moment.js 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074
  1. var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
  2. get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
  3. }) : x)(function(x) {
  4. if (typeof require !== "undefined")
  5. return require.apply(this, arguments);
  6. throw new Error('Dynamic require of "' + x + '" is not supported');
  7. });
  8. // ../../../../Users/Administrator/Desktop/hbuilderXProjects/hlt_app/node_modules/moment/dist/moment.js
  9. var hookCallback;
  10. function hooks() {
  11. return hookCallback.apply(null, arguments);
  12. }
  13. function setHookCallback(callback) {
  14. hookCallback = callback;
  15. }
  16. function isArray(input) {
  17. return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
  18. }
  19. function isObject(input) {
  20. return input != null && Object.prototype.toString.call(input) === "[object Object]";
  21. }
  22. function hasOwnProp(a, b) {
  23. return Object.prototype.hasOwnProperty.call(a, b);
  24. }
  25. function isObjectEmpty(obj) {
  26. if (Object.getOwnPropertyNames) {
  27. return Object.getOwnPropertyNames(obj).length === 0;
  28. } else {
  29. var k;
  30. for (k in obj) {
  31. if (hasOwnProp(obj, k)) {
  32. return false;
  33. }
  34. }
  35. return true;
  36. }
  37. }
  38. function isUndefined(input) {
  39. return input === void 0;
  40. }
  41. function isNumber(input) {
  42. return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
  43. }
  44. function isDate(input) {
  45. return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
  46. }
  47. function map(arr, fn) {
  48. var res = [], i, arrLen = arr.length;
  49. for (i = 0; i < arrLen; ++i) {
  50. res.push(fn(arr[i], i));
  51. }
  52. return res;
  53. }
  54. function extend(a, b) {
  55. for (var i in b) {
  56. if (hasOwnProp(b, i)) {
  57. a[i] = b[i];
  58. }
  59. }
  60. if (hasOwnProp(b, "toString")) {
  61. a.toString = b.toString;
  62. }
  63. if (hasOwnProp(b, "valueOf")) {
  64. a.valueOf = b.valueOf;
  65. }
  66. return a;
  67. }
  68. function createUTC(input, format2, locale2, strict) {
  69. return createLocalOrUTC(input, format2, locale2, strict, true).utc();
  70. }
  71. function defaultParsingFlags() {
  72. return {
  73. empty: false,
  74. unusedTokens: [],
  75. unusedInput: [],
  76. overflow: -2,
  77. charsLeftOver: 0,
  78. nullInput: false,
  79. invalidEra: null,
  80. invalidMonth: null,
  81. invalidFormat: false,
  82. userInvalidated: false,
  83. iso: false,
  84. parsedDateParts: [],
  85. era: null,
  86. meridiem: null,
  87. rfc2822: false,
  88. weekdayMismatch: false
  89. };
  90. }
  91. function getParsingFlags(m) {
  92. if (m._pf == null) {
  93. m._pf = defaultParsingFlags();
  94. }
  95. return m._pf;
  96. }
  97. var some;
  98. if (Array.prototype.some) {
  99. some = Array.prototype.some;
  100. } else {
  101. some = function(fun) {
  102. var t = Object(this), len = t.length >>> 0, i;
  103. for (i = 0; i < len; i++) {
  104. if (i in t && fun.call(this, t[i], i, t)) {
  105. return true;
  106. }
  107. }
  108. return false;
  109. };
  110. }
  111. function isValid(m) {
  112. var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
  113. if (isNowValid) {
  114. flags = getParsingFlags(m);
  115. parsedParts = some.call(flags.parsedDateParts, function(i) {
  116. return i != null;
  117. });
  118. isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
  119. if (m._strict) {
  120. isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
  121. }
  122. }
  123. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  124. m._isValid = isNowValid;
  125. } else {
  126. return isNowValid;
  127. }
  128. return m._isValid;
  129. }
  130. function createInvalid(flags) {
  131. var m = createUTC(NaN);
  132. if (flags != null) {
  133. extend(getParsingFlags(m), flags);
  134. } else {
  135. getParsingFlags(m).userInvalidated = true;
  136. }
  137. return m;
  138. }
  139. var momentProperties = hooks.momentProperties = [];
  140. var updateInProgress = false;
  141. function copyConfig(to2, from2) {
  142. var i, prop, val, momentPropertiesLen = momentProperties.length;
  143. if (!isUndefined(from2._isAMomentObject)) {
  144. to2._isAMomentObject = from2._isAMomentObject;
  145. }
  146. if (!isUndefined(from2._i)) {
  147. to2._i = from2._i;
  148. }
  149. if (!isUndefined(from2._f)) {
  150. to2._f = from2._f;
  151. }
  152. if (!isUndefined(from2._l)) {
  153. to2._l = from2._l;
  154. }
  155. if (!isUndefined(from2._strict)) {
  156. to2._strict = from2._strict;
  157. }
  158. if (!isUndefined(from2._tzm)) {
  159. to2._tzm = from2._tzm;
  160. }
  161. if (!isUndefined(from2._isUTC)) {
  162. to2._isUTC = from2._isUTC;
  163. }
  164. if (!isUndefined(from2._offset)) {
  165. to2._offset = from2._offset;
  166. }
  167. if (!isUndefined(from2._pf)) {
  168. to2._pf = getParsingFlags(from2);
  169. }
  170. if (!isUndefined(from2._locale)) {
  171. to2._locale = from2._locale;
  172. }
  173. if (momentPropertiesLen > 0) {
  174. for (i = 0; i < momentPropertiesLen; i++) {
  175. prop = momentProperties[i];
  176. val = from2[prop];
  177. if (!isUndefined(val)) {
  178. to2[prop] = val;
  179. }
  180. }
  181. }
  182. return to2;
  183. }
  184. function Moment(config) {
  185. copyConfig(this, config);
  186. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  187. if (!this.isValid()) {
  188. this._d = /* @__PURE__ */ new Date(NaN);
  189. }
  190. if (updateInProgress === false) {
  191. updateInProgress = true;
  192. hooks.updateOffset(this);
  193. updateInProgress = false;
  194. }
  195. }
  196. function isMoment(obj) {
  197. return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
  198. }
  199. function warn(msg) {
  200. if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
  201. console.warn("Deprecation warning: " + msg);
  202. }
  203. }
  204. function deprecate(msg, fn) {
  205. var firstTime = true;
  206. return extend(function() {
  207. if (hooks.deprecationHandler != null) {
  208. hooks.deprecationHandler(null, msg);
  209. }
  210. if (firstTime) {
  211. var args = [], arg, i, key, argLen = arguments.length;
  212. for (i = 0; i < argLen; i++) {
  213. arg = "";
  214. if (typeof arguments[i] === "object") {
  215. arg += "\n[" + i + "] ";
  216. for (key in arguments[0]) {
  217. if (hasOwnProp(arguments[0], key)) {
  218. arg += key + ": " + arguments[0][key] + ", ";
  219. }
  220. }
  221. arg = arg.slice(0, -2);
  222. } else {
  223. arg = arguments[i];
  224. }
  225. args.push(arg);
  226. }
  227. warn(
  228. msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
  229. );
  230. firstTime = false;
  231. }
  232. return fn.apply(this, arguments);
  233. }, fn);
  234. }
  235. var deprecations = {};
  236. function deprecateSimple(name, msg) {
  237. if (hooks.deprecationHandler != null) {
  238. hooks.deprecationHandler(name, msg);
  239. }
  240. if (!deprecations[name]) {
  241. warn(msg);
  242. deprecations[name] = true;
  243. }
  244. }
  245. hooks.suppressDeprecationWarnings = false;
  246. hooks.deprecationHandler = null;
  247. function isFunction(input) {
  248. return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
  249. }
  250. function set(config) {
  251. var prop, i;
  252. for (i in config) {
  253. if (hasOwnProp(config, i)) {
  254. prop = config[i];
  255. if (isFunction(prop)) {
  256. this[i] = prop;
  257. } else {
  258. this["_" + i] = prop;
  259. }
  260. }
  261. }
  262. this._config = config;
  263. this._dayOfMonthOrdinalParseLenient = new RegExp(
  264. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
  265. );
  266. }
  267. function mergeConfigs(parentConfig, childConfig) {
  268. var res = extend({}, parentConfig), prop;
  269. for (prop in childConfig) {
  270. if (hasOwnProp(childConfig, prop)) {
  271. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  272. res[prop] = {};
  273. extend(res[prop], parentConfig[prop]);
  274. extend(res[prop], childConfig[prop]);
  275. } else if (childConfig[prop] != null) {
  276. res[prop] = childConfig[prop];
  277. } else {
  278. delete res[prop];
  279. }
  280. }
  281. }
  282. for (prop in parentConfig) {
  283. if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
  284. res[prop] = extend({}, res[prop]);
  285. }
  286. }
  287. return res;
  288. }
  289. function Locale(config) {
  290. if (config != null) {
  291. this.set(config);
  292. }
  293. }
  294. var keys;
  295. if (Object.keys) {
  296. keys = Object.keys;
  297. } else {
  298. keys = function(obj) {
  299. var i, res = [];
  300. for (i in obj) {
  301. if (hasOwnProp(obj, i)) {
  302. res.push(i);
  303. }
  304. }
  305. return res;
  306. };
  307. }
  308. var defaultCalendar = {
  309. sameDay: "[Today at] LT",
  310. nextDay: "[Tomorrow at] LT",
  311. nextWeek: "dddd [at] LT",
  312. lastDay: "[Yesterday at] LT",
  313. lastWeek: "[Last] dddd [at] LT",
  314. sameElse: "L"
  315. };
  316. function calendar(key, mom, now2) {
  317. var output = this._calendar[key] || this._calendar["sameElse"];
  318. return isFunction(output) ? output.call(mom, now2) : output;
  319. }
  320. function zeroFill(number, targetLength, forceSign) {
  321. var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
  322. return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  323. }
  324. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  325. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  326. var formatFunctions = {};
  327. var formatTokenFunctions = {};
  328. function addFormatToken(token2, padded, ordinal2, callback) {
  329. var func = callback;
  330. if (typeof callback === "string") {
  331. func = function() {
  332. return this[callback]();
  333. };
  334. }
  335. if (token2) {
  336. formatTokenFunctions[token2] = func;
  337. }
  338. if (padded) {
  339. formatTokenFunctions[padded[0]] = function() {
  340. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  341. };
  342. }
  343. if (ordinal2) {
  344. formatTokenFunctions[ordinal2] = function() {
  345. return this.localeData().ordinal(
  346. func.apply(this, arguments),
  347. token2
  348. );
  349. };
  350. }
  351. }
  352. function removeFormattingTokens(input) {
  353. if (input.match(/\[[\s\S]/)) {
  354. return input.replace(/^\[|\]$/g, "");
  355. }
  356. return input.replace(/\\/g, "");
  357. }
  358. function makeFormatFunction(format2) {
  359. var array = format2.match(formattingTokens), i, length;
  360. for (i = 0, length = array.length; i < length; i++) {
  361. if (formatTokenFunctions[array[i]]) {
  362. array[i] = formatTokenFunctions[array[i]];
  363. } else {
  364. array[i] = removeFormattingTokens(array[i]);
  365. }
  366. }
  367. return function(mom) {
  368. var output = "", i2;
  369. for (i2 = 0; i2 < length; i2++) {
  370. output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2];
  371. }
  372. return output;
  373. };
  374. }
  375. function formatMoment(m, format2) {
  376. if (!m.isValid()) {
  377. return m.localeData().invalidDate();
  378. }
  379. format2 = expandFormat(format2, m.localeData());
  380. formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
  381. return formatFunctions[format2](m);
  382. }
  383. function expandFormat(format2, locale2) {
  384. var i = 5;
  385. function replaceLongDateFormatTokens(input) {
  386. return locale2.longDateFormat(input) || input;
  387. }
  388. localFormattingTokens.lastIndex = 0;
  389. while (i >= 0 && localFormattingTokens.test(format2)) {
  390. format2 = format2.replace(
  391. localFormattingTokens,
  392. replaceLongDateFormatTokens
  393. );
  394. localFormattingTokens.lastIndex = 0;
  395. i -= 1;
  396. }
  397. return format2;
  398. }
  399. var defaultLongDateFormat = {
  400. LTS: "h:mm:ss A",
  401. LT: "h:mm A",
  402. L: "MM/DD/YYYY",
  403. LL: "MMMM D, YYYY",
  404. LLL: "MMMM D, YYYY h:mm A",
  405. LLLL: "dddd, MMMM D, YYYY h:mm A"
  406. };
  407. function longDateFormat(key) {
  408. var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
  409. if (format2 || !formatUpper) {
  410. return format2;
  411. }
  412. this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
  413. if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
  414. return tok.slice(1);
  415. }
  416. return tok;
  417. }).join("");
  418. return this._longDateFormat[key];
  419. }
  420. var defaultInvalidDate = "Invalid date";
  421. function invalidDate() {
  422. return this._invalidDate;
  423. }
  424. var defaultOrdinal = "%d";
  425. var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  426. function ordinal(number) {
  427. return this._ordinal.replace("%d", number);
  428. }
  429. var defaultRelativeTime = {
  430. future: "in %s",
  431. past: "%s ago",
  432. s: "a few seconds",
  433. ss: "%d seconds",
  434. m: "a minute",
  435. mm: "%d minutes",
  436. h: "an hour",
  437. hh: "%d hours",
  438. d: "a day",
  439. dd: "%d days",
  440. w: "a week",
  441. ww: "%d weeks",
  442. M: "a month",
  443. MM: "%d months",
  444. y: "a year",
  445. yy: "%d years"
  446. };
  447. function relativeTime(number, withoutSuffix, string, isFuture) {
  448. var output = this._relativeTime[string];
  449. return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
  450. }
  451. function pastFuture(diff2, output) {
  452. var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
  453. return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
  454. }
  455. var aliases = {
  456. D: "date",
  457. dates: "date",
  458. date: "date",
  459. d: "day",
  460. days: "day",
  461. day: "day",
  462. e: "weekday",
  463. weekdays: "weekday",
  464. weekday: "weekday",
  465. E: "isoWeekday",
  466. isoweekdays: "isoWeekday",
  467. isoweekday: "isoWeekday",
  468. DDD: "dayOfYear",
  469. dayofyears: "dayOfYear",
  470. dayofyear: "dayOfYear",
  471. h: "hour",
  472. hours: "hour",
  473. hour: "hour",
  474. ms: "millisecond",
  475. milliseconds: "millisecond",
  476. millisecond: "millisecond",
  477. m: "minute",
  478. minutes: "minute",
  479. minute: "minute",
  480. M: "month",
  481. months: "month",
  482. month: "month",
  483. Q: "quarter",
  484. quarters: "quarter",
  485. quarter: "quarter",
  486. s: "second",
  487. seconds: "second",
  488. second: "second",
  489. gg: "weekYear",
  490. weekyears: "weekYear",
  491. weekyear: "weekYear",
  492. GG: "isoWeekYear",
  493. isoweekyears: "isoWeekYear",
  494. isoweekyear: "isoWeekYear",
  495. w: "week",
  496. weeks: "week",
  497. week: "week",
  498. W: "isoWeek",
  499. isoweeks: "isoWeek",
  500. isoweek: "isoWeek",
  501. y: "year",
  502. years: "year",
  503. year: "year"
  504. };
  505. function normalizeUnits(units) {
  506. return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
  507. }
  508. function normalizeObjectUnits(inputObject) {
  509. var normalizedInput = {}, normalizedProp, prop;
  510. for (prop in inputObject) {
  511. if (hasOwnProp(inputObject, prop)) {
  512. normalizedProp = normalizeUnits(prop);
  513. if (normalizedProp) {
  514. normalizedInput[normalizedProp] = inputObject[prop];
  515. }
  516. }
  517. }
  518. return normalizedInput;
  519. }
  520. var priorities = {
  521. date: 9,
  522. day: 11,
  523. weekday: 11,
  524. isoWeekday: 11,
  525. dayOfYear: 4,
  526. hour: 13,
  527. millisecond: 16,
  528. minute: 14,
  529. month: 8,
  530. quarter: 7,
  531. second: 15,
  532. weekYear: 1,
  533. isoWeekYear: 1,
  534. week: 5,
  535. isoWeek: 5,
  536. year: 1
  537. };
  538. function getPrioritizedUnits(unitsObj) {
  539. var units = [], u;
  540. for (u in unitsObj) {
  541. if (hasOwnProp(unitsObj, u)) {
  542. units.push({ unit: u, priority: priorities[u] });
  543. }
  544. }
  545. units.sort(function(a, b) {
  546. return a.priority - b.priority;
  547. });
  548. return units;
  549. }
  550. var match1 = /\d/;
  551. var match2 = /\d\d/;
  552. var match3 = /\d{3}/;
  553. var match4 = /\d{4}/;
  554. var match6 = /[+-]?\d{6}/;
  555. var match1to2 = /\d\d?/;
  556. var match3to4 = /\d\d\d\d?/;
  557. var match5to6 = /\d\d\d\d\d\d?/;
  558. var match1to3 = /\d{1,3}/;
  559. var match1to4 = /\d{1,4}/;
  560. var match1to6 = /[+-]?\d{1,6}/;
  561. var matchUnsigned = /\d+/;
  562. var matchSigned = /[+-]?\d+/;
  563. var matchOffset = /Z|[+-]\d\d:?\d\d/gi;
  564. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi;
  565. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
  566. var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
  567. var match1to2NoLeadingZero = /^[1-9]\d?/;
  568. var match1to2HasZero = /^([1-9]\d|\d)/;
  569. var regexes;
  570. regexes = {};
  571. function addRegexToken(token2, regex, strictRegex) {
  572. regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
  573. return isStrict && strictRegex ? strictRegex : regex;
  574. };
  575. }
  576. function getParseRegexForToken(token2, config) {
  577. if (!hasOwnProp(regexes, token2)) {
  578. return new RegExp(unescapeFormat(token2));
  579. }
  580. return regexes[token2](config._strict, config._locale);
  581. }
  582. function unescapeFormat(s) {
  583. return regexEscape(
  584. s.replace("\\", "").replace(
  585. /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
  586. function(matched, p1, p2, p3, p4) {
  587. return p1 || p2 || p3 || p4;
  588. }
  589. )
  590. );
  591. }
  592. function regexEscape(s) {
  593. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
  594. }
  595. function absFloor(number) {
  596. if (number < 0) {
  597. return Math.ceil(number) || 0;
  598. } else {
  599. return Math.floor(number);
  600. }
  601. }
  602. function toInt(argumentForCoercion) {
  603. var coercedNumber = +argumentForCoercion, value = 0;
  604. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  605. value = absFloor(coercedNumber);
  606. }
  607. return value;
  608. }
  609. var tokens = {};
  610. function addParseToken(token2, callback) {
  611. var i, func = callback, tokenLen;
  612. if (typeof token2 === "string") {
  613. token2 = [token2];
  614. }
  615. if (isNumber(callback)) {
  616. func = function(input, array) {
  617. array[callback] = toInt(input);
  618. };
  619. }
  620. tokenLen = token2.length;
  621. for (i = 0; i < tokenLen; i++) {
  622. tokens[token2[i]] = func;
  623. }
  624. }
  625. function addWeekParseToken(token2, callback) {
  626. addParseToken(token2, function(input, array, config, token3) {
  627. config._w = config._w || {};
  628. callback(input, config._w, config, token3);
  629. });
  630. }
  631. function addTimeToArrayFromToken(token2, input, config) {
  632. if (input != null && hasOwnProp(tokens, token2)) {
  633. tokens[token2](input, config._a, config, token2);
  634. }
  635. }
  636. function isLeapYear(year) {
  637. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  638. }
  639. var YEAR = 0;
  640. var MONTH = 1;
  641. var DATE = 2;
  642. var HOUR = 3;
  643. var MINUTE = 4;
  644. var SECOND = 5;
  645. var MILLISECOND = 6;
  646. var WEEK = 7;
  647. var WEEKDAY = 8;
  648. addFormatToken("Y", 0, 0, function() {
  649. var y = this.year();
  650. return y <= 9999 ? zeroFill(y, 4) : "+" + y;
  651. });
  652. addFormatToken(0, ["YY", 2], 0, function() {
  653. return this.year() % 100;
  654. });
  655. addFormatToken(0, ["YYYY", 4], 0, "year");
  656. addFormatToken(0, ["YYYYY", 5], 0, "year");
  657. addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
  658. addRegexToken("Y", matchSigned);
  659. addRegexToken("YY", match1to2, match2);
  660. addRegexToken("YYYY", match1to4, match4);
  661. addRegexToken("YYYYY", match1to6, match6);
  662. addRegexToken("YYYYYY", match1to6, match6);
  663. addParseToken(["YYYYY", "YYYYYY"], YEAR);
  664. addParseToken("YYYY", function(input, array) {
  665. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  666. });
  667. addParseToken("YY", function(input, array) {
  668. array[YEAR] = hooks.parseTwoDigitYear(input);
  669. });
  670. addParseToken("Y", function(input, array) {
  671. array[YEAR] = parseInt(input, 10);
  672. });
  673. function daysInYear(year) {
  674. return isLeapYear(year) ? 366 : 365;
  675. }
  676. hooks.parseTwoDigitYear = function(input) {
  677. return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
  678. };
  679. var getSetYear = makeGetSet("FullYear", true);
  680. function getIsLeapYear() {
  681. return isLeapYear(this.year());
  682. }
  683. function makeGetSet(unit, keepTime) {
  684. return function(value) {
  685. if (value != null) {
  686. set$1(this, unit, value);
  687. hooks.updateOffset(this, keepTime);
  688. return this;
  689. } else {
  690. return get(this, unit);
  691. }
  692. };
  693. }
  694. function get(mom, unit) {
  695. if (!mom.isValid()) {
  696. return NaN;
  697. }
  698. var d = mom._d, isUTC = mom._isUTC;
  699. switch (unit) {
  700. case "Milliseconds":
  701. return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
  702. case "Seconds":
  703. return isUTC ? d.getUTCSeconds() : d.getSeconds();
  704. case "Minutes":
  705. return isUTC ? d.getUTCMinutes() : d.getMinutes();
  706. case "Hours":
  707. return isUTC ? d.getUTCHours() : d.getHours();
  708. case "Date":
  709. return isUTC ? d.getUTCDate() : d.getDate();
  710. case "Day":
  711. return isUTC ? d.getUTCDay() : d.getDay();
  712. case "Month":
  713. return isUTC ? d.getUTCMonth() : d.getMonth();
  714. case "FullYear":
  715. return isUTC ? d.getUTCFullYear() : d.getFullYear();
  716. default:
  717. return NaN;
  718. }
  719. }
  720. function set$1(mom, unit, value) {
  721. var d, isUTC, year, month, date;
  722. if (!mom.isValid() || isNaN(value)) {
  723. return;
  724. }
  725. d = mom._d;
  726. isUTC = mom._isUTC;
  727. switch (unit) {
  728. case "Milliseconds":
  729. return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
  730. case "Seconds":
  731. return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
  732. case "Minutes":
  733. return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
  734. case "Hours":
  735. return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
  736. case "Date":
  737. return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
  738. case "FullYear":
  739. break;
  740. default:
  741. return;
  742. }
  743. year = value;
  744. month = mom.month();
  745. date = mom.date();
  746. date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
  747. void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
  748. }
  749. function stringGet(units) {
  750. units = normalizeUnits(units);
  751. if (isFunction(this[units])) {
  752. return this[units]();
  753. }
  754. return this;
  755. }
  756. function stringSet(units, value) {
  757. if (typeof units === "object") {
  758. units = normalizeObjectUnits(units);
  759. var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
  760. for (i = 0; i < prioritizedLen; i++) {
  761. this[prioritized[i].unit](units[prioritized[i].unit]);
  762. }
  763. } else {
  764. units = normalizeUnits(units);
  765. if (isFunction(this[units])) {
  766. return this[units](value);
  767. }
  768. }
  769. return this;
  770. }
  771. function mod(n, x) {
  772. return (n % x + x) % x;
  773. }
  774. var indexOf;
  775. if (Array.prototype.indexOf) {
  776. indexOf = Array.prototype.indexOf;
  777. } else {
  778. indexOf = function(o) {
  779. var i;
  780. for (i = 0; i < this.length; ++i) {
  781. if (this[i] === o) {
  782. return i;
  783. }
  784. }
  785. return -1;
  786. };
  787. }
  788. function daysInMonth(year, month) {
  789. if (isNaN(year) || isNaN(month)) {
  790. return NaN;
  791. }
  792. var modMonth = mod(month, 12);
  793. year += (month - modMonth) / 12;
  794. return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
  795. }
  796. addFormatToken("M", ["MM", 2], "Mo", function() {
  797. return this.month() + 1;
  798. });
  799. addFormatToken("MMM", 0, 0, function(format2) {
  800. return this.localeData().monthsShort(this, format2);
  801. });
  802. addFormatToken("MMMM", 0, 0, function(format2) {
  803. return this.localeData().months(this, format2);
  804. });
  805. addRegexToken("M", match1to2, match1to2NoLeadingZero);
  806. addRegexToken("MM", match1to2, match2);
  807. addRegexToken("MMM", function(isStrict, locale2) {
  808. return locale2.monthsShortRegex(isStrict);
  809. });
  810. addRegexToken("MMMM", function(isStrict, locale2) {
  811. return locale2.monthsRegex(isStrict);
  812. });
  813. addParseToken(["M", "MM"], function(input, array) {
  814. array[MONTH] = toInt(input) - 1;
  815. });
  816. addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
  817. var month = config._locale.monthsParse(input, token2, config._strict);
  818. if (month != null) {
  819. array[MONTH] = month;
  820. } else {
  821. getParsingFlags(config).invalidMonth = input;
  822. }
  823. });
  824. var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
  825. "_"
  826. );
  827. var defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");
  828. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  829. var defaultMonthsShortRegex = matchWord;
  830. var defaultMonthsRegex = matchWord;
  831. function localeMonths(m, format2) {
  832. if (!m) {
  833. return isArray(this._months) ? this._months : this._months["standalone"];
  834. }
  835. return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()];
  836. }
  837. function localeMonthsShort(m, format2) {
  838. if (!m) {
  839. return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
  840. }
  841. return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
  842. }
  843. function handleStrictParse(monthName, format2, strict) {
  844. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  845. if (!this._monthsParse) {
  846. this._monthsParse = [];
  847. this._longMonthsParse = [];
  848. this._shortMonthsParse = [];
  849. for (i = 0; i < 12; ++i) {
  850. mom = createUTC([2e3, i]);
  851. this._shortMonthsParse[i] = this.monthsShort(
  852. mom,
  853. ""
  854. ).toLocaleLowerCase();
  855. this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase();
  856. }
  857. }
  858. if (strict) {
  859. if (format2 === "MMM") {
  860. ii = indexOf.call(this._shortMonthsParse, llc);
  861. return ii !== -1 ? ii : null;
  862. } else {
  863. ii = indexOf.call(this._longMonthsParse, llc);
  864. return ii !== -1 ? ii : null;
  865. }
  866. } else {
  867. if (format2 === "MMM") {
  868. ii = indexOf.call(this._shortMonthsParse, llc);
  869. if (ii !== -1) {
  870. return ii;
  871. }
  872. ii = indexOf.call(this._longMonthsParse, llc);
  873. return ii !== -1 ? ii : null;
  874. } else {
  875. ii = indexOf.call(this._longMonthsParse, llc);
  876. if (ii !== -1) {
  877. return ii;
  878. }
  879. ii = indexOf.call(this._shortMonthsParse, llc);
  880. return ii !== -1 ? ii : null;
  881. }
  882. }
  883. }
  884. function localeMonthsParse(monthName, format2, strict) {
  885. var i, mom, regex;
  886. if (this._monthsParseExact) {
  887. return handleStrictParse.call(this, monthName, format2, strict);
  888. }
  889. if (!this._monthsParse) {
  890. this._monthsParse = [];
  891. this._longMonthsParse = [];
  892. this._shortMonthsParse = [];
  893. }
  894. for (i = 0; i < 12; i++) {
  895. mom = createUTC([2e3, i]);
  896. if (strict && !this._longMonthsParse[i]) {
  897. this._longMonthsParse[i] = new RegExp(
  898. "^" + this.months(mom, "").replace(".", "") + "$",
  899. "i"
  900. );
  901. this._shortMonthsParse[i] = new RegExp(
  902. "^" + this.monthsShort(mom, "").replace(".", "") + "$",
  903. "i"
  904. );
  905. }
  906. if (!strict && !this._monthsParse[i]) {
  907. regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
  908. this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i");
  909. }
  910. if (strict && format2 === "MMMM" && this._longMonthsParse[i].test(monthName)) {
  911. return i;
  912. } else if (strict && format2 === "MMM" && this._shortMonthsParse[i].test(monthName)) {
  913. return i;
  914. } else if (!strict && this._monthsParse[i].test(monthName)) {
  915. return i;
  916. }
  917. }
  918. }
  919. function setMonth(mom, value) {
  920. if (!mom.isValid()) {
  921. return mom;
  922. }
  923. if (typeof value === "string") {
  924. if (/^\d+$/.test(value)) {
  925. value = toInt(value);
  926. } else {
  927. value = mom.localeData().monthsParse(value);
  928. if (!isNumber(value)) {
  929. return mom;
  930. }
  931. }
  932. }
  933. var month = value, date = mom.date();
  934. date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
  935. void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
  936. return mom;
  937. }
  938. function getSetMonth(value) {
  939. if (value != null) {
  940. setMonth(this, value);
  941. hooks.updateOffset(this, true);
  942. return this;
  943. } else {
  944. return get(this, "Month");
  945. }
  946. }
  947. function getDaysInMonth() {
  948. return daysInMonth(this.year(), this.month());
  949. }
  950. function monthsShortRegex(isStrict) {
  951. if (this._monthsParseExact) {
  952. if (!hasOwnProp(this, "_monthsRegex")) {
  953. computeMonthsParse.call(this);
  954. }
  955. if (isStrict) {
  956. return this._monthsShortStrictRegex;
  957. } else {
  958. return this._monthsShortRegex;
  959. }
  960. } else {
  961. if (!hasOwnProp(this, "_monthsShortRegex")) {
  962. this._monthsShortRegex = defaultMonthsShortRegex;
  963. }
  964. return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
  965. }
  966. }
  967. function monthsRegex(isStrict) {
  968. if (this._monthsParseExact) {
  969. if (!hasOwnProp(this, "_monthsRegex")) {
  970. computeMonthsParse.call(this);
  971. }
  972. if (isStrict) {
  973. return this._monthsStrictRegex;
  974. } else {
  975. return this._monthsRegex;
  976. }
  977. } else {
  978. if (!hasOwnProp(this, "_monthsRegex")) {
  979. this._monthsRegex = defaultMonthsRegex;
  980. }
  981. return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
  982. }
  983. }
  984. function computeMonthsParse() {
  985. function cmpLenRev(a, b) {
  986. return b.length - a.length;
  987. }
  988. var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP;
  989. for (i = 0; i < 12; i++) {
  990. mom = createUTC([2e3, i]);
  991. shortP = regexEscape(this.monthsShort(mom, ""));
  992. longP = regexEscape(this.months(mom, ""));
  993. shortPieces.push(shortP);
  994. longPieces.push(longP);
  995. mixedPieces.push(longP);
  996. mixedPieces.push(shortP);
  997. }
  998. shortPieces.sort(cmpLenRev);
  999. longPieces.sort(cmpLenRev);
  1000. mixedPieces.sort(cmpLenRev);
  1001. this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  1002. this._monthsShortRegex = this._monthsRegex;
  1003. this._monthsStrictRegex = new RegExp(
  1004. "^(" + longPieces.join("|") + ")",
  1005. "i"
  1006. );
  1007. this._monthsShortStrictRegex = new RegExp(
  1008. "^(" + shortPieces.join("|") + ")",
  1009. "i"
  1010. );
  1011. }
  1012. function createDate(y, m, d, h, M, s, ms) {
  1013. var date;
  1014. if (y < 100 && y >= 0) {
  1015. date = new Date(y + 400, m, d, h, M, s, ms);
  1016. if (isFinite(date.getFullYear())) {
  1017. date.setFullYear(y);
  1018. }
  1019. } else {
  1020. date = new Date(y, m, d, h, M, s, ms);
  1021. }
  1022. return date;
  1023. }
  1024. function createUTCDate(y) {
  1025. var date, args;
  1026. if (y < 100 && y >= 0) {
  1027. args = Array.prototype.slice.call(arguments);
  1028. args[0] = y + 400;
  1029. date = new Date(Date.UTC.apply(null, args));
  1030. if (isFinite(date.getUTCFullYear())) {
  1031. date.setUTCFullYear(y);
  1032. }
  1033. } else {
  1034. date = new Date(Date.UTC.apply(null, arguments));
  1035. }
  1036. return date;
  1037. }
  1038. function firstWeekOffset(year, dow, doy) {
  1039. var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1040. return -fwdlw + fwd - 1;
  1041. }
  1042. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1043. var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
  1044. if (dayOfYear <= 0) {
  1045. resYear = year - 1;
  1046. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1047. } else if (dayOfYear > daysInYear(year)) {
  1048. resYear = year + 1;
  1049. resDayOfYear = dayOfYear - daysInYear(year);
  1050. } else {
  1051. resYear = year;
  1052. resDayOfYear = dayOfYear;
  1053. }
  1054. return {
  1055. year: resYear,
  1056. dayOfYear: resDayOfYear
  1057. };
  1058. }
  1059. function weekOfYear(mom, dow, doy) {
  1060. var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
  1061. if (week < 1) {
  1062. resYear = mom.year() - 1;
  1063. resWeek = week + weeksInYear(resYear, dow, doy);
  1064. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1065. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1066. resYear = mom.year() + 1;
  1067. } else {
  1068. resYear = mom.year();
  1069. resWeek = week;
  1070. }
  1071. return {
  1072. week: resWeek,
  1073. year: resYear
  1074. };
  1075. }
  1076. function weeksInYear(year, dow, doy) {
  1077. var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1078. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1079. }
  1080. addFormatToken("w", ["ww", 2], "wo", "week");
  1081. addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
  1082. addRegexToken("w", match1to2, match1to2NoLeadingZero);
  1083. addRegexToken("ww", match1to2, match2);
  1084. addRegexToken("W", match1to2, match1to2NoLeadingZero);
  1085. addRegexToken("WW", match1to2, match2);
  1086. addWeekParseToken(
  1087. ["w", "ww", "W", "WW"],
  1088. function(input, week, config, token2) {
  1089. week[token2.substr(0, 1)] = toInt(input);
  1090. }
  1091. );
  1092. function localeWeek(mom) {
  1093. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  1094. }
  1095. var defaultLocaleWeek = {
  1096. dow: 0,
  1097. // Sunday is the first day of the week.
  1098. doy: 6
  1099. // The week that contains Jan 6th is the first week of the year.
  1100. };
  1101. function localeFirstDayOfWeek() {
  1102. return this._week.dow;
  1103. }
  1104. function localeFirstDayOfYear() {
  1105. return this._week.doy;
  1106. }
  1107. function getSetWeek(input) {
  1108. var week = this.localeData().week(this);
  1109. return input == null ? week : this.add((input - week) * 7, "d");
  1110. }
  1111. function getSetISOWeek(input) {
  1112. var week = weekOfYear(this, 1, 4).week;
  1113. return input == null ? week : this.add((input - week) * 7, "d");
  1114. }
  1115. addFormatToken("d", 0, "do", "day");
  1116. addFormatToken("dd", 0, 0, function(format2) {
  1117. return this.localeData().weekdaysMin(this, format2);
  1118. });
  1119. addFormatToken("ddd", 0, 0, function(format2) {
  1120. return this.localeData().weekdaysShort(this, format2);
  1121. });
  1122. addFormatToken("dddd", 0, 0, function(format2) {
  1123. return this.localeData().weekdays(this, format2);
  1124. });
  1125. addFormatToken("e", 0, 0, "weekday");
  1126. addFormatToken("E", 0, 0, "isoWeekday");
  1127. addRegexToken("d", match1to2);
  1128. addRegexToken("e", match1to2);
  1129. addRegexToken("E", match1to2);
  1130. addRegexToken("dd", function(isStrict, locale2) {
  1131. return locale2.weekdaysMinRegex(isStrict);
  1132. });
  1133. addRegexToken("ddd", function(isStrict, locale2) {
  1134. return locale2.weekdaysShortRegex(isStrict);
  1135. });
  1136. addRegexToken("dddd", function(isStrict, locale2) {
  1137. return locale2.weekdaysRegex(isStrict);
  1138. });
  1139. addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) {
  1140. var weekday = config._locale.weekdaysParse(input, token2, config._strict);
  1141. if (weekday != null) {
  1142. week.d = weekday;
  1143. } else {
  1144. getParsingFlags(config).invalidWeekday = input;
  1145. }
  1146. });
  1147. addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
  1148. week[token2] = toInt(input);
  1149. });
  1150. function parseWeekday(input, locale2) {
  1151. if (typeof input !== "string") {
  1152. return input;
  1153. }
  1154. if (!isNaN(input)) {
  1155. return parseInt(input, 10);
  1156. }
  1157. input = locale2.weekdaysParse(input);
  1158. if (typeof input === "number") {
  1159. return input;
  1160. }
  1161. return null;
  1162. }
  1163. function parseIsoWeekday(input, locale2) {
  1164. if (typeof input === "string") {
  1165. return locale2.weekdaysParse(input) % 7 || 7;
  1166. }
  1167. return isNaN(input) ? null : input;
  1168. }
  1169. function shiftWeekdays(ws, n) {
  1170. return ws.slice(n, 7).concat(ws.slice(0, n));
  1171. }
  1172. var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");
  1173. var defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");
  1174. var defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
  1175. var defaultWeekdaysRegex = matchWord;
  1176. var defaultWeekdaysShortRegex = matchWord;
  1177. var defaultWeekdaysMinRegex = matchWord;
  1178. function localeWeekdays(m, format2) {
  1179. var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
  1180. return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
  1181. }
  1182. function localeWeekdaysShort(m) {
  1183. return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  1184. }
  1185. function localeWeekdaysMin(m) {
  1186. return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  1187. }
  1188. function handleStrictParse$1(weekdayName, format2, strict) {
  1189. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  1190. if (!this._weekdaysParse) {
  1191. this._weekdaysParse = [];
  1192. this._shortWeekdaysParse = [];
  1193. this._minWeekdaysParse = [];
  1194. for (i = 0; i < 7; ++i) {
  1195. mom = createUTC([2e3, 1]).day(i);
  1196. this._minWeekdaysParse[i] = this.weekdaysMin(
  1197. mom,
  1198. ""
  1199. ).toLocaleLowerCase();
  1200. this._shortWeekdaysParse[i] = this.weekdaysShort(
  1201. mom,
  1202. ""
  1203. ).toLocaleLowerCase();
  1204. this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase();
  1205. }
  1206. }
  1207. if (strict) {
  1208. if (format2 === "dddd") {
  1209. ii = indexOf.call(this._weekdaysParse, llc);
  1210. return ii !== -1 ? ii : null;
  1211. } else if (format2 === "ddd") {
  1212. ii = indexOf.call(this._shortWeekdaysParse, llc);
  1213. return ii !== -1 ? ii : null;
  1214. } else {
  1215. ii = indexOf.call(this._minWeekdaysParse, llc);
  1216. return ii !== -1 ? ii : null;
  1217. }
  1218. } else {
  1219. if (format2 === "dddd") {
  1220. ii = indexOf.call(this._weekdaysParse, llc);
  1221. if (ii !== -1) {
  1222. return ii;
  1223. }
  1224. ii = indexOf.call(this._shortWeekdaysParse, llc);
  1225. if (ii !== -1) {
  1226. return ii;
  1227. }
  1228. ii = indexOf.call(this._minWeekdaysParse, llc);
  1229. return ii !== -1 ? ii : null;
  1230. } else if (format2 === "ddd") {
  1231. ii = indexOf.call(this._shortWeekdaysParse, llc);
  1232. if (ii !== -1) {
  1233. return ii;
  1234. }
  1235. ii = indexOf.call(this._weekdaysParse, llc);
  1236. if (ii !== -1) {
  1237. return ii;
  1238. }
  1239. ii = indexOf.call(this._minWeekdaysParse, llc);
  1240. return ii !== -1 ? ii : null;
  1241. } else {
  1242. ii = indexOf.call(this._minWeekdaysParse, llc);
  1243. if (ii !== -1) {
  1244. return ii;
  1245. }
  1246. ii = indexOf.call(this._weekdaysParse, llc);
  1247. if (ii !== -1) {
  1248. return ii;
  1249. }
  1250. ii = indexOf.call(this._shortWeekdaysParse, llc);
  1251. return ii !== -1 ? ii : null;
  1252. }
  1253. }
  1254. }
  1255. function localeWeekdaysParse(weekdayName, format2, strict) {
  1256. var i, mom, regex;
  1257. if (this._weekdaysParseExact) {
  1258. return handleStrictParse$1.call(this, weekdayName, format2, strict);
  1259. }
  1260. if (!this._weekdaysParse) {
  1261. this._weekdaysParse = [];
  1262. this._minWeekdaysParse = [];
  1263. this._shortWeekdaysParse = [];
  1264. this._fullWeekdaysParse = [];
  1265. }
  1266. for (i = 0; i < 7; i++) {
  1267. mom = createUTC([2e3, 1]).day(i);
  1268. if (strict && !this._fullWeekdaysParse[i]) {
  1269. this._fullWeekdaysParse[i] = new RegExp(
  1270. "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
  1271. "i"
  1272. );
  1273. this._shortWeekdaysParse[i] = new RegExp(
  1274. "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
  1275. "i"
  1276. );
  1277. this._minWeekdaysParse[i] = new RegExp(
  1278. "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
  1279. "i"
  1280. );
  1281. }
  1282. if (!this._weekdaysParse[i]) {
  1283. regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
  1284. this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i");
  1285. }
  1286. if (strict && format2 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) {
  1287. return i;
  1288. } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) {
  1289. return i;
  1290. } else if (strict && format2 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) {
  1291. return i;
  1292. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  1293. return i;
  1294. }
  1295. }
  1296. }
  1297. function getSetDayOfWeek(input) {
  1298. if (!this.isValid()) {
  1299. return input != null ? this : NaN;
  1300. }
  1301. var day = get(this, "Day");
  1302. if (input != null) {
  1303. input = parseWeekday(input, this.localeData());
  1304. return this.add(input - day, "d");
  1305. } else {
  1306. return day;
  1307. }
  1308. }
  1309. function getSetLocaleDayOfWeek(input) {
  1310. if (!this.isValid()) {
  1311. return input != null ? this : NaN;
  1312. }
  1313. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  1314. return input == null ? weekday : this.add(input - weekday, "d");
  1315. }
  1316. function getSetISODayOfWeek(input) {
  1317. if (!this.isValid()) {
  1318. return input != null ? this : NaN;
  1319. }
  1320. if (input != null) {
  1321. var weekday = parseIsoWeekday(input, this.localeData());
  1322. return this.day(this.day() % 7 ? weekday : weekday - 7);
  1323. } else {
  1324. return this.day() || 7;
  1325. }
  1326. }
  1327. function weekdaysRegex(isStrict) {
  1328. if (this._weekdaysParseExact) {
  1329. if (!hasOwnProp(this, "_weekdaysRegex")) {
  1330. computeWeekdaysParse.call(this);
  1331. }
  1332. if (isStrict) {
  1333. return this._weekdaysStrictRegex;
  1334. } else {
  1335. return this._weekdaysRegex;
  1336. }
  1337. } else {
  1338. if (!hasOwnProp(this, "_weekdaysRegex")) {
  1339. this._weekdaysRegex = defaultWeekdaysRegex;
  1340. }
  1341. return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
  1342. }
  1343. }
  1344. function weekdaysShortRegex(isStrict) {
  1345. if (this._weekdaysParseExact) {
  1346. if (!hasOwnProp(this, "_weekdaysRegex")) {
  1347. computeWeekdaysParse.call(this);
  1348. }
  1349. if (isStrict) {
  1350. return this._weekdaysShortStrictRegex;
  1351. } else {
  1352. return this._weekdaysShortRegex;
  1353. }
  1354. } else {
  1355. if (!hasOwnProp(this, "_weekdaysShortRegex")) {
  1356. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  1357. }
  1358. return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  1359. }
  1360. }
  1361. function weekdaysMinRegex(isStrict) {
  1362. if (this._weekdaysParseExact) {
  1363. if (!hasOwnProp(this, "_weekdaysRegex")) {
  1364. computeWeekdaysParse.call(this);
  1365. }
  1366. if (isStrict) {
  1367. return this._weekdaysMinStrictRegex;
  1368. } else {
  1369. return this._weekdaysMinRegex;
  1370. }
  1371. } else {
  1372. if (!hasOwnProp(this, "_weekdaysMinRegex")) {
  1373. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  1374. }
  1375. return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  1376. }
  1377. }
  1378. function computeWeekdaysParse() {
  1379. function cmpLenRev(a, b) {
  1380. return b.length - a.length;
  1381. }
  1382. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp;
  1383. for (i = 0; i < 7; i++) {
  1384. mom = createUTC([2e3, 1]).day(i);
  1385. minp = regexEscape(this.weekdaysMin(mom, ""));
  1386. shortp = regexEscape(this.weekdaysShort(mom, ""));
  1387. longp = regexEscape(this.weekdays(mom, ""));
  1388. minPieces.push(minp);
  1389. shortPieces.push(shortp);
  1390. longPieces.push(longp);
  1391. mixedPieces.push(minp);
  1392. mixedPieces.push(shortp);
  1393. mixedPieces.push(longp);
  1394. }
  1395. minPieces.sort(cmpLenRev);
  1396. shortPieces.sort(cmpLenRev);
  1397. longPieces.sort(cmpLenRev);
  1398. mixedPieces.sort(cmpLenRev);
  1399. this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  1400. this._weekdaysShortRegex = this._weekdaysRegex;
  1401. this._weekdaysMinRegex = this._weekdaysRegex;
  1402. this._weekdaysStrictRegex = new RegExp(
  1403. "^(" + longPieces.join("|") + ")",
  1404. "i"
  1405. );
  1406. this._weekdaysShortStrictRegex = new RegExp(
  1407. "^(" + shortPieces.join("|") + ")",
  1408. "i"
  1409. );
  1410. this._weekdaysMinStrictRegex = new RegExp(
  1411. "^(" + minPieces.join("|") + ")",
  1412. "i"
  1413. );
  1414. }
  1415. function hFormat() {
  1416. return this.hours() % 12 || 12;
  1417. }
  1418. function kFormat() {
  1419. return this.hours() || 24;
  1420. }
  1421. addFormatToken("H", ["HH", 2], 0, "hour");
  1422. addFormatToken("h", ["hh", 2], 0, hFormat);
  1423. addFormatToken("k", ["kk", 2], 0, kFormat);
  1424. addFormatToken("hmm", 0, 0, function() {
  1425. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  1426. });
  1427. addFormatToken("hmmss", 0, 0, function() {
  1428. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  1429. });
  1430. addFormatToken("Hmm", 0, 0, function() {
  1431. return "" + this.hours() + zeroFill(this.minutes(), 2);
  1432. });
  1433. addFormatToken("Hmmss", 0, 0, function() {
  1434. return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  1435. });
  1436. function meridiem(token2, lowercase) {
  1437. addFormatToken(token2, 0, 0, function() {
  1438. return this.localeData().meridiem(
  1439. this.hours(),
  1440. this.minutes(),
  1441. lowercase
  1442. );
  1443. });
  1444. }
  1445. meridiem("a", true);
  1446. meridiem("A", false);
  1447. function matchMeridiem(isStrict, locale2) {
  1448. return locale2._meridiemParse;
  1449. }
  1450. addRegexToken("a", matchMeridiem);
  1451. addRegexToken("A", matchMeridiem);
  1452. addRegexToken("H", match1to2, match1to2HasZero);
  1453. addRegexToken("h", match1to2, match1to2NoLeadingZero);
  1454. addRegexToken("k", match1to2, match1to2NoLeadingZero);
  1455. addRegexToken("HH", match1to2, match2);
  1456. addRegexToken("hh", match1to2, match2);
  1457. addRegexToken("kk", match1to2, match2);
  1458. addRegexToken("hmm", match3to4);
  1459. addRegexToken("hmmss", match5to6);
  1460. addRegexToken("Hmm", match3to4);
  1461. addRegexToken("Hmmss", match5to6);
  1462. addParseToken(["H", "HH"], HOUR);
  1463. addParseToken(["k", "kk"], function(input, array, config) {
  1464. var kInput = toInt(input);
  1465. array[HOUR] = kInput === 24 ? 0 : kInput;
  1466. });
  1467. addParseToken(["a", "A"], function(input, array, config) {
  1468. config._isPm = config._locale.isPM(input);
  1469. config._meridiem = input;
  1470. });
  1471. addParseToken(["h", "hh"], function(input, array, config) {
  1472. array[HOUR] = toInt(input);
  1473. getParsingFlags(config).bigHour = true;
  1474. });
  1475. addParseToken("hmm", function(input, array, config) {
  1476. var pos = input.length - 2;
  1477. array[HOUR] = toInt(input.substr(0, pos));
  1478. array[MINUTE] = toInt(input.substr(pos));
  1479. getParsingFlags(config).bigHour = true;
  1480. });
  1481. addParseToken("hmmss", function(input, array, config) {
  1482. var pos1 = input.length - 4, pos2 = input.length - 2;
  1483. array[HOUR] = toInt(input.substr(0, pos1));
  1484. array[MINUTE] = toInt(input.substr(pos1, 2));
  1485. array[SECOND] = toInt(input.substr(pos2));
  1486. getParsingFlags(config).bigHour = true;
  1487. });
  1488. addParseToken("Hmm", function(input, array, config) {
  1489. var pos = input.length - 2;
  1490. array[HOUR] = toInt(input.substr(0, pos));
  1491. array[MINUTE] = toInt(input.substr(pos));
  1492. });
  1493. addParseToken("Hmmss", function(input, array, config) {
  1494. var pos1 = input.length - 4, pos2 = input.length - 2;
  1495. array[HOUR] = toInt(input.substr(0, pos1));
  1496. array[MINUTE] = toInt(input.substr(pos1, 2));
  1497. array[SECOND] = toInt(input.substr(pos2));
  1498. });
  1499. function localeIsPM(input) {
  1500. return (input + "").toLowerCase().charAt(0) === "p";
  1501. }
  1502. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  1503. var getSetHour = makeGetSet("Hours", true);
  1504. function localeMeridiem(hours2, minutes2, isLower) {
  1505. if (hours2 > 11) {
  1506. return isLower ? "pm" : "PM";
  1507. } else {
  1508. return isLower ? "am" : "AM";
  1509. }
  1510. }
  1511. var baseConfig = {
  1512. calendar: defaultCalendar,
  1513. longDateFormat: defaultLongDateFormat,
  1514. invalidDate: defaultInvalidDate,
  1515. ordinal: defaultOrdinal,
  1516. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  1517. relativeTime: defaultRelativeTime,
  1518. months: defaultLocaleMonths,
  1519. monthsShort: defaultLocaleMonthsShort,
  1520. week: defaultLocaleWeek,
  1521. weekdays: defaultLocaleWeekdays,
  1522. weekdaysMin: defaultLocaleWeekdaysMin,
  1523. weekdaysShort: defaultLocaleWeekdaysShort,
  1524. meridiemParse: defaultLocaleMeridiemParse
  1525. };
  1526. var locales = {};
  1527. var localeFamilies = {};
  1528. var globalLocale;
  1529. function commonPrefix(arr1, arr2) {
  1530. var i, minl = Math.min(arr1.length, arr2.length);
  1531. for (i = 0; i < minl; i += 1) {
  1532. if (arr1[i] !== arr2[i]) {
  1533. return i;
  1534. }
  1535. }
  1536. return minl;
  1537. }
  1538. function normalizeLocale(key) {
  1539. return key ? key.toLowerCase().replace("_", "-") : key;
  1540. }
  1541. function chooseLocale(names) {
  1542. var i = 0, j, next, locale2, split;
  1543. while (i < names.length) {
  1544. split = normalizeLocale(names[i]).split("-");
  1545. j = split.length;
  1546. next = normalizeLocale(names[i + 1]);
  1547. next = next ? next.split("-") : null;
  1548. while (j > 0) {
  1549. locale2 = loadLocale(split.slice(0, j).join("-"));
  1550. if (locale2) {
  1551. return locale2;
  1552. }
  1553. if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
  1554. break;
  1555. }
  1556. j--;
  1557. }
  1558. i++;
  1559. }
  1560. return globalLocale;
  1561. }
  1562. function isLocaleNameSane(name) {
  1563. return !!(name && name.match("^[^/\\\\]*$"));
  1564. }
  1565. function loadLocale(name) {
  1566. var oldLocale = null, aliasedRequire;
  1567. if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
  1568. try {
  1569. oldLocale = globalLocale._abbr;
  1570. aliasedRequire = __require;
  1571. aliasedRequire("./locale/" + name);
  1572. getSetGlobalLocale(oldLocale);
  1573. } catch (e) {
  1574. locales[name] = null;
  1575. }
  1576. }
  1577. return locales[name];
  1578. }
  1579. function getSetGlobalLocale(key, values) {
  1580. var data;
  1581. if (key) {
  1582. if (isUndefined(values)) {
  1583. data = getLocale(key);
  1584. } else {
  1585. data = defineLocale(key, values);
  1586. }
  1587. if (data) {
  1588. globalLocale = data;
  1589. } else {
  1590. if (typeof console !== "undefined" && console.warn) {
  1591. console.warn(
  1592. "Locale " + key + " not found. Did you forget to load it?"
  1593. );
  1594. }
  1595. }
  1596. }
  1597. return globalLocale._abbr;
  1598. }
  1599. function defineLocale(name, config) {
  1600. if (config !== null) {
  1601. var locale2, parentConfig = baseConfig;
  1602. config.abbr = name;
  1603. if (locales[name] != null) {
  1604. deprecateSimple(
  1605. "defineLocaleOverride",
  1606. "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
  1607. );
  1608. parentConfig = locales[name]._config;
  1609. } else if (config.parentLocale != null) {
  1610. if (locales[config.parentLocale] != null) {
  1611. parentConfig = locales[config.parentLocale]._config;
  1612. } else {
  1613. locale2 = loadLocale(config.parentLocale);
  1614. if (locale2 != null) {
  1615. parentConfig = locale2._config;
  1616. } else {
  1617. if (!localeFamilies[config.parentLocale]) {
  1618. localeFamilies[config.parentLocale] = [];
  1619. }
  1620. localeFamilies[config.parentLocale].push({
  1621. name,
  1622. config
  1623. });
  1624. return null;
  1625. }
  1626. }
  1627. }
  1628. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  1629. if (localeFamilies[name]) {
  1630. localeFamilies[name].forEach(function(x) {
  1631. defineLocale(x.name, x.config);
  1632. });
  1633. }
  1634. getSetGlobalLocale(name);
  1635. return locales[name];
  1636. } else {
  1637. delete locales[name];
  1638. return null;
  1639. }
  1640. }
  1641. function updateLocale(name, config) {
  1642. if (config != null) {
  1643. var locale2, tmpLocale, parentConfig = baseConfig;
  1644. if (locales[name] != null && locales[name].parentLocale != null) {
  1645. locales[name].set(mergeConfigs(locales[name]._config, config));
  1646. } else {
  1647. tmpLocale = loadLocale(name);
  1648. if (tmpLocale != null) {
  1649. parentConfig = tmpLocale._config;
  1650. }
  1651. config = mergeConfigs(parentConfig, config);
  1652. if (tmpLocale == null) {
  1653. config.abbr = name;
  1654. }
  1655. locale2 = new Locale(config);
  1656. locale2.parentLocale = locales[name];
  1657. locales[name] = locale2;
  1658. }
  1659. getSetGlobalLocale(name);
  1660. } else {
  1661. if (locales[name] != null) {
  1662. if (locales[name].parentLocale != null) {
  1663. locales[name] = locales[name].parentLocale;
  1664. if (name === getSetGlobalLocale()) {
  1665. getSetGlobalLocale(name);
  1666. }
  1667. } else if (locales[name] != null) {
  1668. delete locales[name];
  1669. }
  1670. }
  1671. }
  1672. return locales[name];
  1673. }
  1674. function getLocale(key) {
  1675. var locale2;
  1676. if (key && key._locale && key._locale._abbr) {
  1677. key = key._locale._abbr;
  1678. }
  1679. if (!key) {
  1680. return globalLocale;
  1681. }
  1682. if (!isArray(key)) {
  1683. locale2 = loadLocale(key);
  1684. if (locale2) {
  1685. return locale2;
  1686. }
  1687. key = [key];
  1688. }
  1689. return chooseLocale(key);
  1690. }
  1691. function listLocales() {
  1692. return keys(locales);
  1693. }
  1694. function checkOverflow(m) {
  1695. var overflow, a = m._a;
  1696. if (a && getParsingFlags(m).overflow === -2) {
  1697. overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
  1698. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  1699. overflow = DATE;
  1700. }
  1701. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  1702. overflow = WEEK;
  1703. }
  1704. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  1705. overflow = WEEKDAY;
  1706. }
  1707. getParsingFlags(m).overflow = overflow;
  1708. }
  1709. return m;
  1710. }
  1711. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1712. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1713. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  1714. var isoDates = [
  1715. ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
  1716. ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
  1717. ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
  1718. ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
  1719. ["YYYY-DDD", /\d{4}-\d{3}/],
  1720. ["YYYY-MM", /\d{4}-\d\d/, false],
  1721. ["YYYYYYMMDD", /[+-]\d{10}/],
  1722. ["YYYYMMDD", /\d{8}/],
  1723. ["GGGG[W]WWE", /\d{4}W\d{3}/],
  1724. ["GGGG[W]WW", /\d{4}W\d{2}/, false],
  1725. ["YYYYDDD", /\d{7}/],
  1726. ["YYYYMM", /\d{6}/, false],
  1727. ["YYYY", /\d{4}/, false]
  1728. ];
  1729. var isoTimes = [
  1730. ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
  1731. ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
  1732. ["HH:mm:ss", /\d\d:\d\d:\d\d/],
  1733. ["HH:mm", /\d\d:\d\d/],
  1734. ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
  1735. ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
  1736. ["HHmmss", /\d\d\d\d\d\d/],
  1737. ["HHmm", /\d\d\d\d/],
  1738. ["HH", /\d\d/]
  1739. ];
  1740. var aspNetJsonRegex = /^\/?Date\((-?\d+)/i;
  1741. var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
  1742. var obsOffsets = {
  1743. UT: 0,
  1744. GMT: 0,
  1745. EDT: -4 * 60,
  1746. EST: -5 * 60,
  1747. CDT: -5 * 60,
  1748. CST: -6 * 60,
  1749. MDT: -6 * 60,
  1750. MST: -7 * 60,
  1751. PDT: -7 * 60,
  1752. PST: -8 * 60
  1753. };
  1754. function configFromISO(config) {
  1755. var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
  1756. if (match) {
  1757. getParsingFlags(config).iso = true;
  1758. for (i = 0, l = isoDatesLen; i < l; i++) {
  1759. if (isoDates[i][1].exec(match[1])) {
  1760. dateFormat = isoDates[i][0];
  1761. allowTime = isoDates[i][2] !== false;
  1762. break;
  1763. }
  1764. }
  1765. if (dateFormat == null) {
  1766. config._isValid = false;
  1767. return;
  1768. }
  1769. if (match[3]) {
  1770. for (i = 0, l = isoTimesLen; i < l; i++) {
  1771. if (isoTimes[i][1].exec(match[3])) {
  1772. timeFormat = (match[2] || " ") + isoTimes[i][0];
  1773. break;
  1774. }
  1775. }
  1776. if (timeFormat == null) {
  1777. config._isValid = false;
  1778. return;
  1779. }
  1780. }
  1781. if (!allowTime && timeFormat != null) {
  1782. config._isValid = false;
  1783. return;
  1784. }
  1785. if (match[4]) {
  1786. if (tzRegex.exec(match[4])) {
  1787. tzFormat = "Z";
  1788. } else {
  1789. config._isValid = false;
  1790. return;
  1791. }
  1792. }
  1793. config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
  1794. configFromStringAndFormat(config);
  1795. } else {
  1796. config._isValid = false;
  1797. }
  1798. }
  1799. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  1800. var result = [
  1801. untruncateYear(yearStr),
  1802. defaultLocaleMonthsShort.indexOf(monthStr),
  1803. parseInt(dayStr, 10),
  1804. parseInt(hourStr, 10),
  1805. parseInt(minuteStr, 10)
  1806. ];
  1807. if (secondStr) {
  1808. result.push(parseInt(secondStr, 10));
  1809. }
  1810. return result;
  1811. }
  1812. function untruncateYear(yearStr) {
  1813. var year = parseInt(yearStr, 10);
  1814. if (year <= 49) {
  1815. return 2e3 + year;
  1816. } else if (year <= 999) {
  1817. return 1900 + year;
  1818. }
  1819. return year;
  1820. }
  1821. function preprocessRFC2822(s) {
  1822. return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
  1823. }
  1824. function checkWeekday(weekdayStr, parsedInput, config) {
  1825. if (weekdayStr) {
  1826. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
  1827. parsedInput[0],
  1828. parsedInput[1],
  1829. parsedInput[2]
  1830. ).getDay();
  1831. if (weekdayProvided !== weekdayActual) {
  1832. getParsingFlags(config).weekdayMismatch = true;
  1833. config._isValid = false;
  1834. return false;
  1835. }
  1836. }
  1837. return true;
  1838. }
  1839. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  1840. if (obsOffset) {
  1841. return obsOffsets[obsOffset];
  1842. } else if (militaryOffset) {
  1843. return 0;
  1844. } else {
  1845. var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100;
  1846. return h * 60 + m;
  1847. }
  1848. }
  1849. function configFromRFC2822(config) {
  1850. var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
  1851. if (match) {
  1852. parsedArray = extractFromRFC2822Strings(
  1853. match[4],
  1854. match[3],
  1855. match[2],
  1856. match[5],
  1857. match[6],
  1858. match[7]
  1859. );
  1860. if (!checkWeekday(match[1], parsedArray, config)) {
  1861. return;
  1862. }
  1863. config._a = parsedArray;
  1864. config._tzm = calculateOffset(match[8], match[9], match[10]);
  1865. config._d = createUTCDate.apply(null, config._a);
  1866. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  1867. getParsingFlags(config).rfc2822 = true;
  1868. } else {
  1869. config._isValid = false;
  1870. }
  1871. }
  1872. function configFromString(config) {
  1873. var matched = aspNetJsonRegex.exec(config._i);
  1874. if (matched !== null) {
  1875. config._d = /* @__PURE__ */ new Date(+matched[1]);
  1876. return;
  1877. }
  1878. configFromISO(config);
  1879. if (config._isValid === false) {
  1880. delete config._isValid;
  1881. } else {
  1882. return;
  1883. }
  1884. configFromRFC2822(config);
  1885. if (config._isValid === false) {
  1886. delete config._isValid;
  1887. } else {
  1888. return;
  1889. }
  1890. if (config._strict) {
  1891. config._isValid = false;
  1892. } else {
  1893. hooks.createFromInputFallback(config);
  1894. }
  1895. }
  1896. hooks.createFromInputFallback = deprecate(
  1897. "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
  1898. function(config) {
  1899. config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
  1900. }
  1901. );
  1902. function defaults(a, b, c) {
  1903. if (a != null) {
  1904. return a;
  1905. }
  1906. if (b != null) {
  1907. return b;
  1908. }
  1909. return c;
  1910. }
  1911. function currentDateArray(config) {
  1912. var nowValue = new Date(hooks.now());
  1913. if (config._useUTC) {
  1914. return [
  1915. nowValue.getUTCFullYear(),
  1916. nowValue.getUTCMonth(),
  1917. nowValue.getUTCDate()
  1918. ];
  1919. }
  1920. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  1921. }
  1922. function configFromArray(config) {
  1923. var i, date, input = [], currentDate, expectedWeekday, yearToUse;
  1924. if (config._d) {
  1925. return;
  1926. }
  1927. currentDate = currentDateArray(config);
  1928. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  1929. dayOfYearFromWeekInfo(config);
  1930. }
  1931. if (config._dayOfYear != null) {
  1932. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  1933. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  1934. getParsingFlags(config)._overflowDayOfYear = true;
  1935. }
  1936. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  1937. config._a[MONTH] = date.getUTCMonth();
  1938. config._a[DATE] = date.getUTCDate();
  1939. }
  1940. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  1941. config._a[i] = input[i] = currentDate[i];
  1942. }
  1943. for (; i < 7; i++) {
  1944. config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
  1945. }
  1946. if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
  1947. config._nextDay = true;
  1948. config._a[HOUR] = 0;
  1949. }
  1950. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  1951. null,
  1952. input
  1953. );
  1954. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  1955. if (config._tzm != null) {
  1956. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  1957. }
  1958. if (config._nextDay) {
  1959. config._a[HOUR] = 24;
  1960. }
  1961. if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
  1962. getParsingFlags(config).weekdayMismatch = true;
  1963. }
  1964. }
  1965. function dayOfYearFromWeekInfo(config) {
  1966. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  1967. w = config._w;
  1968. if (w.GG != null || w.W != null || w.E != null) {
  1969. dow = 1;
  1970. doy = 4;
  1971. weekYear = defaults(
  1972. w.GG,
  1973. config._a[YEAR],
  1974. weekOfYear(createLocal(), 1, 4).year
  1975. );
  1976. week = defaults(w.W, 1);
  1977. weekday = defaults(w.E, 1);
  1978. if (weekday < 1 || weekday > 7) {
  1979. weekdayOverflow = true;
  1980. }
  1981. } else {
  1982. dow = config._locale._week.dow;
  1983. doy = config._locale._week.doy;
  1984. curWeek = weekOfYear(createLocal(), dow, doy);
  1985. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  1986. week = defaults(w.w, curWeek.week);
  1987. if (w.d != null) {
  1988. weekday = w.d;
  1989. if (weekday < 0 || weekday > 6) {
  1990. weekdayOverflow = true;
  1991. }
  1992. } else if (w.e != null) {
  1993. weekday = w.e + dow;
  1994. if (w.e < 0 || w.e > 6) {
  1995. weekdayOverflow = true;
  1996. }
  1997. } else {
  1998. weekday = dow;
  1999. }
  2000. }
  2001. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  2002. getParsingFlags(config)._overflowWeeks = true;
  2003. } else if (weekdayOverflow != null) {
  2004. getParsingFlags(config)._overflowWeekday = true;
  2005. } else {
  2006. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  2007. config._a[YEAR] = temp.year;
  2008. config._dayOfYear = temp.dayOfYear;
  2009. }
  2010. }
  2011. hooks.ISO_8601 = function() {
  2012. };
  2013. hooks.RFC_2822 = function() {
  2014. };
  2015. function configFromStringAndFormat(config) {
  2016. if (config._f === hooks.ISO_8601) {
  2017. configFromISO(config);
  2018. return;
  2019. }
  2020. if (config._f === hooks.RFC_2822) {
  2021. configFromRFC2822(config);
  2022. return;
  2023. }
  2024. config._a = [];
  2025. getParsingFlags(config).empty = true;
  2026. var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
  2027. tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  2028. tokenLen = tokens2.length;
  2029. for (i = 0; i < tokenLen; i++) {
  2030. token2 = tokens2[i];
  2031. parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
  2032. if (parsedInput) {
  2033. skipped = string.substr(0, string.indexOf(parsedInput));
  2034. if (skipped.length > 0) {
  2035. getParsingFlags(config).unusedInput.push(skipped);
  2036. }
  2037. string = string.slice(
  2038. string.indexOf(parsedInput) + parsedInput.length
  2039. );
  2040. totalParsedInputLength += parsedInput.length;
  2041. }
  2042. if (formatTokenFunctions[token2]) {
  2043. if (parsedInput) {
  2044. getParsingFlags(config).empty = false;
  2045. } else {
  2046. getParsingFlags(config).unusedTokens.push(token2);
  2047. }
  2048. addTimeToArrayFromToken(token2, parsedInput, config);
  2049. } else if (config._strict && !parsedInput) {
  2050. getParsingFlags(config).unusedTokens.push(token2);
  2051. }
  2052. }
  2053. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  2054. if (string.length > 0) {
  2055. getParsingFlags(config).unusedInput.push(string);
  2056. }
  2057. if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
  2058. getParsingFlags(config).bigHour = void 0;
  2059. }
  2060. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  2061. getParsingFlags(config).meridiem = config._meridiem;
  2062. config._a[HOUR] = meridiemFixWrap(
  2063. config._locale,
  2064. config._a[HOUR],
  2065. config._meridiem
  2066. );
  2067. era = getParsingFlags(config).era;
  2068. if (era !== null) {
  2069. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  2070. }
  2071. configFromArray(config);
  2072. checkOverflow(config);
  2073. }
  2074. function meridiemFixWrap(locale2, hour, meridiem2) {
  2075. var isPm;
  2076. if (meridiem2 == null) {
  2077. return hour;
  2078. }
  2079. if (locale2.meridiemHour != null) {
  2080. return locale2.meridiemHour(hour, meridiem2);
  2081. } else if (locale2.isPM != null) {
  2082. isPm = locale2.isPM(meridiem2);
  2083. if (isPm && hour < 12) {
  2084. hour += 12;
  2085. }
  2086. if (!isPm && hour === 12) {
  2087. hour = 0;
  2088. }
  2089. return hour;
  2090. } else {
  2091. return hour;
  2092. }
  2093. }
  2094. function configFromStringAndArray(config) {
  2095. var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
  2096. if (configfLen === 0) {
  2097. getParsingFlags(config).invalidFormat = true;
  2098. config._d = /* @__PURE__ */ new Date(NaN);
  2099. return;
  2100. }
  2101. for (i = 0; i < configfLen; i++) {
  2102. currentScore = 0;
  2103. validFormatFound = false;
  2104. tempConfig = copyConfig({}, config);
  2105. if (config._useUTC != null) {
  2106. tempConfig._useUTC = config._useUTC;
  2107. }
  2108. tempConfig._f = config._f[i];
  2109. configFromStringAndFormat(tempConfig);
  2110. if (isValid(tempConfig)) {
  2111. validFormatFound = true;
  2112. }
  2113. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  2114. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  2115. getParsingFlags(tempConfig).score = currentScore;
  2116. if (!bestFormatIsValid) {
  2117. if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
  2118. scoreToBeat = currentScore;
  2119. bestMoment = tempConfig;
  2120. if (validFormatFound) {
  2121. bestFormatIsValid = true;
  2122. }
  2123. }
  2124. } else {
  2125. if (currentScore < scoreToBeat) {
  2126. scoreToBeat = currentScore;
  2127. bestMoment = tempConfig;
  2128. }
  2129. }
  2130. }
  2131. extend(config, bestMoment || tempConfig);
  2132. }
  2133. function configFromObject(config) {
  2134. if (config._d) {
  2135. return;
  2136. }
  2137. var i = normalizeObjectUnits(config._i), dayOrDate = i.day === void 0 ? i.date : i.day;
  2138. config._a = map(
  2139. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  2140. function(obj) {
  2141. return obj && parseInt(obj, 10);
  2142. }
  2143. );
  2144. configFromArray(config);
  2145. }
  2146. function createFromConfig(config) {
  2147. var res = new Moment(checkOverflow(prepareConfig(config)));
  2148. if (res._nextDay) {
  2149. res.add(1, "d");
  2150. res._nextDay = void 0;
  2151. }
  2152. return res;
  2153. }
  2154. function prepareConfig(config) {
  2155. var input = config._i, format2 = config._f;
  2156. config._locale = config._locale || getLocale(config._l);
  2157. if (input === null || format2 === void 0 && input === "") {
  2158. return createInvalid({ nullInput: true });
  2159. }
  2160. if (typeof input === "string") {
  2161. config._i = input = config._locale.preparse(input);
  2162. }
  2163. if (isMoment(input)) {
  2164. return new Moment(checkOverflow(input));
  2165. } else if (isDate(input)) {
  2166. config._d = input;
  2167. } else if (isArray(format2)) {
  2168. configFromStringAndArray(config);
  2169. } else if (format2) {
  2170. configFromStringAndFormat(config);
  2171. } else {
  2172. configFromInput(config);
  2173. }
  2174. if (!isValid(config)) {
  2175. config._d = null;
  2176. }
  2177. return config;
  2178. }
  2179. function configFromInput(config) {
  2180. var input = config._i;
  2181. if (isUndefined(input)) {
  2182. config._d = new Date(hooks.now());
  2183. } else if (isDate(input)) {
  2184. config._d = new Date(input.valueOf());
  2185. } else if (typeof input === "string") {
  2186. configFromString(config);
  2187. } else if (isArray(input)) {
  2188. config._a = map(input.slice(0), function(obj) {
  2189. return parseInt(obj, 10);
  2190. });
  2191. configFromArray(config);
  2192. } else if (isObject(input)) {
  2193. configFromObject(config);
  2194. } else if (isNumber(input)) {
  2195. config._d = new Date(input);
  2196. } else {
  2197. hooks.createFromInputFallback(config);
  2198. }
  2199. }
  2200. function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
  2201. var c = {};
  2202. if (format2 === true || format2 === false) {
  2203. strict = format2;
  2204. format2 = void 0;
  2205. }
  2206. if (locale2 === true || locale2 === false) {
  2207. strict = locale2;
  2208. locale2 = void 0;
  2209. }
  2210. if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
  2211. input = void 0;
  2212. }
  2213. c._isAMomentObject = true;
  2214. c._useUTC = c._isUTC = isUTC;
  2215. c._l = locale2;
  2216. c._i = input;
  2217. c._f = format2;
  2218. c._strict = strict;
  2219. return createFromConfig(c);
  2220. }
  2221. function createLocal(input, format2, locale2, strict) {
  2222. return createLocalOrUTC(input, format2, locale2, strict, false);
  2223. }
  2224. var prototypeMin = deprecate(
  2225. "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
  2226. function() {
  2227. var other = createLocal.apply(null, arguments);
  2228. if (this.isValid() && other.isValid()) {
  2229. return other < this ? this : other;
  2230. } else {
  2231. return createInvalid();
  2232. }
  2233. }
  2234. );
  2235. var prototypeMax = deprecate(
  2236. "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
  2237. function() {
  2238. var other = createLocal.apply(null, arguments);
  2239. if (this.isValid() && other.isValid()) {
  2240. return other > this ? this : other;
  2241. } else {
  2242. return createInvalid();
  2243. }
  2244. }
  2245. );
  2246. function pickBy(fn, moments) {
  2247. var res, i;
  2248. if (moments.length === 1 && isArray(moments[0])) {
  2249. moments = moments[0];
  2250. }
  2251. if (!moments.length) {
  2252. return createLocal();
  2253. }
  2254. res = moments[0];
  2255. for (i = 1; i < moments.length; ++i) {
  2256. if (!moments[i].isValid() || moments[i][fn](res)) {
  2257. res = moments[i];
  2258. }
  2259. }
  2260. return res;
  2261. }
  2262. function min() {
  2263. var args = [].slice.call(arguments, 0);
  2264. return pickBy("isBefore", args);
  2265. }
  2266. function max() {
  2267. var args = [].slice.call(arguments, 0);
  2268. return pickBy("isAfter", args);
  2269. }
  2270. var now = function() {
  2271. return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
  2272. };
  2273. var ordering = [
  2274. "year",
  2275. "quarter",
  2276. "month",
  2277. "week",
  2278. "day",
  2279. "hour",
  2280. "minute",
  2281. "second",
  2282. "millisecond"
  2283. ];
  2284. function isDurationValid(m) {
  2285. var key, unitHasDecimal = false, i, orderLen = ordering.length;
  2286. for (key in m) {
  2287. if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
  2288. return false;
  2289. }
  2290. }
  2291. for (i = 0; i < orderLen; ++i) {
  2292. if (m[ordering[i]]) {
  2293. if (unitHasDecimal) {
  2294. return false;
  2295. }
  2296. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  2297. unitHasDecimal = true;
  2298. }
  2299. }
  2300. }
  2301. return true;
  2302. }
  2303. function isValid$1() {
  2304. return this._isValid;
  2305. }
  2306. function createInvalid$1() {
  2307. return createDuration(NaN);
  2308. }
  2309. function Duration(duration) {
  2310. var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
  2311. this._isValid = isDurationValid(normalizedInput);
  2312. this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
  2313. minutes2 * 6e4 + // 1000 * 60
  2314. hours2 * 1e3 * 60 * 60;
  2315. this._days = +days2 + weeks2 * 7;
  2316. this._months = +months2 + quarters * 3 + years2 * 12;
  2317. this._data = {};
  2318. this._locale = getLocale();
  2319. this._bubble();
  2320. }
  2321. function isDuration(obj) {
  2322. return obj instanceof Duration;
  2323. }
  2324. function absRound(number) {
  2325. if (number < 0) {
  2326. return Math.round(-1 * number) * -1;
  2327. } else {
  2328. return Math.round(number);
  2329. }
  2330. }
  2331. function compareArrays(array1, array2, dontConvert) {
  2332. var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
  2333. for (i = 0; i < len; i++) {
  2334. if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
  2335. diffs++;
  2336. }
  2337. }
  2338. return diffs + lengthDiff;
  2339. }
  2340. function offset(token2, separator) {
  2341. addFormatToken(token2, 0, 0, function() {
  2342. var offset2 = this.utcOffset(), sign2 = "+";
  2343. if (offset2 < 0) {
  2344. offset2 = -offset2;
  2345. sign2 = "-";
  2346. }
  2347. return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
  2348. });
  2349. }
  2350. offset("Z", ":");
  2351. offset("ZZ", "");
  2352. addRegexToken("Z", matchShortOffset);
  2353. addRegexToken("ZZ", matchShortOffset);
  2354. addParseToken(["Z", "ZZ"], function(input, array, config) {
  2355. config._useUTC = true;
  2356. config._tzm = offsetFromString(matchShortOffset, input);
  2357. });
  2358. var chunkOffset = /([\+\-]|\d\d)/gi;
  2359. function offsetFromString(matcher, string) {
  2360. var matches = (string || "").match(matcher), chunk, parts, minutes2;
  2361. if (matches === null) {
  2362. return null;
  2363. }
  2364. chunk = matches[matches.length - 1] || [];
  2365. parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
  2366. minutes2 = +(parts[1] * 60) + toInt(parts[2]);
  2367. return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
  2368. }
  2369. function cloneWithOffset(input, model) {
  2370. var res, diff2;
  2371. if (model._isUTC) {
  2372. res = model.clone();
  2373. diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  2374. res._d.setTime(res._d.valueOf() + diff2);
  2375. hooks.updateOffset(res, false);
  2376. return res;
  2377. } else {
  2378. return createLocal(input).local();
  2379. }
  2380. }
  2381. function getDateOffset(m) {
  2382. return -Math.round(m._d.getTimezoneOffset());
  2383. }
  2384. hooks.updateOffset = function() {
  2385. };
  2386. function getSetOffset(input, keepLocalTime, keepMinutes) {
  2387. var offset2 = this._offset || 0, localAdjust;
  2388. if (!this.isValid()) {
  2389. return input != null ? this : NaN;
  2390. }
  2391. if (input != null) {
  2392. if (typeof input === "string") {
  2393. input = offsetFromString(matchShortOffset, input);
  2394. if (input === null) {
  2395. return this;
  2396. }
  2397. } else if (Math.abs(input) < 16 && !keepMinutes) {
  2398. input = input * 60;
  2399. }
  2400. if (!this._isUTC && keepLocalTime) {
  2401. localAdjust = getDateOffset(this);
  2402. }
  2403. this._offset = input;
  2404. this._isUTC = true;
  2405. if (localAdjust != null) {
  2406. this.add(localAdjust, "m");
  2407. }
  2408. if (offset2 !== input) {
  2409. if (!keepLocalTime || this._changeInProgress) {
  2410. addSubtract(
  2411. this,
  2412. createDuration(input - offset2, "m"),
  2413. 1,
  2414. false
  2415. );
  2416. } else if (!this._changeInProgress) {
  2417. this._changeInProgress = true;
  2418. hooks.updateOffset(this, true);
  2419. this._changeInProgress = null;
  2420. }
  2421. }
  2422. return this;
  2423. } else {
  2424. return this._isUTC ? offset2 : getDateOffset(this);
  2425. }
  2426. }
  2427. function getSetZone(input, keepLocalTime) {
  2428. if (input != null) {
  2429. if (typeof input !== "string") {
  2430. input = -input;
  2431. }
  2432. this.utcOffset(input, keepLocalTime);
  2433. return this;
  2434. } else {
  2435. return -this.utcOffset();
  2436. }
  2437. }
  2438. function setOffsetToUTC(keepLocalTime) {
  2439. return this.utcOffset(0, keepLocalTime);
  2440. }
  2441. function setOffsetToLocal(keepLocalTime) {
  2442. if (this._isUTC) {
  2443. this.utcOffset(0, keepLocalTime);
  2444. this._isUTC = false;
  2445. if (keepLocalTime) {
  2446. this.subtract(getDateOffset(this), "m");
  2447. }
  2448. }
  2449. return this;
  2450. }
  2451. function setOffsetToParsedOffset() {
  2452. if (this._tzm != null) {
  2453. this.utcOffset(this._tzm, false, true);
  2454. } else if (typeof this._i === "string") {
  2455. var tZone = offsetFromString(matchOffset, this._i);
  2456. if (tZone != null) {
  2457. this.utcOffset(tZone);
  2458. } else {
  2459. this.utcOffset(0, true);
  2460. }
  2461. }
  2462. return this;
  2463. }
  2464. function hasAlignedHourOffset(input) {
  2465. if (!this.isValid()) {
  2466. return false;
  2467. }
  2468. input = input ? createLocal(input).utcOffset() : 0;
  2469. return (this.utcOffset() - input) % 60 === 0;
  2470. }
  2471. function isDaylightSavingTime() {
  2472. return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
  2473. }
  2474. function isDaylightSavingTimeShifted() {
  2475. if (!isUndefined(this._isDSTShifted)) {
  2476. return this._isDSTShifted;
  2477. }
  2478. var c = {}, other;
  2479. copyConfig(c, this);
  2480. c = prepareConfig(c);
  2481. if (c._a) {
  2482. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  2483. this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  2484. } else {
  2485. this._isDSTShifted = false;
  2486. }
  2487. return this._isDSTShifted;
  2488. }
  2489. function isLocal() {
  2490. return this.isValid() ? !this._isUTC : false;
  2491. }
  2492. function isUtcOffset() {
  2493. return this.isValid() ? this._isUTC : false;
  2494. }
  2495. function isUtc() {
  2496. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  2497. }
  2498. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/;
  2499. var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  2500. function createDuration(input, key) {
  2501. var duration = input, match = null, sign2, ret, diffRes;
  2502. if (isDuration(input)) {
  2503. duration = {
  2504. ms: input._milliseconds,
  2505. d: input._days,
  2506. M: input._months
  2507. };
  2508. } else if (isNumber(input) || !isNaN(+input)) {
  2509. duration = {};
  2510. if (key) {
  2511. duration[key] = +input;
  2512. } else {
  2513. duration.milliseconds = +input;
  2514. }
  2515. } else if (match = aspNetRegex.exec(input)) {
  2516. sign2 = match[1] === "-" ? -1 : 1;
  2517. duration = {
  2518. y: 0,
  2519. d: toInt(match[DATE]) * sign2,
  2520. h: toInt(match[HOUR]) * sign2,
  2521. m: toInt(match[MINUTE]) * sign2,
  2522. s: toInt(match[SECOND]) * sign2,
  2523. ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
  2524. // the millisecond decimal point is included in the match
  2525. };
  2526. } else if (match = isoRegex.exec(input)) {
  2527. sign2 = match[1] === "-" ? -1 : 1;
  2528. duration = {
  2529. y: parseIso(match[2], sign2),
  2530. M: parseIso(match[3], sign2),
  2531. w: parseIso(match[4], sign2),
  2532. d: parseIso(match[5], sign2),
  2533. h: parseIso(match[6], sign2),
  2534. m: parseIso(match[7], sign2),
  2535. s: parseIso(match[8], sign2)
  2536. };
  2537. } else if (duration == null) {
  2538. duration = {};
  2539. } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
  2540. diffRes = momentsDifference(
  2541. createLocal(duration.from),
  2542. createLocal(duration.to)
  2543. );
  2544. duration = {};
  2545. duration.ms = diffRes.milliseconds;
  2546. duration.M = diffRes.months;
  2547. }
  2548. ret = new Duration(duration);
  2549. if (isDuration(input) && hasOwnProp(input, "_locale")) {
  2550. ret._locale = input._locale;
  2551. }
  2552. if (isDuration(input) && hasOwnProp(input, "_isValid")) {
  2553. ret._isValid = input._isValid;
  2554. }
  2555. return ret;
  2556. }
  2557. createDuration.fn = Duration.prototype;
  2558. createDuration.invalid = createInvalid$1;
  2559. function parseIso(inp, sign2) {
  2560. var res = inp && parseFloat(inp.replace(",", "."));
  2561. return (isNaN(res) ? 0 : res) * sign2;
  2562. }
  2563. function positiveMomentsDifference(base, other) {
  2564. var res = {};
  2565. res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
  2566. if (base.clone().add(res.months, "M").isAfter(other)) {
  2567. --res.months;
  2568. }
  2569. res.milliseconds = +other - +base.clone().add(res.months, "M");
  2570. return res;
  2571. }
  2572. function momentsDifference(base, other) {
  2573. var res;
  2574. if (!(base.isValid() && other.isValid())) {
  2575. return { milliseconds: 0, months: 0 };
  2576. }
  2577. other = cloneWithOffset(other, base);
  2578. if (base.isBefore(other)) {
  2579. res = positiveMomentsDifference(base, other);
  2580. } else {
  2581. res = positiveMomentsDifference(other, base);
  2582. res.milliseconds = -res.milliseconds;
  2583. res.months = -res.months;
  2584. }
  2585. return res;
  2586. }
  2587. function createAdder(direction, name) {
  2588. return function(val, period) {
  2589. var dur, tmp;
  2590. if (period !== null && !isNaN(+period)) {
  2591. deprecateSimple(
  2592. name,
  2593. "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
  2594. );
  2595. tmp = val;
  2596. val = period;
  2597. period = tmp;
  2598. }
  2599. dur = createDuration(val, period);
  2600. addSubtract(this, dur, direction);
  2601. return this;
  2602. };
  2603. }
  2604. function addSubtract(mom, duration, isAdding, updateOffset) {
  2605. var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
  2606. if (!mom.isValid()) {
  2607. return;
  2608. }
  2609. updateOffset = updateOffset == null ? true : updateOffset;
  2610. if (months2) {
  2611. setMonth(mom, get(mom, "Month") + months2 * isAdding);
  2612. }
  2613. if (days2) {
  2614. set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
  2615. }
  2616. if (milliseconds2) {
  2617. mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
  2618. }
  2619. if (updateOffset) {
  2620. hooks.updateOffset(mom, days2 || months2);
  2621. }
  2622. }
  2623. var add = createAdder(1, "add");
  2624. var subtract = createAdder(-1, "subtract");
  2625. function isString(input) {
  2626. return typeof input === "string" || input instanceof String;
  2627. }
  2628. function isMomentInput(input) {
  2629. return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
  2630. }
  2631. function isMomentInputObject(input) {
  2632. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  2633. "years",
  2634. "year",
  2635. "y",
  2636. "months",
  2637. "month",
  2638. "M",
  2639. "days",
  2640. "day",
  2641. "d",
  2642. "dates",
  2643. "date",
  2644. "D",
  2645. "hours",
  2646. "hour",
  2647. "h",
  2648. "minutes",
  2649. "minute",
  2650. "m",
  2651. "seconds",
  2652. "second",
  2653. "s",
  2654. "milliseconds",
  2655. "millisecond",
  2656. "ms"
  2657. ], i, property, propertyLen = properties.length;
  2658. for (i = 0; i < propertyLen; i += 1) {
  2659. property = properties[i];
  2660. propertyTest = propertyTest || hasOwnProp(input, property);
  2661. }
  2662. return objectTest && propertyTest;
  2663. }
  2664. function isNumberOrStringArray(input) {
  2665. var arrayTest = isArray(input), dataTypeTest = false;
  2666. if (arrayTest) {
  2667. dataTypeTest = input.filter(function(item) {
  2668. return !isNumber(item) && isString(input);
  2669. }).length === 0;
  2670. }
  2671. return arrayTest && dataTypeTest;
  2672. }
  2673. function isCalendarSpec(input) {
  2674. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  2675. "sameDay",
  2676. "nextDay",
  2677. "lastDay",
  2678. "nextWeek",
  2679. "lastWeek",
  2680. "sameElse"
  2681. ], i, property;
  2682. for (i = 0; i < properties.length; i += 1) {
  2683. property = properties[i];
  2684. propertyTest = propertyTest || hasOwnProp(input, property);
  2685. }
  2686. return objectTest && propertyTest;
  2687. }
  2688. function getCalendarFormat(myMoment, now2) {
  2689. var diff2 = myMoment.diff(now2, "days", true);
  2690. return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
  2691. }
  2692. function calendar$1(time, formats) {
  2693. if (arguments.length === 1) {
  2694. if (!arguments[0]) {
  2695. time = void 0;
  2696. formats = void 0;
  2697. } else if (isMomentInput(arguments[0])) {
  2698. time = arguments[0];
  2699. formats = void 0;
  2700. } else if (isCalendarSpec(arguments[0])) {
  2701. formats = arguments[0];
  2702. time = void 0;
  2703. }
  2704. }
  2705. var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
  2706. return this.format(
  2707. output || this.localeData().calendar(format2, this, createLocal(now2))
  2708. );
  2709. }
  2710. function clone() {
  2711. return new Moment(this);
  2712. }
  2713. function isAfter(input, units) {
  2714. var localInput = isMoment(input) ? input : createLocal(input);
  2715. if (!(this.isValid() && localInput.isValid())) {
  2716. return false;
  2717. }
  2718. units = normalizeUnits(units) || "millisecond";
  2719. if (units === "millisecond") {
  2720. return this.valueOf() > localInput.valueOf();
  2721. } else {
  2722. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  2723. }
  2724. }
  2725. function isBefore(input, units) {
  2726. var localInput = isMoment(input) ? input : createLocal(input);
  2727. if (!(this.isValid() && localInput.isValid())) {
  2728. return false;
  2729. }
  2730. units = normalizeUnits(units) || "millisecond";
  2731. if (units === "millisecond") {
  2732. return this.valueOf() < localInput.valueOf();
  2733. } else {
  2734. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  2735. }
  2736. }
  2737. function isBetween(from2, to2, units, inclusivity) {
  2738. var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
  2739. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  2740. return false;
  2741. }
  2742. inclusivity = inclusivity || "()";
  2743. return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
  2744. }
  2745. function isSame(input, units) {
  2746. var localInput = isMoment(input) ? input : createLocal(input), inputMs;
  2747. if (!(this.isValid() && localInput.isValid())) {
  2748. return false;
  2749. }
  2750. units = normalizeUnits(units) || "millisecond";
  2751. if (units === "millisecond") {
  2752. return this.valueOf() === localInput.valueOf();
  2753. } else {
  2754. inputMs = localInput.valueOf();
  2755. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  2756. }
  2757. }
  2758. function isSameOrAfter(input, units) {
  2759. return this.isSame(input, units) || this.isAfter(input, units);
  2760. }
  2761. function isSameOrBefore(input, units) {
  2762. return this.isSame(input, units) || this.isBefore(input, units);
  2763. }
  2764. function diff(input, units, asFloat) {
  2765. var that, zoneDelta, output;
  2766. if (!this.isValid()) {
  2767. return NaN;
  2768. }
  2769. that = cloneWithOffset(input, this);
  2770. if (!that.isValid()) {
  2771. return NaN;
  2772. }
  2773. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  2774. units = normalizeUnits(units);
  2775. switch (units) {
  2776. case "year":
  2777. output = monthDiff(this, that) / 12;
  2778. break;
  2779. case "month":
  2780. output = monthDiff(this, that);
  2781. break;
  2782. case "quarter":
  2783. output = monthDiff(this, that) / 3;
  2784. break;
  2785. case "second":
  2786. output = (this - that) / 1e3;
  2787. break;
  2788. case "minute":
  2789. output = (this - that) / 6e4;
  2790. break;
  2791. case "hour":
  2792. output = (this - that) / 36e5;
  2793. break;
  2794. case "day":
  2795. output = (this - that - zoneDelta) / 864e5;
  2796. break;
  2797. case "week":
  2798. output = (this - that - zoneDelta) / 6048e5;
  2799. break;
  2800. default:
  2801. output = this - that;
  2802. }
  2803. return asFloat ? output : absFloor(output);
  2804. }
  2805. function monthDiff(a, b) {
  2806. if (a.date() < b.date()) {
  2807. return -monthDiff(b, a);
  2808. }
  2809. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
  2810. if (b - anchor < 0) {
  2811. anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
  2812. adjust = (b - anchor) / (anchor - anchor2);
  2813. } else {
  2814. anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
  2815. adjust = (b - anchor) / (anchor2 - anchor);
  2816. }
  2817. return -(wholeMonthDiff + adjust) || 0;
  2818. }
  2819. hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
  2820. hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
  2821. function toString() {
  2822. return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
  2823. }
  2824. function toISOString(keepOffset) {
  2825. if (!this.isValid()) {
  2826. return null;
  2827. }
  2828. var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
  2829. if (m.year() < 0 || m.year() > 9999) {
  2830. return formatMoment(
  2831. m,
  2832. utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
  2833. );
  2834. }
  2835. if (isFunction(Date.prototype.toISOString)) {
  2836. if (utc) {
  2837. return this.toDate().toISOString();
  2838. } else {
  2839. return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
  2840. }
  2841. }
  2842. return formatMoment(
  2843. m,
  2844. utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
  2845. );
  2846. }
  2847. function inspect() {
  2848. if (!this.isValid()) {
  2849. return "moment.invalid(/* " + this._i + " */)";
  2850. }
  2851. var func = "moment", zone = "", prefix, year, datetime, suffix;
  2852. if (!this.isLocal()) {
  2853. func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
  2854. zone = "Z";
  2855. }
  2856. prefix = "[" + func + '("]';
  2857. year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
  2858. datetime = "-MM-DD[T]HH:mm:ss.SSS";
  2859. suffix = zone + '[")]';
  2860. return this.format(prefix + year + datetime + suffix);
  2861. }
  2862. function format(inputString) {
  2863. if (!inputString) {
  2864. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  2865. }
  2866. var output = formatMoment(this, inputString);
  2867. return this.localeData().postformat(output);
  2868. }
  2869. function from(time, withoutSuffix) {
  2870. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  2871. return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
  2872. } else {
  2873. return this.localeData().invalidDate();
  2874. }
  2875. }
  2876. function fromNow(withoutSuffix) {
  2877. return this.from(createLocal(), withoutSuffix);
  2878. }
  2879. function to(time, withoutSuffix) {
  2880. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  2881. return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
  2882. } else {
  2883. return this.localeData().invalidDate();
  2884. }
  2885. }
  2886. function toNow(withoutSuffix) {
  2887. return this.to(createLocal(), withoutSuffix);
  2888. }
  2889. function locale(key) {
  2890. var newLocaleData;
  2891. if (key === void 0) {
  2892. return this._locale._abbr;
  2893. } else {
  2894. newLocaleData = getLocale(key);
  2895. if (newLocaleData != null) {
  2896. this._locale = newLocaleData;
  2897. }
  2898. return this;
  2899. }
  2900. }
  2901. var lang = deprecate(
  2902. "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
  2903. function(key) {
  2904. if (key === void 0) {
  2905. return this.localeData();
  2906. } else {
  2907. return this.locale(key);
  2908. }
  2909. }
  2910. );
  2911. function localeData() {
  2912. return this._locale;
  2913. }
  2914. var MS_PER_SECOND = 1e3;
  2915. var MS_PER_MINUTE = 60 * MS_PER_SECOND;
  2916. var MS_PER_HOUR = 60 * MS_PER_MINUTE;
  2917. var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  2918. function mod$1(dividend, divisor) {
  2919. return (dividend % divisor + divisor) % divisor;
  2920. }
  2921. function localStartOfDate(y, m, d) {
  2922. if (y < 100 && y >= 0) {
  2923. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  2924. } else {
  2925. return new Date(y, m, d).valueOf();
  2926. }
  2927. }
  2928. function utcStartOfDate(y, m, d) {
  2929. if (y < 100 && y >= 0) {
  2930. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  2931. } else {
  2932. return Date.UTC(y, m, d);
  2933. }
  2934. }
  2935. function startOf(units) {
  2936. var time, startOfDate;
  2937. units = normalizeUnits(units);
  2938. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  2939. return this;
  2940. }
  2941. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  2942. switch (units) {
  2943. case "year":
  2944. time = startOfDate(this.year(), 0, 1);
  2945. break;
  2946. case "quarter":
  2947. time = startOfDate(
  2948. this.year(),
  2949. this.month() - this.month() % 3,
  2950. 1
  2951. );
  2952. break;
  2953. case "month":
  2954. time = startOfDate(this.year(), this.month(), 1);
  2955. break;
  2956. case "week":
  2957. time = startOfDate(
  2958. this.year(),
  2959. this.month(),
  2960. this.date() - this.weekday()
  2961. );
  2962. break;
  2963. case "isoWeek":
  2964. time = startOfDate(
  2965. this.year(),
  2966. this.month(),
  2967. this.date() - (this.isoWeekday() - 1)
  2968. );
  2969. break;
  2970. case "day":
  2971. case "date":
  2972. time = startOfDate(this.year(), this.month(), this.date());
  2973. break;
  2974. case "hour":
  2975. time = this._d.valueOf();
  2976. time -= mod$1(
  2977. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  2978. MS_PER_HOUR
  2979. );
  2980. break;
  2981. case "minute":
  2982. time = this._d.valueOf();
  2983. time -= mod$1(time, MS_PER_MINUTE);
  2984. break;
  2985. case "second":
  2986. time = this._d.valueOf();
  2987. time -= mod$1(time, MS_PER_SECOND);
  2988. break;
  2989. }
  2990. this._d.setTime(time);
  2991. hooks.updateOffset(this, true);
  2992. return this;
  2993. }
  2994. function endOf(units) {
  2995. var time, startOfDate;
  2996. units = normalizeUnits(units);
  2997. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  2998. return this;
  2999. }
  3000. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  3001. switch (units) {
  3002. case "year":
  3003. time = startOfDate(this.year() + 1, 0, 1) - 1;
  3004. break;
  3005. case "quarter":
  3006. time = startOfDate(
  3007. this.year(),
  3008. this.month() - this.month() % 3 + 3,
  3009. 1
  3010. ) - 1;
  3011. break;
  3012. case "month":
  3013. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  3014. break;
  3015. case "week":
  3016. time = startOfDate(
  3017. this.year(),
  3018. this.month(),
  3019. this.date() - this.weekday() + 7
  3020. ) - 1;
  3021. break;
  3022. case "isoWeek":
  3023. time = startOfDate(
  3024. this.year(),
  3025. this.month(),
  3026. this.date() - (this.isoWeekday() - 1) + 7
  3027. ) - 1;
  3028. break;
  3029. case "day":
  3030. case "date":
  3031. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  3032. break;
  3033. case "hour":
  3034. time = this._d.valueOf();
  3035. time += MS_PER_HOUR - mod$1(
  3036. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  3037. MS_PER_HOUR
  3038. ) - 1;
  3039. break;
  3040. case "minute":
  3041. time = this._d.valueOf();
  3042. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  3043. break;
  3044. case "second":
  3045. time = this._d.valueOf();
  3046. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  3047. break;
  3048. }
  3049. this._d.setTime(time);
  3050. hooks.updateOffset(this, true);
  3051. return this;
  3052. }
  3053. function valueOf() {
  3054. return this._d.valueOf() - (this._offset || 0) * 6e4;
  3055. }
  3056. function unix() {
  3057. return Math.floor(this.valueOf() / 1e3);
  3058. }
  3059. function toDate() {
  3060. return new Date(this.valueOf());
  3061. }
  3062. function toArray() {
  3063. var m = this;
  3064. return [
  3065. m.year(),
  3066. m.month(),
  3067. m.date(),
  3068. m.hour(),
  3069. m.minute(),
  3070. m.second(),
  3071. m.millisecond()
  3072. ];
  3073. }
  3074. function toObject() {
  3075. var m = this;
  3076. return {
  3077. years: m.year(),
  3078. months: m.month(),
  3079. date: m.date(),
  3080. hours: m.hours(),
  3081. minutes: m.minutes(),
  3082. seconds: m.seconds(),
  3083. milliseconds: m.milliseconds()
  3084. };
  3085. }
  3086. function toJSON() {
  3087. return this.isValid() ? this.toISOString() : null;
  3088. }
  3089. function isValid$2() {
  3090. return isValid(this);
  3091. }
  3092. function parsingFlags() {
  3093. return extend({}, getParsingFlags(this));
  3094. }
  3095. function invalidAt() {
  3096. return getParsingFlags(this).overflow;
  3097. }
  3098. function creationData() {
  3099. return {
  3100. input: this._i,
  3101. format: this._f,
  3102. locale: this._locale,
  3103. isUTC: this._isUTC,
  3104. strict: this._strict
  3105. };
  3106. }
  3107. addFormatToken("N", 0, 0, "eraAbbr");
  3108. addFormatToken("NN", 0, 0, "eraAbbr");
  3109. addFormatToken("NNN", 0, 0, "eraAbbr");
  3110. addFormatToken("NNNN", 0, 0, "eraName");
  3111. addFormatToken("NNNNN", 0, 0, "eraNarrow");
  3112. addFormatToken("y", ["y", 1], "yo", "eraYear");
  3113. addFormatToken("y", ["yy", 2], 0, "eraYear");
  3114. addFormatToken("y", ["yyy", 3], 0, "eraYear");
  3115. addFormatToken("y", ["yyyy", 4], 0, "eraYear");
  3116. addRegexToken("N", matchEraAbbr);
  3117. addRegexToken("NN", matchEraAbbr);
  3118. addRegexToken("NNN", matchEraAbbr);
  3119. addRegexToken("NNNN", matchEraName);
  3120. addRegexToken("NNNNN", matchEraNarrow);
  3121. addParseToken(
  3122. ["N", "NN", "NNN", "NNNN", "NNNNN"],
  3123. function(input, array, config, token2) {
  3124. var era = config._locale.erasParse(input, token2, config._strict);
  3125. if (era) {
  3126. getParsingFlags(config).era = era;
  3127. } else {
  3128. getParsingFlags(config).invalidEra = input;
  3129. }
  3130. }
  3131. );
  3132. addRegexToken("y", matchUnsigned);
  3133. addRegexToken("yy", matchUnsigned);
  3134. addRegexToken("yyy", matchUnsigned);
  3135. addRegexToken("yyyy", matchUnsigned);
  3136. addRegexToken("yo", matchEraYearOrdinal);
  3137. addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
  3138. addParseToken(["yo"], function(input, array, config, token2) {
  3139. var match;
  3140. if (config._locale._eraYearOrdinalRegex) {
  3141. match = input.match(config._locale._eraYearOrdinalRegex);
  3142. }
  3143. if (config._locale.eraYearOrdinalParse) {
  3144. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  3145. } else {
  3146. array[YEAR] = parseInt(input, 10);
  3147. }
  3148. });
  3149. function localeEras(m, format2) {
  3150. var i, l, date, eras = this._eras || getLocale("en")._eras;
  3151. for (i = 0, l = eras.length; i < l; ++i) {
  3152. switch (typeof eras[i].since) {
  3153. case "string":
  3154. date = hooks(eras[i].since).startOf("day");
  3155. eras[i].since = date.valueOf();
  3156. break;
  3157. }
  3158. switch (typeof eras[i].until) {
  3159. case "undefined":
  3160. eras[i].until = Infinity;
  3161. break;
  3162. case "string":
  3163. date = hooks(eras[i].until).startOf("day").valueOf();
  3164. eras[i].until = date.valueOf();
  3165. break;
  3166. }
  3167. }
  3168. return eras;
  3169. }
  3170. function localeErasParse(eraName, format2, strict) {
  3171. var i, l, eras = this.eras(), name, abbr, narrow;
  3172. eraName = eraName.toUpperCase();
  3173. for (i = 0, l = eras.length; i < l; ++i) {
  3174. name = eras[i].name.toUpperCase();
  3175. abbr = eras[i].abbr.toUpperCase();
  3176. narrow = eras[i].narrow.toUpperCase();
  3177. if (strict) {
  3178. switch (format2) {
  3179. case "N":
  3180. case "NN":
  3181. case "NNN":
  3182. if (abbr === eraName) {
  3183. return eras[i];
  3184. }
  3185. break;
  3186. case "NNNN":
  3187. if (name === eraName) {
  3188. return eras[i];
  3189. }
  3190. break;
  3191. case "NNNNN":
  3192. if (narrow === eraName) {
  3193. return eras[i];
  3194. }
  3195. break;
  3196. }
  3197. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  3198. return eras[i];
  3199. }
  3200. }
  3201. }
  3202. function localeErasConvertYear(era, year) {
  3203. var dir = era.since <= era.until ? 1 : -1;
  3204. if (year === void 0) {
  3205. return hooks(era.since).year();
  3206. } else {
  3207. return hooks(era.since).year() + (year - era.offset) * dir;
  3208. }
  3209. }
  3210. function getEraName() {
  3211. var i, l, val, eras = this.localeData().eras();
  3212. for (i = 0, l = eras.length; i < l; ++i) {
  3213. val = this.clone().startOf("day").valueOf();
  3214. if (eras[i].since <= val && val <= eras[i].until) {
  3215. return eras[i].name;
  3216. }
  3217. if (eras[i].until <= val && val <= eras[i].since) {
  3218. return eras[i].name;
  3219. }
  3220. }
  3221. return "";
  3222. }
  3223. function getEraNarrow() {
  3224. var i, l, val, eras = this.localeData().eras();
  3225. for (i = 0, l = eras.length; i < l; ++i) {
  3226. val = this.clone().startOf("day").valueOf();
  3227. if (eras[i].since <= val && val <= eras[i].until) {
  3228. return eras[i].narrow;
  3229. }
  3230. if (eras[i].until <= val && val <= eras[i].since) {
  3231. return eras[i].narrow;
  3232. }
  3233. }
  3234. return "";
  3235. }
  3236. function getEraAbbr() {
  3237. var i, l, val, eras = this.localeData().eras();
  3238. for (i = 0, l = eras.length; i < l; ++i) {
  3239. val = this.clone().startOf("day").valueOf();
  3240. if (eras[i].since <= val && val <= eras[i].until) {
  3241. return eras[i].abbr;
  3242. }
  3243. if (eras[i].until <= val && val <= eras[i].since) {
  3244. return eras[i].abbr;
  3245. }
  3246. }
  3247. return "";
  3248. }
  3249. function getEraYear() {
  3250. var i, l, dir, val, eras = this.localeData().eras();
  3251. for (i = 0, l = eras.length; i < l; ++i) {
  3252. dir = eras[i].since <= eras[i].until ? 1 : -1;
  3253. val = this.clone().startOf("day").valueOf();
  3254. if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {
  3255. return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;
  3256. }
  3257. }
  3258. return this.year();
  3259. }
  3260. function erasNameRegex(isStrict) {
  3261. if (!hasOwnProp(this, "_erasNameRegex")) {
  3262. computeErasParse.call(this);
  3263. }
  3264. return isStrict ? this._erasNameRegex : this._erasRegex;
  3265. }
  3266. function erasAbbrRegex(isStrict) {
  3267. if (!hasOwnProp(this, "_erasAbbrRegex")) {
  3268. computeErasParse.call(this);
  3269. }
  3270. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  3271. }
  3272. function erasNarrowRegex(isStrict) {
  3273. if (!hasOwnProp(this, "_erasNarrowRegex")) {
  3274. computeErasParse.call(this);
  3275. }
  3276. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  3277. }
  3278. function matchEraAbbr(isStrict, locale2) {
  3279. return locale2.erasAbbrRegex(isStrict);
  3280. }
  3281. function matchEraName(isStrict, locale2) {
  3282. return locale2.erasNameRegex(isStrict);
  3283. }
  3284. function matchEraNarrow(isStrict, locale2) {
  3285. return locale2.erasNarrowRegex(isStrict);
  3286. }
  3287. function matchEraYearOrdinal(isStrict, locale2) {
  3288. return locale2._eraYearOrdinalRegex || matchUnsigned;
  3289. }
  3290. function computeErasParse() {
  3291. var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
  3292. for (i = 0, l = eras.length; i < l; ++i) {
  3293. erasName = regexEscape(eras[i].name);
  3294. erasAbbr = regexEscape(eras[i].abbr);
  3295. erasNarrow = regexEscape(eras[i].narrow);
  3296. namePieces.push(erasName);
  3297. abbrPieces.push(erasAbbr);
  3298. narrowPieces.push(erasNarrow);
  3299. mixedPieces.push(erasName);
  3300. mixedPieces.push(erasAbbr);
  3301. mixedPieces.push(erasNarrow);
  3302. }
  3303. this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  3304. this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
  3305. this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
  3306. this._erasNarrowRegex = new RegExp(
  3307. "^(" + narrowPieces.join("|") + ")",
  3308. "i"
  3309. );
  3310. }
  3311. addFormatToken(0, ["gg", 2], 0, function() {
  3312. return this.weekYear() % 100;
  3313. });
  3314. addFormatToken(0, ["GG", 2], 0, function() {
  3315. return this.isoWeekYear() % 100;
  3316. });
  3317. function addWeekYearFormatToken(token2, getter) {
  3318. addFormatToken(0, [token2, token2.length], 0, getter);
  3319. }
  3320. addWeekYearFormatToken("gggg", "weekYear");
  3321. addWeekYearFormatToken("ggggg", "weekYear");
  3322. addWeekYearFormatToken("GGGG", "isoWeekYear");
  3323. addWeekYearFormatToken("GGGGG", "isoWeekYear");
  3324. addRegexToken("G", matchSigned);
  3325. addRegexToken("g", matchSigned);
  3326. addRegexToken("GG", match1to2, match2);
  3327. addRegexToken("gg", match1to2, match2);
  3328. addRegexToken("GGGG", match1to4, match4);
  3329. addRegexToken("gggg", match1to4, match4);
  3330. addRegexToken("GGGGG", match1to6, match6);
  3331. addRegexToken("ggggg", match1to6, match6);
  3332. addWeekParseToken(
  3333. ["gggg", "ggggg", "GGGG", "GGGGG"],
  3334. function(input, week, config, token2) {
  3335. week[token2.substr(0, 2)] = toInt(input);
  3336. }
  3337. );
  3338. addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
  3339. week[token2] = hooks.parseTwoDigitYear(input);
  3340. });
  3341. function getSetWeekYear(input) {
  3342. return getSetWeekYearHelper.call(
  3343. this,
  3344. input,
  3345. this.week(),
  3346. this.weekday() + this.localeData()._week.dow,
  3347. this.localeData()._week.dow,
  3348. this.localeData()._week.doy
  3349. );
  3350. }
  3351. function getSetISOWeekYear(input) {
  3352. return getSetWeekYearHelper.call(
  3353. this,
  3354. input,
  3355. this.isoWeek(),
  3356. this.isoWeekday(),
  3357. 1,
  3358. 4
  3359. );
  3360. }
  3361. function getISOWeeksInYear() {
  3362. return weeksInYear(this.year(), 1, 4);
  3363. }
  3364. function getISOWeeksInISOWeekYear() {
  3365. return weeksInYear(this.isoWeekYear(), 1, 4);
  3366. }
  3367. function getWeeksInYear() {
  3368. var weekInfo = this.localeData()._week;
  3369. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  3370. }
  3371. function getWeeksInWeekYear() {
  3372. var weekInfo = this.localeData()._week;
  3373. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  3374. }
  3375. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  3376. var weeksTarget;
  3377. if (input == null) {
  3378. return weekOfYear(this, dow, doy).year;
  3379. } else {
  3380. weeksTarget = weeksInYear(input, dow, doy);
  3381. if (week > weeksTarget) {
  3382. week = weeksTarget;
  3383. }
  3384. return setWeekAll.call(this, input, week, weekday, dow, doy);
  3385. }
  3386. }
  3387. function setWeekAll(weekYear, week, weekday, dow, doy) {
  3388. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  3389. this.year(date.getUTCFullYear());
  3390. this.month(date.getUTCMonth());
  3391. this.date(date.getUTCDate());
  3392. return this;
  3393. }
  3394. addFormatToken("Q", 0, "Qo", "quarter");
  3395. addRegexToken("Q", match1);
  3396. addParseToken("Q", function(input, array) {
  3397. array[MONTH] = (toInt(input) - 1) * 3;
  3398. });
  3399. function getSetQuarter(input) {
  3400. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  3401. }
  3402. addFormatToken("D", ["DD", 2], "Do", "date");
  3403. addRegexToken("D", match1to2, match1to2NoLeadingZero);
  3404. addRegexToken("DD", match1to2, match2);
  3405. addRegexToken("Do", function(isStrict, locale2) {
  3406. return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
  3407. });
  3408. addParseToken(["D", "DD"], DATE);
  3409. addParseToken("Do", function(input, array) {
  3410. array[DATE] = toInt(input.match(match1to2)[0]);
  3411. });
  3412. var getSetDayOfMonth = makeGetSet("Date", true);
  3413. addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
  3414. addRegexToken("DDD", match1to3);
  3415. addRegexToken("DDDD", match3);
  3416. addParseToken(["DDD", "DDDD"], function(input, array, config) {
  3417. config._dayOfYear = toInt(input);
  3418. });
  3419. function getSetDayOfYear(input) {
  3420. var dayOfYear = Math.round(
  3421. (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
  3422. ) + 1;
  3423. return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
  3424. }
  3425. addFormatToken("m", ["mm", 2], 0, "minute");
  3426. addRegexToken("m", match1to2, match1to2HasZero);
  3427. addRegexToken("mm", match1to2, match2);
  3428. addParseToken(["m", "mm"], MINUTE);
  3429. var getSetMinute = makeGetSet("Minutes", false);
  3430. addFormatToken("s", ["ss", 2], 0, "second");
  3431. addRegexToken("s", match1to2, match1to2HasZero);
  3432. addRegexToken("ss", match1to2, match2);
  3433. addParseToken(["s", "ss"], SECOND);
  3434. var getSetSecond = makeGetSet("Seconds", false);
  3435. addFormatToken("S", 0, 0, function() {
  3436. return ~~(this.millisecond() / 100);
  3437. });
  3438. addFormatToken(0, ["SS", 2], 0, function() {
  3439. return ~~(this.millisecond() / 10);
  3440. });
  3441. addFormatToken(0, ["SSS", 3], 0, "millisecond");
  3442. addFormatToken(0, ["SSSS", 4], 0, function() {
  3443. return this.millisecond() * 10;
  3444. });
  3445. addFormatToken(0, ["SSSSS", 5], 0, function() {
  3446. return this.millisecond() * 100;
  3447. });
  3448. addFormatToken(0, ["SSSSSS", 6], 0, function() {
  3449. return this.millisecond() * 1e3;
  3450. });
  3451. addFormatToken(0, ["SSSSSSS", 7], 0, function() {
  3452. return this.millisecond() * 1e4;
  3453. });
  3454. addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
  3455. return this.millisecond() * 1e5;
  3456. });
  3457. addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
  3458. return this.millisecond() * 1e6;
  3459. });
  3460. addRegexToken("S", match1to3, match1);
  3461. addRegexToken("SS", match1to3, match2);
  3462. addRegexToken("SSS", match1to3, match3);
  3463. var token;
  3464. var getSetMillisecond;
  3465. for (token = "SSSS"; token.length <= 9; token += "S") {
  3466. addRegexToken(token, matchUnsigned);
  3467. }
  3468. function parseMs(input, array) {
  3469. array[MILLISECOND] = toInt(("0." + input) * 1e3);
  3470. }
  3471. for (token = "S"; token.length <= 9; token += "S") {
  3472. addParseToken(token, parseMs);
  3473. }
  3474. getSetMillisecond = makeGetSet("Milliseconds", false);
  3475. addFormatToken("z", 0, 0, "zoneAbbr");
  3476. addFormatToken("zz", 0, 0, "zoneName");
  3477. function getZoneAbbr() {
  3478. return this._isUTC ? "UTC" : "";
  3479. }
  3480. function getZoneName() {
  3481. return this._isUTC ? "Coordinated Universal Time" : "";
  3482. }
  3483. var proto = Moment.prototype;
  3484. proto.add = add;
  3485. proto.calendar = calendar$1;
  3486. proto.clone = clone;
  3487. proto.diff = diff;
  3488. proto.endOf = endOf;
  3489. proto.format = format;
  3490. proto.from = from;
  3491. proto.fromNow = fromNow;
  3492. proto.to = to;
  3493. proto.toNow = toNow;
  3494. proto.get = stringGet;
  3495. proto.invalidAt = invalidAt;
  3496. proto.isAfter = isAfter;
  3497. proto.isBefore = isBefore;
  3498. proto.isBetween = isBetween;
  3499. proto.isSame = isSame;
  3500. proto.isSameOrAfter = isSameOrAfter;
  3501. proto.isSameOrBefore = isSameOrBefore;
  3502. proto.isValid = isValid$2;
  3503. proto.lang = lang;
  3504. proto.locale = locale;
  3505. proto.localeData = localeData;
  3506. proto.max = prototypeMax;
  3507. proto.min = prototypeMin;
  3508. proto.parsingFlags = parsingFlags;
  3509. proto.set = stringSet;
  3510. proto.startOf = startOf;
  3511. proto.subtract = subtract;
  3512. proto.toArray = toArray;
  3513. proto.toObject = toObject;
  3514. proto.toDate = toDate;
  3515. proto.toISOString = toISOString;
  3516. proto.inspect = inspect;
  3517. if (typeof Symbol !== "undefined" && Symbol.for != null) {
  3518. proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
  3519. return "Moment<" + this.format() + ">";
  3520. };
  3521. }
  3522. proto.toJSON = toJSON;
  3523. proto.toString = toString;
  3524. proto.unix = unix;
  3525. proto.valueOf = valueOf;
  3526. proto.creationData = creationData;
  3527. proto.eraName = getEraName;
  3528. proto.eraNarrow = getEraNarrow;
  3529. proto.eraAbbr = getEraAbbr;
  3530. proto.eraYear = getEraYear;
  3531. proto.year = getSetYear;
  3532. proto.isLeapYear = getIsLeapYear;
  3533. proto.weekYear = getSetWeekYear;
  3534. proto.isoWeekYear = getSetISOWeekYear;
  3535. proto.quarter = proto.quarters = getSetQuarter;
  3536. proto.month = getSetMonth;
  3537. proto.daysInMonth = getDaysInMonth;
  3538. proto.week = proto.weeks = getSetWeek;
  3539. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  3540. proto.weeksInYear = getWeeksInYear;
  3541. proto.weeksInWeekYear = getWeeksInWeekYear;
  3542. proto.isoWeeksInYear = getISOWeeksInYear;
  3543. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  3544. proto.date = getSetDayOfMonth;
  3545. proto.day = proto.days = getSetDayOfWeek;
  3546. proto.weekday = getSetLocaleDayOfWeek;
  3547. proto.isoWeekday = getSetISODayOfWeek;
  3548. proto.dayOfYear = getSetDayOfYear;
  3549. proto.hour = proto.hours = getSetHour;
  3550. proto.minute = proto.minutes = getSetMinute;
  3551. proto.second = proto.seconds = getSetSecond;
  3552. proto.millisecond = proto.milliseconds = getSetMillisecond;
  3553. proto.utcOffset = getSetOffset;
  3554. proto.utc = setOffsetToUTC;
  3555. proto.local = setOffsetToLocal;
  3556. proto.parseZone = setOffsetToParsedOffset;
  3557. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  3558. proto.isDST = isDaylightSavingTime;
  3559. proto.isLocal = isLocal;
  3560. proto.isUtcOffset = isUtcOffset;
  3561. proto.isUtc = isUtc;
  3562. proto.isUTC = isUtc;
  3563. proto.zoneAbbr = getZoneAbbr;
  3564. proto.zoneName = getZoneName;
  3565. proto.dates = deprecate(
  3566. "dates accessor is deprecated. Use date instead.",
  3567. getSetDayOfMonth
  3568. );
  3569. proto.months = deprecate(
  3570. "months accessor is deprecated. Use month instead",
  3571. getSetMonth
  3572. );
  3573. proto.years = deprecate(
  3574. "years accessor is deprecated. Use year instead",
  3575. getSetYear
  3576. );
  3577. proto.zone = deprecate(
  3578. "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
  3579. getSetZone
  3580. );
  3581. proto.isDSTShifted = deprecate(
  3582. "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
  3583. isDaylightSavingTimeShifted
  3584. );
  3585. function createUnix(input) {
  3586. return createLocal(input * 1e3);
  3587. }
  3588. function createInZone() {
  3589. return createLocal.apply(null, arguments).parseZone();
  3590. }
  3591. function preParsePostFormat(string) {
  3592. return string;
  3593. }
  3594. var proto$1 = Locale.prototype;
  3595. proto$1.calendar = calendar;
  3596. proto$1.longDateFormat = longDateFormat;
  3597. proto$1.invalidDate = invalidDate;
  3598. proto$1.ordinal = ordinal;
  3599. proto$1.preparse = preParsePostFormat;
  3600. proto$1.postformat = preParsePostFormat;
  3601. proto$1.relativeTime = relativeTime;
  3602. proto$1.pastFuture = pastFuture;
  3603. proto$1.set = set;
  3604. proto$1.eras = localeEras;
  3605. proto$1.erasParse = localeErasParse;
  3606. proto$1.erasConvertYear = localeErasConvertYear;
  3607. proto$1.erasAbbrRegex = erasAbbrRegex;
  3608. proto$1.erasNameRegex = erasNameRegex;
  3609. proto$1.erasNarrowRegex = erasNarrowRegex;
  3610. proto$1.months = localeMonths;
  3611. proto$1.monthsShort = localeMonthsShort;
  3612. proto$1.monthsParse = localeMonthsParse;
  3613. proto$1.monthsRegex = monthsRegex;
  3614. proto$1.monthsShortRegex = monthsShortRegex;
  3615. proto$1.week = localeWeek;
  3616. proto$1.firstDayOfYear = localeFirstDayOfYear;
  3617. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  3618. proto$1.weekdays = localeWeekdays;
  3619. proto$1.weekdaysMin = localeWeekdaysMin;
  3620. proto$1.weekdaysShort = localeWeekdaysShort;
  3621. proto$1.weekdaysParse = localeWeekdaysParse;
  3622. proto$1.weekdaysRegex = weekdaysRegex;
  3623. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  3624. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  3625. proto$1.isPM = localeIsPM;
  3626. proto$1.meridiem = localeMeridiem;
  3627. function get$1(format2, index, field, setter) {
  3628. var locale2 = getLocale(), utc = createUTC().set(setter, index);
  3629. return locale2[field](utc, format2);
  3630. }
  3631. function listMonthsImpl(format2, index, field) {
  3632. if (isNumber(format2)) {
  3633. index = format2;
  3634. format2 = void 0;
  3635. }
  3636. format2 = format2 || "";
  3637. if (index != null) {
  3638. return get$1(format2, index, field, "month");
  3639. }
  3640. var i, out = [];
  3641. for (i = 0; i < 12; i++) {
  3642. out[i] = get$1(format2, i, field, "month");
  3643. }
  3644. return out;
  3645. }
  3646. function listWeekdaysImpl(localeSorted, format2, index, field) {
  3647. if (typeof localeSorted === "boolean") {
  3648. if (isNumber(format2)) {
  3649. index = format2;
  3650. format2 = void 0;
  3651. }
  3652. format2 = format2 || "";
  3653. } else {
  3654. format2 = localeSorted;
  3655. index = format2;
  3656. localeSorted = false;
  3657. if (isNumber(format2)) {
  3658. index = format2;
  3659. format2 = void 0;
  3660. }
  3661. format2 = format2 || "";
  3662. }
  3663. var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i, out = [];
  3664. if (index != null) {
  3665. return get$1(format2, (index + shift) % 7, field, "day");
  3666. }
  3667. for (i = 0; i < 7; i++) {
  3668. out[i] = get$1(format2, (i + shift) % 7, field, "day");
  3669. }
  3670. return out;
  3671. }
  3672. function listMonths(format2, index) {
  3673. return listMonthsImpl(format2, index, "months");
  3674. }
  3675. function listMonthsShort(format2, index) {
  3676. return listMonthsImpl(format2, index, "monthsShort");
  3677. }
  3678. function listWeekdays(localeSorted, format2, index) {
  3679. return listWeekdaysImpl(localeSorted, format2, index, "weekdays");
  3680. }
  3681. function listWeekdaysShort(localeSorted, format2, index) {
  3682. return listWeekdaysImpl(localeSorted, format2, index, "weekdaysShort");
  3683. }
  3684. function listWeekdaysMin(localeSorted, format2, index) {
  3685. return listWeekdaysImpl(localeSorted, format2, index, "weekdaysMin");
  3686. }
  3687. getSetGlobalLocale("en", {
  3688. eras: [
  3689. {
  3690. since: "0001-01-01",
  3691. until: Infinity,
  3692. offset: 1,
  3693. name: "Anno Domini",
  3694. narrow: "AD",
  3695. abbr: "AD"
  3696. },
  3697. {
  3698. since: "0000-12-31",
  3699. until: -Infinity,
  3700. offset: 1,
  3701. name: "Before Christ",
  3702. narrow: "BC",
  3703. abbr: "BC"
  3704. }
  3705. ],
  3706. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  3707. ordinal: function(number) {
  3708. var b = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
  3709. return number + output;
  3710. }
  3711. });
  3712. hooks.lang = deprecate(
  3713. "moment.lang is deprecated. Use moment.locale instead.",
  3714. getSetGlobalLocale
  3715. );
  3716. hooks.langData = deprecate(
  3717. "moment.langData is deprecated. Use moment.localeData instead.",
  3718. getLocale
  3719. );
  3720. var mathAbs = Math.abs;
  3721. function abs() {
  3722. var data = this._data;
  3723. this._milliseconds = mathAbs(this._milliseconds);
  3724. this._days = mathAbs(this._days);
  3725. this._months = mathAbs(this._months);
  3726. data.milliseconds = mathAbs(data.milliseconds);
  3727. data.seconds = mathAbs(data.seconds);
  3728. data.minutes = mathAbs(data.minutes);
  3729. data.hours = mathAbs(data.hours);
  3730. data.months = mathAbs(data.months);
  3731. data.years = mathAbs(data.years);
  3732. return this;
  3733. }
  3734. function addSubtract$1(duration, input, value, direction) {
  3735. var other = createDuration(input, value);
  3736. duration._milliseconds += direction * other._milliseconds;
  3737. duration._days += direction * other._days;
  3738. duration._months += direction * other._months;
  3739. return duration._bubble();
  3740. }
  3741. function add$1(input, value) {
  3742. return addSubtract$1(this, input, value, 1);
  3743. }
  3744. function subtract$1(input, value) {
  3745. return addSubtract$1(this, input, value, -1);
  3746. }
  3747. function absCeil(number) {
  3748. if (number < 0) {
  3749. return Math.floor(number);
  3750. } else {
  3751. return Math.ceil(number);
  3752. }
  3753. }
  3754. function bubble() {
  3755. var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
  3756. if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
  3757. milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
  3758. days2 = 0;
  3759. months2 = 0;
  3760. }
  3761. data.milliseconds = milliseconds2 % 1e3;
  3762. seconds2 = absFloor(milliseconds2 / 1e3);
  3763. data.seconds = seconds2 % 60;
  3764. minutes2 = absFloor(seconds2 / 60);
  3765. data.minutes = minutes2 % 60;
  3766. hours2 = absFloor(minutes2 / 60);
  3767. data.hours = hours2 % 24;
  3768. days2 += absFloor(hours2 / 24);
  3769. monthsFromDays = absFloor(daysToMonths(days2));
  3770. months2 += monthsFromDays;
  3771. days2 -= absCeil(monthsToDays(monthsFromDays));
  3772. years2 = absFloor(months2 / 12);
  3773. months2 %= 12;
  3774. data.days = days2;
  3775. data.months = months2;
  3776. data.years = years2;
  3777. return this;
  3778. }
  3779. function daysToMonths(days2) {
  3780. return days2 * 4800 / 146097;
  3781. }
  3782. function monthsToDays(months2) {
  3783. return months2 * 146097 / 4800;
  3784. }
  3785. function as(units) {
  3786. if (!this.isValid()) {
  3787. return NaN;
  3788. }
  3789. var days2, months2, milliseconds2 = this._milliseconds;
  3790. units = normalizeUnits(units);
  3791. if (units === "month" || units === "quarter" || units === "year") {
  3792. days2 = this._days + milliseconds2 / 864e5;
  3793. months2 = this._months + daysToMonths(days2);
  3794. switch (units) {
  3795. case "month":
  3796. return months2;
  3797. case "quarter":
  3798. return months2 / 3;
  3799. case "year":
  3800. return months2 / 12;
  3801. }
  3802. } else {
  3803. days2 = this._days + Math.round(monthsToDays(this._months));
  3804. switch (units) {
  3805. case "week":
  3806. return days2 / 7 + milliseconds2 / 6048e5;
  3807. case "day":
  3808. return days2 + milliseconds2 / 864e5;
  3809. case "hour":
  3810. return days2 * 24 + milliseconds2 / 36e5;
  3811. case "minute":
  3812. return days2 * 1440 + milliseconds2 / 6e4;
  3813. case "second":
  3814. return days2 * 86400 + milliseconds2 / 1e3;
  3815. case "millisecond":
  3816. return Math.floor(days2 * 864e5) + milliseconds2;
  3817. default:
  3818. throw new Error("Unknown unit " + units);
  3819. }
  3820. }
  3821. }
  3822. function makeAs(alias) {
  3823. return function() {
  3824. return this.as(alias);
  3825. };
  3826. }
  3827. var asMilliseconds = makeAs("ms");
  3828. var asSeconds = makeAs("s");
  3829. var asMinutes = makeAs("m");
  3830. var asHours = makeAs("h");
  3831. var asDays = makeAs("d");
  3832. var asWeeks = makeAs("w");
  3833. var asMonths = makeAs("M");
  3834. var asQuarters = makeAs("Q");
  3835. var asYears = makeAs("y");
  3836. var valueOf$1 = asMilliseconds;
  3837. function clone$1() {
  3838. return createDuration(this);
  3839. }
  3840. function get$2(units) {
  3841. units = normalizeUnits(units);
  3842. return this.isValid() ? this[units + "s"]() : NaN;
  3843. }
  3844. function makeGetter(name) {
  3845. return function() {
  3846. return this.isValid() ? this._data[name] : NaN;
  3847. };
  3848. }
  3849. var milliseconds = makeGetter("milliseconds");
  3850. var seconds = makeGetter("seconds");
  3851. var minutes = makeGetter("minutes");
  3852. var hours = makeGetter("hours");
  3853. var days = makeGetter("days");
  3854. var months = makeGetter("months");
  3855. var years = makeGetter("years");
  3856. function weeks() {
  3857. return absFloor(this.days() / 7);
  3858. }
  3859. var round = Math.round;
  3860. var thresholds = {
  3861. ss: 44,
  3862. // a few seconds to seconds
  3863. s: 45,
  3864. // seconds to minute
  3865. m: 45,
  3866. // minutes to hour
  3867. h: 22,
  3868. // hours to day
  3869. d: 26,
  3870. // days to month/week
  3871. w: null,
  3872. // weeks to month
  3873. M: 11
  3874. // months to year
  3875. };
  3876. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
  3877. return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  3878. }
  3879. function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
  3880. var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
  3881. if (thresholds2.w != null) {
  3882. a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
  3883. }
  3884. a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
  3885. a[2] = withoutSuffix;
  3886. a[3] = +posNegDuration > 0;
  3887. a[4] = locale2;
  3888. return substituteTimeAgo.apply(null, a);
  3889. }
  3890. function getSetRelativeTimeRounding(roundingFunction) {
  3891. if (roundingFunction === void 0) {
  3892. return round;
  3893. }
  3894. if (typeof roundingFunction === "function") {
  3895. round = roundingFunction;
  3896. return true;
  3897. }
  3898. return false;
  3899. }
  3900. function getSetRelativeTimeThreshold(threshold, limit) {
  3901. if (thresholds[threshold] === void 0) {
  3902. return false;
  3903. }
  3904. if (limit === void 0) {
  3905. return thresholds[threshold];
  3906. }
  3907. thresholds[threshold] = limit;
  3908. if (threshold === "s") {
  3909. thresholds.ss = limit - 1;
  3910. }
  3911. return true;
  3912. }
  3913. function humanize(argWithSuffix, argThresholds) {
  3914. if (!this.isValid()) {
  3915. return this.localeData().invalidDate();
  3916. }
  3917. var withSuffix = false, th = thresholds, locale2, output;
  3918. if (typeof argWithSuffix === "object") {
  3919. argThresholds = argWithSuffix;
  3920. argWithSuffix = false;
  3921. }
  3922. if (typeof argWithSuffix === "boolean") {
  3923. withSuffix = argWithSuffix;
  3924. }
  3925. if (typeof argThresholds === "object") {
  3926. th = Object.assign({}, thresholds, argThresholds);
  3927. if (argThresholds.s != null && argThresholds.ss == null) {
  3928. th.ss = argThresholds.s - 1;
  3929. }
  3930. }
  3931. locale2 = this.localeData();
  3932. output = relativeTime$1(this, !withSuffix, th, locale2);
  3933. if (withSuffix) {
  3934. output = locale2.pastFuture(+this, output);
  3935. }
  3936. return locale2.postformat(output);
  3937. }
  3938. var abs$1 = Math.abs;
  3939. function sign(x) {
  3940. return (x > 0) - (x < 0) || +x;
  3941. }
  3942. function toISOString$1() {
  3943. if (!this.isValid()) {
  3944. return this.localeData().invalidDate();
  3945. }
  3946. var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
  3947. if (!total) {
  3948. return "P0D";
  3949. }
  3950. minutes2 = absFloor(seconds2 / 60);
  3951. hours2 = absFloor(minutes2 / 60);
  3952. seconds2 %= 60;
  3953. minutes2 %= 60;
  3954. years2 = absFloor(months2 / 12);
  3955. months2 %= 12;
  3956. s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
  3957. totalSign = total < 0 ? "-" : "";
  3958. ymSign = sign(this._months) !== sign(total) ? "-" : "";
  3959. daysSign = sign(this._days) !== sign(total) ? "-" : "";
  3960. hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
  3961. return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
  3962. }
  3963. var proto$2 = Duration.prototype;
  3964. proto$2.isValid = isValid$1;
  3965. proto$2.abs = abs;
  3966. proto$2.add = add$1;
  3967. proto$2.subtract = subtract$1;
  3968. proto$2.as = as;
  3969. proto$2.asMilliseconds = asMilliseconds;
  3970. proto$2.asSeconds = asSeconds;
  3971. proto$2.asMinutes = asMinutes;
  3972. proto$2.asHours = asHours;
  3973. proto$2.asDays = asDays;
  3974. proto$2.asWeeks = asWeeks;
  3975. proto$2.asMonths = asMonths;
  3976. proto$2.asQuarters = asQuarters;
  3977. proto$2.asYears = asYears;
  3978. proto$2.valueOf = valueOf$1;
  3979. proto$2._bubble = bubble;
  3980. proto$2.clone = clone$1;
  3981. proto$2.get = get$2;
  3982. proto$2.milliseconds = milliseconds;
  3983. proto$2.seconds = seconds;
  3984. proto$2.minutes = minutes;
  3985. proto$2.hours = hours;
  3986. proto$2.days = days;
  3987. proto$2.weeks = weeks;
  3988. proto$2.months = months;
  3989. proto$2.years = years;
  3990. proto$2.humanize = humanize;
  3991. proto$2.toISOString = toISOString$1;
  3992. proto$2.toString = toISOString$1;
  3993. proto$2.toJSON = toISOString$1;
  3994. proto$2.locale = locale;
  3995. proto$2.localeData = localeData;
  3996. proto$2.toIsoString = deprecate(
  3997. "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
  3998. toISOString$1
  3999. );
  4000. proto$2.lang = lang;
  4001. addFormatToken("X", 0, 0, "unix");
  4002. addFormatToken("x", 0, 0, "valueOf");
  4003. addRegexToken("x", matchSigned);
  4004. addRegexToken("X", matchTimestamp);
  4005. addParseToken("X", function(input, array, config) {
  4006. config._d = new Date(parseFloat(input) * 1e3);
  4007. });
  4008. addParseToken("x", function(input, array, config) {
  4009. config._d = new Date(toInt(input));
  4010. });
  4011. hooks.version = "2.30.1";
  4012. setHookCallback(createLocal);
  4013. hooks.fn = proto;
  4014. hooks.min = min;
  4015. hooks.max = max;
  4016. hooks.now = now;
  4017. hooks.utc = createUTC;
  4018. hooks.unix = createUnix;
  4019. hooks.months = listMonths;
  4020. hooks.isDate = isDate;
  4021. hooks.locale = getSetGlobalLocale;
  4022. hooks.invalid = createInvalid;
  4023. hooks.duration = createDuration;
  4024. hooks.isMoment = isMoment;
  4025. hooks.weekdays = listWeekdays;
  4026. hooks.parseZone = createInZone;
  4027. hooks.localeData = getLocale;
  4028. hooks.isDuration = isDuration;
  4029. hooks.monthsShort = listMonthsShort;
  4030. hooks.weekdaysMin = listWeekdaysMin;
  4031. hooks.defineLocale = defineLocale;
  4032. hooks.updateLocale = updateLocale;
  4033. hooks.locales = listLocales;
  4034. hooks.weekdaysShort = listWeekdaysShort;
  4035. hooks.normalizeUnits = normalizeUnits;
  4036. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  4037. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  4038. hooks.calendarFormat = getCalendarFormat;
  4039. hooks.prototype = proto;
  4040. hooks.HTML5_FMT = {
  4041. DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
  4042. // <input type="datetime-local" />
  4043. DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
  4044. // <input type="datetime-local" step="1" />
  4045. DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
  4046. // <input type="datetime-local" step="0.001" />
  4047. DATE: "YYYY-MM-DD",
  4048. // <input type="date" />
  4049. TIME: "HH:mm",
  4050. // <input type="time" />
  4051. TIME_SECONDS: "HH:mm:ss",
  4052. // <input type="time" step="1" />
  4053. TIME_MS: "HH:mm:ss.SSS",
  4054. // <input type="time" step="0.001" />
  4055. WEEK: "GGGG-[W]WW",
  4056. // <input type="week" />
  4057. MONTH: "YYYY-MM"
  4058. // <input type="month" />
  4059. };
  4060. var moment_default = hooks;
  4061. export {
  4062. moment_default as default
  4063. };
  4064. /*! Bundled license information:
  4065. moment/dist/moment.js:
  4066. (*! moment.js *)
  4067. (*! version : 2.30.1 *)
  4068. (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
  4069. (*! license : MIT *)
  4070. (*! momentjs.com *)
  4071. */
  4072. //# sourceMappingURL=moment.js.map