var ee=Object.defineProperty;var te=(s,n,e)=>n in s?ee(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e;var o=(s,n,e)=>te(s,typeof n!="symbol"?n+"":n,e);import{aB as Z,a6 as P,a9 as b,aa as re,ae as se,aT as ne,bb as ae,ar as H,ak as K,ba as oe,b8 as ie,a8 as $,al as V,ax as ce,bj as F,cm as ue,cn as z,co as le}from"./index-DXdAv5n3.js";function de(){return Object.assign({},Z())}function we(s){let e=P(s).getDay();return e===0&&(e=7),e}function fe(s,n){const e=n instanceof Date?b(n,0):new n(0);return e.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),e.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),e}const he=10;class j{constructor(){o(this,"subPriority",0)}validate(n,e){return!0}}class ye extends j{constructor(n,e,r,t,a){super(),this.value=n,this.validateValue=e,this.setValue=r,this.priority=t,a&&(this.subPriority=a)}validate(n,e){return this.validateValue(n,this.value,e)}set(n,e,r){return this.setValue(n,e,this.value,r)}}class be extends j{constructor(){super(...arguments);o(this,"priority",he);o(this,"subPriority",-1)}set(e,r){return r.timestampIsSet?e:b(e,fe(e,Date))}}class u{run(n,e,r,t){const a=this.parse(n,e,r,t);return a?{setter:new ye(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(n,e,r){return!0}}class xe extends u{constructor(){super(...arguments);o(this,"priority",140);o(this,"incompatibleTokens",["R","u","t","T"])}parse(e,r,t){switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,r,t){return r.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}}const f={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}/},m={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 h(s,n){return s&&{value:n(s.value),rest:s.rest}}function l(s,n){const e=n.match(s);return e?{value:parseInt(e[0],10),rest:n.slice(e[0].length)}:null}function T(s,n){const e=n.match(s);if(!e)return null;if(e[0]==="Z")return{value:0,rest:n.slice(1)};const r=e[1]==="+"?1:-1,t=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:r*(t*re+a*se+i*ne),rest:n.slice(e[0].length)}}function U(s){return l(f.anyDigitsSigned,s)}function w(s,n){switch(s){case 1:return l(f.singleDigit,n);case 2:return l(f.twoDigits,n);case 3:return l(f.threeDigits,n);case 4:return l(f.fourDigits,n);default:return l(new RegExp("^\\d{1,"+s+"}"),n)}}function Y(s,n){switch(s){case 1:return l(f.singleDigitSigned,n);case 2:return l(f.twoDigitsSigned,n);case 3:return l(f.threeDigitsSigned,n);case 4:return l(f.fourDigitsSigned,n);default:return l(new RegExp("^-?\\d{1,"+s+"}"),n)}}function I(s){switch(s){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 J(s,n){const e=n>0,r=e?n:1-n;let t;if(r<=50)t=s||100;else{const a=r+50,i=Math.trunc(a/100)*100,y=s>=a%100;t=s+i-(y?100:0)}return e?t:1-t}function S(s){return s%400===0||s%4===0&&s%100!==0}class pe extends u{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,r,t){const a=i=>({year:i,isTwoDigitYear:r==="yy"});switch(r){case"y":return h(w(4,e),a);case"yo":return h(t.ordinalNumber(e,{unit:"year"}),a);default:return h(w(r.length,e),a)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t){const a=e.getFullYear();if(t.isTwoDigitYear){const y=J(t.year,a);return e.setFullYear(y,0,1),e.setHours(0,0,0,0),e}const i=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class me extends u{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,r,t){const a=i=>({year:i,isTwoDigitYear:r==="YY"});switch(r){case"Y":return h(w(4,e),a);case"Yo":return h(t.ordinalNumber(e,{unit:"year"}),a);default:return h(w(r.length,e),a)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t,a){const i=ae(e,a);if(t.isTwoDigitYear){const x=J(t.year,i);return e.setFullYear(x,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),H(e,a)}const y=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(y,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),H(e,a)}}class Te extends u{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,r){return Y(r==="R"?4:r.length,e)}set(e,r,t){const a=b(e,0);return a.setFullYear(t,0,4),a.setHours(0,0,0,0),K(a)}}class ke extends u{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,r){return Y(r==="u"?4:r.length,e)}set(e,r,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}}class ge extends u{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,r,t){switch(r){case"Q":case"QQ":return w(r.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}}class Pe extends u{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,r,t){switch(r){case"q":case"qq":return w(r.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}}class De extends u{constructor(){super(...arguments);o(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);o(this,"priority",110)}parse(e,r,t){const a=i=>i-1;switch(r){case"M":return h(l(f.month,e),a);case"MM":return h(w(2,e),a);case"Mo":return h(t.ordinalNumber(e,{unit:"month"}),a);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class Me extends u{constructor(){super(...arguments);o(this,"priority",110);o(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,r,t){const a=i=>i-1;switch(r){case"L":return h(l(f.month,e),a);case"LL":return h(w(2,e),a);case"Lo":return h(t.ordinalNumber(e,{unit:"month"}),a);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}function _e(s,n,e){const r=P(s),t=oe(r,e)-n;return r.setDate(r.getDate()-t*7),r}class Ye extends u{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,r,t){switch(r){case"w":return l(f.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t,a){return H(_e(e,t,a),a)}}function Oe(s,n){const e=P(s),r=ie(e)-n;return e.setDate(e.getDate()-r*7),e}class Ee extends u{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,r,t){switch(r){case"I":return l(f.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t){return K(Oe(e,t))}}const He=[31,28,31,30,31,30,31,31,30,31,30,31],Ie=[31,29,31,30,31,30,31,31,30,31,30,31];class qe extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"subPriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,r,t){switch(r){case"d":return l(f.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear(),a=S(t),i=e.getMonth();return a?r>=1&&r<=Ie[i]:r>=1&&r<=He[i]}set(e,r,t){return e.setDate(t),e.setHours(0,0,0,0),e}}class Ne extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"subpriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,r,t){switch(r){case"D":case"DD":return l(f.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear();return S(t)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}}function q(s,n,e){var D,_,k,M;const r=Z(),t=(e==null?void 0:e.weekStartsOn)??((_=(D=e==null?void 0:e.locale)==null?void 0:D.options)==null?void 0:_.weekStartsOn)??r.weekStartsOn??((M=(k=r.locale)==null?void 0:k.options)==null?void 0:M.weekStartsOn)??0,a=P(s),i=a.getDay(),x=(n%7+7)%7,g=7-t,O=n<0||n>6?n-(i+g)%7:(x+g)%7-(i+g)%7;return $(a,O)}class Le extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,r,t){switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,a){return e=q(e,t,a),e.setHours(0,0,0,0),e}}class Qe extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,r,t,a){const i=y=>{const x=Math.floor((y-1)/7)*7;return(y+a.weekStartsOn+6)%7+x};switch(r){case"e":case"ee":return h(w(r.length,e),i);case"eo":return h(t.ordinalNumber(e,{unit:"day"}),i);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,a){return e=q(e,t,a),e.setHours(0,0,0,0),e}}class ve extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,r,t,a){const i=y=>{const x=Math.floor((y-1)/7)*7;return(y+a.weekStartsOn+6)%7+x};switch(r){case"c":case"cc":return h(w(r.length,e),i);case"co":return h(t.ordinalNumber(e,{unit:"day"}),i);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,a){return e=q(e,t,a),e.setHours(0,0,0,0),e}}function Re(s,n){const e=P(s),r=we(e),t=n-r;return $(e,t)}class We extends u{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,r,t){const a=i=>i===0?7:i;switch(r){case"i":case"ii":return w(r.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return h(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return h(t.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return h(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return h(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,r){return r>=1&&r<=7}set(e,r,t){return e=Re(e,t),e.setHours(0,0,0,0),e}}class Ce extends u{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,r,t){switch(r){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(I(t),0,0,0),e}}class Be extends u{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,r,t){switch(r){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(I(t),0,0,0),e}}class Ge extends u{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","b","t","T"])}parse(e,r,t){switch(r){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(I(t),0,0,0),e}}class Ae extends u{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,r,t){switch(r){case"h":return l(f.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,t){const a=e.getHours()>=12;return a&&t<12?e.setHours(t+12,0,0,0):!a&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}}class Xe extends u{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,r,t){switch(r){case"H":return l(f.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,t){return e.setHours(t,0,0,0),e}}class Fe extends u{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,r,t){switch(r){case"K":return l(f.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}}class ze extends u{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,r,t){switch(r){case"k":return l(f.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,t){const a=t<=24?t%24:t;return e.setHours(a,0,0,0),e}}class Ze extends u{constructor(){super(...arguments);o(this,"priority",60);o(this,"incompatibleTokens",["t","T"])}parse(e,r,t){switch(r){case"m":return l(f.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setMinutes(t,0,0),e}}class Ke extends u{constructor(){super(...arguments);o(this,"priority",50);o(this,"incompatibleTokens",["t","T"])}parse(e,r,t){switch(r){case"s":return l(f.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setSeconds(t,0),e}}class $e extends u{constructor(){super(...arguments);o(this,"priority",30);o(this,"incompatibleTokens",["t","T"])}parse(e,r){const t=a=>Math.trunc(a*Math.pow(10,-r.length+3));return h(w(r.length,e),t)}set(e,r,t){return e.setMilliseconds(t),e}}class Ve extends u{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","x"])}parse(e,r){switch(r){case"X":return T(m.basicOptionalMinutes,e);case"XX":return T(m.basic,e);case"XXXX":return T(m.basicOptionalSeconds,e);case"XXXXX":return T(m.extendedOptionalSeconds,e);case"XXX":default:return T(m.extended,e)}}set(e,r,t){return r.timestampIsSet?e:b(e,e.getTime()-V(e)-t)}}class je extends u{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","X"])}parse(e,r){switch(r){case"x":return T(m.basicOptionalMinutes,e);case"xx":return T(m.basic,e);case"xxxx":return T(m.basicOptionalSeconds,e);case"xxxxx":return T(m.extendedOptionalSeconds,e);case"xxx":default:return T(m.extended,e)}}set(e,r,t){return r.timestampIsSet?e:b(e,e.getTime()-V(e)-t)}}class Ue extends u{constructor(){super(...arguments);o(this,"priority",40);o(this,"incompatibleTokens","*")}parse(e){return U(e)}set(e,r,t){return[b(e,t*1e3),{timestampIsSet:!0}]}}class Je extends u{constructor(){super(...arguments);o(this,"priority",20);o(this,"incompatibleTokens","*")}parse(e){return U(e)}set(e,r,t){return[b(e,t),{timestampIsSet:!0}]}}const Se={G:new xe,y:new pe,Y:new me,R:new Te,u:new ke,Q:new ge,q:new Pe,M:new De,L:new Me,w:new Ye,I:new Ee,d:new qe,D:new Ne,E:new Le,e:new Qe,c:new ve,i:new We,a:new Ce,b:new Be,B:new Ge,h:new Ae,H:new Xe,K:new Fe,k:new ze,m:new Ze,s:new Ke,S:new $e,X:new Ve,x:new je,t:new Ue,T:new Je},et=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rt=/^'([^]*?)'?$/,st=/''/g,nt=/\S/,at=/[a-zA-Z]/;function ut(s,n,e,r){var N,L,Q,v,R,W,C,B;const t=de(),a=(r==null?void 0:r.locale)??t.locale??ce,i=(r==null?void 0:r.firstWeekContainsDate)??((L=(N=r==null?void 0:r.locale)==null?void 0:N.options)==null?void 0:L.firstWeekContainsDate)??t.firstWeekContainsDate??((v=(Q=t.locale)==null?void 0:Q.options)==null?void 0:v.firstWeekContainsDate)??1,y=(r==null?void 0:r.weekStartsOn)??((W=(R=r==null?void 0:r.locale)==null?void 0:R.options)==null?void 0:W.weekStartsOn)??t.weekStartsOn??((B=(C=t.locale)==null?void 0:C.options)==null?void 0:B.weekStartsOn)??0;if(n==="")return s===""?P(e):b(e,NaN);const x={firstWeekContainsDate:i,weekStartsOn:y,locale:a},g=[new be],O=n.match(tt).map(c=>{const d=c[0];if(d in F){const p=F[d];return p(c,a.formatLong)}return c}).join("").match(et),D=[];for(let c of O){!(r!=null&&r.useAdditionalWeekYearTokens)&&ue(c)&&z(c,n,s),!(r!=null&&r.useAdditionalDayOfYearTokens)&&le(c)&&z(c,n,s);const d=c[0],p=Se[d];if(p){const{incompatibleTokens:G}=p;if(Array.isArray(G)){const A=D.find(X=>G.includes(X.token)||X.token===d);if(A)throw new RangeError(`The format string mustn't contain \`${A.fullToken}\` and \`${c}\` at the same time`)}else if(p.incompatibleTokens==="*"&&D.length>0)throw new RangeError(`The format string mustn't contain \`${c}\` and any other token at the same time`);D.push({token:d,fullToken:c});const E=p.run(s,c,a.match,x);if(!E)return b(e,NaN);g.push(E.setter),s=E.rest}else{if(d.match(at))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");if(c==="''"?c="'":d==="'"&&(c=ot(c)),s.indexOf(c)===0)s=s.slice(c.length);else return b(e,NaN)}}if(s.length>0&&nt.test(s))return b(e,NaN);const _=g.map(c=>c.priority).sort((c,d)=>d-c).filter((c,d,p)=>p.indexOf(c)===d).map(c=>g.filter(d=>d.priority===c).sort((d,p)=>p.subPriority-d.subPriority)).map(c=>c[0]);let k=P(e);if(isNaN(k.getTime()))return b(e,NaN);const M={};for(const c of _){if(!c.validate(k,x))return b(e,NaN);const d=c.set(k,M,x);Array.isArray(d)?(k=d[0],Object.assign(M,d[1])):k=d}return b(e,k)}function ot(s){return s.match(rt)[1].replace(st,"'")}export{we as a,Se as b,Re as c,Oe as d,_e as e,de as g,ut as p,q as s,fe as t};