From 7de2f807b1c73f36687c18bd22e6d5bda56908f1 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Sat, 9 Nov 2024 17:48:53 -0600 Subject: [PATCH] Move luxon dependency to npm --- thrimbletrimmer/package.json | 4 +- thrimbletrimmer/src/common/convertTime.tsx | 5 +- thrimbletrimmer/src/common/googleAuth.tsx | 8 +- thrimbletrimmer/src/external/luxon.min.js | 1 - thrimbletrimmer/src/globalStyle.scss | 2 +- .../thumbnails/ThumbnailManager.module.scss | 2 +- .../src/thumbnails/ThumbnailManager.tsx | 155 ++++++++++++++---- thrimbletrimmer/src/utilities/Clock.tsx | 2 +- .../src/utilities/TimeConverter.tsx | 2 +- thrimbletrimmer/src/utilities/Utilities.tsx | 2 +- 10 files changed, 135 insertions(+), 48 deletions(-) delete mode 100644 thrimbletrimmer/src/external/luxon.min.js diff --git a/thrimbletrimmer/package.json b/thrimbletrimmer/package.json index cec134e..c480e23 100644 --- a/thrimbletrimmer/package.json +++ b/thrimbletrimmer/package.json @@ -16,9 +16,11 @@ "typescript": "5.6.3", "url": "0.11.4", "vite": "5.4.10", - "vite-plugin-solid": "2.10.2" + "vite-plugin-solid": "2.10.2", + "@types/luxon": "3.4.2" }, "dependencies": { + "luxon": "3.4.4", "solid-js": "1.9.3" } } diff --git a/thrimbletrimmer/src/common/convertTime.tsx b/thrimbletrimmer/src/common/convertTime.tsx index 1538e3d..5b0785b 100644 --- a/thrimbletrimmer/src/common/convertTime.tsx +++ b/thrimbletrimmer/src/common/convertTime.tsx @@ -1,5 +1,4 @@ -import { l } from "vite/dist/node/types.d-aGj9QkWt"; -import { DateTime } from "../external/luxon.min"; +import { DateTime } from "luxon"; export function dateTimeFromWubloaderTime(wubloaderTime: string): DateTime | null { const dt = DateTime.fromISO(wubloaderTime, { zone: "UTC" }); @@ -86,7 +85,7 @@ export function timeAgoFromDateTime(dateTime: DateTime): string { timeAgoSeconds = -timeAgoSeconds; } - const seconds = (((timeAgoSeconds % 60) * 1000) | 0) / 1000 + const seconds = (((timeAgoSeconds % 60) * 1000) | 0) / 1000; const secondsString = seconds < 10 ? `0${seconds}` : seconds.toString(); const minutes = (timeAgoSeconds / 60) % 60 | 0; const minutesString = minutes < 10 ? `0${minutes}` : minutes.toString(); diff --git a/thrimbletrimmer/src/common/googleAuth.tsx b/thrimbletrimmer/src/common/googleAuth.tsx index a5d4e02..0abba77 100644 --- a/thrimbletrimmer/src/common/googleAuth.tsx +++ b/thrimbletrimmer/src/common/googleAuth.tsx @@ -20,7 +20,7 @@ async function googleSignOut() { if (googleUser) { googleUser = null; await gapi.auth2.getAuthInstance().signOut(); - + const signInElem = document.getElementById("google-auth-sign-in"); if (signInElem) { signInElem.classList.add("hidden"); @@ -40,7 +40,9 @@ export const GoogleSignIn: Component = () => { return (
- +
); -}; \ No newline at end of file +}; diff --git a/thrimbletrimmer/src/external/luxon.min.js b/thrimbletrimmer/src/external/luxon.min.js deleted file mode 100644 index 9a7d762..0000000 --- a/thrimbletrimmer/src/external/luxon.min.js +++ /dev/null @@ -1 +0,0 @@ -class e extends Error{}class L extends e{constructor(e){super("Invalid DateTime: "+e.toMessage())}}class z extends e{constructor(e){super("Invalid Interval: "+e.toMessage())}}class j extends e{constructor(e){super("Invalid Duration: "+e.toMessage())}}class v extends e{}class q extends e{constructor(e){super("Invalid unit "+e)}}class u extends e{}class r extends e{constructor(){super("Zone is an abstract class")}}var t="numeric",n="short",s="long";const A={year:t,month:t,day:t},$={year:t,month:n,day:t},U={year:t,month:n,day:t,weekday:n},_={year:t,month:s,day:t},Y={year:t,month:s,day:t,weekday:s},R={hour:t,minute:t},H={hour:t,minute:t,second:t},P={hour:t,minute:t,second:t,timeZoneName:n},J={hour:t,minute:t,second:t,timeZoneName:s},G={hour:t,minute:t,hourCycle:"h23"},B={hour:t,minute:t,second:t,hourCycle:"h23"},Q={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:n},K={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:s},X={year:t,month:t,day:t,hour:t,minute:t},ee={year:t,month:t,day:t,hour:t,minute:t,second:t},te={year:t,month:n,day:t,hour:t,minute:t},re={year:t,month:n,day:t,hour:t,minute:t,second:t},ne={year:t,month:n,day:t,weekday:n,hour:t,minute:t},se={year:t,month:s,day:t,hour:t,minute:t,timeZoneName:n},ie={year:t,month:s,day:t,hour:t,minute:t,second:t,timeZoneName:n},ae={year:t,month:s,day:t,weekday:s,hour:t,minute:t,timeZoneName:s},oe={year:t,month:s,day:t,weekday:s,hour:t,minute:t,second:t,timeZoneName:s};class i{get type(){throw new r}get name(){throw new r}get ianaName(){return this.name}get isUniversal(){throw new r}offsetName(e,t){throw new r}formatOffset(e,t){throw new r}offset(e){throw new r}equals(e){throw new r}get isValid(){throw new r}}let ue=null;class le extends i{static get instance(){return ue=null===ue?new le:ue}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return It(e,t,r)}formatOffset(e,t){return Ct(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let ce={};function he(e){return ce[e]||(ce[e]=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"})),ce[e]}const de={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function me(e,t){var e=e.format(t).replace(/\u200E/g,""),[,t,e,r,n,s,i,a]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e);return[r,t,e,n,s,i,a]}function fe(e,t){var r=e.formatToParts(t),n=[];for(let e=0;ee).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){var e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{var t;return"timeZoneName"===e.type?(t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName}),{...e,value:t}):e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Le{constructor(e,t,r){this.opts={style:"long",...r},!t&&yt()&&(this.rtf=Oe(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):Qt(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ze={firstDay:1,minimalDays:4,weekend:[6,7]};class w{static fromOpts(e){return w.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){e=e||k.defaultLocale,s=e||(s?"en-US":Ne()),t=t||k.defaultNumberingSystem,r=r||k.defaultOutputCalendar,n=pt(n)||k.defaultWeekSettings;return new w(s,t,r,n,e)}static resetCache(){be=null,we={},ke={},Te={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return w.create(e,t,r,n)}constructor(e,t,r,n,s){var[e,i,a]=Ie(e);this.locale=e,this.numberingSystem=t||i||null,this.outputCalendar=r||a||null,this.weekSettings=n,this.intl=Ve(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(){return null==this.fastNumbersCached&&(this.fastNumbersCached=Fe(this)),this.fastNumbersCached}listingMode(){var 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?w.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,pt(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(r,n=!1){return Ce(this,r,zt,()=>{const t=n?{month:r,day:"numeric"}:{month:r},e=n?"format":"standalone";return this.monthsCache[e][r]||(this.monthsCache[e][r]=xe(e=>this.extract(e,t,"month"))),this.monthsCache[e][r]})}weekdays(r,n=!1){return Ce(this,r,$t,()=>{const t=n?{weekday:r,year:"numeric",month:"long",day:"numeric"}:{weekday:r},e=n?"format":"standalone";return this.weekdaysCache[e][r]||(this.weekdaysCache[e][r]=Ee(e=>this.extract(e,t,"weekday"))),this.weekdaysCache[e][r]})}meridiems(){return Ce(this,void 0,()=>Ut,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[W.utc(2016,11,13,9),W.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(e){return Ce(this,e,Ht,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[W.utc(-40,1,1),W.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){e=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return e?e.value:null}numberFormatter(e={}){return new Ze(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new We(e,this.intl,t)}relFormatter(e={}){return new Le(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ve(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings||(gt()?Me(this.locale):ze)}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 je=null;class d extends i{static get utcInstance(){return je=null===je?new d(0):je}static instance(e){return 0===e?d.utcInstance:new d(e)}static parseSpecifier(e){if(e){e=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new d(Vt(e[1],e[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":"UTC"+Ct(this.fixed,"narrow")}get ianaName(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+Ct(-this.fixed,"narrow")}offsetName(){return this.name}formatOffset(e,t){return Ct(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 qe extends i{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 p(e,t){var r;return S(e)||null===e?t:e instanceof i?e:"string"==typeof e?"default"===(r=e.toLowerCase())?t:"local"===r||"system"===r?le.instance:"utc"===r||"gmt"===r?d.utcInstance:d.parseSpecifier(r)||a.create(e):h(e)?d.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new qe(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"},$e={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]},Ue=Ae.hanidec.replace(/[\[|\]]/g,"").split("");let o={};function _e(){o={}}function y({numberingSystem:e},t=""){e=e||"latn";return o[e]||(o[e]={}),o[e][t]||(o[e][t]=new RegExp(""+Ae[e]+t)),o[e][t]}let Ye=()=>Date.now(),Re="system",He=null,Pe=null,Je=null,Ge=60,Be,Qe=null;class k{static get now(){return Ye}static set now(e){Ye=e}static set defaultZone(e){Re=e}static get defaultZone(){return p(Re,le.instance)}static get defaultLocale(){return He}static set defaultLocale(e){He=e}static get defaultNumberingSystem(){return Pe}static set defaultNumberingSystem(e){Pe=e}static get defaultOutputCalendar(){return Je}static set defaultOutputCalendar(e){Je=e}static get defaultWeekSettings(){return Qe}static set defaultWeekSettings(e){Qe=pt(e)}static get twoDigitCutoffYear(){return Ge}static set twoDigitCutoffYear(e){Ge=e%100}static get throwOnInvalid(){return Be}static set throwOnInvalid(e){Be=e}static resetCaches(){w.resetCache(),a.resetCache(),W.resetCache(),_e()}}class l{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?this.reason+": "+this.explanation:this.reason}}const Ke=[0,31,59,90,120,151,181,212,243,273,304,334],Xe=[0,31,60,91,121,152,182,213,244,274,305,335];function c(e,t){return new l("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function et(e,t,r){t=new Date(Date.UTC(e,t-1,r)),e<100&&0<=e&&t.setUTCFullYear(t.getUTCFullYear()-1900),r=t.getUTCDay();return 0===r?7:r}function tt(e,t,r){return r+(Tt(e)?Xe:Ke)[t-1]}function rt(e,t){var e=Tt(e)?Xe:Ke,r=e.findIndex(e=>eDt(n,t,r)?(u=n+1,o=1):u=n,{weekYear:u,weekNumber:o,weekday:s,...Ft(e)}}function it(e,t=4,r=1){var{weekYear:n,weekNumber:s,weekday:i}=e,r=nt(et(n,1,t),r),a=b(n);let o=7*s+i-r-7+t,u;o<1?(u=n-1,o+=b(u)):o>a?(u=n+1,o-=b(n)):u=n;var{month:s,day:i}=rt(u,o);return{year:u,month:s,day:i,...Ft(e)}}function at(e){var{year:t,month:r,day:n}=e;return{year:t,ordinal:tt(t,r,n),...Ft(e)}}function ot(e){var{year:t,ordinal:r}=e,{month:r,day:n}=rt(t,r);return{year:t,month:r,day:n,...Ft(e)}}function ut(e,t){if(S(e.localWeekday)&&S(e.localWeekNumber)&&S(e.localWeekYear))return{minDaysInFirstWeek:4,startOfWeek:1};if(S(e.weekday)&&S(e.weekNumber)&&S(e.weekYear))return S(e.localWeekday)||(e.weekday=e.localWeekday),S(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),S(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()};throw new v("Cannot mix locale-based week fields with ISO-based week fields")}function lt(e,t=4,r=1){var n=mt(e.weekYear),t=f(e.weekNumber,1,Dt(e.weekYear,t,r)),r=f(e.weekday,1,7);return n?t?!r&&c("weekday",e.weekday):c("week",e.weekNumber):c("weekYear",e.weekYear)}function ct(e){var t=mt(e.year),r=f(e.ordinal,1,b(e.year));return t?!r&&c("ordinal",e.ordinal):c("year",e.year)}function ht(e){var t=mt(e.year),r=f(e.month,1,12),n=f(e.day,1,Ot(e.year,e.month));return t?r?!n&&c("day",e.day):c("month",e.month):c("year",e.year)}function dt(e){var{hour:e,minute:t,second:r,millisecond:n}=e,s=f(e,0,23)||24===e&&0===t&&0===r&&0===n,i=f(t,0,59),a=f(r,0,59),o=f(n,0,999);return s?i?a?!o&&c("millisecond",n):c("second",r):c("minute",t):c("hour",e)}function S(e){return void 0===e}function h(e){return"number"==typeof e}function mt(e){return"number"==typeof e&&e%1==0}function ft(e){return"[object Date]"===Object.prototype.toString.call(e)}function yt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function gt(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function vt(e){return Array.isArray(e)?e:[e]}function wt(e,r,n){if(0!==e.length)return e.reduce((e,t)=>{t=[r(t),t];return e&&n(e[0],t[0])===e[0]?e:t},null)[1]}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pt(e){if(null==e)return null;if("object"!=typeof e)throw new u("Week settings must be an object");if(f(e.firstDay,1,7)&&f(e.minimalDays,1,7)&&Array.isArray(e.weekend)&&!e.weekend.some(e=>!f(e,1,7)))return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)};throw new u("Invalid week settings")}function f(e,t,r){return mt(e)&&t<=e&&e<=r}function g(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function T(e){if(!S(e)&&null!==e&&""!==e)return parseInt(e,10)}function O(e){if(!S(e)&&null!==e&&""!==e)return parseFloat(e)}function kt(e){if(!S(e)&&null!==e&&""!==e)return e=1e3*parseFloat("0."+e),Math.floor(e)}function St(e,t,r=!1){t=10**t;return(r?Math.trunc:Math.round)(e*t)/t}function Tt(e){return e%4==0&&(e%100!=0||e%400==0)}function b(e){return Tt(e)?366:365}function Ot(e,t){var r,n=(n=t-1)-(r=12)*Math.floor(n/r)+1;return 2==n?Tt(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&0<=e.year&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function Nt(e,t,r){return-nt(et(e,1,t),r)+t-1}function Dt(e,t=4,r=1){var n=Nt(e,t,r),t=Nt(e+1,t,r);return(b(e)-n+t)/7}function Mt(e){return 99k.twoDigitCutoffYear?1900+e:2e3+e}function It(e,t,r,n=null){var e=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},n=(n&&(s.timeZone=n),{timeZoneName:t,...s}),t=new Intl.DateTimeFormat(r,n).formatToParts(e).find(e=>"timezonename"===e.type.toLowerCase());return t?t.value:null}function Vt(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);e=parseInt(t,10)||0,t=r<0||Object.is(r,-0)?-e:e;return 60*r+t}function xt(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u("Invalid unit value "+e);return t}function Et(e,t){var r,n={};for(const s in e)m(e,s)&&null!=(r=e[s])&&(n[t(s)]=xt(r));return n}function Ct(e,t){var r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),s=0<=e?"+":"-";switch(t){case"short":return s+g(r,2)+":"+g(n,2);case"narrow":return s+r+(0(e[t]=r[t],e),{});var r}const Zt=["January","February","March","April","May","June","July","August","September","October","November","December"],Wt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Lt=["J","F","M","A","M","J","J","A","S","O","N","D"];function zt(e){switch(e){case"narrow":return[...Lt];case"short":return[...Wt];case"long":return[...Zt];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 jt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],qt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],At=["M","T","W","T","F","S","S"];function $t(e){switch(e){case"narrow":return[...At];case"short":return[...qt];case"long":return[...jt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ut=["AM","PM"],_t=["Before Christ","Anno Domini"],Yt=["BC","AD"],Rt=["B","A"];function Ht(e){switch(e){case"narrow":return[...Rt];case"short":return[...Yt];case"long":return[..._t];default:return null}}function Pt(e){return Ut[e.hour<12?0:1]}function Jt(e,t){return $t(t)[e.weekday-1]}function Gt(e,t){return zt(t)[e.month-1]}function Bt(e,t){return Ht(t)[e.year<0?0:1]}function Qt(e,t,r="always",n=!1){var 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."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&i){var a="days"===e;switch(t){case 1:return a?"tomorrow":"next "+s[e][0];case-1:return a?"yesterday":"last "+s[e][0];case 0:return a?"today":"this "+s[e][0]}}var r=Object.is(t,-0)||t<0,i=Math.abs(t),t=1===i,o=s[e],n=n?!t&&o[2]||o[1]:t?s[e][0]:e;return r?i+` ${n} ago`:`in ${i} `+n}function Kt(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const Xt={D:A,DD:$,DDD:_,DDDD:Y,t:R,tt:H,ttt:P,tttt:J,T:G,TT:B,TTT:Q,TTTT:K,f:X,ff:te,fff:se,ffff:ae,F:ee,FF:re,FFF:ie,FFFF:oe};class N{static create(e,t={}){return new N(e,t)}static parseFormat(t){let r=null,n="",s=!1;var i=[];for(let e=0;ethis.loc.extract(r,e,t),i=e=>r.isOffsetFixed&&0===r.offset&&e.allowZ?"Z":r.isValid?r.zone.formatOffset(r.ts,e.format):"",a=()=>n?Pt(r):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(e,t)=>n?Gt(r,e):s(t?{month:e}:{month:e,day:"numeric"},"month"),u=(e,t)=>n?Jt(r,e):s(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),l=e=>{var t=N.macroTokenToFormatOpts(e);return t?this.formatWithSystemDefault(r,t):e},c=e=>n?Bt(r,e):s({era:e},"era");return Kt(N.parseFormat(e),e=>{switch(e){case"S":return this.num(r.millisecond);case"u":case"SSS":return this.num(r.millisecond,3);case"s":return this.num(r.second);case"ss":return this.num(r.second,2);case"uu":return this.num(Math.floor(r.millisecond/10),2);case"uuu":return this.num(Math.floor(r.millisecond/100));case"m":return this.num(r.minute);case"mm":return this.num(r.minute,2);case"h":return this.num(r.hour%12==0?12:r.hour%12);case"hh":return this.num(r.hour%12==0?12:r.hour%12,2);case"H":return this.num(r.hour);case"HH":return this.num(r.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return r.zone.offsetName(r.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return r.zone.offsetName(r.ts,{format:"long",locale:this.loc.locale});case"z":return r.zoneName;case"a":return a();case"d":return t?s({day:"numeric"},"day"):this.num(r.day);case"dd":return t?s({day:"2-digit"},"day"):this.num(r.day,2);case"c":return this.num(r.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(r.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return t?s({month:"numeric",day:"numeric"},"month"):this.num(r.month);case"LL":return t?s({month:"2-digit",day:"numeric"},"month"):this.num(r.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return t?s({month:"numeric"},"month"):this.num(r.month);case"MM":return t?s({month:"2-digit"},"month"):this.num(r.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return t?s({year:"numeric"},"year"):this.num(r.year);case"yy":return t?s({year:"2-digit"},"year"):this.num(r.year.toString().slice(-2),2);case"yyyy":return t?s({year:"numeric"},"year"):this.num(r.year,4);case"yyyyyy":return t?s({year:"numeric"},"year"):this.num(r.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(r.weekYear.toString().slice(-2),2);case"kkkk":return this.num(r.weekYear,4);case"W":return this.num(r.weekNumber);case"WW":return this.num(r.weekNumber,2);case"n":return this.num(r.localWeekNumber);case"nn":return this.num(r.localWeekNumber,2);case"ii":return this.num(r.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(r.localWeekYear,4);case"o":return this.num(r.ordinal);case"ooo":return this.num(r.ordinal,3);case"q":return this.num(r.quarter);case"qq":return this.num(r.quarter,2);case"X":return this.num(Math.floor(r.ts/1e3));case"x":return this.num(r.ts);default:return l(e)}})}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=N.parseFormat(t),s=n.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),i=e.shiftTo(...s.map(r).filter(e=>e));return Kt(n,(a=i,e=>{var t=r(e);return t?this.num(a.get(t),e.length):e}));var a}}n=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function D(...e){e=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${e}$`)}function M(...e){return i=>e.reduce(([e,t,r],n)=>{var[n,r,s]=n(i,r);return[{...e,...n},r||t,s]},[{},null,1]).slice(0,2)}function er(e,...t){if(null!=e)for(var[r,n]of t){r=r.exec(e);if(r)return n(r)}return[null,null]}function tr(...s){return(e,t)=>{var r={};let n;for(n=0;nvoid 0!==e&&(t||e&&l)?-e:e;return[{years:c(O(t)),months:c(O(r)),weeks:c(O(n)),days:c(O(s)),hours:c(O(i)),minutes:c(O(a)),seconds:c(O(o),"-0"===o),milliseconds:c(kt(u),e)}]}const mr={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fr(e,t,r,n,s,i,a){t={year:2===t.length?Mt(T(t)):T(t),month:Wt.indexOf(r)+1,day:T(n),hour:T(s),minute:T(i)};return a&&(t.second=T(a)),e&&(t.weekday=3{var r,n;return S(i[t])?e:(e&&(n=i[e]*a,r=s[t][e],n=Math.floor(n/r),i[t]+=n*a,i[e]-=n*r*a),t)},null),I.reduce((e,t)=>{var r;return S(i[t])?e:(e&&(r=i[e]%1,i[e]-=r,i[t]+=r*s[e][t]),t)},null)}function Gr(e){var t,r,n={};for([t,r]of Object.entries(e))0!==r&&(n[t]=r);return n}class x{constructor(e){var t="longterm"===e.conversionAccuracy||!1;let r=t?Rr:Ur;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||w.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return x.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new x({values:Et(e,x.normalizeUnit),loc:w.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(h(e))return x.fromMillis(e);if(x.isDuration(e))return e;if("object"==typeof e)return x.fromObject(e);throw new u(`Unknown duration argument ${e} of type `+typeof e)}static fromISO(e,t){var[r]=Fr(e);return r?x.fromObject(r,t):x.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){var[r]=Wr(e);return r?x.fromObject(r,t):x.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");e=e instanceof l?e:new l(e,t);if(k.throwOnInvalid)throw new j(e);return new x({invalid:e})}static normalizeUnit(e){var 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()];if(t)return t;throw new q(e)}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={}){t={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?N.create(this.loc,t).formatDurationFromString(this,e):Ar}toHuman(r={}){var e;return this.isValid?(e=I.map(e=>{var t=this.values[e];return S(t)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...r,unit:e.slice(0,-1)}).format(t)}).filter(e=>e),this.loc.listFormatter({type:"conjunction",style:r.listStyle||"narrow",...r}).format(e)):Ar}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+=St(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){var t;return!this.isValid||(t=this.toMillis())<0||864e5<=t?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},W.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?Pr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;var t=x.fromDurationLike(e),r={};for(const n of I)(m(t.values,n)||m(this.values,n))&&(r[n]=t.get(n)+this.get(n));return V(this,{values:r},!0)}minus(e){return this.isValid?(e=x.fromDurationLike(e),this.plus(e.negate())):this}mapUnits(e){if(!this.isValid)return this;var t={};for(const r of Object.keys(this.values))t[r]=xt(e(this.values[r],r));return V(this,{values:t},!0)}get(e){return this[x.normalizeUnit(e)]}set(e){return this.isValid?V(this,{values:{...this.values,...Et(e,x.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){e=this.loc.clone({locale:e,numberingSystem:t});return V(this,{loc:e,matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){var e;return this.isValid?(e=this.toObject(),Jr(this.matrix,e),V(this,{values:e},!0)):this}rescale(){var e;return this.isValid?(e=Gr(this.normalize().shiftToAll().toObject()),V(this,{values:e},!0)):this}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>x.normalizeUnit(e));var t={},r={},n=this.toObject();let s;for(const a of I)if(0<=e.indexOf(a)){s=a;let e=0;for(const o in r)e+=this.matrix[o][a]*r[o],r[o]=0;h(n[a])&&(e+=n[a]);var i=Math.trunc(e);t[a]=i,r[a]=(1e3*e-1e3*i)/1e3}else h(n[a])&&(r[a]=n[a]);for(const u in r)0!==r[u]&&(t[s]+=u===s?r[u]:r[u]/this.matrix[s][u]);return Jr(this.matrix,t),V(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;var e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return V(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 I)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 Br="Invalid Interval";function Qr(e,t){return e&&e.isValid?t&&t.isValid?te}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?E.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];var t=e.map(_n).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let n=this["s"],s=0;for(;n+this.e?this.e:i;r.push(E.fromDateTimes(n,i)),n=i,s+=1}return r}splitBy(e){var t=x.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r=this["s"],n=1,s;for(var i=[];re*n));s=+a>+this.e?this.e:a,i.push(E.fromDateTimes(r,s)),r=s,n+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.ee.e?this:e).e,E.fromDateTimes(t,e)):this}static merge(e){var[e,t]=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 t&&e.push(t),e}static xor(e){let t=null,r=0;var n=[],e=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]);for(const s of Array.prototype.concat(...e).sort((e,t)=>e.time-t.time))r+="s"===s.type?1:-1,t=1===r?s.time:(t&&+t!=+s.time&&n.push(E.fromDateTimes(t,s.time)),null);return E.merge(n)}difference(...e){return E.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Br}[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=A,t={}){return this.isValid?N.create(this.s.loc.clone(t),e).formatInterval(this):Br}toISO(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Br}toISODate(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Br}toISOTime(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Br}toFormat(e,{separator:t=" – "}={}){return this.isValid?""+this.s.toFormat(e)+t+this.e.toFormat(e):Br}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):x.invalid(this.invalidReason)}mapEndpoints(e){return E.fromDateTimes(e(this.s),e(this.e))}}class Kr{static hasDST(e=k.defaultZone){var t=W.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return a.isValidZone(e)}static normalizeZone(e){return p(e,k.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||w.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||w.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||w.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||w.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return w.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return w.create(t,null,"gregory").eras(e)}static features(){return{relative:yt(),localeWeek:gt()}}}function Xr(e,t){var r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),t=r(t)-r(e);return Math.floor(x.fromMillis(t).as("days"))}function en(e,t,r,n){let[s,i,a,o]=function(e,t,r){var n,s,i={},a=e;let o,u;for([n,s]of[["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)=>{e=Xr(e,t);return(e-e%7)/7}],["days",Xr]])0<=r.indexOf(n)&&(i[o=n]=s(e,t),(u=a.plus(i))>t?(i[n]--,t<(e=a.plus(i))&&(u=e,i[n]--,e=a.plus(i))):e=u);return[e,i,u,o]}(e,t,r);e=t-s,r=r.filter(e=>0<=["hours","minutes","seconds","milliseconds"].indexOf(e)),0===r.length&&(a=ae){return{regex:e,deser:([e])=>t(function(t){let r=parseInt(t,10);if(isNaN(r)){r="";for(let e=0;ee.findIndex(e=>sn(t)===sn(e))+r}}function an(e,t){return{regex:e,deser:([,e,t])=>Vt(e,t),groups:t}}function on(e){return{regex:e,deser:([e])=>e}}function un(t,r){const n=y(r),s=y(r,"{2}"),i=y(r,"{3}"),a=y(r,"{4}"),o=y(r,"{6}"),u=y(r,"{1,2}"),l=y(r,"{1,3}"),c=y(r,"{1,6}"),h=y(r,"{1,9}"),d=y(r,"{2,4}"),m=y(r,"{4,6}"),f=e=>({regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:([e])=>e,literal:!0});var e=(e=>{if(t.literal)return f(e);switch(e.val){case"G":return F(r.eras("short"),0);case"GG":return F(r.eras("long"),0);case"y":return C(c);case"yy":return C(d,Mt);case"yyyy":return C(a);case"yyyyy":return C(m);case"yyyyyy":return C(o);case"M":return C(u);case"MM":return C(s);case"MMM":return F(r.months("short",!0),1);case"MMMM":return F(r.months("long",!0),1);case"L":return C(u);case"LL":return C(s);case"LLL":return F(r.months("short",!1),1);case"LLLL":return F(r.months("long",!1),1);case"d":return C(u);case"dd":return C(s);case"o":return C(l);case"ooo":return C(i);case"HH":return C(s);case"H":return C(u);case"hh":return C(s);case"h":return C(u);case"mm":return C(s);case"m":case"q":return C(u);case"qq":return C(s);case"s":return C(u);case"ss":return C(s);case"S":return C(l);case"SSS":return C(i);case"u":return on(h);case"uu":return on(u);case"uuu":return C(n);case"a":return F(r.meridiems(),0);case"kkkk":return C(a);case"kk":return C(d,Mt);case"W":return C(u);case"WW":return C(s);case"E":case"c":return C(n);case"EEE":return F(r.weekdays("short",!1),1);case"EEEE":return F(r.weekdays("long",!1),1);case"ccc":return F(r.weekdays("short",!0),1);case"cccc":return F(r.weekdays("long",!0),1);case"Z":case"ZZ":return an(new RegExp(`([+-]${u.source})(?::(${s.source}))?`),2);case"ZZZ":return an(new RegExp(`([+-]${u.source})(${s.source})?`),2);case"z":return on(/[a-z_+-/]{1,256}?/i);case" ":return on(/[^\S\n\r]/);default:return f(e)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return e.token=t,e}const ln={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"}};function cn(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,e]}function hn(e,t,r){var n=e.match(t);if(n){var s,i,a={};let e=1;for(const o in r)m(r,o)&&(i=(s=r[o]).groups?s.groups+1:1,!s.literal&&s.token&&(a[s.token.val[0]]=s.deser(n.slice(e,e+i))),e+=i);return[n,a]}return[n,{}]}function dn(n){let e=null,t;return S(n.z)||(e=a.create(n.z)),S(n.Z)||(e=e||new d(n.Z),t=n.Z),S(n.q)||(n.M=3*(n.q-1)+1),S(n.h)||(n.h<12&&1===n.a?n.h+=12:12===n.h&&0===n.a&&(n.h=0)),0===n.G&&n.y&&(n.y=-n.y),S(n.u)||(n.S=kt(n.u)),[Object.keys(n).reduce((e,t)=>{var r=(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}})(t);return r&&(e[r]=n[t]),e},{}),e,t]}let mn=null;function fn(e,r){return Array.prototype.concat(...e.map(e=>{return t=r,(e=e).literal||null==(t=wn(N.macroTokenToFormatOpts(e.val),t))||t.includes(void 0)?e:t;var t}))}class yn{constructor(t,e){var r;this.locale=t,this.format=e,this.tokens=fn(N.parseFormat(e),t),this.units=this.tokens.map(e=>un(e,t)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),this.disqualifyingUnit||([e,r]=cn(this.units),this.regex=RegExp(e,"i"),this.handlers=r)}explainFromTokens(e){if(this.isValid){var[t,r]=hn(e,this.regex,this.handlers),[n,s,i]=r?dn(r):[null,null,void 0];if(m(r,"a")&&m(r,"H"))throw new v("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:s,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 gn(e,t,r){return new yn(e,r).explainFromTokens(t)}function vn(e,t,r){var{result:e,zone:t,specificOffset:r,invalidReason:n}=gn(e,t,r);return[e,t,r,n]}function wn(o,e){if(!o)return null;var e=N.create(e,o).dtFormatter(mn=mn||W.fromMillis(1555555555555)),t=e.formatToParts();const u=e.resolvedOptions();return t.map(r=>{{var n=o,s=u,{type:r,value:i}=r;if("literal"===r)return{literal:!(a=/^\s+$/.test(i)),val:a?" ":i};var a=n[r];let e=r,t=("hour"===r&&(e=null!=n.hour12?n.hour12?"hour12":"hour24":null!=n.hourCycle?"h11"===n.hourCycle||"h12"===n.hourCycle?"hour12":"hour24":s.hour12?"hour12":"hour24"),ln[e]);return(t="object"==typeof t?t[a]:t)?{literal:!1,val:t}:void 0}})}const pn="Invalid DateTime";function kn(e){return new l("unsupported zone",`the zone "${e.name}" is not supported`)}function Sn(e){return null===e.weekData&&(e.weekData=st(e.c)),e.weekData}function Tn(e){return null===e.localWeekData&&(e.localWeekData=st(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Z(e,t){e={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new W({...e,...t,old:e})}function On(e,t,r){var n=e-60*t*1e3,s=r.offset(n);return t===s?[n,t]:s===(r=r.offset(n-=60*(s-t)*1e3))?[n,s]:[e-60*Math.min(s,r)*1e3,Math.max(s,r)]}function bn(e,t){e+=60*t*1e3;t=new Date(e);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Nn(e,t,r){return On(bt(e),t,r)}function Dn(e,t){var r=e.o,n=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),n={...e.c,year:n,month:s,day:Math.min(e.c.day,Ot(n,s))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},s=x.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds");let[i,a]=On(bt(n),r,e.zone);return 0!==s&&(i+=s,a=e.zone.offset(i)),{ts:i,o:a}}function Mn(e,t,r,n,s,i){var{setZone:a,zone:o}=r;return e&&0!==Object.keys(e).length||t?(t=t||o,e=W.fromObject(e,{...r,zone:t,specificOffset:i}),a?e:e.setZone(o)):W.invalid(new l("unparsable",`the input "${s}" can't be parsed as `+n))}function In(e,t,r=!0){return e.isValid?N.create(w.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Vn(e,t){var r=9999{return e=St(e,s||n.calendary?0:2,!0),r.loc.clone(n).relFormatter(n).format(e,t)},i=e=>n.calendary?r.hasSame(t,e)?0:r.startOf(e).diff(t.startOf(e),e).get(e):r.diff(t,e).get(e);if(n.unit)return e(i(n.unit),n.unit);for(const o of n.units){var a=i(o);if(1<=Math.abs(a))return e(a,o)}return e(re?e.val:null).join(""):null}static expandFormat(e,t={}){return fn(N.parseFormat(e),w.fromObject(t)).map(e=>e.val).join("")}static resetCache(){$n=void 0,Un={}}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Sn(this).weekYear:NaN}get weekNumber(){return this.isValid?Sn(this).weekNumber:NaN}get weekday(){return this.isValid?Sn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Tn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Tn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Tn(this).weekYear:NaN}get ordinal(){return this.isValid?at(this.c).ordinal:NaN}get monthShort(){return this.isValid?Kr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Kr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Kr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Kr.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){var e,t,r,n;return this.isValid&&!this.isOffsetFixed&&(e=bt(this.c),r=this.zone.offset(e-864e5),n=this.zone.offset(e+864e5),(r=this.zone.offset(e-6e4*r))!==(n=this.zone.offset(e-6e4*n)))&&(t=e-6e4*n,r=bn(e=e-6e4*r,r),n=bn(t,n),r.hour===n.hour)&&r.minute===n.minute&&r.second===n.second&&r.millisecond===n.millisecond?[Z(this,{ts:e}),Z(this,{ts:t})]:[this]}get isInLeapYear(){return Tt(this.year)}get daysInMonth(){return Ot(this.year,this.month)}get daysInYear(){return this.isValid?b(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Dt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){var{locale:e,numberingSystem:t,calendar:r}=N.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:e,numberingSystem:t,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(d.instance(e),t)}toLocal(){return this.setZone(k.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if((t=p(t,k.defaultZone)).equals(this.zone))return this;if(t.isValid){let e=this.ts;return(r||n)&&(r=t.offset(this.ts),n=this.toObject(),[e]=Nn(n,r,t)),Z(this,{ts:e,zone:t})}return W.invalid(kn(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){e=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return Z(this,{loc:e})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;var e=Et(e,zn),{minDaysInFirstWeek:t,startOfWeek:r}=ut(e,this.loc),n=!S(e.weekYear)||!S(e.weekNumber)||!S(e.weekday),s=!S(e.ordinal),i=!S(e.year),a=!S(e.month)||!S(e.day),o=e.weekYear||e.weekNumber;if((i||a||s)&&o)throw new v("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new v("Can't mix ordinal dates with month/day");let u;n?u=it({...st(this.c,t,r),...e},t,r):S(e.ordinal)?(u={...this.toObject(),...e},S(e.day)&&(u.day=Math.min(Ot(u.year,u.month),u.day))):u=ot({...at(this.c),...e});var[i,o]=Nn(u,this.o,this.zone);return Z(this,{ts:i,o:o})}plus(e){return this.isValid?Z(this,Dn(this,x.fromDurationLike(e))):this}minus(e){return this.isValid?Z(this,Dn(this,x.fromDurationLike(e).negate())):this}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;var r,n={},e=x.normalizeUnit(e);switch(e){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}return"weeks"===e&&(t?(t=this.loc.getStartOfWeek(),r=this["weekday"],rthis.valueOf())?this:e,n?e:this,t,r),n?e.negate():e):x.invalid("created by diffing an invalid DateTime")}diffNow(e="milliseconds",t={}){return this.diff(W.now(),e,t)}until(e){return this.isValid?E.fromDateTimes(this,e):this}hasSame(e,t,r){var n;return!!this.isValid&&(n=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,r)<=n)&&n<=e.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;var t=e.base||W.fromObject({},{zone:this.zone}),r=e.padding?thise.valueOf(),Math.min);throw new u("min requires all arguments be DateTimes")}static max(...e){if(e.every(W.isDateTime))return wt(e,e=>e.valueOf(),Math.max);throw new u("max requires all arguments be DateTimes")}static fromFormatExplain(e,t,r={}){var{locale:r=null,numberingSystem:n=null}=r;return gn(w.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return W.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){var{locale:t=null,numberingSystem:r=null}=t,t=w.fromOpts({locale:t,numberingSystem:r,defaultToEN:!0});return new yn(t,e)}static fromFormatParser(e,t,r={}){if(S(e)||S(t))throw new u("fromFormatParser requires an input string and a format parser");var n,s,i,{locale:a=null,numberingSystem:o=null}=r,a=w.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});if(a.equals(t.locale))return{result:o,zone:n,specificOffset:s,invalidReason:i}=t.explainFromTokens(e),i?W.invalid(i):Mn(o,n,r,"format "+t.format,e,s);throw new u(`fromFormatParser called with a locale of ${a}, `+"but the format parser was created for "+t.locale)}static get DATE_SHORT(){return A}static get DATE_MED(){return $}static get DATE_MED_WITH_WEEKDAY(){return U}static get DATE_FULL(){return _}static get DATE_HUGE(){return Y}static get TIME_SIMPLE(){return R}static get TIME_WITH_SECONDS(){return H}static get TIME_WITH_SHORT_OFFSET(){return P}static get TIME_WITH_LONG_OFFSET(){return J}static get TIME_24_SIMPLE(){return G}static get TIME_24_WITH_SECONDS(){return B}static get TIME_24_WITH_SHORT_OFFSET(){return Q}static get TIME_24_WITH_LONG_OFFSET(){return K}static get DATETIME_SHORT(){return X}static get DATETIME_SHORT_WITH_SECONDS(){return ee}static get DATETIME_MED(){return te}static get DATETIME_MED_WITH_SECONDS(){return re}static get DATETIME_MED_WITH_WEEKDAY(){return ne}static get DATETIME_FULL(){return se}static get DATETIME_FULL_WITH_SECONDS(){return ie}static get DATETIME_HUGE(){return ae}static get DATETIME_HUGE_WITH_SECONDS(){return oe}}function _n(e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&h(e.valueOf()))return W.fromJSDate(e);if(e&&"object"==typeof e)return W.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type `+typeof e)}s="3.5.0";export{W as DateTime,x as Duration,d as FixedOffsetZone,a as IANAZone,Kr as Info,E as Interval,qe as InvalidZone,k as Settings,le as SystemZone,s as VERSION,i as Zone}; \ No newline at end of file diff --git a/thrimbletrimmer/src/globalStyle.scss b/thrimbletrimmer/src/globalStyle.scss index e7fc76e..35998a3 100644 --- a/thrimbletrimmer/src/globalStyle.scss +++ b/thrimbletrimmer/src/globalStyle.scss @@ -1,3 +1,3 @@ .hidden { display: none; -} \ No newline at end of file +} diff --git a/thrimbletrimmer/src/thumbnails/ThumbnailManager.module.scss b/thrimbletrimmer/src/thumbnails/ThumbnailManager.module.scss index d941b5b..a1ca0a3 100644 --- a/thrimbletrimmer/src/thumbnails/ThumbnailManager.module.scss +++ b/thrimbletrimmer/src/thumbnails/ThumbnailManager.module.scss @@ -44,4 +44,4 @@ .newTemplateMidText { margin: 2px; -} \ No newline at end of file +} diff --git a/thrimbletrimmer/src/thumbnails/ThumbnailManager.tsx b/thrimbletrimmer/src/thumbnails/ThumbnailManager.tsx index 9c7f783..432f9a6 100644 --- a/thrimbletrimmer/src/thumbnails/ThumbnailManager.tsx +++ b/thrimbletrimmer/src/thumbnails/ThumbnailManager.tsx @@ -41,13 +41,19 @@ const ThumbnailManager: Component = () => { cropStart: cropStart, cropEnd: cropEnd, locationStart: locationStart, - locationEnd: locationEnd + locationEnd: locationEnd, }); } setTemplates(templateList); }); - const submitHandler = async (origName: string, noImageIsError: boolean, errorList: Accessor, setErrorList: Setter, event: SubmitEvent): Promise