UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1 lines 59.2 kB
(function(T,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../button-edit/index.umd.js"),require("../common/index.umd.js"),require("../locale/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","../common/index.umd.js","../locale/index.umd.js"],i):(T=typeof globalThis<"u"?globalThis:T||self,i(T["time-picker"]={},T.Vue,T.FButtonEdit,T.common,T.locale))})(this,function(T,i,Q,Pe,Ue){"use strict";var nn=Object.defineProperty;var an=(T,i,Q)=>i in T?nn(T,i,{enumerable:!0,configurable:!0,writable:!0,value:Q}):T[i]=Q;var u=(T,i,Q)=>an(T,typeof i!="symbol"?i+"":i,Q);const Te={modelValue:{type:String,default:""},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},popupClassName:{type:String,default:""},placeholder:{type:String,default:"请选择时间"},placement:{type:String,default:"auto"},defaultOpenValue:{type:Date,default:null},format:{type:String,default:"HH:mm:ss"},isOpen:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!1},use12Hours:{type:Boolean,default:!1},disabledHours:{type:Function,default:null},disabledMinutes:{type:Function,default:null},disabledSeconds:{type:Function,default:null},hideDisabledElements:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0}},ke={modelValue:{type:String,default:""},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},defaultOpenValue:{type:Date,default:null},disabledHours:{type:Function,default:null},disabledMinutes:{type:Function,default:null},disabledSeconds:{type:Function,default:null},format:{type:String,default:"HH:mm:ss"},isOpen:{type:Boolean,default:!1},use12Hours:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!1},hideDisabledElements:{type:Boolean,default:!1},inDatePicker:{type:Boolean,default:!1},headerLabels:{type:Object,default:null}};function Y(t){const n=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&n==="[object Date]"?new t.constructor(+t):typeof t=="number"||n==="[object Number]"||typeof t=="string"||n==="[object String]"?new Date(t):new Date(NaN)}function D(t,n){return t instanceof Date?new t.constructor(n):new Date(n)}function De(t,n){const e=Y(t);return isNaN(n)?D(t,NaN):(n&&e.setDate(e.getDate()+n),e)}const Oe=6048e5,Ze=864e5,ze=6e4,Je=36e5,Ke=1e3;let et={};function A(){return et}function S(t,n){var d,w,y,h;const e=A(),r=(n==null?void 0:n.weekStartsOn)??((w=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:w.weekStartsOn)??e.weekStartsOn??((h=(y=e.locale)==null?void 0:y.options)==null?void 0:h.weekStartsOn)??0,a=Y(t),s=a.getDay(),l=(s<r?7:0)+s-r;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function X(t){return S(t,{weekStartsOn:1})}function ve(t){const n=Y(t),e=n.getFullYear(),r=D(t,0);r.setFullYear(e+1,0,4),r.setHours(0,0,0,0);const a=X(r),s=D(t,0);s.setFullYear(e,0,4),s.setHours(0,0,0,0);const l=X(s);return n.getTime()>=a.getTime()?e+1:n.getTime()>=l.getTime()?e:e-1}function Ve(t){const n=Y(t);return n.setHours(0,0,0,0),n}function re(t){const n=Y(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function tt(t,n){const e=Ve(t),r=Ve(n),a=+e-re(e),s=+r-re(r);return Math.round((a-s)/Ze)}function rt(t){const n=ve(t),e=D(t,0);return e.setFullYear(n,0,4),e.setHours(0,0,0,0),X(e)}function nt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ne(t){if(!nt(t)&&typeof t!="number")return!1;const n=Y(t);return!isNaN(Number(n))}function at(t){const n=Y(t),e=D(t,0);return e.setFullYear(n.getFullYear(),0,1),e.setHours(0,0,0,0),e}const st={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=(t,n,e)=>{let r;const a=st[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function de(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ut={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ct={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lt={date:de({formats:ot,defaultWidth:"full"}),time:de({formats:ut,defaultWidth:"full"}),dateTime:de({formats:ct,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ft=(t,n,e,r)=>dt[t];function Z(t){return(n,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,d=e!=null&&e.width?String(e.width):l;a=t.formattingValues[d]||t.formattingValues[l]}else{const l=t.defaultWidth,d=e!=null&&e.width?String(e.width):t.defaultWidth;a=t.values[d]||t.values[l]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const ht={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},yt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},gt={ordinalNumber:(t,n)=>{const e=Number(t),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Z({values:ht,defaultWidth:"wide"}),quarter:Z({values:mt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Z({values:wt,defaultWidth:"wide"}),day:Z({values:yt,defaultWidth:"wide"}),dayPeriod:Z({values:pt,defaultWidth:"wide",formattingValues:bt,defaultFormattingWidth:"wide"})};function z(t){return(n,e={})=>{const r=e.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const l=s[0],d=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],w=Array.isArray(d)?Mt(d,p=>p.test(l)):xt(d,p=>p.test(l));let y;y=t.valueCallback?t.valueCallback(w):w,y=e.valueCallback?e.valueCallback(y):y;const h=n.slice(l.length);return{value:y,rest:h}}}function xt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function Mt(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ht(t){return(n,e={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let l=t.valueCallback?t.valueCallback(s[0]):s[0];l=e.valueCallback?e.valueCallback(l):l;const d=n.slice(a.length);return{value:l,rest:d}}}const Pt=/^(\d+)(th|st|nd|rd)?/i,Tt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dt={any:[/^b/i,/^(a|c)/i]},Ot={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Vt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Nt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Et={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Ht({matchPattern:Pt,parsePattern:Tt,valueCallback:t=>parseInt(t,10)}),era:z({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Dt,defaultParseWidth:"any"}),quarter:z({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:z({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:Nt,defaultParseWidth:"any"}),day:z({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Et,defaultParseWidth:"any"}),dayPeriod:z({matchPatterns:Wt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ye={code:"en-US",formatDistance:it,formatLong:lt,formatRelative:ft,localize:gt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qt(t){const n=Y(t);return tt(n,at(n))+1}function Ee(t){const n=Y(t),e=+X(n)-+rt(n);return Math.round(e/Oe)+1}function fe(t,n){var h,p,o,b;const e=Y(t),r=e.getFullYear(),a=A(),s=(n==null?void 0:n.firstWeekContainsDate)??((p=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(o=a.locale)==null?void 0:o.options)==null?void 0:b.firstWeekContainsDate)??1,l=D(t,0);l.setFullYear(r+1,0,s),l.setHours(0,0,0,0);const d=S(l,n),w=D(t,0);w.setFullYear(r,0,s),w.setHours(0,0,0,0);const y=S(w,n);return e.getTime()>=d.getTime()?r+1:e.getTime()>=y.getTime()?r:r-1}function Lt(t,n){var d,w,y,h;const e=A(),r=(n==null?void 0:n.firstWeekContainsDate)??((w=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:w.firstWeekContainsDate)??e.firstWeekContainsDate??((h=(y=e.locale)==null?void 0:y.options)==null?void 0:h.firstWeekContainsDate)??1,a=fe(t,n),s=D(t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),S(s,n)}function We(t,n){const e=Y(t),r=+S(e,n)-+Lt(e,n);return Math.round(r/Oe)+1}function H(t,n){const e=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return e+r}const I={y(t,n){const e=t.getFullYear(),r=e>0?e:1-e;return H(n==="yy"?r%100:r,n.length)},M(t,n){const e=t.getMonth();return n==="M"?String(e+1):H(e+1,2)},d(t,n){return H(t.getDate(),n.length)},a(t,n){const e=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(t,n){return H(t.getHours()%12||12,n.length)},H(t,n){return H(t.getHours(),n.length)},m(t,n){return H(t.getMinutes(),n.length)},s(t,n){return H(t.getSeconds(),n.length)},S(t,n){const e=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,e-3));return H(a,n.length)}},j={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ce={G:function(t,n,e){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return e.ordinalNumber(a,{unit:"year"})}return I.y(t,n)},Y:function(t,n,e,r){const a=fe(t,r),s=a>0?a:1-a;if(n==="YY"){const l=s%100;return H(l,2)}return n==="Yo"?e.ordinalNumber(s,{unit:"year"}):H(s,n.length)},R:function(t,n){const e=ve(t);return H(e,n.length)},u:function(t,n){const e=t.getFullYear();return H(e,n.length)},Q:function(t,n,e){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return H(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return H(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){const r=t.getMonth();switch(n){case"M":case"MM":return I.M(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return H(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){const a=We(t,r);return n==="wo"?e.ordinalNumber(a,{unit:"week"}):H(a,n.length)},I:function(t,n,e){const r=Ee(t);return n==="Io"?e.ordinalNumber(r,{unit:"week"}):H(r,n.length)},d:function(t,n,e){return n==="do"?e.ordinalNumber(t.getDate(),{unit:"date"}):I.d(t,n)},D:function(t,n,e){const r=qt(t);return n==="Do"?e.ordinalNumber(r,{unit:"dayOfYear"}):H(r,n.length)},E:function(t,n,e){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return H(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return H(s,n.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,e){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return H(a,n.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,e){const r=t.getHours();let a;switch(r===12?a=j.noon:r===0?a=j.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,e){const r=t.getHours();let a;switch(r>=17?a=j.evening:r>=12?a=j.afternoon:r>=4?a=j.morning:a=j.night,n){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,e){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return I.h(t,n)},H:function(t,n,e){return n==="Ho"?e.ordinalNumber(t.getHours(),{unit:"hour"}):I.H(t,n)},K:function(t,n,e){const r=t.getHours()%12;return n==="Ko"?e.ordinalNumber(r,{unit:"hour"}):H(r,n.length)},k:function(t,n,e){let r=t.getHours();return r===0&&(r=24),n==="ko"?e.ordinalNumber(r,{unit:"hour"}):H(r,n.length)},m:function(t,n,e){return n==="mo"?e.ordinalNumber(t.getMinutes(),{unit:"minute"}):I.m(t,n)},s:function(t,n,e){return n==="so"?e.ordinalNumber(t.getSeconds(),{unit:"second"}):I.s(t,n)},S:function(t,n){return I.S(t,n)},X:function(t,n,e){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return qe(r);case"XXXX":case"XX":return R(r);case"XXXXX":case"XXX":default:return R(r,":")}},x:function(t,n,e){const r=t.getTimezoneOffset();switch(n){case"x":return qe(r);case"xxxx":case"xx":return R(r);case"xxxxx":case"xxx":default:return R(r,":")}},O:function(t,n,e){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+_e(r,":");case"OOOO":default:return"GMT"+R(r,":")}},z:function(t,n,e){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+_e(r,":");case"zzzz":default:return"GMT"+R(r,":")}},t:function(t,n,e){const r=Math.trunc(t.getTime()/1e3);return H(r,n.length)},T:function(t,n,e){const r=t.getTime();return H(r,n.length)}};function _e(t,n=""){const e=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?e+String(a):e+String(a)+n+H(s,2)}function qe(t,n){return t%60===0?(t>0?"-":"+")+H(Math.abs(t)/60,2):R(t,n)}function R(t,n=""){const e=t>0?"-":"+",r=Math.abs(t),a=H(Math.trunc(r/60),2),s=H(r%60,2);return e+a+n+s}const Le=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Fe=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},he={p:Fe,P:(t,n)=>{const e=t.match(/(P+)(p+)?/)||[],r=e[1],a=e[2];if(!a)return Le(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Le(r,n)).replace("{{time}}",Fe(a,n))}},Ft=/^D+$/,St=/^Y+$/,It=["D","DD","YY","YYYY"];function Se(t){return Ft.test(t)}function Ie(t){return St.test(t)}function me(t,n,e){const r=Rt(t,n,e);if(console.warn(r),It.includes(t))throw new RangeError(r)}function Rt(t,n,e){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Bt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,At=/^'([^]*?)'?$/,Xt=/''/g,jt=/[a-zA-Z]/;function Re(t,n,e){var h,p,o,b;const r=A(),a=r.locale??Ye,s=r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,l=r.weekStartsOn??((b=(o=r.locale)==null?void 0:o.options)==null?void 0:b.weekStartsOn)??0,d=Y(t);if(!Ne(d))throw new RangeError("Invalid time value");let w=n.match(Qt).map(x=>{const N=x[0];if(N==="p"||N==="P"){const q=he[N];return q(x,a.formatLong)}return x}).join("").match(Bt).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const N=x[0];if(N==="'")return{isToken:!1,value:Gt(x)};if(Ce[N])return{isToken:!0,value:x};if(N.match(jt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:x}});a.localize.preprocessor&&(w=a.localize.preprocessor(d,w));const y={firstWeekContainsDate:s,weekStartsOn:l,locale:a};return w.map(x=>{if(!x.isToken)return x.value;const N=x.value;(Ie(N)||Se(N))&&me(N,n,String(t));const q=Ce[N[0]];return q(d,N,a.localize,y)}).join("")}function Gt(t){const n=t.match(At);return n?n[1].replace(Xt,"'"):t}function $t(){return Object.assign({},A())}function Ut(t){let e=Y(t).getDay();return e===0&&(e=7),e}function Zt(t,n){const e=n instanceof Date?D(n,0):new n(0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e}const zt=10;class Be{constructor(){u(this,"subPriority",0)}validate(n,e){return!0}}class Jt extends Be{constructor(n,e,r,a,s){super(),this.value=n,this.validateValue=e,this.setValue=r,this.priority=a,s&&(this.subPriority=s)}validate(n,e){return this.validateValue(n,this.value,e)}set(n,e,r){return this.setValue(n,e,this.value,r)}}class Kt extends Be{constructor(){super(...arguments);u(this,"priority",zt);u(this,"subPriority",-1)}set(e,r){return r.timestampIsSet?e:D(e,Zt(e,Date))}}class M{run(n,e,r,a){const s=this.parse(n,e,r,a);return s?{setter:new Jt(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(n,e,r){return!0}}class er extends M{constructor(){super(...arguments);u(this,"priority",140);u(this,"incompatibleTokens",["R","u","t","T"])}parse(e,r,a){switch(r){case"G":case"GG":case"GGG":return a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"});case"GGGGG":return a.era(e,{width:"narrow"});case"GGGG":default:return a.era(e,{width:"wide"})||a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"})}}set(e,r,a){return r.era=a,e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}const v={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},C={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function V(t,n){return t&&{value:n(t.value),rest:t.rest}}function k(t,n){const e=n.match(t);return e?{value:parseInt(e[0],10),rest:n.slice(e[0].length)}:null}function _(t,n){const e=n.match(t);if(!e)return null;if(e[0]==="Z")return{value:0,rest:n.slice(1)};const r=e[1]==="+"?1:-1,a=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,l=e[5]?parseInt(e[5],10):0;return{value:r*(a*Je+s*ze+l*Ke),rest:n.slice(e[0].length)}}function Qe(t){return k(v.anyDigitsSigned,t)}function O(t,n){switch(t){case 1:return k(v.singleDigit,n);case 2:return k(v.twoDigits,n);case 3:return k(v.threeDigits,n);case 4:return k(v.fourDigits,n);default:return k(new RegExp("^\\d{1,"+t+"}"),n)}}function ne(t,n){switch(t){case 1:return k(v.singleDigitSigned,n);case 2:return k(v.twoDigitsSigned,n);case 3:return k(v.threeDigitsSigned,n);case 4:return k(v.fourDigitsSigned,n);default:return k(new RegExp("^-?\\d{1,"+t+"}"),n)}}function we(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ae(t,n){const e=n>0,r=e?n:1-n;let a;if(r<=50)a=t||100;else{const s=r+50,l=Math.trunc(s/100)*100,d=t>=s%100;a=t+l-(d?100:0)}return e?a:1-a}function Xe(t){return t%400===0||t%4===0&&t%100!==0}class tr extends M{constructor(){super(...arguments);u(this,"priority",130);u(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,r,a){const s=l=>({year:l,isTwoDigitYear:r==="yy"});switch(r){case"y":return V(O(4,e),s);case"yo":return V(a.ordinalNumber(e,{unit:"year"}),s);default:return V(O(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,a){const s=e.getFullYear();if(a.isTwoDigitYear){const d=Ae(a.year,s);return e.setFullYear(d,0,1),e.setHours(0,0,0,0),e}const l=!("era"in r)||r.era===1?a.year:1-a.year;return e.setFullYear(l,0,1),e.setHours(0,0,0,0),e}}class rr extends M{constructor(){super(...arguments);u(this,"priority",130);u(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,r,a){const s=l=>({year:l,isTwoDigitYear:r==="YY"});switch(r){case"Y":return V(O(4,e),s);case"Yo":return V(a.ordinalNumber(e,{unit:"year"}),s);default:return V(O(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,a,s){const l=fe(e,s);if(a.isTwoDigitYear){const w=Ae(a.year,l);return e.setFullYear(w,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),S(e,s)}const d=!("era"in r)||r.era===1?a.year:1-a.year;return e.setFullYear(d,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),S(e,s)}}class nr extends M{constructor(){super(...arguments);u(this,"priority",130);u(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,r){return ne(r==="R"?4:r.length,e)}set(e,r,a){const s=D(e,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),X(s)}}class ar extends M{constructor(){super(...arguments);u(this,"priority",130);u(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,r){return ne(r==="u"?4:r.length,e)}set(e,r,a){return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class sr extends M{constructor(){super(...arguments);u(this,"priority",120);u(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,r,a){switch(r){case"Q":case"QQ":return O(r.length,e);case"Qo":return a.ordinalNumber(e,{unit:"quarter"});case"QQQ":return a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(e,{width:"wide",context:"formatting"})||a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class ir extends M{constructor(){super(...arguments);u(this,"priority",120);u(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,r,a){switch(r){case"q":case"qq":return O(r.length,e);case"qo":return a.ordinalNumber(e,{unit:"quarter"});case"qqq":return a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(e,{width:"wide",context:"standalone"})||a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class or extends M{constructor(){super(...arguments);u(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);u(this,"priority",110)}parse(e,r,a){const s=l=>l-1;switch(r){case"M":return V(k(v.month,e),s);case"MM":return V(O(2,e),s);case"Mo":return V(a.ordinalNumber(e,{unit:"month"}),s);case"MMM":return a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(e,{width:"wide",context:"formatting"})||a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}class ur extends M{constructor(){super(...arguments);u(this,"priority",110);u(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,r,a){const s=l=>l-1;switch(r){case"L":return V(k(v.month,e),s);case"LL":return V(O(2,e),s);case"Lo":return V(a.ordinalNumber(e,{unit:"month"}),s);case"LLL":return a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(e,{width:"wide",context:"standalone"})||a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}function cr(t,n,e){const r=Y(t),a=We(r,e)-n;return r.setDate(r.getDate()-a*7),r}class lr extends M{constructor(){super(...arguments);u(this,"priority",100);u(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,r,a){switch(r){case"w":return k(v.week,e);case"wo":return a.ordinalNumber(e,{unit:"week"});default:return O(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,a,s){return S(cr(e,a,s),s)}}function dr(t,n){const e=Y(t),r=Ee(e)-n;return e.setDate(e.getDate()-r*7),e}class fr extends M{constructor(){super(...arguments);u(this,"priority",100);u(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,r,a){switch(r){case"I":return k(v.week,e);case"Io":return a.ordinalNumber(e,{unit:"week"});default:return O(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,a){return X(dr(e,a))}}const hr=[31,28,31,30,31,30,31,31,30,31,30,31],mr=[31,29,31,30,31,30,31,31,30,31,30,31];class wr extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"subPriority",1);u(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,r,a){switch(r){case"d":return k(v.date,e);case"do":return a.ordinalNumber(e,{unit:"date"});default:return O(r.length,e)}}validate(e,r){const a=e.getFullYear(),s=Xe(a),l=e.getMonth();return s?r>=1&&r<=mr[l]:r>=1&&r<=hr[l]}set(e,r,a){return e.setDate(a),e.setHours(0,0,0,0),e}}class yr extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"subpriority",1);u(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,r,a){switch(r){case"D":case"DD":return k(v.dayOfYear,e);case"Do":return a.ordinalNumber(e,{unit:"date"});default:return O(r.length,e)}}validate(e,r){const a=e.getFullYear();return Xe(a)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,a){return e.setMonth(0,a),e.setHours(0,0,0,0),e}}function ye(t,n,e){var p,o,b,x;const r=A(),a=(e==null?void 0:e.weekStartsOn)??((o=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:o.weekStartsOn)??r.weekStartsOn??((x=(b=r.locale)==null?void 0:b.options)==null?void 0:x.weekStartsOn)??0,s=Y(t),l=s.getDay(),w=(n%7+7)%7,y=7-a,h=n<0||n>6?n-(l+y)%7:(w+y)%7-(l+y)%7;return De(s,h)}class pr extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,r,a){switch(r){case"E":case"EE":case"EEE":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,a,s){return e=ye(e,a,s),e.setHours(0,0,0,0),e}}class br extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,r,a,s){const l=d=>{const w=Math.floor((d-1)/7)*7;return(d+s.weekStartsOn+6)%7+w};switch(r){case"e":case"ee":return V(O(r.length,e),l);case"eo":return V(a.ordinalNumber(e,{unit:"day"}),l);case"eee":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeeee":return a.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,a,s){return e=ye(e,a,s),e.setHours(0,0,0,0),e}}class gr extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,r,a,s){const l=d=>{const w=Math.floor((d-1)/7)*7;return(d+s.weekStartsOn+6)%7+w};switch(r){case"c":case"cc":return V(O(r.length,e),l);case"co":return V(a.ordinalNumber(e,{unit:"day"}),l);case"ccc":return a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"ccccc":return a.day(e,{width:"narrow",context:"standalone"});case"cccccc":return a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(e,{width:"wide",context:"standalone"})||a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,a,s){return e=ye(e,a,s),e.setHours(0,0,0,0),e}}function xr(t,n){const e=Y(t),r=Ut(e),a=n-r;return De(e,a)}class Mr extends M{constructor(){super(...arguments);u(this,"priority",90);u(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,r,a){const s=l=>l===0?7:l;switch(r){case"i":case"ii":return O(r.length,e);case"io":return a.ordinalNumber(e,{unit:"day"});case"iii":return V(a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return V(a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return V(a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiii":default:return V(a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,r){return r>=1&&r<=7}set(e,r,a){return e=xr(e,a),e.setHours(0,0,0,0),e}}class Hr extends M{constructor(){super(...arguments);u(this,"priority",80);u(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,r,a){switch(r){case"a":case"aa":case"aaa":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,a){return e.setHours(we(a),0,0,0),e}}class Pr extends M{constructor(){super(...arguments);u(this,"priority",80);u(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,r,a){switch(r){case"b":case"bb":case"bbb":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,a){return e.setHours(we(a),0,0,0),e}}class Tr extends M{constructor(){super(...arguments);u(this,"priority",80);u(this,"incompatibleTokens",["a","b","t","T"])}parse(e,r,a){switch(r){case"B":case"BB":case"BBB":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,a){return e.setHours(we(a),0,0,0),e}}class kr extends M{constructor(){super(...arguments);u(this,"priority",70);u(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,r,a){switch(r){case"h":return k(v.hour12h,e);case"ho":return a.ordinalNumber(e,{unit:"hour"});default:return O(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,a){const s=e.getHours()>=12;return s&&a<12?e.setHours(a+12,0,0,0):!s&&a===12?e.setHours(0,0,0,0):e.setHours(a,0,0,0),e}}class Dr extends M{constructor(){super(...arguments);u(this,"priority",70);u(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,r,a){switch(r){case"H":return k(v.hour23h,e);case"Ho":return a.ordinalNumber(e,{unit:"hour"});default:return O(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,a){return e.setHours(a,0,0,0),e}}class Or extends M{constructor(){super(...arguments);u(this,"priority",70);u(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,r,a){switch(r){case"K":return k(v.hour11h,e);case"Ko":return a.ordinalNumber(e,{unit:"hour"});default:return O(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,a){return e.getHours()>=12&&a<12?e.setHours(a+12,0,0,0):e.setHours(a,0,0,0),e}}class vr extends M{constructor(){super(...arguments);u(this,"priority",70);u(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,r,a){switch(r){case"k":return k(v.hour24h,e);case"ko":return a.ordinalNumber(e,{unit:"hour"});default:return O(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,a){const s=a<=24?a%24:a;return e.setHours(s,0,0,0),e}}class Vr extends M{constructor(){super(...arguments);u(this,"priority",60);u(this,"incompatibleTokens",["t","T"])}parse(e,r,a){switch(r){case"m":return k(v.minute,e);case"mo":return a.ordinalNumber(e,{unit:"minute"});default:return O(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,a){return e.setMinutes(a,0,0),e}}class Nr extends M{constructor(){super(...arguments);u(this,"priority",50);u(this,"incompatibleTokens",["t","T"])}parse(e,r,a){switch(r){case"s":return k(v.second,e);case"so":return a.ordinalNumber(e,{unit:"second"});default:return O(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,a){return e.setSeconds(a,0),e}}class Yr extends M{constructor(){super(...arguments);u(this,"priority",30);u(this,"incompatibleTokens",["t","T"])}parse(e,r){const a=s=>Math.trunc(s*Math.pow(10,-r.length+3));return V(O(r.length,e),a)}set(e,r,a){return e.setMilliseconds(a),e}}class Er extends M{constructor(){super(...arguments);u(this,"priority",10);u(this,"incompatibleTokens",["t","T","x"])}parse(e,r){switch(r){case"X":return _(C.basicOptionalMinutes,e);case"XX":return _(C.basic,e);case"XXXX":return _(C.basicOptionalSeconds,e);case"XXXXX":return _(C.extendedOptionalSeconds,e);case"XXX":default:return _(C.extended,e)}}set(e,r,a){return r.timestampIsSet?e:D(e,e.getTime()-re(e)-a)}}class Wr extends M{constructor(){super(...arguments);u(this,"priority",10);u(this,"incompatibleTokens",["t","T","X"])}parse(e,r){switch(r){case"x":return _(C.basicOptionalMinutes,e);case"xx":return _(C.basic,e);case"xxxx":return _(C.basicOptionalSeconds,e);case"xxxxx":return _(C.extendedOptionalSeconds,e);case"xxx":default:return _(C.extended,e)}}set(e,r,a){return r.timestampIsSet?e:D(e,e.getTime()-re(e)-a)}}class Cr extends M{constructor(){super(...arguments);u(this,"priority",40);u(this,"incompatibleTokens","*")}parse(e){return Qe(e)}set(e,r,a){return[D(e,a*1e3),{timestampIsSet:!0}]}}class _r extends M{constructor(){super(...arguments);u(this,"priority",20);u(this,"incompatibleTokens","*")}parse(e){return Qe(e)}set(e,r,a){return[D(e,a),{timestampIsSet:!0}]}}const qr={G:new er,y:new tr,Y:new rr,R:new nr,u:new ar,Q:new sr,q:new ir,M:new or,L:new ur,w:new lr,I:new fr,d:new wr,D:new yr,E:new pr,e:new br,c:new gr,i:new Mr,a:new Hr,b:new Pr,B:new Tr,h:new kr,H:new Dr,K:new Or,k:new vr,m:new Vr,s:new Nr,S:new Yr,X:new Er,x:new Wr,t:new Cr,T:new _r},Lr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sr=/^'([^]*?)'?$/,Ir=/''/g,Rr=/\S/,Br=/[a-zA-Z]/;function je(t,n,e,r){var N,q,ie,G;const a=$t(),s=a.locale??Ye,l=a.firstWeekContainsDate??((q=(N=a.locale)==null?void 0:N.options)==null?void 0:q.firstWeekContainsDate)??1,d=a.weekStartsOn??((G=(ie=a.locale)==null?void 0:ie.options)==null?void 0:G.weekStartsOn)??0;if(n==="")return t===""?Y(e):D(e,NaN);const w={firstWeekContainsDate:l,weekStartsOn:d,locale:s},y=[new Kt],h=n.match(Fr).map(m=>{const g=m[0];if(g in he){const W=he[g];return W(m,s.formatLong)}return m}).join("").match(Lr),p=[];for(let m of h){Ie(m)&&me(m,n,t),Se(m)&&me(m,n,t);const g=m[0],W=qr[g];if(W){const{incompatibleTokens:F}=W;if(Array.isArray(F)){const oe=p.find(U=>F.includes(U.token)||U.token===g);if(oe)throw new RangeError(`The format string mustn't contain \`${oe.fullToken}\` and \`${m}\` at the same time`)}else if(W.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);p.push({token:g,fullToken:m});const $=W.run(t,m,s.match,w);if(!$)return D(e,NaN);y.push($.setter),t=$.rest}else{if(g.match(Br))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");if(m==="''"?m="'":g==="'"&&(m=Qr(m)),t.indexOf(m)===0)t=t.slice(m.length);else return D(e,NaN)}}if(t.length>0&&Rr.test(t))return D(e,NaN);const o=y.map(m=>m.priority).sort((m,g)=>g-m).filter((m,g,W)=>W.indexOf(m)===g).map(m=>y.filter(g=>g.priority===m).sort((g,W)=>W.subPriority-g.subPriority)).map(m=>m[0]);let b=Y(e);if(isNaN(b.getTime()))return D(e,NaN);const x={};for(const m of o){if(!m.validate(b,w))return D(e,NaN);const g=m.set(b,x,w);Array.isArray(g)?(b=g[0],Object.assign(x,g[1])):b=g}return D(e,b)}function Qr(t){return t.match(Sr)[1].replace(Ir,"'")}function P(t){return typeof t<"u"&&t!==null}function Ar(t){return!!t}function pe(t,n="hh:mm:ss"){if(!(!t||!n))return n.indexOf("ss")===-1&&t.split(":").length===3&&(n=n+":ss"),n.indexOf("A")>-1?(n=n.replace(/A/g,"a"),je(t.toLowerCase(),n,new Date)):je(t,n,new Date)}function be(t,n="hh:mm:ss",e="AM"){return!t||isNaN(t.getTime())?"":n.indexOf("A")>-1?(n=n.replace(/A/g,"a"),Re(t,n).toUpperCase()):Re(t,n)}function Xr(t){return t=String(t),t.length===1?"0"+t:t}function ae(t,n){let e=t||"hh:mm:ss";return n?(e=e?e.replace(/H/g,"h"):"hh:mm:ss a",e.indexOf("a")===-1&&e.indexOf("A")===-1&&(e=e+" a")):e=e?e.replace(/h/g,"H"):"HH:mm:ss",e}class jr{constructor(){u(this,"hourStep",1);u(this,"minuteStep",1);u(this,"secondStep",1);u(this,"use12Hours",!1);u(this,"changedValue",i.ref({text:"",value:void 0}));u(this,"format","HH:mm:ss");u(this,"temporaryHours");u(this,"temporaryMinutes");u(this,"temporarySeconds");u(this,"temporaryText","");u(this,"temporaryValue");u(this,"temporarySelected12Hours");u(this,"temporaryDefaultOpenValue",new Date)}get hours(){return this.temporaryHours}set hours(n){n!==this.temporaryHours&&(this.use12Hours?this.selected12Hours==="PM"&&n!==12?this.temporaryHours=n+12:this.selected12Hours==="AM"&&n===12?this.temporaryHours=0:this.temporaryHours=n:this.temporaryHours=n,this.update())}get realHours(){return this.temporaryHours}get viewHours(){return this.use12Hours&&P(this.temporaryHours)?this.calculateViewHour(this.temporaryHours):this.temporaryHours}get minutes(){return this.temporaryMinutes}set minutes(n){n!==this.temporaryMinutes&&(this.temporaryMinutes=n,this.update())}get seconds(){return this.temporarySeconds}set seconds(n){n!==this.temporarySeconds&&(this.temporarySeconds=n,this.update())}get defaultHours(){return this.defaultOpenValue.getHours()}get defaultViewHours(){const n=this.defaultOpenValue.getHours();return this.use12Hours&&P(n)?this.calculateViewHour(n):n}get defaultRealHours(){return this.defaultOpenValue.getHours()}get defaultMinutes(){return this.defaultOpenValue.getMinutes()}get defaultSeconds(){return this.defaultOpenValue.getSeconds()}get default12Hours(){return this.defaultOpenValue.getHours()>=12?"PM":"AM"}get text(){return this.temporaryText}set text(n){n!==this.temporaryText&&(this.temporaryText=n)}get value(){return this.temporaryValue}set value(n){n!==this.temporaryValue&&(this.temporaryValue=n,P(this.temporaryValue)&&Ne(this.temporaryValue)?(this.temporaryHours=this.temporaryValue.getHours(),this.temporaryMinutes=this.temporaryValue.getMinutes(),this.temporarySeconds=this.temporaryValue.getSeconds(),this.use12Hours&&P(this.temporaryHours)&&(this.temporarySelected12Hours=this.temporaryHours>=12?"PM":"AM")):this.clearTimeValue())}get selected12Hours(){return this.temporarySelected12Hours}set selected12Hours(n){n.toUpperCase()!==this.temporarySelected12Hours&&(this.temporarySelected12Hours=n.toUpperCase(),this.update())}get defaultOpenValue(){return this.temporaryDefaultOpenValue.setHours(this.setValueByStep(this.temporaryDefaultOpenValue.getHours(),this.hourStep)),this.temporaryDefaultOpenValue.setMinutes(this.setValueByStep(this.temporaryDefaultOpenValue.getMinutes(),this.minuteStep)),this.temporaryDefaultOpenValue.setSeconds(this.setValueByStep(this.temporaryDefaultOpenValue.getSeconds(),this.secondStep)),this.temporaryDefaultOpenValue}set defaultOpenValue(n){this.temporaryDefaultOpenValue!==n&&(this.temporaryDefaultOpenValue=n,this.update())}get isEmpty(){return!(P(this.temporaryHours)||P(this.temporaryMinutes)||P(this.temporarySeconds))}setFormat(n){this.format=n}setHours(n,e){return e?this:(this.setDefaultValueIfNil(),this.hours=n,this)}setUse12Hours(n){return this.use12Hours=n,this}setMinutes(n,e){return e?this:(this.setDefaultValueIfNil(),this.minutes=n,this)}setSeconds(n,e){return e?this:(this.setDefaultValueIfNil(),this.seconds=n,this)}setValue(n,e){return P(e)&&(this.use12Hours=e),this.value=n,this}setValueByStep(n,e){let r=Math.floor(n/e);const a=n%e,s=e/2;return r=a>s?r+1:r,e*r}setDefaultOpenValue(n){return this.defaultOpenValue=n,this}setDefaultValueIfNil(){P(this.temporaryValue)||(this.temporaryValue=new Date(this.defaultOpenValue))}update(){this.isEmpty?this.temporaryValue=void 0:(P(this.temporaryHours)?this.temporaryValue.setHours(this.hours):this.temporaryHours=this.defaultHours,P(this.temporaryMinutes)?this.temporaryValue.setMinutes(this.minutes):this.temporaryMinutes=this.defaultMinutes,P(this.temporarySeconds)?this.temporaryValue.setSeconds(this.seconds):this.temporarySeconds=this.defaultSeconds,this.use12Hours&&(P(this.temporarySelected12Hours)||(this.temporarySelected12Hours=this.default12Hours),this.selected12Hours==="PM"&&this.temporaryHours<12&&(this.temporaryHours+=12,this.temporaryValue.setHours(this.temporaryHours)),this.selected12Hours==="AM"&&this.temporaryHours>=12&&(this.temporaryHours-=12,this.temporaryValue.setHours(this.temporaryHours))),this.temporaryValue=new Date(this.temporaryValue),this.text=be(this.temporaryValue,this.format,this.selected12Hours),this.changedValue.value={text:this.text,value:this.temporaryValue})}clearTimeValue(){this.temporaryHours=void 0,this.temporaryMinutes=void 0,this.temporarySeconds=void 0,this.temporarySelected12Hours=void 0,this.temporaryValue=void 0}clear(){this.clearTimeValue(),this.update()}calculateViewHour(n){const e=this.temporarySelected12Hours||this.default12Hours;return e==="PM"&&n>12?n-12:e==="AM"&&n===0?12:n}}function Gr(t,n,e,r,a,s){function l(h,p,o=0,b,x){const N=d(p,b,x),q=h.children[0].children[N]||h.children[0].children[0];w(h,q.offsetTop,o)}function d(h,p,o){if(p==="hour"){const b=t.disabledHours&&t.disabledHours();return y(b,e.value.map(x=>x.index).indexOf(h))}if(p==="minute"){const b=t.disabledMinutes&&t.disab