@wikicasa-dev/utilities 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(r){const e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new r.constructor(+r):typeof r=="number"||e==="[object Number]"||typeof r=="string"||e==="[object String]"?new Date(r):new Date(NaN)}function m(r,e){return r instanceof Date?new r.constructor(e):new Date(e)}function X(r,e){const t=p(r);return isNaN(e)?m(r,NaN):(e&&t.setDate(t.getDate()+e),t)}const te=6048e5,me=864e5,we=6e4,ye=36e5,ge=1e3;let be={};function _(){return be}function O(r,e){const t=_(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=p(r),s=a.getDay(),o=(s<n?7:0)+s-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function W(r){return O(r,{weekStartsOn:1})}function ne(r){const e=p(r),t=e.getFullYear(),n=m(r,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const a=W(n),s=m(r,0);s.setFullYear(t,0,4),s.setHours(0,0,0,0);const o=W(s);return e.getTime()>=a.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function J(r){const e=p(r);return e.setHours(0,0,0,0),e}function F(r){const e=p(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function pe(r,e){const t=J(r),n=J(e),a=+t-F(t),s=+n-F(n);return Math.round((a-s)/me)}function xe(r){const e=ne(r),t=m(r,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),W(t)}function Me(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function re(r){if(!Me(r)&&typeof r!="number")return!1;const e=p(r);return!isNaN(Number(e))}function Pe(r){const e=p(r),t=m(r,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const De={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"}},Te=(r,e,t)=>{let n;const a=De[r];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function I(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const ke={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Oe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ve={date:I({formats:ke,defaultWidth:"full"}),time:I({formats:Oe,defaultWidth:"full"}),dateTime:I({formats:Ye,defaultWidth:"full"})},Ee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},We=(r,e,t,n)=>Ee[r];function q(r){return(e,t)=>{const n=t?.context?String(t.context):"standalone";let a;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,d=t?.width?String(t.width):o;a=r.formattingValues[d]||r.formattingValues[o]}else{const o=r.defaultWidth,d=t?.width?String(t.width):r.defaultWidth;a=r.values[d]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(e):e;return a[s]}}const _e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ne={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qe={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"]},He={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"]},Fe={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"}},Le={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"}},Ce=(r,e)=>{const t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Ie={ordinalNumber:Ce,era:q({values:_e,defaultWidth:"wide"}),quarter:q({values:Ne,defaultWidth:"wide",argumentCallback:r=>r-1}),month:q({values:qe,defaultWidth:"wide"}),day:q({values:He,defaultWidth:"wide"}),dayPeriod:q({values:Fe,defaultWidth:"wide",formattingValues:Le,defaultFormattingWidth:"wide"})};function H(r){return(e,t={})=>{const n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(a);if(!s)return null;const o=s[0],d=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],M=Array.isArray(d)?Re(d,f=>f.test(o)):Qe(d,f=>f.test(o));let x;x=r.valueCallback?r.valueCallback(M):M,x=t.valueCallback?t.valueCallback(x):x;const b=e.slice(o.length);return{value:x,rest:b}}}function Qe(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function Re(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return t}function Xe(r){return(e,t={})=>{const n=e.match(r.matchPattern);if(!n)return null;const a=n[0],s=e.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const d=e.slice(a.length);return{value:o,rest:d}}}const Ge=/^(\d+)(th|st|nd|rd)?/i,Be=/\d+/i,Ae={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},$e={any:[/^b/i,/^(a|c)/i]},je={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ve={any:[/1/i,/2/i,/3/i,/4/i]},ze={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},Je={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]},Ze={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},Ke={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]},Ue={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},Se={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}},et={ordinalNumber:Xe({matchPattern:Ge,parsePattern:Be,valueCallback:r=>parseInt(r,10)}),era:H({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:$e,defaultParseWidth:"any"}),quarter:H({matchPatterns:je,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any",valueCallback:r=>r+1}),month:H({matchPatterns:ze,defaultMatchWidth:"wide",parsePatterns:Je,defaultParseWidth:"any"}),day:H({matchPatterns:Ze,defaultMatchWidth:"wide",parsePatterns:Ke,defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:Ue,defaultMatchWidth:"any",parsePatterns:Se,defaultParseWidth:"any"})},ae={code:"en-US",formatDistance:Te,formatLong:ve,formatRelative:We,localize:Ie,match:et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function tt(r){const e=p(r);return pe(e,Pe(e))+1}function se(r){const e=p(r),t=+W(e)-+xe(e);return Math.round(t/te)+1}function G(r,e){const t=p(r),n=t.getFullYear(),a=_(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=m(r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const d=O(o,e),M=m(r,0);M.setFullYear(n,0,s),M.setHours(0,0,0,0);const x=O(M,e);return t.getTime()>=d.getTime()?n+1:t.getTime()>=x.getTime()?n:n-1}function nt(r,e){const t=_(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=G(r,e),s=m(r,0);return s.setFullYear(a,0,n),s.setHours(0,0,0,0),O(s,e)}function oe(r,e){const t=p(r),n=+O(t,e)-+nt(t,e);return Math.round(n/te)+1}function c(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const k={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return c(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):c(t+1,2)},d(r,e){return c(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return c(r.getHours()%12||12,e.length)},H(r,e){return c(r.getHours(),e.length)},m(r,e){return c(r.getMinutes(),e.length)},s(r,e){return c(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return c(a,e.length)}},E={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Z={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return k.y(r,e)},Y:function(r,e,t,n){const a=G(r,n),s=a>0?a:1-a;if(e==="YY"){const o=s%100;return c(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):c(s,e.length)},R:function(r,e){const t=ne(r);return c(t,e.length)},u:function(r,e){const t=r.getFullYear();return c(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return c(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return c(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return k.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return c(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=oe(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(r,e,t){const n=se(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):c(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):k.d(r,e)},D:function(r,e,t){const n=tt(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):c(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return c(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return c(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=E.noon:n===0?a=E.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=E.evening:n>=12?a=E.afternoon:n>=4?a=E.morning:a=E.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return k.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):k.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):k.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):k.s(r,e)},S:function(r,e){return k.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return U(n);case"XXXX":case"XX":return Y(n);case"XXXXX":case"XXX":default:return Y(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return U(n);case"xxxx":case"xx":return Y(n);case"xxxxx":case"xxx":default:return Y(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+K(n,":");case"OOOO":default:return"GMT"+Y(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+K(n,":");case"zzzz":default:return"GMT"+Y(n,":")}},t:function(r,e,t){const n=Math.trunc(r.getTime()/1e3);return c(n,e.length)},T:function(r,e,t){const n=r.getTime();return c(n,e.length)}};function K(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),s=n%60;return s===0?t+String(a):t+String(a)+e+c(s,2)}function U(r,e){return r%60===0?(r>0?"-":"+")+c(Math.abs(r)/60,2):Y(r,e)}function Y(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=c(Math.trunc(n/60),2),s=c(n%60,2);return t+a+e+s}const S=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ie=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},rt=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return S(r,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",S(n,e)).replace("{{time}}",ie(a,e))},Q={p:ie,P:rt},at=/^D+$/,st=/^Y+$/,ot=["D","DD","YY","YYYY"];function ue(r){return at.test(r)}function ce(r){return st.test(r)}function R(r,e,t){const n=it(r,e,t);if(console.warn(n),ot.includes(r))throw new RangeError(n)}function it(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ut=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dt=/^'([^]*?)'?$/,lt=/''/g,ft=/[a-zA-Z]/;function ee(r,e,t){const n=_(),a=n.locale??ae,s=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,d=p(r);if(!re(d))throw new RangeError("Invalid time value");let M=e.match(ct).map(b=>{const f=b[0];if(f==="p"||f==="P"){const N=Q[f];return N(b,a.formatLong)}return b}).join("").match(ut).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const f=b[0];if(f==="'")return{isToken:!1,value:ht(b)};if(Z[f])return{isToken:!0,value:b};if(f.match(ft))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(M=a.localize.preprocessor(d,M));const x={firstWeekContainsDate:s,weekStartsOn:o,locale:a};return M.map(b=>{if(!b.isToken)return b.value;const f=b.value;(ce(f)||ue(f))&&R(f,e,String(r));const N=Z[f[0]];return N(d,f,a.localize,x)}).join("")}function ht(r){const e=r.match(dt);return e?e[1].replace(lt,"'"):r}function mt(){return Object.assign({},_())}function wt(r){let t=p(r).getDay();return t===0&&(t=7),t}function yt(r,e){const t=e instanceof Date?m(e,0):new e(0);return t.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),t.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),t}const gt=10;class de{subPriority=0;validate(e,t){return!0}}class bt extends de{constructor(e,t,n,a,s){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=a,s&&(this.subPriority=s)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class pt extends de{priority=gt;subPriority=-1;set(e,t){return t.timestampIsSet?e:m(e,yt(e,Date))}}class u{run(e,t,n,a){const s=this.parse(e,t,n,a);return s?{setter:new bt(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(e,t,n){return!0}}class xt extends u{priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const y={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}/},D={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 g(r,e){return r&&{value:e(r.value),rest:r.rest}}function l(r,e){const t=e.match(r);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function T(r,e){const t=e.match(r);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};const n=t[1]==="+"?1:-1,a=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(a*ye+s*we+o*ge),rest:e.slice(t[0].length)}}function le(r){return l(y.anyDigitsSigned,r)}function w(r,e){switch(r){case 1:return l(y.singleDigit,e);case 2:return l(y.twoDigits,e);case 3:return l(y.threeDigits,e);case 4:return l(y.fourDigits,e);default:return l(new RegExp("^\\d{1,"+r+"}"),e)}}function L(r,e){switch(r){case 1:return l(y.singleDigitSigned,e);case 2:return l(y.twoDigitsSigned,e);case 3:return l(y.threeDigitsSigned,e);case 4:return l(y.fourDigitsSigned,e);default:return l(new RegExp("^-?\\d{1,"+r+"}"),e)}}function B(r){switch(r){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 fe(r,e){const t=e>0,n=t?e:1-e;let a;if(n<=50)a=r||100;else{const s=n+50,o=Math.trunc(s/100)*100,d=r>=s%100;a=r+o-(d?100:0)}return t?a:1-a}function he(r){return r%400===0||r%4===0&&r%100!==0}class Mt extends u{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="yy"});switch(t){case"y":return g(w(4,e),a);case"yo":return g(n.ordinalNumber(e,{unit:"year"}),a);default:return g(w(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const a=e.getFullYear();if(n.isTwoDigitYear){const o=fe(n.year,a);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const s=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Pt extends u{priority=130;parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="YY"});switch(t){case"Y":return g(w(4,e),a);case"Yo":return g(n.ordinalNumber(e,{unit:"year"}),a);default:return g(w(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,a){const s=G(e,a);if(n.isTwoDigitYear){const d=fe(n.year,s);return e.setFullYear(d,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),O(e,a)}const o=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(o,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),O(e,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Dt extends u{priority=130;parse(e,t){return L(t==="R"?4:t.length,e)}set(e,t,n){const a=m(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),W(a)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Tt extends u{priority=130;parse(e,t){return L(t==="u"?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class kt extends u{priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return w(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Ot extends u{priority=120;parse(e,t,n){switch(t){case"q":case"qq":return w(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Yt extends u{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"M":return g(l(y.month,e),a);case"MM":return g(w(2,e),a);case"Mo":return g(n.ordinalNumber(e,{unit:"month"}),a);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class vt extends u{priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"L":return g(l(y.month,e),a);case"LL":return g(w(2,e),a);case"Lo":return g(n.ordinalNumber(e,{unit:"month"}),a);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Et(r,e,t){const n=p(r),a=oe(n,t)-e;return n.setDate(n.getDate()-a*7),n}class Wt extends u{priority=100;parse(e,t,n){switch(t){case"w":return l(y.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,a){return O(Et(e,n,a),a)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _t(r,e){const t=p(r),n=se(t)-e;return t.setDate(t.getDate()-n*7),t}class Nt extends u{priority=100;parse(e,t,n){switch(t){case"I":return l(y.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return W(_t(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const qt=[31,28,31,30,31,30,31,31,30,31,30,31],Ht=[31,29,31,30,31,30,31,31,30,31,30,31];class Ft extends u{priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return l(y.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return w(t.length,e)}}validate(e,t){const n=e.getFullYear(),a=he(n),s=e.getMonth();return a?t>=1&&t<=Ht[s]:t>=1&&t<=qt[s]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Lt extends u{priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return l(y.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return w(t.length,e)}}validate(e,t){const n=e.getFullYear();return he(n)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function A(r,e,t){const n=_(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=p(r),o=s.getDay(),M=(e%7+7)%7,x=7-a,b=e<0||e>6?e-(o+x)%7:(M+x)%7-(o+x)%7;return X(s,b)}class Ct extends u{priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class It extends u{priority=90;parse(e,t,n,a){const s=o=>{const d=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+d};switch(t){case"e":case"ee":return g(w(t.length,e),s);case"eo":return g(n.ordinalNumber(e,{unit:"day"}),s);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Qt extends u{priority=90;parse(e,t,n,a){const s=o=>{const d=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+d};switch(t){case"c":case"cc":return g(w(t.length,e),s);case"co":return g(n.ordinalNumber(e,{unit:"day"}),s);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Rt(r,e){const t=p(r),n=wt(t),a=e-n;return X(t,a)}class Xt extends u{priority=90;parse(e,t,n){const a=s=>s===0?7:s;switch(t){case"i":case"ii":return w(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return g(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return g(n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return g(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return g(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=Rt(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Gt extends u{priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Bt extends u{priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class At extends u{priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class $t extends u{priority=70;parse(e,t,n){switch(t){case"h":return l(y.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const a=e.getHours()>=12;return a&&n<12?e.setHours(n+12,0,0,0):!a&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class jt extends u{priority=70;parse(e,t,n){switch(t){case"H":return l(y.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class Vt extends u{priority=70;parse(e,t,n){switch(t){case"K":return l(y.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class zt extends u{priority=70;parse(e,t,n){switch(t){case"k":return l(y.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const a=n<=24?n%24:n;return e.setHours(a,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class Jt extends u{priority=60;parse(e,t,n){switch(t){case"m":return l(y.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}class Zt extends u{priority=50;parse(e,t,n){switch(t){case"s":return l(y.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class Kt extends u{priority=30;parse(e,t){const n=a=>Math.trunc(a*Math.pow(10,-t.length+3));return g(w(t.length,e),n)}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class Ut extends u{priority=10;parse(e,t){switch(t){case"X":return T(D.basicOptionalMinutes,e);case"XX":return T(D.basic,e);case"XXXX":return T(D.basicOptionalSeconds,e);case"XXXXX":return T(D.extendedOptionalSeconds,e);case"XXX":default:return T(D.extended,e)}}set(e,t,n){return t.timestampIsSet?e:m(e,e.getTime()-F(e)-n)}incompatibleTokens=["t","T","x"]}class St extends u{priority=10;parse(e,t){switch(t){case"x":return T(D.basicOptionalMinutes,e);case"xx":return T(D.basic,e);case"xxxx":return T(D.basicOptionalSeconds,e);case"xxxxx":return T(D.extendedOptionalSeconds,e);case"xxx":default:return T(D.extended,e)}}set(e,t,n){return t.timestampIsSet?e:m(e,e.getTime()-F(e)-n)}incompatibleTokens=["t","T","X"]}class en extends u{priority=40;parse(e){return le(e)}set(e,t,n){return[m(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class tn extends u{priority=20;parse(e){return le(e)}set(e,t,n){return[m(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const nn={G:new xt,y:new Mt,Y:new Pt,R:new Dt,u:new Tt,Q:new kt,q:new Ot,M:new Yt,L:new vt,w:new Wt,I:new Nt,d:new Ft,D:new Lt,E:new Ct,e:new It,c:new Qt,i:new Xt,a:new Gt,b:new Bt,B:new At,h:new $t,H:new jt,K:new Vt,k:new zt,m:new Jt,s:new Zt,S:new Kt,X:new Ut,x:new St,t:new en,T:new tn},rn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,an=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sn=/^'([^]*?)'?$/,on=/''/g,un=/\S/,cn=/[a-zA-Z]/;function dn(r,e,t,n){const a=mt(),s=a.locale??ae,o=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,d=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(e==="")return r===""?p(t):m(t,NaN);const M={firstWeekContainsDate:o,weekStartsOn:d,locale:s},x=[new pt],b=e.match(an).map(i=>{const h=i[0];if(h in Q){const P=Q[h];return P(i,s.formatLong)}return i}).join("").match(rn),f=[];for(let i of b){ce(i)&&R(i,e,r),ue(i)&&R(i,e,r);const h=i[0],P=nn[h];if(P){const{incompatibleTokens:j}=P;if(Array.isArray(j)){const V=f.find(z=>j.includes(z.token)||z.token===h);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${i}\` at the same time`)}else if(P.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);f.push({token:h,fullToken:i});const C=P.run(r,i,s.match,M);if(!C)return m(t,NaN);x.push(C.setter),r=C.rest}else{if(h.match(cn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");if(i==="''"?i="'":h==="'"&&(i=ln(i)),r.indexOf(i)===0)r=r.slice(i.length);else return m(t,NaN)}}if(r.length>0&&un.test(r))return m(t,NaN);const N=x.map(i=>i.priority).sort((i,h)=>h-i).filter((i,h,P)=>P.indexOf(i)===h).map(i=>x.filter(h=>h.priority===i).sort((h,P)=>P.subPriority-h.subPriority)).map(i=>i[0]);let v=p(t);if(isNaN(v.getTime()))return m(t,NaN);const $={};for(const i of N){if(!i.validate(v,M))return m(t,NaN);const h=i.set(v,$,M);Array.isArray(h)?(v=h[0],Object.assign($,h[1])):v=h}return m(t,v)}function ln(r){return r.match(sn)[1].replace(on,"'")}function fn(r,e){return X(r,-e)}function hn(r,e=!1){const t=r.getDate(),n=r.getMonth()+1,a=r.getFullYear();return e?`${("0"+t).slice(-2)}-${("0"+n).slice(-2)}-${a}`:`${a}-${("0"+n).slice(-2)}-${("0"+t).slice(-2)}`}const mn=r=>{if(typeof r=="string"){const e=new Date(r);return isNaN(e.valueOf())?"":ee(e,"dd/MM/yyyy")}return ee(r,"dd/MM/yyyy")},wn=(r=new Date,e)=>(e<0&&(e=0),fn(r,e));function yn(r){const t=["yyyy-MM-dd","yyyy/MM/dd","dd/MM/yyyy","dd-MM-yyyy"].map(n=>dn(r,n,new Date)).find(n=>re(n));if(t){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{start:n.toISOString(),end:a.toISOString()}}return{start:null,end:null}}exports.formatDate=hn;exports.formatDateToddMMYYYY=mn;exports.getStartAndEndOfDayUTC=yn;exports.subtractDaysFromDate=wn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(r){const e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new r.constructor(+r):typeof r=="number"||e==="[object Number]"||typeof r=="string"||e==="[object String]"?new Date(r):new Date(NaN)}function m(r,e){return r instanceof Date?new r.constructor(e):new Date(e)}function X(r,e){const t=p(r);return isNaN(e)?m(r,NaN):(e&&t.setDate(t.getDate()+e),t)}const te=6048e5,me=864e5,we=6e4,ye=36e5,ge=1e3;let be={};function _(){return be}function O(r,e){const t=_(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=p(r),s=a.getDay(),o=(s<n?7:0)+s-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function W(r){return O(r,{weekStartsOn:1})}function ne(r){const e=p(r),t=e.getFullYear(),n=m(r,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const a=W(n),s=m(r,0);s.setFullYear(t,0,4),s.setHours(0,0,0,0);const o=W(s);return e.getTime()>=a.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function J(r){const e=p(r);return e.setHours(0,0,0,0),e}function F(r){const e=p(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function pe(r,e){const t=J(r),n=J(e),a=+t-F(t),s=+n-F(n);return Math.round((a-s)/me)}function xe(r){const e=ne(r),t=m(r,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),W(t)}function Me(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function re(r){if(!Me(r)&&typeof r!="number")return!1;const e=p(r);return!isNaN(Number(e))}function Pe(r){const e=p(r),t=m(r,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const De={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"}},Te=(r,e,t)=>{let n;const a=De[r];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function I(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const ke={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Oe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ve={date:I({formats:ke,defaultWidth:"full"}),time:I({formats:Oe,defaultWidth:"full"}),dateTime:I({formats:Ye,defaultWidth:"full"})},Ee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},We=(r,e,t,n)=>Ee[r];function q(r){return(e,t)=>{const n=t?.context?String(t.context):"standalone";let a;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,d=t?.width?String(t.width):o;a=r.formattingValues[d]||r.formattingValues[o]}else{const o=r.defaultWidth,d=t?.width?String(t.width):r.defaultWidth;a=r.values[d]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(e):e;return a[s]}}const _e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ne={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qe={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"]},He={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"]},Fe={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"}},Le={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"}},Ce=(r,e)=>{const t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Ie={ordinalNumber:Ce,era:q({values:_e,defaultWidth:"wide"}),quarter:q({values:Ne,defaultWidth:"wide",argumentCallback:r=>r-1}),month:q({values:qe,defaultWidth:"wide"}),day:q({values:He,defaultWidth:"wide"}),dayPeriod:q({values:Fe,defaultWidth:"wide",formattingValues:Le,defaultFormattingWidth:"wide"})};function H(r){return(e,t={})=>{const n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(a);if(!s)return null;const o=s[0],d=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],M=Array.isArray(d)?Re(d,f=>f.test(o)):Qe(d,f=>f.test(o));let x;x=r.valueCallback?r.valueCallback(M):M,x=t.valueCallback?t.valueCallback(x):x;const b=e.slice(o.length);return{value:x,rest:b}}}function Qe(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function Re(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return t}function Xe(r){return(e,t={})=>{const n=e.match(r.matchPattern);if(!n)return null;const a=n[0],s=e.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const d=e.slice(a.length);return{value:o,rest:d}}}const Ge=/^(\d+)(th|st|nd|rd)?/i,Be=/\d+/i,Ae={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},$e={any:[/^b/i,/^(a|c)/i]},je={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ve={any:[/1/i,/2/i,/3/i,/4/i]},ze={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},Je={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]},Ze={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},Ke={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]},Ue={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},Se={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}},et={ordinalNumber:Xe({matchPattern:Ge,parsePattern:Be,valueCallback:r=>parseInt(r,10)}),era:H({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:$e,defaultParseWidth:"any"}),quarter:H({matchPatterns:je,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any",valueCallback:r=>r+1}),month:H({matchPatterns:ze,defaultMatchWidth:"wide",parsePatterns:Je,defaultParseWidth:"any"}),day:H({matchPatterns:Ze,defaultMatchWidth:"wide",parsePatterns:Ke,defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:Ue,defaultMatchWidth:"any",parsePatterns:Se,defaultParseWidth:"any"})},ae={code:"en-US",formatDistance:Te,formatLong:ve,formatRelative:We,localize:Ie,match:et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function tt(r){const e=p(r);return pe(e,Pe(e))+1}function se(r){const e=p(r),t=+W(e)-+xe(e);return Math.round(t/te)+1}function G(r,e){const t=p(r),n=t.getFullYear(),a=_(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=m(r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const d=O(o,e),M=m(r,0);M.setFullYear(n,0,s),M.setHours(0,0,0,0);const x=O(M,e);return t.getTime()>=d.getTime()?n+1:t.getTime()>=x.getTime()?n:n-1}function nt(r,e){const t=_(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=G(r,e),s=m(r,0);return s.setFullYear(a,0,n),s.setHours(0,0,0,0),O(s,e)}function oe(r,e){const t=p(r),n=+O(t,e)-+nt(t,e);return Math.round(n/te)+1}function c(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const k={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return c(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):c(t+1,2)},d(r,e){return c(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return c(r.getHours()%12||12,e.length)},H(r,e){return c(r.getHours(),e.length)},m(r,e){return c(r.getMinutes(),e.length)},s(r,e){return c(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return c(a,e.length)}},E={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Z={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return k.y(r,e)},Y:function(r,e,t,n){const a=G(r,n),s=a>0?a:1-a;if(e==="YY"){const o=s%100;return c(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):c(s,e.length)},R:function(r,e){const t=ne(r);return c(t,e.length)},u:function(r,e){const t=r.getFullYear();return c(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return c(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return c(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return k.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return c(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=oe(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(r,e,t){const n=se(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):c(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):k.d(r,e)},D:function(r,e,t){const n=tt(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):c(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return c(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return c(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=E.noon:n===0?a=E.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=E.evening:n>=12?a=E.afternoon:n>=4?a=E.morning:a=E.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return k.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):k.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):k.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):k.s(r,e)},S:function(r,e){return k.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return U(n);case"XXXX":case"XX":return Y(n);case"XXXXX":case"XXX":default:return Y(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return U(n);case"xxxx":case"xx":return Y(n);case"xxxxx":case"xxx":default:return Y(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+K(n,":");case"OOOO":default:return"GMT"+Y(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+K(n,":");case"zzzz":default:return"GMT"+Y(n,":")}},t:function(r,e,t){const n=Math.trunc(r.getTime()/1e3);return c(n,e.length)},T:function(r,e,t){const n=r.getTime();return c(n,e.length)}};function K(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),s=n%60;return s===0?t+String(a):t+String(a)+e+c(s,2)}function U(r,e){return r%60===0?(r>0?"-":"+")+c(Math.abs(r)/60,2):Y(r,e)}function Y(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=c(Math.trunc(n/60),2),s=c(n%60,2);return t+a+e+s}const S=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ie=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},rt=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return S(r,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",S(n,e)).replace("{{time}}",ie(a,e))},Q={p:ie,P:rt},at=/^D+$/,st=/^Y+$/,ot=["D","DD","YY","YYYY"];function ue(r){return at.test(r)}function ce(r){return st.test(r)}function R(r,e,t){const n=it(r,e,t);if(console.warn(n),ot.includes(r))throw new RangeError(n)}function it(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ut=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dt=/^'([^]*?)'?$/,lt=/''/g,ft=/[a-zA-Z]/;function ee(r,e,t){const n=_(),a=n.locale??ae,s=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,d=p(r);if(!re(d))throw new RangeError("Invalid time value");let M=e.match(ct).map(b=>{const f=b[0];if(f==="p"||f==="P"){const N=Q[f];return N(b,a.formatLong)}return b}).join("").match(ut).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const f=b[0];if(f==="'")return{isToken:!1,value:ht(b)};if(Z[f])return{isToken:!0,value:b};if(f.match(ft))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(M=a.localize.preprocessor(d,M));const x={firstWeekContainsDate:s,weekStartsOn:o,locale:a};return M.map(b=>{if(!b.isToken)return b.value;const f=b.value;(ce(f)||ue(f))&&R(f,e,String(r));const N=Z[f[0]];return N(d,f,a.localize,x)}).join("")}function ht(r){const e=r.match(dt);return e?e[1].replace(lt,"'"):r}function mt(){return Object.assign({},_())}function wt(r){let t=p(r).getDay();return t===0&&(t=7),t}function yt(r,e){const t=e instanceof Date?m(e,0):new e(0);return t.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),t.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),t}const gt=10;class de{subPriority=0;validate(e,t){return!0}}class bt extends de{constructor(e,t,n,a,s){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=a,s&&(this.subPriority=s)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class pt extends de{priority=gt;subPriority=-1;set(e,t){return t.timestampIsSet?e:m(e,yt(e,Date))}}class u{run(e,t,n,a){const s=this.parse(e,t,n,a);return s?{setter:new bt(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(e,t,n){return!0}}class xt extends u{priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const y={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}/},D={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 g(r,e){return r&&{value:e(r.value),rest:r.rest}}function l(r,e){const t=e.match(r);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function T(r,e){const t=e.match(r);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};const n=t[1]==="+"?1:-1,a=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(a*ye+s*we+o*ge),rest:e.slice(t[0].length)}}function le(r){return l(y.anyDigitsSigned,r)}function w(r,e){switch(r){case 1:return l(y.singleDigit,e);case 2:return l(y.twoDigits,e);case 3:return l(y.threeDigits,e);case 4:return l(y.fourDigits,e);default:return l(new RegExp("^\\d{1,"+r+"}"),e)}}function L(r,e){switch(r){case 1:return l(y.singleDigitSigned,e);case 2:return l(y.twoDigitsSigned,e);case 3:return l(y.threeDigitsSigned,e);case 4:return l(y.fourDigitsSigned,e);default:return l(new RegExp("^-?\\d{1,"+r+"}"),e)}}function B(r){switch(r){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 fe(r,e){const t=e>0,n=t?e:1-e;let a;if(n<=50)a=r||100;else{const s=n+50,o=Math.trunc(s/100)*100,d=r>=s%100;a=r+o-(d?100:0)}return t?a:1-a}function he(r){return r%400===0||r%4===0&&r%100!==0}class Mt extends u{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="yy"});switch(t){case"y":return g(w(4,e),a);case"yo":return g(n.ordinalNumber(e,{unit:"year"}),a);default:return g(w(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const a=e.getFullYear();if(n.isTwoDigitYear){const o=fe(n.year,a);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const s=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Pt extends u{priority=130;parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="YY"});switch(t){case"Y":return g(w(4,e),a);case"Yo":return g(n.ordinalNumber(e,{unit:"year"}),a);default:return g(w(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,a){const s=G(e,a);if(n.isTwoDigitYear){const d=fe(n.year,s);return e.setFullYear(d,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),O(e,a)}const o=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(o,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),O(e,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Dt extends u{priority=130;parse(e,t){return L(t==="R"?4:t.length,e)}set(e,t,n){const a=m(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),W(a)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Tt extends u{priority=130;parse(e,t){return L(t==="u"?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class kt extends u{priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return w(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Ot extends u{priority=120;parse(e,t,n){switch(t){case"q":case"qq":return w(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Yt extends u{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"M":return g(l(y.month,e),a);case"MM":return g(w(2,e),a);case"Mo":return g(n.ordinalNumber(e,{unit:"month"}),a);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class vt extends u{priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"L":return g(l(y.month,e),a);case"LL":return g(w(2,e),a);case"Lo":return g(n.ordinalNumber(e,{unit:"month"}),a);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Et(r,e,t){const n=p(r),a=oe(n,t)-e;return n.setDate(n.getDate()-a*7),n}class Wt extends u{priority=100;parse(e,t,n){switch(t){case"w":return l(y.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,a){return O(Et(e,n,a),a)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _t(r,e){const t=p(r),n=se(t)-e;return t.setDate(t.getDate()-n*7),t}class Nt extends u{priority=100;parse(e,t,n){switch(t){case"I":return l(y.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return W(_t(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const qt=[31,28,31,30,31,30,31,31,30,31,30,31],Ht=[31,29,31,30,31,30,31,31,30,31,30,31];class Ft extends u{priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return l(y.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return w(t.length,e)}}validate(e,t){const n=e.getFullYear(),a=he(n),s=e.getMonth();return a?t>=1&&t<=Ht[s]:t>=1&&t<=qt[s]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Lt extends u{priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return l(y.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return w(t.length,e)}}validate(e,t){const n=e.getFullYear();return he(n)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function A(r,e,t){const n=_(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=p(r),o=s.getDay(),M=(e%7+7)%7,x=7-a,b=e<0||e>6?e-(o+x)%7:(M+x)%7-(o+x)%7;return X(s,b)}class Ct extends u{priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class It extends u{priority=90;parse(e,t,n,a){const s=o=>{const d=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+d};switch(t){case"e":case"ee":return g(w(t.length,e),s);case"eo":return g(n.ordinalNumber(e,{unit:"day"}),s);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Qt extends u{priority=90;parse(e,t,n,a){const s=o=>{const d=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+d};switch(t){case"c":case"cc":return g(w(t.length,e),s);case"co":return g(n.ordinalNumber(e,{unit:"day"}),s);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=A(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Rt(r,e){const t=p(r),n=wt(t),a=e-n;return X(t,a)}class Xt extends u{priority=90;parse(e,t,n){const a=s=>s===0?7:s;switch(t){case"i":case"ii":return w(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return g(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return g(n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return g(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return g(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=Rt(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Gt extends u{priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Bt extends u{priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class At extends u{priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(B(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class $t extends u{priority=70;parse(e,t,n){switch(t){case"h":return l(y.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const a=e.getHours()>=12;return a&&n<12?e.setHours(n+12,0,0,0):!a&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class jt extends u{priority=70;parse(e,t,n){switch(t){case"H":return l(y.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class Vt extends u{priority=70;parse(e,t,n){switch(t){case"K":return l(y.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class zt extends u{priority=70;parse(e,t,n){switch(t){case"k":return l(y.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return w(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const a=n<=24?n%24:n;return e.setHours(a,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class Jt extends u{priority=60;parse(e,t,n){switch(t){case"m":return l(y.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}class Zt extends u{priority=50;parse(e,t,n){switch(t){case"s":return l(y.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return w(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class Kt extends u{priority=30;parse(e,t){const n=a=>Math.trunc(a*Math.pow(10,-t.length+3));return g(w(t.length,e),n)}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class Ut extends u{priority=10;parse(e,t){switch(t){case"X":return T(D.basicOptionalMinutes,e);case"XX":return T(D.basic,e);case"XXXX":return T(D.basicOptionalSeconds,e);case"XXXXX":return T(D.extendedOptionalSeconds,e);case"XXX":default:return T(D.extended,e)}}set(e,t,n){return t.timestampIsSet?e:m(e,e.getTime()-F(e)-n)}incompatibleTokens=["t","T","x"]}class St extends u{priority=10;parse(e,t){switch(t){case"x":return T(D.basicOptionalMinutes,e);case"xx":return T(D.basic,e);case"xxxx":return T(D.basicOptionalSeconds,e);case"xxxxx":return T(D.extendedOptionalSeconds,e);case"xxx":default:return T(D.extended,e)}}set(e,t,n){return t.timestampIsSet?e:m(e,e.getTime()-F(e)-n)}incompatibleTokens=["t","T","X"]}class en extends u{priority=40;parse(e){return le(e)}set(e,t,n){return[m(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class tn extends u{priority=20;parse(e){return le(e)}set(e,t,n){return[m(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const nn={G:new xt,y:new Mt,Y:new Pt,R:new Dt,u:new Tt,Q:new kt,q:new Ot,M:new Yt,L:new vt,w:new Wt,I:new Nt,d:new Ft,D:new Lt,E:new Ct,e:new It,c:new Qt,i:new Xt,a:new Gt,b:new Bt,B:new At,h:new $t,H:new jt,K:new Vt,k:new zt,m:new Jt,s:new Zt,S:new Kt,X:new Ut,x:new St,t:new en,T:new tn},rn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,an=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sn=/^'([^]*?)'?$/,on=/''/g,un=/\S/,cn=/[a-zA-Z]/;function dn(r,e,t,n){const a=mt(),s=a.locale??ae,o=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,d=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(e==="")return r===""?p(t):m(t,NaN);const M={firstWeekContainsDate:o,weekStartsOn:d,locale:s},x=[new pt],b=e.match(an).map(i=>{const h=i[0];if(h in Q){const P=Q[h];return P(i,s.formatLong)}return i}).join("").match(rn),f=[];for(let i of b){ce(i)&&R(i,e,r),ue(i)&&R(i,e,r);const h=i[0],P=nn[h];if(P){const{incompatibleTokens:j}=P;if(Array.isArray(j)){const V=f.find(z=>j.includes(z.token)||z.token===h);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${i}\` at the same time`)}else if(P.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);f.push({token:h,fullToken:i});const C=P.run(r,i,s.match,M);if(!C)return m(t,NaN);x.push(C.setter),r=C.rest}else{if(h.match(cn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");if(i==="''"?i="'":h==="'"&&(i=ln(i)),r.indexOf(i)===0)r=r.slice(i.length);else return m(t,NaN)}}if(r.length>0&&un.test(r))return m(t,NaN);const N=x.map(i=>i.priority).sort((i,h)=>h-i).filter((i,h,P)=>P.indexOf(i)===h).map(i=>x.filter(h=>h.priority===i).sort((h,P)=>P.subPriority-h.subPriority)).map(i=>i[0]);let v=p(t);if(isNaN(v.getTime()))return m(t,NaN);const $={};for(const i of N){if(!i.validate(v,M))return m(t,NaN);const h=i.set(v,$,M);Array.isArray(h)?(v=h[0],Object.assign($,h[1])):v=h}return m(t,v)}function ln(r){return r.match(sn)[1].replace(on,"'")}function fn(r,e){return X(r,-e)}function hn(r,e=!1){const t=r.getDate(),n=r.getMonth()+1,a=r.getFullYear();return e?`${("0"+t).slice(-2)}-${("0"+n).slice(-2)}-${a}`:`${a}-${("0"+n).slice(-2)}-${("0"+t).slice(-2)}`}const mn=r=>{if(typeof r=="string"){const e=new Date(r);return isNaN(e.valueOf())?"":ee(e,"dd/MM/yyyy")}return ee(r,"dd/MM/yyyy")},wn=(r=new Date,e)=>(e<0&&(e=0),fn(r,e));function yn(r){const t=["yyyy-MM-dd","yyyy/MM/dd","dd/MM/yyyy","dd-MM-yyyy"].map(n=>dn(r,n,new Date)).find(n=>re(n));if(t){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{start:n.toISOString(),end:a.toISOString()}}return{start:null,end:null}}exports.formatDate=hn;exports.formatDateToddMMYYYY=mn;exports.getStartAndEndOfDayUTC=yn;exports.subtractDaysFromDate=wn;
package/dist/DateUtils.js CHANGED
@@ -582,8 +582,6 @@ const k = {
582
582
  return c(a, e.length);
583
583
  }
584
584
  }, E = {
585
- am: "am",
586
- pm: "pm",
587
585
  midnight: "midnight",
588
586
  noon: "noon",
589
587
  morning: "morning",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-BWBYhYYs.cjs"),n=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window?.MSStream,r=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator?.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=()=>navigator?.userAgent.includes("Windows"),a=(t={sm:i.Y.SMALL,md:i.Y.MEDIUM,lg:i.Y.LARGE,xl:i.Y.EXTRA_LARGE})=>{const e=t;return window?.innerWidth<e.sm?"mobile":window?.innerWidth<e.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=a;exports.isMobile=r;exports.isSafari=o;exports.isWindows=s;exports.isiOSDevice=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-vJ6cvKG3.cjs"),n=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window?.MSStream,r=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator?.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=()=>navigator?.userAgent.includes("Windows"),a=(t={sm:i.Y.SMALL,md:i.Y.MEDIUM,lg:i.Y.LARGE,xl:i.Y.EXTRA_LARGE})=>{const e=t;return window?.innerWidth<e.sm?"mobile":window?.innerWidth<e.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=a;exports.isMobile=r;exports.isSafari=o;exports.isWindows=s;exports.isiOSDevice=n;
@@ -1,4 +1,4 @@
1
- import { Y as i } from "./types-Cjj_nH6d.js";
1
+ import { Y as i } from "./types-CNysP827.js";
2
2
  const r = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window?.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
3
3
  navigator?.userAgent
4
4
  ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = () => navigator?.userAgent.includes("Windows"), d = (n = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,n){if(e)for(const t in e)n[t]=e[t]}const l=e=>!e||!Object.keys(e).length;function c(e){if(!e)return null;for(const n in e){const t=e[n];if(t&&(Array.isArray(t)||Object.keys(t).length>0))return JSON.parse(JSON.stringify(e))}return{...e}}const s=e=>Object.entries(e).reduce((n,[t,r])=>(n[r]=t,n),{}),u=e=>Object.keys(e).reduce((n,t)=>(n[t]=t,n),{}),O=e=>e??null;exports.deepCopy=c;exports.getOrNull=O;exports.invertFlatObject=s;exports.invertKeyToValue=u;exports.isEmptyObject=l;exports.shallowCopyObjectTo=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,t){if(e)for(const n in e)t[n]=e[n]}const l=e=>!e||!Object.keys(e).length;function c(e){if(!e)return null;for(const t in e){const n=e[t];if(n&&(Array.isArray(n)||Object.keys(n).length>0))return JSON.parse(JSON.stringify(e))}return{...e}}const s=e=>Object.entries(e).reduce((t,[n,r])=>(t[r]=n,t),{}),u=e=>Object.keys(e).reduce((t,n)=>(t[n]=n,t),{}),O=e=>e??null,o=(e,t)=>e??t;exports.deepCopy=c;exports.getOrDefault=o;exports.getOrNull=O;exports.invertFlatObject=s;exports.invertKeyToValue=u;exports.isEmptyObject=l;exports.shallowCopyObjectTo=i;
@@ -1,27 +1,28 @@
1
- function i(e, n) {
2
- if (e)
3
- for (const t in e)
4
- n[t] = e[t];
1
+ function i(t, e) {
2
+ if (t)
3
+ for (const n in t)
4
+ e[n] = t[n];
5
5
  }
6
- const s = (e) => !e || !Object.keys(e).length;
7
- function c(e) {
8
- if (!e) return null;
9
- for (const n in e) {
10
- const t = e[n];
11
- if (t && (Array.isArray(t) || Object.keys(t).length > 0))
12
- return JSON.parse(JSON.stringify(e));
6
+ const s = (t) => !t || !Object.keys(t).length;
7
+ function c(t) {
8
+ if (!t) return null;
9
+ for (const e in t) {
10
+ const n = t[e];
11
+ if (n && (Array.isArray(n) || Object.keys(n).length > 0))
12
+ return JSON.parse(JSON.stringify(t));
13
13
  }
14
- return { ...e };
14
+ return { ...t };
15
15
  }
16
- const u = (e) => Object.entries(e).reduce(
17
- (n, [t, r]) => (n[r] = t, n),
16
+ const u = (t) => Object.entries(t).reduce(
17
+ (e, [n, r]) => (e[r] = n, e),
18
18
  {}
19
- ), l = (e) => Object.keys(e).reduce(
20
- (n, t) => (n[t] = t, n),
19
+ ), l = (t) => Object.keys(t).reduce(
20
+ (e, n) => (e[n] = n, e),
21
21
  {}
22
- ), O = (e) => e ?? null;
22
+ ), O = (t) => t ?? null, f = (t, e) => t ?? e;
23
23
  export {
24
24
  c as deepCopy,
25
+ f as getOrDefault,
25
26
  O as getOrNull,
26
27
  u as invertFlatObject,
27
28
  l as invertKeyToValue,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./types-BWBYhYYs.cjs");function l(i,p,t,o,r,e,f){let n="/";return t&&(n+=t+"-"),n+=`${p}/`,e&&(n+=`${e}/`),i&&(n+=`${i.replace(/^-+|-+$/g,"")}/`),o&&(n+=`${o.replace(/^_+|_+$/g,"")}/`),!o&&f&&(n+=`${f.replace(/^_+|_+$/g,"")}/`),r&&(n+=`${r.replace(/^_+|_+$/g,"")}/`),n}function a(i,p=!1){const t=p?{...$.ie}:{...$.Ce},o=Object.entries(i).filter(([r,e])=>t[r]&&e!=null).flatMap(([r,e])=>Array.isArray(e)?e.map(f=>`${encodeURIComponent(t[r])}=${encodeURIComponent(f)}`):e!=null?`${encodeURIComponent(t[r])}=${e instanceof Date?encodeURIComponent(e.toISOString()):encodeURIComponent(e)}`:[]).join("&");return o?`?${o}`:""}exports.buildParams=a;exports.buildURL=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./types-vJ6cvKG3.cjs");function s(i,p,t,o,r,e,f){let n="/";return t&&(n+=t+"-"),n+=`${p}/`,e&&(n+=`${e}/`),i&&(n+=`${i.replace(/^-+|-+$/g,"")}/`),o&&(n+=`${o.replace(/^_+|_+$/g,"")}/`),!o&&f&&(n+=`${f.replace(/^_+|_+$/g,"")}/`),r&&(n+=`${r.replace(/^_+|_+$/g,"")}/`),n}function c(i,p=!1){const t=p?{...$.ie}:{...$.Ce},o=Object.entries(i).filter(([r,e])=>t[r]&&e!==void 0&&e!==null&&e!==!1&&e!=="").flatMap(([r,e])=>Array.isArray(e)?e.map(f=>`${encodeURIComponent(t[r])}=${encodeURIComponent(f)}`):e!=null?`${encodeURIComponent(t[r])}=${e instanceof Date?encodeURIComponent(e.toISOString()):encodeURIComponent(e)}`:[]).join("&");return o?`?${o}`:""}exports.buildParams=c;exports.buildURL=s;
@@ -1,15 +1,17 @@
1
- import { i as $, C as a } from "./types-Cjj_nH6d.js";
2
- function s(i, p, o, t, r, e, f) {
1
+ import { i as $, C as m } from "./types-CNysP827.js";
2
+ function a(i, p, o, t, r, e, f) {
3
3
  let n = "/";
4
4
  return o && (n += o + "-"), n += `${p}/`, e && (n += `${e}/`), i && (n += `${i.replace(/^-+|-+$/g, "")}/`), t && (n += `${t.replace(/^_+|_+$/g, "")}/`), !t && f && (n += `${f.replace(/^_+|_+$/g, "")}/`), r && (n += `${r.replace(/^_+|_+$/g, "")}/`), n;
5
5
  }
6
6
  function c(i, p = !1) {
7
- const o = p ? { ...$ } : { ...a }, t = Object.entries(i).filter(([r, e]) => o[r] && e != null).flatMap(([r, e]) => Array.isArray(e) ? e.map(
7
+ const o = p ? { ...$ } : { ...m }, t = Object.entries(i).filter(
8
+ ([r, e]) => o[r] && e !== void 0 && e !== null && e !== !1 && e !== ""
9
+ ).flatMap(([r, e]) => Array.isArray(e) ? e.map(
8
10
  (f) => `${encodeURIComponent(o[r])}=${encodeURIComponent(f)}`
9
11
  ) : e != null ? `${encodeURIComponent(o[r])}=${e instanceof Date ? encodeURIComponent(e.toISOString()) : encodeURIComponent(e)}` : []).join("&");
10
12
  return t ? `?${t}` : "";
11
13
  }
12
14
  export {
13
15
  c as buildParams,
14
- s as buildURL
16
+ a as buildURL
15
17
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),C=require("./ColorUtils.cjs"),a=require("./CookieUtils.cjs"),c=require("./CurrencyUtils.cjs"),n=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),l=require("./DOMUtils.cjs"),E=require("./EmailUtils.cjs"),u=require("./FunctionUtils.cjs"),m=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),o=require("./ObjectUtils.cjs"),S=require("./ObserverUtils.cjs"),d=require("./PermissionUtils.cjs"),g=require("./RESB_UrlBuilder.cjs"),r=require("./StringUtils.cjs"),y=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),b=require("./GeolocationUtils.cjs"),p=require("./AdressUtils.cjs"),P=require("./GAutocompleteUtils.cjs"),U=require("./DownloadUtils.cjs"),i=require("./MapUtils.cjs");exports.isArrNullOrEmpty=O.isArrNullOrEmpty;exports.rgba=C.rgba;exports.decodeCookie=a.decodeCookie;exports.encodeCookie=a.encodeCookie;exports.getCookie=a.getCookie;exports.removeCookie=a.removeCookie;exports.formatCurrency=c.formatCurrency;exports.formatCurrencyShort=c.formatCurrencyShort;exports.formatDate=n.formatDate;exports.formatDateToddMMYYYY=n.formatDateToddMMYYYY;exports.getStartAndEndOfDayUTC=n.getStartAndEndOfDayUTC;exports.subtractDaysFromDate=n.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isWindows=s.isWindows;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=l.emptyElem;exports.getSingleElement=l.getSingleElement;exports.hideElem=l.hideElem;exports.showElem=l.showElem;exports.hash256=E.hash256;exports.hashEmail=E.hashEmail;exports.debounce=u.debounce;exports.isPromise=u.isPromise;exports.awaitableSetTimeout=m.awaitableSetTimeout;exports.createCustomEvent=m.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=o.deepCopy;exports.getOrNull=o.getOrNull;exports.invertFlatObject=o.invertFlatObject;exports.invertKeyToValue=o.invertKeyToValue;exports.isEmptyObject=o.isEmptyObject;exports.shallowCopyObjectTo=o.shallowCopyObjectTo;exports.observeOnce=S.observeOnce;exports.addPermissionStateListener=d.addPermissionStateListener;exports.onNotificationsPermissionChange=d.onNotificationsPermissionChange;exports.buildParams=g.buildParams;exports.buildURL=g.buildURL;exports.capitalizeFirstLetter=r.capitalizeFirstLetter;exports.cleanASCII=r.cleanASCII;exports.decodeTextWithEntities=r.decodeTextWithEntities;exports.replaceAll=r.replaceAll;exports.replaceAllTokens=r.replaceAllTokens;exports.stringToHyphened=r.stringToHyphened;exports.strip=r.strip;exports.appendQueryString=y.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=b.browserSupportGeolocation;exports.getUserPosition=b.getUserPosition;exports.formatAddress=p.formatAddress;exports.formattedAddress=p.formattedAddress;exports.googlePlaceConverter=P.googlePlaceConverter;exports.downloadFile=U.downloadFile;exports.calcPolygonCenter=i.calcPolygonCenter;exports.encodePolygon=i.encodePolygon;exports.getMinMaxLatLng=i.getMinMaxLatLng;exports.getPolygonString=i.getPolygonString;exports.parsePoints=i.parsePoints;exports.removeDuplicatePoints=i.removeDuplicatePoints;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./ArrayUtils.cjs"),C=require("./ColorUtils.cjs"),a=require("./CookieUtils.cjs"),c=require("./CurrencyUtils.cjs"),n=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),l=require("./DOMUtils.cjs"),u=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),m=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),S=require("./ObserverUtils.cjs"),d=require("./PermissionUtils.cjs"),g=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),y=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),b=require("./GeolocationUtils.cjs"),O=require("./AdressUtils.cjs"),f=require("./GAutocompleteUtils.cjs"),P=require("./DownloadUtils.cjs"),i=require("./MapUtils.cjs");exports.isArrNullOrEmpty=p.isArrNullOrEmpty;exports.rgba=C.rgba;exports.decodeCookie=a.decodeCookie;exports.encodeCookie=a.encodeCookie;exports.getCookie=a.getCookie;exports.removeCookie=a.removeCookie;exports.formatCurrency=c.formatCurrency;exports.formatCurrencyShort=c.formatCurrencyShort;exports.formatDate=n.formatDate;exports.formatDateToddMMYYYY=n.formatDateToddMMYYYY;exports.getStartAndEndOfDayUTC=n.getStartAndEndOfDayUTC;exports.subtractDaysFromDate=n.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isWindows=s.isWindows;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=l.emptyElem;exports.getSingleElement=l.getSingleElement;exports.hideElem=l.hideElem;exports.showElem=l.showElem;exports.hash256=u.hash256;exports.hashEmail=u.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=m.awaitableSetTimeout;exports.createCustomEvent=m.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=r.deepCopy;exports.getOrDefault=r.getOrDefault;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=S.observeOnce;exports.addPermissionStateListener=d.addPermissionStateListener;exports.onNotificationsPermissionChange=d.onNotificationsPermissionChange;exports.buildParams=g.buildParams;exports.buildURL=g.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.strip=o.strip;exports.appendQueryString=y.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=b.browserSupportGeolocation;exports.getUserPosition=b.getUserPosition;exports.formatAddress=O.formatAddress;exports.formattedAddress=O.formattedAddress;exports.googlePlaceConverter=f.googlePlaceConverter;exports.downloadFile=P.downloadFile;exports.calcPolygonCenter=i.calcPolygonCenter;exports.encodePolygon=i.encodePolygon;exports.getMinMaxLatLng=i.getMinMaxLatLng;exports.getPolygonString=i.getPolygonString;exports.parsePoints=i.parsePoints;exports.removeDuplicatePoints=i.removeDuplicatePoints;
package/dist/index.js CHANGED
@@ -1,58 +1,58 @@
1
1
  import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
2
2
  import { rgba as a } from "./ColorUtils.js";
3
- import { decodeCookie as i, encodeCookie as n, getCookie as p, removeCookie as l } from "./CookieUtils.js";
4
- import { formatCurrency as E, formatCurrencyShort as f } from "./CurrencyUtils.js";
3
+ import { decodeCookie as i, encodeCookie as l, getCookie as n, removeCookie as p } from "./CookieUtils.js";
4
+ import { formatCurrency as f, formatCurrencyShort as E } from "./CurrencyUtils.js";
5
5
  import { formatDate as d, formatDateToddMMYYYY as x, getStartAndEndOfDayUTC as u, subtractDaysFromDate as g } from "./DateUtils.js";
6
6
  import { getCurrentDeviceSize as O, isMobile as C, isSafari as S, isWindows as y, isiOSDevice as P } from "./DeviceDetectionUtils.js";
7
- import { emptyElem as L, getSingleElement as R, hideElem as T, showElem as _ } from "./DOMUtils.js";
7
+ import { emptyElem as L, getSingleElement as R, hideElem as T, showElem as D } from "./DOMUtils.js";
8
8
  import { hash256 as G, hashEmail as N } from "./EmailUtils.js";
9
9
  import { debounce as h, isPromise as M } from "./FunctionUtils.js";
10
10
  import { awaitableSetTimeout as I, createCustomEvent as w } from "./GenericUtils.js";
11
11
  import { formatFloat as F, formatInteger as j, formatLocaleNumber as U, formatLocaleNumberAuto as Y, formatNumber as H, formatterNumberObj as W, parseLocaleNumber as z, parseLocaleNumberAuto as Q } from "./NumberUtils.js";
12
- import { deepCopy as K, getOrNull as V, invertFlatObject as q, invertKeyToValue as J, isEmptyObject as Z, shallowCopyObjectTo as $ } from "./ObjectUtils.js";
13
- import { observeOnce as oe } from "./ObserverUtils.js";
14
- import { addPermissionStateListener as te, onNotificationsPermissionChange as ae } from "./PermissionUtils.js";
15
- import { buildParams as ie, buildURL as ne } from "./RESB_UrlBuilder.js";
16
- import { capitalizeFirstLetter as le, cleanASCII as se, decodeTextWithEntities as Ee, replaceAll as fe, replaceAllTokens as ce, stringToHyphened as de, strip as xe } from "./StringUtils.js";
17
- import { appendQueryString as ge } from "./URLBuilderUtils.js";
18
- import { COMPETITOR_REGEX as Oe, DATE_REGEX as Ce, EMAIL_REGEX as Se, EMAIL_REGEX_INTO_TEXT as ye, EXCLUDED_REGEX as Pe, GLOBAL_PHONE_REGEX as Ae, PASSWORD_REGEX as Le, PHONE_REGEX as Re, ROOMS_REGEX as Te, SQM_REGEX as _e } from "./RegexUtils.js";
19
- import { browserSupportGeolocation as Ge, getUserPosition as Ne } from "./GeolocationUtils.js";
20
- import { formatAddress as he, formattedAddress as Me } from "./AdressUtils.js";
21
- import { googlePlaceConverter as Ie } from "./GAutocompleteUtils.js";
22
- import { downloadFile as ke } from "./DownloadUtils.js";
23
- import { calcPolygonCenter as je, encodePolygon as Ue, getMinMaxLatLng as Ye, getPolygonString as He, parsePoints as We, removeDuplicatePoints as ze } from "./MapUtils.js";
12
+ import { deepCopy as K, getOrDefault as V, getOrNull as q, invertFlatObject as J, invertKeyToValue as Z, isEmptyObject as $, shallowCopyObjectTo as ee } from "./ObjectUtils.js";
13
+ import { observeOnce as re } from "./ObserverUtils.js";
14
+ import { addPermissionStateListener as ae, onNotificationsPermissionChange as me } from "./PermissionUtils.js";
15
+ import { buildParams as le, buildURL as ne } from "./RESB_UrlBuilder.js";
16
+ import { capitalizeFirstLetter as se, cleanASCII as fe, decodeTextWithEntities as Ee, replaceAll as ce, replaceAllTokens as de, stringToHyphened as xe, strip as ue } from "./StringUtils.js";
17
+ import { appendQueryString as be } from "./URLBuilderUtils.js";
18
+ import { COMPETITOR_REGEX as Ce, DATE_REGEX as Se, EMAIL_REGEX as ye, EMAIL_REGEX_INTO_TEXT as Pe, EXCLUDED_REGEX as Ae, GLOBAL_PHONE_REGEX as Le, PASSWORD_REGEX as Re, PHONE_REGEX as Te, ROOMS_REGEX as De, SQM_REGEX as _e } from "./RegexUtils.js";
19
+ import { browserSupportGeolocation as Ne, getUserPosition as Xe } from "./GeolocationUtils.js";
20
+ import { formatAddress as Me, formattedAddress as ve } from "./AdressUtils.js";
21
+ import { googlePlaceConverter as we } from "./GAutocompleteUtils.js";
22
+ import { downloadFile as Fe } from "./DownloadUtils.js";
23
+ import { calcPolygonCenter as Ue, encodePolygon as Ye, getMinMaxLatLng as He, getPolygonString as We, parsePoints as ze, removeDuplicatePoints as Qe } from "./MapUtils.js";
24
24
  export {
25
- Oe as COMPETITOR_REGEX,
26
- Ce as DATE_REGEX,
27
- Se as EMAIL_REGEX,
28
- ye as EMAIL_REGEX_INTO_TEXT,
29
- Pe as EXCLUDED_REGEX,
30
- Ae as GLOBAL_PHONE_REGEX,
31
- Le as PASSWORD_REGEX,
32
- Re as PHONE_REGEX,
33
- Te as ROOMS_REGEX,
25
+ Ce as COMPETITOR_REGEX,
26
+ Se as DATE_REGEX,
27
+ ye as EMAIL_REGEX,
28
+ Pe as EMAIL_REGEX_INTO_TEXT,
29
+ Ae as EXCLUDED_REGEX,
30
+ Le as GLOBAL_PHONE_REGEX,
31
+ Re as PASSWORD_REGEX,
32
+ Te as PHONE_REGEX,
33
+ De as ROOMS_REGEX,
34
34
  _e as SQM_REGEX,
35
- te as addPermissionStateListener,
36
- ge as appendQueryString,
35
+ ae as addPermissionStateListener,
36
+ be as appendQueryString,
37
37
  I as awaitableSetTimeout,
38
- Ge as browserSupportGeolocation,
39
- ie as buildParams,
38
+ Ne as browserSupportGeolocation,
39
+ le as buildParams,
40
40
  ne as buildURL,
41
- je as calcPolygonCenter,
42
- le as capitalizeFirstLetter,
43
- se as cleanASCII,
41
+ Ue as calcPolygonCenter,
42
+ se as capitalizeFirstLetter,
43
+ fe as cleanASCII,
44
44
  w as createCustomEvent,
45
45
  h as debounce,
46
46
  i as decodeCookie,
47
47
  Ee as decodeTextWithEntities,
48
48
  K as deepCopy,
49
- ke as downloadFile,
49
+ Fe as downloadFile,
50
50
  L as emptyElem,
51
- n as encodeCookie,
52
- Ue as encodePolygon,
53
- he as formatAddress,
54
- E as formatCurrency,
55
- f as formatCurrencyShort,
51
+ l as encodeCookie,
52
+ Ye as encodePolygon,
53
+ Me as formatAddress,
54
+ f as formatCurrency,
55
+ E as formatCurrencyShort,
56
56
  d as formatDate,
57
57
  x as formatDateToddMMYYYY,
58
58
  F as formatFloat,
@@ -60,42 +60,43 @@ export {
60
60
  U as formatLocaleNumber,
61
61
  Y as formatLocaleNumberAuto,
62
62
  H as formatNumber,
63
- Me as formattedAddress,
63
+ ve as formattedAddress,
64
64
  W as formatterNumberObj,
65
- p as getCookie,
65
+ n as getCookie,
66
66
  O as getCurrentDeviceSize,
67
- Ye as getMinMaxLatLng,
68
- V as getOrNull,
69
- He as getPolygonString,
67
+ He as getMinMaxLatLng,
68
+ V as getOrDefault,
69
+ q as getOrNull,
70
+ We as getPolygonString,
70
71
  R as getSingleElement,
71
72
  u as getStartAndEndOfDayUTC,
72
- Ne as getUserPosition,
73
- Ie as googlePlaceConverter,
73
+ Xe as getUserPosition,
74
+ we as googlePlaceConverter,
74
75
  G as hash256,
75
76
  N as hashEmail,
76
77
  T as hideElem,
77
- q as invertFlatObject,
78
- J as invertKeyToValue,
78
+ J as invertFlatObject,
79
+ Z as invertKeyToValue,
79
80
  r as isArrNullOrEmpty,
80
- Z as isEmptyObject,
81
+ $ as isEmptyObject,
81
82
  C as isMobile,
82
83
  M as isPromise,
83
84
  S as isSafari,
84
85
  y as isWindows,
85
86
  P as isiOSDevice,
86
- oe as observeOnce,
87
- ae as onNotificationsPermissionChange,
87
+ re as observeOnce,
88
+ me as onNotificationsPermissionChange,
88
89
  z as parseLocaleNumber,
89
90
  Q as parseLocaleNumberAuto,
90
- We as parsePoints,
91
- l as removeCookie,
92
- ze as removeDuplicatePoints,
93
- fe as replaceAll,
94
- ce as replaceAllTokens,
91
+ ze as parsePoints,
92
+ p as removeCookie,
93
+ Qe as removeDuplicatePoints,
94
+ ce as replaceAll,
95
+ de as replaceAllTokens,
95
96
  a as rgba,
96
- $ as shallowCopyObjectTo,
97
- _ as showElem,
98
- de as stringToHyphened,
99
- xe as strip,
97
+ ee as shallowCopyObjectTo,
98
+ D as showElem,
99
+ xe as stringToHyphened,
100
+ ue as strip,
100
101
  g as subtractDaysFromDate
101
102
  };