@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 69.3 kB
JavaScript
(function(h,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("bignumber.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","bignumber.js","lodash-es"],d):(h=typeof globalThis<"u"?globalThis:h||self,d(h.common={},h.Vue,h.BigNumber,h.LodashES))})(this,function(h,d,C,wt){"use strict";var ua=Object.defineProperty;var ca=(h,d,C)=>d in h?ua(h,d,{enumerable:!0,configurable:!0,writable:!0,value:C}):h[d]=C;var c=(h,d,C)=>ca(h,typeof d!="symbol"?d+"":d,C);function Ye(t){const r=t.nativeElement?t.nativeElement:t;return r.classList!==void 0&&r.classList!==null?r:null}function Ee(t,r){if(r===void 0)return;const e=Ye(t);e&&e.classList.remove(r)}function be(t,r){if(r===void 0)return;const e=Ye(t);e&&e.classList.add(r)}const gt=[{size:"sm",width:576,pattern:/\b(col-|col-sm-)\d+\b/},{size:"md",width:768,pattern:/\bcol-md-\d+\b/},{size:"lg",width:888,pattern:/\bcol-lg-\d+\b/},{size:"xl",width:1200,pattern:/\bcol-xl-\d+\b/},{size:"el",width:1690,pattern:/\bcol-el-\d+\b/}];function Ae(t){t.resizeObserver&&(t.resizeObserver.disconnect(),t.sharedObject=null)}function He(t,r,e=0){const n=[];if(!r)return;const a=e||r.getBoundingClientRect().width,i=parseFloat(a),s=t.breakPoints;for(let o=0;o<s.length;o++)s[o].width<=i&&n.push(s[o].size);if(t.className.join(",")!==n.join(",")){if(t.className.length-n.length>0)for(let u=n.length;u<t.className.length;u++)Ee(r,"f-area-response--"+t.className[u]);else for(let u=t.className.length;u<n.length;u++)be(r,"f-area-response--"+n[u]);t.className=[...n]}}function yt(t,r){t.enable&&t.autoWidth?t.resizeObserver||(t.resizeObserver=new ResizeObserver(e=>{if(!e||e.length<1||!e[0].contentRect)return;const n=e[0].contentRect;Math.abs(parseInt(n.width+"")-t.width)>t.threshold&&(He(t,r,n.width),t.width=parseInt(n.width+""))}),t.resizeObserver.observe(r)):Ae(t)}function We(t,r){if(t.enable)be(r,"f-area-response"),He(t,r);else{Ee(r,"f-area-response");for(let e=t.className.length;e>0;e--)be(r,"f-area-response--"+t.className[e]);t.className=[]}yt(t,r)}function bt(t){const r=[];return gt.map(e=>{const n="col-"+e.size+"-";if(t.querySelectorAll('[class*="'+n+'"]').length>0)r.push({size:e.size,width:e.width});else if(e.size==="sm"){const i=t.querySelectorAll('[class*="col-"]');Array.from(i).some(o=>o.className.match(e.pattern))&&r.push({size:e.size,width:e.width})}}),r}function qe(t,r,e){r.value&&Object.prototype.hasOwnProperty.call(r.value,"enable")&&(t.enable=r.value.enable),r.value&&Object.prototype.hasOwnProperty.call(r.value,"autoWidth")&&(t.autoWidth=r.value.autoWidth),t.breakPoints=bt(e)}const fe={mounted:(t,r,e)=>{e.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0,breakPoints:[]},qe(e.sharedObject,r,t),We(e.sharedObject,t)},updated:function(t,r,e,n){e.sharedObject=n.sharedObject,qe(e.sharedObject,r,t),We(e.sharedObject,t)},beforeUnmount(t,r,e){Ae(e.sharedObject)}};function pt(t,r,e,n,a){const i=d.ref(t.disabled),s=d.ref(!1),o=d.ref("text"),u=d.ref(t.showBorder),g=d.ref(t.textAlign),x=d.ref(t.updateOn),y=d.ref(!1),Y=d.computed(()=>t.editable||!t.readonly&&!t.disabled),v=d.computed(()=>t.editable&&!t.disabled&&!t.readonly),M=d.computed(()=>!t.disabled&&!t.readonly&&s.value),l=d.computed(()=>e.value===""||e.value===null||e.value===void 0),f=d.computed(()=>(t.disabled||t.readonly)&&!t.forcePlaceholder?"":t.placeholder),b=d.computed(()=>t.readonly||!t.editable),L=d.computed(()=>t.enableTitle?e.value:""),w=d.computed(()=>({"form-control":!0,"f-utils-fill":!0,"text-left":g.value==="left","text-center":g.value==="center","text-right":g.value==="right"})),p=d.computed(()=>{const m={"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":i.value,"f-state-editable":v.value,"f-state-readonly":b.value,"f-state-focus":M.value,"input-group--has-clear":t.enableClear&&y.value};return(t.customClass||"").split(" ").reduce((de,oa)=>(de[oa]=!0,de),m),m}),A=d.computed(()=>u.value?"":"border-width : 0 ");function z(m,H=!0){e.value=m,n.value!==m&&(n.value=m),H&&r.emit("change",m),r.emit("update:modelValue",m),r.emit("update:value",m)}d.watch(()=>t.modelValue,(m,H)=>{m!==H&&(e.value=m,n.value=m)}),d.watch(()=>t.disabled,(m,H)=>{m!==H&&(i.value=m)});function $(m){return m.stopPropagation(),s.value=!1,r.emit("blur",m),m.target.tagName==="TEXTAREA"&&(r.emit("update:modelValue",m.target.value),r.emit("update:value",m.target.value),r.emit("change",m.target.value)),!1}function Q(m){r.emit("click",m)}function F(m){i.value||b.value||(u.value&&(s.value=!0),Y.value&&r.emit("focus",m))}function ce(m){r.emit("input",m.target.value,m);const H=m.target.value;n.value=H,x.value==="change"&&(r.emit("update:modelValue",H),r.emit("update:value",H),r.emit("change",H))}function le(m){r.emit("keydown",m)}function K(m){r.emit("keyup",m)}function G(m){const H=m.target;H.tagName!=="INPUT"&&H.tagName!=="TEXTAREA"&&m.preventDefault(),m.stopPropagation(),r.emit("mousedownEvent",m)}function U(m){r.emit("mouseupEvent",m)}function ye(m){if(x.value==="blur"){const H=m.target.value;m.stopPropagation(),z(H)}}return{changeTextBoxValue:z,disabled:i,displayText:n,editable:v,hasFocused:M,inputGroupClass:p,inputType:o,isEmpty:l,modelValue:e,readonly:b,onBlur:$,hasClearClass:y,onClick:Q,onFocus:F,onInput:ce,onKeydown:le,onKeyup:K,onMousedown:G,onMouseup:U,onTextBoxValueChange:ye,placeholder:f,textBoxClass:w,textBoxTitle:L,inputGroupStyle:A}}function Tt(t,r,e,n){const a=d.ref(t.disabled),i=d.ref(!1),s=d.ref("text"),o=d.ref(t.showBorder),u=d.ref(t.textAlign);d.computed(()=>t.editable||!t.readonly);const g=d.computed(()=>t.editable&&!t.disabled&&!t.readonly),x=d.computed(()=>!t.disabled&&i.value),y=d.computed(()=>e.value===""||e.value===null||e.value===void 0),Y=d.computed(()=>t.placeholder),v=d.computed(()=>t.readonly||!t.editable),M=d.computed(()=>t.enableTitle?e.value:""),l=d.computed(()=>({"form-control":!0,"text-left":u.value==="left","text-center":u.value==="center","text-right":u.value==="right"})),f=d.computed(()=>({"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":!0,"f-state-editable":!1,"f-state-readonly":!0})),b=d.computed(()=>o.value?"":"border-width : 0 ");function L(w,p=!0){}return{changeTextBoxValue:L,disabled:a,displayText:n,editable:g,hasFocused:x,inputGroupClass:f,inputType:s,isEmpty:y,modelValue:e,readonly:v,placeholder:Y,textBoxClass:l,textBoxTitle:M,inputGroupStyle:b}}function xt(t,r,e){const n=d.ref(!1),a=d.computed(()=>t.enableClear&&!t.readonly&&!t.disabled),{changeTextBoxValue:i,displayText:s,hasFocused:o,modelValue:u,isEmpty:g,hasClearClass:x}=e;function y(b){n.value=b,x&&(x.value=n.value)}d.watch(s,()=>{o!=null&&o.value?y(!!(s!=null&&s.value)):y(!1)});const Y=d.computed(()=>({"input-group-text":!0,"input-group-clear":!0})),v=d.computed(()=>({width:"24px",display:n.value?"flex":"none"}));function M(b){b.stopPropagation(),a.value&&(i("",!0),y(!n.value),r.emit("clear"))}function l(b){var A,z;const L=((A=b.target.querySelector("input"))==null?void 0:A.value)||"",w=((z=b.target.querySelector("textarea"))==null?void 0:z.value)||"",p=L||w;p!==u.value&&(u.value=p),a.value&&y(!!p)}function f(b){a.value&&y(!1)}return{clearButtonClass:Y,clearButtonStyle:v,hasShownClearButton:n,onClearValue:M,onMouseEnter:l,onMouseLeave:f,shouldShowClearButton:a}}const Dt={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Mt={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};class pe{constructor(){c(this,"regexes",{YEAR:"[1-9]\\d{3}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",MONTHNAME:"jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december",DAYNAME:"mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",TIMEZONE:"[+-][01]\\d\\:?[0-5]\\d",H24:"[01]\\d|2[0-3]",MIN:"[0-5]\\d",SEC:"[0-5]\\d",MS:"\\d{3,}",H12:"0?[1-9]|1[012]",AMPM:"am|pm",UNIT:"year|month|week|day|hour|minute|second|millisecond"});c(this,"patterns",[["iso_8601",this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"),"$2/$3/$1"],["us",this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"),"$1/$3/$4"],["world",this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"),"$3/$1/$4"],["chicago",this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"),"$3 $1, $4"],["conversational",this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"),"$1 $2, $3"],["month_day_time_year",this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"),r=>{const e=(""+this.getMonthByName(r[1])).padStart(2,"0"),n=(""+r[2]).padStart(2,"0"),a=r[5],i=r[3],s=r[4],o=a+"-"+e+"-"+n+"T"+i+s;return isNaN(o)?!1:o}],["unix",/^@(-?\d+)$/,r=>this.create(parseInt(r[1],10)*1e3)],["24_hour",this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"),r=>{let e;const n=r[1];if(n){if(e=this.create(n),isNaN(e))return!1}else e=new Date,e.setMilliseconds(0);const a=r[2],i=r[3],s=r[4],o=r[5];return e.setHours(parseFloat(a),parseFloat(i),parseFloat(s||0)),o&&e.setMilliseconds(+String(o).slice(0,3)),e}],["12_hour",this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"),r=>{let e;const n=r[1];if(n){if(e=this.create(n),isNaN(e))return!1}else e=new Date,e.setMilliseconds(0);let a=parseFloat(r[2]);a=r[5].toLowerCase()==="am"?a===12?0:a:a===12?12:a+12;const i=r[3],s=r[4];return e.setHours(a,parseFloat(i||0),parseFloat(s||0)),e}]])}makePattern(r){return r=r.replace(/_([A-Z][A-Z0-9]+)_/g,(e,n)=>this.regexes[n]),new RegExp(r,"i")}getMonthByName(r){return Dt[String(r).slice(0,3).toLowerCase()]}getWeekdayByName(r){return Mt[String(r).slice(0,3).toLowerCase()]}parse(r){if(!isNaN(Number(r)))return new Date(r);if(r=String(r).replace(/^\s*(.*)\s*$/,"$1"),r=r.replace(/\s{2,}/g," "),r==="")return Date.now();let e=0;for(;e<this.patterns.length;){const n=this.patterns[e];let a,i;typeof n[0]=="string"?(i=n[1],a=n[2]):(i=n[0],a=n[1]);const s=r.match(i);if(!s){e++;continue}if(typeof a=="function"){const o=a(s);if(o instanceof Date)return o}else{const o=Date.parse(r.replace(i,a));if(!isNaN(o))return new Date(o)}e++}return NaN}create(r){return r==null?Date.now():r instanceof Date?r:this.parse(r)}}function E(t){const r=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&r==="[object Date]"?new t.constructor(+t):typeof t=="number"||r==="[object Number]"||typeof t=="string"||r==="[object String]"?new Date(t):new Date(NaN)}function N(t,r){return t instanceof Date?new t.constructor(r):new Date(r)}function Re(t,r){const e=E(t);return isNaN(r)?N(t,NaN):(r&&e.setDate(e.getDate()+r),e)}const Ie=6048e5,vt=864e5,Te=6e4,xe=36e5,kt=1e3;let Nt={};function ee(){return Nt}function S(t,r){var o,u,g,x;const e=ee(),n=(r==null?void 0:r.weekStartsOn)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??e.weekStartsOn??((x=(g=e.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,a=E(t),i=a.getDay(),s=(i<n?7:0)+i-n;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function te(t){return S(t,{weekStartsOn:1})}function Fe(t){const r=E(t),e=r.getFullYear(),n=N(t,0);n.setFullYear(e+1,0,4),n.setHours(0,0,0,0);const a=te(n),i=N(t,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const s=te(i);return r.getTime()>=a.getTime()?e+1:r.getTime()>=s.getTime()?e:e-1}function Le(t){const r=E(t);return r.setHours(0,0,0,0),r}function he(t){const r=E(t),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+t-+e}function Ot(t,r){const e=Le(t),n=Le(r),a=+e-he(e),i=+n-he(n);return Math.round((a-i)/vt)}function _t(t){const r=Fe(t),e=N(t,0);return e.setFullYear(r,0,4),e.setHours(0,0,0,0),te(e)}function Pt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Be(t){if(!Pt(t)&&typeof t!="number")return!1;const r=E(t);return!isNaN(Number(r))}function Ct(t){const r=E(t),e=N(t,0);return e.setFullYear(r.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Yt={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"}},Et=(t,r,e)=>{let n;const a=Yt[t];return typeof a=="string"?n=a:r===1?n=a.one:n=a.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function De(t){return(r={})=>{const e=r.width?String(r.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const At={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qt={date:De({formats:At,defaultWidth:"full"}),time:De({formats:Ht,defaultWidth:"full"}),dateTime:De({formats:Wt,defaultWidth:"full"})},Rt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},It=(t,r,e,n)=>Rt[t];function ae(t){return(r,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,o=e!=null&&e.width?String(e.width):s;a=t.formattingValues[o]||t.formattingValues[s]}else{const s=t.defaultWidth,o=e!=null&&e.width?String(e.width):t.defaultWidth;a=t.values[o]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(r):r;return a[i]}}const Ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bt={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"]},$t={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"]},Qt={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"}},Xt={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"}},jt={ordinalNumber:(t,r)=>{const e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ae({values:Ft,defaultWidth:"wide"}),quarter:ae({values:Lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ae({values:Bt,defaultWidth:"wide"}),day:ae({values:$t,defaultWidth:"wide"}),dayPeriod:ae({values:Qt,defaultWidth:"wide",formattingValues:Xt,defaultFormattingWidth:"wide"})};function ie(t){return(r,e={})=>{const n=e.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=r.match(a);if(!i)return null;const s=i[0],o=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(o)?Gt(o,y=>y.test(s)):zt(o,y=>y.test(s));let g;g=t.valueCallback?t.valueCallback(u):u,g=e.valueCallback?e.valueCallback(g):g;const x=r.slice(s.length);return{value:g,rest:x}}}function zt(t,r){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&r(t[e]))return e}function Gt(t,r){for(let e=0;e<t.length;e++)if(r(t[e]))return e}function Ut(t){return(r,e={})=>{const n=r.match(t.matchPattern);if(!n)return null;const a=n[0],i=r.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;const o=r.slice(a.length);return{value:s,rest:o}}}const St=/^(\d+)(th|st|nd|rd)?/i,Vt=/\d+/i,Zt={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},Kt={any:[/^b/i,/^(a|c)/i]},Jt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},en={any:[/1/i,/2/i,/3/i,/4/i]},tn={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},nn={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]},rn={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},an={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]},sn={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},on={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}},un={ordinalNumber:Ut({matchPattern:St,parsePattern:Vt,valueCallback:t=>parseInt(t,10)}),era:ie({matchPatterns:Zt,defaultMatchWidth:"wide",parsePatterns:Kt,defaultParseWidth:"any"}),quarter:ie({matchPatterns:Jt,defaultMatchWidth:"wide",parsePatterns:en,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ie({matchPatterns:tn,defaultMatchWidth:"wide",parsePatterns:nn,defaultParseWidth:"any"}),day:ie({matchPatterns:rn,defaultMatchWidth:"wide",parsePatterns:an,defaultParseWidth:"any"}),dayPeriod:ie({matchPatterns:sn,defaultMatchWidth:"any",parsePatterns:on,defaultParseWidth:"any"})},$e={code:"en-US",formatDistance:Et,formatLong:qt,formatRelative:It,localize:jt,match:un,options:{weekStartsOn:0,firstWeekContainsDate:1}};function cn(t){const r=E(t);return Ot(r,Ct(r))+1}function Qe(t){const r=E(t),e=+te(r)-+_t(r);return Math.round(e/Ie)+1}function Me(t,r){var x,y,Y,v;const e=E(t),n=e.getFullYear(),a=ee(),i=(r==null?void 0:r.firstWeekContainsDate)??((y=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((v=(Y=a.locale)==null?void 0:Y.options)==null?void 0:v.firstWeekContainsDate)??1,s=N(t,0);s.setFullYear(n+1,0,i),s.setHours(0,0,0,0);const o=S(s,r),u=N(t,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const g=S(u,r);return e.getTime()>=o.getTime()?n+1:e.getTime()>=g.getTime()?n:n-1}function ln(t,r){var o,u,g,x;const e=ee(),n=(r==null?void 0:r.firstWeekContainsDate)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??e.firstWeekContainsDate??((x=(g=e.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,a=Me(t,r),i=N(t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),S(i,r)}function Xe(t,r){const e=E(t),n=+S(e,r)-+ln(e,r);return Math.round(n/Ie)+1}function D(t,r){const e=t<0?"-":"",n=Math.abs(t).toString().padStart(r,"0");return e+n}const V={y(t,r){const e=t.getFullYear(),n=e>0?e:1-e;return D(r==="yy"?n%100:n,r.length)},M(t,r){const e=t.getMonth();return r==="M"?String(e+1):D(e+1,2)},d(t,r){return D(t.getDate(),r.length)},a(t,r){const e=t.getHours()/12>=1?"pm":"am";switch(r){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,r){return D(t.getHours()%12||12,r.length)},H(t,r){return D(t.getHours(),r.length)},m(t,r){return D(t.getMinutes(),r.length)},s(t,r){return D(t.getSeconds(),r.length)},S(t,r){const e=r.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,e-3));return D(a,r.length)}},ne={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},je={G:function(t,r,e){const n=t.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(t,r,e){if(r==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return e.ordinalNumber(a,{unit:"year"})}return V.y(t,r)},Y:function(t,r,e,n){const a=Me(t,n),i=a>0?a:1-a;if(r==="YY"){const s=i%100;return D(s,2)}return r==="Yo"?e.ordinalNumber(i,{unit:"year"}):D(i,r.length)},R:function(t,r){const e=Fe(t);return D(e,r.length)},u:function(t,r){const e=t.getFullYear();return D(e,r.length)},Q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return D(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return D(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,r,e){const n=t.getMonth();switch(r){case"M":case"MM":return V.M(t,r);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(t,r,e){const n=t.getMonth();switch(r){case"L":return String(n+1);case"LL":return D(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(t,r,e,n){const a=Xe(t,n);return r==="wo"?e.ordinalNumber(a,{unit:"week"}):D(a,r.length)},I:function(t,r,e){const n=Qe(t);return r==="Io"?e.ordinalNumber(n,{unit:"week"}):D(n,r.length)},d:function(t,r,e){return r==="do"?e.ordinalNumber(t.getDate(),{unit:"date"}):V.d(t,r)},D:function(t,r,e){const n=cn(t);return r==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):D(n,r.length)},E:function(t,r,e){const n=t.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(t,r,e,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(i);case"ee":return D(i,2);case"eo":return e.ordinalNumber(i,{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,r,e,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(i);case"cc":return D(i,r.length);case"co":return e.ordinalNumber(i,{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,r,e){const n=t.getDay(),a=n===0?7:n;switch(r){case"i":return String(a);case"ii":return D(a,r.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(t,r,e){const a=t.getHours()/12>=1?"pm":"am";switch(r){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,r,e){const n=t.getHours();let a;switch(n===12?a=ne.noon:n===0?a=ne.midnight:a=n/12>=1?"pm":"am",r){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,r,e){const n=t.getHours();let a;switch(n>=17?a=ne.evening:n>=12?a=ne.afternoon:n>=4?a=ne.morning:a=ne.night,r){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,r,e){if(r==="ho"){let n=t.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return V.h(t,r)},H:function(t,r,e){return r==="Ho"?e.ordinalNumber(t.getHours(),{unit:"hour"}):V.H(t,r)},K:function(t,r,e){const n=t.getHours()%12;return r==="Ko"?e.ordinalNumber(n,{unit:"hour"}):D(n,r.length)},k:function(t,r,e){let n=t.getHours();return n===0&&(n=24),r==="ko"?e.ordinalNumber(n,{unit:"hour"}):D(n,r.length)},m:function(t,r,e){return r==="mo"?e.ordinalNumber(t.getMinutes(),{unit:"minute"}):V.m(t,r)},s:function(t,r,e){return r==="so"?e.ordinalNumber(t.getSeconds(),{unit:"second"}):V.s(t,r)},S:function(t,r){return V.S(t,r)},X:function(t,r,e){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(r){case"X":return Ge(n);case"XXXX":case"XX":return J(n);case"XXXXX":case"XXX":default:return J(n,":")}},x:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"x":return Ge(n);case"xxxx":case"xx":return J(n);case"xxxxx":case"xxx":default:return J(n,":")}},O:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ze(n,":");case"OOOO":default:return"GMT"+J(n,":")}},z:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ze(n,":");case"zzzz":default:return"GMT"+J(n,":")}},t:function(t,r,e){const n=Math.trunc(t.getTime()/1e3);return D(n,r.length)},T:function(t,r,e){const n=t.getTime();return D(n,r.length)}};function ze(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?e+String(a):e+String(a)+r+D(i,2)}function Ge(t,r){return t%60===0?(t>0?"-":"+")+D(Math.abs(t)/60,2):J(t,r)}function J(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=D(Math.trunc(n/60),2),i=D(n%60,2);return e+a+r+i}const Ue=(t,r)=>{switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Se=(t,r)=>{switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},ve={p:Se,P:(t,r)=>{const e=t.match(/(P+)(p+)?/)||[],n=e[1],a=e[2];if(!a)return Ue(t,r);let i;switch(n){case"P":i=r.dateTime({width:"short"});break;case"PP":i=r.dateTime({width:"medium"});break;case"PPP":i=r.dateTime({width:"long"});break;case"PPPP":default:i=r.dateTime({width:"full"});break}return i.replace("{{date}}",Ue(n,r)).replace("{{time}}",Se(a,r))}},dn=/^D+$/,fn=/^Y+$/,hn=["D","DD","YY","YYYY"];function Ve(t){return dn.test(t)}function Ze(t){return fn.test(t)}function ke(t,r,e){const n=mn(t,r,e);if(console.warn(n),hn.includes(t))throw new RangeError(n)}function mn(t,r,e){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${r}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yn=/^'([^]*?)'?$/,bn=/''/g,pn=/[a-zA-Z]/;function se(t,r,e){var x,y,Y,v;const n=ee(),a=n.locale??$e,i=n.firstWeekContainsDate??((y=(x=n.locale)==null?void 0:x.options)==null?void 0:y.firstWeekContainsDate)??1,s=n.weekStartsOn??((v=(Y=n.locale)==null?void 0:Y.options)==null?void 0:v.weekStartsOn)??0,o=E(t);if(!Be(o))throw new RangeError("Invalid time value");let u=r.match(gn).map(M=>{const l=M[0];if(l==="p"||l==="P"){const f=ve[l];return f(M,a.formatLong)}return M}).join("").match(wn).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const l=M[0];if(l==="'")return{isToken:!1,value:Tn(M)};if(je[l])return{isToken:!0,value:M};if(l.match(pn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:M}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const g={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return u.map(M=>{if(!M.isToken)return M.value;const l=M.value;(Ze(l)||Ve(l))&&ke(l,r,String(t));const f=je[l[0]];return f(o,l,a.localize,g)}).join("")}function Tn(t){const r=t.match(yn);return r?r[1].replace(bn,"'"):t}function xn(){return Object.assign({},ee())}function Dn(t){let e=E(t).getDay();return e===0&&(e=7),e}function Mn(t,r){const e=r instanceof Date?N(r,0):new r(0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e}const vn=10;class Ke{constructor(){c(this,"subPriority",0)}validate(r,e){return!0}}class kn extends Ke{constructor(r,e,n,a,i){super(),this.value=r,this.validateValue=e,this.setValue=n,this.priority=a,i&&(this.subPriority=i)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,n){return this.setValue(r,e,this.value,n)}}class Nn extends Ke{constructor(){super(...arguments);c(this,"priority",vn);c(this,"subPriority",-1)}set(e,n){return n.timestampIsSet?e:N(e,Mn(e,Date))}}class T{run(r,e,n,a){const i=this.parse(r,e,n,a);return i?{setter:new kn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(r,e,n){return!0}}class On extends T{constructor(){super(...arguments);c(this,"priority",140);c(this,"incompatibleTokens",["R","u","t","T"])}parse(e,n,a){switch(n){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,n,a){return n.era=a,e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}const _={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}/},X={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 P(t,r){return t&&{value:r(t.value),rest:t.rest}}function k(t,r){const e=r.match(t);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function j(t,r){const e=r.match(t);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const n=e[1]==="+"?1:-1,a=e[2]?parseInt(e[2],10):0,i=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:n*(a*xe+i*Te+s*kt),rest:r.slice(e[0].length)}}function Je(t){return k(_.anyDigitsSigned,t)}function O(t,r){switch(t){case 1:return k(_.singleDigit,r);case 2:return k(_.twoDigits,r);case 3:return k(_.threeDigits,r);case 4:return k(_.fourDigits,r);default:return k(new RegExp("^\\d{1,"+t+"}"),r)}}function me(t,r){switch(t){case 1:return k(_.singleDigitSigned,r);case 2:return k(_.twoDigitsSigned,r);case 3:return k(_.threeDigitsSigned,r);case 4:return k(_.fourDigitsSigned,r);default:return k(new RegExp("^-?\\d{1,"+t+"}"),r)}}function Ne(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 et(t,r){const e=r>0,n=e?r:1-r;let a;if(n<=50)a=t||100;else{const i=n+50,s=Math.trunc(i/100)*100,o=t>=i%100;a=t+s-(o?100:0)}return e?a:1-a}function tt(t){return t%400===0||t%4===0&&t%100!==0}class _n extends T{constructor(){super(...arguments);c(this,"priority",130);c(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,n,a){const i=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return P(O(4,e),i);case"yo":return P(a.ordinalNumber(e,{unit:"year"}),i);default:return P(O(n.length,e),i)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a){const i=e.getFullYear();if(a.isTwoDigitYear){const o=et(a.year,i);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const s=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Pn extends T{constructor(){super(...arguments);c(this,"priority",130);c(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,n,a){const i=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return P(O(4,e),i);case"Yo":return P(a.ordinalNumber(e,{unit:"year"}),i);default:return P(O(n.length,e),i)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a,i){const s=Me(e,i);if(a.isTwoDigitYear){const u=et(a.year,s);return e.setFullYear(u,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),S(e,i)}const o=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(o,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),S(e,i)}}class Cn extends T{constructor(){super(...arguments);c(this,"priority",130);c(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,n){return me(n==="R"?4:n.length,e)}set(e,n,a){const i=N(e,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),te(i)}}class Yn extends T{constructor(){super(...arguments);c(this,"priority",130);c(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,n){return me(n==="u"?4:n.length,e)}set(e,n,a){return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class En extends T{constructor(){super(...arguments);c(this,"priority",120);c(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"Q":case"QQ":return O(n.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,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class An extends T{constructor(){super(...arguments);c(this,"priority",120);c(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"q":case"qq":return O(n.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,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class Hn extends T{constructor(){super(...arguments);c(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);c(this,"priority",110)}parse(e,n,a){const i=s=>s-1;switch(n){case"M":return P(k(_.month,e),i);case"MM":return P(O(2,e),i);case"Mo":return P(a.ordinalNumber(e,{unit:"month"}),i);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,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}class Wn extends T{constructor(){super(...arguments);c(this,"priority",110);c(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,n,a){const i=s=>s-1;switch(n){case"L":return P(k(_.month,e),i);case"LL":return P(O(2,e),i);case"Lo":return P(a.ordinalNumber(e,{unit:"month"}),i);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,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}function qn(t,r,e){const n=E(t),a=Xe(n,e)-r;return n.setDate(n.getDate()-a*7),n}class Rn extends T{constructor(){super(...arguments);c(this,"priority",100);c(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,n,a){switch(n){case"w":return k(_.week,e);case"wo":return a.ordinalNumber(e,{unit:"week"});default:return O(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a,i){return S(qn(e,a,i),i)}}function In(t,r){const e=E(t),n=Qe(e)-r;return e.setDate(e.getDate()-n*7),e}class Fn extends T{constructor(){super(...arguments);c(this,"priority",100);c(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,n,a){switch(n){case"I":return k(_.week,e);case"Io":return a.ordinalNumber(e,{unit:"week"});default:return O(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a){return te(In(e,a))}}const Ln=[31,28,31,30,31,30,31,31,30,31,30,31],Bn=[31,29,31,30,31,30,31,31,30,31,30,31];class $n extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"subPriority",1);c(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"d":return k(_.date,e);case"do":return a.ordinalNumber(e,{unit:"date"});default:return O(n.length,e)}}validate(e,n){const a=e.getFullYear(),i=tt(a),s=e.getMonth();return i?n>=1&&n<=Bn[s]:n>=1&&n<=Ln[s]}set(e,n,a){return e.setDate(a),e.setHours(0,0,0,0),e}}class Qn extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"subpriority",1);c(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,n,a){switch(n){case"D":case"DD":return k(_.dayOfYear,e);case"Do":return a.ordinalNumber(e,{unit:"date"});default:return O(n.length,e)}}validate(e,n){const a=e.getFullYear();return tt(a)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,a){return e.setMonth(0,a),e.setHours(0,0,0,0),e}}function Oe(t,r,e){var y,Y,v,M;const n=ee(),a=(e==null?void 0:e.weekStartsOn)??((Y=(y=e==null?void 0:e.locale)==null?void 0:y.options)==null?void 0:Y.weekStartsOn)??n.weekStartsOn??((M=(v=n.locale)==null?void 0:v.options)==null?void 0:M.weekStartsOn)??0,i=E(t),s=i.getDay(),u=(r%7+7)%7,g=7-a,x=r<0||r>6?r-(s+g)%7:(u+g)%7-(s+g)%7;return Re(i,x)}class Xn extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,n,a){switch(n){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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Oe(e,a,i),e.setHours(0,0,0,0),e}}class jn extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,n,a,i){const s=o=>{const u=Math.floor((o-1)/7)*7;return(o+i.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return P(O(n.length,e),s);case"eo":return P(a.ordinalNumber(e,{unit:"day"}),s);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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Oe(e,a,i),e.setHours(0,0,0,0),e}}class zn extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,n,a,i){const s=o=>{const u=Math.floor((o-1)/7)*7;return(o+i.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return P(O(n.length,e),s);case"co":return P(a.ordinalNumber(e,{unit:"day"}),s);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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Oe(e,a,i),e.setHours(0,0,0,0),e}}function Gn(t,r){const e=E(t),n=Dn(e),a=r-n;return Re(e,a)}class Un extends T{constructor(){super(...arguments);c(this,"priority",90);c(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,n,a){const i=s=>s===0?7:s;switch(n){case"i":case"ii":return O(n.length,e);case"io":return a.ordinalNumber(e,{unit:"day"});case"iii":return P(a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return P(a.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return P(a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),i);case"iiii":default:return P(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"}),i)}}validate(e,n){return n>=1&&n<=7}set(e,n,a){return e=Gn(e,a),e.setHours(0,0,0,0),e}}class Sn extends T{constructor(){super(...arguments);c(this,"priority",80);c(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ne(a),0,0,0),e}}class Vn extends T{constructor(){super(...arguments);c(this,"priority",80);c(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ne(a),0,0,0),e}}class Zn extends T{constructor(){super(...arguments);c(this,"priority",80);c(this,"incompatibleTokens",["a","b","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ne(a),0,0,0),e}}class Kn extends T{constructor(){super(...arguments);c(this,"priority",70);c(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,n,a){switch(n){case"h":return k(_.hour12h,e);case"ho":return a.ordinalNumber(e,{unit:"hour"});default:return O(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,a){const i=e.getHours()>=12;return i&&a<12?e.setHours(a+12,0,0,0):!i&&a===12?e.setHours(0,0,0,0):e.setHours(a,0,0,0),e}}class Jn extends T{constructor(){super(...arguments);c(this,"priority",70);c(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,n,a){switch(n){case"H":return k(_.hour23h,e);case"Ho":return a.ordinalNumber(e,{unit:"hour"});default:return O(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,a){return e.setHours(a,0,0,0),e}}class er extends T{constructor(){super(...arguments);c(this,"priority",70);c(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,n,a){switch(n){case"K":return k(_.hour11h,e);case"Ko":return a.ordinalNumber(e,{unit:"hour"});default:return O(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,a){return e.getHours()>=12&&a<12?e.setHours(a+12,0,0,0):e.setHours(a,0,0,0),e}}class tr extends T{constructor(){super(...arguments);c(this,"priority",70);c(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,n,a){switch(n){case"k":return k(_.hour24h,e);case"ko":return a.ordinalNumber(e,{unit:"hour"});default:return O(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,a){const i=a<=24?a%24:a;return e.setHours(i,0,0,0),e}}class nr extends T{constructor(){super(...arguments);c(this,"priority",60);c(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"m":return k(_.minute,e);case"mo":return a.ordinalNumber(e,{unit:"minute"});default:return O(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setMinutes(a,0,0),e}}class rr extends T{constructor(){super(...arguments);c(this,"priority",50);c(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"s":return k(_.second,e);case"so":return a.ordinalNumber(e,{unit:"second"});default:return O(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setSeconds(a,0),e}}class ar extends T{constructor(){super(...arguments);c(this,"priority",30);c(this,"incompatibleTokens",["t","T"])}parse(e,n){const a=i=>Math.trunc(i*Math.pow(10,-n.length+3));return P(O(n.length,e),a)}set(e,n,a){return e.setMilliseconds(a),e}}class ir extends T{constructor(){super(...arguments);c(this,"priority",10);c(this,"incompatibleTokens",["t","T","x"])}parse(e,n){switch(n){case"X":return j(X.basicOptionalMinutes,e);case"XX":return j(X.basic,e);case"XXXX":return j(X.basicOptionalSeconds,e);case"XXXXX":return j(X.extendedOptionalSeconds,e);case"XXX":default:return j(X.extended,e)}}set(e,n,a){return n.timestampIsSet?e:N(e,e.getTime()-he(e)-a)}}class sr extends T{constructor(){super(...arguments);c(this,"priority",10);c(this,"incompatibleTokens",["t","T","X"])}parse(e,n){switch(n){case"x":return j(X.basicOptionalMinutes,e);case"xx":return j(X.basic,e);case"xxxx":return j(X.basicOptionalSeconds,e);case"xxxxx":return j(X.extendedOptionalSeconds,e)