appos 0.3.3-0 → 0.3.4-0
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/bin/main.mjs
CHANGED
|
@@ -80,7 +80,7 @@ ${Ci}${t.trimStart()}`),n=3+bt(t.trimStart()).length)}process.stdout.write(`
|
|
|
80
80
|
`);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=F.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?F.default.green(qr):n===1?F.default.red(Gr):F.default.red(Kr);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
|
|
81
81
|
`):process.stdout.write(`${r} ${s}
|
|
82
82
|
`),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Ei=async(e,t)=>{let n={},r=Object.keys(e);for(let i of r){let r=e[i],a=await r({results:n})?.catch(e=>{throw e});if(typeof t?.onCancel==`function`&&br(a)){n[i]=`canceled`,t.onCancel({results:n});continue}n[i]=a}return n};function Di(e,t,n){return{args:e,ask:pi,cancel(e=`Cancelled`){yi(e),process.exit(0)},choice:gi,async cleanup(){for(let[,e]of Object.entries(n.db))await e.$client.end();for(let[,e]of Object.entries(n.cache))await e.disconnect();await n.eventBus.close(),n.logger.flush()},comment(e){Si.message(F.default.dim(e))},confirm:hi,container:n,error(e){Si.error(e)},async exec(e,t){return new Promise((n,r)=>{let i=Ze(e,t,{stdio:[`inherit`,`pipe`,`pipe`],cwd:process.cwd()}),a=``;i.stderr?.on(`data`,e=>{a+=e.toString()}),i.on(`close`,e=>{e===0?n():r(Error(a||`Command failed with exit code ${e}`))}),i.on(`error`,r)})},fail(e){Si.error(e),xi(F.default.red(`Failed`)),process.exit(1)},group:Ei,info(e){Si.info(e)},intro(e){bi(e)},isCancel:br,line(e){Si.message(e)},multiselect:_i,note(e,t){vi(e,t)},opts:t,outro(e=`Done`){xi(e)},secret:mi,async spinner(e,t){let n=Ti();n.start(e);try{let r=await t();return n.stop(e),r}catch(t){throw n.stop(e,1),t}},step(e){Si.step(e)},success(e){Si.success(e)},table(e,t){let n=e.map((e,n)=>Math.max(e.length,...t.map(e=>(e[n]||``).length)));vi([e.map((e,t)=>e.padEnd(n[t])).join(` │ `),n.map(e=>`─`.repeat(e)).join(`─┼─`),...t.map(e=>e.map((e,t)=>(e||``).padEnd(n[t])).join(` │ `))].join(`
|
|
83
|
-
`))},async task(e,t){let n=Date.now(),r=await t(),i=`${Date.now()-n}ms DONE`,a=`.`.repeat(Math.max(1,45-e.length-i.length));return Si.message(`${e} ${F.default.dim(a)} ${F.default.green(i)}`,{symbol:F.default.green(`◆`)}),r},taskStatus(e,t){let n=`.`.repeat(Math.max(1,45-e.length-t.length));Si.message(`${e} ${F.default.dim(n)} ${F.default.dim(t)}`,{symbol:F.default.dim(`◇`)})},warn(e){Si.warn(e)}}}function Oi(e){return{aliases:e.aliases||[],description:e.description,devOnly:e.devOnly??!1,args:e.args||[],opts:e.opts||{},run:e.run}}const ki=[`canvas`,`esbuild`,`sharp`,`@napi-rs/canvas`,`ultimate-express`,`uWebSockets.js`,`pino`,`pino-pretty`,`thread-stream`,`youch`],Ai=[`@esbuild/`,`@img/`,`@opentelemetry/`,`@dbos-inc/`,`@aws-sdk/`,`@smithy/`];function ji(){return[...ki,...Ai.map(e=>`${e}*`)]}async function Mi(){let e=[];try{await at(`./main.ts`),e.push(`./main.ts`)}catch{}for await(let t of ot(`./api/**/*.ts`))t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||t.includes(`/__fixtures__/`)||t.includes(`/databases/`)||e.push(t);return e}var Ni=Oi({description:`Build the application for production deployment`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`build`);let t=await Mi();e.step(`Found ${t.length} entry points`),await e.spinner(`Building production bundle`,async()=>{await ct(`./dist`,{recursive:!0,force:!0});let{build:e}=await import(`esbuild`);await e({banner:{js:`import{createRequire as __appos_createRequire}from"module";import{fileURLToPath as __appos_fileURLToPath}from"node:url";import{dirname as __appos_dirname}from"node:path";const __filename=__appos_fileURLToPath(import.meta.url);const __dirname=__appos_dirname(__filename);const require=__appos_createRequire(import.meta.url);`},bundle:!0,entryPoints:t,external:ji(),format:`esm`,minify:!0,outdir:`./dist`,outbase:`.`,platform:`node`,sourcemap:!0,splitting:!0,target:`node24`}),await N(`./api/databases`,`./dist/api/databases`,{recursive:!0})}),e.success(`Built to ./dist`),await e.cleanup(),e.outro()}}),I=t(i(((e,t)=>{var n=class e extends Array{constructor(t,n){if(super(t),this.sign=n,Object.setPrototypeOf(this,e.prototype),t>e.__kMaxLength)throw RangeError(`Maximum BigInt size exceeded`)}static BigInt(t){var n=Math.floor,r=Number.isFinite;if(typeof t==`number`){if(t===0)return e.__zero();if(e.__isOneDigitInt(t))return 0>t?e.__oneDigit(-t,!0):e.__oneDigit(t,!1);if(!r(t)||n(t)!==t)throw RangeError(`The number `+t+` cannot be converted to BigInt because it is not an integer`);return e.__fromDouble(t)}if(typeof t==`string`){let n=e.__fromString(t);if(n===null)throw SyntaxError(`Cannot convert `+t+` to a BigInt`);return n}if(typeof t==`boolean`)return!0===t?e.__oneDigit(1,!1):e.__zero();if(typeof t==`object`){if(t.constructor===e)return t;let n=e.__toPrimitive(t);return e.BigInt(n)}throw TypeError(`Cannot convert `+t+` to a BigInt`)}toDebugString(){let e=[`BigInt[`];for(let t of this)e.push((t&&(t>>>0).toString(16))+`, `);return e.push(`]`),e.join(``)}toString(t=10){if(2>t||36<t)throw RangeError(`toString() radix argument must be between 2 and 36`);return this.length===0?`0`:t&t-1?e.__toStringGeneric(this,t,!1):e.__toStringBasePowerOfTwo(this,t)}valueOf(){throw Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(t){let n=t.length;if(n===0)return 0;if(n===1){let e=t.__unsignedDigit(0);return t.sign?-e:e}let r=t.__digit(n-1),i=e.__clz30(r),a=30*n-i;if(1024<a)return t.sign?-1/0:1/0;let o=a-1,s=r,c=n-1,l=i+3,u=l===32?0:s<<l;u>>>=12;let d=l-12,f=12<=l?0:s<<20+l,p=20+l;for(0<d&&0<c&&(c--,s=t.__digit(c),u|=s>>>30-d,f=s<<d+2,p=d+2);0<p&&0<c;)c--,s=t.__digit(c),f|=30<=p?s<<p-30:s>>>30-p,p-=30;let m=e.__decideRounding(t,p,c,s);if((m===1||m===0&&(1&f)==1)&&(f=f+1>>>0,f===0&&(u++,u>>>20&&(u=0,o++,1023<o))))return t.sign?-1/0:1/0;let h=t.sign?-2147483648:0;return o=o+1023<<20,e.__kBitConversionInts[e.__kBitConversionIntHigh]=h|o|u,e.__kBitConversionInts[e.__kBitConversionIntLow]=f,e.__kBitConversionDouble[0]}static unaryMinus(e){if(e.length===0)return e;let t=e.__copy();return t.sign=!e.sign,t}static bitwiseNot(t){return t.sign?e.__absoluteSubOne(t).__trim():e.__absoluteAddOne(t,!0)}static exponentiate(t,n){if(n.sign)throw RangeError(`Exponent must be positive`);if(n.length===0)return e.__oneDigit(1,!1);if(t.length===0)return t;if(t.length===1&&t.__digit(0)===1)return t.sign&&!(1&n.__digit(0))?e.unaryMinus(t):t;if(1<n.length)throw RangeError(`BigInt too big`);let r=n.__unsignedDigit(0);if(r===1)return t;if(r>=e.__kMaxLengthBits)throw RangeError(`BigInt too big`);if(t.length===1&&t.__digit(0)===2){let n=1+(0|r/30),i=new e(n,t.sign&&(1&r)!=0);i.__initializeDigits();let a=1<<r%30;return i.__setDigit(n-1,a),i}let i=null,a=t;for(1&r&&(i=t),r>>=1;r!==0;r>>=1)a=e.multiply(a,a),1&r&&(i=i===null?a:e.multiply(i,a));return i}static multiply(t,n){if(t.length===0)return t;if(n.length===0)return n;let r=t.length+n.length;30<=t.__clzmsd()+n.__clzmsd()&&r--;let i=new e(r,t.sign!==n.sign);i.__initializeDigits();for(let r=0;r<t.length;r++)e.__multiplyAccumulate(n,t.__digit(r),i,r);return i.__trim()}static divide(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return e.__zero();let r=t.sign!==n.sign,i=n.__unsignedDigit(0),a;if(n.length===1&&32767>=i){if(i===1)return r===t.sign?t:e.unaryMinus(t);a=e.__absoluteDivSmall(t,i,null)}else a=e.__absoluteDivLarge(t,n,!0,!1);return a.sign=r,a.__trim()}static remainder(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return t;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return e.__zero();let n=e.__absoluteModSmall(t,r);return n===0?e.__zero():e.__oneDigit(n,t.sign)}let i=e.__absoluteDivLarge(t,n,!1,!0);return i.sign=t.sign,i.__trim()}static add(t,n){let r=t.sign;return r===n.sign?e.__absoluteAdd(t,n,r):0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r)}static subtract(t,n){let r=t.sign;return r===n.sign?0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r):e.__absoluteAdd(t,n,r)}static leftShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__rightShiftByAbsolute(t,n):e.__leftShiftByAbsolute(t,n)}static signedRightShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__leftShiftByAbsolute(t,n):e.__rightShiftByAbsolute(t,n)}static unsignedRightShift(){throw TypeError(`BigInts have no unsigned right shift; use >> instead`)}static lessThan(t,n){return 0>e.__compareToBigInt(t,n)}static lessThanOrEqual(t,n){return 0>=e.__compareToBigInt(t,n)}static greaterThan(t,n){return 0<e.__compareToBigInt(t,n)}static greaterThanOrEqual(t,n){return 0<=e.__compareToBigInt(t,n)}static equal(e,t){if(e.sign!==t.sign||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return!1;return!0}static notEqual(t,n){return!e.equal(t,n)}static bitwiseAnd(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteAnd(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length)+1,a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return a=e.__absoluteOr(a,o,a),e.__absoluteAddOne(a,!0,a).__trim()}return t.sign&&([t,n]=[n,t]),e.__absoluteAndNot(t,e.__absoluteSubOne(n)).__trim()}static bitwiseXor(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteXor(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length),a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return e.__absoluteXor(a,o,a).__trim()}let i=r(t.length,n.length)+1;t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteXor(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static bitwiseOr(t,n){var r=Math.max;let i=r(t.length,n.length);if(!t.sign&&!n.sign)return e.__absoluteOr(t,n).__trim();if(t.sign&&n.sign){let r=e.__absoluteSubOne(t,i),a=e.__absoluteSubOne(n);return r=e.__absoluteAnd(r,a,r),e.__absoluteAddOne(r,!0,r).__trim()}t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteAndNot(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static asIntN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=n.__unsignedDigit(i-1),o=1<<(t-1)%30;if(n.length===i&&a<o)return n;if((a&o)!==o)return e.__truncateToNBits(t,n);if(!n.sign)return e.__truncateAndSubFromPowerOfTwo(t,n,!0);if(!(a&o-1)){for(let r=i-2;0<=r;r--)if(n.__digit(r)!==0)return e.__truncateAndSubFromPowerOfTwo(t,n,!1);return n.length===i&&a===o?n:e.__truncateToNBits(t,n)}return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}static asUintN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(n.sign){if(t>e.__kMaxLengthBits)throw RangeError(`BigInt too big`);return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=t%30;return n.length==i&&(a===0||!(n.__digit(i-1)>>>a))?n:e.__truncateToNBits(t,n)}static ADD(t,n){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`)return typeof n!=`string`&&(n=n.toString()),t+n;if(typeof n==`string`)return t.toString()+n;if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)&&e.__isBigInt(n))return e.add(t,n);if(typeof t==`number`&&typeof n==`number`)return t+n;throw TypeError(`Cannot mix BigInt and other types, use explicit conversions`)}static LT(t,n){return e.__compare(t,n,0)}static LE(t,n){return e.__compare(t,n,1)}static GT(t,n){return e.__compare(t,n,2)}static GE(t,n){return e.__compare(t,n,3)}static EQ(t,n){for(;;){if(e.__isBigInt(t))return e.__isBigInt(n)?e.equal(t,n):e.EQ(n,t);if(typeof t==`number`){if(e.__isBigInt(n))return e.__equalToNumber(n,t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`string`){if(e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.equal(t,n);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`boolean`){if(e.__isBigInt(n))return e.__equalToNumber(n,+t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`symbol`){if(e.__isBigInt(n))return!1;if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`object`){if(typeof n==`object`&&n.constructor!==e)return t==n;t=e.__toPrimitive(t)}else return t==n}}static NE(t,n){return!e.EQ(t,n)}static DataViewGetBigInt64(t,n,r=!1){return e.asIntN(64,e.DataViewGetBigUint64(t,n,r))}static DataViewGetBigUint64(t,n,r=!1){let[i,a]=r?[4,0]:[0,4],o=t.getUint32(n+i,r),s=t.getUint32(n+a,r),c=new e(3,!1);return c.__setDigit(0,1073741823&s),c.__setDigit(1,(268435455&o)<<2|s>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(t,n,r,i=!1){e.DataViewSetBigUint64(t,n,r,i)}static DataViewSetBigUint64(t,n,r,i=!1){r=e.asUintN(64,r);let a=0,o=0;if(0<r.length&&(o=r.__digit(0),1<r.length)){let e=r.__digit(1);o|=e<<30,a=e>>>2,2<r.length&&(a|=r.__digit(2)<<28)}let[s,c]=i?[4,0]:[0,4];t.setUint32(n+s,a,i),t.setUint32(n+c,o,i)}static __zero(){return new e(0,!1)}static __oneDigit(t,n){let r=new e(1,n);return r.__setDigit(0,t),r}__copy(){let t=new e(this.length,this.sign);for(let e=0;e<this.length;e++)t[e]=this[e];return t}__trim(){let e=this.length,t=this[e-1];for(;t===0;)e--,t=this[e-1],this.pop();return e===0&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,t,n,r){if(0<t)return-1;let i;if(0>t)i=-t-1;else{if(n===0)return-1;n--,r=e.__digit(n),i=29}let a=1<<i;if((r&a)==0)return-1;if(--a,(r&a)!=0)return 1;for(;0<n;)if(n--,e.__digit(n)!==0)return 1;return 0}static __fromDouble(t){e.__kBitConversionDouble[0]=t;let n=(2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20)-1023,r=(0|n/30)+1,i=new e(r,0>t),a=1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh]|1048576,o=e.__kBitConversionInts[e.__kBitConversionIntLow],s=n%30,c,l=0;if(s<20){let e=20-s;l=e+32,c=a>>>e,a=a<<32-e|o>>>e,o<<=32-e}else if(s===20)l=32,c=a,a=o,o=0;else{let e=s-20;l=32-e,c=a<<e|o>>>32-e,a=o<<e,o=0}i.__setDigit(r-1,c);for(let e=r-2;0<=e;e--)0<l?(l-=30,c=a>>>2,a=a<<30|o>>>2,o<<=30):c=0,i.__setDigit(e,c);return i.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(t,n=0){let r=0,i=t.length,a=0;if(a===i)return e.__zero();let o=t.charCodeAt(a);for(;e.__isWhitespace(o);){if(++a===i)return e.__zero();o=t.charCodeAt(a)}if(o===43){if(++a===i)return null;o=t.charCodeAt(a),r=1}else if(o===45){if(++a===i)return null;o=t.charCodeAt(a),r=-1}if(n===0){if(n=10,o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(n=16,++a===i)return null;o=t.charCodeAt(a)}else if(o===79||o===111){if(n=8,++a===i)return null;o=t.charCodeAt(a)}else if(o===66||o===98){if(n=2,++a===i)return null;o=t.charCodeAt(a)}}}else if(n===16&&o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(++a===i)return null;o=t.charCodeAt(a)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++a===i)return e.__zero();o=t.charCodeAt(a)}let s=i-a,c=e.__kMaxBitsPerChar[n],l=e.__kBitsPerCharTableMultiplier-1;if(s>1073741824/c)return null;let u=new e(0|((c*s+l>>>e.__kBitsPerCharTableShift)+29)/30,!1),d=10>n?n:10,f=10<n?n-10:0;if(n&n-1){u.__initializeDigits();let r=!1,s=0;do{let p=0,m=1;for(;;){let e;if(o-48>>>0<d)e=o-48;else if((32|o)-97>>>0<f)e=(32|o)-87;else{r=!0;break}let c=m*n;if(1073741823<c)break;if(m=c,p=p*n+e,s++,++a===i){r=!0;break}o=t.charCodeAt(a)}l=30*e.__kBitsPerCharTableMultiplier-1;let h=0|(c*s+l>>>e.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(m,p,h)}while(!r)}else{c>>=e.__kBitsPerCharTableShift;let n=[],r=[],s=!1;do{let e=0,l=0;for(;;){let n;if(o-48>>>0<d)n=o-48;else if((32|o)-97>>>0<f)n=(32|o)-87;else{s=!0;break}if(l+=c,e=e<<c|n,++a===i){s=!0;break}if(o=t.charCodeAt(a),30<l+c)break}n.push(e),r.push(l)}while(!s);e.__fillFromParts(u,n,r)}if(a!==i){if(!e.__isWhitespace(o))return null;for(a++;a<i;a++)if(o=t.charCodeAt(a),!e.__isWhitespace(o))return null}return u.sign=r==-1,u.__trim()}static __fillFromParts(e,t,n){let r=0,i=0,a=0;for(let o=t.length-1;0<=o;o--){let s=t[o],c=n[o];i|=s<<a,a+=c,a===30?(e.__setDigit(r++,i),a=0,i=0):30<a&&(e.__setDigit(r++,1073741823&i),a-=30,i=s>>>c-a)}if(i!==0){if(r>=e.length)throw Error(`implementation bug`);e.__setDigit(r++,i)}for(;r<e.length;r++)e.__setDigit(r,0)}static __toStringBasePowerOfTwo(t,n){let r=t.length,i=n-1;i=(85&i>>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);let a=i,o=n-1,s=t.__digit(r-1),c=e.__clz30(s),l=0|(30*r-c+a-1)/a;if(t.sign&&l++,268435456<l)throw Error(`string too long`);let u=Array(l),d=l-1,f=0,p=0;for(let n=0;n<r-1;n++){let r=t.__digit(n),i=(f|r<<p)&o;u[d--]=e.__kConversionChars[i];let s=a-p;for(f=r>>>s,p=30-s;p>=a;)u[d--]=e.__kConversionChars[f&o],f>>>=a,p-=a}let m=(f|s<<p)&o;for(u[d--]=e.__kConversionChars[m],f=s>>>a-p;f!==0;)u[d--]=e.__kConversionChars[f&o],f>>>=a;if(t.sign&&(u[d--]=`-`),d!=-1)throw Error(`implementation bug`);return u.join(``)}static __toStringGeneric(t,n,r){let i=t.length;if(i===0)return``;if(i===1){let e=t.__unsignedDigit(0).toString(n);return!1===r&&t.sign&&(e=`-`+e),e}let a=30*i-e.__clz30(t.__digit(i-1)),o=e.__kMaxBitsPerChar[n]-1,s=a*e.__kBitsPerCharTableMultiplier;s+=o-1,s=0|s/o;let c=s+1>>1,l=e.exponentiate(e.__oneDigit(n,!1),e.__oneDigit(c,!1)),u,d,f=l.__unsignedDigit(0);if(l.length===1&&32767>=f){u=new e(t.length,!1),u.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){let n=r<<15|t.__halfDigit(e);u.__setHalfDigit(e,0|n/f),r=0|n%f}d=r.toString(n)}else{let r=e.__absoluteDivLarge(t,l,!0,!0);u=r.quotient;let i=r.remainder.__trim();d=e.__toStringGeneric(i,n,!0)}u.__trim();let p=e.__toStringGeneric(u,n,!0);for(;d.length<c;)d=`0`+d;return!1===r&&t.sign&&(p=`-`+p),p+d}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(t,n){let r=t.sign;if(r!==n.sign)return e.__unequalSign(r);let i=e.__absoluteCompare(t,n);return 0<i?e.__absoluteGreater(r):0>i?e.__absoluteLess(r):0}static __compareToNumber(t,n){if(e.__isOneDigitInt(n)){let r=t.sign,i=0>n;if(r!==i)return e.__unequalSign(r);if(t.length===0){if(i)throw Error(`implementation bug`);return n===0?0:-1}if(1<t.length)return e.__absoluteGreater(r);let a=Math.abs(n),o=t.__unsignedDigit(0);return o>a?e.__absoluteGreater(r):o<a?e.__absoluteLess(r):0}return e.__compareToDouble(t,n)}static __compareToDouble(t,n){if(n!==n)return n;if(n===1/0)return-1;if(n===-1/0)return 1;let r=t.sign;if(r!==0>n)return e.__unequalSign(r);if(n===0)throw Error(`implementation bug: should be handled elsewhere`);if(t.length===0)return-1;e.__kBitConversionDouble[0]=n;let i=2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20;if(i==2047)throw Error(`implementation bug: handled elsewhere`);let a=i-1023;if(0>a)return e.__absoluteGreater(r);let o=t.length,s=t.__digit(o-1),c=e.__clz30(s),l=30*o-c,u=a+1;if(l<u)return e.__absoluteLess(r);if(l>u)return e.__absoluteGreater(r);let d=1048576|1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh],f=e.__kBitConversionInts[e.__kBitConversionIntLow],p=29-c;if(p!==(0|(l-1)%30))throw Error(`implementation bug`);let m,h=0;if(20>p){let e=20-p;h=e+32,m=d>>>e,d=d<<32-e|f>>>e,f<<=32-e}else if(p===20)h=32,m=d,d=f,f=0;else{let e=p-20;h=32-e,m=d<<e|f>>>32-e,d=f<<e,f=0}if(s>>>=0,m>>>=0,s>m)return e.__absoluteGreater(r);if(s<m)return e.__absoluteLess(r);for(let n=o-2;0<=n;n--){0<h?(h-=30,m=d>>>2,d=d<<30|f>>>2,f<<=30):m=0;let i=t.__unsignedDigit(n);if(i>m)return e.__absoluteGreater(r);if(i<m)return e.__absoluteLess(r)}if(d!==0||f!==0){if(h===0)throw Error(`implementation bug`);return e.__absoluteLess(r)}return 0}static __equalToNumber(t,n){var r=Math.abs;return e.__isOneDigitInt(n)?n===0?t.length===0:t.length===1&&t.sign===0>n&&t.__unsignedDigit(0)===r(n):e.__compareToDouble(t,n)===0}static __comparisonResultToBool(e,t){return t===0?0>e:t===1?0>=e:t===2?0<e:t===3?0<=e:void 0}static __compare(t,n,r){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`&&typeof n==`string`)switch(r){case 0:return t<n;case 1:return t<=n;case 2:return t>n;case 3:return t>=n}if(e.__isBigInt(t)&&typeof n==`string`)return n=e.__fromString(n),n!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof t==`string`&&e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)){if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof n!=`number`)throw Error(`implementation bug`);return e.__comparisonResultToBool(e.__compareToNumber(t,n),r)}if(typeof t!=`number`)throw Error(`implementation bug`);if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToNumber(n,t),2^r);if(typeof n!=`number`)throw Error(`implementation bug`);return r===0?t<n:r===1?t<=n:r===2?t>n:r===3?t>=n:void 0}__clzmsd(){return e.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,n,r){if(t.length<n.length)return e.__absoluteAdd(n,t,r);if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=t.length;(t.__clzmsd()===0||n.length===t.length&&n.__clzmsd()===0)&&i++;let a=new e(i,r),o=0,s=0;for(;s<n.length;s++){let e=t.__digit(s)+n.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}for(;s<t.length;s++){let e=t.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}return s<a.length&&a.__setDigit(s,o),a.__trim()}static __absoluteSub(t,n,r){if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=new e(t.length,r),a=0,o=0;for(;o<n.length;o++){let e=t.__digit(o)-n.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}for(;o<t.length;o++){let e=t.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}return i.__trim()}static __absoluteAddOne(t,n,r=null){let i=t.length;r===null?r=new e(i,n):r.sign=n;let a=1;for(let e=0;e<i;e++){let n=t.__digit(e)+a;a=n>>>30,r.__setDigit(e,1073741823&n)}return a!=0&&r.__setDigitGrow(i,1),r}static __absoluteSubOne(t,n){let r=t.length;n||=r;let i=new e(n,!1),a=1;for(let e=0;e<r;e++){let n=t.__digit(e)-a;a=1&n>>>30,i.__setDigit(e,1073741823&n)}if(a!=0)throw Error(`implementation bug`);for(let e=r;e<n;e++)i.__setDigit(e,0);return i}static __absoluteAnd(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=o;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&n.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteAndNot(t,n,r=null){let i=t.length,a=n.length,o=a;i<a&&(o=i);let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&~n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteOr(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)|n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteXor(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)^n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteCompare(e,t){let n=e.length-t.length;if(n!=0)return n;let r=e.length-1;for(;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}static __multiplyAccumulate(t,n,r,i){if(n===0)return;let a=32767&n,o=n>>>15,s=0,c=0;for(let n,l=0;l<t.length;l++,i++){n=r.__digit(i);let u=t.__digit(l),d=32767&u,f=u>>>15,p=e.__imul(d,a),m=e.__imul(d,o),h=e.__imul(f,a),g=e.__imul(f,o);n+=c+p+s,s=n>>>30,n&=1073741823,n+=((32767&m)<<15)+((32767&h)<<15),s+=n>>>30,c=g+(m>>>15)+(h>>>15),r.__setDigit(i,1073741823&n)}for(;s!=0||c!==0;i++){let e=r.__digit(i);e+=s+c,c=0,s=e>>>30,r.__setDigit(i,1073741823&e)}}static __internalMultiplyAdd(t,n,r,i,a){let o=r,s=0;for(let r=0;r<i;r++){let i=t.__digit(r),c=e.__imul(32767&i,n),l=e.__imul(i>>>15,n),u=c+((32767&l)<<15)+s+o;o=u>>>30,s=l>>>15,a.__setDigit(r,1073741823&u)}if(a.length>i)for(a.__setDigit(i++,o+s);i<a.length;)a.__setDigit(i++,0);else if(o+s!==0)throw Error(`implementation bug`)}__inplaceMultiplyAdd(t,n,r){r>this.length&&(r=this.length);let i=32767&t,a=t>>>15,o=0,s=n;for(let t=0;t<r;t++){let n=this.__digit(t),r=32767&n,c=n>>>15,l=e.__imul(r,i),u=e.__imul(r,a),d=e.__imul(c,i),f=e.__imul(c,a),p=s+l+o;o=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&d)<<15),o+=p>>>30,s=f+(u>>>15)+(d>>>15),this.__setDigit(t,1073741823&p)}if(o!=0||s!==0)throw Error(`implementation bug`)}static __absoluteDivSmall(t,n,r=null){r===null&&(r=new e(t.length,!1));let i=0;for(let e,a=2*t.length-1;0<=a;a-=2){e=(i<<15|t.__halfDigit(a))>>>0;let o=0|e/n;i=0|e%n,e=(i<<15|t.__halfDigit(a-1))>>>0;let s=0|e/n;i=0|e%n,r.__setDigit(a>>>1,o<<15|s)}return r}static __absoluteModSmall(e,t){let n=0;for(let r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}static __absoluteDivLarge(t,n,r,i){let a=n.__halfDigitLength(),o=n.length,s=t.__halfDigitLength()-a,c=null;r&&(c=new e(s+2>>>1,!1),c.__initializeDigits());let l=new e(a+2>>>1,!1);l.__initializeDigits();let u=e.__clz15(n.__halfDigit(a-1));0<u&&(n=e.__specialLeftShift(n,u,0));let d=e.__specialLeftShift(t,u,1),f=n.__halfDigit(a-1),p=0;for(let t,i=s;0<=i;i--){t=32767;let s=d.__halfDigit(i+a);if(s!==f){let r=(s<<15|d.__halfDigit(i+a-1))>>>0;t=0|r/f;let o=0|r%f,c=n.__halfDigit(a-2),l=d.__halfDigit(i+a-2);for(;e.__imul(t,c)>>>0>(o<<16|l)>>>0&&(t--,o+=f,!(32767<o)););}e.__internalMultiplyAdd(n,t,0,o,l);let u=d.__inplaceSub(l,i,a+1);u!==0&&(u=d.__inplaceAdd(n,i,a),d.__setHalfDigit(i+a,32767&d.__halfDigit(i+a)+u),t--),r&&(1&i?p=t<<15:c.__setDigit(i>>>1,p|t))}if(i)return d.__inplaceRightShift(u),r?{quotient:c,remainder:d}:d;if(r)return c;throw Error(`unreachable`)}static __clz15(t){return e.__clz30(t)-15}__inplaceAdd(e,t,n){let r=0;for(let i=0;i<n;i++){let n=this.__halfDigit(t+i)+e.__halfDigit(i)+r;r=n>>>15,this.__setHalfDigit(t+i,32767&n)}return r}__inplaceSub(e,t,n){let r=0;if(1&t){t>>=1;let i=this.__digit(t),a=32767&i,o=0;for(;o<n-1>>>1;o++){let n=e.__digit(o),s=(i>>>15)-(32767&n)-r;r=1&s>>>15,this.__setDigit(t+o,(32767&s)<<15|32767&a),i=this.__digit(t+o+1),a=(32767&i)-(n>>>15)-r,r=1&a>>>15}let s=e.__digit(o),c=(i>>>15)-(32767&s)-r;if(r=1&c>>>15,this.__setDigit(t+o,(32767&c)<<15|32767&a),t+o+1>=this.length)throw RangeError(`out of bounds`);!(1&n)&&(i=this.__digit(t+o+1),a=(32767&i)-(s>>>15)-r,r=1&a>>>15,this.__setDigit(t+e.length,1073709056&i|32767&a))}else{t>>=1;let i=0;for(;i<e.length-1;i++){let n=this.__digit(t+i),a=e.__digit(i),o=(32767&n)-(32767&a)-r;r=1&o>>>15;let s=(n>>>15)-(a>>>15)-r;r=1&s>>>15,this.__setDigit(t+i,(32767&s)<<15|32767&o)}let a=this.__digit(t+i),o=e.__digit(i),s=(32767&a)-(32767&o)-r;r=1&s>>>15;let c=0;!(1&n)&&(c=(a>>>15)-(o>>>15)-r,r=1&c>>>15),this.__setDigit(t+i,(32767&c)<<15|32767&s)}return r}__inplaceRightShift(e){if(e===0)return;let t=this.__digit(0)>>>e,n=this.length-1;for(let r=0;r<n;r++){let n=this.__digit(r+1);this.__setDigit(r,1073741823&n<<30-e|t),t=n>>>e}this.__setDigit(n,t)}static __specialLeftShift(t,n,r){let i=t.length,a=new e(i+r,!1);if(n===0){for(let e=0;e<i;e++)a.__setDigit(e,t.__digit(e));return 0<r&&a.__setDigit(i,0),a}let o=0;for(let e=0;e<i;e++){let r=t.__digit(e);a.__setDigit(e,1073741823&r<<n|o),o=r>>>30-n}return 0<r&&a.__setDigit(i,o),a}static __leftShiftByAbsolute(t,n){let r=e.__toShiftAmount(n);if(0>r)throw RangeError(`BigInt too big`);let i=0|r/30,a=r%30,o=t.length,s=a!==0&&t.__digit(o-1)>>>30-a!=0,c=o+i+(s?1:0),l=new e(c,t.sign);if(a===0){let e=0;for(;e<i;e++)l.__setDigit(e,0);for(;e<c;e++)l.__setDigit(e,t.__digit(e-i))}else{let e=0;for(let e=0;e<i;e++)l.__setDigit(e,0);for(let n=0;n<o;n++){let r=t.__digit(n);l.__setDigit(n+i,1073741823&r<<a|e),e=r>>>30-a}if(s)l.__setDigit(o+i,e);else if(e!==0)throw Error(`implementation bug`)}return l.__trim()}static __rightShiftByAbsolute(t,n){let r=t.length,i=t.sign,a=e.__toShiftAmount(n);if(0>a)return e.__rightShiftByMaximum(i);let o=0|a/30,s=a%30,c=r-o;if(0>=c)return e.__rightShiftByMaximum(i);let l=!1;if(i){if(t.__digit(o)&(1<<s)-1)l=!0;else for(let e=0;e<o;e++)if(t.__digit(e)!==0){l=!0;break}}l&&s===0&&~t.__digit(r-1)==0&&c++;let u=new e(c,i);if(s===0){u.__setDigit(c-1,0);for(let e=o;e<r;e++)u.__setDigit(e-o,t.__digit(e))}else{let e=t.__digit(o)>>>s,n=r-o-1;for(let r=0;r<n;r++){let n=t.__digit(r+o+1);u.__setDigit(r,1073741823&n<<30-s|e),e=n>>>s}u.__setDigit(n,e)}return l&&(u=e.__absoluteAddOne(u,!0,u)),u.__trim()}static __rightShiftByMaximum(t){return t?e.__oneDigit(1,!0):e.__zero()}static __toShiftAmount(t){if(1<t.length)return-1;let n=t.__unsignedDigit(0);return n>e.__kMaxLengthBits?-1:n}static __toPrimitive(t,n=`default`){if(typeof t!=`object`||t.constructor===e)return t;if(typeof Symbol<`u`&&typeof Symbol.toPrimitive==`symbol`&&t[Symbol.toPrimitive]){let e=t[Symbol.toPrimitive](n);if(typeof e!=`object`)return e;throw TypeError(`Cannot convert object to primitive value`)}let r=t.valueOf;if(r){let e=r.call(t);if(typeof e!=`object`)return e}let i=t.toString;if(i){let e=i.call(t);if(typeof e!=`object`)return e}throw TypeError(`Cannot convert object to primitive value`)}static __toNumeric(t){return e.__isBigInt(t)?t:+t}static __isBigInt(t){return typeof t==`object`&&!!t&&t.constructor===e}static __truncateToNBits(t,n){let r=0|(t+29)/30,i=new e(r,n.sign),a=r-1;for(let e=0;e<a;e++)i.__setDigit(e,n.__digit(e));let o=n.__digit(a);if(t%30!=0){let e=32-t%30;o=o<<e>>>e}return i.__setDigit(a,o),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,n,r){var i=Math.min;let a=0|(t+29)/30,o=new e(a,r),s=0,c=a-1,l=0;for(let e=i(c,n.length);s<e;s++){let e=0-n.__digit(s)-l;l=1&e>>>30,o.__setDigit(s,1073741823&e)}for(;s<c;s++)o.__setDigit(s,0|1073741823&-l);let u=c<n.length?n.__digit(c):0,d=t%30,f;if(d==0)f=0-u-l,f&=1073741823;else{let e=32-d;u=u<<e>>>e;let t=1<<32-e;f=t-u-l,f&=t-1}return o.__setDigit(c,f),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,t){this[e]=0|t}__setDigitGrow(e,t){this[e]=0|t}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,t){let n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}static __digitPow(e,t){let n=1;for(;0<t;)1&t&&(n*=e),t>>>=1,e*=e;return n}static __detectBigEndian(){return e.__kBitConversionDouble[0]=-0,e.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};n.__kMaxLength=33554432,n.__kMaxLengthBits=n.__kMaxLength<<5,n.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],n.__kBitsPerCharTableShift=5,n.__kBitsPerCharTableMultiplier=1<<n.__kBitsPerCharTableShift,n.__kConversionChars=`0123456789abcdefghijklmnopqrstuvwxyz`.split(``),n.__kBitConversionBuffer=new ArrayBuffer(8),n.__kBitConversionDouble=new Float64Array(n.__kBitConversionBuffer),n.__kBitConversionInts=new Int32Array(n.__kBitConversionBuffer),n.__kBitConversionIntHigh=n.__detectBigEndian()?0:1,n.__kBitConversionIntLow=n.__detectBigEndian()?1:0,n.__clz30=Math.clz32?function(e){return Math.clz32(e)-2}:function(e){return e===0?30:0|29-(0|Math.log(e>>>0)/Math.LN2)},n.__imul=Math.imul||function(e,t){return 0|e*t},t.exports=n}))(),1);const Pi=I.default.BigInt(0),Fi=I.default.BigInt(1),Ii=I.default.BigInt(2),Li=I.default.BigInt(10),Ri=I.default.BigInt(24),zi=I.default.BigInt(60),Bi=I.default.BigInt(1e3),Vi=I.default.BigInt(1e6),Hi=I.default.BigInt(1e9),Ui=I.default.multiply(I.default.BigInt(3600),Hi),Wi=I.default.multiply(zi,Hi),Gi=I.default.multiply(Ui,Ri);function Ki(e){return typeof e==`bigint`?I.default.BigInt(e.toString(10)):e}function qi(e){return I.default.equal(I.default.remainder(e,Ii),Pi)}function Ji(e){return I.default.lessThan(e,Pi)?I.default.unaryMinus(e):e}function Yi(e,t){return I.default.lessThan(e,t)?-1:I.default.greaterThan(e,t)?1:0}function Xi(e,t){return{quotient:I.default.divide(e,t),remainder:I.default.remainder(e,t)}}var Zi,Qi;const $i=`slot-epochNanoSeconds`,ea=`slot-iso-date`,ta=`slot-iso-date-time`,na=`slot-time`,ra=`slot-calendar`,ia=`slot-date-brand`,aa=`slot-year-month-brand`,oa=`slot-month-day-brand`,sa=`slot-time-zone`,ca=`slot-years`,la=`slot-months`,ua=`slot-weeks`,da=`slot-days`,fa=`slot-hours`,pa=`slot-minutes`,ma=`slot-seconds`,ha=`slot-milliseconds`,ga=`slot-microseconds`,_a=`slot-nanoseconds`,va=`date`,ya=`time`,ba=`datetime`,xa=`instant`,Sa=`original`,Ca=`timezone-canonical`,wa=`timezone-original`,Ta=`calendar-id`,Ea=`locale`,Da=`options`,Oa=new WeakMap,ka=Symbol.for(`@@Temporal__GetSlots`);(Zi=globalThis)[ka]||(Zi[ka]=function(e){return Oa.get(e)});const Aa=globalThis[ka],ja=Symbol.for(`@@Temporal__CreateSlots`);(Qi=globalThis)[ja]||(Qi[ja]=function(e){Oa.set(e,Object.create(null))});const Ma=globalThis[ja];function Na(e,...t){if(!e||typeof e!=`object`)return!1;let n=Aa(e);return!!n&&t.every((e=>e in n))}function L(e,t){let n=Aa(e)?.[t];if(n===void 0)throw TypeError(`Missing internal slot ${t}`);return n}function Pa(e,t,n){let r=Aa(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t])throw TypeError(`${t} already has set`);r[t]=n}const Fa={};function Ia(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let n=Object.getOwnPropertyNames(e);for(let t=0;t<n.length;t++){let r=n[t],i=Object.getOwnPropertyDescriptor(e,r);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e,r,i))}let r=Object.getOwnPropertyNames(e.prototype);for(let t=0;t<r.length;t++){let n=r[t],i=Object.getOwnPropertyDescriptor(e.prototype,n);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e.prototype,n,i))}La(t,e),La(`${t}.prototype`,e.prototype)}function La(e,t){let n=`%${e}%`;if(Fa[n]!==void 0)throw Error(`intrinsic ${e} already exists`);Fa[n]=t}function Ra(e){return Fa[e]}function za(e,t){let n=e;if(n===0)return{div:n,mod:n};let r=Math.sign(n);n=Math.abs(n);let i=Math.trunc(1+Math.log10(n));if(t>=i)return{div:0*r,mod:r*n};if(t===0)return{div:r*n,mod:0*r};let a=n.toPrecision(i);return{div:r*Number.parseInt(a.slice(0,i-t),10),mod:r*Number.parseInt(a.slice(i-t),10)}}function Ba(e,t,n){let r=e,i=n;if(r===0)return i;let a=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let o=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return a*Number.parseInt(o+`0`.repeat(t),10);let s=o+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,`0`);return a*Number.parseInt(s,10)}function Va(e,t){let n=t===`negative`;switch(e){case`ceil`:return n?`zero`:`infinity`;case`floor`:return n?`infinity`:`zero`;case`expand`:return`infinity`;case`trunc`:return`zero`;case`halfCeil`:return n?`half-zero`:`half-infinity`;case`halfFloor`:return n?`half-infinity`:`half-zero`;case`halfExpand`:return`half-infinity`;case`halfTrunc`:return`half-zero`;case`halfEven`:return`half-even`}}function Ha(e,t,n,r,i){return i===`zero`?e:i===`infinity`?t:n<0?e:n>0?t:i===`half-zero`?e:i===`half-infinity`?t:r?e:t}var Ua=class e{constructor(e){this.totalNs=Ki(e),this.sec=I.default.toNumber(I.default.divide(this.totalNs,Hi)),this.subsec=I.default.toNumber(I.default.remainder(this.totalNs,Hi))}static validateNew(t,n){if(I.default.greaterThan(Ji(t),e.MAX))throw RangeError(`${n} of duration time units cannot exceed ${e.MAX} s`);return new e(t)}static fromEpochNsDiff(t,n){return new e(I.default.subtract(Ki(t),Ki(n)))}static fromComponents(t,n,r,i,a,o){let s=I.default.add(I.default.add(I.default.add(I.default.add(I.default.add(I.default.BigInt(o),I.default.multiply(I.default.BigInt(a),Bi)),I.default.multiply(I.default.BigInt(i),Vi)),I.default.multiply(I.default.BigInt(r),Hi)),I.default.multiply(I.default.BigInt(n),Wi)),I.default.multiply(I.default.BigInt(t),Ui));return e.validateNew(s,`total`)}abs(){return new e(Ji(this.totalNs))}add(t){return e.validateNew(I.default.add(this.totalNs,t.totalNs),`sum`)}add24HourDays(t){return e.validateNew(I.default.add(this.totalNs,I.default.multiply(I.default.BigInt(t),Gi)),`sum`)}addToEpochNs(e){return I.default.add(Ki(e),this.totalNs)}cmp(e){return Yi(this.totalNs,e.totalNs)}divmod(t){let{quotient:n,remainder:r}=Xi(this.totalNs,I.default.BigInt(t));return{quotient:I.default.toNumber(n),remainder:new e(r)}}fdiv(e){let t=Ki(e),n=I.default.BigInt(t),{quotient:r,remainder:i}=Xi(this.totalNs,n),a=[],o,s=(I.default.lessThan(this.totalNs,Pi)?-1:1)*Math.sign(I.default.toNumber(t));for(;!I.default.equal(i,Pi)&&a.length<50;)i=I.default.multiply(i,Li),{quotient:o,remainder:i}=Xi(i,n),a.push(Math.abs(I.default.toNumber(o)));return s*Number(Ji(r).toString()+`.`+a.join(``))}isZero(){return I.default.equal(this.totalNs,Pi)}round(t,n){let r=Ki(t);if(I.default.equal(r,Fi))return this;let{quotient:i,remainder:a}=Xi(this.totalNs,r),o=I.default.lessThan(this.totalNs,Pi)?`negative`:`positive`,s=I.default.multiply(Ji(i),r),c=I.default.add(s,r),l=Yi(Ji(I.default.multiply(a,Ii)),r),u=Va(n,o),d=I.default.equal(Ji(this.totalNs),s)?s:Ha(s,c,l,qi(i),u),f=o===`positive`?d:I.default.unaryMinus(d);return e.validateNew(f,`rounding`)}sign(){return this.cmp(new e(Pi))}subtract(t){return e.validateNew(I.default.subtract(this.totalNs,t.totalNs),`difference`)}};Ua.MAX=I.default.BigInt(`9007199254740991999999999`),Ua.ZERO=new Ua(Pi);const Wa=/[A-Za-z._][A-Za-z._0-9+-]*/,Ga=RegExp(`(?:(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)|(?:${Wa.source})(?:\\/(?:${Wa.source}))*)`),Ka=/(?:[+-]\d{6}|\d{4})/,qa=/(?:0[1-9]|1[0-2])/,Ja=/(?:0[1-9]|[12]\d|3[01])/,Ya=RegExp(`(${Ka.source})(?:-(${qa.source})-(${Ja.source})|(${qa.source})(${Ja.source}))`),Xa=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Za=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Qa=RegExp(`([zZ])|${Za.source}?`),$a=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,eo=new RegExp([`^${Ya.source}`,`(?:(?:[tT]|\\s+)${Xa.source}(?:${Qa.source})?)?`,`(?:\\[!?(${Ga.source})\\])?`,`((?:${$a.source})*)$`].join(``)),to=new RegExp([`^[tT]?${Xa.source}`,`(?:${Qa.source})?`,`(?:\\[!?${Ga.source}\\])?`,`((?:${$a.source})*)$`].join(``)),no=RegExp(`^(${Ka.source})-?(${qa.source})(?:\\[!?${Ga.source}\\])?((?:${$a.source})*)$`),ro=RegExp(`^(?:--)?(${qa.source})-?(${Ja.source})(?:\\[!?${Ga.source}\\])?((?:${$a.source})*)$`),io=/(\d+)(?:[.,](\d{1,9}))?/,ao=RegExp(`(?:${io.source}H)?(?:${io.source}M)?(?:${io.source}S)?`),oo=RegExp(`^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?!$)${ao.source})?$`,`i`),so=864e5,co=1e6*so,lo=1e8*so,uo=tu(lo),fo=I.default.unaryMinus(uo),po=I.default.add(I.default.subtract(fo,Gi),Fi),mo=I.default.subtract(I.default.add(uo,Gi),Fi);146097*so;const ho=-271821,go=275760,_o=Date.UTC(1847,0,1),vo=[`iso8601`,`hebrew`,`islamic`,`islamic-umalqura`,`islamic-tbla`,`islamic-civil`,`islamic-rgsa`,`islamicc`,`persian`,`ethiopic`,`ethioaa`,`ethiopic-amete-alem`,`coptic`,`chinese`,`dangi`,`roc`,`indian`,`buddhist`,`japanese`,`gregory`],yo=new Set([`ACT`,`AET`,`AGT`,`ART`,`AST`,`BET`,`BST`,`CAT`,`CNT`,`CST`,`CTT`,`EAT`,`ECT`,`IET`,`IST`,`JST`,`MIT`,`NET`,`NST`,`PLT`,`PNT`,`PRT`,`PST`,`SST`,`VST`]);function bo(e){return typeof e==`object`&&!!e||typeof e==`function`}function xo(e){if(typeof e==`bigint`)throw TypeError(`Cannot convert BigInt to number`);return Number(e)}function So(e){if(typeof e==`symbol`)throw TypeError(`Cannot convert a Symbol value to a String`);return String(e)}function Co(e){let t=xo(e);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw RangeError(`invalid number value`);let n=Math.trunc(t);return n===0?0:n}function wo(e,t){let n=Co(e);if(n<=0)throw t===void 0?RangeError(`Cannot convert a number less than one to a positive integer`):RangeError(`property '${t}' cannot be a a number less than one`);return n}function To(e){let t=xo(e);if(Number.isNaN(t))throw RangeError(`not a number`);if(t===1/0||t===-1/0)throw RangeError(`infinity is out of range`);if(!function(e){if(typeof e!=`number`||Number.isNaN(e)||e===1/0||e===-1/0)return!1;let t=Math.abs(e);return Math.floor(t)===t}(t))throw RangeError(`unsupported fractional value ${e}`);return t===0?0:t}function Eo(e,t){return String(e).padStart(t,`0`)}function Do(e){if(typeof e!=`string`)throw TypeError(`expected a string, not ${String(e)}`);return e}function Oo(e,t){if(bo(e)){let t=e?.toString();if(typeof t==`string`||typeof t==`number`)return t;throw TypeError(`Cannot convert object to primitive value`)}return e}const ko=[`era`,`eraYear`,`year`,`month`,`monthCode`,`day`,`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],Ao={era:So,eraYear:Co,year:Co,month:wo,monthCode:function(e){let t=Do(Oo(e));if(t.length<3||t.length>4||t[0]!==`M`||`0123456789`.indexOf(t[1])===-1||`0123456789`.indexOf(t[2])===-1||t[1]+t[2]===`00`&&t[3]!==`L`||t[3]!==`L`&&t[3]!==void 0)throw RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:wo,hour:Co,minute:Co,second:Co,millisecond:Co,microsecond:Co,nanosecond:Co,offset:function(e){let t=Do(Oo(e));return Pc(t),t},timeZone:pc},jo={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Mo=[[`years`,`year`,`date`],[`months`,`month`,`date`],[`weeks`,`week`,`date`],[`days`,`day`,`date`],[`hours`,`hour`,`time`],[`minutes`,`minute`,`time`],[`seconds`,`second`,`time`],[`milliseconds`,`millisecond`,`time`],[`microseconds`,`microsecond`,`time`],[`nanoseconds`,`nanosecond`,`time`]],No=Object.fromEntries(Mo.map((e=>[e[0],e[1]]))),Po=Object.fromEntries(Mo.map((([e,t])=>[t,e]))),Fo=Mo.map((([,e])=>e)),Io={day:co,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Lo=[`days`,`hours`,`microseconds`,`milliseconds`,`minutes`,`months`,`nanoseconds`,`seconds`,`weeks`,`years`],Ro=Intl.DateTimeFormat,zo=new Map;function Bo(e){let t=uu(e),n=zo.get(t);return n===void 0&&(n=new Ro(`en-us`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),zo.set(t,n)),n}function Vo(e){return Na(e,$i)&&!Na(e,sa,ra)}function Ho(e){return Na(e,ca,la,da,fa,pa,ma,ha,ga,_a)}function Uo(e){return Na(e,ia)}function Wo(e){return Na(e,na)}function Go(e){return Na(e,ta)}function Ko(e){return Na(e,aa)}function qo(e){return Na(e,oa)}function Jo(e){return Na(e,$i,sa,ra)}function R(e,t){if(!t(e))throw TypeError(`invalid receiver: method called with the wrong type of this-object`)}function Yo(e){if(Na(e,ra)||Na(e,sa))throw TypeError(`with() does not support a calendar or timeZone property`);if(Wo(e))throw TypeError(`with() does not accept Temporal.PlainTime, use withPlainTime() instead`);if(e.calendar!==void 0)throw TypeError(`with() does not support a calendar property`);if(e.timeZone!==void 0)throw TypeError(`with() does not support a timeZone property`)}function Xo(e,t){return t===`never`||t===`auto`&&e===`iso8601`?``:`[${t===`critical`?`!`:``}u-ca=${e}]`}function Zo(e){let t,n,r=!1;for($a.lastIndex=0;n=$a.exec(e);){let{1:i,2:a,3:o}=n;if(a===`u-ca`){if(t===void 0)t=o,r=i===`!`;else if(i===`!`||r)throw RangeError(`Invalid annotations in ${e}: more than one u-ca present with critical flag`)}else if(i===`!`)throw RangeError(`Unrecognized annotation: !${a}=${o}`)}return t}function Qo(e){let t=eo.exec(e);if(!t)throw RangeError(`invalid RFC 9557 string: ${e}`);let n=Zo(t[16]),r=t[1];if(r===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);let i=+r,a=+(t[2]??t[4]??1),o=+(t[3]??t[5]??1),s=t[6]!==void 0,c=+(t[6]??0),l=+(t[7]??t[10]??0),u=+(t[8]??t[11]??0);u===60&&(u=59);let d=(t[9]??t[12]??``)+`000000000`,f=+d.slice(0,3),p=+d.slice(3,6),m=+d.slice(6,9),h,g=!1;t[13]?(h=void 0,g=!0):t[14]&&(h=t[14]);let _=t[15];return ul(i,a,o,c,l,u,f,p,m),{year:i,month:a,day:o,time:s?{hour:c,minute:l,second:u,millisecond:f,microsecond:p,nanosecond:m}:`start-of-day`,tzAnnotation:_,offset:h,z:g,calendar:n}}function $o(e){let t=to.exec(e),n,r,i,a,o,s,c;if(t){c=Zo(t[10]),n=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let e=(t[4]??t[7]??``)+`000000000`;if(a=+e.slice(0,3),o=+e.slice(3,6),s=+e.slice(6,9),t[8])throw RangeError(`Z designator not supported for PlainTime`)}else{let t,l;if({time:t,z:l,calendar:c}=Qo(e),t===`start-of-day`)throw RangeError(`time is missing in string: ${e}`);if(l)throw RangeError(`Z designator not supported for PlainTime`);({hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s}=t)}if(ll(n,r,i,a,o,s),/[tT ][0-9][0-9]/.test(e))return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c};try{let{month:t,day:n}=ts(e);sl(1972,t,n)}catch{try{let{year:t,month:n}=es(e);sl(t,n,1)}catch{return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c}}}throw RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`)}function es(e){let t=no.exec(e),n,r,i,a;if(t){i=Zo(t[3]);let o=t[1];if(o===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);if(n=+o,r=+t[2],a=1,i!==void 0&&i!==`iso8601`)throw RangeError(`YYYY-MM format is only valid with iso8601 calendar`)}else{let t;if({year:n,month:r,calendar:i,day:a,z:t}=Qo(e),t)throw RangeError(`Z designator not supported for PlainYearMonth`)}return{year:n,month:r,calendar:i,referenceISODay:a}}function ts(e){let t=ro.exec(e),n,r,i,a;if(t){if(i=Zo(t[3]),n=+t[1],r=+t[2],i!==void 0&&i!==`iso8601`)throw RangeError(`MM-DD format is only valid with iso8601 calendar`)}else{let t;if({month:n,day:r,calendar:i,year:a,z:t}=Qo(e),t)throw RangeError(`Z designator not supported for PlainMonthDay`)}return{month:n,day:r,calendar:i,referenceISOYear:a}}const ns=RegExp(`^${Ga.source}$`,`i`),rs=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?$`);function is(e){let t=see.test(e)?`Seconds not allowed in offset time zone`:`Invalid time zone`;throw RangeError(`${t}: ${e}`)}function as(e){return ns.test(e)||is(e),rs.test(e)?{offsetMinutes:Pc(e)/6e10}:{tzName:e}}function os(e,t,n,r){let i=e,a=t,o=n;switch(r){case`reject`:sl(i,a,o);break;case`constrain`:({year:i,month:a,day:o}=al(i,a,o))}return{year:i,month:a,day:o}}function ss(e,t,n,r,i,a,o){let s=e,c=t,l=n,u=r,d=i,f=a;switch(o){case`reject`:ll(s,c,l,u,d,f);break;case`constrain`:s=il(s,0,23),c=il(c,0,59),l=il(l,0,59),u=il(u,0,999),d=il(d,0,999),f=il(f,0,999)}return{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function cs(e){if(!bo(e))throw TypeError(`invalid duration-like`);let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},n=!1;for(let r=0;r<Lo.length;r++){let i=Lo[r],a=e[i];a!==void 0&&(n=!0,t[i]=To(a))}if(!n)throw TypeError(`invalid duration-like`);return t}function ls({years:e,months:t,weeks:n,days:r},i,a,o){return{years:e,months:o??t,weeks:a??n,days:i??r}}function us(e,t){return{isoDate:e,time:t}}function ds(e){return cu(e,`overflow`,[`constrain`,`reject`],`constrain`)}function fs(e){return cu(e,`disambiguation`,[`compatible`,`earlier`,`later`,`reject`],`compatible`)}function ps(e,t){return cu(e,`roundingMode`,[`ceil`,`floor`,`expand`,`trunc`,`halfCeil`,`halfFloor`,`halfExpand`,`halfTrunc`,`halfEven`],t)}function ms(e,t){return cu(e,`offset`,[`prefer`,`use`,`ignore`,`reject`],t)}function hs(e){return cu(e,`calendarName`,[`auto`,`always`,`never`,`critical`],`auto`)}function gs(e){let t=e.roundingIncrement;if(t===void 0)return 1;let n=Co(t);if(n<1||n>1e9)throw RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return n}function _s(e,t,n){let r=n?t:t-1;if(e>r)throw RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${e}`);if(t%e!=0)throw RangeError(`Rounding increment must divide evenly into ${t}`)}function vs(e){let t=e.fractionalSecondDigits;if(t===void 0)return`auto`;if(typeof t!=`number`){if(So(t)!==`auto`)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return`auto`}let n=Math.floor(t);if(!Number.isFinite(n)||n<0||n>9)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return n}function ys(e,t){switch(e){case`minute`:return{precision:`minute`,unit:`minute`,increment:1};case`second`:return{precision:0,unit:`second`,increment:1};case`millisecond`:return{precision:3,unit:`millisecond`,increment:1};case`microsecond`:return{precision:6,unit:`microsecond`,increment:1};case`nanosecond`:return{precision:9,unit:`nanosecond`,increment:1}}switch(t){case`auto`:return{precision:t,unit:`nanosecond`,increment:1};case 0:return{precision:t,unit:`second`,increment:1};case 1:case 2:case 3:return{precision:t,unit:`millisecond`,increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:`microsecond`,increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:`nanosecond`,increment:10**(9-t)};default:throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const bs=Symbol(`~required~`);function xs(e,t,n,r,i=[]){let a=[];for(let e=0;e<Mo.length;e++){let t=Mo[e],r=t[1],i=t[2];n!==`datetime`&&n!==i||a.push(r)}a=a.concat(i);let o=r;o===bs?o=void 0:o!==void 0&&a.push(o);let s=[];s=s.concat(a);for(let e=0;e<a.length;e++){let t=Po[a[e]];t!==void 0&&s.push(t)}let c=cu(e,t,s,o);if(c===void 0&&r===bs)throw RangeError(`${t} is required`);return c&&c in No?No[c]:c}function Ss(e){let t=e.relativeTo;if(t===void 0)return{};let n,r,i,a,o,s=`option`,c=!1;if(bo(t)){if(Jo(t))return{zonedRelativeTo:t};if(Uo(t))return{plainRelativeTo:t};if(Go(t))return{plainRelativeTo:Ws(L(t,ta).isoDate,L(t,ra))};i=cc(t);let e=As(i,t,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[]);({isoDate:n,time:r}=Ns(i,e,`constrain`)),{offset:o,timeZone:a}=e,o===void 0&&(s=`wall`)}else{let e,l,u,d,f;if({year:u,month:d,day:f,time:r,calendar:i,tzAnnotation:e,offset:o,z:l}=Qo(Do(t)),e)a=pc(e),l?s=`exact`:o||(s=`wall`),c=!0;else if(l)throw RangeError(`Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone`);i||=`iso8601`,i=lu(i),n={year:u,month:d,day:f}}return a===void 0?{plainRelativeTo:Ws(n,i)}:{zonedRelativeTo:nc(Vs(n,r,s,s===`option`?Pc(o):0,a,`compatible`,`reject`,c),a,i)}}function Cs(e){return L(e,ca)===0?L(e,la)===0?L(e,ua)===0?L(e,da)===0?L(e,fa)===0?L(e,pa)===0?L(e,ma)===0?L(e,ha)===0?L(e,ga)===0?`nanosecond`:`microsecond`:`millisecond`:`second`:`minute`:`hour`:`day`:`week`:`month`:`year`}function ws(e,t){return Fo.indexOf(e)>Fo.indexOf(t)?t:e}function Ts(e){return e===`year`||e===`month`||e===`week`}function Es(e){return Ts(e)||e===`day`?`date`:`time`}function Ds(e){return Ra(`%calendarImpl%`)(e)}function Os(e){return Ra(`%calendarImpl%`)(L(e,ra))}function ks(e,t,n=`date`){let r=Object.create(null),i=Ds(e).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,n!==`month-day`&&n!==`date`||(r.day=i.day),n!==`year-month`&&n!==`date`||(r.year=i.year),r}function As(e,t,n,r,i){let a=Ds(e).extraFields(n),o=n.concat(r,a),s=Object.create(null),c=!1;o.sort();for(let e=0;e<o.length;e++){let n=o[e],r=t[n];if(r!==void 0)c=!0,s[n]=(0,Ao[n])(r);else if(i!==`partial`){if(i.includes(n))throw TypeError(`required property '${n}' missing or undefined`);s[n]=jo[n]}}if(i===`partial`&&!c)throw TypeError(`no supported properties found`);return s}function js(e,t=`complete`){let n=[`hour`,`microsecond`,`millisecond`,`minute`,`nanosecond`,`second`],r=!1,i=Object.create(null);for(let a=0;a<n.length;a++){let o=n[a],s=e[o];s===void 0?t===`complete`&&(i[o]=0):(i[o]=Co(s),r=!0)}if(!r)throw TypeError(`invalid time-like`);return i}function Ms(e,t){if(bo(e)){if(Uo(e))return ds(ou(t)),Ws(L(e,ea),L(e,ra));if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Ws(n.isoDate,L(e,ra))}if(Go(e))return ds(ou(t)),Ws(L(e,ta).isoDate,L(e,ra));let n=cc(e);return Ws(uc(n,As(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),ds(ou(t))),n)}let{year:n,month:r,day:i,calendar:a,z:o}=Qo(Do(e));if(o)throw RangeError(`Z designator not supported for PlainDate`);return a||=`iso8601`,a=lu(a),ds(ou(t)),Ws({year:n,month:r,day:i},a)}function Ns(e,t,n){return us(uc(e,t,n),ss(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,n))}function Ps(e,t){let n,r,i;if(bo(e)){if(Go(e))return ds(ou(t)),Ks(L(e,ta),L(e,ra));if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Ks(n,L(e,ra))}if(Uo(e))return ds(ou(t)),Ks(us(L(e,ea),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),L(e,ra));i=cc(e);let a=As(i,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],[]),o=ds(ou(t));({isoDate:n,time:r}=Ns(i,a,o))}else{let a,o,s,c;if({year:o,month:s,day:c,time:r,calendar:i,z:a}=Qo(Do(e)),a)throw RangeError(`Z designator not supported for PlainDateTime`);r===`start-of-day`&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ul(o,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||=`iso8601`,i=lu(i),ds(ou(t)),n={year:o,month:s,day:c}}return Ks(us(n,r),i)}function Fs(e){let t=Ra(`%Temporal.Duration%`);if(Ho(e))return new t(L(e,ca),L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a));if(!bo(e))return function(e){let{years:t,months:n,weeks:r,days:i,hours:a,minutes:o,seconds:s,milliseconds:c,microseconds:l,nanoseconds:u}=function(e){let t=oo.exec(e);if(!t||t.every(((e,t)=>t<2||e===void 0)))throw RangeError(`invalid duration: ${e}`);let n=t[1]===`-`?-1:1,r=t[2]===void 0?0:Co(t[2])*n,i=t[3]===void 0?0:Co(t[3])*n,a=t[4]===void 0?0:Co(t[4])*n,o=t[5]===void 0?0:Co(t[5])*n,s=t[6]===void 0?0:Co(t[6])*n,c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=0,m=0,h=0;if(c!==void 0){if(l??u??d??f)throw RangeError(`only the smallest unit can be fractional`);h=3600*Co((c+`000000000`).slice(0,9))*n}else if(p=l===void 0?0:Co(l)*n,u!==void 0){if(d??f)throw RangeError(`only the smallest unit can be fractional`);h=60*Co((u+`000000000`).slice(0,9))*n}else m=d===void 0?0:Co(d)*n,f!==void 0&&(h=Co((f+`000000000`).slice(0,9))*n);let g=h%1e3,_=Math.trunc(h/1e3)%1e3,v=Math.trunc(h/1e6)%1e3;return m+=Math.trunc(h/1e9)%60,p+=Math.trunc(h/6e10),hl(r,i,a,o,s,p,m,v,_,g),{years:r,months:i,weeks:a,days:o,hours:s,minutes:p,seconds:m,milliseconds:v,microseconds:_,nanoseconds:g}}(e);return new(Ra(`%Temporal.Duration%`))(t,n,r,i,a,o,s,c,l,u)}(Do(e));let n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=cs(e);for(let e=0;e<Lo.length;e++){let t=Lo[e],i=r[t];i!==void 0&&(n[t]=i)}return new t(n.years,n.months,n.weeks,n.days,n.hours,n.minutes,n.seconds,n.milliseconds,n.microseconds,n.nanoseconds)}function Is(e){let t;if(bo(e)){if(Vo(e)||Jo(e))return ec(L(e,$i));t=Oo(e)}else t=e;let{year:n,month:r,day:i,time:a,offset:o,z:s}=function(e){let t=Qo(e);if(!t.z&&!t.offset)throw RangeError(`Temporal.Instant requires a time zone offset`);return t}(Do(t)),{hour:c=0,minute:l=0,second:u=0,millisecond:d=0,microsecond:f=0,nanosecond:p=0}=a===`start-of-day`?{}:a,m=el(n,r,i,c,l,u,d,f,p-(s?0:Pc(o)));return Sl(m.isoDate),ec(Hc(m))}function Ls(e,t){if(bo(e)){if(qo(e))return ds(ou(t)),Js(L(e,ea),L(e,ra));let n;return Na(e,ra)?n=L(e,ra):(n=e.calendar,n===void 0&&(n=`iso8601`),n=sc(n)),Js(fc(n,As(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),ds(ou(t))),n)}let{month:n,day:r,referenceISOYear:i,calendar:a}=ts(Do(e));if(a===void 0&&(a=`iso8601`),a=lu(a),ds(ou(t)),a===`iso8601`)return Js({year:1972,month:n,day:r},a);let o={year:i,month:n,day:r};return cl(o),o=fc(a,ks(a,o,`month-day`),`constrain`),Js(o,a)}function Rs(e,t){let n;if(bo(e)){if(Wo(e))return ds(ou(t)),Xs(L(e,na));if(Go(e))return ds(ou(t)),Xs(L(e,ta).time);if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Xs(n.time)}let{hour:r,minute:i,second:a,millisecond:o,microsecond:s,nanosecond:c}=js(e);n=ss(r,i,a,o,s,c,ds(ou(t)))}else n=$o(Do(e)),ds(ou(t));return Xs(n)}function zs(e){return e===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:L(Rs(e),na)}function Bs(e,t){if(bo(e)){if(Ko(e))return ds(ou(t)),Qs(L(e,ea),L(e,ra));let n=cc(e);return Qs(dc(n,As(n,e,[`year`,`month`,`monthCode`],[],[]),ds(ou(t))),n)}let{year:n,month:r,referenceISODay:i,calendar:a}=es(Do(e));a===void 0&&(a=`iso8601`),a=lu(a),ds(ou(t));let o={year:n,month:r,day:i};return ml(o),o=dc(a,ks(a,o,`year-month`),`constrain`),Qs(o,a)}function Vs(e,t,n,r,i,a,o,s){if(t===`start-of-day`)return xc(i,e);let c=us(e,t);if(n===`wall`||o===`ignore`)return vc(i,c,a);if(n===`exact`||o===`use`){let n=el(e.year,e.month,e.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Sl(n.isoDate);let i=Hc(n);return pl(i),i}Sl(e);let l=Hc(c),u=bc(i,c);for(let e=0;e<u.length;e++){let t=u[e],n=I.default.toNumber(I.default.subtract(l,t)),i=Wl(n,6e10,`halfExpand`);if(n===r||s&&i===r)return t}if(o===`reject`){let e=gc(r),t=kc(c,`iso8601`,`auto`);throw RangeError(`Offset ${e} is invalid for ${t} in ${i}`)}return yc(u,i,c,a)}function Hs(e,t){let n,r,i,a,o,s,c,l=!1,u=`option`;if(bo(e)){if(Jo(e)){let n=ou(t);return fs(n),ms(n,`reject`),ds(n),nc(L(e,$i),L(e,sa),L(e,ra))}o=cc(e);let l=As(o,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[`timeZone`]);({offset:a,timeZone:i}=l),a===void 0&&(u=`wall`);let d=ou(t);s=fs(d),c=ms(d,`reject`);let f=ds(d);({isoDate:n,time:r}=Ns(o,l,f))}else{let d,f,p,m,h;({year:p,month:m,day:h,time:r,tzAnnotation:d,offset:a,z:f,calendar:o}=function(e){let t=Qo(e);if(!t.tzAnnotation)throw RangeError(`Temporal.ZonedDateTime requires a time zone ID in brackets`);return t}(Do(e))),i=pc(d),f?u=`exact`:a||(u=`wall`),o||=`iso8601`,o=lu(o),l=!0;let g=ou(t);s=fs(g),c=ms(g,`reject`),ds(g),n={year:p,month:m,day:h}}let d=0;return u===`option`&&(d=Pc(a)),nc(Vs(n,r,u,d,i,s,c,l),i,o)}function Us(e,t,n){cl(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,ia,!0)}function Ws(e,t){let n=Ra(`%Temporal.PlainDate%`),r=Object.create(n.prototype);return Us(r,e,t),r}function Gs(e,t,n){dl(t),Ma(e),Pa(e,ta,t),Pa(e,ra,n)}function Ks(e,t){let n=Ra(`%Temporal.PlainDateTime%`),r=Object.create(n.prototype);return Gs(r,e,t),r}function qs(e,t,n){cl(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,oa,!0)}function Js(e,t){let n=Ra(`%Temporal.PlainMonthDay%`),r=Object.create(n.prototype);return qs(r,e,t),r}function Ys(e,t){Ma(e),Pa(e,na,t)}function Xs(e){let t=Ra(`%Temporal.PlainTime%`),n=Object.create(t.prototype);return Ys(n,e),n}function Zs(e,t,n){ml(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,aa,!0)}function Qs(e,t){let n=Ra(`%Temporal.PlainYearMonth%`),r=Object.create(n.prototype);return Zs(r,e,t),r}function $s(e,t){pl(t),Ma(e),Pa(e,$i,t)}function ec(e){let t=Ra(`%Temporal.Instant%`),n=Object.create(t.prototype);return $s(n,e),n}function tc(e,t,n,r){pl(t),Ma(e),Pa(e,$i,t),Pa(e,sa,n),Pa(e,ra,r)}function nc(e,t,n=`iso8601`){let r=Ra(`%Temporal.ZonedDateTime%`),i=Object.create(r.prototype);return tc(i,e,t,n),i}function rc(e){return ko.filter((t=>e[t]!==void 0))}function ic(e,t,n){let r=rc(n),i=Ds(e).fieldKeysToIgnore(r),a=Object.create(null),o=rc(t);for(let e=0;e<ko.length;e++){let s,c=ko[e];o.includes(c)&&!i.includes(c)&&(s=t[c]),r.includes(c)&&(s=n[c]),s!==void 0&&(a[c]=s)}return a}function ac(e,t,n,r){let i=Ds(e).dateAdd(t,n,r);return cl(i),i}function oc(e,t,n,r){return Ds(e).dateUntil(t,n,r)}function sc(e){if(bo(e)&&Na(e,ra))return L(e,ra);let t=Do(e);try{return lu(t)}catch{}let n;try{({calendar:n}=Qo(t))}catch{try{({calendar:n}=$o(t))}catch{try{({calendar:n}=es(t))}catch{({calendar:n}=ts(t))}}}return n||=`iso8601`,lu(n)}function cc(e){if(Na(e,ra))return L(e,ra);let{calendar:t}=e;return t===void 0?`iso8601`:sc(t)}function lc(e,t){return lu(e)===lu(t)}function uc(e,t,n){let r=Ds(e);r.resolveFields(t,`date`);let i=r.dateToISO(t,n);return cl(i),i}function dc(e,t,n){let r=Ds(e);r.resolveFields(t,`year-month`),t.day=1;let i=r.dateToISO(t,n);return ml(i),i}function fc(e,t,n){let r=Ds(e);r.resolveFields(t,`month-day`);let i=r.monthDayToISOReferenceDate(t,n);return cl(i),i}function pc(e){if(bo(e)&&Jo(e))return L(e,sa);let t=Do(e);if(t===`UTC`)return`UTC`;let{tzName:n,offsetMinutes:r}=function(e){let{tzAnnotation:t,offset:n,z:r}=function(e){if(ns.test(e))return{tzAnnotation:e,offset:void 0,z:!1};try{let{tzAnnotation:t,offset:n,z:r}=Qo(e);if(r||t||n)return{tzAnnotation:t,offset:n,z:r}}catch{}is(e)}(e);return t?as(t):r?as(`UTC`):n?as(n):void 0}(t);if(r!==void 0)return zc(r);let i=Ic(n);if(!i)throw RangeError(`Unrecognized time zone ${n}`);return i.identifier}function mc(e,t){if(e===t)return!0;let n=as(e).offsetMinutes,r=as(t).offsetMinutes;if(n===void 0&&r===void 0){let n=Ic(t);if(!n)return!1;let r=Ic(e);return!!r&&r.primaryIdentifier===n.primaryIdentifier}return n===r}function hc(e,t){let n=as(e).offsetMinutes;return n===void 0?Rc(e,t):6e10*n}function gc(e){let t=e<0?`-`:`+`,n=Math.abs(e),r=Math.floor(n/36e11),i=Math.floor(n/6e10)%60,a=Math.floor(n/1e9)%60,o=n%1e9;return`${t}${Tc(r,i,a,o,a===0&&o===0?`minute`:`auto`)}`}function _c(e,t){let n=hc(e,t),{isoDate:{year:r,month:i,day:a},time:{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d}}=Uc(t);return el(r,i,a,o,s,c,l,u,d+n)}function vc(e,t,n){return yc(bc(e,t),e,t,n)}function yc(e,t,n,r){let i=e.length;if(i===1)return e[0];if(i)switch(r){case`compatible`:case`earlier`:return e[0];case`later`:return e[i-1];case`reject`:throw RangeError(`multiple instants found`)}if(r===`reject`)throw RangeError(`multiple instants found`);let a=Hc(n),o=I.default.subtract(a,Gi);pl(o);let s=hc(t,o),c=I.default.add(a,Gi);pl(c);let l=hc(t,c)-s;switch(r){case`earlier`:{let e=Ua.fromComponents(0,0,0,0,0,-l),r=Pl(n.time,e);return bc(t,us($c(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r))[0]}case`compatible`:case`later`:{let e=Ua.fromComponents(0,0,0,0,0,l),r=Pl(n.time,e),i=bc(t,us($c(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r));return i[i.length-1]}}}function bc(e,t){if(e===`UTC`)return Sl(t.isoDate),[Hc(t)];let n=as(e).offsetMinutes;if(n!==void 0){let e=el(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-n,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);Sl(e.isoDate);let r=Hc(e);return pl(r),[r]}return Sl(t.isoDate),function(e,t){let n=Hc(t),r=I.default.subtract(n,Gi);I.default.lessThan(r,fo)&&(r=n);let i=I.default.add(n,Gi);I.default.greaterThan(i,uo)&&(i=n);let a=Rc(e,r),o=Rc(e,i);return(a===o?[a]:[a,o]).map((r=>{let i=I.default.subtract(n,I.default.BigInt(r));if(Ql(t,function(e,t){let{epochMilliseconds:n,time:{millisecond:r,microsecond:i,nanosecond:a}}=Uc(t),{year:o,month:s,day:c,hour:l,minute:u,second:d}=Kc(e,n);return el(o,s,c,l,u,d,r,i,a)}(e,i))===0)return pl(i),i})).filter((e=>e!==void 0))}(e,t)}function xc(e,t){let n=us(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=bc(e,n);if(r.length)return r[0];let i=Hc(n),a=I.default.subtract(i,Gi);return pl(a),Wc(e,a)}function Sc(e){let t;return t=e<0||e>9999?(e<0?`-`:`+`)+Eo(Math.abs(e),6):Eo(e,4),t}function Cc(e){return Eo(e,2)}function wc(e,t){let n;if(t===`auto`){if(e===0)return``;n=Eo(e,9).replace(/0+$/,``)}else{if(t===0)return``;n=Eo(e,9).slice(0,t)}return`.${n}`}function Tc(e,t,n,r,i){let a=`${Cc(e)}:${Cc(t)}`;return i===`minute`||(a+=`:${Cc(n)}`,a+=wc(r,i)),a}function eee(e,t,n){let r=t;r===void 0&&(r=`UTC`);let i=L(e,$i),a=kc(_c(r,i),`iso8601`,n,`never`),o=`Z`;return t!==void 0&&(o=Bc(hc(r,i))),`${a}${o}`}function Ec(e,t){let n=L(e,ca),r=L(e,la),i=L(e,ua),a=L(e,da),o=L(e,fa),s=L(e,pa),c=Yc(e),l=``;n!==0&&(l+=`${Math.abs(n)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),a!==0&&(l+=`${Math.abs(a)}D`);let u=``;o!==0&&(u+=`${Math.abs(o)}H`),s!==0&&(u+=`${Math.abs(s)}M`);let d=Ua.fromComponents(0,0,L(e,ma),L(e,ha),L(e,ga),L(e,_a));d.isZero()&&![`second`,`millisecond`,`microsecond`,`nanosecond`].includes(Cs(e))&&t===`auto`||(u+=`${Math.abs(d.sec)}${wc(Math.abs(d.subsec),t)}S`);let f=`${c<0?`-`:``}P${l}`;return u&&(f=`${f}T${u}`),f}function Dc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea);return`${Sc(n)}-${Cc(r)}-${Cc(i)}${Xo(L(e,ra),t)}`}function Oc({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){return Tc(e,t,n,1e6*r+1e3*i+a,o)}function kc(e,t,n,r=`auto`){let{isoDate:{year:i,month:a,day:o},time:{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}=e;return`${Sc(i)}-${Cc(a)}-${Cc(o)}T${Tc(s,c,l,1e6*u+1e3*d+f,n)}${Xo(t,r)}`}function Ac(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea),a=`${Cc(r)}-${Cc(i)}`,o=L(e,ra);t!==`always`&&t!==`critical`&&o===`iso8601`||(a=`${Sc(n)}-${a}`);let s=Xo(o,t);return s&&(a+=s),a}function jc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea),a=`${Sc(n)}-${Cc(r)}`,o=L(e,ra);t!==`always`&&t!==`critical`&&o===`iso8601`||(a+=`-${Cc(i)}`);let s=Xo(o,t);return s&&(a+=s),a}function Mc(e,t,n=`auto`,r=`auto`,i=`auto`,a=void 0){let o=L(e,$i);if(a){let{unit:e,increment:t,roundingMode:n}=a;o=Gl(o,t,e,n)}let s=L(e,sa),c=hc(s,o),l=kc(_c(s,o),`iso8601`,t,`never`);return i!==`never`&&(l+=Bc(c)),r!==`never`&&(l+=`[${r===`critical`?`!`:``}${s}]`),l+=Xo(L(e,ra),n),l}function Nc(e){return rs.test(e)}function Pc(e){let t=cee.exec(e);if(!t)throw RangeError(`invalid time zone offset: ${e}; must match ±HH:MM[:SS.SSSSSSSSS]`);return(t[1]===`-`?-1:1)*(1e9*(60*(60*t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+`000000000`).slice(0,9))}let Fc;const tee=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function Ic(e){if(Fc===void 0){let e=Intl.supportedValuesOf?.(`timeZone`);if(e){Fc=new Map;for(let t=0;t<e.length;t++){let n=e[t];Fc.set(uu(n),n)}}else Fc=null}let t=uu(e),n=Fc?.get(t);if(n)return{identifier:n,primaryIdentifier:n};try{n=Bo(e).resolvedOptions().timeZone}catch{return}if(t===`antarctica/south_pole`&&(n=`Antarctica/McMurdo`),yo.has(e))throw RangeError(`${e} is a legacy time zone identifier from ICU. Use ${n} instead`);let r=[...t].map(((e,n)=>n===0||tee[t[n-1]]?e.toUpperCase():e)).join(``).split(`/`);if(r.length===1)return t===`gb-eire`?{identifier:`GB-Eire`,primaryIdentifier:n}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:n};if(r[0]===`Etc`)return{identifier:`Etc/${[`Zulu`,`Greenwich`,`Universal`].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if(r[0]===`Us`)return{identifier:`US/${r[1]}`,primaryIdentifier:n};let i=new Map([[`Act`,`ACT`],[`Lhi`,`LHI`],[`Nsw`,`NSW`],[`Dar_Es_Salaam`,`Dar_es_Salaam`],[`Port_Of_Spain`,`Port_of_Spain`],[`Port-Au-Prince`,`Port-au-Prince`],[`Isle_Of_Man`,`Isle_of_Man`],[`Comodrivadavia`,`ComodRivadavia`],[`Knox_In`,`Knox_IN`],[`Dumontdurville`,`DumontDUrville`],[`Mcmurdo`,`McMurdo`],[`Denoronha`,`DeNoronha`],[`Easterisland`,`EasterIsland`],[`Bajanorte`,`BajaNorte`],[`Bajasur`,`BajaSur`]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join(`/`),primaryIdentifier:n}}function Lc(e,t){let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Kc(e,t),c=t%1e3;return c<0&&(c+=1e3),1e6*(Vc({isoDate:{year:n,month:r,day:i},time:{hour:a,minute:o,second:s,millisecond:c}})-t)}function Rc(e,t){return Lc(e,eu(t,`floor`))}function zc(e){let t=e<0?`-`:`+`,n=Math.abs(e);return`${t}${Tc(Math.floor(n/60),n%60,0,0,`minute`)}`}function Bc(e){return zc(Wl(e,6e10,`halfExpand`)/6e10)}function Vc({isoDate:{year:e,month:t,day:n},time:{hour:r,minute:i,second:a,millisecond:o}}){let s=e%400,c=(e-s)/400,l=new Date;return l.setUTCHours(r,i,a,o),l.setUTCFullYear(s,t-1,n),l.getTime()+0xb7af85d9c00*c}function Hc(e){let t=Vc(e),n=1e3*e.time.microsecond+e.time.nanosecond;return I.default.add(tu(t),I.default.BigInt(n))}function Uc(e){let t=eu(e,`trunc`),n=I.default.toNumber(I.default.remainder(e,Vi));n<0&&(n+=1e6,--t);let r=Math.floor(n/1e3)%1e3,i=n%1e3,a=new Date(t);return{epochMilliseconds:t,isoDate:{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate()},time:{hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function Wc(e,t){if(e===`UTC`)return null;let n=eu(t,`floor`);if(n<_o)return Wc(e,tu(_o));let r=Date.now(),i=Math.max(n,r)+366*so*3,a=n,o=Lc(e,a),s=a,c=o;for(;o===c&&a<i;){if(s=a+2*so*7,s>lo)return null;c=Lc(e,s),o===c&&(a=s)}return o===c?null:tu(fu((t=>Lc(e,t)),a,s,o,c))}function Gc(e,t){if(e===`UTC`)return null;let n=eu(t,`ceil`),r=Date.now(),i=r+366*so*3;if(n>i){let t=Gc(e,tu(i));if(t===null||I.default.lessThan(t,tu(r)))return t}if(e===`Africa/Casablanca`||e===`Africa/El_Aaiun`){let t=Date.UTC(2088,0,1);if(t<n)return Gc(e,tu(t))}let a=n-1;if(a<_o)return null;let o=Lc(e,a),s=a,c=o;for(;o===c&&a>_o;){if(s=a-2*so*7,s<_o)return null;c=Lc(e,s),o===c&&(a=s)}return o===c?null:tu(fu((t=>Lc(e,t)),s,a,c,o))}function Kc(e,t){return function(e){let t=e.split(/[^\w]+/);if(t.length!==7)throw RangeError(`expected 7 parts in "${e}`);let n=+t[0],r=+t[1],i=+t[2],a=t[3];if(a[0]===`b`||a[0]===`B`)i=1-i;else if(a[0]!==`a`&&a[0]!==`A`)throw RangeError(`Unknown era ${a} in "${e}`);let o=t[4]===`24`?0:+t[4],s=+t[5],c=+t[6];if(!(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)&&Number.isFinite(c)))throw RangeError(`Invalid number in "${e}`);return{year:i,month:n,day:r,hour:o,minute:s,second:c}}(Bo(e).format(t))}function qc(e){return e!==void 0&&!(e%4!=0||e%100==0&&e%400!=0)}function Jc(e,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[qc(e)?`leapyear`:`standard`][t-1]}function Yc(e){let t=[L(e,ca),L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a)];for(let e=0;e<t.length;e++){let n=t[e];if(n!==0)return n<0?-1:1}return 0}function Xc(e){let t=[`years`,`months`,`weeks`,`days`];for(let n=0;n<t.length;n++){let r=e[t[n]];if(r!==0)return r<0?-1:1}return 0}function Zc(e){let t=Xc(e.date);return t===0?e.time.sign():t}function Qc(e,t){let n=e,r=t;if(!Number.isFinite(n)||!Number.isFinite(r))throw RangeError(`infinity is out of range`);return--r,n+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:n,month:r}}function $c(e,t,n){let r=e,i=t,a=n;if(!Number.isFinite(a))throw RangeError(`infinity is out of range`);({year:r,month:i}=Qc(r,i));let o=146097;if(Math.abs(a)>o){let e=Math.trunc(a/o);r+=400*e,a-=e*o}let s=0,c=i>2?r:r-1;for(;s=qc(c)?366:365,a<-s;)--r,--c,a+=s;for(c+=1;s=qc(c)?366:365,a>s;)r+=1,c+=1,a-=s;for(;a<1;)({year:r,month:i}=Qc(r,i-1)),a+=Jc(r,i);for(;a>Jc(r,i);)a-=Jc(r,i),{year:r,month:i}=Qc(r,i+1);return{year:r,month:i,day:a}}function el(e,t,n,r,i,a,o,s,c){let l=tl(r,i,a,o,s,c);return us($c(e,t,n+l.deltaDays),l)}function tl(e,t,n,r,i,a){let o,s=e,c=t,l=n,u=r,d=i,f=a;({div:o,mod:f}=za(f,3)),d+=o,f<0&&(--d,f+=1e3),{div:o,mod:d}=za(d,3),u+=o,d<0&&(--u,d+=1e3),l+=Math.trunc(u/1e3),u%=1e3,u<0&&(--l,u+=1e3),c+=Math.trunc(l/60),l%=60,l<0&&(--c,l+=60),s+=Math.trunc(c/60),c%=60,c<0&&(--s,c+=60);let p=Math.trunc(s/24);return s%=24,s<0&&(--p,s+=24),p+=0,s+=0,c+=0,l+=0,u+=0,d+=0,f+=0,{deltaDays:p,hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function nl(e,t){let n=ls(e,0);if(Xc(n)===0)return e.days;let r=L(t,ea),i=ac(L(t,ra),r,n,`constrain`),a=xl(r.year,r.month-1,r.day),o=xl(i.year,i.month-1,i.day)-a;return e.days+o}function rl(e){return new(Ra(`%Temporal.Duration%`))(-L(e,ca),-L(e,la),-L(e,ua),-L(e,da),-L(e,fa),-L(e,pa),-L(e,ma),-L(e,ha),-L(e,ga),-L(e,_a))}function il(e,t,n){return Math.min(n,Math.max(t,e))}function al(e,t,n){let r=il(t,1,12);return{year:e,month:r,day:il(n,1,Jc(e,r))}}function ol(e,t,n){if(e<t||e>n)throw RangeError(`value out of range: ${t} <= ${e} <= ${n}`)}function sl(e,t,n){ol(t,1,12),ol(n,1,Jc(e,t))}function cl(e){dl(us(e,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function ll(e,t,n,r,i,a){ol(e,0,23),ol(t,0,59),ol(n,0,59),ol(r,0,999),ol(i,0,999),ol(a,0,999)}function ul(e,t,n,r,i,a,o,s,c){sl(e,t,n),ll(r,i,a,o,s,c)}function dl(e){let t=Hc(e);(I.default.lessThan(t,po)||I.default.greaterThan(t,mo))&&pl(t)}function fl(e){Hc(e)}function pl(e){if(I.default.lessThan(e,fo)||I.default.greaterThan(e,uo))throw RangeError(`date/time value is outside of supported range`)}function ml({year:e,month:t}){ol(e,ho,go),e===ho?ol(t,4,12):e===go&&ol(t,1,9)}function hl(e,t,n,r,i,a,o,s,c,l){let u=0,d=[e,t,n,r,i,a,o,s,c,l];for(let e=0;e<d.length;e++){let t=d[e];if(t===1/0||t===-1/0)throw RangeError(`infinite values not allowed as duration fields`);if(t!==0){let e=t<0?-1:1;if(u!==0&&e!==u)throw RangeError(`mixed-sign values not allowed as duration fields`);u=e}}if(Math.abs(e)>=2**32||Math.abs(t)>=2**32||Math.abs(n)>=2**32)throw RangeError(`years, months, and weeks must be < 2³²`);let f=za(s,3),p=za(c,6),m=za(l,9),h=za(1e6*f.mod+1e3*p.mod+m.mod,9).div,g=86400*r+3600*i+60*a+o+f.div+p.div+m.div+h;if(!Number.isSafeInteger(g))throw RangeError(`total of duration time units cannot exceed 9007199254740991.999999999 s`)}function gl(e){return{date:{years:L(e,ca),months:L(e,la),weeks:L(e,ua),days:L(e,da)},time:Ua.fromComponents(L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a))}}function _l(e){let t=Ua.fromComponents(L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a)).add24HourDays(L(e,da));return{date:{years:L(e,ca),months:L(e,la),weeks:L(e,ua),days:0},time:t}}function vl(e){let t=_l(e),n=Math.trunc(t.time.sec/86400);return hl(t.date.years,t.date.months,t.date.weeks,n,0,0,0,0,0,0),{...t.date,days:n}}function yl(e,t){let n=e.time.sign(),r=e.time.abs().subsec,i=0,a=0,o=e.time.abs().sec,s=0,c=0,l=0;switch(t){case`year`:case`month`:case`week`:case`day`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60,l=Math.trunc(c/24),c%=24;break;case`hour`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60;break;case`minute`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60;break;case`second`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3;break;case`millisecond`:i=Math.trunc(r/1e3),r%=1e3,a=Ba(o,3,Math.trunc(i/1e3)),i%=1e3,o=0;break;case`microsecond`:i=Ba(o,6,Math.trunc(r/1e3)),r%=1e3,o=0;break;case`nanosecond`:r=Ba(o,9,r),o=0}return new(Ra(`%Temporal.Duration%`))(e.date.years,e.date.months,e.date.weeks,e.date.days+n*l,n*c,n*s,n*o,n*a,n*i,n*r)}function bl(e,t){return Xc(e),t.sign(),{date:e,time:t}}function xl(e,t,n){return Vc({isoDate:{year:e,month:t+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/so}function Sl({year:e,month:t,day:n}){if(Math.abs(xl(e,t-1,n))>1e8)throw RangeError(`date/time value is outside the supported range`)}function Cl(e,t){let n=t.hour-e.hour,r=t.minute-e.minute,i=t.second-e.second,a=t.millisecond-e.millisecond,o=t.microsecond-e.microsecond,s=t.nanosecond-e.nanosecond;return Ua.fromComponents(n,r,i,a,o,s)}function wl(e,t,n,r,i){let a=Ua.fromEpochNsDiff(t,e);return a=Jl(a,n,r,i),bl({years:0,months:0,weeks:0,days:0},a)}function Tl(e,t,n,r){fl(e),fl(t);let i=Cl(e.time,t.time),a=i.sign(),o=Xl(e.isoDate,t.isoDate),s=t.isoDate;o===a&&(s=$c(s.year,s.month,s.day+a),i=i.add24HourDays(-a));let c=ws(`day`,r),l=oc(n,e.isoDate,s,c);return r!==c&&(i=i.add24HourDays(l.days),l.days=0),bl(l,i)}function El(e,t,n,r,i){let a=I.default.subtract(t,e);if(I.default.equal(a,Pi))return{date:{years:0,months:0,weeks:0,days:0},time:Ua.ZERO};let o=I.default.lessThan(a,Pi)?-1:1,s=_c(n,e),c=_c(n,t),l,u=0,d=o===1?2:1,f=Cl(s.time,c.time);for(f.sign()===-o&&u++;u<=d;u++){l=us($c(c.isoDate.year,c.isoDate.month,c.isoDate.day-u*o),s.time);let e=vc(n,l,`compatible`);if(f=Ua.fromEpochNsDiff(t,e),f.sign()!==-o)break}let p=ws(`day`,i);return bl(oc(r,s.isoDate,l.isoDate,p),f)}function Dl(e,t,n,r,i,a,o,s,c){let l,u,d,f,p=t;switch(s){case`year`:{let t=Wl(p.date.years,o,`trunc`);l=t,u=t+o*e,d={years:l,months:0,weeks:0,days:0},f={...d,years:u};break}case`month`:{let t=Wl(p.date.months,o,`trunc`);l=t,u=t+o*e,d=ls(p.date,0,0,l),f=ls(p.date,0,0,u);break}case`week`:{let t=ls(p.date,0,0),n=ac(a,r.isoDate,t,`constrain`),i=oc(a,n,$c(n.year,n.month,n.day+p.date.days),`week`),s=Wl(p.date.weeks+i.weeks,o,`trunc`);l=s,u=s+o*e,d=ls(p.date,0,l),f=ls(p.date,0,u);break}case`day`:{let t=Wl(p.date.days,o,`trunc`);l=t,u=t+o*e,d=ls(p.date,l),f=ls(p.date,u);break}}let m=ac(a,r.isoDate,d,`constrain`),h=ac(a,r.isoDate,f,`constrain`),g,_,v=us(m,r.time),y=us(h,r.time);i?(g=vc(i,v,`compatible`),_=vc(i,y,`compatible`)):(g=Hc(v),_=Hc(y));let b=Ua.fromEpochNsDiff(n,g),x=Ua.fromEpochNsDiff(_,g),S=Va(c,e<0?`negative`:`positive`),C=b.add(b).abs().subtract(x.abs()).sign(),w=Math.abs(l)/o%2==0,T=b.isZero()?Math.abs(l):b.cmp(x)?Ha(Math.abs(l),Math.abs(u),C,w,S):Math.abs(u),E=new Ua(I.default.add(I.default.multiply(x.totalNs,I.default.BigInt(l)),I.default.multiply(b.totalNs,I.default.BigInt(o*e)))).fdiv(x.totalNs),ee=T===Math.abs(u);return p={date:ee?f:d,time:Ua.ZERO},{nudgeResult:{duration:p,nudgedEpochNs:ee?_:g,didExpandCalendarUnit:ee},total:E}}function Ol(e,t,n,r,i,a,o,s,c){let l=e,u=Ts(s)||r&&s===`day`,d=Zc(l)<0?-1:1,f;return u?{nudgeResult:f}=Dl(d,l,t,n,r,i,o,s,c):f=r?function(e,t,n,r,i,a,o,s){let c=t,l=ac(i,n.isoDate,c.date,`constrain`),u=us(l,n.time),d=us($c(l.year,l.month,l.day+e),n.time),f=vc(r,u,`compatible`),p=vc(r,d,`compatible`),m=Ua.fromEpochNsDiff(p,f);if(m.sign()!==e)throw RangeError(`time zone returned inconsistent Instants`);let h=I.default.BigInt(Io[o]*a),g=c.time.round(h,s),_=g.subtract(m),v=_.sign()!==-e,y,b;return v?(y=e,g=_.round(h,s),b=g.addToEpochNs(p)):(y=0,b=g.addToEpochNs(f)),{duration:bl(ls(c.date,c.date.days+y),g),nudgedEpochNs:b,didExpandCalendarUnit:v}}(d,l,n,r,i,o,s,c):function(e,t,n,r,i,a){let o=e,s=o.time.add24HourDays(o.date.days),c=s.round(I.default.BigInt(r*Io[i]),a),l=c.subtract(s),{quotient:u}=s.divmod(co),{quotient:d}=c.divmod(co),f=Math.sign(d-u)===s.sign(),p=l.addToEpochNs(t),m=0,h=c;return Es(n)===`date`&&(m=d,h=c.add(Ua.fromComponents(24*-d,0,0,0,0,0))),{duration:{date:ls(o.date,m),time:h},nudgedEpochNs:p,didExpandCalendarUnit:f}}(l,t,a,o,s,c),l=f.duration,f.didExpandCalendarUnit&&s!==`week`&&(l=function(e,t,n,r,i,a,o,s){let c=t;if(s===o)return c;let l=Fo.indexOf(o);for(let t=Fo.indexOf(s)-1;t>=l;t--){let s=Fo[t];if(s===`week`&&o!==`week`)continue;let l;switch(s){case`year`:l={years:c.date.years+e,months:0,weeks:0,days:0};break;case`month`:{let t=c.date.months+e;l=ls(c.date,0,0,t);break}case`week`:{let t=c.date.weeks+e;l=ls(c.date,0,t);break}}let u=us(ac(a,r.isoDate,l,`constrain`),r.time),d;if(d=i?vc(i,u,`compatible`):Hc(u),Yi(n,d)===-e)break;c={date:l,time:Ua.ZERO}}return c}(d,l,f.nudgedEpochNs,n,r,i,a,ws(s,`day`))),l}function kl(e,t,n,r,i,a){return Ts(a)||r&&a===`day`?Dl(Zc(e)<0?-1:1,e,t,n,r,i,1,a,`trunc`).total:Yl(e.time.add24HourDays(e.date.days),a)}function Al(e,t,n,r,i,a,o){if(Ql(e,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Ua.ZERO};dl(e),dl(t);let s=Tl(e,t,n,r);return a===`nanosecond`&&i===1?s:Ol(s,Hc(t),e,null,n,r,i,a,o)}function jl(e,t,n,r,i,a,o,s){if(Es(i)===`time`)return wl(e,t,a,o,s);let c=El(e,t,n,r,i);return o===`nanosecond`&&a===1?c:Ol(c,t,_c(n,e),n,r,i,a,o,s)}function Ml(e,t,n,r,i,a){let o=Mo.reduce(((e,t)=>{let i=t[0],a=t[1],o=t[2];return n!==`datetime`&&o!==n||r.includes(a)||e.push(a,i),e}),[]),s=xs(t,`largestUnit`,n,`auto`);if(r.includes(s))throw RangeError(`largestUnit must be one of ${o.join(`, `)}, not ${s}`);let c=gs(t),l=ps(t,`trunc`);e===`since`&&(l=function(e){switch(e){case`ceil`:return`floor`;case`floor`:return`ceil`;case`halfCeil`:return`halfFloor`;case`halfFloor`:return`halfCeil`;default:return e}}(l));let u=xs(t,`smallestUnit`,n,i);if(r.includes(u))throw RangeError(`smallestUnit must be one of ${o.join(`, `)}, not ${u}`);let d=ws(a,u);if(s===`auto`&&(s=d),ws(s,u)!==s)throw RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${u}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];return f!==void 0&&_s(c,f,!1),{largestUnit:s,roundingIncrement:c,roundingMode:l,smallestUnit:u}}function nee(e,t,n,r){let i=Is(n),a=Ml(e,ou(r),`time`,[],`nanosecond`,`second`),o=yl(wl(L(t,$i),L(i,$i),a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);return e===`since`&&(o=rl(o)),o}function ree(e,t,n,r){let i=Ms(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`date`,[],`day`,`day`),c=Ra(`%Temporal.Duration%`),l=L(t,ea),u=L(i,ea);if(Xl(l,u)===0)return new c;let d={date:oc(a,l,u,s.largestUnit),time:Ua.ZERO};if(s.smallestUnit!==`day`||s.roundingIncrement!==1){let e=us(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});d=Ol(d,Hc(us(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let f=yl(d,`day`);return e===`since`&&(f=rl(f)),f}function iee(e,t,n,r){let i=Ps(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`datetime`,[],`nanosecond`,`day`),c=Ra(`%Temporal.Duration%`),l=L(t,ta),u=L(i,ta);if(Ql(l,u)===0)return new c;let d=yl(Al(l,u,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return e===`since`&&(d=rl(d)),d}function aee(e,t,n,r){let i=Rs(n),a=Ml(e,ou(r),`time`,[],`nanosecond`,`hour`),o=Cl(L(t,na),L(i,na));o=Jl(o,a.roundingIncrement,a.smallestUnit,a.roundingMode);let s=yl(bl({years:0,months:0,weeks:0,days:0},o),a.largestUnit);return e===`since`&&(s=rl(s)),s}function oee(e,t,n,r){let i=Bs(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between months of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`date`,[`week`,`day`],`month`,`year`),c=Ra(`%Temporal.Duration%`);if(Xl(L(t,ea),L(i,ea))==0)return new c;let l=ks(a,L(t,ea),`year-month`);l.day=1;let u=uc(a,l,`constrain`),d=ks(a,L(i,ea),`year-month`);d.day=1;let f=uc(a,d,`constrain`),p={date:ls(oc(a,u,f,s.largestUnit),0,0),time:Ua.ZERO};if(s.smallestUnit!==`month`||s.roundingIncrement!==1){let e=us(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Ol(p,Hc(us(f,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let m=yl(p,`day`);return e===`since`&&(m=rl(m)),m}function Nl(e,t,n,r){let i=Hs(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`datetime`,[],`nanosecond`,`hour`),c=L(t,$i),l=L(i,$i),u=Ra(`%Temporal.Duration%`),d;if(Es(s.largestUnit)!==`date`)d=yl(wl(c,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let e=L(t,sa);if(!mc(e,L(i,sa)))throw RangeError(`When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.`);if(I.default.equal(c,l))return new u;d=yl(jl(c,l,e,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),`hour`)}return e===`since`&&(d=rl(d)),d}function Pl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){let s=n,c=a;return s+=o.sec,c+=o.subsec,tl(e,t,s,r,i,c)}function Fl(e,t){let n=t.addToEpochNs(e);return pl(n),n}function Il(e,t,n,r,i=`constrain`){if(Xc(r.date)===0)return Fl(e,r.time);let a=_c(t,e);return Fl(vc(t,us(ac(n,a.isoDate,r.date,i),a.time),`compatible`),r.time)}function Ll(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=ws(Cs(t),Cs(r));if(Ts(i))throw RangeError(`For years, months, or weeks arithmetic, use date arithmetic relative to a starting point`);let a=_l(t),o=_l(r);return yl(bl({years:0,months:0,weeks:0,days:0},a.time.add(o.time)),i)}function Rl(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=Cs(r);if(Es(i)===`date`)throw RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let a=_l(r);return ec(Fl(L(t,$i),a.time))}function zl(e,t,n,r){let i=L(t,ra),a=Fs(n);e===`subtract`&&(a=rl(a));let o=vl(a),s=ds(ou(r));return Ws(ac(i,L(t,ea),o,s),i)}function Bl(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=L(t,ra),s=_l(i),c=L(t,ta),l=Pl(c.time,s.time),u=ls(s.date,l.deltaDays);return hl(u.years,u.months,u.weeks,u.days,0,0,0,0,0,0),Ks(us(ac(o,c.isoDate,u,a),l),o)}function Vl(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=_l(r),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Pl(L(t,na),i.time);return Xs(ss(a,o,s,c,l,u,`reject`))}function Hl(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=Yc(i),s=L(t,ra),c=ks(s,L(t,ea),`year-month`);c.day=1;let l=uc(s,c,`constrain`);if(o<0){let e=ac(s,l,{months:1},`constrain`);l=$c(e.year,e.month,e.day-1)}let u=vl(i);return cl(l),Qs(dc(s,ks(s,ac(s,l,u,a),`year-month`),a),s)}function Ul(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=L(t,sa),s=L(t,ra),c=gl(i);return nc(Il(L(t,$i),o,s,c,a),o,s)}function Wl(e,t,n){let r=Math.trunc(e/t),i=e%t,a=e<0?`negative`:`positive`,o=Math.abs(r),s=o+1,c=au(Math.abs(2*i)-t),l=o%2==0,u=Va(n,a),d=i===0?o:Ha(o,s,c,l,u);return t*(a===`positive`?d:-d)}function Gl(e,t,n,r){let i=Io[n]*t;return function(e,t,n){let r=Ki(e),i=Ki(t),a=I.default.divide(r,i),o=I.default.remainder(r,i),s=Va(n,`positive`),c,l;I.default.lessThan(r,Pi)?(c=I.default.subtract(a,Fi),l=a):(c=a,l=I.default.add(a,Fi));let u=Yi(Ji(I.default.multiply(o,Ii)),i)*(I.default.lessThan(r,Pi)?-1:1)+0,d=I.default.equal(o,Pi)?a:Ha(c,l,u,qi(c),s);return I.default.multiply(d,i)}(e,I.default.BigInt(i),r)}function Kl(e,t,n,r){fl(e);let{year:i,month:a,day:o}=e.isoDate,s=ql(e.time,t,n,r);return us($c(i,a,o+s.deltaDays),s)}function ql({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o,s,c){let l;switch(s){case`day`:case`hour`:l=1e3*(1e3*(1e3*(60*(60*e+t)+n)+r)+i)+a;break;case`minute`:l=1e3*(1e3*(1e3*(60*t+n)+r)+i)+a;break;case`second`:l=1e3*(1e3*(1e3*n+r)+i)+a;break;case`millisecond`:l=1e3*(1e3*r+i)+a;break;case`microsecond`:l=1e3*i+a;break;case`nanosecond`:l=a}let u=Io[s],d=Wl(l,u*o,c)/u;switch(s){case`day`:return{deltaDays:d,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case`hour`:return tl(d,0,0,0,0,0);case`minute`:return tl(e,d,0,0,0,0);case`second`:return tl(e,t,d,0,0,0);case`millisecond`:return tl(e,t,n,d,0,0);case`microsecond`:return tl(e,t,n,r,d,0);case`nanosecond`:return tl(e,t,n,r,i,d);default:throw Error(`Invalid unit ${s}`)}}function Jl(e,t,n,r){let i=Io[n];return e.round(I.default.BigInt(i*t),r)}function Yl(e,t){let n=Io[t];return e.fdiv(I.default.BigInt(n))}function Xl(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:au(e.day-t.day):au(e.month-t.month):au(e.year-t.year)}function Zl(e,t){return e.hour===t.hour?e.minute===t.minute?e.second===t.second?e.millisecond===t.millisecond?e.microsecond===t.microsecond?e.nanosecond===t.nanosecond?0:au(e.nanosecond-t.nanosecond):au(e.microsecond-t.microsecond):au(e.millisecond-t.millisecond):au(e.second-t.second):au(e.minute-t.minute):au(e.hour-t.hour)}function Ql(e,t){let n=Xl(e.isoDate,t.isoDate);return n===0?Zl(e.time,t.time):n}function $l(e){let t=nu(e);return globalThis.BigInt===void 0?t:globalThis.BigInt(t.toString(10))}function eu(e,t){let{quotient:n,remainder:r}=Xi(Ki(e),Vi),i=I.default.toNumber(n);return t===`floor`&&I.default.toNumber(r)<0&&--i,t===`ceil`&&I.default.toNumber(r)>0&&(i+=1),i}function tu(e){if(!Number.isInteger(e))throw RangeError(`epoch milliseconds must be an integer`);return I.default.multiply(I.default.BigInt(e),Vi)}function nu(e){let t=e;if(typeof e==`object`){let n=e[Symbol.toPrimitive];n&&typeof n==`function`&&(t=n.call(e,`number`))}if(typeof t==`number`)throw TypeError(`cannot convert number to bigint`);return typeof t==`bigint`?I.default.BigInt(t.toString(10)):I.default.BigInt(t)}const ru=(()=>{let e=I.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),n=I.default.BigInt(t),r=I.default.add(tu(t),e);return e=I.default.remainder(n,Vi),I.default.greaterThan(r,uo)?uo:I.default.lessThan(r,fo)?fo:r}})();function iu(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function au(e){return e<0?-1:e>0?1:e}function ou(e){if(e===void 0)return Object.create(null);if(bo(e)&&e!==null)return e;throw TypeError(`Options parameter must be an object, not `+(e===null?`null`:typeof e))}function su(e,t){let n=Object.create(null);return n[e]=t,n}function cu(e,t,n,r){let i=e[t];if(i!==void 0){if(i=So(i),!n.includes(i))throw RangeError(`${t} must be one of ${n.join(`, `)}, not ${i}`);return i}if(r===bs)throw RangeError(`${t} option is required`);return r}function lu(e){let t=uu(e);if(!vo.includes(uu(t)))throw RangeError(`invalid calendar identifier ${t}`);switch(t){case`ethiopic-amete-alem`:return`ethioaa`;case`islamicc`:return`islamic-civil`}return t}function uu(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function du(e){throw TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${e===`PlainMonthDay`?`Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))`:`Temporal.${e}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}const see=RegExp(`^${Za.source}$`),cee=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?$`);function fu(e,t,n,r=e(t),i=e(n)){let a=t,o=n,s=r,c=i;for(;o-a>1;){let t=Math.trunc((a+o)/2),n=e(t);n===s?(a=t,s=n):n===c&&(o=t,c=n)}return o}function pu(e){return[...e]}function mu(e,t){if(e!==`gregory`&&e!==`iso8601`)return;let n=gu[e],r=t.year,{dayOfWeek:i,dayOfYear:a,daysInYear:o}=n.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=n.getFirstDayOfWeek(),c=n.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,u=(i-a+7001-s)%7,d=Math.floor((a-1+u)/7);if(7-u>=c&&++d,d==0)d=function(e,t,n,r){let i=(r-e-n+1)%7;i<0&&(i+=7);let a=Math.floor((n+i-1)/7);return 7-i>=t&&++a,a}(s,c,a+n.isoToDate(n.dateAdd(t,{years:-1},`constrain`),{daysInYear:!0}).daysInYear,i),r--;else if(a>=o-5){let e=(l+o-a)%7;e<0&&(e+=7),6-e>=c&&a+7-l>o&&(d=1,r++)}return{week:d,year:r}}function hu(e,t,n,r,i){if(t!==i.year){if(e*(t-i.year)>0)return!0}else if(n!==i.month){if(e*(n-i.month)>0)return!0}else if(r!==i.day&&e*(r-i.day)>0)return!0;return!1}const gu={};function _u(e){if(!e.startsWith(`M`))throw RangeError(`Invalid month code: ${e}. Month codes must start with M.`);let t=+e.slice(1);if(Number.isNaN(t))throw RangeError(`Invalid month code: ${e}`);return t}function vu(e,t=!1){return`M${`${e}`.padStart(2,`0`)}${t?`L`:``}`}function yu(e,t=void 0,n=12){let{month:r,monthCode:i}=e;if(i===void 0){if(r===void 0)throw TypeError(`Either month or monthCode are required`);t===`reject`&&ol(r,1,n),t===`constrain`&&(r=il(r,1,n)),i=vu(r)}else{let e=_u(i);if(i!==vu(e))throw RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==e)throw RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=e,r<1||r>n)throw RangeError(`Invalid monthCode: ${i}`)}return{...e,month:r,monthCode:i}}gu.iso8601={resolveFields(e,t){if((t===`date`||t===`year-month`)&&e.year===void 0)throw TypeError(`year is required`);if((t===`date`||t===`month-day`)&&e.day===void 0)throw TypeError(`day is required`);Object.assign(e,yu(e))},dateToISO:(e,t)=>os(e.year,e.month,e.day,t),monthDayToISOReferenceDate(e,t){let{month:n,day:r}=os(e.year??1972,e.month,e.day,t);return{month:n,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];t.add(r),r===`month`?t.add(`monthCode`):r===`monthCode`&&t.add(`month`)}return pu(t)},dateAdd(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a){let{year:o,month:s,day:c}=e;return o+=t,s+=n,{year:o,month:s}=Qc(o,s),{year:o,month:s,day:c}=os(o,s,c,a),c+=i+7*r,$c(o,s,c)},dateUntil(e,t,n){let r=-Xl(e,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,a=0,o=0;if(n===`year`||n===`month`){let s=t.year-e.year;for(s!==0&&(s-=r);!hu(r,e.year+s,e.month,e.day,t);)a=s,s+=r;let c=r;for(i=Qc(e.year+a,e.month+c);!hu(r,i.year,i.month,e.day,t);)o=c,c+=r,i=Qc(i.year,i.month+r);n===`month`&&(o+=12*a,a=0)}i=Qc(e.year+a,e.month+o);let s=al(i.year,i.month,e.day),c=0,l=xl(t.year,t.month-1,t.day)-xl(s.year,s.month-1,s.day);return n===`week`&&(c=Math.trunc(l/7),l%=7),{years:a,months:o,weeks:c,days:l}},isoToDate({year:e,month:t,day:n},r){let i={era:void 0,eraYear:void 0,year:e,month:t,day:n,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=vu(t)),r.dayOfWeek){let r=t+(t<3?10:-2),a=e-(t<3?1:0),o=Math.floor(a/100),s=a-100*o,c=(n+Math.floor(2.6*r-.2)+(s+Math.floor(s/4))+(Math.floor(o/4)-2*o))%7;i.dayOfWeek=c+(c<=0?7:0)}if(r.dayOfYear){let r=n;for(let n=t-1;n>0;n--)r+=Jc(e,n);i.dayOfYear=r}return r.weekOfYear&&(i.weekOfYear=mu(`iso8601`,{year:e,month:t,day:n})),r.daysInMonth&&(i.daysInMonth=Jc(e,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=qc(e),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var bu=class e{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let n=0;for(let r of t.map.entries()){if(++n>e.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(e){let t=this.map.get(e);return t&&(this.hits++,this.report()),this.calls++,t}set(e,t){this.map.set(e,t),this.misses++,this.report()}report(){}setObject(t){if(e.objectMap.get(t))throw RangeError(`object already cached`);e.objectMap.set(t,this),this.report()}static getCacheForObject(t){let n=e.objectMap.get(t);return n||(n=new e,e.objectMap.set(t,n)),n}};function xu({isoYear:e,isoMonth:t,isoDay:n}){return`${Sc(e)}-${Cc(t)}-${Cc(n)}T00:00Z`}function Su(e,t){return{years:e.year-t.year,months:e.month-t.month,days:e.day-t.day}}bu.objectMap=new WeakMap,bu.MAX_CACHE_ENTRIES=1e3;var Cu=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:`numeric`,month:`numeric`,year:`numeric`,era:`short`,timeZone:`UTC`})),this.formatter}getCalendarParts(e){let t=this.getFormatter(),n=new Date(e);if(e===`-271821-04-19T00:00Z`){let e=t.resolvedOptions();t=new Intl.DateTimeFormat(e.locale,{...e,timeZone:`Etc/GMT+1`}),n=new Date(`-271821-04-20T00:00Z`)}try{return t.formatToParts(n)}catch{throw RangeError(`Invalid ISO date: ${e}`)}}isoToCalendarDate(e,t){let{year:n,month:r,day:i}=e,a=JSON.stringify({func:`isoToCalendarDate`,isoYear:n,isoMonth:r,isoDay:i,id:this.id}),o=t.get(a);if(o)return o;let s=xu({isoYear:n,isoMonth:r,isoDay:i}),c=this.getCalendarParts(s),l={};for(let e=0;e<c.length;e++){let{type:t,value:n}=c[e];if(t!==`year`&&t!==`relatedYear`||(this.hasEra?l.eraYear=+n:l.year=+n),t===`month`){let e=/^([0-9]*)(.*?)$/.exec(n);if(!e||e.length!=3||!e[1]&&!e[2])throw RangeError(`Unexpected month: ${n}`);if(l.month=e[1]?+e[1]:1,l.month<1)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(l.month>13)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);e[2]&&(l.monthExtra=e[2])}t===`day`&&(l.day=+n),this.hasEra&&t===`era`&&n!=null&&n!==``&&(l.era=n.split(` (`)[0].normalize(`NFD`).replace(/[^-0-9 \p{L}]/gu,``).replace(/ /g,`-`).toLowerCase())}if(this.hasEra&&l.eraYear===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let e=this.eras.find((e=>l.era===e.genericName));e&&(l.era=e.code)}if(this.reviseIntlEra){let{era:t,eraYear:n}=this.reviseIntlEra(l,e);l.era=t,l.eraYear=n}this.checkIcuBugs&&this.checkIcuBugs(e);let u=this.adjustCalendarDate(l,t,`constrain`,!0);if(u.year===void 0)throw RangeError(`Missing year converting ${JSON.stringify(e)}`);if(u.month===void 0)throw RangeError(`Missing month converting ${JSON.stringify(e)}`);if(u.day===void 0)throw RangeError(`Missing day converting ${JSON.stringify(e)}`);return t.set(a,u),[`constrain`,`reject`].forEach((n=>{let r=JSON.stringify({func:`calendarToIsoDate`,year:u.year,month:u.month,day:u.day,overflow:n,id:this.id});t.set(r,e)})),u}validateCalendarDate(e){let{month:t,year:n,day:r,eraYear:i,monthCode:a,monthExtra:o}=e;if(o!==void 0)throw RangeError("Unexpected `monthExtra` value");if(n===void 0&&i===void 0)throw TypeError(`year or eraYear is required`);if(t===void 0&&a===void 0)throw TypeError(`month or monthCode is required`);if(r===void 0)throw RangeError(`Missing day`);if(a!==void 0){if(typeof a!=`string`)throw RangeError(`monthCode must be a string, not `+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&e.era===void 0!=(e.eraYear===void 0))throw TypeError(`properties era and eraYear must be provided together`)}adjustCalendarDate(e,t=void 0,n=`constrain`,r=!1){if(this.calendarType===`lunisolar`)throw RangeError(`Override required for lunisolar calendars`);let i=e;this.validateCalendarDate(i);let a=this.monthsInYear(i,t),{month:o,monthCode:s}=i;return{month:o,monthCode:s}=yu(i,n,a),{...i,month:o,monthCode:s}}regulateMonthDayNaive(e,t,n){let r=this.monthsInYear(e,n),{month:i,day:a}=e;return t===`reject`?(ol(i,1,r),ol(a,1,this.maximumMonthLength(e))):(i=il(i,1,r),a=il(a,1,this.maximumMonthLength({...e,month:i}))),{...e,month:i,day:a}}calendarToIsoDate(e,t=`constrain`,n){let r=e,i=this.adjustCalendarDate(e,n,t,!1);i=this.regulateMonthDayNaive(i,t,n);let{year:a,month:o,day:s}=i,c=JSON.stringify({func:`calendarToIsoDate`,year:a,month:o,day:s,overflow:t,id:this.id}),l,u=n.get(c);if(u||r.year!==void 0&&r.month!==void 0&&r.day!==void 0&&(r.year!==i.year||r.month!==i.month||r.day!==i.day)&&(l=JSON.stringify({func:`calendarToIsoDate`,year:r.year,month:r.month,day:r.day,overflow:t,id:this.id}),u=n.get(l),u))return u;let d=this.estimateIsoDate({year:a,month:o,day:s}),f=e=>{let r=this.addDaysIso(d,e);if(i.day>this.minimumMonthLength(i)){let e=this.isoToCalendarDate(r,n);for(;e.month!==o||e.year!==a;){if(t===`reject`)throw RangeError(`day ${s} does not exist in month ${o} of year ${a}`);r=this.addDaysIso(r,-1),e=this.isoToCalendarDate(r,n)}}return r},p=0,m=this.isoToCalendarDate(d,n),h=Su(i,m);if(h.years!==0||h.months!==0||h.days!==0){let e=365*h.years+30*h.months+h.days;d=this.addDaysIso(d,e),m=this.isoToCalendarDate(d,n),h=Su(i,m),h.years===0&&h.months===0?d=f(h.days):p=this.compareCalendarDates(i,m)}let g=8;for(;p;){d=this.addDaysIso(d,p*g);let e=m;m=this.isoToCalendarDate(d,n);let a=p;if(p=this.compareCalendarDates(i,m),p){if(h=Su(i,m),h.years===0&&h.months===0)d=f(h.days),p=0;else if(a&&p!==a)if(g>1)g/=2;else{if(t===`reject`)throw RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...r})}`);this.compareCalendarDates(m,e)>0&&(d=this.addDaysIso(d,-1)),p=0}}}if(n.set(c,d),l&&n.set(l,d),i.year===void 0||i.month===void 0||i.day===void 0||i.monthCode===void 0||this.hasEra&&(i.era===void 0||i.eraYear===void 0))throw RangeError(`Unexpected missing property`);return d}compareCalendarDates(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:au(e.day-t.day):au(e.month-t.month):au(e.year-t.year)}regulateDate(e,t=`constrain`,n){let r=this.calendarToIsoDate(e,t,n);return this.isoToCalendarDate(r,n)}addDaysIso(e,t){return $c(e.year,e.month,e.day+t)}addDaysCalendar(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.addDaysIso(r,t);return this.isoToCalendarDate(i,n)}addMonthsCalendar(e,t,n,r){let i=e,{day:a}=i;for(let e=0,n=Math.abs(t);e<n;e++){let{month:e}=i,n=i,o=t<0?-Math.max(a,this.daysInPreviousMonth(i,r)):this.daysInMonth(i,r),s=this.calendarToIsoDate(i,`constrain`,r),c=this.addDaysIso(s,o);if(i=this.isoToCalendarDate(c,r),t>0){let t=this.monthsInYear(n,r);for(;i.month-1!=e%t;)c=this.addDaysIso(c,-1),i=this.isoToCalendarDate(c,r)}i.day!==a&&(i=this.regulateDate({...i,day:a},`constrain`,r))}if(n===`reject`&&i.day!==a)throw RangeError(`Day ${a} does not exist in resulting calendar month`);return i}addCalendar(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a,o){let{year:s,day:c,monthCode:l}=e,u=this.adjustCalendarDate({year:s+t,monthCode:l,day:c},o),d=this.addMonthsCalendar(u,n,a,o),f=i+7*r;return this.addDaysCalendar(d,f,o)}untilCalendar(e,t,n,r){let i=0,a=0,o=0,s=0;switch(n){case`day`:i=this.calendarDaysUntil(e,t,r);break;case`week`:{let n=this.calendarDaysUntil(e,t,r);i=n%7,a=(n-i)/7;break}case`month`:case`year`:{let a=this.compareCalendarDates(t,e);if(!a)return{years:0,months:0,weeks:0,days:0};let c=t.year-e.year,l=t.day-e.day;if(n===`year`&&c){let n=0;t.monthCode>e.monthCode&&(n=1),t.monthCode<e.monthCode&&(n=-1),n||=Math.sign(l),s=n*a<0?c-a:c}let u,d=s?this.addCalendar(e,{years:s},`constrain`,r):e;do o+=a,u=d,d=this.addMonthsCalendar(u,a,`constrain`,r),d.day!==e.day&&(d=this.regulateDate({...d,day:e.day},`constrain`,r));while(this.compareCalendarDates(t,d)*a>=0);o-=a,i=this.calendarDaysUntil(u,t,r);break}}return{years:s,months:o,weeks:a,days:i}}daysInMonth(e,t){let{day:n}=e,r=this.maximumMonthLength(e),i=this.minimumMonthLength(e);if(i===r)return i;let a=n<=r-i?r:i,o=this.calendarToIsoDate(e,`constrain`,t),s=this.addDaysIso(o,a),c=this.isoToCalendarDate(s,t),l=this.addDaysIso(s,-c.day);return this.isoToCalendarDate(l,t).day}daysInPreviousMonth(e,t){let{day:n,month:r,year:i}=e,a={year:r>1?i:i-1,month:r,day:1},o=r>1?r-1:this.monthsInYear(a,t);a={...a,month:o};let s=this.minimumMonthLength(a),c=this.maximumMonthLength(a);if(s===c)return c;let l=this.calendarToIsoDate(e,`constrain`,t),u=this.addDaysIso(l,-n);return this.isoToCalendarDate(u,t).day}startOfCalendarYear(e){return{year:e.year,month:1,monthCode:`M01`,day:1}}startOfCalendarMonth(e){return{year:e.year,month:e.month,day:1}}calendarDaysUntil(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.calendarToIsoDate(t,`constrain`,n);return xl(i.year,i.month-1,i.day)-xl(r.year,r.month-1,r.day)}monthDaySearchStartYear(e,t){return 1972}monthDayFromFields(e,t,n){let r,i,a,o,s,{era:c,eraYear:l,year:u,month:d,monthCode:f,day:p}=e;if(d!==void 0&&u===void 0&&(!this.hasEra||c===void 0||l===void 0))throw TypeError(`when month is present, year (or era and eraYear) are required`);(f===void 0||u!==void 0||this.hasEra&&l!==void 0)&&({monthCode:f,day:p}=this.isoToCalendarDate(this.calendarToIsoDate(e,t,n),n));let m={year:this.monthDaySearchStartYear(f,p),month:12,day:31},h=this.isoToCalendarDate(m,n),g=h.monthCode>f||h.monthCode===f&&h.day>=p?h.year:h.year-1;for(let e=0;e<20;e++){let c=this.adjustCalendarDate({day:p,monthCode:f,year:g-e},n),l=this.calendarToIsoDate(c,`constrain`,n),u=this.isoToCalendarDate(l,n);if({year:r,month:i,day:a}=l,u.monthCode===f&&u.day===p)return{month:i,day:a,year:r};if(t===`constrain`){let e=this.maxLengthOfMonthCodeInAnyYear(u.monthCode);if(u.monthCode===f&&u.day===e&&p>e)return{month:i,day:a,year:r};(o===void 0||u.monthCode===o.monthCode&&u.day>o.day)&&(o=u,s=l)}}if(t===`constrain`&&s!==void 0)return s;throw RangeError(`No recent ${this.id} year with monthCode ${f} and day ${p}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},lee=class extends Cu{constructor(){super(...arguments),this.id=`hebrew`,this.calendarType=`lunisolar`,this.months={Tishri:{leap:1,regular:1,monthCode:`M01`,days:30},Heshvan:{leap:2,regular:2,monthCode:`M02`,days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:`M03`,days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:`M04`,days:29},Shevat:{leap:5,regular:5,monthCode:`M05`,days:30},Adar:{leap:void 0,regular:6,monthCode:`M06`,days:29},"Adar I":{leap:6,regular:void 0,monthCode:`M05L`,days:30},"Adar II":{leap:7,regular:void 0,monthCode:`M06`,days:29},Nisan:{leap:8,regular:7,monthCode:`M07`,days:30},Iyar:{leap:9,regular:8,monthCode:`M08`,days:29},Sivan:{leap:10,regular:9,monthCode:`M09`,days:30},Tamuz:{leap:11,regular:10,monthCode:`M10`,days:29},Av:{leap:12,regular:11,monthCode:`M11`,days:30},Elul:{leap:13,regular:12,monthCode:`M12`,days:29}}}inLeapYear(e){let{year:t}=e;return(7*t+1)%19<7}monthsInYear(e){return this.inLeapYear(e)?13:12}minimumMonthLength(e){return this.minMaxMonthLength(e,`min`)}maximumMonthLength(e){return this.minMaxMonthLength(e,`max`)}minMaxMonthLength(e,t){let{month:n,year:r}=e,i=this.getMonthCode(r,n),a=Object.entries(this.months).find((e=>e[1].monthCode===i));if(a===void 0)throw RangeError(`unmatched Hebrew month: ${n}`);let o=a[1].days;return typeof o==`number`?o:o[t]}maxLengthOfMonthCodeInAnyYear(e){return[`M04`,`M06`,`M08`,`M10`,`M12`].includes(e)?29:30}estimateIsoDate(e){let{year:t}=e;return{year:t-3760,month:1,day:1}}getMonthCode(e,t){return this.inLeapYear({year:e})?t===6?vu(5,!0):vu(t<6?t:t-1):vu(t)}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthCode:o,day:s,monthExtra:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(c){let e=this.months[c];if(!e)throw RangeError(`Unrecognized month from formatToParts: ${c}`);a=this.inLeapYear({year:i})?e.leap:e.regular}return o=this.getMonthCode(i,a),{year:i,month:a,day:s,monthCode:o}}if(this.validateCalendarDate(e),a===void 0)if(o.endsWith(`L`)){if(o!==`M05L`)throw RangeError(`Hebrew leap month must have monthCode M05L, not ${o}`);if(a=6,!this.inLeapYear({year:i})){if(n===`reject`)throw RangeError(`Hebrew monthCode M05L is invalid in year ${i} which is not a leap year`);a=6,o=`M06`}}else{a=_u(o),this.inLeapYear({year:i})&&a>=6&&a++;let e=this.monthsInYear({year:i});if(a<1||a>e)throw RangeError(`Invalid monthCode: ${o}`)}else if(n===`reject`?(ol(a,1,this.monthsInYear({year:i})),ol(s,1,this.maximumMonthLength({year:i,month:a}))):(a=il(a,1,this.monthsInYear({year:i})),s=il(s,1,this.maximumMonthLength({year:i,month:a}))),o===void 0)o=this.getMonthCode(i,a);else if(this.getMonthCode(i,a)!==o)throw RangeError(`monthCode ${o} doesn't correspond to month ${a} in Hebrew year ${i}`);return{...e,day:s,month:a,monthCode:o,year:i}}},wu=class extends Cu{constructor(){super(...arguments),this.calendarType=`lunar`,this.DAYS_PER_ISLAMIC_YEAR=354.3666666666667,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(e,t){let n={year:e.year,month:1,monthCode:`M01`,day:1},r={year:e.year+1,month:1,monthCode:`M01`,day:1};return this.calendarDaysUntil(n,r,t)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:Math.floor(t*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},uee=class extends wu{constructor(){super(...arguments),this.id=`islamic`}},dee=class extends wu{constructor(){super(...arguments),this.id=`islamic-umalqura`}},fee=class extends wu{constructor(){super(...arguments),this.id=`islamic-tbla`}},pee=class extends wu{constructor(){super(...arguments),this.id=`islamic-civil`}},mee=class extends wu{constructor(){super(...arguments),this.id=`islamic-rgsa`}},hee=class extends wu{constructor(){super(...arguments),this.id=`islamicc`}},gee=class extends Cu{constructor(){super(...arguments),this.id=`persian`,this.calendarType=`solar`}inLeapYear(e,t){return this.daysInMonth({year:e.year,month:12,day:1},t)===30}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===12?29:t<=6?31:30}maximumMonthLength(e){let{month:t}=e;return t===12?30:t<=6?31:30}maxLengthOfMonthCodeInAnyYear(e){return _u(e)<=6?31:30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:t+621,month:1,day:1}}},_ee=class extends Cu{constructor(){super(...arguments),this.id=`indian`,this.calendarType=`solar`,this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date(`0000-01-01T00:00Z`).toLocaleDateString(`en-US-u-ca-indian`,{timeZone:`UTC`})!==`10/11/-79 Saka`}inLeapYear(e){return Tu(e.year+78)}monthsInYear(){return 12}minimumMonthLength(e){return this.getMonthInfo(e).length}maximumMonthLength(e){return this.getMonthInfo(e).length}maxLengthOfMonthCodeInAnyYear(e){let t=_u(e),n=this.months[t];return n=n.leap??n,n.length}getMonthInfo(e){let{month:t}=e,n=this.months[t];if(n===void 0)throw RangeError(`Invalid month: ${t}`);return this.inLeapYear(e)&&n.leap&&(n=n.leap),n}estimateIsoDate(e){let t=this.adjustCalendarDate(e),n=this.getMonthInfo(t);return $c(t.year+78+(n.nextYear?1:0),n.month,n.day+t.day-1)}checkIcuBugs(e){if(this.vulnerableToBceBug&&e.year<1)throw RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function Tu(e){return e%4==0&&(e%100!=0||e%400==0)}var Eu=class extends Cu{constructor(e,t){super(),this.calendarType=`solar`,this.id=e,this.isoEpoch=t}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Tu(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][_u(e)-1]}estimateIsoDate(e){let t=this.adjustCalendarDate(e);return os(t.year+this.isoEpoch.year,t.month+this.isoEpoch.month,t.day+this.isoEpoch.day,`constrain`)}},Du=class extends Cu{constructor(e,t){super(),this.hasEra=!0,this.calendarType=`solar`,this.id=e;let{eras:n,anchorEra:r}=function(e){let t,n=e;if(n.length===0)throw RangeError(`Invalid era data: eras are required`);if(n.length===1&&n[0].reverseOf)throw RangeError(`Invalid era data: anchor era cannot count years backwards`);if(n.length===1&&!n[0].code)throw RangeError(`Invalid era data: at least one named era is required`);if(n.filter((e=>e.reverseOf!=null)).length>1)throw RangeError(`Invalid era data: only one era can count years backwards`);n.forEach((e=>{if(e.isAnchor||!e.anchorEpoch&&!e.reverseOf){if(t)throw RangeError(`Invalid era data: cannot have multiple anchor eras`);t=e,e.anchorEpoch={year:e.hasYearZero?0:1}}else if(!e.code)throw RangeError(`If era name is blank, it must be the anchor era`)})),n=n.filter((e=>e.code)),n.forEach((e=>{let{reverseOf:t}=e;if(t){let r=n.find((e=>e.code===t));if(r===void 0)throw RangeError(`Invalid era data: unmatched reverseOf era: ${t}`);e.reverseOf=r,e.anchorEpoch=r.anchorEpoch,e.isoEpoch=r.isoEpoch}e.anchorEpoch.month===void 0&&(e.anchorEpoch.month=1),e.anchorEpoch.day===void 0&&(e.anchorEpoch.day=1)})),n.sort(((e,t)=>{if(e.reverseOf)return 1;if(t.reverseOf)return-1;if(!e.isoEpoch||!t.isoEpoch)throw RangeError(`Invalid era data: missing ISO epoch`);return t.isoEpoch.year-e.isoEpoch.year}));let r=n[n.length-1].reverseOf;if(r&&r!==n[n.length-2])throw RangeError(`Invalid era data: invalid reverse-sign era`);return n.forEach(((e,t)=>{e.genericName=`era`+(n.length-1-t)})),{eras:n,anchorEra:t||n[0]}}(t);this.anchorEra=r,this.eras=n}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Tu(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][_u(e)-1]}completeEraYear(e){let t=(t,n,r)=>{let i=e[t];if(i!=null&&i!=n&&!(r||[]).includes(i)){let e=r?.[0];throw RangeError(`Input ${t} ${i} doesn't match calculated value ${e?`${n} (also called ${e})`:n}`)}},n=t=>{let n,r={...e,year:t},i=this.eras.find(((e,i)=>{if(i===this.eras.length-1){if(e.reverseOf){if(t>0)throw RangeError(`Signed year ${t} is invalid for era ${e.code}`);return n=e.anchorEpoch.year-t,!0}return n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0}return this.compareCalendarDates(r,e.anchorEpoch)>=0&&(n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0)}));if(!i)throw RangeError(`Year ${t} was not matched by any era`);return{eraYear:n,era:i.code,eraNames:i.names}},{year:r,eraYear:i,era:a}=e;if(r!=null){let e=n(r);({eraYear:i,era:a}=e),t(`era`,a,e?.eraNames),t(`eraYear`,i)}else{if(i==null)throw RangeError(`Either year or eraYear and era are required`);{if(a===void 0)throw RangeError(`era and eraYear must be provided together`);let e=this.eras.find((({code:e,names:t=[]})=>e===a||t.includes(a)));if(!e)throw RangeError(`Era ${a} (ISO year ${i}) was not matched by any era`);r=e.reverseOf?e.anchorEpoch.year-i:i+e.anchorEpoch.year-(e.hasYearZero?0:1),t(`year`,r),{eraYear:i,era:a}=n(r)}}return{...e,year:r,eraYear:i,era:a}}adjustCalendarDate(e,t,n=`constrain`){let r=e,{month:i,monthCode:a}=r;return i===void 0&&(r={...r,month:_u(a)}),this.validateCalendarDate(r),r=this.completeEraYear(r),super.adjustCalendarDate(r,t,n)}estimateIsoDate(e){let{year:t,month:n,day:r}=this.adjustCalendarDate(e),{anchorEra:i}=this;return os(t+i.isoEpoch.year-(i.hasYearZero?0:1),n,r,`constrain`)}},Ou=class extends Du{constructor(e,t){super(e,t)}isoToCalendarDate(e){let{year:t,month:n,day:r}=e,i=vu(n),a=t-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:n,monthCode:i,day:r})}};const ku={inLeapYear(e){let{year:t}=e;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(e){let{month:t}=e;return t===13?this.inLeapYear(e)?6:5:30},maximumMonthLength(e){return this.minimumMonthLength(e)},maxLengthOfMonthCodeInAnyYear:e=>e===`M13`?6:30};var vee=class extends Eu{constructor(e,t){super(e,t),this.inLeapYear=ku.inLeapYear,this.monthsInYear=ku.monthsInYear,this.minimumMonthLength=ku.minimumMonthLength,this.maximumMonthLength=ku.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=ku.maxLengthOfMonthCodeInAnyYear}},Au=class extends Du{constructor(e,t){super(e,t),this.inLeapYear=ku.inLeapYear,this.monthsInYear=ku.monthsInYear,this.minimumMonthLength=ku.minimumMonthLength,this.maximumMonthLength=ku.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=ku.maxLengthOfMonthCodeInAnyYear}},yee=class extends vee{constructor(){super(`ethioaa`,{year:-5492,month:7,day:17})}},bee=class extends Au{constructor(){super(`coptic`,[{code:`coptic`,isoEpoch:{year:284,month:8,day:29}},{code:`coptic-inverse`,reverseOf:`coptic`}])}},xee=class extends Au{constructor(){super(`ethiopic`,[{code:`ethioaa`,names:[`ethiopic-amete-alem`,`mundi`],isoEpoch:{year:-5492,month:7,day:17}},{code:`ethiopic`,names:[`incar`],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},See=class extends Ou{constructor(){super(`roc`,[{code:`roc`,names:[`minguo`],isoEpoch:{year:1912,month:1,day:1}},{code:`roc-inverse`,names:[`before-roc`],reverseOf:`roc`}])}},Cee=class extends Eu{constructor(){super(`buddhist`,{year:-543,month:1,day:1})}},wee=class extends Ou{constructor(){super(`gregory`,[{code:`gregory`,names:[`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`gregory-inverse`,names:[`be`,`bce`],reverseOf:`gregory`}])}reviseIntlEra(e){let{era:t,eraYear:n}=e;return t===`b`&&(t=`gregory-inverse`),t===`a`&&(t=`gregory`),{era:t,eraYear:n}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},Tee=class extends Ou{constructor(){super(`japanese`,[{code:`reiwa`,isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:`heisei`,isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:`showa`,isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:`taisho`,isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:`meiji`,isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:`japanese`,names:[`japanese`,`gregory`,`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`japanese-inverse`,names:[`japanese-inverse`,`gregory-inverse`,`bc`,`bce`],reverseOf:`japanese`}]),this.erasBeginMidYear=!0}reviseIntlEra(e,t){let{era:n,eraYear:r}=e,{year:i}=t;return this.eras.find((e=>e.code===n))?{era:n,eraYear:r}:i<1?{era:`japanese-inverse`,eraYear:1-i}:{era:`japanese`,eraYear:i}}},ju=class extends Cu{constructor(){super(...arguments),this.calendarType=`lunisolar`}inLeapYear(e,t){let n=this.getMonthList(e.year,t);return Object.entries(n).length===13}monthsInYear(e,t){return this.inLeapYear(e,t)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(e){return[`M01L`,`M09L`,`M10L`,`M11L`,`M12L`].includes(e)?29:30}monthDaySearchStartYear(e,t){let n={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[e]??[1972,1972];return t<30?n[0]:n[1]}getMonthList(e,t){if(e===void 0)throw TypeError(`Missing year`);let n=JSON.stringify({func:`getMonthList`,calendarYear:e,id:this.id}),r=t.get(n);if(r)return r;let i=this.getFormatter(),a=(e,t)=>{let n=xu({isoYear:e,isoMonth:2,isoDay:1}),r=new Date(n);r.setUTCDate(t+1);let a=i.formatToParts(r),o=a.find((e=>e.type===`month`)).value,s=+a.find((e=>e.type===`day`)).value,c=a.find((e=>e.type===`relatedYear`)),l;if(c===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return l=+c.value,{calendarMonthString:o,calendarDay:s,calendarYearToVerify:l}},o=17,{calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o);s!==`1`&&(o+=29,{calendarMonthString:s,calendarDay:c}=a(e,o)),o-=c-5;let u={},d,f,p=1,m=!1;do({calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o)),d&&(u[f].daysInMonth=d+30-c),l===e?(u[s]={monthIndex:p++},o+=30):m=!0,d=c,f=s;while(!m);return u[f].daysInMonth=d+30-c,t.set(n,u),u}estimateIsoDate(e){let{year:t,month:n}=e;return{year:t,month:n>=12?12:n+1,day:1}}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthExtra:o,day:s,monthCode:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(o&&o!==`bis`)throw RangeError(`Unexpected leap month suffix: ${o}`);let e=vu(a,o!==void 0),n=`${a}${o||``}`,r=this.getMonthList(i,t)[n];if(r===void 0)throw RangeError(`Unmatched month ${n} in Chinese year ${i}`);return a=r.monthIndex,{year:i,month:a,day:s,monthCode:e}}if(this.validateCalendarDate(e),a===void 0){let e=this.getMonthList(i,t),r=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));r[0]===`0`&&(r=r.slice(1));let o=e[r];if(a=o&&o.monthIndex,a===void 0&&c.endsWith(`L`)&&c!=`M13L`&&n===`constrain`){let t=+c.replace(/^M0?|L$/g,``);o=e[t],o&&(a=o.monthIndex,c=vu(t))}if(a===void 0)throw RangeError(`Unmatched month ${c} in Chinese year ${i}`)}else if(c===void 0){let e=this.getMonthList(i,t),r=Object.entries(e),o=r.length;n===`reject`?(ol(a,1,o),ol(s,1,this.maximumMonthLength())):(a=il(a,1,o),s=il(s,1,this.maximumMonthLength()));let l=r.find((e=>e[1].monthIndex===a));if(l===void 0)throw RangeError(`Invalid month ${a} in Chinese year ${i}`);c=vu(+l[0].replace(`bis`,``),l[0].indexOf(`bis`)!==-1)}else{let e=this.getMonthList(i,t),n=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));n[0]===`0`&&(n=n.slice(1));let r=e[n];if(!r)throw RangeError(`Unmatched monthCode ${c} in Chinese year ${i}`);if(a!==r.monthIndex)throw RangeError(`monthCode ${c} doesn't correspond to month ${a} in Chinese year ${i}`)}return{...e,year:i,month:a,monthCode:c,day:s}}},Eee=class extends ju{constructor(){super(...arguments),this.id=`chinese`}},Dee=class extends ju{constructor(){super(...arguments),this.id=`dangi`}},Oee=class{constructor(e){this.helper=e}extraFields(e){return this.helper.hasEra&&e.includes(`year`)?[`era`,`eraYear`]:[]}resolveFields(e){if(this.helper.calendarType!==`lunisolar`){let t=new bu;yu(e,void 0,this.helper.monthsInYear({year:e.year??1972},t))}}dateToISO(e,t){let n=new bu,r=this.helper.calendarToIsoDate(e,t,n);return n.setObject(r),r}monthDayToISOReferenceDate(e,t){let n=new bu,r=this.helper.monthDayFromFields(e,t,n);return n.setObject(r),r}fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];switch(t.add(r),r){case`era`:t.add(`eraYear`),t.add(`year`);break;case`eraYear`:t.add(`era`),t.add(`year`);break;case`year`:t.add(`era`),t.add(`eraYear`);break;case`month`:t.add(`monthCode`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`monthCode`:t.add(`month`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`day`:this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`))}}return pu(t)}dateAdd(e,{years:t,months:n,weeks:r,days:i},a){let o=bu.getCacheForObject(e),s=this.helper.isoToCalendarDate(e,o),c=this.helper.addCalendar(s,{years:t,months:n,weeks:r,days:i},a,o),l=this.helper.calendarToIsoDate(c,`constrain`,o);return bu.getCacheForObject(l)||new bu(o).setObject(l),l}dateUntil(e,t,n){let r=bu.getCacheForObject(e),i=bu.getCacheForObject(t),a=this.helper.isoToCalendarDate(e,r),o=this.helper.isoToCalendarDate(t,i);return this.helper.untilCalendar(a,o,n,r)}isoToDate(e,t){let n=bu.getCacheForObject(e),r=this.helper.isoToCalendarDate(e,n);if(t.dayOfWeek&&(r.dayOfWeek=gu.iso8601.isoToDate(e,{dayOfWeek:!0}).dayOfWeek),t.dayOfYear){let e=this.helper.startOfCalendarYear(r);r.dayOfYear=this.helper.calendarDaysUntil(e,r,n)+1}if(t.weekOfYear&&(r.weekOfYear=mu(this.helper.id,e)),r.daysInWeek=7,t.daysInMonth&&(r.daysInMonth=this.helper.daysInMonth(r,n)),t.daysInYear){let e=this.helper.startOfCalendarYear(r),t=this.helper.addCalendar(e,{years:1},`constrain`,n);r.daysInYear=this.helper.calendarDaysUntil(e,t,n)}return t.monthsInYear&&(r.monthsInYear=this.helper.monthsInYear(r,n)),t.inLeapYear&&(r.inLeapYear=this.helper.inLeapYear(r,n)),r}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let e of[lee,gee,xee,yee,bee,Eee,Dee,See,_ee,Cee,wee,Tee,uee,dee,fee,pee,mee,hee]){let t=new e;gu[t.id]=new Oee(t)}La(`calendarImpl`,(function(e){return gu[e]}));const Mu=Intl.DateTimeFormat;function Nu(e,t){let n=L(e,t);return typeof n==`function`&&(n=new Mu(L(e,Ea),n(L(e,Da))),function(e,t,n){let r=Aa(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t]===void 0)throw TypeError(`tried to reset ${t} which was not set`);r[t]=n}(e,t,n)),n}function Pu(e){return Na(e,Sa)}var Fu=class{constructor(e=void 0,t=void 0){(function(e,t,n){let r=n!==void 0,i;if(r){let e=[`localeMatcher`,`calendar`,`numberingSystem`,`hour12`,`hourCycle`,`timeZone`,`weekday`,`era`,`year`,`month`,`day`,`dayPeriod`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`timeZoneName`,`formatMatcher`,`dateStyle`,`timeStyle`];i=function(e){if(e==null)throw TypeError(`Expected object not ${e}`);return Object(e)}(n);let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}i=t}else i=Object.create(null);let a=new Mu(t,i),o=a.resolvedOptions();if(Ma(e),r){let t=Object.assign(Object.create(null),o);for(let e in t)Object.prototype.hasOwnProperty.call(i,e)||delete t[e];t.hour12=i.hour12,t.hourCycle=i.hourCycle,Pa(e,Da,t)}else Pa(e,Da,i);Pa(e,Ea,o.locale),Pa(e,Sa,a),Pa(e,Ca,o.timeZone),Pa(e,Ta,o.calendar),Pa(e,va,Lee),Pa(e,`ym`,Fee),Pa(e,`md`,Iee),Pa(e,ya,Pee),Pa(e,ba,Ree),Pa(e,xa,zee);let s=r?i.timeZone:void 0;if(s===void 0)Pa(e,wa,o.timeZone);else{let t=So(s);if(t.startsWith(`−`))throw RangeError(`Unicode minus (U+2212) is not supported in time zone offsets`);Pa(e,wa,pc(t))}})(this,e,t)}get format(){R(this,Pu);let e=Aee.bind(this);return Object.defineProperties(e,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:``,enumerable:!1,writable:!1,configurable:!0}}),e}formatRange(e,t){return R(this,Pu),Mee.call(this,e,t)}formatToParts(e,...t){return R(this,Pu),jee.call(this,e,...t)}formatRangeToParts(e,t){return R(this,Pu),Nee.call(this,e,t)}resolvedOptions(){return R(this,Pu),kee.call(this)}};`formatToParts`in Mu.prototype||delete Fu.prototype.formatToParts,`formatRangeToParts`in Mu.prototype||delete Fu.prototype.formatRangeToParts;const Iu=function(e=void 0,t=void 0){return new Fu(e,t)};function kee(){let e=L(this,Sa).resolvedOptions();return e.timeZone=L(this,wa),e}function Aee(e,...t){let n,r,i=Wu(e,this);return i.formatter?(n=i.formatter,r=[eu(i.epochNs,`floor`)]):(n=L(this,Sa),r=[e,...t]),n.format(...r)}function jee(e,...t){let n,r,i=Wu(e,this);return i.formatter?(n=i.formatter,r=[eu(i.epochNs,`floor`)]):(n=L(this,Sa),r=[e,...t]),n.formatToParts(...r)}function Mee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=Hu(e),r=Hu(t),i,a=[n,r];if(Vu(n)!==Vu(r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);if(Vu(n)){if(!Uu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);let{epochNs:e,formatter:t}=Wu(n,this),{epochNs:o,formatter:s}=Wu(r,this);t&&(i=t,a=[eu(e,`floor`),eu(o,`floor`)])}return i||=L(this,Sa),i.formatRange(...a)}function Nee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=Hu(e),r=Hu(t),i,a=[n,r];if(Vu(n)!==Vu(r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);if(Vu(n)){if(!Uu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);let{epochNs:e,formatter:t}=Wu(n,this),{epochNs:o,formatter:s}=Wu(r,this);t&&(i=t,a=[eu(e,`floor`),eu(o,`floor`)])}return i||=L(this,Sa),i.formatRangeToParts(...a)}function Lu(e={},t={}){let n=Object.assign({},e),r=[`year`,`month`,`day`,`hour`,`minute`,`second`,`weekday`,`dayPeriod`,`timeZoneName`,`dateStyle`,`timeStyle`];for(let e=0;e<r.length;e++){let i=r[e];n[i]=i in t?t[i]:n[i],!1!==n[i]&&n[i]!==void 0||delete n[i]}return n}function Pee(e){let t=Lu(e,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!==`long`&&t.timeStyle!==`full`||(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})),!zu(t)){if(Bu(e))throw TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(e)}]`);Object.assign(t,{hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function Fee(e){let t={short:{year:`2-digit`,month:`numeric`},medium:{year:`numeric`,month:`short`},long:{year:`numeric`,month:`long`},full:{year:`numeric`,month:`long`}},n=Lu(e,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`year`in n||`month`in n||`era`in n)){if(Bu(e))throw TypeError(`cannot format PlainYearMonth with options [${Object.keys(e)}]`);Object.assign(n,{year:`numeric`,month:`numeric`})}return n}function Iee(e){let t={short:{month:`numeric`,day:`numeric`},medium:{month:`short`,day:`numeric`},long:{month:`long`,day:`numeric`},full:{month:`long`,day:`numeric`}},n=Lu(e,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`month`in n)&&!(`day`in n)){if(Bu(e))throw TypeError(`cannot format PlainMonthDay with options [${Object.keys(e)}]`);Object.assign(n,{month:`numeric`,day:`numeric`})}return n}function Lee(e){let t=Lu(e,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Ru(t)){if(Bu(e))throw TypeError(`cannot format PlainDate with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`})}return t}function Ree(e){let t=Lu(e,{timeZoneName:!1});if((t.timeStyle===`long`||t.timeStyle===`full`)&&(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}),t.dateStyle)&&(Object.assign(t,{short:{year:`numeric`,month:`numeric`,day:`numeric`},medium:{year:`numeric`,month:`short`,day:`numeric`},long:{year:`numeric`,month:`long`,day:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,weekday:`long`}}[t.dateStyle]),delete t.dateStyle),!zu(t)&&!Ru(t)){if(Bu(e))throw TypeError(`cannot format PlainDateTime with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function zee(e){let t=e;return zu(t)||Ru(t)||(t=Object.assign({},t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})),t}function Ru(e){return`year`in e||`month`in e||`day`in e||`weekday`in e||`dateStyle`in e||`era`in e}function zu(e){return`hour`in e||`minute`in e||`second`in e||`timeStyle`in e||`dayPeriod`in e||`fractionalSecondDigits`in e}function Bu(e){return Ru(e)||zu(e)||`dateStyle`in e||`timeStyle`in e||`timeZoneName`in e}function Vu(e){return Uo(e)||Wo(e)||Go(e)||Jo(e)||Ko(e)||qo(e)||Vo(e)}function Hu(e){return Vu(e)?e:xo(e)}function Uu(e,t){return!(!Vu(e)||!Vu(t)||Wo(e)&&!Wo(t)||Uo(e)&&!Uo(t)||Go(e)&&!Go(t)||Jo(e)&&!Jo(t)||Ko(e)&&!Ko(t)||qo(e)&&!qo(t)||Vo(e)&&!Vo(t))}function Wu(e,t){if(Wo(e)){let n={isoDate:{year:1970,month:1,day:1},time:L(e,na)};return{epochNs:vc(L(t,Ca),n,`compatible`),formatter:Nu(t,ya)}}if(Ko(e)){let n=L(e,ra),r=L(t,Ta);if(n!==r)throw RangeError(`cannot format PlainYearMonth with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,`ym`)}}if(qo(e)){let n=L(e,ra),r=L(t,Ta);if(n!==r)throw RangeError(`cannot format PlainMonthDay with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,`md`)}}if(Uo(e)){let n=L(e,ra),r=L(t,Ta);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDate with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,va)}}if(Go(e)){let n=L(e,ra),r=L(t,Ta);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDateTime with calendar ${n} in locale with calendar ${r}`);let i=L(e,ta);return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,ba)}}if(Jo(e))throw TypeError(`Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.`);return Vo(e)?{epochNs:L(e,$i),formatter:Nu(t,xa)}:{}}function Gu(e){let t=Object.create(null);return t.years=L(e,ca),t.months=L(e,la),t.weeks=L(e,ua),t.days=L(e,da),t.hours=L(e,fa),t.minutes=L(e,pa),t.seconds=L(e,ma),t.milliseconds=L(e,ha),t.microseconds=L(e,ga),t.nanoseconds=L(e,_a),t}Fu.prototype.constructor=Iu,Object.defineProperty(Iu,`prototype`,{value:Fu.prototype,writable:!1,enumerable:!1,configurable:!1}),Iu.supportedLocalesOf=Mu.supportedLocalesOf,Ia(Iu,`Intl.DateTimeFormat`);const{format:Bee,formatToParts:Vee}=Intl.DurationFormat?.prototype??Object.create(null);function Ku(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Gu(Fs(e));return Bee.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Ku,Intl.DurationFormat.prototype.formatToParts=function(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Gu(Fs(e));return Vee.call(this,t)}),Object.freeze({__proto__:null,DateTimeFormat:Iu,ModifiedIntlDurationFormatPrototypeFormat:Ku});var qu=class{constructor(e){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);$s(this,nu(e))}get epochMilliseconds(){return R(this,Vo),eu(L(this,$i),`floor`)}get epochNanoseconds(){return R(this,Vo),$l(I.default.BigInt(L(this,$i)))}add(e){return R(this,Vo),Rl(`add`,this,e)}subtract(e){return R(this,Vo),Rl(`subtract`,this,e)}until(e,t=void 0){return R(this,Vo),nee(`until`,this,e,t)}since(e,t=void 0){return R(this,Vo),nee(`since`,this,e,t)}round(e){if(R(this,Vo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs);return _s(n,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[i],!0),ec(Gl(L(this,$i),n,i,r))}equals(e){R(this,Vo);let t=Is(e),n=L(this,$i),r=L(t,$i);return I.default.equal(I.default.BigInt(n),I.default.BigInt(r))}toString(e=void 0){R(this,Vo);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let a=t.timeZone;a!==void 0&&(a=pc(a));let{precision:o,unit:s,increment:c}=ys(i,n);return eee(ec(Gl(L(this,$i),c,s,r)),a,o)}toJSON(){return R(this,Vo),eee(this,void 0,`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Vo),new Iu(e,t).format(this)}valueOf(){du(`Instant`)}toZonedDateTimeISO(e){R(this,Vo);let t=pc(e);return nc(L(this,$i),t,`iso8601`)}static fromEpochMilliseconds(e){return ec(tu(xo(e)))}static fromEpochNanoseconds(e){return ec(nu(e))}static from(e){return Is(e)}static compare(e,t){let n=Is(e),r=Is(t),i=L(n,$i),a=L(r,$i);return I.default.lessThan(i,a)?-1:I.default.greaterThan(i,a)?1:0}};Ia(qu,`Temporal.Instant`);var Ju=class{constructor(e,t,n,r=`iso8601`){let i=Co(e),a=Co(t),o=Co(n),s=lu(r===void 0?`iso8601`:Do(r));sl(i,a,o),Us(this,{year:i,month:a,day:o},s)}get calendarId(){return R(this,Uo),L(this,ra)}get era(){return Yu(this,`era`)}get eraYear(){return Yu(this,`eraYear`)}get year(){return Yu(this,`year`)}get month(){return Yu(this,`month`)}get monthCode(){return Yu(this,`monthCode`)}get day(){return Yu(this,`day`)}get dayOfWeek(){return Yu(this,`dayOfWeek`)}get dayOfYear(){return Yu(this,`dayOfYear`)}get weekOfYear(){return Yu(this,`weekOfYear`)?.week}get yearOfWeek(){return Yu(this,`weekOfYear`)?.year}get daysInWeek(){return Yu(this,`daysInWeek`)}get daysInMonth(){return Yu(this,`daysInMonth`)}get daysInYear(){return Yu(this,`daysInYear`)}get monthsInYear(){return Yu(this,`monthsInYear`)}get inLeapYear(){return Yu(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Uo),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea));return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Ws(uc(n,r,ds(ou(t))),n)}withCalendar(e){R(this,Uo);let t=sc(e);return Ws(L(this,ea),t)}add(e,t=void 0){return R(this,Uo),zl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Uo),zl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Uo),ree(`until`,this,e,t)}since(e,t=void 0){return R(this,Uo),ree(`since`,this,e,t)}equals(e){R(this,Uo);let t=Ms(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,Uo),Dc(this,hs(ou(e)))}toJSON(){return R(this,Uo),Dc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Uo),new Iu(e,t).format(this)}valueOf(){du(`PlainDate`)}toPlainDateTime(e=void 0){R(this,Uo);let t=zs(e);return Ks(us(L(this,ea),t),L(this,ra))}toZonedDateTime(e){let t,n;if(R(this,Uo),bo(e)){let r=e.timeZone;r===void 0?t=pc(e):(t=pc(r),n=e.plainTime)}else t=pc(e);let r=L(this,ea),i;return n===void 0?i=xc(t,r):(n=Rs(n),i=vc(t,us(r,L(n,na)),`compatible`)),nc(i,t,L(this,ra))}toPlainYearMonth(){R(this,Uo);let e=L(this,ra);return Qs(dc(e,ks(e,L(this,ea)),`constrain`),e)}toPlainMonthDay(){R(this,Uo);let e=L(this,ra);return Js(fc(e,ks(e,L(this,ea)),`constrain`),e)}static from(e,t=void 0){return Ms(e,t)}static compare(e,t){let n=Ms(e),r=Ms(t);return Xl(L(n,ea),L(r,ea))}};function Yu(e,t){R(e,Uo);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}Ia(Ju,`Temporal.PlainDate`);var Xu=class{constructor(e,t,n,r=0,i=0,a=0,o=0,s=0,c=0,l=`iso8601`){let u=Co(e),d=Co(t),f=Co(n),p=r===void 0?0:Co(r),m=i===void 0?0:Co(i),h=a===void 0?0:Co(a),g=o===void 0?0:Co(o),_=s===void 0?0:Co(s),v=c===void 0?0:Co(c),y=lu(l===void 0?`iso8601`:Do(l));ul(u,d,f,p,m,h,g,_,v),Gs(this,{isoDate:{year:u,month:d,day:f},time:{hour:p,minute:m,second:h,millisecond:g,microsecond:_,nanosecond:v}},y)}get calendarId(){return R(this,Go),L(this,ra)}get year(){return Zu(this,`year`)}get month(){return Zu(this,`month`)}get monthCode(){return Zu(this,`monthCode`)}get day(){return Zu(this,`day`)}get hour(){return Qu(this,`hour`)}get minute(){return Qu(this,`minute`)}get second(){return Qu(this,`second`)}get millisecond(){return Qu(this,`millisecond`)}get microsecond(){return Qu(this,`microsecond`)}get nanosecond(){return Qu(this,`nanosecond`)}get era(){return Zu(this,`era`)}get eraYear(){return Zu(this,`eraYear`)}get dayOfWeek(){return Zu(this,`dayOfWeek`)}get dayOfYear(){return Zu(this,`dayOfYear`)}get weekOfYear(){return Zu(this,`weekOfYear`)?.week}get yearOfWeek(){return Zu(this,`weekOfYear`)?.year}get daysInWeek(){return Zu(this,`daysInWeek`)}get daysInYear(){return Zu(this,`daysInYear`)}get daysInMonth(){return Zu(this,`daysInMonth`)}get monthsInYear(){return Zu(this,`monthsInYear`)}get inLeapYear(){return Zu(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Go),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=L(this,ta),i={...ks(n,r.isoDate),...r.time};return i=ic(n,i,As(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],`partial`)),Ks(Ns(n,i,ds(ou(t))),n)}withPlainTime(e=void 0){R(this,Go);let t=zs(e);return Ks(us(L(this,ta).isoDate,t),L(this,ra))}withCalendar(e){R(this,Go);let t=sc(e);return Ks(L(this,ta),t)}add(e,t=void 0){return R(this,Go),Bl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Go),Bl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Go),iee(`until`,this,e,t)}since(e,t=void 0){return R(this,Go),iee(`since`,this,e,t)}round(e){if(R(this,Go),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];_s(n,a,a===1);let o=L(this,ta);return Ks(n===1&&i===`nanosecond`?o:Kl(o,n,i,r),L(this,ra))}equals(e){R(this,Go);let t=Ps(e);return Ql(L(this,ta),L(t,ta))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){R(this,Go);let t=ou(e),n=hs(t),r=vs(t),i=ps(t,`trunc`),a=xs(t,`smallestUnit`,`time`,void 0);if(a===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:o,unit:s,increment:c}=ys(a,r),l=Kl(L(this,ta),c,s,i);return dl(l),kc(l,L(this,ra),o,n)}toJSON(){return R(this,Go),kc(L(this,ta),L(this,ra),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Go),new Iu(e,t).format(this)}valueOf(){du(`PlainDateTime`)}toZonedDateTime(e,t=void 0){R(this,Go);let n=pc(e),r=fs(ou(t));return nc(vc(n,L(this,ta),r),n,L(this,ra))}toPlainDate(){return R(this,Go),Ws(L(this,ta).isoDate,L(this,ra))}toPlainTime(){return R(this,Go),Xs(L(this,ta).time)}static from(e,t=void 0){return Ps(e,t)}static compare(e,t){let n=Ps(e),r=Ps(t);return Ql(L(n,ta),L(r,ta))}};function Zu(e,t){R(e,Go);let n=L(e,ta).isoDate;return Os(e).isoToDate(n,{[t]:!0})[t]}function Qu(e,t){return R(e,Go),L(e,ta).time[t]}Ia(Xu,`Temporal.PlainDateTime`);var $u=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){let u=e===void 0?0:To(e),d=t===void 0?0:To(t),f=n===void 0?0:To(n),p=r===void 0?0:To(r),m=i===void 0?0:To(i),h=a===void 0?0:To(a),g=o===void 0?0:To(o),_=s===void 0?0:To(s),v=c===void 0?0:To(c),y=l===void 0?0:To(l);hl(u,d,f,p,m,h,g,_,v,y),Ma(this),Pa(this,ca,u),Pa(this,la,d),Pa(this,ua,f),Pa(this,da,p),Pa(this,fa,m),Pa(this,pa,h),Pa(this,ma,g),Pa(this,ha,_),Pa(this,ga,v),Pa(this,_a,y)}get years(){return R(this,Ho),L(this,ca)}get months(){return R(this,Ho),L(this,la)}get weeks(){return R(this,Ho),L(this,ua)}get days(){return R(this,Ho),L(this,da)}get hours(){return R(this,Ho),L(this,fa)}get minutes(){return R(this,Ho),L(this,pa)}get seconds(){return R(this,Ho),L(this,ma)}get milliseconds(){return R(this,Ho),L(this,ha)}get microseconds(){return R(this,Ho),L(this,ga)}get nanoseconds(){return R(this,Ho),L(this,_a)}get sign(){return R(this,Ho),Yc(this)}get blank(){return R(this,Ho),Yc(this)===0}with(t){R(this,Ho);let{years:n=L(this,ca),months:r=L(this,la),weeks:i=L(this,ua),days:a=L(this,da),hours:o=L(this,fa),minutes:s=L(this,pa),seconds:c=L(this,ma),milliseconds:l=L(this,ha),microseconds:u=L(this,ga),nanoseconds:d=L(this,_a)}=cs(t);return new e(n,r,i,a,o,s,c,l,u,d)}negated(){return R(this,Ho),rl(this)}abs(){return R(this,Ho),new e(Math.abs(L(this,ca)),Math.abs(L(this,la)),Math.abs(L(this,ua)),Math.abs(L(this,da)),Math.abs(L(this,fa)),Math.abs(L(this,pa)),Math.abs(L(this,ma)),Math.abs(L(this,ha)),Math.abs(L(this,ga)),Math.abs(L(this,_a)))}add(e){return R(this,Ho),Ll(`add`,this,e)}subtract(e){return R(this,Ho),Ll(`subtract`,this,e)}round(e){if(R(this,Ho),e===void 0)throw TypeError(`options parameter is required`);let t=Cs(this),n=typeof e==`string`?su(`smallestUnit`,e):ou(e),r=xs(n,`largestUnit`,`datetime`,void 0,[`auto`]),{plainRelativeTo:i,zonedRelativeTo:a}=Ss(n),o=gs(n),s=ps(n,`halfExpand`),c=xs(n,`smallestUnit`,`datetime`,void 0),l=!0;c||=(l=!1,`nanosecond`);let u=ws(t,c),d=!0;if(r||=(d=!1,u),r===`auto`&&(r=u),!l&&!d)throw RangeError(`at least one of smallestUnit or largestUnit is required`);if(ws(r,c)!==r)throw RangeError(`largestUnit ${r} cannot be smaller than smallestUnit ${c}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[c];if(f!==void 0&&_s(o,f,!1),o>1&&Es(c)===`date`&&r!==c)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);if(a){let e=gl(this),t=L(a,sa),n=L(a,ra),i=L(a,$i);return e=jl(i,Il(i,t,n,e),t,n,r,o,c,s),Es(r)===`date`&&(r=`hour`),yl(e,r)}if(i){let e=_l(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),n=L(i,ea),a=L(i,ra),l=ac(a,n,ls(e.date,t.deltaDays),`constrain`);return e=Al(us(n,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),us(l,t),a,r,o,c,s),yl(e,r)}if(Ts(t))throw RangeError(`a starting point is required for ${t}s balancing`);if(Ts(r))throw RangeError(`a starting point is required for ${r}s balancing`);let p=_l(this);if(c===`day`){let{quotient:e,remainder:t}=p.time.divmod(co),n=p.date.days+e+Yl(t,`day`);n=Wl(n,o,s),p=bl({years:0,months:0,weeks:0,days:n},Ua.ZERO)}else p=bl({years:0,months:0,weeks:0,days:0},Jl(p.time,o,c,s));return yl(p,r)}total(e){if(R(this,Ho),e===void 0)throw TypeError(`options argument is required`);let t=typeof e==`string`?su(`unit`,e):ou(e),{plainRelativeTo:n,zonedRelativeTo:r}=Ss(t),i=xs(t,`unit`,`datetime`,bs);if(r){let e=gl(this),t=L(r,sa),n=L(r,ra),a=L(r,$i);return function(e,t,n,r,i){return Es(i)===`time`?Yl(Ua.fromEpochNsDiff(t,e),i):kl(El(e,t,n,r,i),t,_c(n,e),n,r,i)}(a,Il(a,t,n,e),t,n,i)}if(n){let e=_l(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),r=L(n,ea),a=L(n,ra),o=ac(a,r,ls(e.date,t.deltaDays),`constrain`);return function(e,t,n,r){if(Ql(e,t)==0)return 0;dl(e),dl(t);let i=Tl(e,t,n,r);return r===`nanosecond`?I.default.toNumber(i.time.totalNs):kl(i,Hc(t),e,null,n,r)}(us(r,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),us(o,t),a,i)}let a=Cs(this);if(Ts(a))throw RangeError(`a starting point is required for ${a}s total`);if(Ts(i))throw RangeError(`a starting point is required for ${i}s total`);return Yl(_l(this).time,i)}toString(e=void 0){R(this,Ho);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`||i===`minute`)throw RangeError(`smallestUnit must be a time unit other than "hours" or "minutes"`);let{precision:a,unit:o,increment:s}=ys(i,n);if(o===`nanosecond`&&s===1)return Ec(this,a);let c=Cs(this),l=gl(this),u=Jl(l.time,s,o,r);return l=bl(l.date,u),Ec(yl(l,ws(c,`second`)),a)}toJSON(){return R(this,Ho),Ec(this,`auto`)}toLocaleString(e=void 0,t=void 0){if(R(this,Ho),typeof Intl.DurationFormat==`function`){let n=new Intl.DurationFormat(e,t);return Ku.call(n,this)}return console.warn(`Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat.`),Ec(this,`auto`)}valueOf(){du(`Duration`)}static from(e){return Fs(e)}static compare(e,t,n=void 0){let r=Fs(e),i=Fs(t),{plainRelativeTo:a,zonedRelativeTo:o}=Ss(ou(n));if(L(r,ca)===L(i,ca)&&L(r,la)===L(i,la)&&L(r,ua)===L(i,ua)&&L(r,da)===L(i,da)&&L(r,fa)===L(i,fa)&&L(r,pa)===L(i,pa)&&L(r,ma)===L(i,ma)&&L(r,ha)===L(i,ha)&&L(r,ga)===L(i,ga)&&L(r,_a)===L(i,_a))return 0;let s=Cs(r),c=Cs(i),l=gl(r),u=gl(i);if(o&&(Es(s)===`date`||Es(c)===`date`)){let e=L(o,sa),t=L(o,ra),n=L(o,$i),r=Il(n,e,t,l),i=Il(n,e,t,u);return au(I.default.toNumber(I.default.subtract(r,i)))}let d=l.date.days,f=u.date.days;if(Ts(s)||Ts(c)){if(!a)throw RangeError(`A starting point is required for years, months, or weeks comparison`);d=nl(l.date,a),f=nl(u.date,a)}let p=l.time.add24HourDays(d),m=u.time.add24HourDays(f);return p.cmp(m)}};Ia($u,`Temporal.Duration`);var ed=class{constructor(e,t,n=`iso8601`,r=1972){let i=Co(e),a=Co(t),o=lu(n===void 0?`iso8601`:Do(n)),s=Co(r);sl(s,i,a),qs(this,{year:s,month:i,day:a},o)}get monthCode(){return td(this,`monthCode`)}get day(){return td(this,`day`)}get calendarId(){return R(this,qo),L(this,ra)}with(e,t=void 0){if(R(this,qo),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea),`month-day`);return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Js(fc(n,r,ds(ou(t))),n)}equals(e){R(this,qo);let t=Ls(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,qo),Ac(this,hs(ou(e)))}toJSON(){return R(this,qo),Ac(this)}toLocaleString(e=void 0,t=void 0){return R(this,qo),new Iu(e,t).format(this)}valueOf(){du(`PlainMonthDay`)}toPlainDate(e){if(R(this,qo),!bo(e))throw TypeError(`argument should be an object`);let t=L(this,ra);return Ws(uc(t,ic(t,ks(t,L(this,ea),`month-day`),As(t,e,[`year`],[],[])),`constrain`),t)}static from(e,t=void 0){return Ls(e,t)}};function td(e,t){R(e,qo);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}function nd(e){return _c(e,ru())}Ia(ed,`Temporal.PlainMonthDay`);const rd={instant:()=>ec(ru()),plainDateTimeISO:(e=iu())=>Ks(nd(pc(e)),`iso8601`),plainDateISO:(e=iu())=>Ws(nd(pc(e)).isoDate,`iso8601`),plainTimeISO:(e=iu())=>Xs(nd(pc(e)).time),timeZoneId:()=>iu(),zonedDateTimeISO:(e=iu())=>{let t=pc(e);return nc(ru(),t,`iso8601`)},[Symbol.toStringTag]:`Temporal.Now`};Object.defineProperty(rd,Symbol.toStringTag,{value:`Temporal.Now`,writable:!1,enumerable:!1,configurable:!0});var id=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0){let o=e===void 0?0:Co(e),s=t===void 0?0:Co(t),c=n===void 0?0:Co(n),l=r===void 0?0:Co(r),u=i===void 0?0:Co(i),d=a===void 0?0:Co(a);ll(o,s,c,l,u,d),Ys(this,{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d})}get hour(){return R(this,Wo),L(this,na).hour}get minute(){return R(this,Wo),L(this,na).minute}get second(){return R(this,Wo),L(this,na).second}get millisecond(){return R(this,Wo),L(this,na).millisecond}get microsecond(){return R(this,Wo),L(this,na).microsecond}get nanosecond(){return R(this,Wo),L(this,na).nanosecond}with(t,n=void 0){if(R(this,Wo),!bo(t))throw TypeError(`invalid argument`);Yo(t);let r=js(t,`partial`),i=js(this),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Object.assign(i,r),d=ds(ou(n));return{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=ss(a,o,s,c,l,u,d),new e(a,o,s,c,l,u)}add(e){return R(this,Wo),Vl(`add`,this,e)}subtract(e){return R(this,Wo),Vl(`subtract`,this,e)}until(e,t=void 0){return R(this,Wo),aee(`until`,this,e,t)}since(e,t=void 0){return R(this,Wo),aee(`since`,this,e,t)}round(e){if(R(this,Wo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs);return _s(n,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i],!1),Xs(ql(L(this,na),n,i,r))}equals(e){R(this,Wo);let t=Rs(e);return Zl(L(this,na),L(t,na))===0}toString(e=void 0){R(this,Wo);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:a,unit:o,increment:s}=ys(i,n);return Oc(ql(L(this,na),s,o,r),a)}toJSON(){return R(this,Wo),Oc(L(this,na),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Wo),new Iu(e,t).format(this)}valueOf(){du(`PlainTime`)}static from(e,t=void 0){return Rs(e,t)}static compare(e,t){let n=Rs(e),r=Rs(t);return Zl(L(n,na),L(r,na))}};Ia(id,`Temporal.PlainTime`);var ad=class{constructor(e,t,n=`iso8601`,r=1){let i=Co(e),a=Co(t),o=lu(n===void 0?`iso8601`:Do(n)),s=Co(r);sl(i,a,s),Zs(this,{year:i,month:a,day:s},o)}get year(){return od(this,`year`)}get month(){return od(this,`month`)}get monthCode(){return od(this,`monthCode`)}get calendarId(){return R(this,Ko),L(this,ra)}get era(){return od(this,`era`)}get eraYear(){return od(this,`eraYear`)}get daysInMonth(){return od(this,`daysInMonth`)}get daysInYear(){return od(this,`daysInYear`)}get monthsInYear(){return od(this,`monthsInYear`)}get inLeapYear(){return od(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Ko),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea),`year-month`);return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`],[],`partial`)),Qs(dc(n,r,ds(ou(t))),n)}add(e,t=void 0){return R(this,Ko),Hl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Ko),Hl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Ko),oee(`until`,this,e,t)}since(e,t=void 0){return R(this,Ko),oee(`since`,this,e,t)}equals(e){R(this,Ko);let t=Bs(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,Ko),jc(this,hs(ou(e)))}toJSON(){return R(this,Ko),jc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Ko),new Iu(e,t).format(this)}valueOf(){du(`PlainYearMonth`)}toPlainDate(e){if(R(this,Ko),!bo(e))throw TypeError(`argument should be an object`);let t=L(this,ra);return Ws(uc(t,ic(t,ks(t,L(this,ea),`year-month`),As(t,e,[`day`],[],[])),`constrain`),t)}static from(e,t=void 0){return Bs(e,t)}static compare(e,t){let n=Bs(e),r=Bs(t);return Xl(L(n,ea),L(r,ea))}};function od(e,t){R(e,Ko);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}Ia(ad,`Temporal.PlainYearMonth`);const Hee=Iu.prototype.resolvedOptions;var sd=class{constructor(e,t,n=`iso8601`){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);let r=nu(e),i=Do(t),{tzName:a,offsetMinutes:o}=as(i);if(o===void 0){let e=Ic(a);if(!e)throw RangeError(`unknown time zone ${a}`);i=e.identifier}else i=zc(o);tc(this,r,i,lu(n===void 0?`iso8601`:Do(n)))}get calendarId(){return R(this,Jo),L(this,ra)}get timeZoneId(){return R(this,Jo),L(this,sa)}get year(){return ld(this,`year`)}get month(){return ld(this,`month`)}get monthCode(){return ld(this,`monthCode`)}get day(){return ld(this,`day`)}get hour(){return ud(this,`hour`)}get minute(){return ud(this,`minute`)}get second(){return ud(this,`second`)}get millisecond(){return ud(this,`millisecond`)}get microsecond(){return ud(this,`microsecond`)}get nanosecond(){return ud(this,`nanosecond`)}get era(){return ld(this,`era`)}get eraYear(){return ld(this,`eraYear`)}get epochMilliseconds(){return R(this,Jo),eu(L(this,$i),`floor`)}get epochNanoseconds(){return R(this,Jo),$l(L(this,$i))}get dayOfWeek(){return ld(this,`dayOfWeek`)}get dayOfYear(){return ld(this,`dayOfYear`)}get weekOfYear(){return ld(this,`weekOfYear`)?.week}get yearOfWeek(){return ld(this,`weekOfYear`)?.year}get hoursInDay(){R(this,Jo);let e=L(this,sa),t=cd(this).isoDate,n=$c(t.year,t.month,t.day+1),r=xc(e,t),i=xc(e,n);return Yl(Ua.fromEpochNsDiff(i,r),`hour`)}get daysInWeek(){return ld(this,`daysInWeek`)}get daysInMonth(){return ld(this,`daysInMonth`)}get daysInYear(){return ld(this,`daysInYear`)}get monthsInYear(){return ld(this,`monthsInYear`)}get inLeapYear(){return ld(this,`inLeapYear`)}get offset(){return R(this,Jo),gc(hc(L(this,sa),L(this,$i)))}get offsetNanoseconds(){return R(this,Jo),hc(L(this,sa),L(this,$i))}with(e,t=void 0){if(R(this,Jo),!bo(e))throw TypeError(`invalid zoned-date-time-like`);Yo(e);let n=L(this,ra),r=L(this,sa),i=hc(r,L(this,$i)),a=cd(this),o={...ks(n,a.isoDate),...a.time,offset:gc(i)};o=ic(n,o,As(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`],`partial`));let s=ou(t),c=fs(s),l=ms(s,`prefer`),u=Ns(n,o,ds(s)),d=Pc(o.offset);return nc(Vs(u.isoDate,u.time,`option`,d,r,c,l,!1),r,n)}withPlainTime(e=void 0){R(this,Jo);let t=L(this,sa),n=L(this,ra),r=cd(this).isoDate,i;return i=e===void 0?xc(t,r):vc(t,us(r,L(Rs(e),na)),`compatible`),nc(i,t,n)}withTimeZone(e){R(this,Jo);let t=pc(e);return nc(L(this,$i),t,L(this,ra))}withCalendar(e){R(this,Jo);let t=sc(e);return nc(L(this,$i),L(this,sa),t)}add(e,t=void 0){return R(this,Jo),Ul(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Jo),Ul(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Jo),Nl(`until`,this,e,t)}since(e,t=void 0){return R(this,Jo),Nl(`since`,this,e,t)}round(e){if(R(this,Jo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];if(_s(n,a,a===1),i===`nanosecond`&&n===1)return nc(L(this,$i),L(this,sa),L(this,ra));let o=L(this,sa),s=L(this,$i),c=cd(this),l;if(i===`day`){let e=c.isoDate,t=$c(e.year,e.month,e.day+1),n=xc(o,e),i=xc(o,t),a=I.default.subtract(i,n);l=Ua.fromEpochNsDiff(s,n).round(a,r).addToEpochNs(n)}else{let e=Kl(c,n,i,r),t=hc(o,s);l=Vs(e.isoDate,e.time,`option`,t,o,`compatible`,`prefer`,!1)}return nc(l,o,L(this,ra))}equals(e){R(this,Jo);let t=Hs(e),n=L(this,$i),r=L(t,$i);return!!I.default.equal(I.default.BigInt(n),I.default.BigInt(r))&&!!mc(L(this,sa),L(t,sa))&&lc(L(this,ra),L(t,ra))}toString(e=void 0){R(this,Jo);let t=ou(e),n=hs(t),r=vs(t),i=function(e){return cu(e,`offset`,[`auto`,`never`],`auto`)}(t),a=ps(t,`trunc`),o=xs(t,`smallestUnit`,`time`,void 0);if(o===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let s=function(e){return cu(e,`timeZoneName`,[`auto`,`never`,`critical`],`auto`)}(t),{precision:c,unit:l,increment:u}=ys(o,r);return Mc(this,c,n,s,i,{unit:l,increment:u,roundingMode:a})}toLocaleString(e=void 0,t=void 0){R(this,Jo);let n=ou(t),r=Object.create(null);if(function(e,t,n,r){if(t==null)return;let i=Reflect.ownKeys(t);for(let r=0;r<i.length;r++){let a=i[r];!n.some((e=>Object.is(e,a)))&&Object.prototype.propertyIsEnumerable.call(t,a)&&(e[a]=t[a])}}(r,n,[`timeZone`]),n.timeZone!==void 0)throw TypeError(`ZonedDateTime toLocaleString does not accept a timeZone option`);if(r.year===void 0&&r.month===void 0&&r.day===void 0&&r.era===void 0&&r.weekday===void 0&&r.dateStyle===void 0&&r.hour===void 0&&r.minute===void 0&&r.second===void 0&&r.fractionalSecondDigits===void 0&&r.timeStyle===void 0&&r.dayPeriod===void 0&&r.timeZoneName===void 0&&(r.timeZoneName=`short`),r.timeZone=L(this,sa),Nc(r.timeZone))throw RangeError(`toLocaleString does not currently support offset time zones`);let i=new Iu(e,r),a=Hee.call(i).calendar,o=L(this,ra);if(o!==`iso8601`&&a!==`iso8601`&&!lc(a,o))throw RangeError(`cannot format ZonedDateTime with calendar ${o} in locale with calendar ${a}`);return i.format(ec(L(this,$i)))}toJSON(){return R(this,Jo),Mc(this,`auto`)}valueOf(){du(`ZonedDateTime`)}startOfDay(){R(this,Jo);let e=L(this,sa);return nc(xc(e,cd(this).isoDate),e,L(this,ra))}getTimeZoneTransition(e){R(this,Jo);let t=L(this,sa);if(e===void 0)throw TypeError(`options parameter is required`);let n=cu(typeof e==`string`?su(`direction`,e):ou(e),`direction`,[`next`,`previous`],bs);if(n===void 0)throw TypeError(`direction option is required`);if(Nc(t)||t===`UTC`)return null;let r=L(this,$i),i=n===`next`?Wc(t,r):Gc(t,r);return i===null?null:nc(i,t,L(this,ra))}toInstant(){return R(this,Jo),ec(L(this,$i))}toPlainDate(){return R(this,Jo),Ws(cd(this).isoDate,L(this,ra))}toPlainTime(){return R(this,Jo),Xs(cd(this).time)}toPlainDateTime(){return R(this,Jo),Ks(cd(this),L(this,ra))}static from(e,t=void 0){return Hs(e,t)}static compare(e,t){let n=Hs(e),r=Hs(t),i=L(n,$i),a=L(r,$i);return I.default.lessThan(I.default.BigInt(i),I.default.BigInt(a))?-1:I.default.greaterThan(I.default.BigInt(i),I.default.BigInt(a))?1:0}};function cd(e){return _c(L(e,sa),L(e,$i))}function ld(e,t){R(e,Jo);let n=cd(e).isoDate;return Os(e).isoToDate(n,{[t]:!0})[t]}function ud(e,t){return R(e,Jo),cd(e).time[t]}Ia(sd,`Temporal.ZonedDateTime`);var dd=Object.freeze({__proto__:null,Duration:$u,Instant:qu,Now:rd,PlainDate:Ju,PlainDateTime:Xu,PlainMonthDay:ed,PlainTime:id,PlainYearMonth:ad,ZonedDateTime:sd});(class{toTemporalInstant(){return ec(tu(Date.prototype.valueOf.call(this)))}}).prototype.toTemporalInstant;const Uee=[qu,Ju,Xu,$u,ed,id,ad,sd];for(let e of Uee){let t=Object.getOwnPropertyDescriptor(e,`prototype`);(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(e,`prototype`,t))}const Wee=Symbol.for(`drizzle:CockroachMaterializedViewConfig`);function Gee(e){return{...e[te]}}function Kee(e){return{...e[te],...e[Wee]}}const qee=Symbol.for(`drizzle:MsSqlViewConfig`);function Jee(e){return{...e[te],...e[qee]}}const fd=Dt(import.meta.url);var Yee=Object.create,pd=Object.defineProperty,Xee=Object.getOwnPropertyDescriptor,md=Object.getOwnPropertyNames,Zee=Object.getPrototypeOf,Qee=Object.prototype.hasOwnProperty,z=(e=>fd===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(fd===void 0?e:fd)[t]}):e:fd)(function(e){if(fd!==void 0)return fd.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),B=(e,t)=>function(){return e&&(t=(0,e[md(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[md(e)[0]])((t={exports:{}}).exports,t),t.exports},hd=(e,t)=>{for(var n in t)pd(e,n,{get:t[n],enumerable:!0})},gd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of md(t))!Qee.call(e,i)&&i!==n&&pd(e,i,{get:()=>t[i],enumerable:!(r=Xee(t,i))||r.enumerable});return e},_d=(e,t,n)=>(n=e==null?{}:Yee(Zee(e)),gd(t||!e||!e.__esModule?pd(n,`default`,{value:e,enumerable:!0}):n,e)),vd=e=>gd(pd({},`__esModule`,{value:!0}),e);function yd(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=e[n];if(r&&typeof r==`object`&&r.CONTAINS!==void 0){if(!Array.isArray(t)||!t.find(e=>wd(e,r.CONTAINS)))return!1}else if(!wd(t,r))return!1}return!0}function bd(e,t){return e.filter(e=>yd(e,t))}function xd(e){return`${e.schema??``}:${e.table??``}:${e.name}:${e.entityType}`}function $ee(e,t){let n=xd(t);return e.find(e=>xd(e)===n)}function ete(e,t){let n=xd(t);return e.filter(e=>xd(e)===n)}function Sd(e,t,n=!1){if(typeof e!=`object`||!e)return!1;for(let r of Array.from(new Set([...Object.keys(e),...Object.keys(t)])))if(!(!n&&r===`entityType`)){if(!t[r])return!1;if(t[r]===`string[]`){if(!Array.isArray(e[r])||!e[r].every(e=>typeof e==`string`))return!1}else if(typeof t[r]==`string`){let n=t[r].endsWith(`?`);if(e[r]===null&&!n||e[r]!==null&&typeof e[r]!==kd(t[r]))return!1}else if(Array.isArray(t[r])){if(typeof t[r][0]==`string`){if(!t[r].some(t=>t===e[r]))return!1}else if(!Array.isArray(e[r])||!e[r].every(e=>Sd(e,t[r][0]),!0))return!1}else if(e[r]!==null&&!Sd(e[r],t[r],!0))return!1}return!0}function Cd({entities:e},t,n,r){let i=Object.entries(e),a=Object.fromEntries(Object.entries(n?r:e).map(([e,t])=>[e,Object.keys(t).filter(e=>e in jd).length+4]));return Object.fromEntries(i.map(([i,o])=>[i,{push:Md(n?r:e,t,n?void 0:i),list:Nd(t,n?void 0:i),one:Pd(t,n?void 0:i),update:Fd(t,n?void 0:i),delete:Id(t,n?void 0:i),validate:Rd(n?r:e,n?void 0:i),hasDiff:Ld(a)}]))}function wd(e,t){return typeof e==typeof t?Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>wd(e,t[n])):!1:typeof e==`object`?e===t?!0:(e===null||t===null)&&e!==t?!1:Array.from(new Set([...Object.keys(e),...Object.keys(t)])).every(n=>wd(e[n],t[n])):e===t:!1}function Td(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!zd[e]))}function Ed(e){let t={};for(let n of Object.keys(jd))e[n]===void 0||e[n]===null||(t[n]=e[n]);return t}function Dd(e,t,n,r){n??=`entities`,r??=`all`;let i=e.entities.list(n===`entities`?void 0:{entityType:n}),a=t.entities.list(n===`entities`?void 0:{entityType:n}),o={},s={};for(let e of i)o[xd(e)]=e;for(let e of a)s[xd(e)]=e;let c=[],l=[],u=[];for(let[e,t]of Object.entries(o)){let n=s[e];if(!n)(r===`all`||r===`drop`||r===`createdrop`)&&l.push({$diffType:`drop`,entityType:t.entityType,...Ed(t),...Td(t)});else if(r===`all`||r===`alter`){let e={},r=!1;for(let[i,a]of Object.entries(t))zd[i]||wd(t[i],n[i])||(r=!0,e[i]={from:t[i],to:n[i]});r&&u.push({$diffType:`alter`,entityType:n.entityType,...Ed(n),...e,$left:t,$right:n})}delete s[e]}if(r===`all`||r===`create`||r===`createdrop`)for(let e of Object.values(s))c.push({$diffType:`create`,entityType:e.entityType,...Ed(e),...Td(e)});return[...c,...l,...u]}function Od(e,t,n){return Dd(e,t,n,`createdrop`)}function kd(e){return e.endsWith(`?`)?e.slice(0,e.length-1):e}function Ad(e){let t=new Bd(e),n=Cd(t._,t._.store,!1);for(let[e,r]of Object.entries(n))t[e]=r;return t}var jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd=B({"src/dialects/dialect.ts"(){jd={schema:`string?`,table:`string?`,name:`string`},Md=(e,t,n)=>{let r=n?Object.fromEntries(Object.keys(e[n]).filter(e=>!jd[e]||!jd[e].endsWith(`?`)).map(e=>[e,null])):void 0;return(i,a)=>{let o=Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),s=n??o.entityType,c={...r??Object.fromEntries(Object.keys(e[s]).map(e=>[e,null])),...o,entityType:s},l=a?t.collection.find(e=>{if(e.entityType!==c.entityType)return!1;for(let t of a)if(t in c&&!wd(c[t],e[t]))return!1;return!0}):$ee(t.collection,c);return l?{status:`CONFLICT`,data:l}:(t.collection.push(c),{status:`OK`,data:c})}},Nd=(e,t)=>n=>{let r=t?bd(e.collection,{entityType:t}):e.collection;return n?bd(r,n):r},Pd=(e,t)=>n=>{let r=t?bd(e.collection,{entityType:t}):e.collection;return n?bd(r,n)[0]??null:r[0]??null},Fd=(e,t)=>({set:n,where:r})=>{let i=t?{...r,entityType:t}:r,a=i?bd(e.collection,i):e.collection,o=Object.entries(n),s=[],c=0,l=[];for(let t of a){let n={...t};for(let[e,r]of o){if(!(e in t))continue;let i=t[e];n[e]=typeof r==`function`?Array.isArray(i)?i.map(r):r(i):r}let r=ete(e.collection,n).filter(e=>e!==t);l.push(...r.filter(e=>!l.find(t=>t===e))),r.length||s.push({item:n,index:c++})}if(l.length)return{status:`CONFLICT`,data:l};for(let{index:e,item:t}of s)Object.assign(a[e],t);return{status:`OK`,data:a}},Id=(e,t)=>n=>{let r=[],i=[],a=t?{...n,entityType:t}:n;return a?(e.collection.forEach(e=>{yd(e,a)?i.push(e):r.push(e)}),e.collection=r,i):(e.collection=r,i)},Ld=e=>t=>{let n=e[t.entityType];return Object.keys(t).length>n},Rd=(e,t)=>(n=>{if(typeof n!=`object`||!n)return!1;let r=t??n.entityType;if(typeof r!=`string`||n.entityType!==r)return!1;let i=e[r];return i?Sd(n,i):!1}),zd={entityType:!0,name:!0,schema:!0,table:!0},(e=>{function t(e,t,n){return Dd(e,t,n,`all`)}e.all=t;function n(e,t,n){return Dd(e,t,n,`create`)}e.creates=n;function r(e,t,n){return Dd(e,t,n,`drop`)}e.drops=r;function i(e,t,n){return Dd(e,t,n,`alter`)}e.alters=i})(Od||={}),Bd=class{_={diffs:{},store:{collection:[]}};entities;constructor(e){let t=Object.entries(e),n=Object.fromEntries(t.map(([e,t])=>{if(e===`entities`||e===`_`)throw Error(`Illegal entity type name: "${e}"`);let n={};for(let r in Object.entries(t).forEach(([t,r])=>{if(n[t]=r,r===`required`){if(!(t in jd))throw Error(`Type value "required" is only applicable to common keys [ ${Object.keys(jd).map(e=>`"${e}"`).join(`, `)} ], used on: "${t}"`);n[t]=kd(jd[t])}else if(t in jd)throw Error(`Used forbidden key "${t}" in entity "${e}"`)}),jd)jd[r].endsWith(`?`)||(n[r]=jd[r]);return[e,n]}));this._.entities=n,this.entities=Cd({...this._,entities:{entities:jd}},this._.store,!0,this._.entities).entities}}}});function Hd(e){throw Error(`Didn't expect to get here`)}function Ud(e){return e.replace(/'/g,`''`)}function Wd(e,t,n,r=0){if(!Array.isArray(e))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)?Wd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Gd(e,t,n,r=0){if(!e.find(e=>Array.isArray(e)))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)&&e.find(e=>Array.isArray(e))?Gd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Kd(e){return af.test(e)}function qd(e){let t={},n=e.split(` `);if(n.length===1)return t;let r=n.slice(1,n.length).join(` `);if(of.includes(r))return{...t,fields:r};for(let e of of)if(r.startsWith(`${e}(`))return{...t,fields:e};return t}function Jd(e){let t=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)},n=(e,t)=>{let n=new ArrayBuffer(8),r=new DataView(n);for(let n=0;n<8;n++)r.setUint8(n,e[t+n]);return r.getFloat64(0,!0)},r=t(e),i=0,a=r[i];i+=1;let o=new DataView(r.buffer),s=o.getUint32(i,a===1);i+=4;let c;if(s&536870912&&(c=o.getUint32(i,a===1),i+=4),(s&65535)==1){let e=n(r,i);i+=8;let t=n(r,i);return i+=8,{srid:c,point:[e,t]}}throw Error(`Unsupported geometry type`)}var Yd,Xd,H,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf=B({"src/utils/index.ts"(){Yd=`00000000-0000-0000-0000-000000000000`,Xd=e=>e.map(e=>{let t=e.from.schema?`${e.from.schema}.`:``,n=e.to.schema?`${e.to.schema}.`:``,r=e.from.table?`${e.from.table}.`:``,i=e.to.table?`${e.to.table}.`:``;return`${t}${r}${e.from.name}->${n}${i}${e.to.name}`}),H=(e,t)=>e.length<2?e:typeof t==`string`&&e.startsWith(t)&&e.endsWith(t)||Array.isArray(t)&&e.startsWith(t[0])&&e.endsWith(t[1])?e.substring(1,e.length-1):e,Zd=(e,t)=>!e.startsWith(t)||!e.endsWith(t)?`${t}${e}${t}`:e,Qd=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?/,$d=e=>Qd.test(e),ef=/^\d{4}-\d{2}-\d{2}/,tf=e=>ef.test(e),nf=/^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?|\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)$/,rf=e=>nf.test(e),af=/([+-]\d{2}(:\d{2})?|Z)$/i,of=[`year`,`month`,`day`,`hour`,`minute`,`second`,`year to month`,`day to hour`,`day to minute`,`day to second`,`hour to minute`,`hour to second`,`minute to second`]}}),cf={};hd(cf,{StringBuffer:()=>bf,abstract:()=>lf,assert:()=>uf,checkNotNull:()=>Cf,clone:()=>tte,copyWithoutDuplicates:()=>gf,defineLazyProperty:()=>df,getDuplicates:()=>hf,isLexical:()=>vf,isSyntactic:()=>_f,padLeft:()=>yf,repeat:()=>mf,repeatFn:()=>ff,repeatStr:()=>pf,unescapeCodePoint:()=>xf,unexpectedObjToString:()=>Sf});function lf(e){let t=e||``;return function(){throw Error(`this method `+t+` is abstract! (it has no implementation in class `+this.constructor.name+`)`)}}function uf(e,t){if(!e)throw Error(t||`Assertion failed`)}function df(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||=n.call(this),r}})}function tte(e){return e&&Object.assign({},e)}function ff(e,t){let n=[];for(;t-- >0;)n.push(e());return n}function pf(e,t){return Array(t+1).join(e)}function mf(e,t){return ff(()=>e,t)}function hf(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];e.lastIndexOf(r)!==n&&t.indexOf(r)<0&&t.push(r)}return t}function gf(e){let t=[];return e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t}function _f(e){let t=e[0];return t===t.toUpperCase()}function vf(e){return!_f(e)}function yf(e,t,n){let r=n||` `;return e.length<t?pf(r,t-e.length)+e:e}function bf(){this.strings=[]}function xf(e){if(e.charAt(0)===`\\`)switch(e.charAt(1)){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
83
|
+
`))},async task(e,t){let n=Date.now(),r=await t(),i=`${Date.now()-n}ms DONE`,a=`.`.repeat(Math.max(1,45-e.length-i.length));return Si.message(`${e} ${F.default.dim(a)} ${F.default.green(i)}`,{symbol:F.default.green(`◆`)}),r},taskStatus(e,t){let n=`.`.repeat(Math.max(1,45-e.length-t.length));Si.message(`${e} ${F.default.dim(n)} ${F.default.dim(t)}`,{symbol:F.default.dim(`◇`)})},warn(e){Si.warn(e)}}}function Oi(e){return{aliases:e.aliases||[],description:e.description,devOnly:e.devOnly??!1,args:e.args||[],opts:e.opts||{},run:e.run}}const ki=[`canvas`,`esbuild`,`sharp`,`ultimate-express`,`uWebSockets.js`,`pino`,`pino-pretty`,`thread-stream`,`youch`],Ai=[`@esbuild/`,`@img/`,`@opentelemetry/`,`@dbos-inc/`,`@aws-sdk/`,`@smithy/`];function ji(){return[...ki,...Ai.map(e=>`${e}*`)]}async function Mi(){let e=[];try{await at(`./main.ts`),e.push(`./main.ts`)}catch{}for await(let t of ot(`./api/**/*.ts`))t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||t.includes(`/__fixtures__/`)||t.includes(`/databases/`)||e.push(t);return e}var Ni=Oi({description:`Build the application for production deployment`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`build`);let t=await Mi();e.step(`Found ${t.length} entry points`),await e.spinner(`Building production bundle`,async()=>{await ct(`./dist`,{recursive:!0,force:!0});let{build:e}=await import(`esbuild`);await e({banner:{js:`import{createRequire as __appos_createRequire}from"module";import{fileURLToPath as __appos_fileURLToPath}from"node:url";import{dirname as __appos_dirname}from"node:path";const __filename=__appos_fileURLToPath(import.meta.url);const __dirname=__appos_dirname(__filename);const require=__appos_createRequire(import.meta.url);`},bundle:!0,entryPoints:t,external:ji(),format:`esm`,minify:!0,outdir:`./dist`,outbase:`.`,platform:`node`,sourcemap:!0,splitting:!0,target:`node24`}),await N(`./api/databases`,`./dist/api/databases`,{recursive:!0})}),e.success(`Built to ./dist`),await e.cleanup(),e.outro()}}),I=t(i(((e,t)=>{var n=class e extends Array{constructor(t,n){if(super(t),this.sign=n,Object.setPrototypeOf(this,e.prototype),t>e.__kMaxLength)throw RangeError(`Maximum BigInt size exceeded`)}static BigInt(t){var n=Math.floor,r=Number.isFinite;if(typeof t==`number`){if(t===0)return e.__zero();if(e.__isOneDigitInt(t))return 0>t?e.__oneDigit(-t,!0):e.__oneDigit(t,!1);if(!r(t)||n(t)!==t)throw RangeError(`The number `+t+` cannot be converted to BigInt because it is not an integer`);return e.__fromDouble(t)}if(typeof t==`string`){let n=e.__fromString(t);if(n===null)throw SyntaxError(`Cannot convert `+t+` to a BigInt`);return n}if(typeof t==`boolean`)return!0===t?e.__oneDigit(1,!1):e.__zero();if(typeof t==`object`){if(t.constructor===e)return t;let n=e.__toPrimitive(t);return e.BigInt(n)}throw TypeError(`Cannot convert `+t+` to a BigInt`)}toDebugString(){let e=[`BigInt[`];for(let t of this)e.push((t&&(t>>>0).toString(16))+`, `);return e.push(`]`),e.join(``)}toString(t=10){if(2>t||36<t)throw RangeError(`toString() radix argument must be between 2 and 36`);return this.length===0?`0`:t&t-1?e.__toStringGeneric(this,t,!1):e.__toStringBasePowerOfTwo(this,t)}valueOf(){throw Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(t){let n=t.length;if(n===0)return 0;if(n===1){let e=t.__unsignedDigit(0);return t.sign?-e:e}let r=t.__digit(n-1),i=e.__clz30(r),a=30*n-i;if(1024<a)return t.sign?-1/0:1/0;let o=a-1,s=r,c=n-1,l=i+3,u=l===32?0:s<<l;u>>>=12;let d=l-12,f=12<=l?0:s<<20+l,p=20+l;for(0<d&&0<c&&(c--,s=t.__digit(c),u|=s>>>30-d,f=s<<d+2,p=d+2);0<p&&0<c;)c--,s=t.__digit(c),f|=30<=p?s<<p-30:s>>>30-p,p-=30;let m=e.__decideRounding(t,p,c,s);if((m===1||m===0&&(1&f)==1)&&(f=f+1>>>0,f===0&&(u++,u>>>20&&(u=0,o++,1023<o))))return t.sign?-1/0:1/0;let h=t.sign?-2147483648:0;return o=o+1023<<20,e.__kBitConversionInts[e.__kBitConversionIntHigh]=h|o|u,e.__kBitConversionInts[e.__kBitConversionIntLow]=f,e.__kBitConversionDouble[0]}static unaryMinus(e){if(e.length===0)return e;let t=e.__copy();return t.sign=!e.sign,t}static bitwiseNot(t){return t.sign?e.__absoluteSubOne(t).__trim():e.__absoluteAddOne(t,!0)}static exponentiate(t,n){if(n.sign)throw RangeError(`Exponent must be positive`);if(n.length===0)return e.__oneDigit(1,!1);if(t.length===0)return t;if(t.length===1&&t.__digit(0)===1)return t.sign&&!(1&n.__digit(0))?e.unaryMinus(t):t;if(1<n.length)throw RangeError(`BigInt too big`);let r=n.__unsignedDigit(0);if(r===1)return t;if(r>=e.__kMaxLengthBits)throw RangeError(`BigInt too big`);if(t.length===1&&t.__digit(0)===2){let n=1+(0|r/30),i=new e(n,t.sign&&(1&r)!=0);i.__initializeDigits();let a=1<<r%30;return i.__setDigit(n-1,a),i}let i=null,a=t;for(1&r&&(i=t),r>>=1;r!==0;r>>=1)a=e.multiply(a,a),1&r&&(i=i===null?a:e.multiply(i,a));return i}static multiply(t,n){if(t.length===0)return t;if(n.length===0)return n;let r=t.length+n.length;30<=t.__clzmsd()+n.__clzmsd()&&r--;let i=new e(r,t.sign!==n.sign);i.__initializeDigits();for(let r=0;r<t.length;r++)e.__multiplyAccumulate(n,t.__digit(r),i,r);return i.__trim()}static divide(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return e.__zero();let r=t.sign!==n.sign,i=n.__unsignedDigit(0),a;if(n.length===1&&32767>=i){if(i===1)return r===t.sign?t:e.unaryMinus(t);a=e.__absoluteDivSmall(t,i,null)}else a=e.__absoluteDivLarge(t,n,!0,!1);return a.sign=r,a.__trim()}static remainder(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return t;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return e.__zero();let n=e.__absoluteModSmall(t,r);return n===0?e.__zero():e.__oneDigit(n,t.sign)}let i=e.__absoluteDivLarge(t,n,!1,!0);return i.sign=t.sign,i.__trim()}static add(t,n){let r=t.sign;return r===n.sign?e.__absoluteAdd(t,n,r):0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r)}static subtract(t,n){let r=t.sign;return r===n.sign?0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r):e.__absoluteAdd(t,n,r)}static leftShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__rightShiftByAbsolute(t,n):e.__leftShiftByAbsolute(t,n)}static signedRightShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__leftShiftByAbsolute(t,n):e.__rightShiftByAbsolute(t,n)}static unsignedRightShift(){throw TypeError(`BigInts have no unsigned right shift; use >> instead`)}static lessThan(t,n){return 0>e.__compareToBigInt(t,n)}static lessThanOrEqual(t,n){return 0>=e.__compareToBigInt(t,n)}static greaterThan(t,n){return 0<e.__compareToBigInt(t,n)}static greaterThanOrEqual(t,n){return 0<=e.__compareToBigInt(t,n)}static equal(e,t){if(e.sign!==t.sign||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return!1;return!0}static notEqual(t,n){return!e.equal(t,n)}static bitwiseAnd(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteAnd(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length)+1,a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return a=e.__absoluteOr(a,o,a),e.__absoluteAddOne(a,!0,a).__trim()}return t.sign&&([t,n]=[n,t]),e.__absoluteAndNot(t,e.__absoluteSubOne(n)).__trim()}static bitwiseXor(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteXor(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length),a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return e.__absoluteXor(a,o,a).__trim()}let i=r(t.length,n.length)+1;t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteXor(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static bitwiseOr(t,n){var r=Math.max;let i=r(t.length,n.length);if(!t.sign&&!n.sign)return e.__absoluteOr(t,n).__trim();if(t.sign&&n.sign){let r=e.__absoluteSubOne(t,i),a=e.__absoluteSubOne(n);return r=e.__absoluteAnd(r,a,r),e.__absoluteAddOne(r,!0,r).__trim()}t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteAndNot(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static asIntN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=n.__unsignedDigit(i-1),o=1<<(t-1)%30;if(n.length===i&&a<o)return n;if((a&o)!==o)return e.__truncateToNBits(t,n);if(!n.sign)return e.__truncateAndSubFromPowerOfTwo(t,n,!0);if(!(a&o-1)){for(let r=i-2;0<=r;r--)if(n.__digit(r)!==0)return e.__truncateAndSubFromPowerOfTwo(t,n,!1);return n.length===i&&a===o?n:e.__truncateToNBits(t,n)}return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}static asUintN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(n.sign){if(t>e.__kMaxLengthBits)throw RangeError(`BigInt too big`);return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=t%30;return n.length==i&&(a===0||!(n.__digit(i-1)>>>a))?n:e.__truncateToNBits(t,n)}static ADD(t,n){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`)return typeof n!=`string`&&(n=n.toString()),t+n;if(typeof n==`string`)return t.toString()+n;if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)&&e.__isBigInt(n))return e.add(t,n);if(typeof t==`number`&&typeof n==`number`)return t+n;throw TypeError(`Cannot mix BigInt and other types, use explicit conversions`)}static LT(t,n){return e.__compare(t,n,0)}static LE(t,n){return e.__compare(t,n,1)}static GT(t,n){return e.__compare(t,n,2)}static GE(t,n){return e.__compare(t,n,3)}static EQ(t,n){for(;;){if(e.__isBigInt(t))return e.__isBigInt(n)?e.equal(t,n):e.EQ(n,t);if(typeof t==`number`){if(e.__isBigInt(n))return e.__equalToNumber(n,t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`string`){if(e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.equal(t,n);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`boolean`){if(e.__isBigInt(n))return e.__equalToNumber(n,+t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`symbol`){if(e.__isBigInt(n))return!1;if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`object`){if(typeof n==`object`&&n.constructor!==e)return t==n;t=e.__toPrimitive(t)}else return t==n}}static NE(t,n){return!e.EQ(t,n)}static DataViewGetBigInt64(t,n,r=!1){return e.asIntN(64,e.DataViewGetBigUint64(t,n,r))}static DataViewGetBigUint64(t,n,r=!1){let[i,a]=r?[4,0]:[0,4],o=t.getUint32(n+i,r),s=t.getUint32(n+a,r),c=new e(3,!1);return c.__setDigit(0,1073741823&s),c.__setDigit(1,(268435455&o)<<2|s>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(t,n,r,i=!1){e.DataViewSetBigUint64(t,n,r,i)}static DataViewSetBigUint64(t,n,r,i=!1){r=e.asUintN(64,r);let a=0,o=0;if(0<r.length&&(o=r.__digit(0),1<r.length)){let e=r.__digit(1);o|=e<<30,a=e>>>2,2<r.length&&(a|=r.__digit(2)<<28)}let[s,c]=i?[4,0]:[0,4];t.setUint32(n+s,a,i),t.setUint32(n+c,o,i)}static __zero(){return new e(0,!1)}static __oneDigit(t,n){let r=new e(1,n);return r.__setDigit(0,t),r}__copy(){let t=new e(this.length,this.sign);for(let e=0;e<this.length;e++)t[e]=this[e];return t}__trim(){let e=this.length,t=this[e-1];for(;t===0;)e--,t=this[e-1],this.pop();return e===0&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,t,n,r){if(0<t)return-1;let i;if(0>t)i=-t-1;else{if(n===0)return-1;n--,r=e.__digit(n),i=29}let a=1<<i;if((r&a)==0)return-1;if(--a,(r&a)!=0)return 1;for(;0<n;)if(n--,e.__digit(n)!==0)return 1;return 0}static __fromDouble(t){e.__kBitConversionDouble[0]=t;let n=(2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20)-1023,r=(0|n/30)+1,i=new e(r,0>t),a=1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh]|1048576,o=e.__kBitConversionInts[e.__kBitConversionIntLow],s=n%30,c,l=0;if(s<20){let e=20-s;l=e+32,c=a>>>e,a=a<<32-e|o>>>e,o<<=32-e}else if(s===20)l=32,c=a,a=o,o=0;else{let e=s-20;l=32-e,c=a<<e|o>>>32-e,a=o<<e,o=0}i.__setDigit(r-1,c);for(let e=r-2;0<=e;e--)0<l?(l-=30,c=a>>>2,a=a<<30|o>>>2,o<<=30):c=0,i.__setDigit(e,c);return i.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(t,n=0){let r=0,i=t.length,a=0;if(a===i)return e.__zero();let o=t.charCodeAt(a);for(;e.__isWhitespace(o);){if(++a===i)return e.__zero();o=t.charCodeAt(a)}if(o===43){if(++a===i)return null;o=t.charCodeAt(a),r=1}else if(o===45){if(++a===i)return null;o=t.charCodeAt(a),r=-1}if(n===0){if(n=10,o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(n=16,++a===i)return null;o=t.charCodeAt(a)}else if(o===79||o===111){if(n=8,++a===i)return null;o=t.charCodeAt(a)}else if(o===66||o===98){if(n=2,++a===i)return null;o=t.charCodeAt(a)}}}else if(n===16&&o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(++a===i)return null;o=t.charCodeAt(a)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++a===i)return e.__zero();o=t.charCodeAt(a)}let s=i-a,c=e.__kMaxBitsPerChar[n],l=e.__kBitsPerCharTableMultiplier-1;if(s>1073741824/c)return null;let u=new e(0|((c*s+l>>>e.__kBitsPerCharTableShift)+29)/30,!1),d=10>n?n:10,f=10<n?n-10:0;if(n&n-1){u.__initializeDigits();let r=!1,s=0;do{let p=0,m=1;for(;;){let e;if(o-48>>>0<d)e=o-48;else if((32|o)-97>>>0<f)e=(32|o)-87;else{r=!0;break}let c=m*n;if(1073741823<c)break;if(m=c,p=p*n+e,s++,++a===i){r=!0;break}o=t.charCodeAt(a)}l=30*e.__kBitsPerCharTableMultiplier-1;let h=0|(c*s+l>>>e.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(m,p,h)}while(!r)}else{c>>=e.__kBitsPerCharTableShift;let n=[],r=[],s=!1;do{let e=0,l=0;for(;;){let n;if(o-48>>>0<d)n=o-48;else if((32|o)-97>>>0<f)n=(32|o)-87;else{s=!0;break}if(l+=c,e=e<<c|n,++a===i){s=!0;break}if(o=t.charCodeAt(a),30<l+c)break}n.push(e),r.push(l)}while(!s);e.__fillFromParts(u,n,r)}if(a!==i){if(!e.__isWhitespace(o))return null;for(a++;a<i;a++)if(o=t.charCodeAt(a),!e.__isWhitespace(o))return null}return u.sign=r==-1,u.__trim()}static __fillFromParts(e,t,n){let r=0,i=0,a=0;for(let o=t.length-1;0<=o;o--){let s=t[o],c=n[o];i|=s<<a,a+=c,a===30?(e.__setDigit(r++,i),a=0,i=0):30<a&&(e.__setDigit(r++,1073741823&i),a-=30,i=s>>>c-a)}if(i!==0){if(r>=e.length)throw Error(`implementation bug`);e.__setDigit(r++,i)}for(;r<e.length;r++)e.__setDigit(r,0)}static __toStringBasePowerOfTwo(t,n){let r=t.length,i=n-1;i=(85&i>>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);let a=i,o=n-1,s=t.__digit(r-1),c=e.__clz30(s),l=0|(30*r-c+a-1)/a;if(t.sign&&l++,268435456<l)throw Error(`string too long`);let u=Array(l),d=l-1,f=0,p=0;for(let n=0;n<r-1;n++){let r=t.__digit(n),i=(f|r<<p)&o;u[d--]=e.__kConversionChars[i];let s=a-p;for(f=r>>>s,p=30-s;p>=a;)u[d--]=e.__kConversionChars[f&o],f>>>=a,p-=a}let m=(f|s<<p)&o;for(u[d--]=e.__kConversionChars[m],f=s>>>a-p;f!==0;)u[d--]=e.__kConversionChars[f&o],f>>>=a;if(t.sign&&(u[d--]=`-`),d!=-1)throw Error(`implementation bug`);return u.join(``)}static __toStringGeneric(t,n,r){let i=t.length;if(i===0)return``;if(i===1){let e=t.__unsignedDigit(0).toString(n);return!1===r&&t.sign&&(e=`-`+e),e}let a=30*i-e.__clz30(t.__digit(i-1)),o=e.__kMaxBitsPerChar[n]-1,s=a*e.__kBitsPerCharTableMultiplier;s+=o-1,s=0|s/o;let c=s+1>>1,l=e.exponentiate(e.__oneDigit(n,!1),e.__oneDigit(c,!1)),u,d,f=l.__unsignedDigit(0);if(l.length===1&&32767>=f){u=new e(t.length,!1),u.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){let n=r<<15|t.__halfDigit(e);u.__setHalfDigit(e,0|n/f),r=0|n%f}d=r.toString(n)}else{let r=e.__absoluteDivLarge(t,l,!0,!0);u=r.quotient;let i=r.remainder.__trim();d=e.__toStringGeneric(i,n,!0)}u.__trim();let p=e.__toStringGeneric(u,n,!0);for(;d.length<c;)d=`0`+d;return!1===r&&t.sign&&(p=`-`+p),p+d}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(t,n){let r=t.sign;if(r!==n.sign)return e.__unequalSign(r);let i=e.__absoluteCompare(t,n);return 0<i?e.__absoluteGreater(r):0>i?e.__absoluteLess(r):0}static __compareToNumber(t,n){if(e.__isOneDigitInt(n)){let r=t.sign,i=0>n;if(r!==i)return e.__unequalSign(r);if(t.length===0){if(i)throw Error(`implementation bug`);return n===0?0:-1}if(1<t.length)return e.__absoluteGreater(r);let a=Math.abs(n),o=t.__unsignedDigit(0);return o>a?e.__absoluteGreater(r):o<a?e.__absoluteLess(r):0}return e.__compareToDouble(t,n)}static __compareToDouble(t,n){if(n!==n)return n;if(n===1/0)return-1;if(n===-1/0)return 1;let r=t.sign;if(r!==0>n)return e.__unequalSign(r);if(n===0)throw Error(`implementation bug: should be handled elsewhere`);if(t.length===0)return-1;e.__kBitConversionDouble[0]=n;let i=2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20;if(i==2047)throw Error(`implementation bug: handled elsewhere`);let a=i-1023;if(0>a)return e.__absoluteGreater(r);let o=t.length,s=t.__digit(o-1),c=e.__clz30(s),l=30*o-c,u=a+1;if(l<u)return e.__absoluteLess(r);if(l>u)return e.__absoluteGreater(r);let d=1048576|1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh],f=e.__kBitConversionInts[e.__kBitConversionIntLow],p=29-c;if(p!==(0|(l-1)%30))throw Error(`implementation bug`);let m,h=0;if(20>p){let e=20-p;h=e+32,m=d>>>e,d=d<<32-e|f>>>e,f<<=32-e}else if(p===20)h=32,m=d,d=f,f=0;else{let e=p-20;h=32-e,m=d<<e|f>>>32-e,d=f<<e,f=0}if(s>>>=0,m>>>=0,s>m)return e.__absoluteGreater(r);if(s<m)return e.__absoluteLess(r);for(let n=o-2;0<=n;n--){0<h?(h-=30,m=d>>>2,d=d<<30|f>>>2,f<<=30):m=0;let i=t.__unsignedDigit(n);if(i>m)return e.__absoluteGreater(r);if(i<m)return e.__absoluteLess(r)}if(d!==0||f!==0){if(h===0)throw Error(`implementation bug`);return e.__absoluteLess(r)}return 0}static __equalToNumber(t,n){var r=Math.abs;return e.__isOneDigitInt(n)?n===0?t.length===0:t.length===1&&t.sign===0>n&&t.__unsignedDigit(0)===r(n):e.__compareToDouble(t,n)===0}static __comparisonResultToBool(e,t){return t===0?0>e:t===1?0>=e:t===2?0<e:t===3?0<=e:void 0}static __compare(t,n,r){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`&&typeof n==`string`)switch(r){case 0:return t<n;case 1:return t<=n;case 2:return t>n;case 3:return t>=n}if(e.__isBigInt(t)&&typeof n==`string`)return n=e.__fromString(n),n!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof t==`string`&&e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)){if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof n!=`number`)throw Error(`implementation bug`);return e.__comparisonResultToBool(e.__compareToNumber(t,n),r)}if(typeof t!=`number`)throw Error(`implementation bug`);if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToNumber(n,t),2^r);if(typeof n!=`number`)throw Error(`implementation bug`);return r===0?t<n:r===1?t<=n:r===2?t>n:r===3?t>=n:void 0}__clzmsd(){return e.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,n,r){if(t.length<n.length)return e.__absoluteAdd(n,t,r);if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=t.length;(t.__clzmsd()===0||n.length===t.length&&n.__clzmsd()===0)&&i++;let a=new e(i,r),o=0,s=0;for(;s<n.length;s++){let e=t.__digit(s)+n.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}for(;s<t.length;s++){let e=t.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}return s<a.length&&a.__setDigit(s,o),a.__trim()}static __absoluteSub(t,n,r){if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=new e(t.length,r),a=0,o=0;for(;o<n.length;o++){let e=t.__digit(o)-n.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}for(;o<t.length;o++){let e=t.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}return i.__trim()}static __absoluteAddOne(t,n,r=null){let i=t.length;r===null?r=new e(i,n):r.sign=n;let a=1;for(let e=0;e<i;e++){let n=t.__digit(e)+a;a=n>>>30,r.__setDigit(e,1073741823&n)}return a!=0&&r.__setDigitGrow(i,1),r}static __absoluteSubOne(t,n){let r=t.length;n||=r;let i=new e(n,!1),a=1;for(let e=0;e<r;e++){let n=t.__digit(e)-a;a=1&n>>>30,i.__setDigit(e,1073741823&n)}if(a!=0)throw Error(`implementation bug`);for(let e=r;e<n;e++)i.__setDigit(e,0);return i}static __absoluteAnd(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=o;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&n.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteAndNot(t,n,r=null){let i=t.length,a=n.length,o=a;i<a&&(o=i);let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&~n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteOr(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)|n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteXor(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)^n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteCompare(e,t){let n=e.length-t.length;if(n!=0)return n;let r=e.length-1;for(;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}static __multiplyAccumulate(t,n,r,i){if(n===0)return;let a=32767&n,o=n>>>15,s=0,c=0;for(let n,l=0;l<t.length;l++,i++){n=r.__digit(i);let u=t.__digit(l),d=32767&u,f=u>>>15,p=e.__imul(d,a),m=e.__imul(d,o),h=e.__imul(f,a),g=e.__imul(f,o);n+=c+p+s,s=n>>>30,n&=1073741823,n+=((32767&m)<<15)+((32767&h)<<15),s+=n>>>30,c=g+(m>>>15)+(h>>>15),r.__setDigit(i,1073741823&n)}for(;s!=0||c!==0;i++){let e=r.__digit(i);e+=s+c,c=0,s=e>>>30,r.__setDigit(i,1073741823&e)}}static __internalMultiplyAdd(t,n,r,i,a){let o=r,s=0;for(let r=0;r<i;r++){let i=t.__digit(r),c=e.__imul(32767&i,n),l=e.__imul(i>>>15,n),u=c+((32767&l)<<15)+s+o;o=u>>>30,s=l>>>15,a.__setDigit(r,1073741823&u)}if(a.length>i)for(a.__setDigit(i++,o+s);i<a.length;)a.__setDigit(i++,0);else if(o+s!==0)throw Error(`implementation bug`)}__inplaceMultiplyAdd(t,n,r){r>this.length&&(r=this.length);let i=32767&t,a=t>>>15,o=0,s=n;for(let t=0;t<r;t++){let n=this.__digit(t),r=32767&n,c=n>>>15,l=e.__imul(r,i),u=e.__imul(r,a),d=e.__imul(c,i),f=e.__imul(c,a),p=s+l+o;o=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&d)<<15),o+=p>>>30,s=f+(u>>>15)+(d>>>15),this.__setDigit(t,1073741823&p)}if(o!=0||s!==0)throw Error(`implementation bug`)}static __absoluteDivSmall(t,n,r=null){r===null&&(r=new e(t.length,!1));let i=0;for(let e,a=2*t.length-1;0<=a;a-=2){e=(i<<15|t.__halfDigit(a))>>>0;let o=0|e/n;i=0|e%n,e=(i<<15|t.__halfDigit(a-1))>>>0;let s=0|e/n;i=0|e%n,r.__setDigit(a>>>1,o<<15|s)}return r}static __absoluteModSmall(e,t){let n=0;for(let r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}static __absoluteDivLarge(t,n,r,i){let a=n.__halfDigitLength(),o=n.length,s=t.__halfDigitLength()-a,c=null;r&&(c=new e(s+2>>>1,!1),c.__initializeDigits());let l=new e(a+2>>>1,!1);l.__initializeDigits();let u=e.__clz15(n.__halfDigit(a-1));0<u&&(n=e.__specialLeftShift(n,u,0));let d=e.__specialLeftShift(t,u,1),f=n.__halfDigit(a-1),p=0;for(let t,i=s;0<=i;i--){t=32767;let s=d.__halfDigit(i+a);if(s!==f){let r=(s<<15|d.__halfDigit(i+a-1))>>>0;t=0|r/f;let o=0|r%f,c=n.__halfDigit(a-2),l=d.__halfDigit(i+a-2);for(;e.__imul(t,c)>>>0>(o<<16|l)>>>0&&(t--,o+=f,!(32767<o)););}e.__internalMultiplyAdd(n,t,0,o,l);let u=d.__inplaceSub(l,i,a+1);u!==0&&(u=d.__inplaceAdd(n,i,a),d.__setHalfDigit(i+a,32767&d.__halfDigit(i+a)+u),t--),r&&(1&i?p=t<<15:c.__setDigit(i>>>1,p|t))}if(i)return d.__inplaceRightShift(u),r?{quotient:c,remainder:d}:d;if(r)return c;throw Error(`unreachable`)}static __clz15(t){return e.__clz30(t)-15}__inplaceAdd(e,t,n){let r=0;for(let i=0;i<n;i++){let n=this.__halfDigit(t+i)+e.__halfDigit(i)+r;r=n>>>15,this.__setHalfDigit(t+i,32767&n)}return r}__inplaceSub(e,t,n){let r=0;if(1&t){t>>=1;let i=this.__digit(t),a=32767&i,o=0;for(;o<n-1>>>1;o++){let n=e.__digit(o),s=(i>>>15)-(32767&n)-r;r=1&s>>>15,this.__setDigit(t+o,(32767&s)<<15|32767&a),i=this.__digit(t+o+1),a=(32767&i)-(n>>>15)-r,r=1&a>>>15}let s=e.__digit(o),c=(i>>>15)-(32767&s)-r;if(r=1&c>>>15,this.__setDigit(t+o,(32767&c)<<15|32767&a),t+o+1>=this.length)throw RangeError(`out of bounds`);!(1&n)&&(i=this.__digit(t+o+1),a=(32767&i)-(s>>>15)-r,r=1&a>>>15,this.__setDigit(t+e.length,1073709056&i|32767&a))}else{t>>=1;let i=0;for(;i<e.length-1;i++){let n=this.__digit(t+i),a=e.__digit(i),o=(32767&n)-(32767&a)-r;r=1&o>>>15;let s=(n>>>15)-(a>>>15)-r;r=1&s>>>15,this.__setDigit(t+i,(32767&s)<<15|32767&o)}let a=this.__digit(t+i),o=e.__digit(i),s=(32767&a)-(32767&o)-r;r=1&s>>>15;let c=0;!(1&n)&&(c=(a>>>15)-(o>>>15)-r,r=1&c>>>15),this.__setDigit(t+i,(32767&c)<<15|32767&s)}return r}__inplaceRightShift(e){if(e===0)return;let t=this.__digit(0)>>>e,n=this.length-1;for(let r=0;r<n;r++){let n=this.__digit(r+1);this.__setDigit(r,1073741823&n<<30-e|t),t=n>>>e}this.__setDigit(n,t)}static __specialLeftShift(t,n,r){let i=t.length,a=new e(i+r,!1);if(n===0){for(let e=0;e<i;e++)a.__setDigit(e,t.__digit(e));return 0<r&&a.__setDigit(i,0),a}let o=0;for(let e=0;e<i;e++){let r=t.__digit(e);a.__setDigit(e,1073741823&r<<n|o),o=r>>>30-n}return 0<r&&a.__setDigit(i,o),a}static __leftShiftByAbsolute(t,n){let r=e.__toShiftAmount(n);if(0>r)throw RangeError(`BigInt too big`);let i=0|r/30,a=r%30,o=t.length,s=a!==0&&t.__digit(o-1)>>>30-a!=0,c=o+i+(s?1:0),l=new e(c,t.sign);if(a===0){let e=0;for(;e<i;e++)l.__setDigit(e,0);for(;e<c;e++)l.__setDigit(e,t.__digit(e-i))}else{let e=0;for(let e=0;e<i;e++)l.__setDigit(e,0);for(let n=0;n<o;n++){let r=t.__digit(n);l.__setDigit(n+i,1073741823&r<<a|e),e=r>>>30-a}if(s)l.__setDigit(o+i,e);else if(e!==0)throw Error(`implementation bug`)}return l.__trim()}static __rightShiftByAbsolute(t,n){let r=t.length,i=t.sign,a=e.__toShiftAmount(n);if(0>a)return e.__rightShiftByMaximum(i);let o=0|a/30,s=a%30,c=r-o;if(0>=c)return e.__rightShiftByMaximum(i);let l=!1;if(i){if(t.__digit(o)&(1<<s)-1)l=!0;else for(let e=0;e<o;e++)if(t.__digit(e)!==0){l=!0;break}}l&&s===0&&~t.__digit(r-1)==0&&c++;let u=new e(c,i);if(s===0){u.__setDigit(c-1,0);for(let e=o;e<r;e++)u.__setDigit(e-o,t.__digit(e))}else{let e=t.__digit(o)>>>s,n=r-o-1;for(let r=0;r<n;r++){let n=t.__digit(r+o+1);u.__setDigit(r,1073741823&n<<30-s|e),e=n>>>s}u.__setDigit(n,e)}return l&&(u=e.__absoluteAddOne(u,!0,u)),u.__trim()}static __rightShiftByMaximum(t){return t?e.__oneDigit(1,!0):e.__zero()}static __toShiftAmount(t){if(1<t.length)return-1;let n=t.__unsignedDigit(0);return n>e.__kMaxLengthBits?-1:n}static __toPrimitive(t,n=`default`){if(typeof t!=`object`||t.constructor===e)return t;if(typeof Symbol<`u`&&typeof Symbol.toPrimitive==`symbol`&&t[Symbol.toPrimitive]){let e=t[Symbol.toPrimitive](n);if(typeof e!=`object`)return e;throw TypeError(`Cannot convert object to primitive value`)}let r=t.valueOf;if(r){let e=r.call(t);if(typeof e!=`object`)return e}let i=t.toString;if(i){let e=i.call(t);if(typeof e!=`object`)return e}throw TypeError(`Cannot convert object to primitive value`)}static __toNumeric(t){return e.__isBigInt(t)?t:+t}static __isBigInt(t){return typeof t==`object`&&!!t&&t.constructor===e}static __truncateToNBits(t,n){let r=0|(t+29)/30,i=new e(r,n.sign),a=r-1;for(let e=0;e<a;e++)i.__setDigit(e,n.__digit(e));let o=n.__digit(a);if(t%30!=0){let e=32-t%30;o=o<<e>>>e}return i.__setDigit(a,o),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,n,r){var i=Math.min;let a=0|(t+29)/30,o=new e(a,r),s=0,c=a-1,l=0;for(let e=i(c,n.length);s<e;s++){let e=0-n.__digit(s)-l;l=1&e>>>30,o.__setDigit(s,1073741823&e)}for(;s<c;s++)o.__setDigit(s,0|1073741823&-l);let u=c<n.length?n.__digit(c):0,d=t%30,f;if(d==0)f=0-u-l,f&=1073741823;else{let e=32-d;u=u<<e>>>e;let t=1<<32-e;f=t-u-l,f&=t-1}return o.__setDigit(c,f),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,t){this[e]=0|t}__setDigitGrow(e,t){this[e]=0|t}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,t){let n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}static __digitPow(e,t){let n=1;for(;0<t;)1&t&&(n*=e),t>>>=1,e*=e;return n}static __detectBigEndian(){return e.__kBitConversionDouble[0]=-0,e.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};n.__kMaxLength=33554432,n.__kMaxLengthBits=n.__kMaxLength<<5,n.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],n.__kBitsPerCharTableShift=5,n.__kBitsPerCharTableMultiplier=1<<n.__kBitsPerCharTableShift,n.__kConversionChars=`0123456789abcdefghijklmnopqrstuvwxyz`.split(``),n.__kBitConversionBuffer=new ArrayBuffer(8),n.__kBitConversionDouble=new Float64Array(n.__kBitConversionBuffer),n.__kBitConversionInts=new Int32Array(n.__kBitConversionBuffer),n.__kBitConversionIntHigh=n.__detectBigEndian()?0:1,n.__kBitConversionIntLow=n.__detectBigEndian()?1:0,n.__clz30=Math.clz32?function(e){return Math.clz32(e)-2}:function(e){return e===0?30:0|29-(0|Math.log(e>>>0)/Math.LN2)},n.__imul=Math.imul||function(e,t){return 0|e*t},t.exports=n}))(),1);const Pi=I.default.BigInt(0),Fi=I.default.BigInt(1),Ii=I.default.BigInt(2),Li=I.default.BigInt(10),Ri=I.default.BigInt(24),zi=I.default.BigInt(60),Bi=I.default.BigInt(1e3),Vi=I.default.BigInt(1e6),Hi=I.default.BigInt(1e9),Ui=I.default.multiply(I.default.BigInt(3600),Hi),Wi=I.default.multiply(zi,Hi),Gi=I.default.multiply(Ui,Ri);function Ki(e){return typeof e==`bigint`?I.default.BigInt(e.toString(10)):e}function qi(e){return I.default.equal(I.default.remainder(e,Ii),Pi)}function Ji(e){return I.default.lessThan(e,Pi)?I.default.unaryMinus(e):e}function Yi(e,t){return I.default.lessThan(e,t)?-1:I.default.greaterThan(e,t)?1:0}function Xi(e,t){return{quotient:I.default.divide(e,t),remainder:I.default.remainder(e,t)}}var Zi,Qi;const $i=`slot-epochNanoSeconds`,ea=`slot-iso-date`,ta=`slot-iso-date-time`,na=`slot-time`,ra=`slot-calendar`,ia=`slot-date-brand`,aa=`slot-year-month-brand`,oa=`slot-month-day-brand`,sa=`slot-time-zone`,ca=`slot-years`,la=`slot-months`,ua=`slot-weeks`,da=`slot-days`,fa=`slot-hours`,pa=`slot-minutes`,ma=`slot-seconds`,ha=`slot-milliseconds`,ga=`slot-microseconds`,_a=`slot-nanoseconds`,va=`date`,ya=`time`,ba=`datetime`,xa=`instant`,Sa=`original`,Ca=`timezone-canonical`,wa=`timezone-original`,Ta=`calendar-id`,Ea=`locale`,Da=`options`,Oa=new WeakMap,ka=Symbol.for(`@@Temporal__GetSlots`);(Zi=globalThis)[ka]||(Zi[ka]=function(e){return Oa.get(e)});const Aa=globalThis[ka],ja=Symbol.for(`@@Temporal__CreateSlots`);(Qi=globalThis)[ja]||(Qi[ja]=function(e){Oa.set(e,Object.create(null))});const Ma=globalThis[ja];function Na(e,...t){if(!e||typeof e!=`object`)return!1;let n=Aa(e);return!!n&&t.every((e=>e in n))}function L(e,t){let n=Aa(e)?.[t];if(n===void 0)throw TypeError(`Missing internal slot ${t}`);return n}function Pa(e,t,n){let r=Aa(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t])throw TypeError(`${t} already has set`);r[t]=n}const Fa={};function Ia(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let n=Object.getOwnPropertyNames(e);for(let t=0;t<n.length;t++){let r=n[t],i=Object.getOwnPropertyDescriptor(e,r);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e,r,i))}let r=Object.getOwnPropertyNames(e.prototype);for(let t=0;t<r.length;t++){let n=r[t],i=Object.getOwnPropertyDescriptor(e.prototype,n);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e.prototype,n,i))}La(t,e),La(`${t}.prototype`,e.prototype)}function La(e,t){let n=`%${e}%`;if(Fa[n]!==void 0)throw Error(`intrinsic ${e} already exists`);Fa[n]=t}function Ra(e){return Fa[e]}function za(e,t){let n=e;if(n===0)return{div:n,mod:n};let r=Math.sign(n);n=Math.abs(n);let i=Math.trunc(1+Math.log10(n));if(t>=i)return{div:0*r,mod:r*n};if(t===0)return{div:r*n,mod:0*r};let a=n.toPrecision(i);return{div:r*Number.parseInt(a.slice(0,i-t),10),mod:r*Number.parseInt(a.slice(i-t),10)}}function Ba(e,t,n){let r=e,i=n;if(r===0)return i;let a=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let o=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return a*Number.parseInt(o+`0`.repeat(t),10);let s=o+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,`0`);return a*Number.parseInt(s,10)}function Va(e,t){let n=t===`negative`;switch(e){case`ceil`:return n?`zero`:`infinity`;case`floor`:return n?`infinity`:`zero`;case`expand`:return`infinity`;case`trunc`:return`zero`;case`halfCeil`:return n?`half-zero`:`half-infinity`;case`halfFloor`:return n?`half-infinity`:`half-zero`;case`halfExpand`:return`half-infinity`;case`halfTrunc`:return`half-zero`;case`halfEven`:return`half-even`}}function Ha(e,t,n,r,i){return i===`zero`?e:i===`infinity`?t:n<0?e:n>0?t:i===`half-zero`?e:i===`half-infinity`?t:r?e:t}var Ua=class e{constructor(e){this.totalNs=Ki(e),this.sec=I.default.toNumber(I.default.divide(this.totalNs,Hi)),this.subsec=I.default.toNumber(I.default.remainder(this.totalNs,Hi))}static validateNew(t,n){if(I.default.greaterThan(Ji(t),e.MAX))throw RangeError(`${n} of duration time units cannot exceed ${e.MAX} s`);return new e(t)}static fromEpochNsDiff(t,n){return new e(I.default.subtract(Ki(t),Ki(n)))}static fromComponents(t,n,r,i,a,o){let s=I.default.add(I.default.add(I.default.add(I.default.add(I.default.add(I.default.BigInt(o),I.default.multiply(I.default.BigInt(a),Bi)),I.default.multiply(I.default.BigInt(i),Vi)),I.default.multiply(I.default.BigInt(r),Hi)),I.default.multiply(I.default.BigInt(n),Wi)),I.default.multiply(I.default.BigInt(t),Ui));return e.validateNew(s,`total`)}abs(){return new e(Ji(this.totalNs))}add(t){return e.validateNew(I.default.add(this.totalNs,t.totalNs),`sum`)}add24HourDays(t){return e.validateNew(I.default.add(this.totalNs,I.default.multiply(I.default.BigInt(t),Gi)),`sum`)}addToEpochNs(e){return I.default.add(Ki(e),this.totalNs)}cmp(e){return Yi(this.totalNs,e.totalNs)}divmod(t){let{quotient:n,remainder:r}=Xi(this.totalNs,I.default.BigInt(t));return{quotient:I.default.toNumber(n),remainder:new e(r)}}fdiv(e){let t=Ki(e),n=I.default.BigInt(t),{quotient:r,remainder:i}=Xi(this.totalNs,n),a=[],o,s=(I.default.lessThan(this.totalNs,Pi)?-1:1)*Math.sign(I.default.toNumber(t));for(;!I.default.equal(i,Pi)&&a.length<50;)i=I.default.multiply(i,Li),{quotient:o,remainder:i}=Xi(i,n),a.push(Math.abs(I.default.toNumber(o)));return s*Number(Ji(r).toString()+`.`+a.join(``))}isZero(){return I.default.equal(this.totalNs,Pi)}round(t,n){let r=Ki(t);if(I.default.equal(r,Fi))return this;let{quotient:i,remainder:a}=Xi(this.totalNs,r),o=I.default.lessThan(this.totalNs,Pi)?`negative`:`positive`,s=I.default.multiply(Ji(i),r),c=I.default.add(s,r),l=Yi(Ji(I.default.multiply(a,Ii)),r),u=Va(n,o),d=I.default.equal(Ji(this.totalNs),s)?s:Ha(s,c,l,qi(i),u),f=o===`positive`?d:I.default.unaryMinus(d);return e.validateNew(f,`rounding`)}sign(){return this.cmp(new e(Pi))}subtract(t){return e.validateNew(I.default.subtract(this.totalNs,t.totalNs),`difference`)}};Ua.MAX=I.default.BigInt(`9007199254740991999999999`),Ua.ZERO=new Ua(Pi);const Wa=/[A-Za-z._][A-Za-z._0-9+-]*/,Ga=RegExp(`(?:(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)|(?:${Wa.source})(?:\\/(?:${Wa.source}))*)`),Ka=/(?:[+-]\d{6}|\d{4})/,qa=/(?:0[1-9]|1[0-2])/,Ja=/(?:0[1-9]|[12]\d|3[01])/,Ya=RegExp(`(${Ka.source})(?:-(${qa.source})-(${Ja.source})|(${qa.source})(${Ja.source}))`),Xa=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Za=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Qa=RegExp(`([zZ])|${Za.source}?`),$a=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,eo=new RegExp([`^${Ya.source}`,`(?:(?:[tT]|\\s+)${Xa.source}(?:${Qa.source})?)?`,`(?:\\[!?(${Ga.source})\\])?`,`((?:${$a.source})*)$`].join(``)),to=new RegExp([`^[tT]?${Xa.source}`,`(?:${Qa.source})?`,`(?:\\[!?${Ga.source}\\])?`,`((?:${$a.source})*)$`].join(``)),no=RegExp(`^(${Ka.source})-?(${qa.source})(?:\\[!?${Ga.source}\\])?((?:${$a.source})*)$`),ro=RegExp(`^(?:--)?(${qa.source})-?(${Ja.source})(?:\\[!?${Ga.source}\\])?((?:${$a.source})*)$`),io=/(\d+)(?:[.,](\d{1,9}))?/,ao=RegExp(`(?:${io.source}H)?(?:${io.source}M)?(?:${io.source}S)?`),oo=RegExp(`^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?!$)${ao.source})?$`,`i`),so=864e5,co=1e6*so,lo=1e8*so,uo=tu(lo),fo=I.default.unaryMinus(uo),po=I.default.add(I.default.subtract(fo,Gi),Fi),mo=I.default.subtract(I.default.add(uo,Gi),Fi);146097*so;const ho=-271821,go=275760,_o=Date.UTC(1847,0,1),vo=[`iso8601`,`hebrew`,`islamic`,`islamic-umalqura`,`islamic-tbla`,`islamic-civil`,`islamic-rgsa`,`islamicc`,`persian`,`ethiopic`,`ethioaa`,`ethiopic-amete-alem`,`coptic`,`chinese`,`dangi`,`roc`,`indian`,`buddhist`,`japanese`,`gregory`],yo=new Set([`ACT`,`AET`,`AGT`,`ART`,`AST`,`BET`,`BST`,`CAT`,`CNT`,`CST`,`CTT`,`EAT`,`ECT`,`IET`,`IST`,`JST`,`MIT`,`NET`,`NST`,`PLT`,`PNT`,`PRT`,`PST`,`SST`,`VST`]);function bo(e){return typeof e==`object`&&!!e||typeof e==`function`}function xo(e){if(typeof e==`bigint`)throw TypeError(`Cannot convert BigInt to number`);return Number(e)}function So(e){if(typeof e==`symbol`)throw TypeError(`Cannot convert a Symbol value to a String`);return String(e)}function Co(e){let t=xo(e);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw RangeError(`invalid number value`);let n=Math.trunc(t);return n===0?0:n}function wo(e,t){let n=Co(e);if(n<=0)throw t===void 0?RangeError(`Cannot convert a number less than one to a positive integer`):RangeError(`property '${t}' cannot be a a number less than one`);return n}function To(e){let t=xo(e);if(Number.isNaN(t))throw RangeError(`not a number`);if(t===1/0||t===-1/0)throw RangeError(`infinity is out of range`);if(!function(e){if(typeof e!=`number`||Number.isNaN(e)||e===1/0||e===-1/0)return!1;let t=Math.abs(e);return Math.floor(t)===t}(t))throw RangeError(`unsupported fractional value ${e}`);return t===0?0:t}function Eo(e,t){return String(e).padStart(t,`0`)}function Do(e){if(typeof e!=`string`)throw TypeError(`expected a string, not ${String(e)}`);return e}function Oo(e,t){if(bo(e)){let t=e?.toString();if(typeof t==`string`||typeof t==`number`)return t;throw TypeError(`Cannot convert object to primitive value`)}return e}const ko=[`era`,`eraYear`,`year`,`month`,`monthCode`,`day`,`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],Ao={era:So,eraYear:Co,year:Co,month:wo,monthCode:function(e){let t=Do(Oo(e));if(t.length<3||t.length>4||t[0]!==`M`||`0123456789`.indexOf(t[1])===-1||`0123456789`.indexOf(t[2])===-1||t[1]+t[2]===`00`&&t[3]!==`L`||t[3]!==`L`&&t[3]!==void 0)throw RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:wo,hour:Co,minute:Co,second:Co,millisecond:Co,microsecond:Co,nanosecond:Co,offset:function(e){let t=Do(Oo(e));return Pc(t),t},timeZone:pc},jo={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Mo=[[`years`,`year`,`date`],[`months`,`month`,`date`],[`weeks`,`week`,`date`],[`days`,`day`,`date`],[`hours`,`hour`,`time`],[`minutes`,`minute`,`time`],[`seconds`,`second`,`time`],[`milliseconds`,`millisecond`,`time`],[`microseconds`,`microsecond`,`time`],[`nanoseconds`,`nanosecond`,`time`]],No=Object.fromEntries(Mo.map((e=>[e[0],e[1]]))),Po=Object.fromEntries(Mo.map((([e,t])=>[t,e]))),Fo=Mo.map((([,e])=>e)),Io={day:co,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Lo=[`days`,`hours`,`microseconds`,`milliseconds`,`minutes`,`months`,`nanoseconds`,`seconds`,`weeks`,`years`],Ro=Intl.DateTimeFormat,zo=new Map;function Bo(e){let t=uu(e),n=zo.get(t);return n===void 0&&(n=new Ro(`en-us`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),zo.set(t,n)),n}function Vo(e){return Na(e,$i)&&!Na(e,sa,ra)}function Ho(e){return Na(e,ca,la,da,fa,pa,ma,ha,ga,_a)}function Uo(e){return Na(e,ia)}function Wo(e){return Na(e,na)}function Go(e){return Na(e,ta)}function Ko(e){return Na(e,aa)}function qo(e){return Na(e,oa)}function Jo(e){return Na(e,$i,sa,ra)}function R(e,t){if(!t(e))throw TypeError(`invalid receiver: method called with the wrong type of this-object`)}function Yo(e){if(Na(e,ra)||Na(e,sa))throw TypeError(`with() does not support a calendar or timeZone property`);if(Wo(e))throw TypeError(`with() does not accept Temporal.PlainTime, use withPlainTime() instead`);if(e.calendar!==void 0)throw TypeError(`with() does not support a calendar property`);if(e.timeZone!==void 0)throw TypeError(`with() does not support a timeZone property`)}function Xo(e,t){return t===`never`||t===`auto`&&e===`iso8601`?``:`[${t===`critical`?`!`:``}u-ca=${e}]`}function Zo(e){let t,n,r=!1;for($a.lastIndex=0;n=$a.exec(e);){let{1:i,2:a,3:o}=n;if(a===`u-ca`){if(t===void 0)t=o,r=i===`!`;else if(i===`!`||r)throw RangeError(`Invalid annotations in ${e}: more than one u-ca present with critical flag`)}else if(i===`!`)throw RangeError(`Unrecognized annotation: !${a}=${o}`)}return t}function Qo(e){let t=eo.exec(e);if(!t)throw RangeError(`invalid RFC 9557 string: ${e}`);let n=Zo(t[16]),r=t[1];if(r===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);let i=+r,a=+(t[2]??t[4]??1),o=+(t[3]??t[5]??1),s=t[6]!==void 0,c=+(t[6]??0),l=+(t[7]??t[10]??0),u=+(t[8]??t[11]??0);u===60&&(u=59);let d=(t[9]??t[12]??``)+`000000000`,f=+d.slice(0,3),p=+d.slice(3,6),m=+d.slice(6,9),h,g=!1;t[13]?(h=void 0,g=!0):t[14]&&(h=t[14]);let _=t[15];return ul(i,a,o,c,l,u,f,p,m),{year:i,month:a,day:o,time:s?{hour:c,minute:l,second:u,millisecond:f,microsecond:p,nanosecond:m}:`start-of-day`,tzAnnotation:_,offset:h,z:g,calendar:n}}function $o(e){let t=to.exec(e),n,r,i,a,o,s,c;if(t){c=Zo(t[10]),n=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let e=(t[4]??t[7]??``)+`000000000`;if(a=+e.slice(0,3),o=+e.slice(3,6),s=+e.slice(6,9),t[8])throw RangeError(`Z designator not supported for PlainTime`)}else{let t,l;if({time:t,z:l,calendar:c}=Qo(e),t===`start-of-day`)throw RangeError(`time is missing in string: ${e}`);if(l)throw RangeError(`Z designator not supported for PlainTime`);({hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s}=t)}if(ll(n,r,i,a,o,s),/[tT ][0-9][0-9]/.test(e))return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c};try{let{month:t,day:n}=ts(e);sl(1972,t,n)}catch{try{let{year:t,month:n}=es(e);sl(t,n,1)}catch{return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c}}}throw RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`)}function es(e){let t=no.exec(e),n,r,i,a;if(t){i=Zo(t[3]);let o=t[1];if(o===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);if(n=+o,r=+t[2],a=1,i!==void 0&&i!==`iso8601`)throw RangeError(`YYYY-MM format is only valid with iso8601 calendar`)}else{let t;if({year:n,month:r,calendar:i,day:a,z:t}=Qo(e),t)throw RangeError(`Z designator not supported for PlainYearMonth`)}return{year:n,month:r,calendar:i,referenceISODay:a}}function ts(e){let t=ro.exec(e),n,r,i,a;if(t){if(i=Zo(t[3]),n=+t[1],r=+t[2],i!==void 0&&i!==`iso8601`)throw RangeError(`MM-DD format is only valid with iso8601 calendar`)}else{let t;if({month:n,day:r,calendar:i,year:a,z:t}=Qo(e),t)throw RangeError(`Z designator not supported for PlainMonthDay`)}return{month:n,day:r,calendar:i,referenceISOYear:a}}const ns=RegExp(`^${Ga.source}$`,`i`),rs=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?$`);function is(e){let t=see.test(e)?`Seconds not allowed in offset time zone`:`Invalid time zone`;throw RangeError(`${t}: ${e}`)}function as(e){return ns.test(e)||is(e),rs.test(e)?{offsetMinutes:Pc(e)/6e10}:{tzName:e}}function os(e,t,n,r){let i=e,a=t,o=n;switch(r){case`reject`:sl(i,a,o);break;case`constrain`:({year:i,month:a,day:o}=al(i,a,o))}return{year:i,month:a,day:o}}function ss(e,t,n,r,i,a,o){let s=e,c=t,l=n,u=r,d=i,f=a;switch(o){case`reject`:ll(s,c,l,u,d,f);break;case`constrain`:s=il(s,0,23),c=il(c,0,59),l=il(l,0,59),u=il(u,0,999),d=il(d,0,999),f=il(f,0,999)}return{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function cs(e){if(!bo(e))throw TypeError(`invalid duration-like`);let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},n=!1;for(let r=0;r<Lo.length;r++){let i=Lo[r],a=e[i];a!==void 0&&(n=!0,t[i]=To(a))}if(!n)throw TypeError(`invalid duration-like`);return t}function ls({years:e,months:t,weeks:n,days:r},i,a,o){return{years:e,months:o??t,weeks:a??n,days:i??r}}function us(e,t){return{isoDate:e,time:t}}function ds(e){return cu(e,`overflow`,[`constrain`,`reject`],`constrain`)}function fs(e){return cu(e,`disambiguation`,[`compatible`,`earlier`,`later`,`reject`],`compatible`)}function ps(e,t){return cu(e,`roundingMode`,[`ceil`,`floor`,`expand`,`trunc`,`halfCeil`,`halfFloor`,`halfExpand`,`halfTrunc`,`halfEven`],t)}function ms(e,t){return cu(e,`offset`,[`prefer`,`use`,`ignore`,`reject`],t)}function hs(e){return cu(e,`calendarName`,[`auto`,`always`,`never`,`critical`],`auto`)}function gs(e){let t=e.roundingIncrement;if(t===void 0)return 1;let n=Co(t);if(n<1||n>1e9)throw RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return n}function _s(e,t,n){let r=n?t:t-1;if(e>r)throw RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${e}`);if(t%e!=0)throw RangeError(`Rounding increment must divide evenly into ${t}`)}function vs(e){let t=e.fractionalSecondDigits;if(t===void 0)return`auto`;if(typeof t!=`number`){if(So(t)!==`auto`)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return`auto`}let n=Math.floor(t);if(!Number.isFinite(n)||n<0||n>9)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return n}function ys(e,t){switch(e){case`minute`:return{precision:`minute`,unit:`minute`,increment:1};case`second`:return{precision:0,unit:`second`,increment:1};case`millisecond`:return{precision:3,unit:`millisecond`,increment:1};case`microsecond`:return{precision:6,unit:`microsecond`,increment:1};case`nanosecond`:return{precision:9,unit:`nanosecond`,increment:1}}switch(t){case`auto`:return{precision:t,unit:`nanosecond`,increment:1};case 0:return{precision:t,unit:`second`,increment:1};case 1:case 2:case 3:return{precision:t,unit:`millisecond`,increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:`microsecond`,increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:`nanosecond`,increment:10**(9-t)};default:throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const bs=Symbol(`~required~`);function xs(e,t,n,r,i=[]){let a=[];for(let e=0;e<Mo.length;e++){let t=Mo[e],r=t[1],i=t[2];n!==`datetime`&&n!==i||a.push(r)}a=a.concat(i);let o=r;o===bs?o=void 0:o!==void 0&&a.push(o);let s=[];s=s.concat(a);for(let e=0;e<a.length;e++){let t=Po[a[e]];t!==void 0&&s.push(t)}let c=cu(e,t,s,o);if(c===void 0&&r===bs)throw RangeError(`${t} is required`);return c&&c in No?No[c]:c}function Ss(e){let t=e.relativeTo;if(t===void 0)return{};let n,r,i,a,o,s=`option`,c=!1;if(bo(t)){if(Jo(t))return{zonedRelativeTo:t};if(Uo(t))return{plainRelativeTo:t};if(Go(t))return{plainRelativeTo:Ws(L(t,ta).isoDate,L(t,ra))};i=cc(t);let e=As(i,t,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[]);({isoDate:n,time:r}=Ns(i,e,`constrain`)),{offset:o,timeZone:a}=e,o===void 0&&(s=`wall`)}else{let e,l,u,d,f;if({year:u,month:d,day:f,time:r,calendar:i,tzAnnotation:e,offset:o,z:l}=Qo(Do(t)),e)a=pc(e),l?s=`exact`:o||(s=`wall`),c=!0;else if(l)throw RangeError(`Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone`);i||=`iso8601`,i=lu(i),n={year:u,month:d,day:f}}return a===void 0?{plainRelativeTo:Ws(n,i)}:{zonedRelativeTo:nc(Vs(n,r,s,s===`option`?Pc(o):0,a,`compatible`,`reject`,c),a,i)}}function Cs(e){return L(e,ca)===0?L(e,la)===0?L(e,ua)===0?L(e,da)===0?L(e,fa)===0?L(e,pa)===0?L(e,ma)===0?L(e,ha)===0?L(e,ga)===0?`nanosecond`:`microsecond`:`millisecond`:`second`:`minute`:`hour`:`day`:`week`:`month`:`year`}function ws(e,t){return Fo.indexOf(e)>Fo.indexOf(t)?t:e}function Ts(e){return e===`year`||e===`month`||e===`week`}function Es(e){return Ts(e)||e===`day`?`date`:`time`}function Ds(e){return Ra(`%calendarImpl%`)(e)}function Os(e){return Ra(`%calendarImpl%`)(L(e,ra))}function ks(e,t,n=`date`){let r=Object.create(null),i=Ds(e).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,n!==`month-day`&&n!==`date`||(r.day=i.day),n!==`year-month`&&n!==`date`||(r.year=i.year),r}function As(e,t,n,r,i){let a=Ds(e).extraFields(n),o=n.concat(r,a),s=Object.create(null),c=!1;o.sort();for(let e=0;e<o.length;e++){let n=o[e],r=t[n];if(r!==void 0)c=!0,s[n]=(0,Ao[n])(r);else if(i!==`partial`){if(i.includes(n))throw TypeError(`required property '${n}' missing or undefined`);s[n]=jo[n]}}if(i===`partial`&&!c)throw TypeError(`no supported properties found`);return s}function js(e,t=`complete`){let n=[`hour`,`microsecond`,`millisecond`,`minute`,`nanosecond`,`second`],r=!1,i=Object.create(null);for(let a=0;a<n.length;a++){let o=n[a],s=e[o];s===void 0?t===`complete`&&(i[o]=0):(i[o]=Co(s),r=!0)}if(!r)throw TypeError(`invalid time-like`);return i}function Ms(e,t){if(bo(e)){if(Uo(e))return ds(ou(t)),Ws(L(e,ea),L(e,ra));if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Ws(n.isoDate,L(e,ra))}if(Go(e))return ds(ou(t)),Ws(L(e,ta).isoDate,L(e,ra));let n=cc(e);return Ws(uc(n,As(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),ds(ou(t))),n)}let{year:n,month:r,day:i,calendar:a,z:o}=Qo(Do(e));if(o)throw RangeError(`Z designator not supported for PlainDate`);return a||=`iso8601`,a=lu(a),ds(ou(t)),Ws({year:n,month:r,day:i},a)}function Ns(e,t,n){return us(uc(e,t,n),ss(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,n))}function Ps(e,t){let n,r,i;if(bo(e)){if(Go(e))return ds(ou(t)),Ks(L(e,ta),L(e,ra));if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Ks(n,L(e,ra))}if(Uo(e))return ds(ou(t)),Ks(us(L(e,ea),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),L(e,ra));i=cc(e);let a=As(i,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],[]),o=ds(ou(t));({isoDate:n,time:r}=Ns(i,a,o))}else{let a,o,s,c;if({year:o,month:s,day:c,time:r,calendar:i,z:a}=Qo(Do(e)),a)throw RangeError(`Z designator not supported for PlainDateTime`);r===`start-of-day`&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ul(o,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||=`iso8601`,i=lu(i),ds(ou(t)),n={year:o,month:s,day:c}}return Ks(us(n,r),i)}function Fs(e){let t=Ra(`%Temporal.Duration%`);if(Ho(e))return new t(L(e,ca),L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a));if(!bo(e))return function(e){let{years:t,months:n,weeks:r,days:i,hours:a,minutes:o,seconds:s,milliseconds:c,microseconds:l,nanoseconds:u}=function(e){let t=oo.exec(e);if(!t||t.every(((e,t)=>t<2||e===void 0)))throw RangeError(`invalid duration: ${e}`);let n=t[1]===`-`?-1:1,r=t[2]===void 0?0:Co(t[2])*n,i=t[3]===void 0?0:Co(t[3])*n,a=t[4]===void 0?0:Co(t[4])*n,o=t[5]===void 0?0:Co(t[5])*n,s=t[6]===void 0?0:Co(t[6])*n,c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=0,m=0,h=0;if(c!==void 0){if(l??u??d??f)throw RangeError(`only the smallest unit can be fractional`);h=3600*Co((c+`000000000`).slice(0,9))*n}else if(p=l===void 0?0:Co(l)*n,u!==void 0){if(d??f)throw RangeError(`only the smallest unit can be fractional`);h=60*Co((u+`000000000`).slice(0,9))*n}else m=d===void 0?0:Co(d)*n,f!==void 0&&(h=Co((f+`000000000`).slice(0,9))*n);let g=h%1e3,_=Math.trunc(h/1e3)%1e3,v=Math.trunc(h/1e6)%1e3;return m+=Math.trunc(h/1e9)%60,p+=Math.trunc(h/6e10),hl(r,i,a,o,s,p,m,v,_,g),{years:r,months:i,weeks:a,days:o,hours:s,minutes:p,seconds:m,milliseconds:v,microseconds:_,nanoseconds:g}}(e);return new(Ra(`%Temporal.Duration%`))(t,n,r,i,a,o,s,c,l,u)}(Do(e));let n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=cs(e);for(let e=0;e<Lo.length;e++){let t=Lo[e],i=r[t];i!==void 0&&(n[t]=i)}return new t(n.years,n.months,n.weeks,n.days,n.hours,n.minutes,n.seconds,n.milliseconds,n.microseconds,n.nanoseconds)}function Is(e){let t;if(bo(e)){if(Vo(e)||Jo(e))return ec(L(e,$i));t=Oo(e)}else t=e;let{year:n,month:r,day:i,time:a,offset:o,z:s}=function(e){let t=Qo(e);if(!t.z&&!t.offset)throw RangeError(`Temporal.Instant requires a time zone offset`);return t}(Do(t)),{hour:c=0,minute:l=0,second:u=0,millisecond:d=0,microsecond:f=0,nanosecond:p=0}=a===`start-of-day`?{}:a,m=el(n,r,i,c,l,u,d,f,p-(s?0:Pc(o)));return Sl(m.isoDate),ec(Hc(m))}function Ls(e,t){if(bo(e)){if(qo(e))return ds(ou(t)),Js(L(e,ea),L(e,ra));let n;return Na(e,ra)?n=L(e,ra):(n=e.calendar,n===void 0&&(n=`iso8601`),n=sc(n)),Js(fc(n,As(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),ds(ou(t))),n)}let{month:n,day:r,referenceISOYear:i,calendar:a}=ts(Do(e));if(a===void 0&&(a=`iso8601`),a=lu(a),ds(ou(t)),a===`iso8601`)return Js({year:1972,month:n,day:r},a);let o={year:i,month:n,day:r};return cl(o),o=fc(a,ks(a,o,`month-day`),`constrain`),Js(o,a)}function Rs(e,t){let n;if(bo(e)){if(Wo(e))return ds(ou(t)),Xs(L(e,na));if(Go(e))return ds(ou(t)),Xs(L(e,ta).time);if(Jo(e)){let n=_c(L(e,sa),L(e,$i));return ds(ou(t)),Xs(n.time)}let{hour:r,minute:i,second:a,millisecond:o,microsecond:s,nanosecond:c}=js(e);n=ss(r,i,a,o,s,c,ds(ou(t)))}else n=$o(Do(e)),ds(ou(t));return Xs(n)}function zs(e){return e===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:L(Rs(e),na)}function Bs(e,t){if(bo(e)){if(Ko(e))return ds(ou(t)),Qs(L(e,ea),L(e,ra));let n=cc(e);return Qs(dc(n,As(n,e,[`year`,`month`,`monthCode`],[],[]),ds(ou(t))),n)}let{year:n,month:r,referenceISODay:i,calendar:a}=es(Do(e));a===void 0&&(a=`iso8601`),a=lu(a),ds(ou(t));let o={year:n,month:r,day:i};return ml(o),o=dc(a,ks(a,o,`year-month`),`constrain`),Qs(o,a)}function Vs(e,t,n,r,i,a,o,s){if(t===`start-of-day`)return xc(i,e);let c=us(e,t);if(n===`wall`||o===`ignore`)return vc(i,c,a);if(n===`exact`||o===`use`){let n=el(e.year,e.month,e.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Sl(n.isoDate);let i=Hc(n);return pl(i),i}Sl(e);let l=Hc(c),u=bc(i,c);for(let e=0;e<u.length;e++){let t=u[e],n=I.default.toNumber(I.default.subtract(l,t)),i=Wl(n,6e10,`halfExpand`);if(n===r||s&&i===r)return t}if(o===`reject`){let e=gc(r),t=kc(c,`iso8601`,`auto`);throw RangeError(`Offset ${e} is invalid for ${t} in ${i}`)}return yc(u,i,c,a)}function Hs(e,t){let n,r,i,a,o,s,c,l=!1,u=`option`;if(bo(e)){if(Jo(e)){let n=ou(t);return fs(n),ms(n,`reject`),ds(n),nc(L(e,$i),L(e,sa),L(e,ra))}o=cc(e);let l=As(o,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[`timeZone`]);({offset:a,timeZone:i}=l),a===void 0&&(u=`wall`);let d=ou(t);s=fs(d),c=ms(d,`reject`);let f=ds(d);({isoDate:n,time:r}=Ns(o,l,f))}else{let d,f,p,m,h;({year:p,month:m,day:h,time:r,tzAnnotation:d,offset:a,z:f,calendar:o}=function(e){let t=Qo(e);if(!t.tzAnnotation)throw RangeError(`Temporal.ZonedDateTime requires a time zone ID in brackets`);return t}(Do(e))),i=pc(d),f?u=`exact`:a||(u=`wall`),o||=`iso8601`,o=lu(o),l=!0;let g=ou(t);s=fs(g),c=ms(g,`reject`),ds(g),n={year:p,month:m,day:h}}let d=0;return u===`option`&&(d=Pc(a)),nc(Vs(n,r,u,d,i,s,c,l),i,o)}function Us(e,t,n){cl(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,ia,!0)}function Ws(e,t){let n=Ra(`%Temporal.PlainDate%`),r=Object.create(n.prototype);return Us(r,e,t),r}function Gs(e,t,n){dl(t),Ma(e),Pa(e,ta,t),Pa(e,ra,n)}function Ks(e,t){let n=Ra(`%Temporal.PlainDateTime%`),r=Object.create(n.prototype);return Gs(r,e,t),r}function qs(e,t,n){cl(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,oa,!0)}function Js(e,t){let n=Ra(`%Temporal.PlainMonthDay%`),r=Object.create(n.prototype);return qs(r,e,t),r}function Ys(e,t){Ma(e),Pa(e,na,t)}function Xs(e){let t=Ra(`%Temporal.PlainTime%`),n=Object.create(t.prototype);return Ys(n,e),n}function Zs(e,t,n){ml(t),Ma(e),Pa(e,ea,t),Pa(e,ra,n),Pa(e,aa,!0)}function Qs(e,t){let n=Ra(`%Temporal.PlainYearMonth%`),r=Object.create(n.prototype);return Zs(r,e,t),r}function $s(e,t){pl(t),Ma(e),Pa(e,$i,t)}function ec(e){let t=Ra(`%Temporal.Instant%`),n=Object.create(t.prototype);return $s(n,e),n}function tc(e,t,n,r){pl(t),Ma(e),Pa(e,$i,t),Pa(e,sa,n),Pa(e,ra,r)}function nc(e,t,n=`iso8601`){let r=Ra(`%Temporal.ZonedDateTime%`),i=Object.create(r.prototype);return tc(i,e,t,n),i}function rc(e){return ko.filter((t=>e[t]!==void 0))}function ic(e,t,n){let r=rc(n),i=Ds(e).fieldKeysToIgnore(r),a=Object.create(null),o=rc(t);for(let e=0;e<ko.length;e++){let s,c=ko[e];o.includes(c)&&!i.includes(c)&&(s=t[c]),r.includes(c)&&(s=n[c]),s!==void 0&&(a[c]=s)}return a}function ac(e,t,n,r){let i=Ds(e).dateAdd(t,n,r);return cl(i),i}function oc(e,t,n,r){return Ds(e).dateUntil(t,n,r)}function sc(e){if(bo(e)&&Na(e,ra))return L(e,ra);let t=Do(e);try{return lu(t)}catch{}let n;try{({calendar:n}=Qo(t))}catch{try{({calendar:n}=$o(t))}catch{try{({calendar:n}=es(t))}catch{({calendar:n}=ts(t))}}}return n||=`iso8601`,lu(n)}function cc(e){if(Na(e,ra))return L(e,ra);let{calendar:t}=e;return t===void 0?`iso8601`:sc(t)}function lc(e,t){return lu(e)===lu(t)}function uc(e,t,n){let r=Ds(e);r.resolveFields(t,`date`);let i=r.dateToISO(t,n);return cl(i),i}function dc(e,t,n){let r=Ds(e);r.resolveFields(t,`year-month`),t.day=1;let i=r.dateToISO(t,n);return ml(i),i}function fc(e,t,n){let r=Ds(e);r.resolveFields(t,`month-day`);let i=r.monthDayToISOReferenceDate(t,n);return cl(i),i}function pc(e){if(bo(e)&&Jo(e))return L(e,sa);let t=Do(e);if(t===`UTC`)return`UTC`;let{tzName:n,offsetMinutes:r}=function(e){let{tzAnnotation:t,offset:n,z:r}=function(e){if(ns.test(e))return{tzAnnotation:e,offset:void 0,z:!1};try{let{tzAnnotation:t,offset:n,z:r}=Qo(e);if(r||t||n)return{tzAnnotation:t,offset:n,z:r}}catch{}is(e)}(e);return t?as(t):r?as(`UTC`):n?as(n):void 0}(t);if(r!==void 0)return zc(r);let i=Ic(n);if(!i)throw RangeError(`Unrecognized time zone ${n}`);return i.identifier}function mc(e,t){if(e===t)return!0;let n=as(e).offsetMinutes,r=as(t).offsetMinutes;if(n===void 0&&r===void 0){let n=Ic(t);if(!n)return!1;let r=Ic(e);return!!r&&r.primaryIdentifier===n.primaryIdentifier}return n===r}function hc(e,t){let n=as(e).offsetMinutes;return n===void 0?Rc(e,t):6e10*n}function gc(e){let t=e<0?`-`:`+`,n=Math.abs(e),r=Math.floor(n/36e11),i=Math.floor(n/6e10)%60,a=Math.floor(n/1e9)%60,o=n%1e9;return`${t}${Tc(r,i,a,o,a===0&&o===0?`minute`:`auto`)}`}function _c(e,t){let n=hc(e,t),{isoDate:{year:r,month:i,day:a},time:{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d}}=Uc(t);return el(r,i,a,o,s,c,l,u,d+n)}function vc(e,t,n){return yc(bc(e,t),e,t,n)}function yc(e,t,n,r){let i=e.length;if(i===1)return e[0];if(i)switch(r){case`compatible`:case`earlier`:return e[0];case`later`:return e[i-1];case`reject`:throw RangeError(`multiple instants found`)}if(r===`reject`)throw RangeError(`multiple instants found`);let a=Hc(n),o=I.default.subtract(a,Gi);pl(o);let s=hc(t,o),c=I.default.add(a,Gi);pl(c);let l=hc(t,c)-s;switch(r){case`earlier`:{let e=Ua.fromComponents(0,0,0,0,0,-l),r=Pl(n.time,e);return bc(t,us($c(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r))[0]}case`compatible`:case`later`:{let e=Ua.fromComponents(0,0,0,0,0,l),r=Pl(n.time,e),i=bc(t,us($c(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r));return i[i.length-1]}}}function bc(e,t){if(e===`UTC`)return Sl(t.isoDate),[Hc(t)];let n=as(e).offsetMinutes;if(n!==void 0){let e=el(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-n,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);Sl(e.isoDate);let r=Hc(e);return pl(r),[r]}return Sl(t.isoDate),function(e,t){let n=Hc(t),r=I.default.subtract(n,Gi);I.default.lessThan(r,fo)&&(r=n);let i=I.default.add(n,Gi);I.default.greaterThan(i,uo)&&(i=n);let a=Rc(e,r),o=Rc(e,i);return(a===o?[a]:[a,o]).map((r=>{let i=I.default.subtract(n,I.default.BigInt(r));if(Ql(t,function(e,t){let{epochMilliseconds:n,time:{millisecond:r,microsecond:i,nanosecond:a}}=Uc(t),{year:o,month:s,day:c,hour:l,minute:u,second:d}=Kc(e,n);return el(o,s,c,l,u,d,r,i,a)}(e,i))===0)return pl(i),i})).filter((e=>e!==void 0))}(e,t)}function xc(e,t){let n=us(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=bc(e,n);if(r.length)return r[0];let i=Hc(n),a=I.default.subtract(i,Gi);return pl(a),Wc(e,a)}function Sc(e){let t;return t=e<0||e>9999?(e<0?`-`:`+`)+Eo(Math.abs(e),6):Eo(e,4),t}function Cc(e){return Eo(e,2)}function wc(e,t){let n;if(t===`auto`){if(e===0)return``;n=Eo(e,9).replace(/0+$/,``)}else{if(t===0)return``;n=Eo(e,9).slice(0,t)}return`.${n}`}function Tc(e,t,n,r,i){let a=`${Cc(e)}:${Cc(t)}`;return i===`minute`||(a+=`:${Cc(n)}`,a+=wc(r,i)),a}function eee(e,t,n){let r=t;r===void 0&&(r=`UTC`);let i=L(e,$i),a=kc(_c(r,i),`iso8601`,n,`never`),o=`Z`;return t!==void 0&&(o=Bc(hc(r,i))),`${a}${o}`}function Ec(e,t){let n=L(e,ca),r=L(e,la),i=L(e,ua),a=L(e,da),o=L(e,fa),s=L(e,pa),c=Yc(e),l=``;n!==0&&(l+=`${Math.abs(n)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),a!==0&&(l+=`${Math.abs(a)}D`);let u=``;o!==0&&(u+=`${Math.abs(o)}H`),s!==0&&(u+=`${Math.abs(s)}M`);let d=Ua.fromComponents(0,0,L(e,ma),L(e,ha),L(e,ga),L(e,_a));d.isZero()&&![`second`,`millisecond`,`microsecond`,`nanosecond`].includes(Cs(e))&&t===`auto`||(u+=`${Math.abs(d.sec)}${wc(Math.abs(d.subsec),t)}S`);let f=`${c<0?`-`:``}P${l}`;return u&&(f=`${f}T${u}`),f}function Dc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea);return`${Sc(n)}-${Cc(r)}-${Cc(i)}${Xo(L(e,ra),t)}`}function Oc({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){return Tc(e,t,n,1e6*r+1e3*i+a,o)}function kc(e,t,n,r=`auto`){let{isoDate:{year:i,month:a,day:o},time:{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}=e;return`${Sc(i)}-${Cc(a)}-${Cc(o)}T${Tc(s,c,l,1e6*u+1e3*d+f,n)}${Xo(t,r)}`}function Ac(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea),a=`${Cc(r)}-${Cc(i)}`,o=L(e,ra);t!==`always`&&t!==`critical`&&o===`iso8601`||(a=`${Sc(n)}-${a}`);let s=Xo(o,t);return s&&(a+=s),a}function jc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ea),a=`${Sc(n)}-${Cc(r)}`,o=L(e,ra);t!==`always`&&t!==`critical`&&o===`iso8601`||(a+=`-${Cc(i)}`);let s=Xo(o,t);return s&&(a+=s),a}function Mc(e,t,n=`auto`,r=`auto`,i=`auto`,a=void 0){let o=L(e,$i);if(a){let{unit:e,increment:t,roundingMode:n}=a;o=Gl(o,t,e,n)}let s=L(e,sa),c=hc(s,o),l=kc(_c(s,o),`iso8601`,t,`never`);return i!==`never`&&(l+=Bc(c)),r!==`never`&&(l+=`[${r===`critical`?`!`:``}${s}]`),l+=Xo(L(e,ra),n),l}function Nc(e){return rs.test(e)}function Pc(e){let t=cee.exec(e);if(!t)throw RangeError(`invalid time zone offset: ${e}; must match ±HH:MM[:SS.SSSSSSSSS]`);return(t[1]===`-`?-1:1)*(1e9*(60*(60*t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+`000000000`).slice(0,9))}let Fc;const tee=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function Ic(e){if(Fc===void 0){let e=Intl.supportedValuesOf?.(`timeZone`);if(e){Fc=new Map;for(let t=0;t<e.length;t++){let n=e[t];Fc.set(uu(n),n)}}else Fc=null}let t=uu(e),n=Fc?.get(t);if(n)return{identifier:n,primaryIdentifier:n};try{n=Bo(e).resolvedOptions().timeZone}catch{return}if(t===`antarctica/south_pole`&&(n=`Antarctica/McMurdo`),yo.has(e))throw RangeError(`${e} is a legacy time zone identifier from ICU. Use ${n} instead`);let r=[...t].map(((e,n)=>n===0||tee[t[n-1]]?e.toUpperCase():e)).join(``).split(`/`);if(r.length===1)return t===`gb-eire`?{identifier:`GB-Eire`,primaryIdentifier:n}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:n};if(r[0]===`Etc`)return{identifier:`Etc/${[`Zulu`,`Greenwich`,`Universal`].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if(r[0]===`Us`)return{identifier:`US/${r[1]}`,primaryIdentifier:n};let i=new Map([[`Act`,`ACT`],[`Lhi`,`LHI`],[`Nsw`,`NSW`],[`Dar_Es_Salaam`,`Dar_es_Salaam`],[`Port_Of_Spain`,`Port_of_Spain`],[`Port-Au-Prince`,`Port-au-Prince`],[`Isle_Of_Man`,`Isle_of_Man`],[`Comodrivadavia`,`ComodRivadavia`],[`Knox_In`,`Knox_IN`],[`Dumontdurville`,`DumontDUrville`],[`Mcmurdo`,`McMurdo`],[`Denoronha`,`DeNoronha`],[`Easterisland`,`EasterIsland`],[`Bajanorte`,`BajaNorte`],[`Bajasur`,`BajaSur`]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join(`/`),primaryIdentifier:n}}function Lc(e,t){let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Kc(e,t),c=t%1e3;return c<0&&(c+=1e3),1e6*(Vc({isoDate:{year:n,month:r,day:i},time:{hour:a,minute:o,second:s,millisecond:c}})-t)}function Rc(e,t){return Lc(e,eu(t,`floor`))}function zc(e){let t=e<0?`-`:`+`,n=Math.abs(e);return`${t}${Tc(Math.floor(n/60),n%60,0,0,`minute`)}`}function Bc(e){return zc(Wl(e,6e10,`halfExpand`)/6e10)}function Vc({isoDate:{year:e,month:t,day:n},time:{hour:r,minute:i,second:a,millisecond:o}}){let s=e%400,c=(e-s)/400,l=new Date;return l.setUTCHours(r,i,a,o),l.setUTCFullYear(s,t-1,n),l.getTime()+0xb7af85d9c00*c}function Hc(e){let t=Vc(e),n=1e3*e.time.microsecond+e.time.nanosecond;return I.default.add(tu(t),I.default.BigInt(n))}function Uc(e){let t=eu(e,`trunc`),n=I.default.toNumber(I.default.remainder(e,Vi));n<0&&(n+=1e6,--t);let r=Math.floor(n/1e3)%1e3,i=n%1e3,a=new Date(t);return{epochMilliseconds:t,isoDate:{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate()},time:{hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function Wc(e,t){if(e===`UTC`)return null;let n=eu(t,`floor`);if(n<_o)return Wc(e,tu(_o));let r=Date.now(),i=Math.max(n,r)+366*so*3,a=n,o=Lc(e,a),s=a,c=o;for(;o===c&&a<i;){if(s=a+2*so*7,s>lo)return null;c=Lc(e,s),o===c&&(a=s)}return o===c?null:tu(fu((t=>Lc(e,t)),a,s,o,c))}function Gc(e,t){if(e===`UTC`)return null;let n=eu(t,`ceil`),r=Date.now(),i=r+366*so*3;if(n>i){let t=Gc(e,tu(i));if(t===null||I.default.lessThan(t,tu(r)))return t}if(e===`Africa/Casablanca`||e===`Africa/El_Aaiun`){let t=Date.UTC(2088,0,1);if(t<n)return Gc(e,tu(t))}let a=n-1;if(a<_o)return null;let o=Lc(e,a),s=a,c=o;for(;o===c&&a>_o;){if(s=a-2*so*7,s<_o)return null;c=Lc(e,s),o===c&&(a=s)}return o===c?null:tu(fu((t=>Lc(e,t)),s,a,c,o))}function Kc(e,t){return function(e){let t=e.split(/[^\w]+/);if(t.length!==7)throw RangeError(`expected 7 parts in "${e}`);let n=+t[0],r=+t[1],i=+t[2],a=t[3];if(a[0]===`b`||a[0]===`B`)i=1-i;else if(a[0]!==`a`&&a[0]!==`A`)throw RangeError(`Unknown era ${a} in "${e}`);let o=t[4]===`24`?0:+t[4],s=+t[5],c=+t[6];if(!(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)&&Number.isFinite(c)))throw RangeError(`Invalid number in "${e}`);return{year:i,month:n,day:r,hour:o,minute:s,second:c}}(Bo(e).format(t))}function qc(e){return e!==void 0&&!(e%4!=0||e%100==0&&e%400!=0)}function Jc(e,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[qc(e)?`leapyear`:`standard`][t-1]}function Yc(e){let t=[L(e,ca),L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a)];for(let e=0;e<t.length;e++){let n=t[e];if(n!==0)return n<0?-1:1}return 0}function Xc(e){let t=[`years`,`months`,`weeks`,`days`];for(let n=0;n<t.length;n++){let r=e[t[n]];if(r!==0)return r<0?-1:1}return 0}function Zc(e){let t=Xc(e.date);return t===0?e.time.sign():t}function Qc(e,t){let n=e,r=t;if(!Number.isFinite(n)||!Number.isFinite(r))throw RangeError(`infinity is out of range`);return--r,n+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:n,month:r}}function $c(e,t,n){let r=e,i=t,a=n;if(!Number.isFinite(a))throw RangeError(`infinity is out of range`);({year:r,month:i}=Qc(r,i));let o=146097;if(Math.abs(a)>o){let e=Math.trunc(a/o);r+=400*e,a-=e*o}let s=0,c=i>2?r:r-1;for(;s=qc(c)?366:365,a<-s;)--r,--c,a+=s;for(c+=1;s=qc(c)?366:365,a>s;)r+=1,c+=1,a-=s;for(;a<1;)({year:r,month:i}=Qc(r,i-1)),a+=Jc(r,i);for(;a>Jc(r,i);)a-=Jc(r,i),{year:r,month:i}=Qc(r,i+1);return{year:r,month:i,day:a}}function el(e,t,n,r,i,a,o,s,c){let l=tl(r,i,a,o,s,c);return us($c(e,t,n+l.deltaDays),l)}function tl(e,t,n,r,i,a){let o,s=e,c=t,l=n,u=r,d=i,f=a;({div:o,mod:f}=za(f,3)),d+=o,f<0&&(--d,f+=1e3),{div:o,mod:d}=za(d,3),u+=o,d<0&&(--u,d+=1e3),l+=Math.trunc(u/1e3),u%=1e3,u<0&&(--l,u+=1e3),c+=Math.trunc(l/60),l%=60,l<0&&(--c,l+=60),s+=Math.trunc(c/60),c%=60,c<0&&(--s,c+=60);let p=Math.trunc(s/24);return s%=24,s<0&&(--p,s+=24),p+=0,s+=0,c+=0,l+=0,u+=0,d+=0,f+=0,{deltaDays:p,hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function nl(e,t){let n=ls(e,0);if(Xc(n)===0)return e.days;let r=L(t,ea),i=ac(L(t,ra),r,n,`constrain`),a=xl(r.year,r.month-1,r.day),o=xl(i.year,i.month-1,i.day)-a;return e.days+o}function rl(e){return new(Ra(`%Temporal.Duration%`))(-L(e,ca),-L(e,la),-L(e,ua),-L(e,da),-L(e,fa),-L(e,pa),-L(e,ma),-L(e,ha),-L(e,ga),-L(e,_a))}function il(e,t,n){return Math.min(n,Math.max(t,e))}function al(e,t,n){let r=il(t,1,12);return{year:e,month:r,day:il(n,1,Jc(e,r))}}function ol(e,t,n){if(e<t||e>n)throw RangeError(`value out of range: ${t} <= ${e} <= ${n}`)}function sl(e,t,n){ol(t,1,12),ol(n,1,Jc(e,t))}function cl(e){dl(us(e,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function ll(e,t,n,r,i,a){ol(e,0,23),ol(t,0,59),ol(n,0,59),ol(r,0,999),ol(i,0,999),ol(a,0,999)}function ul(e,t,n,r,i,a,o,s,c){sl(e,t,n),ll(r,i,a,o,s,c)}function dl(e){let t=Hc(e);(I.default.lessThan(t,po)||I.default.greaterThan(t,mo))&&pl(t)}function fl(e){Hc(e)}function pl(e){if(I.default.lessThan(e,fo)||I.default.greaterThan(e,uo))throw RangeError(`date/time value is outside of supported range`)}function ml({year:e,month:t}){ol(e,ho,go),e===ho?ol(t,4,12):e===go&&ol(t,1,9)}function hl(e,t,n,r,i,a,o,s,c,l){let u=0,d=[e,t,n,r,i,a,o,s,c,l];for(let e=0;e<d.length;e++){let t=d[e];if(t===1/0||t===-1/0)throw RangeError(`infinite values not allowed as duration fields`);if(t!==0){let e=t<0?-1:1;if(u!==0&&e!==u)throw RangeError(`mixed-sign values not allowed as duration fields`);u=e}}if(Math.abs(e)>=2**32||Math.abs(t)>=2**32||Math.abs(n)>=2**32)throw RangeError(`years, months, and weeks must be < 2³²`);let f=za(s,3),p=za(c,6),m=za(l,9),h=za(1e6*f.mod+1e3*p.mod+m.mod,9).div,g=86400*r+3600*i+60*a+o+f.div+p.div+m.div+h;if(!Number.isSafeInteger(g))throw RangeError(`total of duration time units cannot exceed 9007199254740991.999999999 s`)}function gl(e){return{date:{years:L(e,ca),months:L(e,la),weeks:L(e,ua),days:L(e,da)},time:Ua.fromComponents(L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a))}}function _l(e){let t=Ua.fromComponents(L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a)).add24HourDays(L(e,da));return{date:{years:L(e,ca),months:L(e,la),weeks:L(e,ua),days:0},time:t}}function vl(e){let t=_l(e),n=Math.trunc(t.time.sec/86400);return hl(t.date.years,t.date.months,t.date.weeks,n,0,0,0,0,0,0),{...t.date,days:n}}function yl(e,t){let n=e.time.sign(),r=e.time.abs().subsec,i=0,a=0,o=e.time.abs().sec,s=0,c=0,l=0;switch(t){case`year`:case`month`:case`week`:case`day`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60,l=Math.trunc(c/24),c%=24;break;case`hour`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60;break;case`minute`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60;break;case`second`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3;break;case`millisecond`:i=Math.trunc(r/1e3),r%=1e3,a=Ba(o,3,Math.trunc(i/1e3)),i%=1e3,o=0;break;case`microsecond`:i=Ba(o,6,Math.trunc(r/1e3)),r%=1e3,o=0;break;case`nanosecond`:r=Ba(o,9,r),o=0}return new(Ra(`%Temporal.Duration%`))(e.date.years,e.date.months,e.date.weeks,e.date.days+n*l,n*c,n*s,n*o,n*a,n*i,n*r)}function bl(e,t){return Xc(e),t.sign(),{date:e,time:t}}function xl(e,t,n){return Vc({isoDate:{year:e,month:t+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/so}function Sl({year:e,month:t,day:n}){if(Math.abs(xl(e,t-1,n))>1e8)throw RangeError(`date/time value is outside the supported range`)}function Cl(e,t){let n=t.hour-e.hour,r=t.minute-e.minute,i=t.second-e.second,a=t.millisecond-e.millisecond,o=t.microsecond-e.microsecond,s=t.nanosecond-e.nanosecond;return Ua.fromComponents(n,r,i,a,o,s)}function wl(e,t,n,r,i){let a=Ua.fromEpochNsDiff(t,e);return a=Jl(a,n,r,i),bl({years:0,months:0,weeks:0,days:0},a)}function Tl(e,t,n,r){fl(e),fl(t);let i=Cl(e.time,t.time),a=i.sign(),o=Xl(e.isoDate,t.isoDate),s=t.isoDate;o===a&&(s=$c(s.year,s.month,s.day+a),i=i.add24HourDays(-a));let c=ws(`day`,r),l=oc(n,e.isoDate,s,c);return r!==c&&(i=i.add24HourDays(l.days),l.days=0),bl(l,i)}function El(e,t,n,r,i){let a=I.default.subtract(t,e);if(I.default.equal(a,Pi))return{date:{years:0,months:0,weeks:0,days:0},time:Ua.ZERO};let o=I.default.lessThan(a,Pi)?-1:1,s=_c(n,e),c=_c(n,t),l,u=0,d=o===1?2:1,f=Cl(s.time,c.time);for(f.sign()===-o&&u++;u<=d;u++){l=us($c(c.isoDate.year,c.isoDate.month,c.isoDate.day-u*o),s.time);let e=vc(n,l,`compatible`);if(f=Ua.fromEpochNsDiff(t,e),f.sign()!==-o)break}let p=ws(`day`,i);return bl(oc(r,s.isoDate,l.isoDate,p),f)}function Dl(e,t,n,r,i,a,o,s,c){let l,u,d,f,p=t;switch(s){case`year`:{let t=Wl(p.date.years,o,`trunc`);l=t,u=t+o*e,d={years:l,months:0,weeks:0,days:0},f={...d,years:u};break}case`month`:{let t=Wl(p.date.months,o,`trunc`);l=t,u=t+o*e,d=ls(p.date,0,0,l),f=ls(p.date,0,0,u);break}case`week`:{let t=ls(p.date,0,0),n=ac(a,r.isoDate,t,`constrain`),i=oc(a,n,$c(n.year,n.month,n.day+p.date.days),`week`),s=Wl(p.date.weeks+i.weeks,o,`trunc`);l=s,u=s+o*e,d=ls(p.date,0,l),f=ls(p.date,0,u);break}case`day`:{let t=Wl(p.date.days,o,`trunc`);l=t,u=t+o*e,d=ls(p.date,l),f=ls(p.date,u);break}}let m=ac(a,r.isoDate,d,`constrain`),h=ac(a,r.isoDate,f,`constrain`),g,_,v=us(m,r.time),y=us(h,r.time);i?(g=vc(i,v,`compatible`),_=vc(i,y,`compatible`)):(g=Hc(v),_=Hc(y));let b=Ua.fromEpochNsDiff(n,g),x=Ua.fromEpochNsDiff(_,g),S=Va(c,e<0?`negative`:`positive`),C=b.add(b).abs().subtract(x.abs()).sign(),w=Math.abs(l)/o%2==0,T=b.isZero()?Math.abs(l):b.cmp(x)?Ha(Math.abs(l),Math.abs(u),C,w,S):Math.abs(u),E=new Ua(I.default.add(I.default.multiply(x.totalNs,I.default.BigInt(l)),I.default.multiply(b.totalNs,I.default.BigInt(o*e)))).fdiv(x.totalNs),ee=T===Math.abs(u);return p={date:ee?f:d,time:Ua.ZERO},{nudgeResult:{duration:p,nudgedEpochNs:ee?_:g,didExpandCalendarUnit:ee},total:E}}function Ol(e,t,n,r,i,a,o,s,c){let l=e,u=Ts(s)||r&&s===`day`,d=Zc(l)<0?-1:1,f;return u?{nudgeResult:f}=Dl(d,l,t,n,r,i,o,s,c):f=r?function(e,t,n,r,i,a,o,s){let c=t,l=ac(i,n.isoDate,c.date,`constrain`),u=us(l,n.time),d=us($c(l.year,l.month,l.day+e),n.time),f=vc(r,u,`compatible`),p=vc(r,d,`compatible`),m=Ua.fromEpochNsDiff(p,f);if(m.sign()!==e)throw RangeError(`time zone returned inconsistent Instants`);let h=I.default.BigInt(Io[o]*a),g=c.time.round(h,s),_=g.subtract(m),v=_.sign()!==-e,y,b;return v?(y=e,g=_.round(h,s),b=g.addToEpochNs(p)):(y=0,b=g.addToEpochNs(f)),{duration:bl(ls(c.date,c.date.days+y),g),nudgedEpochNs:b,didExpandCalendarUnit:v}}(d,l,n,r,i,o,s,c):function(e,t,n,r,i,a){let o=e,s=o.time.add24HourDays(o.date.days),c=s.round(I.default.BigInt(r*Io[i]),a),l=c.subtract(s),{quotient:u}=s.divmod(co),{quotient:d}=c.divmod(co),f=Math.sign(d-u)===s.sign(),p=l.addToEpochNs(t),m=0,h=c;return Es(n)===`date`&&(m=d,h=c.add(Ua.fromComponents(24*-d,0,0,0,0,0))),{duration:{date:ls(o.date,m),time:h},nudgedEpochNs:p,didExpandCalendarUnit:f}}(l,t,a,o,s,c),l=f.duration,f.didExpandCalendarUnit&&s!==`week`&&(l=function(e,t,n,r,i,a,o,s){let c=t;if(s===o)return c;let l=Fo.indexOf(o);for(let t=Fo.indexOf(s)-1;t>=l;t--){let s=Fo[t];if(s===`week`&&o!==`week`)continue;let l;switch(s){case`year`:l={years:c.date.years+e,months:0,weeks:0,days:0};break;case`month`:{let t=c.date.months+e;l=ls(c.date,0,0,t);break}case`week`:{let t=c.date.weeks+e;l=ls(c.date,0,t);break}}let u=us(ac(a,r.isoDate,l,`constrain`),r.time),d;if(d=i?vc(i,u,`compatible`):Hc(u),Yi(n,d)===-e)break;c={date:l,time:Ua.ZERO}}return c}(d,l,f.nudgedEpochNs,n,r,i,a,ws(s,`day`))),l}function kl(e,t,n,r,i,a){return Ts(a)||r&&a===`day`?Dl(Zc(e)<0?-1:1,e,t,n,r,i,1,a,`trunc`).total:Yl(e.time.add24HourDays(e.date.days),a)}function Al(e,t,n,r,i,a,o){if(Ql(e,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Ua.ZERO};dl(e),dl(t);let s=Tl(e,t,n,r);return a===`nanosecond`&&i===1?s:Ol(s,Hc(t),e,null,n,r,i,a,o)}function jl(e,t,n,r,i,a,o,s){if(Es(i)===`time`)return wl(e,t,a,o,s);let c=El(e,t,n,r,i);return o===`nanosecond`&&a===1?c:Ol(c,t,_c(n,e),n,r,i,a,o,s)}function Ml(e,t,n,r,i,a){let o=Mo.reduce(((e,t)=>{let i=t[0],a=t[1],o=t[2];return n!==`datetime`&&o!==n||r.includes(a)||e.push(a,i),e}),[]),s=xs(t,`largestUnit`,n,`auto`);if(r.includes(s))throw RangeError(`largestUnit must be one of ${o.join(`, `)}, not ${s}`);let c=gs(t),l=ps(t,`trunc`);e===`since`&&(l=function(e){switch(e){case`ceil`:return`floor`;case`floor`:return`ceil`;case`halfCeil`:return`halfFloor`;case`halfFloor`:return`halfCeil`;default:return e}}(l));let u=xs(t,`smallestUnit`,n,i);if(r.includes(u))throw RangeError(`smallestUnit must be one of ${o.join(`, `)}, not ${u}`);let d=ws(a,u);if(s===`auto`&&(s=d),ws(s,u)!==s)throw RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${u}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];return f!==void 0&&_s(c,f,!1),{largestUnit:s,roundingIncrement:c,roundingMode:l,smallestUnit:u}}function nee(e,t,n,r){let i=Is(n),a=Ml(e,ou(r),`time`,[],`nanosecond`,`second`),o=yl(wl(L(t,$i),L(i,$i),a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);return e===`since`&&(o=rl(o)),o}function ree(e,t,n,r){let i=Ms(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`date`,[],`day`,`day`),c=Ra(`%Temporal.Duration%`),l=L(t,ea),u=L(i,ea);if(Xl(l,u)===0)return new c;let d={date:oc(a,l,u,s.largestUnit),time:Ua.ZERO};if(s.smallestUnit!==`day`||s.roundingIncrement!==1){let e=us(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});d=Ol(d,Hc(us(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let f=yl(d,`day`);return e===`since`&&(f=rl(f)),f}function iee(e,t,n,r){let i=Ps(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`datetime`,[],`nanosecond`,`day`),c=Ra(`%Temporal.Duration%`),l=L(t,ta),u=L(i,ta);if(Ql(l,u)===0)return new c;let d=yl(Al(l,u,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return e===`since`&&(d=rl(d)),d}function aee(e,t,n,r){let i=Rs(n),a=Ml(e,ou(r),`time`,[],`nanosecond`,`hour`),o=Cl(L(t,na),L(i,na));o=Jl(o,a.roundingIncrement,a.smallestUnit,a.roundingMode);let s=yl(bl({years:0,months:0,weeks:0,days:0},o),a.largestUnit);return e===`since`&&(s=rl(s)),s}function oee(e,t,n,r){let i=Bs(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between months of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`date`,[`week`,`day`],`month`,`year`),c=Ra(`%Temporal.Duration%`);if(Xl(L(t,ea),L(i,ea))==0)return new c;let l=ks(a,L(t,ea),`year-month`);l.day=1;let u=uc(a,l,`constrain`),d=ks(a,L(i,ea),`year-month`);d.day=1;let f=uc(a,d,`constrain`),p={date:ls(oc(a,u,f,s.largestUnit),0,0),time:Ua.ZERO};if(s.smallestUnit!==`month`||s.roundingIncrement!==1){let e=us(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Ol(p,Hc(us(f,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let m=yl(p,`day`);return e===`since`&&(m=rl(m)),m}function Nl(e,t,n,r){let i=Hs(n),a=L(t,ra),o=L(i,ra);if(!lc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Ml(e,ou(r),`datetime`,[],`nanosecond`,`hour`),c=L(t,$i),l=L(i,$i),u=Ra(`%Temporal.Duration%`),d;if(Es(s.largestUnit)!==`date`)d=yl(wl(c,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let e=L(t,sa);if(!mc(e,L(i,sa)))throw RangeError(`When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.`);if(I.default.equal(c,l))return new u;d=yl(jl(c,l,e,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),`hour`)}return e===`since`&&(d=rl(d)),d}function Pl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){let s=n,c=a;return s+=o.sec,c+=o.subsec,tl(e,t,s,r,i,c)}function Fl(e,t){let n=t.addToEpochNs(e);return pl(n),n}function Il(e,t,n,r,i=`constrain`){if(Xc(r.date)===0)return Fl(e,r.time);let a=_c(t,e);return Fl(vc(t,us(ac(n,a.isoDate,r.date,i),a.time),`compatible`),r.time)}function Ll(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=ws(Cs(t),Cs(r));if(Ts(i))throw RangeError(`For years, months, or weeks arithmetic, use date arithmetic relative to a starting point`);let a=_l(t),o=_l(r);return yl(bl({years:0,months:0,weeks:0,days:0},a.time.add(o.time)),i)}function Rl(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=Cs(r);if(Es(i)===`date`)throw RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let a=_l(r);return ec(Fl(L(t,$i),a.time))}function zl(e,t,n,r){let i=L(t,ra),a=Fs(n);e===`subtract`&&(a=rl(a));let o=vl(a),s=ds(ou(r));return Ws(ac(i,L(t,ea),o,s),i)}function Bl(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=L(t,ra),s=_l(i),c=L(t,ta),l=Pl(c.time,s.time),u=ls(s.date,l.deltaDays);return hl(u.years,u.months,u.weeks,u.days,0,0,0,0,0,0),Ks(us(ac(o,c.isoDate,u,a),l),o)}function Vl(e,t,n){let r=Fs(n);e===`subtract`&&(r=rl(r));let i=_l(r),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Pl(L(t,na),i.time);return Xs(ss(a,o,s,c,l,u,`reject`))}function Hl(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=Yc(i),s=L(t,ra),c=ks(s,L(t,ea),`year-month`);c.day=1;let l=uc(s,c,`constrain`);if(o<0){let e=ac(s,l,{months:1},`constrain`);l=$c(e.year,e.month,e.day-1)}let u=vl(i);return cl(l),Qs(dc(s,ks(s,ac(s,l,u,a),`year-month`),a),s)}function Ul(e,t,n,r){let i=Fs(n);e===`subtract`&&(i=rl(i));let a=ds(ou(r)),o=L(t,sa),s=L(t,ra),c=gl(i);return nc(Il(L(t,$i),o,s,c,a),o,s)}function Wl(e,t,n){let r=Math.trunc(e/t),i=e%t,a=e<0?`negative`:`positive`,o=Math.abs(r),s=o+1,c=au(Math.abs(2*i)-t),l=o%2==0,u=Va(n,a),d=i===0?o:Ha(o,s,c,l,u);return t*(a===`positive`?d:-d)}function Gl(e,t,n,r){let i=Io[n]*t;return function(e,t,n){let r=Ki(e),i=Ki(t),a=I.default.divide(r,i),o=I.default.remainder(r,i),s=Va(n,`positive`),c,l;I.default.lessThan(r,Pi)?(c=I.default.subtract(a,Fi),l=a):(c=a,l=I.default.add(a,Fi));let u=Yi(Ji(I.default.multiply(o,Ii)),i)*(I.default.lessThan(r,Pi)?-1:1)+0,d=I.default.equal(o,Pi)?a:Ha(c,l,u,qi(c),s);return I.default.multiply(d,i)}(e,I.default.BigInt(i),r)}function Kl(e,t,n,r){fl(e);let{year:i,month:a,day:o}=e.isoDate,s=ql(e.time,t,n,r);return us($c(i,a,o+s.deltaDays),s)}function ql({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o,s,c){let l;switch(s){case`day`:case`hour`:l=1e3*(1e3*(1e3*(60*(60*e+t)+n)+r)+i)+a;break;case`minute`:l=1e3*(1e3*(1e3*(60*t+n)+r)+i)+a;break;case`second`:l=1e3*(1e3*(1e3*n+r)+i)+a;break;case`millisecond`:l=1e3*(1e3*r+i)+a;break;case`microsecond`:l=1e3*i+a;break;case`nanosecond`:l=a}let u=Io[s],d=Wl(l,u*o,c)/u;switch(s){case`day`:return{deltaDays:d,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case`hour`:return tl(d,0,0,0,0,0);case`minute`:return tl(e,d,0,0,0,0);case`second`:return tl(e,t,d,0,0,0);case`millisecond`:return tl(e,t,n,d,0,0);case`microsecond`:return tl(e,t,n,r,d,0);case`nanosecond`:return tl(e,t,n,r,i,d);default:throw Error(`Invalid unit ${s}`)}}function Jl(e,t,n,r){let i=Io[n];return e.round(I.default.BigInt(i*t),r)}function Yl(e,t){let n=Io[t];return e.fdiv(I.default.BigInt(n))}function Xl(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:au(e.day-t.day):au(e.month-t.month):au(e.year-t.year)}function Zl(e,t){return e.hour===t.hour?e.minute===t.minute?e.second===t.second?e.millisecond===t.millisecond?e.microsecond===t.microsecond?e.nanosecond===t.nanosecond?0:au(e.nanosecond-t.nanosecond):au(e.microsecond-t.microsecond):au(e.millisecond-t.millisecond):au(e.second-t.second):au(e.minute-t.minute):au(e.hour-t.hour)}function Ql(e,t){let n=Xl(e.isoDate,t.isoDate);return n===0?Zl(e.time,t.time):n}function $l(e){let t=nu(e);return globalThis.BigInt===void 0?t:globalThis.BigInt(t.toString(10))}function eu(e,t){let{quotient:n,remainder:r}=Xi(Ki(e),Vi),i=I.default.toNumber(n);return t===`floor`&&I.default.toNumber(r)<0&&--i,t===`ceil`&&I.default.toNumber(r)>0&&(i+=1),i}function tu(e){if(!Number.isInteger(e))throw RangeError(`epoch milliseconds must be an integer`);return I.default.multiply(I.default.BigInt(e),Vi)}function nu(e){let t=e;if(typeof e==`object`){let n=e[Symbol.toPrimitive];n&&typeof n==`function`&&(t=n.call(e,`number`))}if(typeof t==`number`)throw TypeError(`cannot convert number to bigint`);return typeof t==`bigint`?I.default.BigInt(t.toString(10)):I.default.BigInt(t)}const ru=(()=>{let e=I.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),n=I.default.BigInt(t),r=I.default.add(tu(t),e);return e=I.default.remainder(n,Vi),I.default.greaterThan(r,uo)?uo:I.default.lessThan(r,fo)?fo:r}})();function iu(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function au(e){return e<0?-1:e>0?1:e}function ou(e){if(e===void 0)return Object.create(null);if(bo(e)&&e!==null)return e;throw TypeError(`Options parameter must be an object, not `+(e===null?`null`:typeof e))}function su(e,t){let n=Object.create(null);return n[e]=t,n}function cu(e,t,n,r){let i=e[t];if(i!==void 0){if(i=So(i),!n.includes(i))throw RangeError(`${t} must be one of ${n.join(`, `)}, not ${i}`);return i}if(r===bs)throw RangeError(`${t} option is required`);return r}function lu(e){let t=uu(e);if(!vo.includes(uu(t)))throw RangeError(`invalid calendar identifier ${t}`);switch(t){case`ethiopic-amete-alem`:return`ethioaa`;case`islamicc`:return`islamic-civil`}return t}function uu(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function du(e){throw TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${e===`PlainMonthDay`?`Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))`:`Temporal.${e}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}const see=RegExp(`^${Za.source}$`),cee=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?$`);function fu(e,t,n,r=e(t),i=e(n)){let a=t,o=n,s=r,c=i;for(;o-a>1;){let t=Math.trunc((a+o)/2),n=e(t);n===s?(a=t,s=n):n===c&&(o=t,c=n)}return o}function pu(e){return[...e]}function mu(e,t){if(e!==`gregory`&&e!==`iso8601`)return;let n=gu[e],r=t.year,{dayOfWeek:i,dayOfYear:a,daysInYear:o}=n.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=n.getFirstDayOfWeek(),c=n.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,u=(i-a+7001-s)%7,d=Math.floor((a-1+u)/7);if(7-u>=c&&++d,d==0)d=function(e,t,n,r){let i=(r-e-n+1)%7;i<0&&(i+=7);let a=Math.floor((n+i-1)/7);return 7-i>=t&&++a,a}(s,c,a+n.isoToDate(n.dateAdd(t,{years:-1},`constrain`),{daysInYear:!0}).daysInYear,i),r--;else if(a>=o-5){let e=(l+o-a)%7;e<0&&(e+=7),6-e>=c&&a+7-l>o&&(d=1,r++)}return{week:d,year:r}}function hu(e,t,n,r,i){if(t!==i.year){if(e*(t-i.year)>0)return!0}else if(n!==i.month){if(e*(n-i.month)>0)return!0}else if(r!==i.day&&e*(r-i.day)>0)return!0;return!1}const gu={};function _u(e){if(!e.startsWith(`M`))throw RangeError(`Invalid month code: ${e}. Month codes must start with M.`);let t=+e.slice(1);if(Number.isNaN(t))throw RangeError(`Invalid month code: ${e}`);return t}function vu(e,t=!1){return`M${`${e}`.padStart(2,`0`)}${t?`L`:``}`}function yu(e,t=void 0,n=12){let{month:r,monthCode:i}=e;if(i===void 0){if(r===void 0)throw TypeError(`Either month or monthCode are required`);t===`reject`&&ol(r,1,n),t===`constrain`&&(r=il(r,1,n)),i=vu(r)}else{let e=_u(i);if(i!==vu(e))throw RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==e)throw RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=e,r<1||r>n)throw RangeError(`Invalid monthCode: ${i}`)}return{...e,month:r,monthCode:i}}gu.iso8601={resolveFields(e,t){if((t===`date`||t===`year-month`)&&e.year===void 0)throw TypeError(`year is required`);if((t===`date`||t===`month-day`)&&e.day===void 0)throw TypeError(`day is required`);Object.assign(e,yu(e))},dateToISO:(e,t)=>os(e.year,e.month,e.day,t),monthDayToISOReferenceDate(e,t){let{month:n,day:r}=os(e.year??1972,e.month,e.day,t);return{month:n,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];t.add(r),r===`month`?t.add(`monthCode`):r===`monthCode`&&t.add(`month`)}return pu(t)},dateAdd(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a){let{year:o,month:s,day:c}=e;return o+=t,s+=n,{year:o,month:s}=Qc(o,s),{year:o,month:s,day:c}=os(o,s,c,a),c+=i+7*r,$c(o,s,c)},dateUntil(e,t,n){let r=-Xl(e,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,a=0,o=0;if(n===`year`||n===`month`){let s=t.year-e.year;for(s!==0&&(s-=r);!hu(r,e.year+s,e.month,e.day,t);)a=s,s+=r;let c=r;for(i=Qc(e.year+a,e.month+c);!hu(r,i.year,i.month,e.day,t);)o=c,c+=r,i=Qc(i.year,i.month+r);n===`month`&&(o+=12*a,a=0)}i=Qc(e.year+a,e.month+o);let s=al(i.year,i.month,e.day),c=0,l=xl(t.year,t.month-1,t.day)-xl(s.year,s.month-1,s.day);return n===`week`&&(c=Math.trunc(l/7),l%=7),{years:a,months:o,weeks:c,days:l}},isoToDate({year:e,month:t,day:n},r){let i={era:void 0,eraYear:void 0,year:e,month:t,day:n,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=vu(t)),r.dayOfWeek){let r=t+(t<3?10:-2),a=e-(t<3?1:0),o=Math.floor(a/100),s=a-100*o,c=(n+Math.floor(2.6*r-.2)+(s+Math.floor(s/4))+(Math.floor(o/4)-2*o))%7;i.dayOfWeek=c+(c<=0?7:0)}if(r.dayOfYear){let r=n;for(let n=t-1;n>0;n--)r+=Jc(e,n);i.dayOfYear=r}return r.weekOfYear&&(i.weekOfYear=mu(`iso8601`,{year:e,month:t,day:n})),r.daysInMonth&&(i.daysInMonth=Jc(e,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=qc(e),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var bu=class e{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let n=0;for(let r of t.map.entries()){if(++n>e.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(e){let t=this.map.get(e);return t&&(this.hits++,this.report()),this.calls++,t}set(e,t){this.map.set(e,t),this.misses++,this.report()}report(){}setObject(t){if(e.objectMap.get(t))throw RangeError(`object already cached`);e.objectMap.set(t,this),this.report()}static getCacheForObject(t){let n=e.objectMap.get(t);return n||(n=new e,e.objectMap.set(t,n)),n}};function xu({isoYear:e,isoMonth:t,isoDay:n}){return`${Sc(e)}-${Cc(t)}-${Cc(n)}T00:00Z`}function Su(e,t){return{years:e.year-t.year,months:e.month-t.month,days:e.day-t.day}}bu.objectMap=new WeakMap,bu.MAX_CACHE_ENTRIES=1e3;var Cu=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:`numeric`,month:`numeric`,year:`numeric`,era:`short`,timeZone:`UTC`})),this.formatter}getCalendarParts(e){let t=this.getFormatter(),n=new Date(e);if(e===`-271821-04-19T00:00Z`){let e=t.resolvedOptions();t=new Intl.DateTimeFormat(e.locale,{...e,timeZone:`Etc/GMT+1`}),n=new Date(`-271821-04-20T00:00Z`)}try{return t.formatToParts(n)}catch{throw RangeError(`Invalid ISO date: ${e}`)}}isoToCalendarDate(e,t){let{year:n,month:r,day:i}=e,a=JSON.stringify({func:`isoToCalendarDate`,isoYear:n,isoMonth:r,isoDay:i,id:this.id}),o=t.get(a);if(o)return o;let s=xu({isoYear:n,isoMonth:r,isoDay:i}),c=this.getCalendarParts(s),l={};for(let e=0;e<c.length;e++){let{type:t,value:n}=c[e];if(t!==`year`&&t!==`relatedYear`||(this.hasEra?l.eraYear=+n:l.year=+n),t===`month`){let e=/^([0-9]*)(.*?)$/.exec(n);if(!e||e.length!=3||!e[1]&&!e[2])throw RangeError(`Unexpected month: ${n}`);if(l.month=e[1]?+e[1]:1,l.month<1)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(l.month>13)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);e[2]&&(l.monthExtra=e[2])}t===`day`&&(l.day=+n),this.hasEra&&t===`era`&&n!=null&&n!==``&&(l.era=n.split(` (`)[0].normalize(`NFD`).replace(/[^-0-9 \p{L}]/gu,``).replace(/ /g,`-`).toLowerCase())}if(this.hasEra&&l.eraYear===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let e=this.eras.find((e=>l.era===e.genericName));e&&(l.era=e.code)}if(this.reviseIntlEra){let{era:t,eraYear:n}=this.reviseIntlEra(l,e);l.era=t,l.eraYear=n}this.checkIcuBugs&&this.checkIcuBugs(e);let u=this.adjustCalendarDate(l,t,`constrain`,!0);if(u.year===void 0)throw RangeError(`Missing year converting ${JSON.stringify(e)}`);if(u.month===void 0)throw RangeError(`Missing month converting ${JSON.stringify(e)}`);if(u.day===void 0)throw RangeError(`Missing day converting ${JSON.stringify(e)}`);return t.set(a,u),[`constrain`,`reject`].forEach((n=>{let r=JSON.stringify({func:`calendarToIsoDate`,year:u.year,month:u.month,day:u.day,overflow:n,id:this.id});t.set(r,e)})),u}validateCalendarDate(e){let{month:t,year:n,day:r,eraYear:i,monthCode:a,monthExtra:o}=e;if(o!==void 0)throw RangeError("Unexpected `monthExtra` value");if(n===void 0&&i===void 0)throw TypeError(`year or eraYear is required`);if(t===void 0&&a===void 0)throw TypeError(`month or monthCode is required`);if(r===void 0)throw RangeError(`Missing day`);if(a!==void 0){if(typeof a!=`string`)throw RangeError(`monthCode must be a string, not `+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&e.era===void 0!=(e.eraYear===void 0))throw TypeError(`properties era and eraYear must be provided together`)}adjustCalendarDate(e,t=void 0,n=`constrain`,r=!1){if(this.calendarType===`lunisolar`)throw RangeError(`Override required for lunisolar calendars`);let i=e;this.validateCalendarDate(i);let a=this.monthsInYear(i,t),{month:o,monthCode:s}=i;return{month:o,monthCode:s}=yu(i,n,a),{...i,month:o,monthCode:s}}regulateMonthDayNaive(e,t,n){let r=this.monthsInYear(e,n),{month:i,day:a}=e;return t===`reject`?(ol(i,1,r),ol(a,1,this.maximumMonthLength(e))):(i=il(i,1,r),a=il(a,1,this.maximumMonthLength({...e,month:i}))),{...e,month:i,day:a}}calendarToIsoDate(e,t=`constrain`,n){let r=e,i=this.adjustCalendarDate(e,n,t,!1);i=this.regulateMonthDayNaive(i,t,n);let{year:a,month:o,day:s}=i,c=JSON.stringify({func:`calendarToIsoDate`,year:a,month:o,day:s,overflow:t,id:this.id}),l,u=n.get(c);if(u||r.year!==void 0&&r.month!==void 0&&r.day!==void 0&&(r.year!==i.year||r.month!==i.month||r.day!==i.day)&&(l=JSON.stringify({func:`calendarToIsoDate`,year:r.year,month:r.month,day:r.day,overflow:t,id:this.id}),u=n.get(l),u))return u;let d=this.estimateIsoDate({year:a,month:o,day:s}),f=e=>{let r=this.addDaysIso(d,e);if(i.day>this.minimumMonthLength(i)){let e=this.isoToCalendarDate(r,n);for(;e.month!==o||e.year!==a;){if(t===`reject`)throw RangeError(`day ${s} does not exist in month ${o} of year ${a}`);r=this.addDaysIso(r,-1),e=this.isoToCalendarDate(r,n)}}return r},p=0,m=this.isoToCalendarDate(d,n),h=Su(i,m);if(h.years!==0||h.months!==0||h.days!==0){let e=365*h.years+30*h.months+h.days;d=this.addDaysIso(d,e),m=this.isoToCalendarDate(d,n),h=Su(i,m),h.years===0&&h.months===0?d=f(h.days):p=this.compareCalendarDates(i,m)}let g=8;for(;p;){d=this.addDaysIso(d,p*g);let e=m;m=this.isoToCalendarDate(d,n);let a=p;if(p=this.compareCalendarDates(i,m),p){if(h=Su(i,m),h.years===0&&h.months===0)d=f(h.days),p=0;else if(a&&p!==a)if(g>1)g/=2;else{if(t===`reject`)throw RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...r})}`);this.compareCalendarDates(m,e)>0&&(d=this.addDaysIso(d,-1)),p=0}}}if(n.set(c,d),l&&n.set(l,d),i.year===void 0||i.month===void 0||i.day===void 0||i.monthCode===void 0||this.hasEra&&(i.era===void 0||i.eraYear===void 0))throw RangeError(`Unexpected missing property`);return d}compareCalendarDates(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:au(e.day-t.day):au(e.month-t.month):au(e.year-t.year)}regulateDate(e,t=`constrain`,n){let r=this.calendarToIsoDate(e,t,n);return this.isoToCalendarDate(r,n)}addDaysIso(e,t){return $c(e.year,e.month,e.day+t)}addDaysCalendar(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.addDaysIso(r,t);return this.isoToCalendarDate(i,n)}addMonthsCalendar(e,t,n,r){let i=e,{day:a}=i;for(let e=0,n=Math.abs(t);e<n;e++){let{month:e}=i,n=i,o=t<0?-Math.max(a,this.daysInPreviousMonth(i,r)):this.daysInMonth(i,r),s=this.calendarToIsoDate(i,`constrain`,r),c=this.addDaysIso(s,o);if(i=this.isoToCalendarDate(c,r),t>0){let t=this.monthsInYear(n,r);for(;i.month-1!=e%t;)c=this.addDaysIso(c,-1),i=this.isoToCalendarDate(c,r)}i.day!==a&&(i=this.regulateDate({...i,day:a},`constrain`,r))}if(n===`reject`&&i.day!==a)throw RangeError(`Day ${a} does not exist in resulting calendar month`);return i}addCalendar(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a,o){let{year:s,day:c,monthCode:l}=e,u=this.adjustCalendarDate({year:s+t,monthCode:l,day:c},o),d=this.addMonthsCalendar(u,n,a,o),f=i+7*r;return this.addDaysCalendar(d,f,o)}untilCalendar(e,t,n,r){let i=0,a=0,o=0,s=0;switch(n){case`day`:i=this.calendarDaysUntil(e,t,r);break;case`week`:{let n=this.calendarDaysUntil(e,t,r);i=n%7,a=(n-i)/7;break}case`month`:case`year`:{let a=this.compareCalendarDates(t,e);if(!a)return{years:0,months:0,weeks:0,days:0};let c=t.year-e.year,l=t.day-e.day;if(n===`year`&&c){let n=0;t.monthCode>e.monthCode&&(n=1),t.monthCode<e.monthCode&&(n=-1),n||=Math.sign(l),s=n*a<0?c-a:c}let u,d=s?this.addCalendar(e,{years:s},`constrain`,r):e;do o+=a,u=d,d=this.addMonthsCalendar(u,a,`constrain`,r),d.day!==e.day&&(d=this.regulateDate({...d,day:e.day},`constrain`,r));while(this.compareCalendarDates(t,d)*a>=0);o-=a,i=this.calendarDaysUntil(u,t,r);break}}return{years:s,months:o,weeks:a,days:i}}daysInMonth(e,t){let{day:n}=e,r=this.maximumMonthLength(e),i=this.minimumMonthLength(e);if(i===r)return i;let a=n<=r-i?r:i,o=this.calendarToIsoDate(e,`constrain`,t),s=this.addDaysIso(o,a),c=this.isoToCalendarDate(s,t),l=this.addDaysIso(s,-c.day);return this.isoToCalendarDate(l,t).day}daysInPreviousMonth(e,t){let{day:n,month:r,year:i}=e,a={year:r>1?i:i-1,month:r,day:1},o=r>1?r-1:this.monthsInYear(a,t);a={...a,month:o};let s=this.minimumMonthLength(a),c=this.maximumMonthLength(a);if(s===c)return c;let l=this.calendarToIsoDate(e,`constrain`,t),u=this.addDaysIso(l,-n);return this.isoToCalendarDate(u,t).day}startOfCalendarYear(e){return{year:e.year,month:1,monthCode:`M01`,day:1}}startOfCalendarMonth(e){return{year:e.year,month:e.month,day:1}}calendarDaysUntil(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.calendarToIsoDate(t,`constrain`,n);return xl(i.year,i.month-1,i.day)-xl(r.year,r.month-1,r.day)}monthDaySearchStartYear(e,t){return 1972}monthDayFromFields(e,t,n){let r,i,a,o,s,{era:c,eraYear:l,year:u,month:d,monthCode:f,day:p}=e;if(d!==void 0&&u===void 0&&(!this.hasEra||c===void 0||l===void 0))throw TypeError(`when month is present, year (or era and eraYear) are required`);(f===void 0||u!==void 0||this.hasEra&&l!==void 0)&&({monthCode:f,day:p}=this.isoToCalendarDate(this.calendarToIsoDate(e,t,n),n));let m={year:this.monthDaySearchStartYear(f,p),month:12,day:31},h=this.isoToCalendarDate(m,n),g=h.monthCode>f||h.monthCode===f&&h.day>=p?h.year:h.year-1;for(let e=0;e<20;e++){let c=this.adjustCalendarDate({day:p,monthCode:f,year:g-e},n),l=this.calendarToIsoDate(c,`constrain`,n),u=this.isoToCalendarDate(l,n);if({year:r,month:i,day:a}=l,u.monthCode===f&&u.day===p)return{month:i,day:a,year:r};if(t===`constrain`){let e=this.maxLengthOfMonthCodeInAnyYear(u.monthCode);if(u.monthCode===f&&u.day===e&&p>e)return{month:i,day:a,year:r};(o===void 0||u.monthCode===o.monthCode&&u.day>o.day)&&(o=u,s=l)}}if(t===`constrain`&&s!==void 0)return s;throw RangeError(`No recent ${this.id} year with monthCode ${f} and day ${p}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},lee=class extends Cu{constructor(){super(...arguments),this.id=`hebrew`,this.calendarType=`lunisolar`,this.months={Tishri:{leap:1,regular:1,monthCode:`M01`,days:30},Heshvan:{leap:2,regular:2,monthCode:`M02`,days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:`M03`,days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:`M04`,days:29},Shevat:{leap:5,regular:5,monthCode:`M05`,days:30},Adar:{leap:void 0,regular:6,monthCode:`M06`,days:29},"Adar I":{leap:6,regular:void 0,monthCode:`M05L`,days:30},"Adar II":{leap:7,regular:void 0,monthCode:`M06`,days:29},Nisan:{leap:8,regular:7,monthCode:`M07`,days:30},Iyar:{leap:9,regular:8,monthCode:`M08`,days:29},Sivan:{leap:10,regular:9,monthCode:`M09`,days:30},Tamuz:{leap:11,regular:10,monthCode:`M10`,days:29},Av:{leap:12,regular:11,monthCode:`M11`,days:30},Elul:{leap:13,regular:12,monthCode:`M12`,days:29}}}inLeapYear(e){let{year:t}=e;return(7*t+1)%19<7}monthsInYear(e){return this.inLeapYear(e)?13:12}minimumMonthLength(e){return this.minMaxMonthLength(e,`min`)}maximumMonthLength(e){return this.minMaxMonthLength(e,`max`)}minMaxMonthLength(e,t){let{month:n,year:r}=e,i=this.getMonthCode(r,n),a=Object.entries(this.months).find((e=>e[1].monthCode===i));if(a===void 0)throw RangeError(`unmatched Hebrew month: ${n}`);let o=a[1].days;return typeof o==`number`?o:o[t]}maxLengthOfMonthCodeInAnyYear(e){return[`M04`,`M06`,`M08`,`M10`,`M12`].includes(e)?29:30}estimateIsoDate(e){let{year:t}=e;return{year:t-3760,month:1,day:1}}getMonthCode(e,t){return this.inLeapYear({year:e})?t===6?vu(5,!0):vu(t<6?t:t-1):vu(t)}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthCode:o,day:s,monthExtra:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(c){let e=this.months[c];if(!e)throw RangeError(`Unrecognized month from formatToParts: ${c}`);a=this.inLeapYear({year:i})?e.leap:e.regular}return o=this.getMonthCode(i,a),{year:i,month:a,day:s,monthCode:o}}if(this.validateCalendarDate(e),a===void 0)if(o.endsWith(`L`)){if(o!==`M05L`)throw RangeError(`Hebrew leap month must have monthCode M05L, not ${o}`);if(a=6,!this.inLeapYear({year:i})){if(n===`reject`)throw RangeError(`Hebrew monthCode M05L is invalid in year ${i} which is not a leap year`);a=6,o=`M06`}}else{a=_u(o),this.inLeapYear({year:i})&&a>=6&&a++;let e=this.monthsInYear({year:i});if(a<1||a>e)throw RangeError(`Invalid monthCode: ${o}`)}else if(n===`reject`?(ol(a,1,this.monthsInYear({year:i})),ol(s,1,this.maximumMonthLength({year:i,month:a}))):(a=il(a,1,this.monthsInYear({year:i})),s=il(s,1,this.maximumMonthLength({year:i,month:a}))),o===void 0)o=this.getMonthCode(i,a);else if(this.getMonthCode(i,a)!==o)throw RangeError(`monthCode ${o} doesn't correspond to month ${a} in Hebrew year ${i}`);return{...e,day:s,month:a,monthCode:o,year:i}}},wu=class extends Cu{constructor(){super(...arguments),this.calendarType=`lunar`,this.DAYS_PER_ISLAMIC_YEAR=354.3666666666667,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(e,t){let n={year:e.year,month:1,monthCode:`M01`,day:1},r={year:e.year+1,month:1,monthCode:`M01`,day:1};return this.calendarDaysUntil(n,r,t)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:Math.floor(t*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},uee=class extends wu{constructor(){super(...arguments),this.id=`islamic`}},dee=class extends wu{constructor(){super(...arguments),this.id=`islamic-umalqura`}},fee=class extends wu{constructor(){super(...arguments),this.id=`islamic-tbla`}},pee=class extends wu{constructor(){super(...arguments),this.id=`islamic-civil`}},mee=class extends wu{constructor(){super(...arguments),this.id=`islamic-rgsa`}},hee=class extends wu{constructor(){super(...arguments),this.id=`islamicc`}},gee=class extends Cu{constructor(){super(...arguments),this.id=`persian`,this.calendarType=`solar`}inLeapYear(e,t){return this.daysInMonth({year:e.year,month:12,day:1},t)===30}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===12?29:t<=6?31:30}maximumMonthLength(e){let{month:t}=e;return t===12?30:t<=6?31:30}maxLengthOfMonthCodeInAnyYear(e){return _u(e)<=6?31:30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:t+621,month:1,day:1}}},_ee=class extends Cu{constructor(){super(...arguments),this.id=`indian`,this.calendarType=`solar`,this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date(`0000-01-01T00:00Z`).toLocaleDateString(`en-US-u-ca-indian`,{timeZone:`UTC`})!==`10/11/-79 Saka`}inLeapYear(e){return Tu(e.year+78)}monthsInYear(){return 12}minimumMonthLength(e){return this.getMonthInfo(e).length}maximumMonthLength(e){return this.getMonthInfo(e).length}maxLengthOfMonthCodeInAnyYear(e){let t=_u(e),n=this.months[t];return n=n.leap??n,n.length}getMonthInfo(e){let{month:t}=e,n=this.months[t];if(n===void 0)throw RangeError(`Invalid month: ${t}`);return this.inLeapYear(e)&&n.leap&&(n=n.leap),n}estimateIsoDate(e){let t=this.adjustCalendarDate(e),n=this.getMonthInfo(t);return $c(t.year+78+(n.nextYear?1:0),n.month,n.day+t.day-1)}checkIcuBugs(e){if(this.vulnerableToBceBug&&e.year<1)throw RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function Tu(e){return e%4==0&&(e%100!=0||e%400==0)}var Eu=class extends Cu{constructor(e,t){super(),this.calendarType=`solar`,this.id=e,this.isoEpoch=t}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Tu(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][_u(e)-1]}estimateIsoDate(e){let t=this.adjustCalendarDate(e);return os(t.year+this.isoEpoch.year,t.month+this.isoEpoch.month,t.day+this.isoEpoch.day,`constrain`)}},Du=class extends Cu{constructor(e,t){super(),this.hasEra=!0,this.calendarType=`solar`,this.id=e;let{eras:n,anchorEra:r}=function(e){let t,n=e;if(n.length===0)throw RangeError(`Invalid era data: eras are required`);if(n.length===1&&n[0].reverseOf)throw RangeError(`Invalid era data: anchor era cannot count years backwards`);if(n.length===1&&!n[0].code)throw RangeError(`Invalid era data: at least one named era is required`);if(n.filter((e=>e.reverseOf!=null)).length>1)throw RangeError(`Invalid era data: only one era can count years backwards`);n.forEach((e=>{if(e.isAnchor||!e.anchorEpoch&&!e.reverseOf){if(t)throw RangeError(`Invalid era data: cannot have multiple anchor eras`);t=e,e.anchorEpoch={year:e.hasYearZero?0:1}}else if(!e.code)throw RangeError(`If era name is blank, it must be the anchor era`)})),n=n.filter((e=>e.code)),n.forEach((e=>{let{reverseOf:t}=e;if(t){let r=n.find((e=>e.code===t));if(r===void 0)throw RangeError(`Invalid era data: unmatched reverseOf era: ${t}`);e.reverseOf=r,e.anchorEpoch=r.anchorEpoch,e.isoEpoch=r.isoEpoch}e.anchorEpoch.month===void 0&&(e.anchorEpoch.month=1),e.anchorEpoch.day===void 0&&(e.anchorEpoch.day=1)})),n.sort(((e,t)=>{if(e.reverseOf)return 1;if(t.reverseOf)return-1;if(!e.isoEpoch||!t.isoEpoch)throw RangeError(`Invalid era data: missing ISO epoch`);return t.isoEpoch.year-e.isoEpoch.year}));let r=n[n.length-1].reverseOf;if(r&&r!==n[n.length-2])throw RangeError(`Invalid era data: invalid reverse-sign era`);return n.forEach(((e,t)=>{e.genericName=`era`+(n.length-1-t)})),{eras:n,anchorEra:t||n[0]}}(t);this.anchorEra=r,this.eras=n}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Tu(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][_u(e)-1]}completeEraYear(e){let t=(t,n,r)=>{let i=e[t];if(i!=null&&i!=n&&!(r||[]).includes(i)){let e=r?.[0];throw RangeError(`Input ${t} ${i} doesn't match calculated value ${e?`${n} (also called ${e})`:n}`)}},n=t=>{let n,r={...e,year:t},i=this.eras.find(((e,i)=>{if(i===this.eras.length-1){if(e.reverseOf){if(t>0)throw RangeError(`Signed year ${t} is invalid for era ${e.code}`);return n=e.anchorEpoch.year-t,!0}return n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0}return this.compareCalendarDates(r,e.anchorEpoch)>=0&&(n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0)}));if(!i)throw RangeError(`Year ${t} was not matched by any era`);return{eraYear:n,era:i.code,eraNames:i.names}},{year:r,eraYear:i,era:a}=e;if(r!=null){let e=n(r);({eraYear:i,era:a}=e),t(`era`,a,e?.eraNames),t(`eraYear`,i)}else{if(i==null)throw RangeError(`Either year or eraYear and era are required`);{if(a===void 0)throw RangeError(`era and eraYear must be provided together`);let e=this.eras.find((({code:e,names:t=[]})=>e===a||t.includes(a)));if(!e)throw RangeError(`Era ${a} (ISO year ${i}) was not matched by any era`);r=e.reverseOf?e.anchorEpoch.year-i:i+e.anchorEpoch.year-(e.hasYearZero?0:1),t(`year`,r),{eraYear:i,era:a}=n(r)}}return{...e,year:r,eraYear:i,era:a}}adjustCalendarDate(e,t,n=`constrain`){let r=e,{month:i,monthCode:a}=r;return i===void 0&&(r={...r,month:_u(a)}),this.validateCalendarDate(r),r=this.completeEraYear(r),super.adjustCalendarDate(r,t,n)}estimateIsoDate(e){let{year:t,month:n,day:r}=this.adjustCalendarDate(e),{anchorEra:i}=this;return os(t+i.isoEpoch.year-(i.hasYearZero?0:1),n,r,`constrain`)}},Ou=class extends Du{constructor(e,t){super(e,t)}isoToCalendarDate(e){let{year:t,month:n,day:r}=e,i=vu(n),a=t-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:n,monthCode:i,day:r})}};const ku={inLeapYear(e){let{year:t}=e;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(e){let{month:t}=e;return t===13?this.inLeapYear(e)?6:5:30},maximumMonthLength(e){return this.minimumMonthLength(e)},maxLengthOfMonthCodeInAnyYear:e=>e===`M13`?6:30};var vee=class extends Eu{constructor(e,t){super(e,t),this.inLeapYear=ku.inLeapYear,this.monthsInYear=ku.monthsInYear,this.minimumMonthLength=ku.minimumMonthLength,this.maximumMonthLength=ku.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=ku.maxLengthOfMonthCodeInAnyYear}},Au=class extends Du{constructor(e,t){super(e,t),this.inLeapYear=ku.inLeapYear,this.monthsInYear=ku.monthsInYear,this.minimumMonthLength=ku.minimumMonthLength,this.maximumMonthLength=ku.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=ku.maxLengthOfMonthCodeInAnyYear}},yee=class extends vee{constructor(){super(`ethioaa`,{year:-5492,month:7,day:17})}},bee=class extends Au{constructor(){super(`coptic`,[{code:`coptic`,isoEpoch:{year:284,month:8,day:29}},{code:`coptic-inverse`,reverseOf:`coptic`}])}},xee=class extends Au{constructor(){super(`ethiopic`,[{code:`ethioaa`,names:[`ethiopic-amete-alem`,`mundi`],isoEpoch:{year:-5492,month:7,day:17}},{code:`ethiopic`,names:[`incar`],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},See=class extends Ou{constructor(){super(`roc`,[{code:`roc`,names:[`minguo`],isoEpoch:{year:1912,month:1,day:1}},{code:`roc-inverse`,names:[`before-roc`],reverseOf:`roc`}])}},Cee=class extends Eu{constructor(){super(`buddhist`,{year:-543,month:1,day:1})}},wee=class extends Ou{constructor(){super(`gregory`,[{code:`gregory`,names:[`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`gregory-inverse`,names:[`be`,`bce`],reverseOf:`gregory`}])}reviseIntlEra(e){let{era:t,eraYear:n}=e;return t===`b`&&(t=`gregory-inverse`),t===`a`&&(t=`gregory`),{era:t,eraYear:n}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},Tee=class extends Ou{constructor(){super(`japanese`,[{code:`reiwa`,isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:`heisei`,isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:`showa`,isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:`taisho`,isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:`meiji`,isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:`japanese`,names:[`japanese`,`gregory`,`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`japanese-inverse`,names:[`japanese-inverse`,`gregory-inverse`,`bc`,`bce`],reverseOf:`japanese`}]),this.erasBeginMidYear=!0}reviseIntlEra(e,t){let{era:n,eraYear:r}=e,{year:i}=t;return this.eras.find((e=>e.code===n))?{era:n,eraYear:r}:i<1?{era:`japanese-inverse`,eraYear:1-i}:{era:`japanese`,eraYear:i}}},ju=class extends Cu{constructor(){super(...arguments),this.calendarType=`lunisolar`}inLeapYear(e,t){let n=this.getMonthList(e.year,t);return Object.entries(n).length===13}monthsInYear(e,t){return this.inLeapYear(e,t)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(e){return[`M01L`,`M09L`,`M10L`,`M11L`,`M12L`].includes(e)?29:30}monthDaySearchStartYear(e,t){let n={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[e]??[1972,1972];return t<30?n[0]:n[1]}getMonthList(e,t){if(e===void 0)throw TypeError(`Missing year`);let n=JSON.stringify({func:`getMonthList`,calendarYear:e,id:this.id}),r=t.get(n);if(r)return r;let i=this.getFormatter(),a=(e,t)=>{let n=xu({isoYear:e,isoMonth:2,isoDay:1}),r=new Date(n);r.setUTCDate(t+1);let a=i.formatToParts(r),o=a.find((e=>e.type===`month`)).value,s=+a.find((e=>e.type===`day`)).value,c=a.find((e=>e.type===`relatedYear`)),l;if(c===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return l=+c.value,{calendarMonthString:o,calendarDay:s,calendarYearToVerify:l}},o=17,{calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o);s!==`1`&&(o+=29,{calendarMonthString:s,calendarDay:c}=a(e,o)),o-=c-5;let u={},d,f,p=1,m=!1;do({calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o)),d&&(u[f].daysInMonth=d+30-c),l===e?(u[s]={monthIndex:p++},o+=30):m=!0,d=c,f=s;while(!m);return u[f].daysInMonth=d+30-c,t.set(n,u),u}estimateIsoDate(e){let{year:t,month:n}=e;return{year:t,month:n>=12?12:n+1,day:1}}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthExtra:o,day:s,monthCode:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(o&&o!==`bis`)throw RangeError(`Unexpected leap month suffix: ${o}`);let e=vu(a,o!==void 0),n=`${a}${o||``}`,r=this.getMonthList(i,t)[n];if(r===void 0)throw RangeError(`Unmatched month ${n} in Chinese year ${i}`);return a=r.monthIndex,{year:i,month:a,day:s,monthCode:e}}if(this.validateCalendarDate(e),a===void 0){let e=this.getMonthList(i,t),r=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));r[0]===`0`&&(r=r.slice(1));let o=e[r];if(a=o&&o.monthIndex,a===void 0&&c.endsWith(`L`)&&c!=`M13L`&&n===`constrain`){let t=+c.replace(/^M0?|L$/g,``);o=e[t],o&&(a=o.monthIndex,c=vu(t))}if(a===void 0)throw RangeError(`Unmatched month ${c} in Chinese year ${i}`)}else if(c===void 0){let e=this.getMonthList(i,t),r=Object.entries(e),o=r.length;n===`reject`?(ol(a,1,o),ol(s,1,this.maximumMonthLength())):(a=il(a,1,o),s=il(s,1,this.maximumMonthLength()));let l=r.find((e=>e[1].monthIndex===a));if(l===void 0)throw RangeError(`Invalid month ${a} in Chinese year ${i}`);c=vu(+l[0].replace(`bis`,``),l[0].indexOf(`bis`)!==-1)}else{let e=this.getMonthList(i,t),n=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));n[0]===`0`&&(n=n.slice(1));let r=e[n];if(!r)throw RangeError(`Unmatched monthCode ${c} in Chinese year ${i}`);if(a!==r.monthIndex)throw RangeError(`monthCode ${c} doesn't correspond to month ${a} in Chinese year ${i}`)}return{...e,year:i,month:a,monthCode:c,day:s}}},Eee=class extends ju{constructor(){super(...arguments),this.id=`chinese`}},Dee=class extends ju{constructor(){super(...arguments),this.id=`dangi`}},Oee=class{constructor(e){this.helper=e}extraFields(e){return this.helper.hasEra&&e.includes(`year`)?[`era`,`eraYear`]:[]}resolveFields(e){if(this.helper.calendarType!==`lunisolar`){let t=new bu;yu(e,void 0,this.helper.monthsInYear({year:e.year??1972},t))}}dateToISO(e,t){let n=new bu,r=this.helper.calendarToIsoDate(e,t,n);return n.setObject(r),r}monthDayToISOReferenceDate(e,t){let n=new bu,r=this.helper.monthDayFromFields(e,t,n);return n.setObject(r),r}fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];switch(t.add(r),r){case`era`:t.add(`eraYear`),t.add(`year`);break;case`eraYear`:t.add(`era`),t.add(`year`);break;case`year`:t.add(`era`),t.add(`eraYear`);break;case`month`:t.add(`monthCode`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`monthCode`:t.add(`month`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`day`:this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`))}}return pu(t)}dateAdd(e,{years:t,months:n,weeks:r,days:i},a){let o=bu.getCacheForObject(e),s=this.helper.isoToCalendarDate(e,o),c=this.helper.addCalendar(s,{years:t,months:n,weeks:r,days:i},a,o),l=this.helper.calendarToIsoDate(c,`constrain`,o);return bu.getCacheForObject(l)||new bu(o).setObject(l),l}dateUntil(e,t,n){let r=bu.getCacheForObject(e),i=bu.getCacheForObject(t),a=this.helper.isoToCalendarDate(e,r),o=this.helper.isoToCalendarDate(t,i);return this.helper.untilCalendar(a,o,n,r)}isoToDate(e,t){let n=bu.getCacheForObject(e),r=this.helper.isoToCalendarDate(e,n);if(t.dayOfWeek&&(r.dayOfWeek=gu.iso8601.isoToDate(e,{dayOfWeek:!0}).dayOfWeek),t.dayOfYear){let e=this.helper.startOfCalendarYear(r);r.dayOfYear=this.helper.calendarDaysUntil(e,r,n)+1}if(t.weekOfYear&&(r.weekOfYear=mu(this.helper.id,e)),r.daysInWeek=7,t.daysInMonth&&(r.daysInMonth=this.helper.daysInMonth(r,n)),t.daysInYear){let e=this.helper.startOfCalendarYear(r),t=this.helper.addCalendar(e,{years:1},`constrain`,n);r.daysInYear=this.helper.calendarDaysUntil(e,t,n)}return t.monthsInYear&&(r.monthsInYear=this.helper.monthsInYear(r,n)),t.inLeapYear&&(r.inLeapYear=this.helper.inLeapYear(r,n)),r}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let e of[lee,gee,xee,yee,bee,Eee,Dee,See,_ee,Cee,wee,Tee,uee,dee,fee,pee,mee,hee]){let t=new e;gu[t.id]=new Oee(t)}La(`calendarImpl`,(function(e){return gu[e]}));const Mu=Intl.DateTimeFormat;function Nu(e,t){let n=L(e,t);return typeof n==`function`&&(n=new Mu(L(e,Ea),n(L(e,Da))),function(e,t,n){let r=Aa(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t]===void 0)throw TypeError(`tried to reset ${t} which was not set`);r[t]=n}(e,t,n)),n}function Pu(e){return Na(e,Sa)}var Fu=class{constructor(e=void 0,t=void 0){(function(e,t,n){let r=n!==void 0,i;if(r){let e=[`localeMatcher`,`calendar`,`numberingSystem`,`hour12`,`hourCycle`,`timeZone`,`weekday`,`era`,`year`,`month`,`day`,`dayPeriod`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`timeZoneName`,`formatMatcher`,`dateStyle`,`timeStyle`];i=function(e){if(e==null)throw TypeError(`Expected object not ${e}`);return Object(e)}(n);let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}i=t}else i=Object.create(null);let a=new Mu(t,i),o=a.resolvedOptions();if(Ma(e),r){let t=Object.assign(Object.create(null),o);for(let e in t)Object.prototype.hasOwnProperty.call(i,e)||delete t[e];t.hour12=i.hour12,t.hourCycle=i.hourCycle,Pa(e,Da,t)}else Pa(e,Da,i);Pa(e,Ea,o.locale),Pa(e,Sa,a),Pa(e,Ca,o.timeZone),Pa(e,Ta,o.calendar),Pa(e,va,Lee),Pa(e,`ym`,Fee),Pa(e,`md`,Iee),Pa(e,ya,Pee),Pa(e,ba,Ree),Pa(e,xa,zee);let s=r?i.timeZone:void 0;if(s===void 0)Pa(e,wa,o.timeZone);else{let t=So(s);if(t.startsWith(`−`))throw RangeError(`Unicode minus (U+2212) is not supported in time zone offsets`);Pa(e,wa,pc(t))}})(this,e,t)}get format(){R(this,Pu);let e=Aee.bind(this);return Object.defineProperties(e,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:``,enumerable:!1,writable:!1,configurable:!0}}),e}formatRange(e,t){return R(this,Pu),Mee.call(this,e,t)}formatToParts(e,...t){return R(this,Pu),jee.call(this,e,...t)}formatRangeToParts(e,t){return R(this,Pu),Nee.call(this,e,t)}resolvedOptions(){return R(this,Pu),kee.call(this)}};`formatToParts`in Mu.prototype||delete Fu.prototype.formatToParts,`formatRangeToParts`in Mu.prototype||delete Fu.prototype.formatRangeToParts;const Iu=function(e=void 0,t=void 0){return new Fu(e,t)};function kee(){let e=L(this,Sa).resolvedOptions();return e.timeZone=L(this,wa),e}function Aee(e,...t){let n,r,i=Wu(e,this);return i.formatter?(n=i.formatter,r=[eu(i.epochNs,`floor`)]):(n=L(this,Sa),r=[e,...t]),n.format(...r)}function jee(e,...t){let n,r,i=Wu(e,this);return i.formatter?(n=i.formatter,r=[eu(i.epochNs,`floor`)]):(n=L(this,Sa),r=[e,...t]),n.formatToParts(...r)}function Mee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=Hu(e),r=Hu(t),i,a=[n,r];if(Vu(n)!==Vu(r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);if(Vu(n)){if(!Uu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);let{epochNs:e,formatter:t}=Wu(n,this),{epochNs:o,formatter:s}=Wu(r,this);t&&(i=t,a=[eu(e,`floor`),eu(o,`floor`)])}return i||=L(this,Sa),i.formatRange(...a)}function Nee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=Hu(e),r=Hu(t),i,a=[n,r];if(Vu(n)!==Vu(r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);if(Vu(n)){if(!Uu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);let{epochNs:e,formatter:t}=Wu(n,this),{epochNs:o,formatter:s}=Wu(r,this);t&&(i=t,a=[eu(e,`floor`),eu(o,`floor`)])}return i||=L(this,Sa),i.formatRangeToParts(...a)}function Lu(e={},t={}){let n=Object.assign({},e),r=[`year`,`month`,`day`,`hour`,`minute`,`second`,`weekday`,`dayPeriod`,`timeZoneName`,`dateStyle`,`timeStyle`];for(let e=0;e<r.length;e++){let i=r[e];n[i]=i in t?t[i]:n[i],!1!==n[i]&&n[i]!==void 0||delete n[i]}return n}function Pee(e){let t=Lu(e,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!==`long`&&t.timeStyle!==`full`||(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})),!zu(t)){if(Bu(e))throw TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(e)}]`);Object.assign(t,{hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function Fee(e){let t={short:{year:`2-digit`,month:`numeric`},medium:{year:`numeric`,month:`short`},long:{year:`numeric`,month:`long`},full:{year:`numeric`,month:`long`}},n=Lu(e,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`year`in n||`month`in n||`era`in n)){if(Bu(e))throw TypeError(`cannot format PlainYearMonth with options [${Object.keys(e)}]`);Object.assign(n,{year:`numeric`,month:`numeric`})}return n}function Iee(e){let t={short:{month:`numeric`,day:`numeric`},medium:{month:`short`,day:`numeric`},long:{month:`long`,day:`numeric`},full:{month:`long`,day:`numeric`}},n=Lu(e,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`month`in n)&&!(`day`in n)){if(Bu(e))throw TypeError(`cannot format PlainMonthDay with options [${Object.keys(e)}]`);Object.assign(n,{month:`numeric`,day:`numeric`})}return n}function Lee(e){let t=Lu(e,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Ru(t)){if(Bu(e))throw TypeError(`cannot format PlainDate with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`})}return t}function Ree(e){let t=Lu(e,{timeZoneName:!1});if((t.timeStyle===`long`||t.timeStyle===`full`)&&(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}),t.dateStyle)&&(Object.assign(t,{short:{year:`numeric`,month:`numeric`,day:`numeric`},medium:{year:`numeric`,month:`short`,day:`numeric`},long:{year:`numeric`,month:`long`,day:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,weekday:`long`}}[t.dateStyle]),delete t.dateStyle),!zu(t)&&!Ru(t)){if(Bu(e))throw TypeError(`cannot format PlainDateTime with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function zee(e){let t=e;return zu(t)||Ru(t)||(t=Object.assign({},t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})),t}function Ru(e){return`year`in e||`month`in e||`day`in e||`weekday`in e||`dateStyle`in e||`era`in e}function zu(e){return`hour`in e||`minute`in e||`second`in e||`timeStyle`in e||`dayPeriod`in e||`fractionalSecondDigits`in e}function Bu(e){return Ru(e)||zu(e)||`dateStyle`in e||`timeStyle`in e||`timeZoneName`in e}function Vu(e){return Uo(e)||Wo(e)||Go(e)||Jo(e)||Ko(e)||qo(e)||Vo(e)}function Hu(e){return Vu(e)?e:xo(e)}function Uu(e,t){return!(!Vu(e)||!Vu(t)||Wo(e)&&!Wo(t)||Uo(e)&&!Uo(t)||Go(e)&&!Go(t)||Jo(e)&&!Jo(t)||Ko(e)&&!Ko(t)||qo(e)&&!qo(t)||Vo(e)&&!Vo(t))}function Wu(e,t){if(Wo(e)){let n={isoDate:{year:1970,month:1,day:1},time:L(e,na)};return{epochNs:vc(L(t,Ca),n,`compatible`),formatter:Nu(t,ya)}}if(Ko(e)){let n=L(e,ra),r=L(t,Ta);if(n!==r)throw RangeError(`cannot format PlainYearMonth with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,`ym`)}}if(qo(e)){let n=L(e,ra),r=L(t,Ta);if(n!==r)throw RangeError(`cannot format PlainMonthDay with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,`md`)}}if(Uo(e)){let n=L(e,ra),r=L(t,Ta);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDate with calendar ${n} in locale with calendar ${r}`);let i=us(L(e,ea),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,va)}}if(Go(e)){let n=L(e,ra),r=L(t,Ta);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDateTime with calendar ${n} in locale with calendar ${r}`);let i=L(e,ta);return{epochNs:vc(L(t,Ca),i,`compatible`),formatter:Nu(t,ba)}}if(Jo(e))throw TypeError(`Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.`);return Vo(e)?{epochNs:L(e,$i),formatter:Nu(t,xa)}:{}}function Gu(e){let t=Object.create(null);return t.years=L(e,ca),t.months=L(e,la),t.weeks=L(e,ua),t.days=L(e,da),t.hours=L(e,fa),t.minutes=L(e,pa),t.seconds=L(e,ma),t.milliseconds=L(e,ha),t.microseconds=L(e,ga),t.nanoseconds=L(e,_a),t}Fu.prototype.constructor=Iu,Object.defineProperty(Iu,`prototype`,{value:Fu.prototype,writable:!1,enumerable:!1,configurable:!1}),Iu.supportedLocalesOf=Mu.supportedLocalesOf,Ia(Iu,`Intl.DateTimeFormat`);const{format:Bee,formatToParts:Vee}=Intl.DurationFormat?.prototype??Object.create(null);function Ku(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Gu(Fs(e));return Bee.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Ku,Intl.DurationFormat.prototype.formatToParts=function(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Gu(Fs(e));return Vee.call(this,t)}),Object.freeze({__proto__:null,DateTimeFormat:Iu,ModifiedIntlDurationFormatPrototypeFormat:Ku});var qu=class{constructor(e){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);$s(this,nu(e))}get epochMilliseconds(){return R(this,Vo),eu(L(this,$i),`floor`)}get epochNanoseconds(){return R(this,Vo),$l(I.default.BigInt(L(this,$i)))}add(e){return R(this,Vo),Rl(`add`,this,e)}subtract(e){return R(this,Vo),Rl(`subtract`,this,e)}until(e,t=void 0){return R(this,Vo),nee(`until`,this,e,t)}since(e,t=void 0){return R(this,Vo),nee(`since`,this,e,t)}round(e){if(R(this,Vo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs);return _s(n,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[i],!0),ec(Gl(L(this,$i),n,i,r))}equals(e){R(this,Vo);let t=Is(e),n=L(this,$i),r=L(t,$i);return I.default.equal(I.default.BigInt(n),I.default.BigInt(r))}toString(e=void 0){R(this,Vo);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let a=t.timeZone;a!==void 0&&(a=pc(a));let{precision:o,unit:s,increment:c}=ys(i,n);return eee(ec(Gl(L(this,$i),c,s,r)),a,o)}toJSON(){return R(this,Vo),eee(this,void 0,`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Vo),new Iu(e,t).format(this)}valueOf(){du(`Instant`)}toZonedDateTimeISO(e){R(this,Vo);let t=pc(e);return nc(L(this,$i),t,`iso8601`)}static fromEpochMilliseconds(e){return ec(tu(xo(e)))}static fromEpochNanoseconds(e){return ec(nu(e))}static from(e){return Is(e)}static compare(e,t){let n=Is(e),r=Is(t),i=L(n,$i),a=L(r,$i);return I.default.lessThan(i,a)?-1:I.default.greaterThan(i,a)?1:0}};Ia(qu,`Temporal.Instant`);var Ju=class{constructor(e,t,n,r=`iso8601`){let i=Co(e),a=Co(t),o=Co(n),s=lu(r===void 0?`iso8601`:Do(r));sl(i,a,o),Us(this,{year:i,month:a,day:o},s)}get calendarId(){return R(this,Uo),L(this,ra)}get era(){return Yu(this,`era`)}get eraYear(){return Yu(this,`eraYear`)}get year(){return Yu(this,`year`)}get month(){return Yu(this,`month`)}get monthCode(){return Yu(this,`monthCode`)}get day(){return Yu(this,`day`)}get dayOfWeek(){return Yu(this,`dayOfWeek`)}get dayOfYear(){return Yu(this,`dayOfYear`)}get weekOfYear(){return Yu(this,`weekOfYear`)?.week}get yearOfWeek(){return Yu(this,`weekOfYear`)?.year}get daysInWeek(){return Yu(this,`daysInWeek`)}get daysInMonth(){return Yu(this,`daysInMonth`)}get daysInYear(){return Yu(this,`daysInYear`)}get monthsInYear(){return Yu(this,`monthsInYear`)}get inLeapYear(){return Yu(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Uo),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea));return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Ws(uc(n,r,ds(ou(t))),n)}withCalendar(e){R(this,Uo);let t=sc(e);return Ws(L(this,ea),t)}add(e,t=void 0){return R(this,Uo),zl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Uo),zl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Uo),ree(`until`,this,e,t)}since(e,t=void 0){return R(this,Uo),ree(`since`,this,e,t)}equals(e){R(this,Uo);let t=Ms(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,Uo),Dc(this,hs(ou(e)))}toJSON(){return R(this,Uo),Dc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Uo),new Iu(e,t).format(this)}valueOf(){du(`PlainDate`)}toPlainDateTime(e=void 0){R(this,Uo);let t=zs(e);return Ks(us(L(this,ea),t),L(this,ra))}toZonedDateTime(e){let t,n;if(R(this,Uo),bo(e)){let r=e.timeZone;r===void 0?t=pc(e):(t=pc(r),n=e.plainTime)}else t=pc(e);let r=L(this,ea),i;return n===void 0?i=xc(t,r):(n=Rs(n),i=vc(t,us(r,L(n,na)),`compatible`)),nc(i,t,L(this,ra))}toPlainYearMonth(){R(this,Uo);let e=L(this,ra);return Qs(dc(e,ks(e,L(this,ea)),`constrain`),e)}toPlainMonthDay(){R(this,Uo);let e=L(this,ra);return Js(fc(e,ks(e,L(this,ea)),`constrain`),e)}static from(e,t=void 0){return Ms(e,t)}static compare(e,t){let n=Ms(e),r=Ms(t);return Xl(L(n,ea),L(r,ea))}};function Yu(e,t){R(e,Uo);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}Ia(Ju,`Temporal.PlainDate`);var Xu=class{constructor(e,t,n,r=0,i=0,a=0,o=0,s=0,c=0,l=`iso8601`){let u=Co(e),d=Co(t),f=Co(n),p=r===void 0?0:Co(r),m=i===void 0?0:Co(i),h=a===void 0?0:Co(a),g=o===void 0?0:Co(o),_=s===void 0?0:Co(s),v=c===void 0?0:Co(c),y=lu(l===void 0?`iso8601`:Do(l));ul(u,d,f,p,m,h,g,_,v),Gs(this,{isoDate:{year:u,month:d,day:f},time:{hour:p,minute:m,second:h,millisecond:g,microsecond:_,nanosecond:v}},y)}get calendarId(){return R(this,Go),L(this,ra)}get year(){return Zu(this,`year`)}get month(){return Zu(this,`month`)}get monthCode(){return Zu(this,`monthCode`)}get day(){return Zu(this,`day`)}get hour(){return Qu(this,`hour`)}get minute(){return Qu(this,`minute`)}get second(){return Qu(this,`second`)}get millisecond(){return Qu(this,`millisecond`)}get microsecond(){return Qu(this,`microsecond`)}get nanosecond(){return Qu(this,`nanosecond`)}get era(){return Zu(this,`era`)}get eraYear(){return Zu(this,`eraYear`)}get dayOfWeek(){return Zu(this,`dayOfWeek`)}get dayOfYear(){return Zu(this,`dayOfYear`)}get weekOfYear(){return Zu(this,`weekOfYear`)?.week}get yearOfWeek(){return Zu(this,`weekOfYear`)?.year}get daysInWeek(){return Zu(this,`daysInWeek`)}get daysInYear(){return Zu(this,`daysInYear`)}get daysInMonth(){return Zu(this,`daysInMonth`)}get monthsInYear(){return Zu(this,`monthsInYear`)}get inLeapYear(){return Zu(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Go),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=L(this,ta),i={...ks(n,r.isoDate),...r.time};return i=ic(n,i,As(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],`partial`)),Ks(Ns(n,i,ds(ou(t))),n)}withPlainTime(e=void 0){R(this,Go);let t=zs(e);return Ks(us(L(this,ta).isoDate,t),L(this,ra))}withCalendar(e){R(this,Go);let t=sc(e);return Ks(L(this,ta),t)}add(e,t=void 0){return R(this,Go),Bl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Go),Bl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Go),iee(`until`,this,e,t)}since(e,t=void 0){return R(this,Go),iee(`since`,this,e,t)}round(e){if(R(this,Go),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];_s(n,a,a===1);let o=L(this,ta);return Ks(n===1&&i===`nanosecond`?o:Kl(o,n,i,r),L(this,ra))}equals(e){R(this,Go);let t=Ps(e);return Ql(L(this,ta),L(t,ta))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){R(this,Go);let t=ou(e),n=hs(t),r=vs(t),i=ps(t,`trunc`),a=xs(t,`smallestUnit`,`time`,void 0);if(a===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:o,unit:s,increment:c}=ys(a,r),l=Kl(L(this,ta),c,s,i);return dl(l),kc(l,L(this,ra),o,n)}toJSON(){return R(this,Go),kc(L(this,ta),L(this,ra),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Go),new Iu(e,t).format(this)}valueOf(){du(`PlainDateTime`)}toZonedDateTime(e,t=void 0){R(this,Go);let n=pc(e),r=fs(ou(t));return nc(vc(n,L(this,ta),r),n,L(this,ra))}toPlainDate(){return R(this,Go),Ws(L(this,ta).isoDate,L(this,ra))}toPlainTime(){return R(this,Go),Xs(L(this,ta).time)}static from(e,t=void 0){return Ps(e,t)}static compare(e,t){let n=Ps(e),r=Ps(t);return Ql(L(n,ta),L(r,ta))}};function Zu(e,t){R(e,Go);let n=L(e,ta).isoDate;return Os(e).isoToDate(n,{[t]:!0})[t]}function Qu(e,t){return R(e,Go),L(e,ta).time[t]}Ia(Xu,`Temporal.PlainDateTime`);var $u=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){let u=e===void 0?0:To(e),d=t===void 0?0:To(t),f=n===void 0?0:To(n),p=r===void 0?0:To(r),m=i===void 0?0:To(i),h=a===void 0?0:To(a),g=o===void 0?0:To(o),_=s===void 0?0:To(s),v=c===void 0?0:To(c),y=l===void 0?0:To(l);hl(u,d,f,p,m,h,g,_,v,y),Ma(this),Pa(this,ca,u),Pa(this,la,d),Pa(this,ua,f),Pa(this,da,p),Pa(this,fa,m),Pa(this,pa,h),Pa(this,ma,g),Pa(this,ha,_),Pa(this,ga,v),Pa(this,_a,y)}get years(){return R(this,Ho),L(this,ca)}get months(){return R(this,Ho),L(this,la)}get weeks(){return R(this,Ho),L(this,ua)}get days(){return R(this,Ho),L(this,da)}get hours(){return R(this,Ho),L(this,fa)}get minutes(){return R(this,Ho),L(this,pa)}get seconds(){return R(this,Ho),L(this,ma)}get milliseconds(){return R(this,Ho),L(this,ha)}get microseconds(){return R(this,Ho),L(this,ga)}get nanoseconds(){return R(this,Ho),L(this,_a)}get sign(){return R(this,Ho),Yc(this)}get blank(){return R(this,Ho),Yc(this)===0}with(t){R(this,Ho);let{years:n=L(this,ca),months:r=L(this,la),weeks:i=L(this,ua),days:a=L(this,da),hours:o=L(this,fa),minutes:s=L(this,pa),seconds:c=L(this,ma),milliseconds:l=L(this,ha),microseconds:u=L(this,ga),nanoseconds:d=L(this,_a)}=cs(t);return new e(n,r,i,a,o,s,c,l,u,d)}negated(){return R(this,Ho),rl(this)}abs(){return R(this,Ho),new e(Math.abs(L(this,ca)),Math.abs(L(this,la)),Math.abs(L(this,ua)),Math.abs(L(this,da)),Math.abs(L(this,fa)),Math.abs(L(this,pa)),Math.abs(L(this,ma)),Math.abs(L(this,ha)),Math.abs(L(this,ga)),Math.abs(L(this,_a)))}add(e){return R(this,Ho),Ll(`add`,this,e)}subtract(e){return R(this,Ho),Ll(`subtract`,this,e)}round(e){if(R(this,Ho),e===void 0)throw TypeError(`options parameter is required`);let t=Cs(this),n=typeof e==`string`?su(`smallestUnit`,e):ou(e),r=xs(n,`largestUnit`,`datetime`,void 0,[`auto`]),{plainRelativeTo:i,zonedRelativeTo:a}=Ss(n),o=gs(n),s=ps(n,`halfExpand`),c=xs(n,`smallestUnit`,`datetime`,void 0),l=!0;c||=(l=!1,`nanosecond`);let u=ws(t,c),d=!0;if(r||=(d=!1,u),r===`auto`&&(r=u),!l&&!d)throw RangeError(`at least one of smallestUnit or largestUnit is required`);if(ws(r,c)!==r)throw RangeError(`largestUnit ${r} cannot be smaller than smallestUnit ${c}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[c];if(f!==void 0&&_s(o,f,!1),o>1&&Es(c)===`date`&&r!==c)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);if(a){let e=gl(this),t=L(a,sa),n=L(a,ra),i=L(a,$i);return e=jl(i,Il(i,t,n,e),t,n,r,o,c,s),Es(r)===`date`&&(r=`hour`),yl(e,r)}if(i){let e=_l(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),n=L(i,ea),a=L(i,ra),l=ac(a,n,ls(e.date,t.deltaDays),`constrain`);return e=Al(us(n,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),us(l,t),a,r,o,c,s),yl(e,r)}if(Ts(t))throw RangeError(`a starting point is required for ${t}s balancing`);if(Ts(r))throw RangeError(`a starting point is required for ${r}s balancing`);let p=_l(this);if(c===`day`){let{quotient:e,remainder:t}=p.time.divmod(co),n=p.date.days+e+Yl(t,`day`);n=Wl(n,o,s),p=bl({years:0,months:0,weeks:0,days:n},Ua.ZERO)}else p=bl({years:0,months:0,weeks:0,days:0},Jl(p.time,o,c,s));return yl(p,r)}total(e){if(R(this,Ho),e===void 0)throw TypeError(`options argument is required`);let t=typeof e==`string`?su(`unit`,e):ou(e),{plainRelativeTo:n,zonedRelativeTo:r}=Ss(t),i=xs(t,`unit`,`datetime`,bs);if(r){let e=gl(this),t=L(r,sa),n=L(r,ra),a=L(r,$i);return function(e,t,n,r,i){return Es(i)===`time`?Yl(Ua.fromEpochNsDiff(t,e),i):kl(El(e,t,n,r,i),t,_c(n,e),n,r,i)}(a,Il(a,t,n,e),t,n,i)}if(n){let e=_l(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),r=L(n,ea),a=L(n,ra),o=ac(a,r,ls(e.date,t.deltaDays),`constrain`);return function(e,t,n,r){if(Ql(e,t)==0)return 0;dl(e),dl(t);let i=Tl(e,t,n,r);return r===`nanosecond`?I.default.toNumber(i.time.totalNs):kl(i,Hc(t),e,null,n,r)}(us(r,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),us(o,t),a,i)}let a=Cs(this);if(Ts(a))throw RangeError(`a starting point is required for ${a}s total`);if(Ts(i))throw RangeError(`a starting point is required for ${i}s total`);return Yl(_l(this).time,i)}toString(e=void 0){R(this,Ho);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`||i===`minute`)throw RangeError(`smallestUnit must be a time unit other than "hours" or "minutes"`);let{precision:a,unit:o,increment:s}=ys(i,n);if(o===`nanosecond`&&s===1)return Ec(this,a);let c=Cs(this),l=gl(this),u=Jl(l.time,s,o,r);return l=bl(l.date,u),Ec(yl(l,ws(c,`second`)),a)}toJSON(){return R(this,Ho),Ec(this,`auto`)}toLocaleString(e=void 0,t=void 0){if(R(this,Ho),typeof Intl.DurationFormat==`function`){let n=new Intl.DurationFormat(e,t);return Ku.call(n,this)}return console.warn(`Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat.`),Ec(this,`auto`)}valueOf(){du(`Duration`)}static from(e){return Fs(e)}static compare(e,t,n=void 0){let r=Fs(e),i=Fs(t),{plainRelativeTo:a,zonedRelativeTo:o}=Ss(ou(n));if(L(r,ca)===L(i,ca)&&L(r,la)===L(i,la)&&L(r,ua)===L(i,ua)&&L(r,da)===L(i,da)&&L(r,fa)===L(i,fa)&&L(r,pa)===L(i,pa)&&L(r,ma)===L(i,ma)&&L(r,ha)===L(i,ha)&&L(r,ga)===L(i,ga)&&L(r,_a)===L(i,_a))return 0;let s=Cs(r),c=Cs(i),l=gl(r),u=gl(i);if(o&&(Es(s)===`date`||Es(c)===`date`)){let e=L(o,sa),t=L(o,ra),n=L(o,$i),r=Il(n,e,t,l),i=Il(n,e,t,u);return au(I.default.toNumber(I.default.subtract(r,i)))}let d=l.date.days,f=u.date.days;if(Ts(s)||Ts(c)){if(!a)throw RangeError(`A starting point is required for years, months, or weeks comparison`);d=nl(l.date,a),f=nl(u.date,a)}let p=l.time.add24HourDays(d),m=u.time.add24HourDays(f);return p.cmp(m)}};Ia($u,`Temporal.Duration`);var ed=class{constructor(e,t,n=`iso8601`,r=1972){let i=Co(e),a=Co(t),o=lu(n===void 0?`iso8601`:Do(n)),s=Co(r);sl(s,i,a),qs(this,{year:s,month:i,day:a},o)}get monthCode(){return td(this,`monthCode`)}get day(){return td(this,`day`)}get calendarId(){return R(this,qo),L(this,ra)}with(e,t=void 0){if(R(this,qo),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea),`month-day`);return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Js(fc(n,r,ds(ou(t))),n)}equals(e){R(this,qo);let t=Ls(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,qo),Ac(this,hs(ou(e)))}toJSON(){return R(this,qo),Ac(this)}toLocaleString(e=void 0,t=void 0){return R(this,qo),new Iu(e,t).format(this)}valueOf(){du(`PlainMonthDay`)}toPlainDate(e){if(R(this,qo),!bo(e))throw TypeError(`argument should be an object`);let t=L(this,ra);return Ws(uc(t,ic(t,ks(t,L(this,ea),`month-day`),As(t,e,[`year`],[],[])),`constrain`),t)}static from(e,t=void 0){return Ls(e,t)}};function td(e,t){R(e,qo);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}function nd(e){return _c(e,ru())}Ia(ed,`Temporal.PlainMonthDay`);const rd={instant:()=>ec(ru()),plainDateTimeISO:(e=iu())=>Ks(nd(pc(e)),`iso8601`),plainDateISO:(e=iu())=>Ws(nd(pc(e)).isoDate,`iso8601`),plainTimeISO:(e=iu())=>Xs(nd(pc(e)).time),timeZoneId:()=>iu(),zonedDateTimeISO:(e=iu())=>{let t=pc(e);return nc(ru(),t,`iso8601`)},[Symbol.toStringTag]:`Temporal.Now`};Object.defineProperty(rd,Symbol.toStringTag,{value:`Temporal.Now`,writable:!1,enumerable:!1,configurable:!0});var id=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0){let o=e===void 0?0:Co(e),s=t===void 0?0:Co(t),c=n===void 0?0:Co(n),l=r===void 0?0:Co(r),u=i===void 0?0:Co(i),d=a===void 0?0:Co(a);ll(o,s,c,l,u,d),Ys(this,{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d})}get hour(){return R(this,Wo),L(this,na).hour}get minute(){return R(this,Wo),L(this,na).minute}get second(){return R(this,Wo),L(this,na).second}get millisecond(){return R(this,Wo),L(this,na).millisecond}get microsecond(){return R(this,Wo),L(this,na).microsecond}get nanosecond(){return R(this,Wo),L(this,na).nanosecond}with(t,n=void 0){if(R(this,Wo),!bo(t))throw TypeError(`invalid argument`);Yo(t);let r=js(t,`partial`),i=js(this),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Object.assign(i,r),d=ds(ou(n));return{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=ss(a,o,s,c,l,u,d),new e(a,o,s,c,l,u)}add(e){return R(this,Wo),Vl(`add`,this,e)}subtract(e){return R(this,Wo),Vl(`subtract`,this,e)}until(e,t=void 0){return R(this,Wo),aee(`until`,this,e,t)}since(e,t=void 0){return R(this,Wo),aee(`since`,this,e,t)}round(e){if(R(this,Wo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs);return _s(n,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i],!1),Xs(ql(L(this,na),n,i,r))}equals(e){R(this,Wo);let t=Rs(e);return Zl(L(this,na),L(t,na))===0}toString(e=void 0){R(this,Wo);let t=ou(e),n=vs(t),r=ps(t,`trunc`),i=xs(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:a,unit:o,increment:s}=ys(i,n);return Oc(ql(L(this,na),s,o,r),a)}toJSON(){return R(this,Wo),Oc(L(this,na),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Wo),new Iu(e,t).format(this)}valueOf(){du(`PlainTime`)}static from(e,t=void 0){return Rs(e,t)}static compare(e,t){let n=Rs(e),r=Rs(t);return Zl(L(n,na),L(r,na))}};Ia(id,`Temporal.PlainTime`);var ad=class{constructor(e,t,n=`iso8601`,r=1){let i=Co(e),a=Co(t),o=lu(n===void 0?`iso8601`:Do(n)),s=Co(r);sl(i,a,s),Zs(this,{year:i,month:a,day:s},o)}get year(){return od(this,`year`)}get month(){return od(this,`month`)}get monthCode(){return od(this,`monthCode`)}get calendarId(){return R(this,Ko),L(this,ra)}get era(){return od(this,`era`)}get eraYear(){return od(this,`eraYear`)}get daysInMonth(){return od(this,`daysInMonth`)}get daysInYear(){return od(this,`daysInYear`)}get monthsInYear(){return od(this,`monthsInYear`)}get inLeapYear(){return od(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Ko),!bo(e))throw TypeError(`invalid argument`);Yo(e);let n=L(this,ra),r=ks(n,L(this,ea),`year-month`);return r=ic(n,r,As(n,e,[`year`,`month`,`monthCode`],[],`partial`)),Qs(dc(n,r,ds(ou(t))),n)}add(e,t=void 0){return R(this,Ko),Hl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Ko),Hl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Ko),oee(`until`,this,e,t)}since(e,t=void 0){return R(this,Ko),oee(`since`,this,e,t)}equals(e){R(this,Ko);let t=Bs(e);return Xl(L(this,ea),L(t,ea))===0&&lc(L(this,ra),L(t,ra))}toString(e=void 0){return R(this,Ko),jc(this,hs(ou(e)))}toJSON(){return R(this,Ko),jc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Ko),new Iu(e,t).format(this)}valueOf(){du(`PlainYearMonth`)}toPlainDate(e){if(R(this,Ko),!bo(e))throw TypeError(`argument should be an object`);let t=L(this,ra);return Ws(uc(t,ic(t,ks(t,L(this,ea),`year-month`),As(t,e,[`day`],[],[])),`constrain`),t)}static from(e,t=void 0){return Bs(e,t)}static compare(e,t){let n=Bs(e),r=Bs(t);return Xl(L(n,ea),L(r,ea))}};function od(e,t){R(e,Ko);let n=L(e,ea);return Os(e).isoToDate(n,{[t]:!0})[t]}Ia(ad,`Temporal.PlainYearMonth`);const Hee=Iu.prototype.resolvedOptions;var sd=class{constructor(e,t,n=`iso8601`){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);let r=nu(e),i=Do(t),{tzName:a,offsetMinutes:o}=as(i);if(o===void 0){let e=Ic(a);if(!e)throw RangeError(`unknown time zone ${a}`);i=e.identifier}else i=zc(o);tc(this,r,i,lu(n===void 0?`iso8601`:Do(n)))}get calendarId(){return R(this,Jo),L(this,ra)}get timeZoneId(){return R(this,Jo),L(this,sa)}get year(){return ld(this,`year`)}get month(){return ld(this,`month`)}get monthCode(){return ld(this,`monthCode`)}get day(){return ld(this,`day`)}get hour(){return ud(this,`hour`)}get minute(){return ud(this,`minute`)}get second(){return ud(this,`second`)}get millisecond(){return ud(this,`millisecond`)}get microsecond(){return ud(this,`microsecond`)}get nanosecond(){return ud(this,`nanosecond`)}get era(){return ld(this,`era`)}get eraYear(){return ld(this,`eraYear`)}get epochMilliseconds(){return R(this,Jo),eu(L(this,$i),`floor`)}get epochNanoseconds(){return R(this,Jo),$l(L(this,$i))}get dayOfWeek(){return ld(this,`dayOfWeek`)}get dayOfYear(){return ld(this,`dayOfYear`)}get weekOfYear(){return ld(this,`weekOfYear`)?.week}get yearOfWeek(){return ld(this,`weekOfYear`)?.year}get hoursInDay(){R(this,Jo);let e=L(this,sa),t=cd(this).isoDate,n=$c(t.year,t.month,t.day+1),r=xc(e,t),i=xc(e,n);return Yl(Ua.fromEpochNsDiff(i,r),`hour`)}get daysInWeek(){return ld(this,`daysInWeek`)}get daysInMonth(){return ld(this,`daysInMonth`)}get daysInYear(){return ld(this,`daysInYear`)}get monthsInYear(){return ld(this,`monthsInYear`)}get inLeapYear(){return ld(this,`inLeapYear`)}get offset(){return R(this,Jo),gc(hc(L(this,sa),L(this,$i)))}get offsetNanoseconds(){return R(this,Jo),hc(L(this,sa),L(this,$i))}with(e,t=void 0){if(R(this,Jo),!bo(e))throw TypeError(`invalid zoned-date-time-like`);Yo(e);let n=L(this,ra),r=L(this,sa),i=hc(r,L(this,$i)),a=cd(this),o={...ks(n,a.isoDate),...a.time,offset:gc(i)};o=ic(n,o,As(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`],`partial`));let s=ou(t),c=fs(s),l=ms(s,`prefer`),u=Ns(n,o,ds(s)),d=Pc(o.offset);return nc(Vs(u.isoDate,u.time,`option`,d,r,c,l,!1),r,n)}withPlainTime(e=void 0){R(this,Jo);let t=L(this,sa),n=L(this,ra),r=cd(this).isoDate,i;return i=e===void 0?xc(t,r):vc(t,us(r,L(Rs(e),na)),`compatible`),nc(i,t,n)}withTimeZone(e){R(this,Jo);let t=pc(e);return nc(L(this,$i),t,L(this,ra))}withCalendar(e){R(this,Jo);let t=sc(e);return nc(L(this,$i),L(this,sa),t)}add(e,t=void 0){return R(this,Jo),Ul(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Jo),Ul(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Jo),Nl(`until`,this,e,t)}since(e,t=void 0){return R(this,Jo),Nl(`since`,this,e,t)}round(e){if(R(this,Jo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?su(`smallestUnit`,e):ou(e),n=gs(t),r=ps(t,`halfExpand`),i=xs(t,`smallestUnit`,`time`,bs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];if(_s(n,a,a===1),i===`nanosecond`&&n===1)return nc(L(this,$i),L(this,sa),L(this,ra));let o=L(this,sa),s=L(this,$i),c=cd(this),l;if(i===`day`){let e=c.isoDate,t=$c(e.year,e.month,e.day+1),n=xc(o,e),i=xc(o,t),a=I.default.subtract(i,n);l=Ua.fromEpochNsDiff(s,n).round(a,r).addToEpochNs(n)}else{let e=Kl(c,n,i,r),t=hc(o,s);l=Vs(e.isoDate,e.time,`option`,t,o,`compatible`,`prefer`,!1)}return nc(l,o,L(this,ra))}equals(e){R(this,Jo);let t=Hs(e),n=L(this,$i),r=L(t,$i);return!!I.default.equal(I.default.BigInt(n),I.default.BigInt(r))&&!!mc(L(this,sa),L(t,sa))&&lc(L(this,ra),L(t,ra))}toString(e=void 0){R(this,Jo);let t=ou(e),n=hs(t),r=vs(t),i=function(e){return cu(e,`offset`,[`auto`,`never`],`auto`)}(t),a=ps(t,`trunc`),o=xs(t,`smallestUnit`,`time`,void 0);if(o===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let s=function(e){return cu(e,`timeZoneName`,[`auto`,`never`,`critical`],`auto`)}(t),{precision:c,unit:l,increment:u}=ys(o,r);return Mc(this,c,n,s,i,{unit:l,increment:u,roundingMode:a})}toLocaleString(e=void 0,t=void 0){R(this,Jo);let n=ou(t),r=Object.create(null);if(function(e,t,n,r){if(t==null)return;let i=Reflect.ownKeys(t);for(let r=0;r<i.length;r++){let a=i[r];!n.some((e=>Object.is(e,a)))&&Object.prototype.propertyIsEnumerable.call(t,a)&&(e[a]=t[a])}}(r,n,[`timeZone`]),n.timeZone!==void 0)throw TypeError(`ZonedDateTime toLocaleString does not accept a timeZone option`);if(r.year===void 0&&r.month===void 0&&r.day===void 0&&r.era===void 0&&r.weekday===void 0&&r.dateStyle===void 0&&r.hour===void 0&&r.minute===void 0&&r.second===void 0&&r.fractionalSecondDigits===void 0&&r.timeStyle===void 0&&r.dayPeriod===void 0&&r.timeZoneName===void 0&&(r.timeZoneName=`short`),r.timeZone=L(this,sa),Nc(r.timeZone))throw RangeError(`toLocaleString does not currently support offset time zones`);let i=new Iu(e,r),a=Hee.call(i).calendar,o=L(this,ra);if(o!==`iso8601`&&a!==`iso8601`&&!lc(a,o))throw RangeError(`cannot format ZonedDateTime with calendar ${o} in locale with calendar ${a}`);return i.format(ec(L(this,$i)))}toJSON(){return R(this,Jo),Mc(this,`auto`)}valueOf(){du(`ZonedDateTime`)}startOfDay(){R(this,Jo);let e=L(this,sa);return nc(xc(e,cd(this).isoDate),e,L(this,ra))}getTimeZoneTransition(e){R(this,Jo);let t=L(this,sa);if(e===void 0)throw TypeError(`options parameter is required`);let n=cu(typeof e==`string`?su(`direction`,e):ou(e),`direction`,[`next`,`previous`],bs);if(n===void 0)throw TypeError(`direction option is required`);if(Nc(t)||t===`UTC`)return null;let r=L(this,$i),i=n===`next`?Wc(t,r):Gc(t,r);return i===null?null:nc(i,t,L(this,ra))}toInstant(){return R(this,Jo),ec(L(this,$i))}toPlainDate(){return R(this,Jo),Ws(cd(this).isoDate,L(this,ra))}toPlainTime(){return R(this,Jo),Xs(cd(this).time)}toPlainDateTime(){return R(this,Jo),Ks(cd(this),L(this,ra))}static from(e,t=void 0){return Hs(e,t)}static compare(e,t){let n=Hs(e),r=Hs(t),i=L(n,$i),a=L(r,$i);return I.default.lessThan(I.default.BigInt(i),I.default.BigInt(a))?-1:I.default.greaterThan(I.default.BigInt(i),I.default.BigInt(a))?1:0}};function cd(e){return _c(L(e,sa),L(e,$i))}function ld(e,t){R(e,Jo);let n=cd(e).isoDate;return Os(e).isoToDate(n,{[t]:!0})[t]}function ud(e,t){return R(e,Jo),cd(e).time[t]}Ia(sd,`Temporal.ZonedDateTime`);var dd=Object.freeze({__proto__:null,Duration:$u,Instant:qu,Now:rd,PlainDate:Ju,PlainDateTime:Xu,PlainMonthDay:ed,PlainTime:id,PlainYearMonth:ad,ZonedDateTime:sd});(class{toTemporalInstant(){return ec(tu(Date.prototype.valueOf.call(this)))}}).prototype.toTemporalInstant;const Uee=[qu,Ju,Xu,$u,ed,id,ad,sd];for(let e of Uee){let t=Object.getOwnPropertyDescriptor(e,`prototype`);(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(e,`prototype`,t))}const Wee=Symbol.for(`drizzle:CockroachMaterializedViewConfig`);function Gee(e){return{...e[te]}}function Kee(e){return{...e[te],...e[Wee]}}const qee=Symbol.for(`drizzle:MsSqlViewConfig`);function Jee(e){return{...e[te],...e[qee]}}const fd=Dt(import.meta.url);var Yee=Object.create,pd=Object.defineProperty,Xee=Object.getOwnPropertyDescriptor,md=Object.getOwnPropertyNames,Zee=Object.getPrototypeOf,Qee=Object.prototype.hasOwnProperty,z=(e=>fd===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(fd===void 0?e:fd)[t]}):e:fd)(function(e){if(fd!==void 0)return fd.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),B=(e,t)=>function(){return e&&(t=(0,e[md(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[md(e)[0]])((t={exports:{}}).exports,t),t.exports},hd=(e,t)=>{for(var n in t)pd(e,n,{get:t[n],enumerable:!0})},gd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of md(t))!Qee.call(e,i)&&i!==n&&pd(e,i,{get:()=>t[i],enumerable:!(r=Xee(t,i))||r.enumerable});return e},_d=(e,t,n)=>(n=e==null?{}:Yee(Zee(e)),gd(t||!e||!e.__esModule?pd(n,`default`,{value:e,enumerable:!0}):n,e)),vd=e=>gd(pd({},`__esModule`,{value:!0}),e);function yd(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=e[n];if(r&&typeof r==`object`&&r.CONTAINS!==void 0){if(!Array.isArray(t)||!t.find(e=>wd(e,r.CONTAINS)))return!1}else if(!wd(t,r))return!1}return!0}function bd(e,t){return e.filter(e=>yd(e,t))}function xd(e){return`${e.schema??``}:${e.table??``}:${e.name}:${e.entityType}`}function $ee(e,t){let n=xd(t);return e.find(e=>xd(e)===n)}function ete(e,t){let n=xd(t);return e.filter(e=>xd(e)===n)}function Sd(e,t,n=!1){if(typeof e!=`object`||!e)return!1;for(let r of Array.from(new Set([...Object.keys(e),...Object.keys(t)])))if(!(!n&&r===`entityType`)){if(!t[r])return!1;if(t[r]===`string[]`){if(!Array.isArray(e[r])||!e[r].every(e=>typeof e==`string`))return!1}else if(typeof t[r]==`string`){let n=t[r].endsWith(`?`);if(e[r]===null&&!n||e[r]!==null&&typeof e[r]!==kd(t[r]))return!1}else if(Array.isArray(t[r])){if(typeof t[r][0]==`string`){if(!t[r].some(t=>t===e[r]))return!1}else if(!Array.isArray(e[r])||!e[r].every(e=>Sd(e,t[r][0]),!0))return!1}else if(e[r]!==null&&!Sd(e[r],t[r],!0))return!1}return!0}function Cd({entities:e},t,n,r){let i=Object.entries(e),a=Object.fromEntries(Object.entries(n?r:e).map(([e,t])=>[e,Object.keys(t).filter(e=>e in jd).length+4]));return Object.fromEntries(i.map(([i,o])=>[i,{push:Md(n?r:e,t,n?void 0:i),list:Nd(t,n?void 0:i),one:Pd(t,n?void 0:i),update:Fd(t,n?void 0:i),delete:Id(t,n?void 0:i),validate:Rd(n?r:e,n?void 0:i),hasDiff:Ld(a)}]))}function wd(e,t){return typeof e==typeof t?Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>wd(e,t[n])):!1:typeof e==`object`?e===t?!0:(e===null||t===null)&&e!==t?!1:Array.from(new Set([...Object.keys(e),...Object.keys(t)])).every(n=>wd(e[n],t[n])):e===t:!1}function Td(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!zd[e]))}function Ed(e){let t={};for(let n of Object.keys(jd))e[n]===void 0||e[n]===null||(t[n]=e[n]);return t}function Dd(e,t,n,r){n??=`entities`,r??=`all`;let i=e.entities.list(n===`entities`?void 0:{entityType:n}),a=t.entities.list(n===`entities`?void 0:{entityType:n}),o={},s={};for(let e of i)o[xd(e)]=e;for(let e of a)s[xd(e)]=e;let c=[],l=[],u=[];for(let[e,t]of Object.entries(o)){let n=s[e];if(!n)(r===`all`||r===`drop`||r===`createdrop`)&&l.push({$diffType:`drop`,entityType:t.entityType,...Ed(t),...Td(t)});else if(r===`all`||r===`alter`){let e={},r=!1;for(let[i,a]of Object.entries(t))zd[i]||wd(t[i],n[i])||(r=!0,e[i]={from:t[i],to:n[i]});r&&u.push({$diffType:`alter`,entityType:n.entityType,...Ed(n),...e,$left:t,$right:n})}delete s[e]}if(r===`all`||r===`create`||r===`createdrop`)for(let e of Object.values(s))c.push({$diffType:`create`,entityType:e.entityType,...Ed(e),...Td(e)});return[...c,...l,...u]}function Od(e,t,n){return Dd(e,t,n,`createdrop`)}function kd(e){return e.endsWith(`?`)?e.slice(0,e.length-1):e}function Ad(e){let t=new Bd(e),n=Cd(t._,t._.store,!1);for(let[e,r]of Object.entries(n))t[e]=r;return t}var jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd=B({"src/dialects/dialect.ts"(){jd={schema:`string?`,table:`string?`,name:`string`},Md=(e,t,n)=>{let r=n?Object.fromEntries(Object.keys(e[n]).filter(e=>!jd[e]||!jd[e].endsWith(`?`)).map(e=>[e,null])):void 0;return(i,a)=>{let o=Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),s=n??o.entityType,c={...r??Object.fromEntries(Object.keys(e[s]).map(e=>[e,null])),...o,entityType:s},l=a?t.collection.find(e=>{if(e.entityType!==c.entityType)return!1;for(let t of a)if(t in c&&!wd(c[t],e[t]))return!1;return!0}):$ee(t.collection,c);return l?{status:`CONFLICT`,data:l}:(t.collection.push(c),{status:`OK`,data:c})}},Nd=(e,t)=>n=>{let r=t?bd(e.collection,{entityType:t}):e.collection;return n?bd(r,n):r},Pd=(e,t)=>n=>{let r=t?bd(e.collection,{entityType:t}):e.collection;return n?bd(r,n)[0]??null:r[0]??null},Fd=(e,t)=>({set:n,where:r})=>{let i=t?{...r,entityType:t}:r,a=i?bd(e.collection,i):e.collection,o=Object.entries(n),s=[],c=0,l=[];for(let t of a){let n={...t};for(let[e,r]of o){if(!(e in t))continue;let i=t[e];n[e]=typeof r==`function`?Array.isArray(i)?i.map(r):r(i):r}let r=ete(e.collection,n).filter(e=>e!==t);l.push(...r.filter(e=>!l.find(t=>t===e))),r.length||s.push({item:n,index:c++})}if(l.length)return{status:`CONFLICT`,data:l};for(let{index:e,item:t}of s)Object.assign(a[e],t);return{status:`OK`,data:a}},Id=(e,t)=>n=>{let r=[],i=[],a=t?{...n,entityType:t}:n;return a?(e.collection.forEach(e=>{yd(e,a)?i.push(e):r.push(e)}),e.collection=r,i):(e.collection=r,i)},Ld=e=>t=>{let n=e[t.entityType];return Object.keys(t).length>n},Rd=(e,t)=>(n=>{if(typeof n!=`object`||!n)return!1;let r=t??n.entityType;if(typeof r!=`string`||n.entityType!==r)return!1;let i=e[r];return i?Sd(n,i):!1}),zd={entityType:!0,name:!0,schema:!0,table:!0},(e=>{function t(e,t,n){return Dd(e,t,n,`all`)}e.all=t;function n(e,t,n){return Dd(e,t,n,`create`)}e.creates=n;function r(e,t,n){return Dd(e,t,n,`drop`)}e.drops=r;function i(e,t,n){return Dd(e,t,n,`alter`)}e.alters=i})(Od||={}),Bd=class{_={diffs:{},store:{collection:[]}};entities;constructor(e){let t=Object.entries(e),n=Object.fromEntries(t.map(([e,t])=>{if(e===`entities`||e===`_`)throw Error(`Illegal entity type name: "${e}"`);let n={};for(let r in Object.entries(t).forEach(([t,r])=>{if(n[t]=r,r===`required`){if(!(t in jd))throw Error(`Type value "required" is only applicable to common keys [ ${Object.keys(jd).map(e=>`"${e}"`).join(`, `)} ], used on: "${t}"`);n[t]=kd(jd[t])}else if(t in jd)throw Error(`Used forbidden key "${t}" in entity "${e}"`)}),jd)jd[r].endsWith(`?`)||(n[r]=jd[r]);return[e,n]}));this._.entities=n,this.entities=Cd({...this._,entities:{entities:jd}},this._.store,!0,this._.entities).entities}}}});function Hd(e){throw Error(`Didn't expect to get here`)}function Ud(e){return e.replace(/'/g,`''`)}function Wd(e,t,n,r=0){if(!Array.isArray(e))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)?Wd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Gd(e,t,n,r=0){if(!e.find(e=>Array.isArray(e)))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)&&e.find(e=>Array.isArray(e))?Gd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Kd(e){return af.test(e)}function qd(e){let t={},n=e.split(` `);if(n.length===1)return t;let r=n.slice(1,n.length).join(` `);if(of.includes(r))return{...t,fields:r};for(let e of of)if(r.startsWith(`${e}(`))return{...t,fields:e};return t}function Jd(e){let t=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)},n=(e,t)=>{let n=new ArrayBuffer(8),r=new DataView(n);for(let n=0;n<8;n++)r.setUint8(n,e[t+n]);return r.getFloat64(0,!0)},r=t(e),i=0,a=r[i];i+=1;let o=new DataView(r.buffer),s=o.getUint32(i,a===1);i+=4;let c;if(s&536870912&&(c=o.getUint32(i,a===1),i+=4),(s&65535)==1){let e=n(r,i);i+=8;let t=n(r,i);return i+=8,{srid:c,point:[e,t]}}throw Error(`Unsupported geometry type`)}var Yd,Xd,H,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf=B({"src/utils/index.ts"(){Yd=`00000000-0000-0000-0000-000000000000`,Xd=e=>e.map(e=>{let t=e.from.schema?`${e.from.schema}.`:``,n=e.to.schema?`${e.to.schema}.`:``,r=e.from.table?`${e.from.table}.`:``,i=e.to.table?`${e.to.table}.`:``;return`${t}${r}${e.from.name}->${n}${i}${e.to.name}`}),H=(e,t)=>e.length<2?e:typeof t==`string`&&e.startsWith(t)&&e.endsWith(t)||Array.isArray(t)&&e.startsWith(t[0])&&e.endsWith(t[1])?e.substring(1,e.length-1):e,Zd=(e,t)=>!e.startsWith(t)||!e.endsWith(t)?`${t}${e}${t}`:e,Qd=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?/,$d=e=>Qd.test(e),ef=/^\d{4}-\d{2}-\d{2}/,tf=e=>ef.test(e),nf=/^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?|\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)$/,rf=e=>nf.test(e),af=/([+-]\d{2}(:\d{2})?|Z)$/i,of=[`year`,`month`,`day`,`hour`,`minute`,`second`,`year to month`,`day to hour`,`day to minute`,`day to second`,`hour to minute`,`hour to second`,`minute to second`]}}),cf={};hd(cf,{StringBuffer:()=>bf,abstract:()=>lf,assert:()=>uf,checkNotNull:()=>Cf,clone:()=>tte,copyWithoutDuplicates:()=>gf,defineLazyProperty:()=>df,getDuplicates:()=>hf,isLexical:()=>vf,isSyntactic:()=>_f,padLeft:()=>yf,repeat:()=>mf,repeatFn:()=>ff,repeatStr:()=>pf,unescapeCodePoint:()=>xf,unexpectedObjToString:()=>Sf});function lf(e){let t=e||``;return function(){throw Error(`this method `+t+` is abstract! (it has no implementation in class `+this.constructor.name+`)`)}}function uf(e,t){if(!e)throw Error(t||`Assertion failed`)}function df(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||=n.call(this),r}})}function tte(e){return e&&Object.assign({},e)}function ff(e,t){let n=[];for(;t-- >0;)n.push(e());return n}function pf(e,t){return Array(t+1).join(e)}function mf(e,t){return ff(()=>e,t)}function hf(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];e.lastIndexOf(r)!==n&&t.indexOf(r)<0&&t.push(r)}return t}function gf(e){let t=[];return e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t}function _f(e){let t=e[0];return t===t.toUpperCase()}function vf(e){return!_f(e)}function yf(e,t,n){let r=n||` `;return e.length<t?pf(r,t-e.length)+e:e}function bf(){this.strings=[]}function xf(e){if(e.charAt(0)===`\\`)switch(e.charAt(1)){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
84
84
|
`;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;case`x`:return Tf(e.slice(2,4));case`u`:return e.charAt(2)===`{`?Tf(e.slice(3,-1)):Tf(e.slice(2,6));default:return e.charAt(1)}else return e}function Sf(e){if(e==null)return String(e);let t=Object.prototype.toString.call(e);try{let n;return n=e.constructor&&e.constructor.name?e.constructor.name:t.indexOf(`[object `)===0?t.slice(8,-1):typeof e,n+`: `+JSON.stringify(String(e))}catch{return t}}function Cf(e,t=`unexpected null value`){if(e==null)throw Error(t);return e}var wf,Tf,Ef=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/common.js"(){wf={};for(let e=0;e<128;e++)wf[e]=String.fromCharCode(e);wf[39]=`\\'`,wf[34]=`\\"`,wf[92]=`\\\\`,wf[8]=`\\b`,wf[12]=`\\f`,wf[10]=`\\n`,wf[13]=`\\r`,wf[9]=`\\t`,wf[11]=`\\v`,bf.prototype.append=function(e){this.strings.push(e)},bf.prototype.contents=function(){return this.strings.join(``)},Tf=e=>String.fromCodePoint(parseInt(e,16))}}),Df,nte=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/UnicodeCategories.js"(){Df={Lu:/\p{Lu}/u,Ll:/\p{Ll}/u,Lt:/\p{Lt}/u,Lm:/\p{Lm}/u,Lo:/\p{Lo}/u,Nl:/\p{Nl}/u,Nd:/\p{Nd}/u,Mn:/\p{Mn}/u,Mc:/\p{Mc}/u,Pc:/\p{Pc}/u,Zs:/\p{Zs}/u,L:/\p{Letter}/u,Ltmo:/\p{Lt}|\p{Lm}|\p{Lo}/u}}}),Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/pexprs-main.js"(){nte(),Ef(),Of=class e{constructor(){if(this.constructor===e)throw Error(`PExpr cannot be instantiated -- it's abstract`)}withSource(e){return e&&(this.source=e.trimmed()),this}},kf=Object.create(Of.prototype),Af=Object.create(Of.prototype),jf=class extends Of{constructor(e){super(),this.obj=e}},Mf=class extends Of{constructor(e,t){super(),this.from=e,this.to=t,this.matchCodePoint=e.length>1||t.length>1}},Nf=class extends Of{constructor(e){super(),this.index=e}},Pf=class extends Of{constructor(e){super(),this.terms=e}},Ff=class extends Pf{constructor(e,t,n){let r=e.rules[t].body;super([n,r]),this.superGrammar=e,this.name=t,this.body=n}},If=class extends Pf{constructor(e,t,n,r){let i=e.rules[t].body;super([...n,i,...r]),this.superGrammar=e,this.ruleName=t,this.expansionPos=n.length}},Lf=class extends Of{constructor(e){super(),this.factors=e}},Rf=class extends Of{constructor(e){super(),this.expr=e}},zf=class extends Rf{},Bf=class extends Rf{},Vf=class extends Rf{},zf.prototype.operator=`*`,Bf.prototype.operator=`+`,Vf.prototype.operator=`?`,zf.prototype.minNumMatches=0,Bf.prototype.minNumMatches=1,Vf.prototype.minNumMatches=0,zf.prototype.maxNumMatches=1/0,Bf.prototype.maxNumMatches=1/0,Vf.prototype.maxNumMatches=1,Hf=class extends Of{constructor(e){super(),this.expr=e}},Uf=class extends Of{constructor(e){super(),this.expr=e}},Wf=class extends Of{constructor(e){super(),this.expr=e}},Gf=class extends Of{constructor(e,t=[]){super(),this.ruleName=e,this.args=t}isSyntactic(){return _f(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,`_memoKey`,{value:this.toString()}),this._memoKey}},Kf=class extends Of{constructor(e){super(),this.category=e,this.pattern=Df[e]}}}});function Jf(e,t){let n;return t?(n=Error(t.getLineAndColumnMessage()+e),n.shortMessage=e,n.interval=t):n=Error(e),n}function Yf(){return Jf(`Interval sources don't match`)}function rte(e,t,n){return Jf(t?`Grammar ${e} is not declared in namespace '${t}'`:`Undeclared grammar `+e,n)}function ite(e,t){return Jf(`Grammar `+e.name+` is already declared in this namespace`)}function ate(e){return Jf(`Grammar '${e.name}' does not support incremental parsing`)}function ote(e,t,n){return Jf(`Rule `+e+` is not declared in grammar `+t,n)}function ste(e,t,n){return Jf(`Cannot override rule `+e+` because it is not declared in `+t,n)}function cte(e,t,n){return Jf(`Cannot extend rule `+e+` because it is not declared in `+t,n)}function lte(e,t,n,r){let i=`Duplicate declaration for rule '`+e+`' in grammar '`+t+`'`;return t!==n&&(i+=` (originally declared in '`+n+`')`),Jf(i,r)}function ute(e,t,n,r){return Jf(`Wrong number of parameters for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function dte(e,t,n,r){return Jf(`Wrong number of arguments for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function fte(e,t,n){return Jf(`Duplicate parameter names in rule `+e+`: `+t.join(`, `),n)}function pte(e,t){return Jf(`Invalid parameter to rule `+e+`: `+t+` has arity `+t.getArity()+`, but parameter expressions must have arity 1`,t.source)}function mte(e,t){return Jf(`Cannot apply syntactic rule `+e+` from here (inside a lexical context)`,t.source)}function hte(e){let{ruleName:t}=e;return Jf(`applySyntactic is for syntactic rules, but '${t}' is a lexical rule. `+Zf,e.source)}function gte(e){return Jf(`applySyntactic is not required here (in a syntactic context)`,e.source)}function _te(e,t){return Jf(`Incorrect argument type: expected `+e,t.source)}function vte(e){return Jf(`'...' can appear at most once in a rule body`,e.source)}function yte(e){let t=e._node;uf(t&&t.isNonterminal()&&t.ctorName===`escapeChar_unicodeCodePoint`);let n=e.children.slice(1,-1).map(e=>e.source),r=n[0].coverageWith(...n.slice(1));return Jf(`U+${r.contents} is not a valid Unicode code point`,r)}function bte(e,t){let n=t.length>0?t[t.length-1].args:[],r=`Nullable expression `+e.expr.substituteParams(n)+` is not allowed inside '`+e.operator+`' (possible infinite loop)`;if(t.length>0){let e=t.map(e=>new Gf(e.ruleName,e.args)).join(`
|
|
85
85
|
`);r+=`
|
|
86
86
|
Application stack (most recent application last):
|
|
@@ -1303,7 +1303,7 @@ export default async function seed(container: AppOS.Container) {}
|
|
|
1303
1303
|
`;async function x9(e){try{return await it.access(e),!0}catch{return!1}}async function sDe(e){if(!await x9(e))return null;let t=(await it.readdir(e,{withFileTypes:!0})).filter(e=>e.isDirectory()&&/^\d{14}_/.test(e.name)).map(e=>e.name).sort().reverse();if(t.length===0)return null;let n=Qe.join(e,t[0],`snapshot.json`);if(!await x9(n))return null;let r=await it.readFile(n,`utf-8`);return JSON.parse(r)}async function S9(e){let t=Qe.join(process.cwd(),l,d,e);await x9(t)||await it.mkdir(t,{recursive:!0});let n=Qe.join(t,`schema.ts`);await x9(n)||await it.writeFile(n,iDe(e));let r=Qe.join(t,`relations.ts`);await x9(r)||await it.writeFile(r,aDe(e));let i=Qe.join(t,`seed.ts`);await x9(i)||await it.writeFile(i,oDe(e));let a=Qe.join(t,`schema-migrations`);await x9(a)||await it.mkdir(a,{recursive:!0});let o=Qe.join(t,`data-migrations`);await x9(o)||await it.mkdir(o,{recursive:!0})}async function cDe(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(t.info(`Generating data migration`),r.length===0){t.info(`No databases available`);return}let i=await t.choice({message:`Select database`,options:r.map(e=>({value:e,label:e}))});t.isCancel(i)&&t.cancel();let a=i;await S9(a);let{migrationsFolder:o}=y7(a,`data`),s=await t.task(a,async()=>{let e=`${new Date().toISOString().replace(/[-:T]/g,``).slice(0,14)}_${rDe()}`,t=Qe.join(o,e);await it.mkdir(t,{recursive:!0});let n=Qe.join(t,`migration.sql`);return await it.writeFile(n,`-- Write your data migration SQL here
|
|
1304
1304
|
`),n});t.success(s)}async function lDe(e){let{ctx:t,migrationType:n}=e,{container:r}=t;if(n===`data`){await cDe(e);return}let i=Object.keys(r.db);if(t.info(`Generating ${n} migrations`),i.length===0){t.info(`Nothing to generate`);return}for(let e of i)await S9(e);let a=!1;for(let e of i){let r=Qe.join(process.cwd(),l,d,e,`schema.ts`),{migrationsFolder:i}=y7(e,n);try{let n=await import(r),o=n.default||n,s=await sDe(i)??await _Te({}),c=await _Te(o),l=await vTe(s,c);if(!l||l.length===0){t.taskStatus(e,`no changes`);continue}let u=await t.task(e,async()=>{let e=`${new Date().toISOString().replace(/[-:T]/g,``).slice(0,14)}_${rDe()}`,t=Qe.join(i,e);await it.mkdir(t,{recursive:!0});let n=`${l.join(`;
|
|
1305
1305
|
|
|
1306
|
-
`)};`,r=Qe.join(t,`migration.sql`),a=Qe.join(t,`snapshot.json`);return await it.writeFile(r,n),await it.writeFile(a,JSON.stringify(c,null,2)),r});t.success(u),a=!0}catch(e){t.fail(e instanceof Error?e.message:String(e))}}a||t.info(`Nothing to generate`)}async function C9(e){let{ctx:t,migrationType:n}=e,{container:r}=t,i=Object.keys(r.db),a=r.logger.level;r.logger.level=`silent`,n===`schema`&&await(0,nDe.ensureSystemDatabase)(r.worker.dbUrl,r.logger);let o=(await Promise.all(i.map(async e=>{let{migrationsFolder:t}=y7(e,n);return x9(t)}))).some(Boolean);if(i.length===0||!o){t.info(`Nothing to migrate`),r.logger.level=a;return}for(let e of i){let i=r.db[e],a=y7(e,n);if(await x9(a.migrationsFolder))try{await t.task(e,async()=>{await Ue(i,a)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}r.logger.level=a}async function w9(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(r.length===0){t.info(`Nothing to seed`);return}for(let e of r)await S9(e);for(let e of r){let r=Qe.join(process.cwd(),l,d,e,`seed.ts`);try{await t.task(e,async()=>{let e=await import(r),t=e.default||e.seed;if(typeof t!=`function`)throw Error(`seed file does not export a function`);await t(n)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}}var uDe=Oi({description:`Generate database data migrations`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:data:gen`),await lDe({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),dDe=Oi({description:`Run pending database data migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:data:migrate`),await C9({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),fDe=Oi({description:`Generate database schema migrations from schema changes`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:gen`),await lDe({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),pDe=Oi({description:`Run pending database schema migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:migrate`),await C9({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),mDe=Oi({description:`Seed databases with initial data`,devOnly:!0,args:y([]),opts:v({}),async run(e){await w9({ctx:e}),await e.cleanup()}}),hDe=Oi({description:`Teardown the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`down`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}await e.cleanup(),e.outro()}}),gDe=Oi({description:`Preview the application`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`preview`),e.step(`Starting containers (Ctrl+C to stop)`);let t=Ze(`docker`,[`compose`,`--profile=app`,`up`,`--build`],{stdio:`inherit`,cwd:process.cwd()}),n=!1,r=async()=>{if(!n){n=!0,t.kill(`SIGTERM`),e.step(`Stopping containers`);try{await e.exec(`docker`,[`compose`,`--profile=app`,`down`,`--remove-orphans`,`--timeout=0`])}catch{}await e.cleanup(),process.exit(0)}};process.on(`SIGINT`,r),process.on(`SIGTERM`,r),t.on(`close`,()=>{n||r()}),await new Promise(()=>{})}}),_De=`0.3.
|
|
1306
|
+
`)};`,r=Qe.join(t,`migration.sql`),a=Qe.join(t,`snapshot.json`);return await it.writeFile(r,n),await it.writeFile(a,JSON.stringify(c,null,2)),r});t.success(u),a=!0}catch(e){t.fail(e instanceof Error?e.message:String(e))}}a||t.info(`Nothing to generate`)}async function C9(e){let{ctx:t,migrationType:n}=e,{container:r}=t,i=Object.keys(r.db),a=r.logger.level;r.logger.level=`silent`,n===`schema`&&await(0,nDe.ensureSystemDatabase)(r.worker.dbUrl,r.logger);let o=(await Promise.all(i.map(async e=>{let{migrationsFolder:t}=y7(e,n);return x9(t)}))).some(Boolean);if(i.length===0||!o){t.info(`Nothing to migrate`),r.logger.level=a;return}for(let e of i){let i=r.db[e],a=y7(e,n);if(await x9(a.migrationsFolder))try{await t.task(e,async()=>{await Ue(i,a)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}r.logger.level=a}async function w9(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(r.length===0){t.info(`Nothing to seed`);return}for(let e of r)await S9(e);for(let e of r){let r=Qe.join(process.cwd(),l,d,e,`seed.ts`);try{await t.task(e,async()=>{let e=await import(r),t=e.default||e.seed;if(typeof t!=`function`)throw Error(`seed file does not export a function`);await t(n)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}}var uDe=Oi({description:`Generate database data migrations`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:data:gen`),await lDe({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),dDe=Oi({description:`Run pending database data migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:data:migrate`),await C9({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),fDe=Oi({description:`Generate database schema migrations from schema changes`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:gen`),await lDe({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),pDe=Oi({description:`Run pending database schema migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:migrate`),await C9({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),mDe=Oi({description:`Seed databases with initial data`,devOnly:!0,args:y([]),opts:v({}),async run(e){await w9({ctx:e}),await e.cleanup()}}),hDe=Oi({description:`Teardown the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`down`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}await e.cleanup(),e.outro()}}),gDe=Oi({description:`Preview the application`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`preview`),e.step(`Starting containers (Ctrl+C to stop)`);let t=Ze(`docker`,[`compose`,`--profile=app`,`up`,`--build`],{stdio:`inherit`,cwd:process.cwd()}),n=!1,r=async()=>{if(!n){n=!0,t.kill(`SIGTERM`),e.step(`Stopping containers`);try{await e.exec(`docker`,[`compose`,`--profile=app`,`down`,`--remove-orphans`,`--timeout=0`])}catch{}await e.cleanup(),process.exit(0)}};process.on(`SIGINT`,r),process.on(`SIGTERM`,r),t.on(`close`,()=>{n||r()}),await new Promise(()=>{})}}),_De=`0.3.4-0`;const vDe=`(AppOS v${_De} | Node ${process.version})`;var yDe=Oi({description:`Start an interactive REPL with container access`,aliases:[`r`],args:y([]),opts:v({}),async run(e){e.intro(`repl`);let{container:t}=e,n=[],r=Object.keys(t.db);r.length>0&&n.push(`container.db.{${r.join(`, `)}}`);let i=Object.keys(t.cache);i.length>0&&n.push(`container.cache.{${i.join(`, `)}}`);let a=Object.keys(t.storage);a.length>0&&n.push(`container.storage.{${a.join(`, `)}}`);let o=Object.keys(t).filter(e=>e!==`db`&&e!==`cache`&&e!==`storage`).map(e=>`container.${e}`);n.push(...o),e.info(`Starting REPL ${vDe}`),e.info(`Available: ${n.join(`, `)}`),e.line(``);let s=Dn.start({prompt:`appos(${t.config.APP_NAME})> `,useColors:!0,useGlobal:!0,breakEvalOnSigint:!0});s.context.container=t,s.on(`exit`,async()=>{await e.cleanup(),e.info(`Bye`),process.exit(0)}),await new Promise(()=>{})}}),bDe=Oi({description:`Reset the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`reset`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}try{await e.spinner(`Starting containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`up`,`--wait`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}e.step(`Running schema migrations`),await C9({ctx:e,migrationType:`schema`}),e.step(`Seeding databases`),await w9({ctx:e}),await e.cleanup(),e.outro()}}),xDe=t(i(((e,t)=>{var n={decodeValues:!0,map:!1,silent:!1};function r(e){return typeof e!=`string`||e in{}}function i(){return Object.create(null)}function a(e){return typeof e==`string`&&!!e.trim()}function o(e,t){var o=e.split(`;`).filter(a),c=s(o.shift()),l=c.name,u=c.value;if(t=t?Object.assign({},n,t):n,r(l))return null;try{u=t.decodeValues?decodeURIComponent(u):u}catch(e){console.error(`set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.`,e)}var d=i();return d.name=l,d.value=u,o.forEach(function(e){var t=e.split(`=`),n=t.shift().trimLeft().toLowerCase();if(!r(n)){var i=t.join(`=`);if(n===`expires`)d.expires=new Date(i);else if(n===`max-age`){var a=parseInt(i,10);Number.isNaN(a)||(d.maxAge=a)}else n===`secure`?d.secure=!0:n===`httponly`?d.httpOnly=!0:n===`samesite`?d.sameSite=i:n===`partitioned`?d.partitioned=!0:n&&(d[n]=i)}}),d}function s(e){var t=``,n=``,r=e.split(`=`);return r.length>1?(t=r.shift(),n=r.join(`=`)):n=e,{name:t,value:n}}function c(e,t){if(t=t?Object.assign({},n,t):n,!e)return t.map?i():[];if(e.headers)if(typeof e.headers.getSetCookie==`function`)e=e.headers.getSetCookie();else if(e.headers[`set-cookie`])e=e.headers[`set-cookie`];else{var s=e.headers[Object.keys(e.headers).find(function(e){return e.toLowerCase()===`set-cookie`})];!s&&e.headers.cookie&&!t.silent&&console.warn(`Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.`),e=s}if(Array.isArray(e)||(e=[e]),t.map){var c=i();return e.filter(a).reduce(function(e,n){var i=o(n,t);return i&&!r(i.name)&&(e[i.name]=i),e},c)}else return e.filter(a).map(function(e){return o(e,t)}).filter(Boolean)}function l(e){if(Array.isArray(e))return e;if(typeof e!=`string`)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}t.exports=c,t.exports.parse=c,t.exports.parseString=o,t.exports.splitCookiesString=l}))(),1);function SDe(e,t){let n=e.headers;if(!n[`content-type`])return null;let r=Number(n[`content-length`]);if(e.httpVersionMajor===1&&isNaN(r)&&n[`transfer-encoding`]==null||r===0)return null;let i=r;if(t){if(!i)i=t;else if(i>t)throw Error(`Received content-length of ${i}, but only accept up to ${t} bytes.`)}if(e.destroyed){let e=new ReadableStream;return e.cancel(),e}let a=0,o=!1;return new ReadableStream({start(t){e.on(`error`,e=>{o=!0,t.error(e)}),e.on(`end`,()=>{o||t.close()}),e.on(`data`,n=>{if(!o){if(a+=n.length,a>i){o=!0,t.error(Error(`request body size exceeded ${r?`'content-length'`:`BODY_SIZE_LIMIT`} of ${i}`));return}t.enqueue(n),(t.desiredSize===null||t.desiredSize<=0)&&e.pause()}})},pull(){e.resume()},cancel(t){o=!0,e.destroy(t)}})}function CDe({request:e,base:t,bodySizeLimit:n}){let r=e?.baseUrl,i=r?r+e.url:e.url,a=e,o,s=e.method;if(s!==`GET`&&s!==`HEAD`)if(a.body!==void 0){let e=typeof a.body==`string`?a.body:JSON.stringify(a.body);o=new ReadableStream({start(t){t.enqueue(new TextEncoder().encode(e)),t.close()}})}else o=SDe(e,n);return new Request(t+i,{duplex:`half`,method:e.method,body:o,headers:e.headers})}async function wDe(e,t){for(let[n,r]of t.headers)try{e.setHeader(n,n===`set-cookie`?xDe.splitCookiesString(t.headers.get(n)):r)}catch(t){e.getHeaderNames().forEach(t=>e.removeHeader(t)),e.writeHead(500).end(String(t));return}if(e.writeHead(t.status),!t.body){e.end();return}if(t.body.locked){e.end(`Fatal error: Response body is locked. This can happen when the response was already read (for example through 'response.json()' or 'response.text()').`);return}let n=t.body.getReader();if(e.destroyed){n.cancel();return}let r=t=>{e.off(`close`,r),e.off(`error`,r),n.cancel(t).catch(()=>{}),t&&e.destroy(t)};e.on(`close`,r),e.on(`error`,r),i();async function i(){try{for(;;){let{done:t,value:r}=await n.read();if(t)break;if(!e.write(r)){e.once(`drain`,i);return}}e.end()}catch(e){r(e instanceof Error?e:Error(String(e)))}}}function TDe(e){return async(t,n)=>wDe(n,await e(CDe({base:`${t.headers[`x-forwarded-proto`]||(t.socket.encrypted?`https`:`http`)}://${t.headers[`:authority`]||t.headers.host}`,request:t})))}const EDe=e=>`handler`in e?TDe(e.handler):TDe(e);
|
|
1307
1307
|
/*
|
|
1308
1308
|
object-assign
|
|
1309
1309
|
(c) Sindre Sorhus
|
|
@@ -239,14 +239,14 @@ declare class StorageService<TDiskNames extends string = string, TTableNames ext
|
|
|
239
239
|
blobId: string;
|
|
240
240
|
blob: {
|
|
241
241
|
id: string;
|
|
242
|
-
createdAt: string;
|
|
243
242
|
key: string;
|
|
244
|
-
metadata: unknown;
|
|
245
243
|
filename: string;
|
|
246
244
|
contentType: string | null;
|
|
245
|
+
metadata: unknown;
|
|
247
246
|
serviceName: string;
|
|
248
247
|
byteSize: number;
|
|
249
248
|
checksum: string | null;
|
|
249
|
+
createdAt: string;
|
|
250
250
|
} | null;
|
|
251
251
|
}[]>;
|
|
252
252
|
/**
|
|
@@ -263,14 +263,14 @@ declare class StorageService<TDiskNames extends string = string, TTableNames ext
|
|
|
263
263
|
blobId: string;
|
|
264
264
|
blob: {
|
|
265
265
|
id: string;
|
|
266
|
-
createdAt: string;
|
|
267
266
|
key: string;
|
|
268
|
-
metadata: unknown;
|
|
269
267
|
filename: string;
|
|
270
268
|
contentType: string | null;
|
|
269
|
+
metadata: unknown;
|
|
271
270
|
serviceName: string;
|
|
272
271
|
byteSize: number;
|
|
273
272
|
checksum: string | null;
|
|
273
|
+
createdAt: string;
|
|
274
274
|
} | null;
|
|
275
275
|
}[]>;
|
|
276
276
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appos",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4-0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "release-it",
|
|
@@ -130,7 +130,6 @@
|
|
|
130
130
|
"@aws-sdk/client-s3": "^3.955.0",
|
|
131
131
|
"@aws-sdk/s3-request-presigner": "^3.955.0",
|
|
132
132
|
"@dbos-inc/dbos-sdk": "^4.5.13",
|
|
133
|
-
"@napi-rs/canvas": "^0.1.84",
|
|
134
133
|
"@opentelemetry/api": "^1.9.0",
|
|
135
134
|
"@opentelemetry/auto-instrumentations-node": "^0.67.3",
|
|
136
135
|
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|