hotel-datepicker-responsive
Version:
Un selector de fechas moderno y flexible para reservas de hotel y vuelos con soporte para calendario de precios y diseño responsive
8 lines • 155 kB
JavaScript
/*!
* Hotel DatePicker v2.0.13
* Un selector de fechas moderno y flexible para reservas de hotel
*
* (c) 2025 José Ramón Gracia Calderon gracia123ramon@hotmail.com
* Released under the MIT License
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).HotelDatePicker=t()}(this,(function(){"use strict";class e extends Error{}class t extends e{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class r extends e{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class n extends e{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class s extends e{}class a extends e{constructor(e){super(`Invalid unit ${e}`)}}class i extends e{}class o extends e{constructor(){super("Zone is an abstract class")}}const l="numeric",c="short",d="long",u={year:l,month:l,day:l},h={year:l,month:c,day:l},p={year:l,month:c,day:l,weekday:c},m={year:l,month:d,day:l},f={year:l,month:d,day:l,weekday:d},y={hour:l,minute:l},g={hour:l,minute:l,second:l},b={hour:l,minute:l,second:l,timeZoneName:c},v={hour:l,minute:l,second:l,timeZoneName:d},S={hour:l,minute:l,hourCycle:"h23"},w={hour:l,minute:l,second:l,hourCycle:"h23"},x={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:c},k={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:d},C={year:l,month:l,day:l,hour:l,minute:l},D={year:l,month:l,day:l,hour:l,minute:l,second:l},M={year:l,month:c,day:l,hour:l,minute:l},E={year:l,month:c,day:l,hour:l,minute:l,second:l},T={year:l,month:c,day:l,weekday:c,hour:l,minute:l},N={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:c},O={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:c},L={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},I={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d};class W{get type(){throw new o}get name(){throw new o}get ianaName(){return this.name}get isUniversal(){throw new o}offsetName(e,t){throw new o}formatOffset(e,t){throw new o}offset(e){throw new o}equals(e){throw new o}get isValid(){throw new o}}let V=null;class $ extends W{static get instance(){return null===V&&(V=new $),V}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return tt(e,t,r)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const z=new Map;const F={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const q=new Map;class P extends W{static create(e){let t=q.get(e);return void 0===t&&q.set(e,t=new P(e)),t}static resetCache(){q.clear(),z.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=P.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return tt(e,t,r,this.name)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=z.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),z.set(e,t)),t}(this.name);let[n,s,a,i,o,l,c]=r.formatToParts?function(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const{type:t,value:s}=r[e],a=F[t];"era"===t?n[a]=s:Ve(a)||(n[a]=parseInt(s,10))}return n}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,s,a,i,o,l,c,d]=n;return[i,s,a,o,l,c,d]}(r,t);"BC"===i&&(n=1-Math.abs(n));let d=+t;const u=d%1e3;return d-=u>=0?u:1e3+u,(Xe({year:n,month:s,day:a,hour:24===o?0:o,minute:l,second:c,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let A={};const j=new Map;function Z(e,t={}){const r=JSON.stringify([e,t]);let n=j.get(r);return void 0===n&&(n=new Intl.DateTimeFormat(e,t),j.set(r,n)),n}const R=new Map;const H=new Map;let _=null;const U=new Map;function Y(e){let t=U.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),U.set(e,t)),t}const J=new Map;function B(e,t,r,n){const s=e.listingMode();return"error"===s?null:"en"===s?r(t):n(t)}class G{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...a}=r;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let n=R.get(r);return void 0===n&&(n=new Intl.NumberFormat(e,t),R.set(r,n)),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Re(this.floor?Math.floor(e):Ye(e,3),this.padTo)}}class X{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&P.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=Z(t,s)}format(){return this.originalZone?this.formatToParts().map((({value:e})=>e)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map((e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e})):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Q{constructor(e,t,r){this.opts={style:"long",...r},!t&&Fe()&&(this.rtf=function(e,t={}){const{base:r,...n}=t,s=JSON.stringify([e,n]);let a=H.get(s);return void 0===a&&(a=new Intl.RelativeTimeFormat(e,t),H.set(s,a)),a}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&a){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${s[e][0]}`;case-1:return r?"yesterday":`last ${s[e][0]}`;case 0:return r?"today":`this ${s[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=s[e],d=n?l?c[1]:c[2]||c[1]:l?s[e][0]:e;return i?`${o} ${d} ago`:`in ${o} ${d}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const K={firstDay:1,minimalDays:4,weekend:[6,7]};class ee{static fromOpts(e){return ee.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){const a=e||be.defaultLocale,i=a||(s?"en-US":_||(_=(new Intl.DateTimeFormat).resolvedOptions().locale,_)),o=t||be.defaultNumberingSystem,l=r||be.defaultOutputCalendar,c=je(n)||be.defaultWeekSettings;return new ee(i,o,l,c,a)}static resetCache(){_=null,j.clear(),R.clear(),H.clear(),U.clear(),J.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return ee.create(e,t,r,n)}constructor(e,t,r,n,s){const[a,i,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=Z(e).resolvedOptions(),n=e}catch(s){const a=e.substring(0,r);t=Z(a).resolvedOptions(),n=a}const{numberingSystem:s,calendar:a}=t;return[n,s,a]}}(e);this.locale=a,this.numberingSystem=t||i||null,this.outputCalendar=r||o||null,this.weekSettings=n,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===Y(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?ee.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,je(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return B(this,e,dt,(()=>{const r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function(e){const t=[];for(let r=1;r<=12;r++){const n=mn.utc(2009,r,1);t.push(e(n))}return t}((e=>this.extract(e,r,"month")))),this.monthsCache[n][e]}))}weekdays(e,t=!1){return B(this,e,mt,(()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let r=1;r<=7;r++){const n=mn.utc(2016,11,13+r);t.push(e(n))}return t}((e=>this.extract(e,r,"weekday")))),this.weekdaysCache[n][e]}))}meridiems(){return B(this,void 0,(()=>ft),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[mn.utc(2016,11,13,9),mn.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e){return B(this,e,vt,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[mn.utc(-40,1,1),mn.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===r));return n?n.value:null}numberFormatter(e={}){return new G(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new X(e,this.intl,t)}relFormatter(e={}){return new Q(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let n=A[r];return n||(n=new Intl.ListFormat(e,t),A[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Y(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:qe()?function(e){let t=J.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...K,...t}),J.set(e,t)}return t}(this.locale):K}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let te=null;class re extends W{static get utcInstance(){return null===te&&(te=new re(0)),te}static instance(e){return 0===e?re.utcInstance:new re(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new re(rt(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${at(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${at(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return at(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class ne extends W{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function se(e,t){if(Ve(e)||null===e)return t;if(e instanceof W)return e;if("string"==typeof e){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?$.instance:"utc"===r||"gmt"===r?re.utcInstance:re.parseSpecifier(r)||P.create(e)}return $e(e)?re.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new ne(e)}const ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ie={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},oe=ae.hanidec.replace(/[\[|\]]/g,"").split("");const le=new Map;function ce({numberingSystem:e},t=""){const r=e||"latn";let n=le.get(r);void 0===n&&(n=new Map,le.set(r,n));let s=n.get(t);return void 0===s&&(s=new RegExp(`${ae[r]}${t}`),n.set(t,s)),s}let de,ue=()=>Date.now(),he="system",pe=null,me=null,fe=null,ye=60,ge=null;class be{static get now(){return ue}static set now(e){ue=e}static set defaultZone(e){he=e}static get defaultZone(){return se(he,$.instance)}static get defaultLocale(){return pe}static set defaultLocale(e){pe=e}static get defaultNumberingSystem(){return me}static set defaultNumberingSystem(e){me=e}static get defaultOutputCalendar(){return fe}static set defaultOutputCalendar(e){fe=e}static get defaultWeekSettings(){return ge}static set defaultWeekSettings(e){ge=je(e)}static get twoDigitCutoffYear(){return ye}static set twoDigitCutoffYear(e){ye=e%100}static get throwOnInvalid(){return de}static set throwOnInvalid(e){de=e}static resetCaches(){ee.resetCache(),P.resetCache(),mn.resetCache(),le.clear()}}class ve{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Se=[0,31,59,90,120,151,181,212,243,273,304,334],we=[0,31,60,91,121,152,182,213,244,274,305,335];function xe(e,t){return new ve("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ke(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return 0===s?7:s}function Ce(e,t,r){return r+(Je(e)?we:Se)[t-1]}function De(e,t){const r=Je(e)?we:Se,n=r.findIndex((e=>e<t));return{month:n+1,day:t-r[n]}}function Me(e,t){return(e-t+7)%7+1}function Ee(e,t=4,r=1){const{year:n,month:s,day:a}=e,i=Ce(n,s,a),o=Me(ke(n,s,a),r);let l,c=Math.floor((i-o+14-t)/7);return c<1?(l=n-1,c=Ke(l,t,r)):c>Ke(n,t,r)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:o,...it(e)}}function Te(e,t=4,r=1){const{weekYear:n,weekNumber:s,weekday:a}=e,i=Me(ke(n,1,t),r),o=Be(n);let l,c=7*s+a-i-7+t;c<1?(l=n-1,c+=Be(l)):c>o?(l=n+1,c-=Be(n)):l=n;const{month:d,day:u}=De(l,c);return{year:l,month:d,day:u,...it(e)}}function Ne(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:Ce(t,r,n),...it(e)}}function Oe(e){const{year:t,ordinal:r}=e,{month:n,day:s}=De(t,r);return{year:t,month:n,day:s,...it(e)}}function Le(e,t){if(!Ve(e.localWeekday)||!Ve(e.localWeekNumber)||!Ve(e.localWeekYear)){if(!Ve(e.weekday)||!Ve(e.weekNumber)||!Ve(e.weekYear))throw new s("Cannot mix locale-based week fields with ISO-based week fields");return Ve(e.localWeekday)||(e.weekday=e.localWeekday),Ve(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ve(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Ie(e){const t=ze(e.year),r=Ze(e.month,1,12),n=Ze(e.day,1,Ge(e.year,e.month));return t?r?!n&&xe("day",e.day):xe("month",e.month):xe("year",e.year)}function We(e){const{hour:t,minute:r,second:n,millisecond:s}=e,a=Ze(t,0,23)||24===t&&0===r&&0===n&&0===s,i=Ze(r,0,59),o=Ze(n,0,59),l=Ze(s,0,999);return a?i?o?!l&&xe("millisecond",s):xe("second",n):xe("minute",r):xe("hour",t)}function Ve(e){return void 0===e}function $e(e){return"number"==typeof e}function ze(e){return"number"==typeof e&&e%1==0}function Fe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function qe(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function Pe(e,t,r){if(0!==e.length)return e.reduce(((e,n)=>{const s=[t(n),n];return e&&r(e[0],s[0])===e[0]?e:s}),null)[1]}function Ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function je(e){if(null==e)return null;if("object"!=typeof e)throw new i("Week settings must be an object");if(!Ze(e.firstDay,1,7)||!Ze(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((e=>!Ze(e,1,7))))throw new i("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Ze(e,t,r){return ze(e)&&e>=t&&e<=r}function Re(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function He(e){return Ve(e)||null===e||""===e?void 0:parseInt(e,10)}function _e(e){return Ve(e)||null===e||""===e?void 0:parseFloat(e)}function Ue(e){if(!Ve(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ye(e,t,r=!1){const n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Je(e){return e%4==0&&(e%100!=0||e%400==0)}function Be(e){return Je(e)?366:365}function Ge(e,t){const r=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?Je(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Xe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Qe(e,t,r){return-Me(ke(e,1,t),r)+t-1}function Ke(e,t=4,r=1){const n=Qe(e,t,r),s=Qe(e+1,t,r);return(Be(e)-n+s)/7}function et(e){return e>99?e:e>be.twoDigitCutoffYear?1900+e:2e3+e}function tt(e,t,r,n=null){const s=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(r,i).formatToParts(s).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function rt(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function nt(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new i(`Invalid unit value ${e}`);return t}function st(e,t){const r={};for(const n in e)if(Ae(e,n)){const s=e[n];if(null==s)continue;r[t(n)]=nt(s)}return r}function at(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Re(r,2)}:${Re(n,2)}`;case"narrow":return`${s}${r}${n>0?`:${n}`:""}`;case"techie":return`${s}${Re(r,2)}${Re(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function it(e){return function(e,t){return t.reduce(((t,r)=>(t[r]=e[r],t)),{})}(e,["hour","minute","second","millisecond"])}const ot=["January","February","March","April","May","June","July","August","September","October","November","December"],lt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ct=["J","F","M","A","M","J","J","A","S","O","N","D"];function dt(e){switch(e){case"narrow":return[...ct];case"short":return[...lt];case"long":return[...ot];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ut=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ht=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],pt=["M","T","W","T","F","S","S"];function mt(e){switch(e){case"narrow":return[...pt];case"short":return[...ht];case"long":return[...ut];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ft=["AM","PM"],yt=["Before Christ","Anno Domini"],gt=["BC","AD"],bt=["B","A"];function vt(e){switch(e){case"narrow":return[...bt];case"short":return[...gt];case"long":return[...yt];default:return null}}function St(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const wt={D:u,DD:h,DDD:m,DDDD:f,t:y,tt:g,ttt:b,tttt:v,T:S,TT:w,TTT:x,TTTT:k,f:C,ff:M,fff:N,ffff:L,F:D,FF:E,FFF:O,FFFF:I};class xt{static create(e,t={}){return new xt(e,t)}static parseFormat(e){let t=null,r="",n=!1;const s=[];for(let a=0;a<e.length;a++){const i=e.charAt(a);"'"===i?(r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n||i===t?r+=i:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=i,t=i)}return r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return wt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Re(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(t,r)=>this.loc.extract(e,t,r),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>r?function(e){return ft[e.hour<12?0:1]}(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,n)=>r?function(e,t){return dt(t)[e.month-1]}(e,t):s(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?function(e,t){return mt(t)[e.weekday-1]}(e,t):s(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const r=xt.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},d=t=>r?function(e,t){return vt(t)[e.year<0?0:1]}(e,t):s({era:t},"era");return St(xt.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const r=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=xt.parseFormat(t),s=n.reduce(((e,{literal:t,val:r})=>t?e:e.concat(r)),[]);return St(n,(e=>t=>{const n=r(t);return n?this.num(e.get(n),t.length):t})(e.shiftTo(...s.map(r).filter((e=>e)))))}}const kt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ct(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Dt(...e){return t=>e.reduce((([e,r,n],s)=>{const[a,i,o]=s(t,n);return[{...e,...a},i||r,o]}),[{},null,1]).slice(0,2)}function Mt(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function Et(...e){return(t,r)=>{const n={};let s;for(s=0;s<e.length;s++)n[e[s]]=He(t[r+s]);return[n,null,r+s]}}const Tt=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Nt=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ot=RegExp(`${Nt.source}${`(?:${Tt.source}?(?:\\[(${kt.source})\\])?)?`}`),Lt=RegExp(`(?:T${Ot.source})?`),It=Et("weekYear","weekNumber","weekDay"),Wt=Et("year","ordinal"),Vt=RegExp(`${Nt.source} ?(?:${Tt.source}|(${kt.source}))?`),$t=RegExp(`(?: ${Vt.source})?`);function zt(e,t,r){const n=e[t];return Ve(n)?r:He(n)}function Ft(e,t){return[{hours:zt(e,t,0),minutes:zt(e,t+1,0),seconds:zt(e,t+2,0),milliseconds:Ue(e[t+3])},null,t+4]}function qt(e,t){const r=!e[t]&&!e[t+1],n=rt(e[t+1],e[t+2]);return[{},r?null:re.instance(n),t+3]}function Pt(e,t){return[{},e[t]?P.create(e[t]):null,t+1]}const At=RegExp(`^T?${Nt.source}$`),jt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Zt(e){const[t,r,n,s,a,i,o,l,c]=e,d="-"===t[0],u=l&&"-"===l[0],h=(e,t=!1)=>void 0!==e&&(t||e&&d)?-e:e;return[{years:h(_e(r)),months:h(_e(n)),weeks:h(_e(s)),days:h(_e(a)),hours:h(_e(i)),minutes:h(_e(o)),seconds:h(_e(l),"-0"===l),milliseconds:h(Ue(c),u)}]}const Rt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ht(e,t,r,n,s,a,i){const o={year:2===t.length?et(He(t)):He(t),month:lt.indexOf(r)+1,day:He(n),hour:He(s),minute:He(a)};return i&&(o.second=He(i)),e&&(o.weekday=e.length>3?ut.indexOf(e)+1:ht.indexOf(e)+1),o}const _t=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Ut(e){const[,t,r,n,s,a,i,o,l,c,d,u]=e,h=Ht(t,s,n,r,a,i,o);let p;return p=l?Rt[l]:c?0:rt(d,u),[h,new re(p)]}const Yt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Jt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Bt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Gt(e){const[,t,r,n,s,a,i,o]=e;return[Ht(t,s,n,r,a,i,o),re.utcInstance]}function Xt(e){const[,t,r,n,s,a,i,o]=e;return[Ht(t,o,r,n,s,a,i),re.utcInstance]}const Qt=Ct(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Lt),Kt=Ct(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Lt),er=Ct(/(\d{4})-?(\d{3})/,Lt),tr=Ct(Ot),rr=Dt((function(e,t){return[{year:zt(e,t),month:zt(e,t+1,1),day:zt(e,t+2,1)},null,t+3]}),Ft,qt,Pt),nr=Dt(It,Ft,qt,Pt),sr=Dt(Wt,Ft,qt,Pt),ar=Dt(Ft,qt,Pt);const ir=Dt(Ft);const or=Ct(/(\d{4})-(\d\d)-(\d\d)/,$t),lr=Ct(Vt),cr=Dt(Ft,qt,Pt);const dr="Invalid Duration",ur={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},hr={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...ur},pr=365.2425,mr=30.436875,fr={years:{quarters:4,months:12,weeks:52.1775,days:pr,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:mr,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...ur},yr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],gr=yr.slice(0).reverse();function br(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new wr(n)}function vr(e,t){let r=t.milliseconds??0;for(const n of gr.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function Sr(e,t){const r=vr(e,t)<0?-1:1;yr.reduceRight(((n,s)=>{if(Ve(t[s]))return n;if(n){const a=t[n]*r,i=e[s][n],o=Math.floor(a/i);t[s]+=o*r,t[n]-=o*i*r}return s}),null),yr.reduce(((r,n)=>{if(Ve(t[n]))return r;if(r){const s=t[r]%1;t[r]-=s,t[n]+=s*e[r][n]}return n}),null)}class wr{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?fr:hr;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||ee.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return wr.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new i("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new wr({values:st(e,wr.normalizeUnit),loc:ee.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if($e(e))return wr.fromMillis(e);if(wr.isDuration(e))return e;if("object"==typeof e)return wr.fromObject(e);throw new i(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function(e){return Mt(e,[jt,Zt])}(e);return r?wr.fromObject(r,t):wr.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function(e){return Mt(e,[At,ir])}(e);return r?wr.fromObject(r,t):wr.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new i("need to specify a reason the Duration is invalid");const r=e instanceof ve?e:new ve(e,t);if(be.throwOnInvalid)throw new n(r);return new wr({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new a(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?xt.create(this.loc,r).formatDurationFromString(this,e):dr}toHuman(e={}){if(!this.isValid)return dr;const t=yr.map((t=>{const r=this.values[t];return Ve(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(r)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Ye(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return mn.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?vr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=wr.fromDurationLike(e),r={};for(const e of yr)(Ae(t.values,e)||Ae(this.values,e))&&(r[e]=t.get(e)+this.get(e));return br(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=wr.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=nt(e(this.values[r],r));return br(this,{values:t},!0)}get(e){return this[wr.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return br(this,{values:{...this.values,...st(e,wr.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return br(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Sr(this.matrix,e),br(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return br(this,{values:function(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>wr.normalizeUnit(e)));const t={},r={},n=this.toObject();let s;for(const a of yr)if(e.indexOf(a)>=0){s=a;let e=0;for(const t in r)e+=this.matrix[t][a]*r[t],r[t]=0;$e(n[a])&&(e+=n[a]);const i=Math.trunc(e);t[a]=i,r[a]=(1e3*e-1e3*i)/1e3}else $e(n[a])&&(r[a]=n[a]);for(const e in r)0!==r[e]&&(t[s]+=e===s?r[e]:r[e]/this.matrix[s][e]);return Sr(this.matrix,t),br(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return br(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const n of yr)if(t=this.values[n],r=e.values[n],!(void 0===t||0===t?void 0===r||0===r:t===r))return!1;var t,r;return!0}}const xr="Invalid Interval";class kr{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new i("need to specify a reason the Interval is invalid");const n=e instanceof ve?e:new ve(e,t);if(be.throwOnInvalid)throw new r(n);return new kr({invalid:n})}static fromDateTimes(e,t){const r=fn(e),n=fn(t),s=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?kr.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:kr.invalid("missing or invalid end"):kr.invalid("missing or invalid start")}(r,n);return null==s?new kr({start:r,end:n}):s}static after(e,t){const r=wr.fromDurationLike(t),n=fn(e);return kr.fromDateTimes(n,n.plus(r))}static before(e,t){const r=wr.fromDurationLike(t),n=fn(e);return kr.fromDateTimes(n.minus(r),n)}static fromISO(e,t){const[r,n]=(e||"").split("/",2);if(r&&n){let e,s,a,i;try{e=mn.fromISO(r,t),s=e.isValid}catch(n){s=!1}try{a=mn.fromISO(n,t),i=a.isValid}catch(n){i=!1}if(s&&i)return kr.fromDateTimes(e,a);if(s){const r=wr.fromISO(n,t);if(r.isValid)return kr.after(e,r)}else if(i){const e=wr.fromISO(r,t);if(e.isValid)return kr.before(a,e)}}return kr.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let n;return n=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,n=n.startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?kr.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(fn).filter((e=>this.contains(e))).sort(((e,t)=>e.toMillis()-t.toMillis())),r=[];let{s:n}=this,s=0;for(;n<this.e;){const e=t[s]||this.e,a=+e>+this.e?this.e:e;r.push(kr.fromDateTimes(n,a)),n=a,s+=1}return r}splitBy(e){const t=wr.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,s=1;const a=[];for(;n<this.e;){const e=this.start.plus(t.mapUnits((e=>e*s)));r=+e>+this.e?this.e:e,a.push(kr.fromDateTimes(n,r)),n=r,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:kr.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return kr.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r]),[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],s=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...s).sort(((e,t)=>e.time-t.time));for(const e of a)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!=+e.time&&n.push(kr.fromDateTimes(t,e.time)),t=null);return kr.merge(n)}difference(...e){return kr.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=u,t={}){return this.isValid?xt.create(this.s.loc.clone(t),e).formatInterval(this):xr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:xr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:xr}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:xr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):wr.invalid(this.invalidReason)}mapEndpoints(e){return kr.fromDateTimes(e(this.s),e(this.e))}}class Cr{static hasDST(e=be.defaultZone){const t=mn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return P.isValidZone(e)}static normalizeZone(e){return se(e,be.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||ee.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||ee.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||ee.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||ee.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||ee.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||ee.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||ee.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ee.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return ee.create(t,null,"gregory").eras(e)}static features(){return{relative:Fe(),localeWeek:qe()}}}function Dr(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(wr.fromMillis(n).as("days"))}function Mr(e,t,r,n){let[s,a,i,o]=function(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=Dr(e,t);return(r-r%7)/7}],["days",Dr]],s={},a=e;let i,o;for(const[l,c]of n)r.indexOf(l)>=0&&(i=l,s[l]=c(e,t),o=a.plus(s),o>t?(s[l]--,(e=a.plus(s))>t&&(o=e,s[l]--,e=a.plus(s))):e=o);return[e,s,o,i]}(e,t,r);const l=t-s,c=r.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i<t&&(i=s.plus({[o]:1})),i!==s&&(a[o]=(a[o]||0)+l/(i-s)));const d=wr.fromObject(a,n);return c.length>0?wr.fromMillis(l,n).shiftTo(...c).plus(d):d}function Er(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(-1!==e[r].search(ae.hanidec))t+=oe.indexOf(e[r]);else for(const e in ie){const[r,s]=ie[e];n>=r&&n<=s&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const Tr=`[ ${String.fromCharCode(160)}]`,Nr=new RegExp(Tr,"g");function Or(e){return e.replace(/\./g,"\\.?").replace(Nr,Tr)}function Lr(e){return e.replace(/\./g,"").replace(Nr," ").toLowerCase()}function Ir(e,t){return null===e?null:{regex:RegExp(e.map(Or).join("|")),deser:([r])=>e.findIndex((e=>Lr(r)===Lr(e)))+t}}function Wr(e,t){return{regex:e,deser:([,e,t])=>rt(e,t),groups:t}}function Vr(e){return{regex:e,deser:([e])=>e}}const $r={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let zr=null;function Fr(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const r=Ar(xt.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t))))}class qr{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Fr(xt.parseFormat(t),e),this.units=this.tokens.map((t=>function(e,t){const r=ce(t),n=ce(t,"{2}"),s=ce(t,"{3}"),a=ce(t,"{4}"),i=ce(t,"{6}"),o=ce(t,"{1,2}"),l=ce(t,"{1,3}"),c=ce(t,"{1,6}"),d=ce(t,"{1,9}"),u=ce(t,"{2,4}"),h=ce(t,"{4,6}"),p=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},m=(m=>{if(e.literal)return p(m);switch(m.val){case"G":return Ir(t.eras("short"),0);case"GG":return Ir(t.eras("long"),0);case"y":return Er(c);case"yy":case"kk":return Er(u,et);case"yyyy":case"kkkk":return Er(a);case"yyyyy":return Er(h);case"yyyyyy":return Er(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Er(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Er(n);case"MMM":return Ir(t.months("short",!0),1);case"MMMM":return Ir(t.months("long",!0),1);case"LLL":return Ir(t.months("short",!1),1);case"LLLL":return Ir(t.months("long",!1),1);case"o":case"S":return Er(l);case"ooo":case"SSS":return Er(s);case"u":return Vr(d);case"uu":return Vr(o);case"uuu":case"E":case"c":return Er(r);case"a":return Ir(t.meridiems(),0);case"EEE":return Ir(t.weekdays("short",!1),1);case"EEEE":return Ir(t.weekdays("long",!1),1);case"ccc":return Ir(t.weekdays("short",!0),1);case"cccc":return Ir(t.weekdays("long",!0),1);case"Z":case"ZZ":return Wr(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Wr(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Vr(/[a-z_+-/]{1,256}?/i);case" ":return Vr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=e,m}(t,e))),this.disqualifyingUnit=this.units.find((e=>e.invalidReason)),!this.disqualifyingUnit){const[e,t]=[`^${(r=this.units).map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,r];this.regex=RegExp(e,"i"),this.handlers=t}var r}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const s in r)if(Ae(r,s)){const a=r[s],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(n.slice(t,t+i))),t+=i}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,a,i]=r?function(e){let t,r=null;return Ve(e.z)||(r=P.create(e.z)),Ve(e.Z)||(r||(r=new re(e.Z)),t=e.Z),Ve(e.q)||(e.M=3*(e.q-1)+1),Ve(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Ve(e.u)||(e.S=Ue(e.u)),[Object.keys(e).reduce(((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t}),{}),r,t]}(r):[null,null,void 0];if(Ae(r,"a")&&Ae(r,"H"))throw new s("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:a,specificOffset:i}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Pr(e,t,r){return new qr(e,r).explainFromTokens(t)}function Ar(e,t){if(!e)return null;const r=xt.create(t,e).dtFormatter((zr||(zr=mn.fromMillis(1555555555555)),zr)),n=r.formatToParts(),s=r.resolvedOptions();return n.map((t=>function(e,t,r){const{type:n,value:s}=e;if("literal"===n){const e=/^\s+$/.test(s);return{literal:!e,val:e?" ":s}}const a=t[n];let i=n;"hour"===n&&(i=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":