@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 4.33 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index.cjs231.js"),M=require("./index.cjs275.js"),O=require("./index.cjs229.js"),N=require("./index.cjs239.js"),$=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function S(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function g(...e){return t=>e.reduce(([n,r,s],a)=>{const[d,i,c]=a(t,s);return[{...n,...d},i||r,c]},[{},null,1]).slice(0,2)}function x(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const s=n.exec(e);if(s)return r(s)}return[null,null]}function E(...e){return(t,n)=>{const r={};let s;for(s=0;s<e.length;s++)r[e[s]]=o.parseInteger(t[n+s]);return[r,null,n+s]}}const b=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Z=`(?:${b.source}?(?:\\[(${$.source})\\])?)?`,D=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,W=RegExp(`${D.source}${Z}`),A=RegExp(`(?:T${W.source})?`),q=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,w=/(\d{4})-?W(\d\d)(?:-?(\d))?/,P=/(\d{4})-?(\d{3})/,Y=E("weekYear","weekNumber","weekDay"),v=E("year","ordinal"),z=/(\d{4})-(\d\d)-(\d\d)/,J=RegExp(`${D.source} ?(?:${b.source}|(${$.source}))?`),G=RegExp(`(?: ${J.source})?`);function f(e,t,n){const r=e[t];return o.isUndefined(r)?n:o.parseInteger(r)}function H(e,t){return[{year:f(e,t),month:f(e,t+1,1),day:f(e,t+2,1)},null,t+3]}function T(e,t){return[{hours:f(e,t,0),minutes:f(e,t+1,0),seconds:f(e,t+2,0),milliseconds:o.parseMillis(e[t+3])},null,t+4]}function m(e,t){const n=!e[t]&&!e[t+1],r=o.signedOffset(e[t+1],e[t+2]),s=n?null:O.instance(r);return[{},s,t+3]}function p(e,t){const n=e[t]?N.create(e[t]):null;return[{},n,t+1]}const L=RegExp(`^T?${D.source}$`),_=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Q(e){const[t,n,r,s,a,d,i,c,y]=e,I=t[0]==="-",R=c&&c[0]==="-",u=(l,C=!1)=>l!==void 0&&(C||l&&I)?-l:l;return[{years:u(o.parseFloating(n)),months:u(o.parseFloating(r)),weeks:u(o.parseFloating(s)),days:u(o.parseFloating(a)),hours:u(o.parseFloating(d)),minutes:u(o.parseFloating(i)),seconds:u(o.parseFloating(c),c==="-0"),milliseconds:u(o.parseMillis(y),R)}]}const U={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function h(e,t,n,r,s,a,d){const i={year:t.length===2?o.untruncateYear(o.parseInteger(t)):o.parseInteger(t),month:M.monthsShort.indexOf(n)+1,day:o.parseInteger(r),hour:o.parseInteger(s),minute:o.parseInteger(a)};return d&&(i.second=o.parseInteger(d)),e&&(i.weekday=e.length>3?M.weekdaysLong.indexOf(e)+1:M.weekdaysShort.indexOf(e)+1),i}const j=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function B(e){const[,t,n,r,s,a,d,i,c,y,I,R]=e,u=h(t,s,r,n,a,d,i);let l;return c?l=U[c]:y?l=0:l=o.signedOffset(I,R),[u,new O(l)]}function K(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const V=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,X=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ee=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function F(e){const[,t,n,r,s,a,d,i]=e;return[h(t,s,r,n,a,d,i),O.utcInstance]}function te(e){const[,t,n,r,s,a,d,i]=e;return[h(t,i,n,r,s,a,d),O.utcInstance]}const ne=S(q,A),re=S(w,A),se=S(P,A),oe=S(W),k=g(H,T,m,p),ie=g(Y,T,m,p),de=g(v,T,m,p),ae=g(T,m,p);function ce(e){return x(e,[ne,k],[re,ie],[se,de],[oe,ae])}function ue(e){return x(K(e),[j,B])}function le(e){return x(e,[V,F],[X,F],[ee,te])}function fe(e){return x(e,[_,Q])}const Se=g(T);function ge(e){return x(e,[L,Se])}const xe=S(z,G),Te=S(J),me=g(T,m,p);function pe(e){return x(e,[xe,k],[Te,me])}exports.parseHTTPDate=le;exports.parseISODate=ce;exports.parseISODuration=fe;exports.parseISOTimeOnly=ge;exports.parseRFC2822Date=ue;exports.parseSQL=pe;
//# sourceMappingURL=index.cjs5.js.map