@anoki/fse-ui 1.0.761 → 1.0.762
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs211.js +1 -1
- package/dist/index.cjs211.js.map +1 -1
- package/dist/index.cjs215.js +1 -1
- package/dist/index.cjs215.js.map +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs270.js +1 -1
- package/dist/index.cjs283.js +1 -1
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs295.js +1 -1
- package/dist/index.cjs370.js +1 -1
- package/dist/index.cjs371.js +1 -1
- package/dist/index.cjs381.js +1 -1
- package/dist/index.cjs389.js +1 -1
- package/dist/index.cjs390.js +3 -12
- package/dist/index.cjs390.js.map +1 -1
- package/dist/index.cjs391.js +27 -1
- package/dist/index.cjs391.js.map +1 -1
- package/dist/index.cjs392.js +1 -2
- package/dist/index.cjs392.js.map +1 -1
- package/dist/index.cjs393.js +1 -27
- package/dist/index.cjs393.js.map +1 -1
- package/dist/index.cjs394.js +1 -1
- package/dist/index.cjs394.js.map +1 -1
- package/dist/index.cjs395.js +2 -1
- package/dist/index.cjs395.js.map +1 -1
- package/dist/index.cjs399.js +1 -1
- package/dist/index.cjs401.js +1 -1
- package/dist/index.cjs402.js +1 -1
- package/dist/index.cjs408.js +1 -1
- package/dist/index.cjs409.js +1 -1
- package/dist/index.cjs410.js +1 -1
- package/dist/index.cjs410.js.map +1 -1
- package/dist/index.cjs412.js +1 -1
- package/dist/index.cjs412.js.map +1 -1
- package/dist/index.cjs416.js +1 -1
- package/dist/index.cjs417.js +1 -1
- package/dist/index.cjs418.js +1 -1
- package/dist/index.cjs431.js +2 -0
- package/dist/index.cjs431.js.map +1 -0
- package/dist/index.cjs432.js +2 -0
- package/dist/index.cjs432.js.map +1 -0
- package/dist/{index.cjs437.js → index.cjs433.js} +1 -1
- package/dist/{index.cjs437.js.map → index.cjs433.js.map} +1 -1
- package/dist/{index.cjs438.js → index.cjs434.js} +2 -2
- package/dist/{index.cjs438.js.map → index.cjs434.js.map} +1 -1
- package/dist/index.cjs435.js +1 -1
- package/dist/index.cjs435.js.map +1 -1
- package/dist/index.cjs436.js +1 -1
- package/dist/index.cjs436.js.map +1 -1
- package/dist/index.cjs441.js +1 -1
- package/dist/index.cjs457.js +1 -1
- package/dist/index.cjs458.js +1 -1
- package/dist/index.cjs463.js +2 -0
- package/dist/index.cjs463.js.map +1 -0
- package/dist/index.cjs464.js +2 -0
- package/dist/index.cjs464.js.map +1 -0
- package/dist/index.cjs465.js +1 -1
- package/dist/index.cjs465.js.map +1 -1
- package/dist/index.cjs466.js +1 -1
- package/dist/index.cjs466.js.map +1 -1
- package/dist/index.cjs469.js +1 -1
- package/dist/index.cjs472.js +1 -1
- package/dist/index.cjs479.js +1 -1
- package/dist/index.cjs480.js +2 -0
- package/dist/index.cjs480.js.map +1 -0
- package/dist/index.cjs481.js +2 -0
- package/dist/index.cjs481.js.map +1 -0
- package/dist/index.cjs482.js +1 -1
- package/dist/index.cjs482.js.map +1 -1
- package/dist/index.cjs483.js +1 -1
- package/dist/index.cjs483.js.map +1 -1
- package/dist/index.cjs496.js +1 -1
- package/dist/index.es197.js +76 -71
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +11 -1
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es202.js +63 -58
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es211.js +29 -26
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es215.js +18 -15
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es220.js +1 -1
- package/dist/index.es227.js +2 -2
- package/dist/index.es23.js +25 -15
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es270.js +1 -1
- package/dist/index.es283.js +1 -1
- package/dist/index.es288.js +1 -1
- package/dist/index.es295.js +1 -1
- package/dist/index.es370.js +2 -2
- package/dist/index.es371.js +3 -3
- package/dist/index.es381.js +1 -1
- package/dist/index.es389.js +1 -1
- package/dist/index.es390.js +146 -307
- package/dist/index.es390.js.map +1 -1
- package/dist/index.es391.js +3674 -5
- package/dist/index.es391.js.map +1 -1
- package/dist/index.es392.js +5 -520
- package/dist/index.es392.js.map +1 -1
- package/dist/index.es393.js +2 -3675
- package/dist/index.es393.js.map +1 -1
- package/dist/index.es394.js +5 -5
- package/dist/index.es394.js.map +1 -1
- package/dist/index.es395.js +521 -2
- package/dist/index.es395.js.map +1 -1
- package/dist/index.es399.js +1 -1
- package/dist/index.es401.js +5 -5
- package/dist/index.es402.js +1 -1
- package/dist/index.es408.js +1 -1
- package/dist/index.es409.js +1 -1
- package/dist/index.es410.js +2 -15
- package/dist/index.es410.js.map +1 -1
- package/dist/index.es411.js +2 -2
- package/dist/index.es412.js +15 -2
- package/dist/index.es412.js.map +1 -1
- package/dist/index.es416.js +1 -1
- package/dist/index.es417.js +1 -1
- package/dist/index.es418.js +1 -1
- package/dist/index.es431.js +14 -0
- package/dist/index.es431.js.map +1 -0
- package/dist/index.es432.js +49 -0
- package/dist/index.es432.js.map +1 -0
- package/dist/{index.es437.js → index.es433.js} +1 -1
- package/dist/{index.es437.js.map → index.es433.js.map} +1 -1
- package/dist/{index.es438.js → index.es434.js} +3 -3
- package/dist/{index.es438.js.map → index.es434.js.map} +1 -1
- package/dist/index.es435.js +177 -10
- package/dist/index.es435.js.map +1 -1
- package/dist/index.es436.js +4 -46
- package/dist/index.es436.js.map +1 -1
- package/dist/index.es441.js +1 -1
- package/dist/index.es457.js +1 -1
- package/dist/index.es458.js +1 -1
- package/dist/index.es463.js +26 -0
- package/dist/index.es463.js.map +1 -0
- package/dist/index.es464.js +16 -0
- package/dist/index.es464.js.map +1 -0
- package/dist/index.es465.js +25 -20
- package/dist/index.es465.js.map +1 -1
- package/dist/index.es466.js +4 -12
- package/dist/index.es466.js.map +1 -1
- package/dist/index.es469.js +2 -2
- package/dist/index.es472.js +1 -1
- package/dist/index.es479.js +3 -3
- package/dist/index.es480.js +13 -0
- package/dist/index.es480.js.map +1 -0
- package/dist/index.es481.js +181 -0
- package/dist/index.es481.js.map +1 -0
- package/dist/index.es482.js +3 -9
- package/dist/index.es482.js.map +1 -1
- package/dist/index.es483.js +126 -171
- package/dist/index.es483.js.map +1 -1
- package/dist/index.es496.js +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/package.json +1 -1
- package/dist/index.cjs439.js +0 -2
- package/dist/index.cjs439.js.map +0 -1
- package/dist/index.cjs440.js +0 -2
- package/dist/index.cjs440.js.map +0 -1
- package/dist/index.cjs467.js +0 -2
- package/dist/index.cjs467.js.map +0 -1
- package/dist/index.cjs468.js +0 -2
- package/dist/index.cjs468.js.map +0 -1
- package/dist/index.cjs484.js +0 -2
- package/dist/index.cjs484.js.map +0 -1
- package/dist/index.cjs485.js +0 -2
- package/dist/index.cjs485.js.map +0 -1
- package/dist/index.es439.js +0 -181
- package/dist/index.es439.js.map +0 -1
- package/dist/index.es440.js +0 -7
- package/dist/index.es440.js.map +0 -1
- package/dist/index.es467.js +0 -31
- package/dist/index.es467.js.map +0 -1
- package/dist/index.es468.js +0 -8
- package/dist/index.es468.js.map +0 -1
- package/dist/index.es484.js +0 -7
- package/dist/index.es484.js.map +0 -1
- package/dist/index.es485.js +0 -136
- package/dist/index.es485.js.map +0 -1
- /package/dist/components/ui/{ConsentModal/ConsentModalFooter/ConsentModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
package/dist/index.cjs198.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";const o=require("./index.cjs197.js"),h=require("./index.cjs3.js"),v=require("./index.cjs4.js"),m=require("./index.cjs209.js"),V=require("./index.cjs210.js"),S=require("./index.cjs200.js"),O=require("./index.cjs208.js"),f="Invalid Interval";function D(c,t){return!c||!c.isValid?a.invalid("missing or invalid start"):!t||!t.isValid?a.invalid("missing or invalid end"):t<c?a.invalid("end before start",`The end of an interval must be after its start, but you had start=${c.toISO()} and end=${t.toISO()}`):null}class a{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,i=null){if(!t)throw new m.InvalidArgumentError("need to specify a reason the Interval is invalid");const e=t instanceof V?t:new V(t,i);if(v.throwOnInvalid)throw new m.InvalidIntervalError(e);return new a({invalid:e})}static fromDateTimes(t,i){const e=o.friendlyDateTime(t),s=o.friendlyDateTime(i),r=D(e,s);return r??new a({start:e,end:s})}static after(t,i){const e=h.default.fromDurationLike(i),s=o.friendlyDateTime(t);return a.fromDateTimes(s,s.plus(e))}static before(t,i){const e=h.default.fromDurationLike(i),s=o.friendlyDateTime(t);return a.fromDateTimes(s.minus(e),s)}static fromISO(t,i){const[e,s]=(t||"").split("/",2);if(e&&s){let r,n;try{r=o.default.fromISO(e,i),n=r.isValid}catch{n=!1}let u,l;try{u=o.default.fromISO(s,i),l=u.isValid}catch{l=!1}if(n&&l)return a.fromDateTimes(r,u);if(n){const d=h.default.fromISO(s,i);if(d.isValid)return a.after(r,d)}else if(l){const d=h.default.fromISO(e,i);if(d.isValid)return a.before(u,d)}}return a.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",i){if(!this.isValid)return NaN;const e=this.start.startOf(t,i);let s;return i!=null&&i.useLocaleWeeks?s=this.end.reconfigure({locale:e.locale}):s=this.end,s=s.startOf(t,i),Math.floor(s.diff(e,t).get(t))+(s.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:i}={}){return this.isValid?a.fromDateTimes(t||this.s,i||this.e):this}splitAt(...t){if(!this.isValid)return[];const i=t.map(o.friendlyDateTime).filter(n=>this.contains(n)).sort((n,u)=>n.toMillis()-u.toMillis()),e=[];let{s}=this,r=0;for(;s<this.e;){const n=i[r]||this.e,u=+n>+this.e?this.e:n;e.push(a.fromDateTimes(s,u)),s=u,r+=1}return e}splitBy(t){const i=h.default.fromDurationLike(t);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:e}=this,s=1,r;const n=[];for(;e<this.e;){const u=this.start.plus(i.mapUnits(l=>l*s));r=+u>+this.e?this.e:u,n.push(a.fromDateTimes(e,r)),e=r,s+=1}return n}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const i=this.s>t.s?this.s:t.s,e=this.e<t.e?this.e:t.e;return i>=e?null:a.fromDateTimes(i,e)}union(t){if(!this.isValid)return this;const i=this.s<t.s?this.s:t.s,e=this.e>t.e?this.e:t.e;return a.fromDateTimes(i,e)}static merge(t){const[i,e]=t.sort((s,r)=>s.s-r.s).reduce(([s,r],n)=>r?r.overlaps(n)||r.abutsStart(n)?[s,r.union(n)]:[s.concat([r]),n]:[s,n],[[],null]);return e&&i.push(e),i}static xor(t){let i=null,e=0;const s=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),n=Array.prototype.concat(...r),u=n.sort((l,d)=>l.time-d.time);for(const l of u)e+=l.type==="s"?1:-1,e===1?i=l.time:(i&&+i!=+l.time&&s.push(a.fromDateTimes(i,l.time)),i=null);return a.merge(s)}difference(...t){return a.xor([this].concat(t)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:f}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=O.DATE_SHORT,i={}){return this.isValid?S.create(this.s.loc.clone(i),t).formatInterval(this):f}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:f}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:f}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:f}toFormat(t,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${i}${this.e.toFormat(t)}`:f}toDuration(t,i){return this.isValid?this.e.diff(this.s,t,i):h.default.invalid(this.invalidReason)}mapEndpoints(t){return a.fromDateTimes(t(this.s),t(this.e))}}module.exports=a;
|
1
|
+
"use strict";const o=require("./index.cjs197.js"),h=require("./index.cjs3.js"),v=require("./index.cjs4.js"),m=require("./index.cjs209.js"),V=require("./index.cjs210.js"),S=require("./index.cjs200.js"),O=require("./index.cjs208.js"),f="Invalid Interval";function D(c,t){return!c||!c.isValid?a.invalid("missing or invalid start"):!t||!t.isValid?a.invalid("missing or invalid end"):t<c?a.invalid("end before start",`The end of an interval must be after its start, but you had start=${c.toISO()} and end=${t.toISO()}`):null}class a{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,i=null){if(!t)throw new m.InvalidArgumentError("need to specify a reason the Interval is invalid");const e=t instanceof V?t:new V(t,i);if(v.throwOnInvalid)throw new m.InvalidIntervalError(e);return new a({invalid:e})}static fromDateTimes(t,i){const e=o.friendlyDateTime(t),s=o.friendlyDateTime(i),r=D(e,s);return r??new a({start:e,end:s})}static after(t,i){const e=h.default.fromDurationLike(i),s=o.friendlyDateTime(t);return a.fromDateTimes(s,s.plus(e))}static before(t,i){const e=h.default.fromDurationLike(i),s=o.friendlyDateTime(t);return a.fromDateTimes(s.minus(e),s)}static fromISO(t,i){const[e,s]=(t||"").split("/",2);if(e&&s){let r,n;try{r=o.default.fromISO(e,i),n=r.isValid}catch{n=!1}let u,l;try{u=o.default.fromISO(s,i),l=u.isValid}catch{l=!1}if(n&&l)return a.fromDateTimes(r,u);if(n){const d=h.default.fromISO(s,i);if(d.isValid)return a.after(r,d)}else if(l){const d=h.default.fromISO(e,i);if(d.isValid)return a.before(u,d)}}return a.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",i){if(!this.isValid)return NaN;const e=this.start.startOf(t,i);let s;return i!=null&&i.useLocaleWeeks?s=this.end.reconfigure({locale:e.locale}):s=this.end,s=s.startOf(t,i),Math.floor(s.diff(e,t).get(t))+(s.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:i}={}){return this.isValid?a.fromDateTimes(t||this.s,i||this.e):this}splitAt(...t){if(!this.isValid)return[];const i=t.map(o.friendlyDateTime).filter(n=>this.contains(n)).sort((n,u)=>n.toMillis()-u.toMillis()),e=[];let{s}=this,r=0;for(;s<this.e;){const n=i[r]||this.e,u=+n>+this.e?this.e:n;e.push(a.fromDateTimes(s,u)),s=u,r+=1}return e}splitBy(t){const i=h.default.fromDurationLike(t);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:e}=this,s=1,r;const n=[];for(;e<this.e;){const u=this.start.plus(i.mapUnits(l=>l*s));r=+u>+this.e?this.e:u,n.push(a.fromDateTimes(e,r)),e=r,s+=1}return n}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const i=this.s>t.s?this.s:t.s,e=this.e<t.e?this.e:t.e;return i>=e?null:a.fromDateTimes(i,e)}union(t){if(!this.isValid)return this;const i=this.s<t.s?this.s:t.s,e=this.e>t.e?this.e:t.e;return a.fromDateTimes(i,e)}static merge(t){const[i,e]=t.sort((s,r)=>s.s-r.s).reduce(([s,r],n)=>r?r.overlaps(n)||r.abutsStart(n)?[s,r.union(n)]:[s.concat([r]),n]:[s,n],[[],null]);return e&&i.push(e),i}static xor(t){let i=null,e=0;const s=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),n=Array.prototype.concat(...r),u=n.sort((l,d)=>l.time-d.time);for(const l of u)e+=l.type==="s"?1:-1,e===1?i=l.time:(i&&+i!=+l.time&&s.push(a.fromDateTimes(i,l.time)),i=null);return a.merge(s)}difference(...t){return a.xor([this].concat(t)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:f}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=O.DATE_SHORT,i={}){return this.isValid?S.create(this.s.loc.clone(i),t).formatInterval(this):f}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:f}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:f}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:f}toFormat(t,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${i}${this.e.toFormat(t)}`:f}toDuration(t,i){return this.isValid?this.e.diff(this.s,t,i):h.default.invalid(this.invalidReason)}mapEndpoints(t){return a.fromDateTimes(t(this.s),t(this.e))}}module.exports=a;
|
2
2
|
//# sourceMappingURL=index.cjs198.js.map
|
package/dist/index.cjs198.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs198.js","sources":["../node_modules/luxon/src/interval.js"],"sourcesContent":["import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n"],"names":["INVALID","validateStartEnd","start","end","Interval","config","reason","explanation","InvalidArgumentError","invalid","Invalid","Settings","InvalidIntervalError","builtStart","friendlyDateTime","builtEnd","validateError","duration","dur","Duration","dt","text","opts","s","e","startIsValid","DateTime","endIsValid","o","unit","dateTime","dateTimes","sorted","d","a","b","results","i","added","next","idx","x","numberOfParts","other","intervals","found","final","sofar","current","item","currentCount","ends","flattened","arr","formatOpts","Formats.DATE_SHORT","Formatter","dateFormat","separator","mapFn"],"mappings":"wOAQMA,EAAU,mBAGhB,SAASC,EAAi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,MAAMA,CAAI,CAAC,IAAI,KAAK,EAAE,MAAMA,CAAI,CAAC,GADxBtB,CAE9B,CAQE,WAAY,CACV,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,UAAS,CAAE,IAAI,KAAK,EAAE,UAAS,CAAE,GADxBA,CAE9B,CASE,UAAUsB,EAAM,CACd,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,UAAUA,CAAI,CAAC,IAAI,KAAK,EAAE,UAAUA,CAAI,CAAC,GADhCtB,CAE9B,CAaE,SAASyD,EAAY,CAAE,UAAAC,EAAY,KAAK,EAAK,CAAA,EAAI,CAC/C,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,SAASD,CAAU,CAAC,GAAGC,CAAS,GAAG,KAAK,EAAE,SAASD,CAAU,CAAC,GADrDzD,CAE9B,CAcE,WAAW6B,EAAMP,EAAM,CACrB,OAAK,KAAK,QAGH,KAAK,EAAE,KAAK,KAAK,EAAGO,EAAMP,CAAI,EAF5BH,UAAS,QAAQ,KAAK,aAAa,CAGhD,CASE,aAAawC,EAAO,CAClB,OAAOvD,EAAS,cAAcuD,EAAM,KAAK,CAAC,EAAGA,EAAM,KAAK,CAAC,CAAC,CAC9D,CACA","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs198.js","sources":["../node_modules/luxon/src/interval.js"],"sourcesContent":["import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n"],"names":["INVALID","validateStartEnd","start","end","Interval","config","reason","explanation","InvalidArgumentError","invalid","Invalid","Settings","InvalidIntervalError","builtStart","friendlyDateTime","builtEnd","validateError","duration","dur","Duration","dt","text","opts","s","e","startIsValid","DateTime","endIsValid","o","unit","dateTime","dateTimes","sorted","d","a","b","results","i","added","next","idx","x","numberOfParts","other","intervals","found","final","sofar","current","item","currentCount","ends","flattened","arr","formatOpts","Formats.DATE_SHORT","Formatter","dateFormat","separator","mapFn"],"mappings":"wOAQMA,EAAU,mBAGhB,SAASC,EAAiBC,EAAOC,EAAK,CACpC,MAAI,CAACD,GAAS,CAACA,EAAM,QACZE,EAAS,QAAQ,0BAA0B,EACzC,CAACD,GAAO,CAACA,EAAI,QACfC,EAAS,QAAQ,wBAAwB,EACvCD,EAAMD,EACRE,EAAS,QACd,mBACA,qEAAqEF,EAAM,MAAK,CAAE,YAAYC,EAAI,OAAO,EAC1G,EAEM,IAEX,CAce,MAAMC,CAAS,CAI5B,YAAYC,EAAQ,CAIlB,KAAK,EAAIA,EAAO,MAIhB,KAAK,EAAIA,EAAO,IAIhB,KAAK,QAAUA,EAAO,SAAW,KAIjC,KAAK,gBAAkB,EAC3B,CAQE,OAAO,QAAQC,EAAQC,EAAc,KAAM,CACzC,GAAI,CAACD,EACH,MAAM,IAAIE,EAAoB,qBAAC,kDAAkD,EAGnF,MAAMC,EAAUH,aAAkBI,EAAUJ,EAAS,IAAII,EAAQJ,EAAQC,CAAW,EAEpF,GAAII,EAAS,eACX,MAAM,IAAIC,EAAoB,qBAACH,CAAO,EAEtC,OAAO,IAAIL,EAAS,CAAEK,QAAAA,EAAS,CAErC,CAQE,OAAO,cAAcP,EAAOC,EAAK,CAC/B,MAAMU,EAAaC,EAAgB,iBAACZ,CAAK,EACvCa,EAAWD,EAAgB,iBAACX,CAAG,EAE3Ba,EAAgBf,EAAiBY,EAAYE,CAAQ,EAE3D,OAAIC,GACK,IAAIZ,EAAS,CAClB,MAAOS,EACP,IAAKE,CACb,CAAO,CAIP,CAQE,OAAO,MAAMb,EAAOe,EAAU,CAC5B,MAAMC,EAAMC,EAAAA,QAAS,iBAAiBF,CAAQ,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I,KAAK,QACA,qBAAqB,KAAK,EAAE,MAAK,CAAE,UAAU,KAAK,EAAE,MAAK,CAAE,KAE3D,+BAA+B,KAAK,aAAa,IAE9D,CAoBE,eAAesD,EAAaC,aAAoBjC,EAAO,CAAA,EAAI,CACzD,OAAO,KAAK,QACRkC,EAAU,OAAO,KAAK,EAAE,IAAI,MAAMlC,CAAI,EAAGgC,CAAU,EAAE,eAAe,IAAI,EACxEtD,CACR,CAQE,MAAMsB,EAAM,CACV,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,MAAMA,CAAI,CAAC,IAAI,KAAK,EAAE,MAAMA,CAAI,CAAC,GADxBtB,CAE9B,CAQE,WAAY,CACV,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,UAAS,CAAE,IAAI,KAAK,EAAE,UAAS,CAAE,GADxBA,CAE9B,CASE,UAAUsB,EAAM,CACd,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,UAAUA,CAAI,CAAC,IAAI,KAAK,EAAE,UAAUA,CAAI,CAAC,GADhCtB,CAE9B,CAaE,SAASyD,EAAY,CAAE,UAAAC,EAAY,KAAK,EAAK,CAAA,EAAI,CAC/C,OAAK,KAAK,QACH,GAAG,KAAK,EAAE,SAASD,CAAU,CAAC,GAAGC,CAAS,GAAG,KAAK,EAAE,SAASD,CAAU,CAAC,GADrDzD,CAE9B,CAcE,WAAW6B,EAAMP,EAAM,CACrB,OAAK,KAAK,QAGH,KAAK,EAAE,KAAK,KAAK,EAAGO,EAAMP,CAAI,EAF5BH,UAAS,QAAQ,KAAK,aAAa,CAGhD,CASE,aAAawC,EAAO,CAClB,OAAOvD,EAAS,cAAcuD,EAAM,KAAK,CAAC,EAAGA,EAAM,KAAK,CAAC,CAAC,CAC9D,CACA","x_google_ignoreList":[0]}
|
package/dist/index.cjs202.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";const
|
1
|
+
"use strict";const c=require("./index.cjs203.js"),h=require("./index.cjs386.js"),d=require("./index.cjs4.js"),l=require("./index.cjs197.js"),I=require("./index.cjs211.js");let T={};function W(n,e={}){const t=JSON.stringify([n,e]);let s=T[t];return s||(s=new Intl.ListFormat(n,e),T[t]=s),s}const g=new Map;function p(n,e={}){const t=JSON.stringify([n,e]);let s=g.get(t);return s===void 0&&(s=new Intl.DateTimeFormat(n,e),g.set(t,s)),s}const C=new Map;function v(n,e={}){const t=JSON.stringify([n,e]);let s=C.get(t);return s===void 0&&(s=new Intl.NumberFormat(n,e),C.set(t,s)),s}const k=new Map;function D(n,e={}){const{base:t,...s}=e,i=JSON.stringify([n,s]);let r=k.get(i);return r===void 0&&(r=new Intl.RelativeTimeFormat(n,e),k.set(i,r)),r}let m=null;function x(){return m||(m=new Intl.DateTimeFormat().resolvedOptions().locale,m)}const w=new Map;function N(n){let e=w.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),w.set(n,e)),e}const b=new Map;function Z(n){let e=b.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...S,...e}),b.set(n,e)}return e}function L(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let s,i;try{s=p(n).resolvedOptions(),i=n}catch{const u=n.substring(0,t);s=p(u).resolvedOptions(),i=u}const{numberingSystem:r,calendar:a}=s;return[i,r,a]}}function M(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function R(n){const e=[];for(let t=1;t<=12;t++){const s=l.default.utc(2009,t,1);e.push(n(s))}return e}function E(n){const e=[];for(let t=1;t<=7;t++){const s=l.default.utc(2016,11,13+t);e.push(n(s))}return e}function y(n,e,t,s){const i=n.listingMode();return i==="error"?null:i==="en"?t(e):s(e)}function P(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||N(n.locale).numberingSystem==="latn"}class z{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:i,floor:r,...a}=s;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...s};s.padTo>0&&(o.minimumIntegerDigits=s.padTo),this.inf=v(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):c.roundTo(e,3);return c.padStart(t,this.padTo)}}}class ${constructor(e,t,s){this.opts=s,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&I.create(o).valid?(i=o,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const r={...this.opts};r.timeZone=r.timeZone||i,this.dtf=p(t,r)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:s}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class q{constructor(e,t,s){this.opts={style:"long",...s},!t&&c.hasRelative()&&(this.rtf=D(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):h.formatRelativeTime(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const S={firstDay:1,minimalDays:4,weekend:[6,7]};class f{static fromOpts(e){return f.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,s,i,r=!1){const a=e||d.defaultLocale,o=a||(r?"en-US":x()),u=t||d.defaultNumberingSystem,O=s||d.defaultOutputCalendar,F=c.validateWeekSettings(i)||d.defaultWeekSettings;return new f(o,u,O,F,a)}static resetCache(){m=null,g.clear(),C.clear(),k.clear(),w.clear(),b.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:s,weekSettings:i}={}){return f.create(e,t,s,i)}constructor(e,t,s,i,r){const[a,o,u]=L(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=s||u||null,this.weekSettings=i,this.intl=M(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=P(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:f.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,c.validateWeekSettings(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return y(this,e,h.months,()=>{const s=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=R(r=>this.extract(r,s,"month"))),this.monthsCache[i][e]})}weekdays(e,t=!1){return y(this,e,h.weekdays,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=E(r=>this.extract(r,s,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return y(this,void 0,()=>h.meridiems,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[l.default.utc(2016,11,13,9),l.default.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return y(this,e,h.eras,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[l.default.utc(-40,1,1),l.default.utc(2017,1,1)].map(s=>this.extract(s,t,"era"))),this.eraCache[e]})}extract(e,t,s){const i=this.dtFormatter(e,t),r=i.formatToParts(),a=r.find(o=>o.type.toLowerCase()===s);return a?a.value:null}numberFormatter(e={}){return new z(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new $(e,this.intl,t)}relFormatter(e={}){return new q(this.intl,this.isEnglish(),e)}listFormatter(e={}){return W(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||N(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:c.hasLocaleWeekInfo()?Z(this.locale):S}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})`}}module.exports=f;
|
2
2
|
//# sourceMappingURL=index.cjs202.js.map
|
package/dist/index.cjs202.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs202.js","sources":["../node_modules/luxon/src/impl/locale.js"],"sourcesContent":["import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n"],"names":["intlLFCache","getCachedLF","locString","opts","key","dtf","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","intlRelCache","getCachedRTF","base","cacheKeyOpts","sysLocaleCache","systemLocale","weekInfoCache","getCachedWeekInfo","data","locale","parseLocaleString","localeStr","xIndex","uIndex","options","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","mapMonths","f","ms","i","dt","DateTime","mapWeekdays","listStuff","loc","length","englishFn","intlFn","mode","supportsFastNumbers","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","fixed","roundTo","padStart","PolyDateFormatter","z","gmtOffset","offsetZ","IANAZone","value","parts","part","offsetName","PolyRelFormatter","isEnglish","hasRelative","count","unit","English.formatRelativeTime","fallbackWeekSettings","Locale","weekSettings","defaultToEN","specifiedLocale","Settings","localeR","numberingSystemR","outputCalendarR","weekSettingsR","validateWeekSettings","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","isActuallyEn","hasNoWeirdness","alts","format","English.months","formatStr","English.weekdays","English.meridiems","English.eras","field","df","results","matching","m","hasLocaleWeekInfo","other"],"mappings":"4KAQA,IAAIA,EAAc,CAAE,EACpB,SAASC,EAAYC,EAAWC,EAAO,GAAI,CACzC,MAAMC,EAAM,KAAK,UAAU,CAACF,EAAWC,CAAI,CAAC,EAC5C,IAAIE,EAAML,EAAYI,CAAG,EACzB,OAAKC,IACHA,EAAM,IAAI,KAAK,WAAWH,EAAWC,CAAI,EACzCH,EAAYI,CAAG,EAAIC,GAEdA,CACT,CAEA,IAAIC,EAAc,CAAE,EACpB,SAASC,EAAaL,EAAWC,EAAO,GAAI,CAC1C,MAAMC,EAAM,KAAK,UAAU,CAACF,EAAWC,CAAI,CAAC,EAC5C,IAAIE,EAAMC,EAAYF,CAAG,EACzB,OAAKC,IACHA,EAAM,IAAI,KAAK,eAAeH,EAAWC,CAAI,EAC7CG,EAAYF,CAAG,EAAIC,GAEdA,CACT,CAEA,IAAIG,EAAe,CAAE,EACrB,SAASC,EAAaP,EAAWC,EAAO,GAAI,CAC1C,MAAMC,EAAM,KAAK,UAAU,CAACF,EAAWC,CAAI,CAAC,EAC5C,IAAIO,EAAMF,EAAaJ,CAAG,EAC1B,OAAKM,IACHA,EAAM,IAAI,KAAK,aAAaR,EAAWC,CAAI,EAC3CK,EAAaJ,CAAG,EAAIM,GAEfA,CACT,CAEA,IAAIC,EAAe,CAAE,EACrB,SAASC,EAAaV,EAAWC,EAAO,GAAI,CAC1C,KAAM,CAAE,KAAAU,EAAM,GAAGC,CAA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EAAO,GAAI,CAGzB,OAAO,IAAI2C,EAAoB,KAAK,KAAM3C,EAAK,aAAe,KAAK,YAAaA,CAAI,CACxF,CAEE,YAAYiC,EAAIgB,EAAW,GAAI,CAC7B,OAAO,IAAII,EAAkBpB,EAAI,KAAK,KAAMgB,CAAQ,CACxD,CAEE,aAAajD,EAAO,GAAI,CACtB,OAAO,IAAI8D,EAAiB,KAAK,KAAM,KAAK,UAAW,EAAE9D,CAAI,CACjE,CAEE,cAAcA,EAAO,GAAI,CACvB,OAAOF,EAAY,KAAK,KAAME,CAAI,CACtC,CAEE,WAAY,CACV,OACE,KAAK,SAAW,MAChB,KAAK,OAAO,YAAW,IAAO,SAC9B,IAAI,KAAK,eAAe,KAAK,IAAI,EAAE,gBAAiB,EAAC,OAAO,WAAW,OAAO,CAEpF,CAEE,iBAAkB,CAChB,OAAI,KAAK,aACA,KAAK,aACFiG,EAAAA,oBAGHlF,EAAkB,KAAK,MAAM,EAF7BqD,CAIb,CAEE,gBAAiB,CACf,OAAO,KAAK,gBAAe,EAAG,QAClC,CAEE,uBAAwB,CACtB,OAAO,KAAK,gBAAe,EAAG,WAClC,CAEE,gBAAiB,CACf,OAAO,KAAK,gBAAe,EAAG,OAClC,CAEE,OAAO8B,EAAO,CACZ,OACE,KAAK,SAAWA,EAAM,QACtB,KAAK,kBAAoBA,EAAM,iBAC/B,KAAK,iBAAmBA,EAAM,cAEpC,CAEE,UAAW,CACT,MAAO,UAAU,KAAK,MAAM,KAAK,KAAK,eAAe,KAAK,KAAK,cAAc,GACjF,CACA","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs202.js","sources":["../node_modules/luxon/src/impl/locale.js"],"sourcesContent":["import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n"],"names":["intlLFCache","getCachedLF","locString","opts","key","dtf","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","intlRelCache","getCachedRTF","base","cacheKeyOpts","sysLocaleCache","systemLocale","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","getCachedWeekInfo","data","locale","fallbackWeekSettings","parseLocaleString","localeStr","xIndex","uIndex","options","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","mapMonths","f","ms","i","dt","DateTime","mapWeekdays","listStuff","loc","length","englishFn","intlFn","mode","supportsFastNumbers","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","fixed","roundTo","padStart","PolyDateFormatter","z","gmtOffset","offsetZ","IANAZone","value","parts","part","offsetName","PolyRelFormatter","isEnglish","hasRelative","count","unit","English.formatRelativeTime","Locale","weekSettings","defaultToEN","specifiedLocale","Settings","localeR","numberingSystemR","outputCalendarR","weekSettingsR","validateWeekSettings","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","isActuallyEn","hasNoWeirdness","alts","format","English.months","formatStr","English.weekdays","English.meridiems","English.eras","field","df","results","matching","m","hasLocaleWeekInfo","other"],"mappings":"4KAQA,IAAIA,EAAc,CAAE,EACpB,SAASC,EAAYC,EAAWC,EAAO,GAAI,CACzC,MAAMC,EAAM,KAAK,UAAU,CAACF,EAAWC,CAAI,CAAC,EAC5C,IAAIE,EAAML,EAAYI,CAAG,EACzB,OAAKC,IACHA,EAAM,IAAI,KAAK,WAAWH,EAAWC,CAAI,EACzCH,EAAYI,CAAG,EAAIC,GAEdA,CACT,CAEA,MAAMC,EAAc,IAAI,IACxB,SAASC,EAAaL,EAAWC,EAAO,GAAI,CAC1C,MAAMC,EAAM,KAAK,UAAU,CAACF,EAAWC,CAAI,CAAC,EAC5C,IAAIE,EAAMC,EAAY,IAAIF,CAAG,EAC7B,OAAIC,IAAQ,SACVA,EAAM,IAAI,K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AAK,IAAI,EAAE,OAAO,WAAW,OAAO,CAEtE,CAEE,iBAAkB,CAChB,OAAI,KAAK,aACA,KAAK,aACFoF,EAAAA,oBAGHlF,EAAkB,KAAK,MAAM,EAF7BG,CAIb,CAEE,gBAAiB,CACf,OAAO,KAAK,gBAAe,EAAG,QAClC,CAEE,uBAAwB,CACtB,OAAO,KAAK,gBAAe,EAAG,WAClC,CAEE,gBAAiB,CACf,OAAO,KAAK,gBAAe,EAAG,OAClC,CAEE,OAAOgF,EAAO,CACZ,OACE,KAAK,SAAWA,EAAM,QACtB,KAAK,kBAAoBA,EAAM,iBAC/B,KAAK,iBAAmBA,EAAM,cAEpC,CAEE,UAAW,CACT,MAAO,UAAU,KAAK,MAAM,KAAK,KAAK,eAAe,KAAK,KAAK,cAAc,GACjF,CACA","x_google_ignoreList":[0]}
|
package/dist/index.cjs211.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";const
|
1
|
+
"use strict";const c=require("./index.cjs203.js"),v=require("./index.cjs212.js"),g=new Map;function w(a){let e=g.get(a);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),g.set(a,e)),e}const C={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function D(a,e){const t=a.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,n,i,o,s,f,u,l]=r;return[o,n,i,s,f,u,l]}function N(a,e){const t=a.formatToParts(e),r=[];for(let n=0;n<t.length;n++){const{type:i,value:o}=t[n],s=C[i];i==="era"?r[s]=o:c.isUndefined(s)||(r[s]=parseInt(o,10))}return r}const p=new Map;class d extends v{static create(e){let t=p.get(e);return t===void 0&&p.set(e,t=new d(e)),t}static resetCache(){p.clear(),g.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=d.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return c.parseZoneInfo(e,t,r,this.name)}formatOffset(e,t){return c.formatOffset(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=w(this.name);let[n,i,o,s,f,u,l]=r.formatToParts?N(r,t):D(r,t);s==="BC"&&(n=-Math.abs(n)+1);const y=f===24?0:f,T=c.objToLocalTS({year:n,month:i,day:o,hour:y,minute:u,second:l,millisecond:0});let h=+t;const m=h%1e3;return h-=m>=0?m:1e3+m,(T-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}module.exports=d;
|
2
2
|
//# sourceMappingURL=index.cjs211.js.map
|
package/dist/index.cjs211.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs211.js","sources":["../node_modules/luxon/src/zones/IANAZone.js"],"sourcesContent":["import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\
|
1
|
+
{"version":3,"file":"index.cjs211.js","sources":["../node_modules/luxon/src/zones/IANAZone.js"],"sourcesContent":["import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n"],"names":["dtfCache","makeDTF","zoneName","dtf","typeToPos","hackyOffset","date","formatted","parsed","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","filled","i","type","value","pos","isUndefined","ianaZoneCache","IANAZone","Zone","name","zone","s","ts","format","locale","parseZoneInfo","formatOffset","year","month","day","adOrBc","hour","minute","second","adjustedHour","asUTC","objToLocalTS","asTS","over","otherZone"],"mappings":"iFAGMA,EAAW,IAAI,IACrB,SAASC,EAAQC,EAAU,CACzB,IAAIC,EAAMH,EAAS,IAAIE,CAAQ,EAC/B,OAAIC,IAAQ,SACVA,EAAM,IAAI,KAAK,eAAe,QAAS,CACrC,OAAQ,GACR,SAAUD,EACV,KAAM,UACN,MAAO,UACP,IAAK,UACL,KAAM,UACN,OAAQ,UACR,OAAQ,UACR,IAAK,OACX,CAAK,EACDF,EAAS,IAAIE,EAAUC,CAAG,GAErBA,CACT,CAEA,MAAMC,EAAY,CAChB,KAAM,EACN,MAAO,EACP,IAAK,EACL,IAAK,EACL,KAAM,EACN,OAAQ,EACR,OAAQ,CACV,EAEA,SAASC,EAAYF,EAAKG,EAAM,CAC9B,MAAMC,EAAYJ,EAAI,OAAOG,CAAI,EAAE,QAAQ,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ChB,CAQE,IAAI,aAAc,CAChB,MAAO,EACX,CAWE,WAAWG,EAAI,CAAE,OAAAC,EAAQ,OAAAC,CAAM,EAAI,CACjC,OAAOC,EAAAA,cAAcH,EAAIC,EAAQC,EAAQ,KAAK,IAAI,CACtD,CAUE,aAAaF,EAAIC,EAAQ,CACvB,OAAOG,EAAY,aAAC,KAAK,OAAOJ,CAAE,EAAGC,CAAM,CAC/C,CAQE,OAAOD,EAAI,CACT,GAAI,CAAC,KAAK,MAAO,MAAO,KACxB,MAAMvB,EAAO,IAAI,KAAKuB,CAAE,EAExB,GAAI,MAAMvB,CAAI,EAAG,MAAO,KAExB,MAAMH,EAAMF,EAAQ,KAAK,IAAI,EAC7B,GAAI,CAACiC,EAAMC,EAAOC,EAAKC,EAAQC,EAAMC,EAAQC,CAAM,EAAIrC,EAAI,cACvDa,EAAYb,EAAKG,CAAI,EACrBD,EAAYF,EAAKG,CAAI,EAErB+B,IAAW,OACbH,EAAO,CAAC,KAAK,IAAIA,CAAI,EAAI,GAI3B,MAAMO,EAAeH,IAAS,GAAK,EAAIA,EAEjCI,EAAQC,EAAAA,aAAa,CACzB,KAAAT,EACA,MAAAC,EACA,IAAAC,EACA,KAAMK,EACN,OAAAF,EACA,OAAAC,EACA,YAAa,CACnB,CAAK,EAED,IAAII,EAAO,CAACtC,EACZ,MAAMuC,EAAOD,EAAO,IACpB,OAAAA,GAAQC,GAAQ,EAAIA,EAAO,IAAOA,GAC1BH,EAAQE,IAAS,GAAK,IAClC,CAQE,OAAOE,EAAW,CAChB,OAAOA,EAAU,OAAS,QAAUA,EAAU,OAAS,KAAK,IAChE,CAOE,IAAI,SAAU,CACZ,OAAO,KAAK,KAChB,CACA","x_google_ignoreList":[0]}
|
package/dist/index.cjs215.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},c={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]},o=r.hanidec.replace(/[\[|\]]/g,"").split("");function s(i){let e=parseInt(i,10);if(isNaN(e)){e="";for(let u=0;u<i.length;u++){const t=i.charCodeAt(u);if(i[u].search(r.hanidec)!==-1)e+=o.indexOf(i[u]);else for(const n in c){const[l,g]=c[n];t>=l&&t<=g&&(e+=t-l)}}return parseInt(e,10)}else return e}const a=new Map;function d(){a.clear()}function m({numberingSystem:i},e=""){const u=i||"latn";let t=a.get(u);t===void 0&&(t=new Map,a.set(u,t));let n=t.get(e);return n===void 0&&(n=new RegExp(`${r[u]}${e}`),t.set(e,n)),n}exports.digitRegex=m;exports.parseDigits=s;exports.resetDigitRegexCache=d;
|
2
2
|
//# sourceMappingURL=index.cjs215.js.map
|
package/dist/index.cjs215.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs215.js","sources":["../node_modules/luxon/src/impl/digits.js"],"sourcesContent":["const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\
|
1
|
+
{"version":3,"file":"index.cjs215.js","sources":["../node_modules/luxon/src/impl/digits.js"],"sourcesContent":["const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n"],"names":["numberingSystems","numberingSystemsUTF16","hanidecChars","parseDigits","str","value","i","code","key","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","numberingSystem","append","ns","appendCache","regex"],"mappings":"gFAAA,MAAMA,EAAmB,CACvB,KAAM,QACN,QAAS,QACT,KAAM,QACN,KAAM,QACN,KAAM,QACN,SAAU,QACV,KAAM,QACN,QAAS,wBACT,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,QACN,QAAS,QACT,KAAM,QACN,KAAM,QACN,KAAM,QACN,KAAM,KACR,EAEMC,EAAwB,CAC5B,KAAM,CAAC,KAAM,IAAI,EACjB,QAAS,CAAC,KAAM,IAAI,EACpB,KAAM,CAAC,KAAM,IAAI,EACjB,KAAM,CAAC,KAAM,IAAI,EACjB,KAAM,CAAC,KAAM,IAAI,EACjB,SAAU,CAAC,MAAO,KAAK,EACvB,KAAM,CAAC,KAAM,IAAI,EACjB,KAAM,CAAC,KAAM,IAAI,EACjB,KAAM,CAAC,KAAM,IAAI,EACjB,KAAM,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iBgB,CAAE,CAAC,GAAGD,CAAM,EAAE,EACrDE,EAAY,IAAIF,EAAQG,CAAK,GAGxBA,CACT","x_google_ignoreList":[0]}
|
package/dist/index.cjs220.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs391.js");var r=e.__require();exports.lodashExports=r;
|
2
2
|
//# sourceMappingURL=index.cjs220.js.map
|
package/dist/index.cjs227.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";const r=require("./index.
|
1
|
+
"use strict";const r=require("./index.cjs392.js"),e=require("./index.cjs394.js");var s=e.__require();const o=r.getDefaultExportFromCjs(s);module.exports=o;
|
2
2
|
//# sourceMappingURL=index.cjs227.js.map
|
package/dist/index.cjs23.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/Dropdown/Dropdown.css');const e=require("./index.cjs216.js"),r=require("./index.cjs249.js"),x=require("./index.cjs218.js"),a=require("./index.cjs233.js");;/* empty css */const u=require("./index.cjs135.js"),c=require("./index.cjs9.js"),d=({text:t,leftIcon:n,options:o,asLinkItem:s,textColor:i="white"})=>{const l=a.createColorClasses({text:i});return e.jsxRuntimeExports.jsxs(r.Root,{children:[e.jsxRuntimeExports.jsx(r.Trigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{className:x.clsx("border-none bg-transparent base-row gap-x8 fw-regular fs-6 align-items-center",l,"ui-dropdown-trigger"),children:[n&&n,e.jsxRuntimeExports.jsxs(c.Row,{as:"span",gap:"x4",children:[t,e.jsxRuntimeExports.jsx(u.ArrowDown,{color:i,className:"ui-arrow"})]})]})}),e.jsxRuntimeExports.jsx(m,{options:o,asLinkItem:s})]})},m=({options:t,asLinkItem:n})=>{if(t.length===0)return null;const o=n??"a";return e.jsxRuntimeExports.jsx(r.Portal,{children:e.jsxRuntimeExports.jsx(r.Content,{className:"bg-white shadow ui-dropdown-menu-content",children:e.jsxRuntimeExports.jsx(r.Group,{className:"ui-dropdown-menu-group",children:t.map((s,i)=>e.jsxRuntimeExports.jsx(r.Item,{asChild:!0,className:"ui-dropdown-menu-item",children:s.href?e.jsxRuntimeExports.jsxs(o,{href:s.href,className:x.clsx("fs-6 text-decoration-none",s.active?"text-primary fw-semibold":"text-slate-28 fw-regular"),children:[s.label,s.active&&e.jsxRuntimeExports.jsx("span",{className:"visually-hidden",children:"Attivo"})]}):e.jsxRuntimeExports.jsxs("button",{onClick:s.onClick,children:[s.label,s.active&&e.jsxRuntimeExports.jsx("span",{className:"visually-hidden",children:"Attivo"})]})},i))})})})};exports.Dropdown=d;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/Dropdown/Dropdown.css');const e=require("./index.cjs216.js"),r=require("./index.cjs249.js"),x=require("./index.cjs218.js"),a=require("./index.cjs233.js");;/* empty css */const u=require("./index.cjs135.js"),c=require("./index.cjs9.js"),d=({text:t,leftIcon:n,options:o,asLinkItem:s,textColor:i="white"})=>{const l=a.createColorClasses({text:i});return e.jsxRuntimeExports.jsxs(r.Root,{children:[e.jsxRuntimeExports.jsx(r.Trigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{className:x.clsx("border-none bg-transparent base-row gap-x8 fw-regular fs-6 align-items-center",l,"ui-dropdown-trigger"),children:[n&&n,e.jsxRuntimeExports.jsxs(c.Row,{as:"span",gap:"x4",children:[t,e.jsxRuntimeExports.jsx(u.ArrowDown,{color:i,className:"ui-arrow"})]})]})}),e.jsxRuntimeExports.jsx(m,{options:o,asLinkItem:s})]})},m=({options:t,asLinkItem:n})=>{if(t.length===0)return null;const o=n??"a";return e.jsxRuntimeExports.jsx(r.Portal,{children:e.jsxRuntimeExports.jsx(r.Content,{className:"bg-white shadow ui-dropdown-menu-content",children:e.jsxRuntimeExports.jsx(r.Group,{className:"ui-dropdown-menu-group",children:t.map((s,i)=>e.jsxRuntimeExports.jsx(r.Item,{asChild:!0,className:"ui-dropdown-menu-item",children:s.href?e.jsxRuntimeExports.jsxs(o,{href:s.href,className:x.clsx("fs-6 text-decoration-none",s.active?"text-primary fw-semibold":"text-slate-28 fw-regular"),children:[s.label,s.active&&e.jsxRuntimeExports.jsx("span",{className:"visually-hidden",children:"Attivo"})]}):e.jsxRuntimeExports.jsxs("button",{onClick:s.onClick,className:x.clsx("fs-6 text-decoration-none bg-white outline-none border-none text-left",s.active?"text-primary fw-semibold":"text-slate-28 fw-regular"),children:[s.label,s.active&&e.jsxRuntimeExports.jsx("span",{className:"visually-hidden",children:"Attivo"})]})},i))})})})};exports.Dropdown=d;
|
2
2
|
//# sourceMappingURL=index.cjs23.js.map
|
package/dist/index.cjs23.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs23.js","sources":["../src/components/ui/Dropdown/index.tsx"],"sourcesContent":["import { ArrowDown } from \"@/icons\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport clsx from \"clsx\";\nimport { ColorKeys, createColorClasses } from \"@/theme/colors\";\nimport \"./Dropdown.scss\";\nimport { Row } from \"@/components\";\n\ntype DropdownOption = {\n label: string;\n href?: string;\n onClick?: () => void;\n active?: boolean;\n};\n\ntype DropdownProps = {\n text: string;\n leftIcon?: React.ReactNode;\n options: DropdownOption[];\n asLinkItem?: \"a\" | React.ComponentType<any>;\n textColor?: ColorKeys;\n};\n\ntype DropdownMenuContentProps = {\n options: DropdownOption[];\n asLinkItem?: \"a\" | React.ComponentType<any>;\n};\n\nexport const Dropdown = ({\n text,\n leftIcon,\n options,\n asLinkItem,\n textColor = \"white\",\n}: DropdownProps) => {\n const textColorClass = createColorClasses({ text: textColor });\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n className={clsx(\n \"border-none bg-transparent base-row gap-x8 fw-regular fs-6 align-items-center\",\n textColorClass,\n \"ui-dropdown-trigger\",\n )}\n >\n {leftIcon && leftIcon}\n <Row as={\"span\"} gap={\"x4\"}>\n {text}\n <ArrowDown color={textColor} className={\"ui-arrow\"} />\n </Row>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenuContent options={options} asLinkItem={asLinkItem} />\n </DropdownMenu.Root>\n );\n};\n\nconst DropdownMenuContent = ({\n options,\n asLinkItem,\n}: DropdownMenuContentProps) => {\n if (options.length === 0) return null;\n\n const LinkComponent = asLinkItem ?? \"a\";\n\n return (\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className={\"bg-white shadow ui-dropdown-menu-content\"}\n >\n <DropdownMenu.Group className={\"ui-dropdown-menu-group\"}>\n {options.map((option, index) => (\n <DropdownMenu.Item\n key={index}\n asChild\n className={\"ui-dropdown-menu-item\"}\n >\n {option.href ? (\n <LinkComponent\n href={option.href}\n className={clsx(\n \"fs-6 text-decoration-none\",\n option.active\n ? `text-primary fw-semibold`\n : `text-slate-28 fw-regular`,\n )}\n >\n {option.label}\n {option.active && (\n <span className=\"visually-hidden\">Attivo</span>\n )}\n </LinkComponent>\n ) : (\n <button
|
1
|
+
{"version":3,"file":"index.cjs23.js","sources":["../src/components/ui/Dropdown/index.tsx"],"sourcesContent":["import { ArrowDown } from \"@/icons\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport clsx from \"clsx\";\nimport { ColorKeys, createColorClasses } from \"@/theme/colors\";\nimport \"./Dropdown.scss\";\nimport { Row } from \"@/components\";\n\ntype DropdownOption = {\n label: string;\n href?: string;\n onClick?: () => void;\n active?: boolean;\n};\n\ntype DropdownProps = {\n text: string;\n leftIcon?: React.ReactNode;\n options: DropdownOption[];\n asLinkItem?: \"a\" | React.ComponentType<any>;\n textColor?: ColorKeys;\n};\n\ntype DropdownMenuContentProps = {\n options: DropdownOption[];\n asLinkItem?: \"a\" | React.ComponentType<any>;\n};\n\nexport const Dropdown = ({\n text,\n leftIcon,\n options,\n asLinkItem,\n textColor = \"white\",\n}: DropdownProps) => {\n const textColorClass = createColorClasses({ text: textColor });\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n className={clsx(\n \"border-none bg-transparent base-row gap-x8 fw-regular fs-6 align-items-center\",\n textColorClass,\n \"ui-dropdown-trigger\",\n )}\n >\n {leftIcon && leftIcon}\n <Row as={\"span\"} gap={\"x4\"}>\n {text}\n <ArrowDown color={textColor} className={\"ui-arrow\"} />\n </Row>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenuContent options={options} asLinkItem={asLinkItem} />\n </DropdownMenu.Root>\n );\n};\n\nconst DropdownMenuContent = ({\n options,\n asLinkItem,\n}: DropdownMenuContentProps) => {\n if (options.length === 0) return null;\n\n const LinkComponent = asLinkItem ?? \"a\";\n\n return (\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n className={\"bg-white shadow ui-dropdown-menu-content\"}\n >\n <DropdownMenu.Group className={\"ui-dropdown-menu-group\"}>\n {options.map((option, index) => (\n <DropdownMenu.Item\n key={index}\n asChild\n className={\"ui-dropdown-menu-item\"}\n >\n {option.href ? (\n <LinkComponent\n href={option.href}\n className={clsx(\n \"fs-6 text-decoration-none\",\n option.active\n ? `text-primary fw-semibold`\n : `text-slate-28 fw-regular`,\n )}\n >\n {option.label}\n {option.active && (\n <span className=\"visually-hidden\">Attivo</span>\n )}\n </LinkComponent>\n ) : (\n <button\n onClick={option.onClick}\n className={clsx(\n \"fs-6 text-decoration-none bg-white outline-none border-none text-left\",\n option.active\n ? `text-primary fw-semibold`\n : `text-slate-28 fw-regular`,\n )}\n >\n {option.label}\n {option.active && (\n <span className=\"visually-hidden\">Attivo</span>\n )}\n </button>\n )}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Group>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n );\n};\n"],"names":["Dropdown","text","leftIcon","options","asLinkItem","textColor","textColorClass","createColorClasses","jsxs","DropdownMenu.Root","jsx","DropdownMenu.Trigger","clsx","Row","ArrowDown","DropdownMenuContent","LinkComponent","DropdownMenu.Portal","DropdownMenu.Content","DropdownMenu.Group","option","index","DropdownMenu.Item"],"mappings":"iTA2BaA,EAAW,CAAC,CACvB,KAAAC,EACA,SAAAC,EACA,QAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,OACd,IAAqB,CACnB,MAAMC,EAAiBC,EAAA,mBAAmB,CAAE,KAAMF,EAAW,EAG3D,OAAAG,EAAA,kBAAA,KAACC,OAAA,CACC,SAAA,CAAAC,EAAAA,kBAAAA,IAACC,EAAAA,QAAA,CAAqB,QAAO,GAC3B,SAAAH,EAAA,kBAAA,KAAC,SAAA,CACC,UAAWI,EAAA,KACT,gFACAN,EACA,qBACF,EAEC,SAAA,CAAYJ,GAAAA,EACZM,EAAA,kBAAA,KAAAK,EAAA,IAAA,CAAI,GAAI,OAAQ,IAAK,KACnB,SAAA,CAAAZ,EACAS,EAAA,kBAAA,IAAAI,EAAA,UAAA,CAAU,MAAOT,EAAW,UAAW,UAAY,CAAA,CAAA,CACtD,CAAA,CAAA,CAAA,CAAA,EAEJ,EACAK,EAAAA,kBAAAA,IAACK,EAAoB,CAAA,QAAAZ,EAAkB,WAAAC,CAAwB,CAAA,CAAA,EACjE,CAEJ,EAEMW,EAAsB,CAAC,CAC3B,QAAAZ,EACA,WAAAC,CACF,IAAgC,CAC1B,GAAAD,EAAQ,SAAW,EAAU,OAAA,KAEjC,MAAMa,EAAgBZ,GAAc,IAGlC,OAAAM,wBAACO,EAAAA,OAAA,CACC,SAAAP,EAAA,kBAAA,IAACQ,EAAa,QAAb,CACC,UAAW,2CAEX,SAAAR,EAAA,kBAAA,IAACS,QAAA,CAAmB,UAAW,yBAC5B,SAAQhB,EAAA,IAAI,CAACiB,EAAQC,IACpBX,EAAA,kBAAA,IAACY,EAAa,KAAb,CAEC,QAAO,GACP,UAAW,wBAEV,WAAO,KACNd,EAAA,kBAAA,KAACQ,EAAA,CACC,KAAMI,EAAO,KACb,UAAWR,EAAA,KACT,4BACAQ,EAAO,OACH,2BACA,0BACN,EAEC,SAAA,CAAOA,EAAA,MACPA,EAAO,QACNV,EAAAA,kBAAAA,IAAC,OAAK,CAAA,UAAU,kBAAkB,SAAM,QAAA,CAAA,CAAA,CAAA,CAAA,EAI5CF,EAAA,kBAAA,KAAC,SAAA,CACC,QAASY,EAAO,QAChB,UAAWR,EAAA,KACT,wEACAQ,EAAO,OACH,2BACA,0BACN,EAEC,SAAA,CAAOA,EAAA,MACPA,EAAO,QACNV,EAAAA,kBAAAA,IAAC,OAAK,CAAA,UAAU,kBAAkB,SAAM,QAAA,CAAA,CAAA,CAAA,CAAA,CAE5C,EAjCGW,CAAA,CAoCR,CACH,CAAA,CAAA,CAAA,EAEJ,CAEJ"}
|
package/dist/index.cjs270.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index.cjs412.js"),n=require("react"),p=()=>{const[o,t]=i.useCopyToClipboard(),[r,e]=n.useState(!1);return{isCopied:r,copiedText:o,copyToClipboard:()=>{const c=window.location.href;t(c).then(()=>{e(()=>!0),setTimeout(()=>{e(!1)},1500)}).catch(s=>{console.debug("Failed to copy!",s)})}}};exports.useCopyToClipboardCurrentPage=p;
|
2
2
|
//# sourceMappingURL=index.cjs270.js.map
|
package/dist/index.cjs283.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/DoctorModal/DoctorModalFooter/DoctorModalFooter.css');const o=require("./index.cjs216.js");;/* empty css */const t=({children:e})=>o.jsxRuntimeExports.jsx("footer",{className:"ui-consent-modal-footer bg-white shadow",children:e});exports.ConsentModalFooter=t;
|
2
2
|
//# sourceMappingURL=index.cjs283.js.map
|
package/dist/index.cjs288.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/DoctorModal/DoctorModalFooter/DoctorModalFooter.css');const e=require("./index.cjs216.js");;/* empty css */const t=({children:o})=>e.jsxRuntimeExports.jsx("footer",{className:"ui-consent-modal-footer bg-white shadow",children:o});exports.DoctorModalFooter=t;
|
2
2
|
//# sourceMappingURL=index.cjs288.js.map
|
package/dist/index.cjs295.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/DoctorModal/DoctorModalFooter/DoctorModalFooter.css');const e=require("./index.cjs216.js");;/* empty css */const t=({children:o})=>e.jsxRuntimeExports.jsx("footer",{className:"ui-consent-modal-footer bg-white shadow",children:o});exports.DoctorConfirmModalFooter=t;
|
2
2
|
//# sourceMappingURL=index.cjs295.js.map
|