gemi 0.4.87 → 0.4.89
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/app/App.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bin/index.js +8 -8
- package/dist/{chunk-6434d2c5758f4125.js → chunk-116e493e1848228a.js} +1 -1
- package/dist/{chunk-8e55cff6329b67a9.js → chunk-24341645f1dbb11b.js} +1 -1
- package/dist/{chunk-cc7158438e52b9ab.js → chunk-37a23ee8398a9bdf.js} +2 -2
- package/dist/{chunk-c4b0f134a6b82c51.js → chunk-4df444d8a20035e1.js} +1 -1
- package/dist/{chunk-b38c0c4618d0dd89.js → chunk-6c96e8e51232f838.js} +1 -1
- package/dist/{chunk-d0b9873261cd82b7.js → chunk-6fbe844659c3b67d.js} +1 -1
- package/dist/{chunk-6b18189b2aabf6b7.js → chunk-786985b106091b91.js} +1 -1
- package/dist/{chunk-b3eca9338a13f510.js → chunk-833e8b963e935111.js} +1 -1
- package/dist/chunk-8f66c4705c7ddab7.js +18 -0
- package/dist/{chunk-9383d727762ecba1.js → chunk-905d85c9a9ca1c9e.js} +1 -1
- package/dist/{chunk-8f2c54f2cd43402a.js → chunk-a4e7e8a00a47ba85.js} +1 -1
- package/dist/{chunk-fa61561237819f16.js → chunk-a96c2e272f0ddf6c.js} +1 -1
- package/dist/chunk-acf6e39c4caa6aeb.js +3 -0
- package/dist/{chunk-b4cbb4706a35f5d5.js → chunk-b0131f371340bf21.js} +1 -1
- package/dist/{chunk-c160211e5cc4c447.js → chunk-c36af52cbe0d034e.js} +1 -1
- package/dist/{chunk-5806220e55ac164c.js → chunk-e5ed2736da251b56.js} +1 -1
- package/dist/{chunk-5f01223b8fbe1ed8.js → chunk-f6597f92f878d2dc.js} +1 -1
- package/dist/client/index.js +1 -6
- package/dist/client/init.d.ts.map +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/services/index.js +1 -1
- package/package.json +1 -7
- package/dist/chunk-519593bc19f7cb9f.js +0 -18
- package/dist/chunk-69b5648fcd0f0a18.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as x} from"./chunk-24a86f8f5ddc0cbd.js";import{
|
|
1
|
+
import{B as x} from"./chunk-24a86f8f5ddc0cbd.js";import{ub as S} from"./chunk-786985b106091b91.js";var q="AWS_PROFILE";var B=(o)=>o.profile||process.env["AWS_PROFILE"]||"default";import{join as b} from"path";import{homedir as N} from"os";import{sep as L} from"path";var d={},w=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},f=()=>{const{HOME:o,USERPROFILE:e,HOMEPATH:t,HOMEDRIVE:r=`C:${L}`}=process.env;if(o)return o;if(e)return e;if(t)return`${r}${t}`;const i=w();if(!d[i])d[i]=N();return d[i]};var v="AWS_CONFIG_FILE",g=()=>process.env[v]||b(f(),".aws","config");var D=x(S(),1);import{join as I} from"path";var h=x(S(),1);var O=(o)=>Object.entries(o).filter(([e])=>{const t=e.indexOf(c);if(t===-1)return!1;return Object.values(h.IniSectionType).includes(e.substring(0,t))}).reduce((e,[t,r])=>{const i=t.indexOf(c),s=t.substring(0,i)===h.IniSectionType.PROFILE?t.substring(i+1):t;return e[s]=r,e},{...o.default&&{default:o.default}});import{join as j} from"path";var y="AWS_SHARED_CREDENTIALS_FILE",_=()=>process.env[y]||j(f(),".aws","credentials");var C=x(S(),1);var $=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,G=["__proto__","profile __proto__"],a=(o)=>{const e={};let t,r;for(let i of o.split(/\r?\n/)){const s=i.split(/(^|\s)[;#]/)[0].trim();if(s[0]==="["&&s[s.length-1]==="]"){t=void 0,r=void 0;const n=s.substring(1,s.length-1),m=$.exec(n);if(m){const[,p,,F]=m;if(Object.values(C.IniSectionType).includes(p))t=[p,F].join(c)}else t=n;if(G.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(t){const n=s.indexOf("=");if(![0,-1].includes(n)){const[m,p]=[s.substring(0,n).trim(),s.substring(n+1).trim()];if(p==="")r=m;else{if(r&&i.trimStart()===i)r=void 0;e[t]=e[t]||{};const F=r?[r,m].join(c):m;e[t][F]=p}}}}return e};import{promises as W} from"fs";var{readFile:K}=W,E={},l=(o,e)=>{if(!E[o]||e?.ignoreCache)E[o]=K(o,"utf8");return E[o]};var P=()=>({}),c=".",R=async(o={})=>{const{filepath:e=_(),configFilepath:t=g()}=o,r=f();let s=e;if(e.startsWith("~/"))s=I(r,e.slice(2));let u=t;if(t.startsWith("~/"))u=I(r,t.slice(2));const n=await Promise.all([l(u,{ignoreCache:o.ignoreCache}).then(a).then(O).catch(P),l(s,{ignoreCache:o.ignoreCache}).then(a).catch(P)]);return{configFile:n[0],credentialsFile:n[1]}};var T=(o)=>Object.entries(o).filter(([e])=>e.startsWith(D.IniSectionType.SSO_SESSION+c)).reduce((e,[t,r])=>({...e,[t.substring(t.indexOf(c)+1)]:r}),{});var V=()=>({}),Pe=async(o={})=>l(o.configFilepath??g()).then(a).then(T).catch(V);var A=(...o)=>{const e={};for(let t of o)for(let[r,i]of Object.entries(t))if(e[r]!==void 0)Object.assign(e[r],i);else e[r]=i;return e};var He=async(o)=>{const e=await R(o);return A(e.configFile,e.credentialsFile)};import{createHash as U} from"crypto";import{join as X} from"path";var H=(o)=>{const t=U("sha1").update(o).digest("hex");return X(f(),".aws","sso","cache",`${t}.json`)};import{promises as k} from"fs";var{readFile:M}=k,$e=async(o)=>{const e=H(o),t=await M(e,"utf8");return JSON.parse(t)};export{q as zb,B as Ab,H as Bb,$e as Cb,c as Db,R as Eb,Pe as Fb,He as Gb};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{B as F,C as le} from"./chunk-24a86f8f5ddc0cbd.js";import{ub as _} from"./chunk-786985b106091b91.js";var ye=le((Br,me)=>{var{defineProperty:D,getOwnPropertyDescriptor:dt,getOwnPropertyNames:lt}=Object,ht=Object.prototype.hasOwnProperty,Y=(e,t)=>D(e,"name",{value:t,configurable:!0}),pt=(e,t)=>{for(var r in t)D(e,r,{get:t[r],enumerable:!0})},mt=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of lt(t))if(!ht.call(e,o)&&o!==r)D(e,o,{get:()=>t[o],enumerable:!(n=dt(t,o))||n.enumerable})}return e},yt=(e)=>mt(D({},"__esModule",{value:!0}),e),he={};pt(he,{escapeUri:()=>pe,escapeUriPath:()=>wt});me.exports=yt(he);var pe=Y((e)=>encodeURIComponent(e).replace(/[!'()*]/g,gt),"escapeUri"),gt=Y((e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),wt=Y((e)=>e.split("/").map(pe).join("/"),"escapeUriPath")});var Oe=le((xo,De)=>{var Le=function(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in X)t[r/2]=X[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t},Pe=function(e){let t="";for(let r=0;r<e.byteLength;r++)t+=Ue[e[r]];return t},j=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Ut=Object.getOwnPropertyNames,Lt=Object.prototype.hasOwnProperty,ke=(e,t)=>j(e,"name",{value:t,configurable:!0}),Pt=(e,t)=>{for(var r in t)j(e,r,{get:t[r],enumerable:!0})},Dt=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of Ut(t))if(!Lt.call(e,o)&&o!==r)j(e,o,{get:()=>t[o],enumerable:!(n=Ft(t,o))||n.enumerable})}return e},Ot=(e)=>Dt(j({},"__esModule",{value:!0}),e),Fe={};Pt(Fe,{fromHex:()=>Le,toHex:()=>Pe});De.exports=Ot(Fe);var Ue={},X={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;Ue[e]=t,X[t]=e}ke(Le,"fromHex");ke(Pe,"toHex")});var C=(e,t)=>{const r=[];if(e)r.push(e);if(t)for(let n of t)r.push(n);return r},S=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},A=()=>{let e=[],t=[],r=!1;const n=new Set,o=(a)=>a.sort((f,d)=>ce[d.step]-ce[f.step]||ae[d.priority||"normal"]-ae[f.priority||"normal"]),s=(a)=>{let f=!1;const d=(y)=>{const w=C(y.name,y.aliases);if(w.includes(a)){f=!0;for(let p of w)n.delete(p);return!1}return!0};return e=e.filter(d),t=t.filter(d),f},c=(a)=>{let f=!1;const d=(y)=>{if(y.middleware===a){f=!0;for(let w of C(y.name,y.aliases))n.delete(w);return!1}return!0};return e=e.filter(d),t=t.filter(d),f},i=(a)=>{return e.forEach((f)=>{a.add(f.middleware,{...f})}),t.forEach((f)=>{a.addRelativeTo(f.middleware,{...f})}),a.identifyOnResolve?.(g.identifyOnResolve()),a},u=(a)=>{const f=[];return a.before.forEach((d)=>{if(d.before.length===0&&d.after.length===0)f.push(d);else f.push(...u(d))}),f.push(a),a.after.reverse().forEach((d)=>{if(d.before.length===0&&d.after.length===0)f.push(d);else f.push(...u(d))}),f},h=(a=!1)=>{const f=[],d=[],y={};return e.forEach((p)=>{const m={...p,before:[],after:[]};for(let l of C(m.name,m.aliases))y[l]=m;f.push(m)}),t.forEach((p)=>{const m={...p,before:[],after:[]};for(let l of C(m.name,m.aliases))y[l]=m;d.push(m)}),d.forEach((p)=>{if(p.toMiddleware){const m=y[p.toMiddleware];if(m===void 0){if(a)return;throw new Error(`${p.toMiddleware} is not found when adding `+`${S(p.name,p.aliases)} `+`middleware ${p.relation} ${p.toMiddleware}`)}if(p.relation==="after")m.after.push(p);if(p.relation==="before")m.before.push(p)}}),o(f).map(u).reduce((p,m)=>{return p.push(...m),p},[])},g={add:(a,f={})=>{const{name:d,override:y,aliases:w}=f,p={step:"initialize",priority:"normal",middleware:a,...f},m=C(d,w);if(m.length>0){if(m.some((l)=>n.has(l))){if(!y)throw new Error(`Duplicate middleware name '${S(d,w)}'`);for(let l of m){const E=e.findIndex((k)=>k.name===l||k.aliases?.some((q)=>q===l));if(E===-1)continue;const x=e[E];if(x.step!==p.step||p.priority!==x.priority)throw new Error(`"${S(x.name,x.aliases)}" middleware with `+`${x.priority} priority in ${x.step} step cannot `+`be overridden by "${S(d,w)}" middleware with `+`${p.priority} priority in ${p.step} step.`);e.splice(E,1)}}for(let l of m)n.add(l)}e.push(p)},addRelativeTo:(a,f)=>{const{name:d,override:y,aliases:w}=f,p={middleware:a,...f},m=C(d,w);if(m.length>0){if(m.some((l)=>n.has(l))){if(!y)throw new Error(`Duplicate middleware name '${S(d,w)}'`);for(let l of m){const E=t.findIndex((k)=>k.name===l||k.aliases?.some((q)=>q===l));if(E===-1)continue;const x=t[E];if(x.toMiddleware!==p.toMiddleware||x.relation!==p.relation)throw new Error(`"${S(x.name,x.aliases)}" middleware `+`${x.relation} "${x.toMiddleware}" middleware cannot be overridden `+`by "${S(d,w)}" middleware ${p.relation} `+`"${p.toMiddleware}" middleware.`);t.splice(E,1)}}for(let l of m)n.add(l)}t.push(p)},clone:()=>i(A()),use:(a)=>{a.applyToStack(g)},remove:(a)=>{if(typeof a==="string")return s(a);else return c(a)},removeByTag:(a)=>{let f=!1;const d=(y)=>{const{tags:w,name:p,aliases:m}=y;if(w&&w.includes(a)){const l=C(p,m);for(let E of l)n.delete(E);return f=!0,!1}return!0};return e=e.filter(d),t=t.filter(d),f},concat:(a)=>{const f=i(A());return f.use(a),f.identifyOnResolve(r||f.identifyOnResolve()||(a.identifyOnResolve?.()??!1)),f},applyToStack:i,identify:()=>{return h(!0).map((a)=>{const f=a.step??a.relation+" "+a.toMiddleware;return S(a.name,a.aliases)+" - "+f})},identifyOnResolve(a){if(typeof a==="boolean")r=a;return r},resolve:(a,f)=>{for(let d of h().map((y)=>y.middleware).reverse())a=d(a,f);if(r)console.log(g.identify());return a}};return g},ce={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ae={high:3,normal:2,low:1};class at{constructor(e){this.config=e,this.middlewareStack=A()}send(e,t,r){const n=typeof t!=="function"?t:void 0,o=typeof t==="function"?t:r,s=n===void 0&&this.config.cacheMiddleware===!0;let c;if(s){if(!this.handlers)this.handlers=new WeakMap;const i=this.handlers;if(i.has(e.constructor))c=i.get(e.constructor);else c=e.resolveMiddleware(this.middlewareStack,this.config,n),i.set(e.constructor,c)}else delete this.handlers,c=e.resolveMiddleware(this.middlewareStack,this.config,n);if(o)c(e).then((i)=>o(null,i.output),(i)=>o(i)).catch(()=>{});else return c(e).then((i)=>i.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var fe=F(_(),1);class ue{constructor(){this.middlewareStack=A()}static classBuilder(){return new de}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,smithyContext:u,additionalContext:h,CommandCtor:g}){for(let w of n.bind(this)(g,e,t,r))this.middlewareStack.use(w);const a=e.concat(this.middlewareStack),{logger:f}=t,d={logger:f,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,[fe.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...h},{requestHandler:y}=t;return a.resolve((w)=>y.handle(w.request,r||{}),d)}}class de{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(e)=>e,this._outputFilterSensitiveLog=(e)=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let t;return t=class extends ue{static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=r??{},e._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}var Er=(e)=>{let t=e.httpHandler;return{setHttpHandler(r){t=r},httpHandler(){return t},updateHttpClientConfig(r,n){t.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},xr=(e)=>{return{httpHandler:e.httpHandler()}};var ft=F(_(),1);var ut=function(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})};class V{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new V({...e,headers:{...e.headers}});if(t.query)t.query=ut(t.query);return t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return V.clone(this)}}class U{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var O=F(ye(),1);function B(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=O.escapeUri(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)t.push(`${r}=${O.escapeUri(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${O.escapeUri(n)}`;t.push(o)}}return t.join("&")}import{Agent as Te,request as bt} from"http";import{Agent as Se,request as Tt} from"https";var ge=["ECONNRESET","EPIPE","ETIMEDOUT"];var J=(e)=>{const t={};for(let r of Object.keys(e)){const n=e[r];t[r]=Array.isArray(n)?n.join(","):n}return t};var we=(e,t,r=0)=>{if(!r)return-1;const n=(o)=>{const s=setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r-o),c=(i)=>{if(i?.connecting)i.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(e.socket)c(e.socket);else e.on("socket",c)};if(r<2000)return n(0),0;return setTimeout(n.bind(null,1000),1000)};var Ee=(e,{keepAlive:t,keepAliveMsecs:r},n=3000)=>{if(t!==!0)return-1;const o=()=>{if(e.socket)e.socket.setKeepAlive(t,r||0);else e.on("socket",(s)=>{s.setKeepAlive(t,r||0)})};if(n===0)return o(),0;return setTimeout(o,n)};var xe=(e,t,r=0)=>{const n=(o)=>{e.setTimeout(r-o,()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};if(0<r&&r<6000)return n(0),0;return setTimeout(n.bind(null,r===0?0:3000),3000)};import{Readable as Et} from"stream";async function Z(e,t,r=be){const n=t.headers??{},o=n.Expect||n.expect;let s=-1,c=!1;if(o==="100-continue")await Promise.race([new Promise((i)=>{s=Number(setTimeout(i,Math.max(be,r)))}),new Promise((i)=>{e.on("continue",()=>{clearTimeout(s),i()}),e.on("error",()=>{c=!0,clearTimeout(s),i()})})]);if(!c)xt(e,t.body)}var xt=function(e,t){if(t instanceof Et){t.pipe(e);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){e.end(t);return}const r=t;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()},be=1000;class Q{static create(e){if(typeof e?.handle==="function")return e;return new Q(e)}static checkSocketUsage(e,t,r=console){const{sockets:n,requests:o,maxSockets:s}=e;if(typeof s!=="number"||s===Infinity)return t;const c=15000;if(Date.now()-c<t)return t;if(n&&o)for(let i in n){const u=n[i]?.length??0,h=o[i]?.length??0;if(u>=s&&h>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${h} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((n)=>{t(this.resolveDefaultConfig(n))}).catch(r);else t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=e||{};return{connectionTimeout:r,requestTimeout:t??n,httpAgent:(()=>{if(o instanceof Te||typeof o?.destroy==="function")return o;return new Te({keepAlive:!0,maxSockets:50,...o})})(),httpsAgent:(()=>{if(s instanceof Se||typeof s?.destroy==="function")return s;return new Se({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((r,n)=>{let o=void 0;const s=[],c=async(l)=>{await o,s.forEach(clearTimeout),r(l)},i=async(l)=>{await o,s.forEach(clearTimeout),n(l)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const l=new Error("Request aborted");l.name="AbortError",i(l);return}const u=e.protocol==="https:",h=u?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=Q.checkSocketUsage(h,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const g=B(e.query||{});let a=void 0;if(e.username!=null||e.password!=null){const l=e.username??"",E=e.password??"";a=`${l}:${E}`}let f=e.path;if(g)f+=`?${g}`;if(e.fragment)f+=`#${e.fragment}`;let d=e.hostname??"";if(d[0]==="["&&d.endsWith("]"))d=e.hostname.slice(1,-1);else d=e.hostname;const y={headers:e.headers,host:d,method:e.method,path:f,port:e.port,agent:h,auth:a},p=(u?Tt:bt)(y,(l)=>{const E=new U({statusCode:l.statusCode||-1,reason:l.statusMessage,headers:J(l.headers),body:l});c({response:E})});if(p.on("error",(l)=>{if(ge.includes(l.code))i(Object.assign(l,{name:"TimeoutError"}));else i(l)}),t){const l=()=>{p.destroy();const E=new Error("Request aborted");E.name="AbortError",i(E)};if(typeof t.addEventListener==="function"){const E=t;E.addEventListener("abort",l,{once:!0}),p.once("close",()=>E.removeEventListener("abort",l))}else t.onabort=l}s.push(we(p,i,this.config.connectionTimeout)),s.push(xe(p,i,this.config.requestTimeout));const m=y.agent;if(typeof m==="object"&&"keepAlive"in m)s.push(Ee(p,{keepAlive:m.keepAlive,keepAliveMsecs:m.keepAliveMsecs}));o=Z(p,e,this.config.requestTimeout).catch((l)=>{return s.forEach(clearTimeout),n(l)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as St} from"stream";class G extends St{constructor(){super(...arguments);this.bufferedBytes=[]}_write(e,t,r){this.bufferedBytes.push(e),r()}}async function $t(e){const t=[],r=e.getReader();let n=!1,o=0;while(!n){const{done:i,value:u}=await r.read();if(u)t.push(u),o+=u.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of t)s.set(i,c),c+=i.length;return s}var Ce=(e)=>{if(Ct(e))return $t(e);return new Promise((t,r)=>{const n=new G;e.pipe(n),e.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.bufferedBytes));t(o)})})},Ct=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;var Cn="***SensitiveInformation***";var An=(e,t)=>{for(let r of Object.keys(e)){const n=e[r],o=async function(c,i,u){const h=new n(c);if(typeof i==="function")this.send(h,i);else if(typeof u==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(h,i||{},u)}else return this.send(h,i)},s=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");t.prototype[s]=o}};class $e extends Error{constructor(e){super(e.message);Object.setPrototypeOf(this,$e.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}var Ae=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(e[n]==null||e[n]==="")e[n]=o});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e};class At{trace(){}debug(){}info(){}warn(){}error(){}}var Ie=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";import{Buffer as K} from"buffer";var I=(e,t=0,r=e.byteLength-t)=>{if(!Ie(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return K.from(e,t,r)},v=(e,t)=>{if(typeof e!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?K.from(e,t):K.from(e)};var It=/^[A-Za-z0-9+/]*={0,2}$/,z=(e)=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!It.exec(e))throw new TypeError("Invalid base64 string.");const t=v(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var N=(e)=>{const t=v(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var vn=(e)=>{if(typeof e==="string")return N(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)};var W=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return I(e.buffer,e.byteOffset,e.byteLength).toString("utf8")};var H=(e)=>{let t;if(typeof e==="string")t=N(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return I(t.buffer,t.byteOffset,t.byteLength).toString("base64")};function Ne(e,t="utf-8"){if(t==="base64")return H(e);return W(e)}function Re(e,t){if(t==="base64")return T.mutate(z(e));return T.mutate(N(e))}class T extends Uint8Array{static fromString(e,t="utf-8"){switch(typeof e){case"string":return Re(e,t);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,T.prototype),e}transformToString(e="utf-8"){return Ne(this,e)}}import{Readable as Nt} from"stream";var io=(e,t)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:o,checksumLocationName:s,streamHasher:c}=t,i=r!==void 0&&o!==void 0&&s!==void 0&&c!==void 0,u=i?c(o,e):void 0,h=new Nt({read:()=>{}});return e.on("data",(g)=>{const a=n(g)||0;h.push(`${a.toString(16)}\r\n`),h.push(g),h.push("\r\n")}),e.on("end",async()=>{if(h.push("0\r\n"),i){const g=r(await u);h.push(`${s}:${g}\r\n`),h.push("\r\n")}h.push(null)}),h};import{Readable as ee} from"stream";import{TextDecoder as Bt} from"util";async function Rt(e){const t=await kt(e),r=z(t);return new Uint8Array(r)}async function Mt(e){const t=[],r=e.getReader();let n=!1,o=0;while(!n){const{done:i,value:u}=await r.read();if(u)t.push(u),o+=u.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of t)s.set(i,c),c+=i.length;return s}var kt=function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),c=s>-1?s+1:o.length;t(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})},Me=(e)=>{if(typeof Blob==="function"&&e instanceof Blob)return Rt(e);return Mt(e)};var ze=F(Oe(),1);var $=(e)=>typeof ReadableStream==="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);var Be="The stream has already been transformed.",We=(e)=>{if(!ve(e)&&!$(e)){const o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let t=!1;const r=async()=>{if(t)throw new Error(Be);return t=!0,await Me(e)},n=(o)=>{if(typeof o.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return o.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async(o)=>{const s=await r();if(o==="base64")return H(s);else if(o==="hex")return ze.toHex(s);else if(o===void 0||o==="utf8"||o==="utf-8")return W(s);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(Be);if(t=!0,ve(e))return n(e);else if($(e))return e;else throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},ve=(e)=>typeof Blob==="function"&&e instanceof Blob;var He="The stream has already been transformed.",Fo=(e)=>{if(!(e instanceof ee))try{return We(e)}catch(n){const o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let t=!1;const r=async()=>{if(t)throw new Error(He);return t=!0,await Ce(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{const o=await r();if(n===void 0||Buffer.isEncoding(n))return I(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new Bt(n).decode(o)},transformToWebStream:()=>{if(t)throw new Error(He);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof ee.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return t=!0,ee.toWeb(e)}})};import{PassThrough as qe} from"stream";async function je(e){if(typeof e.stream==="function")e=e.stream();return e.tee()}async function Bo(e){if($(e))return je(e);const t=new qe,r=new qe;return e.pipe(t),e.pipe(r),[t,r]}import{Writable as vt} from"stream";async function _e(e,t){let r=0;const n=[],o=e.getReader();let s=!1;while(!s){const{done:u,value:h}=await o.read();if(h)n.push(h),r+=h?.byteLength??0;if(r>=t)break;s=u}o.releaseLock();const c=new Uint8Array(Math.min(t,r));let i=0;for(let u of n){if(u.byteLength>c.byteLength-i){c.set(u.subarray(0,c.byteLength-i),i);break}else c.set(u,i);i+=u.length}return c}var qo=(e,t)=>{if($(e))return _e(e,t);return new Promise((r,n)=>{const o=new Ve;o.limit=t,e.pipe(o),e.on("error",(s)=>{o.end(),n(s)}),o.on("error",n),o.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.buffers));r(s)})})};class Ve extends vt{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(e,t,r){if(this.buffers.push(e),this.bytesBuffered+=e.byteLength??0,this.bytesBuffered>=this.limit){const n=this.bytesBuffered-this.limit,o=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=o.subarray(0,o.byteLength-n),this.emit("finish")}r()}}var es=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return T.mutate(e);if(!e)return T.mutate(new Uint8Array);const r=t.streamCollector(e);return T.mutate(await r)};var rs=(e)=>{switch(e){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${e}"`)}};var zt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){const t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))et.warn(Xe(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)},Wt=Math.ceil(340282346638528860000000000000000000000),Ye=(e)=>{const t=zt(e);if(t!==void 0&&!Number.isNaN(t)&&t!==Infinity&&t!==(-Infinity)){if(Math.abs(t)>Wt)throw new TypeError(`Expected 32-bit float, got ${e}`)}return t},te=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)};var Je=(e)=>re(e,32),Ze=(e)=>re(e,16),Qe=(e)=>re(e,8),re=(e,t)=>{const r=te(e);if(r!==void 0&&Ht(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},Ht=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},ns=(e,t)=>{if(e===null||e===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},os=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},ss=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return et.warn(Xe(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)};var Ge=(e)=>{if(typeof e=="string")return Ye(L(e));return Ye(e)},jt=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,L=(e)=>{const t=e.match(jt);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var is=(e)=>{if(typeof e==="string")return te(L(e));return te(e)};var cs=(e)=>{if(typeof e==="string")return Je(L(e));return Je(e)},R=(e)=>{if(typeof e==="string")return Ze(L(e));return Ze(e)},Ke=(e)=>{if(typeof e==="string")return Qe(L(e));return Qe(e)},Xe=(e)=>{return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join("\n")},et={warn:console.warn};function ds(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),o=e.getUTCDate(),s=e.getUTCHours(),c=e.getUTCMinutes(),i=e.getUTCSeconds(),u=o<10?`0${o}`:`${o}`,h=s<10?`0${s}`:`${s}`,g=c<10?`0${c}`:`${c}`,a=i<10?`0${i}`:`${i}`;return`${qt[n]}, ${u} ${oe[r]} ${t} ${h}:${g}:${a} GMT`}var qt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],oe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_t=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),ls=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=_t.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,u,h]=t,g=R(M(n)),a=b(o,"month",1,12),f=b(s,"day",1,31);return P(g,a,f,{hours:c,minutes:i,seconds:u,fractionalMilliseconds:h})},Vt=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),hs=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Vt.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,u,h,g]=t,a=R(M(n)),f=b(o,"month",1,12),d=b(s,"day",1,31),y=P(a,f,d,{hours:c,minutes:i,seconds:u,fractionalMilliseconds:h});if(g.toUpperCase()!="Z")y.setTime(y.getTime()-nr(g));return y},Yt=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Jt=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Zt=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),ps=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Yt.exec(e);if(t){const[r,n,o,s,c,i,u,h]=t;return P(R(M(s)),ne(o),b(n,"day",1,31),{hours:c,minutes:i,seconds:u,fractionalMilliseconds:h})}if(t=Jt.exec(e),t){const[r,n,o,s,c,i,u,h]=t;return Kt(P(Qt(s),ne(o),b(n,"day",1,31),{hours:c,minutes:i,seconds:u,fractionalMilliseconds:h}))}if(t=Zt.exec(e),t){const[r,n,o,s,c,i,u,h]=t;return P(R(M(h)),ne(n),b(o.trimLeft(),"day",1,31),{hours:s,minutes:c,seconds:i,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var P=(e,t,r,n)=>{const o=t-1;return er(e,o,r),new Date(Date.UTC(e,o,r,b(n.hours,"hour",0,23),b(n.minutes,"minute",0,59),b(n.seconds,"seconds",0,60),rr(n.fractionalMilliseconds)))},Qt=(e)=>{const t=(new Date()).getUTCFullYear(),r=Math.floor(t/100)*100+R(M(e));if(r<t)return r+100;return r},Gt=1576800000000,Kt=(e)=>{if(e.getTime()-(new Date()).getTime()>Gt)return new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()));return e},ne=(e)=>{const t=oe.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Xt=[31,28,31,30,31,30,31,31,30,31,30,31],er=(e,t,r)=>{let n=Xt[t];if(t===1&&tr(e))n=29;if(r>n)throw new TypeError(`Invalid day for ${oe[t]} in ${e}: ${r}`)},tr=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},b=(e,t,r,n)=>{const o=Ke(M(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},rr=(e)=>{if(e===null||e===void 0)return 0;return Ge("0."+e)*1000},nr=(e)=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1000},M=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)};var or=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{const o=sr(e),s=o.httpStatusCode?o.httpStatusCode+"":void 0,c=new r({name:t?.code||t?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw Ae(c,t)},gs=(e)=>{return({output:t,parsedBody:r,errorCode:n})=>{or({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})}},sr=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var Es=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var tt=!1,bs=(e)=>{if(e&&!tt&&parseInt(e.substring(1,e.indexOf(".")))<16)tt=!0};var se=F(_(),1);var rt=(e)=>{const t=[];for(let r in se.AlgorithmId){const n=se.AlgorithmId[r];if(e[n]===void 0)continue;t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},nt=(e)=>{const t={};return e.checksumAlgorithms().forEach((r)=>{t[r.algorithmId()]=r.checksumConstructor()}),t};var ot=(e)=>{let t=e.retryStrategy;return{setRetryStrategy(r){t=r},retryStrategy(){return t}}},st=(e)=>{const t={};return t.retryStrategy=e.retryStrategy(),t};var Is=(e)=>{return{...rt(e),...ot(e)}};var Ns=(e)=>{return{...nt(e),...st(e)}};function ir(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var ie=function(){const e=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,e.prototype),r};ie.prototype=Object.create(String.prototype,{constructor:{value:ie,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(ie,String);function cr(e,t,r){let n,o,s;if(typeof t==="undefined"&&typeof r==="undefined")n={},s=e;else if(n=e,typeof t==="function")return o=t,s=r,ar(n,o,s);else s=t;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){n[c]=s[c];continue}it(n,null,s,c)}return n}var Ds=(e,t)=>{const r={};for(let n in t)it(r,e,t,n);return r},ar=(e,t,r)=>{return cr(e,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[t,s()];else n[o]=[t,s];return n},{}))},it=(e,t,r,n)=>{if(t!==null){let c=r[n];if(typeof c==="function")c=[,c];const[i=fr,u=ur,h=n]=c;if(typeof i==="function"&&i(t[h])||typeof i!=="function"&&!!i)e[n]=u(t[h]);return}let[o,s]=r[n];if(typeof s==="function"){let c;const i=o===void 0&&(c=s())!=null,u=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(i)e[n]=c;else if(u)e[n]=s()}else{const c=o===void 0&&s!=null,i=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(c||i)e[n]=s}},fr=(e)=>e!=null,ur=(e)=>e;var zs=(e)=>e.toISOString().replace(".000Z","Z");var ct=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map(ct);if(typeof e==="object"){const t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=ct(e[r])}return t}return e};export{Er as ya,xr as za,V as Aa,U as Ba,Ie as Ca,I as Da,v as Ea,N as Fa,vn as Ga,W as Ha,At as Ia,at as Ja,z as Ka,H as La,io as Ma,ye as Na,Q as Oa,Ce as Pa,Oe as Qa,Fo as Ra,Bo as Sa,qo as Ta,es as Ua,ue as Va,Cn as Wa,An as Xa,rs as Ya,te as Za,Je as _a,ns as $a,os as ab,ss as bb,is as cb,cs as db,ds as eb,ls as fb,hs as gb,ps as hb,$e as ib,Ae as jb,gs as kb,Es as lb,bs as mb,Is as nb,Ns as ob,ir as pb,cr as qb,Ds as rb,zs as sb,ct as tb};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{C as D} from"./chunk-24a86f8f5ddc0cbd.js";var C=D((h,A)=>{var{defineProperty:Q,getOwnPropertyDescriptor:M,getOwnPropertyNames:J}=Object,V=Object.prototype.hasOwnProperty,I=(j,b)=>Q(j,"name",{value:b,configurable:!0}),w=(j,b)=>{for(var F in b)Q(j,F,{get:b[F],enumerable:!0})},O=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of J(b))if(!V.call(j,G)&&G!==F)Q(j,G,{get:()=>b[G],enumerable:!(B=M(b,G))||B.enumerable})}return j},q=(j)=>O(Q({},"__esModule",{value:!0}),j),Y={};w(Y,{CredentialsProviderError:()=>L,ProviderError:()=>U,TokenProviderError:()=>S,chain:()=>T,fromStatic:()=>N,memoize:()=>R});A.exports=q(Y);var Z=class j extends Error{constructor(b,F=!0){var B;let G,H=!0;if(typeof F==="boolean")G=void 0,H=F;else if(F!=null&&typeof F==="object")G=F.logger,H=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=H,Object.setPrototypeOf(this,j.prototype),(B=G==null?void 0:G.debug)==null||B.call(G,`@smithy/property-provider ${H?"->":"(!)"} ${b}`)}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}};I(Z,"ProviderError");var U=Z,$=class j extends U{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}};I($,"CredentialsProviderError");var L=$,z=class j extends U{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}};I(z,"TokenProviderError");var S=z,T=I((...j)=>async()=>{if(j.length===0)throw new U("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B==null?void 0:B.tryNextLink)continue;throw B}throw b},"chain"),N=I((j)=>()=>Promise.resolve(j),"fromStatic"),R=I((j,b,F)=>{let B,G,H,W=!1;const X=I(async()=>{if(!G)G=j();try{B=await G,H=!0,W=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();return B};return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();if(W)return B;if(F&&!F(B))return W=!0,B;if(b(B))return await X(),B;return B}},"memoize")});
|
|
2
|
-
export{C as
|
|
2
|
+
export{C as xb};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-
|
|
2
|
+
import{B} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-786985b106091b91.js";import{xb as D} from"./chunk-b0131f371340bf21.js";import{Ab as K,Gb as E} from"./chunk-a96c2e272f0ddf6c.js";var Z=B(D(),1);var $=B(D(),1);var C=B(D(),1),A=(y,c,_)=>{const b={EcsContainer:async(x)=>{const{fromHttp:w}=await import("./chunk-6fbe844659c3b67d.js"),{fromContainerMetadata:k}=await import("./chunk-905d85c9a9ca1c9e.js");return _?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),C.chain(w(x??{}),k(x))},Ec2InstanceMetadata:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:w}=await import("./chunk-905d85c9a9ca1c9e.js");return w(x)},Environment:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:w}=await import("./chunk-f6597f92f878d2dc.js");return w(x)}};if(y in b)return b[y];else throw new C.CredentialsProviderError(`Unsupported credential source in profile ${c}. Got ${y}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:_})};var J=(y,{profile:c="default",logger:_}={})=>{return Boolean(y)&&typeof y==="object"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1&&["undefined","string"].indexOf(typeof y.external_id)>-1&&["undefined","string"].indexOf(typeof y.mfa_serial)>-1&&(H(y,{profile:c,logger:_})||R(y,{profile:c,logger:_}))},H=(y,{profile:c,logger:_})=>{const b=typeof y.source_profile==="string"&&typeof y.credential_source==="undefined";if(b)_?.debug?.(` ${c} isAssumeRoleWithSourceProfile source_profile=${y.source_profile}`);return b},R=(y,{profile:c,logger:_})=>{const b=typeof y.credential_source==="string"&&typeof y.source_profile==="undefined";if(b)_?.debug?.(` ${c} isCredentialSourceProfile credential_source=${y.credential_source}`);return b},L=async(y,c,_,b={})=>{_.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const x=c[y];if(!_.roleAssumer){const{getDefaultRoleAssumer:I}=await import("./chunk-4df444d8a20035e1.js");_.roleAssumer=I({..._.clientConfig,credentialProviderLogger:_.logger,parentClientConfig:_?.parentClientConfig},_.clientPlugins)}const{source_profile:w}=x;if(w&&w in b)throw new $.CredentialsProviderError("Detected a cycle attempting to resolve credentials for profile"+` ${K(_)}. Profiles visited: `+Object.keys(b).join(", "),{logger:_.logger});_.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${w?`source_profile=[${w}]`:`profile=[${y}]`}`);const k=w?j(w,c,_,{...b,[w]:!0},G(c[w]??{})):(await A(x.credential_source,y,_.logger)(_))();if(G(x))return k;else{const I={RoleArn:x.role_arn,RoleSessionName:x.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:x.external_id,DurationSeconds:parseInt(x.duration_seconds||"3600",10)},{mfa_serial:O}=x;if(O){if(!_.mfaCodeProvider)throw new $.CredentialsProviderError(`Profile ${y} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:_.logger,tryNextLink:!1});I.SerialNumber=O,I.TokenCode=await _.mfaCodeProvider(O)}const F=await k;return _.roleAssumer(F,I)}},G=(y)=>{return!y.role_arn&&!!y.credential_source};var Q=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.credential_process==="string",U=async(y,c)=>import("./chunk-833e8b963e935111.js").then(({fromProcess:_})=>_({...y,profile:c})());var V=async(y,c={})=>{const{fromSSO:_}=await import("./chunk-116e493e1848228a.js");return _({profile:y,logger:c.logger})()},W=(y)=>y&&(typeof y.sso_start_url==="string"||typeof y.sso_account_id==="string"||typeof y.sso_session==="string"||typeof y.sso_region==="string"||typeof y.sso_role_name==="string");var q=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.aws_access_key_id==="string"&&typeof y.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof y.aws_session_token)>-1&&["undefined","string"].indexOf(typeof y.aws_account_id)>-1,z=(y,c)=>{return c?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:y.aws_access_key_id,secretAccessKey:y.aws_secret_access_key,sessionToken:y.aws_session_token,...y.aws_credential_scope&&{credentialScope:y.aws_credential_scope},...y.aws_account_id&&{accountId:y.aws_account_id}})};var X=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.web_identity_token_file==="string"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1,Y=async(y,c)=>import("./chunk-a4e7e8a00a47ba85.js").then(({fromTokenFile:_})=>_({webIdentityTokenFile:y.web_identity_token_file,roleArn:y.role_arn,roleSessionName:y.role_session_name,roleAssumerWithWebIdentity:c.roleAssumerWithWebIdentity,logger:c.logger,parentClientConfig:c.parentClientConfig})());var j=async(y,c,_,b={},x=!1)=>{const w=c[y];if(Object.keys(b).length>0&&q(w))return z(w,_);if(x||J(w,{profile:y,logger:_.logger}))return L(y,c,_,b);if(q(w))return z(w,_);if(X(w))return Y(w,_);if(Q(w))return U(_,y);if(W(w))return await V(y,_);throw new Z.CredentialsProviderError(`Could not resolve credentials using profile: [${y}] in configuration/credentials file(s).`,{logger:_.logger})};var a=(y={})=>async()=>{y.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const c=await E(y);return j(K(y),c,y)};export{a as fromIni};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as h,C as G} from"./chunk-24a86f8f5ddc0cbd.js";import{
|
|
1
|
+
import{B as h,C as G} from"./chunk-24a86f8f5ddc0cbd.js";import{xb as I} from"./chunk-b0131f371340bf21.js";import{Ab as H,Eb as K} from"./chunk-a96c2e272f0ddf6c.js";var t=G((r,j)=>{var T=function(c){const i={};if(c=c.replace(/^\?/,""),c)for(let n of c.split("&")){let[F,f=null]=n.split("=");if(F=decodeURIComponent(F),f)f=decodeURIComponent(f);if(!(F in i))i[F]=f;else if(Array.isArray(i[F]))i[F].push(f);else i[F]=[i[F],f]}return i},o=Object.defineProperty,M=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyNames,U=Object.prototype.hasOwnProperty,O=(c,i)=>o(c,"name",{value:i,configurable:!0}),d=(c,i)=>{for(var n in i)o(c,n,{get:i[n],enumerable:!0})},v=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of Q(i))if(!U.call(c,f)&&f!==n)o(c,f,{get:()=>i[f],enumerable:!(F=M(i,f))||F.enumerable})}return c},J=(c)=>v(o({},"__esModule",{value:!0}),c),S={};d(S,{parseQueryString:()=>T});j.exports=J(S);O(T,"parseQueryString")});var a=G((y,Z)=>{var{defineProperty:w,getOwnPropertyDescriptor:x,getOwnPropertyNames:P}=Object,s=Object.prototype.hasOwnProperty,l=(c,i)=>w(c,"name",{value:i,configurable:!0}),m=(c,i)=>{for(var n in i)w(c,n,{get:i[n],enumerable:!0})},k=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of P(i))if(!s.call(c,f)&&f!==n)w(c,f,{get:()=>i[f],enumerable:!(F=x(i,f))||F.enumerable})}return c},q=(c)=>k(w({},"__esModule",{value:!0}),c),z={};m(z,{parseUrl:()=>X});Z.exports=q(z);var p=t(),X=l((c)=>{if(typeof c==="string")return X(new URL(c));const{hostname:i,pathname:n,port:F,protocol:f,search:E}=c;let N;if(E)N=p.parseQueryString(E);return{hostname:i,port:F?parseInt(F):void 0,protocol:f,path:n,query:N}},"parseUrl")});var R=h(I(),1);var b=h(I(),1);function C(c){try{const i=new Set(Array.from(c.match(/([A-Z_]){3,}/g)??[]));return i.delete("CONFIG"),i.delete("CONFIG_PREFIX_SEPARATOR"),i.delete("ENV"),[...i].join(", ")}catch(i){return c}}var B=(c,i)=>async()=>{try{const n=c(process.env);if(n===void 0)throw new Error;return n}catch(n){throw new b.CredentialsProviderError(n.message||`Not found in ENV: ${C(c.toString())}`,{logger:i})}};var L=h(I(),1);var V=(c,{preferredFile:i="config",...n}={})=>async()=>{const F=H(n),{configFile:f,credentialsFile:E}=await K(n),N=E[F]||{},$=f[F]||{},D=i==="config"?{...N,...$}:{...$,...N};try{const A=c(D,i==="config"?f:E);if(A===void 0)throw new Error;return A}catch(g){throw new L.CredentialsProviderError(g.message||`Not found in config files w/ profile [${F}]: ${C(c.toString())}`,{logger:n.logger})}};var W=h(I(),1),u=(c)=>typeof c==="function",Y=(c)=>u(c)?async()=>await c():W.fromStatic(c);var wi=({environmentVariableSelector:c,configFileSelector:i,default:n},F={})=>R.memoize(R.chain(B(c),V(i,F),Y(n)));export{a as vb,wi as wb};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{B as _} from"./chunk-24a86f8f5ddc0cbd.js";import{
|
|
2
|
+
import{B as _} from"./chunk-24a86f8f5ddc0cbd.js";import{xb as S} from"./chunk-b0131f371340bf21.js";var E=_(S(),1),p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",I="AWS_CREDENTIAL_SCOPE",a="AWS_ACCOUNT_ID",i=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");const o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[I],c=process.env[a];if(o&&r)return{accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...c&&{accountId:c}};throw new E.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{i as fromEnv,C as ENV_SESSION,A as ENV_SECRET,p as ENV_KEY,N as ENV_EXPIRATION,I as ENV_CREDENTIAL_SCOPE,a as ENV_ACCOUNT_ID};export{p as u,A as v,i as w};
|
package/dist/client/index.js
CHANGED
|
@@ -30837,12 +30837,7 @@ function init(RootLayout) {
|
|
|
30837
30837
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30838
30838
|
/* @__PURE__ */ jsx(Fragment, {}),
|
|
30839
30839
|
/* @__PURE__ */ jsx(ServerDataProvider, { children: /* @__PURE__ */ jsx(ClientRouter, { RootLayout }) })
|
|
30840
|
-
] })
|
|
30841
|
-
{
|
|
30842
|
-
onRecoverableError: (error, errorInfo) => {
|
|
30843
|
-
console.log({ error, errorInfo });
|
|
30844
|
-
}
|
|
30845
|
-
}
|
|
30840
|
+
] })
|
|
30846
30841
|
);
|
|
30847
30842
|
}
|
|
30848
30843
|
function createRoot(RootLayout) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,QAUlD"}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as Zf,b as Ui,c as qi,d as Lf,e as wl,g as Fs,h as Rs,i as xa,j as qf,k as xf,m as _f,n as Gf} from"../http/index.js";import{o as Ol} from"../facades/index.js";import{p as Qf,q as Jf,r as Yf,s as Bf,t as Kf} from"../services/index.js";import"../chunk-5f01223b8fbe1ed8.js";import{A as jt,z as jl} from"../chunk-9475c6ed18013dc8.js";import"../chunk-24a86f8f5ddc0cbd.js";import"../chunk-332553172e3ab961.js";import{E as zf,F as Uf} from"../chunk-7d5fe4acabfee228.js";import"../chunk-0ba2cc302113ab40.js";import"../chunk-28694e5e949df0ff.js";import"../chunk-519593bc19f7cb9f.js";import"../chunk-69b5648fcd0f0a18.js";import"../chunk-6b18189b2aabf6b7.js";import"../chunk-5806220e55ac164c.js";import"../chunk-b4cbb4706a35f5d5.js";import"../chunk-cc7158438e52b9ab.js";import"../chunk-fa61561237819f16.js";var Za=function(a,s,t,i,o){function r(...d){if(!(this instanceof r))throw new TypeError(jr);hf(this,s(...d))}function l(d,u){return Object.defineProperties(function(...f){return d.call(this,c(this),...f)},oo(u))}function c(d){const u=k(d);if(!u||u.branding!==a)throw new TypeError(jr);return u}return Object.defineProperties(r.prototype,{...Ul(ya(l,t)),...ds(ya(l,i)),...Gt("Temporal."+a)}),Object.defineProperties(r,{...ds(o),...oo(a)}),[r,(d)=>{const u=Object.create(r.prototype);return hf(u,d),u},c]},Tf=function(a){return a=a.concat("id").sort(),(s)=>{if(!Ql(s,a))throw new TypeError(Iu);return s}},Xs=function(a){if(k(a)||a.calendar!==void 0||a.timeZone!==void 0)throw new TypeError(Cu);return a},Ai=function(a,s){const t={};for(let i in a)t[i]=({o},r)=>{const l=k(r)||{},{branding:c}=l,d=c===Os||s.includes(c)?l:ra(r);return o[i](d)};return t},ll=function(a){const s={};for(let t in a)s[t]=(i)=>{const{calendar:o}=i;return(r=o,typeof r=="string"?Us(r):(l=r,Object.assign(Object.create(dh),{i:l})))[t](i);var r,l};return s},is=function(){throw new TypeError(Lu)},vt=function({calendar:a}){return typeof a=="string"?new Pl(a):a},ff=function(a,s){if(s=H(s),_(a)){const i=k(a);if(i&&i.branding===Gs)return S(s),i;const o=yf(a);return Or(zi(o||w),!o,a,s)}const t=sd(Us,a);return S(s),t},bf=function(a,s,t){return i=s.call(a,oa(G(t))),$o(ut(i));var i},Ei=function(a,s=vf){const t=Object.keys(s).sort(),i={};for(let o of t)i[o]=D(s[o],a,Bu(a[o]));return i},n=function(a,s){return typeof a=="string"?xi(a):Ei(a,s)},J=function(a){return n(a,rl)},ja=function(a){if(_(a)){const s=k(a);if(s)switch(s.branding){case Zi:return s;case za:return G(s.epochNanoseconds)}}return Xc(a)};var pf=function(a,s,t){const i=s.l(ja(t).epochNanoseconds,a);return i?oa(G(i)):null},M=function(a){return _(a)?(k(a)||{}).timeZone||gh(a):((s)=>Pi(rd(x(s))))(a)},ea=function(a,s){if(_(a)){const t=k(a)||{};switch(t.branding){case Ci:return S(s),t;case ys:return S(s),Sa(t);case za:return S(s),Fr(J,t)}return Nd(a,s)}return S(s),td(a)},cl=function(a){return a===void 0?void 0:ea(a)},Ys=function(a,s){if(s=H(s),_(a)){const i=k(a);return i&&i.branding===_s?(S(s),i):br($i(Ft(a)),a,s)}const t=ad(Us,a);return S(s),t},as=function(a,s){if(s=H(s),_(a)){const i=k(a)||{};switch(i.branding){case ys:return S(s),i;case Os:return S(s),W({...i,...Oa});case za:return S(s),Sr(J,i)}return Wd(Ji(Ft(a)),a,s)}const t=ec(a);return S(s),t},ra=function(a,s){if(s=H(s),_(a)){const i=k(a)||{};switch(i.branding){case Os:return S(s),i;case ys:return S(s),N(i);case za:return S(s),vr(J,i)}return Tr(Ji(Ft(a)),a,s)}const t=hi(a);return S(s),t},Of=function(a,s,t){return Da(s.call(a,A(N(t,a))))},La=function(a){return(s)=>typeof s=="string"?Us(s):((t,i)=>{const o=Object.keys(i).sort(),r={};for(let l of o)r[l]=D(i[l],t,t[l]);return r})(s,a)},I=function(a){if(_(a)){const s=k(a);return s&&s.branding===Li?s:$d(a)}return id(a)},St=function(a){if(a!==void 0){if(_(a)){const s=k(a)||{};switch(s.branding){case za:case Os:return s;case ys:return N(s)}const t=Ft(a);return{...Ed(M,n,Ji(t),a),calendar:t}}return kc(a)}},Ft=function(a){return yf(a)||w},yf=function(a){const{calendar:s}=a;if(s!==void 0)return X(s)},X=function(a){return _(a)?(k(a)||{}).calendar||Ch(a):((s)=>mt(od(x(s))))(a)},Bs=function(a,s){if(s=H(s),_(a)){const t=k(a);if(t&&t.branding===za)return ft(s),t;const i=Ft(a);return Hd(M,n,Ji(i),i,a,s)}return Vc(a,s)},mf=function(a){return ya((s)=>(t)=>s(ol(t)),a)},ol=function(a){return ta(a,J)},Ym=function(){const a=Va.prototype,s=Object.getOwnPropertyDescriptors(a),t=Object.getOwnPropertyDescriptors(Va),i=function(o,r={}){if(!(this instanceof i))return new i(o,r);Tl.set(this,((l,c={})=>{const d=new Va(l,c),u=d.resolvedOptions(),f=u.locale,p=pa(Object.keys(c),u),m=ua(Xm),h=(...g)=>{let P;const T=g.map((O,b)=>{const y=k(O),E=(y||{}).branding;if(b&&P&&P!==E)throw new TypeError(Hu);return P=E,y});return P?m(P)(f,p,...T):[d,...g]};return h.u=d,h})(o,r))};for(let o in s){const r=s[o],l=o.startsWith("format")&&Bm(o);typeof r.value=="function"?r.value=o==="constructor"?i:l||Km(o):l&&(r.get=function(){return l.bind(this)})}return t.prototype.value=Object.create(a,s),Object.defineProperties(i,t),i},Bm=function(a){return function(...s){const t=Tl.get(this),[i,...o]=t(...s);return i[a](...o)}},Km=function(a){return function(...s){return Tl.get(this).u[a](...s)}},Xm=function(a){const s=km[a];if(!s)throw new TypeError(Eu(a));return Na(s,ua(nr))};var la=function(a,s,t,i,o){return Pa(s,Gl(a,s),t,i,o)},Pa=function(a,s,t,i,o,r){const l=Xi(s,t,i);if(o&&s!==l)throw new RangeError(Mu(a,s,t,i,r));return l},Gl=function(a,s){const t=a[s];if(t===void 0)throw new TypeError(Rr(s));return t},_=function(a){return a!==null&&/object|function/.test(typeof a)},ua=function(a,s=Map){const t=new s;return(i,...o)=>{if(t.has(i))return t.get(i);const r=a(i,...o);return t.set(i,r),r}},oo=function(a){return ds({name:a},1)},ds=function(a,s){return ya((t)=>({value:t,configurable:1,writable:!s}),a)},Ul=function(a){return ya((s)=>({get:s,configurable:1}),a)},Gt=function(a){return{[Symbol.toStringTag]:{value:a,configurable:1}}},Is=function(a,s){const t={};let i=a.length;for(let o of s)t[a[--i]]=o;return t},ya=function(a,s,t){const i={};for(let o in s)i[o]=a(s[o],o,t);return i},ct=function(a,s,t){const i={};for(let o=0;o<s.length;o++){const r=s[o];i[r]=a(r,o,t)}return i},Vf=function(a,s,t){const i={};for(let o=0;o<a.length;o++)i[s[o]]=t[a[o]];return i},pa=function(a,s){const t={};for(let i of a)t[i]=s[i];return t},ro=function(a,s){const t={};for(let i in s)a.has(i)||(t[i]=s[i]);return t},lo=function(a){a={...a};const s=Object.keys(a);for(let t of s)a[t]===void 0&&delete a[t];return a},Ql=function(a,s){for(let t of s)if(!(t in a))return 0;return 1},Yl=function(a,s,t){for(let i of a)if(s[i]!==t[i])return 0;return 1},Bl=function(a,s,t){const i={...t};for(let o=0;o<s;o++)i[a[o]]=0;return i},D=function(a,...s){return(...t)=>a(...s,...t)},Cl=function(a){return a[0].toUpperCase()+a.substring(1)},dt=function(a){return a.slice().sort()},Et=function(a,s){return String(s).padStart(a,"0")},qa=function(a,s){return Math.sign(a-s)},Xi=function(a,s,t){return Math.min(Math.max(a,s),t)},Aa=function(a,s){return[Math.floor(a/s),at(a,s)]},at=function(a,s){return(a%s+s)%s},Ua=function(a,s){return[Ut(a,s),co(a,s)]},Ut=function(a,s){return Math.trunc(a/s)||0},co=function(a,s){return a%s||0},Ct=function(a){return Math.abs(a%1)===0.5},Kl=function(a,s,t){let i=0,o=0;for(let c=0;c<=s;c++){const d=a[t[c]],u=Ra[c],f=F/u,[p,m]=Ua(d,f);i+=m*u,o+=p}const[r,l]=Ua(i,F);return[o+r,l]},Qt=function(a,s,t){const i={};for(let o=s;o>=0;o--){const r=Ra[o];i[t[o]]=Ut(a,r),a=co(a,r)}return i},Xl=function(a){return a===w?Ri:[]},kl=function(a){return a===w?Ot:[]},Vl=function(a){return a===w?["year","day"]:[]},el=function(a){if(a!==void 0)return x(a)},ac=function(a){if(a!==void 0)return Da(a)},uo=function(a){if(a!==void 0)return ut(a)},Da=function(a){return ic(ut(a))},ut=function(a){return tc(_p(a))},fo=function(a){if(a==null)throw new TypeError("Cannot be null or undefined");return a},sc=function(a,s){if(s==null)throw new RangeError(Rr(a));return s},Ha=function(a){if(!_(a))throw new TypeError(Ru);return a},Yt=function(a,s,t=a){if(typeof s!==a)throw new TypeError(Pt(t,s));return s},tc=function(a,s="number"){if(!Number.isInteger(a))throw new RangeError(gp(s,a));return a||0},ic=function(a,s="number"){if(a<=0)throw new RangeError(Pp(s,a));return a},po=function(a){if(typeof a=="symbol")throw new TypeError(yp);return String(a)},Ht=function(a,s){return _(a)?String(a):x(a,s)},Bt=function(a){if(typeof a=="string")return BigInt(a);if(typeof a!="bigint")throw new TypeError(Op(a));return a},oc=function(a,s="number"){if(typeof a=="bigint")throw new TypeError(bp(s));if(a=Number(a),!Number.isFinite(a))throw new RangeError(Tp(s,a));return a},V=function(a,s){return Math.trunc(oc(a,s))||0},rc=function(a,s){return tc(oc(a,s),s)},Zl=function(a,s){return ic(V(a,s),s)},mo=function(a,s){let[t,i]=Ua(s,F),o=a+t;const r=Math.sign(o);return r&&r===-Math.sign(i)&&(o-=r,i+=r*F),[o,i]},js=function(a,s,t=1){return mo(a[0]+s[0]*t,a[1]+s[1]*t)},Cs=function(a,s){return mo(a[0],a[1]+s)},ma=function(a,s){return js(s,a,-1)},aa=function(a,s){return qa(a[0],s[0])||qa(a[1],s[1])},lc=function(a,s,t){return aa(a,s)===-1||aa(a,t)===1},Kt=function(a,s=1){const t=BigInt(F/s);return[Number(a/t),Number(a%t)*s]},Zs=function(a,s=1){const t=F/s,[i,o]=Ua(a,t);return[i,o*s]},cc=function(a,s=1){const[t,i]=a,o=Math.floor(i/s),r=F/s;return BigInt(t)*BigInt(r)+BigInt(o)},ha=function(a,s=1,t){const[i,o]=a,[r,l]=Ua(o,s);return i*(F/s)+(r+(t?l/s:0))},ho=function(a,s,t=Aa){const[i,o]=a,[r,l]=t(o,s);return[i*(F/s)+r,l]},go=function(a,s){const t=a.formatToParts(s),i={};for(let o of t)i[o.type]=o.value;return i},Po=function(a){return la(a,"isoYear",lt,rt,1),a.isoYear===lt?la(a,"isoMonth",4,12,1):a.isoYear===rt&&la(a,"isoMonth",1,9,1),a},_a=function(a){return Wa({...a,...Oa,isoHour:12}),a},Wa=function(a){const s=la(a,"isoYear",lt,rt,1),t=s===lt?1:s===rt?-1:0;return t&&ga(e({...a,isoDay:a.isoDay+t,isoNanosecond:a.isoNanosecond-t})),a},ga=function(a){if(!a||lc(a,Xp,Kp))throw new RangeError(Si);return a},Qa=function(a){return Kl(a,5,Fa)[1]},Xt=function(a){const[s,t]=Aa(a,F);return[Qt(t,5,Fa),s]},dc=function(a){return uc(a)[0]},uc=function(a){return ho(a,ba)},sa=function(a){return As(a.isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond,a.isoMillisecond)},e=function(a){const s=sa(a);if(s!==void 0){const[t,i]=Ua(s,da);return[t,i*Ma+(a.isoMicrosecond||0)*bs+(a.isoNanosecond||0)]}},To=function(a,s){const[t,i]=Xt(Qa(a)-s);return ga(e({...a,isoDay:a.isoDay+i,...t}))},Wt=function(...a){return As(...a)/Nu},As=function(...a){const[s,t]=fc(...a),i=s.valueOf();if(!isNaN(i))return i-t*da},fc=function(a,s=1,t=1,i=0,o=0,r=0,l=0){const c=a===lt?1:a===rt?-1:0,d=new Date;return d.setUTCHours(i,o,r,l),d.setUTCFullYear(a,s-1,t+c),[d,c]},Ba=function(a,s){let[t,i]=Cs(a,s);i<0&&(i+=F,t-=1);const[o,r]=Aa(i,Ma),[l,c]=Aa(r,bs);return kt(t*da+o,l,c)},kt=function(a,s=0,t=0){const i=Math.ceil(Math.max(0,Math.abs(a)-Bp)/da)*Math.sign(a),o=new Date(a-i*da);return Is(ji,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+i,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,t])},pc=function(a){return[a.isoYear,a.isoMonth,a.isoDay]},mc=function(){return Ia},bo=function(a,s){switch(s){case 2:return Oo(a)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},hc=function(a){return Oo(a)?366:365},Oo=function(a){return a%4==0&&(a%100!=0||a%400==0)},gc=function(a){const[s,t]=fc(a.isoYear,a.isoMonth,a.isoDay);return at(s.getUTCDay()-t,7)||7},Pc=function({isoYear:a}){return a<1?["bce",1-a]:["ce",a]},ef=function(a){const s=sa(a);if(s<Vp)return Pc(a);const t=go(Gr(Ls),s),{era:i,eraYear:o}=Rd(t,Ls);return[i,o]},Vt=function(a){return us(a),et(a,1),a},us=function(a){return Tc(a,1),a},Ll=function(a){return Yl(Hr,a,Tc(a))},Tc=function(a,s){const{isoYear:t}=a,i=la(a,"isoMonth",1,mc(),s);return{isoYear:t,isoMonth:i,isoDay:la(a,"isoDay",1,bo(t,i),s)}},et=function(a,s){return Is(Fa,[la(a,"isoHour",0,23,s),la(a,"isoMinute",0,59,s),la(a,"isoSecond",0,59,s),la(a,"isoMillisecond",0,999,s),la(a,"isoMicrosecond",0,999,s),la(a,"isoNanosecond",0,999,s)])},S=function(a){return a===void 0?0:sf(Ha(a))},ft=function(a,s=0){a=wa(a);const t=tf(a),i=dm(a,s);return[sf(a),i,t]},yo=function(a){return tf(wa(a))},bc=function(a){return a=wa(a),$r(a,9,6,1)},Es=function(a,s,t,i=9,o=0,r=4){s=wa(s);let l=$r(s,i,o),c=So(s),d=Dt(s,r);const u=yt(s,i,o,1);return l==null?l=Math.max(t,u):wc(l,u),c=vo(c,u,1),a&&(d=((f)=>f<4?(f+2)%4:f)(d)),[l,u,c,d]},ai=function(a,s=6,t){let i=So(a=Fo(a,_t));const o=Dt(a,7);let r=yt(a,s);return r=sc(_t,r),i=vo(i,r,void 0,t),[r,i,o]},Do=function(a){return Jr(wa(a))},Oc=function(a,s){return wo(wa(a),s)},wo=function(a,s=4){const t=Dc(a);return[Dt(a,4),...yc(yt(a,s),t)]},yc=function(a,s){return a!=null?[Ra[a],a<4?9-3*a:-1]:[s===void 0?1:10**(9-s),s]},So=function(a){const s=a[st];return s===void 0?1:V(s,st)},vo=function(a,s,t,i){const o=i?F:Ra[s+1];if(o){const r=Ra[s];if(o%((a=Pa(st,a,1,o/r-(i?0:1),1))*r))throw new RangeError(Pt(st,a))}else a=Pa(st,a,1,t?1e9:1,1);return a},Dc=function(a){let s=a[Ki];if(s!==void 0){if(typeof s!="number"){if(po(s)==="auto")return;throw new RangeError(Pt(Ki,s))}s=Pa(Ki,Math.floor(s),0,9,1)}return s},wa=function(a){return a===void 0?{}:Ha(a)},Fo=function(a,s){return typeof a=="string"?{[s]:a}:Ha(a)},H=function(a){if(a!==void 0){if(_(a))return Object.assign(Object.create(null),a);throw new TypeError(Ru)}},si=function(a,s){return a&&Object.assign(Object.create(null),a,{overflow:am[s]})},no=function(a,s,t=9,i=0,o){let r=s[a];if(r===void 0)return o?i:void 0;if(r=po(r),r==="auto")return o?i:null;let l=ao[r];if(l===void 0&&(l=Qp[r]),l===void 0)throw new RangeError(Zu(a,r,ao));return Pa(a,l,i,t,1,bt),l},fs=function(a,s,t,i=0){const o=t[a];if(o===void 0)return i;const r=po(o),l=s[r];if(l===void 0)throw new RangeError(Zu(a,r,s));return l},wc=function(a,s){if(s>a)throw new RangeError(Np)},G=function(a){return{branding:Zi,epochNanoseconds:a}},B=function(a,s,t){return{branding:za,calendar:t,timeZone:s,epochNanoseconds:a}},W=function(a,s=a.calendar){return{branding:ys,calendar:s,...pa(ku,a)}},N=function(a,s=a.calendar){return{branding:Os,calendar:s,...pa(Wr,a)}},ls=function(a,s=a.calendar){return{branding:_s,calendar:s,...pa(Wr,a)}},Nt=function(a,s=a.calendar){return{branding:Gs,calendar:s,...pa(Wr,a)}},Sa=function(a){return{branding:Ci,...pa(Xu,a)}},C=function(a){return{branding:Li,sign:Ka(a),...pa(Ir,a)}},Sc=function(a){return dc(a.epochNanoseconds)},ti=function(a){return ho(a.epochNanoseconds,Ma)[0]},vc=function(a){return cc(a.epochNanoseconds,bs)},Fc=function(a){return cc(a.epochNanoseconds)},nc=function(a){return a.epochNanoseconds},Q=function(a){return typeof a=="string"?a:x(a.id)},Hs=function(a,s){return a===s||Q(a)===Q(s)},Rc=function(a,s,t,i,o){const r=cs(i),[l,c]=((T,O)=>{const b=O((T=Fo(T,io))[eu]);let y=cm(T);return y=sc(io,y),[y,b]})(o,a);if(it(Math.max(l,r),c))return xl(i,l);if(!c)throw new RangeError(vi);const[d,u,f]=di(s,t,c),p=Ko(f),m=ui(f),h=Xo(f),g=m(u,d,i),P=h(u,d,g,l);return it(l,c)?xl(P,l):((T,O,b,y,E,Z,j)=>{const L=Ka(T),[U,z]=Ro(y,Er(b,T),b,L,E,Z,j),ks=Mo(O,U,z);return T[v[b]]+ks*L})(P,p(g),l,u,d,p,m)},xl=function(a,s){return ha(q(a),Ra[s],1)},Ro=function(a,s,t,i,o,r,l){const c=v[t],d={...s,[c]:s[c]+i},u=l(a,o,s),f=l(a,o,d);return[r(u),r(f)]},Mo=function(a,s,t){const i=ha(ma(s,t));if(!i)throw new RangeError(Tt);return ha(ma(s,a))/i},Mc=function(a,s){const[t,i,o]=ai(s,5,1);return G(oi(a.epochNanoseconds,t,i,o,1))},jc=function(a,s,t){let{epochNanoseconds:i,timeZone:o,calendar:r}=s;const[l,c,d]=ai(t);if(l===0&&c===1)return s;const u=a(o);if(l===6)i=((f,p,m,h)=>{const g=ta(m,p),[P,T]=f(g),O=m.epochNanoseconds,b=fa(p,P),y=fa(p,T);if(lc(O,b,y))throw new RangeError(Tt);return Wc(Mo(O,b,y),h)?y:b})(Ec,u,s,d);else{const f=u.getOffsetNanosecondsFor(i);i=ms(u,Ic(Ba(i,f),l,c,d),f,2,0,1)}return B(i,o,r)},Cc=function(a,s){return W(Ic(a,...ai(s)),a.calendar)},Zc=function(a,s){const[t,i,o]=ai(s,5);var r;return Sa((r=o,jo(a,pt(t,i),r)[0]))},Lc=function(a,s){const t=a(s.timeZone),i=ta(s,t),[o,r]=Ec(i),l=ha(ma(fa(t,o),fa(t,r)),ni,1);if(l<=0)throw new RangeError(Tt);return l},xc=function(a,s){const{timeZone:t,calendar:i}=s,o=((r,l,c)=>fa(l,r(ta(c,l))))(Hc,a(t),s);return B(o,t,i)},Ic=function(a,s,t,i){return Ac(a,pt(s,t),i)},Ac=function(a,s,t){const[i,o]=jo(a,s,t);return Wa({...hs(a,o),...i})},jo=function(a,s,t){return Xt(Ya(Qa(a),s,t))},$t=function(a){return Ya(a,Fi,7)},pt=function(a,s){return Ra[a]*s},Ec=function(a){const s=Hc(a);return[s,hs(s,1)]},Hc=function(a){return Yp(6,a)},ap=function(a,s,t){const i=Math.min(cs(a),6);return Ns(ri(q(a,i),s,t),i)},ii=function(a,s,t,i,o,r,l,c,d,u){if(i===0&&o===1)return a;const f=it(i,c)?fi(c)&&i<6&&t>=6?tp:sp:ip;let[p,m,h]=f(a,s,t,i,o,r,l,c,d,u);return h&&i!==7&&(p=((g,P,T,O,b,y,E,Z)=>{const j=Ka(g);for(let L=O+1;L<=T;L++){if(L===7&&T!==7)continue;const U=Er(L,g);U[v[L]]+=j;const z=ha(ma(E(Z(b,y,U)),P));if(z&&Math.sign(z)!==j)break;g=U}return g})(p,m,t,Math.max(6,i),l,c,d,u)),p},oi=function(a,s,t,i,o){if(s===6){const r=((l)=>l[0]+l[1]/F)(a);return[Ya(r,t,i),0]}return ri(a,pt(s,t),i,o)},ri=function(a,s,t,i){let[o,r]=a;i&&r<0&&(r+=F,o-=1);const[l,c]=Aa(Ya(r,s,t),F);return mo(o+l,c)},Ya=function(a,s,t){return Wc(a/s,t)*s},Wc=function(a,s){return pm[s](a)},sp=function(a,s,t,i,o,r){const l=Ka(a),c=q(a),d=oi(c,i,o,r),u=ma(c,d),f=Math.sign(d[0]-c[0])===l,p=Ns(d,Math.min(t,6));return[{...a,...p},js(s,u),f]},tp=function(a,s,t,i,o,r,l,c,d,u){const f=Ka(a),p=ha(q(a,5)),m=pt(i,o);let h=Ya(p,m,r);const[g,P]=Ro(l,{...a,...Ar},6,f,c,d,u),T=h-ha(ma(g,P));let O=0;T&&Math.sign(T)!==f?s=Cs(g,h):(O+=f,h=Ya(T,m,r),s=Cs(P,h));const b=mi(h);return[{...a,...b,days:a.days+O},s,Boolean(O)]},ip=function(a,s,t,i,o,r,l,c,d,u){const f=Ka(a),p=v[i],m=Er(i,a);i===7&&(a={...a,weeks:a.weeks+Math.trunc(a.days/7)});const h=Ut(a[p],o)*o;m[p]=h;const[g,P]=Ro(l,m,i,o*f,c,d,u),T=h+Mo(s,g,P)*f*o,O=Ya(T,o,r),b=Math.sign(O-T)===f;return m[p]=O,[m,b?P:g,b]},Co=function(a,s,t,i){const[o,r,l,c]=((u)=>{const f=wo(u=wa(u));return[u.timeZone,...f]})(i),d=o!==void 0;return((u,f,p,m,h,g)=>{p=ri(p,h,m,1);const P=f.getOffsetNanosecondsFor(p);return Ho(Ba(p,P),g)+(u?ps($t(P)):"Z")})(d,s(d?a(o):Ds),t.epochNanoseconds,r,l,c)},Zo=function(a,s,t){const[i,o,r,l,c,d]=((u)=>{u=wa(u);const f=Jr(u),p=Dc(u),m=fm(u),h=Dt(u,4),g=yt(u,4);return[f,um(u),m,h,...yc(g,p)]})(t);return((u,f,p,m,h,g,P,T,O,b)=>{m=ri(m,O,T,1);const y=u(p).getOffsetNanosecondsFor(m);return Ho(Ba(m,y),b)+ps($t(y),P)+((E,Z)=>Z!==1?"["+(Z===2?"!":"")+Q(E)+"]":"")(p,g)+Wo(f,h)})(a,s.calendar,s.timeZone,s.epochNanoseconds,i,o,r,l,c,d)},Lo=function(a,s){const[t,i,o,r]=((u)=>(u=wa(u),[Jr(u),...wo(u)]))(s);return l=a.calendar,c=t,d=r,Ho(Ac(a,o,i),d)+Wo(l,c);var l,c,d},xo=function(a,s){return t=a.calendar,i=a,o=Do(s),Jt(i)+Wo(t,o);var t,i,o},Io=function(a,s){return Nc(a.calendar,$c,a,Do(s))},Ao=function(a,s){return Nc(a.calendar,op,a,Do(s))},Eo=function(a,s){const[t,i,o]=Oc(s);return r=o,Jc(jo(a,i,t)[0],r);var r},li=function(a,s){const[t,i,o]=Oc(s,3);return i>1&&(a={...a,...ap(a,i,t)}),((r,l)=>{const{sign:c}=r,d=c===-1?ia(r):r,{hours:u,minutes:f}=d,[p,m]=ho(q(d,3),ba,Ua);Bc(p);const h=No(m,l),g=l>=0||!c||h;return(c<0?"-":"")+"P"+Il({Y:rs(d.years),M:rs(d.months),W:rs(d.weeks),D:rs(d.days)})+(u||f||p||g?"T"+Il({H:rs(u),M:rs(f),S:rs(p,g)+h}):"")})(a,o)},Nc=function(a,s,t,i){const o=Q(a),r=i>1||i===0&&o!==w;return i===1?o===w?s(t):Jt(t):r?Jt(t)+zc(o,i===2):s(t)},Il=function(a){const s=[];for(let t in a){const i=a[t];i&&s.push(i,t)}return s.join("")},Ho=function(a,s){return Jt(a)+"T"+Jc(a,s)},Jt=function(a){return $c(a)+"-"+Ta(a.isoDay)},$c=function(a){const{isoYear:s}=a;return(s<0||s>9999?qc(s)+Et(6,Math.abs(s)):Et(4,s))+"-"+Ta(a.isoMonth)},op=function(a){return Ta(a.isoMonth)+"-"+Ta(a.isoDay)},Jc=function(a,s){const t=[Ta(a.isoHour),Ta(a.isoMinute)];return s!==-1&&t.push(Ta(a.isoSecond)+((i,o,r,l)=>No(i*Ma+o*bs+r,l))(a.isoMillisecond,a.isoMicrosecond,a.isoNanosecond,s)),t.join(":")},ps=function(a,s=0){if(s===1)return"";const[t,i]=Aa(Math.abs(a),ni),[o,r]=Aa(i,Fi),[l,c]=Aa(r,ba);return qc(a)+Ta(t)+":"+Ta(o)+(l||c?":"+Ta(l)+No(c):"")},Wo=function(a,s){if(s!==1){const t=Q(a);if(s>1||s===0&&t!==w)return zc(t,s===2)}return""},zc=function(a,s){return"["+(s?"!":"")+"u-ca="+a+"]"},No=function(a,s){let t=Et(9,a);return t=s===void 0?t.replace(gm,""):t.slice(0,s),t?"."+t:""},qc=function(a){return a<0?"-":"+"},rs=function(a,s){return a||s?a.toLocaleString("fullwide",{useGrouping:0}):""},rp=function(a,s){const{epochNanoseconds:t}=a,i=(s.getOffsetNanosecondsFor?s:s(a.timeZone)).getOffsetNanosecondsFor(t),o=Ba(t,i);return{calendar:a.calendar,...o,offsetNanoseconds:i}},_c=function(a,s){const t=ta(s,a);return{calendar:s.calendar,...pa(ku,t),offset:ps(t.offsetNanoseconds),timeZone:s.timeZone}},ms=function(a,s,t,i=0,o=0,r,l){if(t!==void 0&&i===1&&(i===1||l))return To(s,t);const c=a.getPossibleInstantsFor(s);if(t!==void 0&&i!==3){const d=((u,f,p,m)=>{const h=e(f);m&&(p=$t(p));for(let g of u){let P=ha(ma(g,h));if(m&&(P=$t(P)),P===p)return g}})(c,s,t,r);if(d!==void 0)return d;if(i===0)throw new RangeError(xp)}return l?e(s):fa(a,s,o,c)},fa=function(a,s,t=0,i=a.getPossibleInstantsFor(s)){if(i.length===1)return i[0];if(t===1)throw new RangeError(Ip);if(i.length)return i[t===3?1:0];const o=e(s),r=((c,d)=>{const u=c.getOffsetNanosecondsFor(Cs(d,-F));return Jo(c.getOffsetNanosecondsFor(Cs(d,F))-u)})(a,o),l=r*(t===2?-1:1);return(i=a.getPossibleInstantsFor(Ba(o,l)))[t===2?0:i.length-1]},$o=function(a){if(Math.abs(a)>=F)throw new RangeError(Zp);return a},Jo=function(a){if(a>F)throw new RangeError(Lp);return a},zo=function(a,s,t){return G(ga(js(s.epochNanoseconds,((i)=>{if(Kc(i))throw new RangeError(Hp);return q(i,5)})(a?ia(t):t))))},qo=function(a,s,t,i,o,r=Object.create(null)){const l=s(i.timeZone),c=a(i.calendar);return{...i,...Yo(l,c,i,t?ia(o):o,r)}},_o=function(a,s,t,i,o=Object.create(null)){const{calendar:r}=t;return W(Bo(a(r),t,s?ia(i):i,o),r)},Go=function(a,s,t,i,o){const{calendar:r}=t;return N(ci(a(r),t,s?ia(i):i,o),r)},Uo=function(a,s,t,i,o=Object.create(null)){const r=t.calendar,l=a(r);let c=tt(l,t);s&&(i=pi(i)),i.sign<0&&(c=l.dateAdd(c,{...Y,months:1}),c=hs(c,-1));const d=l.dateAdd(c,i,o);return ls(tt(l,d),r)},Qo=function(a,s,t){return Sa(Gc(s,a?ia(t):t)[0])},Yo=function(a,s,t,i,o){const r=q(i,5);let l=t.epochNanoseconds;if(Kc(i)){const c=ta(t,a);l=js(fa(a,{...ci(s,c,{...i,...Ar},o),...pa(Fa,c)}),r)}else l=js(l,r),S(o);return{epochNanoseconds:ga(l)}},Bo=function(a,s,t,i){const[o,r]=Gc(s,t);return Wa({...ci(a,s,{...t,...Ar,days:t.days+r},i),...o})},ci=function(a,s,t,i){if(t.years||t.months||t.weeks)return a.dateAdd(s,t,i);S(i);const o=t.days+q(t,5)[0];return o?_a(hs(s,o)):s},tt=function(a,s,t=1){return hs(s,t-a.day(s))},Gc=function(a,s){const[t,i]=q(s,5),[o,r]=Xt(Qa(a)+i);return[o,t+r]},hs=function(a,s){return s?{...a,...kt(sa(a)+s*da)}:a},di=function(a,s,t){const i=a(t.calendar);return fi(t)?[t,i,s(t.timeZone)]:[{...t,...Oa},i]},Ko=function(a){return a?nc:e},ui=function(a){return a?D(Yo,a):Bo},Xo=function(a){return a?D(cp,a):dp},fi=function(a){return a&&a.epochNanoseconds},it=function(a,s){return a<=6-(fi(s)?1:0)},ko=function(a,s,t,i,o,r,l){const c=a(wa(l).relativeTo),d=Math.max(cs(o),cs(r));if(it(d,c))return C(Ws(((P,T,O,b)=>{const y=js(q(P),q(T),b?-1:1);if(!Number.isFinite(y[0]))throw new RangeError(Si);return{...Y,...Ns(y,O)}})(o,r,d,i)));if(!c)throw new RangeError(vi);i&&(r=ia(r));const[u,f,p]=di(s,t,c),m=ui(p),h=Xo(p),g=m(f,u,o);return C(h(f,u,m(f,g,r),d))},Uc=function(a,s,t,i,o){const r=cs(i),[l,c,d,u,f]=((j,L,U)=>{j=Fo(j,_t);let z=$r(j);const ks=U(j[eu]);let Vs=So(j);const kf=Dt(j,7);let os=yt(j);if(z===void 0&&os===void 0)throw new RangeError(Wp);return os==null&&(os=0),z==null&&(z=Math.max(os,L)),wc(z,os),Vs=vo(Vs,os,1),[z,os,Vs,kf,ks]})(o,r,a),p=Math.max(r,l);if(!fi(f)&&p<=6)return C(Ws(((j,L,U,z,ks)=>{const Vs=oi(q(j),U,z,ks);return{...Y,...Ns(Vs,L)}})(i,l,c,d,u)));if(!f)throw new RangeError(vi);const[m,h,g]=di(s,t,f),P=Ko(g),T=ui(g),O=Xo(g),b=T(h,m,i);let y=O(h,m,b,l);const E=i.sign,Z=Ka(y);if(E&&Z&&E!==Z)throw new RangeError(Tt);return Z&&(y=ii(y,P(b),l,c,d,u,h,m,P,T)),C(y)},Qc=function(a){return a.sign===-1?pi(a):a},pi=function(a){return C(ia(a))},ia=function(a){const s={};for(let t of v)s[t]=-1*a[t]||0;return s},Yc=function(a){return!a.sign},Ka=function(a,s=v){let t=0;for(let i of s){const o=Math.sign(a[i]);if(o){if(t&&t!==o)throw new RangeError(Ep);t=o}}return t},Ws=function(a){for(let s of Up)Pa(s,a[s],-Jl,Jl,1);return Bc(ha(q(a),ba)),a},Bc=function(a){if(!Number.isSafeInteger(a))throw new RangeError(Ap)},q=function(a,s=6){return Kl(a,s,v)},Ns=function(a,s=6){const[t,i]=a,o=Qt(i,s,v);if(o[v[s]]+=t*(F/Ra[s]),!Number.isFinite(o[v[s]]))throw new RangeError(Si);return o},mi=function(a,s=5){return Qt(a,s,v)},Kc=function(a){return Boolean(Ka(a,Ku))},cs=function(a){let s=9;for(;s>0&&!a[v[s]];s--);return s},lp=function(a,s){return[a,s]},Al=function(a){const s=Math.floor(a/It)*It;return[s,s+It]},Xc=function(a){const s=Xa(a=Ht(a));if(!s)throw new RangeError(ca(a));let t;if(s.m)t=0;else{if(!s.offset)throw new RangeError(ca(a));t=$s(s.offset)}return s.timeZone&&sr(s.timeZone,1),G(To(Vt(s),t))},kc=function(a){const s=Xa(x(a));if(!s)throw new RangeError(ca(a));if(s.timeZone)return ld(s,s.offset?$s(s.offset):void 0);if(s.m)throw new RangeError(ca(a));return dd(s)},Vc=function(a,s){const t=Xa(x(a));if(!t||!t.timeZone)throw new RangeError(ca(a));const{offset:i}=t,o=i?$s(i):void 0,[,r,l]=ft(s);return ld(t,o,r,l)},$s=function(a){const s=sr(a);if(s===void 0)throw new RangeError(ca(a));return s},ec=function(a){const s=Xa(x(a));if(!s||s.m)throw new RangeError(ca(a));return W(cd(s))},hi=function(a){const s=Xa(x(a));if(!s||s.m)throw new RangeError(ca(a));return N(s.p?cd(s):dd(s))},ad=function(a,s){const t=eo(x(s));if(t)return Vo(t),ls(Po(us(t)));const i=hi(s);return ls(tt(a(i.calendar),i))},Vo=function(a){if(a.calendar!==w)throw new RangeError(Ea(a.calendar))},sd=function(a,s){const t=ar(x(s));if(t)return Vo(t),Nt(us(t));const i=hi(s),{calendar:o}=i,r=a(o),[l,c,d]=r.h(i),[u,f]=r.I(l,c),[p,m]=r.N(u,f,d);return Nt(_a(r.P(p,m,d)),o)},td=function(a){let s,t=((i)=>{const o=ym.exec(i);return o?(gi(o[10]),pd(o)):void 0})(x(a));if(!t){if(t=Xa(a),!t)throw new RangeError(ca(a));if(!t.p)throw new RangeError(ca(a));if(t.m)throw new RangeError(Ea("Z"));Vo(t)}if((s=eo(a))&&Ll(s))throw new RangeError(ca(a));if((s=ar(a))&&Ll(s))throw new RangeError(ca(a));return Sa(et(t,1))},id=function(a){const s=((t)=>{const i=Sm.exec(t);return i?((o)=>{function r(f,p,m){let h=0,g=0;if(m&&([h,d]=Aa(d,Ra[m])),f!==void 0){if(c)throw new RangeError(Ea(f));g=((P)=>{const T=parseInt(P);if(!Number.isFinite(T))throw new RangeError(Ea(P));return T})(f),l=1,p&&(d=tr(p)*(Ra[m]/ba),c=1)}return h+g}let l=0,c=0,d=0,u={...Is(v,[r(o[2]),r(o[3]),r(o[4]),r(o[5]),r(o[6],o[7],5),r(o[8],o[9],4),r(o[10],o[11],3)]),...Qt(d,2,v)};if(!l)throw new RangeError(ju(v));return ir(o[1])<0&&(u=ia(u)),u})(i):void 0})(x(a));if(!s)throw new RangeError(ca(a));return C(Ws(s))},od=function(a){const s=Xa(a)||eo(a)||ar(a);return s?s.calendar:a},rd=function(a){const s=Xa(a);return s&&(s.timeZone||s.m&&Ds||s.offset)||a},ld=function(a,s,t=0,i=0){const o=Pi(a.timeZone),r=xi(o);return B(ms(r,Vt(a),s,t,i,!r.v,a.m),o,mt(a.calendar))},cd=function(a){return ud(Wa(Vt(a)))},dd=function(a){return ud(_a(us(a)))},ud=function(a){return{...a,calendar:mt(a.calendar)}},Xa=function(a){const s=Om.exec(a);return s?((t)=>{const i=t[10],o=(i||"").toUpperCase()==="Z";return{isoYear:fd(t),isoMonth:parseInt(t[4]),isoDay:parseInt(t[5]),...pd(t.slice(5)),...gi(t[16]),p:Boolean(t[6]),m:o,offset:o?void 0:i}})(s):void 0},eo=function(a){const s=Tm.exec(a);return s?((t)=>({isoYear:fd(t),isoMonth:parseInt(t[4]),isoDay:1,...gi(t[5])}))(s):void 0},ar=function(a){const s=bm.exec(a);return s?((t)=>({isoYear:xs,isoMonth:parseInt(t[1]),isoDay:parseInt(t[2]),...gi(t[3])}))(s):void 0},sr=function(a,s){const t=Dm.exec(a);return t?((i,o)=>{const r=i[4]||i[5];if(o&&r)throw new RangeError(Ea(r));return $o((Ms(i[2])*ni+Ms(i[3])*Fi+Ms(i[4])*ba+tr(i[5]||""))*ir(i[1]))})(t,s):void 0},fd=function(a){const s=ir(a[1]),t=parseInt(a[2]||a[3]);if(s<0&&!t)throw new RangeError(Ea(-0));return s*t},pd=function(a){const s=Ms(a[3]);return{...Xt(tr(a[4]||""))[0],isoHour:Ms(a[1]),isoMinute:Ms(a[2]),isoSecond:s===60?59:s}},gi=function(a){let s,t;const i=[];if(a.replace(wm,(o,r,l)=>{const c=Boolean(r),[d,u]=l.split("=").reverse();if(u){if(u==="u-ca")i.push(d),s||(s=c);else if(c||/[A-Z]/.test(u))throw new RangeError(Ea(o))}else{if(t)throw new RangeError(Ea(o));t=d}return""}),i.length>1&&s)throw new RangeError(Ea(a));return{timeZone:t,calendar:i[0]||w}},tr=function(a){return parseInt(a.padEnd(9,"0"))},Js=function(a){return new RegExp(`^${a}\$`,"i")},ir=function(a){return a&&a!=="+"?-1:1},Ms=function(a){return a===void 0?0:parseInt(a)},md=function(a){return Pi(x(a))},Pi=function(a){const s=or(a);return typeof s=="number"?ps(s):s?((t)=>{if(Fm.test(t))throw new RangeError(Cp);return t.toLowerCase().split("/").map((i,o)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(r,l)=>r.length<=2&&!o||r==="in"||r==="chat"?r.toUpperCase():r.length>2||!l?Cl(r).replace(/island|noronha|murdo|rivadavia|urville/,Cl):r)).join("/")})(a):Ds},El=function(a){const s=or(a);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:Ds},or=function(a){const s=sr(a=a.toUpperCase(),1);return s!==void 0?s:a!==Ds?vm(a):void 0},rr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},lr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},hd=function(a,s,t,i,o,r){const l=a(wa(r).relativeTo),c=Math.max(cs(i),cs(o));if(Yl(v,i,o))return 0;if(it(c,l))return aa(q(i),q(o));if(!l)throw new RangeError(vi);const[d,u,f]=di(s,t,l),p=Ko(f),m=ui(f);return aa(p(m(u,d,i)),p(m(u,d,o)))},cr=function(a,s){return gs(a,s)||Ti(a,s)},gs=function(a,s){return qa(sa(a),sa(s))},Ti=function(a,s){return qa(Qa(a),Qa(s))},gd=function(a,s){return!rr(a,s)},Pd=function(a,s){return!lr(a,s)&&!!bi(a.timeZone,s.timeZone)&&Hs(a.calendar,s.calendar)},Td=function(a,s){return!cr(a,s)&&Hs(a.calendar,s.calendar)},bd=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},Od=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},yd=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},Dd=function(a,s){return!Ti(a,s)},bi=function(a,s){if(a===s)return 1;const t=Q(a),i=Q(s);if(t===i)return 1;try{return El(t)===El(i)}catch(o){}},dr=function(a,s,t,i){const o=Es(a,H(i),3,5),r=Oi(s.epochNanoseconds,t.epochNanoseconds,...o);return C(a?ia(r):r)},ur=function(a,s,t,i,o,r){const l=Di(i.calendar,o.calendar),c=H(r),[d,u,f,p]=Es(t,c,5),m=i.epochNanoseconds,h=o.epochNanoseconds,g=aa(h,m);let P;if(g)if(d<6)P=Oi(m,h,d,u,f,p);else{const T=s(((b,y)=>{if(!bi(b,y))throw new RangeError(Au);return b})(i.timeZone,o.timeZone)),O=a(l);P=Sd(O,T,i,o,g,d,c),P=ii(P,h,d,u,f,p,O,i,nc,D(Yo,T))}else P=Y;return C(t?ia(P):P)},fr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o),[c,d,u,f]=Es(s,l,6),p=e(t),m=e(i),h=aa(m,p);let g;if(h)if(c<=6)g=Oi(p,m,c,d,u,f);else{const P=a(r);g=vd(P,t,i,h,c,l),g=ii(g,m,c,d,u,f,P,t,e,Bo)}else g=Y;return C(s?ia(g):g)},pr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o);return wd(s,()=>a(r),t,i,...Es(s,l,6,9,6),l)},mr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o),c=Es(s,l,9,9,8),d=a(r);return wd(s,()=>d,tt(d,t),tt(d,i),...c,l)},wd=function(a,s,t,i,o,r,l,c,d){const u=e(t),f=e(i);let p;if(aa(f,u))if(o===6)p=Oi(u,f,o,r,l,c);else{const m=s();p=m.dateUntil(t,i,o,d),r===6&&l===1||(p=ii(p,f,o,r,l,c,m,t,e,ci))}else p=Y;return C(a?ia(p):p)},hr=function(a,s,t,i){const o=H(i),[r,l,c,d]=Es(a,o,5,5),u=Ya(gr(s,t),pt(l,c),d),f={...Y,...mi(u,r)};return C(a?ia(f):f)},cp=function(a,s,t,i,o,r){const l=aa(i.epochNanoseconds,t.epochNanoseconds);return l?o<6?Fd(t.epochNanoseconds,i.epochNanoseconds,o):Sd(s,a,t,i,l,o,r):Y},dp=function(a,s,t,i,o){const r=e(s),l=e(t),c=aa(l,r);return c?i<=6?Fd(r,l,i):vd(a,s,t,c,i,o):Y},Sd=function(a,s,t,i,o,r,l){const[c,d,u]=((m,h,g,P)=>{function T(){return L={...hs(y,Z++*-P),...b},U=fa(m,L),aa(E,U)===-P}const O=ta(h,m),b=pa(Fa,O),y=ta(g,m),E=g.epochNanoseconds;let Z=0;const j=gr(O,y);let L,U;if(Math.sign(j)===-P&&Z++,T()&&(P===-1||T()))throw new RangeError(Tt);const z=ha(ma(U,E));return[O,L,z]})(s,t,i,o);var f,p;return{...r===6?(f=c,p=d,{...Y,days:nd(f,p)}):a.dateUntil(c,d,r,l),...mi(u)}},vd=function(a,s,t,i,o,r){const[l,c,d]=((u,f,p)=>{let m=f,h=gr(u,f);return Math.sign(h)===-p&&(m=hs(f,-p),h+=F*p),[u,m,h]})(s,t,i);return{...a.dateUntil(l,c,o,r),...mi(d)}},Oi=function(a,s,t,i,o,r){return{...Y,...Ns(oi(ma(a,s),i,o,r),t)}},Fd=function(a,s,t){return{...Y,...Ns(ma(a,s),t)}},nd=function(a,s){return yi(sa(a),sa(s))},yi=function(a,s){return Math.trunc((s-a)/da)},gr=function(a,s){return Qa(s)-Qa(a)},Di=function(a,s){if(!Hs(a,s))throw new RangeError(Cr);return a},up=function(a){function s(o){return((r,l)=>({...Rd(r,l),F:r.month,day:parseInt(r.day)}))(go(t,o),i)}const t=Gr(a),i=zt(a);return{id:a,O:fp(s),B:pp(s)}},fp=function(a){return ua((s)=>{const t=sa(s);return a(t)},WeakMap)},pp=function(a){const s=a(0).year-kp;return ua((t)=>{let i,o=As(t-s);const r=[],l=[];do o+=400*da;while((i=a(o)).year<=t);do o+=(1-i.day)*da,i.year===t&&(r.push(o),l.push(i.F)),o-=da;while((i=a(o)).year>=t);return{k:r.reverse(),C:Wu(l.reverse())}})},Rd=function(a,s){let t,i,o=Md(a);if(a.era){const r=Qu[s];r!==void 0&&(t=s==="islamic"?"ah":a.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),t==="bc"||t==="b"?t="bce":t!=="ad"&&t!=="a"||(t="ce"),i=o,o=xd(i,r[t]||0))}return{era:t,eraYear:i,year:o}},Md=function(a){return parseInt(a.relatedYear||a.year)},ki=function(a){const{year:s,F:t,day:i}=this.O(a),{C:o}=this.B(s);return[s,o[t]+1,i]},ot=function(a,s=1,t=1){return this.B(a).k[s-1]+(t-1)*da},Zt=function(a){const s=Wl(this,a),t=Wl(this,a-1),i=s.length;if(i>t.length){const o=Id(this);if(o<0)return-o;for(let r=0;r<i;r++)if(s[r]!==t[r])return r+1}},Lt=function(a){return yi(ot.call(this,a),ot.call(this,a+1))},Hl=function(a,s){const{k:t}=this.B(a);let i=s+1,o=t;return i>t.length&&(i=1,o=this.B(a+1).k),yi(t[s-1],o[i-1])},xt=function(a){return this.B(a).k.length},Wl=function(a,s){return Object.keys(a.B(s).C)},jd=function(a){return mt(x(a))},mt=function(a){if((a=a.toLowerCase())!==w&&a!==Mi&&zt(a)!==zt(Gr(a).resolvedOptions().calendar))throw new RangeError(jp(a));return a},zt=function(a){return a==="islamicc"&&(a="islamic"),a.split("-")[0]},Cd=function(a){return this.R(a)[0]},Zd=function(a){return this.R(a)[1]},Pr=function(a){const[s]=this.h(a);return yi(this.q(s),sa(a))+1},Ld=function(a){const s=Rm.exec(a);if(!s)throw new RangeError(Rp(a));return[parseInt(s[1]),Boolean(s[2])]},qt=function(a,s,t){return a+(s||t&&a>=t?1:0)},Vi=function(a,s){return a-(s&&a>=s?1:0)},xd=function(a,s){return(s+a)*(Math.sign(s)||1)||0},ei=function(a){return Qu[Ad(a)]},Id=function(a){return qp[Ad(a)]},Ad=function(a){return zt(a.id||w)},Ed=function(a,s,t,i){const o=ka(t,i,va,[],qu);if(o.timeZone!==void 0){const r=t.dateFromFields(o),l=Ps(o),c=a(o.timeZone);return{epochNanoseconds:ms(s(c),{...r,...l},o.offset!==void 0?$s(o.offset):void 0),timeZone:c}}return{...t.dateFromFields(o),...Oa}},Hd=function(a,s,t,i,o,r){const l=ka(t,o,va,Ju,qu),c=a(l.timeZone),[d,u,f]=ft(r),p=t.dateFromFields(l,si(r,d)),m=Ps(l,d);return B(ms(s(c),{...p,...m},l.offset!==void 0?$s(l.offset):void 0,u,f),c,i)},Wd=function(a,s,t){const i=ka(a,s,va,[],Ja),o=S(t);return W(Wa({...a.dateFromFields(i,si(t,o)),...Ps(i,o)}))},Tr=function(a,s,t,i=[]){const o=ka(a,s,va,i);return a.dateFromFields(o,t)},br=function(a,s,t,i){const o=ka(a,s,xr,i);return a.yearMonthFromFields(o,t)},Or=function(a,s,t,i,o=[]){const r=ka(a,t,va,o);return s&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=xs),a.monthDayFromFields(r,i)},Nd=function(a,s){const t=S(s);return Sa(Ps(na(a,so,[],1),t))},$d=function(a){const s=na(a,Ir);return C(Ws({...Y,...s}))},ka=function(a,s,t,i=[],o=[]){return na(s,[...a.fields(t),...o].sort(),i)},na=function(a,s,t,i=!t){const o={};let r,l=0;for(let c of s){if(c===r)throw new RangeError(Dp(c));if(c==="constructor"||c==="__proto__")throw new RangeError(Mr(c));let d=a[c];if(d!==void 0)l=1,zl[c]&&(d=zl[c](d,c)),o[c]=d;else if(t){if(t.includes(c))throw new TypeError(Rr(c));o[c]=Uu[c]}r=c}if(i&&!l)throw new TypeError(ju(s));return o},Ps=function(a,s){return et(Zm({...Uu,...a}),s)},Jd=function(a,s,t,i,o,r){const l=H(r),{calendar:c,timeZone:d}=t;return B(((u,f,p,m,h)=>{const g=ht(u,p,m,va,zu,$u),[P,T,O]=ft(h,2);return ms(f,{...u.dateFromFields(g,si(h,P)),...Ps(g,P)},$s(g.offset),T,O)})(a(c),s(d),i,o,l),d,c)},zd=function(a,s,t,i,o){const r=H(o);return W(((l,c,d,u)=>{const f=ht(l,c,d,va,Ja),p=S(u);return Wa({...l.dateFromFields(f,si(u,p)),...Ps(f,p)})})(a(s.calendar),t,i,r))},qd=function(a,s,t,i,o){const r=H(o);return((l,c,d,u)=>{const f=ht(l,c,d,va);return l.dateFromFields(f,u)})(a(s.calendar),t,i,r)},_d=function(a,s,t,i,o){const r=H(o);return ls(((l,c,d,u)=>{const f=ht(l,c,d,xr);return l.yearMonthFromFields(f,u)})(a(s.calendar),t,i,r))},Gd=function(a,s,t,i,o){const r=H(o);return((l,c,d,u)=>{const f=ht(l,c,d,va);return l.monthDayFromFields(f,u)})(a(s.calendar),t,i,r)},Ud=function(a,s,t){return Sa(((i,o,r)=>{const l=S(r);return Ps({...pa(so,i),...na(o,so)},l)})(a,s,t))},Qd=function(a,s){return C((t=a,i=s,Ws({...t,...na(i,Ir)})));var t,i},ht=function(a,s,t,i,o=[],r=[]){const l=[...a.fields(i),...o].sort();let c=na(s,l,r);const d=na(t,l);return c=a.mergeFields(c,d),na(c,l,[])},yr=function(a,s){const t=ka(a,s,Gu);return a.monthDayFromFields(t)},Dr=function(a,s,t){const i=ka(a,s,_u);return a.yearMonthFromFields(i,t)},Yd=function(a,s,t,i,o){s=pa(t=a.fields(t),s),i=na(i,o=a.fields(o),[]);let r=a.mergeFields(s,i);return r=na(r,[...t,...o].sort(),[]),a.dateFromFields(r)},Qi=function(a,s){let{era:t,eraYear:i,year:o}=s;const r=ei(a);if(t!==void 0||i!==void 0){if(t===void 0||i===void 0)throw new TypeError(Sp);if(!r)throw new RangeError(wp);const l=r[t];if(l===void 0)throw new RangeError(Fp(t));const c=xd(i,l);if(o!==void 0&&o!==c)throw new RangeError(vp);o=c}else if(o===void 0)throw new TypeError(np(r));return o},Yi=function(a,s,t,i){let{month:o,monthCode:r}=s;if(r!==void 0){const l=((c,d,u,f)=>{const p=c.U(u),[m,h]=Ld(d);let g=qt(m,h,p);if(h){const P=Id(c);if(P===void 0)throw new RangeError(es);if(P>0){if(g>P)throw new RangeError(es);if(p===void 0){if(f===1)throw new RangeError(es);g--}}else{if(g!==-P)throw new RangeError(es);if(p===void 0&&f===1)throw new RangeError(es)}}return g})(a,r,t,i);if(o!==void 0&&o!==l)throw new RangeError(xu);o=l,i=1}else if(o===void 0)throw new TypeError(Mp);return Pa("month",o,1,a.L(t),i)},Nl=function(a,s,t,i,o){return la(s,"day",1,a.j(i,t),o)},Bi=function(a,s,t,i){let o=0;const r=[];for(let l of t)s[l]!==void 0?o=1:r.push(l);if(Object.assign(a,s),o)for(let l of i||r)delete a[l]},Bd=function(a){return G(ga(Kt(Bt(a))))},Kd=function(a,s,t,i,o=w){return B(ga(Kt(Bt(t))),s(i),a(o))},Xd=function(a,s,t,i,o=0,r=0,l=0,c=0,d=0,u=0,f=w){return W(Wa(Vt(ya(V,Is(ji,[s,t,i,o,r,l,c,d,u])))),a(f))},kd=function(a,s,t,i,o=w){return N(_a(us(ya(V,{isoYear:s,isoMonth:t,isoDay:i}))),a(o))},Vd=function(a,s,t,i=w,o=1){const r=V(s),l=V(t),c=a(i);return ls(Po(us({isoYear:r,isoMonth:l,isoDay:V(o)})),c)},ed=function(a,s,t,i=w,o=xs){const r=V(s),l=V(t),c=a(i);return Nt(_a(us({isoYear:V(o),isoMonth:r,isoDay:l})),c)},au=function(a=0,s=0,t=0,i=0,o=0,r=0){return Sa(et(ya(V,Is(Fa,[a,s,t,i,o,r])),1))},su=function(a=0,s=0,t=0,i=0,o=0,r=0,l=0,c=0,d=0,u=0){return C(Ws(ya(rc,Is(v,[a,s,t,i,o,r,l,c,d,u]))))},wr=function(a,s,t=w){return B(a.epochNanoseconds,s,t)},tu=function(a){return G(a.epochNanoseconds)},Sr=function(a,s){return W(ta(s,a))},vr=function(a,s){return N(ta(s,a))},iu=function(a,s,t){return Dr(a(s.calendar),t)},ou=function(a,s,t){return yr(a(s.calendar),t)},Fr=function(a,s){return Sa(ta(s,a))},ru=function(a,s,t,i){const o=((r,l,c,d)=>{const u=yo(d);return fa(r(l),c,u)})(a,t,s,i);return B(ga(o),t,s.calendar)},lu=function(a,s,t){const i=a(s.calendar);return ls({...s,...Dr(i,t)})},cu=function(a,s,t){return yr(a(s.calendar),t)},du=function(a,s,t,i,o){const r=a(o.timeZone),l=o.plainTime,c=l!==void 0?s(l):Oa;return B(fa(t(r),{...i,...c}),r,i.calendar)},uu=function(a,s=Oa){return W(Wa({...a,...s}))},fu=function(a,s,t){return Dr(a(s.calendar),t)},pu=function(a,s,t){return yr(a(s.calendar),t)},mu=function(a,s,t,i){return((o,r,l)=>Yd(o,r,_u,Ha(l),Ot))(a(s.calendar),t,i)},hu=function(a,s,t,i){return((o,r,l)=>Yd(o,r,Gu,Ha(l),Ri))(a(s.calendar),t,i)},gu=function(a,s,t,i,o){const r=Ha(o),l=s(r.plainDate),c=a(r.timeZone);return B(fa(t(c),{...l,...i}),c,l.calendar)},Pu=function(a,s){return W(Wa({...a,...s}))},Tu=function(a){return G(ga(Zs(a,ba)))},bu=function(a){return G(ga(Zs(a,Ma)))},Ou=function(a){return G(ga(Kt(Bt(a),bs)))},yu=function(a){return G(ga(Kt(Bt(a))))},Du=function(a,s,t=Oa){const i=s.timeZone,o=a(i),r={...ta(s,o),...t};return B(ms(o,r,r.offsetNanoseconds,2),i,s.calendar)},wu=function(a,s,t){const i=s.timeZone,o=a(i),r={...ta(s,o),...t},l=nu(s.calendar,t.calendar);return B(ms(o,r,r.offsetNanoseconds,2),i,l)},Su=function(a,s=Oa){return W({...a,...s})},vu=function(a,s){return W({...a,...s},nu(a.calendar,s.calendar))},wi=function(a,s){return{...a,calendar:s}},Fu=function(a,s){return{...a,timeZone:s}},nu=function(a,s){if(a===s)return a;const t=Q(a),i=Q(s);if(t===i||t===w)return s;if(i===w)return a;throw new RangeError(Cr)},mp=function(a,s){return(t)=>t===w?a:t===Mi||t===Ls?Object.assign(Object.create(a),{id:t}):Object.assign(Object.create(s),nm(t))},Ts=function(a,s,t){const i=new Set(t);return(o)=>(((r,l)=>{for(let c of l)if(c in r)return 1;return 0})(o=ro(i,o),a)||Object.assign(o,s),t&&(o.timeZone=Ds,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)},Na=function(a,s=nr){const[t,,,i]=a;return(o,r=Qm,...l)=>{const c=s(i&&i(...l),o,r,t),d=c.resolvedOptions();return[c,...hp(a,d,l)]}},nr=function(a,s,t,i){if(t=i(t),a){if(t.timeZone!==void 0)throw new TypeError($p);t.timeZone=a}return new Va(s,t)},hp=function(a,s,t){const[,i,o]=a;return t.map((r)=>(r.calendar&&((l,c,d)=>{if((d||l!==w)&&l!==c)throw new RangeError(Cr)})(Q(r.calendar),s.calendar,o),i(r,s)))},zs=function(a){const s=gt();return Ba(s,a.getOffsetNanosecondsFor(s))},gt=function(){return Zs(Date.now(),Ma)},$a=function(){return _l||(_l=new Va().resolvedOptions().timeZone)},gp=(a,s)=>`Non-integer ${a}: ${s}`,Pp=(a,s)=>`Non-positive ${a}: ${s}`,Tp=(a,s)=>`Non-finite ${a}: ${s}`,bp=(a)=>`Cannot convert bigint to ${a}`,Op=(a)=>`Invalid bigint: ${a}`,yp="Cannot convert Symbol to string",Ru="Invalid object",Mu=(a,s,t,i,o)=>o?Mu(a,o[s],o[t],o[i]):Pt(a,s)+`; must be between ${t}-${i}`,Pt=(a,s)=>`Invalid ${a}: ${s}`,Rr=(a)=>`Missing ${a}`,Mr=(a)=>`Invalid field ${a}`,Dp=(a)=>`Duplicate field ${a}`,ju=(a)=>"No valid fields: "+a.join(),Cu="Invalid bag",Zu=(a,s,t)=>Pt(a,s)+"; must be "+Object.keys(t).join(),Lu="Cannot use valueOf",jr="Invalid calling context",wp="Forbidden era/eraYear",Sp="Mismatching era/eraYear",vp="Mismatching year/eraYear",Fp=(a)=>`Invalid era: ${a}`,np=(a)=>"Missing year"+(a?"/era/eraYear":""),Rp=(a)=>`Invalid monthCode: ${a}`,xu="Mismatching month/monthCode",Mp="Missing month/monthCode",$l="Cannot guess year",es="Invalid leap month",Iu="Invalid protocol",Tt="Invalid protocol results",Cr="Mismatching Calendars",jp=(a)=>`Invalid Calendar: ${a}`,Au="Mismatching TimeZones",Cp="Forbidden ICU TimeZone",Zp="Out-of-bounds offset",Lp="Out-of-bounds TimeZone gap",xp="Invalid TimeZone offset",Ip="Ambiguous offset",Si="Out-of-bounds date",Ap="Out-of-bounds duration",Ep="Cannot mix duration signs",vi="Missing relativeTo",Hp="Cannot use large units",Wp="Required smallestUnit or largestUnit",Np="smallestUnit > largestUnit",ca=(a)=>`Cannot parse: ${a}`,Ea=(a)=>`Invalid substring: ${a}`,Eu=(a)=>`Cannot format ${a}`,Hu="Mismatching types for formatting",$p="Cannot specify TimeZone",Wu=D(ct,(a,s)=>s),qs=D(ct,(a,s,t)=>t),Ta=D(Et,2),ao={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},bt=Object.keys(ao),da=86400000,Nu=1000,bs=1000,Ma=1e6,ba=1e9,Fi=60000000000,ni=3600000000000,F=86400000000000,Ra=[1,bs,Ma,ba,Fi,ni,F],Ja=bt.slice(0,6),so=dt(Ja),$u=["offset"],Ju=["timeZone"],zu=Ja.concat($u),qu=zu.concat(Ju),to=["era","eraYear"],Jp=to.concat(["year"]),Ri=["year"],Zr=["monthCode"],Lr=["month"].concat(Zr),Ot=["day"],xr=Lr.concat(Ri),_u=Zr.concat(Ri),va=Ot.concat(xr),zp=Ot.concat(Lr),Gu=Ot.concat(Zr),Uu=qs(Ja,0),w="iso8601",Mi="gregory",Ls="japanese",Qu={[Mi]:{bce:-1,ce:0},[Ls]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},qp={chinese:13,dangi:13,hebrew:-6},x=D(Yt,"string"),Yu=D(Yt,"boolean"),_p=D(Yt,"number"),Bu=D(Yt,"function"),v=bt.map((a)=>a+"s"),Ir=dt(v),Gp=v.slice(0,6),Ku=v.slice(6),Up=Ku.slice(1),Qp=Wu(v),Y=qs(v,0),Ar=qs(Gp,0),Er=D(Bl,v),Fa=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Hr=["isoDay","isoMonth","isoYear"],ji=Fa.concat(Hr),Wr=dt(Hr),Xu=dt(Fa),ku=dt(ji),Oa=qs(Xu,0),Yp=D(Bl,ji),Va=Intl.DateTimeFormat,Vu="en-GB",Nr=1e8,Bp=Nr*da,Kp=[Nr,0],Xp=[-Nr,0],rt=275760,lt=-271821,kp=1970,xs=1972,Ia=12,Vp=As(1868,9,8),ep=ua(ef,WeakMap),_t="smallestUnit",io="unit",st="roundingIncrement",Ki="fractionalSecondDigits",eu="relativeTo",af={constrain:0,reject:1},am=Object.keys(af),sm={compatible:0,reject:1,earlier:2,later:3},tm={reject:0,use:1,prefer:2,ignore:3},im={auto:0,never:1,critical:2,always:3},om={auto:0,never:1,critical:2},rm={auto:0,never:1},lm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},yt=D(no,_t),$r=D(no,"largestUnit"),cm=D(no,io),sf=D(fs,"overflow",af),tf=D(fs,"disambiguation",sm),dm=D(fs,"offset",tm),Jr=D(fs,"calendarName",im),um=D(fs,"timeZoneName",om),fm=D(fs,"offset",rm),Dt=D(fs,"roundingMode",lm),_s="PlainYearMonth",Gs="PlainMonthDay",Os="PlainDate",ys="PlainDateTime",Ci="PlainTime",za="ZonedDateTime",Zi="Instant",Li="Duration",pm=[Math.floor,(a)=>Ct(a)?Math.floor(a):Math.round(a),Math.ceil,(a)=>Ct(a)?Math.ceil(a):Math.round(a),Math.trunc,(a)=>Ct(a)?Math.trunc(a)||0:Math.round(a),(a)=>a<0?Math.floor(a):Math.ceil(a),(a)=>Math.sign(a)*Math.round(Math.abs(a))||0,(a)=>Ct(a)?(a=Math.trunc(a)||0)+a%2:Math.round(a)],Ds="UTC",It=5184000,mm=Wt(1847),hm=Wt((new Date()).getUTCFullYear()+10),gm=/0+$/,ta=ua(rp,WeakMap),Jl=4294967295,xi=ua((a)=>{const s=or(a);return typeof s=="object"?new rf(s):new of(s||0)});class of{constructor(a){this.v=a}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(a){return[To(a,this.v)]}l(){}}class rf{constructor(a){this.$=((s)=>{function t(d){const u=Xi(d,l,c),[f,p]=Al(u),m=o(f),h=o(p);return m===h?m:i(r(f,p),m,h,d)}function i(d,u,f,p){let m,h;for(;(p===void 0||(m=p<d[0]?u:p>=d[1]?f:void 0)===void 0)&&(h=d[1]-d[0]);){const g=d[0]+Math.floor(h/2);s(g)===f?d[1]=g:d[0]=g+1}return m}const o=ua(s),r=ua(lp);let l=mm,c=hm;return{G(d){const u=t(d-86400),f=t(d+86400),p=d-u,m=d-f;if(u===f)return[p];const h=t(p);return h===t(m)?[d-h]:u>f?[p,m]:[]},V:t,l(d,u){const f=Xi(d,l,c);let[p,m]=Al(f);const h=It*u,g=u<0?()=>m>l||(l=f,0):()=>p<c||(c=f,0);for(;g();){const P=o(p),T=o(m);if(P!==T){const O=r(p,m);i(O,P,T);const b=O[0];if((qa(b,d)||1)===u)return b}p+=h,m+=h}}}})(((s)=>(t)=>{const i=go(s,t*Nu);return Wt(Md(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-t})(a))}getOffsetNanosecondsFor(a){return this.$.V(dc(a))*ba}getPossibleInstantsFor(a){const[s,t]=[Wt((i=a).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*Ma+i.isoMicrosecond*bs+i.isoNanosecond];var i;return this.$.G(s).map((o)=>ga(Cs(Zs(o,ba),t)))}l(a,s){const[t,i]=uc(a),o=this.$.l(t+(s>0||i?1:0),s);if(o!==void 0)return Zs(o,ba)}}var zr="([+\u2212-])",At="(?:[.,](\\d{1,9}))?",lf=`(?:(?:${zr}(\\d{6}))|(\\d{4}))-?(\\d{2})`,qr="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+At+")?)?",_r=zr+qr,Pm=lf+"-?(\\d{2})(?:[T ]"+qr+"(Z|"+_r+")?)?",cf="\\[(!?)([^\\]]*)\\]",Ii=`((?:${cf}){0,9})`,Tm=Js(lf+Ii),bm=Js("(?:--)?(\\d{2})-?(\\d{2})"+Ii),Om=Js(Pm+Ii),ym=Js("T?"+qr+"(?:"+_r+")?"+Ii),Dm=Js(_r),wm=new RegExp(cf,"g"),Sm=Js(`${zr}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${At}H)?(?:(\\d+)${At}M)?(?:(\\d+)${At}S)?)?`),vm=ua((a)=>new Va(Vu,{timeZone:a,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Fm=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,nm=ua(up),Gr=ua((a)=>new Va(Vu,{calendar:a,timeZone:Ds,era:"short",year:"numeric",month:"short",day:"numeric"})),Rm=/^M(\d{2})(L?)$/,Mm={era:Ht,eraYear:V,year:V,month:Zl,monthCode:Ht,day:Zl},jm=qs(Ja,V),Cm=qs(v,rc),zl=Object.assign({},Mm,jm,Cm,{offset:Ht}),Zm=D(Vf,Ja,Fa),ql={dateAdd(a,s,t){const i=S(t);let o,{years:r,months:l,weeks:c,days:d}=s;if(d+=q(s,5)[0],r||l)o=((u,f,p,m,h)=>{let[g,P,T]=u.h(f);if(p){const[O,b]=u.I(g,P);g+=p,P=qt(O,b,u.U(g)),P=Pa("month",P,1,u.L(g),h)}return m&&([g,P]=u._(g,P,m)),T=Pa("day",T,1,u.j(g,P),h),u.q(g,P,T)})(this,a,r,l,i);else{if(!c&&!d)return a;o=sa(a)}return o+=(7*c+d)*da,_a(kt(o))},dateUntil(a,s,t){if(t<=7){let d=0,u=nd({...a,...Oa},{...s,...Oa});return t===7&&([d,u]=Ua(u,7)),{...Y,weeks:d,days:u}}const i=this.h(a),o=this.h(s);let[r,l,c]=((d,u,f,p,m,h,g)=>{let P=m-u,T=h-f,O=g-p;if(P||T){const b=Math.sign(P||T);let y=d.j(m,h),E=0;if(Math.sign(O)===-b){const Z=y;[m,h]=d._(m,h,-b),P=m-u,T=h-f,y=d.j(m,h),E=b<0?-Z:y}if(O=g-Math.min(p,y)+E,P){const[Z,j]=d.I(u,f),[L,U]=d.I(m,h);if(T=L-Z||Number(U)-Number(j),Math.sign(T)===-b){const z=b<0&&-d.L(m);P=(m-=b)-u,T=h-qt(Z,j,d.U(m))+(z||d.L(m))}}}return[P,T,O]})(this,...i,...o);return t===8&&(l+=this.J(r,i[0]),r=0),{...Y,years:r,months:l,days:c}},dateFromFields(a,s){const t=S(s),i=Qi(this,a),o=Yi(this,a,i,t),r=Nl(this,a,o,i,t);return N(_a(this.P(i,o,r)),this.id||w)},yearMonthFromFields(a,s){const t=S(s),i=Qi(this,a),o=Yi(this,a,i,t);return ls(Po(this.P(i,o,1)),this.id||w)},monthDayFromFields(a,s){const t=S(s),i=!this.id,{monthCode:o,year:r,month:l}=a;let c,d,u,f,p;if(o!==void 0){[c,d]=Ld(o),p=Gl(a,"day");const m=this.N(c,d,p);if(!m)throw new RangeError($l);if([u,f]=m,l!==void 0&&l!==f)throw new RangeError(xu);i&&(f=Pa("month",f,1,Ia,1),p=Pa("day",p,1,bo(r!==void 0?r:u,f),t))}else{u=r===void 0&&i?xs:Qi(this,a),f=Yi(this,a,u,t),p=Nl(this,a,f,u,t);const m=this.U(u);d=f===m,c=Vi(f,m);const h=this.N(c,d,p);if(!h)throw new RangeError($l);[u,f]=h}return Nt(_a(this.P(u,f,p)),this.id||w)},fields(a){return ei(this)&&a.includes("year")?[...a,...to]:a},mergeFields(a,s){const t=Object.assign(Object.create(null),a);return Bi(t,s,Lr),ei(this)&&(Bi(t,s,Jp),this.id===Ls&&Bi(t,s,zp,to)),t},inLeapYear(a){const[s]=this.h(a);return this.K(s)},monthsInYear(a){const[s]=this.h(a);return this.L(s)},daysInMonth(a){const[s,t]=this.h(a);return this.j(s,t)},daysInYear(a){const[s]=this.h(a);return this.X(s)},dayOfYear:Pr,era(a){return this.ee(a)[0]},eraYear(a){return this.ee(a)[1]},monthCode(a){const[s,t]=this.h(a),[i,o]=this.I(s,t);return((r,l)=>"M"+Ta(r)+(l?"L":""))(i,o)},dayOfWeek:gc,daysInWeek(){return 7}},Lm={dayOfYear:Pr,h:pc,q:As},xm=Object.assign({},Lm,{weekOfYear:Cd,yearOfWeek:Zd,R(a){function s(h){return(7-h<i?7:0)-h}function t(h){const g=hc(m+h),P=h||1,T=s(at(d+g*P,7));return f=(g+(T-u)*P)/7}const i=this.id?1:4,o=gc(a),r=this.dayOfYear(a),l=at(o-1,7),c=r-1,d=at(l-c,7),u=s(d);let f,p=Math.floor((c-u)/7)+1,m=a.isoYear;return p?p>t(0)&&(p=1,m++):(p=t(-1),m--),[p,m,f]}}),Im={dayOfYear:Pr,h:ki,q:ot,weekOfYear:Cd,yearOfWeek:Zd,R(){return[]}},Us=mp(Object.assign({},ql,xm,{h:pc,ee(a){return this.id===Mi?Pc(a):this.id===Ls?ep(a):[]},I:(a,s)=>[s,0],N(a,s){if(!s)return[xs,a]},K:Oo,U(){},L:mc,J:(a)=>a*Ia,j:bo,X:hc,P:(a,s,t)=>({isoYear:a,isoMonth:s,isoDay:t}),q:As,_:(a,s,t)=>(a+=Ut(t,Ia),(s+=co(t,Ia))<1?(a--,s+=Ia):s>Ia&&(a++,s-=Ia),[a,s]),year(a){return a.isoYear},month(a){return a.isoMonth},day:(a)=>a.isoDay}),Object.assign({},ql,Im,{h:ki,ee(a){const s=this.O(a);return[s.era,s.eraYear]},I(a,s){const t=Zt.call(this,a);return[Vi(s,t),t===s]},N(a,s,t){let[i,o,r]=ki.call(this,{isoYear:xs,isoMonth:Ia,isoDay:31});const l=Zt.call(this,i),c=o===l;(qa(a,Vi(o,l))||qa(Number(s),Number(c))||qa(t,r))===1&&i--;for(let d=0;d<100;d++){const u=i-d,f=Zt.call(this,u),p=qt(a,s,f);if(s===(p===f)&&t<=Hl.call(this,u,p))return[u,p]}},K(a){const s=Lt.call(this,a);return s>Lt.call(this,a-1)&&s>Lt.call(this,a+1)},U:Zt,L:xt,J(a,s){const t=s+a,i=Math.sign(a),o=i<0?-1:0;let r=0;for(let l=s;l!==t;l+=i)r+=xt.call(this,l+o);return r},j:Hl,X:Lt,P(a,s,t){return kt(ot.call(this,a,s,t))},q:ot,_(a,s,t){if(t){if(s+=t,!Number.isSafeInteger(s))throw new RangeError(Si);if(t<0)for(;s<1;)s+=xt.call(this,--a);else{let i;for(;s>(i=xt.call(this,a));)s-=i,a++}}return[a,s]},year(a){return this.O(a).year},month(a){const{year:s,F:t}=this.O(a),{C:i}=this.B(s);return i[t]+1},day(a){return this.O(a).day}})),Ga="numeric",Qs=["timeZoneName"],df={month:Ga,day:Ga},Ur={year:Ga,month:Ga},Qr=Object.assign({},Ur,{day:Ga}),Yr={hour:Ga,minute:Ga,second:Ga},Br=Object.assign({},Qr,Yr),Am=Object.assign({},Br,{timeZoneName:"short"}),Em=Object.keys(Ur),Hm=Object.keys(df),Wm=Object.keys(Qr),Nm=Object.keys(Yr),Kr=["dateStyle"],$m=Em.concat(Kr),Jm=Hm.concat(Kr),Xr=Wm.concat(Kr,["weekday"]),wt=Nm.concat(["dayPeriod","timeStyle"]),kr=Xr.concat(wt),zm=kr.concat(Qs),qm=Qs.concat(wt),_m=Qs.concat(Xr),Gm=Qs.concat(["day","weekday"],wt),Um=Qs.concat(["year","weekday"],wt),Qm={},Vr=[Ts(kr,Br),ti],uf=[Ts(zm,Am),ti,0,(a,s)=>{const t=Q(a.timeZone);if(s&&Q(s.timeZone)!==t)throw new RangeError(Au);return t}],er=[Ts(kr,Br,Qs),sa],al=[Ts(Xr,Qr,qm),sa],sl=[Ts(wt,Yr,_m),(a)=>Qa(a)/Ma],tl=[Ts($m,Ur,Gm),sa,1],il=[Ts(Jm,df,Um),sa,1],_l;var km={Instant:Vr,PlainDateTime:er,PlainDate:al,PlainTime:sl,PlainYearMonth:tl,PlainMonthDay:il},Vm=Na(Vr),em=Na(uf),ah=Na(er),sh=Na(al),th=Na(sl),ih=Na(tl),oh=Na(il),dl={era:el,eraYear:uo,year:ut,month:Da,daysInMonth:Da,daysInYear:Da,inLeapYear:Yu,monthsInYear:Da},Wi={monthCode:x},ul={day:Da},Df={dayOfWeek:Da,dayOfYear:Da,weekOfYear:ac,yearOfWeek:uo,daysInWeek:Da},wf=Object.assign({},dl,Wi,ul,Df),Hi=new WeakMap,k=Hi.get.bind(Hi),hf=Hi.set.bind(Hi),rh={...Ai(dl,[_s]),...Ai(Df,[]),...Ai(Wi,[_s,Gs]),...Ai(ul,[Gs])},fl=ll(wf),lh=ll({...dl,...Wi}),ch=ll({...Wi,...ul}),nt={calendarId:(a)=>Q(a.calendar)},dh=ya((a,s)=>function(t){const{i}=this;return a(i[s](A(N(t,i))))},wf),uh=ct((a)=>(s)=>s[a],v.concat("sign")),pl=ct((a,s)=>(t)=>t[Fa[s]],Ja),Sf={epochSeconds:Sc,epochMilliseconds:ti,epochMicroseconds:vc,epochNanoseconds:Fc},Rt=D(ro,new Set(["branding"])),[fh,Ks,ph]=Za(Gs,D(ed,X),{...nt,...ch},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return Ks(Gd(Rh,a,this,Xs(s),t))},equals:(a,s)=>yd(a,ff(s)),toPlainDate(a,s){return A(hu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=oh(s,t,a);return i.format(o)},toString:Ao,toJSON:(a)=>Ao(a),valueOf:is},{from:(a,s)=>Ks(ff(a,s))}),vf={getOffsetNanosecondsFor:bf,getPossibleInstantsFor(a,s,t){const i=[...s.call(a,K(W(t,w)))].map((r)=>hh(r).epochNanoseconds),o=i.length;return o>1&&(i.sort(aa),Jo(ha(ma(i[0],i[o-1])))),i}},rl={getOffsetNanosecondsFor:bf},[mh,oa,hh]=Za(Zi,Bd,Sf,{add:(a,s)=>oa(zo(0,a,I(s))),subtract:(a,s)=>oa(zo(1,a,I(s))),until:(a,s,t)=>R(dr(0,a,ja(s),t)),since:(a,s,t)=>R(dr(1,a,ja(s),t)),round:(a,s)=>oa(Mc(a,s)),equals:(a,s)=>gd(a,ja(s)),toZonedDateTime(a,s){const t=Ha(s);return $(wr(a,M(t.timeZone),X(t.calendar)))},toZonedDateTimeISO:(a,s)=>$(wr(a,M(s))),toLocaleString(a,s,t){const[i,o]=Vm(s,t,a);return i.format(o)},toString:(a,s)=>Co(M,J,a,s),toJSON:(a)=>Co(M,J,a),valueOf:is},{from:(a)=>oa(ja(a)),fromEpochSeconds:(a)=>oa(Tu(a)),fromEpochMilliseconds:(a)=>oa(bu(a)),fromEpochMicroseconds:(a)=>oa(Ou(a)),fromEpochNanoseconds:(a)=>oa(yu(a)),compare:(a,s)=>rr(ja(a),ja(s))}),[Ni,$h]=Za("TimeZone",(a)=>{const s=md(a);return{branding:"TimeZone",id:s,o:xi(s)}},{id:(a)=>a.id},{getPossibleInstantsFor:({o:a},s)=>a.getPossibleInstantsFor(as(s)).map((t)=>oa(G(t))),getOffsetNanosecondsFor:({o:a},s)=>a.getOffsetNanosecondsFor(ja(s).epochNanoseconds),getOffsetStringFor(a,s){const t=ja(s).epochNanoseconds,i=Ei(this,rl).getOffsetNanosecondsFor(t);return ps(i)},getPlainDateTimeFor(a,s,t=w){const i=ja(s).epochNanoseconds,o=Ei(this,rl).getOffsetNanosecondsFor(i);return K(W(Ba(i,o),X(t)))},getInstantFor(a,s,t){const i=as(s),o=yo(t),r=Ei(this);return oa(G(fa(r,i,o)))},getNextTransition:({o:a},s)=>pf(1,a,s),getPreviousTransition:({o:a},s)=>pf(-1,a,s),equals(a,s){return!!bi(this,M(s))},toString:(a)=>a.id,toJSON:(a)=>a.id},{from(a){const s=M(a);return typeof s=="string"?new Ni(s):s}}),gh=Tf(Object.keys(vf)),[Ph,ss]=Za(Ci,au,pl,{getISOFields:Rt,with(a,s,t){return ss(Ud(this,Xs(s),t))},add:(a,s)=>ss(Qo(0,a,I(s))),subtract:(a,s)=>ss(Qo(1,a,I(s))),until:(a,s,t)=>R(hr(0,a,ea(s),t)),since:(a,s,t)=>R(hr(1,a,ea(s),t)),round:(a,s)=>ss(Zc(a,s)),equals:(a,s)=>Dd(a,ea(s)),toZonedDateTime:(a,s)=>$(gu(M,ra,n,a,s)),toPlainDateTime:(a,s)=>K(Pu(a,ra(s))),toLocaleString(a,s,t){const[i,o]=th(s,t,a);return i.format(o)},toString:Eo,toJSON:(a)=>Eo(a),valueOf:is},{from:(a,s)=>ss(ea(a,s)),compare:(a,s)=>Ti(ea(a),ea(s))}),[Th,ts,bh]=Za(_s,D(Vd,X),{...nt,...lh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return ts(_d(nh,a,this,Xs(s),t))},add:(a,s,t)=>ts(Uo(gf,0,a,I(s),t)),subtract:(a,s,t)=>ts(Uo(gf,1,a,I(s),t)),until:(a,s,t)=>R(mr(Pf,0,a,Ys(s),t)),since:(a,s,t)=>R(mr(Pf,1,a,Ys(s),t)),equals:(a,s)=>Od(a,Ys(s)),toPlainDate(a,s){return A(mu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=ih(s,t,a);return i.format(o)},toString:Io,toJSON:(a)=>Io(a),valueOf:is},{from:(a,s)=>ts(Ys(a,s)),compare:(a,s)=>gs(Ys(a),Ys(s))}),[Oh,K]=Za(ys,D(Xd,X),{...nt,...fl,...pl},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return K(zd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>K(wi(a,X(s))),withPlainDate:(a,s)=>K(vu(a,ra(s))),withPlainTime:(a,s)=>K(Su(a,cl(s))),add:(a,s,t)=>K(_o(ws,0,a,I(s),t)),subtract:(a,s,t)=>K(_o(ws,1,a,I(s),t)),until:(a,s,t)=>R(fr(Ca,0,a,as(s),t)),since:(a,s,t)=>R(fr(Ca,1,a,as(s),t)),round:(a,s)=>K(Cc(a,s)),equals:(a,s)=>Td(a,as(s)),toZonedDateTime:(a,s,t)=>$(ru(n,a,M(s),t)),toPlainDate:(a)=>A(N(a)),toPlainTime:(a)=>ss(Sa(a)),toPlainYearMonth(a){return ts(lu($i,a,this))},toPlainMonthDay(a){return Ks(cu(zi,a,this))},toLocaleString(a,s,t){const[i,o]=ah(s,t,a);return i.format(o)},toString:Lo,toJSON:(a)=>Lo(a),valueOf:is},{from:(a,s)=>K(as(a,s)),compare:(a,s)=>cr(as(a),as(s))}),[yh,A,Ff]=Za(Os,D(kd,X),{...nt,...fl},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return A(qd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>A(wi(a,X(s))),add:(a,s,t)=>A(Go(ws,0,a,I(s),t)),subtract:(a,s,t)=>A(Go(ws,1,a,I(s),t)),until:(a,s,t)=>R(pr(Ca,0,a,ra(s),t)),since:(a,s,t)=>R(pr(Ca,1,a,ra(s),t)),equals:(a,s)=>bd(a,ra(s)),toZonedDateTime(a,s){const t=!_(s)||s instanceof Ni?{timeZone:s}:s;return $(du(M,ea,n,a,t))},toPlainDateTime:(a,s)=>K(uu(a,cl(s))),toPlainYearMonth(a){return ts(fu($i,a,this))},toPlainMonthDay(a){return Ks(pu(zi,a,this))},toLocaleString(a,s,t){const[i,o]=sh(s,t,a);return i.format(o)},toString:xo,toJSON:(a)=>xo(a),valueOf:is},{from:(a,s)=>A(ra(a,s)),compare:(a,s)=>gs(ra(a),ra(s))}),ml={fields(a,s,t){return[...s.call(a,t)]}},nf=Object.assign({dateFromFields(a,s,t,i){return Ff(s.call(a,Object.assign(Object.create(null),t),i))}},ml),Rf=Object.assign({yearMonthFromFields(a,s,t,i){return bh(s.call(a,Object.assign(Object.create(null),t),i))}},ml),Mf=Object.assign({monthDayFromFields(a,s,t,i){return ph(s.call(a,Object.assign(Object.create(null),t),i))}},ml),hl={mergeFields(a,s,t,i){return Ha(s.call(a,Object.assign(Object.create(null),t),Object.assign(Object.create(null),i)))}},Dh=Object.assign({},nf,hl),wh=Object.assign({},Rf,hl),Sh=Object.assign({},Mf,hl),gl={dateAdd(a,s,t,i,o){return Ff(s.call(a,A(N(t,a)),R(C(i)),o))}},jf=Object.assign({},gl,{dateUntil(a,s,t,i,o,r){return jh(s.call(a,A(N(t,a)),A(N(i,a)),Object.assign(Object.create(null),r,{largestUnit:bt[o]})))}}),vh=Object.assign({},gl,{day:Of}),Fh=Object.assign({},jf,{day:Of}),$i=La(Rf),Ji=La(nf),zi=La(Mf),nh=La(wh),Mt=La(Dh),Rh=La(Sh),ws=La(gl),Ca=La(jf),gf=La(vh),Pf=La(Fh),[Mh,R,jh]=Za(Li,su,{...uh,blank:Yc},{with:(a,s)=>R(Qd(a,s)),negated:(a)=>R(pi(a)),abs:(a)=>R(Qc(a)),add:(a,s,t)=>R(ko(St,Ca,n,0,a,I(s),t)),subtract:(a,s,t)=>R(ko(St,Ca,n,1,a,I(s),t)),round:(a,s)=>R(Uc(St,Ca,n,a,s)),total:(a,s)=>Rc(St,Ca,n,a,s),toLocaleString(a,s,t){return Intl.DurationFormat?new Intl.DurationFormat(s,t).format(this):li(a)},toString:li,toJSON:(a)=>li(a),valueOf:is},{from:(a)=>R(I(a)),compare:(a,s,t)=>hd(St,ws,n,I(a),I(s),t)}),Cf={toString:(a)=>a.id,toJSON:(a)=>a.id,...rh,dateAdd:({id:a,o:s},t,i,o)=>A(N(s.dateAdd(ra(t),I(i),o),a)),dateUntil:({o:a},s,t,i)=>R(C(a.dateUntil(ra(s),ra(t),bc(i)))),dateFromFields:({id:a,o:s},t,i)=>A(Tr(s,t,i,Vl(a))),yearMonthFromFields:({id:a,o:s},t,i)=>ts(br(s,t,i,Xl(a))),monthDayFromFields:({id:a,o:s},t,i)=>Ks(Or(s,0,t,i,kl(a))),fields({o:a},s){const t=new Set(va),i=[];for(let o of s){if(x(o),!t.has(o))throw new RangeError(Mr(o));t.delete(o),i.push(o)}return a.fields(i)},mergeFields:({o:a},s,t)=>a.mergeFields(lo(fo(s)),lo(fo(t)))},[Pl]=Za("Calendar",(a)=>{const s=jd(a);return{branding:"Calendar",id:s,o:Us(s)}},{id:(a)=>a.id},Cf,{from(a){const s=X(a);return typeof s=="string"?new Pl(s):s}}),Ch=Tf(Object.keys(Cf).slice(4)),[Zh,$]=Za(za,D(Kd,X,M),{...Sf,...nt,...mf(fl),...mf(pl),offset:(a)=>ps(ol(a).offsetNanoseconds),offsetNanoseconds:(a)=>ol(a).offsetNanoseconds,timeZoneId:(a)=>Q(a.timeZone),hoursInDay:(a)=>Lc(n,a)},{getISOFields:(a)=>_c(J,a),getCalendar:vt,getTimeZone:({timeZone:a})=>typeof a=="string"?new Ni(a):a,with(a,s,t){return $(Jd(Mt,n,a,this,Xs(s),t))},withCalendar:(a,s)=>$(wi(a,X(s))),withTimeZone:(a,s)=>$(Fu(a,M(s))),withPlainDate:(a,s)=>$(wu(n,a,ra(s))),withPlainTime:(a,s)=>$(Du(n,a,cl(s))),add:(a,s,t)=>$(qo(ws,n,0,a,I(s),t)),subtract:(a,s,t)=>$(qo(ws,n,1,a,I(s),t)),until:(a,s,t)=>R(C(ur(Ca,n,0,a,Bs(s),t))),since:(a,s,t)=>R(C(ur(Ca,n,1,a,Bs(s),t))),round:(a,s)=>$(jc(n,a,s)),startOfDay:(a)=>$(xc(n,a)),equals:(a,s)=>Pd(a,Bs(s)),toInstant:(a)=>oa(tu(a)),toPlainDateTime:(a)=>K(Sr(J,a)),toPlainDate:(a)=>A(vr(J,a)),toPlainTime:(a)=>ss(Fr(J,a)),toPlainYearMonth(a){return ts(iu($i,a,this))},toPlainMonthDay(a){return Ks(ou(zi,a,this))},toLocaleString(a,s,t={}){const[i,o]=em(s,t,a);return i.format(o)},toString:(a,s)=>Zo(J,a,s),toJSON:(a)=>Zo(J,a),valueOf:is},{from:(a,s)=>$(Bs(a,s)),compare:(a,s)=>lr(Bs(a),Bs(s))}),Lh=Object.defineProperties({},{...Gt("Temporal.Now"),...ds({timeZoneId:()=>$a(),instant:()=>oa(G(gt())),zonedDateTime:(a,s=$a())=>$(B(gt(),M(s),X(a))),zonedDateTimeISO:(a=$a())=>$(B(gt(),M(a),w)),plainDateTime:(a,s=$a())=>K(W(zs(J(M(s))),X(a))),plainDateTimeISO:(a=$a())=>K(W(zs(J(M(a))),w)),plainDate:(a,s=$a())=>A(N(zs(J(M(s))),X(a))),plainDateISO:(a=$a())=>A(N(zs(J(M(a))),w)),plainTimeISO:(a=$a())=>ss(Sa(zs(J(M(a)))))})}),Ss=Object.defineProperties({},{...Gt("Temporal"),...ds({PlainYearMonth:Th,PlainMonthDay:fh,PlainDate:yh,PlainTime:Ph,PlainDateTime:Oh,ZonedDateTime:Zh,Instant:mh,Calendar:Pl,TimeZone:Ni,Duration:Mh,Now:Lh})}),xh=Ym(),Tl=new WeakMap,Ih=Object.defineProperties(Object.create(Intl),ds({DateTimeFormat:xh}));class vs extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class bl{createSession(){throw new vs}deleteSession(){throw new vs}findSession(){throw new vs}findUserByEmailAddress(){throw new vs}updateSession(){throw new vs}createUser(){throw new vs}}class If extends xa{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Af extends xa{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Ef extends xa{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class Hf extends xa{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class ns extends Zf{constructor(){super(...arguments)}provider=jt.getStore().authenticationServiceProvider;async me(){const a=await Ol.user();if(!a)throw new xf;return a}async signIn(a=new If){const s=await a.input.call(a),{email:t,password:i}=s.toJSON(),o=await this.provider.adapter.findUserByEmailAddress(t);if(!o)throw new Fs({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,o.password))throw new Fs({invalid_credentials:["Invalid credentials"]});const l=a.headers.get("User-Agent"),c=new Bun.CryptoHasher("sha256");c.update(`${o.email}${l}`);const d=c.digest("hex");let u=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!u)u=await this.provider.adapter.createSession({token:d,userId:o.id,userAgent:"local",expiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else u=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return a.ctx.setCookie("access_token",u.token,{expires:u.expiresAt}),await this.provider.onSignIn(o),o}async signUp(a=new Af){const s=await a.input(),{email:t,password:i,name:o}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(t))throw new Fs({email:["Email address already exists"]});const l=await this.provider.hashPassword(i),c=await this.provider.adapter.createUser({email:t,name:o,password:l});return await this.provider.onSignUp(c),c}async signOut(a=new xa){const s=a.cookies.get("access_token"),t=await Ol.user();return await this.provider.adapter.deleteSession({token:s}),a.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(t),{}}async forgotPassword(a=new Ef){const s=await a.input(),{email:t}=s.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(t);if(!i)return{};const o=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:o}),await this.provider.onForgotPassword(i,o),{}}async resetPassword(a=new Hf){const s=await a.input(),{password:t,token:i}=s.toJSON(),o=await this.provider.adapter.findPasswordResetToken({token:i});if(!o)throw new Fs({token:["Invalid token"]});if(Ss.Now.instant().until(Ss.Instant.from(o.createdAt.toISOString()).add({hours:24}).toString()).sign)throw new Fs({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const l=await this.provider.adapter.findUserByEmailAddress(o.user.email);if(!l)throw new Fs({email:["User not found"]});const c=await this.provider.hashPassword(t);return await this.provider.adapter.updateUserPassword({id:l.id,password:c}),await this.provider.adapter.deleteAllUserSessions(l.id),await this.provider.onResetPassword(l),{}}}class Wf extends qi{constructor(){super(...arguments)}routes={"/sign-in":this.post(ns,"signIn"),"/sign-up":this.post(ns,"signUp"),"/sign-out":this.post(ns,"signOut"),"/forgot-password":this.post(ns,"forgotPassword"),"/reset-password":this.post(ns,"resetPassword"),"/me":this.get(ns,"me")}}class Nf extends Lf{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class _i{basePath="/auth";routers={api:Wf,view:Nf};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new bl;async verifyPassword(a,s){return await Bun.password.verify(a,s)}async hashPassword(a){return await Bun.password.hash(a)}async generateForgotPasswordToken(a){const s=new Bun.CryptoHasher("sha256");return s.update(`${a.email}${Date.now()}`),s.digest("hex")}onSignUp(a){}onSignIn(a){}onSignOut(a){}onForgotPassword(a,s){}onResetPassword(a){}}class $f extends qi{constructor(){super(...arguments)}routes={"/translations":this.get(async(a=new xa)=>{const s=await a.input(),{scope:t,locale:i}=s.toJSON(),o=i??jt.getStore().i18nServiceContainer.detectLocale(a),r=jt.getStore().i18nServiceContainer.getPageTranslations(o,t);return a.ctx.setHeaders("Cache-Control",a.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),a.ctx.setCookie("i18n-locale",o,{expires:new Date(Date.now()+31536000000)}),{[o]:r}})}}class yl{a;constructor(a){this.service=a}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:$f};boot(){const a=new Map;for(let[t,i]of Object.entries(this.service.dictionary))for(let[o,r]of Object.entries(i))for(let[l,c]of Object.entries(r)){const d=l==="default"?this.service.defaultLocale:l;if(!a.has(`${d}.${t}`))a.set(`${d}.${t}`,new Map);a.get(`${d}.${t}`)?.set(o,c),this.isEnabled=!0}let s=new Set;for(let[t,i]of a.entries())this.translations.set(t,Object.fromEntries(i.entries())),s.add(t.split(".")[0]);this.supportedLocales=Array.from(s)}detectLocale(a){const s=this.service.detectLocale(a);if(this.supportedLocales.includes(s))return s;const i=a.cookies.get("i18n-locale")??(a.headers.get("accept-language")||"en-US"),[o]=i.split(",");if(this.supportedLocales.includes(o))return o;const r=this.service.defaultLocale??this.supportedLocales[0];if(r)return r;return"en-US"}getPageTranslations(a,s){if(!s)return{};const t=this.translations.get(`${a}.view:${s}`)??{},i={[`view:${s}`]:t};for(let[o]of this.translations.entries()){const r=o.split(".")[1];if(!r.startsWith("layout:"))continue;const l=r.split(":")[1];if(s?.startsWith(l))i[r]=this.translations.get(`${a}.${r}`)??{}}return i}}class Dl{a;constructor(a){this.service=a}}class Sl{a;constructor(a){this.service=a}getRouteHandlerAndParams(a){const t=new URL(a.url).pathname.replace("/api","");let i={},o;for(let[r]of Object.entries(this.service.flatRoutes))try{const l=new URLPattern({pathname:r});if(l.test({pathname:t})){o=r,i=l.exec({pathname:t})?.pathname.groups;break}}catch(l){console.error(l)}return{params:i,path:o}}async runRouteMiddleware(a){const s=Rs.getStore(),i=this.service.flatRoutes[a][s.req.rawRequest.method].middleware;try{await Gi.getContext().middlewareServiceContainer.runMiddleware(i,a)}catch(o){if(o.kind===wl){if(s.req.rawRequest.url.includes("/api")){const{status:r=400,data:l,headers:c}=o.payload.api;return new Response(JSON.stringify(l),{status:r,headers:{"Content-Type":"application/json",...c}})}}else throw console.error(o),o}}async getRouteData(a){const s=this.service.flatRoutes[a],t=Rs.getStore(),i=s[t.req.rawRequest.method].exec??(()=>Promise.resolve({}));let o={};try{o=await i()}catch(r){if(r.kind===wl){const{status:l=400,data:c,headers:d}=r.payload.api;return new Response(JSON.stringify(c),{status:l,headers:{"Content-Type":"application/json",...d}})}else throw console.error(r),r}return o}async handleApiRequest(a){const{params:s,path:t}=this.getRouteHandlerAndParams(a),i=this.service.flatRoutes[t];if(!i||!i[a.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const o=new xa(a,s);return await Rs.run(o,async()=>{const r=await this.runRouteMiddleware(t);if(r instanceof Response)return r;const l=await this.getRouteData(t);if(l instanceof Response)return l;const c=Rs.getStore(),d=c.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(c.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return c.cookies.forEach((u)=>d.append("Set-Cookie",u.toString())),c.destroy(),new Response(JSON.stringify(l),{headers:d})})}}var Ah=function(a){return Ui(a)};function vl(a){const s={};for(let[t,i]of Object.entries(a))if("run"in i){const o=i;if(!s[t])s[t]={};const{method:r,middlewares:l}=o,c=o.run.bind(o);s[t][r]={exec:c,middleware:l}}else if(Ah(i)){const o=new i,r=vl(o.routes);for(let[l,c]of Object.entries(r)){const d=l==="/"?"":l,u=t==="/"?"":t,f=`${u}${d}`===""?"/":`${u}${d}`;if(!s[f])s[f]={};for(let[p,m]of Object.entries(c))s[f][p]={exec:m.exec,middleware:[o.middleware,...o.middlewares,...m.middleware]}}}else for(let o of Object.values(i)){if(!s[t])s[t]={};const{method:r,middlewares:l}=o,c=o.run.bind(o);s[t][r]={exec:c,middleware:l}}return Object.fromEntries(Object.entries(s).sort(([t],[i])=>{const o=t.split("/").length+t.split(":").length,r=i.split("/").length+i.split(":").length;return o-r}))}class Fl extends Jf{constructor(){super(...arguments)}flatRoutes={};boot(a){this.flatRoutes=vl(a)}}var Eh=function(a){const s=new Map;for(let t of a)if(typeof t==="string"){const[i,o=""]=t.split(":");if(i.startsWith("-")){if(s.has(i.replace("-","")))s.delete(i.replace("-",""))}else s.set(i,o.split(","))}else s.set(t,[]);return s};class nl{a;constructor(a){this.service=a}runMiddleware(a,s){const t=Rs.getStore().req;return Array.from(Eh(a).entries()).map(([i,o])=>{if(typeof i==="string"){const r=this.service.aliases[i];if(r){const l=new r(s);return(c)=>l.run.call(l,c,...o)}}else{if(Ui(i)){const r=new aliasOrTest(s);return r.run.bind(r)}return i}}).filter(Boolean).reduce((i,o)=>{return async(r,l)=>{return{...await i(r,l),...await o(r,l)}}},(i)=>Promise.resolve({}))(t)}}class Rl{a;constructor(a){this.service=a}}import{AsyncLocalStorage as Hh} from"async_hooks";class Ml extends zf{a;name="broadcastingServiceContainer";publishCb;context=new Hh;constructor(a){super();this.service=a}onPublish(a){this.publishCb=a}publish(...a){const[s,t,i]=a;this.publishCb(s,t,i)}async handleMessage(a,s){const t=JSON.parse(s);if(t.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([o],[r])=>o.length-r.length);for(let[o,r]of i){const l=new URLPattern({pathname:o});if(l.test({pathname:t.topic})){const c=l.exec({pathname:t.topic})?.pathname.groups,d=new r;if(await d.subscribe.call(d,c))a.subscribe(t.topic)}break}}if(t.type==="broadcast")a.publish(t.topic,JSON.stringify({topic:t.topic,data:t.payload}));if(t.type==="unsubscribe")a.unsubscribe(t.topic)}run(a,s){const t=a.get("Cookie"),i=new Map;if(t){const o=t.split(";");for(let r of o){const[l,c]=r.split("=");i.set(l.trim(),c.trim())}}this.context.run({headers:a,cookies:i},s)}}class Gi{emailServiceProvider=Bf;authenticationServiceProvider=_i;middlewareServiceProvider=qf;policiesServiceProvider=_f;i18nServiceProvider=Gf;fileStorageServiceProvider=Qf;apiRouterServiceProvider=Fl;rateLimiterServiceProvider=Yf;broadcastingsServiceProvider=Kf;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new Uf(new this.emailServiceProvider),authenticationServiceProvider:new this.authenticationServiceProvider,middlewareServiceContainer:new nl(new this.middlewareServiceProvider),policiesServiceProvider:new this.policiesServiceProvider,i18nServiceContainer:new yl(new this.i18nServiceProvider),fileStorageServiceContainer:new Dl(new this.fileStorageServiceProvider),apiRouterServiceContainer:new Sl(new this.apiRouterServiceProvider),rateLimiterServiceContainer:new Rl(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new Ml(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>jl.getStore();run(a){const s=this.getServices();return jl.run(s,a)}}class Xf{a;constructor(a){this.prisma=a}async createSession(a){return await this.prisma.session.create({data:a,include:{user:!0}})}async createUser(a){return await this.prisma.user.create({data:a})}async deleteSession(a){return await this.prisma.session.deleteMany({where:{token:a.token}})}async findUserByEmailAddress(a){return await this.prisma.user.findUnique({where:{email:a}})}async findSession(a){if(!a.token)return null;try{return await this.prisma.session.findUnique({where:{token:a.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(s){return console.log(s),null}}async updateSession(a){return await this.prisma.session.update({where:{token:a.token},data:{expiresAt:a.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(a){return await this.prisma.user.update({where:{id:a.id},data:{password:a.password}})}async createPasswordResetToken(a){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:a.user.id}},token:a.token}})}async findPasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.findUnique({where:{token:s},include:{user:!0}})}async deleteAllUserSessions(a){return await this.prisma.session.deleteMany({where:{userId:a}})}async deletePasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.delete({where:{token:s}})}}export{Xf as PrismaAuthenticationAdapter,Gi as Kernel,_i as AuthenticationServiceProvider};
|
|
2
|
+
import{a as Zf,b as Ui,c as qi,d as Lf,e as wl,g as Fs,h as Rs,i as xa,j as qf,k as xf,m as _f,n as Gf} from"../http/index.js";import{o as Ol} from"../facades/index.js";import{p as Qf,q as Jf,r as Yf,s as Bf,t as Kf} from"../services/index.js";import"../chunk-f6597f92f878d2dc.js";import{A as jt,z as jl} from"../chunk-9475c6ed18013dc8.js";import"../chunk-24a86f8f5ddc0cbd.js";import"../chunk-332553172e3ab961.js";import{E as zf,F as Uf} from"../chunk-7d5fe4acabfee228.js";import"../chunk-0ba2cc302113ab40.js";import"../chunk-28694e5e949df0ff.js";import"../chunk-8f66c4705c7ddab7.js";import"../chunk-acf6e39c4caa6aeb.js";import"../chunk-786985b106091b91.js";import"../chunk-e5ed2736da251b56.js";import"../chunk-b0131f371340bf21.js";import"../chunk-37a23ee8398a9bdf.js";import"../chunk-a96c2e272f0ddf6c.js";var Za=function(a,s,t,i,o){function r(...d){if(!(this instanceof r))throw new TypeError(jr);hf(this,s(...d))}function l(d,u){return Object.defineProperties(function(...f){return d.call(this,c(this),...f)},oo(u))}function c(d){const u=k(d);if(!u||u.branding!==a)throw new TypeError(jr);return u}return Object.defineProperties(r.prototype,{...Ul(ya(l,t)),...ds(ya(l,i)),...Gt("Temporal."+a)}),Object.defineProperties(r,{...ds(o),...oo(a)}),[r,(d)=>{const u=Object.create(r.prototype);return hf(u,d),u},c]},Tf=function(a){return a=a.concat("id").sort(),(s)=>{if(!Ql(s,a))throw new TypeError(Iu);return s}},Xs=function(a){if(k(a)||a.calendar!==void 0||a.timeZone!==void 0)throw new TypeError(Cu);return a},Ai=function(a,s){const t={};for(let i in a)t[i]=({o},r)=>{const l=k(r)||{},{branding:c}=l,d=c===Os||s.includes(c)?l:ra(r);return o[i](d)};return t},ll=function(a){const s={};for(let t in a)s[t]=(i)=>{const{calendar:o}=i;return(r=o,typeof r=="string"?Us(r):(l=r,Object.assign(Object.create(dh),{i:l})))[t](i);var r,l};return s},is=function(){throw new TypeError(Lu)},vt=function({calendar:a}){return typeof a=="string"?new Pl(a):a},ff=function(a,s){if(s=H(s),_(a)){const i=k(a);if(i&&i.branding===Gs)return S(s),i;const o=yf(a);return Or(zi(o||w),!o,a,s)}const t=sd(Us,a);return S(s),t},bf=function(a,s,t){return i=s.call(a,oa(G(t))),$o(ut(i));var i},Ei=function(a,s=vf){const t=Object.keys(s).sort(),i={};for(let o of t)i[o]=D(s[o],a,Bu(a[o]));return i},n=function(a,s){return typeof a=="string"?xi(a):Ei(a,s)},J=function(a){return n(a,rl)},ja=function(a){if(_(a)){const s=k(a);if(s)switch(s.branding){case Zi:return s;case za:return G(s.epochNanoseconds)}}return Xc(a)};var pf=function(a,s,t){const i=s.l(ja(t).epochNanoseconds,a);return i?oa(G(i)):null},M=function(a){return _(a)?(k(a)||{}).timeZone||gh(a):((s)=>Pi(rd(x(s))))(a)},ea=function(a,s){if(_(a)){const t=k(a)||{};switch(t.branding){case Ci:return S(s),t;case ys:return S(s),Sa(t);case za:return S(s),Fr(J,t)}return Nd(a,s)}return S(s),td(a)},cl=function(a){return a===void 0?void 0:ea(a)},Ys=function(a,s){if(s=H(s),_(a)){const i=k(a);return i&&i.branding===_s?(S(s),i):br($i(Ft(a)),a,s)}const t=ad(Us,a);return S(s),t},as=function(a,s){if(s=H(s),_(a)){const i=k(a)||{};switch(i.branding){case ys:return S(s),i;case Os:return S(s),W({...i,...Oa});case za:return S(s),Sr(J,i)}return Wd(Ji(Ft(a)),a,s)}const t=ec(a);return S(s),t},ra=function(a,s){if(s=H(s),_(a)){const i=k(a)||{};switch(i.branding){case Os:return S(s),i;case ys:return S(s),N(i);case za:return S(s),vr(J,i)}return Tr(Ji(Ft(a)),a,s)}const t=hi(a);return S(s),t},Of=function(a,s,t){return Da(s.call(a,A(N(t,a))))},La=function(a){return(s)=>typeof s=="string"?Us(s):((t,i)=>{const o=Object.keys(i).sort(),r={};for(let l of o)r[l]=D(i[l],t,t[l]);return r})(s,a)},I=function(a){if(_(a)){const s=k(a);return s&&s.branding===Li?s:$d(a)}return id(a)},St=function(a){if(a!==void 0){if(_(a)){const s=k(a)||{};switch(s.branding){case za:case Os:return s;case ys:return N(s)}const t=Ft(a);return{...Ed(M,n,Ji(t),a),calendar:t}}return kc(a)}},Ft=function(a){return yf(a)||w},yf=function(a){const{calendar:s}=a;if(s!==void 0)return X(s)},X=function(a){return _(a)?(k(a)||{}).calendar||Ch(a):((s)=>mt(od(x(s))))(a)},Bs=function(a,s){if(s=H(s),_(a)){const t=k(a);if(t&&t.branding===za)return ft(s),t;const i=Ft(a);return Hd(M,n,Ji(i),i,a,s)}return Vc(a,s)},mf=function(a){return ya((s)=>(t)=>s(ol(t)),a)},ol=function(a){return ta(a,J)},Ym=function(){const a=Va.prototype,s=Object.getOwnPropertyDescriptors(a),t=Object.getOwnPropertyDescriptors(Va),i=function(o,r={}){if(!(this instanceof i))return new i(o,r);Tl.set(this,((l,c={})=>{const d=new Va(l,c),u=d.resolvedOptions(),f=u.locale,p=pa(Object.keys(c),u),m=ua(Xm),h=(...g)=>{let P;const T=g.map((O,b)=>{const y=k(O),E=(y||{}).branding;if(b&&P&&P!==E)throw new TypeError(Hu);return P=E,y});return P?m(P)(f,p,...T):[d,...g]};return h.u=d,h})(o,r))};for(let o in s){const r=s[o],l=o.startsWith("format")&&Bm(o);typeof r.value=="function"?r.value=o==="constructor"?i:l||Km(o):l&&(r.get=function(){return l.bind(this)})}return t.prototype.value=Object.create(a,s),Object.defineProperties(i,t),i},Bm=function(a){return function(...s){const t=Tl.get(this),[i,...o]=t(...s);return i[a](...o)}},Km=function(a){return function(...s){return Tl.get(this).u[a](...s)}},Xm=function(a){const s=km[a];if(!s)throw new TypeError(Eu(a));return Na(s,ua(nr))};var la=function(a,s,t,i,o){return Pa(s,Gl(a,s),t,i,o)},Pa=function(a,s,t,i,o,r){const l=Xi(s,t,i);if(o&&s!==l)throw new RangeError(Mu(a,s,t,i,r));return l},Gl=function(a,s){const t=a[s];if(t===void 0)throw new TypeError(Rr(s));return t},_=function(a){return a!==null&&/object|function/.test(typeof a)},ua=function(a,s=Map){const t=new s;return(i,...o)=>{if(t.has(i))return t.get(i);const r=a(i,...o);return t.set(i,r),r}},oo=function(a){return ds({name:a},1)},ds=function(a,s){return ya((t)=>({value:t,configurable:1,writable:!s}),a)},Ul=function(a){return ya((s)=>({get:s,configurable:1}),a)},Gt=function(a){return{[Symbol.toStringTag]:{value:a,configurable:1}}},Is=function(a,s){const t={};let i=a.length;for(let o of s)t[a[--i]]=o;return t},ya=function(a,s,t){const i={};for(let o in s)i[o]=a(s[o],o,t);return i},ct=function(a,s,t){const i={};for(let o=0;o<s.length;o++){const r=s[o];i[r]=a(r,o,t)}return i},Vf=function(a,s,t){const i={};for(let o=0;o<a.length;o++)i[s[o]]=t[a[o]];return i},pa=function(a,s){const t={};for(let i of a)t[i]=s[i];return t},ro=function(a,s){const t={};for(let i in s)a.has(i)||(t[i]=s[i]);return t},lo=function(a){a={...a};const s=Object.keys(a);for(let t of s)a[t]===void 0&&delete a[t];return a},Ql=function(a,s){for(let t of s)if(!(t in a))return 0;return 1},Yl=function(a,s,t){for(let i of a)if(s[i]!==t[i])return 0;return 1},Bl=function(a,s,t){const i={...t};for(let o=0;o<s;o++)i[a[o]]=0;return i},D=function(a,...s){return(...t)=>a(...s,...t)},Cl=function(a){return a[0].toUpperCase()+a.substring(1)},dt=function(a){return a.slice().sort()},Et=function(a,s){return String(s).padStart(a,"0")},qa=function(a,s){return Math.sign(a-s)},Xi=function(a,s,t){return Math.min(Math.max(a,s),t)},Aa=function(a,s){return[Math.floor(a/s),at(a,s)]},at=function(a,s){return(a%s+s)%s},Ua=function(a,s){return[Ut(a,s),co(a,s)]},Ut=function(a,s){return Math.trunc(a/s)||0},co=function(a,s){return a%s||0},Ct=function(a){return Math.abs(a%1)===0.5},Kl=function(a,s,t){let i=0,o=0;for(let c=0;c<=s;c++){const d=a[t[c]],u=Ra[c],f=F/u,[p,m]=Ua(d,f);i+=m*u,o+=p}const[r,l]=Ua(i,F);return[o+r,l]},Qt=function(a,s,t){const i={};for(let o=s;o>=0;o--){const r=Ra[o];i[t[o]]=Ut(a,r),a=co(a,r)}return i},Xl=function(a){return a===w?Ri:[]},kl=function(a){return a===w?Ot:[]},Vl=function(a){return a===w?["year","day"]:[]},el=function(a){if(a!==void 0)return x(a)},ac=function(a){if(a!==void 0)return Da(a)},uo=function(a){if(a!==void 0)return ut(a)},Da=function(a){return ic(ut(a))},ut=function(a){return tc(_p(a))},fo=function(a){if(a==null)throw new TypeError("Cannot be null or undefined");return a},sc=function(a,s){if(s==null)throw new RangeError(Rr(a));return s},Ha=function(a){if(!_(a))throw new TypeError(Ru);return a},Yt=function(a,s,t=a){if(typeof s!==a)throw new TypeError(Pt(t,s));return s},tc=function(a,s="number"){if(!Number.isInteger(a))throw new RangeError(gp(s,a));return a||0},ic=function(a,s="number"){if(a<=0)throw new RangeError(Pp(s,a));return a},po=function(a){if(typeof a=="symbol")throw new TypeError(yp);return String(a)},Ht=function(a,s){return _(a)?String(a):x(a,s)},Bt=function(a){if(typeof a=="string")return BigInt(a);if(typeof a!="bigint")throw new TypeError(Op(a));return a},oc=function(a,s="number"){if(typeof a=="bigint")throw new TypeError(bp(s));if(a=Number(a),!Number.isFinite(a))throw new RangeError(Tp(s,a));return a},V=function(a,s){return Math.trunc(oc(a,s))||0},rc=function(a,s){return tc(oc(a,s),s)},Zl=function(a,s){return ic(V(a,s),s)},mo=function(a,s){let[t,i]=Ua(s,F),o=a+t;const r=Math.sign(o);return r&&r===-Math.sign(i)&&(o-=r,i+=r*F),[o,i]},js=function(a,s,t=1){return mo(a[0]+s[0]*t,a[1]+s[1]*t)},Cs=function(a,s){return mo(a[0],a[1]+s)},ma=function(a,s){return js(s,a,-1)},aa=function(a,s){return qa(a[0],s[0])||qa(a[1],s[1])},lc=function(a,s,t){return aa(a,s)===-1||aa(a,t)===1},Kt=function(a,s=1){const t=BigInt(F/s);return[Number(a/t),Number(a%t)*s]},Zs=function(a,s=1){const t=F/s,[i,o]=Ua(a,t);return[i,o*s]},cc=function(a,s=1){const[t,i]=a,o=Math.floor(i/s),r=F/s;return BigInt(t)*BigInt(r)+BigInt(o)},ha=function(a,s=1,t){const[i,o]=a,[r,l]=Ua(o,s);return i*(F/s)+(r+(t?l/s:0))},ho=function(a,s,t=Aa){const[i,o]=a,[r,l]=t(o,s);return[i*(F/s)+r,l]},go=function(a,s){const t=a.formatToParts(s),i={};for(let o of t)i[o.type]=o.value;return i},Po=function(a){return la(a,"isoYear",lt,rt,1),a.isoYear===lt?la(a,"isoMonth",4,12,1):a.isoYear===rt&&la(a,"isoMonth",1,9,1),a},_a=function(a){return Wa({...a,...Oa,isoHour:12}),a},Wa=function(a){const s=la(a,"isoYear",lt,rt,1),t=s===lt?1:s===rt?-1:0;return t&&ga(e({...a,isoDay:a.isoDay+t,isoNanosecond:a.isoNanosecond-t})),a},ga=function(a){if(!a||lc(a,Xp,Kp))throw new RangeError(Si);return a},Qa=function(a){return Kl(a,5,Fa)[1]},Xt=function(a){const[s,t]=Aa(a,F);return[Qt(t,5,Fa),s]},dc=function(a){return uc(a)[0]},uc=function(a){return ho(a,ba)},sa=function(a){return As(a.isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond,a.isoMillisecond)},e=function(a){const s=sa(a);if(s!==void 0){const[t,i]=Ua(s,da);return[t,i*Ma+(a.isoMicrosecond||0)*bs+(a.isoNanosecond||0)]}},To=function(a,s){const[t,i]=Xt(Qa(a)-s);return ga(e({...a,isoDay:a.isoDay+i,...t}))},Wt=function(...a){return As(...a)/Nu},As=function(...a){const[s,t]=fc(...a),i=s.valueOf();if(!isNaN(i))return i-t*da},fc=function(a,s=1,t=1,i=0,o=0,r=0,l=0){const c=a===lt?1:a===rt?-1:0,d=new Date;return d.setUTCHours(i,o,r,l),d.setUTCFullYear(a,s-1,t+c),[d,c]},Ba=function(a,s){let[t,i]=Cs(a,s);i<0&&(i+=F,t-=1);const[o,r]=Aa(i,Ma),[l,c]=Aa(r,bs);return kt(t*da+o,l,c)},kt=function(a,s=0,t=0){const i=Math.ceil(Math.max(0,Math.abs(a)-Bp)/da)*Math.sign(a),o=new Date(a-i*da);return Is(ji,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+i,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,t])},pc=function(a){return[a.isoYear,a.isoMonth,a.isoDay]},mc=function(){return Ia},bo=function(a,s){switch(s){case 2:return Oo(a)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},hc=function(a){return Oo(a)?366:365},Oo=function(a){return a%4==0&&(a%100!=0||a%400==0)},gc=function(a){const[s,t]=fc(a.isoYear,a.isoMonth,a.isoDay);return at(s.getUTCDay()-t,7)||7},Pc=function({isoYear:a}){return a<1?["bce",1-a]:["ce",a]},ef=function(a){const s=sa(a);if(s<Vp)return Pc(a);const t=go(Gr(Ls),s),{era:i,eraYear:o}=Rd(t,Ls);return[i,o]},Vt=function(a){return us(a),et(a,1),a},us=function(a){return Tc(a,1),a},Ll=function(a){return Yl(Hr,a,Tc(a))},Tc=function(a,s){const{isoYear:t}=a,i=la(a,"isoMonth",1,mc(),s);return{isoYear:t,isoMonth:i,isoDay:la(a,"isoDay",1,bo(t,i),s)}},et=function(a,s){return Is(Fa,[la(a,"isoHour",0,23,s),la(a,"isoMinute",0,59,s),la(a,"isoSecond",0,59,s),la(a,"isoMillisecond",0,999,s),la(a,"isoMicrosecond",0,999,s),la(a,"isoNanosecond",0,999,s)])},S=function(a){return a===void 0?0:sf(Ha(a))},ft=function(a,s=0){a=wa(a);const t=tf(a),i=dm(a,s);return[sf(a),i,t]},yo=function(a){return tf(wa(a))},bc=function(a){return a=wa(a),$r(a,9,6,1)},Es=function(a,s,t,i=9,o=0,r=4){s=wa(s);let l=$r(s,i,o),c=So(s),d=Dt(s,r);const u=yt(s,i,o,1);return l==null?l=Math.max(t,u):wc(l,u),c=vo(c,u,1),a&&(d=((f)=>f<4?(f+2)%4:f)(d)),[l,u,c,d]},ai=function(a,s=6,t){let i=So(a=Fo(a,_t));const o=Dt(a,7);let r=yt(a,s);return r=sc(_t,r),i=vo(i,r,void 0,t),[r,i,o]},Do=function(a){return Jr(wa(a))},Oc=function(a,s){return wo(wa(a),s)},wo=function(a,s=4){const t=Dc(a);return[Dt(a,4),...yc(yt(a,s),t)]},yc=function(a,s){return a!=null?[Ra[a],a<4?9-3*a:-1]:[s===void 0?1:10**(9-s),s]},So=function(a){const s=a[st];return s===void 0?1:V(s,st)},vo=function(a,s,t,i){const o=i?F:Ra[s+1];if(o){const r=Ra[s];if(o%((a=Pa(st,a,1,o/r-(i?0:1),1))*r))throw new RangeError(Pt(st,a))}else a=Pa(st,a,1,t?1e9:1,1);return a},Dc=function(a){let s=a[Ki];if(s!==void 0){if(typeof s!="number"){if(po(s)==="auto")return;throw new RangeError(Pt(Ki,s))}s=Pa(Ki,Math.floor(s),0,9,1)}return s},wa=function(a){return a===void 0?{}:Ha(a)},Fo=function(a,s){return typeof a=="string"?{[s]:a}:Ha(a)},H=function(a){if(a!==void 0){if(_(a))return Object.assign(Object.create(null),a);throw new TypeError(Ru)}},si=function(a,s){return a&&Object.assign(Object.create(null),a,{overflow:am[s]})},no=function(a,s,t=9,i=0,o){let r=s[a];if(r===void 0)return o?i:void 0;if(r=po(r),r==="auto")return o?i:null;let l=ao[r];if(l===void 0&&(l=Qp[r]),l===void 0)throw new RangeError(Zu(a,r,ao));return Pa(a,l,i,t,1,bt),l},fs=function(a,s,t,i=0){const o=t[a];if(o===void 0)return i;const r=po(o),l=s[r];if(l===void 0)throw new RangeError(Zu(a,r,s));return l},wc=function(a,s){if(s>a)throw new RangeError(Np)},G=function(a){return{branding:Zi,epochNanoseconds:a}},B=function(a,s,t){return{branding:za,calendar:t,timeZone:s,epochNanoseconds:a}},W=function(a,s=a.calendar){return{branding:ys,calendar:s,...pa(ku,a)}},N=function(a,s=a.calendar){return{branding:Os,calendar:s,...pa(Wr,a)}},ls=function(a,s=a.calendar){return{branding:_s,calendar:s,...pa(Wr,a)}},Nt=function(a,s=a.calendar){return{branding:Gs,calendar:s,...pa(Wr,a)}},Sa=function(a){return{branding:Ci,...pa(Xu,a)}},C=function(a){return{branding:Li,sign:Ka(a),...pa(Ir,a)}},Sc=function(a){return dc(a.epochNanoseconds)},ti=function(a){return ho(a.epochNanoseconds,Ma)[0]},vc=function(a){return cc(a.epochNanoseconds,bs)},Fc=function(a){return cc(a.epochNanoseconds)},nc=function(a){return a.epochNanoseconds},Q=function(a){return typeof a=="string"?a:x(a.id)},Hs=function(a,s){return a===s||Q(a)===Q(s)},Rc=function(a,s,t,i,o){const r=cs(i),[l,c]=((T,O)=>{const b=O((T=Fo(T,io))[eu]);let y=cm(T);return y=sc(io,y),[y,b]})(o,a);if(it(Math.max(l,r),c))return xl(i,l);if(!c)throw new RangeError(vi);const[d,u,f]=di(s,t,c),p=Ko(f),m=ui(f),h=Xo(f),g=m(u,d,i),P=h(u,d,g,l);return it(l,c)?xl(P,l):((T,O,b,y,E,Z,j)=>{const L=Ka(T),[U,z]=Ro(y,Er(b,T),b,L,E,Z,j),ks=Mo(O,U,z);return T[v[b]]+ks*L})(P,p(g),l,u,d,p,m)},xl=function(a,s){return ha(q(a),Ra[s],1)},Ro=function(a,s,t,i,o,r,l){const c=v[t],d={...s,[c]:s[c]+i},u=l(a,o,s),f=l(a,o,d);return[r(u),r(f)]},Mo=function(a,s,t){const i=ha(ma(s,t));if(!i)throw new RangeError(Tt);return ha(ma(s,a))/i},Mc=function(a,s){const[t,i,o]=ai(s,5,1);return G(oi(a.epochNanoseconds,t,i,o,1))},jc=function(a,s,t){let{epochNanoseconds:i,timeZone:o,calendar:r}=s;const[l,c,d]=ai(t);if(l===0&&c===1)return s;const u=a(o);if(l===6)i=((f,p,m,h)=>{const g=ta(m,p),[P,T]=f(g),O=m.epochNanoseconds,b=fa(p,P),y=fa(p,T);if(lc(O,b,y))throw new RangeError(Tt);return Wc(Mo(O,b,y),h)?y:b})(Ec,u,s,d);else{const f=u.getOffsetNanosecondsFor(i);i=ms(u,Ic(Ba(i,f),l,c,d),f,2,0,1)}return B(i,o,r)},Cc=function(a,s){return W(Ic(a,...ai(s)),a.calendar)},Zc=function(a,s){const[t,i,o]=ai(s,5);var r;return Sa((r=o,jo(a,pt(t,i),r)[0]))},Lc=function(a,s){const t=a(s.timeZone),i=ta(s,t),[o,r]=Ec(i),l=ha(ma(fa(t,o),fa(t,r)),ni,1);if(l<=0)throw new RangeError(Tt);return l},xc=function(a,s){const{timeZone:t,calendar:i}=s,o=((r,l,c)=>fa(l,r(ta(c,l))))(Hc,a(t),s);return B(o,t,i)},Ic=function(a,s,t,i){return Ac(a,pt(s,t),i)},Ac=function(a,s,t){const[i,o]=jo(a,s,t);return Wa({...hs(a,o),...i})},jo=function(a,s,t){return Xt(Ya(Qa(a),s,t))},$t=function(a){return Ya(a,Fi,7)},pt=function(a,s){return Ra[a]*s},Ec=function(a){const s=Hc(a);return[s,hs(s,1)]},Hc=function(a){return Yp(6,a)},ap=function(a,s,t){const i=Math.min(cs(a),6);return Ns(ri(q(a,i),s,t),i)},ii=function(a,s,t,i,o,r,l,c,d,u){if(i===0&&o===1)return a;const f=it(i,c)?fi(c)&&i<6&&t>=6?tp:sp:ip;let[p,m,h]=f(a,s,t,i,o,r,l,c,d,u);return h&&i!==7&&(p=((g,P,T,O,b,y,E,Z)=>{const j=Ka(g);for(let L=O+1;L<=T;L++){if(L===7&&T!==7)continue;const U=Er(L,g);U[v[L]]+=j;const z=ha(ma(E(Z(b,y,U)),P));if(z&&Math.sign(z)!==j)break;g=U}return g})(p,m,t,Math.max(6,i),l,c,d,u)),p},oi=function(a,s,t,i,o){if(s===6){const r=((l)=>l[0]+l[1]/F)(a);return[Ya(r,t,i),0]}return ri(a,pt(s,t),i,o)},ri=function(a,s,t,i){let[o,r]=a;i&&r<0&&(r+=F,o-=1);const[l,c]=Aa(Ya(r,s,t),F);return mo(o+l,c)},Ya=function(a,s,t){return Wc(a/s,t)*s},Wc=function(a,s){return pm[s](a)},sp=function(a,s,t,i,o,r){const l=Ka(a),c=q(a),d=oi(c,i,o,r),u=ma(c,d),f=Math.sign(d[0]-c[0])===l,p=Ns(d,Math.min(t,6));return[{...a,...p},js(s,u),f]},tp=function(a,s,t,i,o,r,l,c,d,u){const f=Ka(a),p=ha(q(a,5)),m=pt(i,o);let h=Ya(p,m,r);const[g,P]=Ro(l,{...a,...Ar},6,f,c,d,u),T=h-ha(ma(g,P));let O=0;T&&Math.sign(T)!==f?s=Cs(g,h):(O+=f,h=Ya(T,m,r),s=Cs(P,h));const b=mi(h);return[{...a,...b,days:a.days+O},s,Boolean(O)]},ip=function(a,s,t,i,o,r,l,c,d,u){const f=Ka(a),p=v[i],m=Er(i,a);i===7&&(a={...a,weeks:a.weeks+Math.trunc(a.days/7)});const h=Ut(a[p],o)*o;m[p]=h;const[g,P]=Ro(l,m,i,o*f,c,d,u),T=h+Mo(s,g,P)*f*o,O=Ya(T,o,r),b=Math.sign(O-T)===f;return m[p]=O,[m,b?P:g,b]},Co=function(a,s,t,i){const[o,r,l,c]=((u)=>{const f=wo(u=wa(u));return[u.timeZone,...f]})(i),d=o!==void 0;return((u,f,p,m,h,g)=>{p=ri(p,h,m,1);const P=f.getOffsetNanosecondsFor(p);return Ho(Ba(p,P),g)+(u?ps($t(P)):"Z")})(d,s(d?a(o):Ds),t.epochNanoseconds,r,l,c)},Zo=function(a,s,t){const[i,o,r,l,c,d]=((u)=>{u=wa(u);const f=Jr(u),p=Dc(u),m=fm(u),h=Dt(u,4),g=yt(u,4);return[f,um(u),m,h,...yc(g,p)]})(t);return((u,f,p,m,h,g,P,T,O,b)=>{m=ri(m,O,T,1);const y=u(p).getOffsetNanosecondsFor(m);return Ho(Ba(m,y),b)+ps($t(y),P)+((E,Z)=>Z!==1?"["+(Z===2?"!":"")+Q(E)+"]":"")(p,g)+Wo(f,h)})(a,s.calendar,s.timeZone,s.epochNanoseconds,i,o,r,l,c,d)},Lo=function(a,s){const[t,i,o,r]=((u)=>(u=wa(u),[Jr(u),...wo(u)]))(s);return l=a.calendar,c=t,d=r,Ho(Ac(a,o,i),d)+Wo(l,c);var l,c,d},xo=function(a,s){return t=a.calendar,i=a,o=Do(s),Jt(i)+Wo(t,o);var t,i,o},Io=function(a,s){return Nc(a.calendar,$c,a,Do(s))},Ao=function(a,s){return Nc(a.calendar,op,a,Do(s))},Eo=function(a,s){const[t,i,o]=Oc(s);return r=o,Jc(jo(a,i,t)[0],r);var r},li=function(a,s){const[t,i,o]=Oc(s,3);return i>1&&(a={...a,...ap(a,i,t)}),((r,l)=>{const{sign:c}=r,d=c===-1?ia(r):r,{hours:u,minutes:f}=d,[p,m]=ho(q(d,3),ba,Ua);Bc(p);const h=No(m,l),g=l>=0||!c||h;return(c<0?"-":"")+"P"+Il({Y:rs(d.years),M:rs(d.months),W:rs(d.weeks),D:rs(d.days)})+(u||f||p||g?"T"+Il({H:rs(u),M:rs(f),S:rs(p,g)+h}):"")})(a,o)},Nc=function(a,s,t,i){const o=Q(a),r=i>1||i===0&&o!==w;return i===1?o===w?s(t):Jt(t):r?Jt(t)+zc(o,i===2):s(t)},Il=function(a){const s=[];for(let t in a){const i=a[t];i&&s.push(i,t)}return s.join("")},Ho=function(a,s){return Jt(a)+"T"+Jc(a,s)},Jt=function(a){return $c(a)+"-"+Ta(a.isoDay)},$c=function(a){const{isoYear:s}=a;return(s<0||s>9999?qc(s)+Et(6,Math.abs(s)):Et(4,s))+"-"+Ta(a.isoMonth)},op=function(a){return Ta(a.isoMonth)+"-"+Ta(a.isoDay)},Jc=function(a,s){const t=[Ta(a.isoHour),Ta(a.isoMinute)];return s!==-1&&t.push(Ta(a.isoSecond)+((i,o,r,l)=>No(i*Ma+o*bs+r,l))(a.isoMillisecond,a.isoMicrosecond,a.isoNanosecond,s)),t.join(":")},ps=function(a,s=0){if(s===1)return"";const[t,i]=Aa(Math.abs(a),ni),[o,r]=Aa(i,Fi),[l,c]=Aa(r,ba);return qc(a)+Ta(t)+":"+Ta(o)+(l||c?":"+Ta(l)+No(c):"")},Wo=function(a,s){if(s!==1){const t=Q(a);if(s>1||s===0&&t!==w)return zc(t,s===2)}return""},zc=function(a,s){return"["+(s?"!":"")+"u-ca="+a+"]"},No=function(a,s){let t=Et(9,a);return t=s===void 0?t.replace(gm,""):t.slice(0,s),t?"."+t:""},qc=function(a){return a<0?"-":"+"},rs=function(a,s){return a||s?a.toLocaleString("fullwide",{useGrouping:0}):""},rp=function(a,s){const{epochNanoseconds:t}=a,i=(s.getOffsetNanosecondsFor?s:s(a.timeZone)).getOffsetNanosecondsFor(t),o=Ba(t,i);return{calendar:a.calendar,...o,offsetNanoseconds:i}},_c=function(a,s){const t=ta(s,a);return{calendar:s.calendar,...pa(ku,t),offset:ps(t.offsetNanoseconds),timeZone:s.timeZone}},ms=function(a,s,t,i=0,o=0,r,l){if(t!==void 0&&i===1&&(i===1||l))return To(s,t);const c=a.getPossibleInstantsFor(s);if(t!==void 0&&i!==3){const d=((u,f,p,m)=>{const h=e(f);m&&(p=$t(p));for(let g of u){let P=ha(ma(g,h));if(m&&(P=$t(P)),P===p)return g}})(c,s,t,r);if(d!==void 0)return d;if(i===0)throw new RangeError(xp)}return l?e(s):fa(a,s,o,c)},fa=function(a,s,t=0,i=a.getPossibleInstantsFor(s)){if(i.length===1)return i[0];if(t===1)throw new RangeError(Ip);if(i.length)return i[t===3?1:0];const o=e(s),r=((c,d)=>{const u=c.getOffsetNanosecondsFor(Cs(d,-F));return Jo(c.getOffsetNanosecondsFor(Cs(d,F))-u)})(a,o),l=r*(t===2?-1:1);return(i=a.getPossibleInstantsFor(Ba(o,l)))[t===2?0:i.length-1]},$o=function(a){if(Math.abs(a)>=F)throw new RangeError(Zp);return a},Jo=function(a){if(a>F)throw new RangeError(Lp);return a},zo=function(a,s,t){return G(ga(js(s.epochNanoseconds,((i)=>{if(Kc(i))throw new RangeError(Hp);return q(i,5)})(a?ia(t):t))))},qo=function(a,s,t,i,o,r=Object.create(null)){const l=s(i.timeZone),c=a(i.calendar);return{...i,...Yo(l,c,i,t?ia(o):o,r)}},_o=function(a,s,t,i,o=Object.create(null)){const{calendar:r}=t;return W(Bo(a(r),t,s?ia(i):i,o),r)},Go=function(a,s,t,i,o){const{calendar:r}=t;return N(ci(a(r),t,s?ia(i):i,o),r)},Uo=function(a,s,t,i,o=Object.create(null)){const r=t.calendar,l=a(r);let c=tt(l,t);s&&(i=pi(i)),i.sign<0&&(c=l.dateAdd(c,{...Y,months:1}),c=hs(c,-1));const d=l.dateAdd(c,i,o);return ls(tt(l,d),r)},Qo=function(a,s,t){return Sa(Gc(s,a?ia(t):t)[0])},Yo=function(a,s,t,i,o){const r=q(i,5);let l=t.epochNanoseconds;if(Kc(i)){const c=ta(t,a);l=js(fa(a,{...ci(s,c,{...i,...Ar},o),...pa(Fa,c)}),r)}else l=js(l,r),S(o);return{epochNanoseconds:ga(l)}},Bo=function(a,s,t,i){const[o,r]=Gc(s,t);return Wa({...ci(a,s,{...t,...Ar,days:t.days+r},i),...o})},ci=function(a,s,t,i){if(t.years||t.months||t.weeks)return a.dateAdd(s,t,i);S(i);const o=t.days+q(t,5)[0];return o?_a(hs(s,o)):s},tt=function(a,s,t=1){return hs(s,t-a.day(s))},Gc=function(a,s){const[t,i]=q(s,5),[o,r]=Xt(Qa(a)+i);return[o,t+r]},hs=function(a,s){return s?{...a,...kt(sa(a)+s*da)}:a},di=function(a,s,t){const i=a(t.calendar);return fi(t)?[t,i,s(t.timeZone)]:[{...t,...Oa},i]},Ko=function(a){return a?nc:e},ui=function(a){return a?D(Yo,a):Bo},Xo=function(a){return a?D(cp,a):dp},fi=function(a){return a&&a.epochNanoseconds},it=function(a,s){return a<=6-(fi(s)?1:0)},ko=function(a,s,t,i,o,r,l){const c=a(wa(l).relativeTo),d=Math.max(cs(o),cs(r));if(it(d,c))return C(Ws(((P,T,O,b)=>{const y=js(q(P),q(T),b?-1:1);if(!Number.isFinite(y[0]))throw new RangeError(Si);return{...Y,...Ns(y,O)}})(o,r,d,i)));if(!c)throw new RangeError(vi);i&&(r=ia(r));const[u,f,p]=di(s,t,c),m=ui(p),h=Xo(p),g=m(f,u,o);return C(h(f,u,m(f,g,r),d))},Uc=function(a,s,t,i,o){const r=cs(i),[l,c,d,u,f]=((j,L,U)=>{j=Fo(j,_t);let z=$r(j);const ks=U(j[eu]);let Vs=So(j);const kf=Dt(j,7);let os=yt(j);if(z===void 0&&os===void 0)throw new RangeError(Wp);return os==null&&(os=0),z==null&&(z=Math.max(os,L)),wc(z,os),Vs=vo(Vs,os,1),[z,os,Vs,kf,ks]})(o,r,a),p=Math.max(r,l);if(!fi(f)&&p<=6)return C(Ws(((j,L,U,z,ks)=>{const Vs=oi(q(j),U,z,ks);return{...Y,...Ns(Vs,L)}})(i,l,c,d,u)));if(!f)throw new RangeError(vi);const[m,h,g]=di(s,t,f),P=Ko(g),T=ui(g),O=Xo(g),b=T(h,m,i);let y=O(h,m,b,l);const E=i.sign,Z=Ka(y);if(E&&Z&&E!==Z)throw new RangeError(Tt);return Z&&(y=ii(y,P(b),l,c,d,u,h,m,P,T)),C(y)},Qc=function(a){return a.sign===-1?pi(a):a},pi=function(a){return C(ia(a))},ia=function(a){const s={};for(let t of v)s[t]=-1*a[t]||0;return s},Yc=function(a){return!a.sign},Ka=function(a,s=v){let t=0;for(let i of s){const o=Math.sign(a[i]);if(o){if(t&&t!==o)throw new RangeError(Ep);t=o}}return t},Ws=function(a){for(let s of Up)Pa(s,a[s],-Jl,Jl,1);return Bc(ha(q(a),ba)),a},Bc=function(a){if(!Number.isSafeInteger(a))throw new RangeError(Ap)},q=function(a,s=6){return Kl(a,s,v)},Ns=function(a,s=6){const[t,i]=a,o=Qt(i,s,v);if(o[v[s]]+=t*(F/Ra[s]),!Number.isFinite(o[v[s]]))throw new RangeError(Si);return o},mi=function(a,s=5){return Qt(a,s,v)},Kc=function(a){return Boolean(Ka(a,Ku))},cs=function(a){let s=9;for(;s>0&&!a[v[s]];s--);return s},lp=function(a,s){return[a,s]},Al=function(a){const s=Math.floor(a/It)*It;return[s,s+It]},Xc=function(a){const s=Xa(a=Ht(a));if(!s)throw new RangeError(ca(a));let t;if(s.m)t=0;else{if(!s.offset)throw new RangeError(ca(a));t=$s(s.offset)}return s.timeZone&&sr(s.timeZone,1),G(To(Vt(s),t))},kc=function(a){const s=Xa(x(a));if(!s)throw new RangeError(ca(a));if(s.timeZone)return ld(s,s.offset?$s(s.offset):void 0);if(s.m)throw new RangeError(ca(a));return dd(s)},Vc=function(a,s){const t=Xa(x(a));if(!t||!t.timeZone)throw new RangeError(ca(a));const{offset:i}=t,o=i?$s(i):void 0,[,r,l]=ft(s);return ld(t,o,r,l)},$s=function(a){const s=sr(a);if(s===void 0)throw new RangeError(ca(a));return s},ec=function(a){const s=Xa(x(a));if(!s||s.m)throw new RangeError(ca(a));return W(cd(s))},hi=function(a){const s=Xa(x(a));if(!s||s.m)throw new RangeError(ca(a));return N(s.p?cd(s):dd(s))},ad=function(a,s){const t=eo(x(s));if(t)return Vo(t),ls(Po(us(t)));const i=hi(s);return ls(tt(a(i.calendar),i))},Vo=function(a){if(a.calendar!==w)throw new RangeError(Ea(a.calendar))},sd=function(a,s){const t=ar(x(s));if(t)return Vo(t),Nt(us(t));const i=hi(s),{calendar:o}=i,r=a(o),[l,c,d]=r.h(i),[u,f]=r.I(l,c),[p,m]=r.N(u,f,d);return Nt(_a(r.P(p,m,d)),o)},td=function(a){let s,t=((i)=>{const o=ym.exec(i);return o?(gi(o[10]),pd(o)):void 0})(x(a));if(!t){if(t=Xa(a),!t)throw new RangeError(ca(a));if(!t.p)throw new RangeError(ca(a));if(t.m)throw new RangeError(Ea("Z"));Vo(t)}if((s=eo(a))&&Ll(s))throw new RangeError(ca(a));if((s=ar(a))&&Ll(s))throw new RangeError(ca(a));return Sa(et(t,1))},id=function(a){const s=((t)=>{const i=Sm.exec(t);return i?((o)=>{function r(f,p,m){let h=0,g=0;if(m&&([h,d]=Aa(d,Ra[m])),f!==void 0){if(c)throw new RangeError(Ea(f));g=((P)=>{const T=parseInt(P);if(!Number.isFinite(T))throw new RangeError(Ea(P));return T})(f),l=1,p&&(d=tr(p)*(Ra[m]/ba),c=1)}return h+g}let l=0,c=0,d=0,u={...Is(v,[r(o[2]),r(o[3]),r(o[4]),r(o[5]),r(o[6],o[7],5),r(o[8],o[9],4),r(o[10],o[11],3)]),...Qt(d,2,v)};if(!l)throw new RangeError(ju(v));return ir(o[1])<0&&(u=ia(u)),u})(i):void 0})(x(a));if(!s)throw new RangeError(ca(a));return C(Ws(s))},od=function(a){const s=Xa(a)||eo(a)||ar(a);return s?s.calendar:a},rd=function(a){const s=Xa(a);return s&&(s.timeZone||s.m&&Ds||s.offset)||a},ld=function(a,s,t=0,i=0){const o=Pi(a.timeZone),r=xi(o);return B(ms(r,Vt(a),s,t,i,!r.v,a.m),o,mt(a.calendar))},cd=function(a){return ud(Wa(Vt(a)))},dd=function(a){return ud(_a(us(a)))},ud=function(a){return{...a,calendar:mt(a.calendar)}},Xa=function(a){const s=Om.exec(a);return s?((t)=>{const i=t[10],o=(i||"").toUpperCase()==="Z";return{isoYear:fd(t),isoMonth:parseInt(t[4]),isoDay:parseInt(t[5]),...pd(t.slice(5)),...gi(t[16]),p:Boolean(t[6]),m:o,offset:o?void 0:i}})(s):void 0},eo=function(a){const s=Tm.exec(a);return s?((t)=>({isoYear:fd(t),isoMonth:parseInt(t[4]),isoDay:1,...gi(t[5])}))(s):void 0},ar=function(a){const s=bm.exec(a);return s?((t)=>({isoYear:xs,isoMonth:parseInt(t[1]),isoDay:parseInt(t[2]),...gi(t[3])}))(s):void 0},sr=function(a,s){const t=Dm.exec(a);return t?((i,o)=>{const r=i[4]||i[5];if(o&&r)throw new RangeError(Ea(r));return $o((Ms(i[2])*ni+Ms(i[3])*Fi+Ms(i[4])*ba+tr(i[5]||""))*ir(i[1]))})(t,s):void 0},fd=function(a){const s=ir(a[1]),t=parseInt(a[2]||a[3]);if(s<0&&!t)throw new RangeError(Ea(-0));return s*t},pd=function(a){const s=Ms(a[3]);return{...Xt(tr(a[4]||""))[0],isoHour:Ms(a[1]),isoMinute:Ms(a[2]),isoSecond:s===60?59:s}},gi=function(a){let s,t;const i=[];if(a.replace(wm,(o,r,l)=>{const c=Boolean(r),[d,u]=l.split("=").reverse();if(u){if(u==="u-ca")i.push(d),s||(s=c);else if(c||/[A-Z]/.test(u))throw new RangeError(Ea(o))}else{if(t)throw new RangeError(Ea(o));t=d}return""}),i.length>1&&s)throw new RangeError(Ea(a));return{timeZone:t,calendar:i[0]||w}},tr=function(a){return parseInt(a.padEnd(9,"0"))},Js=function(a){return new RegExp(`^${a}\$`,"i")},ir=function(a){return a&&a!=="+"?-1:1},Ms=function(a){return a===void 0?0:parseInt(a)},md=function(a){return Pi(x(a))},Pi=function(a){const s=or(a);return typeof s=="number"?ps(s):s?((t)=>{if(Fm.test(t))throw new RangeError(Cp);return t.toLowerCase().split("/").map((i,o)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(r,l)=>r.length<=2&&!o||r==="in"||r==="chat"?r.toUpperCase():r.length>2||!l?Cl(r).replace(/island|noronha|murdo|rivadavia|urville/,Cl):r)).join("/")})(a):Ds},El=function(a){const s=or(a);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:Ds},or=function(a){const s=sr(a=a.toUpperCase(),1);return s!==void 0?s:a!==Ds?vm(a):void 0},rr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},lr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},hd=function(a,s,t,i,o,r){const l=a(wa(r).relativeTo),c=Math.max(cs(i),cs(o));if(Yl(v,i,o))return 0;if(it(c,l))return aa(q(i),q(o));if(!l)throw new RangeError(vi);const[d,u,f]=di(s,t,l),p=Ko(f),m=ui(f);return aa(p(m(u,d,i)),p(m(u,d,o)))},cr=function(a,s){return gs(a,s)||Ti(a,s)},gs=function(a,s){return qa(sa(a),sa(s))},Ti=function(a,s){return qa(Qa(a),Qa(s))},gd=function(a,s){return!rr(a,s)},Pd=function(a,s){return!lr(a,s)&&!!bi(a.timeZone,s.timeZone)&&Hs(a.calendar,s.calendar)},Td=function(a,s){return!cr(a,s)&&Hs(a.calendar,s.calendar)},bd=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},Od=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},yd=function(a,s){return!gs(a,s)&&Hs(a.calendar,s.calendar)},Dd=function(a,s){return!Ti(a,s)},bi=function(a,s){if(a===s)return 1;const t=Q(a),i=Q(s);if(t===i)return 1;try{return El(t)===El(i)}catch(o){}},dr=function(a,s,t,i){const o=Es(a,H(i),3,5),r=Oi(s.epochNanoseconds,t.epochNanoseconds,...o);return C(a?ia(r):r)},ur=function(a,s,t,i,o,r){const l=Di(i.calendar,o.calendar),c=H(r),[d,u,f,p]=Es(t,c,5),m=i.epochNanoseconds,h=o.epochNanoseconds,g=aa(h,m);let P;if(g)if(d<6)P=Oi(m,h,d,u,f,p);else{const T=s(((b,y)=>{if(!bi(b,y))throw new RangeError(Au);return b})(i.timeZone,o.timeZone)),O=a(l);P=Sd(O,T,i,o,g,d,c),P=ii(P,h,d,u,f,p,O,i,nc,D(Yo,T))}else P=Y;return C(t?ia(P):P)},fr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o),[c,d,u,f]=Es(s,l,6),p=e(t),m=e(i),h=aa(m,p);let g;if(h)if(c<=6)g=Oi(p,m,c,d,u,f);else{const P=a(r);g=vd(P,t,i,h,c,l),g=ii(g,m,c,d,u,f,P,t,e,Bo)}else g=Y;return C(s?ia(g):g)},pr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o);return wd(s,()=>a(r),t,i,...Es(s,l,6,9,6),l)},mr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),l=H(o),c=Es(s,l,9,9,8),d=a(r);return wd(s,()=>d,tt(d,t),tt(d,i),...c,l)},wd=function(a,s,t,i,o,r,l,c,d){const u=e(t),f=e(i);let p;if(aa(f,u))if(o===6)p=Oi(u,f,o,r,l,c);else{const m=s();p=m.dateUntil(t,i,o,d),r===6&&l===1||(p=ii(p,f,o,r,l,c,m,t,e,ci))}else p=Y;return C(a?ia(p):p)},hr=function(a,s,t,i){const o=H(i),[r,l,c,d]=Es(a,o,5,5),u=Ya(gr(s,t),pt(l,c),d),f={...Y,...mi(u,r)};return C(a?ia(f):f)},cp=function(a,s,t,i,o,r){const l=aa(i.epochNanoseconds,t.epochNanoseconds);return l?o<6?Fd(t.epochNanoseconds,i.epochNanoseconds,o):Sd(s,a,t,i,l,o,r):Y},dp=function(a,s,t,i,o){const r=e(s),l=e(t),c=aa(l,r);return c?i<=6?Fd(r,l,i):vd(a,s,t,c,i,o):Y},Sd=function(a,s,t,i,o,r,l){const[c,d,u]=((m,h,g,P)=>{function T(){return L={...hs(y,Z++*-P),...b},U=fa(m,L),aa(E,U)===-P}const O=ta(h,m),b=pa(Fa,O),y=ta(g,m),E=g.epochNanoseconds;let Z=0;const j=gr(O,y);let L,U;if(Math.sign(j)===-P&&Z++,T()&&(P===-1||T()))throw new RangeError(Tt);const z=ha(ma(U,E));return[O,L,z]})(s,t,i,o);var f,p;return{...r===6?(f=c,p=d,{...Y,days:nd(f,p)}):a.dateUntil(c,d,r,l),...mi(u)}},vd=function(a,s,t,i,o,r){const[l,c,d]=((u,f,p)=>{let m=f,h=gr(u,f);return Math.sign(h)===-p&&(m=hs(f,-p),h+=F*p),[u,m,h]})(s,t,i);return{...a.dateUntil(l,c,o,r),...mi(d)}},Oi=function(a,s,t,i,o,r){return{...Y,...Ns(oi(ma(a,s),i,o,r),t)}},Fd=function(a,s,t){return{...Y,...Ns(ma(a,s),t)}},nd=function(a,s){return yi(sa(a),sa(s))},yi=function(a,s){return Math.trunc((s-a)/da)},gr=function(a,s){return Qa(s)-Qa(a)},Di=function(a,s){if(!Hs(a,s))throw new RangeError(Cr);return a},up=function(a){function s(o){return((r,l)=>({...Rd(r,l),F:r.month,day:parseInt(r.day)}))(go(t,o),i)}const t=Gr(a),i=zt(a);return{id:a,O:fp(s),B:pp(s)}},fp=function(a){return ua((s)=>{const t=sa(s);return a(t)},WeakMap)},pp=function(a){const s=a(0).year-kp;return ua((t)=>{let i,o=As(t-s);const r=[],l=[];do o+=400*da;while((i=a(o)).year<=t);do o+=(1-i.day)*da,i.year===t&&(r.push(o),l.push(i.F)),o-=da;while((i=a(o)).year>=t);return{k:r.reverse(),C:Wu(l.reverse())}})},Rd=function(a,s){let t,i,o=Md(a);if(a.era){const r=Qu[s];r!==void 0&&(t=s==="islamic"?"ah":a.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),t==="bc"||t==="b"?t="bce":t!=="ad"&&t!=="a"||(t="ce"),i=o,o=xd(i,r[t]||0))}return{era:t,eraYear:i,year:o}},Md=function(a){return parseInt(a.relatedYear||a.year)},ki=function(a){const{year:s,F:t,day:i}=this.O(a),{C:o}=this.B(s);return[s,o[t]+1,i]},ot=function(a,s=1,t=1){return this.B(a).k[s-1]+(t-1)*da},Zt=function(a){const s=Wl(this,a),t=Wl(this,a-1),i=s.length;if(i>t.length){const o=Id(this);if(o<0)return-o;for(let r=0;r<i;r++)if(s[r]!==t[r])return r+1}},Lt=function(a){return yi(ot.call(this,a),ot.call(this,a+1))},Hl=function(a,s){const{k:t}=this.B(a);let i=s+1,o=t;return i>t.length&&(i=1,o=this.B(a+1).k),yi(t[s-1],o[i-1])},xt=function(a){return this.B(a).k.length},Wl=function(a,s){return Object.keys(a.B(s).C)},jd=function(a){return mt(x(a))},mt=function(a){if((a=a.toLowerCase())!==w&&a!==Mi&&zt(a)!==zt(Gr(a).resolvedOptions().calendar))throw new RangeError(jp(a));return a},zt=function(a){return a==="islamicc"&&(a="islamic"),a.split("-")[0]},Cd=function(a){return this.R(a)[0]},Zd=function(a){return this.R(a)[1]},Pr=function(a){const[s]=this.h(a);return yi(this.q(s),sa(a))+1},Ld=function(a){const s=Rm.exec(a);if(!s)throw new RangeError(Rp(a));return[parseInt(s[1]),Boolean(s[2])]},qt=function(a,s,t){return a+(s||t&&a>=t?1:0)},Vi=function(a,s){return a-(s&&a>=s?1:0)},xd=function(a,s){return(s+a)*(Math.sign(s)||1)||0},ei=function(a){return Qu[Ad(a)]},Id=function(a){return qp[Ad(a)]},Ad=function(a){return zt(a.id||w)},Ed=function(a,s,t,i){const o=ka(t,i,va,[],qu);if(o.timeZone!==void 0){const r=t.dateFromFields(o),l=Ps(o),c=a(o.timeZone);return{epochNanoseconds:ms(s(c),{...r,...l},o.offset!==void 0?$s(o.offset):void 0),timeZone:c}}return{...t.dateFromFields(o),...Oa}},Hd=function(a,s,t,i,o,r){const l=ka(t,o,va,Ju,qu),c=a(l.timeZone),[d,u,f]=ft(r),p=t.dateFromFields(l,si(r,d)),m=Ps(l,d);return B(ms(s(c),{...p,...m},l.offset!==void 0?$s(l.offset):void 0,u,f),c,i)},Wd=function(a,s,t){const i=ka(a,s,va,[],Ja),o=S(t);return W(Wa({...a.dateFromFields(i,si(t,o)),...Ps(i,o)}))},Tr=function(a,s,t,i=[]){const o=ka(a,s,va,i);return a.dateFromFields(o,t)},br=function(a,s,t,i){const o=ka(a,s,xr,i);return a.yearMonthFromFields(o,t)},Or=function(a,s,t,i,o=[]){const r=ka(a,t,va,o);return s&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=xs),a.monthDayFromFields(r,i)},Nd=function(a,s){const t=S(s);return Sa(Ps(na(a,so,[],1),t))},$d=function(a){const s=na(a,Ir);return C(Ws({...Y,...s}))},ka=function(a,s,t,i=[],o=[]){return na(s,[...a.fields(t),...o].sort(),i)},na=function(a,s,t,i=!t){const o={};let r,l=0;for(let c of s){if(c===r)throw new RangeError(Dp(c));if(c==="constructor"||c==="__proto__")throw new RangeError(Mr(c));let d=a[c];if(d!==void 0)l=1,zl[c]&&(d=zl[c](d,c)),o[c]=d;else if(t){if(t.includes(c))throw new TypeError(Rr(c));o[c]=Uu[c]}r=c}if(i&&!l)throw new TypeError(ju(s));return o},Ps=function(a,s){return et(Zm({...Uu,...a}),s)},Jd=function(a,s,t,i,o,r){const l=H(r),{calendar:c,timeZone:d}=t;return B(((u,f,p,m,h)=>{const g=ht(u,p,m,va,zu,$u),[P,T,O]=ft(h,2);return ms(f,{...u.dateFromFields(g,si(h,P)),...Ps(g,P)},$s(g.offset),T,O)})(a(c),s(d),i,o,l),d,c)},zd=function(a,s,t,i,o){const r=H(o);return W(((l,c,d,u)=>{const f=ht(l,c,d,va,Ja),p=S(u);return Wa({...l.dateFromFields(f,si(u,p)),...Ps(f,p)})})(a(s.calendar),t,i,r))},qd=function(a,s,t,i,o){const r=H(o);return((l,c,d,u)=>{const f=ht(l,c,d,va);return l.dateFromFields(f,u)})(a(s.calendar),t,i,r)},_d=function(a,s,t,i,o){const r=H(o);return ls(((l,c,d,u)=>{const f=ht(l,c,d,xr);return l.yearMonthFromFields(f,u)})(a(s.calendar),t,i,r))},Gd=function(a,s,t,i,o){const r=H(o);return((l,c,d,u)=>{const f=ht(l,c,d,va);return l.monthDayFromFields(f,u)})(a(s.calendar),t,i,r)},Ud=function(a,s,t){return Sa(((i,o,r)=>{const l=S(r);return Ps({...pa(so,i),...na(o,so)},l)})(a,s,t))},Qd=function(a,s){return C((t=a,i=s,Ws({...t,...na(i,Ir)})));var t,i},ht=function(a,s,t,i,o=[],r=[]){const l=[...a.fields(i),...o].sort();let c=na(s,l,r);const d=na(t,l);return c=a.mergeFields(c,d),na(c,l,[])},yr=function(a,s){const t=ka(a,s,Gu);return a.monthDayFromFields(t)},Dr=function(a,s,t){const i=ka(a,s,_u);return a.yearMonthFromFields(i,t)},Yd=function(a,s,t,i,o){s=pa(t=a.fields(t),s),i=na(i,o=a.fields(o),[]);let r=a.mergeFields(s,i);return r=na(r,[...t,...o].sort(),[]),a.dateFromFields(r)},Qi=function(a,s){let{era:t,eraYear:i,year:o}=s;const r=ei(a);if(t!==void 0||i!==void 0){if(t===void 0||i===void 0)throw new TypeError(Sp);if(!r)throw new RangeError(wp);const l=r[t];if(l===void 0)throw new RangeError(Fp(t));const c=xd(i,l);if(o!==void 0&&o!==c)throw new RangeError(vp);o=c}else if(o===void 0)throw new TypeError(np(r));return o},Yi=function(a,s,t,i){let{month:o,monthCode:r}=s;if(r!==void 0){const l=((c,d,u,f)=>{const p=c.U(u),[m,h]=Ld(d);let g=qt(m,h,p);if(h){const P=Id(c);if(P===void 0)throw new RangeError(es);if(P>0){if(g>P)throw new RangeError(es);if(p===void 0){if(f===1)throw new RangeError(es);g--}}else{if(g!==-P)throw new RangeError(es);if(p===void 0&&f===1)throw new RangeError(es)}}return g})(a,r,t,i);if(o!==void 0&&o!==l)throw new RangeError(xu);o=l,i=1}else if(o===void 0)throw new TypeError(Mp);return Pa("month",o,1,a.L(t),i)},Nl=function(a,s,t,i,o){return la(s,"day",1,a.j(i,t),o)},Bi=function(a,s,t,i){let o=0;const r=[];for(let l of t)s[l]!==void 0?o=1:r.push(l);if(Object.assign(a,s),o)for(let l of i||r)delete a[l]},Bd=function(a){return G(ga(Kt(Bt(a))))},Kd=function(a,s,t,i,o=w){return B(ga(Kt(Bt(t))),s(i),a(o))},Xd=function(a,s,t,i,o=0,r=0,l=0,c=0,d=0,u=0,f=w){return W(Wa(Vt(ya(V,Is(ji,[s,t,i,o,r,l,c,d,u])))),a(f))},kd=function(a,s,t,i,o=w){return N(_a(us(ya(V,{isoYear:s,isoMonth:t,isoDay:i}))),a(o))},Vd=function(a,s,t,i=w,o=1){const r=V(s),l=V(t),c=a(i);return ls(Po(us({isoYear:r,isoMonth:l,isoDay:V(o)})),c)},ed=function(a,s,t,i=w,o=xs){const r=V(s),l=V(t),c=a(i);return Nt(_a(us({isoYear:V(o),isoMonth:r,isoDay:l})),c)},au=function(a=0,s=0,t=0,i=0,o=0,r=0){return Sa(et(ya(V,Is(Fa,[a,s,t,i,o,r])),1))},su=function(a=0,s=0,t=0,i=0,o=0,r=0,l=0,c=0,d=0,u=0){return C(Ws(ya(rc,Is(v,[a,s,t,i,o,r,l,c,d,u]))))},wr=function(a,s,t=w){return B(a.epochNanoseconds,s,t)},tu=function(a){return G(a.epochNanoseconds)},Sr=function(a,s){return W(ta(s,a))},vr=function(a,s){return N(ta(s,a))},iu=function(a,s,t){return Dr(a(s.calendar),t)},ou=function(a,s,t){return yr(a(s.calendar),t)},Fr=function(a,s){return Sa(ta(s,a))},ru=function(a,s,t,i){const o=((r,l,c,d)=>{const u=yo(d);return fa(r(l),c,u)})(a,t,s,i);return B(ga(o),t,s.calendar)},lu=function(a,s,t){const i=a(s.calendar);return ls({...s,...Dr(i,t)})},cu=function(a,s,t){return yr(a(s.calendar),t)},du=function(a,s,t,i,o){const r=a(o.timeZone),l=o.plainTime,c=l!==void 0?s(l):Oa;return B(fa(t(r),{...i,...c}),r,i.calendar)},uu=function(a,s=Oa){return W(Wa({...a,...s}))},fu=function(a,s,t){return Dr(a(s.calendar),t)},pu=function(a,s,t){return yr(a(s.calendar),t)},mu=function(a,s,t,i){return((o,r,l)=>Yd(o,r,_u,Ha(l),Ot))(a(s.calendar),t,i)},hu=function(a,s,t,i){return((o,r,l)=>Yd(o,r,Gu,Ha(l),Ri))(a(s.calendar),t,i)},gu=function(a,s,t,i,o){const r=Ha(o),l=s(r.plainDate),c=a(r.timeZone);return B(fa(t(c),{...l,...i}),c,l.calendar)},Pu=function(a,s){return W(Wa({...a,...s}))},Tu=function(a){return G(ga(Zs(a,ba)))},bu=function(a){return G(ga(Zs(a,Ma)))},Ou=function(a){return G(ga(Kt(Bt(a),bs)))},yu=function(a){return G(ga(Kt(Bt(a))))},Du=function(a,s,t=Oa){const i=s.timeZone,o=a(i),r={...ta(s,o),...t};return B(ms(o,r,r.offsetNanoseconds,2),i,s.calendar)},wu=function(a,s,t){const i=s.timeZone,o=a(i),r={...ta(s,o),...t},l=nu(s.calendar,t.calendar);return B(ms(o,r,r.offsetNanoseconds,2),i,l)},Su=function(a,s=Oa){return W({...a,...s})},vu=function(a,s){return W({...a,...s},nu(a.calendar,s.calendar))},wi=function(a,s){return{...a,calendar:s}},Fu=function(a,s){return{...a,timeZone:s}},nu=function(a,s){if(a===s)return a;const t=Q(a),i=Q(s);if(t===i||t===w)return s;if(i===w)return a;throw new RangeError(Cr)},mp=function(a,s){return(t)=>t===w?a:t===Mi||t===Ls?Object.assign(Object.create(a),{id:t}):Object.assign(Object.create(s),nm(t))},Ts=function(a,s,t){const i=new Set(t);return(o)=>(((r,l)=>{for(let c of l)if(c in r)return 1;return 0})(o=ro(i,o),a)||Object.assign(o,s),t&&(o.timeZone=Ds,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)},Na=function(a,s=nr){const[t,,,i]=a;return(o,r=Qm,...l)=>{const c=s(i&&i(...l),o,r,t),d=c.resolvedOptions();return[c,...hp(a,d,l)]}},nr=function(a,s,t,i){if(t=i(t),a){if(t.timeZone!==void 0)throw new TypeError($p);t.timeZone=a}return new Va(s,t)},hp=function(a,s,t){const[,i,o]=a;return t.map((r)=>(r.calendar&&((l,c,d)=>{if((d||l!==w)&&l!==c)throw new RangeError(Cr)})(Q(r.calendar),s.calendar,o),i(r,s)))},zs=function(a){const s=gt();return Ba(s,a.getOffsetNanosecondsFor(s))},gt=function(){return Zs(Date.now(),Ma)},$a=function(){return _l||(_l=new Va().resolvedOptions().timeZone)},gp=(a,s)=>`Non-integer ${a}: ${s}`,Pp=(a,s)=>`Non-positive ${a}: ${s}`,Tp=(a,s)=>`Non-finite ${a}: ${s}`,bp=(a)=>`Cannot convert bigint to ${a}`,Op=(a)=>`Invalid bigint: ${a}`,yp="Cannot convert Symbol to string",Ru="Invalid object",Mu=(a,s,t,i,o)=>o?Mu(a,o[s],o[t],o[i]):Pt(a,s)+`; must be between ${t}-${i}`,Pt=(a,s)=>`Invalid ${a}: ${s}`,Rr=(a)=>`Missing ${a}`,Mr=(a)=>`Invalid field ${a}`,Dp=(a)=>`Duplicate field ${a}`,ju=(a)=>"No valid fields: "+a.join(),Cu="Invalid bag",Zu=(a,s,t)=>Pt(a,s)+"; must be "+Object.keys(t).join(),Lu="Cannot use valueOf",jr="Invalid calling context",wp="Forbidden era/eraYear",Sp="Mismatching era/eraYear",vp="Mismatching year/eraYear",Fp=(a)=>`Invalid era: ${a}`,np=(a)=>"Missing year"+(a?"/era/eraYear":""),Rp=(a)=>`Invalid monthCode: ${a}`,xu="Mismatching month/monthCode",Mp="Missing month/monthCode",$l="Cannot guess year",es="Invalid leap month",Iu="Invalid protocol",Tt="Invalid protocol results",Cr="Mismatching Calendars",jp=(a)=>`Invalid Calendar: ${a}`,Au="Mismatching TimeZones",Cp="Forbidden ICU TimeZone",Zp="Out-of-bounds offset",Lp="Out-of-bounds TimeZone gap",xp="Invalid TimeZone offset",Ip="Ambiguous offset",Si="Out-of-bounds date",Ap="Out-of-bounds duration",Ep="Cannot mix duration signs",vi="Missing relativeTo",Hp="Cannot use large units",Wp="Required smallestUnit or largestUnit",Np="smallestUnit > largestUnit",ca=(a)=>`Cannot parse: ${a}`,Ea=(a)=>`Invalid substring: ${a}`,Eu=(a)=>`Cannot format ${a}`,Hu="Mismatching types for formatting",$p="Cannot specify TimeZone",Wu=D(ct,(a,s)=>s),qs=D(ct,(a,s,t)=>t),Ta=D(Et,2),ao={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},bt=Object.keys(ao),da=86400000,Nu=1000,bs=1000,Ma=1e6,ba=1e9,Fi=60000000000,ni=3600000000000,F=86400000000000,Ra=[1,bs,Ma,ba,Fi,ni,F],Ja=bt.slice(0,6),so=dt(Ja),$u=["offset"],Ju=["timeZone"],zu=Ja.concat($u),qu=zu.concat(Ju),to=["era","eraYear"],Jp=to.concat(["year"]),Ri=["year"],Zr=["monthCode"],Lr=["month"].concat(Zr),Ot=["day"],xr=Lr.concat(Ri),_u=Zr.concat(Ri),va=Ot.concat(xr),zp=Ot.concat(Lr),Gu=Ot.concat(Zr),Uu=qs(Ja,0),w="iso8601",Mi="gregory",Ls="japanese",Qu={[Mi]:{bce:-1,ce:0},[Ls]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},qp={chinese:13,dangi:13,hebrew:-6},x=D(Yt,"string"),Yu=D(Yt,"boolean"),_p=D(Yt,"number"),Bu=D(Yt,"function"),v=bt.map((a)=>a+"s"),Ir=dt(v),Gp=v.slice(0,6),Ku=v.slice(6),Up=Ku.slice(1),Qp=Wu(v),Y=qs(v,0),Ar=qs(Gp,0),Er=D(Bl,v),Fa=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Hr=["isoDay","isoMonth","isoYear"],ji=Fa.concat(Hr),Wr=dt(Hr),Xu=dt(Fa),ku=dt(ji),Oa=qs(Xu,0),Yp=D(Bl,ji),Va=Intl.DateTimeFormat,Vu="en-GB",Nr=1e8,Bp=Nr*da,Kp=[Nr,0],Xp=[-Nr,0],rt=275760,lt=-271821,kp=1970,xs=1972,Ia=12,Vp=As(1868,9,8),ep=ua(ef,WeakMap),_t="smallestUnit",io="unit",st="roundingIncrement",Ki="fractionalSecondDigits",eu="relativeTo",af={constrain:0,reject:1},am=Object.keys(af),sm={compatible:0,reject:1,earlier:2,later:3},tm={reject:0,use:1,prefer:2,ignore:3},im={auto:0,never:1,critical:2,always:3},om={auto:0,never:1,critical:2},rm={auto:0,never:1},lm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},yt=D(no,_t),$r=D(no,"largestUnit"),cm=D(no,io),sf=D(fs,"overflow",af),tf=D(fs,"disambiguation",sm),dm=D(fs,"offset",tm),Jr=D(fs,"calendarName",im),um=D(fs,"timeZoneName",om),fm=D(fs,"offset",rm),Dt=D(fs,"roundingMode",lm),_s="PlainYearMonth",Gs="PlainMonthDay",Os="PlainDate",ys="PlainDateTime",Ci="PlainTime",za="ZonedDateTime",Zi="Instant",Li="Duration",pm=[Math.floor,(a)=>Ct(a)?Math.floor(a):Math.round(a),Math.ceil,(a)=>Ct(a)?Math.ceil(a):Math.round(a),Math.trunc,(a)=>Ct(a)?Math.trunc(a)||0:Math.round(a),(a)=>a<0?Math.floor(a):Math.ceil(a),(a)=>Math.sign(a)*Math.round(Math.abs(a))||0,(a)=>Ct(a)?(a=Math.trunc(a)||0)+a%2:Math.round(a)],Ds="UTC",It=5184000,mm=Wt(1847),hm=Wt((new Date()).getUTCFullYear()+10),gm=/0+$/,ta=ua(rp,WeakMap),Jl=4294967295,xi=ua((a)=>{const s=or(a);return typeof s=="object"?new rf(s):new of(s||0)});class of{constructor(a){this.v=a}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(a){return[To(a,this.v)]}l(){}}class rf{constructor(a){this.$=((s)=>{function t(d){const u=Xi(d,l,c),[f,p]=Al(u),m=o(f),h=o(p);return m===h?m:i(r(f,p),m,h,d)}function i(d,u,f,p){let m,h;for(;(p===void 0||(m=p<d[0]?u:p>=d[1]?f:void 0)===void 0)&&(h=d[1]-d[0]);){const g=d[0]+Math.floor(h/2);s(g)===f?d[1]=g:d[0]=g+1}return m}const o=ua(s),r=ua(lp);let l=mm,c=hm;return{G(d){const u=t(d-86400),f=t(d+86400),p=d-u,m=d-f;if(u===f)return[p];const h=t(p);return h===t(m)?[d-h]:u>f?[p,m]:[]},V:t,l(d,u){const f=Xi(d,l,c);let[p,m]=Al(f);const h=It*u,g=u<0?()=>m>l||(l=f,0):()=>p<c||(c=f,0);for(;g();){const P=o(p),T=o(m);if(P!==T){const O=r(p,m);i(O,P,T);const b=O[0];if((qa(b,d)||1)===u)return b}p+=h,m+=h}}}})(((s)=>(t)=>{const i=go(s,t*Nu);return Wt(Md(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-t})(a))}getOffsetNanosecondsFor(a){return this.$.V(dc(a))*ba}getPossibleInstantsFor(a){const[s,t]=[Wt((i=a).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*Ma+i.isoMicrosecond*bs+i.isoNanosecond];var i;return this.$.G(s).map((o)=>ga(Cs(Zs(o,ba),t)))}l(a,s){const[t,i]=uc(a),o=this.$.l(t+(s>0||i?1:0),s);if(o!==void 0)return Zs(o,ba)}}var zr="([+\u2212-])",At="(?:[.,](\\d{1,9}))?",lf=`(?:(?:${zr}(\\d{6}))|(\\d{4}))-?(\\d{2})`,qr="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+At+")?)?",_r=zr+qr,Pm=lf+"-?(\\d{2})(?:[T ]"+qr+"(Z|"+_r+")?)?",cf="\\[(!?)([^\\]]*)\\]",Ii=`((?:${cf}){0,9})`,Tm=Js(lf+Ii),bm=Js("(?:--)?(\\d{2})-?(\\d{2})"+Ii),Om=Js(Pm+Ii),ym=Js("T?"+qr+"(?:"+_r+")?"+Ii),Dm=Js(_r),wm=new RegExp(cf,"g"),Sm=Js(`${zr}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${At}H)?(?:(\\d+)${At}M)?(?:(\\d+)${At}S)?)?`),vm=ua((a)=>new Va(Vu,{timeZone:a,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Fm=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,nm=ua(up),Gr=ua((a)=>new Va(Vu,{calendar:a,timeZone:Ds,era:"short",year:"numeric",month:"short",day:"numeric"})),Rm=/^M(\d{2})(L?)$/,Mm={era:Ht,eraYear:V,year:V,month:Zl,monthCode:Ht,day:Zl},jm=qs(Ja,V),Cm=qs(v,rc),zl=Object.assign({},Mm,jm,Cm,{offset:Ht}),Zm=D(Vf,Ja,Fa),ql={dateAdd(a,s,t){const i=S(t);let o,{years:r,months:l,weeks:c,days:d}=s;if(d+=q(s,5)[0],r||l)o=((u,f,p,m,h)=>{let[g,P,T]=u.h(f);if(p){const[O,b]=u.I(g,P);g+=p,P=qt(O,b,u.U(g)),P=Pa("month",P,1,u.L(g),h)}return m&&([g,P]=u._(g,P,m)),T=Pa("day",T,1,u.j(g,P),h),u.q(g,P,T)})(this,a,r,l,i);else{if(!c&&!d)return a;o=sa(a)}return o+=(7*c+d)*da,_a(kt(o))},dateUntil(a,s,t){if(t<=7){let d=0,u=nd({...a,...Oa},{...s,...Oa});return t===7&&([d,u]=Ua(u,7)),{...Y,weeks:d,days:u}}const i=this.h(a),o=this.h(s);let[r,l,c]=((d,u,f,p,m,h,g)=>{let P=m-u,T=h-f,O=g-p;if(P||T){const b=Math.sign(P||T);let y=d.j(m,h),E=0;if(Math.sign(O)===-b){const Z=y;[m,h]=d._(m,h,-b),P=m-u,T=h-f,y=d.j(m,h),E=b<0?-Z:y}if(O=g-Math.min(p,y)+E,P){const[Z,j]=d.I(u,f),[L,U]=d.I(m,h);if(T=L-Z||Number(U)-Number(j),Math.sign(T)===-b){const z=b<0&&-d.L(m);P=(m-=b)-u,T=h-qt(Z,j,d.U(m))+(z||d.L(m))}}}return[P,T,O]})(this,...i,...o);return t===8&&(l+=this.J(r,i[0]),r=0),{...Y,years:r,months:l,days:c}},dateFromFields(a,s){const t=S(s),i=Qi(this,a),o=Yi(this,a,i,t),r=Nl(this,a,o,i,t);return N(_a(this.P(i,o,r)),this.id||w)},yearMonthFromFields(a,s){const t=S(s),i=Qi(this,a),o=Yi(this,a,i,t);return ls(Po(this.P(i,o,1)),this.id||w)},monthDayFromFields(a,s){const t=S(s),i=!this.id,{monthCode:o,year:r,month:l}=a;let c,d,u,f,p;if(o!==void 0){[c,d]=Ld(o),p=Gl(a,"day");const m=this.N(c,d,p);if(!m)throw new RangeError($l);if([u,f]=m,l!==void 0&&l!==f)throw new RangeError(xu);i&&(f=Pa("month",f,1,Ia,1),p=Pa("day",p,1,bo(r!==void 0?r:u,f),t))}else{u=r===void 0&&i?xs:Qi(this,a),f=Yi(this,a,u,t),p=Nl(this,a,f,u,t);const m=this.U(u);d=f===m,c=Vi(f,m);const h=this.N(c,d,p);if(!h)throw new RangeError($l);[u,f]=h}return Nt(_a(this.P(u,f,p)),this.id||w)},fields(a){return ei(this)&&a.includes("year")?[...a,...to]:a},mergeFields(a,s){const t=Object.assign(Object.create(null),a);return Bi(t,s,Lr),ei(this)&&(Bi(t,s,Jp),this.id===Ls&&Bi(t,s,zp,to)),t},inLeapYear(a){const[s]=this.h(a);return this.K(s)},monthsInYear(a){const[s]=this.h(a);return this.L(s)},daysInMonth(a){const[s,t]=this.h(a);return this.j(s,t)},daysInYear(a){const[s]=this.h(a);return this.X(s)},dayOfYear:Pr,era(a){return this.ee(a)[0]},eraYear(a){return this.ee(a)[1]},monthCode(a){const[s,t]=this.h(a),[i,o]=this.I(s,t);return((r,l)=>"M"+Ta(r)+(l?"L":""))(i,o)},dayOfWeek:gc,daysInWeek(){return 7}},Lm={dayOfYear:Pr,h:pc,q:As},xm=Object.assign({},Lm,{weekOfYear:Cd,yearOfWeek:Zd,R(a){function s(h){return(7-h<i?7:0)-h}function t(h){const g=hc(m+h),P=h||1,T=s(at(d+g*P,7));return f=(g+(T-u)*P)/7}const i=this.id?1:4,o=gc(a),r=this.dayOfYear(a),l=at(o-1,7),c=r-1,d=at(l-c,7),u=s(d);let f,p=Math.floor((c-u)/7)+1,m=a.isoYear;return p?p>t(0)&&(p=1,m++):(p=t(-1),m--),[p,m,f]}}),Im={dayOfYear:Pr,h:ki,q:ot,weekOfYear:Cd,yearOfWeek:Zd,R(){return[]}},Us=mp(Object.assign({},ql,xm,{h:pc,ee(a){return this.id===Mi?Pc(a):this.id===Ls?ep(a):[]},I:(a,s)=>[s,0],N(a,s){if(!s)return[xs,a]},K:Oo,U(){},L:mc,J:(a)=>a*Ia,j:bo,X:hc,P:(a,s,t)=>({isoYear:a,isoMonth:s,isoDay:t}),q:As,_:(a,s,t)=>(a+=Ut(t,Ia),(s+=co(t,Ia))<1?(a--,s+=Ia):s>Ia&&(a++,s-=Ia),[a,s]),year(a){return a.isoYear},month(a){return a.isoMonth},day:(a)=>a.isoDay}),Object.assign({},ql,Im,{h:ki,ee(a){const s=this.O(a);return[s.era,s.eraYear]},I(a,s){const t=Zt.call(this,a);return[Vi(s,t),t===s]},N(a,s,t){let[i,o,r]=ki.call(this,{isoYear:xs,isoMonth:Ia,isoDay:31});const l=Zt.call(this,i),c=o===l;(qa(a,Vi(o,l))||qa(Number(s),Number(c))||qa(t,r))===1&&i--;for(let d=0;d<100;d++){const u=i-d,f=Zt.call(this,u),p=qt(a,s,f);if(s===(p===f)&&t<=Hl.call(this,u,p))return[u,p]}},K(a){const s=Lt.call(this,a);return s>Lt.call(this,a-1)&&s>Lt.call(this,a+1)},U:Zt,L:xt,J(a,s){const t=s+a,i=Math.sign(a),o=i<0?-1:0;let r=0;for(let l=s;l!==t;l+=i)r+=xt.call(this,l+o);return r},j:Hl,X:Lt,P(a,s,t){return kt(ot.call(this,a,s,t))},q:ot,_(a,s,t){if(t){if(s+=t,!Number.isSafeInteger(s))throw new RangeError(Si);if(t<0)for(;s<1;)s+=xt.call(this,--a);else{let i;for(;s>(i=xt.call(this,a));)s-=i,a++}}return[a,s]},year(a){return this.O(a).year},month(a){const{year:s,F:t}=this.O(a),{C:i}=this.B(s);return i[t]+1},day(a){return this.O(a).day}})),Ga="numeric",Qs=["timeZoneName"],df={month:Ga,day:Ga},Ur={year:Ga,month:Ga},Qr=Object.assign({},Ur,{day:Ga}),Yr={hour:Ga,minute:Ga,second:Ga},Br=Object.assign({},Qr,Yr),Am=Object.assign({},Br,{timeZoneName:"short"}),Em=Object.keys(Ur),Hm=Object.keys(df),Wm=Object.keys(Qr),Nm=Object.keys(Yr),Kr=["dateStyle"],$m=Em.concat(Kr),Jm=Hm.concat(Kr),Xr=Wm.concat(Kr,["weekday"]),wt=Nm.concat(["dayPeriod","timeStyle"]),kr=Xr.concat(wt),zm=kr.concat(Qs),qm=Qs.concat(wt),_m=Qs.concat(Xr),Gm=Qs.concat(["day","weekday"],wt),Um=Qs.concat(["year","weekday"],wt),Qm={},Vr=[Ts(kr,Br),ti],uf=[Ts(zm,Am),ti,0,(a,s)=>{const t=Q(a.timeZone);if(s&&Q(s.timeZone)!==t)throw new RangeError(Au);return t}],er=[Ts(kr,Br,Qs),sa],al=[Ts(Xr,Qr,qm),sa],sl=[Ts(wt,Yr,_m),(a)=>Qa(a)/Ma],tl=[Ts($m,Ur,Gm),sa,1],il=[Ts(Jm,df,Um),sa,1],_l;var km={Instant:Vr,PlainDateTime:er,PlainDate:al,PlainTime:sl,PlainYearMonth:tl,PlainMonthDay:il},Vm=Na(Vr),em=Na(uf),ah=Na(er),sh=Na(al),th=Na(sl),ih=Na(tl),oh=Na(il),dl={era:el,eraYear:uo,year:ut,month:Da,daysInMonth:Da,daysInYear:Da,inLeapYear:Yu,monthsInYear:Da},Wi={monthCode:x},ul={day:Da},Df={dayOfWeek:Da,dayOfYear:Da,weekOfYear:ac,yearOfWeek:uo,daysInWeek:Da},wf=Object.assign({},dl,Wi,ul,Df),Hi=new WeakMap,k=Hi.get.bind(Hi),hf=Hi.set.bind(Hi),rh={...Ai(dl,[_s]),...Ai(Df,[]),...Ai(Wi,[_s,Gs]),...Ai(ul,[Gs])},fl=ll(wf),lh=ll({...dl,...Wi}),ch=ll({...Wi,...ul}),nt={calendarId:(a)=>Q(a.calendar)},dh=ya((a,s)=>function(t){const{i}=this;return a(i[s](A(N(t,i))))},wf),uh=ct((a)=>(s)=>s[a],v.concat("sign")),pl=ct((a,s)=>(t)=>t[Fa[s]],Ja),Sf={epochSeconds:Sc,epochMilliseconds:ti,epochMicroseconds:vc,epochNanoseconds:Fc},Rt=D(ro,new Set(["branding"])),[fh,Ks,ph]=Za(Gs,D(ed,X),{...nt,...ch},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return Ks(Gd(Rh,a,this,Xs(s),t))},equals:(a,s)=>yd(a,ff(s)),toPlainDate(a,s){return A(hu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=oh(s,t,a);return i.format(o)},toString:Ao,toJSON:(a)=>Ao(a),valueOf:is},{from:(a,s)=>Ks(ff(a,s))}),vf={getOffsetNanosecondsFor:bf,getPossibleInstantsFor(a,s,t){const i=[...s.call(a,K(W(t,w)))].map((r)=>hh(r).epochNanoseconds),o=i.length;return o>1&&(i.sort(aa),Jo(ha(ma(i[0],i[o-1])))),i}},rl={getOffsetNanosecondsFor:bf},[mh,oa,hh]=Za(Zi,Bd,Sf,{add:(a,s)=>oa(zo(0,a,I(s))),subtract:(a,s)=>oa(zo(1,a,I(s))),until:(a,s,t)=>R(dr(0,a,ja(s),t)),since:(a,s,t)=>R(dr(1,a,ja(s),t)),round:(a,s)=>oa(Mc(a,s)),equals:(a,s)=>gd(a,ja(s)),toZonedDateTime(a,s){const t=Ha(s);return $(wr(a,M(t.timeZone),X(t.calendar)))},toZonedDateTimeISO:(a,s)=>$(wr(a,M(s))),toLocaleString(a,s,t){const[i,o]=Vm(s,t,a);return i.format(o)},toString:(a,s)=>Co(M,J,a,s),toJSON:(a)=>Co(M,J,a),valueOf:is},{from:(a)=>oa(ja(a)),fromEpochSeconds:(a)=>oa(Tu(a)),fromEpochMilliseconds:(a)=>oa(bu(a)),fromEpochMicroseconds:(a)=>oa(Ou(a)),fromEpochNanoseconds:(a)=>oa(yu(a)),compare:(a,s)=>rr(ja(a),ja(s))}),[Ni,$h]=Za("TimeZone",(a)=>{const s=md(a);return{branding:"TimeZone",id:s,o:xi(s)}},{id:(a)=>a.id},{getPossibleInstantsFor:({o:a},s)=>a.getPossibleInstantsFor(as(s)).map((t)=>oa(G(t))),getOffsetNanosecondsFor:({o:a},s)=>a.getOffsetNanosecondsFor(ja(s).epochNanoseconds),getOffsetStringFor(a,s){const t=ja(s).epochNanoseconds,i=Ei(this,rl).getOffsetNanosecondsFor(t);return ps(i)},getPlainDateTimeFor(a,s,t=w){const i=ja(s).epochNanoseconds,o=Ei(this,rl).getOffsetNanosecondsFor(i);return K(W(Ba(i,o),X(t)))},getInstantFor(a,s,t){const i=as(s),o=yo(t),r=Ei(this);return oa(G(fa(r,i,o)))},getNextTransition:({o:a},s)=>pf(1,a,s),getPreviousTransition:({o:a},s)=>pf(-1,a,s),equals(a,s){return!!bi(this,M(s))},toString:(a)=>a.id,toJSON:(a)=>a.id},{from(a){const s=M(a);return typeof s=="string"?new Ni(s):s}}),gh=Tf(Object.keys(vf)),[Ph,ss]=Za(Ci,au,pl,{getISOFields:Rt,with(a,s,t){return ss(Ud(this,Xs(s),t))},add:(a,s)=>ss(Qo(0,a,I(s))),subtract:(a,s)=>ss(Qo(1,a,I(s))),until:(a,s,t)=>R(hr(0,a,ea(s),t)),since:(a,s,t)=>R(hr(1,a,ea(s),t)),round:(a,s)=>ss(Zc(a,s)),equals:(a,s)=>Dd(a,ea(s)),toZonedDateTime:(a,s)=>$(gu(M,ra,n,a,s)),toPlainDateTime:(a,s)=>K(Pu(a,ra(s))),toLocaleString(a,s,t){const[i,o]=th(s,t,a);return i.format(o)},toString:Eo,toJSON:(a)=>Eo(a),valueOf:is},{from:(a,s)=>ss(ea(a,s)),compare:(a,s)=>Ti(ea(a),ea(s))}),[Th,ts,bh]=Za(_s,D(Vd,X),{...nt,...lh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return ts(_d(nh,a,this,Xs(s),t))},add:(a,s,t)=>ts(Uo(gf,0,a,I(s),t)),subtract:(a,s,t)=>ts(Uo(gf,1,a,I(s),t)),until:(a,s,t)=>R(mr(Pf,0,a,Ys(s),t)),since:(a,s,t)=>R(mr(Pf,1,a,Ys(s),t)),equals:(a,s)=>Od(a,Ys(s)),toPlainDate(a,s){return A(mu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=ih(s,t,a);return i.format(o)},toString:Io,toJSON:(a)=>Io(a),valueOf:is},{from:(a,s)=>ts(Ys(a,s)),compare:(a,s)=>gs(Ys(a),Ys(s))}),[Oh,K]=Za(ys,D(Xd,X),{...nt,...fl,...pl},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return K(zd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>K(wi(a,X(s))),withPlainDate:(a,s)=>K(vu(a,ra(s))),withPlainTime:(a,s)=>K(Su(a,cl(s))),add:(a,s,t)=>K(_o(ws,0,a,I(s),t)),subtract:(a,s,t)=>K(_o(ws,1,a,I(s),t)),until:(a,s,t)=>R(fr(Ca,0,a,as(s),t)),since:(a,s,t)=>R(fr(Ca,1,a,as(s),t)),round:(a,s)=>K(Cc(a,s)),equals:(a,s)=>Td(a,as(s)),toZonedDateTime:(a,s,t)=>$(ru(n,a,M(s),t)),toPlainDate:(a)=>A(N(a)),toPlainTime:(a)=>ss(Sa(a)),toPlainYearMonth(a){return ts(lu($i,a,this))},toPlainMonthDay(a){return Ks(cu(zi,a,this))},toLocaleString(a,s,t){const[i,o]=ah(s,t,a);return i.format(o)},toString:Lo,toJSON:(a)=>Lo(a),valueOf:is},{from:(a,s)=>K(as(a,s)),compare:(a,s)=>cr(as(a),as(s))}),[yh,A,Ff]=Za(Os,D(kd,X),{...nt,...fl},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return A(qd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>A(wi(a,X(s))),add:(a,s,t)=>A(Go(ws,0,a,I(s),t)),subtract:(a,s,t)=>A(Go(ws,1,a,I(s),t)),until:(a,s,t)=>R(pr(Ca,0,a,ra(s),t)),since:(a,s,t)=>R(pr(Ca,1,a,ra(s),t)),equals:(a,s)=>bd(a,ra(s)),toZonedDateTime(a,s){const t=!_(s)||s instanceof Ni?{timeZone:s}:s;return $(du(M,ea,n,a,t))},toPlainDateTime:(a,s)=>K(uu(a,cl(s))),toPlainYearMonth(a){return ts(fu($i,a,this))},toPlainMonthDay(a){return Ks(pu(zi,a,this))},toLocaleString(a,s,t){const[i,o]=sh(s,t,a);return i.format(o)},toString:xo,toJSON:(a)=>xo(a),valueOf:is},{from:(a,s)=>A(ra(a,s)),compare:(a,s)=>gs(ra(a),ra(s))}),ml={fields(a,s,t){return[...s.call(a,t)]}},nf=Object.assign({dateFromFields(a,s,t,i){return Ff(s.call(a,Object.assign(Object.create(null),t),i))}},ml),Rf=Object.assign({yearMonthFromFields(a,s,t,i){return bh(s.call(a,Object.assign(Object.create(null),t),i))}},ml),Mf=Object.assign({monthDayFromFields(a,s,t,i){return ph(s.call(a,Object.assign(Object.create(null),t),i))}},ml),hl={mergeFields(a,s,t,i){return Ha(s.call(a,Object.assign(Object.create(null),t),Object.assign(Object.create(null),i)))}},Dh=Object.assign({},nf,hl),wh=Object.assign({},Rf,hl),Sh=Object.assign({},Mf,hl),gl={dateAdd(a,s,t,i,o){return Ff(s.call(a,A(N(t,a)),R(C(i)),o))}},jf=Object.assign({},gl,{dateUntil(a,s,t,i,o,r){return jh(s.call(a,A(N(t,a)),A(N(i,a)),Object.assign(Object.create(null),r,{largestUnit:bt[o]})))}}),vh=Object.assign({},gl,{day:Of}),Fh=Object.assign({},jf,{day:Of}),$i=La(Rf),Ji=La(nf),zi=La(Mf),nh=La(wh),Mt=La(Dh),Rh=La(Sh),ws=La(gl),Ca=La(jf),gf=La(vh),Pf=La(Fh),[Mh,R,jh]=Za(Li,su,{...uh,blank:Yc},{with:(a,s)=>R(Qd(a,s)),negated:(a)=>R(pi(a)),abs:(a)=>R(Qc(a)),add:(a,s,t)=>R(ko(St,Ca,n,0,a,I(s),t)),subtract:(a,s,t)=>R(ko(St,Ca,n,1,a,I(s),t)),round:(a,s)=>R(Uc(St,Ca,n,a,s)),total:(a,s)=>Rc(St,Ca,n,a,s),toLocaleString(a,s,t){return Intl.DurationFormat?new Intl.DurationFormat(s,t).format(this):li(a)},toString:li,toJSON:(a)=>li(a),valueOf:is},{from:(a)=>R(I(a)),compare:(a,s,t)=>hd(St,ws,n,I(a),I(s),t)}),Cf={toString:(a)=>a.id,toJSON:(a)=>a.id,...rh,dateAdd:({id:a,o:s},t,i,o)=>A(N(s.dateAdd(ra(t),I(i),o),a)),dateUntil:({o:a},s,t,i)=>R(C(a.dateUntil(ra(s),ra(t),bc(i)))),dateFromFields:({id:a,o:s},t,i)=>A(Tr(s,t,i,Vl(a))),yearMonthFromFields:({id:a,o:s},t,i)=>ts(br(s,t,i,Xl(a))),monthDayFromFields:({id:a,o:s},t,i)=>Ks(Or(s,0,t,i,kl(a))),fields({o:a},s){const t=new Set(va),i=[];for(let o of s){if(x(o),!t.has(o))throw new RangeError(Mr(o));t.delete(o),i.push(o)}return a.fields(i)},mergeFields:({o:a},s,t)=>a.mergeFields(lo(fo(s)),lo(fo(t)))},[Pl]=Za("Calendar",(a)=>{const s=jd(a);return{branding:"Calendar",id:s,o:Us(s)}},{id:(a)=>a.id},Cf,{from(a){const s=X(a);return typeof s=="string"?new Pl(s):s}}),Ch=Tf(Object.keys(Cf).slice(4)),[Zh,$]=Za(za,D(Kd,X,M),{...Sf,...nt,...mf(fl),...mf(pl),offset:(a)=>ps(ol(a).offsetNanoseconds),offsetNanoseconds:(a)=>ol(a).offsetNanoseconds,timeZoneId:(a)=>Q(a.timeZone),hoursInDay:(a)=>Lc(n,a)},{getISOFields:(a)=>_c(J,a),getCalendar:vt,getTimeZone:({timeZone:a})=>typeof a=="string"?new Ni(a):a,with(a,s,t){return $(Jd(Mt,n,a,this,Xs(s),t))},withCalendar:(a,s)=>$(wi(a,X(s))),withTimeZone:(a,s)=>$(Fu(a,M(s))),withPlainDate:(a,s)=>$(wu(n,a,ra(s))),withPlainTime:(a,s)=>$(Du(n,a,cl(s))),add:(a,s,t)=>$(qo(ws,n,0,a,I(s),t)),subtract:(a,s,t)=>$(qo(ws,n,1,a,I(s),t)),until:(a,s,t)=>R(C(ur(Ca,n,0,a,Bs(s),t))),since:(a,s,t)=>R(C(ur(Ca,n,1,a,Bs(s),t))),round:(a,s)=>$(jc(n,a,s)),startOfDay:(a)=>$(xc(n,a)),equals:(a,s)=>Pd(a,Bs(s)),toInstant:(a)=>oa(tu(a)),toPlainDateTime:(a)=>K(Sr(J,a)),toPlainDate:(a)=>A(vr(J,a)),toPlainTime:(a)=>ss(Fr(J,a)),toPlainYearMonth(a){return ts(iu($i,a,this))},toPlainMonthDay(a){return Ks(ou(zi,a,this))},toLocaleString(a,s,t={}){const[i,o]=em(s,t,a);return i.format(o)},toString:(a,s)=>Zo(J,a,s),toJSON:(a)=>Zo(J,a),valueOf:is},{from:(a,s)=>$(Bs(a,s)),compare:(a,s)=>lr(Bs(a),Bs(s))}),Lh=Object.defineProperties({},{...Gt("Temporal.Now"),...ds({timeZoneId:()=>$a(),instant:()=>oa(G(gt())),zonedDateTime:(a,s=$a())=>$(B(gt(),M(s),X(a))),zonedDateTimeISO:(a=$a())=>$(B(gt(),M(a),w)),plainDateTime:(a,s=$a())=>K(W(zs(J(M(s))),X(a))),plainDateTimeISO:(a=$a())=>K(W(zs(J(M(a))),w)),plainDate:(a,s=$a())=>A(N(zs(J(M(s))),X(a))),plainDateISO:(a=$a())=>A(N(zs(J(M(a))),w)),plainTimeISO:(a=$a())=>ss(Sa(zs(J(M(a)))))})}),Ss=Object.defineProperties({},{...Gt("Temporal"),...ds({PlainYearMonth:Th,PlainMonthDay:fh,PlainDate:yh,PlainTime:Ph,PlainDateTime:Oh,ZonedDateTime:Zh,Instant:mh,Calendar:Pl,TimeZone:Ni,Duration:Mh,Now:Lh})}),xh=Ym(),Tl=new WeakMap,Ih=Object.defineProperties(Object.create(Intl),ds({DateTimeFormat:xh}));class vs extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class bl{createSession(){throw new vs}deleteSession(){throw new vs}findSession(){throw new vs}findUserByEmailAddress(){throw new vs}updateSession(){throw new vs}createUser(){throw new vs}}class If extends xa{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Af extends xa{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Ef extends xa{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class Hf extends xa{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class ns extends Zf{constructor(){super(...arguments)}provider=jt.getStore().authenticationServiceProvider;async me(){const a=await Ol.user();if(!a)throw new xf;return a}async signIn(a=new If){const s=await a.input.call(a),{email:t,password:i}=s.toJSON(),o=await this.provider.adapter.findUserByEmailAddress(t);if(!o)throw new Fs({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,o.password))throw new Fs({invalid_credentials:["Invalid credentials"]});const l=a.headers.get("User-Agent"),c=new Bun.CryptoHasher("sha256");c.update(`${o.email}${l}`);const d=c.digest("hex");let u=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!u)u=await this.provider.adapter.createSession({token:d,userId:o.id,userAgent:"local",expiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else u=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(Ss.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return a.ctx.setCookie("access_token",u.token,{expires:u.expiresAt}),await this.provider.onSignIn(o),o}async signUp(a=new Af){const s=await a.input(),{email:t,password:i,name:o}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(t))throw new Fs({email:["Email address already exists"]});const l=await this.provider.hashPassword(i),c=await this.provider.adapter.createUser({email:t,name:o,password:l});return await this.provider.onSignUp(c),c}async signOut(a=new xa){const s=a.cookies.get("access_token"),t=await Ol.user();return await this.provider.adapter.deleteSession({token:s}),a.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(t),{}}async forgotPassword(a=new Ef){const s=await a.input(),{email:t}=s.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(t);if(!i)return{};const o=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:o}),await this.provider.onForgotPassword(i,o),{}}async resetPassword(a=new Hf){const s=await a.input(),{password:t,token:i}=s.toJSON(),o=await this.provider.adapter.findPasswordResetToken({token:i});if(!o)throw new Fs({token:["Invalid token"]});if(Ss.Instant.from(o.createdAt.toISOString()).add({hours:24}).until(Ss.Now.instant()).sign>=0)throw new Fs({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const l=await this.provider.adapter.findUserByEmailAddress(o.user.email);if(!l)throw new Fs({email:["User not found"]});const c=await this.provider.hashPassword(t);return await this.provider.adapter.updateUserPassword({id:l.id,password:c}),await this.provider.adapter.deleteAllUserSessions(l.id),await this.provider.onResetPassword(l),{}}}class Wf extends qi{constructor(){super(...arguments)}routes={"/sign-in":this.post(ns,"signIn"),"/sign-up":this.post(ns,"signUp"),"/sign-out":this.post(ns,"signOut"),"/forgot-password":this.post(ns,"forgotPassword"),"/reset-password":this.post(ns,"resetPassword"),"/me":this.get(ns,"me")}}class Nf extends Lf{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class _i{basePath="/auth";routers={api:Wf,view:Nf};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new bl;async verifyPassword(a,s){return await Bun.password.verify(a,s)}async hashPassword(a){return await Bun.password.hash(a)}async generateForgotPasswordToken(a){const s=new Bun.CryptoHasher("sha256");return s.update(`${a.email}${Date.now()}`),s.digest("hex")}onSignUp(a){}onSignIn(a){}onSignOut(a){}onForgotPassword(a,s){}onResetPassword(a){}}class $f extends qi{constructor(){super(...arguments)}routes={"/translations":this.get(async(a=new xa)=>{const s=await a.input(),{scope:t,locale:i}=s.toJSON(),o=i??jt.getStore().i18nServiceContainer.detectLocale(a),r=jt.getStore().i18nServiceContainer.getPageTranslations(o,t);return a.ctx.setHeaders("Cache-Control",a.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),a.ctx.setCookie("i18n-locale",o,{expires:new Date(Date.now()+31536000000)}),{[o]:r}})}}class yl{a;constructor(a){this.service=a}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:$f};boot(){const a=new Map;for(let[t,i]of Object.entries(this.service.dictionary))for(let[o,r]of Object.entries(i))for(let[l,c]of Object.entries(r)){const d=l==="default"?this.service.defaultLocale:l;if(!a.has(`${d}.${t}`))a.set(`${d}.${t}`,new Map);a.get(`${d}.${t}`)?.set(o,c),this.isEnabled=!0}let s=new Set;for(let[t,i]of a.entries())this.translations.set(t,Object.fromEntries(i.entries())),s.add(t.split(".")[0]);this.supportedLocales=Array.from(s)}detectLocale(a){const s=this.service.detectLocale(a);if(this.supportedLocales.includes(s))return s;const i=a.cookies.get("i18n-locale")??(a.headers.get("accept-language")||"en-US"),[o]=i.split(",");if(this.supportedLocales.includes(o))return o;const r=this.service.defaultLocale??this.supportedLocales[0];if(r)return r;return"en-US"}getPageTranslations(a,s){if(!s)return{};const t=this.translations.get(`${a}.view:${s}`)??{},i={[`view:${s}`]:t};for(let[o]of this.translations.entries()){const r=o.split(".")[1];if(!r.startsWith("layout:"))continue;const l=r.split(":")[1];if(s?.startsWith(l))i[r]=this.translations.get(`${a}.${r}`)??{}}return i}}class Dl{a;constructor(a){this.service=a}}class Sl{a;constructor(a){this.service=a}getRouteHandlerAndParams(a){const t=new URL(a.url).pathname.replace("/api","");let i={},o;for(let[r]of Object.entries(this.service.flatRoutes))try{const l=new URLPattern({pathname:r});if(l.test({pathname:t})){o=r,i=l.exec({pathname:t})?.pathname.groups;break}}catch(l){console.error(l)}return{params:i,path:o}}async runRouteMiddleware(a){const s=Rs.getStore(),i=this.service.flatRoutes[a][s.req.rawRequest.method].middleware;try{await Gi.getContext().middlewareServiceContainer.runMiddleware(i,a)}catch(o){if(o.kind===wl){if(s.req.rawRequest.url.includes("/api")){const{status:r=400,data:l,headers:c}=o.payload.api;return new Response(JSON.stringify(l),{status:r,headers:{"Content-Type":"application/json",...c}})}}else throw console.error(o),o}}async getRouteData(a){const s=this.service.flatRoutes[a],t=Rs.getStore(),i=s[t.req.rawRequest.method].exec??(()=>Promise.resolve({}));let o={};try{o=await i()}catch(r){if(r.kind===wl){const{status:l=400,data:c,headers:d}=r.payload.api;return new Response(JSON.stringify(c),{status:l,headers:{"Content-Type":"application/json",...d}})}else throw console.error(r),r}return o}async handleApiRequest(a){const{params:s,path:t}=this.getRouteHandlerAndParams(a),i=this.service.flatRoutes[t];if(!i||!i[a.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const o=new xa(a,s);return await Rs.run(o,async()=>{const r=await this.runRouteMiddleware(t);if(r instanceof Response)return r;const l=await this.getRouteData(t);if(l instanceof Response)return l;const c=Rs.getStore(),d=c.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(c.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return c.cookies.forEach((u)=>d.append("Set-Cookie",u.toString())),c.destroy(),new Response(JSON.stringify(l),{headers:d})})}}var Ah=function(a){return Ui(a)};function vl(a){const s={};for(let[t,i]of Object.entries(a))if("run"in i){const o=i;if(!s[t])s[t]={};const{method:r,middlewares:l}=o,c=o.run.bind(o);s[t][r]={exec:c,middleware:l}}else if(Ah(i)){const o=new i,r=vl(o.routes);for(let[l,c]of Object.entries(r)){const d=l==="/"?"":l,u=t==="/"?"":t,f=`${u}${d}`===""?"/":`${u}${d}`;if(!s[f])s[f]={};for(let[p,m]of Object.entries(c))s[f][p]={exec:m.exec,middleware:[o.middleware,...o.middlewares,...m.middleware]}}}else for(let o of Object.values(i)){if(!s[t])s[t]={};const{method:r,middlewares:l}=o,c=o.run.bind(o);s[t][r]={exec:c,middleware:l}}return Object.fromEntries(Object.entries(s).sort(([t],[i])=>{const o=t.split("/").length+t.split(":").length,r=i.split("/").length+i.split(":").length;return o-r}))}class Fl extends Jf{constructor(){super(...arguments)}flatRoutes={};boot(a){this.flatRoutes=vl(a)}}var Eh=function(a){const s=new Map;for(let t of a)if(typeof t==="string"){const[i,o=""]=t.split(":");if(i.startsWith("-")){if(s.has(i.replace("-","")))s.delete(i.replace("-",""))}else s.set(i,o.split(","))}else s.set(t,[]);return s};class nl{a;constructor(a){this.service=a}runMiddleware(a,s){const t=Rs.getStore().req;return Array.from(Eh(a).entries()).map(([i,o])=>{if(typeof i==="string"){const r=this.service.aliases[i];if(r){const l=new r(s);return(c)=>l.run.call(l,c,...o)}}else{if(Ui(i)){const r=new aliasOrTest(s);return r.run.bind(r)}return i}}).filter(Boolean).reduce((i,o)=>{return async(r,l)=>{return{...await i(r,l),...await o(r,l)}}},(i)=>Promise.resolve({}))(t)}}class Rl{a;constructor(a){this.service=a}}import{AsyncLocalStorage as Hh} from"async_hooks";class Ml extends zf{a;name="broadcastingServiceContainer";publishCb;context=new Hh;constructor(a){super();this.service=a}onPublish(a){this.publishCb=a}publish(...a){const[s,t,i]=a;this.publishCb(s,t,i)}async handleMessage(a,s){const t=JSON.parse(s);if(t.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([o],[r])=>o.length-r.length);for(let[o,r]of i){const l=new URLPattern({pathname:o});if(l.test({pathname:t.topic})){const c=l.exec({pathname:t.topic})?.pathname.groups,d=new r;if(await d.subscribe.call(d,c))a.subscribe(t.topic)}break}}if(t.type==="broadcast")a.publish(t.topic,JSON.stringify({topic:t.topic,data:t.payload}));if(t.type==="unsubscribe")a.unsubscribe(t.topic)}run(a,s){const t=a.get("Cookie"),i=new Map;if(t){const o=t.split(";");for(let r of o){const[l,c]=r.split("=");i.set(l.trim(),c.trim())}}this.context.run({headers:a,cookies:i},s)}}class Gi{emailServiceProvider=Bf;authenticationServiceProvider=_i;middlewareServiceProvider=qf;policiesServiceProvider=_f;i18nServiceProvider=Gf;fileStorageServiceProvider=Qf;apiRouterServiceProvider=Fl;rateLimiterServiceProvider=Yf;broadcastingsServiceProvider=Kf;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new Uf(new this.emailServiceProvider),authenticationServiceProvider:new this.authenticationServiceProvider,middlewareServiceContainer:new nl(new this.middlewareServiceProvider),policiesServiceProvider:new this.policiesServiceProvider,i18nServiceContainer:new yl(new this.i18nServiceProvider),fileStorageServiceContainer:new Dl(new this.fileStorageServiceProvider),apiRouterServiceContainer:new Sl(new this.apiRouterServiceProvider),rateLimiterServiceContainer:new Rl(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new Ml(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>jl.getStore();run(a){const s=this.getServices();return jl.run(s,a)}}class Xf{a;constructor(a){this.prisma=a}async createSession(a){return await this.prisma.session.create({data:a,include:{user:!0}})}async createUser(a){return await this.prisma.user.create({data:a})}async deleteSession(a){return await this.prisma.session.deleteMany({where:{token:a.token}})}async findUserByEmailAddress(a){return await this.prisma.user.findUnique({where:{email:a}})}async findSession(a){if(!a.token)return null;try{return await this.prisma.session.findUnique({where:{token:a.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(s){return console.log(s),null}}async updateSession(a){return await this.prisma.session.update({where:{token:a.token},data:{expiresAt:a.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(a){return await this.prisma.user.update({where:{id:a.id},data:{password:a.password}})}async createPasswordResetToken(a){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:a.user.id}},token:a.token}})}async findPasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.findUnique({where:{token:s},include:{user:!0}})}async deleteAllUserSessions(a){return await this.prisma.session.deleteMany({where:{userId:a}})}async deletePasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.delete({where:{token:s}})}}export{Xf as PrismaAuthenticationAdapter,Gi as Kernel,_i as AuthenticationServiceProvider};
|