UNPKG

@oxog/kairos

Version:

Revolutionary zero-dependency JavaScript date/time library with modular architecture and dynamic holiday system

9 lines 91.5 kB
/*!
 * Kairos v1.0.0
 * (c) 2025 Ersin Koc
 * Released under the MIT License
 * https://github.com/ersinkoc/kairos
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kairos={})}(this,function(e){"use strict";class t{constructor(e=1e3){this.cache=new Map,this.maxSize=e}get(e){const t=this.cache.get(e);return void 0!==t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;void 0!==e&&this.cache.delete(e)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}size(){return this.cache.size}}function a(e,a){const n=new t;return(...t)=>{const r=a?a(...t):JSON.stringify(t);if(n.has(r))return n.get(r);const s=e(...t);return n.set(r,s),s}}function n(){return new t(5e3)}function r(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function s(e){return"string"==typeof e&&e.length>0}function i(e){return r(e)&&e>=1&&e<=12}function o(e){return r(e)&&e>=1&&e<=31}function l(e){return r(e)&&e>=0&&e<=6}function d(e){return r(e)&&(e>=1&&e<=5||-1===e)}function u(e){const t=[];if(!e||"object"!=typeof e)return t.push("Rule must be an object"),t;s(e.name)||t.push("Rule name must be a non-empty string");const a=["fixed","nth-weekday","relative","lunar","easter-based","custom"];if(a.includes(e.type)||t.push(`Rule type must be one of: ${a.join(", ")}`),!e.rule||"object"!=typeof e.rule)return t.push("Rule must have a rule property"),t;switch(e.type){case"fixed":i(e.rule.month)||t.push("Fixed rule month must be 1-12"),o(e.rule.day)||t.push("Fixed rule day must be 1-31");break;case"nth-weekday":i(e.rule.month)||t.push("Nth-weekday rule month must be 1-12"),l(e.rule.weekday)||t.push("Nth-weekday rule weekday must be 0-6"),d(e.rule.nth)||t.push("Nth-weekday rule nth must be 1-5 or -1");break;case"relative":s(e.rule.relativeTo)||t.push("Relative rule relativeTo must be a non-empty string"),r(e.rule.offset)||t.push("Relative rule offset must be a number");break;case"lunar":{const a=["islamic","chinese","hebrew","persian"];a.includes(e.rule.calendar)||t.push(`Lunar rule calendar must be one of: ${a.join(", ")}`),i(e.rule.month)||t.push("Lunar rule month must be 1-12"),o(e.rule.day)||t.push("Lunar rule day must be 1-31");break}case"easter-based":r(e.rule.offset)||t.push("Easter-based rule offset must be a number");break;case"custom":"function"!=typeof e.rule.calculate&&t.push("Custom rule must have a calculate function")}return t}function c(e,t){const a=new Error(e);throw t&&(a.code=t),a}const y=e=>null!==e&&"object"==typeof e&&("year"in e&&"month"in e&&"day"in e||"date"in e),h=new t(1e3);class m{constructor(e){this._date=this.parseInput(e)}parseInput(e){if(void 0===e)return new Date;if(e instanceof Date)return new Date(e.getTime());if("number"==typeof e)return isNaN(e)?new Date(NaN):new Date(e);if("string"==typeof e){if("invalid"===e.toLowerCase()||""===e)return new Date(NaN);if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,a,n]=e.split("-").map(Number);if(a<1||a>12)return new Date(NaN);const r=new Date(t,a-1,n,0,0,0,0);return r.getFullYear()!==t||r.getMonth()!==a-1||r.getDate()!==n?new Date(NaN):r}const t=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;if(t.test(e)){const a=e.match(t);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10),n=parseInt(a[3],10);if(t<1||t>12||e<1||e>31)return new Date(NaN);const r=new Date(n,t-1,e,0,0,0,0);return r.getFullYear()!==n||r.getMonth()!==t-1||r.getDate()!==e?new Date(NaN):r}}const a=new Date(e);return isNaN(a.getTime())?(m.config.strict&&c(`Invalid date string: ${e}`,"INVALID_DATE"),new Date(NaN)):a}if(e&&"object"==typeof e){if(null!==(t=e)&&"object"==typeof t&&"_date"in t&&t._date instanceof Date)return new Date(e._date.getTime());if((e=>null!==e&&"object"==typeof e&&"toDate"in e&&"function"==typeof e.toDate)(e))return e.toDate();if(y(e)&&void 0!==e.year&&void 0!==e.month&&void 0!==e.day){const t=e.year,a=e.month-1,n=e.day,r=e.hour||0,s=e.minute||0,i=e.second||0,o=e.millisecond||0,l=new Date(t,a,n,r,s,i,o);return l.getFullYear()!==t||l.getMonth()!==a||l.getDate()!==n?new Date(NaN):l}if(y(e)&&e.date instanceof Date)return new Date(e.date.getTime())}var t;return new Date(NaN)}valueOf(){return this._date.getTime()}toString(){return this._date.toString()}toISOString(){return this._date.toISOString()}offset(){return this._isUTC?0:-this._date.getTimezoneOffset()}toDate(){return new Date(this._date.getTime())}clone(){return new m(this._date)}year(e){if(void 0===e)return this._date.getFullYear();const t=this.clone();return t._date.setFullYear(e),t}month(e){if(void 0===e)return this._date.getMonth()+1;const t=this.clone();return t._date.setMonth(e-1),t}date(e){if(void 0===e)return this._date.getDate();const t=this.clone();return t._date.setDate(e),t}day(){return this._date.getDay()}hour(e){if(void 0===e)return this._date.getHours();const t=this.clone();return t._date.setHours(e),t}minute(e){if(void 0===e)return this._date.getMinutes();const t=this.clone();return t._date.setMinutes(e),t}second(e){if(void 0===e)return this._date.getSeconds();const t=this.clone();return t._date.setSeconds(e),t}millisecond(e){if(void 0===e)return this._date.getMilliseconds();const t=this.clone();return t._date.setMilliseconds(e),t}add(e,t){if(!this.isValid())return this.clone();const a=this.clone();switch(this.normalizeUnit(t)){case"year":a._date.setFullYear(a._date.getFullYear()+e);break;case"month":{const t=a._date.getDate();let n=a._date.getMonth()+e,r=a._date.getFullYear();for(;n<0;)n+=12,r--;for(;n>=12;)n-=12,r++;const s=new Date(r,n+1,0).getDate();a._date.setDate(1),a._date.setFullYear(r),a._date.setMonth(n),a._date.setDate(Math.min(t,s));break}case"week":a._date.setDate(a._date.getDate()+7*e);break;case"day":if(e%1!=0){const t=Math.floor(e),n=24*(e-t);a._date.setDate(a._date.getDate()+t),a._date.setHours(a._date.getHours()+n)}else a._date.setDate(a._date.getDate()+e);break;case"hour":a._date.setHours(a._date.getHours()+e);break;case"minute":a._date.setMinutes(a._date.getMinutes()+e);break;case"second":a._date.setSeconds(a._date.getSeconds()+e);break;case"millisecond":a._date.setMilliseconds(a._date.getMilliseconds()+e);break;default:c(`Unknown unit: ${t}`,"INVALID_UNIT")}return a}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this.clone();switch(this.normalizeUnit(e)){case"year":t._date.setMonth(0,1),t._date.setHours(0,0,0,0);break;case"month":t._date.setDate(1),t._date.setHours(0,0,0,0);break;case"week":{const e=t._date.getDay();t._date.setDate(t._date.getDate()-e),t._date.setHours(0,0,0,0);break}case"day":t._date.setHours(0,0,0,0);break;case"hour":t._date.setMinutes(0,0,0);break;case"minute":t._date.setSeconds(0,0);break;case"second":t._date.setMilliseconds(0)}return t}endOf(e){const t=this.clone();switch(this.normalizeUnit(e)){case"year":t._date.setMonth(11,31),t._date.setHours(23,59,59,999);break;case"month":t._date.setMonth(t._date.getMonth()+1,0),t._date.setHours(23,59,59,999);break;case"week":{const e=t._date.getDay();t._date.setDate(t._date.getDate()+(6-e)),t._date.setHours(23,59,59,999);break}case"day":t._date.setHours(23,59,59,999);break;case"hour":t._date.setMinutes(59,59,999);break;case"minute":t._date.setSeconds(59,999);break;case"second":t._date.setMilliseconds(999)}return t}isValid(){return!isNaN(this._date.getTime())}isBefore(e){return this.valueOf()<e.valueOf()}isAfter(e){return this.valueOf()>e.valueOf()}isSame(e){return this.valueOf()===e.valueOf()}format(e="YYYY-MM-DD"){if(!this.isValid())return"Invalid Date";const t=this._isUTC,a=t?this._date.getUTCFullYear():this._date.getFullYear(),n=t?this._date.getUTCMonth()+1:this._date.getMonth()+1,r=t?this._date.getUTCDate():this._date.getDate(),s=t?this._date.getUTCHours():this._date.getHours(),i=t?this._date.getUTCMinutes():this._date.getMinutes(),o=t?this._date.getUTCSeconds():this._date.getSeconds();return isNaN(a)||isNaN(n)||isNaN(r)?"Invalid Date":e.replace(/YYYY/g,a.toString()).replace(/MM/g,n.toString().padStart(2,"0")).replace(/DD/g,r.toString().padStart(2,"0")).replace(/HH/g,s.toString().padStart(2,"0")).replace(/mm/g,i.toString().padStart(2,"0")).replace(/ss/g,o.toString().padStart(2,"0"))}normalizeUnit(e){return{y:"year",year:"year",years:"year",M:"month",month:"month",months:"month",w:"week",week:"week",weeks:"week",d:"day",day:"day",days:"day",h:"hour",hour:"hour",hours:"hour",m:"minute",minute:"minute",minutes:"minute",s:"second",second:"second",seconds:"second",ms:"millisecond",millisecond:"millisecond",milliseconds:"millisecond"}[e]||e}}m.config={locale:"en",strict:!1,suppressDeprecationWarnings:!1};class f{static use(e){const t=Array.isArray(e)?e:[e];for(const e of t)this.installPlugin(e);return g}static installPlugin(e){if(this.installedPlugins.has(e.name))return;if(e.dependencies)for(const t of e.dependencies)this.installedPlugins.has(t)||c(`Plugin ${e.name} depends on ${t} which is not installed`,"MISSING_DEPENDENCY");this.plugins.set(e.name,e),this.installedPlugins.add(e.name);const t={cache:h,memoize:a,validateInput:(e,t)=>{switch(t){case"date":return e instanceof Date&&!isNaN(e.getTime());case"number":return"number"==typeof e&&!isNaN(e);case"string":return"string"==typeof e;default:return!1}},throwError:c};e.install(g,t)}static extend(e){Object.assign(this.extensionMethods,e);for(const[t,a]of Object.entries(e))m.prototype[t]=a}static addStatic(e){Object.assign(this.staticMethods,e);for(const[t,a]of Object.entries(e))g[t]=a}static getPlugin(e){return this.plugins.get(e)}static isInstalled(e){return this.installedPlugins.has(e)}static getInstalledPlugins(){return Array.from(this.installedPlugins)}}f.plugins=new Map,f.installedPlugins=new Set,f.extensionMethods={},f.staticMethods={};const g=e=>new m(e);g.use=f.use.bind(f),g.extend=f.extend.bind(f),g.addStatic=f.addStatic.bind(f),g.plugins=f.plugins,g.utc=e=>{let t;if("string"!=typeof e||e.endsWith("Z")||e.includes("+")||/[+-]\d{2}:?\d{2}$/.test(e))t=new Date(e);else{const a=/^(\d{4})-(\d{2})-(\d{2})(?:\s+|T)(\d{2}):(\d{2})(?::(\d{2}))?$/,n=/^(\d{4})-(\d{2})-(\d{2})$/,r=e.match(a)||e.match(n);if(r){const e=parseInt(r[1],10),a=parseInt(r[2],10)-1,n=parseInt(r[3],10),s=r[4]?parseInt(r[4],10):0,i=r[5]?parseInt(r[5],10):0,o=r[6]?parseInt(r[6],10):0;t=new Date(Date.UTC(e,a,n,s,i,o))}else e=e.replace(" ","T")+"Z",t=new Date(e)}const a=new m(t);return a._isUTC=!0,a},g.unix=e=>new m(new Date(1e3*e));class p{constructor(){this.locales=new Map,this.currentLocale="en-US",this.defaultLocale="en-US"}static getInstance(){return p.instance||(p.instance=new p),p.instance}register(e,t){this.locales.set(e,t),1===this.locales.size&&(this.defaultLocale=e,this.currentLocale=e)}setLocale(e){return!!this.locales.has(e)&&(this.currentLocale=e,!0)}getLocale(e){const t=e||this.currentLocale;return this.locales.get(t)}getCurrentLocale(){return this.currentLocale}getDefaultLocale(){return this.defaultLocale}setDefaultLocale(e){return!!this.locales.has(e)&&(this.defaultLocale=e,!0)}getHolidays(e,t){const a=this.getLocale(e);if(!a)return[];if(t)switch(t){case"federal":return a.federalHolidays||[];case"state":return a.stateHolidays?Object.values(a.stateHolidays).flat():[];case"public":return a.publicHolidays||[];case"observances":return a.observances||[];default:if(a[t]&&Array.isArray(a[t]))return a[t]}return a.holidays||[]}getStateHolidays(e,t){const a=this.getLocale(t);if(!a||!a.stateHolidays)return[];const n=e.toLowerCase();return a.stateHolidays[n]||[]}getAllHolidays(e){const t=this.getLocale(e);if(!t)return[];const a=[];if(t.holidays&&a.push(...t.holidays),t.federalHolidays&&a.push(...t.federalHolidays),t.stateHolidays)for(const e of Object.values(t.stateHolidays))a.push(...e);t.publicHolidays&&a.push(...t.publicHolidays),t.observances&&a.push(...t.observances);const n=new Map;for(const e of a)n.has(e.name)||n.set(e.name,e);return Array.from(n.values())}getAvailableLocales(){return Array.from(this.locales.keys())}hasLocale(e){return this.locales.has(e)}clear(){this.locales.clear(),this.currentLocale="en-US",this.defaultLocale="en-US"}}const D=p.getInstance();const w=new class{constructor(){this.calculators=new Map,this.cache=n(),this.ruleCache=new Map,this.registerCalculators()}registerCalculators(){}registerCalculator(e,t){this.calculators.set(e,t)}calculate(e,t){const a=u(e);if(a.length>0)throw new Error(`Invalid holiday rule: ${a.join(", ")}`);this.ruleCache.has(e.name||"unnamed")||this.ruleCache.set(e.name||"unnamed",new Map);const n=this.ruleCache.get(e.name||"unnamed");if(n.has(t))return n.get(t);const r=this.calculators.get(e.type);if(!r)throw new Error(`Unknown holiday type: ${e.type}`);let s=r.calculate(e,t);return e.observedRule&&(s=this.applyObservedRules(s,e.observedRule)),e.duration&&e.duration>1&&(s=this.expandDuration(s,e.duration)),n.set(t,s),s}applyObservedRules(e,t){const a=[];for(const n of e){const e=n.getDay();if(t.weekends?.includes(e)||0===e||6===e)switch(t.type){case"substitute":a.push(this.findSubstituteDate(n,t));break;case"nearest-weekday":a.push(this.findNearestWeekday(n));break;case"bridge":a.push(n),a.push(this.findBridgeDate(n));break;default:a.push(n)}else a.push(n)}return a}findSubstituteDate(e,t){const a=t.direction||"forward",n=t.weekends||[0,6],r=new Date(e),s="forward"===a?1:-1;for(;n.includes(r.getDay());)r.setDate(r.getDate()+s);return r}findNearestWeekday(e){const t=e.getDay();return 0===t?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1):6===t?new Date(e.getFullYear(),e.getMonth(),e.getDate()-1):e}findBridgeDate(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+1)}expandDuration(e,t){const a=[];for(const n of e)for(let e=0;e<t;e++){const t=new Date(n);t.setDate(t.getDate()+e),a.push(t)}return a}isHoliday(e,t){const a=e.getFullYear();for(const n of t){if(!n.active&&void 0!==n.active)continue;const r=this.calculateWithContext(n,a,t);for(const t of r)if(this.isSameDay(e,t))return{id:n.id||n.name,name:n.name,type:n.type,date:t,regions:n.regions||[]}}return null}getHolidaysForYear(e,t){const a=[];for(const n of t){if(!n.active&&void 0!==n.active)continue;const r=this.calculateWithContext(n,e,t);for(const e of r)a.push({id:n.id||n.name,name:n.name,type:n.type,date:e,regions:n.regions||[]})}return a.sort((e,t)=>e.date.getTime()-t.date.getTime())}calculateWithContext(e,t,a){const n=u(e);if(n.length>0)throw new Error(`Invalid holiday rule: ${n.join(", ")}`);this.ruleCache.has(e.name||"unnamed")||this.ruleCache.set(e.name||"unnamed",new Map);const r=this.ruleCache.get(e.name||"unnamed");if(r.has(t))return r.get(t);const s=this.calculators.get(e.type);if(!s)throw new Error(`Unknown holiday type: ${e.type}`);let i;return i="relative"===e.type?s.calculate(e,t,{holidays:a}):s.calculate(e,t),e.observedRule&&(i=this.applyObservedRules(i,e.observedRule)),e.duration&&e.duration>1&&(i=this.expandDuration(i,e.duration)),r.set(t,i),i}getHolidaysInRange(e,t,a){const n=[],r=e.getFullYear(),s=t.getFullYear();for(let i=r;i<=s;i++){const r=this.getHolidaysForYear(i,a);for(const a of r)a.date>=e&&a.date<=t&&n.push(a)}return n}getNextHoliday(e,t){const a=e.getFullYear(),n=this.getHolidaysForYear(a,t);for(const t of n)if(t.date>e)return t;return this.getHolidaysForYear(a+1,t)[0]||null}getPreviousHoliday(e,t){const a=e.getFullYear(),n=this.getHolidaysForYear(a,t);for(let t=n.length-1;t>=0;t--){const a=n[t];if(a.date<e)return a}const r=this.getHolidaysForYear(a-1,t);return r[r.length-1]||null}isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}clearCache(){this.cache.clear(),this.ruleCache.clear()}};var M={name:"holiday-engine",version:"1.0.0",size:2048,install(e,t){e.extend({isHoliday(e){const t=e||D.getHolidays();return null!==w.isHoliday(this.toDate(),t)},getHolidayInfo(e){const t=e||D.getHolidays();return w.isHoliday(this.toDate(),t)},nextHoliday(t){const a=t||D.getHolidays(),n=w.getNextHoliday(this.toDate(),a);return n?e(n.date):null},previousHoliday(t){const a=t||D.getHolidays(),n=w.getPreviousHoliday(this.toDate(),a);return n?e(n.date):null},getHolidays:e=>D.getHolidays(void 0,e)}),e.addStatic?.({getYearHolidays:(e,t)=>w.getHolidaysForYear(e,t),getHolidaysInRange(t,a,n){const r=e(t).toDate(),s=e(a).toDate();return w.getHolidaysInRange(r,s,n)},holidayEngine:w})}};class b{calculate(e,t){const{month:a,day:n}=e.rule,r=new Date(t,a-1,n);return r.getFullYear()!==t||r.getMonth()!==a-1||r.getDate()!==n?[]:[r]}}var x={name:"holiday-fixed-calculator",version:"1.0.0",size:256,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("fixed",new b)}};class Y{calculate(e,t){const{month:a,weekday:n,nth:r}=e.rule;return r>0?[this.getNthWeekdayOfMonth(t,a-1,n,r)]:[this.getLastNthWeekdayOfMonth(t,a-1,n,Math.abs(r))]}getNthWeekdayOfMonth(e,t,a,n){let r=a-new Date(e,t,1).getDay();r<0&&(r+=7);const s=new Date(e,t,1+r+7*(n-1));if(s.getMonth()!==t)throw new Error(`${n}${this.getOrdinalSuffix(n)} ${this.getWeekdayName(a)} of ${this.getMonthName(t)} ${e} does not exist`);return s}getLastNthWeekdayOfMonth(e,t,a,n){const r=new Date(e,t+1,0);let s=r.getDay()-a;s<0&&(s+=7);const i=r.getDate()-s-7*(n-1);if(i<1)throw new Error(`${n}${this.getOrdinalSuffix(n)} to last ${this.getWeekdayName(a)} of ${this.getMonthName(t)} ${e} does not exist`);return new Date(e,t,i)}getOrdinalSuffix(e){if(e>=11&&e<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}getWeekdayName(e){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e]||"Unknown"}getMonthName(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e]||"Unknown"}}var k={name:"holiday-nth-weekday-calculator",version:"1.0.0",size:512,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("nth-weekday",new Y)}};class v{calculate(e,t){const{offset:a}=e.rule,n=this.calculateEaster(t),r=new Date(n);return r.setDate(r.getDate()+a),[r]}calculateEaster(e){if(e<1583)return this.calculateJulianEaster(e);const t=e%19,a=Math.floor(e/100),n=e%100,r=Math.floor(a/4),s=a%4,i=Math.floor((a+8)/25),o=(19*t+a-r-Math.floor((a-i+1)/3)+15)%30,l=(32+2*s+2*Math.floor(n/4)-o-n%4)%7,d=Math.floor((t+11*o+22*l)/451),u=Math.floor((o+l-7*d+114)/31)-1;return new Date(e,u,(o+l-7*d+114)%31+1)}calculateJulianEaster(e){const t=(19*(e%19)+15)%30,a=(2*(e%4)+4*(e%7)-t+34)%7,n=Math.floor((t+a+114)/31)-1,r=new Date(e,n,(t+a+114)%31+1),s=this.dateToJulianDay(r);return this.julianDayToDate(s)}dateToJulianDay(e){const t=e.getFullYear(),a=e.getMonth()+1,n=e.getDate(),r=Math.floor((14-a)/12),s=t+4800-r,i=a+12*r-3;return n+Math.floor((153*i+2)/5)+365*s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400)-32045}julianDayToDate(e){const t=e+32044,a=(4*t+3)/146097,n=t-Math.floor(146097*a/4),r=(4*n+3)/1461,s=n-Math.floor(1461*r/4),i=(5*s+2)/153,o=s-Math.floor((153*i+2)/5)+1,l=i+3-12*Math.floor(i/10),d=100*a+r-4800+Math.floor(i/10);return new Date(d,l-1,o)}calculateOrthodoxEaster(e){const t=(19*(e%19)+15)%30,a=(2*(e%4)+4*(e%7)-t+34)%7,n=Math.floor((t+a+114)/31),r=new Date(e,n-1,(t+a+114)%31+1),s=this.getJulianGregorianDifference(e),i=new Date(r);return i.setDate(i.getDate()+s),i}getJulianGregorianDifference(e){if(e<1583)return 0;const t=Math.floor(e/100);return t-Math.floor(t/4)-2}}var H={name:"holiday-easter-calculator",version:"1.0.0",size:1024,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("easter-based",new v),e.addStatic?.({getEaster(t){const a=(new v).calculateEaster(t);return e(a)},getOrthodoxEaster(t){const a=(new v).calculateOrthodoxEaster(t);return e(a)}})}};class S{constructor(){this.converters={islamic:new L,chinese:new C,hebrew:new F,persian:new T}}calculate(e,t){const{calendar:a,month:n,day:r}=e.rule,s=this.converters[a];if(!s)throw new Error(`Unknown lunar calendar: ${a}`);const i=this.getLunarYear(t,a);return[s.toGregorian(i,n,r)]}getLunarYear(e,t){switch(t){case"islamic":return Math.round(1.030684*(e-622));case"chinese":return e-2637;case"hebrew":return e+3761;case"persian":return e-622;default:return e}}}class L{toGregorian(e,t,a){const n=1948084+(354.36667*(e-1)+this.getIslamicMonthDays(t,e)+a-1);return this.julianDayToGregorian(n)}fromGregorian(e){const t=this.gregorianToJulianDay(e)-1948084,a=354.36667,n=Math.floor(t/a)+1;let r=1,s=t-(n-1)*a;for(;s>this.getIslamicMonthLength(r,n);)s-=this.getIslamicMonthLength(r,n),r++;return{year:n,month:r,day:Math.floor(s)}}getIslamicMonthDays(e,t){let a=0;for(let n=1;n<e;n++)a+=this.getIslamicMonthLength(n,t);return a}getIslamicMonthLength(e,t){return 12===e&&this.isIslamicLeapYear(t)?30:[30,29,30,29,30,29,30,29,30,29,30,29][e-1]||29}isIslamicLeapYear(e){return(11*e+14)%30<11}julianDayToGregorian(e){const t=e+32044,a=(4*t+3)/146097,n=t-Math.floor(146097*a/4),r=(4*n+3)/1461,s=n-Math.floor(1461*r/4),i=(5*s+2)/153,o=s-Math.floor((153*i+2)/5)+1,l=i+3-12*Math.floor(i/10),d=100*a+r-4800+Math.floor(i/10);return new Date(d,l-1,o)}gregorianToJulianDay(e){const t=e.getFullYear(),a=e.getMonth()+1,n=e.getDate(),r=Math.floor((14-a)/12),s=t+4800-r,i=a+12*r-3;return n+Math.floor((153*i+2)/5)+365*s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400)-32045}}class C{toGregorian(e,t,a){const n=e+2637,r=Math.floor(30*Math.random())+21,s=new Date(n,0,r),i=29.5*(t-1)+a-1,o=new Date(s);return o.setDate(o.getDate()+i),o}fromGregorian(e){return{year:e.getFullYear()-2637,month:e.getMonth()+1,day:e.getDate()}}}class F{toGregorian(e,t,a){const n=new Date(e-3761,8,15),r=29.5*(t-1)+a-1,s=new Date(n);return s.setDate(s.getDate()+r),s}fromGregorian(e){return{year:e.getFullYear()+3761,month:e.getMonth()+1,day:e.getDate()}}}class T{toGregorian(e,t,a){const n=new Date(e+622,2,21),r=30*(t-1)+a-1,s=new Date(n);return s.setDate(s.getDate()+r),s}fromGregorian(e){return{year:e.getFullYear()-622,month:e.getMonth()+1,day:e.getDate()}}}var E={name:"holiday-lunar-calculator",version:"1.0.0",size:2048,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("lunar",new S)}};class I{constructor(){this.holidayCache=new Map,this.allHolidays=[]}calculate(e,t,a){const{relativeTo:n,offset:r}=e.rule;a?.holidays&&(this.allHolidays=a.holidays);const s=this.findBaseHoliday(n);if(!s)throw new Error(`Base holiday '${n}' not found for relative rule '${e.name}'`);const i=this.calculateBaseHolidayDates(s,t),o=[];for(const e of i){const t=new Date(e);t.setDate(t.getDate()+r),o.push(t)}return o}findBaseHoliday(e){let t=this.allHolidays.find(t=>t.name===e);return t||(t=this.allHolidays.find(t=>t.id===e)),t||(t=this.allHolidays.find(t=>t.name.toLowerCase()===e.toLowerCase())),t||null}calculateBaseHolidayDates(e,t){if("relative"===e.type)throw new Error(`Circular dependency detected: ${e.name} cannot be relative to another relative holiday`);const a=`${e.name}-${t}`;if(this.holidayCache.has(a))return this.holidayCache.get(a);const n=this.calculateDirectHoliday(e,t);return this.holidayCache.set(a,n),n}calculateDirectHoliday(e,t){switch(e.type){case"fixed":return this.calculateFixed(e,t);case"nth-weekday":return this.calculateNthWeekday(e,t);case"easter-based":return this.calculateEasterBased(e,t);default:throw new Error(`Cannot calculate base holiday of type: ${e.type}`)}}calculateFixed(e,t){const{month:a,day:n}=e.rule,r=new Date(t,a-1,n);return r.getFullYear()!==t||r.getMonth()!==a-1||r.getDate()!==n?[]:[r]}calculateNthWeekday(e,t){const{month:a,weekday:n,nth:r}=e.rule;return r>0?[this.getNthWeekdayOfMonth(t,a-1,n,r)]:[this.getLastNthWeekdayOfMonth(t,a-1,n,Math.abs(r))]}calculateEasterBased(e,t){const{offset:a}=e.rule,n=this.calculateEaster(t),r=new Date(n);return r.setDate(r.getDate()+a),[r]}getNthWeekdayOfMonth(e,t,a,n){let r=a-new Date(e,t,1).getDay();r<0&&(r+=7);return new Date(e,t,1+r+7*(n-1))}getLastNthWeekdayOfMonth(e,t,a,n){const r=new Date(e,t+1,0);let s=r.getDay()-a;s<0&&(s+=7);const i=r.getDate()-s-7*(n-1);return new Date(e,t,i)}calculateEaster(e){const t=e%19,a=Math.floor(e/100),n=e%100,r=Math.floor(a/4),s=a%4,i=Math.floor((a+8)/25),o=(19*t+a-r-Math.floor((a-i+1)/3)+15)%30,l=(32+2*s+2*Math.floor(n/4)-o-n%4)%7,d=Math.floor((t+11*o+22*l)/451),u=Math.floor((o+l-7*d+114)/31)-1;return new Date(e,u,(o+l-7*d+114)%31+1)}clearCache(){this.holidayCache.clear()}}var j={name:"holiday-relative-calculator",version:"1.0.0",size:1024,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("relative",new I)}};class N{calculate(e,t,a){const{calculate:n}=e.rule;if("function"!=typeof n)throw new Error(`Custom rule '${e.name}' must have a calculate function`);try{const r=n(t,a);if(r instanceof Date)return[r];if(Array.isArray(r))return r.filter(e=>e instanceof Date);throw new Error(`Custom rule '${e.name}' must return Date or Date[]`)}catch(t){throw new Error(`Error calculating custom rule '${e.name}': ${t instanceof Error?t.message:String(t)}`)}}}const O={calculateVernalEquinox(e){const t=new Date(e,2,20),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateAutumnalEquinox(e){const t=new Date(e,8,23),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateSummerSolstice(e){const t=new Date(e,5,21),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateWinterSolstice(e){const t=new Date(e,11,21),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},findWeekdayInMonth(e,t,a,n){if("first"===n){let n=a-new Date(e,t,1).getDay();return n<0&&(n+=7),new Date(e,t,1+n)}{const n=new Date(e,t+1,0);let r=n.getDay()-a;return r<0&&(r+=7),new Date(e,t,n.getDate()-r)}},calculateNewMoon(e,t){const a=new Date(e,t,0).getDate(),n=Math.floor(.5*a);return new Date(e,t-1,n)},calculateFullMoon(e,t){const a=this.calculateNewMoon(e,t),n=new Date(a);return n.setDate(n.getDate()+14),n},getNextBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()+1);0===t.getDay()||6===t.getDay();)t.setDate(t.getDate()+1);return t},getPreviousBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()-1);0===t.getDay()||6===t.getDay();)t.setDate(t.getDate()-1);return t},getDateInTimezone:(e,t)=>new Date(e.toLocaleString("en-US",{timeZone:t})),getDSTTransition(e,t){return"spring"===t?this.findWeekdayInMonth(e,2,0,"first"):this.findWeekdayInMonth(e,10,0,"first")},calculateGoldenWeekSubstitutes(e){const t=[new Date(e,3,29),new Date(e,4,3),new Date(e,4,4),new Date(e,4,5)],a=[];for(const e of t){if(0===e.getDay()){const t=new Date(e);t.setDate(t.getDate()+1),a.push(t)}}return a},calculateQingming(e){const t=new Date(e,3,5),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t}};var B={name:"holiday-custom-calculator",version:"1.0.0",size:1536,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("custom",new N),e.addStatic?.({customCalculatorUtils:O})}};class R{constructor(e={}){this.cache=new Map,this.config={weekends:[0,6],holidays:[],customRules:[],...e}}updateConfig(e){this.config={...this.config,...e},this.cache.clear()}isBusinessDay(e){const t=e.toISOString().split("T")[0];if(this.cache.has(t))return this.cache.get(t);const a=this.calculateIsBusinessDay(e);return this.cache.set(t,a),a}calculateIsBusinessDay(e){const t=e.getDay();if(this.config.weekends?.includes(t))return!1;if(this.config.holidays&&this.config.holidays.length>0){const t=globalThis.kairos?.holidayEngine;if(t){if(t.isHoliday(e,this.config.holidays))return!1}}if(this.config.customRules)for(const t of this.config.customRules)if(!t(e))return!1;return!0}nextBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()+1);!this.isBusinessDay(t);)t.setDate(t.getDate()+1);return t}previousBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()-1);!this.isBusinessDay(t);)t.setDate(t.getDate()-1);return t}addBusinessDays(e,t){if(0===t)return new Date(e);const a=new Date(e);let n=0;const r=t>0?1:-1,s=Math.abs(t);for(;n<s;)a.setDate(a.getDate()+r),this.isBusinessDay(a)&&n++;return a}businessDaysBetween(e,t){const a=new Date(e),n=new Date(t);if(a.getTime()===n.getTime())return 0;const r=a<n?1:-1;let s=0;const i=new Date(a);for(;i.getTime()!==n.getTime();)i.setDate(i.getDate()+r),this.isBusinessDay(i)&&s++;return s*r}businessDaysInMonth(e,t){const a=new Date(e,t,1),n=new Date(e,t+1,0);return this.businessDaysBetween(a,n)+(this.isBusinessDay(a)?1:0)}businessDaysInYear(e){const t=new Date(e,0,1),a=new Date(e,11,31);return this.businessDaysBetween(t,a)+(this.isBusinessDay(t)?1:0)}settlementDate(e,t){return this.addBusinessDays(e,t)}getBusinessDaysInMonth(e,t){const a=[],n=new Date(e,t,1),r=new Date(e,t+1,0),s=new Date(n);for(;s<=r;)this.isBusinessDay(s)&&a.push(new Date(s)),s.setDate(s.getDate()+1);return a}getBusinessDaysInRange(e,t){const a=[],n=new Date(e);for(;n<=t;)this.isBusinessDay(n)&&a.push(new Date(n)),n.setDate(n.getDate()+1);return a}getNthBusinessDay(e,t,a){const n=new Date(e,t,1),r=new Date(e,t+1,0),s=new Date(n);let i=0;for(;s<=r;){if(this.isBusinessDay(s)&&(i++,i===a))return new Date(s);s.setDate(s.getDate()+1)}return null}getLastBusinessDay(e,t){const a=new Date(e,t+1,0),n=new Date(a);for(;n.getMonth()===t;){if(this.isBusinessDay(n))return new Date(n);n.setDate(n.getDate()-1)}return null}clearCache(){this.cache.clear()}}const _=new R;var W={name:"business-workday",version:"1.0.0",size:2048,dependencies:["holiday-engine"],install(e,t){e.extend({isBusinessDay(e){const t=e?new R(e):_;if(!e?.holidays&&this.getHolidays){const e=this.getHolidays();t.updateConfig({holidays:e})}return t.isBusinessDay(this.toDate())},isWeekend(){const e=this.day();return 0===e||6===e},nextBusinessDay(t){const a=t?new R(t):_;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}const n=a.nextBusinessDay(this.toDate());return e(n)},previousBusinessDay(t){const a=t?new R(t):_;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}const n=a.previousBusinessDay(this.toDate());return e(n)},addBusinessDays(t,a){const n=a?new R(a):_;if(!a?.holidays&&this.getHolidays){const e=this.getHolidays();n.updateConfig({holidays:e})}const r=n.addBusinessDays(this.toDate(),t);return e(r)},businessDaysBetween(e,t){const a=t?new R(t):_;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}return a.businessDaysBetween(this.toDate(),e.toDate())},businessDaysInMonth(e){const t=e?new R(e):_;if(!e?.holidays&&this.getHolidays){const e=this.getHolidays();t.updateConfig({holidays:e})}return t.businessDaysInMonth(this.year(),this.month()-1)},settlementDate(t,a){const n=a?new R(a):_;if(!a?.holidays&&this.getHolidays){const e=this.getHolidays();n.updateConfig({holidays:e})}const r=n.settlementDate(this.toDate(),t);return e(r)},isWorkingHour(e=9,t=17){const a=this.hour();return this.isBusinessDay()&&a>=e&&a<t}}),e.addStatic?.({businessDayCalculator:_,createBusinessDayCalculator:e=>new R(e),getBusinessDaysInMonth:(t,a,n)=>(n?new R(n):_).getBusinessDaysInMonth(t,a-1).map(t=>e(t)),getBusinessDaysInRange(t,a,n){const r=n?new R(n):_,s=e(t).toDate(),i=e(a).toDate();return r.getBusinessDaysInRange(s,i).map(t=>e(t))},getNthBusinessDay(t,a,n,r){const s=(r?new R(r):_).getNthBusinessDay(t,a-1,n);return s?e(s):null},getLastBusinessDay(t,a,n){const r=(n?new R(n):_).getLastBusinessDay(t,a-1);return r?e(r):null},businessDaysInYear:(e,t)=>(t?new R(t):_).businessDaysInYear(e)})}};class A{constructor(e){this.config=e}getStartMonth(){if("number"==typeof this.config.start)return this.config.start;const e=["january","february","march","april","may","june","july","august","september","october","november","december"].indexOf(this.config.start.toLowerCase());return-1===e?1:e+1}getFiscalYear(e){const t=this.getStartMonth(),a=e.getFullYear();return e.getMonth()+1>=t?a:a-1}getFiscalYearStart(e){const t=this.getStartMonth();return new Date(e,t-1,1)}getFiscalYearEnd(e){const t=this.getStartMonth(),a=1===t?12:t-1,n=1===t?e:e+1,r=new Date(n,a,0).getDate();return new Date(n,a-1,r)}getFiscalQuarter(e){const t=this.getStartMonth();let a=e.getMonth()+1-t;return a<0&&(a+=12),Math.floor(a/3)+1}getFiscalQuarterStart(e,t){const a=this.getStartMonth();return new Date(1===t?e:a+3*(t-1)>12?e+1:e,(a-1+3*(t-1))%12,1)}getFiscalQuarterEnd(e,t){const a=this.getStartMonth(),n=(a-1+3*t-1)%12,r=1===t?e:a+3*t-1>12?e+1:e,s=new Date(r,n+1,0).getDate();return new Date(r,n,s)}getDaysInFiscalYear(e){const t=this.getFiscalYearStart(e),a=this.getFiscalYearEnd(e);return Math.floor((a.getTime()-t.getTime())/864e5)+1}getDaysInFiscalQuarter(e,t){const a=this.getFiscalQuarterStart(e,t),n=this.getFiscalQuarterEnd(e,t);return Math.floor((n.getTime()-a.getTime())/864e5)+1}getFiscalWeek(e){const t=this.getFiscalYear(e),a=this.getFiscalYearStart(t),n=e.getTime()-a.getTime(),r=Math.floor(n/864e5);return Math.floor(r/7)+1}static getCommonConfigs(){return{US:{start:10},UK:{start:4},Canada:{start:4},Australia:{start:7},India:{start:4},Japan:{start:4},Germany:{start:1},France:{start:1},China:{start:1},Brazil:{start:1},Russia:{start:1},"South Korea":{start:1},Singapore:{start:4},"Hong Kong":{start:4},"New Zealand":{start:4},Mexico:{start:1},"South Africa":{start:3},Turkey:{start:1},Israel:{start:1},"Saudi Arabia":{start:1},UAE:{start:1},Egypt:{start:7},Nigeria:{start:1},Kenya:{start:7},"Corporate-Q1":{start:1},"Corporate-Q2":{start:4},"Corporate-Q3":{start:7},"Corporate-Q4":{start:10},"Academic-US":{start:8},"Academic-UK":{start:9},"Retail-US":{start:2},"Retail-4-5-4":{start:2}}}}var $={name:"business-fiscal",version:"1.0.0",size:1536,dependencies:["business-workday"],install(e,t){e.extend({fiscalYear(e){return new A(e||{start:1}).getFiscalYear(this.toDate())},fiscalYearStart(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalYearStart(n);return e(r)},fiscalYearEnd(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalYearEnd(n);return e(r)},fiscalQuarter(e){return new A(e||{start:1}).getFiscalQuarter(this.toDate())},fiscalQuarterStart(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalQuarter(this.toDate()),s=a.getFiscalQuarterStart(n,r);return e(s)},fiscalQuarterEnd(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalQuarter(this.toDate()),s=a.getFiscalQuarterEnd(n,r);return e(s)},fiscalWeek(e){return new A(e||{start:1}).getFiscalWeek(this.toDate())},isFiscalYearStart(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalYearStart(n);return this.isSame(e(r))},isFiscalYearEnd(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalYearEnd(n);return this.isSame(e(r))},isFiscalQuarterStart(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalQuarter(this.toDate()),s=a.getFiscalQuarterStart(n,r);return this.isSame(e(s))},isFiscalQuarterEnd(t){const a=new A(t||{start:1}),n=a.getFiscalYear(this.toDate()),r=a.getFiscalQuarter(this.toDate()),s=a.getFiscalQuarterEnd(n,r);return this.isSame(e(s))}}),e.addStatic?.({fiscalYearCalculator:A,getFiscalYearConfig:e=>A.getCommonConfigs()[e]||null,getAvailableFiscalConfigs:()=>Object.keys(A.getCommonConfigs()),createFiscalCalculator:e=>new A(e),getFiscalYearInfo(t,a){const n=new A(a||{start:1});return{fiscalYear:t,start:e(n.getFiscalYearStart(t)),end:e(n.getFiscalYearEnd(t)),days:n.getDaysInFiscalYear(t),quarters:[1,2,3,4].map(a=>({quarter:a,start:e(n.getFiscalQuarterStart(t,a)),end:e(n.getFiscalQuarterEnd(t,a)),days:n.getDaysInFiscalQuarter(t,a)}))}},getBusinessDaysInFiscalYear(t,a){const n=new A(a||{start:1}),r=n.getFiscalYearStart(t),s=n.getFiscalYearEnd(t),i=e.businessDayCalculator;return i.businessDaysBetween(r,s)+(i.isBusinessDay(r)?1:0)}})}};const q={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},P={en:q,"en-US":q,"en-GB":q,de:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"eine Minute",mm:"%d Minuten",h:"eine Stunde",hh:"%d Stunden",d:"ein Tag",dd:"%d Tage",M:"ein Monat",MM:"%d Monate",y:"ein Jahr",yy:"%d Jahre"},"de-DE":{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"eine Minute",mm:"%d Minuten",h:"eine Stunde",hh:"%d Stunden",d:"ein Tag",dd:"%d Tage",M:"ein Monat",MM:"%d Monate",y:"ein Jahr",yy:"%d Jahre"},tr:{future:"%s içinde",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},"tr-TR":{future:"%s içinde",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ja:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"},"ja-JP":{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};class z{constructor(e="en"){this.locale=P[e]||P[e.split("-")[0]]||q}format(e,t=!1){const a=Math.abs(e),n=Math.round(a/1e3),r=Math.round(n/60),s=Math.round(r/60),i=Math.round(s/24),o=Math.round(i/30.436875),l=Math.round(i/365.25);let d;if(d=n<45?this.locale.s:n<90?this.locale.m:r<45?this.locale.mm.replace("%d",r.toString()):r<90?this.locale.h:s<22?this.locale.hh.replace("%d",s.toString()):s<36?this.locale.d:i<26?this.locale.dd.replace("%d",i.toString()):i<46?this.locale.M:i<320?this.locale.MM.replace("%d",o.toString()):i<548?this.locale.y:this.locale.yy.replace("%d",l.toString()),t)return d;return(e>0?this.locale.future:this.locale.past).replace("%s",d)}formatNative(e,t="en",a={}){if("undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const n=new Intl.RelativeTimeFormat(t,{numeric:a.numeric||"auto",style:a.style||"long"}),r=Math.abs(e)/1e3,s=r/60,i=s/60,o=i/24,l=o/7,d=o/30.436875,u=o/365.25,c=e>0?1:-1;return u>=1?n.format(c*Math.round(u),"year"):d>=1?n.format(c*Math.round(d),"month"):l>=1?n.format(c*Math.round(l),"week"):o>=1?n.format(c*Math.round(o),"day"):i>=1?n.format(c*Math.round(i),"hour"):s>=1?n.format(c*Math.round(s),"minute"):n.format(c*Math.round(r),"second")}return this.format(e)}}const U={name:"relativeTime",install(e){e.extend({fromNow(e=!1){const t=Date.now(),a=this.valueOf()-t;return(new z).format(a,e)},from(e,t=!1){const a=this.valueOf()-e.valueOf();return(new z).format(a,t)},toNow(e=!1){const t=Date.now()-this.valueOf();return(new z).format(t,e)},to(e,t=!1){const a=this.valueOf(),n=e.valueOf()-a;return(new z).format(n,t)},humanize(e=!1){const t=new z,a=this.valueOf();return t.format(a,!e)},fromNowNative(e="en",t){const a=Date.now(),n=this.valueOf()-a;return(new z).formatNative(n,e,t)},toNowNative(e="en",t){const a=Date.now()-this.valueOf();return(new z).formatNative(a,e,t)}}),e.addStatic({relativeTime:{registerLocale(e,t){P[e]=t},getLocale:e=>P[e],calculator:e=>new z(e)}})}};class J{static getISOWeek(e){const t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+4-(t.getDay()||7));const a=new Date(t.getFullYear(),0,1);return Math.ceil(((t.getTime()-a.getTime())/864e5+1)/7)}static getISOWeekYear(e){const t=new Date(e.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),t.getFullYear()}static getWeek(e,t=0){const a=new Date(e.getTime());a.setHours(0,0,0,0);const n=new Date(a.getFullYear(),0,1);n.setHours(0,0,0,0);const r=(t-n.getDay()+7)%7,s=new Date(n);r>0&&s.setDate(n.getDate()+r-7);const i=Math.floor((a.getTime()-s.getTime())/864e5),o=Math.floor(i/7)+1;if(o<1){const e=new Date(a.getFullYear()-1,11,31);return this.getWeek(e,t)}return o}static getQuarter(e){return Math.floor(e.getMonth()/3)+1}static getDayOfYear(e){const t=new Date(e.getFullYear(),0,0),a=e.getTime()-t.getTime();return Math.floor(a/864e5)}static getDaysInMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}static getDaysInYear(e){return this.isLeapYear(e)?366:365}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static getWeekOfMonth(e,t=0){const a=(new Date(e.getFullYear(),e.getMonth(),1).getDay()-t+7)%7,n=e.getDate();return Math.ceil((n+a)/7)}static getCalendarInfo(e){const t=e.getFullYear();return{year:t,quarter:this.getQuarter(e),month:e.getMonth()+1,week:this.getWeek(e),weekYear:t,isoWeek:this.getISOWeek(e),isoWeekYear:this.getISOWeekYear(e),dayOfYear:this.getDayOfYear(e),dayOfWeek:e.getDay(),daysInMonth:this.getDaysInMonth(e),daysInYear:this.getDaysInYear(t),isLeapYear:this.isLeapYear(t),weekOfMonth:this.getWeekOfMonth(e)}}}const G={name:"calendar",install(e){e.extend({quarter(e){const t=J.getQuarter(this.toDate());if(void 0===e)return t;if(e<1||e>4)throw new Error("Quarter must be between 1 and 4");const a=3*(e-1)+1;return this.clone().month(a)},week(e){const t=J.getWeek(this.toDate());if(void 0===e)return t;const a=e-t;return this.clone().add(7*a,"days")},isoWeek(e){const t=J.getISOWeek(this.toDate());if(void 0===e)return t;const a=e-t;return this.clone().add(7*a,"days")},isoWeekYear(){return J.getISOWeekYear(this.toDate())},weekYear(){return this.year()},dayOfYear(t){const a=J.getDayOfYear(this.toDate());if(void 0===t)return a;const n=this.clone(),r=new Date(n.year(),0,1);return r.setDate(t),e(r)},daysInMonth(){return J.getDaysInMonth(this.toDate())},daysInYear(){return J.getDaysInYear(this.year())},isLeapYear(){return J.isLeapYear(this.year())},weekOfMonth(){return J.getWeekOfMonth(this.toDate())},calendarInfo(){return J.getCalendarInfo(this.toDate())},startOfQuarter(){const t=3*(this.quarter()-1);return e(new Date(this.year(),t,1)).startOf("day")},endOfQuarter(){const t=3*this.quarter();return e(new Date(this.year(),t,0)).endOf("day")},startOfWeek(e=0){const t=this.clone(),a=t.day(),n=(a<e?-7:0)+e-a;return t.add(n,"days").startOf("day")},endOfWeek(e=0){const t=this.clone(),a=t.day(),n=(a<e?-7:0)+e-a+6;return t.add(n,"days").endOf("day")},startOfISOWeek(){return this.startOfWeek(1)},endOfISOWeek(){return this.endOfWeek(1)},isWeekend(){const e=this.day();return 0===e||6===e},isWeekday(){return!this.isWeekend()},isSameQuarter(e){return this.quarter()===e.quarter()&&this.year()===e.year()},isSameWeek(e,t=0){const a=this.startOfWeek(t),n=e.startOfWeek(t);return a.format("YYYY-MM-DD")===n.format("YYYY-MM-DD")},isSameISOWeek(e){return this.isoWeek()===e.isoWeek()&&this.isoWeekYear()===e.isoWeekYear()},weeksInYear(){const t=e(new Date(this.year(),11,31));return J.getWeek(t.toDate())},isoWeeksInYear(){const e=this.year(),t=J.getISOWeek(new Date(e,11,31));return 1===t?J.getISOWeek(new Date(e,11,24)):t}}),e.addStatic({calendar:J})}},Q=[{id:"new-years-day",name:"New Year's Day",type:"fixed",rule:{month:1,day:1},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"independence-day",name:"Independence Day",type:"fixed",rule:{month:7,day:4},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"veterans-day",name:"Veterans Day",type:"fixed",rule:{month:11,day:11},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"juneteenth",name:"Juneteenth",type:"fixed",rule:{month:6,day:19},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"christmas-day",name:"Christmas Day",type:"fixed",rule:{month:12,day:25},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"martin-luther-king-day",name:"Martin Luther King Jr. Day",type:"nth-weekday",rule:{month:1,weekday:1,nth:3}},{id:"presidents-day",name:"Presidents' Day",type:"nth-weekday",rule:{month:2,weekday:1,nth:3}},{id:"mothers-day",name:"Mother's Day",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{id:"memorial-day",name:"Memorial Day",type:"nth-weekday",rule:{month:5,weekday:1,nth:-1}},{id:"fathers-day",name:"Father's Day",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{id:"labor-day",name:"Labor Day",type:"nth-weekday",rule:{month:9,weekday:1,nth:1}},{id:"columbus-day",name:"Columbus Day",type:"nth-weekday",rule:{month:10,weekday:1,nth:2}},{id:"thanksgiving",name:"Thanksgiving",type:"nth-weekday",rule:{month:11,weekday:4,nth:4}},{id:"black-friday",name:"Black Friday",type:"relative",rule:{relativeTo:"thanksgiving",offset:1}},{id:"good-friday",name:"Good Friday",type:"easter-based",rule:{offset:-2}},{id:"easter-sunday",name:"Easter Sunday",type:"easter-based",rule:{offset:0}},{id:"easter-monday",name:"Easter Monday",type:"easter-based",rule:{offset:1}}],V={texas:[{id:"texas-independence-day",name:"Texas Independence Day",type:"fixed",rule:{month:3,day:2},regions:["TX"]},{id:"juneteenth",name:"Juneteenth",type:"fixed",rule:{month:6,day:19},regions:["TX"]},{id:"lyndon-b-johnson-day",name:"Lyndon B. Johnson Day",type:"fixed",rule:{month:8,day:27},regions:["TX"]}],california:[{id:"cesar-chavez-day",name:"Cesar Chavez Day",type:"fixed",rule:{month:3,day:31},regions:["CA"]}],hawaii:[{id:"prince-kuhio-day",name:"Prince Kuhio Day",type:"fixed",rule:{month:3,day:26},regions:["HI"]},{id:"kamehameha-day",name:"Kamehameha Day",type:"fixed",rule:{month:6,day:11},regions:["HI"]},{id:"statehood-day",name:"Statehood Day",type:"nth-weekday",rule:{month:8,weekday:5,nth:3},regions:["HI"]}],massachusetts:[{id:"patriots-day",name:"Patriots' Day",type:"nth-weekday",rule:{month:4,weekday:1,nth:3},regions:["MA"]}],maine:[{id:"patriots-day",name:"Patriots' Day",type:"nth-weekday",rule:{month:4,weekday:1,nth:3},regions:["ME"]}]},K=Q.filter(e=>["new-years-day","martin-luther-king-day","presidents-day","memorial-day","juneteenth","independence-day","labor-day","columbus-day","veterans-day","thanksgiving","christmas-day"].includes(e.id)),Z=[...Q,...Object.values(V).flat()],X={name:"English (United States)",code:"en-US",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ordinal:e=>{if(e>=11&&e<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}},meridiem:(e,t,a)=>{const n=e<12?"AM":"PM";return a?n.toLowerCase():n}};var ee={name:"locale-en-US",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:X,install(e,t){D.register("en-US",{...X,holidays:Q,federalHolidays:K,stateHolidays:V}),e.locales=e.locales||{},e.locales["en-US"]=X,e.extend({getUSHolidays(e){if(e){const t=e.toLowerCase(),a=V[t];if(a)return[...K,...a]}return Q},getFederalHolidays:()=>K,getStateHolidays:e=>V[e.toLowerCase()]||[],getAllUSHolidays:()=>Z}),e.addStatic?.({locale(t){if(void 0===t)return D.getCurrentLocale();if(D.setLocale(t))return e.currentLocale=t,e;throw new Error(`Locale '${t}' not found`)},getAvailableLocales:()=>Object.keys(e.locales||{})}),e.currentLocale="en-US"}};const te=[{id:"new-years-day",name:"Yılbaşı",type:"fixed",rule:{month:1,day:1}},{id:"national-sovereignty-day",name:"Ulusal Egemenlik ve Çocuk Bayramı",type:"fixed",rule:{month:4,day:23}},{id:"labor-day",name:"Emek ve Dayanışma Günü",type:"fixed",rule:{month:5,day:1}},{id:"ataturk-commemoration-day",name:"Atatürk'ü Anma, Gençlik ve Spor Bayramı",type:"fixed",rule:{month:5,day:19}},{id:"democracy-day",name:"Demokrasi ve Milli Birlik Günü",type:"fixed",rule:{month:7,day:15}},{id:"victory-day",name:"Zafer Bayramı",type:"fixed",rule:{month:8,day:30}},{id:"republic-day",name:"Cumhuriyet Bayramı",type:"fixed",rule:{month:10,day:29}},{id:"ramadan-feast",name:"Ramazan Bayramı",type:"custom",rule:{calculate:e=>{const t={2024:{month:4,day:10},2025:{month:3,day:30},2023:{month:4,day:21}}[e]||{month:4,day:15};return[new Date(e,t.month-1,t.day),new Date(e,t.month-1,t.day+1),new Date(e,t.month-1,t.day+2)]}},duration:3},{id:"sacrifice-feast",name:"Kurban Bayramı",type:"custom",rule:{calculate:e=>{const t={2024:{month:6,day:16},2025:{month:6,day:6},2023:{month:6,day:28}}[e]||{month:6,day:20};return[new Date(e,t.month-1,t.day),new Date(e,t.month-1,t.day+1),new Date(e,t.month-1,t.day+2),new Date(e,t.month-1,t.day+3)]}},duration:4},{id:"mawlid",name:"Mevlid Kandili",type:"lunar",rule:{calendar:"islamic",month:3,day:12}},{id:"regaib-night",name:"Regaib Kandili",type:"custom",rule:{calculate:e=>{const t=new Date(e,1,15),a=new Date(t);for(;4!==a.getDay();)a.setDate(a.getDate()+1);return a}}},{id:"miraj-night",name:"Mirac Kandili",type:"lunar",rule:{calendar:"islamic",month:7,day:27}},{id:"laylat-al-baraat",name:"Berat Kandili",type:"lunar",rule:{calendar:"islamic",month:8,day:15}},{id:"laylat-al-qadr",name:"Kadir Gecesi",type:"lunar",rule:{calendar:"islamic",month:9,day:27}},{id:"arafat-day",name:"Arefe Günü",type:"lunar",rule:{calendar:"islamic",month:12,day:9}}],ae=[{id:"ashura",name:"Aşure Günü",type:"lunar",rule:{calendar:"islamic",month:1,day:10}},{id:"isra-and-miraj",name:"İsra ve Mirac",type:"lunar",rule:{calendar:"islamic",month:7,day:27}},{id:"shab-e-barat",name:"Berat Kandili",type:"lunar",rule:{calendar:"islamic",month:8,day:15}}],ne=[{id:"conquest-of-istanbul",name:"İstanbul'un Fethi",type:"fixed",rule:{month:5,day:29},active:!1},{id:"gallipoli-victory",name:"Çanakkale Zaferi",type:"fixed",rule:{month:3,day:18},active:!1}],re=[...te,...ae,...ne],se=te.filter(e=>["new-years-day","national-sovereignty-day","labor-day","ataturk-commemoration-day","democracy-day","victory-day","republic-day","ramadan-feast","sacrifice-feast"].includes(e.id)),ie={name:"Türkçe (Türkiye)",code:"tr-TR",months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],weekdays:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],weekdaysShort:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],weekdaysMin:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:e=>{if(1===e)return`${e}'inci`;if(2===e)return`${e}'nci`;if(3===e)return`${e}'üncü`;if(4===e)return`${e}'üncü`;if(5===e)return`${e}'inci`;if(6===e)return`${e}'ncı`;if(7===e)return`${e}'nci`;if(8===e)return`${e}'inci`;if(9===e)return`${e}'uncu`;if(10===e)return`${e}'uncu`;const t=e%100;if(t>=11&&t<=13)return`${e}'üncü`;switch(e%10){case 1:case 5:case 8:return`${e}'inci`;case 2:case 7:return`${e}'nci`;case 3:case 4:default:return`${e}'üncü`;case 6:return`${e}'ncı`;case 9:case 0:return`${e}'uncu`}},meridiem:(e,t,a)=>""};var oe={name:"locale-tr-TR",version:"1.0.0",size:1536,dependencies:["holiday-engine"],locale:ie,install(e,t){D.register("tr-TR",{...ie,holidays:te,publicHolidays:se,observances:ae,historicalHolidays:ne}),e.locales=e.locales||{},e.locales["tr-TR"]=ie,e.extend({getTurkishHolidays(e){switch(e){case"public":return se;case"religious":return te.filter(e=>"lunar"===e.type||"custom"===e.type);case"historical":return ne;case"all":return re;default:return te}},getPublicHolidays:()=>se,getReligiousHolidays:()=>te.filter(e=>"lunar"===e.type||"custom"===e.type),getObservances:()=>ae,isReligiousHoliday(){const e=this.getHolidayInfo();return!!e&&("lunar"===e.type||"custom"===e.type)},isPublicHoliday(){return null!==this.getHolidayInfo(se)},formatTurkish(e){const t=e||"D MMMM YYYY, dddd";return this.format(t)}}),e.addStatic?.({getRamazanBayrami(t){const a=te.find(e=>"ramadan-feast"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},getKurbanBayrami(t){const a=te.find(e=>"sacrifice-feast"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},getKandilGecesi(t){const a=te.filter(e=>e.name.includes("Kandil")||e.name.includes("Kadir")),n=[];for(const r of a){const a=e.holidayEngine.calculate(r,t);n.push(...a.map(t=>({date:e(t),name:r.name})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())}})}};const le=[{id:"new-years-day",name:"Neujahr",type:"fixed",rule:{month:1,day:1}},{id:"labor-day",name:"Tag der Arbeit",type:"fixed",rule:{month:5,day:1}},{id:"german-unity-day",name:"Tag der Deutschen Einheit",type:"fixed",rule:{month:10,day:3}},{id:"christmas-day",name:"1. Weihnachtstag",type:"fixed",rule:{month:12,day:25}},{id:"boxing-day",name:"2. Weihnachtstag",type:"fixed",rule:{month:12,day:26}},{id:"good-friday",name:"Karfreitag",type:"easter-based",rule:{offset:-2}},{id:"easter-sunday",name:"Ostersonntag",type:"easter-based",rule:{offset:0}},{id:"easter-monday",name:"Ostermontag",type:"easter-based",rule:{offset:1}},{id:"ascension-day",name:"Christi Himmelfahrt",type:"easter-based",rule:{offset:39}},{id:"whit-sunday",name:"Pfingstsonntag",type:"easter-based",rule:{offset:49}},{id:"whit-monday",name:"Pfingstmontag",type:"easter-based",rule:{offset:50}}],de={"baden-württemberg":[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["BW"]},{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["BW"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["BW"]}],bavaria:[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["BY"]},{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["BY"]},{id:"assumption-day",name:"Mariä Himmelfahrt",type:"fixed",rule:{month:8,day:15},regions:["BY"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["BY"]}],berlin:[{id:"womens-day",name:"Internationaler Frauentag",type:"fixed",rule:{month:3,day:8},regions:["BE"]}],brandenburg:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["BB"]}],bremen:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["HB"]}],hamburg:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["HH"]}],hesse:[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["HE"]}],"lower-saxony":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["NI"]}],"mecklenburg-vorpommern":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["MV"]}],"north-rhine-westphalia":[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["NW"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["NW"]}],"rhineland-palatinate":[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["RP"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["RP"]}],saarland:[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["SL"]},{id:"assumption-day",name:"Mariä Himmelfahrt",type:"fixed",rule:{month:8,day:15},regions:["SL"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["SL"]}],saxony:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["SN"]},{id:"repentance-day",name:"Buß- und Bettag",type:"custom",rule:{calculate:e=>{const t=(new Date(e,10,23).getDay()+4)%7;return new Date(e,10,23-t)}},regions:["SN"]}],"saxony-anhalt":[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["ST"]},{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["ST"]}],"schleswig-holstein":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["SH"]}],thuringia:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["TH"]}]},ue=le,ce=[...le,...Object.values(de).flat()],ye=[{id:"day-of-german-unity-old",name:"Tag der deutschen Einheit (alt)",type:"fixed",rule:{month:6,day:17},active:!1},{id:"reformation-day-2017",name:"Reformationstag 2017",type:"fixed",rule:{month:10,day:31},active:!1}],he={name:"Deutsch (Deutschland)",code:"de-DE",months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],weekdaysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},ordinal:e=>`${e}.`,meridiem:(e,t,a)=>""};var me={name:"locale-de-DE",version:"1.0.0",size:2048,dependencies:["holiday-engine"],locale:he,install(e,t){D.register("de-DE",{...he,holidays:le,federalHolidays:ue,stateHolidays:de,historicalHolidays:ye}),e.locales=e.locales||{},e.locales["de-DE"]=he,e.extend({getGermanHolidays(e){if(e){const t=e.toLowerCase(),a=de[t];if(a)return[...ue,...a]}return le},getFederalHolidays:()=>ue,getStateHolidays:e=>de[e.toLowerCase()]||[],getAllHolidays:()=>ce,getHistoricalHolidays:()=>ye,isEasterHoliday(){const e=this.getHolidayInfo();return!!e&&"easter-based"===e.type},isCatholicHoliday(){const e=this.getHolidayInfo();return!!e&&["epiphany","corpus-christi","assumption-day","all-saints-day"].includes(e.id)},isProtestantHoliday(){const e=this.getHolidayInfo();return!!e&&["reformation-day","repentance-day"].includes(e.id)},formatGerman(e){const t=e||"dddd, D. MMMM YYYY";return this.format(t)}}),e.addStatic?.({getEasterHolidays(t){const a=le.filter(e=>"easter-based"===e.type),n=[];for(const r of a){const a=e.holidayEngine.calculate(r,t);n.push(...a.map(t=>({date:e(t),name:r.name,id:r.id})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getBusBettag(t){const a=de.saxony.find(e=>"repentance-day"===e.id);if(a){const n=e.holidayEngine.calculate(a,t);return n.length>0?e(n[0]):null}return null},getStateHolidaysForYear(t,a){const n=de[t.toLowerCase()];if(!n)return[];const r=[];for(const t of n){const n=e.holidayEngine.calculate(t,a);r.push(...n.map(a=>({date:e(a),name:t.name,id:t.id})))}return r.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getAvailableStates:()=>Object.keys(de)})}};const fe=[{id:"new-years-day",name:"元日",type:"fixed",rule:{month:1,day:1}},{id:"coming-of-age-day",name:"成人の日",type:"nth-weekday",rule:{month:1,weekday:1,nth:2}},{id:"national-foundation-day",name:"建国記念の日",type:"fixed",rule:{month:2,day:11}},{id:"emperors-birthday",name:"天皇誕生日",type:"fixed",rule:{month:2,day:23}},{id:"vernal-equinox-day",name:"春分の日",type:"custom",rule:{calculate:e=>O.calculateVernalEquinox(e)}},{id:"showa-day",name:"昭和の日",type:"fixed",rule:{month:4,day:29}},{id:"constitution-day",name:"憲法記念日",type:"fixed",rule:{month:5,day:3}},{id:"greenery-day",name:"みどりの日",type:"fixed",rule:{month:5,day:4}},{id:"childrens-day",name:"こどもの日",type:"fixed",rule:{month:5,day:5}},{id:"marine-day",name:"海の日",type:"nth-weekday",rule:{month:7,weekday:1,nth:3}},{id:"mountain-day",name:"山の日",type:"fixed",rule:{month:8,day:11}},{id:"respect-for-aged-day",name:"敬老の日",type:"nth-weekday",rule:{month:9,weekday:1,nth:3}},{id:"autumnal-equinox-day",name:"秋分の日",type:"custom",rule:{calculate:e=>O.calculateAutumnalEquinox(e)}},{id:"sports-day",name:"スポーツの日",type:"nth-weekday",rule:{month:10,weekday:1,nth:2}},{id:"culture-day",name:"文化の日",type:"fixed",rule:{month:11,day:3}},{id:"labor-thanksgiving-day",name:"勤労感謝の日",type:"fixed",rule:{month:11,day:23}},{id:"golden-week-substitute",name:"ゴールデンウィーク振替休日",type:"custom",rule:{calculate:e=>O.calculateGoldenWeekSubstitutes(e)}}],ge=[{id:"emperors-birthday-showa",name:"天皇誕生日(昭和)",type:"fixed",rule:{month:4,day:29},active:!1},{id:"emperors-birthday-heisei",name:"天皇誕生日(平成)",type:"fixed",rule:{month:12,day:23},active:!1},{id:"health-sports-day",name:"体育の日",type:"nth-weekday",rule:{month:10,weekday:1,nth:2},active:!1},{id:"national-holiday",name:"国民の休日",type:"fixed",rule:{month:5,day:4},active:!1}],pe=[{id:"setsubun",name:"節分",type:"fixed",rule:{month:2,day:3}},{id:"hinamatsuri",name:"ひなまつり",type:"fixed",rule:{month:3,day:3}},{id:"cherry-blossom-day",name:"桜の日",type:"fixed",rule:{month:3,day:27}},{id:"mothers-day",name:"母の日",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{id:"fathers-day",name:"父の日",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{id:"tanabata",name:"七夕",type:"fixed",rule:{month:7,day:7}},{id:"obon",name:"お盆",type:"fixed",rule:{month:8,day:15},duration:3},{id:"respect-for-elderly-day",name:"敬老の日",type:"nth-weekday",rule:{month:9,weekday:1,nth:3}},{id:"shichi-go-san",name:"七五三",type:"fixed",rule:{month:11,day:15}},{id:"christmas",name:"クリスマス",type:"fixed",rule:{month:12,day:25}},{id:"new-years-eve",name:"大晦日",type:"fixed",rule:{month:12,day:31}}],De=fe.filter(e=>["showa-day","constitution-day","greenery-day","childrens-day","golden-week-substitute"].includes(e.id)),we=fe.filter(e=>"golden-week-substitute"!==e.id),Me=[...fe,...pe,...ge],be=fe.filter(e=>"emperors-birthday-showa"!==e.id&&"emperors-birthday-heisei"!==e.id),xe=[...fe.filter(e=>"emperors-birthday"!==e.id),...ge.filter(e=>"emperors-birthday-heisei"===e.id)],Ye=[{id:"marine-day-2020",name:"海の日(2020年特別)",type:"fixed",rule:{month:7,day:23},active:!1},{id:"sports-day-2020",name:"スポーツの日(2020年特別)",type:"fixed",rule:{month:7,day:24},active:!1},{id:"mountain-day-2020",name:"山の日(2020年特別)",type:"fixed",rule:{month:8,day:10},active:!1}],ke={name:"日本語 (日本)",code:"ja-JP",months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],weekdaysShort:["日","月","火","水","木","金","土"],weekdaysMin:["日","月","火","水","木","金","土"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm"},ordinal:e=>`${e}日`,meridiem:(e,t,a)=>e<12?"午前":"午後"};var ve={name:"locale-ja-JP",version:"1.0.0",size:2048,dependencies:["holiday-engine","holiday-custom-calculator"],locale:ke,install(e,t){D.register("ja-JP",{...ke,holidays:fe,publicHolidays:we,observances:pe,historicalHolidays:ge,goldenWeekHolidays:De,reiwaHolidays:be,heiseiHolidays:xe}),e.locales=e.locales||{},e.locales["ja-JP"]=ke,e.extend({getJapaneseHolidays(e){switch(e){case"public":return we;case"observances":return pe;case"historical":return ge;case"golden-week":return De;case"reiwa":return be;case"heisei":return xe;case"olympics2020":return Ye;case"all":return Me;default:return fe}},getPublicHolidays:()=>we,getObservances:()=>pe,getGoldenWeekHolidays:()=>De,isGoldenWeekHoliday(){return null!==this.getHolidayInfo(De)},isPublicHoliday(){return null!==this.getHolidayInfo(we)},isObservance(){return null!==this.getHolidayInfo(pe)},isEquinoxHoliday(){const e=this.getHolidayInfo();return!!e&&["vernal-equinox-day","autumnal-equinox-day"].includes(e.id)},formatJapanese(e){const t=e||"YYYY年M月D日(ddd)";return this.format(t)},getJapaneseEra(){const e=this.year();return e>=2019?"令和":e>=1989?"平成":e>=1926?"昭和":e>=1912?"大正":e>=1868?"明治":"不明"},getJapaneseEraYear(){const e=this.year();return e>=2019?e-2018:e>=1989?e-1988:e>=1926?e-1925:e>=1912?e-1911:e>=1868?e-1867:e},formatWithEra(){return`${this.getJapaneseEra()}${this.getJapaneseEraYear()}年${this.month()}月${this.date()}日`}}),e.addStatic?.({getGoldenWeek(t){const a=[];for(const n of De){const r=e.holidayEngine.calculate(n,t);a.push(...r.map(t=>({date:e(t),name:n.name,id:n.id})))}return a.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getEquinoxDays(t){const a=fe.filter(e=>["vernal-equinox-day","autumnal-equinox-day"].includes(e.id)),n=[];for(const r of a){const a=e.holidayEngine.calculate(r,t);n.push(...a.map(t=>({date:e(t),name:r.name,id:r.id})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getObon(t){const a=pe.find(e=>"obon"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},isReiwaEra:e=>e>=2019,isHeiseiEra:e=>e>=1989&&e<=2019,isShowaEra:e=>e>=1926&&e<=1989,toJapaneseEra:e=>e>=2019?{era:"令和",year:e-2018}:e>=1989?{era:"平成",year:e-1988}:e>=1926?{era:"昭和",year:e-1925}:e>=1912?{era:"大正",year:e-1911}:e>=1868?{era:"明治",year:e-1867}:{era:"不明",year:e},getHolidaysForEra(e){switch(e){case"reiwa":return be;case"heisei":return xe;default:return fe}}})}};const He=[{name:"Jour de l'An",type:"fixed",rule:{month:1,day:1}},{name:"Fête du Travail",type:"fixed",rule:{month:5,day:1}},{name:"Victoire 1945",type:"fixed",rule:{month:5,day:8}},{name:"Fête Nationale",type:"fixed",rule:{month:7,day:14}},{name:"Assomption",type:"fixed",rule:{month:8,day:15}},{name:"Toussaint",type:"fixed",rule:{month:11,day:1}},{name:"Armistice 1918",type:"fixed",rule:{month:11,day:11}},{name:"Noël",type:"fixed",rule:{month:12,day:25}},{name:"Lundi de Pâques",type:"easter-based",rule:{offset:1}},{name:"Ascension",type:"easter-based",rule:{offset:39}},{name:"Lundi de Pentecôte",type:"easter-based",rule:{offset:50}},{name:"Vendredi Saint",type:"easter-based",rule:{offset:-2},regions:["Alsace","Moselle"]},{name:"Saint-Étienne",type:"fixed",rule:{month:12,day:26},regions:["Alsace","Moselle"]}],Se=[{name:"Saint-Valentin",type:"fixed",rule:{month:2,day:14}},{name:"Fête des Mères",type:"nth-weekday",rule:{month:5,weekday:0,nth:-1}},{name:"Fête des Pères",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{name:"Fête de la Musique",type:"fixed",rule:{month:6,day:21}},{name:"Halloween",type:"fixed",rule:{month:10,day:31}}],Le={alsace:[{name:"Vendredi Saint",type:"easter-based",rule:{offset:-2}},{name:"Saint-Étienne",type:"fixed",rule:{month:12,day:26}}],martinique:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:5,day:22}}],guadeloupe:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:5,day:27}}],guyane:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:6,day:10}}],reunion:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:12,day:20}}]},Ce=[...He,...Se],Fe={name:"Français (France)",code:"fr-FR",months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],weekdays:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],weekdaysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],weekdaysMin:["di","lu","ma","me","je","ve","sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},ordinal:e=>1===e?`${e}er`:`${e}e`,meridiem:(e,t,a)=>"",relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};var Te={name:"locale-fr-FR",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Fe,install(e,t){D.register("fr-FR",{...Fe,holidays:He,observances:Se,regionalHolidays:Le}),e.locales=e.locales||{},e.locales["fr-FR"]=Fe,e.extend({getFrenchHolidays(e){if(e){const t=e.toLowerCase(),a=Le[t];if(a)return[...He,...a]}return He},getFrenchObservances:()=>Se,getRegionalHolidays:e=>Le[e.toLowerCase()]||[],getAllFrenchHolidays:()=>Ce})}};const Ee=[{name:"Año Nuevo",type:"fixed",rule:{month:1,day:1}},{name:"Epifanía del Señor",type:"fixed",rule:{month:1,day:6}},{name:"Viernes Santo",type:"easter-based",rule:{offset:-2}},{name:"Fiesta del Trabajo",type:"fixed",rule:{month:5,day:1}},{name:"Asunción de la Virgen",type:"fixed",rule:{month:8,day:15}},{name:"Fiesta Nacional de España",type:"fixed",rule:{month:10,day:12}},{name:"Todos los Santos",type:"fixed",rule:{month:11,day:1}},{name:"Día de la Constitución",type:"fixed",rule:{month:12,day:6}},{name:"Inmaculada Concepción",type:"fixed",rule:{month:12,day:8}},{name:"Navidad",type:"fixed",rule:{month:12,day:25}},{name:"Jueves Santo",type:"easter-based",rule:{offset:-3},regions:["Andalucía","Aragón","Asturias","Baleares","Canarias","Cantabria","Castilla-La Mancha","Castilla y León","Extremadura","Galicia","Madrid","Murcia","Navarra","País Vasco","La Rioja"]},{name:"Lunes de Pascua",type:"easter-based",rule:{offset:1},regions:["Baleares","Cataluña","Comunidad Valenciana","Navarra","País Vasco"]}],Ie={andalucia:[{name:"Día de Andalucía",type:"fixed",rule:{month:2,day:28}}],aragon:[{name:"San Jorge",type:"fixed",rule:{month:4,day:23}}],asturias:[{name:"Día de Asturias",type:"fixed",rule:{month:9,day:8}}],baleares:[{name:"Día de las Islas Baleares",type:"fixed",rule:{month:3,day:1}}],canarias:[{name:"Día de Canarias",type:"fixed",rule:{month:5,day:30}}],cantabria:[{name:"Día de las Instituciones de Cantabria",type:"fixed",rule:{month:7,day:28}}],castillaLaMancha:[{name:"Día de Castilla-La Mancha",type:"fixed",rule:{month:5,day:31}}],castillaYLeon:[{name:"Día de Castilla y León",type:"fixed",rule:{month:4,day:23}}],cataluna:[{name:"Sant Jordi",type:"fixed",rule:{month:4,day:23}},{name:"Sant Joan",type:"fixed",rule:{month:6,day:24}},{name:"Diada Nacional de Catalunya",type:"fixed",rule:{month:9,day:11}},{name:"Sant Esteve",type:"fixed",rule:{month:12,day:26}}],extremadura:[{name:"Día de Extremadura",type:"fixed",rule:{month:9,day:8}}],galicia:[{name:"Día Nacional de Galicia",type:"fixed",rule:{month:7,day:25}}],madrid:[{name:"Día de la Comunidad de Madrid",type:"fixed",rule:{month:5,day:2}}],murcia:[{name:"Día de la Región de Murcia",type:"fixed",rule:{month:6,day:9}}],navarra:[{name:"San Fermín",type:"fixed",rule:{month:7,day:7}}],paisVasco:[{name:"Lunes de Pascua",type:"easter-based",rule:{offset:1}}],laRioja:[{name:"Día de La Rioja",type:"fixed",rule:{month:6,day:9}}],valencia:[{name:"San Vicente Mártir",type:"fixed",rule:{month:1,day:22}},{name:"Fallas",type:"fixed",rule:{month:3,day:19}},{name:"San Juan",type:"fixed",rule:{month:6,day:24}},{name:"Día de la Comunidad Valenciana",type:"fixed",rule:{month:10,day:9}}]},je=[{name:"San Valentín",type:"fixed",rule:{month:2,day:14}},{name:"Día del Padre",type:"fixed",rule:{month:3,day:19}},{name:"Día de la Madre",type:"nth-weekday",rule:{month:5,weekday:0,nth:1}},{name:"Nochevieja",type:"fixed",rule:{month:12,day:31}}],Ne=[...Ee,...je],Oe={name:"Español (España)",code:"es-ES",months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic."],weekdays:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."],weekdaysMin:["do","lu","ma","mi","ju","vi","sá"],formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"de la mañana":e<20?"de la tarde":"de la noche";return a?n:n.toUpperCase()},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"}};var Be={name:"locale-es-ES",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Oe,install(e,t){D.register("es-ES",{...Oe,holidays:Ee,observances:je,regionalHolidays:Ie}),e.locales=e.locales||{},e.locales["es-ES"]=Oe,e.extend({getSpanishHolidays(e){if(e){const t=e.toLowerCase().replace(/\s/g,""),a=Ie[t];if(a)return[...Ee,...a]}return Ee},getSpanishObservances:()=>je,getRegionalSpanishHolidays:e=>Ie[e.toLowerCase().replace(/\s/g,"")]||[],getAllSpanishHolidays:()=>Ne})}};const Re=[{name:"Capodanno",type:"fixed",rule:{month:1,day:1}},{name:"Epifania",type:"fixed",rule:{month:1,day:6}},{name:"Festa della Liberazione",type:"fixed",rule:{month:4,day:25}},{name:"Festa del Lavoro",type:"fixed",rule:{month:5,day:1}},{name:"Festa della Repubblica",type:"fixed",rule:{month:6,day:2}},{name:"Assunzione di Maria",type:"fixed",rule:{month:8,day:15}},{name:"Ognissanti",type:"fixed",rule:{month:11,day:1}},{name:"Immacolata Concezione",type:"fixed",rule:{month:12,day:8}},{name:"Natale",type:"fixed",rule:{month:12,day:25}},{name:"Santo Stefano",type:"fixed",rule:{month:12,day:26}},{name:"Pasquetta",type:"easter-based",rule:{offset:1}}],_e={sicilia:[{name:"Santa Lucia",type:"fixed",rule:{month:12,day:13}}],sardegna:[{name:"Sagra di Sant'Efisio",type:"fixed",rule:{month:5,day:1}}],veneto:[{name:"San Marco",type:"fixed",rule:{month:4,day:25}}],toscana:[{name:"San Giovanni Battista",type:"fixed",rule:{month:6,day:24}}],lazio:[{name:"Santi Pietro e Paolo",type:"fixed",rule:{month:6,day:29}}],lombardia:[{name:"Sant'Ambrogio",type:"fixed",rule:{month:12,day:7}}]},We=[{name:"San Valentino",type:"fixed",rule:{month:2,day:14}},{name:"Festa della Donna",type:"fixed",rule:{month:3,day:8}},{name:"Festa della Mamma",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"Festa del Papà",type:"fixed",rule:{month:3,day:19}},{name:"Vigilia di Natale",type:"fixed",rule:{month:12,day:24}},{name:"Capodanno",type:"fixed",rule:{month:12,day:31}}],Ae=[...Re,...We],$e={name:"Italiano (Italia)",code:"it-IT",months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen.","feb.","mar.","apr.","mag.","giu.","lug.","ago.","set.","ott.","nov.","dic."],weekdays:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],weekdaysShort:["dom.","lun.","mar.","mer.","gio.","ven.","sab."],weekdaysMin:["do","lu","ma","me","gi","ve","sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"del mattino":e<18?"del pomeriggio":"della sera";return a?n:n.toUpperCase()},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};var qe={name:"locale-it-IT",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:$e,install(e,t){D.register("it-IT",{...$e,holidays:Re,observances:We,regionalHolidays:_e}),e.locales=e.locales||{},e.locales["it-IT"]=$e,e.extend({getItalianHolidays(e){if(e){const t=e.toLowerCase(),a=_e[t];if(a)return[...Re,...a]}return Re},getItalianObservances:()=>We,getRegionalItalianHolidays:e=>_e[e.toLowerCase()]||[],getAllItalianHolidays:()=>Ae})}};const Pe=[{name:"Confraternização Universal",type:"fixed",rule:{month:1,day:1}},{name:"Tiradentes",type:"fixed",rule:{month:4,day:21}},{name:"Dia do Trabalhador",type:"fixed",rule:{month:5,day:1}},{name:"Independência do Brasil",type:"fixed",rule:{month:9,day:7}},{name:"Nossa Senhora Aparecida",type:"fixed",rule:{month:10,day:12}},{name:"Finados",type:"fixed",rule:{month:11,day:2}},{name:"Proclamação da República",type:"fixed",rule:{month:11,day:15}},{name:"Natal",type:"fixed",rule:{month:12,day:25}},{name:"Carnaval",type:"easter-based",rule:{offset:-47}},{name:"Sexta-feira Santa",type:"easter-based",rule:{offset:-2}},{name:"Corpus Christi",type:"easter-based",rule:{offset:60}}],ze={acre:[{name:"Dia da Amazônia",type:"fixed",rule:{month:9,day:5}},{name:"Tratado de Petrópolis",type:"fixed",rule:{month:11,day:17}}],alagoas:[{name:"São João",type:"fixed",rule:{month:6,day:24}},{name:"São Pedro",type:"fixed",rule:{month:6,day:29}}],bahia:[{name:"Independência da Bahia",type:"fixed",rule:{month:7,day:2}}],ceara:[{name:"Abolição da Escravidão no Ceará",type:"fixed",rule:{month:3,day:25}}],df:[{name:"Fundação de Brasília",type:"fixed",rule:{month:4,day:21}},{name:"Dia da Consciência Negra",type:"fixed",rule:{month:11,day:20}}],rj:[{name:"Morte de Zumbi dos Palmares",type:"fixed",rule:{month:4,day:23}},{name:"São Jorge",type:"fixed",rule:{month:4,day:23}}],sp:[{name:"Revolução Constitucionalista",type:"fixed",rule:{month:7,day:9}},{name:"Dia da Consciência Negra",type:"fixed",rule:{month:11,day:20}}]},Ue=[{name:"Dia dos Namorados",type:"fixed",rule:{month:6,day:12}},{name:"Dia das Mães",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"Dia dos Pais",type:"nth-weekday",rule:{month:8,weekday:0,nth:2}},{name:"Dia das Crianças",type:"fixed",rule:{month:10,day:12}},{name:"Dia do Professor",type:"fixed",rule:{month:10,day:15}},{name:"Véspera de Natal",type:"fixed",rule:{month:12,day:24}},{name:"Véspera de Ano Novo",type:"fixed",rule:{month:12,day:31}}],Je=[...Pe,...Ue],Ge={name:"Português (Brasil)",code:"pt-BR",months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthsShort:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],weekdays:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],weekdaysShort:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."],weekdaysMin:["do","sg","te","qa","qi","sx","sá"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"da manhã":e<18?"da tarde":"da noite";return a?n:n.toUpperCase()},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};var Qe={name:"locale-pt-BR",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Ge,install(e,t){D.register("pt-BR",{...Ge,holidays:Pe,observances:Ue,regionalHolidays:ze}),e.locales=e.locales||{},e.locales["pt-BR"]=Ge,e.extend({getBrazilianHolidays(e){if(e){const t=e.toLowerCase(),a=ze[t];if(a)return[...Pe,...a]}return Pe},getBrazilianObservances:()=>Ue,getRegionalBrazilianHolidays:e=>ze[e.toLowerCase()]||[],getAllBrazilianHolidays:()=>Je})}};const Ve=[{name:"Новый год",type:"fixed",rule:{month:1,day:1}},{name:"Рождество Христово",type:"fixed",rule:{month:1,day:7}},{name:"День защитника Отечества",type:"fixed",rule:{month:2,day:23}},{name:"Международный женский день",type:"fixed",rule:{month:3,day:8}},{name:"Праздник Весны и Труда",type:"fixed",rule:{month:5,day:1}},{name:"День Победы",type:"fixed",rule:{month:5,day:9}},{name:"День России",type:"fixed",rule:{month:6,day:12}},{name:"День народного единства",type:"fixed",rule:{month:11,day:4}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:2}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:3}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:4}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:5}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:6}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:8}},{name:"Православная Пасха",type:"easter-based",rule:{offset:0}}],Ke={tatarstan:[{name:"День Республики Татарстан",type:"fixed",rule:{month:8,day:30}}],bashkortostan:[{name:"День Республики Башкортостан",type:"fixed",rule:{month:10,day:11}}],sakha:[{name:"День Республики Саха (Якутия)",type:"fixed",rule:{month:4,day:27}}],chechnya:[{name:"День мира в Чеченской Республике",type:"fixed",rule:{month:4,day:16}}],dagestan:[{name:"День единения народов Дагестана",type:"fixed",rule:{month:9,day:15}}]},Ze=[{name:"День святого Валентина",type:"fixed",rule:{month:2,day:14}},{name:"Масленица",type:"easter-based",rule:{offset:-49}},{name:"День космонавтики",type:"fixed",rule:{month:4,day:12}},{name:"Радоница",type:"easter-based",rule:{offset:9}},{name:"День Победы (вечером)",type:"fixed",rule:{month:5,day:9}},{name:"День знаний",type:"fixed",rule:{month:9,day:1}},{name:"День учителя",type:"fixed",rule:{month:10,day:5}},{name:"День матери",type:"nth-weekday",rule:{month:11,weekday:0,nth:-1}},{name:"День Конституции Российской Федерации",type:"fixed",rule:{month:12,day:12}}],Xe=[...Ve,...Ze],et={name:"Русский (Россия)",code:"ru-RU",months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],monthsShort:["янв.","фев.","мар.","апр.","май","июн.","июл.","авг.","сен.","окт.","ноя.","дек."],weekdays:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],weekdaysShort:["вс.","пн.","вт.","ср.","чт.","пт.","сб."],weekdaysMin:["вс","пн","вт","ср","чт","пт","сб"],formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY [г.]",LLL:"D MMMM YYYY [г.], H:mm",LLLL:"dddd, D MMMM YYYY [г.], H:mm"},ordinal:e=>`${e}-й`,meridiem:(e,t,a)=>e<4?"ночи":e<12?"утра":e<17?"дня":"вечера",relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:e=>e%10==1&&e%100!=11?`${e} секунду`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} секунды`:`${e} секунд`,m:"минуту",mm:e=>e%10==1&&e%100!=11?`${e} минуту`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} минуты`:`${e} минут`,h:"час",hh:e=>e%10==1&&e%100!=11?`${e} час`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} часа`:`${e} часов`,d:"день",dd:e=>e%10==1&&e%100!=11?`${e} день`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} дня`:`${e} дней`,M:"месяц",MM:e=>e%10==1&&e%100!=11?`${e} месяц`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} месяца`:`${e} месяцев`,y:"год",yy:e=>e%10==1&&e%100!=11?`${e} год`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} года`:`${e} лет`}};var tt={name:"locale-ru-RU",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:et,install(e,t){D.register("ru-RU",{...et,holidays:Ve,observances:Ze,regionalHolidays:Ke}),e.locales=e.locales||{},e.locales["ru-RU"]=et,e.extend({getRussianHolidays(e){if(e){const t=e.toLowerCase(),a=Ke[t];if(a)return[...Ve,...a]}return Ve},getRussianObservances:()=>Ze,getRegionalRussianHolidays:e=>Ke[e.toLowerCase()]||[],getAllRussianHolidays:()=>Xe})}};const at=[{name:"元旦",type:"fixed",rule:{month:1,day:1}},{name:"劳动节",type:"fixed",rule:{month:5,day:1}},{name:"国庆节",type:"fixed",rule:{month:10,day:1}},{name:"国庆黄金周",type:"fixed",rule:{month:10,day:2}},{name:"国庆黄金周",type:"fixed",rule:{month:10,day:3}},{name:"春节",type:"lunar",rule:{calendar:"chinese",month:1,day:1}},{name:"春节假期",type:"lunar",rule:{calendar:"chinese",month:1,day:2}},{name:"春节假期",type:"lunar",rule:{calendar:"chinese",month:1,day:3}},{name:"清明节",type:"fixed",rule:{month:4,day:5}},{name:"端午节",type:"lunar",rule:{calendar:"chinese",month:5,day:5}},{name:"中秋节",type:"lunar",rule:{calendar:"chinese",month:8,day:15}}],nt={xinjiang:[{name:"古尔邦节",type:"custom",rule:{calculate:e=>[new Date(e,8,10)]}}],tibet:[{name:"藏历新年",type:"custom",rule:{calculate:e=>[new Date(e,1,10)]}}],guangxi:[{name:"三月三",type:"lunar",rule:{month:3,day:3}}],hongkong:[{name:"佛诞节",type:"lunar",rule:{month:4,day:8}}],macau:[{name:"澳门特别行政区成立纪念日",type:"fixed",rule:{month:12,day:20}}]},rt=[{name:"情人节",type:"fixed",rule:{month:2,day:14}},{name:"妇女节",type:"fixed",rule:{month:3,day:8}},{name:"植树节",type:"fixed",rule:{month:3,day:12}},{name:"愚人节",type:"fixed",rule:{month:4,day:1}},{name:"青年节",type:"fixed",rule:{month:5,day:4}},{name:"母亲节",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"儿童节",type:"fixed",rule:{month:6,day:1}},{name:"父亲节",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{name:"建党节",type:"fixed",rule:{month:7,day:1}},{name:"建军节",type:"fixed",rule:{month:8,day:1}},{name:"教师节",type:"fixed",rule:{month:9,day:10}},{name:"重阳节",type:"lunar",rule:{calendar:"chinese",month:9,day:9}},{name:"万圣节",type:"fixed",rule:{month:10,day:31}},{name:"光棍节",type:"fixed",rule:{month:11,day:11}},{name:"圣诞节",type:"fixed",rule:{month:12,day:25}}],st=[...at,...rt],it={name:"中文 (简体,中国)",code:"zh-CN",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["周日","周一","周二","周三","周四","周五","周六"],weekdaysMin:["日","一","二","三","四","五","六"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"dddd YYYY年M月D日 HH:mm"},ordinal:e=>`第${e}`,meridiem:(e,t,a)=>e<6?"凌晨":e<9?"早上":e<12?"上午":e<13?"中午":e<18?"下午":"晚上",relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d秒",m:"1分钟",mm:"%d分钟",h:"1小时",hh:"%d小时",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1年",yy:"%d年"}};var ot={name:"locale-zh-CN",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:it,install(e,t){D.register("zh-CN",{...it,holidays:at,observances:rt,regionalHolidays:nt}),e.locales=e.locales||{},e.locales["zh-CN"]=it,e.extend({getChineseHolidays(e){if(e){const t=e.toLowerCase(),a=nt[t];if(a)return[...at,...a]}return at},getChineseObservances:()=>rt,getRegionalChineseHolidays:e=>nt[e.toLowerCase()]||[],getAllChineseHolidays:()=>st})}};e.AUTHOR="Ersin Koc",e.BusinessDayCalculator=R,e.CalendarCalculator=J,e.CustomCalculator=N,e.CustomCalculatorUtils=O,e.DESCRIPTION="Revolutionary zero-dependency JavaScript date/time library with modular architecture and dynamic holiday system",e.EasterCalculator=v,e.FiscalYearCalculator=A,e.FixedCalculator=b,e.HOMEPAGE="https://github.com/ersinkoc/kairos#readme",e.LRUCache=t,e.LunarCalculator=S,e.NthWeekdayCalculator=Y,e.REPOSITORY="https://github.com/ersinkoc/kairos",e.RelativeCalculator=I,e.RelativeTimeCalculator=z,e.VERSION="1.1.0",e.allGermanHolidays=ce,e.allJapaneseHolidays=Me,e.allTurkishHolidays=re,e.allUSHolidays=Z,e.businessFiscal=$,e.businessWorkday=W,e.calendarPlugin=G,e.createDateCache=function(){return new t(1e4)},e.createHolidayCache=n,e.customCalculator=B,e.default=g,e.easterCalculator=H,e.fixedCalculator=x,e.germanFederalHolidays=ue,e.germanHistoricalHolidays=ye,e.germanHolidays=le,e.germanStateHolidays=de,e.holidayEngine=M,e.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.isValidDay=o,e.isValidMonth=i,e.isValidNth=d,e.isValidNumber=r,e.isValidString=s,e.isValidWeekday=l,e.isValidYear=function(e){return r(e)&&e>=1e3&&e<=9999},e.japaneseGoldenWeekHolidays=De,e.japaneseHeiseiHolidays=xe,e.japaneseHistoricalHolidays=ge,e.japaneseHolidays=fe,e.japaneseObservances=pe,e.japanesePublicHolidays=we,e.japaneseReiwaHolidays=be,e.localeCN=ot,e.localeDE=me,e.localeES=Be,e.localeFR=Te,e.localeIT=qe,e.localeJP=ve,e.localePT=Qe,e.localeRU=tt,e.localeTR=oe,e.localeUS=ee,e.lunarCalculator=E,e.memoize=a,e.nthWeekdayCalculator=k,e.relativeCalculator=j,e.relativeTimePlugin=U,e.setupBasic=function(){const e=require("./core/plugin-system.js").default,t=require("./plugins/parse/flexible.js").default,a=require("./plugins/parse/iso.js").default,n=require("./plugins/format/tokens.js").default;return e.use([t,a,n]),e},e.setupFull=function(){const e=require("./core/plugin-system.js").default,t=require("./plugins/holiday/engine.js").default,a=require("./plugins/business/workday.js").default,n=require("./plugins/business/fiscal.js").default,r=require("./plugins/relative/relative-time.js").default,s=require("./plugins/calendar/calendar.js").default,i=require("./plugins/duration/duration.js").default,o=require("./plugins/range/range.js").default,l=require("./plugins/timezone/timezone.js").default,d=require("./plugins/parse/flexible.js").default,u=require("./plugins/parse/iso.js").default,c=require("./plugins/parse/rfc2822.js").default,y=require("./plugins/parse/unix.js").default,h=require("./plugins/format/tokens.js").default,m=require("./plugins/locale/en-US/index.js").default,f=require("./plugins/locale/de-DE/index.js").default,g=require("./plugins/locale/tr-TR/index.js").default,p=require("./plugins/locale/ja-JP/index.js").default,D=require("./plugins/locale/fr-FR/index.js").default,w=require("./plugins/locale/es-ES/index.js").default,M=require("./plugins/locale/it-IT/index.js").default,b=require("./plugins/locale/pt-BR/index.js").default,x=require("./plugins/locale/ru-RU/index.js").default,Y=require("./plugins/locale/zh-CN/index.js").default,k=require("./plugins/holiday/calculators/fixed.js").default,v=require("./plugins/holiday/calculators/nth-weekday.js").default,H=require("./plugins/holiday/calculators/easter.js").default,S=require("./plugins/holiday/calculators/lunar.js").default,L=require("./plugins/holiday/calculators/relative.js").default,C=require("./plugins/holiday/calculators/custom.js").default;return e.use([t,k,v,H,S,L,C,a,n,r,s,i,o,l,d,u,c,y,h,m,f,g,p,D,w,M,b,x,Y]),e.locale("en-US"),e},e.setupWithBusiness=function(){const e=require("./core/plugin-system.js").default,t=require("./plugins/business/workday.js").default,a=require("./plugins/business/fiscal.js").default,n=require("./plugins/holiday/engine.js").default;return e.use([t,a,n]),e},e.setupWithLocales=function(){const e=require("./core/plugin-system.js").default,t=require("./plugins/locale/en-US/index.js").default,a=require("./plugins/locale/de-DE/index.js").default,n=require("./plugins/locale/tr-TR/index.js").default,r=require("./plugins/locale/ja-JP/index.js").default,s=require("./plugins/locale/fr-FR/index.js").default,i=require("./plugins/locale/es-ES/index.js").default,o=require("./plugins/locale/it-IT/index.js").default,l=require("./plugins/locale/pt-BR/index.js").default,d=require("./plugins/locale/ru-RU/index.js").default,u=require("./plugins/locale/zh-CN/index.js").default;return e.use([t,a,n,r,s,i,o,l,d,u]),e.locale("en-US"),e},e.throwError=c,e.turkishHistoricalHolidays=ne,e.turkishHolidays=te,e.turkishObservances=ae,e.turkishPublicHolidays=se,e.usFederalHolidays=K,e.usHolidays=Q,e.usStateHolidays=V,e.validateHolidayRule=u,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=kairos.umd.min.js.map