@influence-society-web/yuna-frontend 1.0.5 → 1.0.6

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.
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var Cd=Object.create;var Sa=Object.defineProperty;var Id=Object.getOwnPropertyDescriptor;var xd=Object.getOwnPropertyNames;var Pd=Object.getPrototypeOf,Rd=Object.prototype.hasOwnProperty;var Ad=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Ld=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Nd=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xd(t))!Rd.call(n,i)&&i!==e&&Sa(n,i,{get:()=>t[i],enumerable:!(r=Id(t,i))||r.enumerable});return n};var Od=(n,t,e)=>(e=n!=null?Cd(Pd(n)):{},Nd(t||!n||!n.__esModule?Sa(e,"default",{value:n,enumerable:!0}):e,n));var H=(n,t,e)=>(Ad(n,typeof t!="symbol"?t+"":t,e),e);var Mc=Ld((ka,Ta)=>{(function(n,t){typeof ka=="object"&&typeof Ta<"u"?Ta.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(ka,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(N,Y){(Y==null||Y>N.length)&&(Y=N.length);for(var O=0,ne=Array(Y);O<Y;O++)ne[O]=N[O];return ne}function r(N){if(Array.isArray(N))return N}function i(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function o(N,Y,O){return Y=f(Y),B(N,S()?Reflect.construct(Y,O||[],f(N).constructor):Y.apply(N,O))}function a(N,Y){if(!(N instanceof Y))throw new TypeError("Cannot call a class as a function")}function s(N,Y,O){if(S())return Reflect.construct.apply(null,arguments);var ne=[null];ne.push.apply(ne,Y);var y=new(N.bind.apply(N,ne));return O&&V(y,O.prototype),y}function u(N,Y){for(var O,ne=0;ne<Y.length;ne++)O=Y[ne],O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,J(O.key),O)}function l(N,Y,O){return Y&&u(N.prototype,Y),O&&u(N,O),Object.defineProperty(N,"prototype",{writable:!1}),N}function h(N,Y){var O=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!O){if(Array.isArray(N)||(O=ke(N))||Y&&N&&typeof N.length=="number"){O&&(N=O);var ne=0,y=function(){};return{s:y,n:function(){return ne>=N.length?{done:!0}:{done:!1,value:N[ne++]}},e:function(v){throw v},f:y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L,c=!0,d=!1;return{s:function(){O=O.call(N)},n:function(){var v=O.next();return c=v.done,v},e:function(v){d=!0,L=v},f:function(){try{c||O.return==null||O.return()}finally{if(d)throw L}}}}function f(N){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},f(N)}function g(N,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(Y&&Y.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),Y&&V(N,Y)}function E(N){try{return Function.toString.call(N).indexOf("[native code]")!==-1}catch{return typeof N=="function"}}function S(){try{var N=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S=function(){return!!N})()}function k(N,Y){var O=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(O!=null){var ne,y,L,c,d=[],v=!0,D=!1;try{if(L=(O=O.call(N)).next,Y===0){if(Object(O)!==O)return;v=!1}else for(;!(v=(ne=L.call(O)).done)&&(d.push(ne.value),d.length!==Y);v=!0);}catch(b){D=!0,y=b}finally{try{if(!v&&O.return!=null&&(c=O.return(),Object(c)!==c))return}finally{if(D)throw y}}return d}}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(N,Y){if(Y&&(typeof Y=="object"||typeof Y=="function"))return Y;if(Y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(N)}function V(N,Y){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,ne){return O.__proto__=ne,O},V(N,Y)}function G(N,Y){return r(N)||k(N,Y)||ke(N,Y)||A()}function U(N,Y){if(typeof N!="object"||!N)return N;var O=N[Symbol.toPrimitive];if(O!==void 0){var ne=O.call(N,Y||"default");if(typeof ne!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Y==="string"?String:Number)(N)}function J(N){var Y=U(N,"string");return typeof Y=="symbol"?Y:Y+""}function oe(N){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},oe(N)}function ke(N,Y){if(N){if(typeof N=="string")return e(N,Y);var O={}.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?e(N,Y):void 0}}function Me(N){var Y=typeof Map=="function"?new Map:void 0;return Me=function(O){function ne(){return s(O,arguments,f(this).constructor)}if(O===null||!E(O))return O;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(Y!==void 0){if(Y.has(O))return Y.get(O);Y.set(O,ne)}return ne.prototype=Object.create(O.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),V(ne,O)},Me(N)}var ie=function(N){var Y=Math.abs,O=Math.max,ne=Math.floor;function y(L,c){var d;if(a(this,y),d=o(this,y,[L]),d.sign=c,Object.setPrototypeOf(d,y.prototype),L>y.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return g(y,N),l(y,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var D=c.value;d.push((D&&(D>>>0).toString(16))+", ")}}catch(b){v.e(b)}finally{v.f()}return d.push("]"),d.join("")}},{key:"toString",value:function(){var c=0<arguments.length&&arguments[0]!==void 0?arguments[0]:10;if(2>c||36<c)throw new RangeError("toString() radix argument must be between 2 and 36");return this.length===0?"0":c&c-1?y.__toStringGeneric(this,c,!1):y.__toStringBasePowerOfTwo(this,c)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var c=new y(this.length,this.sign),d=0;d<this.length;d++)c[d]=this[d];return c}},{key:"__trim",value:function(){for(var c=this.length,d=this[c-1];d===0;)c--,d=this[c-1],this.pop();return c===0&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var c=0;c<this.length;c++)this[c]=0}},{key:"__clzmsd",value:function(){return y.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(c,d,v){v>this.length&&(v=this.length);for(var D=32767&c,b=c>>>15,_=0,I=d,C=0;C<v;C++){var F=this.__digit(C),R=32767&F,W=F>>>15,ee=y.__imul(R,D),q=y.__imul(R,b),j=y.__imul(W,D),re=y.__imul(W,b),le=I+ee+_;_=le>>>30,le&=1073741823,le+=((32767&q)<<15)+((32767&j)<<15),_+=le>>>30,I=re+(q>>>15)+(j>>>15),this.__setDigit(C,1073741823&le)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var D,b=0,_=0;_<v;_++)D=this.__halfDigit(d+_)+c.__halfDigit(_)+b,b=D>>>15,this.__setHalfDigit(d+_,32767&D);return b}},{key:"__inplaceSub",value:function(c,d,v){var D=v-1>>>1,b=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,C=0;C<D;C++){var F=c.__digit(C),R=(_>>>15)-(32767&F)-b;b=1&R>>>15,this.__setDigit(d+C,(32767&R)<<15|32767&I),_=this.__digit(d+C+1),I=(32767&_)-(F>>>15)-b,b=1&I>>>15}var W=c.__digit(C),ee=(_>>>15)-(32767&W)-b;b=1&ee>>>15,this.__setDigit(d+C,(32767&ee)<<15|32767&I);var q=W>>>15;if(d+C+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+C+1),I=(32767&_)-q-b,b=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var j=0;j<c.length-1;j++){var re=this.__digit(d+j),le=c.__digit(j),pe=(32767&re)-(32767&le)-b;b=1&pe>>>15;var we=(re>>>15)-(le>>>15)-b;b=1&we>>>15,this.__setDigit(d+j,(32767&we)<<15|32767&pe)}var Re=this.__digit(d+j),je=c.__digit(j),Xe=(32767&Re)-(32767&je)-b;b=1&Xe>>>15;var Vt=0;!(1&v)&&(Vt=(Re>>>15)-(je>>>15)-b,b=1&Vt>>>15),this.__setDigit(d+j,(32767&Vt)<<15|32767&Xe)}return b}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,D=this.length-1,b=0;b<D;b++)d=this.__digit(b+1),this.__setDigit(b,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(D,v)}}},{key:"__digit",value:function(c){return this[c]}},{key:"__unsignedDigit",value:function(c){return this[c]>>>0}},{key:"__setDigit",value:function(c,d){this[c]=0|d}},{key:"__setDigitGrow",value:function(c,d){this[c]=0|d}},{key:"__halfDigitLength",value:function(){var c=this.length;return 32767>=this.__unsignedDigit(c-1)?2*c-1:2*c}},{key:"__halfDigit",value:function(c){return 32767&this[c>>>1]>>>15*(1&c)}},{key:"__setHalfDigit",value:function(c,d){var v=c>>>1,D=this.__digit(v),b=1&c?32767&D|d<<15:1073709056&D|32767&d;this.__setDigit(v,b)}}],[{key:"BigInt",value:function(c){var d=Number.isFinite;if(typeof c=="number"){if(c===0)return y.__zero();if(y.__isOneDigitInt(c))return 0>c?y.__oneDigit(-c,!0):y.__oneDigit(c,!1);if(!d(c)||ne(c)!==c)throw new RangeError("The number "+c+" cannot be converted to BigInt because it is not an integer");return y.__fromDouble(c)}if(typeof c=="string"){var v=y.__fromString(c);if(v===null)throw new SyntaxError("Cannot convert "+c+" to a BigInt");return v}if(typeof c=="boolean")return c===!0?y.__oneDigit(1,!1):y.__zero();if(oe(c)==="object"){if(c.constructor===y)return c;var D=y.__toPrimitive(c);return y.BigInt(D)}throw new TypeError("Cannot convert "+c+" to a BigInt")}},{key:"toNumber",value:function(c){var d=c.length;if(d===0)return 0;if(d===1){var v=c.__unsignedDigit(0);return c.sign?-v:v}var D=c.__digit(d-1),b=y.__clz30(D),_=30*d-b;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,C=D,F=d-1,R=b+3,W=R===32?0:C<<R;W>>>=12;var ee=R-12,q=12<=R?0:C<<20+R,j=20+R;for(0<ee&&0<F&&(F--,C=c.__digit(F),W|=C>>>30-ee,q=C<<ee+2,j=ee+2);0<j&&0<F;)F--,C=c.__digit(F),q|=30<=j?C<<j-30:C>>>30-j,j-=30;var re=y.__decideRounding(c,j,F,C);if((re===1||re===0&&(1&q)==1)&&(q=q+1>>>0,q===0&&(W++,W>>>20!=0&&(W=0,I++,1023<I))))return c.sign?-1/0:1/0;var le=c.sign?-2147483648:0;return I=I+1023<<20,y.__kBitConversionInts[y.__kBitConversionIntHigh]=le|I|W,y.__kBitConversionInts[y.__kBitConversionIntLow]=q,y.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(c){if(c.length===0)return c;var d=c.__copy();return d.sign=!c.sign,d}},{key:"bitwiseNot",value:function(c){return c.sign?y.__absoluteSubOne(c).__trim():y.__absoluteAddOne(c,!0)}},{key:"exponentiate",value:function(c,d){if(d.sign)throw new RangeError("Exponent must be positive");if(d.length===0)return y.__oneDigit(1,!1);if(c.length===0)return c;if(c.length===1&&c.__digit(0)===1)return c.sign&&!(1&d.__digit(0))?y.unaryMinus(c):c;if(1<d.length)throw new RangeError("BigInt too big");var v=d.__unsignedDigit(0);if(v===1)return c;if(v>=y.__kMaxLengthBits)throw new RangeError("BigInt too big");if(c.length===1&&c.__digit(0)===2){var D=1+(0|v/30),b=c.sign&&(1&v)!=0,_=new y(D,b);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(D-1,I),_}var C=null,F=c;for(1&v&&(C=c),v>>=1;v!==0;v>>=1)F=y.multiply(F,F),1&v&&(C===null?C=F:C=y.multiply(C,F));return C}},{key:"multiply",value:function(c,d){if(c.length===0)return c;if(d.length===0)return d;var v=c.length+d.length;30<=c.__clzmsd()+d.__clzmsd()&&v--;var D=new y(v,c.sign!==d.sign);D.__initializeDigits();for(var b=0;b<c.length;b++)y.__multiplyAccumulate(d,c.__digit(b),D,b);return D.__trim()}},{key:"divide",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>y.__absoluteCompare(c,d))return y.__zero();var v,D=c.sign!==d.sign,b=d.__unsignedDigit(0);if(d.length===1&&32767>=b){if(b===1)return D===c.sign?c:y.unaryMinus(c);v=y.__absoluteDivSmall(c,b,null)}else v=y.__absoluteDivLarge(c,d,!0,!1);return v.sign=D,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>y.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return y.__zero();var D=y.__absoluteModSmall(c,v);return D===0?y.__zero():y.__oneDigit(D,c.sign)}var b=y.__absoluteDivLarge(c,d,!1,!0);return b.sign=c.sign,b.__trim()}},{key:"add",value:function(c,d){var v=c.sign;return v===d.sign?y.__absoluteAdd(c,d,v):0<=y.__absoluteCompare(c,d)?y.__absoluteSub(c,d,v):y.__absoluteSub(d,c,!v)}},{key:"subtract",value:function(c,d){var v=c.sign;return v===d.sign?0<=y.__absoluteCompare(c,d)?y.__absoluteSub(c,d,v):y.__absoluteSub(d,c,!v):y.__absoluteAdd(c,d,v)}},{key:"leftShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?y.__rightShiftByAbsolute(c,d):y.__leftShiftByAbsolute(c,d)}},{key:"signedRightShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?y.__leftShiftByAbsolute(c,d):y.__rightShiftByAbsolute(c,d)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(c,d){return 0>y.__compareToBigInt(c,d)}},{key:"lessThanOrEqual",value:function(c,d){return 0>=y.__compareToBigInt(c,d)}},{key:"greaterThan",value:function(c,d){return 0<y.__compareToBigInt(c,d)}},{key:"greaterThanOrEqual",value:function(c,d){return 0<=y.__compareToBigInt(c,d)}},{key:"equal",value:function(c,d){if(c.sign!==d.sign||c.length!==d.length)return!1;for(var v=0;v<c.length;v++)if(c.__digit(v)!==d.__digit(v))return!1;return!0}},{key:"notEqual",value:function(c,d){return!y.equal(c,d)}},{key:"bitwiseAnd",value:function(c,d){if(!c.sign&&!d.sign)return y.__absoluteAnd(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length)+1,D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return D=y.__absoluteOr(D,b,D),y.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}return y.__absoluteAndNot(c,y.__absoluteSubOne(d)).__trim()}},{key:"bitwiseXor",value:function(c,d){if(!c.sign&&!d.sign)return y.__absoluteXor(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length),D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return y.__absoluteXor(D,b,D).__trim()}var _=O(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var C=y.__absoluteSubOne(d,_);return C=y.__absoluteXor(C,c,C),y.__absoluteAddOne(C,!0,C).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=O(c.length,d.length);if(!c.sign&&!d.sign)return y.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return D=y.__absoluteAnd(D,b,D),y.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var I=y.__absoluteSubOne(d,v);return I=y.__absoluteAndNot(I,c,I),y.__absoluteAddOne(I,!0,I).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=ne(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return y.__zero();if(c>=y.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=d.__unsignedDigit(v-1),b=1<<(c-1)%30;if(d.length===v&&D<b)return d;var _=(D&b)===b;if(!_)return y.__truncateToNBits(c,d);if(!d.sign)return y.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(D&b-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return y.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&D===b?d:y.__truncateToNBits(c,d)}return y.__truncateAndSubFromPowerOfTwo(c,d,!1)}},{key:"asUintN",value:function(c,d){if(d.length===0)return d;if(c=ne(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return y.__zero();if(d.sign){if(c>y.__kMaxLengthBits)throw new RangeError("BigInt too big");return y.__truncateAndSubFromPowerOfTwo(c,d,!1)}if(c>=y.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=c%30;if(d.length==v){if(D===0)return d;var b=d.__digit(v-1);if(!(b>>>D))return d}return y.__truncateToNBits(c,d)}},{key:"ADD",value:function(c,d){if(c=y.__toPrimitive(c),d=y.__toPrimitive(d),typeof c=="string")return typeof d!="string"&&(d=d.toString()),c+d;if(typeof d=="string")return c.toString()+d;if(c=y.__toNumeric(c),d=y.__toNumeric(d),y.__isBigInt(c)&&y.__isBigInt(d))return y.add(c,d);if(typeof c=="number"&&typeof d=="number")return c+d;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(c,d){return y.__compare(c,d,0)}},{key:"LE",value:function(c,d){return y.__compare(c,d,1)}},{key:"GT",value:function(c,d){return y.__compare(c,d,2)}},{key:"GE",value:function(c,d){return y.__compare(c,d,3)}},{key:"EQ",value:function(c,d){for(;;){if(y.__isBigInt(c))return y.__isBigInt(d)?y.equal(c,d):y.EQ(d,c);if(typeof c=="number"){if(y.__isBigInt(d))return y.__equalToNumber(d,c);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(typeof c=="string"){if(y.__isBigInt(d))return c=y.__fromString(c),c!==null&&y.equal(c,d);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(typeof c=="boolean"){if(y.__isBigInt(d))return y.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(oe(c)==="symbol"){if(y.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(d)==="object"&&d.constructor!==y)return c==d;c=y.__toPrimitive(c)}else return c==d}}},{key:"NE",value:function(c,d){return!y.EQ(c,d)}},{key:"DataViewGetBigInt64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return y.asIntN(64,y.DataViewGetBigUint64(c,d,v))}},{key:"DataViewGetBigUint64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2],D=v?[4,0]:[0,4],b=G(D,2),_=b[0],I=b[1],C=c.getUint32(d+_,v),F=c.getUint32(d+I,v),R=new y(3,!1);return R.__setDigit(0,1073741823&F),R.__setDigit(1,(268435455&C)<<2|F>>>30),R.__setDigit(2,C>>>28),R.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];y.DataViewSetBigUint64(c,d,v,D)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=y.asUintN(64,v);var b=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,b=I>>>2,2<v.length&&(b|=v.__digit(2)<<28)}var C=D?[4,0]:[0,4],F=G(C,2),R=F[0],W=F[1];c.setUint32(d+R,b,D),c.setUint32(d+W,_,D)}},{key:"__zero",value:function(){return new y(0,!1)}},{key:"__oneDigit",value:function(c,d){var v=new y(1,d);return v.__setDigit(0,c),v}},{key:"__decideRounding",value:function(c,d,v,D){if(0<d)return-1;var b;if(0>d)b=-d-1;else{if(v===0)return-1;v--,D=c.__digit(v),b=29}var _=1<<b;if(!(D&_))return-1;if(_-=1,(D&_)!=0)return 1;for(;0<v;)if(v--,c.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(c){var d=0>c;y.__kBitConversionDouble[0]=c;var v,D=2047&y.__kBitConversionInts[y.__kBitConversionIntHigh]>>>20,b=D-1023,_=(0|b/30)+1,I=new y(_,d),C=1048576,F=1048575&y.__kBitConversionInts[y.__kBitConversionIntHigh]|C,R=y.__kBitConversionInts[y.__kBitConversionIntLow],W=20,ee=b%30,q=0;if(ee<W){var j=W-ee;q=j+32,v=F>>>j,F=F<<32-j|R>>>j,R<<=32-j}else if(ee===W)q=32,v=F,F=R,R=0;else{var re=ee-W;q=32-re,v=F<<re|R>>>32-re,F=R<<re,R=0}I.__setDigit(_-1,v);for(var le=_-2;0<=le;le--)0<q?(q-=30,v=F>>>2,F=F<<30|R>>>2,R<<=30):v=0,I.__setDigit(le,v);return I.__trim()}},{key:"__isWhitespace",value:function(c){return 13>=c&&9<=c||(159>=c?c==32:131071>=c?c==160||c==5760:196607>=c?(c&=131071,10>=c||c==40||c==41||c==47||c==95||c==4096):c==65279)}},{key:"__fromString",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,D=c.length,b=0;if(b===D)return y.__zero();for(var _=c.charCodeAt(b);y.__isWhitespace(_);){if(++b===D)return y.__zero();_=c.charCodeAt(b)}if(_===43){if(++b===D)return null;_=c.charCodeAt(b),v=1}else if(_===45){if(++b===D)return null;_=c.charCodeAt(b),v=-1}if(d===0){if(d=10,_===48){if(++b===D)return y.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(d=16,++b===D)return null;_=c.charCodeAt(b)}else if(_===79||_===111){if(d=8,++b===D)return null;_=c.charCodeAt(b)}else if(_===66||_===98){if(d=2,++b===D)return null;_=c.charCodeAt(b)}}}else if(d===16&&_===48){if(++b===D)return y.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(++b===D)return null;_=c.charCodeAt(b)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++b===D)return y.__zero();_=c.charCodeAt(b)}var I=D-b,C=y.__kMaxBitsPerChar[d],F=y.__kBitsPerCharTableMultiplier-1;if(I>1073741824/C)return null;var R=C*I+F>>>y.__kBitsPerCharTableShift,W=0|(R+29)/30,ee=new y(W,!1),q=10>d?d:10,j=10<d?d-10:0;if(d&d-1){ee.__initializeDigits();var Xe=!1,Vt=0;do{for(var Gn,Rn=0,qr=1;;){if(Gn=void 0,_-48>>>0<q)Gn=_-48;else if((32|_)-97>>>0<j)Gn=(32|_)-87;else{Xe=!0;break}var ao=qr*d;if(1073741823<ao)break;if(qr=ao,Rn=Rn*d+Gn,Vt++,++b===D){Xe=!0;break}_=c.charCodeAt(b)}F=30*y.__kBitsPerCharTableMultiplier-1;var so=0|(C*Vt+F>>>y.__kBitsPerCharTableShift)/30;ee.__inplaceMultiplyAdd(qr,Rn,so)}while(!Xe)}else{C>>=y.__kBitsPerCharTableShift;var re=[],le=[],pe=!1;do{for(var we,Re=0,je=0;;){if(we=void 0,_-48>>>0<q)we=_-48;else if((32|_)-97>>>0<j)we=(32|_)-87;else{pe=!0;break}if(je+=C,Re=Re<<C|we,++b===D){pe=!0;break}if(_=c.charCodeAt(b),30<je+C)break}re.push(Re),le.push(je)}while(!pe);y.__fillFromParts(ee,re,le)}if(b!==D){if(!y.__isWhitespace(_))return null;for(b++;b<D;b++)if(_=c.charCodeAt(b),!y.__isWhitespace(_))return null}return ee.sign=v===-1,ee.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var D=0,b=0,_=0,I=d.length-1;0<=I;I--){var C=d[I],F=v[I];b|=C<<_,_+=F,_===30?(c.__setDigit(D++,b),_=0,b=0):30<_&&(c.__setDigit(D++,1073741823&b),_-=30,b=C>>>F-_)}if(b!==0){if(D>=c.length)throw new Error("implementation bug");c.__setDigit(D++,b)}for(;D<c.length;D++)c.__setDigit(D,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,D=d-1;D=(85&D>>>1)+(85&D),D=(51&D>>>2)+(51&D),D=(15&D>>>4)+(15&D);var b=D,_=d-1,I=c.__digit(v-1),C=y.__clz30(I),F=30*v-C,R=0|(F+b-1)/b;if(c.sign&&R++,268435456<R)throw new Error("string too long");for(var W=Array(R),ee=R-1,q=0,j=0,re=0;re<v-1;re++){var le=c.__digit(re),pe=(q|le<<j)&_;W[ee--]=y.__kConversionChars[pe];var we=b-j;for(q=le>>>we,j=30-we;j>=b;)W[ee--]=y.__kConversionChars[q&_],q>>>=b,j-=b}var Re=(q|I<<j)&_;for(W[ee--]=y.__kConversionChars[Re],q=I>>>b-j;q!==0;)W[ee--]=y.__kConversionChars[q&_],q>>>=b;if(c.sign&&(W[ee--]="-"),ee!==-1)throw new Error("implementation bug");return W.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var D=c.length;if(D===0)return"";if(D===1){var b=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(b="-"+b),b}var _=30*D-y.__clz30(c.__digit(D-1)),I=y.__kMaxBitsPerChar[d],C=I-1,F=_*y.__kBitsPerCharTableMultiplier;F+=C-1,F=0|F/C;var R,W,ee=F+1>>1,q=y.exponentiate(y.__oneDigit(d,!1),y.__oneDigit(ee,!1)),j=q.__unsignedDigit(0);if(q.length===1&&32767>=j){R=new y(c.length,!1),R.__initializeDigits();for(var re,le=0,pe=2*c.length-1;0<=pe;pe--)re=le<<15|c.__halfDigit(pe),R.__setHalfDigit(pe,0|re/j),le=0|re%j;W=le.toString(d)}else{var we=y.__absoluteDivLarge(c,q,!0,!0);R=we.quotient;var Re=we.remainder.__trim();W=y.__toStringGeneric(Re,d,!0)}R.__trim();for(var je=y.__toStringGeneric(R,d,!0);W.length<ee;)W="0"+W;return v===!1&&c.sign&&(je="-"+je),je+W}},{key:"__unequalSign",value:function(c){return c?-1:1}},{key:"__absoluteGreater",value:function(c){return c?-1:1}},{key:"__absoluteLess",value:function(c){return c?1:-1}},{key:"__compareToBigInt",value:function(c,d){var v=c.sign;if(v!==d.sign)return y.__unequalSign(v);var D=y.__absoluteCompare(c,d);return 0<D?y.__absoluteGreater(v):0>D?y.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(y.__isOneDigitInt(d)){var v=c.sign,D=0>d;if(v!==D)return y.__unequalSign(v);if(c.length===0){if(D)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return y.__absoluteGreater(v);var b=Y(d),_=c.__unsignedDigit(0);return _>b?y.__absoluteGreater(v):_<b?y.__absoluteLess(v):0}return y.__compareToDouble(c,d)}},{key:"__compareToDouble",value:function(c,d){if(d!==d)return d;if(d===1/0)return-1;if(d===-1/0)return 1;var v=c.sign,D=0>d;if(v!==D)return y.__unequalSign(v);if(d===0)throw new Error("implementation bug: should be handled elsewhere");if(c.length===0)return-1;y.__kBitConversionDouble[0]=d;var b=2047&y.__kBitConversionInts[y.__kBitConversionIntHigh]>>>20;if(b==2047)throw new Error("implementation bug: handled elsewhere");var _=b-1023;if(0>_)return y.__absoluteGreater(v);var I=c.length,C=c.__digit(I-1),F=y.__clz30(C),R=30*I-F,W=_+1;if(R<W)return y.__absoluteLess(v);if(R>W)return y.__absoluteGreater(v);var ee=1048576,q=1048576|1048575&y.__kBitConversionInts[y.__kBitConversionIntHigh],j=y.__kBitConversionInts[y.__kBitConversionIntLow],re=20,le=29-F;if(le!==(0|(R-1)%30))throw new Error("implementation bug");var pe,we=0;if(le<re){var Re=re-le;we=Re+32,pe=q>>>Re,q=q<<32-Re|j>>>Re,j<<=32-Re}else if(le===re)we=32,pe=q,q=j,j=0;else{var je=le-re;we=32-je,pe=q<<je|j>>>32-je,q=j<<je,j=0}if(C>>>=0,pe>>>=0,C>pe)return y.__absoluteGreater(v);if(C<pe)return y.__absoluteLess(v);for(var Xe=I-2;0<=Xe;Xe--){0<we?(we-=30,pe=q>>>2,q=q<<30|j>>>2,j<<=30):pe=0;var Vt=c.__unsignedDigit(Xe);if(Vt>pe)return y.__absoluteGreater(v);if(Vt<pe)return y.__absoluteLess(v)}if(q!==0||j!==0){if(we===0)throw new Error("implementation bug");return y.__absoluteLess(v)}return 0}},{key:"__equalToNumber",value:function(c,d){return y.__isOneDigitInt(d)?d===0?c.length===0:c.length===1&&c.sign===0>d&&c.__unsignedDigit(0)===Y(d):y.__compareToDouble(c,d)===0}},{key:"__comparisonResultToBool",value:function(c,d){return d===0?0>c:d===1?0>=c:d===2?0<c:d===3?0<=c:void 0}},{key:"__compare",value:function(c,d,v){if(c=y.__toPrimitive(c),d=y.__toPrimitive(d),typeof c=="string"&&typeof d=="string")switch(v){case 0:return c<d;case 1:return c<=d;case 2:return c>d;case 3:return c>=d}if(y.__isBigInt(c)&&typeof d=="string")return d=y.__fromString(d),d!==null&&y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(typeof c=="string"&&y.__isBigInt(d))return c=y.__fromString(c),c!==null&&y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(c=y.__toNumeric(c),d=y.__toNumeric(d),y.__isBigInt(c)){if(y.__isBigInt(d))return y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(typeof d!="number")throw new Error("implementation bug");return y.__comparisonResultToBool(y.__compareToNumber(c,d),v)}if(typeof c!="number")throw new Error("implementation bug");if(y.__isBigInt(d))return y.__comparisonResultToBool(y.__compareToNumber(d,c),2^v);if(typeof d!="number")throw new Error("implementation bug");return v===0?c<d:v===1?c<=d:v===2?c>d:v===3?c>=d:void 0}},{key:"__absoluteAdd",value:function(c,d,v){if(c.length<d.length)return y.__absoluteAdd(d,c,v);if(c.length===0)return c;if(d.length===0)return c.sign===v?c:y.unaryMinus(c);var D=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&D++;for(var b,_=new y(D,v),I=0,C=0;C<d.length;C++)b=c.__digit(C)+d.__digit(C)+I,I=b>>>30,_.__setDigit(C,1073741823&b);for(;C<c.length;C++){var F=c.__digit(C)+I;I=F>>>30,_.__setDigit(C,1073741823&F)}return C<_.length&&_.__setDigit(C,I),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:y.unaryMinus(c);for(var D,b=new y(c.length,v),_=0,I=0;I<d.length;I++)D=c.__digit(I)-d.__digit(I)-_,_=1&D>>>30,b.__setDigit(I,1073741823&D);for(;I<c.length;I++){var C=c.__digit(I)-_;_=1&C>>>30,b.__setDigit(I,1073741823&C)}return b.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length;v===null?v=new y(D,d):v.sign=d;for(var b,_=1,I=0;I<D;I++)b=c.__digit(I)+_,_=b>>>30,v.__setDigit(I,1073741823&b);return _!==0&&v.__setDigitGrow(D,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var D,b=new y(d,!1),_=1,I=0;I<v;I++)D=c.__digit(I)-_,_=1&D>>>30,b.__setDigit(I,1073741823&D);if(_!==0)throw new Error("implementation bug");for(var C=v;C<d;C++)b.__setDigit(C,0);return b}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=_;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)&d.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;D<b&&(_=D);var I=D;v===null?v=new y(I,!1):I=v.length;for(var C=0;C<_;C++)v.__setDigit(C,c.__digit(C)&~d.__digit(C));for(;C<D;C++)v.__setDigit(C,c.__digit(C));for(;C<I;C++)v.__setDigit(C,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=D;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)|d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=D;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)^d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var D=c.length-1;0<=D&&c.__digit(D)===d.__digit(D);)D--;return 0>D?0:c.__unsignedDigit(D)>d.__unsignedDigit(D)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,D){if(d!==0){for(var b=32767&d,_=d>>>15,I=0,C=0,F=0;F<c.length;F++,D++){var R=v.__digit(D),W=c.__digit(F),ee=32767&W,q=W>>>15,j=y.__imul(ee,b),re=y.__imul(ee,_),le=y.__imul(q,b),pe=y.__imul(q,_);R+=C+j+I,I=R>>>30,R&=1073741823,R+=((32767&re)<<15)+((32767&le)<<15),I+=R>>>30,C=pe+(re>>>15)+(le>>>15),v.__setDigit(D,1073741823&R)}for(;I!==0||C!==0;D++){var we=v.__digit(D);we+=I+C,C=0,I=we>>>30,v.__setDigit(D,1073741823&we)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,D,b){for(var _=v,I=0,C=0;C<D;C++){var F=c.__digit(C),R=y.__imul(32767&F,d),W=y.__imul(F>>>15,d),ee=R+((32767&W)<<15)+I+_;_=ee>>>30,I=W>>>15,b.__setDigit(C,1073741823&ee)}if(b.length>D)for(b.__setDigit(D++,_+I);D<b.length;)b.__setDigit(D++,0);else if(_+I!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new y(c.length,!1));for(var D=0,b=2*c.length-1;0<=b;b-=2){var _=(D<<15|c.__halfDigit(b))>>>0,I=0|_/d;D=0|_%d,_=(D<<15|c.__halfDigit(b-1))>>>0;var C=0|_/d;D=0|_%d,v.__setDigit(b>>>1,I<<15|C)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,D=0,b=2*c.length-1;0<=b;b--)v=(D<<15|c.__halfDigit(b))>>>0,D=0|v%d;return D}},{key:"__absoluteDivLarge",value:function(c,d,v,D){var b=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-b,C=null;v&&(C=new y(I+2>>>1,!1),C.__initializeDigits());var F=new y(b+2>>>1,!1);F.__initializeDigits();var R=y.__clz15(d.__halfDigit(b-1));0<R&&(d=y.__specialLeftShift(d,R,0));for(var W=y.__specialLeftShift(c,R,1),ee=d.__halfDigit(b-1),q=0,j=I;0<=j;j--){var re=32767,le=W.__halfDigit(j+b);if(le!==ee){var pe=(le<<15|W.__halfDigit(j+b-1))>>>0;re=0|pe/ee;for(var we=0|pe%ee,Re=d.__halfDigit(b-2),je=W.__halfDigit(j+b-2);y.__imul(re,Re)>>>0>(we<<16|je)>>>0&&(re--,we+=ee,!(32767<we)););}y.__internalMultiplyAdd(d,re,0,_,F);var Xe=W.__inplaceSub(F,j,b+1);Xe!==0&&(Xe=W.__inplaceAdd(d,j,b),W.__setHalfDigit(j+b,32767&W.__halfDigit(j+b)+Xe),re--),v&&(1&j?q=re<<15:C.__setDigit(j>>>1,q|re))}if(D)return W.__inplaceRightShift(R),v?{quotient:C,remainder:W}:W;if(v)return C;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return y.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var D=c.length,b=D+v,_=new y(b,!1);if(d===0){for(var I=0;I<D;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(D,0),_}for(var C,F=0,R=0;R<D;R++)C=c.__digit(R),_.__setDigit(R,1073741823&C<<d|F),F=C>>>30-d;return 0<v&&_.__setDigit(D,F),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=y.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var D=0|v/30,b=v%30,_=c.length,I=b!==0&&c.__digit(_-1)>>>30-b!=0,C=_+D+(I?1:0),F=new y(C,c.sign);if(b===0){for(var R=0;R<D;R++)F.__setDigit(R,0);for(;R<C;R++)F.__setDigit(R,c.__digit(R-D))}else{for(var W=0,ee=0;ee<D;ee++)F.__setDigit(ee,0);for(var q,j=0;j<_;j++)q=c.__digit(j),F.__setDigit(j+D,1073741823&q<<b|W),W=q>>>30-b;if(I)F.__setDigit(_+D,W);else if(W!==0)throw new Error("implementation bug")}return F.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,D=c.sign,b=y.__toShiftAmount(d);if(0>b)return y.__rightShiftByMaximum(D);var _=0|b/30,I=b%30,C=v-_;if(0>=C)return y.__rightShiftByMaximum(D);var F=!1;if(D){var R=(1<<I)-1;if(c.__digit(_)&R)F=!0;else for(var W=0;W<_;W++)if(c.__digit(W)!==0){F=!0;break}}if(F&&I===0){var ee=c.__digit(v-1),q=~ee==0;q&&C++}var j=new y(C,D);if(I===0){j.__setDigit(C-1,0);for(var re=_;re<v;re++)j.__setDigit(re-_,c.__digit(re))}else{for(var le,pe=c.__digit(_)>>>I,we=v-_-1,Re=0;Re<we;Re++)le=c.__digit(Re+_+1),j.__setDigit(Re,1073741823&le<<30-I|pe),pe=le>>>I;j.__setDigit(we,pe)}return F&&(j=y.__absoluteAddOne(j,!0,j)),j.__trim()}},{key:"__rightShiftByMaximum",value:function(c){return c?y.__oneDigit(1,!0):y.__zero()}},{key:"__toShiftAmount",value:function(c){if(1<c.length)return-1;var d=c.__unsignedDigit(0);return d>y.__kMaxLengthBits?-1:d}},{key:"__toPrimitive",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"default";if(oe(c)!=="object"||c.constructor===y)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var D=c.valueOf;if(D){var b=D.call(c);if(oe(b)!=="object")return b}var _=c.toString;if(_){var I=_.call(c);if(oe(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return y.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return oe(c)==="object"&&c!==null&&c.constructor===y}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,D=new y(v,d.sign),b=v-1,_=0;_<b;_++)D.__setDigit(_,d.__digit(_));var I=d.__digit(b);if(c%30!=0){var C=32-c%30;I=I<<C>>>C}return D.__setDigit(b,I),D.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var D=Math.min,b,_=0|(c+29)/30,I=new y(_,v),C=0,F=_-1,R=0,W=D(F,d.length);C<W;C++)b=0-d.__digit(C)-R,R=1&b>>>30,I.__setDigit(C,1073741823&b);for(;C<F;C++)I.__setDigit(C,0|1073741823&-R);var ee,q=F<d.length?d.__digit(F):0,j=c%30;if(j===0)ee=0-q-R,ee&=1073741823;else{var re=32-j;q=q<<re>>>re;var le=1<<32-re;ee=le-q-R,ee&=le-1}return I.__setDigit(F,ee),I.__trim()}},{key:"__digitPow",value:function(c,d){for(var v=1;0<d;)1&d&&(v*=c),d>>>=1,c*=c;return v}},{key:"__detectBigEndian",value:function(){return y.__kBitConversionDouble[0]=-0,y.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(Me(Array));return ie.__kMaxLength=33554432,ie.__kMaxLengthBits=ie.__kMaxLength<<5,ie.__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],ie.__kBitsPerCharTableShift=5,ie.__kBitsPerCharTableMultiplier=1<<ie.__kBitsPerCharTableShift,ie.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ie.__kBitConversionBuffer=new ArrayBuffer(8),ie.__kBitConversionDouble=new Float64Array(ie.__kBitConversionBuffer),ie.__kBitConversionInts=new Int32Array(ie.__kBitConversionBuffer),ie.__kBitConversionIntHigh=ie.__detectBigEndian()?0:1,ie.__kBitConversionIntLow=ie.__detectBigEndian()?1:0,ie.__clz30=t?function(N){return t(N)-2}:function(N){var Y=Math.LN2,O=Math.log;return N===0?30:0|29-(0|O(N>>>0)/Y)},ie.__imul=n||function(N,Y){return 0|N*Y},ie})});var T=Od(Mc(),1),Ht=T.default.BigInt(0),di=T.default.BigInt(1),ws=T.default.BigInt(2),Fd=T.default.BigInt(10),Yd=T.default.BigInt(24),Hd=T.default.BigInt(60),$d=T.default.BigInt(1e3),Ii=T.default.BigInt(1e6),oi=T.default.BigInt(1e9),ol=T.default.multiply(T.default.BigInt(3600),oi),Bd=T.default.multiply(Hd,oi),Yn=T.default.multiply(ol,Yd);function gn(n){return typeof n=="bigint"?T.default.BigInt(n.toString(10)):n}function al(n){return T.default.equal(T.default.remainder(n,ws),Ht)}function Zn(n){return T.default.lessThan(n,Ht)?T.default.unaryMinus(n):n}function mo(n,t){return T.default.lessThan(n,t)?-1:T.default.greaterThan(n,t)?1:0}function Jr(n,t){return{quotient:T.default.divide(n,t),remainder:T.default.remainder(n,t)}}var Sc,kc,se="slot-epochNanoSeconds",ce="slot-iso-date",Ae="slot-iso-date-time",Ye="slot-time",$="slot-calendar",sl="slot-date-brand",cl="slot-year-month-brand",ll="slot-month-day-brand",Ee="slot-time-zone",ct="slot-years",lt="slot-months",St="slot-weeks",ut="slot-days",dt="slot-hours",ht="slot-minutes",mt="slot-seconds",ft="slot-milliseconds",pt="slot-microseconds",kt="slot-nanoseconds",ul="date",dl="ym",hl="md",ml="time",fl="datetime",pl="instant",sr="original",vr="timezone-canonical",Aa="timezone-original",Xr="calendar-id",gl="locale",La="options",yl=new WeakMap,Na=Symbol.for("@@Temporal__GetSlots");(Sc=globalThis)[Na]||(Sc[Na]=function(n){return yl.get(n)});var Io=globalThis[Na],Oa=Symbol.for("@@Temporal__CreateSlots");(kc=globalThis)[Oa]||(kc[Oa]=function(n){yl.set(n,Object.create(null))});var Tn=globalThis[Oa];function bt(n,...t){if(!n||typeof n!="object")return!1;let e=Io(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=Io(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function me(n,t,e){let r=Io(n);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=e}var Fa={};function Cn(n,t){Object.defineProperty(n.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let e=Object.getOwnPropertyNames(n);for(let i=0;i<e.length;i++){let o=e[i],a=Object.getOwnPropertyDescriptor(n,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n,o,a))}let r=Object.getOwnPropertyNames(n.prototype);for(let i=0;i<r.length;i++){let o=r[i],a=Object.getOwnPropertyDescriptor(n.prototype,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n.prototype,o,a))}Ya(t,n),Ya(`${t}.prototype`,n.prototype)}function Ya(n,t){let e=`%${n}%`;if(Fa[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);Fa[e]=t}function Je(n){return Fa[n]}function br(n,t){let e=n;if(e===0)return{div:e,mod:e};let r=Math.sign(e);e=Math.abs(e);let i=Math.trunc(1+Math.log10(e));if(t>=i)return{div:0*r,mod:r*e};if(t===0)return{div:r*e,mod:0*r};let o=e.toPrecision(i);return{div:r*Number.parseInt(o.slice(0,i-t),10),mod:r*Number.parseInt(o.slice(i-t),10)}}function Ca(n,t,e){let r=n,i=e;if(r===0)return i;let o=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return o*Number.parseInt(a+"0".repeat(t),10);let s=a+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,"0");return o*Number.parseInt(s,10)}function xo(n,t){let e=t==="negative";switch(n){case"ceil":return e?"zero":"infinity";case"floor":return e?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return e?"half-zero":"half-infinity";case"halfFloor":return e?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function Po(n,t,e,r,i){return i==="zero"?n:i==="infinity"?t:e<0?n:e>0?t:i==="half-zero"?n:i==="half-infinity"?t:r?n:t}var Se=class n{constructor(t){this.totalNs=gn(t),this.sec=T.default.toNumber(T.default.divide(this.totalNs,oi)),this.subsec=T.default.toNumber(T.default.remainder(this.totalNs,oi))}static validateNew(t,e){if(T.default.greaterThan(Zn(t),n.MAX))throw new RangeError(`${e} of duration time units cannot exceed ${n.MAX} s`);return new n(t)}static fromEpochNsDiff(t,e){let r=T.default.subtract(gn(t),gn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=T.default.add(T.default.add(T.default.add(T.default.add(T.default.add(T.default.BigInt(a),T.default.multiply(T.default.BigInt(o),$d)),T.default.multiply(T.default.BigInt(i),Ii)),T.default.multiply(T.default.BigInt(r),oi)),T.default.multiply(T.default.BigInt(e),Bd)),T.default.multiply(T.default.BigInt(t),ol));return n.validateNew(s,"total")}abs(){return new n(Zn(this.totalNs))}add(t){return n.validateNew(T.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(T.default.add(this.totalNs,T.default.multiply(T.default.BigInt(t),Yn)),"sum")}addToEpochNs(t){return T.default.add(gn(t),this.totalNs)}cmp(t){return mo(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=Jr(this.totalNs,T.default.BigInt(t));return{quotient:T.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=gn(t),r=T.default.BigInt(e),{quotient:i,remainder:o}=Jr(this.totalNs,r),a=[],s,u=(T.default.lessThan(this.totalNs,Ht)?-1:1)*Math.sign(T.default.toNumber(e));for(;!T.default.equal(o,Ht)&&a.length<50;)o=T.default.multiply(o,Fd),{quotient:s,remainder:o}=Jr(o,r),a.push(Math.abs(T.default.toNumber(s)));return u*+(Zn(i).toString()+"."+a.join(""))}isZero(){return T.default.equal(this.totalNs,Ht)}round(t,e){let r=gn(t);if(T.default.equal(r,di))return this;let{quotient:i,remainder:o}=Jr(this.totalNs,r),a=T.default.lessThan(this.totalNs,Ht)?"negative":"positive",s=T.default.multiply(Zn(i),r),u=T.default.add(s,r),l=mo(Zn(T.default.multiply(o,ws)),r),h=xo(e,a),f=T.default.equal(Zn(this.totalNs),s)?s:Po(s,u,l,al(i),h),g=a==="positive"?f:T.default.unaryMinus(f);return n.validateNew(g,"rounding")}sign(){return this.cmp(new n(Ht))}subtract(t){return n.validateNew(T.default.subtract(this.totalNs,t.totalNs),"difference")}};Se.MAX=T.default.BigInt("9007199254740991999999999"),Se.ZERO=new Se(Ht);var Tc=/[A-Za-z._][A-Za-z._0-9+-]*/,xi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Tc.source})(?:\\/(?:${Tc.source}))*)`),vl=/(?:[+-]\d{6}|\d{4})/,fo=/(?:0[1-9]|1[0-2])/,Ha=/(?:0[1-9]|[12]\d|3[01])/,jd=new RegExp(`(${vl.source})(?:-(${fo.source})-(${Ha.source})|(${fo.source})(${Ha.source}))`),wl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,bl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Dl=new RegExp(`([zZ])|${bl.source}?`),Mr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,zd=new RegExp([`^${jd.source}`,`(?:(?:[tT]|\\s+)${wl.source}(?:${Dl.source})?)?`,`(?:\\[!?(${xi.source})\\])?`,`((?:${Mr.source})*)$`].join("")),Ud=new RegExp([`^[tT]?${wl.source}`,`(?:${Dl.source})?`,`(?:\\[!?${xi.source}\\])?`,`((?:${Mr.source})*)$`].join("")),Vd=new RegExp(`^(${vl.source})-?(${fo.source})(?:\\[!?${xi.source}\\])?((?:${Mr.source})*)$`),qd=new RegExp(`^(?:--)?(${fo.source})-?(${Ha.source})(?:\\[!?${xi.source}\\])?((?:${Mr.source})*)$`),Ia=/(\d+)(?:[.,](\d{1,9}))?/,Wd=new RegExp(`(?:${Ia.source}H)?(?:${Ia.source}M)?(?:${Ia.source}S)?`),Kd=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Wd.source})?$`,"i"),Hn=864e5,po=1e6*Hn,Gd=6e10,El=1e8*Hn,Sr=Qt(El),hi=T.default.unaryMinus(Sr),Zd=T.default.add(T.default.subtract(hi,Yn),di),Jd=T.default.subtract(T.default.add(Sr,Yn),di),Xd=146097*Hn,Cc=-271821,Ic=275760,ai=Date.UTC(1847,0,1),Qd=["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"],eh=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 He(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Ro(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function Ao(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function ue(n){let t=Ro(n);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw new RangeError("invalid number value");let e=Math.trunc(t);return e===0?0:e}function xc(n,t){let e=ue(n);if(e<=0)throw t!==void 0?new RangeError(`property '${t}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return e}function Jt(n){let t=Ro(n);if(Number.isNaN(t))throw new RangeError("not a number");if(t===1/0||t===-1/0)throw new 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 r=Math.abs(e);return Math.floor(r)===r}(t))throw new RangeError(`unsupported fractional value ${n}`);return t===0?0:t}function mi(n,t){return String(n).padStart(t,"0")}function Ue(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function $a(n,t){if(He(n)){let e=n?.toString();if(typeof e=="string"||typeof e=="number")return e;throw new TypeError("Cannot convert object to primitive value")}return n}var Ba=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],th={era:Ao,eraYear:ue,year:ue,month:xc,monthCode:function(n){let t=Ue($a(n));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 new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:xc,hour:ue,minute:ue,second:ue,millisecond:ue,microsecond:ue,nanosecond:ue,offset:function(n){let t=Ue($a(n));return Lr(t),t},timeZone:vt},nh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},kr=[["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"]],Pc=Object.fromEntries(kr.map(n=>[n[0],n[1]])),rh=Object.fromEntries(kr.map(([n,t])=>[t,n])),si=kr.map(([,n])=>n),Tr={day:po,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},go=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],ih=Intl.DateTimeFormat,Rc=new Map;function _l(n){let t=vi(n),e=Rc.get(t);return e===void 0&&(e=new ih("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Rc.set(t,e)),e}function Ke(n){return bt(n,se)&&!bt(n,Ee,$)}function Oe(n){return bt(n,ct,lt,ut,dt,ht,mt,ft,pt,kt)}function Fe(n){return bt(n,sl)}function $e(n){return bt(n,Ye)}function xe(n){return bt(n,Ae)}function Ge(n){return bt(n,cl)}function Yt(n){return bt(n,ll)}function fe(n){return bt(n,se,Ee,$)}function x(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function Pr(n){if(bt(n,$)||bt(n,Ee))throw new TypeError("with() does not support a calendar or timeZone property");if($e(n))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(n.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(n.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Pi(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Lo(n){let t,e,r=!1;for(Mr.lastIndex=0;e=Mr.exec(n);){let{1:i,2:o,3:a}=e;if(o==="u-ca"){if(t===void 0)t=a,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${n}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${o}=${a}`)}return t}function mn(n){let t=zd.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Lo(t[16]),r=t[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);let i=+r,o=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=t[6]!==void 0,u=+(t[6]??0),l=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let f=(t[9]??t[12]??"")+"000000000",g=+f.slice(0,3),E=+f.slice(3,6),S=+f.slice(6,9),k,A=!1;t[13]?(k=void 0,A=!0):t[14]&&(k=t[14]);let B=t[15];return Ss(i,o,a,u,l,h,g,E,S),{year:i,month:o,day:a,time:s?{hour:u,minute:l,second:h,millisecond:g,microsecond:E,nanosecond:S}:"start-of-day",tzAnnotation:B,offset:k,z:A,calendar:e}}function Ml(n){let t=Ud.exec(n),e,r,i,o,a,s,u;if(t){u=Lo(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let l=(t[4]??t[7]??"")+"000000000";if(o=+l.slice(0,3),a=+l.slice(3,6),s=+l.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let l,h;if({time:l,z:h,calendar:u}=mn(n),l==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=l)}if(Yo(e,r,i,o,a,s),/[tT ][0-9][0-9]/.test(n))return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u};try{let{month:l,day:h}=Ds(n);tr(1972,l,h)}catch{try{let{year:l,month:h}=bs(n);tr(l,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function bs(n){let t=Vd.exec(n),e,r,i,o;if(t){i=Lo(t[3]);let a=t[1];if(a==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);if(e=+a,r=+t[2],o=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let a;if({year:e,month:r,calendar:i,day:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ds(n){let t=qd.exec(n),e,r,i,o;if(t){if(i=Lo(t[3]),e=+t[1],r=+t[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let a;if({month:e,day:r,calendar:i,year:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Sl=new RegExp(`^${xi.source}$`,"i"),kl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Tl(n){let t=ah.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function Fn(n){return Sl.test(n)||Tl(n),kl.test(n)?{offsetMinutes:Lr(n)/6e10}:{tzName:n}}function ci(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":tr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=Ul(i,o,a))}return{year:i,month:o,day:a}}function No(n,t,e,r,i,o,a){let s=n,u=t,l=e,h=r,f=i,g=o;switch(a){case"reject":Yo(s,u,l,h,f,g);break;case"constrain":s=gt(s,0,23),u=gt(u,0,59),l=gt(l,0,59),h=gt(h,0,999),f=gt(f,0,999),g=gt(g,0,999)}return{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}function Cl(n){if(!He(n))throw new 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},e=!1;for(let r=0;r<go.length;r++){let i=go[r],o=n[i];o!==void 0&&(e=!0,t[i]=Jt(o))}if(!e)throw new TypeError("invalid duration-like");return t}function et({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function be(n,t){return{isoDate:n,time:t}}function ye(n){return _n(n,"overflow",["constrain","reject"],"constrain")}function li(n){return _n(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function en(n,t){return _n(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function ho(n,t){return _n(n,"offset",["prefer","use","ignore","reject"],t)}function Ri(n){return _n(n,"calendarName",["auto","always","never","critical"],"auto")}function Rr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=ue(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Ar(n,t,e){let r=e?t:t-1;if(n>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${n}`);if(t%n!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function Ai(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(Ao(t)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}let e=Math.floor(t);if(!Number.isFinite(e)||e<0||e>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return e}function Li(n,t){switch(n){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 new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}var Sn=Symbol("~required~");function Ct(n,t,e,r,i=[]){let o=[];for(let l=0;l<kr.length;l++){let h=kr[l],f=h[1],g=h[2];e!=="datetime"&&e!==g||o.push(f)}o=o.concat(i);let a=r;a===Sn?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let l=0;l<o.length;l++){let h=o[l],f=rh[h];f!==void 0&&s.push(f)}let u=_n(n,t,s,a);if(u===void 0&&r===Sn)throw new RangeError(`${t} is required`);return u&&u in Pc?Pc[u]:u}function xa(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",u=!1;if(He(t)){if(fe(t))return{zonedRelativeTo:t};if(Fe(t))return{plainRelativeTo:t};if(xe(t))return{plainRelativeTo:yt(m(t,Ae).isoDate,m(t,$))};i=Hi(t);let l=zt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Oi(i,l,"constrain")),{offset:a,timeZone:o}=l,a===void 0&&(s="wall")}else{let l,h,f,g,E;if({year:f,month:g,day:E,time:r,calendar:i,tzAnnotation:l,offset:a,z:h}=mn(Ue(t)),l)o=vt(l),h?s="exact":a||(s="wall"),u=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=Dt(i),e={year:f,month:g,day:E}}return o===void 0?{plainRelativeTo:yt(e,i)}:{zonedRelativeTo:Qe(yo(e,r,s,s==="option"?Lr(a):0,o,"compatible","reject",u),o,i)}}function yn(n){return m(n,ct)!==0?"year":m(n,lt)!==0?"month":m(n,St)!==0?"week":m(n,ut)!==0?"day":m(n,dt)!==0?"hour":m(n,ht)!==0?"minute":m(n,mt)!==0?"second":m(n,ft)!==0?"millisecond":m(n,pt)!==0?"microsecond":"nanosecond"}function Dn(n,t){return si.indexOf(n)>si.indexOf(t)?t:n}function an(n){return n==="year"||n==="month"||n==="week"}function vn(n){return an(n)||n==="day"?"date":"time"}function jn(n){return Je("%calendarImpl%")(n)}function Ni(n){return Je("%calendarImpl%")(m(n,$))}function wt(n,t,e="date"){let r=Object.create(null),i=jn(n).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,e!=="month-day"&&e!=="date"||(r.day=i.day),e!=="year-month"&&e!=="date"||(r.year=i.year),r}function zt(n,t,e,r,i){let o=jn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),u=!1;a.sort();for(let l=0;l<a.length;l++){let h=a[l],f=t[h];if(f!==void 0)u=!0,s[h]=(0,th[h])(f);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=nh[h]}}if(i==="partial"&&!u)throw new TypeError("no supported properties found");return s}function ja(n,t="complete"){let e=["hour","microsecond","millisecond","minute","nanosecond","second"],r=!1,i=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],s=n[a];s!==void 0?(i[a]=ue(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function Qr(n,t){if(He(n)){if(Fe(n))return ye(te(t)),yt(m(n,ce),m(n,$));if(fe(n)){let u=Gt(m(n,Ee),m(n,se));return ye(te(t)),yt(u.isoDate,m(n,$))}if(xe(n))return ye(te(t)),yt(m(n,Ae).isoDate,m(n,$));let s=Hi(n);return yt($n(s,zt(s,n,["year","month","monthCode","day"],[],[]),ye(te(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=mn(Ue(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Dt(o),ye(te(t)),yt({year:e,month:r,day:i},o)}function Oi(n,t,e){return be($n(n,t,e),No(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function ei(n,t){let e,r,i;if(He(n)){if(xe(n))return ye(te(t)),qt(m(n,Ae),m(n,$));if(fe(n)){let s=Gt(m(n,Ee),m(n,se));return ye(te(t)),qt(s,m(n,$))}if(Fe(n))return ye(te(t)),qt(be(m(n,ce),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,$));i=Hi(n);let o=zt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=ye(te(t));({isoDate:e,time:r}=Oi(i,o,a))}else{let o,a,s,u;if({year:a,month:s,day:u,time:r,calendar:i,z:o}=mn(Ue(n)),o)throw new 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}),Ss(a,s,u,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Dt(i),ye(te(t)),e={year:a,month:s,day:u}}return qt(be(e,r),i)}function Kt(n){let t=Je("%Temporal.Duration%");if(Oe(n))return new t(m(n,ct),m(n,lt),m(n,St),m(n,ut),m(n,dt),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,kt));if(!He(n))return function(i){let{years:o,months:a,weeks:s,days:u,hours:l,minutes:h,seconds:f,milliseconds:g,microseconds:E,nanoseconds:S}=function(k){let A=Kd.exec(k);if(!A)throw new RangeError(`invalid duration: ${k}`);if(A.every((v,D)=>D<2||v===void 0))throw new RangeError(`invalid duration: ${k}`);let B=A[1]==="-"?-1:1,V=A[2]===void 0?0:ue(A[2])*B,G=A[3]===void 0?0:ue(A[3])*B,U=A[4]===void 0?0:ue(A[4])*B,J=A[5]===void 0?0:ue(A[5])*B,oe=A[6]===void 0?0:ue(A[6])*B,ke=A[7],Me=A[8],ie=A[9],N=A[10],Y=A[11],O=0,ne=0,y=0;if(ke!==void 0){if(Me??ie??N??Y)throw new RangeError("only the smallest unit can be fractional");y=3600*ue((ke+"000000000").slice(0,9))*B}else if(O=Me===void 0?0:ue(Me)*B,ie!==void 0){if(N??Y)throw new RangeError("only the smallest unit can be fractional");y=60*ue((ie+"000000000").slice(0,9))*B}else ne=N===void 0?0:ue(N)*B,Y!==void 0&&(y=ue((Y+"000000000").slice(0,9))*B);let L=y%1e3,c=Math.trunc(y/1e3)%1e3,d=Math.trunc(y/1e6)%1e3;return ne+=Math.trunc(y/1e9)%60,O+=Math.trunc(y/6e10),Ho(V,G,U,J,oe,O,ne,d,c,L),{years:V,months:G,weeks:U,days:J,hours:oe,minutes:O,seconds:ne,milliseconds:d,microseconds:c,nanoseconds:L}}(i);return new(Je("%Temporal.Duration%"))(o,a,s,u,l,h,f,g,E,S)}(Ue(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Cl(n);for(let i=0;i<go.length;i++){let o=go[i],a=r[o];a!==void 0&&(e[o]=a)}return new t(e.years,e.months,e.weeks,e.days,e.hours,e.minutes,e.seconds,e.milliseconds,e.microseconds,e.nanoseconds)}function ti(n){let t;if(He(n)){if(Ke(n)||fe(n))return Xt(m(n,se));t=$a(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(k){let A=mn(k);if(!A.z&&!A.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return A}(Ue(t)),{hour:u=0,minute:l=0,second:h=0,millisecond:f=0,microsecond:g=0,nanosecond:E=0}=o==="start-of-day"?{}:o,S=yi(e,r,i,u,l,h,f,g,E-(s?0:Lr(a)));return _r(S.isoDate),Xt(Ze(S))}function Ac(n,t){if(He(n)){if(Yt(n))return ye(te(t)),Dr(m(n,ce),m(n,$));let s;return bt(n,$)?s=m(n,$):(s=n.calendar,s===void 0&&(s="iso8601"),s=Yi(s)),Dr(vo(s,zt(s,n,["year","month","monthCode","day"],[],[]),ye(te(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ds(Ue(n));if(o===void 0&&(o="iso8601"),o=Dt(o),ye(te(t)),o==="iso8601")return Dr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return cr(a),a=vo(o,wt(o,a,"month-day"),"constrain"),Dr(a,o)}function Nn(n,t){let e;if(He(n)){if($e(n))return ye(te(t)),wn(m(n,Ye));if(xe(n))return ye(te(t)),wn(m(n,Ae).time);if(fe(n)){let l=Gt(m(n,Ee),m(n,se));return ye(te(t)),wn(l.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:u}=ja(n);e=No(r,i,o,a,s,u,ye(te(t)))}else e=Ml(Ue(n)),ye(te(t));return wn(e)}function Il(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Nn(n),Ye)}function ni(n,t){if(He(n)){if(Ge(n))return ye(te(t)),Er(m(n,ce),m(n,$));let s=Hi(n);return Er(fi(s,zt(s,n,["year","month","monthCode"],[],[]),ye(te(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=bs(Ue(n));o===void 0&&(o="iso8601"),o=Dt(o),ye(te(t));let a={year:e,month:r,day:i};return ks(a),a=fi(o,wt(o,a,"year-month"),"constrain"),Er(a,o)}function yo(n,t,e,r,i,o,a,s){if(t==="start-of-day")return An(i,n);let u=be(n,t);if(e==="wall"||a==="ignore")return tt(i,u,o);if(e==="exact"||a==="use"){let f=yi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);_r(f.isoDate);let g=Ze(f);return dn(g),g}_r(n);let l=Ze(u),h=pi(i,u);for(let f=0;f<h.length;f++){let g=h[f],E=T.default.toNumber(T.default.subtract(l,g)),S=On(E,6e10,"halfExpand");if(E===r||s&&S===r)return g}if(a==="reject"){let f=za(r),g=gi(u,"iso8601","auto");throw new RangeError(`Offset ${f} is invalid for ${g} in ${i}`)}return Yl(h,i,u,o)}function ri(n,t){let e,r,i,o,a,s,u,l=!1,h="option";if(He(n)){if(fe(n)){let k=te(t);return li(k),ho(k,"reject"),ye(k),Qe(m(n,se),m(n,Ee),m(n,$))}a=Hi(n);let g=zt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=g),o===void 0&&(h="wall");let E=te(t);s=li(E),u=ho(E,"reject");let S=ye(E);({isoDate:e,time:r}=Oi(a,g,S))}else{let g,E,S,k,A;({year:S,month:k,day:A,time:r,tzAnnotation:g,offset:o,z:E,calendar:a}=function(V){let G=mn(V);if(!G.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return G}(Ue(n))),i=vt(g),E?h="exact":o||(h="wall"),a||(a="iso8601"),a=Dt(a),l=!0;let B=te(t);s=li(B),u=ho(B,"reject"),ye(B),e={year:S,month:k,day:A}}let f=0;return h==="option"&&(f=Lr(o)),Qe(yo(e,r,h,f,i,s,u,l),i,a)}function xl(n,t,e){cr(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,sl,!0)}function yt(n,t){let e=Je("%Temporal.PlainDate%"),r=Object.create(e.prototype);return xl(r,n,t),r}function Pl(n,t,e){nr(t),Tn(n),me(n,Ae,t),me(n,$,e)}function qt(n,t){let e=Je("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return Pl(r,n,t),r}function Rl(n,t,e){cr(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,ll,!0)}function Dr(n,t){let e=Je("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return Rl(r,n,t),r}function Al(n,t){Tn(n),me(n,Ye,t)}function wn(n){let t=Je("%Temporal.PlainTime%"),e=Object.create(t.prototype);return Al(e,n),e}function Ll(n,t,e){ks(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,cl,!0)}function Er(n,t){let e=Je("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return Ll(r,n,t),r}function Nl(n,t){dn(t),Tn(n),me(n,se,t)}function Xt(n){let t=Je("%Temporal.Instant%"),e=Object.create(t.prototype);return Nl(e,n),e}function Ol(n,t,e,r){dn(t),Tn(n),me(n,se,t),me(n,Ee,e),me(n,$,r)}function Qe(n,t,e="iso8601"){let r=Je("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return Ol(i,n,t,e),i}function Lc(n){return Ba.filter(t=>n[t]!==void 0)}function er(n,t,e){let r=Lc(e),i=jn(n).fieldKeysToIgnore(r),o=Object.create(null),a=Lc(t);for(let s=0;s<Ba.length;s++){let u,l=Ba[s];a.includes(l)&&!i.includes(l)&&(u=t[l]),r.includes(l)&&(u=e[l]),u!==void 0&&(o[l]=u)}return o}function Bt(n,t,e,r){let i=jn(n).dateAdd(t,e,r);return cr(i),i}function Fi(n,t,e,r){return jn(n).dateUntil(t,e,r)}function Yi(n){if(He(n)&&bt(n,$))return m(n,$);let t=Ue(n);try{return Dt(t)}catch{}let e;try{({calendar:e}=mn(t))}catch{try{({calendar:e}=Ml(t))}catch{try{({calendar:e}=bs(t))}catch{({calendar:e}=Ds(t))}}}return e||(e="iso8601"),Dt(e)}function Hi(n){if(bt(n,$))return m(n,$);let{calendar:t}=n;return t===void 0?"iso8601":Yi(t)}function un(n,t){return Dt(n)===Dt(t)}function $n(n,t,e){let r=jn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return cr(i),i}function fi(n,t,e){let r=jn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return ks(i),i}function vo(n,t,e){let r=jn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return cr(i),i}function vt(n){if(He(n)&&fe(n))return m(n,Ee);let t=Ue(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:u}=function(l){if(Sl.test(l))return{tzAnnotation:l,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:f,z:g}=mn(l);if(g||h||f)return{tzAnnotation:h,offset:f,z:g}}catch{}Tl(l)}(o);return a?Fn(a):u?Fn("UTC"):s?Fn(s):void 0}(t);if(r!==void 0)return Es(r);let i=wo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function Fl(n,t){if(n===t)return!0;let e=Fn(n).offsetMinutes,r=Fn(t).offsetMinutes;if(e===void 0&&r===void 0){let i=wo(t);if(!i)return!1;let o=wo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function bn(n,t){let e=Fn(n).offsetMinutes;return e!==void 0?6e10*e:Ua(n,t)}function za(n){let t=n<0?"-":"+",e=Math.abs(n),r=Math.floor(e/36e11),i=Math.floor(e/6e10)%60,o=Math.floor(e/1e9)%60,a=e%1e9;return`${t}${Oo(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function Gt(n,t){let e=bn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:u,millisecond:l,microsecond:h,nanosecond:f}}=Bl(t);return yi(r,i,o,a,s,u,l,h,f+e)}function tt(n,t,e){return Yl(pi(n,t),n,t,e)}function Yl(n,t,e,r){let i=n.length;if(i===1)return n[0];if(i)switch(r){case"compatible":case"earlier":return n[0];case"later":return n[i-1];case"reject":throw new RangeError("multiple instants found")}if(r==="reject")throw new RangeError("multiple instants found");let o=Ze(e),a=T.default.subtract(o,Yn);dn(a);let s=bn(t,a),u=T.default.add(o,Yn);dn(u);let l=bn(t,u)-s;switch(r){case"earlier":{let h=Se.fromComponents(0,0,0,0,0,-l),f=Cr(e.time,h);return pi(t,be(It(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f))[0]}case"compatible":case"later":{let h=Se.fromComponents(0,0,0,0,0,l),f=Cr(e.time,h),g=pi(t,be(It(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f));return g[g.length-1]}}}function pi(n,t){if(n==="UTC")return _r(t.isoDate),[Ze(t)];let e=Fn(n).offsetMinutes;if(e!==void 0){let r=yi(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-e,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);_r(r.isoDate);let i=Ze(r);return dn(i),[i]}return _r(t.isoDate),function(r,i){let o=Ze(i),a=T.default.subtract(o,Yn);T.default.lessThan(a,hi)&&(a=o);let s=T.default.add(o,Yn);T.default.greaterThan(s,Sr)&&(s=o);let u=Ua(r,a),l=Ua(r,s);return(u===l?[u]:[u,l]).map(f=>{let g=T.default.subtract(o,T.default.BigInt(f)),E=function(S,k){let{epochMilliseconds:A,time:{millisecond:B,microsecond:V,nanosecond:G}}=Bl(k),{year:U,month:J,day:oe,hour:ke,minute:Me,second:ie}=jl(S,A);return yi(U,J,oe,ke,Me,ie,B,V,G)}(r,g);if(Ir(i,E)===0)return dn(g),g}).filter(f=>f!==void 0)}(n,t)}function An(n,t){let e=be(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=pi(n,e);if(r.length)return r[0];let i=Ze(e),o=T.default.subtract(i,Yn);return dn(o),Ms(n,o)}function $i(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+mi(Math.abs(n),6):mi(n,4),t}function jt(n){return mi(n,2)}function Hl(n,t){let e;if(t==="auto"){if(n===0)return"";e=mi(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=mi(n,9).slice(0,t)}return`.${e}`}function Oo(n,t,e,r,i){let o=`${jt(n)}:${jt(t)}`;return i==="minute"||(o+=`:${jt(e)}`,o+=Hl(r,i)),o}function Nc(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,se),o=gi(Gt(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=$l(bn(r,i))),`${o}${a}`}function uo(n,t){let e=m(n,ct),r=m(n,lt),i=m(n,St),o=m(n,ut),a=m(n,dt),s=m(n,ht),u=Do(n),l="";e!==0&&(l+=`${Math.abs(e)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),o!==0&&(l+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let f=Se.fromComponents(0,0,m(n,mt),m(n,ft),m(n,pt),m(n,kt));f.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(yn(n))&&t==="auto"||(h+=`${Math.abs(f.sec)}${Hl(Math.abs(f.subsec),t)}S`);let g=`${u<0?"-":""}P${l}`;return h&&(g=`${g}T${h}`),g}function Oc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce);return`${$i(e)}-${jt(r)}-${jt(i)}${Pi(m(n,$),t)}`}function Fc({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return Oo(n,t,e,1e6*r+1e3*i+o,a)}function gi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}=n;return`${$i(i)}-${jt(o)}-${jt(a)}T${Oo(s,u,l,1e6*h+1e3*f+g,e)}${Pi(t,r)}`}function Yc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${jt(r)}-${jt(i)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${$i(e)}-${o}`);let s=Pi(a,t);return s&&(o+=s),o}function Hc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${$i(e)}-${jt(r)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${jt(i)}`);let s=Pi(a,t);return s&&(o+=s),o}function $c(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,se);if(o){let{unit:h,increment:f,roundingMode:g}=o;a=Ka(a,f,h,g)}let s=m(n,Ee),u=bn(s,a),l=gi(Gt(s,a),"iso8601",t,"never");return i!=="never"&&(l+=$l(u)),r!=="never"&&(l+=`[${r==="critical"?"!":""}${s}]`),l+=Pi(m(n,$),e),l}function Bc(n){return kl.test(n)}function Lr(n){let t=sh.exec(n);if(!t)throw new RangeError(`invalid time zone offset: ${n}; must match \xB1HH: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))}var Kr,oh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function wo(n){if(Kr===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){Kr=new Map;for(let a=0;a<o.length;a++){let s=o[a];Kr.set(vi(s),s)}}else Kr=null}let t=vi(n),e=Kr?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=_l(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),eh.has(n))throw new RangeError(`${n} is a legacy time zone identifier from ICU. Use ${e} instead`);let r=[...t].map((o,a)=>a===0||oh[t[a-1]]?o.toUpperCase():o).join("").split("/");if(r.length===1)return t==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:e}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:e};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:e};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:e};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:e}}function Xn(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=jl(n,t),u=t%1e3;return u<0&&(u+=1e3),1e6*(_s({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:u}})-t)}function Ua(n,t){return Xn(n,Zt(t,"floor"))}function Es(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${Oo(Math.floor(e/60),e%60,0,0,"minute")}`}function $l(n){return Es(On(n,Gd,"halfExpand")/6e10)}function _s({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,u=(n-s)/400,l=new Date;return l.setUTCHours(r,i,o,a),l.setUTCFullYear(s,t-1,e),l.getTime()+Xd*u}function Ze(n){let t=_s(n),e=1e3*n.time.microsecond+n.time.nanosecond;return T.default.add(Qt(t),T.default.BigInt(e))}function Bl(n){let t=Zt(n,"trunc"),e=T.default.toNumber(T.default.remainder(n,Ii));e<0&&(e+=1e6,t-=1);let r=Math.floor(e/1e3)%1e3,i=e%1e3,o=new Date(t);return{epochMilliseconds:t,isoDate:{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()},time:{hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function Ms(n,t){if(n==="UTC")return null;let e=Zt(t,"floor");if(e<ai)return Ms(n,Qt(ai));let r=Date.now(),i=Math.max(e,r)+366*Hn*3,o=e,a=Xn(n,o),s=o,u=a;for(;a===u&&o<i;){if(s=o+2*Hn*7,s>El)return null;u=Xn(n,s),a===u&&(o=s)}return a===u?null:Qt(Xl(l=>Xn(n,l),o,s,a,u))}function Va(n,t){if(n==="UTC")return null;let e=Zt(t,"ceil"),r=Date.now(),i=r+366*Hn*3;if(e>i){let l=Va(n,Qt(i));if(l===null||T.default.lessThan(l,Qt(r)))return l}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let l=Date.UTC(2088,0,1);if(l<e)return Va(n,Qt(l))}let o=e-1;if(o<ai)return null;let a=Xn(n,o),s=o,u=a;for(;a===u&&o>ai;){if(s=o-2*Hn*7,s<ai)return null;u=Xn(n,s),a===u&&(o=s)}return a===u?null:Qt(Xl(l=>Xn(n,l),s,o,u,a))}function jl(n,t){return function(e){let r=e.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${e}`);let i=+r[0],o=+r[1],a=+r[2],s=r[3];if(s[0]==="b"||s[0]==="B")a=1-a;else if(s[0]!=="a"&&s[0]!=="A")throw new RangeError(`Unknown era ${s} in "${e}`);let u=r[4]==="24"?0:+r[4],l=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(u)&&Number.isFinite(l)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:u,minute:l,second:h}}(_l(n).format(t))}function bo(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function Qn(n,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]}[bo(n)?"leapyear":"standard"][t-1]}function Do(n){let t=[m(n,ct),m(n,lt),m(n,St),m(n,ut),m(n,dt),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,kt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Fo(n){let t=["years","months","weeks","days"];for(let e=0;e<t.length;e++){let r=n[t[e]];if(r!==0)return r<0?-1:1}return 0}function zl(n){let t=Fo(n.date);return t!==0?t:n.time.sign()}function Jn(n,t){let e=n,r=t;if(!Number.isFinite(e)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,e+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:e,month:r}}function It(n,t,e){let r=n,i=t,o=e;if(!Number.isFinite(o))throw new RangeError("infinity is out of range");({year:r,month:i}=Jn(r,i));let a=146097;if(Math.abs(o)>a){let l=Math.trunc(o/a);r+=400*l,o-=l*a}let s=0,u=i>2?r:r-1;for(;s=bo(u)?366:365,o<-s;)r-=1,u-=1,o+=s;for(u+=1;s=bo(u)?366:365,o>s;)r+=1,u+=1,o-=s;for(;o<1;)({year:r,month:i}=Jn(r,i-1)),o+=Qn(r,i);for(;o>Qn(r,i);)o-=Qn(r,i),{year:r,month:i}=Jn(r,i+1);return{year:r,month:i,day:o}}function yi(n,t,e,r,i,o,a,s,u){let l=Ln(r,i,o,a,s,u);return be(It(n,t,e+l.deltaDays),l)}function Ln(n,t,e,r,i,o){let a,s=n,u=t,l=e,h=r,f=i,g=o;({div:a,mod:g}=br(g,3)),f+=a,g<0&&(f-=1,g+=1e3),{div:a,mod:f}=br(f,3),h+=a,f<0&&(h-=1,f+=1e3),l+=Math.trunc(h/1e3),h%=1e3,h<0&&(l-=1,h+=1e3),u+=Math.trunc(l/60),l%=60,l<0&&(u-=1,l+=60),s+=Math.trunc(u/60),u%=60,u<0&&(s-=1,u+=60);let E=Math.trunc(s/24);return s%=24,s<0&&(E-=1,s+=24),E+=0,s+=0,u+=0,l+=0,h+=0,f+=0,g+=0,{deltaDays:E,hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}function jc(n,t){let e=et(n,0);if(Fo(e)===0)return n.days;let r=m(t,ce),i=Bt(m(t,$),r,e,"constrain"),o=rr(r.year,r.month-1,r.day),a=rr(i.year,i.month-1,i.day)-o;return n.days+a}function xt(n){return new(Je("%Temporal.Duration%"))(-m(n,ct),-m(n,lt),-m(n,St),-m(n,ut),-m(n,dt),-m(n,ht),-m(n,mt),-m(n,ft),-m(n,pt),-m(n,kt))}function gt(n,t,e){return Math.min(e,Math.max(t,n))}function Ul(n,t,e){let r=gt(t,1,12);return{year:n,month:r,day:gt(e,1,Qn(n,r))}}function Ve(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function tr(n,t,e){Ve(t,1,12),Ve(e,1,Qn(n,t))}function cr(n){nr(be(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Yo(n,t,e,r,i,o){Ve(n,0,23),Ve(t,0,59),Ve(e,0,59),Ve(r,0,999),Ve(i,0,999),Ve(o,0,999)}function Ss(n,t,e,r,i,o,a,s,u){tr(n,t,e),Yo(r,i,o,a,s,u)}function nr(n){let t=Ze(n);(T.default.lessThan(t,Zd)||T.default.greaterThan(t,Jd))&&dn(t)}function qa(n){Ze(n)}function dn(n){if(T.default.lessThan(n,hi)||T.default.greaterThan(n,Sr))throw new RangeError("date/time value is outside of supported range")}function ks({year:n,month:t}){Ve(n,Cc,Ic),n===Cc?Ve(t,4,12):n===Ic&&Ve(t,1,9)}function Ho(n,t,e,r,i,o,a,s,u,l){let h=0,f=[n,t,e,r,i,o,a,s,u,l];for(let B=0;B<f.length;B++){let V=f[B];if(V===1/0||V===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(V!==0){let G=V<0?-1:1;if(h!==0&&G!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=G}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let g=br(s,3),E=br(u,6),S=br(l,9),k=br(1e6*g.mod+1e3*E.mod+S.mod,9).div,A=86400*r+3600*i+60*o+a+g.div+E.div+S.div+k;if(!Number.isSafeInteger(A))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function wr(n){return{date:{years:m(n,ct),months:m(n,lt),weeks:m(n,St),days:m(n,ut)},time:Se.fromComponents(m(n,dt),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,kt))}}function cn(n){let t=Se.fromComponents(m(n,dt),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,kt)).add24HourDays(m(n,ut));return{date:{years:m(n,ct),months:m(n,lt),weeks:m(n,St),days:0},time:t}}function Vl(n){let t=cn(n),e=Math.trunc(t.time.sec/86400);return Ho(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function Wt(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,u=0,l=0;switch(t){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60,l=Math.trunc(u/24),u%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,o=Ca(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Ca(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Ca(a,9,r),a=0}return new(Je("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*l,e*u,e*s,e*a,e*o,e*i,e*r)}function En(n,t){return Fo(n),t.sign(),{date:n,time:t}}function rr(n,t,e){return _s({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Hn}function _r({year:n,month:t,day:e}){if(Math.abs(rr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Ts(n,t){let e=t.hour-n.hour,r=t.minute-n.minute,i=t.second-n.second,o=t.millisecond-n.millisecond,a=t.microsecond-n.microsecond,s=t.nanosecond-n.nanosecond;return Se.fromComponents(e,r,i,o,a,s)}function Cs(n,t,e,r,i){let o=Se.fromEpochNsDiff(t,n);return o=Eo(o,e,r,i),En({years:0,months:0,weeks:0,days:0},o)}function ql(n,t,e,r){qa(n),qa(t);let i=Ts(n.time,t.time),o=i.sign(),a=hn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=It(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let u=Dn("day",r),l=Fi(e,n.isoDate,s,u);return r!==u&&(i=i.add24HourDays(l.days),l.days=0),En(l,i)}function Wl(n,t,e,r,i){let o=T.default.subtract(t,n);if(T.default.equal(o,Ht))return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};let a=T.default.lessThan(o,Ht)?-1:1,s=Gt(e,n),u=Gt(e,t),l,h=0,f=a===1?2:1,g=Ts(s.time,u.time);for(g.sign()===-a&&h++;h<=f;h++){l=be(It(u.isoDate.year,u.isoDate.month,u.isoDate.day-h*a),s.time);let S=tt(e,l,"compatible");if(g=Se.fromEpochNsDiff(t,S),g.sign()!==-a)break}let E=Dn("day",i);return En(Fi(r,s.isoDate,l.isoDate,E),g)}function Kl(n,t,e,r,i,o,a,s,u){let l,h,f,g,E=t;switch(s){case"year":{let O=On(E.date.years,a,"trunc");l=O,h=O+a*n,f={years:l,months:0,weeks:0,days:0},g={...f,years:h};break}case"month":{let O=On(E.date.months,a,"trunc");l=O,h=O+a*n,f=et(E.date,0,0,l),g=et(E.date,0,0,h);break}case"week":{let O=et(E.date,0,0),ne=Bt(o,r.isoDate,O,"constrain"),y=Fi(o,ne,It(ne.year,ne.month,ne.day+E.date.days),"week"),L=On(E.date.weeks+y.weeks,a,"trunc");l=L,h=L+a*n,f=et(E.date,0,l),g=et(E.date,0,h);break}case"day":{let O=On(E.date.days,a,"trunc");l=O,h=O+a*n,f=et(E.date,l),g=et(E.date,h);break}}let S=Bt(o,r.isoDate,f,"constrain"),k=Bt(o,r.isoDate,g,"constrain"),A,B,V=be(S,r.time),G=be(k,r.time);i?(A=tt(i,V,"compatible"),B=tt(i,G,"compatible")):(A=Ze(V),B=Ze(G));let U=Se.fromEpochNsDiff(e,A),J=Se.fromEpochNsDiff(B,A),oe=xo(u,n<0?"negative":"positive"),ke=U.add(U).abs().subtract(J.abs()).sign(),Me=Math.abs(l)/a%2==0,ie=U.isZero()?Math.abs(l):U.cmp(J)?Po(Math.abs(l),Math.abs(h),ke,Me,oe):Math.abs(h),N=new Se(T.default.add(T.default.multiply(J.totalNs,T.default.BigInt(l)),T.default.multiply(U.totalNs,T.default.BigInt(a*n)))).fdiv(J.totalNs),Y=ie===Math.abs(h);return E={date:Y?g:f,time:Se.ZERO},{nudgeResult:{duration:E,nudgedEpochNs:Y?B:A,didExpandCalendarUnit:Y},total:N}}function $o(n,t,e,r,i,o,a,s,u){let l=n,h=an(s)||r&&s==="day",f=zl(l)<0?-1:1,g;return h?{nudgeResult:g}=Kl(f,l,t,e,r,i,a,s,u):g=r?function(E,S,k,A,B,V,G,U){let J=S,oe=Bt(B,k.isoDate,J.date,"constrain"),ke=be(oe,k.time),Me=be(It(oe.year,oe.month,oe.day+E),k.time),ie=tt(A,ke,"compatible"),N=tt(A,Me,"compatible"),Y=Se.fromEpochNsDiff(N,ie);if(Y.sign()!==E)throw new RangeError("time zone returned inconsistent Instants");let O=T.default.BigInt(Tr[G]*V),ne=J.time.round(O,U),y=ne.subtract(Y),L=y.sign()!==-E,c,d;return L?(c=E,ne=y.round(O,U),d=ne.addToEpochNs(N)):(c=0,d=ne.addToEpochNs(ie)),{duration:En(et(J.date,J.date.days+c),ne),nudgedEpochNs:d,didExpandCalendarUnit:L}}(f,l,e,r,i,a,s,u):function(E,S,k,A,B,V){let G=E,U=G.time.add24HourDays(G.date.days),J=U.round(T.default.BigInt(A*Tr[B]),V),oe=J.subtract(U),{quotient:ke}=U.divmod(po),{quotient:Me}=J.divmod(po),ie=Math.sign(Me-ke)===U.sign(),N=oe.addToEpochNs(S),Y=0,O=J;return vn(k)==="date"&&(Y=Me,O=J.add(Se.fromComponents(24*-Me,0,0,0,0,0))),{duration:{date:et(G.date,Y),time:O},nudgedEpochNs:N,didExpandCalendarUnit:ie}}(l,t,o,a,s,u),l=g.duration,g.didExpandCalendarUnit&&s!=="week"&&(l=function(E,S,k,A,B,V,G,U){let J=S;if(U===G)return J;let oe=si.indexOf(G);for(let ke=si.indexOf(U)-1;ke>=oe;ke--){let Me=si[ke];if(Me==="week"&&G!=="week")continue;let ie;switch(Me){case"year":ie={years:J.date.years+E,months:0,weeks:0,days:0};break;case"month":{let O=J.date.months+E;ie=et(J.date,0,0,O);break}case"week":{let O=J.date.weeks+E;ie=et(J.date,0,O);break}}let N=be(Bt(V,A.isoDate,ie,"constrain"),A.time),Y;if(Y=B?tt(B,N,"compatible"):Ze(N),mo(k,Y)===-E)break;J={date:ie,time:Se.ZERO}}return J}(f,l,g.nudgedEpochNs,e,r,i,o,Dn(s,"day"))),l}function zc(n,t,e,r,i,o){return an(o)||r&&o==="day"?Kl(zl(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:ui(n.time.add24HourDays(n.date.days),o)}function Gl(n,t,e,r,i,o,a){if(Ir(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};nr(n),nr(t);let s=ql(n,t,e,r);return o==="nanosecond"&&i===1?s:$o(s,Ze(t),n,null,e,r,i,o,a)}function Zl(n,t,e,r,i,o,a,s){if(vn(i)==="time")return Cs(n,t,o,a,s);let u=Wl(n,t,e,r,i);return a==="nanosecond"&&o===1?u:$o(u,t,Gt(e,n),e,r,i,o,a,s)}function Nr(n,t,e,r,i,o){let a=kr.reduce((E,S)=>{let k=S[0],A=S[1],B=S[2];return e!=="datetime"&&B!==e||r.includes(A)||E.push(A,k),E},[]),s=Ct(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let u=Rr(t),l=en(t,"trunc");n==="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 h=Ct(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let f=Dn(o,h);if(s==="auto"&&(s=f),Dn(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let g={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return g!==void 0&&Ar(u,g,!1),{largestUnit:s,roundingIncrement:u,roundingMode:l,smallestUnit:h}}function Uc(n,t,e,r){let i=ti(e),o=Nr(n,te(r),"time",[],"nanosecond","second"),a=Wt(Cs(m(t,se),m(i,se),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=xt(a)),a}function Vc(n,t,e,r){let i=Qr(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",[],"day","day"),u=Je("%Temporal.Duration%"),l=m(t,ce),h=m(i,ce);if(hn(l,h)===0)return new u;let f={date:Fi(o,l,h,s.largestUnit),time:Se.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let E=be(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});f=$o(f,Ze(be(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),E,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let g=Wt(f,"day");return n==="since"&&(g=xt(g)),g}function qc(n,t,e,r){let i=ei(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","day"),u=Je("%Temporal.Duration%"),l=m(t,Ae),h=m(i,Ae);if(Ir(l,h)===0)return new u;let f=Wt(Gl(l,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(f=xt(f)),f}function Wc(n,t,e,r){let i=Nn(e),o=Nr(n,te(r),"time",[],"nanosecond","hour"),a=Ts(m(t,Ye),m(i,Ye));a=Eo(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=Wt(En({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=xt(s)),s}function Kc(n,t,e,r){let i=ni(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",["week","day"],"month","year"),u=Je("%Temporal.Duration%");if(hn(m(t,ce),m(i,ce))==0)return new u;let l=wt(o,m(t,ce),"year-month");l.day=1;let h=$n(o,l,"constrain"),f=wt(o,m(i,ce),"year-month");f.day=1;let g=$n(o,f,"constrain"),E={date:et(Fi(o,h,g,s.largestUnit),0,0),time:Se.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let k=be(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});E=$o(E,Ze(be(g,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),k,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let S=Wt(E,"day");return n==="since"&&(S=xt(S)),S}function Gc(n,t,e,r){let i=ri(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","hour"),u=m(t,se),l=m(i,se),h=Je("%Temporal.Duration%"),f;if(vn(s.largestUnit)!=="date")f=Wt(Cs(u,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let g=m(t,Ee);if(!Fl(g,m(i,Ee)))throw new 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(T.default.equal(u,l))return new h;f=Wt(Zl(u,l,g,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(f=xt(f)),f}function Cr({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,u=o;return s+=a.sec,u+=a.subsec,Ln(n,t,s,r,i,u)}function Wa(n,t){let e=t.addToEpochNs(n);return dn(e),e}function ii(n,t,e,r,i="constrain"){if(Fo(r.date)===0)return Wa(n,r.time);let o=Gt(t,n);return Wa(tt(t,be(Bt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function Zc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=Dn(yn(t),yn(r));if(an(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=cn(t),a=cn(r);return Wt(En({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function Jc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=yn(r);if(vn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=cn(r);return Xt(Wa(m(t,se),o.time))}function Xc(n,t,e,r){let i=m(t,$),o=Kt(e);n==="subtract"&&(o=xt(o));let a=Vl(o),s=ye(te(r));return yt(Bt(i,m(t,ce),a,s),i)}function Qc(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ye(te(r)),a=m(t,$),s=cn(i),u=m(t,Ae),l=Cr(u.time,s.time),h=et(s.date,l.deltaDays);return Ho(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),qt(be(Bt(a,u.isoDate,h,o),l),a)}function el(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=cn(r),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Cr(m(t,Ye),i.time);return wn(No(o,a,s,u,l,h,"reject"))}function tl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ye(te(r)),a=Do(i),s=m(t,$),u=wt(s,m(t,ce),"year-month");u.day=1;let l=$n(s,u,"constrain");if(a<0){let f=Bt(s,l,{months:1},"constrain");l=It(f.year,f.month,f.day-1)}let h=Vl(i);return cr(l),Er(fi(s,wt(s,Bt(s,l,h,o),"year-month"),o),s)}function nl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ye(te(r)),a=m(t,Ee),s=m(t,$),u=wr(i);return Qe(ii(m(t,se),a,s,u,o),a,s)}function On(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,u=Tt(Math.abs(2*i)-t),l=a%2==0,h=xo(e,o),f=i===0?a:Po(a,s,u,l,h);return t*(o==="positive"?f:-f)}function Ka(n,t,e,r){let i=Tr[e]*t;return function(o,a,s){let u=gn(o),l=gn(a),h=T.default.divide(u,l),f=T.default.remainder(u,l),g=xo(s,"positive"),E,S;T.default.lessThan(u,Ht)?(E=T.default.subtract(h,di),S=h):(E=h,S=T.default.add(h,di));let k=mo(Zn(T.default.multiply(f,ws)),l)*(T.default.lessThan(u,Ht)?-1:1)+0,A=T.default.equal(f,Ht)?h:Po(E,S,k,al(E),g);return T.default.multiply(A,l)}(n,T.default.BigInt(i),r)}function Ga(n,t,e,r){qa(n);let{year:i,month:o,day:a}=n.isoDate,s=Za(n.time,t,e,r);return be(It(i,o,a+s.deltaDays),s)}function Za({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,u){let l;switch(s){case"day":case"hour":l=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":l=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":l=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":l=1e3*(1e3*r+i)+o;break;case"microsecond":l=1e3*i+o;break;case"nanosecond":l=o}let h=Tr[s],f=On(l,h*a,u)/h;switch(s){case"day":return{deltaDays:f,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return Ln(f,0,0,0,0,0);case"minute":return Ln(n,f,0,0,0,0);case"second":return Ln(n,t,f,0,0,0);case"millisecond":return Ln(n,t,e,f,0,0);case"microsecond":return Ln(n,t,e,r,f,0);case"nanosecond":return Ln(n,t,e,r,i,f);default:throw new Error(`Invalid unit ${s}`)}}function Eo(n,t,e,r){let i=Tr[e];return n.round(T.default.BigInt(i*t),r)}function ui(n,t){let e=Tr[t];return n.fdiv(T.default.BigInt(e))}function hn(n,t){return n.year!==t.year?Tt(n.year-t.year):n.month!==t.month?Tt(n.month-t.month):n.day!==t.day?Tt(n.day-t.day):0}function Ja(n,t){return n.hour!==t.hour?Tt(n.hour-t.hour):n.minute!==t.minute?Tt(n.minute-t.minute):n.second!==t.second?Tt(n.second-t.second):n.millisecond!==t.millisecond?Tt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Tt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Tt(n.nanosecond-t.nanosecond):0}function Ir(n,t){let e=hn(n.isoDate,t.isoDate);return e!==0?e:Ja(n.time,t.time)}function Jl(n){let t=_o(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function Zt(n,t){let e=gn(n),{quotient:r,remainder:i}=Jr(e,Ii),o=T.default.toNumber(r);return t==="floor"&&T.default.toNumber(i)<0&&(o-=1),t==="ceil"&&T.default.toNumber(i)>0&&(o+=1),o}function Qt(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return T.default.multiply(T.default.BigInt(n),Ii)}function _o(n){let t=n;if(typeof n=="object"){let e=n[Symbol.toPrimitive];e&&typeof e=="function"&&(t=e.call(n,"number"))}if(typeof t=="number")throw new TypeError("cannot convert number to bigint");return typeof t=="bigint"?T.default.BigInt(t.toString(10)):T.default.BigInt(t)}var Xa=(()=>{let n=T.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=T.default.BigInt(t),r=T.default.add(Qt(t),n);return n=T.default.remainder(e,Ii),T.default.greaterThan(r,Sr)?Sr:T.default.lessThan(r,hi)?hi:r}})();function Gr(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Tt(n){return n<0?-1:n>0?1:n}function te(n){if(n===void 0)return Object.create(null);if(He(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function ir(n,t){let e=Object.create(null);return e[n]=t,e}function _n(n,t,e,r){let i=n[t];if(i!==void 0){if(i=Ao(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Sn)throw new RangeError(`${t} option is required`);return r}function Dt(n){let t=vi(n);if(!Qd.includes(vi(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function vi(n){let t="";for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function zn(n){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${n==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${n}.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.`)}var ah=new RegExp(`^${bl.source}$`),sh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Xl(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,u=i;for(;a-o>1;){let l=Math.trunc((o+a)/2),h=n(l);h===s?(o=l,s=h):h===u&&(a=l,u=h)}return a}function Ql(n){return[...n]}function eu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=Bi[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),u=e.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,h=(i-o+7001-s)%7,f=Math.floor((o-1+h)/7);if(7-h>=u&&++f,f==0)f=function(g,E,S,k){let A=(k-g-S+1)%7;A<0&&(A+=7);let B=Math.floor((S+A-1)/7);return 7-A>=E&&++B,B}(s,u,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let g=(l+a-o)%7;g<0&&(g+=7),6-g>=u&&o+7-l>a&&(f=1,r++)}return{week:f,year:r}}function rl(n,t,e,r,i){if(t!==i.year){if(n*(t-i.year)>0)return!0}else if(e!==i.month){if(n*(e-i.month)>0)return!0}else if(r!==i.day&&n*(r-i.day)>0)return!0;return!1}var Bi={};function or(n){if(!n.startsWith("M"))throw new RangeError(`Invalid month code: ${n}. Month codes must start with M.`);let t=+n.slice(1);if(Number.isNaN(t))throw new RangeError(`Invalid month code: ${n}`);return t}function ln(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Is(n,t=void 0,e=12){let{month:r,monthCode:i}=n;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");t==="reject"&&Ve(r,1,e),t==="constrain"&&(r=gt(r,1,e)),i=ln(r)}else{let o=or(i);if(i!==ln(o))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==o)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=o,r<1||r>e)throw new RangeError(`Invalid monthCode: ${i}`)}return{...n,month:r,monthCode:i}}Bi.iso8601={resolveFields(n,t){if((t==="date"||t==="year-month")&&n.year===void 0)throw new TypeError("year is required");if((t==="date"||t==="month-day")&&n.day===void 0)throw new TypeError("day is required");Object.assign(n,Is(n))},dateToISO:(n,t)=>ci(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=ci(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return Ql(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:u}=n;return a+=t,s+=e,{year:a,month:s}=Jn(a,s),{year:a,month:s,day:u}=ci(a,s,u,o),u+=i+7*r,It(a,s,u)},dateUntil(n,t,e){let r=-hn(n,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,o=0,a=0;if(e==="year"||e==="month"){let h=t.year-n.year;for(h!==0&&(h-=r);!rl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let f=r;for(i=Jn(n.year+o,n.month+f);!rl(r,i.year,i.month,n.day,t);)a=f,f+=r,i=Jn(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=Jn(n.year+o,n.month+a);let s=Ul(i.year,i.month,n.day),u=0,l=rr(t.year,t.month-1,t.day)-rr(s.year,s.month-1,s.day);return e==="week"&&(u=Math.trunc(l/7),l%=7),{years:o,months:a,weeks:u,days:l}},isoToDate({year:n,month:t,day:e},r){let i={era:void 0,eraYear:void 0,year:n,month:t,day:e,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=ln(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),u=a-100*s,l=(e+Math.floor(2.6*o-.2)+(u+Math.floor(u/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=l+(l<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=Qn(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=eu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=Qn(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=bo(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Ft=class n{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let e=0;for(let r of t.map.entries()){if(++e>n.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(t){let e=this.map.get(t);return e&&(this.hits++,this.report()),this.calls++,e}set(t,e){this.map.set(t,e),this.misses++,this.report()}report(){}setObject(t){if(n.objectMap.get(t))throw new RangeError("object already cached");n.objectMap.set(t,this),this.report()}static getCacheForObject(t){let e=n.objectMap.get(t);return e||(e=new n,n.objectMap.set(t,e)),e}};function tu({isoYear:n,isoMonth:t,isoDay:e}){return`${$i(n)}-${jt(t)}-${jt(e)}T00:00Z`}function Pa(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Ft.objectMap=new WeakMap,Ft.MAX_CACHE_ENTRIES=1e3;var kn=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(t){let e=this.getFormatter(),r=new Date(t);if(t==="-271821-04-19T00:00Z"){let i=e.resolvedOptions();e=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return e.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${t}`)}}isoToCalendarDate(t,e){let{year:r,month:i,day:o}=t,a=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:o,id:this.id}),s=e.get(a);if(s)return s;let u=tu({isoYear:r,isoMonth:i,isoDay:o}),l=this.getCalendarParts(u),h={};for(let g=0;g<l.length;g++){let{type:E,value:S}=l[g];if(E!=="year"&&E!=="relatedYear"||(this.hasEra?h.eraYear=+S:h.year=+S),E==="month"){let k=/^([0-9]*)(.*?)$/.exec(S);if(!k||k.length!=3||!k[1]&&!k[2])throw new RangeError(`Unexpected month: ${S}`);if(h.month=k[1]?+k[1]:1,h.month<1)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);k[2]&&(h.monthExtra=k[2])}E==="day"&&(h.day=+S),this.hasEra&&E==="era"&&S!=null&&S!==""&&(h.era=S.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&h.eraYear===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let g=this.eras.find(E=>h.era===E.genericName);g&&(h.era=g.code)}if(this.reviseIntlEra){let{era:g,eraYear:E}=this.reviseIntlEra(h,t);h.era=g,h.eraYear=E}this.checkIcuBugs&&this.checkIcuBugs(t);let f=this.adjustCalendarDate(h,e,"constrain",!0);if(f.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(f.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(f.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,f),["constrain","reject"].forEach(g=>{let E=JSON.stringify({func:"calendarToIsoDate",year:f.year,month:f.month,day:f.day,overflow:g,id:this.id});e.set(E,t)}),f}validateCalendarDate(t){let{month:e,year:r,day:i,eraYear:o,monthCode:a,monthExtra:s}=t;if(s!==void 0)throw new RangeError("Unexpected `monthExtra` value");if(r===void 0&&o===void 0)throw new TypeError("year or eraYear is required");if(e===void 0&&a===void 0)throw new TypeError("month or monthCode is required");if(i===void 0)throw new RangeError("Missing day");if(a!==void 0){if(typeof a!="string")throw new RangeError("monthCode must be a string, not "+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw new RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&t.era===void 0!=(t.eraYear===void 0))throw new TypeError("properties era and eraYear must be provided together")}adjustCalendarDate(t,e=void 0,r="constrain",i=!1){if(this.calendarType==="lunisolar")throw new RangeError("Override required for lunisolar calendars");let o=t;this.validateCalendarDate(o);let a=this.monthsInYear(o,e),{month:s,monthCode:u}=o;return{month:s,monthCode:u}=Is(o,r,a),{...o,month:s,monthCode:u}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(Ve(o,1,i),Ve(a,1,this.maximumMonthLength(t))):(o=gt(o,1,i),a=gt(a,1,this.maximumMonthLength({...t,month:o}))),{...t,month:o,day:a}}calendarToIsoDate(t,e="constrain",r){let i=t,o=this.adjustCalendarDate(t,r,e,!1);o=this.regulateMonthDayNaive(o,e,r);let{year:a,month:s,day:u}=o,l=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:u,overflow:e,id:this.id}),h,f=r.get(l);if(f||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==o.year||i.month!==o.month||i.day!==o.day)&&(h=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:e,id:this.id}),f=r.get(h),f))return f;let g=this.estimateIsoDate({year:a,month:s,day:u}),E=V=>{let G=this.addDaysIso(g,V);if(o.day>this.minimumMonthLength(o)){let U=this.isoToCalendarDate(G,r);for(;U.month!==s||U.year!==a;){if(e==="reject")throw new RangeError(`day ${u} does not exist in month ${s} of year ${a}`);G=this.addDaysIso(G,-1),U=this.isoToCalendarDate(G,r)}}return G},S=0,k=this.isoToCalendarDate(g,r),A=Pa(o,k);if(A.years!==0||A.months!==0||A.days!==0){let V=365*A.years+30*A.months+A.days;g=this.addDaysIso(g,V),k=this.isoToCalendarDate(g,r),A=Pa(o,k),A.years===0&&A.months===0?g=E(A.days):S=this.compareCalendarDates(o,k)}let B=8;for(;S;){g=this.addDaysIso(g,S*B);let V=k;k=this.isoToCalendarDate(g,r);let G=S;if(S=this.compareCalendarDates(o,k),S){if(A=Pa(o,k),A.years===0&&A.months===0)g=E(A.days),S=0;else if(G&&S!==G)if(B>1)B/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(k,V)>0&&(g=this.addDaysIso(g,-1)),S=0}}}if(r.set(l,g),h&&r.set(h,g),o.year===void 0||o.month===void 0||o.day===void 0||o.monthCode===void 0||this.hasEra&&(o.era===void 0||o.eraYear===void 0))throw new RangeError("Unexpected missing property");return g}compareCalendarDates(t,e){return t.year!==e.year?Tt(t.year-e.year):t.month!==e.month?Tt(t.month-e.month):t.day!==e.day?Tt(t.day-e.day):0}regulateDate(t,e="constrain",r){let i=this.calendarToIsoDate(t,e,r);return this.isoToCalendarDate(i,r)}addDaysIso(t,e){return It(t.year,t.month,t.day+e)}addDaysCalendar(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.addDaysIso(i,e);return this.isoToCalendarDate(o,r)}addMonthsCalendar(t,e,r,i){let o=t,{day:a}=o;for(let s=0,u=Math.abs(e);s<u;s++){let{month:l}=o,h=o,f=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),g=this.calendarToIsoDate(o,"constrain",i),E=this.addDaysIso(g,f);if(o=this.isoToCalendarDate(E,i),e>0){let S=this.monthsInYear(h,i);for(;o.month-1!=l%S;)E=this.addDaysIso(E,-1),o=this.isoToCalendarDate(E,i)}o.day!==a&&(o=this.regulateDate({...o,day:a},"constrain",i))}if(r==="reject"&&o.day!==a)throw new RangeError(`Day ${a} does not exist in resulting calendar month`);return o}addCalendar(t,{years:e=0,months:r=0,weeks:i=0,days:o=0},a,s){let{year:u,day:l,monthCode:h}=t,f=this.adjustCalendarDate({year:u+e,monthCode:h,day:l},s),g=this.addMonthsCalendar(f,r,a,s),E=o+7*i;return this.addDaysCalendar(g,E,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,u=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let l=this.calendarDaysUntil(t,e,i);o=l%7,a=(l-o)/7;break}case"month":case"year":{let l=this.compareCalendarDates(e,t);if(!l)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,f=e.day-t.day;if(r==="year"&&h){let S=0;e.monthCode>t.monthCode&&(S=1),e.monthCode<t.monthCode&&(S=-1),S||(S=Math.sign(f)),u=S*l<0?h-l:h}let g,E=u?this.addCalendar(t,{years:u},"constrain",i):t;do s+=l,g=E,E=this.addMonthsCalendar(g,l,"constrain",i),E.day!==t.day&&(E=this.regulateDate({...E,day:t.day},"constrain",i));while(this.compareCalendarDates(e,E)*l>=0);s-=l,o=this.calendarDaysUntil(g,e,i);break}}return{years:u,months:s,weeks:a,days:o}}daysInMonth(t,e){let{day:r}=t,i=this.maximumMonthLength(t),o=this.minimumMonthLength(t);if(o===i)return o;let a=r<=i-o?i:o,s=this.calendarToIsoDate(t,"constrain",e),u=this.addDaysIso(s,a),l=this.isoToCalendarDate(u,e),h=this.addDaysIso(u,-l.day);return this.isoToCalendarDate(h,e).day}daysInPreviousMonth(t,e){let{day:r,month:i,year:o}=t,a={year:i>1?o:o-1,month:i,day:1},s=i>1?i-1:this.monthsInYear(a,e);a={...a,month:s};let u=this.minimumMonthLength(a),l=this.maximumMonthLength(a);if(u===l)return l;let h=this.calendarToIsoDate(t,"constrain",e),f=this.addDaysIso(h,-r);return this.isoToCalendarDate(f,e).day}startOfCalendarYear(t){return{year:t.year,month:1,monthCode:"M01",day:1}}startOfCalendarMonth(t){return{year:t.year,month:t.month,day:1}}calendarDaysUntil(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.calendarToIsoDate(e,"constrain",r);return rr(o.year,o.month-1,o.day)-rr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,u,{era:l,eraYear:h,year:f,month:g,monthCode:E,day:S}=t;if(g!==void 0&&f===void 0&&(!this.hasEra||l===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(E===void 0||f!==void 0||this.hasEra&&h!==void 0)&&({monthCode:E,day:S}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let k={year:this.monthDaySearchStartYear(E,S),month:12,day:31},A=this.isoToCalendarDate(k,r),B=A.monthCode>E||A.monthCode===E&&A.day>=S?A.year:A.year-1;for(let V=0;V<20;V++){let G=this.adjustCalendarDate({day:S,monthCode:E,year:B-V},r),U=this.calendarToIsoDate(G,"constrain",r),J=this.isoToCalendarDate(U,r);if({year:i,month:o,day:a}=U,J.monthCode===E&&J.day===S)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(J.monthCode);if(J.monthCode===E&&J.day===oe&&S>oe)return{month:o,day:a,year:i};(s===void 0||J.monthCode===s.monthCode&&J.day>s.day)&&(s=J,u=U)}}if(e==="constrain"&&u!==void 0)return u;throw new RangeError(`No recent ${this.id} year with monthCode ${E} and day ${S}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},Qa=class extends kn{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(t){let{year:e}=t;return(7*e+1)%19<7}monthsInYear(t){return this.inLeapYear(t)?13:12}minimumMonthLength(t){return this.minMaxMonthLength(t,"min")}maximumMonthLength(t){return this.minMaxMonthLength(t,"max")}minMaxMonthLength(t,e){let{month:r,year:i}=t,o=this.getMonthCode(i,r),a=Object.entries(this.months).find(u=>u[1].monthCode===o);if(a===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let s=a[1].days;return typeof s=="number"?s:s[e]}maxLengthOfMonthCodeInAnyYear(t){return["M04","M06","M08","M10","M12"].includes(t)?29:30}estimateIsoDate(t){let{year:e}=t;return{year:e-3760,month:1,day:1}}getMonthCode(t,e){return this.inLeapYear({year:t})?e===6?ln(5,!0):ln(e<6?e:e-1):ln(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:u,monthExtra:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(l){let h=this.months[l];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${l}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:u,monthCode:s}}if(this.validateCalendarDate(t),a===void 0)if(s.endsWith("L")){if(s!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);if(a=6,!this.inLeapYear({year:o})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${o} which is not a leap year`);a=6,s="M06"}}else{a=or(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(Ve(a,1,this.monthsInYear({year:o})),Ve(u,1,this.maximumMonthLength({year:o,month:a}))):(a=gt(a,1,this.monthsInYear({year:o})),u=gt(u,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:u,month:a,monthCode:s,year:o}}},Bn=class extends kn{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(t,e){let r={year:t.year,month:1,monthCode:"M01",day:1},i={year:t.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,e)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:Math.floor(e*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},es=class extends Bn{constructor(){super(...arguments),this.id="islamic"}},ts=class extends Bn{constructor(){super(...arguments),this.id="islamic-umalqura"}},ns=class extends Bn{constructor(){super(...arguments),this.id="islamic-tbla"}},rs=class extends Bn{constructor(){super(...arguments),this.id="islamic-civil"}},is=class extends Bn{constructor(){super(...arguments),this.id="islamic-rgsa"}},os=class extends Bn{constructor(){super(...arguments),this.id="islamicc"}},as=class extends kn{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(t,e){return this.daysInMonth({year:t.year,month:12,day:1},e)===30}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===12?29:e<=6?31:30}maximumMonthLength(t){let{month:e}=t;return e===12?30:e<=6?31:30}maxLengthOfMonthCodeInAnyYear(t){return or(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},ss=class extends kn{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(t){return xs(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=or(t),r=this.months[e];return r=r.leap??r,r.length}getMonthInfo(t){let{month:e}=t,r=this.months[e];if(r===void 0)throw new RangeError(`Invalid month: ${e}`);return this.inLeapYear(t)&&r.leap&&(r=r.leap),r}estimateIsoDate(t){let e=this.adjustCalendarDate(t),r=this.getMonthInfo(e);return It(e.year+78+(r.nextYear?1:0),r.month,r.day+e.day-1)}checkIcuBugs(t){if(this.vulnerableToBceBug&&t.year<1)throw new 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 xs(n){return n%4==0&&(n%100!=0||n%400==0)}var Mo=class extends kn{constructor(t,e){super(),this.calendarType="solar",this.id=t,this.isoEpoch=e}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return xs(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][or(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return ci(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},So=class extends kn{constructor(t,e){super(),this.hasEra=!0,this.calendarType="solar",this.id=t;let{eras:r,anchorEra:i}=function(o){let a,s=o;if(s.length===0)throw new RangeError("Invalid era data: eras are required");if(s.length===1&&s[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(s.length===1&&!s[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(s.filter(l=>l.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(l=>{if(l.isAnchor||!l.anchorEpoch&&!l.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=l,l.anchorEpoch={year:l.hasYearZero?0:1}}else if(!l.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(l=>l.code),s.forEach(l=>{let{reverseOf:h}=l;if(h){let f=s.find(g=>g.code===h);if(f===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);l.reverseOf=f,l.anchorEpoch=f.anchorEpoch,l.isoEpoch=f.isoEpoch}l.anchorEpoch.month===void 0&&(l.anchorEpoch.month=1),l.anchorEpoch.day===void 0&&(l.anchorEpoch.day=1)}),s.sort((l,h)=>{if(l.reverseOf)return 1;if(h.reverseOf)return-1;if(!l.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-l.isoEpoch.year});let u=s[s.length-1].reverseOf;if(u&&u!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((l,h)=>{l.genericName="era"+(s.length-1-h)}),{eras:s,anchorEra:a||s[0]}}(e);this.anchorEra=i,this.eras=r}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return xs(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][or(t)-1]}completeEraYear(t){let e=(s,u,l)=>{let h=t[s];if(h!=null&&h!=u&&!(l||[]).includes(h)){let f=l?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${f?`${u} (also called ${f})`:u}`)}},r=s=>{let u,l={...t,year:s},h=this.eras.find((f,g)=>{if(g===this.eras.length-1){if(f.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${f.code}`);return u=f.anchorEpoch.year-s,!0}return u=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0}return this.compareCalendarDates(l,f.anchorEpoch)>=0&&(u=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:u,era:h.code,eraNames:h.names}},{year:i,eraYear:o,era:a}=t;if(i!=null){let s=r(i);({eraYear:o,era:a}=s),e("era",a,s?.eraNames),e("eraYear",o)}else{if(o==null)throw new RangeError("Either year or eraYear and era are required");{if(a===void 0)throw new RangeError("era and eraYear must be provided together");let s=this.eras.find(({code:u,names:l=[]})=>u===a||l.includes(a));if(!s)throw new RangeError(`Era ${a} (ISO year ${o}) was not matched by any era`);i=s.reverseOf?s.anchorEpoch.year-o:o+s.anchorEpoch.year-(s.hasYearZero?0:1),e("year",i),{eraYear:o,era:a}=r(i)}}return{...t,year:i,eraYear:o,era:a}}adjustCalendarDate(t,e,r="constrain"){let i=t,{month:o,monthCode:a}=i;return o===void 0&&(i={...i,month:or(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return ci(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},wi=class extends So{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=ln(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},sn={inLeapYear(n){let{year:t}=n;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(n){let{month:t}=n;return t===13?this.inLeapYear(n)?6:5:30},maximumMonthLength(n){return this.minimumMonthLength(n)},maxLengthOfMonthCodeInAnyYear:n=>n==="M13"?6:30},cs=class extends Mo{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},ko=class extends So{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},ls=class extends cs{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},us=class extends ko{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},ds=class extends ko{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}}])}},hs=class extends wi{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},ms=class extends Mo{constructor(){super("buddhist",{year:-543,month:1,day:1})}},fs=class extends wi{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(t){let{era:e,eraYear:r}=t;return e==="b"&&(e="gregory-inverse"),e==="a"&&(e="gregory"),{era:e,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},ps=class extends wi{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(t,e){let{era:r,eraYear:i}=t,{year:o}=e;return this.eras.find(a=>a.code===r)?{era:r,eraYear:i}:o<1?{era:"japanese-inverse",eraYear:1-o}:{era:"japanese",eraYear:o}}},To=class extends kn{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(t,e){let r=this.getMonthList(t.year,e);return Object.entries(r).length===13}monthsInYear(t,e){return this.inLeapYear(t,e)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(t){return["M01L","M09L","M10L","M11L","M12L"].includes(t)?29:30}monthDaySearchStartYear(t,e){let r={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]}[t]??[1972,1972];return e<30?r[0]:r[1]}getMonthList(t,e){if(t===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:t,id:this.id}),i=e.get(r);if(i)return i;let o=this.getFormatter(),a=(A,B)=>{let V=tu({isoYear:A,isoMonth:2,isoDay:1}),G=new Date(V);G.setUTCDate(B+1);let U=o.formatToParts(G),J=U.find(ie=>ie.type==="month").value,oe=+U.find(ie=>ie.type==="day").value,ke=U.find(ie=>ie.type==="relatedYear"),Me;if(ke===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Me=+ke.value,{calendarMonthString:J,calendarDay:oe,calendarYearToVerify:Me}},s=17,{calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s);u!=="1"&&(s+=29,{calendarMonthString:u,calendarDay:l}=a(t,s)),s-=l-5;let f={},g,E,S=1,k=!1;do({calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s)),g&&(f[E].daysInMonth=g+30-l),h!==t?k=!0:(f[u]={monthIndex:S++},s+=30),g=l,E=u;while(!k);return f[E].daysInMonth=g+30-l,e.set(r,f),f}estimateIsoDate(t){let{year:e,month:r}=t;return{year:e,month:r>=12?12:r+1,day:1}}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthExtra:s,day:u,monthCode:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(s&&s!=="bis")throw new RangeError(`Unexpected leap month suffix: ${s}`);let h=ln(a,s!==void 0),f=`${a}${s||""}`,g=this.getMonthList(o,e)[f];if(g===void 0)throw new RangeError(`Unmatched month ${f} in Chinese year ${o}`);return a=g.monthIndex,{year:o,month:a,day:u,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),f=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let g=h[f];if(a=g&&g.monthIndex,a===void 0&&l.endsWith("L")&&l!="M13L"&&r==="constrain"){let E=+l.replace(/^M0?|L$/g,"");g=h[E],g&&(a=g.monthIndex,l=ln(E))}if(a===void 0)throw new RangeError(`Unmatched month ${l} in Chinese year ${o}`)}else if(l===void 0){let h=this.getMonthList(o,e),f=Object.entries(h),g=f.length;r==="reject"?(Ve(a,1,g),Ve(u,1,this.maximumMonthLength())):(a=gt(a,1,g),u=gt(u,1,this.maximumMonthLength()));let E=f.find(S=>S[1].monthIndex===a);if(E===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);l=ln(+E[0].replace("bis",""),E[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),f=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let g=h[f];if(!g)throw new RangeError(`Unmatched monthCode ${l} in Chinese year ${o}`);if(a!==g.monthIndex)throw new RangeError(`monthCode ${l} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:l,day:u}}},gs=class extends To{constructor(){super(...arguments),this.id="chinese"}},ys=class extends To{constructor(){super(...arguments),this.id="dangi"}},vs=class{constructor(t){this.helper=t}extraFields(t){return this.helper.hasEra&&t.includes("year")?["era","eraYear"]:[]}resolveFields(t){if(this.helper.calendarType!=="lunisolar"){let e=new Ft;Is(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Ft,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Ft,i=this.helper.monthDayFromFields(t,e,r);return r.setObject(i),i}fieldKeysToIgnore(t){let e=new Set;for(let r=0;r<t.length;r++){let i=t[r];switch(e.add(i),i){case"era":e.add("eraYear"),e.add("year");break;case"eraYear":e.add("era"),e.add("year");break;case"year":e.add("era"),e.add("eraYear");break;case"month":e.add("monthCode"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"monthCode":e.add("month"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"day":this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"))}}return Ql(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Ft.getCacheForObject(t),u=this.helper.isoToCalendarDate(t,s),l=this.helper.addCalendar(u,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(l,"constrain",s);return Ft.getCacheForObject(h)||new Ft(s).setObject(h),h}dateUntil(t,e,r){let i=Ft.getCacheForObject(t),o=Ft.getCacheForObject(e),a=this.helper.isoToCalendarDate(t,i),s=this.helper.isoToCalendarDate(e,o);return this.helper.untilCalendar(a,s,r,i)}isoToDate(t,e){let r=Ft.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=Bi.iso8601.isoToDate(t,{dayOfWeek:!0}).dayOfWeek),e.dayOfYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.calendarDaysUntil(o,i,r);i.dayOfYear=a+1}if(e.weekOfYear&&(i.weekOfYear=eu(this.helper.id,t)),i.daysInWeek=7,e.daysInMonth&&(i.daysInMonth=this.helper.daysInMonth(i,r)),e.daysInYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.addCalendar(o,{years:1},"constrain",r);i.daysInYear=this.helper.calendarDaysUntil(o,a,r)}return e.monthsInYear&&(i.monthsInYear=this.helper.monthsInYear(i,r)),e.inLeapYear&&(i.inLeapYear=this.helper.inLeapYear(i,r)),i}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let n of[Qa,as,ds,ls,us,gs,ys,hs,ss,ms,fs,ps,es,ts,ns,rs,is,os]){let t=new n;Bi[t.id]=new vs(t)}Ya("calendarImpl",function(n){return Bi[n]});var bi=Intl.DateTimeFormat;function pr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new bi(m(n,gl),e(m(n,La))),function(r,i,o){let a=Io(r);if(a===void 0)throw new TypeError("Missing slots for the given container");if(a[i]===void 0)throw new TypeError(`tried to reset ${i} which was not set`);a[i]=o}(n,t,e)),e}function Zr(n){return bt(n,sr)}var ar=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let f=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(E){if(E==null)throw new TypeError(`Expected object not ${E}`);return Object(E)}(o);let g=Object.create(null);for(let E=0;E<f.length;E++){let S=f[E];Object.prototype.hasOwnProperty.call(s,S)&&(g[S]=s[S])}s=g}else s=Object.create(null);let u=new bi(i,s),l=u.resolvedOptions();if(Tn(r),a){let f=Object.assign(Object.create(null),l);for(let g in f)Object.prototype.hasOwnProperty.call(s,g)||delete f[g];f.hour12=s.hour12,f.hourCycle=s.hourCycle,me(r,La,f)}else me(r,La,s);me(r,gl,l.locale),me(r,sr,u),me(r,vr,l.timeZone),me(r,Xr,l.calendar),me(r,ul,gh),me(r,dl,fh),me(r,hl,ph),me(r,ml,mh),me(r,fl,yh),me(r,pl,vh);let h=a?s.timeZone:void 0;if(h===void 0)me(r,Aa,l.timeZone);else{let f=Ao(h);if(f.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");me(r,Aa,vt(f))}})(this,t,e)}get format(){x(this,Zr);let t=lh.bind(this);return Object.defineProperties(t,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:"",enumerable:!1,writable:!1,configurable:!0}}),t}formatRange(t,e){return x(this,Zr),dh.call(this,t,e)}formatToParts(t,...e){return x(this,Zr),uh.call(this,t,...e)}formatRangeToParts(t,e){return x(this,Zr),hh.call(this,t,e)}resolvedOptions(){return x(this,Zr),ch.call(this)}};"formatToParts"in bi.prototype||delete ar.prototype.formatToParts,"formatRangeToParts"in bi.prototype||delete ar.prototype.formatRangeToParts;var $t=function(n=void 0,t=void 0){return new ar(n,t)};function ch(){let n=m(this,sr).resolvedOptions();return n.timeZone=m(this,Aa),n}function lh(n,...t){let e,r,i=xr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,sr),r=[n,...t]),e.format(...r)}function uh(n,...t){let e,r,i=xr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,sr),r=[n,...t]),e.formatToParts(...r)}function dh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=Co(n),r=Co(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(Mn(e)){if(!nu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=xr(e,this),{epochNs:u,formatter:l}=xr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,sr)),i.formatRange(...o)}function hh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=Co(n),r=Co(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(Mn(e)){if(!nu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=xr(e,this),{epochNs:u,formatter:l}=xr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,sr)),i.formatRangeToParts(...o)}function ji(n={},t={}){let e=Object.assign({},n),r=["year","month","day","hour","minute","second","weekday","dayPeriod","timeZoneName","dateStyle","timeStyle"];for(let i=0;i<r.length;i++){let o=r[i];e[o]=o in t?t[o]:e[o],e[o]!==!1&&e[o]!==void 0||delete e[o]}return e}function mh(n){let t=ji(n,{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"})),!jo(t)){if(zi(n))throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(n)}]`);Object.assign(t,{hour:"numeric",minute:"numeric",second:"numeric"})}return t}function fh(n){let t={short:{year:"2-digit",month:"numeric"},medium:{year:"numeric",month:"short"},long:{year:"numeric",month:"long"},full:{year:"numeric",month:"long"}},e=ji(n,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("year"in e||"month"in e||"era"in e)){if(zi(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function ph(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=ji(n,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("month"in e)&&!("day"in e)){if(zi(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function gh(n){let t=ji(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Bo(t)){if(zi(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function yh(n){let t=ji(n,{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),!jo(t)&&!Bo(t)){if(zi(n))throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}return t}function vh(n){let t=n;return jo(t)||Bo(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function Bo(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function jo(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function zi(n){return Bo(n)||jo(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function Mn(n){return Fe(n)||$e(n)||xe(n)||fe(n)||Ge(n)||Yt(n)||Ke(n)}function Co(n){return Mn(n)?n:Ro(n)}function nu(n,t){return!(!Mn(n)||!Mn(t)||$e(n)&&!$e(t)||Fe(n)&&!Fe(t)||xe(n)&&!xe(t)||fe(n)&&!fe(t)||Ge(n)&&!Ge(t)||Yt(n)&&!Yt(t)||Ke(n)&&!Ke(t))}function xr(n,t){if($e(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,Ye)};return{epochNs:tt(m(t,vr),e,"compatible"),formatter:pr(t,ml)}}if(Ge(n)){let e=m(n,$),r=m(t,Xr);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=be(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:tt(m(t,vr),i,"compatible"),formatter:pr(t,dl)}}if(Yt(n)){let e=m(n,$),r=m(t,Xr);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=be(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:tt(m(t,vr),i,"compatible"),formatter:pr(t,hl)}}if(Fe(n)){let e=m(n,$),r=m(t,Xr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=be(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:tt(m(t,vr),i,"compatible"),formatter:pr(t,ul)}}if(xe(n)){let e=m(n,$),r=m(t,Xr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Ae);return{epochNs:tt(m(t,vr),i,"compatible"),formatter:pr(t,fl)}}if(fe(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return Ke(n)?{epochNs:m(n,se),formatter:pr(t,pl)}:{}}function ru(n){let t=Object.create(null);return t.years=m(n,ct),t.months=m(n,lt),t.weeks=m(n,St),t.days=m(n,ut),t.hours=m(n,dt),t.minutes=m(n,ht),t.seconds=m(n,mt),t.milliseconds=m(n,ft),t.microseconds=m(n,pt),t.nanoseconds=m(n,kt),t}ar.prototype.constructor=$t,Object.defineProperty($t,"prototype",{value:ar.prototype,writable:!1,enumerable:!1,configurable:!1}),$t.supportedLocalesOf=bi.supportedLocalesOf,Cn($t,"Intl.DateTimeFormat");var{format:wh,formatToParts:bh}=Intl.DurationFormat?.prototype??Object.create(null);function Ps(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ru(Kt(n));return wh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Ps,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ru(Kt(n));return bh.call(this,t)});var vm=Object.freeze({__proto__:null,DateTimeFormat:$t,ModifiedIntlDurationFormatPrototypeFormat:Ps}),Di=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");Nl(this,_o(t))}get epochMilliseconds(){return x(this,Ke),Zt(m(this,se),"floor")}get epochNanoseconds(){return x(this,Ke),Jl(T.default.BigInt(m(this,se)))}add(t){return x(this,Ke),Jc("add",this,t)}subtract(t){return x(this,Ke),Jc("subtract",this,t)}until(t,e=void 0){return x(this,Ke),Uc("until",this,t,e)}since(t,e=void 0){return x(this,Ke),Uc("since",this,t,e)}round(t){if(x(this,Ke),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?ir("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn);return Ar(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),Xt(Ka(m(this,se),r,o,i))}equals(t){x(this,Ke);let e=ti(t),r=m(this,se),i=m(e,se);return T.default.equal(T.default.BigInt(r),T.default.BigInt(i))}toString(t=void 0){x(this,Ke);let e=te(t),r=Ai(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let a=e.timeZone;a!==void 0&&(a=vt(a));let{precision:s,unit:u,increment:l}=Li(o,r);return Nc(Xt(Ka(m(this,se),l,u,i)),a,s)}toJSON(){return x(this,Ke),Nc(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return x(this,Ke),new $t(t,e).format(this)}valueOf(){zn("Instant")}toZonedDateTimeISO(t){x(this,Ke);let e=vt(t);return Qe(m(this,se),e,"iso8601")}static fromEpochMilliseconds(t){return Xt(Qt(Ro(t)))}static fromEpochNanoseconds(t){return Xt(_o(t))}static from(t){return ti(t)}static compare(t,e){let r=ti(t),i=ti(e),o=m(r,se),a=m(i,se);return T.default.lessThan(o,a)?-1:T.default.greaterThan(o,a)?1:0}};Cn(Di,"Temporal.Instant");var Ei=class{constructor(t,e,r,i="iso8601"){let o=ue(t),a=ue(e),s=ue(r),u=Dt(i===void 0?"iso8601":Ue(i));tr(o,a,s),xl(this,{year:o,month:a,day:s},u)}get calendarId(){return x(this,Fe),m(this,$)}get era(){return ot(this,"era")}get eraYear(){return ot(this,"eraYear")}get year(){return ot(this,"year")}get month(){return ot(this,"month")}get monthCode(){return ot(this,"monthCode")}get day(){return ot(this,"day")}get dayOfWeek(){return ot(this,"dayOfWeek")}get dayOfYear(){return ot(this,"dayOfYear")}get weekOfYear(){return ot(this,"weekOfYear")?.week}get yearOfWeek(){return ot(this,"weekOfYear")?.year}get daysInWeek(){return ot(this,"daysInWeek")}get daysInMonth(){return ot(this,"daysInMonth")}get daysInYear(){return ot(this,"daysInYear")}get monthsInYear(){return ot(this,"monthsInYear")}get inLeapYear(){return ot(this,"inLeapYear")}with(t,e=void 0){if(x(this,Fe),!He(t))throw new TypeError("invalid argument");Pr(t);let r=m(this,$),i=wt(r,m(this,ce));return i=er(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),yt($n(r,i,ye(te(e))),r)}withCalendar(t){x(this,Fe);let e=Yi(t);return yt(m(this,ce),e)}add(t,e=void 0){return x(this,Fe),Xc("add",this,t,e)}subtract(t,e=void 0){return x(this,Fe),Xc("subtract",this,t,e)}until(t,e=void 0){return x(this,Fe),Vc("until",this,t,e)}since(t,e=void 0){return x(this,Fe),Vc("since",this,t,e)}equals(t){x(this,Fe);let e=Qr(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Fe),Oc(this,Ri(te(t)))}toJSON(){return x(this,Fe),Oc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Fe),new $t(t,e).format(this)}valueOf(){zn("PlainDate")}toPlainDateTime(t=void 0){x(this,Fe);let e=Il(t);return qt(be(m(this,ce),e),m(this,$))}toZonedDateTime(t){let e,r;if(x(this,Fe),He(t)){let a=t.timeZone;a===void 0?e=vt(t):(e=vt(a),r=t.plainTime)}else e=vt(t);let i=m(this,ce),o;return r===void 0?o=An(e,i):(r=Nn(r),o=tt(e,be(i,m(r,Ye)),"compatible")),Qe(o,e,m(this,$))}toPlainYearMonth(){x(this,Fe);let t=m(this,$);return Er(fi(t,wt(t,m(this,ce)),"constrain"),t)}toPlainMonthDay(){x(this,Fe);let t=m(this,$);return Dr(vo(t,wt(t,m(this,ce)),"constrain"),t)}static from(t,e=void 0){return Qr(t,e)}static compare(t,e){let r=Qr(t),i=Qr(e);return hn(m(r,ce),m(i,ce))}};function ot(n,t){x(n,Fe);let e=m(n,ce);return Ni(n).isoToDate(e,{[t]:!0})[t]}Cn(Ei,"Temporal.PlainDate");var _i=class{constructor(t,e,r,i=0,o=0,a=0,s=0,u=0,l=0,h="iso8601"){let f=ue(t),g=ue(e),E=ue(r),S=i===void 0?0:ue(i),k=o===void 0?0:ue(o),A=a===void 0?0:ue(a),B=s===void 0?0:ue(s),V=u===void 0?0:ue(u),G=l===void 0?0:ue(l),U=Dt(h===void 0?"iso8601":Ue(h));Ss(f,g,E,S,k,A,B,V,G),Pl(this,{isoDate:{year:f,month:g,day:E},time:{hour:S,minute:k,second:A,millisecond:B,microsecond:V,nanosecond:G}},U)}get calendarId(){return x(this,xe),m(this,$)}get year(){return at(this,"year")}get month(){return at(this,"month")}get monthCode(){return at(this,"monthCode")}get day(){return at(this,"day")}get hour(){return gr(this,"hour")}get minute(){return gr(this,"minute")}get second(){return gr(this,"second")}get millisecond(){return gr(this,"millisecond")}get microsecond(){return gr(this,"microsecond")}get nanosecond(){return gr(this,"nanosecond")}get era(){return at(this,"era")}get eraYear(){return at(this,"eraYear")}get dayOfWeek(){return at(this,"dayOfWeek")}get dayOfYear(){return at(this,"dayOfYear")}get weekOfYear(){return at(this,"weekOfYear")?.week}get yearOfWeek(){return at(this,"weekOfYear")?.year}get daysInWeek(){return at(this,"daysInWeek")}get daysInYear(){return at(this,"daysInYear")}get daysInMonth(){return at(this,"daysInMonth")}get monthsInYear(){return at(this,"monthsInYear")}get inLeapYear(){return at(this,"inLeapYear")}with(t,e=void 0){if(x(this,xe),!He(t))throw new TypeError("invalid argument");Pr(t);let r=m(this,$),i=m(this,Ae),o={...wt(r,i.isoDate),...i.time};return o=er(r,o,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),qt(Oi(r,o,ye(te(e))),r)}withPlainTime(t=void 0){x(this,xe);let e=Il(t);return qt(be(m(this,Ae).isoDate,e),m(this,$))}withCalendar(t){x(this,xe);let e=Yi(t);return qt(m(this,Ae),e)}add(t,e=void 0){return x(this,xe),Qc("add",this,t,e)}subtract(t,e=void 0){return x(this,xe),Qc("subtract",this,t,e)}until(t,e=void 0){return x(this,xe),qc("until",this,t,e)}since(t,e=void 0){return x(this,xe),qc("since",this,t,e)}round(t){if(x(this,xe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?ir("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Ar(r,a,a===1);let s=m(this,Ae);return qt(r===1&&o==="nanosecond"?s:Ga(s,r,o,i),m(this,$))}equals(t){x(this,xe);let e=ei(t);return Ir(m(this,Ae),m(e,Ae))===0&&un(m(this,$),m(e,$))}toString(t=void 0){x(this,xe);let e=te(t),r=Ri(e),i=Ai(e),o=en(e,"trunc"),a=Ct(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:u,increment:l}=Li(a,i),h=Ga(m(this,Ae),l,u,o);return nr(h),gi(h,m(this,$),s,r)}toJSON(){return x(this,xe),gi(m(this,Ae),m(this,$),"auto")}toLocaleString(t=void 0,e=void 0){return x(this,xe),new $t(t,e).format(this)}valueOf(){zn("PlainDateTime")}toZonedDateTime(t,e=void 0){x(this,xe);let r=vt(t),i=li(te(e));return Qe(tt(r,m(this,Ae),i),r,m(this,$))}toPlainDate(){return x(this,xe),yt(m(this,Ae).isoDate,m(this,$))}toPlainTime(){return x(this,xe),wn(m(this,Ae).time)}static from(t,e=void 0){return ei(t,e)}static compare(t,e){let r=ei(t),i=ei(e);return Ir(m(r,Ae),m(i,Ae))}};function at(n,t){x(n,xe);let e=m(n,Ae).isoDate;return Ni(n).isoToDate(e,{[t]:!0})[t]}function gr(n,t){return x(n,xe),m(n,Ae).time[t]}Cn(_i,"Temporal.PlainDateTime");var Mi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,h=0){let f=t===void 0?0:Jt(t),g=e===void 0?0:Jt(e),E=r===void 0?0:Jt(r),S=i===void 0?0:Jt(i),k=o===void 0?0:Jt(o),A=a===void 0?0:Jt(a),B=s===void 0?0:Jt(s),V=u===void 0?0:Jt(u),G=l===void 0?0:Jt(l),U=h===void 0?0:Jt(h);Ho(f,g,E,S,k,A,B,V,G,U),Tn(this),me(this,ct,f),me(this,lt,g),me(this,St,E),me(this,ut,S),me(this,dt,k),me(this,ht,A),me(this,mt,B),me(this,ft,V),me(this,pt,G),me(this,kt,U)}get years(){return x(this,Oe),m(this,ct)}get months(){return x(this,Oe),m(this,lt)}get weeks(){return x(this,Oe),m(this,St)}get days(){return x(this,Oe),m(this,ut)}get hours(){return x(this,Oe),m(this,dt)}get minutes(){return x(this,Oe),m(this,ht)}get seconds(){return x(this,Oe),m(this,mt)}get milliseconds(){return x(this,Oe),m(this,ft)}get microseconds(){return x(this,Oe),m(this,pt)}get nanoseconds(){return x(this,Oe),m(this,kt)}get sign(){return x(this,Oe),Do(this)}get blank(){return x(this,Oe),Do(this)===0}with(t){x(this,Oe);let e=Cl(t),{years:r=m(this,ct),months:i=m(this,lt),weeks:o=m(this,St),days:a=m(this,ut),hours:s=m(this,dt),minutes:u=m(this,ht),seconds:l=m(this,mt),milliseconds:h=m(this,ft),microseconds:f=m(this,pt),nanoseconds:g=m(this,kt)}=e;return new n(r,i,o,a,s,u,l,h,f,g)}negated(){return x(this,Oe),xt(this)}abs(){return x(this,Oe),new n(Math.abs(m(this,ct)),Math.abs(m(this,lt)),Math.abs(m(this,St)),Math.abs(m(this,ut)),Math.abs(m(this,dt)),Math.abs(m(this,ht)),Math.abs(m(this,mt)),Math.abs(m(this,ft)),Math.abs(m(this,pt)),Math.abs(m(this,kt)))}add(t){return x(this,Oe),Zc("add",this,t)}subtract(t){return x(this,Oe),Zc("subtract",this,t)}round(t){if(x(this,Oe),t===void 0)throw new TypeError("options parameter is required");let e=yn(this),r=typeof t=="string"?ir("smallestUnit",t):te(t),i=Ct(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=xa(r),s=Rr(r),u=en(r,"halfExpand"),l=Ct(r,"smallestUnit","datetime",void 0),h=!0;l||(h=!1,l="nanosecond");let f=Dn(e,l),g=!0;if(i||(g=!1,i=f),i==="auto"&&(i=f),!h&&!g)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(Dn(i,l)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${l}`);let E={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[l];if(E!==void 0&&Ar(s,E,!1),s>1&&vn(l)==="date"&&i!==l)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let k=wr(this),A=m(a,Ee),B=m(a,$),V=m(a,se);return k=Zl(V,ii(V,A,B,k),A,B,i,s,l,u),vn(i)==="date"&&(i="hour"),Wt(k,i)}if(o){let k=cn(this),A=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},k.time),B=m(o,ce),V=m(o,$),G=Bt(V,B,et(k.date,A.deltaDays),"constrain");return k=Gl(be(B,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),be(G,A),V,i,s,l,u),Wt(k,i)}if(an(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(an(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let S=cn(this);if(l==="day"){let{quotient:k,remainder:A}=S.time.divmod(po),B=S.date.days+k+ui(A,"day");B=On(B,s,u),S=En({years:0,months:0,weeks:0,days:B},Se.ZERO)}else S=En({years:0,months:0,weeks:0,days:0},Eo(S.time,s,l,u));return Wt(S,i)}total(t){if(x(this,Oe),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?ir("unit",t):te(t),{plainRelativeTo:r,zonedRelativeTo:i}=xa(e),o=Ct(e,"unit","datetime",Sn);if(i){let s=wr(this),u=m(i,Ee),l=m(i,$),h=m(i,se);return function(f,g,E,S,k){return vn(k)==="time"?ui(Se.fromEpochNsDiff(g,f),k):zc(Wl(f,g,E,S,k),g,Gt(E,f),E,S,k)}(h,ii(h,u,l,s),u,l,o)}if(r){let s=cn(this),u=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),l=m(r,ce),h=m(r,$),f=Bt(h,l,et(s.date,u.deltaDays),"constrain");return function(g,E,S,k){if(Ir(g,E)==0)return 0;nr(g),nr(E);let A=ql(g,E,S,k);return k==="nanosecond"?T.default.toNumber(A.time.totalNs):zc(A,Ze(E),g,null,S,k)}(be(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),be(f,u),h,o)}let a=yn(this);if(an(a))throw new RangeError(`a starting point is required for ${a}s total`);if(an(o))throw new RangeError(`a starting point is required for ${o}s total`);return ui(cn(this).time,o)}toString(t=void 0){x(this,Oe);let e=te(t),r=Ai(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour"||o==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:a,unit:s,increment:u}=Li(o,r);if(s==="nanosecond"&&u===1)return uo(this,a);let l=yn(this),h=wr(this),f=Eo(h.time,u,s,i);return h=En(h.date,f),uo(Wt(h,Dn(l,"second")),a)}toJSON(){return x(this,Oe),uo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(x(this,Oe),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Ps.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),uo(this,"auto")}valueOf(){zn("Duration")}static from(t){return Kt(t)}static compare(t,e,r=void 0){let i=Kt(t),o=Kt(e),a=te(r),{plainRelativeTo:s,zonedRelativeTo:u}=xa(a);if(m(i,ct)===m(o,ct)&&m(i,lt)===m(o,lt)&&m(i,St)===m(o,St)&&m(i,ut)===m(o,ut)&&m(i,dt)===m(o,dt)&&m(i,ht)===m(o,ht)&&m(i,mt)===m(o,mt)&&m(i,ft)===m(o,ft)&&m(i,pt)===m(o,pt)&&m(i,kt)===m(o,kt))return 0;let l=yn(i),h=yn(o),f=wr(i),g=wr(o);if(u&&(vn(l)==="date"||vn(h)==="date")){let B=m(u,Ee),V=m(u,$),G=m(u,se),U=ii(G,B,V,f),J=ii(G,B,V,g);return Tt(T.default.toNumber(T.default.subtract(U,J)))}let E=f.date.days,S=g.date.days;if(an(l)||an(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");E=jc(f.date,s),S=jc(g.date,s)}let k=f.time.add24HourDays(E),A=g.time.add24HourDays(S);return k.cmp(A)}};Cn(Mi,"Temporal.Duration");var Si=class{constructor(t,e,r="iso8601",i=1972){let o=ue(t),a=ue(e),s=Dt(r===void 0?"iso8601":Ue(r)),u=ue(i);tr(u,o,a),Rl(this,{year:u,month:o,day:a},s)}get monthCode(){return il(this,"monthCode")}get day(){return il(this,"day")}get calendarId(){return x(this,Yt),m(this,$)}with(t,e=void 0){if(x(this,Yt),!He(t))throw new TypeError("invalid argument");Pr(t);let r=m(this,$),i=wt(r,m(this,ce),"month-day");return i=er(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),Dr(vo(r,i,ye(te(e))),r)}equals(t){x(this,Yt);let e=Ac(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Yt),Yc(this,Ri(te(t)))}toJSON(){return x(this,Yt),Yc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Yt),new $t(t,e).format(this)}valueOf(){zn("PlainMonthDay")}toPlainDate(t){if(x(this,Yt),!He(t))throw new TypeError("argument should be an object");let e=m(this,$);return yt($n(e,er(e,wt(e,m(this,ce),"month-day"),zt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return Ac(t,e)}};function il(n,t){x(n,Yt);let e=m(n,ce);return Ni(n).isoToDate(e,{[t]:!0})[t]}function Ra(n){return Gt(n,Xa())}Cn(Si,"Temporal.PlainMonthDay");var iu={instant:()=>Xt(Xa()),plainDateTimeISO:(n=Gr())=>qt(Ra(vt(n)),"iso8601"),plainDateISO:(n=Gr())=>yt(Ra(vt(n)).isoDate,"iso8601"),plainTimeISO:(n=Gr())=>wn(Ra(vt(n)).time),timeZoneId:()=>Gr(),zonedDateTimeISO:(n=Gr())=>{let t=vt(n);return Qe(Xa(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(iu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var ki=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:ue(t),u=e===void 0?0:ue(e),l=r===void 0?0:ue(r),h=i===void 0?0:ue(i),f=o===void 0?0:ue(o),g=a===void 0?0:ue(a);Yo(s,u,l,h,f,g),Al(this,{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g})}get hour(){return x(this,$e),m(this,Ye).hour}get minute(){return x(this,$e),m(this,Ye).minute}get second(){return x(this,$e),m(this,Ye).second}get millisecond(){return x(this,$e),m(this,Ye).millisecond}get microsecond(){return x(this,$e),m(this,Ye).microsecond}get nanosecond(){return x(this,$e),m(this,Ye).nanosecond}with(t,e=void 0){if(x(this,$e),!He(t))throw new TypeError("invalid argument");Pr(t);let r=ja(t,"partial"),i=ja(this),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Object.assign(i,r),f=ye(te(e));return{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=No(o,a,s,u,l,h,f),new n(o,a,s,u,l,h)}add(t){return x(this,$e),el("add",this,t)}subtract(t){return x(this,$e),el("subtract",this,t)}until(t,e=void 0){return x(this,$e),Wc("until",this,t,e)}since(t,e=void 0){return x(this,$e),Wc("since",this,t,e)}round(t){if(x(this,$e),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?ir("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn);return Ar(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),wn(Za(m(this,Ye),r,o,i))}equals(t){x(this,$e);let e=Nn(t);return Ja(m(this,Ye),m(e,Ye))===0}toString(t=void 0){x(this,$e);let e=te(t),r=Ai(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:a,unit:s,increment:u}=Li(o,r);return Fc(Za(m(this,Ye),u,s,i),a)}toJSON(){return x(this,$e),Fc(m(this,Ye),"auto")}toLocaleString(t=void 0,e=void 0){return x(this,$e),new $t(t,e).format(this)}valueOf(){zn("PlainTime")}static from(t,e=void 0){return Nn(t,e)}static compare(t,e){let r=Nn(t),i=Nn(e);return Ja(m(r,Ye),m(i,Ye))}};Cn(ki,"Temporal.PlainTime");var Ti=class{constructor(t,e,r="iso8601",i=1){let o=ue(t),a=ue(e),s=Dt(r===void 0?"iso8601":Ue(r)),u=ue(i);tr(o,a,u),Ll(this,{year:o,month:a,day:u},s)}get year(){return pn(this,"year")}get month(){return pn(this,"month")}get monthCode(){return pn(this,"monthCode")}get calendarId(){return x(this,Ge),m(this,$)}get era(){return pn(this,"era")}get eraYear(){return pn(this,"eraYear")}get daysInMonth(){return pn(this,"daysInMonth")}get daysInYear(){return pn(this,"daysInYear")}get monthsInYear(){return pn(this,"monthsInYear")}get inLeapYear(){return pn(this,"inLeapYear")}with(t,e=void 0){if(x(this,Ge),!He(t))throw new TypeError("invalid argument");Pr(t);let r=m(this,$),i=wt(r,m(this,ce),"year-month");return i=er(r,i,zt(r,t,["year","month","monthCode"],[],"partial")),Er(fi(r,i,ye(te(e))),r)}add(t,e=void 0){return x(this,Ge),tl("add",this,t,e)}subtract(t,e=void 0){return x(this,Ge),tl("subtract",this,t,e)}until(t,e=void 0){return x(this,Ge),Kc("until",this,t,e)}since(t,e=void 0){return x(this,Ge),Kc("since",this,t,e)}equals(t){x(this,Ge);let e=ni(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Ge),Hc(this,Ri(te(t)))}toJSON(){return x(this,Ge),Hc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Ge),new $t(t,e).format(this)}valueOf(){zn("PlainYearMonth")}toPlainDate(t){if(x(this,Ge),!He(t))throw new TypeError("argument should be an object");let e=m(this,$);return yt($n(e,er(e,wt(e,m(this,ce),"year-month"),zt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return ni(t,e)}static compare(t,e){let r=ni(t),i=ni(e);return hn(m(r,ce),m(i,ce))}};function pn(n,t){x(n,Ge);let e=m(n,ce);return Ni(n).isoToDate(e,{[t]:!0})[t]}Cn(Ti,"Temporal.PlainYearMonth");var Dh=$t.prototype.resolvedOptions,Ci=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=_o(t),o=Ue(e),{tzName:a,offsetMinutes:s}=Fn(o);if(s===void 0){let u=wo(a);if(!u)throw new RangeError(`unknown time zone ${a}`);o=u.identifier}else o=Es(s);Ol(this,i,o,Dt(r===void 0?"iso8601":Ue(r)))}get calendarId(){return x(this,fe),m(this,$)}get timeZoneId(){return x(this,fe),m(this,Ee)}get year(){return st(this,"year")}get month(){return st(this,"month")}get monthCode(){return st(this,"monthCode")}get day(){return st(this,"day")}get hour(){return yr(this,"hour")}get minute(){return yr(this,"minute")}get second(){return yr(this,"second")}get millisecond(){return yr(this,"millisecond")}get microsecond(){return yr(this,"microsecond")}get nanosecond(){return yr(this,"nanosecond")}get era(){return st(this,"era")}get eraYear(){return st(this,"eraYear")}get epochMilliseconds(){return x(this,fe),Zt(m(this,se),"floor")}get epochNanoseconds(){return x(this,fe),Jl(m(this,se))}get dayOfWeek(){return st(this,"dayOfWeek")}get dayOfYear(){return st(this,"dayOfYear")}get weekOfYear(){return st(this,"weekOfYear")?.week}get yearOfWeek(){return st(this,"weekOfYear")?.year}get hoursInDay(){x(this,fe);let t=m(this,Ee),e=on(this).isoDate,r=It(e.year,e.month,e.day+1),i=An(t,e),o=An(t,r);return ui(Se.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return st(this,"daysInWeek")}get daysInMonth(){return st(this,"daysInMonth")}get daysInYear(){return st(this,"daysInYear")}get monthsInYear(){return st(this,"monthsInYear")}get inLeapYear(){return st(this,"inLeapYear")}get offset(){return x(this,fe),za(bn(m(this,Ee),m(this,se)))}get offsetNanoseconds(){return x(this,fe),bn(m(this,Ee),m(this,se))}with(t,e=void 0){if(x(this,fe),!He(t))throw new TypeError("invalid zoned-date-time-like");Pr(t);let r=m(this,$),i=m(this,Ee),o=bn(i,m(this,se)),a=on(this),s={...wt(r,a.isoDate),...a.time,offset:za(o)};s=er(r,s,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let u=te(e),l=li(u),h=ho(u,"prefer"),f=Oi(r,s,ye(u)),g=Lr(s.offset);return Qe(yo(f.isoDate,f.time,"option",g,i,l,h,!1),i,r)}withPlainTime(t=void 0){x(this,fe);let e=m(this,Ee),r=m(this,$),i=on(this).isoDate,o;return o=t===void 0?An(e,i):tt(e,be(i,m(Nn(t),Ye)),"compatible"),Qe(o,e,r)}withTimeZone(t){x(this,fe);let e=vt(t);return Qe(m(this,se),e,m(this,$))}withCalendar(t){x(this,fe);let e=Yi(t);return Qe(m(this,se),m(this,Ee),e)}add(t,e=void 0){return x(this,fe),nl("add",this,t,e)}subtract(t,e=void 0){return x(this,fe),nl("subtract",this,t,e)}until(t,e=void 0){return x(this,fe),Gc("until",this,t,e)}since(t,e=void 0){return x(this,fe),Gc("since",this,t,e)}round(t){if(x(this,fe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?ir("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Ar(r,a,a===1),o==="nanosecond"&&r===1)return Qe(m(this,se),m(this,Ee),m(this,$));let s=m(this,Ee),u=m(this,se),l=on(this),h;if(o==="day"){let f=l.isoDate,g=It(f.year,f.month,f.day+1),E=An(s,f),S=An(s,g),k=T.default.subtract(S,E);h=Se.fromEpochNsDiff(u,E).round(k,i).addToEpochNs(E)}else{let f=Ga(l,r,o,i),g=bn(s,u);h=yo(f.isoDate,f.time,"option",g,s,"compatible","prefer",!1)}return Qe(h,s,m(this,$))}equals(t){x(this,fe);let e=ri(t),r=m(this,se),i=m(e,se);return!!T.default.equal(T.default.BigInt(r),T.default.BigInt(i))&&!!Fl(m(this,Ee),m(e,Ee))&&un(m(this,$),m(e,$))}toString(t=void 0){x(this,fe);let e=te(t),r=Ri(e),i=Ai(e),o=function(g){return _n(g,"offset",["auto","never"],"auto")}(e),a=en(e,"trunc"),s=Ct(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let u=function(g){return _n(g,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:l,unit:h,increment:f}=Li(s,i);return $c(this,l,r,u,o,{unit:h,increment:f,roundingMode:a})}toLocaleString(t=void 0,e=void 0){x(this,fe);let r=te(e),i=Object.create(null);if(function(u,l,h,f){if(l==null)return;let g=Reflect.ownKeys(l);for(let E=0;E<g.length;E++){let S=g[E];if(!h.some(k=>Object.is(k,S))&&Object.prototype.propertyIsEnumerable.call(l,S)){let k=l[S];u[S]=k}}}(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=m(this,Ee),Bc(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new $t(t,i),a=Dh.call(o).calendar,s=m(this,$);if(s!=="iso8601"&&a!=="iso8601"&&!un(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(Xt(m(this,se)))}toJSON(){return x(this,fe),$c(this,"auto")}valueOf(){zn("ZonedDateTime")}startOfDay(){x(this,fe);let t=m(this,Ee);return Qe(An(t,on(this).isoDate),t,m(this,$))}getTimeZoneTransition(t){x(this,fe);let e=m(this,Ee);if(t===void 0)throw new TypeError("options parameter is required");let r=_n(typeof t=="string"?ir("direction",t):te(t),"direction",["next","previous"],Sn);if(r===void 0)throw new TypeError("direction option is required");if(Bc(e)||e==="UTC")return null;let i=m(this,se),o=r==="next"?Ms(e,i):Va(e,i);return o===null?null:Qe(o,e,m(this,$))}toInstant(){return x(this,fe),Xt(m(this,se))}toPlainDate(){return x(this,fe),yt(on(this).isoDate,m(this,$))}toPlainTime(){return x(this,fe),wn(on(this).time)}toPlainDateTime(){return x(this,fe),qt(on(this),m(this,$))}static from(t,e=void 0){return ri(t,e)}static compare(t,e){let r=ri(t),i=ri(e),o=m(r,se),a=m(i,se);return T.default.lessThan(T.default.BigInt(o),T.default.BigInt(a))?-1:T.default.greaterThan(T.default.BigInt(o),T.default.BigInt(a))?1:0}};function on(n){return Gt(m(n,Ee),m(n,se))}function st(n,t){x(n,fe);let e=on(n).isoDate;return Ni(n).isoToDate(e,{[t]:!0})[t]}function yr(n,t){return x(n,fe),on(n).time[t]}Cn(Ci,"Temporal.ZonedDateTime");var Pe=Object.freeze({__proto__:null,Duration:Mi,Instant:Di,Now:iu,PlainDate:Ei,PlainDateTime:_i,PlainMonthDay:Si,PlainTime:ki,PlainYearMonth:Ti,ZonedDateTime:Ci}),wm=class{toTemporalInstant(){return Xt(Qt(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Eh=[Di,Ei,_i,Mi,Si,ki,Ti,Ci];for(let n of Eh){let t=Object.getOwnPropertyDescriptor(n,"prototype");(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(n,"prototype",t))}var _h="https://yuna-backend.cbocher.workers.dev/mews",Mh="https://api.mews.com/api/distributor/v1",Sh="Yuna",kh="mewscache",Th=!1,Ch=13,Ih=8,xh=Pe.Duration.from({minutes:20}).milliseconds,Ph=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),ve={base_url:_h,bookingEngine_url:Mh,bookingEngineClient:Sh,bypassCache:Th,headers:Ph,cache_key:kh,ttl:xh,beCheckInUTC:Ch,beCheckOutUTC:Ih};var zo=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var Or=class{constructor(){H(this,"dbName","MewsAPICache");H(this,"version",2);H(this,"db",null);H(this,"initPromise",null);H(this,"performanceMetrics",[]);this.initPromise=this.init()}async init(){return new Promise((t,e)=>{try{let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.error("Failed to initialize IndexedDB:",r.error),e(r.error)},r.onsuccess=()=>{this.db=r.result,t()},r.onupgradeneeded=i=>{let o=i.target.result,{oldVersion:a}=i;if(a>0)try{o.objectStoreNames.contains("api_cache")&&o.deleteObjectStore("api_cache"),o.objectStoreNames.contains("performance_metrics")&&o.deleteObjectStore("performance_metrics")}catch(l){console.warn("Error cleaning up old stores:",l)}let s=o.createObjectStore("api_cache",{keyPath:"cacheKey"});s.createIndex("by-timestamp","timestamp"),s.createIndex("by-enterprise","enterpriseId"),s.createIndex("by-size","size"),o.createObjectStore("performance_metrics",{keyPath:"timestamp"}).createIndex("by-operation","operation")},r.onblocked=()=>{console.warn("IndexedDB upgrade blocked by another tab")}}catch(r){console.error("Failed to initialize IndexedDB:",r),e(r)}})}async ensureDB(){if(!this.db&&(await this.initPromise,!this.db))throw new Error("Failed to initialize IndexedDB");return this.db}calculateDataSize(t){try{return new Blob([JSON.stringify(t)]).size}catch{return 0}}recordPerformanceMetric(t,e,r,i){let o=performance.now()-e,a={operation:t,duration:o,timestamp:Date.now(),cacheHit:r,dataSize:i};this.performanceMetrics.push(a),this.performanceMetrics.length>1e3&&(this.performanceMetrics=this.performanceMetrics.slice(-1e3)),this.storeMetricAsync(a).catch(console.error)}async storeMetricAsync(t){try{let e=await this.ensureDB();return new Promise(r=>{let a=e.transaction("performance_metrics","readwrite").objectStore("performance_metrics").add(t);a.onerror=()=>r(),a.onsuccess=()=>r()})}catch{}}async get(t,e){let r=performance.now();try{let i=await this.ensureDB();return new Promise(o=>{let u=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);u.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},u.onsuccess=()=>{let l=u.result;if(!l){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:ve.ttl,f=Pe.Instant.fromEpochMilliseconds(l.timestamp);if(Pe.Now.instant().since(f,{smallestUnit:"milliseconds"}).milliseconds>h){this.delete(t).catch(console.error),this.recordPerformanceMetric("cache-expired",r,!1),o(null);return}this.recordPerformanceMetric("cache-hit",r,!0,l.size),o(l.data)}})}catch(i){return console.error("Error getting cached data:",i),this.recordPerformanceMetric("cache-error",r,!1),null}}async set(t,e,r){let i=performance.now();try{let o=await this.ensureDB(),a=this.calculateDataSize(e),s={cacheKey:t,data:e,timestamp:Pe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((u,l)=>{let g=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);g.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),l(g.error)},g.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),u()}})}catch(o){if(console.error("Error setting cached data:",o),this.recordPerformanceMetric("cache-write-error",i,!1),o instanceof Error&&o.name==="QuotaExceededError"){await this.cleanupOldEntries();try{let a=await this.ensureDB(),s={cacheKey:t,data:e,timestamp:Pe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((u,l)=>{let g=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);g.onerror=()=>l(g.error),g.onsuccess=()=>u()})}catch(a){console.error("Error setting cached data after cleanup:",a)}}}}async delete(t){try{let i=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((o,a)=>{let s=i.delete(t);s.onsuccess=()=>o(),s.onerror=()=>a(s.error)})}catch(e){console.error("Error deleting cached data:",e)}}async clearExpired(){let t=performance.now(),e=0;try{let r=await this.ensureDB(),i=Pe.Now.instant().epochMilliseconds-ve.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),u=await new Promise((h,f)=>{let g=s.getAll(IDBKeyRange.upperBound(i));g.onsuccess=()=>h(g.result),g.onerror=()=>f(g.error)}),l=50;for(let h=0;h<u.length;h+=l){let f=u.slice(h,h+l);await Promise.all(f.map(g=>new Promise((E,S)=>{let k=a.delete(g.cacheKey);k.onsuccess=()=>E(),k.onerror=()=>S(k.error)}))),e+=f.length,h+l<u.length&&await new Promise(g=>setTimeout(g,0))}await new Promise((h,f)=>{o.oncomplete=()=>h(),o.onerror=()=>f(o.error)}),this.recordPerformanceMetric("cache-cleanup",t,!1)}catch(r){console.error("Error clearing expired cache:",r)}return e}async cleanupOldEntries(t=1e3){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite"),i=r.objectStore("api_cache"),o=i.index("by-timestamp"),a=await new Promise((s,u)=>{let l=o.getAll();l.onsuccess=()=>s(l.result),l.onerror=()=>u(l.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(u=>new Promise((l,h)=>{let f=i.delete(u.cacheKey);f.onsuccess=()=>l(),f.onerror=()=>h(f.error)})))}await new Promise((s,u)=>{r.oncomplete=()=>s(),r.onerror=()=>u(r.error)})}catch(e){console.error("Error cleaning up old entries:",e)}}async clearAll(){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((i,o)=>{let a=r.clear();a.onsuccess=()=>i(),a.onerror=()=>o(a.error)})}catch(t){console.error("Error clearing all cache:",t)}}async getCacheStats(){try{let r=(await this.ensureDB()).transaction("api_cache","readonly").objectStore("api_cache"),i=await new Promise((a,s)=>{let u=r.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>s(u.error)}),o={totalEntries:i.length,totalSize:i.reduce((a,s)=>a+(s.size||0),0),oldestEntry:i.length>0?Math.min(...i.map(a=>a.timestamp)):null,newestEntry:i.length>0?Math.max(...i.map(a=>a.timestamp)):null,entriesByEnterprise:{}};return i.forEach(a=>{let s=a.enterpriseId||"unknown";o.entriesByEnterprise[s]=(o.entriesByEnterprise[s]||0)+1}),o}catch(t){return console.error("Error getting cache stats:",t),{totalEntries:0,totalSize:0,oldestEntry:null,newestEntry:null,entriesByEnterprise:{}}}}getPerformanceMetrics(){return[...this.performanceMetrics]}getAveragePerformance(){let t=this.performanceMetrics,e=t.filter(o=>o.operation==="cache-hit"),r=t.filter(o=>o.operation==="cache-miss"),i=t.filter(o=>o.operation==="cache-write");return{averageCacheHitTime:e.length>0?e.reduce((o,a)=>o+a.duration,0)/e.length:0,averageCacheMissTime:r.length>0?r.reduce((o,a)=>o+a.duration,0)/r.length:0,averageWriteTime:i.length>0?i.reduce((o,a)=>o+a.duration,0)/i.length:0,cacheHitRate:e.length+r.length>0?e.length/(e.length+r.length):0,totalOperations:t.length}}async performMaintenance(){try{setTimeout(async()=>{await this.clearExpired(),(await this.getCacheStats()).totalEntries>2e3&&await this.cleanupOldEntries(1500)},0)}catch(t){console.error("Error during cache maintenance:",t)}}};var Rs=async(n,t,e=null,r=Pe.Duration.from({minutes:10}).milliseconds)=>{let i=new Or,o=zo(`booking-engine:${n}`,e||"null",t.body);if(!ve.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(u=>{console.error("Error setting booking engine cache:",u)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var ou=(n,t)=>{let e=`${ve.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return Rs(e,r,n)},au=(n,t)=>{let e=`${ve.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return Rs(e,r,n)};var As=class{constructor(){H(this,"listeners",new Map)}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e)}off(t,e){this.listeners.get(t)?.delete(e)}emit(t,e){this.listeners.get(t)?.forEach(r=>r(e))}},Uo=new As;function Et(n,t){Uo.emit(n,t)}function Pt(n,t){Array.isArray(n)?n.forEach(e=>Uo.on(e,t)):Uo.on(n,t)}var su={"en-US":{loading:"Loading...",night:"Night",chooseOption:"Choose an option",apartment:"Apartment",total:"In total",missingEnterpriseId:"Missing enterprise-ID",missingCategoryId:"Missing category-ID",minimumNights:"nights minimum",maximumNights:"nights maximum",booked:"Already Booked",select:"Select",fatalErrorMessage:"Oops! An unexpected error occurred. Please try reloading or contact support.",pleaseWait:"Please wait...","chargingMode:Once":"Once","chargingMode:PerTimeUnit":"Nightly","chargingMode:PerPersonPerTimeUnit":"Nightly per person",adults:"Adults",children:"Children (0-18 years old)",guestSingular:"Person",guestPlural:"People",couponValid:"Coupon is valid ;)",couponInvalid:"Coupon is invalid !",couponError:"Error validating coupon!",proceedToPayment:"Proceed to payment",completePayment:"Complete the payment"},"fr-FR":{loading:"Chargement...",night:"Nuit",chooseOption:"Choisir une option",apartment:"Appartement",total:"Au total",missingEnterpriseId:"ID d'entreprise manquant",missingCategoryId:"ID de cat\xE9gorie manquant",minimumNights:"nuits minimum",maximumNights:"nuits maximum",booked:"D\xE9j\xE0 r\xE9serv\xE9",select:"S\xE9lectionner",fatalErrorMessage:"Oups ! Une erreur inattendue s'est produite. Veuillez recharger la page ou contacter le support.",pleaseWait:"S'il vous pla\xEEt, attendez...","chargingMode:Once":"Une fois","chargingMode:PerTimeUnit":"Par nuit","chargingMode:PerPersonPerTimeUnit":"Par personne par nuit",adults:"Adultes",children:"Enfants (0-18 ans)",guestSingular:"Personne",guestPlural:"Personnes",couponValid:"Le coupon est valide ;)",couponInvalid:"Le coupon est invalide !",couponError:"Erreur lors de la validation du coupon !",proceedToPayment:"Proc\xE9der au paiement",completePayment:"Finalisez le paiement"}},Ce=n=>su[Fr().bcp47][n]||su["fr-FR"][n],Ut=n=>{let t=Fr().bcp47;return t in n?n[t]:(console.warn(`Translation [${t}] not found, falling back to default.`,n),n[t]||n["fr-FR"]||n["en-US"]||"")};var Fr=()=>{let{lang:n}=document.documentElement,t={iso639:"fr",bcp47:"fr-FR"};return n.includes("en")&&(t={iso639:"en",bcp47:"en-US"}),t},tn=Fr().bcp47,Um=Fr().iso639;function Ls(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Ns=Object.assign;var Rh=Object.prototype.hasOwnProperty,Vo=(n,t)=>Rh.call(n,t),lr=Array.isArray,Ui=n=>cu(n)==="[object Map]";var Ah=n=>typeof n=="string",Yr=n=>typeof n=="symbol",Vi=n=>n!==null&&typeof n=="object";var Lh=Object.prototype.toString,cu=n=>Lh.call(n),lu=n=>cu(n).slice(8,-1);var qo=n=>Ah(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var Wo=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},Nh=/-(\w)/g,Wm=Wo(n=>n.replace(Nh,(t,e)=>e?e.toUpperCase():"")),Oh=/\B([A-Z])/g,Km=Wo(n=>n.replace(Oh,"-$1").toLowerCase()),Fh=Wo(n=>n.charAt(0).toUpperCase()+n.slice(1)),Gm=Wo(n=>n?`on${Fh(n)}`:""),ur=(n,t)=>!Object.is(n,t);var Yh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Zm=Ls(Yh+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Os;var Le;var Fs=new WeakSet,Zo=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Os&&Os.active&&Os.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fs.has(this)&&(Fs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Hh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,uu(this),mu(this);let t=Le,e=nn;Le=this,nn=!0;try{return this.fn()}finally{fu(this),Le=t,nn=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Js(t);this.deps=this.depsTail=void 0,uu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){$s(this)&&this.run()}get dirty(){return $s(this)}},hu=0,Wi,Ki;function Hh(n,t=!1){if(n.flags|=8,t){n.next=Ki,Ki=n;return}n.next=Wi,Wi=n}function Gs(){hu++}function Zs(){if(--hu>0)return;if(Ki){let t=Ki;for(Ki=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;Wi;){let t=Wi;for(Wi=void 0;t;){let e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){n||(n=r)}t=e}}if(n)throw n}function mu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),Js(r),Bh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function $s(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($h(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function $h(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Jo)||(n.globalVersion=Jo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!$s(n))))return;n.flags|=2;let t=n.dep,e=Le,r=nn;Le=n,nn=!0;try{mu(n);let i=n.fn(n._value);(t.version===0||ur(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=e,nn=r,fu(n),n.flags&=-3}}function Js(n,t=!1){let{dep:e,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),e.subs===n&&(e.subs=r,!r&&e.computed)){e.computed.flags&=-5;for(let o=e.computed.deps;o;o=o.nextDep)Js(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Bh(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function pu(n,t){n.effect instanceof Zo&&(n=n.effect.fn);let e=new Zo(n);t&&Ns(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var nn=!0,gu=[];function jh(){gu.push(nn),nn=!1}function zh(){let n=gu.pop();nn=n===void 0?!0:n}function uu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var Jo=0,Bs=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Xo=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Le||!nn||Le===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Le)e=this.activeLink=new Bs(Le,this),Le.deps?(e.prevDep=Le.depsTail,Le.depsTail.nextDep=e,Le.depsTail=e):Le.deps=Le.depsTail=e,yu(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){let r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=Le.depsTail,e.nextDep=void 0,Le.depsTail.nextDep=e,Le.depsTail=e,Le.deps===e&&(Le.deps=r)}return e}trigger(t){this.version++,Jo++,this.notify(t)}notify(t){Gs();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Zs()}}};function yu(n){if(n.dep.sc++,n.sub.flags&4){let t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)yu(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var js=new WeakMap,dr=Symbol(""),zs=Symbol(""),Gi=Symbol("");function Rt(n,t,e){if(nn&&Le){let r=js.get(n);r||js.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new Xo),i.map=r,i.key=e),i.track()}}function Un(n,t,e,r,i,o){let a=js.get(n);if(!a){Jo++;return}let s=u=>{u&&u.trigger()};if(Gs(),t==="clear")a.forEach(s);else{let u=lr(n),l=u&&qo(e);if(u&&e==="length"){let h=Number(r);a.forEach((f,g)=>{(g==="length"||g===Gi||!Yr(g)&&g>=h)&&s(f)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),l&&s(a.get(Gi)),t){case"add":u?l&&s(a.get("length")):(s(a.get(dr)),Ui(n)&&s(a.get(zs)));break;case"delete":u||(s(a.get(dr)),Ui(n)&&s(a.get(zs)));break;case"set":Ui(n)&&s(a.get(dr));break}}Zs()}function Hr(n){let t=Ie(n);return t===n?t:(Rt(t,"iterate",Gi),Vn(n)?t:t.map(_t))}function Xs(n){return Rt(n=Ie(n),"iterate",Gi),n}var Uh={__proto__:null,[Symbol.iterator](){return Ys(this,Symbol.iterator,_t)},concat(...n){return Hr(this).concat(...n.map(t=>lr(t)?Hr(t):t))},entries(){return Ys(this,"entries",n=>(n[1]=_t(n[1]),n))},every(n,t){return In(this,"every",n,t,void 0,arguments)},filter(n,t){return In(this,"filter",n,t,e=>e.map(_t),arguments)},find(n,t){return In(this,"find",n,t,_t,arguments)},findIndex(n,t){return In(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return In(this,"findLast",n,t,_t,arguments)},findLastIndex(n,t){return In(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return In(this,"forEach",n,t,void 0,arguments)},includes(...n){return Hs(this,"includes",n)},indexOf(...n){return Hs(this,"indexOf",n)},join(n){return Hr(this).join(n)},lastIndexOf(...n){return Hs(this,"lastIndexOf",n)},map(n,t){return In(this,"map",n,t,void 0,arguments)},pop(){return qi(this,"pop")},push(...n){return qi(this,"push",n)},reduce(n,...t){return du(this,"reduce",n,t)},reduceRight(n,...t){return du(this,"reduceRight",n,t)},shift(){return qi(this,"shift")},some(n,t){return In(this,"some",n,t,void 0,arguments)},splice(...n){return qi(this,"splice",n)},toReversed(){return Hr(this).toReversed()},toSorted(n){return Hr(this).toSorted(n)},toSpliced(...n){return Hr(this).toSpliced(...n)},unshift(...n){return qi(this,"unshift",n)},values(){return Ys(this,"values",_t)}};function Ys(n,t,e){let r=Xs(n),i=r[t]();return r!==n&&!Vn(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Vh=Array.prototype;function In(n,t,e,r,i,o){let a=Xs(n),s=a!==n&&!Vn(n),u=a[t];if(u!==Vh[t]){let f=u.apply(n,o);return s?_t(f):f}let l=e;a!==n&&(s?l=function(f,g){return e.call(this,_t(f),g,n)}:e.length>2&&(l=function(f,g){return e.call(this,f,g,n)}));let h=u.call(a,l,r);return s&&i?i(h):h}function du(n,t,e,r){let i=Xs(n),o=e;return i!==n&&(Vn(n)?e.length>3&&(o=function(a,s,u){return e.call(this,a,s,u,n)}):o=function(a,s,u){return e.call(this,a,_t(s),u,n)}),i[t](o,...r)}function Hs(n,t,e){let r=Ie(n);Rt(r,"iterate",Gi);let i=r[t](...e);return(i===-1||i===!1)&&im(e[0])?(e[0]=Ie(e[0]),r[t](...e)):i}function qi(n,t,e=[]){jh(),Gs();let r=Ie(n)[t].apply(n,e);return Zs(),zh(),r}var qh=Ls("__proto__,__v_isRef,__isVue"),vu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Yr));function Wh(n){Yr(n)||(n=String(n));let t=Ie(this);return Rt(t,"has",n),t.hasOwnProperty(n)}var Qo=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,r){if(e==="__v_skip")return t.__v_skip;let i=this._isReadonly,o=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return o;if(e==="__v_raw")return r===(i?o?tm:Du:o?em:bu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=lr(t);if(!i){let u;if(a&&(u=Uh[e]))return u;if(e==="hasOwnProperty")return Wh}let s=Reflect.get(t,e,$r(t)?t:r);return(Yr(e)?vu.has(e):qh(e))||(i||Rt(t,"get",e),o)?s:$r(s)?a&&qo(e)?s:s.value:Vi(s)?i?ea(s):jr(s):s}},Us=class extends Qo{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let u=Br(o);if(!Vn(r)&&!Br(r)&&(o=Ie(o),r=Ie(r)),!lr(t)&&$r(o)&&!$r(r))return u?!1:(o.value=r,!0)}let a=lr(t)&&qo(e)?Number(e)<t.length:Vo(t,e),s=Reflect.set(t,e,r,$r(t)?t:i);return t===Ie(i)&&(a?ur(r,o)&&Un(t,"set",e,r,o):Un(t,"add",e,r)),s}deleteProperty(t,e){let r=Vo(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&Un(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Yr(e)||!vu.has(e))&&Rt(t,"has",e),r}ownKeys(t){return Rt(t,"iterate",lr(t)?"length":dr),Reflect.ownKeys(t)}},Vs=class extends Qo{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Kh=new Us,Gh=new Vs;var qs=n=>n,Ko=n=>Reflect.getPrototypeOf(n);function Zh(n,t,e){return function(...r){let i=this.__v_raw,o=Ie(i),a=Ui(o),s=n==="entries"||n===Symbol.iterator&&a,u=n==="keys"&&a,l=i[n](...r),h=e?qs:t?Ws:_t;return!t&&Rt(o,"iterate",u?zs:dr),{next(){let{value:f,done:g}=l.next();return g?{value:f,done:g}:{value:s?[h(f[0]),h(f[1])]:h(f),done:g}},[Symbol.iterator](){return this}}}}function Go(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Jh(n,t){let e={get(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);n||(ur(i,s)&&Rt(a,"get",i),Rt(a,"get",s));let{has:u}=Ko(a),l=t?qs:n?Ws:_t;if(u.call(a,i))return l(o.get(i));if(u.call(a,s))return l(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Rt(Ie(i),"iterate",dr),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);return n||(ur(i,s)&&Rt(a,"has",i),Rt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,u=Ie(s),l=t?qs:n?Ws:_t;return!n&&Rt(u,"iterate",dr),s.forEach((h,f)=>i.call(o,l(h),l(f),a))}};return Ns(e,n?{add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear")}:{add(i){!t&&!Vn(i)&&!Br(i)&&(i=Ie(i));let o=Ie(this);return Ko(o).has.call(o,i)||(o.add(i),Un(o,"add",i,i)),this},set(i,o){!t&&!Vn(o)&&!Br(o)&&(o=Ie(o));let a=Ie(this),{has:s,get:u}=Ko(a),l=s.call(a,i);l||(i=Ie(i),l=s.call(a,i));let h=u.call(a,i);return a.set(i,o),l?ur(o,h)&&Un(a,"set",i,o,h):Un(a,"add",i,o),this},delete(i){let o=Ie(this),{has:a,get:s}=Ko(o),u=a.call(o,i);u||(i=Ie(i),u=a.call(o,i));let l=s?s.call(o,i):void 0,h=o.delete(i);return u&&Un(o,"delete",i,void 0,l),h},clear(){let i=Ie(this),o=i.size!==0,a=void 0,s=i.clear();return o&&Un(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Zh(i,n,t)}),e}function wu(n,t){let e=Jh(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Vo(e,i)&&i in r?e:r,i,o)}var Xh={get:wu(!1,!1)};var Qh={get:wu(!0,!1)};var bu=new WeakMap,em=new WeakMap,Du=new WeakMap,tm=new WeakMap;function nm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rm(n){return n.__v_skip||!Object.isExtensible(n)?0:nm(lu(n))}function jr(n){return Br(n)?n:Eu(n,!1,Kh,Xh,bu)}function ea(n){return Eu(n,!0,Gh,Qh,Du)}function Eu(n,t,e,r,i){if(!Vi(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=rm(n);if(o===0)return n;let a=i.get(n);if(a)return a;let s=new Proxy(n,o===2?r:e);return i.set(n,s),s}function Br(n){return!!(n&&n.__v_isReadonly)}function Vn(n){return!!(n&&n.__v_isShallow)}function im(n){return n?!!n.__v_raw:!1}function Ie(n){let t=n&&n.__v_raw;return t?Ie(t):n}var _t=n=>Vi(n)?jr(n):n,Ws=n=>Vi(n)?ea(n):n;function $r(n){return n?n.__v_isRef===!0:!1}function Be(n){return om(n,!1)}function om(n,t){return $r(n)?n:new Ks(n,t)}var Ks=class{constructor(t,e){this.dep=new Xo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Ie(t),this._value=e?t:_t(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||Vn(t)||Br(t);t=r?t:Ie(t),ur(t,e)&&(this._rawValue=t,this._value=r?t:_t(t),this.dep.trigger())}};var qe=async(n,t,e=null,r=!1)=>{let i=new Or,o=zo(n,e||"null",t.body);if(!ve.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(ve.base_url);r&&(a.pathname=a.pathname.replace("/mews","/_adapter")),a.pathname+=n,a.searchParams.set("enterprise",e||"null");let s=await fetch(a.toString(),t),u=await s.json();if(s.ok)return i.set(o,u,e||"null").catch(l=>{console.error("Error setting cache:",l)}),u;throw new Error("FETCH_ERROR",{cause:u})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var _u=(n,t={})=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/services/getAll",e,n)};function Mu(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Ut(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Qs=Be({});async function Su(n){if(Qs.value[n])return Qs.value[n];let t=await _u(n),e=Mu(t);return Qs.value[n]=e,e}var ku=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/ageCategories/getAll",e,n)};function Tu(n){if(!n||!n.AgeCategories||!Array.isArray(n.AgeCategories))throw new Error("Invalid age categories response format");return n.AgeCategories.map(t=>({id:t.Id,name:Ut(t.Names),shortName:t.ShortNames?Ut(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var ec=Be({});async function Cu(n){if(ec.value[n])return ec.value[n];let t=await ku(n,{EnterpriseIds:[n]}),e=Tu(t);return ec.value[n]=e,e}var Iu=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/products/getAll",e,n)};function xu(n){return{currency:n.Currency,datesUtc:n.DatesUtc.map(t=>t.split("T")[0]),timeUnitStartsUTC:n.TimeUnitStartsUtc,categoryPrices:n.CategoryPrices,relativeAdjustment:n.RelativeAdjustment,absoluteAdjustment:n.AbsoluteAdjustment}}function Pu(n){let t={};for(let e of n)e.pricing?.datesUtc.forEach((r,i)=>{t[r]=t[r]||[],t[r].push({rate:e.rate,categoryPrices:e.pricing?.categoryPrices.map(o=>({categoryId:o.CategoryId,amountPrice:o.AmountPrices[i],price:o.Prices[i]}))||[]})});return t}function Ru(n){if(!n||!n.Rates||!Array.isArray(n.Rates))throw new Error("Invalid rates response format");return n.Rates.filter(t=>t.IsActive&&t.IsEnabled&&t.IsPublic).map(t=>({id:t.Id,serviceId:t.ServiceId,baseRateId:t.BaseRateId,isBaseRate:t.IsBaseRate,isActive:t.IsActive,isEnabled:t.IsEnabled,isPublic:t.IsPublic,isDefault:t.IsDefault,type:t.Type,name:Ut(t.Names),shortName:t.ShortName,description:Ut(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function Zi(n,t){return n.map(t)}function tc(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Ut(n.Names),shortName:Ut(n.ShortNames),description:Ut(n.Descriptions),options:n.Options,promotions:n.Promotions,classifications:n.Classifications,pricing:n.Pricing,imageIds:n.ImageIds||[],ordering:n.Ordering,consumptionMoment:n.ConsumptionMoment,chargingMode:n.ChargingMode}}function Au(n){return{products:Zi(n.Products,tc),customerProducts:Zi(n.CustomerProducts,tc)}}var nc=Be({});async function Lu(n,t){if(nc.value[t])return nc.value[t];let e=await Iu(n,{ServiceIds:[t]}),r=Au(e);return nc.value[t]=r,r}var Nu=(n,t={})=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/rates/getAll",e,n)};var rc=Be({});async function Ou(n,t){if(rc.value[t])return rc.value[t];let e=await Nu(n,{ServiceIds:[t]}),r=Ru(e);return rc.value[t]=r,r}var Fu=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/services/getAvailability",e,n)};function Yu(n){if(!n||!n.CategoryAvailabilities||!Array.isArray(n.CategoryAvailabilities)||!n.TimeUnitStartsUtc)throw new Error("Invalid service availabilities response format");return n.CategoryAvailabilities.map(t=>({categoryId:t.CategoryId,timeUnitStartsUTC:n.TimeUnitStartsUtc,availabilities:t.Availabilities||[],adjustments:t.Adjustments||[]}))}var Z=class n{static getCurrentDate(){return Pe.Now.plainDateISO()}static fromString(t){return Pe.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(tn,e)}static formatForAPI(t){return(typeof t=="string"?Pe.PlainDate.from(t):Pe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:Pe.PlainTime.from("00:00")}).toInstant().toString()}static addDays(t,e){return t.add({days:e})}static daysBetween(t,e){return t.until(e).days}static isBefore(t,e){return Pe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return Pe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return Pe.PlainDate.compare(t,e)===0}static getDateRange(t,e){let r=[],i=t;for(;this.isBefore(i,e);)r.push(i),i=this.addDays(i,1);return r}static fromJSDate(t){return Pe.PlainDate.from({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()})}static toJSDate(t){return new Date(t.year,t.month-1,t.day)}static formatForCalendar(t,e="flatpickr"){if(e==="flatpickr")return t.toString();let r=String(t.day).padStart(2,"0"),i=String(t.month).padStart(2,"0");return`${r}/${i}/${t.year}`}static safeParsePlainDate(t){try{if(t.endsWith("Z")){let e=t.split("T")[0];return Pe.PlainDate.from(e)}return Pe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var _p=localStorage.getItem("dev")==="true";var Mp=3*60*60*1e3;var ta="calendar-day-price",Hu="DD/MM/YYYY",$u="Y-m-d",ic=!1,am=365,oc=Z.getCurrentDate(),Bu=Z.addDays(oc,am),xn=Z.getCurrentDate(),qn=Z.addDays(xn,3),sm=Z.getCurrentDate(),Sp=Z.addDays(sm,30);function hr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}function ju(n=!0,t=document.body,e=Ce("fatalErrorMessage")){t.querySelectorAll('[data-fs-element="preloader"]').forEach(i=>{let o=i.querySelector('[data-fs-element="spinner"]'),a=i.querySelector('[data-fs-element="message"]'),s=i.firstChild;o&&o.classList.toggle("hide",n),a&&(n?(s.style.width="90%",a.textContent=e):(s.removeAttribute("style"),a.textContent=Ce("pleaseWait"))),i.classList.toggle("hide",!n)})}var ac=class{constructor(){H(this,"state",jr({appartmentsData:[],today:Z.getCurrentDate(),lowestPricesByDate:{},isLoadingPrices:!1,isLoadingData:!1}))}setAppartmentsData(t){this.state.appartmentsData=t}setLowestPricesByDate(t){this.state.lowestPricesByDate=t}setLoadingPrices(t){this.state.isLoadingPrices=t}setLoadingData(t){this.state.isLoadingData=t}reset(){this.state.appartmentsData=[],this.state.lowestPricesByDate={},this.state.isLoadingPrices=!1,this.state.isLoadingData=!1}},Op=new ac;var mr={get:n=>{try{let t=localStorage.getItem(n);return t?JSON.parse(t):null}catch(t){return console.error(`Error reading from localStorage for key ${n}:`,t),null}},set:(n,t)=>{try{localStorage.setItem(n,JSON.stringify(t)),mr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=mr.get(n),r=t(e);mr.set(n,r)},remove:n=>{localStorage.removeItem(n),mr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",cm()||"root")}},cm=()=>localStorage.getItem("lastUpdater");var Wn=mr.get("form_state"),zu=Wn?{enterpriseId:Wn.enterpriseId||"",startDate:Wn.startDate||"",endDate:Wn.endDate||"",guests:Wn.guests||0,coupon:Wn.coupon||"",referrer:Wn.referrer||window.location.href,rooms:Wn.rooms||0}:{enterpriseId:"",startDate:xn.toString(),endDate:qn.toString(),guests:0,coupon:"",referrer:window.location.href,rooms:0},_e=jr(zu),lm=ea(zu);pu(()=>{mr.set("form_state",_e)});var um="data-fs-element";var Mt=(n,t=document)=>t.querySelector(`[${um}="${n}"]`);var sc=Be({});async function Uu(n,t,e,r){if(sc.value[t])return sc.value[t];let i=await Fu(n,{ServiceId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=Yu(i);return sc.value[t]=o,o}var Vu=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/restrictions/getAll",e,n)};function qu(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var cc=Be({});async function Wu(n,t,e,r){if(cc.value[t])return cc.value[t];let i=await Vu(n,{ServiceIds:[t],CollidingUtc:{StartUtc:Z.formatForAPI(e),EndUtc:Z.formatForAPI(r)},Origin:"User"}),o=qu(i);return cc.value[t]=o,o}var Ku=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/rules/getAll",e,n)};function Gu(n){if(!n||!n.Rules||!Array.isArray(n.Rules))throw new Error("Invalid service rules response format");return n.Rules.map(t=>({id:t.Id,serviceId:t.ServiceId,conditions:t.Conditions,actions:n.RuleActions!=null?n.RuleActions.filter(e=>e.RuleId===t.Id):n.RuleActions}))}var lc=Be({});async function Zu(n,t){if(lc.value[t])return lc.value[t];let e=await Ku(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Gu(e);return lc.value[t]=r,r}var Ju=(n,t)=>{let e={method:"POST",headers:ve.headers,body:JSON.stringify(t)};return qe("/rates/getPricing",e,n)};var uc=Be({});async function Xu(n,t,e,r){if(uc.value[t])return uc.value[t];let i=await Ju(n,{RateId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=xu(i);return uc.value[t]=o,o}var na=class{constructor(t,e){H(this,"enterprise");H(this,"rate",null);H(this,"pricing",null);this.enterprise=t,this.rate=e}getRate(){if(!this.rate)throw new Error("Rate is not initialized");return this.rate}async initPricing(t,e){if(!this.rate)throw new Error("Rate is not initialized");return this.pricing=await Xu(this.enterprise.getEnterpriseId(),this.rate.id,t,e),this.pricing}getPricing(){if(!this.pricing)throw new Error("Rate pricing is not initialized");return this.pricing}};var ra=class{constructor(t,e){H(this,"enterprise");H(this,"service",null);H(this,"products",[]);H(this,"customerProducts",[]);H(this,"restrictions",[]);H(this,"availabilities",[]);H(this,"rules",[]);H(this,"ageCategories",[]);H(this,"rates",[]);this.enterprise=t,this.service=e}getService(){return this.service}async initAvailabilities(t,e){if(!this.service)throw new Error("Service is not initialized");return this.availabilities=await Uu(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.availabilities}getAvailabilities(){if(this.availabilities.length===0)throw new Error("Service availabilities are not initialized");return this.availabilities}async initRestrictions(t,e){if(!this.service)throw new Error("Service is not initialized");return this.restrictions=await Wu(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.restrictions}getRestrictions(){if(this.restrictions.length===0)throw new Error("Service restrictions are not initialized");return this.restrictions}async initProducts(){if(!this.service)throw new Error("Service is not initialized");let t=await Lu(this.enterprise.getEnterpriseId(),this.service.id);return this.products=t.products,this.customerProducts=t.customerProducts,t}getProducts(){if(this.products.length===0)throw new Error("Service products are not initialized");return this.products}async initRates(){if(!this.service)throw new Error("Service is not initialized");let t=await Ou(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new na(this.enterprise,e)),this.rates.length===0)throw new Error("No rates found for the service");return this.rates}getRates(){if(this.rates.length===0)throw new Error("Service rates are not initialized");return this.rates?.map(t=>t.getRate())||[]}async initRules(){if(!this.service)throw new Error("Service is not initialized");return this.rules=await Zu(this.enterprise.getEnterpriseId(),this.service.id),this.rules}getRules(){if(this.rules.length===0)throw new Error("Service rules are not initialized");return this.rules}async initAgeCategories(){if(!this.service)throw new Error("Service is not initialized");return this.ageCategories=await Cu(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var zr=class{constructor(t){H(this,"enterpriseId");H(this,"services",[]);H(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await Su(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ra(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var ia=class{constructor(t){this.fsListInstance=t;H(this,"cmsAparthotels",[]);H(this,"state",{startDate:_e.startDate?Z.safeParsePlainDate(_e.startDate):xn,endDate:_e.endDate?Z.safeParsePlainDate(_e.endDate):qn,apiDataCache:new Map});Pt("loading:start",e=>hr(!0,e)),Pt("loading:end",e=>hr(!1,e))}shuffleArray(t){let e=[...t];for(let r=e.length-1;r>0;r--){let i=Math.floor(Math.random()*(r+1));[e[r],e[i]]=[e[i],e[r]]}return e}init(){Et("loading:start",this.fsListInstance.wrapperElement),this.fsListInstance.addHook("filter",async t=>{console.log("*** Filter hook triggered with items:",t),Et("loading:start",this.fsListInstance.wrapperElement),await new Promise(r=>setTimeout(r,100)),await this.updateListItems(t,{startDate:this.state.startDate.toString(),endDate:this.state.endDate.toString(),guests:_e.guests||1,rooms:_e.rooms||1});let e=t.filter(r=>Number(r.fields["price-sort"]?.value||9999999)<9999999);return console.log("===> Filtered items:",e),this.fsListInstance.instance==="related"&&(e=this.shuffleArray(e),e=e.slice(0,3),console.log("===> Related items shuffled and limited to 3:",e)),Et("loading:end",this.fsListInstance.wrapperElement),e}),Pt("date:changed",t=>{console.log("Date changed:",t),this.state.startDate=Z.safeParsePlainDate(t.startDate),this.state.endDate=Z.safeParsePlainDate(t.endDate),_e.startDate=t.startDate,_e.endDate=t.endDate,this.fsListInstance.triggerHook("filter")})}groupItemsByEnterprise(t){let e={};return t.forEach(r=>{if(!r.fields["enterprise-id"]||!r.fields["resource-category-id"])return;let i=r.fields["enterprise-id"].value,o=r.fields["resource-category-id"].value;e[i]||(e[i]=[]),e[i].includes(o)||e[i].push(o)}),console.log("#=> Grouped by enterprise:",e),e}createCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i.sort().join(",")}`}async fetchApiData(t,e,r){let o=Date.now(),a=[],s=[];for(let[l,h]of Object.entries(r)){let f=this.createCacheKey(t,e,l,h),g=this.state.apiDataCache.get(f);if(g&&o-g.timestamp<3e5){console.log(`Using cached data for ${l} with ${h.length} categories`),a.push(g);continue}let E=(async()=>{try{let S=new zr(l);await S.initServices();let{reservableService:k}=S,A=k?.getService()?.id;if(!A)return console.warn(`No serviceId found for enterprise ${l}`),null;await k?.initAgeCategories();let B=k?.getAgeCategories()||[],V=await Promise.all([ou(l,{EnterpriseId:l,CategoryIds:h,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,Client:ve.bookingEngineClient,LanguageCode:"fr-FR"}),au(l,{Client:ve.bookingEngineClient,EnterpriseId:l,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,CategoryIds:h,CurrencyCode:"EUR"})]),G=V[0],U=V[1],J={enterpriseId:l,ageCategories:B,availabilities:G,servicePricing:U,timestamp:o};return this.state.apiDataCache.set(f,J),J}catch(S){return console.error(`Error fetching data for enterprise ${l}:`,S),null}})();s.push(E)}let u=await Promise.all(s);return[...a,...u.filter(Boolean)]}async updateListItems(t,{startDate:e,endDate:r,guests:i,rooms:o}){let a=this.groupItemsByEnterprise(t),s=await this.fetchApiData(e,r,a);return console.log("#=> API Data:",s),(await Promise.all(t.map(async l=>{let h=!1,f=!0;if(this.screenItem(l,!0),!l.fields["enterprise-id"]){console.warn(`Item missing enterprise-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("missingEnterpriseId"));return}if(!l.fields["resource-category-id"]){console.warn(`Item missing resource-category-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("missingCategoryId"));return}let g=l.fields["enterprise-id"].value,E=l.fields["resource-category-id"].value,S=s.find(J=>J&&J.enterpriseId===g);if(!S){console.warn(`No data found for enterpriseId: ${g} in item: [${l.fields.title.value}]\u21FE[${l.fields.name.value}]`),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("booked"));return}let k=S.availabilities.ApplicableRestrictions||[],A={title:l.fields.title.value,name:l.fields.name.value,exactRateId:"",baseRateId:"",rateGroupId:"",categoryId:E,categoryType:"notVilla",guests:i,startDate:Z.fromString(e),endDate:Z.fromString(r)},B=this.checkReservationAgainstRestrictions(A,k);return console.log("Restriction Verdict:",B),f=S.availabilities.CategoryAvailabilities.find(J=>J.CategoryId===A.categoryId)?.Availabilities?.slice(0,-1).every(J=>J>0)||!1,h=B.block,h?this.screenItem(l,!1,B.message||Ce("booked")):this.screenItem(l,!0),this.updateItemPrice(l,S.servicePricing,E,{startDate:e,endDate:r,guests:i,isLimited:h,isReservable:f,restrictions:k,restrictionMessage:B.message,restrictionBlock:B.block}),l.collectFields(),l;return f?l:null}))).filter(l=>l!==null)}checkReservationAgainstRestrictions(t,e){console.log("Restrictions:",e);let r=e.filter(s=>this.matchesCondition(t,s.Conditions));if(console.log("Applicable Restrictions:",r),r.length===0)return{block:!1,message:null};let i=r.some(s=>{let{Exceptions:u}=s;return u.MaxAdvance==null&&u.MinAdvance==null&&u.MaxLength==null&&u.MinLength==null&&u.MaxPrice==null&&u.MinPrice==null&&u.MaxReservationCount==null&&u.MinReservationCount==null});if(console.log("Has full restriction:",i),i)return{block:!0,message:Ce("booked")};let o=this.getExtremesFromExceptions(r);console.log("Restriction Extremes:",o);let a=this.violatesException(t,o);return console.log("Violation:",a),a?{block:!0,message:a}:{block:!1,message:null}}matchesCondition(t,e){return(e.ExactRateId===null||t.exactRateId===e.ExactRateId)&&(e.BaseRateId===null||t.baseRateId===e.BaseRateId)&&(e.RateGroupId===null||t.rateGroupId===e.RateGroupId)&&(e.ResourceCategoryId===null||t.categoryId===e.ResourceCategoryId)&&(e.ResourceCategoryType===null||t.categoryType===e.ResourceCategoryType)&&e.Days.includes(t.startDate.toLocaleString("en-US",{weekday:"long"}))&&!0}getDurationInDays(t){if(!t)return null;try{return Pe.Duration.from(t).total({unit:"days"})}catch{return null}}getExtremesFromExceptions(t){let e=null,r=null,i=null,o=null,a=!1;for(let s of t){let u=this.getDurationInDays(s.Exceptions.MinAdvance),l=this.getDurationInDays(s.Exceptions.MaxAdvance),h=this.getDurationInDays(s.Exceptions.MinLength),f=this.getDurationInDays(s.Exceptions.MaxLength);u!==null&&(e=Math.max(e??u,u)),l!==null&&(r=Math.min(r??l,l)),h!==null&&(i=Math.max(i??h,h)),f!==null&&(o=Math.min(o??f,f)),!u&&!l&&!h&&!f&&(a=!0)}return{MinAdvance:e,MaxAdvance:r,MinLength:i,MaxLength:o,Restrict:a}}violatesException(t,e){let{startDate:r}=t,{endDate:i}=t,o=i.since(r,{largestUnit:"day"}).days,a=Z.getCurrentDate(),s=r.since(a,{largestUnit:"day"}).days;return e.MinLength&&o<e.MinLength?`${e.MinLength} ${Ce("minimumNights")}`:e.MaxLength&&o>e.MaxLength?`${e.MaxLength} ${Ce("maximumNights")}`:e.MinAdvance&&s<e.MinAdvance?Ce("booked"):e.MaxAdvance&&s>e.MaxAdvance?Ce("booked"):!e.MinLength&&!e.MaxLength&&!e.MinAdvance&&!e.MaxAdvance?Ce("booked"):null}updateItemPrice(t,e,r,{startDate:i,endDate:o,guests:a,isLimited:s,isReservable:u,restrictions:l,restrictionMessage:h,restrictionBlock:f}){console.groupCollapsed(`[${t.fields.title.value}] \u21FE [${t.fields.name.value}] PRICE UPDATE`),console.log(`Is Limited: ${s}`),console.log(`Is Reservable: ${u}`),console.log(`Restriction Block: ${f}`),console.log(`Restriction Message: ${h||"None"}`);let g=Mt("price",t.element),E=t.element.querySelector('[fs-list-field="price-sort"]'),S=Mt("total-price",t.element),k=Z.fromString(i).until(Z.fromString(o)).total({unit:"days"});s&&u&&E&&(E.textContent="999999"),!u&&E&&(E.textContent="9999999");let A=e?.CategoryPrices?.find(U=>U.CategoryId===r);if(console.log("Category Price:",A),console.log("Restrictions:",l),!A||s&&u){if(g){g.textContent="-";let U=g.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}E&&u&&(E.textContent="999999"),A||(console.warn(`No price found for categoryId: ${r}`),s||this.screenItem(t,!1,Ce("booked"))),console.groupEnd();return}if(!u){if(g){g.textContent="-";let U=g.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}console.warn(`No availability found for categoryId: ${r}`),this.screenItem(t,!1,Ce("booked")),console.groupEnd();return}let B=A.OccupancyPrices[0]?.RateGroupPrices.reduce((U,J)=>J.MinPrice.AverageAmountPerTimeUnit.GrossValue<U.MinPrice.AverageAmountPerTimeUnit.GrossValue?J:U);if(console.log("Lowest Price:",B),!B){g&&(g.textContent="-"),E&&u&&(E.textContent="999999"),console.groupEnd();return}let V=B.MinPrice.AverageAmountPerTimeUnit.GrossValue,G=V.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});if(g){g.textContent=G;let U=g.parentElement;U&&(U.style.opacity="1")}if(E&&(E.textContent=V.toString()),S){let J=(V*k).toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});S.textContent=`${J} ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let oe=S.parentElement;oe&&(oe.style.opacity="1")}console.groupEnd()}screenItem(t,e,r=Ce("select")||""){let i=Mt("submit",t.element);i&&(e?(t.element.style.opacity="1",i.classList.remove("room-results_cta-disabled"),i.textContent=r):i.classList.contains("room-results_cta-disabled")||(i.classList.add("room-results_cta-disabled"),i.textContent=r))}};var Ji=()=>{};function Xi(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Ji}var oa=n=>n instanceof HTMLInputElement;var dc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Qi=n=>{let{value:t}=n;if(n.type==="checkbox"&&(t=n.checked.toString()),n.type==="radio"){let e=n.closest("form")?.querySelector(`input[name="${n.name}"]:checked`);t=oa(e)?e.value:""}return t.toString()};var eo=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!oa(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}dc(n,["click","input","change"])};function Qu(n,t){return{rate:n,pricing:t}}function hc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function ed(n,t){let e=t.filter(o=>dm(n,o.Conditions));return!!(e.some(o=>{let{Exceptions:a}=o;return a.MaxAdvance==null&&a.MinAdvance==null&&a.MaxLength==null&&a.MinLength==null&&a.MaxPrice==null&&a.MinPrice==null&&a.MaxReservationCount==null&&a.MinReservationCount==null})||e.some(o=>hm(n,o.Exceptions)))}function dm(n,t){return(t.ExactRateId===null||n.rate.id===t.ExactRateId)&&(t.BaseRateId===null||n.rate.baseRateId===t.BaseRateId)&&(t.ExactRateId===null||n.rate.baseRateId===t.ExactRateId)&&(t.RateGroupId===null||n.rate.group?.Id===t.RateGroupId)&&t.ResourceCategoryId===null&&t.ResourceCategoryType===null&&n.pricing?.datesUtc.every(e=>{let r=Z.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function aa(n){if(!n)return null;try{return Pe.Duration.from(n).total({unit:"days"})}catch{return null}}function hm(n,t){let e=Z.fromString(n.pricing?.datesUtc[0]),r=Z.fromString(n.pricing?.datesUtc.at(-1));if(!e||!r)return console.warn("Missing date information, cannot check restrictions"),!0;let i=r.since(e,{largestUnit:"day"}).days,o=Z.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=aa(t.MinAdvance),u=aa(t.MaxAdvance),l=aa(t.MinLength),h=aa(t.MaxLength);return!!(l&&i<l||h&&i>h||s&&a<s||u&&a>u||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var td=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!ed(s,t)&&hc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=Pu(r),a=mm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function mm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>hc(a.rate));for(let a of o)for(let s of a.categoryPrices)s.price<i&&(i=s.price);i!==1/0&&(t[e]=i)}return t}var mc=async n=>{let t=await Promise.all(n.map(async r=>{let i=new zr(r);await i.initServices();let o=i.reservableService;if(!o){console.error("No reservable service found for the enterprise.");return}await o.initRates();let a=[],s=await Promise.all(o.rates.map(async l=>{let h=await l.initPricing(Z.formatForAPI(oc.toString()),Z.formatForAPI(Bu.toString()));return Qu(l.getRate(),h)}));return td(s,a).lowestDatedPrices})),e={};for(let r of t)if(r)for(let[i,o]of Object.entries(r))(!e[i]||o<e[i])&&(e[i]=o);return e};var We=class We extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(We.parseDateTime(e,r,i));H(this,"lang");this.lang=i}static parseDateTime(e,r="YYYY-MM-DD",i="en-US"){if(!e)return new Date(new Date().setHours(0,0,0,0));if(e instanceof We)return e.toJSDate();if(e instanceof Date)return e;if(/^-?\d{10,}$/.test(String(e)))return new Date(Number(e));if(typeof e=="string"){let o=[],a=null;for(;(a=We.regex.exec(r))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){let s={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};o[0].index>0&&(s.value+=".*?");for(let[l,h]of Object.entries(o)){let f=Number(l),{group:g,pattern:E}=We.formatPatterns(h[0],i);s[g]=f+1,s.value+=E,s.value+=".*?"}let u=new RegExp(`^${s.value}$`);if(u.test(e)){let l=u.exec(e),h=Number(l[s.year]),f=null;s.month?f=Number(l[s.month])-1:s.shortMonth?f=We.shortMonths(i).indexOf(l[s.shortMonth]):s.longMonth&&(f=We.longMonths(i).indexOf(l[s.longMonth]));let g=Number(l[s.day])||1,E=Number(l[s.hour]),S=Number.isNaN(E)?0:E,k=Number(l[s.minute]),A=Number.isNaN(k)?0:k,B=Number(l[s.second]),V=Number.isNaN(B)?0:B,G=l[s.ampm];return G&&G==="PM"&&(S+=12,S===24&&(S=0)),new Date(h,f,g,S,A,V,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return We.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return We.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"long"}))}static formatPatterns(e,r){switch(e){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${e.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${We.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${We.longMonths(r).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}getWeek(e){let r=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-e))%7;r.setDate(r.getDate()-i);let o=r.getTime();return r.setMonth(0,1),r.getDay()!==e&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((o-r.getTime())/6048e5)}clone(){return new We(this)}toJSDate(){return new Date(this)}inArray(e,r="[]"){return e.some(i=>i instanceof Array?this.isBetween(i[0],i[1],r):this.isSame(i,"day"))}isBetween(e,r,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"[)":return this.midnight_ts(this)>=this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"(]":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<=this.midnight_ts(r);case"[]":return this.midnight_ts()>=this.midnight_ts(e)&&this.midnight_ts()<=this.midnight_ts(r)}}isBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return e.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(e.getFullYear(),e.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>e.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()+e);break;case"month":case"months":this.setMonth(this.getMonth()+e)}return this}subtract(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()-e);break;case"month":case"months":this.setMonth(this.getMonth()-e)}return this}diff(e,r="days"){switch(r){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(e))/864e5);case"month":case"months":let i=12*(e.getFullYear()-this.getFullYear());return i-=e.getMonth(),i+=this.getMonth(),i}}format(e,r="en-US"){let i="",o=[],a=null;for(;(a=We.regex.exec(e))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(let[s,u]of Object.entries(o)){let l=Number(s);i+=this.formatTokens(u[0],r),o[l+1]&&(i+=e.substring(u.index+u[0].length,o[l+1].index)),l===o.length-1&&(i+=e.substring(u.index+u[0].length))}}return i.replace(/\\/g,"")}midnight_ts(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(e,r){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return We.shortMonths(r)[this.getMonth()];case"MMMM":return We.longMonths(r)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||this.getHours()===24?"am":"pm";case"A":return this.getHours()<12||this.getHours()===24?"AM":"PM";default:return""}}};H(We,"regex",/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g),H(We,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var de=We,fc=class{constructor(t){H(this,"picker");this.picker=t}render(t,e){t||(t=new de),t.setDate(1),t.setHours(0,0,0,0),typeof this[`get${e}View`]=="function"&&this[`get${e}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){let e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),typeof this.picker.options.header=="string"&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){let e=document.createElement("main");this.picker.ui.container.appendChild(e);let r=document.createElement("div");r.className=`calendars grid-${this.picker.options.grid}`;for(let i=0;i<this.picker.options.calendars;i++){let o=document.createElement("div");o.className="calendar",r.appendChild(o);let a=this.getCalendarHeaderView(t.clone());o.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:i,target:a});let s=this.getCalendarDayNamesView();o.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:i,target:s});let u=this.getCalendarDaysView(t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:u});let l=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:l}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:i,target:o}),t.add(1,"month")}e.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:r}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){let e=document.createElement("footer"),r=document.createElement("div");r.className="footer-buttons";let i=document.createElement("button");i.className="cancel-button unit",i.innerHTML=this.picker.options.locale.cancel,r.appendChild(i);let o=document.createElement("button");o.className="apply-button unit",o.innerHTML=this.picker.options.locale.apply,o.disabled=!0,r.appendChild(o),e.appendChild(r),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){let e=document.createElement("div");e.className="header";let r=document.createElement("div");r.className="month-name",r.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span> ${t.format("YYYY")}`,e.appendChild(r);let i=document.createElement("button");i.className="previous-button unit",i.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(i);let o=document.createElement("button");return o.className="next-button unit",o.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(o),e}getCalendarDayNamesView(){let t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){let r=3+this.picker.options.firstDay+e,i=document.createElement("div");i.className="dayname",i.innerHTML=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),i.title=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(i),this.picker.trigger("view",{dayIdx:r,view:"CalendarDayName",target:i})}return t}getCalendarDaysView(t){let e=document.createElement("div");e.className="days-grid";let r=this.calcOffsetDays(t,this.picker.options.firstDay),i=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let o=0;o<r;o++){let a=document.createElement("div");a.className="offset",e.appendChild(a)}for(let o=1;o<=i;o++){t.setDate(o);let a=this.getCalendarDayView(t);e.appendChild(a),this.picker.trigger("view",{date:t,view:"CalendarDay",target:a})}return e}getCalendarDayView(t){let e=this.picker.options.date?new de(this.picker.options.date):null,r=new de,i=document.createElement("div");return i.className="day unit",i.innerHTML=t.format("D"),i.dataset.time=String(t.getTime()),t.isSame(r,"day")&&i.classList.add("today"),[0,6].includes(t.getDay())&&i.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&i.classList.add("selected"):e&&t.isSame(e,"day")&&i.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:i}),i}getCalendarFooterView(t,e){let r=document.createElement("div");return r.className="footer",r}calcOffsetDays(t,e){let r=t.getDay()-e;return r<0&&(r+=7),r}},pc=class{constructor(t){H(this,"picker");H(this,"instances",{});this.picker=t}initialize(){let t=[];this.picker.options.plugins.forEach(e=>{typeof e=="function"?t.push(new e):typeof e=="string"&&typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick: ${e} not found.`)}),t.sort((e,r)=>e.priority>r.priority?-1:e.priority<r.priority||e.dependencies.length>r.dependencies.length?1:e.dependencies.length<r.dependencies.length?-1:0),t.forEach(e=>{e.attach(this.picker),this.instances[e.getName()]=e})}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick: ${t} already added.`);else{if(typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,t)){let e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if(this.getPluginFn(t)!=="undefined"){let e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick: ${t} not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter(e=>typeof e=="function"&&new e().getName()===t).shift()}},sa=class{constructor(t){H(this,"Calendar",new fc(this));H(this,"PluginManager",new pc(this));H(this,"calendars",[]);H(this,"datePicked",[]);H(this,"cssLoaded",0);H(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});H(this,"options",{doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]});H(this,"ui",{container:null,shadowRoot:null,wrapper:null});H(this,"version","1.2.1");let e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),typeof this.options.setup=="function"&&this.options.setup(this),this.on("click",this.onClick.bind(this));let r=this.options.scrollToDate?this.getDate():null;this.renderAll(r)}on(t,e,r={}){this.ui.container.addEventListener(t,e,r)}off(t,e,r={}){this.ui.container.removeEventListener(t,e,r)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),typeof this.options.documentClick=="function"&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach(t=>{this.PluginManager.removeInstance(t)}),this.ui.wrapper.remove()}onRender(t){let{view:e,date:r}=t.detail;this.Calendar.render(r,e)}onView(t){let{view:e,target:r}=t.detail;e==="Footer"&&this.datePicked.length&&(r.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){let e=new de(t.dataset.time);this.options.autoApply?(this.setDate(e),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=e,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){let e=this.datePicked[0].clone();this.setDate(e)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){let e=t.target;if(e instanceof HTMLElement){let r=e.closest(".unit");if(!(r instanceof HTMLElement))return;this.onClickHeaderButton(r),this.onClickCalendarDay(r),this.onClickApplyButton(r),this.onClickCancelButton(r)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;let e=t&&"target"in t?t.target:this.options.element,{top:r,left:i}=this.adjustPosition(e);this.ui.container.style.top=`${r}px`,this.ui.container.style.left=`${i}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){let e=new de(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof de?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){let t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",r=this.options.element;r instanceof HTMLInputElement?r.value=e:r instanceof HTMLElement&&(r.innerText=e)}hidePicker(t){let e=t.target,r=null;e.shadowRoot&&(e=t.composedPath()[0],r=e.getRootNode().host),this.isShown()&&r!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some(e=>t.classList.contains(e))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){let e=new de(t,this.options.format);e.setDate(1),this.calendars[0]=e.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new de(this.options.date,this.options.format):this.calendars[0]=new de}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach(t=>{let e=document.createElement("link");e.href=t,e.rel="stylesheet";let r=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",r),e.addEventListener("error",r),this.ui.shadowRoot.append(e)});else if(typeof this.options.css=="string"){let t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else typeof this.options.css=="function"&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){let e=t.getBoundingClientRect(),r=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");let i=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let o=e.bottom-r.bottom,a=e.left-r.left;return typeof window<"u"&&(window.innerHeight<o+i.height&&o-i.height>=0&&(o=e.top-r.top-i.height),window.innerWidth<a+i.width&&e.right-i.width>=0&&(a=e.right-r.right-i.width)),{left:a,top:o}}},da=Object.freeze({__proto__:null,Core:sa,create:sa}),to=class{constructor(){H(this,"picker");H(this,"options");H(this,"priority",0);H(this,"dependencies",[])}attach(t){let e=this.getName(),r={...this.options};this.options={...this.options,...t.options[e]||{}};for(let o of Object.keys(r))if(r[o]!==null&&typeof r[o]=="object"&&Object.keys(r[o]).length&&e in t.options&&o in t.options[e]){let a={...t.options[e][o]};a!==null&&typeof a=="object"&&Object.keys(a).length&&Object.keys(a).every(s=>Object.keys(r[o]).includes(s))&&(this.options[o]={...r[o],...a})}if(this.picker=t,this.dependenciesNotFound()){let o=this.dependencies.filter(a=>!this.pluginsAsStringArray().includes(a));return void console.warn(`${this.getName()}: required dependencies (${o.join(", ")}).`)}let i=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(i),this.onAttach()}detach(){let t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),typeof this.onDetach=="function"&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every(t=>this.pluginsAsStringArray().includes(t))}pluginsAsStringArray(){return this.picker.options.plugins.map(t=>typeof t=="function"?new t().getName():t)}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}},ca=class extends to{constructor(){super(...arguments);H(this,"priority",1);H(this,"binds",{onView:this.onView.bind(this)});H(this,"options",{minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null})}getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new de(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new de(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof de&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){let e=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(e)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){let e=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}: options ${e.join(", ")} required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(e){let{view:r,target:i,date:o}=e.detail;if(r==="CalendarHeader"&&(this.options.minDate instanceof de&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof de&&o.isSameOrAfter(this.options.maxDate,"month")&&i.classList.add("no-next-month")),r==="CalendarDay"){let a=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(o))return void i.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){let s=o.clone().subtract(this.options.minDays-1,"day"),u=o.clone().add(this.options.minDays-1,"day"),l=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){l=!0;break}s.add(1,"day")}for(;u.isAfter(o,"day");){if(this.testFilter(u)){h=!0;break}u.subtract(1,"day")}l&&h&&i.classList.add("not-available")}this.rangeIsNotAvailable(o,a)&&i.classList.add("not-available")}this.dateIsNotAvailable(o,a)&&i.classList.add("not-available")}if(this.options.presets&&r==="PresetPluginButton"){let a=new de(Number(i.dataset.start)),s=new de(Number(i.dataset.end)),u=s.diff(a,"day"),l=this.options.minDays&&u<this.options.minDays,h=this.options.maxDays&&u>this.options.maxDays;(l||h||this.lockMinDate(a)||this.lockMaxDate(a)||this.lockMinDate(s)||this.lockMaxDate(s)||this.rangeIsNotAvailable(a,s))&&i.setAttribute("disabled","disabled")}}dateIsNotAvailable(e,r){return this.lockMinDate(e)||this.lockMaxDate(e)||this.lockMinDays(e,r)||this.lockMaxDays(e,r)||this.lockSelectForward(e)||this.lockSelectBackward(e)}rangeIsNotAvailable(e,r){if(!e||!r)return!1;let i=(e.isSameOrBefore(r,"day")?e:r).clone(),o=(r.isSameOrAfter(e,"day")?r:e).clone();for(;i.isSameOrBefore(o,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(e){return this.options.minDate instanceof de&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof de&&e.isAfter(this.options.maxDate,"day")}lockMinDays(e,r){if(this.options.minDays&&r){let i=r.clone().subtract(this.options.minDays-1,"day"),o=r.clone().add(this.options.minDays-1,"day");return e.isBetween(i,o)}return!1}lockMaxDays(e,r){if(this.options.maxDays&&r){let i=r.clone().subtract(this.options.maxDays,"day"),o=r.clone().add(this.options.maxDays,"day");return!e.isBetween(i,o)}return!1}lockSelectForward(e){if(this.picker.datePicked.length===1&&this.options.selectForward){let r=this.picker.datePicked[0].clone();return e.isBefore(r,"day")}return!1}lockSelectBackward(e){if(this.picker.datePicked.length===1&&this.options.selectBackward){let r=this.picker.datePicked[0].clone();return e.isAfter(r,"day")}return!1}testFilter(e){return typeof this.options.filter=="function"&&this.options.filter(e,this.picker.datePicked)}};var la=class extends to{constructor(){super(...arguments);H(this,"tooltipElement");H(this,"triggerElement");H(this,"binds",{setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)});H(this,"options",{elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:e=>e,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)})}getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateValues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),typeof this.picker.options.documentClick=="function"&&(document.removeEventListener("click",this.picker.options.documentClick,!0),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){let[e,r]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?e&&r&&this.setDateRange(e,r):(e&&this.setStartDate(e),r&&this.setEndDate(r))}}updateValues(){let e=this.picker.options.element,r=this.options.elementEnd,i=this.picker.getStartDate(),o=this.picker.getEndDate(),a=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",s=o instanceof Date?o.format(this.picker.options.format,this.picker.options.lang):"";if(r)e instanceof HTMLInputElement?e.value=a:e instanceof HTMLElement&&(e.innerText=a),r instanceof HTMLInputElement?r.value=s:r instanceof HTMLElement&&(r.innerText=s);else{let u=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=u:e instanceof HTMLElement&&(e.innerText=u)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(e){let{target:r}=e.detail;this.triggerElement=r,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(e){let{view:r,target:i}=e.detail;if(r==="Main"&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",i.appendChild(this.tooltipElement)),r==="CalendarDay"){let o=new de(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),u=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&u&&(u.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,u)&&i.classList.add("in-range"))}if(r==="Footer"){let o=this.picker.datePicked.length===1&&!this.options.strict||this.picker.datePicked.length===2;i.querySelector(".apply-button").disabled=!o}}hidePicker(e){let r=e.target,i=null;r.shadowRoot&&(r=e.composedPath()[0],i=r.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&r!==this.picker.options.element&&r!==this.options.elementEnd&&this.picker.hide()}setStartDate(e){let r=new de(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new de(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new de(e,this.picker.options.format),o=new de(r,this.picker.options.format);this.options.startDate=i?i.clone():null,this.options.endDate=o?o.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(e){let r=e.target;if(r instanceof HTMLElement){this.isContainer(r)&&this.initializeRepick();let i=r.closest(".unit");if(!(i instanceof HTMLElement))return;if(this.picker.isCalendarDay(i)){if(this.picker.datePicked.length!==1)return;let o=this.picker.datePicked[0].clone(),a=new de(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let u=o.clone();o=a.clone(),a=u.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(u=>{let l=new de(u.dataset.time),h=this.picker.Calendar.getCalendarDayView(l);l.isBetween(o,a)&&h.classList.add("in-range"),l.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),u===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),u.className=h.className}),this.options.tooltip){let u=this.options.tooltipNumber(a.diff(o,"day")+1);if(u>0){let l=new Intl.PluralRules(this.picker.options.lang).select(u),h=`${u} ${this.options.locale[l]}`;this.showTooltip(i,h)}else this.hideTooltip()}}}}onMouseLeave(e){if(this.isContainer(e.target)&&this.options.repick){let r=this.getStartDate(),i=this.getEndDate();r&&i&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(e){if(this.picker.isCalendarDay(e)){this.picker.datePicked.length===2&&(this.picker.datePicked.length=0);let r=new de(e.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=r,this.picker.datePicked.length===2&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){let i=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=i.clone()}this.picker.datePicked.length!==1&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),this.picker.datePicked.length===1&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),this.picker.datePicked.length===2&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(e){this.picker.isApplyButton(e)&&(this.picker.datePicked.length!==1||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),this.picker.datePicked.length===2&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(e,r){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=r;let i=this.picker.ui.container.getBoundingClientRect(),o=this.tooltipElement.getBoundingClientRect(),a=e.getBoundingClientRect(),s=a.top,u=a.left;s-=i.top,u-=i.left,s-=o.height,u-=o.width/2,u+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${u}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;let e=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],r=Object.keys(this.options.locale);e.every(i=>r.includes(i))||console.warn(`${this.getName()}: provide locales (${e.join(", ")}) for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;let e=this.getStartDate(),r=this.getEndDate();r&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=r),e&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=e)}isContainer(e){return e===this.picker.ui.container}};var ua=class extends to{constructor(){super(...arguments);H(this,"rangePlugin");H(this,"lockPlugin");H(this,"priority",10);H(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});H(this,"options",{dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}});H(this,"matchMedia")}getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(e){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(e),this.handleResetButton(e),this.handleWeekNumbers(e)}onColorScheme(e){let r=e.matches?"dark":"light";this.picker.ui.container.dataset.theme=r}handleDropdown(e){let{view:r,target:i,date:o,index:a}=e.detail;if(r==="CalendarHeader"){let s=i.querySelector(".month-name");if(this.options.dropdown.months){s.childNodes[0].remove();let u=document.createElement("select");u.className="month-name--select month-name--dropdown";for(let l=0;l<12;l+=1){let h=document.createElement("option"),f=new de(new Date(o.getFullYear(),l,2,0,0,0)),g=new de(new Date(o.getFullYear(),l,1,0,0,0));h.value=String(l),h.text=f.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&g.isBefore(new de(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&g.isAfter(new de(this.lockPlugin.options.maxDate),"month")),h.selected=g.getMonth()===o.getMonth(),u.appendChild(h)}u.addEventListener("change",l=>{let h=l.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(u)}if(this.options.dropdown.years){s.childNodes[1].remove();let u=document.createElement("select");u.className="month-name--select";let l=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,u.appendChild(f)}for(let f=h;f>=l;f-=1){let g=document.createElement("option"),E=new de(new Date(f,0,1,0,0,0));g.value=String(f),g.text=String(f),this.lockPlugin&&(g.disabled=this.lockPlugin.options.minDate&&E.isBefore(new de(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&E.isAfter(new de(this.lockPlugin.options.maxDate),"year")),g.selected=o.getFullYear()===f,u.appendChild(g)}if(o.getFullYear()<l){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,u.appendChild(f)}if(this.options.dropdown.years==="asc"){let f=Array.prototype.slice.call(u.childNodes).reverse();u.innerHTML="",f.forEach(g=>{g.innerHTML=g.value,u.appendChild(g)})}u.addEventListener("change",f=>{let g=f.target;this.picker.calendars[0].setFullYear(Number(g.value)),this.picker.renderAll()}),s.appendChild(u)}}}handleResetButton(e){let{view:r,target:i}=e.detail;if(r==="CalendarHeader"&&this.options.resetButton){let o=document.createElement("button");o.className="reset-button unit",o.innerHTML=this.options.locale.resetButton,o.addEventListener("click",a=>{a.preventDefault();let s=!0;typeof this.options.resetButton=="function"&&(s=this.options.resetButton.call(this)),s&&this.picker.clear()}),i.appendChild(o)}}handleWeekNumbers(e){if(this.options.weekNumbers){let{view:r,target:i}=e.detail;if(r==="CalendarDayNames"){let o=document.createElement("div");o.className="wnum-header",o.innerHTML="Wk",i.prepend(o)}r==="CalendarDays"&&[...i.children].forEach((o,a)=>{if(a===0||a%7==0){let s;if(o.classList.contains("day"))s=new de(o.dataset.time);else{let h=i.querySelector(".day");s=new de(h.dataset.time)}let u=s.getWeek(this.picker.options.firstDay);u===53&&s.getMonth()===0&&(u="53/1");let l=document.createElement("div");l.className="wnum-item",l.innerHTML=String(u),i.insertBefore(l,o)}})}}};var ha=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Kn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var ma={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},fa=ma;var nt=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},At=function(n){return n===!0?1:0};function gc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var pa=function(n){return n instanceof Array?n:[n]};function rt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function De(n,t,e){var r=window.document.createElement(n);return t=t||"",e=e||"",r.className=t,e!==void 0&&(r.textContent=e),r}function no(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function yc(n,t){if(t(n))return n;if(n.parentNode)return yc(n.parentNode,t)}function ro(n,t){var e=De("div","numInputWrapper"),r=De("input","numInput "+n),i=De("span","arrowUp"),o=De("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return e.appendChild(r),e.appendChild(i),e.appendChild(o),e}function Lt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var vc=function(){},io=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},nd={D:vc,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*At(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var r=parseInt(t),i=new Date(n.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+e.firstDayOfWeek),i},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:vc,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},u:function(n,t){return new Date(parseFloat(t))},w:vc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Pn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Ur={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[Ur.w(n,t,e)]},F:function(n,t,e){return io(Ur.n(n,t,e)-1,!1,t)},G:function(n,t,e){return nt(Ur.h(n,t,e))},H:function(n){return nt(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[At(n.getHours()>11)]},M:function(n,t){return io(n.getMonth(),!0,t)},S:function(n){return nt(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return nt(n.getFullYear(),4)},d:function(n){return nt(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return nt(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return nt(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}};var wc=function(n){var t=n.config,e=t===void 0?Kn:t,r=n.l10n,i=r===void 0?ma:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,u,l){var h=l||i;return e.formatDate!==void 0&&!a?e.formatDate(s,u,h):u.split("").map(function(f,g,E){return Ur[f]&&E[g-1]!=="\\"?Ur[f](s,h,e):f!=="\\"?f:""}).join("")}},ga=function(n){var t=n.config,e=t===void 0?Kn:t,r=n.l10n,i=r===void 0?ma:r;return function(o,a,s,u){if(!(o!==0&&!o)){var l=u||i,h,f=o;if(o instanceof Date)h=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)h=new Date(o);else if(typeof o=="string"){var g=a||(e||Kn).dateFormat,E=String(o).trim();if(E==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,g);else if(/Z$/.test(E)||/GMT$/.test(E))h=new Date(o);else{for(var S=void 0,k=[],A=0,B=0,V="";A<g.length;A++){var G=g[A],U=G==="\\",J=g[A-1]==="\\"||U;if(Pn[G]&&!J){V+=Pn[G];var oe=new RegExp(V).exec(o);oe&&(S=!0)&&k[G!=="Y"?"push":"unshift"]({fn:nd[G],val:oe[++B]})}else U||(V+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),k.forEach(function(ke){var Me=ke.fn,ie=ke.val;return h=Me(h,ie,l)||h}),h=S?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+f));return}return s===!0&&h.setHours(0,0,0,0),h}}};function Nt(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var rd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ya=function(n,t,e){return n*3600+t*60+e},id=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},od={DAY:864e5};function va(n){var t=n.defaultHour,e=n.defaultMinute,r=n.defaultSeconds;if(n.minDate!==void 0){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();t<i&&(t=i),t===i&&e<o&&(e=o),t===i&&e===o&&r<a&&(r=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),u=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(u,e)),t===s&&e===u&&(r=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(u){return n[u]=s[u]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var it=function(){return it=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},it.apply(this,arguments)},ad=function(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;for(var r=Array(n),i=0,t=0;t<e;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},fm=300;function pm(n,t){var e={config:it(it({},Kn),ze.defaultConfig),l10n:fa};e.parseDate=ga({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=k,e._setHoursFromDate=g,e._positionCalendar=Rn,e.changeMonth=_,e.changeYear=ee,e.clear=I,e.close=C,e.onMouseOver=pe,e._createElement=De,e.createDay=oe,e.destroy=F,e.isEnabled=q,e.jumpToDate=V,e.updateValue=fn,e.open=Re,e.redraw=so,e.set=ud,e.setDate=dd,e.toggle=pd;function r(){e.utils={getDaysInMonth:function(p,w){return p===void 0&&(p=e.currentMonth),w===void 0&&(w=e.currentYear),p===1&&(w%4===0&&w%100!==0||w%400===0)?29:e.l10n.daysInMonth[p]}}}function i(){e.element=e.input=n,e.isOpen=!1,Xe(),Gn(),md(),hd(),r(),e.isMobile||J(),B(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&g(e.config.noCalendar?e.latestSelectedDateObj:void 0),fn(!1)),s();var p=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&p&&Rn(),Ne("onReady")}function o(){var p;return((p=e.calendarContainer)===null||p===void 0?void 0:p.getRootNode()).activeElement||document.activeElement}function a(p){return p.bind(e)}function s(){var p=e.config;p.weekNumbers===!1&&p.showMonths===1||p.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var w=(e.days.offsetWidth+1)*p.showMonths;e.daysContainer.style.width=w+"px",e.calendarContainer.style.width=w+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function u(p){if(e.selectedDates.length===0){var w=e.config.minDate===void 0||Nt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=va(e.config);w.setHours(M.hours,M.minutes,M.seconds,w.getMilliseconds()),e.selectedDates=[w],e.latestSelectedDateObj=w}p!==void 0&&p.type!=="blur"&&vd(p);var P=e._input.value;f(),fn(),e._input.value!==P&&e._debouncedChange()}function l(p,w){return p%12+12*At(w===e.l10n.amPM[1])}function h(p){switch(p%24){case 0:case 12:return 12;default:return p%12}}function f(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var p=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,w=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(p=l(p,e.amPM.textContent));var P=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var K=ya(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),he=ya(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Q=ya(p,w,M);if(Q>he&&Q<K){var ge=id(K);p=ge[0],w=ge[1],M=ge[2]}}else{if(z){var X=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;p=Math.min(p,X.getHours()),p===X.getHours()&&(w=Math.min(w,X.getMinutes())),w===X.getMinutes()&&(M=Math.min(M,X.getSeconds()))}if(P){var ae=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;p=Math.max(p,ae.getHours()),p===ae.getHours()&&w<ae.getMinutes()&&(w=ae.getMinutes()),w===ae.getMinutes()&&(M=Math.max(M,ae.getSeconds()))}}E(p,w,M)}}function g(p){var w=p||e.latestSelectedDateObj;w&&w instanceof Date&&E(w.getHours(),w.getMinutes(),w.getSeconds())}function E(p,w,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(p%24,w,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=nt(e.config.time_24hr?p:(12+p)%12+12*At(p%12===0)),e.minuteElement.value=nt(w),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[At(p>=12)]),e.secondElement!==void 0&&(e.secondElement.value=nt(M)))}function S(p){var w=Lt(p),M=parseInt(w.value)+(p.delta||0);(M/1e3>1||p.key==="Enter"&&!/[^\d]/.test(M.toString()))&&ee(M)}function k(p,w,M,P){if(w instanceof Array)return w.forEach(function(z){return k(p,z,M,P)});if(p instanceof Array)return p.forEach(function(z){return k(z,w,M,P)});p.addEventListener(w,M,P),e._handlers.push({remove:function(){return p.removeEventListener(w,M,P)}})}function A(){Ne("onChange")}function B(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(P){return k(P,"click",e[M])})}),e.isMobile){fd();return}var p=gc(we,50);if(e._debouncedChange=gc(A,fm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&k(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&pe(Lt(M))}),k(e._input,"keydown",le),e.calendarContainer!==void 0&&k(e.calendarContainer,"keydown",le),!e.config.inline&&!e.config.static&&k(window,"resize",p),window.ontouchstart!==void 0?k(window.document,"touchstart",W):k(window.document,"mousedown",W),k(window.document,"focus",W,{capture:!0}),e.config.clickOpens===!0&&(k(e._input,"focus",e.open),k(e._input,"click",e.open)),e.daysContainer!==void 0&&(k(e.monthNav,"click",yd),k(e.monthNav,["keyup","increment"],S),k(e.daysContainer,"click",bc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var w=function(M){return Lt(M).select()};k(e.timeContainer,["increment"],u),k(e.timeContainer,"blur",u,{capture:!0}),k(e.timeContainer,"click",G),k([e.hourElement,e.minuteElement],["focus","click"],w),e.secondElement!==void 0&&k(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&k(e.amPM,"click",function(M){u(M)})}e.config.allowInput&&k(e._input,"blur",re)}function V(p,w){var M=p!==void 0?e.parseDate(p):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),P=e.currentYear,z=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(K){K.message="Invalid date supplied: "+M,e.config.errorHandler(K)}w&&e.currentYear!==P&&(Ne("onYearChange"),ne()),w&&(e.currentYear!==P||e.currentMonth!==z)&&Ne("onMonthChange"),e.redraw()}function G(p){var w=Lt(p);~w.className.indexOf("arrow")&&U(p,w.classList.contains("arrowUp")?1:-1)}function U(p,w,M){var P=p&&Lt(p),z=M||P&&P.parentNode&&P.parentNode.firstChild,K=Da("increment");K.delta=w,z&&z.dispatchEvent(K)}function J(){var p=window.document.createDocumentFragment();if(e.calendarContainer=De("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(p.appendChild(c()),e.innerContainer=De("div","flatpickr-innerContainer"),e.config.weekNumbers){var w=b(),M=w.weekWrapper,P=w.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=P,e.weekWrapper=M}e.rContainer=De("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=De("div","flatpickr-days"),e.daysContainer.tabIndex=-1),O(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),p.appendChild(e.innerContainer)}e.config.enableTime&&p.appendChild(d()),rt(e.calendarContainer,"rangeMode",e.config.mode==="range"),rt(e.calendarContainer,"animate",e.config.animate===!0),rt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(p);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var K=De("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(K,e.element),K.appendChild(e.element),e.altInput&&K.appendChild(e.altInput),K.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function oe(p,w,M,P){var z=q(w,!0),K=De("span",p,w.getDate().toString());return K.dateObj=w,K.$i=P,K.setAttribute("aria-label",e.formatDate(w,e.config.ariaDateFormat)),p.indexOf("hidden")===-1&&Nt(w,e.now)===0&&(e.todayDateElem=K,K.classList.add("today"),K.setAttribute("aria-current","date")),z?(K.tabIndex=-1,Ea(w)&&(K.classList.add("selected"),e.selectedDateElem=K,e.config.mode==="range"&&(rt(K,"startRange",e.selectedDates[0]&&Nt(w,e.selectedDates[0],!0)===0),rt(K,"endRange",e.selectedDates[1]&&Nt(w,e.selectedDates[1],!0)===0),p==="nextMonthDay"&&K.classList.add("inRange")))):K.classList.add("flatpickr-disabled"),e.config.mode==="range"&&gd(w)&&!Ea(w)&&K.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&p!=="prevMonthDay"&&P%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(w)+"</span>"),Ne("onDayCreate",K),K}function ke(p){p.focus(),e.config.mode==="range"&&pe(p)}function Me(p){for(var w=p>0?0:e.config.showMonths-1,M=p>0?e.config.showMonths:-1,P=w;P!=M;P+=p)for(var z=e.daysContainer.children[P],K=p>0?0:z.children.length-1,he=p>0?z.children.length:-1,Q=K;Q!=he;Q+=p){var ge=z.children[Q];if(ge.className.indexOf("hidden")===-1&&q(ge.dateObj))return ge}}function ie(p,w){for(var M=p.className.indexOf("Month")===-1?p.dateObj.getMonth():e.currentMonth,P=w>0?e.config.showMonths:-1,z=w>0?1:-1,K=M-e.currentMonth;K!=P;K+=z)for(var he=e.daysContainer.children[K],Q=M-e.currentMonth===K?p.$i+w:w<0?he.children.length-1:0,ge=he.children.length,X=Q;X>=0&&X<ge&&X!=(w>0?ge:-1);X+=z){var ae=he.children[X];if(ae.className.indexOf("hidden")===-1&&q(ae.dateObj)&&Math.abs(p.$i-X)>=Math.abs(w))return ke(ae)}e.changeMonth(z),N(Me(z),0)}function N(p,w){var M=o(),P=j(M||document.body),z=p!==void 0?p:P?M:e.selectedDateElem!==void 0&&j(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&j(e.todayDateElem)?e.todayDateElem:Me(w>0?1:-1);z===void 0?e._input.focus():P?ie(z,w):ke(z)}function Y(p,w){for(var M=(new Date(p,w,1).getDay()-e.l10n.firstDayOfWeek+7)%7,P=e.utils.getDaysInMonth((w-1+12)%12,p),z=e.utils.getDaysInMonth(w,p),K=window.document.createDocumentFragment(),he=e.config.showMonths>1,Q=he?"prevMonthDay hidden":"prevMonthDay",ge=he?"nextMonthDay hidden":"nextMonthDay",X=P+1-M,ae=0;X<=P;X++,ae++)K.appendChild(oe("flatpickr-day "+Q,new Date(p,w-1,X),X,ae));for(X=1;X<=z;X++,ae++)K.appendChild(oe("flatpickr-day",new Date(p,w,X),X,ae));for(var Te=z+1;Te<=42-M&&(e.config.showMonths===1||ae%7!==0);Te++,ae++)K.appendChild(oe("flatpickr-day "+ge,new Date(p,w+1,Te%z),Te,ae));var rn=De("div","dayContainer");return rn.appendChild(K),rn}function O(){if(e.daysContainer!==void 0){no(e.daysContainer),e.weekNumbers&&no(e.weekNumbers);for(var p=document.createDocumentFragment(),w=0;w<e.config.showMonths;w++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),p.appendChild(Y(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(p),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&pe()}}function ne(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var p=function(P){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&P<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&P>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var w=0;w<12;w++)if(p(w)){var M=De("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,w).getMonth().toString(),M.textContent=io(w,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===w&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function y(){var p=De("div","flatpickr-month"),w=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=De("span","cur-month"):(e.monthsDropdownContainer=De("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),k(e.monthsDropdownContainer,"change",function(he){var Q=Lt(he),ge=parseInt(Q.value,10);e.changeMonth(ge-e.currentMonth),Ne("onMonthChange")}),ne(),M=e.monthsDropdownContainer);var P=ro("cur-year",{tabindex:"-1"}),z=P.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var K=De("div","flatpickr-current-month");return K.appendChild(M),K.appendChild(P),w.appendChild(K),p.appendChild(w),{container:p,yearElement:z,monthElement:M}}function L(){no(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var p=e.config.showMonths;p--;){var w=y();e.yearElements.push(w.yearElement),e.monthElements.push(w.monthElement),e.monthNav.appendChild(w.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=De("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=De("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=De("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,L(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(p){e.__hidePrevMonthArrow!==p&&(rt(e.prevMonthNav,"flatpickr-disabled",p),e.__hidePrevMonthArrow=p)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(p){e.__hideNextMonthArrow!==p&&(rt(e.nextMonthNav,"flatpickr-disabled",p),e.__hideNextMonthArrow=p)}}),e.currentYearElement=e.yearElements[0],lo(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var p=va(e.config);e.timeContainer=De("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var w=De("span","flatpickr-time-separator",":"),M=ro("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var P=ro("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=P.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=nt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?p.hours:h(p.hours)),e.minuteElement.value=nt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():p.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(M),e.timeContainer.appendChild(w),e.timeContainer.appendChild(P),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=ro("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=nt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():p.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(De("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=De("span","flatpickr-am-pm",e.l10n.amPM[At((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function v(){e.weekdayContainer?no(e.weekdayContainer):e.weekdayContainer=De("div","flatpickr-weekdays");for(var p=e.config.showMonths;p--;){var w=De("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(w)}return D(),e.weekdayContainer}function D(){if(e.weekdayContainer){var p=e.l10n.firstDayOfWeek,w=ad(e.l10n.weekdays.shorthand);p>0&&p<w.length&&(w=ad(w.splice(p,w.length),w.splice(0,p)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
1
+ "use strict";(()=>{var Cd=Object.create;var Ma=Object.defineProperty;var Id=Object.getOwnPropertyDescriptor;var xd=Object.getOwnPropertyNames;var Pd=Object.getPrototypeOf,Rd=Object.prototype.hasOwnProperty;var Ad=(n,t,e)=>t in n?Ma(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Ld=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Nd=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xd(t))!Rd.call(n,i)&&i!==e&&Ma(n,i,{get:()=>t[i],enumerable:!(r=Id(t,i))||r.enumerable});return n};var Od=(n,t,e)=>(e=n!=null?Cd(Pd(n)):{},Nd(t||!n||!n.__esModule?Ma(e,"default",{value:n,enumerable:!0}):e,n));var Y=(n,t,e)=>(Ad(n,typeof t!="symbol"?t+"":t,e),e);var _c=Ld((Sa,ka)=>{(function(n,t){typeof Sa=="object"&&typeof ka<"u"?ka.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(Sa,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(N,H){(H==null||H>N.length)&&(H=N.length);for(var O=0,ne=Array(H);O<H;O++)ne[O]=N[O];return ne}function r(N){if(Array.isArray(N))return N}function i(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function o(N,H,O){return H=f(H),B(N,S()?Reflect.construct(H,O||[],f(N).constructor):H.apply(N,O))}function a(N,H){if(!(N instanceof H))throw new TypeError("Cannot call a class as a function")}function s(N,H,O){if(S())return Reflect.construct.apply(null,arguments);var ne=[null];ne.push.apply(ne,H);var y=new(N.bind.apply(N,ne));return O&&V(y,O.prototype),y}function u(N,H){for(var O,ne=0;ne<H.length;ne++)O=H[ne],O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,J(O.key),O)}function l(N,H,O){return H&&u(N.prototype,H),O&&u(N,O),Object.defineProperty(N,"prototype",{writable:!1}),N}function h(N,H){var O=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!O){if(Array.isArray(N)||(O=ke(N))||H&&N&&typeof N.length=="number"){O&&(N=O);var ne=0,y=function(){};return{s:y,n:function(){return ne>=N.length?{done:!0}:{done:!1,value:N[ne++]}},e:function(v){throw v},f:y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L,c=!0,d=!1;return{s:function(){O=O.call(N)},n:function(){var v=O.next();return c=v.done,v},e:function(v){d=!0,L=v},f:function(){try{c||O.return==null||O.return()}finally{if(d)throw L}}}}function f(N){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(H){return H.__proto__||Object.getPrototypeOf(H)},f(N)}function g(N,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(H&&H.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),H&&V(N,H)}function E(N){try{return Function.toString.call(N).indexOf("[native code]")!==-1}catch{return typeof N=="function"}}function S(){try{var N=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S=function(){return!!N})()}function k(N,H){var O=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(O!=null){var ne,y,L,c,d=[],v=!0,D=!1;try{if(L=(O=O.call(N)).next,H===0){if(Object(O)!==O)return;v=!1}else for(;!(v=(ne=L.call(O)).done)&&(d.push(ne.value),d.length!==H);v=!0);}catch(b){D=!0,y=b}finally{try{if(!v&&O.return!=null&&(c=O.return(),Object(c)!==c))return}finally{if(D)throw y}}return d}}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(N,H){if(H&&(typeof H=="object"||typeof H=="function"))return H;if(H!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(N)}function V(N,H){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,ne){return O.__proto__=ne,O},V(N,H)}function G(N,H){return r(N)||k(N,H)||ke(N,H)||A()}function U(N,H){if(typeof N!="object"||!N)return N;var O=N[Symbol.toPrimitive];if(O!==void 0){var ne=O.call(N,H||"default");if(typeof ne!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(N)}function J(N){var H=U(N,"string");return typeof H=="symbol"?H:H+""}function oe(N){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},oe(N)}function ke(N,H){if(N){if(typeof N=="string")return e(N,H);var O={}.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?e(N,H):void 0}}function Me(N){var H=typeof Map=="function"?new Map:void 0;return Me=function(O){function ne(){return s(O,arguments,f(this).constructor)}if(O===null||!E(O))return O;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(H!==void 0){if(H.has(O))return H.get(O);H.set(O,ne)}return ne.prototype=Object.create(O.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),V(ne,O)},Me(N)}var ie=function(N){var H=Math.abs,O=Math.max,ne=Math.floor;function y(L,c){var d;if(a(this,y),d=o(this,y,[L]),d.sign=c,Object.setPrototypeOf(d,y.prototype),L>y.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return g(y,N),l(y,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var D=c.value;d.push((D&&(D>>>0).toString(16))+", ")}}catch(b){v.e(b)}finally{v.f()}return d.push("]"),d.join("")}},{key:"toString",value:function(){var c=0<arguments.length&&arguments[0]!==void 0?arguments[0]:10;if(2>c||36<c)throw new RangeError("toString() radix argument must be between 2 and 36");return this.length===0?"0":c&c-1?y.__toStringGeneric(this,c,!1):y.__toStringBasePowerOfTwo(this,c)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var c=new y(this.length,this.sign),d=0;d<this.length;d++)c[d]=this[d];return c}},{key:"__trim",value:function(){for(var c=this.length,d=this[c-1];d===0;)c--,d=this[c-1],this.pop();return c===0&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var c=0;c<this.length;c++)this[c]=0}},{key:"__clzmsd",value:function(){return y.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(c,d,v){v>this.length&&(v=this.length);for(var D=32767&c,b=c>>>15,_=0,I=d,C=0;C<v;C++){var F=this.__digit(C),R=32767&F,W=F>>>15,ee=y.__imul(R,D),q=y.__imul(R,b),j=y.__imul(W,D),re=y.__imul(W,b),le=I+ee+_;_=le>>>30,le&=1073741823,le+=((32767&q)<<15)+((32767&j)<<15),_+=le>>>30,I=re+(q>>>15)+(j>>>15),this.__setDigit(C,1073741823&le)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var D,b=0,_=0;_<v;_++)D=this.__halfDigit(d+_)+c.__halfDigit(_)+b,b=D>>>15,this.__setHalfDigit(d+_,32767&D);return b}},{key:"__inplaceSub",value:function(c,d,v){var D=v-1>>>1,b=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,C=0;C<D;C++){var F=c.__digit(C),R=(_>>>15)-(32767&F)-b;b=1&R>>>15,this.__setDigit(d+C,(32767&R)<<15|32767&I),_=this.__digit(d+C+1),I=(32767&_)-(F>>>15)-b,b=1&I>>>15}var W=c.__digit(C),ee=(_>>>15)-(32767&W)-b;b=1&ee>>>15,this.__setDigit(d+C,(32767&ee)<<15|32767&I);var q=W>>>15;if(d+C+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+C+1),I=(32767&_)-q-b,b=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var j=0;j<c.length-1;j++){var re=this.__digit(d+j),le=c.__digit(j),pe=(32767&re)-(32767&le)-b;b=1&pe>>>15;var be=(re>>>15)-(le>>>15)-b;b=1&be>>>15,this.__setDigit(d+j,(32767&be)<<15|32767&pe)}var Re=this.__digit(d+j),je=c.__digit(j),et=(32767&Re)-(32767&je)-b;b=1&et>>>15;var Vt=0;!(1&v)&&(Vt=(Re>>>15)-(je>>>15)-b,b=1&Vt>>>15),this.__setDigit(d+j,(32767&Vt)<<15|32767&et)}return b}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,D=this.length-1,b=0;b<D;b++)d=this.__digit(b+1),this.__setDigit(b,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(D,v)}}},{key:"__digit",value:function(c){return this[c]}},{key:"__unsignedDigit",value:function(c){return this[c]>>>0}},{key:"__setDigit",value:function(c,d){this[c]=0|d}},{key:"__setDigitGrow",value:function(c,d){this[c]=0|d}},{key:"__halfDigitLength",value:function(){var c=this.length;return 32767>=this.__unsignedDigit(c-1)?2*c-1:2*c}},{key:"__halfDigit",value:function(c){return 32767&this[c>>>1]>>>15*(1&c)}},{key:"__setHalfDigit",value:function(c,d){var v=c>>>1,D=this.__digit(v),b=1&c?32767&D|d<<15:1073709056&D|32767&d;this.__setDigit(v,b)}}],[{key:"BigInt",value:function(c){var d=Number.isFinite;if(typeof c=="number"){if(c===0)return y.__zero();if(y.__isOneDigitInt(c))return 0>c?y.__oneDigit(-c,!0):y.__oneDigit(c,!1);if(!d(c)||ne(c)!==c)throw new RangeError("The number "+c+" cannot be converted to BigInt because it is not an integer");return y.__fromDouble(c)}if(typeof c=="string"){var v=y.__fromString(c);if(v===null)throw new SyntaxError("Cannot convert "+c+" to a BigInt");return v}if(typeof c=="boolean")return c===!0?y.__oneDigit(1,!1):y.__zero();if(oe(c)==="object"){if(c.constructor===y)return c;var D=y.__toPrimitive(c);return y.BigInt(D)}throw new TypeError("Cannot convert "+c+" to a BigInt")}},{key:"toNumber",value:function(c){var d=c.length;if(d===0)return 0;if(d===1){var v=c.__unsignedDigit(0);return c.sign?-v:v}var D=c.__digit(d-1),b=y.__clz30(D),_=30*d-b;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,C=D,F=d-1,R=b+3,W=R===32?0:C<<R;W>>>=12;var ee=R-12,q=12<=R?0:C<<20+R,j=20+R;for(0<ee&&0<F&&(F--,C=c.__digit(F),W|=C>>>30-ee,q=C<<ee+2,j=ee+2);0<j&&0<F;)F--,C=c.__digit(F),q|=30<=j?C<<j-30:C>>>30-j,j-=30;var re=y.__decideRounding(c,j,F,C);if((re===1||re===0&&(1&q)==1)&&(q=q+1>>>0,q===0&&(W++,W>>>20!=0&&(W=0,I++,1023<I))))return c.sign?-1/0:1/0;var le=c.sign?-2147483648:0;return I=I+1023<<20,y.__kBitConversionInts[y.__kBitConversionIntHigh]=le|I|W,y.__kBitConversionInts[y.__kBitConversionIntLow]=q,y.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(c){if(c.length===0)return c;var d=c.__copy();return d.sign=!c.sign,d}},{key:"bitwiseNot",value:function(c){return c.sign?y.__absoluteSubOne(c).__trim():y.__absoluteAddOne(c,!0)}},{key:"exponentiate",value:function(c,d){if(d.sign)throw new RangeError("Exponent must be positive");if(d.length===0)return y.__oneDigit(1,!1);if(c.length===0)return c;if(c.length===1&&c.__digit(0)===1)return c.sign&&!(1&d.__digit(0))?y.unaryMinus(c):c;if(1<d.length)throw new RangeError("BigInt too big");var v=d.__unsignedDigit(0);if(v===1)return c;if(v>=y.__kMaxLengthBits)throw new RangeError("BigInt too big");if(c.length===1&&c.__digit(0)===2){var D=1+(0|v/30),b=c.sign&&(1&v)!=0,_=new y(D,b);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(D-1,I),_}var C=null,F=c;for(1&v&&(C=c),v>>=1;v!==0;v>>=1)F=y.multiply(F,F),1&v&&(C===null?C=F:C=y.multiply(C,F));return C}},{key:"multiply",value:function(c,d){if(c.length===0)return c;if(d.length===0)return d;var v=c.length+d.length;30<=c.__clzmsd()+d.__clzmsd()&&v--;var D=new y(v,c.sign!==d.sign);D.__initializeDigits();for(var b=0;b<c.length;b++)y.__multiplyAccumulate(d,c.__digit(b),D,b);return D.__trim()}},{key:"divide",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>y.__absoluteCompare(c,d))return y.__zero();var v,D=c.sign!==d.sign,b=d.__unsignedDigit(0);if(d.length===1&&32767>=b){if(b===1)return D===c.sign?c:y.unaryMinus(c);v=y.__absoluteDivSmall(c,b,null)}else v=y.__absoluteDivLarge(c,d,!0,!1);return v.sign=D,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>y.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return y.__zero();var D=y.__absoluteModSmall(c,v);return D===0?y.__zero():y.__oneDigit(D,c.sign)}var b=y.__absoluteDivLarge(c,d,!1,!0);return b.sign=c.sign,b.__trim()}},{key:"add",value:function(c,d){var v=c.sign;return v===d.sign?y.__absoluteAdd(c,d,v):0<=y.__absoluteCompare(c,d)?y.__absoluteSub(c,d,v):y.__absoluteSub(d,c,!v)}},{key:"subtract",value:function(c,d){var v=c.sign;return v===d.sign?0<=y.__absoluteCompare(c,d)?y.__absoluteSub(c,d,v):y.__absoluteSub(d,c,!v):y.__absoluteAdd(c,d,v)}},{key:"leftShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?y.__rightShiftByAbsolute(c,d):y.__leftShiftByAbsolute(c,d)}},{key:"signedRightShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?y.__leftShiftByAbsolute(c,d):y.__rightShiftByAbsolute(c,d)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(c,d){return 0>y.__compareToBigInt(c,d)}},{key:"lessThanOrEqual",value:function(c,d){return 0>=y.__compareToBigInt(c,d)}},{key:"greaterThan",value:function(c,d){return 0<y.__compareToBigInt(c,d)}},{key:"greaterThanOrEqual",value:function(c,d){return 0<=y.__compareToBigInt(c,d)}},{key:"equal",value:function(c,d){if(c.sign!==d.sign||c.length!==d.length)return!1;for(var v=0;v<c.length;v++)if(c.__digit(v)!==d.__digit(v))return!1;return!0}},{key:"notEqual",value:function(c,d){return!y.equal(c,d)}},{key:"bitwiseAnd",value:function(c,d){if(!c.sign&&!d.sign)return y.__absoluteAnd(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length)+1,D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return D=y.__absoluteOr(D,b,D),y.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}return y.__absoluteAndNot(c,y.__absoluteSubOne(d)).__trim()}},{key:"bitwiseXor",value:function(c,d){if(!c.sign&&!d.sign)return y.__absoluteXor(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length),D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return y.__absoluteXor(D,b,D).__trim()}var _=O(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var C=y.__absoluteSubOne(d,_);return C=y.__absoluteXor(C,c,C),y.__absoluteAddOne(C,!0,C).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=O(c.length,d.length);if(!c.sign&&!d.sign)return y.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var D=y.__absoluteSubOne(c,v),b=y.__absoluteSubOne(d);return D=y.__absoluteAnd(D,b,D),y.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var I=y.__absoluteSubOne(d,v);return I=y.__absoluteAndNot(I,c,I),y.__absoluteAddOne(I,!0,I).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=ne(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return y.__zero();if(c>=y.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=d.__unsignedDigit(v-1),b=1<<(c-1)%30;if(d.length===v&&D<b)return d;var _=(D&b)===b;if(!_)return y.__truncateToNBits(c,d);if(!d.sign)return y.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(D&b-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return y.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&D===b?d:y.__truncateToNBits(c,d)}return y.__truncateAndSubFromPowerOfTwo(c,d,!1)}},{key:"asUintN",value:function(c,d){if(d.length===0)return d;if(c=ne(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return y.__zero();if(d.sign){if(c>y.__kMaxLengthBits)throw new RangeError("BigInt too big");return y.__truncateAndSubFromPowerOfTwo(c,d,!1)}if(c>=y.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=c%30;if(d.length==v){if(D===0)return d;var b=d.__digit(v-1);if(!(b>>>D))return d}return y.__truncateToNBits(c,d)}},{key:"ADD",value:function(c,d){if(c=y.__toPrimitive(c),d=y.__toPrimitive(d),typeof c=="string")return typeof d!="string"&&(d=d.toString()),c+d;if(typeof d=="string")return c.toString()+d;if(c=y.__toNumeric(c),d=y.__toNumeric(d),y.__isBigInt(c)&&y.__isBigInt(d))return y.add(c,d);if(typeof c=="number"&&typeof d=="number")return c+d;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(c,d){return y.__compare(c,d,0)}},{key:"LE",value:function(c,d){return y.__compare(c,d,1)}},{key:"GT",value:function(c,d){return y.__compare(c,d,2)}},{key:"GE",value:function(c,d){return y.__compare(c,d,3)}},{key:"EQ",value:function(c,d){for(;;){if(y.__isBigInt(c))return y.__isBigInt(d)?y.equal(c,d):y.EQ(d,c);if(typeof c=="number"){if(y.__isBigInt(d))return y.__equalToNumber(d,c);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(typeof c=="string"){if(y.__isBigInt(d))return c=y.__fromString(c),c!==null&&y.equal(c,d);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(typeof c=="boolean"){if(y.__isBigInt(d))return y.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(oe(c)==="symbol"){if(y.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=y.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(d)==="object"&&d.constructor!==y)return c==d;c=y.__toPrimitive(c)}else return c==d}}},{key:"NE",value:function(c,d){return!y.EQ(c,d)}},{key:"DataViewGetBigInt64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return y.asIntN(64,y.DataViewGetBigUint64(c,d,v))}},{key:"DataViewGetBigUint64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2],D=v?[4,0]:[0,4],b=G(D,2),_=b[0],I=b[1],C=c.getUint32(d+_,v),F=c.getUint32(d+I,v),R=new y(3,!1);return R.__setDigit(0,1073741823&F),R.__setDigit(1,(268435455&C)<<2|F>>>30),R.__setDigit(2,C>>>28),R.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];y.DataViewSetBigUint64(c,d,v,D)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=y.asUintN(64,v);var b=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,b=I>>>2,2<v.length&&(b|=v.__digit(2)<<28)}var C=D?[4,0]:[0,4],F=G(C,2),R=F[0],W=F[1];c.setUint32(d+R,b,D),c.setUint32(d+W,_,D)}},{key:"__zero",value:function(){return new y(0,!1)}},{key:"__oneDigit",value:function(c,d){var v=new y(1,d);return v.__setDigit(0,c),v}},{key:"__decideRounding",value:function(c,d,v,D){if(0<d)return-1;var b;if(0>d)b=-d-1;else{if(v===0)return-1;v--,D=c.__digit(v),b=29}var _=1<<b;if(!(D&_))return-1;if(_-=1,(D&_)!=0)return 1;for(;0<v;)if(v--,c.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(c){var d=0>c;y.__kBitConversionDouble[0]=c;var v,D=2047&y.__kBitConversionInts[y.__kBitConversionIntHigh]>>>20,b=D-1023,_=(0|b/30)+1,I=new y(_,d),C=1048576,F=1048575&y.__kBitConversionInts[y.__kBitConversionIntHigh]|C,R=y.__kBitConversionInts[y.__kBitConversionIntLow],W=20,ee=b%30,q=0;if(ee<W){var j=W-ee;q=j+32,v=F>>>j,F=F<<32-j|R>>>j,R<<=32-j}else if(ee===W)q=32,v=F,F=R,R=0;else{var re=ee-W;q=32-re,v=F<<re|R>>>32-re,F=R<<re,R=0}I.__setDigit(_-1,v);for(var le=_-2;0<=le;le--)0<q?(q-=30,v=F>>>2,F=F<<30|R>>>2,R<<=30):v=0,I.__setDigit(le,v);return I.__trim()}},{key:"__isWhitespace",value:function(c){return 13>=c&&9<=c||(159>=c?c==32:131071>=c?c==160||c==5760:196607>=c?(c&=131071,10>=c||c==40||c==41||c==47||c==95||c==4096):c==65279)}},{key:"__fromString",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,D=c.length,b=0;if(b===D)return y.__zero();for(var _=c.charCodeAt(b);y.__isWhitespace(_);){if(++b===D)return y.__zero();_=c.charCodeAt(b)}if(_===43){if(++b===D)return null;_=c.charCodeAt(b),v=1}else if(_===45){if(++b===D)return null;_=c.charCodeAt(b),v=-1}if(d===0){if(d=10,_===48){if(++b===D)return y.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(d=16,++b===D)return null;_=c.charCodeAt(b)}else if(_===79||_===111){if(d=8,++b===D)return null;_=c.charCodeAt(b)}else if(_===66||_===98){if(d=2,++b===D)return null;_=c.charCodeAt(b)}}}else if(d===16&&_===48){if(++b===D)return y.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(++b===D)return null;_=c.charCodeAt(b)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++b===D)return y.__zero();_=c.charCodeAt(b)}var I=D-b,C=y.__kMaxBitsPerChar[d],F=y.__kBitsPerCharTableMultiplier-1;if(I>1073741824/C)return null;var R=C*I+F>>>y.__kBitsPerCharTableShift,W=0|(R+29)/30,ee=new y(W,!1),q=10>d?d:10,j=10<d?d-10:0;if(d&d-1){ee.__initializeDigits();var et=!1,Vt=0;do{for(var Wn,Pn=0,Wr=1;;){if(Wn=void 0,_-48>>>0<q)Wn=_-48;else if((32|_)-97>>>0<j)Wn=(32|_)-87;else{et=!0;break}var oo=Wr*d;if(1073741823<oo)break;if(Wr=oo,Pn=Pn*d+Wn,Vt++,++b===D){et=!0;break}_=c.charCodeAt(b)}F=30*y.__kBitsPerCharTableMultiplier-1;var ao=0|(C*Vt+F>>>y.__kBitsPerCharTableShift)/30;ee.__inplaceMultiplyAdd(Wr,Pn,ao)}while(!et)}else{C>>=y.__kBitsPerCharTableShift;var re=[],le=[],pe=!1;do{for(var be,Re=0,je=0;;){if(be=void 0,_-48>>>0<q)be=_-48;else if((32|_)-97>>>0<j)be=(32|_)-87;else{pe=!0;break}if(je+=C,Re=Re<<C|be,++b===D){pe=!0;break}if(_=c.charCodeAt(b),30<je+C)break}re.push(Re),le.push(je)}while(!pe);y.__fillFromParts(ee,re,le)}if(b!==D){if(!y.__isWhitespace(_))return null;for(b++;b<D;b++)if(_=c.charCodeAt(b),!y.__isWhitespace(_))return null}return ee.sign=v===-1,ee.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var D=0,b=0,_=0,I=d.length-1;0<=I;I--){var C=d[I],F=v[I];b|=C<<_,_+=F,_===30?(c.__setDigit(D++,b),_=0,b=0):30<_&&(c.__setDigit(D++,1073741823&b),_-=30,b=C>>>F-_)}if(b!==0){if(D>=c.length)throw new Error("implementation bug");c.__setDigit(D++,b)}for(;D<c.length;D++)c.__setDigit(D,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,D=d-1;D=(85&D>>>1)+(85&D),D=(51&D>>>2)+(51&D),D=(15&D>>>4)+(15&D);var b=D,_=d-1,I=c.__digit(v-1),C=y.__clz30(I),F=30*v-C,R=0|(F+b-1)/b;if(c.sign&&R++,268435456<R)throw new Error("string too long");for(var W=Array(R),ee=R-1,q=0,j=0,re=0;re<v-1;re++){var le=c.__digit(re),pe=(q|le<<j)&_;W[ee--]=y.__kConversionChars[pe];var be=b-j;for(q=le>>>be,j=30-be;j>=b;)W[ee--]=y.__kConversionChars[q&_],q>>>=b,j-=b}var Re=(q|I<<j)&_;for(W[ee--]=y.__kConversionChars[Re],q=I>>>b-j;q!==0;)W[ee--]=y.__kConversionChars[q&_],q>>>=b;if(c.sign&&(W[ee--]="-"),ee!==-1)throw new Error("implementation bug");return W.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var D=c.length;if(D===0)return"";if(D===1){var b=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(b="-"+b),b}var _=30*D-y.__clz30(c.__digit(D-1)),I=y.__kMaxBitsPerChar[d],C=I-1,F=_*y.__kBitsPerCharTableMultiplier;F+=C-1,F=0|F/C;var R,W,ee=F+1>>1,q=y.exponentiate(y.__oneDigit(d,!1),y.__oneDigit(ee,!1)),j=q.__unsignedDigit(0);if(q.length===1&&32767>=j){R=new y(c.length,!1),R.__initializeDigits();for(var re,le=0,pe=2*c.length-1;0<=pe;pe--)re=le<<15|c.__halfDigit(pe),R.__setHalfDigit(pe,0|re/j),le=0|re%j;W=le.toString(d)}else{var be=y.__absoluteDivLarge(c,q,!0,!0);R=be.quotient;var Re=be.remainder.__trim();W=y.__toStringGeneric(Re,d,!0)}R.__trim();for(var je=y.__toStringGeneric(R,d,!0);W.length<ee;)W="0"+W;return v===!1&&c.sign&&(je="-"+je),je+W}},{key:"__unequalSign",value:function(c){return c?-1:1}},{key:"__absoluteGreater",value:function(c){return c?-1:1}},{key:"__absoluteLess",value:function(c){return c?1:-1}},{key:"__compareToBigInt",value:function(c,d){var v=c.sign;if(v!==d.sign)return y.__unequalSign(v);var D=y.__absoluteCompare(c,d);return 0<D?y.__absoluteGreater(v):0>D?y.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(y.__isOneDigitInt(d)){var v=c.sign,D=0>d;if(v!==D)return y.__unequalSign(v);if(c.length===0){if(D)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return y.__absoluteGreater(v);var b=H(d),_=c.__unsignedDigit(0);return _>b?y.__absoluteGreater(v):_<b?y.__absoluteLess(v):0}return y.__compareToDouble(c,d)}},{key:"__compareToDouble",value:function(c,d){if(d!==d)return d;if(d===1/0)return-1;if(d===-1/0)return 1;var v=c.sign,D=0>d;if(v!==D)return y.__unequalSign(v);if(d===0)throw new Error("implementation bug: should be handled elsewhere");if(c.length===0)return-1;y.__kBitConversionDouble[0]=d;var b=2047&y.__kBitConversionInts[y.__kBitConversionIntHigh]>>>20;if(b==2047)throw new Error("implementation bug: handled elsewhere");var _=b-1023;if(0>_)return y.__absoluteGreater(v);var I=c.length,C=c.__digit(I-1),F=y.__clz30(C),R=30*I-F,W=_+1;if(R<W)return y.__absoluteLess(v);if(R>W)return y.__absoluteGreater(v);var ee=1048576,q=1048576|1048575&y.__kBitConversionInts[y.__kBitConversionIntHigh],j=y.__kBitConversionInts[y.__kBitConversionIntLow],re=20,le=29-F;if(le!==(0|(R-1)%30))throw new Error("implementation bug");var pe,be=0;if(le<re){var Re=re-le;be=Re+32,pe=q>>>Re,q=q<<32-Re|j>>>Re,j<<=32-Re}else if(le===re)be=32,pe=q,q=j,j=0;else{var je=le-re;be=32-je,pe=q<<je|j>>>32-je,q=j<<je,j=0}if(C>>>=0,pe>>>=0,C>pe)return y.__absoluteGreater(v);if(C<pe)return y.__absoluteLess(v);for(var et=I-2;0<=et;et--){0<be?(be-=30,pe=q>>>2,q=q<<30|j>>>2,j<<=30):pe=0;var Vt=c.__unsignedDigit(et);if(Vt>pe)return y.__absoluteGreater(v);if(Vt<pe)return y.__absoluteLess(v)}if(q!==0||j!==0){if(be===0)throw new Error("implementation bug");return y.__absoluteLess(v)}return 0}},{key:"__equalToNumber",value:function(c,d){return y.__isOneDigitInt(d)?d===0?c.length===0:c.length===1&&c.sign===0>d&&c.__unsignedDigit(0)===H(d):y.__compareToDouble(c,d)===0}},{key:"__comparisonResultToBool",value:function(c,d){return d===0?0>c:d===1?0>=c:d===2?0<c:d===3?0<=c:void 0}},{key:"__compare",value:function(c,d,v){if(c=y.__toPrimitive(c),d=y.__toPrimitive(d),typeof c=="string"&&typeof d=="string")switch(v){case 0:return c<d;case 1:return c<=d;case 2:return c>d;case 3:return c>=d}if(y.__isBigInt(c)&&typeof d=="string")return d=y.__fromString(d),d!==null&&y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(typeof c=="string"&&y.__isBigInt(d))return c=y.__fromString(c),c!==null&&y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(c=y.__toNumeric(c),d=y.__toNumeric(d),y.__isBigInt(c)){if(y.__isBigInt(d))return y.__comparisonResultToBool(y.__compareToBigInt(c,d),v);if(typeof d!="number")throw new Error("implementation bug");return y.__comparisonResultToBool(y.__compareToNumber(c,d),v)}if(typeof c!="number")throw new Error("implementation bug");if(y.__isBigInt(d))return y.__comparisonResultToBool(y.__compareToNumber(d,c),2^v);if(typeof d!="number")throw new Error("implementation bug");return v===0?c<d:v===1?c<=d:v===2?c>d:v===3?c>=d:void 0}},{key:"__absoluteAdd",value:function(c,d,v){if(c.length<d.length)return y.__absoluteAdd(d,c,v);if(c.length===0)return c;if(d.length===0)return c.sign===v?c:y.unaryMinus(c);var D=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&D++;for(var b,_=new y(D,v),I=0,C=0;C<d.length;C++)b=c.__digit(C)+d.__digit(C)+I,I=b>>>30,_.__setDigit(C,1073741823&b);for(;C<c.length;C++){var F=c.__digit(C)+I;I=F>>>30,_.__setDigit(C,1073741823&F)}return C<_.length&&_.__setDigit(C,I),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:y.unaryMinus(c);for(var D,b=new y(c.length,v),_=0,I=0;I<d.length;I++)D=c.__digit(I)-d.__digit(I)-_,_=1&D>>>30,b.__setDigit(I,1073741823&D);for(;I<c.length;I++){var C=c.__digit(I)-_;_=1&C>>>30,b.__setDigit(I,1073741823&C)}return b.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length;v===null?v=new y(D,d):v.sign=d;for(var b,_=1,I=0;I<D;I++)b=c.__digit(I)+_,_=b>>>30,v.__setDigit(I,1073741823&b);return _!==0&&v.__setDigitGrow(D,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var D,b=new y(d,!1),_=1,I=0;I<v;I++)D=c.__digit(I)-_,_=1&D>>>30,b.__setDigit(I,1073741823&D);if(_!==0)throw new Error("implementation bug");for(var C=v;C<d;C++)b.__setDigit(C,0);return b}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=_;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)&d.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;D<b&&(_=D);var I=D;v===null?v=new y(I,!1):I=v.length;for(var C=0;C<_;C++)v.__setDigit(C,c.__digit(C)&~d.__digit(C));for(;C<D;C++)v.__setDigit(C,c.__digit(C));for(;C<I;C++)v.__setDigit(C,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=D;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)|d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var I=c,C=D;c=d,D=b,d=I,b=C}var F=D;v===null?v=new y(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)^d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var D=c.length-1;0<=D&&c.__digit(D)===d.__digit(D);)D--;return 0>D?0:c.__unsignedDigit(D)>d.__unsignedDigit(D)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,D){if(d!==0){for(var b=32767&d,_=d>>>15,I=0,C=0,F=0;F<c.length;F++,D++){var R=v.__digit(D),W=c.__digit(F),ee=32767&W,q=W>>>15,j=y.__imul(ee,b),re=y.__imul(ee,_),le=y.__imul(q,b),pe=y.__imul(q,_);R+=C+j+I,I=R>>>30,R&=1073741823,R+=((32767&re)<<15)+((32767&le)<<15),I+=R>>>30,C=pe+(re>>>15)+(le>>>15),v.__setDigit(D,1073741823&R)}for(;I!==0||C!==0;D++){var be=v.__digit(D);be+=I+C,C=0,I=be>>>30,v.__setDigit(D,1073741823&be)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,D,b){for(var _=v,I=0,C=0;C<D;C++){var F=c.__digit(C),R=y.__imul(32767&F,d),W=y.__imul(F>>>15,d),ee=R+((32767&W)<<15)+I+_;_=ee>>>30,I=W>>>15,b.__setDigit(C,1073741823&ee)}if(b.length>D)for(b.__setDigit(D++,_+I);D<b.length;)b.__setDigit(D++,0);else if(_+I!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new y(c.length,!1));for(var D=0,b=2*c.length-1;0<=b;b-=2){var _=(D<<15|c.__halfDigit(b))>>>0,I=0|_/d;D=0|_%d,_=(D<<15|c.__halfDigit(b-1))>>>0;var C=0|_/d;D=0|_%d,v.__setDigit(b>>>1,I<<15|C)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,D=0,b=2*c.length-1;0<=b;b--)v=(D<<15|c.__halfDigit(b))>>>0,D=0|v%d;return D}},{key:"__absoluteDivLarge",value:function(c,d,v,D){var b=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-b,C=null;v&&(C=new y(I+2>>>1,!1),C.__initializeDigits());var F=new y(b+2>>>1,!1);F.__initializeDigits();var R=y.__clz15(d.__halfDigit(b-1));0<R&&(d=y.__specialLeftShift(d,R,0));for(var W=y.__specialLeftShift(c,R,1),ee=d.__halfDigit(b-1),q=0,j=I;0<=j;j--){var re=32767,le=W.__halfDigit(j+b);if(le!==ee){var pe=(le<<15|W.__halfDigit(j+b-1))>>>0;re=0|pe/ee;for(var be=0|pe%ee,Re=d.__halfDigit(b-2),je=W.__halfDigit(j+b-2);y.__imul(re,Re)>>>0>(be<<16|je)>>>0&&(re--,be+=ee,!(32767<be)););}y.__internalMultiplyAdd(d,re,0,_,F);var et=W.__inplaceSub(F,j,b+1);et!==0&&(et=W.__inplaceAdd(d,j,b),W.__setHalfDigit(j+b,32767&W.__halfDigit(j+b)+et),re--),v&&(1&j?q=re<<15:C.__setDigit(j>>>1,q|re))}if(D)return W.__inplaceRightShift(R),v?{quotient:C,remainder:W}:W;if(v)return C;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return y.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var D=c.length,b=D+v,_=new y(b,!1);if(d===0){for(var I=0;I<D;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(D,0),_}for(var C,F=0,R=0;R<D;R++)C=c.__digit(R),_.__setDigit(R,1073741823&C<<d|F),F=C>>>30-d;return 0<v&&_.__setDigit(D,F),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=y.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var D=0|v/30,b=v%30,_=c.length,I=b!==0&&c.__digit(_-1)>>>30-b!=0,C=_+D+(I?1:0),F=new y(C,c.sign);if(b===0){for(var R=0;R<D;R++)F.__setDigit(R,0);for(;R<C;R++)F.__setDigit(R,c.__digit(R-D))}else{for(var W=0,ee=0;ee<D;ee++)F.__setDigit(ee,0);for(var q,j=0;j<_;j++)q=c.__digit(j),F.__setDigit(j+D,1073741823&q<<b|W),W=q>>>30-b;if(I)F.__setDigit(_+D,W);else if(W!==0)throw new Error("implementation bug")}return F.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,D=c.sign,b=y.__toShiftAmount(d);if(0>b)return y.__rightShiftByMaximum(D);var _=0|b/30,I=b%30,C=v-_;if(0>=C)return y.__rightShiftByMaximum(D);var F=!1;if(D){var R=(1<<I)-1;if(c.__digit(_)&R)F=!0;else for(var W=0;W<_;W++)if(c.__digit(W)!==0){F=!0;break}}if(F&&I===0){var ee=c.__digit(v-1),q=~ee==0;q&&C++}var j=new y(C,D);if(I===0){j.__setDigit(C-1,0);for(var re=_;re<v;re++)j.__setDigit(re-_,c.__digit(re))}else{for(var le,pe=c.__digit(_)>>>I,be=v-_-1,Re=0;Re<be;Re++)le=c.__digit(Re+_+1),j.__setDigit(Re,1073741823&le<<30-I|pe),pe=le>>>I;j.__setDigit(be,pe)}return F&&(j=y.__absoluteAddOne(j,!0,j)),j.__trim()}},{key:"__rightShiftByMaximum",value:function(c){return c?y.__oneDigit(1,!0):y.__zero()}},{key:"__toShiftAmount",value:function(c){if(1<c.length)return-1;var d=c.__unsignedDigit(0);return d>y.__kMaxLengthBits?-1:d}},{key:"__toPrimitive",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"default";if(oe(c)!=="object"||c.constructor===y)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var D=c.valueOf;if(D){var b=D.call(c);if(oe(b)!=="object")return b}var _=c.toString;if(_){var I=_.call(c);if(oe(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return y.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return oe(c)==="object"&&c!==null&&c.constructor===y}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,D=new y(v,d.sign),b=v-1,_=0;_<b;_++)D.__setDigit(_,d.__digit(_));var I=d.__digit(b);if(c%30!=0){var C=32-c%30;I=I<<C>>>C}return D.__setDigit(b,I),D.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var D=Math.min,b,_=0|(c+29)/30,I=new y(_,v),C=0,F=_-1,R=0,W=D(F,d.length);C<W;C++)b=0-d.__digit(C)-R,R=1&b>>>30,I.__setDigit(C,1073741823&b);for(;C<F;C++)I.__setDigit(C,0|1073741823&-R);var ee,q=F<d.length?d.__digit(F):0,j=c%30;if(j===0)ee=0-q-R,ee&=1073741823;else{var re=32-j;q=q<<re>>>re;var le=1<<32-re;ee=le-q-R,ee&=le-1}return I.__setDigit(F,ee),I.__trim()}},{key:"__digitPow",value:function(c,d){for(var v=1;0<d;)1&d&&(v*=c),d>>>=1,c*=c;return v}},{key:"__detectBigEndian",value:function(){return y.__kBitConversionDouble[0]=-0,y.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(Me(Array));return ie.__kMaxLength=33554432,ie.__kMaxLengthBits=ie.__kMaxLength<<5,ie.__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],ie.__kBitsPerCharTableShift=5,ie.__kBitsPerCharTableMultiplier=1<<ie.__kBitsPerCharTableShift,ie.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ie.__kBitConversionBuffer=new ArrayBuffer(8),ie.__kBitConversionDouble=new Float64Array(ie.__kBitConversionBuffer),ie.__kBitConversionInts=new Int32Array(ie.__kBitConversionBuffer),ie.__kBitConversionIntHigh=ie.__detectBigEndian()?0:1,ie.__kBitConversionIntLow=ie.__detectBigEndian()?1:0,ie.__clz30=t?function(N){return t(N)-2}:function(N){var H=Math.LN2,O=Math.log;return N===0?30:0|29-(0|O(N>>>0)/H)},ie.__imul=n||function(N,H){return 0|N*H},ie})});var T=Od(_c(),1),Yt=T.default.BigInt(0),hi=T.default.BigInt(1),vs=T.default.BigInt(2),Fd=T.default.BigInt(10),Hd=T.default.BigInt(24),Yd=T.default.BigInt(60),$d=T.default.BigInt(1e3),xi=T.default.BigInt(1e6),ai=T.default.BigInt(1e9),il=T.default.multiply(T.default.BigInt(3600),ai),Bd=T.default.multiply(Yd,ai),Fn=T.default.multiply(il,Hd);function gn(n){return typeof n=="bigint"?T.default.BigInt(n.toString(10)):n}function ol(n){return T.default.equal(T.default.remainder(n,vs),Yt)}function Kn(n){return T.default.lessThan(n,Yt)?T.default.unaryMinus(n):n}function ho(n,t){return T.default.lessThan(n,t)?-1:T.default.greaterThan(n,t)?1:0}function Xr(n,t){return{quotient:T.default.divide(n,t),remainder:T.default.remainder(n,t)}}var Mc,Sc,se="slot-epochNanoSeconds",ce="slot-iso-date",Ae="slot-iso-date-time",He="slot-time",$="slot-calendar",al="slot-date-brand",sl="slot-year-month-brand",cl="slot-month-day-brand",_e="slot-time-zone",ut="slot-years",dt="slot-months",St="slot-weeks",ht="slot-days",mt="slot-hours",ft="slot-minutes",pt="slot-seconds",gt="slot-milliseconds",yt="slot-microseconds",kt="slot-nanoseconds",ll="date",ul="ym",dl="md",hl="time",ml="datetime",fl="instant",or="original",yr="timezone-canonical",Ra="timezone-original",Qr="calendar-id",pl="locale",Aa="options",gl=new WeakMap,La=Symbol.for("@@Temporal__GetSlots");(Mc=globalThis)[La]||(Mc[La]=function(n){return gl.get(n)});var Co=globalThis[La],Na=Symbol.for("@@Temporal__CreateSlots");(Sc=globalThis)[Na]||(Sc[Na]=function(n){gl.set(n,Object.create(null))});var Tn=globalThis[Na];function Et(n,...t){if(!n||typeof n!="object")return!1;let e=Co(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=Co(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function me(n,t,e){let r=Co(n);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=e}var Oa={};function Cn(n,t){Object.defineProperty(n.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let e=Object.getOwnPropertyNames(n);for(let i=0;i<e.length;i++){let o=e[i],a=Object.getOwnPropertyDescriptor(n,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n,o,a))}let r=Object.getOwnPropertyNames(n.prototype);for(let i=0;i<r.length;i++){let o=r[i],a=Object.getOwnPropertyDescriptor(n.prototype,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n.prototype,o,a))}Fa(t,n),Fa(`${t}.prototype`,n.prototype)}function Fa(n,t){let e=`%${n}%`;if(Oa[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);Oa[e]=t}function Qe(n){return Oa[n]}function wr(n,t){let e=n;if(e===0)return{div:e,mod:e};let r=Math.sign(e);e=Math.abs(e);let i=Math.trunc(1+Math.log10(e));if(t>=i)return{div:0*r,mod:r*e};if(t===0)return{div:r*e,mod:0*r};let o=e.toPrecision(i);return{div:r*Number.parseInt(o.slice(0,i-t),10),mod:r*Number.parseInt(o.slice(i-t),10)}}function Ta(n,t,e){let r=n,i=e;if(r===0)return i;let o=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return o*Number.parseInt(a+"0".repeat(t),10);let s=a+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,"0");return o*Number.parseInt(s,10)}function Io(n,t){let e=t==="negative";switch(n){case"ceil":return e?"zero":"infinity";case"floor":return e?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return e?"half-zero":"half-infinity";case"halfFloor":return e?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function xo(n,t,e,r,i){return i==="zero"?n:i==="infinity"?t:e<0?n:e>0?t:i==="half-zero"?n:i==="half-infinity"?t:r?n:t}var Se=class n{constructor(t){this.totalNs=gn(t),this.sec=T.default.toNumber(T.default.divide(this.totalNs,ai)),this.subsec=T.default.toNumber(T.default.remainder(this.totalNs,ai))}static validateNew(t,e){if(T.default.greaterThan(Kn(t),n.MAX))throw new RangeError(`${e} of duration time units cannot exceed ${n.MAX} s`);return new n(t)}static fromEpochNsDiff(t,e){let r=T.default.subtract(gn(t),gn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=T.default.add(T.default.add(T.default.add(T.default.add(T.default.add(T.default.BigInt(a),T.default.multiply(T.default.BigInt(o),$d)),T.default.multiply(T.default.BigInt(i),xi)),T.default.multiply(T.default.BigInt(r),ai)),T.default.multiply(T.default.BigInt(e),Bd)),T.default.multiply(T.default.BigInt(t),il));return n.validateNew(s,"total")}abs(){return new n(Kn(this.totalNs))}add(t){return n.validateNew(T.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(T.default.add(this.totalNs,T.default.multiply(T.default.BigInt(t),Fn)),"sum")}addToEpochNs(t){return T.default.add(gn(t),this.totalNs)}cmp(t){return ho(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=Xr(this.totalNs,T.default.BigInt(t));return{quotient:T.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=gn(t),r=T.default.BigInt(e),{quotient:i,remainder:o}=Xr(this.totalNs,r),a=[],s,u=(T.default.lessThan(this.totalNs,Yt)?-1:1)*Math.sign(T.default.toNumber(e));for(;!T.default.equal(o,Yt)&&a.length<50;)o=T.default.multiply(o,Fd),{quotient:s,remainder:o}=Xr(o,r),a.push(Math.abs(T.default.toNumber(s)));return u*+(Kn(i).toString()+"."+a.join(""))}isZero(){return T.default.equal(this.totalNs,Yt)}round(t,e){let r=gn(t);if(T.default.equal(r,hi))return this;let{quotient:i,remainder:o}=Xr(this.totalNs,r),a=T.default.lessThan(this.totalNs,Yt)?"negative":"positive",s=T.default.multiply(Kn(i),r),u=T.default.add(s,r),l=ho(Kn(T.default.multiply(o,vs)),r),h=Io(e,a),f=T.default.equal(Kn(this.totalNs),s)?s:xo(s,u,l,ol(i),h),g=a==="positive"?f:T.default.unaryMinus(f);return n.validateNew(g,"rounding")}sign(){return this.cmp(new n(Yt))}subtract(t){return n.validateNew(T.default.subtract(this.totalNs,t.totalNs),"difference")}};Se.MAX=T.default.BigInt("9007199254740991999999999"),Se.ZERO=new Se(Yt);var kc=/[A-Za-z._][A-Za-z._0-9+-]*/,Pi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${kc.source})(?:\\/(?:${kc.source}))*)`),yl=/(?:[+-]\d{6}|\d{4})/,mo=/(?:0[1-9]|1[0-2])/,Ha=/(?:0[1-9]|[12]\d|3[01])/,jd=new RegExp(`(${yl.source})(?:-(${mo.source})-(${Ha.source})|(${mo.source})(${Ha.source}))`),vl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,wl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,bl=new RegExp(`([zZ])|${wl.source}?`),_r=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,zd=new RegExp([`^${jd.source}`,`(?:(?:[tT]|\\s+)${vl.source}(?:${bl.source})?)?`,`(?:\\[!?(${Pi.source})\\])?`,`((?:${_r.source})*)$`].join("")),Ud=new RegExp([`^[tT]?${vl.source}`,`(?:${bl.source})?`,`(?:\\[!?${Pi.source}\\])?`,`((?:${_r.source})*)$`].join("")),Vd=new RegExp(`^(${yl.source})-?(${mo.source})(?:\\[!?${Pi.source}\\])?((?:${_r.source})*)$`),qd=new RegExp(`^(?:--)?(${mo.source})-?(${Ha.source})(?:\\[!?${Pi.source}\\])?((?:${_r.source})*)$`),Ca=/(\d+)(?:[.,](\d{1,9}))?/,Wd=new RegExp(`(?:${Ca.source}H)?(?:${Ca.source}M)?(?:${Ca.source}S)?`),Kd=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Wd.source})?$`,"i"),Hn=864e5,fo=1e6*Hn,Gd=6e10,Dl=1e8*Hn,Mr=Qt(Dl),mi=T.default.unaryMinus(Mr),Zd=T.default.add(T.default.subtract(mi,Fn),hi),Jd=T.default.subtract(T.default.add(Mr,Fn),hi),Xd=146097*Hn,Tc=-271821,Cc=275760,si=Date.UTC(1847,0,1),Qd=["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"],eh=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 Ye(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Po(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function Ro(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function ue(n){let t=Po(n);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw new RangeError("invalid number value");let e=Math.trunc(t);return e===0?0:e}function Ic(n,t){let e=ue(n);if(e<=0)throw t!==void 0?new RangeError(`property '${t}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return e}function Jt(n){let t=Po(n);if(Number.isNaN(t))throw new RangeError("not a number");if(t===1/0||t===-1/0)throw new 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 r=Math.abs(e);return Math.floor(r)===r}(t))throw new RangeError(`unsupported fractional value ${n}`);return t===0?0:t}function fi(n,t){return String(n).padStart(t,"0")}function Ue(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function Ya(n,t){if(Ye(n)){let e=n?.toString();if(typeof e=="string"||typeof e=="number")return e;throw new TypeError("Cannot convert object to primitive value")}return n}var $a=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],th={era:Ro,eraYear:ue,year:ue,month:Ic,monthCode:function(n){let t=Ue(Ya(n));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 new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:Ic,hour:ue,minute:ue,second:ue,millisecond:ue,microsecond:ue,nanosecond:ue,offset:function(n){let t=Ue(Ya(n));return Ar(t),t},timeZone:bt},nh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Sr=[["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"]],xc=Object.fromEntries(Sr.map(n=>[n[0],n[1]])),rh=Object.fromEntries(Sr.map(([n,t])=>[t,n])),ci=Sr.map(([,n])=>n),kr={day:fo,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},po=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],ih=Intl.DateTimeFormat,Pc=new Map;function El(n){let t=wi(n),e=Pc.get(t);return e===void 0&&(e=new ih("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Pc.set(t,e)),e}function Ze(n){return Et(n,se)&&!Et(n,_e,$)}function Oe(n){return Et(n,ut,dt,ht,mt,ft,pt,gt,yt,kt)}function Fe(n){return Et(n,al)}function $e(n){return Et(n,He)}function xe(n){return Et(n,Ae)}function Je(n){return Et(n,sl)}function Ht(n){return Et(n,cl)}function fe(n){return Et(n,se,_e,$)}function x(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function xr(n){if(Et(n,$)||Et(n,_e))throw new TypeError("with() does not support a calendar or timeZone property");if($e(n))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(n.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(n.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Ri(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Ao(n){let t,e,r=!1;for(_r.lastIndex=0;e=_r.exec(n);){let{1:i,2:o,3:a}=e;if(o==="u-ca"){if(t===void 0)t=a,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${n}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${o}=${a}`)}return t}function mn(n){let t=zd.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Ao(t[16]),r=t[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);let i=+r,o=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=t[6]!==void 0,u=+(t[6]??0),l=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let f=(t[9]??t[12]??"")+"000000000",g=+f.slice(0,3),E=+f.slice(3,6),S=+f.slice(6,9),k,A=!1;t[13]?(k=void 0,A=!0):t[14]&&(k=t[14]);let B=t[15];return Ms(i,o,a,u,l,h,g,E,S),{year:i,month:o,day:a,time:s?{hour:u,minute:l,second:h,millisecond:g,microsecond:E,nanosecond:S}:"start-of-day",tzAnnotation:B,offset:k,z:A,calendar:e}}function _l(n){let t=Ud.exec(n),e,r,i,o,a,s,u;if(t){u=Ao(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let l=(t[4]??t[7]??"")+"000000000";if(o=+l.slice(0,3),a=+l.slice(3,6),s=+l.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let l,h;if({time:l,z:h,calendar:u}=mn(n),l==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=l)}if(Fo(e,r,i,o,a,s),/[tT ][0-9][0-9]/.test(n))return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u};try{let{month:l,day:h}=bs(n);Qn(1972,l,h)}catch{try{let{year:l,month:h}=ws(n);Qn(l,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function ws(n){let t=Vd.exec(n),e,r,i,o;if(t){i=Ao(t[3]);let a=t[1];if(a==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);if(e=+a,r=+t[2],o=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let a;if({year:e,month:r,calendar:i,day:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function bs(n){let t=qd.exec(n),e,r,i,o;if(t){if(i=Ao(t[3]),e=+t[1],r=+t[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let a;if({month:e,day:r,calendar:i,year:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Ml=new RegExp(`^${Pi.source}$`,"i"),Sl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function kl(n){let t=ah.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function On(n){return Ml.test(n)||kl(n),Sl.test(n)?{offsetMinutes:Ar(n)/6e10}:{tzName:n}}function li(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":Qn(i,o,a);break;case"constrain":({year:i,month:o,day:a}=zl(i,o,a))}return{year:i,month:o,day:a}}function Lo(n,t,e,r,i,o,a){let s=n,u=t,l=e,h=r,f=i,g=o;switch(a){case"reject":Fo(s,u,l,h,f,g);break;case"constrain":s=vt(s,0,23),u=vt(u,0,59),l=vt(l,0,59),h=vt(h,0,999),f=vt(f,0,999),g=vt(g,0,999)}return{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}function Tl(n){if(!Ye(n))throw new 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},e=!1;for(let r=0;r<po.length;r++){let i=po[r],o=n[i];o!==void 0&&(e=!0,t[i]=Jt(o))}if(!e)throw new TypeError("invalid duration-like");return t}function nt({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function De(n,t){return{isoDate:n,time:t}}function ve(n){return _n(n,"overflow",["constrain","reject"],"constrain")}function ui(n){return _n(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function en(n,t){return _n(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function uo(n,t){return _n(n,"offset",["prefer","use","ignore","reject"],t)}function Ai(n){return _n(n,"calendarName",["auto","always","never","critical"],"auto")}function Pr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=ue(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Rr(n,t,e){let r=e?t:t-1;if(n>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${n}`);if(t%n!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function Li(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(Ro(t)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}let e=Math.floor(t);if(!Number.isFinite(e)||e<0||e>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return e}function Ni(n,t){switch(n){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 new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}var Sn=Symbol("~required~");function Ct(n,t,e,r,i=[]){let o=[];for(let l=0;l<Sr.length;l++){let h=Sr[l],f=h[1],g=h[2];e!=="datetime"&&e!==g||o.push(f)}o=o.concat(i);let a=r;a===Sn?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let l=0;l<o.length;l++){let h=o[l],f=rh[h];f!==void 0&&s.push(f)}let u=_n(n,t,s,a);if(u===void 0&&r===Sn)throw new RangeError(`${t} is required`);return u&&u in xc?xc[u]:u}function Ia(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",u=!1;if(Ye(t)){if(fe(t))return{zonedRelativeTo:t};if(Fe(t))return{plainRelativeTo:t};if(xe(t))return{plainRelativeTo:wt(m(t,Ae).isoDate,m(t,$))};i=$i(t);let l=zt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Fi(i,l,"constrain")),{offset:a,timeZone:o}=l,a===void 0&&(s="wall")}else{let l,h,f,g,E;if({year:f,month:g,day:E,time:r,calendar:i,tzAnnotation:l,offset:a,z:h}=mn(Ue(t)),l)o=bt(l),h?s="exact":a||(s="wall"),u=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=_t(i),e={year:f,month:g,day:E}}return o===void 0?{plainRelativeTo:wt(e,i)}:{zonedRelativeTo:tt(go(e,r,s,s==="option"?Ar(a):0,o,"compatible","reject",u),o,i)}}function yn(n){return m(n,ut)!==0?"year":m(n,dt)!==0?"month":m(n,St)!==0?"week":m(n,ht)!==0?"day":m(n,mt)!==0?"hour":m(n,ft)!==0?"minute":m(n,pt)!==0?"second":m(n,gt)!==0?"millisecond":m(n,yt)!==0?"microsecond":"nanosecond"}function Dn(n,t){return ci.indexOf(n)>ci.indexOf(t)?t:n}function an(n){return n==="year"||n==="month"||n==="week"}function vn(n){return an(n)||n==="day"?"date":"time"}function Bn(n){return Qe("%calendarImpl%")(n)}function Oi(n){return Qe("%calendarImpl%")(m(n,$))}function Dt(n,t,e="date"){let r=Object.create(null),i=Bn(n).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,e!=="month-day"&&e!=="date"||(r.day=i.day),e!=="year-month"&&e!=="date"||(r.year=i.year),r}function zt(n,t,e,r,i){let o=Bn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),u=!1;a.sort();for(let l=0;l<a.length;l++){let h=a[l],f=t[h];if(f!==void 0)u=!0,s[h]=(0,th[h])(f);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=nh[h]}}if(i==="partial"&&!u)throw new TypeError("no supported properties found");return s}function Ba(n,t="complete"){let e=["hour","microsecond","millisecond","minute","nanosecond","second"],r=!1,i=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],s=n[a];s!==void 0?(i[a]=ue(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function ei(n,t){if(Ye(n)){if(Fe(n))return ve(te(t)),wt(m(n,ce),m(n,$));if(fe(n)){let u=Gt(m(n,_e),m(n,se));return ve(te(t)),wt(u.isoDate,m(n,$))}if(xe(n))return ve(te(t)),wt(m(n,Ae).isoDate,m(n,$));let s=$i(n);return wt(Yn(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=mn(Ue(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=_t(o),ve(te(t)),wt({year:e,month:r,day:i},o)}function Fi(n,t,e){return De(Yn(n,t,e),Lo(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function ti(n,t){let e,r,i;if(Ye(n)){if(xe(n))return ve(te(t)),qt(m(n,Ae),m(n,$));if(fe(n)){let s=Gt(m(n,_e),m(n,se));return ve(te(t)),qt(s,m(n,$))}if(Fe(n))return ve(te(t)),qt(De(m(n,ce),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,$));i=$i(n);let o=zt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=ve(te(t));({isoDate:e,time:r}=Fi(i,o,a))}else{let o,a,s,u;if({year:a,month:s,day:u,time:r,calendar:i,z:o}=mn(Ue(n)),o)throw new 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}),Ms(a,s,u,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=_t(i),ve(te(t)),e={year:a,month:s,day:u}}return qt(De(e,r),i)}function Kt(n){let t=Qe("%Temporal.Duration%");if(Oe(n))return new t(m(n,ut),m(n,dt),m(n,St),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,gt),m(n,yt),m(n,kt));if(!Ye(n))return function(i){let{years:o,months:a,weeks:s,days:u,hours:l,minutes:h,seconds:f,milliseconds:g,microseconds:E,nanoseconds:S}=function(k){let A=Kd.exec(k);if(!A)throw new RangeError(`invalid duration: ${k}`);if(A.every((v,D)=>D<2||v===void 0))throw new RangeError(`invalid duration: ${k}`);let B=A[1]==="-"?-1:1,V=A[2]===void 0?0:ue(A[2])*B,G=A[3]===void 0?0:ue(A[3])*B,U=A[4]===void 0?0:ue(A[4])*B,J=A[5]===void 0?0:ue(A[5])*B,oe=A[6]===void 0?0:ue(A[6])*B,ke=A[7],Me=A[8],ie=A[9],N=A[10],H=A[11],O=0,ne=0,y=0;if(ke!==void 0){if(Me??ie??N??H)throw new RangeError("only the smallest unit can be fractional");y=3600*ue((ke+"000000000").slice(0,9))*B}else if(O=Me===void 0?0:ue(Me)*B,ie!==void 0){if(N??H)throw new RangeError("only the smallest unit can be fractional");y=60*ue((ie+"000000000").slice(0,9))*B}else ne=N===void 0?0:ue(N)*B,H!==void 0&&(y=ue((H+"000000000").slice(0,9))*B);let L=y%1e3,c=Math.trunc(y/1e3)%1e3,d=Math.trunc(y/1e6)%1e3;return ne+=Math.trunc(y/1e9)%60,O+=Math.trunc(y/6e10),Ho(V,G,U,J,oe,O,ne,d,c,L),{years:V,months:G,weeks:U,days:J,hours:oe,minutes:O,seconds:ne,milliseconds:d,microseconds:c,nanoseconds:L}}(i);return new(Qe("%Temporal.Duration%"))(o,a,s,u,l,h,f,g,E,S)}(Ue(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Tl(n);for(let i=0;i<po.length;i++){let o=po[i],a=r[o];a!==void 0&&(e[o]=a)}return new t(e.years,e.months,e.weeks,e.days,e.hours,e.minutes,e.seconds,e.milliseconds,e.microseconds,e.nanoseconds)}function ni(n){let t;if(Ye(n)){if(Ze(n)||fe(n))return Xt(m(n,se));t=Ya(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(k){let A=mn(k);if(!A.z&&!A.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return A}(Ue(t)),{hour:u=0,minute:l=0,second:h=0,millisecond:f=0,microsecond:g=0,nanosecond:E=0}=o==="start-of-day"?{}:o,S=vi(e,r,i,u,l,h,f,g,E-(s?0:Ar(a)));return Er(S.isoDate),Xt(Xe(S))}function Rc(n,t){if(Ye(n)){if(Ht(n))return ve(te(t)),br(m(n,ce),m(n,$));let s;return Et(n,$)?s=m(n,$):(s=n.calendar,s===void 0&&(s="iso8601"),s=Yi(s)),br(yo(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=bs(Ue(n));if(o===void 0&&(o="iso8601"),o=_t(o),ve(te(t)),o==="iso8601")return br({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return ar(a),a=yo(o,Dt(o,a,"month-day"),"constrain"),br(a,o)}function Ln(n,t){let e;if(Ye(n)){if($e(n))return ve(te(t)),wn(m(n,He));if(xe(n))return ve(te(t)),wn(m(n,Ae).time);if(fe(n)){let l=Gt(m(n,_e),m(n,se));return ve(te(t)),wn(l.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:u}=Ba(n);e=Lo(r,i,o,a,s,u,ve(te(t)))}else e=_l(Ue(n)),ve(te(t));return wn(e)}function Cl(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Ln(n),He)}function ri(n,t){if(Ye(n)){if(Je(n))return ve(te(t)),Dr(m(n,ce),m(n,$));let s=$i(n);return Dr(pi(s,zt(s,n,["year","month","monthCode"],[],[]),ve(te(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=ws(Ue(n));o===void 0&&(o="iso8601"),o=_t(o),ve(te(t));let a={year:e,month:r,day:i};return Ss(a),a=pi(o,Dt(o,a,"year-month"),"constrain"),Dr(a,o)}function go(n,t,e,r,i,o,a,s){if(t==="start-of-day")return Rn(i,n);let u=De(n,t);if(e==="wall"||a==="ignore")return rt(i,u,o);if(e==="exact"||a==="use"){let f=vi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Er(f.isoDate);let g=Xe(f);return dn(g),g}Er(n);let l=Xe(u),h=gi(i,u);for(let f=0;f<h.length;f++){let g=h[f],E=T.default.toNumber(T.default.subtract(l,g)),S=Nn(E,6e10,"halfExpand");if(E===r||s&&S===r)return g}if(a==="reject"){let f=ja(r),g=yi(u,"iso8601","auto");throw new RangeError(`Offset ${f} is invalid for ${g} in ${i}`)}return Fl(h,i,u,o)}function ii(n,t){let e,r,i,o,a,s,u,l=!1,h="option";if(Ye(n)){if(fe(n)){let k=te(t);return ui(k),uo(k,"reject"),ve(k),tt(m(n,se),m(n,_e),m(n,$))}a=$i(n);let g=zt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=g),o===void 0&&(h="wall");let E=te(t);s=ui(E),u=uo(E,"reject");let S=ve(E);({isoDate:e,time:r}=Fi(a,g,S))}else{let g,E,S,k,A;({year:S,month:k,day:A,time:r,tzAnnotation:g,offset:o,z:E,calendar:a}=function(V){let G=mn(V);if(!G.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return G}(Ue(n))),i=bt(g),E?h="exact":o||(h="wall"),a||(a="iso8601"),a=_t(a),l=!0;let B=te(t);s=ui(B),u=uo(B,"reject"),ve(B),e={year:S,month:k,day:A}}let f=0;return h==="option"&&(f=Ar(o)),tt(go(e,r,h,f,i,s,u,l),i,a)}function Il(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,al,!0)}function wt(n,t){let e=Qe("%Temporal.PlainDate%"),r=Object.create(e.prototype);return Il(r,n,t),r}function xl(n,t,e){er(t),Tn(n),me(n,Ae,t),me(n,$,e)}function qt(n,t){let e=Qe("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return xl(r,n,t),r}function Pl(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,cl,!0)}function br(n,t){let e=Qe("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return Pl(r,n,t),r}function Rl(n,t){Tn(n),me(n,He,t)}function wn(n){let t=Qe("%Temporal.PlainTime%"),e=Object.create(t.prototype);return Rl(e,n),e}function Al(n,t,e){Ss(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,sl,!0)}function Dr(n,t){let e=Qe("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return Al(r,n,t),r}function Ll(n,t){dn(t),Tn(n),me(n,se,t)}function Xt(n){let t=Qe("%Temporal.Instant%"),e=Object.create(t.prototype);return Ll(e,n),e}function Nl(n,t,e,r){dn(t),Tn(n),me(n,se,t),me(n,_e,e),me(n,$,r)}function tt(n,t,e="iso8601"){let r=Qe("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return Nl(i,n,t,e),i}function Ac(n){return $a.filter(t=>n[t]!==void 0)}function Xn(n,t,e){let r=Ac(e),i=Bn(n).fieldKeysToIgnore(r),o=Object.create(null),a=Ac(t);for(let s=0;s<$a.length;s++){let u,l=$a[s];a.includes(l)&&!i.includes(l)&&(u=t[l]),r.includes(l)&&(u=e[l]),u!==void 0&&(o[l]=u)}return o}function Bt(n,t,e,r){let i=Bn(n).dateAdd(t,e,r);return ar(i),i}function Hi(n,t,e,r){return Bn(n).dateUntil(t,e,r)}function Yi(n){if(Ye(n)&&Et(n,$))return m(n,$);let t=Ue(n);try{return _t(t)}catch{}let e;try{({calendar:e}=mn(t))}catch{try{({calendar:e}=_l(t))}catch{try{({calendar:e}=ws(t))}catch{({calendar:e}=bs(t))}}}return e||(e="iso8601"),_t(e)}function $i(n){if(Et(n,$))return m(n,$);let{calendar:t}=n;return t===void 0?"iso8601":Yi(t)}function un(n,t){return _t(n)===_t(t)}function Yn(n,t,e){let r=Bn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return ar(i),i}function pi(n,t,e){let r=Bn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Ss(i),i}function yo(n,t,e){let r=Bn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return ar(i),i}function bt(n){if(Ye(n)&&fe(n))return m(n,_e);let t=Ue(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:u}=function(l){if(Ml.test(l))return{tzAnnotation:l,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:f,z:g}=mn(l);if(g||h||f)return{tzAnnotation:h,offset:f,z:g}}catch{}kl(l)}(o);return a?On(a):u?On("UTC"):s?On(s):void 0}(t);if(r!==void 0)return Ds(r);let i=vo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function Ol(n,t){if(n===t)return!0;let e=On(n).offsetMinutes,r=On(t).offsetMinutes;if(e===void 0&&r===void 0){let i=vo(t);if(!i)return!1;let o=vo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function bn(n,t){let e=On(n).offsetMinutes;return e!==void 0?6e10*e:za(n,t)}function ja(n){let t=n<0?"-":"+",e=Math.abs(n),r=Math.floor(e/36e11),i=Math.floor(e/6e10)%60,o=Math.floor(e/1e9)%60,a=e%1e9;return`${t}${No(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function Gt(n,t){let e=bn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:u,millisecond:l,microsecond:h,nanosecond:f}}=$l(t);return vi(r,i,o,a,s,u,l,h,f+e)}function rt(n,t,e){return Fl(gi(n,t),n,t,e)}function Fl(n,t,e,r){let i=n.length;if(i===1)return n[0];if(i)switch(r){case"compatible":case"earlier":return n[0];case"later":return n[i-1];case"reject":throw new RangeError("multiple instants found")}if(r==="reject")throw new RangeError("multiple instants found");let o=Xe(e),a=T.default.subtract(o,Fn);dn(a);let s=bn(t,a),u=T.default.add(o,Fn);dn(u);let l=bn(t,u)-s;switch(r){case"earlier":{let h=Se.fromComponents(0,0,0,0,0,-l),f=Tr(e.time,h);return gi(t,De(It(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f))[0]}case"compatible":case"later":{let h=Se.fromComponents(0,0,0,0,0,l),f=Tr(e.time,h),g=gi(t,De(It(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f));return g[g.length-1]}}}function gi(n,t){if(n==="UTC")return Er(t.isoDate),[Xe(t)];let e=On(n).offsetMinutes;if(e!==void 0){let r=vi(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-e,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);Er(r.isoDate);let i=Xe(r);return dn(i),[i]}return Er(t.isoDate),function(r,i){let o=Xe(i),a=T.default.subtract(o,Fn);T.default.lessThan(a,mi)&&(a=o);let s=T.default.add(o,Fn);T.default.greaterThan(s,Mr)&&(s=o);let u=za(r,a),l=za(r,s);return(u===l?[u]:[u,l]).map(f=>{let g=T.default.subtract(o,T.default.BigInt(f)),E=function(S,k){let{epochMilliseconds:A,time:{millisecond:B,microsecond:V,nanosecond:G}}=$l(k),{year:U,month:J,day:oe,hour:ke,minute:Me,second:ie}=Bl(S,A);return vi(U,J,oe,ke,Me,ie,B,V,G)}(r,g);if(Cr(i,E)===0)return dn(g),g}).filter(f=>f!==void 0)}(n,t)}function Rn(n,t){let e=De(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=gi(n,e);if(r.length)return r[0];let i=Xe(e),o=T.default.subtract(i,Fn);return dn(o),_s(n,o)}function Bi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+fi(Math.abs(n),6):fi(n,4),t}function jt(n){return fi(n,2)}function Hl(n,t){let e;if(t==="auto"){if(n===0)return"";e=fi(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=fi(n,9).slice(0,t)}return`.${e}`}function No(n,t,e,r,i){let o=`${jt(n)}:${jt(t)}`;return i==="minute"||(o+=`:${jt(e)}`,o+=Hl(r,i)),o}function Lc(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,se),o=yi(Gt(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=Yl(bn(r,i))),`${o}${a}`}function lo(n,t){let e=m(n,ut),r=m(n,dt),i=m(n,St),o=m(n,ht),a=m(n,mt),s=m(n,ft),u=bo(n),l="";e!==0&&(l+=`${Math.abs(e)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),o!==0&&(l+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let f=Se.fromComponents(0,0,m(n,pt),m(n,gt),m(n,yt),m(n,kt));f.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(yn(n))&&t==="auto"||(h+=`${Math.abs(f.sec)}${Hl(Math.abs(f.subsec),t)}S`);let g=`${u<0?"-":""}P${l}`;return h&&(g=`${g}T${h}`),g}function Nc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce);return`${Bi(e)}-${jt(r)}-${jt(i)}${Ri(m(n,$),t)}`}function Oc({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return No(n,t,e,1e6*r+1e3*i+o,a)}function yi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}=n;return`${Bi(i)}-${jt(o)}-${jt(a)}T${No(s,u,l,1e6*h+1e3*f+g,e)}${Ri(t,r)}`}function Fc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${jt(r)}-${jt(i)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Bi(e)}-${o}`);let s=Ri(a,t);return s&&(o+=s),o}function Hc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${Bi(e)}-${jt(r)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${jt(i)}`);let s=Ri(a,t);return s&&(o+=s),o}function Yc(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,se);if(o){let{unit:h,increment:f,roundingMode:g}=o;a=Wa(a,f,h,g)}let s=m(n,_e),u=bn(s,a),l=yi(Gt(s,a),"iso8601",t,"never");return i!=="never"&&(l+=Yl(u)),r!=="never"&&(l+=`[${r==="critical"?"!":""}${s}]`),l+=Ri(m(n,$),e),l}function $c(n){return Sl.test(n)}function Ar(n){let t=sh.exec(n);if(!t)throw new RangeError(`invalid time zone offset: ${n}; must match \xB1HH: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))}var Gr,oh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function vo(n){if(Gr===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){Gr=new Map;for(let a=0;a<o.length;a++){let s=o[a];Gr.set(wi(s),s)}}else Gr=null}let t=wi(n),e=Gr?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=El(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),eh.has(n))throw new RangeError(`${n} is a legacy time zone identifier from ICU. Use ${e} instead`);let r=[...t].map((o,a)=>a===0||oh[t[a-1]]?o.toUpperCase():o).join("").split("/");if(r.length===1)return t==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:e}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:e};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:e};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:e};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:e}}function Zn(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=Bl(n,t),u=t%1e3;return u<0&&(u+=1e3),1e6*(Es({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:u}})-t)}function za(n,t){return Zn(n,Zt(t,"floor"))}function Ds(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${No(Math.floor(e/60),e%60,0,0,"minute")}`}function Yl(n){return Ds(Nn(n,Gd,"halfExpand")/6e10)}function Es({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,u=(n-s)/400,l=new Date;return l.setUTCHours(r,i,o,a),l.setUTCFullYear(s,t-1,e),l.getTime()+Xd*u}function Xe(n){let t=Es(n),e=1e3*n.time.microsecond+n.time.nanosecond;return T.default.add(Qt(t),T.default.BigInt(e))}function $l(n){let t=Zt(n,"trunc"),e=T.default.toNumber(T.default.remainder(n,xi));e<0&&(e+=1e6,t-=1);let r=Math.floor(e/1e3)%1e3,i=e%1e3,o=new Date(t);return{epochMilliseconds:t,isoDate:{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()},time:{hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function _s(n,t){if(n==="UTC")return null;let e=Zt(t,"floor");if(e<si)return _s(n,Qt(si));let r=Date.now(),i=Math.max(e,r)+366*Hn*3,o=e,a=Zn(n,o),s=o,u=a;for(;a===u&&o<i;){if(s=o+2*Hn*7,s>Dl)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(Jl(l=>Zn(n,l),o,s,a,u))}function Ua(n,t){if(n==="UTC")return null;let e=Zt(t,"ceil"),r=Date.now(),i=r+366*Hn*3;if(e>i){let l=Ua(n,Qt(i));if(l===null||T.default.lessThan(l,Qt(r)))return l}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let l=Date.UTC(2088,0,1);if(l<e)return Ua(n,Qt(l))}let o=e-1;if(o<si)return null;let a=Zn(n,o),s=o,u=a;for(;a===u&&o>si;){if(s=o-2*Hn*7,s<si)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(Jl(l=>Zn(n,l),s,o,u,a))}function Bl(n,t){return function(e){let r=e.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${e}`);let i=+r[0],o=+r[1],a=+r[2],s=r[3];if(s[0]==="b"||s[0]==="B")a=1-a;else if(s[0]!=="a"&&s[0]!=="A")throw new RangeError(`Unknown era ${s} in "${e}`);let u=r[4]==="24"?0:+r[4],l=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(u)&&Number.isFinite(l)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:u,minute:l,second:h}}(El(n).format(t))}function wo(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function Jn(n,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]}[wo(n)?"leapyear":"standard"][t-1]}function bo(n){let t=[m(n,ut),m(n,dt),m(n,St),m(n,ht),m(n,mt),m(n,ft),m(n,pt),m(n,gt),m(n,yt),m(n,kt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Oo(n){let t=["years","months","weeks","days"];for(let e=0;e<t.length;e++){let r=n[t[e]];if(r!==0)return r<0?-1:1}return 0}function jl(n){let t=Oo(n.date);return t!==0?t:n.time.sign()}function Gn(n,t){let e=n,r=t;if(!Number.isFinite(e)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,e+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:e,month:r}}function It(n,t,e){let r=n,i=t,o=e;if(!Number.isFinite(o))throw new RangeError("infinity is out of range");({year:r,month:i}=Gn(r,i));let a=146097;if(Math.abs(o)>a){let l=Math.trunc(o/a);r+=400*l,o-=l*a}let s=0,u=i>2?r:r-1;for(;s=wo(u)?366:365,o<-s;)r-=1,u-=1,o+=s;for(u+=1;s=wo(u)?366:365,o>s;)r+=1,u+=1,o-=s;for(;o<1;)({year:r,month:i}=Gn(r,i-1)),o+=Jn(r,i);for(;o>Jn(r,i);)o-=Jn(r,i),{year:r,month:i}=Gn(r,i+1);return{year:r,month:i,day:o}}function vi(n,t,e,r,i,o,a,s,u){let l=An(r,i,o,a,s,u);return De(It(n,t,e+l.deltaDays),l)}function An(n,t,e,r,i,o){let a,s=n,u=t,l=e,h=r,f=i,g=o;({div:a,mod:g}=wr(g,3)),f+=a,g<0&&(f-=1,g+=1e3),{div:a,mod:f}=wr(f,3),h+=a,f<0&&(h-=1,f+=1e3),l+=Math.trunc(h/1e3),h%=1e3,h<0&&(l-=1,h+=1e3),u+=Math.trunc(l/60),l%=60,l<0&&(u-=1,l+=60),s+=Math.trunc(u/60),u%=60,u<0&&(s-=1,u+=60);let E=Math.trunc(s/24);return s%=24,s<0&&(E-=1,s+=24),E+=0,s+=0,u+=0,l+=0,h+=0,f+=0,g+=0,{deltaDays:E,hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g}}function Bc(n,t){let e=nt(n,0);if(Oo(e)===0)return n.days;let r=m(t,ce),i=Bt(m(t,$),r,e,"constrain"),o=tr(r.year,r.month-1,r.day),a=tr(i.year,i.month-1,i.day)-o;return n.days+a}function xt(n){return new(Qe("%Temporal.Duration%"))(-m(n,ut),-m(n,dt),-m(n,St),-m(n,ht),-m(n,mt),-m(n,ft),-m(n,pt),-m(n,gt),-m(n,yt),-m(n,kt))}function vt(n,t,e){return Math.min(e,Math.max(t,n))}function zl(n,t,e){let r=vt(t,1,12);return{year:n,month:r,day:vt(e,1,Jn(n,r))}}function Ve(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function Qn(n,t,e){Ve(t,1,12),Ve(e,1,Jn(n,t))}function ar(n){er(De(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Fo(n,t,e,r,i,o){Ve(n,0,23),Ve(t,0,59),Ve(e,0,59),Ve(r,0,999),Ve(i,0,999),Ve(o,0,999)}function Ms(n,t,e,r,i,o,a,s,u){Qn(n,t,e),Fo(r,i,o,a,s,u)}function er(n){let t=Xe(n);(T.default.lessThan(t,Zd)||T.default.greaterThan(t,Jd))&&dn(t)}function Va(n){Xe(n)}function dn(n){if(T.default.lessThan(n,mi)||T.default.greaterThan(n,Mr))throw new RangeError("date/time value is outside of supported range")}function Ss({year:n,month:t}){Ve(n,Tc,Cc),n===Tc?Ve(t,4,12):n===Cc&&Ve(t,1,9)}function Ho(n,t,e,r,i,o,a,s,u,l){let h=0,f=[n,t,e,r,i,o,a,s,u,l];for(let B=0;B<f.length;B++){let V=f[B];if(V===1/0||V===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(V!==0){let G=V<0?-1:1;if(h!==0&&G!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=G}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let g=wr(s,3),E=wr(u,6),S=wr(l,9),k=wr(1e6*g.mod+1e3*E.mod+S.mod,9).div,A=86400*r+3600*i+60*o+a+g.div+E.div+S.div+k;if(!Number.isSafeInteger(A))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function vr(n){return{date:{years:m(n,ut),months:m(n,dt),weeks:m(n,St),days:m(n,ht)},time:Se.fromComponents(m(n,mt),m(n,ft),m(n,pt),m(n,gt),m(n,yt),m(n,kt))}}function cn(n){let t=Se.fromComponents(m(n,mt),m(n,ft),m(n,pt),m(n,gt),m(n,yt),m(n,kt)).add24HourDays(m(n,ht));return{date:{years:m(n,ut),months:m(n,dt),weeks:m(n,St),days:0},time:t}}function Ul(n){let t=cn(n),e=Math.trunc(t.time.sec/86400);return Ho(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function Wt(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,u=0,l=0;switch(t){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60,l=Math.trunc(u/24),u%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,o=Ta(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Ta(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Ta(a,9,r),a=0}return new(Qe("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*l,e*u,e*s,e*a,e*o,e*i,e*r)}function En(n,t){return Oo(n),t.sign(),{date:n,time:t}}function tr(n,t,e){return Es({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Hn}function Er({year:n,month:t,day:e}){if(Math.abs(tr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function ks(n,t){let e=t.hour-n.hour,r=t.minute-n.minute,i=t.second-n.second,o=t.millisecond-n.millisecond,a=t.microsecond-n.microsecond,s=t.nanosecond-n.nanosecond;return Se.fromComponents(e,r,i,o,a,s)}function Ts(n,t,e,r,i){let o=Se.fromEpochNsDiff(t,n);return o=Do(o,e,r,i),En({years:0,months:0,weeks:0,days:0},o)}function Vl(n,t,e,r){Va(n),Va(t);let i=ks(n.time,t.time),o=i.sign(),a=hn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=It(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let u=Dn("day",r),l=Hi(e,n.isoDate,s,u);return r!==u&&(i=i.add24HourDays(l.days),l.days=0),En(l,i)}function ql(n,t,e,r,i){let o=T.default.subtract(t,n);if(T.default.equal(o,Yt))return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};let a=T.default.lessThan(o,Yt)?-1:1,s=Gt(e,n),u=Gt(e,t),l,h=0,f=a===1?2:1,g=ks(s.time,u.time);for(g.sign()===-a&&h++;h<=f;h++){l=De(It(u.isoDate.year,u.isoDate.month,u.isoDate.day-h*a),s.time);let S=rt(e,l,"compatible");if(g=Se.fromEpochNsDiff(t,S),g.sign()!==-a)break}let E=Dn("day",i);return En(Hi(r,s.isoDate,l.isoDate,E),g)}function Wl(n,t,e,r,i,o,a,s,u){let l,h,f,g,E=t;switch(s){case"year":{let O=Nn(E.date.years,a,"trunc");l=O,h=O+a*n,f={years:l,months:0,weeks:0,days:0},g={...f,years:h};break}case"month":{let O=Nn(E.date.months,a,"trunc");l=O,h=O+a*n,f=nt(E.date,0,0,l),g=nt(E.date,0,0,h);break}case"week":{let O=nt(E.date,0,0),ne=Bt(o,r.isoDate,O,"constrain"),y=Hi(o,ne,It(ne.year,ne.month,ne.day+E.date.days),"week"),L=Nn(E.date.weeks+y.weeks,a,"trunc");l=L,h=L+a*n,f=nt(E.date,0,l),g=nt(E.date,0,h);break}case"day":{let O=Nn(E.date.days,a,"trunc");l=O,h=O+a*n,f=nt(E.date,l),g=nt(E.date,h);break}}let S=Bt(o,r.isoDate,f,"constrain"),k=Bt(o,r.isoDate,g,"constrain"),A,B,V=De(S,r.time),G=De(k,r.time);i?(A=rt(i,V,"compatible"),B=rt(i,G,"compatible")):(A=Xe(V),B=Xe(G));let U=Se.fromEpochNsDiff(e,A),J=Se.fromEpochNsDiff(B,A),oe=Io(u,n<0?"negative":"positive"),ke=U.add(U).abs().subtract(J.abs()).sign(),Me=Math.abs(l)/a%2==0,ie=U.isZero()?Math.abs(l):U.cmp(J)?xo(Math.abs(l),Math.abs(h),ke,Me,oe):Math.abs(h),N=new Se(T.default.add(T.default.multiply(J.totalNs,T.default.BigInt(l)),T.default.multiply(U.totalNs,T.default.BigInt(a*n)))).fdiv(J.totalNs),H=ie===Math.abs(h);return E={date:H?g:f,time:Se.ZERO},{nudgeResult:{duration:E,nudgedEpochNs:H?B:A,didExpandCalendarUnit:H},total:N}}function Yo(n,t,e,r,i,o,a,s,u){let l=n,h=an(s)||r&&s==="day",f=jl(l)<0?-1:1,g;return h?{nudgeResult:g}=Wl(f,l,t,e,r,i,a,s,u):g=r?function(E,S,k,A,B,V,G,U){let J=S,oe=Bt(B,k.isoDate,J.date,"constrain"),ke=De(oe,k.time),Me=De(It(oe.year,oe.month,oe.day+E),k.time),ie=rt(A,ke,"compatible"),N=rt(A,Me,"compatible"),H=Se.fromEpochNsDiff(N,ie);if(H.sign()!==E)throw new RangeError("time zone returned inconsistent Instants");let O=T.default.BigInt(kr[G]*V),ne=J.time.round(O,U),y=ne.subtract(H),L=y.sign()!==-E,c,d;return L?(c=E,ne=y.round(O,U),d=ne.addToEpochNs(N)):(c=0,d=ne.addToEpochNs(ie)),{duration:En(nt(J.date,J.date.days+c),ne),nudgedEpochNs:d,didExpandCalendarUnit:L}}(f,l,e,r,i,a,s,u):function(E,S,k,A,B,V){let G=E,U=G.time.add24HourDays(G.date.days),J=U.round(T.default.BigInt(A*kr[B]),V),oe=J.subtract(U),{quotient:ke}=U.divmod(fo),{quotient:Me}=J.divmod(fo),ie=Math.sign(Me-ke)===U.sign(),N=oe.addToEpochNs(S),H=0,O=J;return vn(k)==="date"&&(H=Me,O=J.add(Se.fromComponents(24*-Me,0,0,0,0,0))),{duration:{date:nt(G.date,H),time:O},nudgedEpochNs:N,didExpandCalendarUnit:ie}}(l,t,o,a,s,u),l=g.duration,g.didExpandCalendarUnit&&s!=="week"&&(l=function(E,S,k,A,B,V,G,U){let J=S;if(U===G)return J;let oe=ci.indexOf(G);for(let ke=ci.indexOf(U)-1;ke>=oe;ke--){let Me=ci[ke];if(Me==="week"&&G!=="week")continue;let ie;switch(Me){case"year":ie={years:J.date.years+E,months:0,weeks:0,days:0};break;case"month":{let O=J.date.months+E;ie=nt(J.date,0,0,O);break}case"week":{let O=J.date.weeks+E;ie=nt(J.date,0,O);break}}let N=De(Bt(V,A.isoDate,ie,"constrain"),A.time),H;if(H=B?rt(B,N,"compatible"):Xe(N),ho(k,H)===-E)break;J={date:ie,time:Se.ZERO}}return J}(f,l,g.nudgedEpochNs,e,r,i,o,Dn(s,"day"))),l}function jc(n,t,e,r,i,o){return an(o)||r&&o==="day"?Wl(jl(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:di(n.time.add24HourDays(n.date.days),o)}function Kl(n,t,e,r,i,o,a){if(Cr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};er(n),er(t);let s=Vl(n,t,e,r);return o==="nanosecond"&&i===1?s:Yo(s,Xe(t),n,null,e,r,i,o,a)}function Gl(n,t,e,r,i,o,a,s){if(vn(i)==="time")return Ts(n,t,o,a,s);let u=ql(n,t,e,r,i);return a==="nanosecond"&&o===1?u:Yo(u,t,Gt(e,n),e,r,i,o,a,s)}function Lr(n,t,e,r,i,o){let a=Sr.reduce((E,S)=>{let k=S[0],A=S[1],B=S[2];return e!=="datetime"&&B!==e||r.includes(A)||E.push(A,k),E},[]),s=Ct(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let u=Pr(t),l=en(t,"trunc");n==="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 h=Ct(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let f=Dn(o,h);if(s==="auto"&&(s=f),Dn(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let g={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return g!==void 0&&Rr(u,g,!1),{largestUnit:s,roundingIncrement:u,roundingMode:l,smallestUnit:h}}function zc(n,t,e,r){let i=ni(e),o=Lr(n,te(r),"time",[],"nanosecond","second"),a=Wt(Ts(m(t,se),m(i,se),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=xt(a)),a}function Uc(n,t,e,r){let i=ei(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Lr(n,te(r),"date",[],"day","day"),u=Qe("%Temporal.Duration%"),l=m(t,ce),h=m(i,ce);if(hn(l,h)===0)return new u;let f={date:Hi(o,l,h,s.largestUnit),time:Se.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let E=De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});f=Yo(f,Xe(De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),E,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let g=Wt(f,"day");return n==="since"&&(g=xt(g)),g}function Vc(n,t,e,r){let i=ti(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Lr(n,te(r),"datetime",[],"nanosecond","day"),u=Qe("%Temporal.Duration%"),l=m(t,Ae),h=m(i,Ae);if(Cr(l,h)===0)return new u;let f=Wt(Kl(l,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(f=xt(f)),f}function qc(n,t,e,r){let i=Ln(e),o=Lr(n,te(r),"time",[],"nanosecond","hour"),a=ks(m(t,He),m(i,He));a=Do(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=Wt(En({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=xt(s)),s}function Wc(n,t,e,r){let i=ri(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Lr(n,te(r),"date",["week","day"],"month","year"),u=Qe("%Temporal.Duration%");if(hn(m(t,ce),m(i,ce))==0)return new u;let l=Dt(o,m(t,ce),"year-month");l.day=1;let h=Yn(o,l,"constrain"),f=Dt(o,m(i,ce),"year-month");f.day=1;let g=Yn(o,f,"constrain"),E={date:nt(Hi(o,h,g,s.largestUnit),0,0),time:Se.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let k=De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});E=Yo(E,Xe(De(g,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),k,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let S=Wt(E,"day");return n==="since"&&(S=xt(S)),S}function Kc(n,t,e,r){let i=ii(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Lr(n,te(r),"datetime",[],"nanosecond","hour"),u=m(t,se),l=m(i,se),h=Qe("%Temporal.Duration%"),f;if(vn(s.largestUnit)!=="date")f=Wt(Ts(u,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let g=m(t,_e);if(!Ol(g,m(i,_e)))throw new 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(T.default.equal(u,l))return new h;f=Wt(Gl(u,l,g,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(f=xt(f)),f}function Tr({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,u=o;return s+=a.sec,u+=a.subsec,An(n,t,s,r,i,u)}function qa(n,t){let e=t.addToEpochNs(n);return dn(e),e}function oi(n,t,e,r,i="constrain"){if(Oo(r.date)===0)return qa(n,r.time);let o=Gt(t,n);return qa(rt(t,De(Bt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function Gc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=Dn(yn(t),yn(r));if(an(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=cn(t),a=cn(r);return Wt(En({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function Zc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=yn(r);if(vn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=cn(r);return Xt(qa(m(t,se),o.time))}function Jc(n,t,e,r){let i=m(t,$),o=Kt(e);n==="subtract"&&(o=xt(o));let a=Ul(o),s=ve(te(r));return wt(Bt(i,m(t,ce),a,s),i)}function Xc(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,$),s=cn(i),u=m(t,Ae),l=Tr(u.time,s.time),h=nt(s.date,l.deltaDays);return Ho(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),qt(De(Bt(a,u.isoDate,h,o),l),a)}function Qc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=cn(r),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Tr(m(t,He),i.time);return wn(Lo(o,a,s,u,l,h,"reject"))}function el(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=bo(i),s=m(t,$),u=Dt(s,m(t,ce),"year-month");u.day=1;let l=Yn(s,u,"constrain");if(a<0){let f=Bt(s,l,{months:1},"constrain");l=It(f.year,f.month,f.day-1)}let h=Ul(i);return ar(l),Dr(pi(s,Dt(s,Bt(s,l,h,o),"year-month"),o),s)}function tl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,_e),s=m(t,$),u=vr(i);return tt(oi(m(t,se),a,s,u,o),a,s)}function Nn(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,u=Tt(Math.abs(2*i)-t),l=a%2==0,h=Io(e,o),f=i===0?a:xo(a,s,u,l,h);return t*(o==="positive"?f:-f)}function Wa(n,t,e,r){let i=kr[e]*t;return function(o,a,s){let u=gn(o),l=gn(a),h=T.default.divide(u,l),f=T.default.remainder(u,l),g=Io(s,"positive"),E,S;T.default.lessThan(u,Yt)?(E=T.default.subtract(h,hi),S=h):(E=h,S=T.default.add(h,hi));let k=ho(Kn(T.default.multiply(f,vs)),l)*(T.default.lessThan(u,Yt)?-1:1)+0,A=T.default.equal(f,Yt)?h:xo(E,S,k,ol(E),g);return T.default.multiply(A,l)}(n,T.default.BigInt(i),r)}function Ka(n,t,e,r){Va(n);let{year:i,month:o,day:a}=n.isoDate,s=Ga(n.time,t,e,r);return De(It(i,o,a+s.deltaDays),s)}function Ga({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,u){let l;switch(s){case"day":case"hour":l=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":l=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":l=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":l=1e3*(1e3*r+i)+o;break;case"microsecond":l=1e3*i+o;break;case"nanosecond":l=o}let h=kr[s],f=Nn(l,h*a,u)/h;switch(s){case"day":return{deltaDays:f,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return An(f,0,0,0,0,0);case"minute":return An(n,f,0,0,0,0);case"second":return An(n,t,f,0,0,0);case"millisecond":return An(n,t,e,f,0,0);case"microsecond":return An(n,t,e,r,f,0);case"nanosecond":return An(n,t,e,r,i,f);default:throw new Error(`Invalid unit ${s}`)}}function Do(n,t,e,r){let i=kr[e];return n.round(T.default.BigInt(i*t),r)}function di(n,t){let e=kr[t];return n.fdiv(T.default.BigInt(e))}function hn(n,t){return n.year!==t.year?Tt(n.year-t.year):n.month!==t.month?Tt(n.month-t.month):n.day!==t.day?Tt(n.day-t.day):0}function Za(n,t){return n.hour!==t.hour?Tt(n.hour-t.hour):n.minute!==t.minute?Tt(n.minute-t.minute):n.second!==t.second?Tt(n.second-t.second):n.millisecond!==t.millisecond?Tt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Tt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Tt(n.nanosecond-t.nanosecond):0}function Cr(n,t){let e=hn(n.isoDate,t.isoDate);return e!==0?e:Za(n.time,t.time)}function Zl(n){let t=Eo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function Zt(n,t){let e=gn(n),{quotient:r,remainder:i}=Xr(e,xi),o=T.default.toNumber(r);return t==="floor"&&T.default.toNumber(i)<0&&(o-=1),t==="ceil"&&T.default.toNumber(i)>0&&(o+=1),o}function Qt(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return T.default.multiply(T.default.BigInt(n),xi)}function Eo(n){let t=n;if(typeof n=="object"){let e=n[Symbol.toPrimitive];e&&typeof e=="function"&&(t=e.call(n,"number"))}if(typeof t=="number")throw new TypeError("cannot convert number to bigint");return typeof t=="bigint"?T.default.BigInt(t.toString(10)):T.default.BigInt(t)}var Ja=(()=>{let n=T.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=T.default.BigInt(t),r=T.default.add(Qt(t),n);return n=T.default.remainder(e,xi),T.default.greaterThan(r,Mr)?Mr:T.default.lessThan(r,mi)?mi:r}})();function Zr(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Tt(n){return n<0?-1:n>0?1:n}function te(n){if(n===void 0)return Object.create(null);if(Ye(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function nr(n,t){let e=Object.create(null);return e[n]=t,e}function _n(n,t,e,r){let i=n[t];if(i!==void 0){if(i=Ro(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Sn)throw new RangeError(`${t} option is required`);return r}function _t(n){let t=wi(n);if(!Qd.includes(wi(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function wi(n){let t="";for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function jn(n){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${n==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${n}.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.`)}var ah=new RegExp(`^${wl.source}$`),sh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Jl(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,u=i;for(;a-o>1;){let l=Math.trunc((o+a)/2),h=n(l);h===s?(o=l,s=h):h===u&&(a=l,u=h)}return a}function Xl(n){return[...n]}function Ql(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=ji[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),u=e.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,h=(i-o+7001-s)%7,f=Math.floor((o-1+h)/7);if(7-h>=u&&++f,f==0)f=function(g,E,S,k){let A=(k-g-S+1)%7;A<0&&(A+=7);let B=Math.floor((S+A-1)/7);return 7-A>=E&&++B,B}(s,u,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let g=(l+a-o)%7;g<0&&(g+=7),6-g>=u&&o+7-l>a&&(f=1,r++)}return{week:f,year:r}}function nl(n,t,e,r,i){if(t!==i.year){if(n*(t-i.year)>0)return!0}else if(e!==i.month){if(n*(e-i.month)>0)return!0}else if(r!==i.day&&n*(r-i.day)>0)return!0;return!1}var ji={};function rr(n){if(!n.startsWith("M"))throw new RangeError(`Invalid month code: ${n}. Month codes must start with M.`);let t=+n.slice(1);if(Number.isNaN(t))throw new RangeError(`Invalid month code: ${n}`);return t}function ln(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Cs(n,t=void 0,e=12){let{month:r,monthCode:i}=n;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");t==="reject"&&Ve(r,1,e),t==="constrain"&&(r=vt(r,1,e)),i=ln(r)}else{let o=rr(i);if(i!==ln(o))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==o)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=o,r<1||r>e)throw new RangeError(`Invalid monthCode: ${i}`)}return{...n,month:r,monthCode:i}}ji.iso8601={resolveFields(n,t){if((t==="date"||t==="year-month")&&n.year===void 0)throw new TypeError("year is required");if((t==="date"||t==="month-day")&&n.day===void 0)throw new TypeError("day is required");Object.assign(n,Cs(n))},dateToISO:(n,t)=>li(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=li(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return Xl(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:u}=n;return a+=t,s+=e,{year:a,month:s}=Gn(a,s),{year:a,month:s,day:u}=li(a,s,u,o),u+=i+7*r,It(a,s,u)},dateUntil(n,t,e){let r=-hn(n,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,o=0,a=0;if(e==="year"||e==="month"){let h=t.year-n.year;for(h!==0&&(h-=r);!nl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let f=r;for(i=Gn(n.year+o,n.month+f);!nl(r,i.year,i.month,n.day,t);)a=f,f+=r,i=Gn(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=Gn(n.year+o,n.month+a);let s=zl(i.year,i.month,n.day),u=0,l=tr(t.year,t.month-1,t.day)-tr(s.year,s.month-1,s.day);return e==="week"&&(u=Math.trunc(l/7),l%=7),{years:o,months:a,weeks:u,days:l}},isoToDate({year:n,month:t,day:e},r){let i={era:void 0,eraYear:void 0,year:n,month:t,day:e,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=ln(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),u=a-100*s,l=(e+Math.floor(2.6*o-.2)+(u+Math.floor(u/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=l+(l<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=Jn(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=Ql("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=Jn(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=wo(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Ft=class n{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let e=0;for(let r of t.map.entries()){if(++e>n.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(t){let e=this.map.get(t);return e&&(this.hits++,this.report()),this.calls++,e}set(t,e){this.map.set(t,e),this.misses++,this.report()}report(){}setObject(t){if(n.objectMap.get(t))throw new RangeError("object already cached");n.objectMap.set(t,this),this.report()}static getCacheForObject(t){let e=n.objectMap.get(t);return e||(e=new n,n.objectMap.set(t,e)),e}};function eu({isoYear:n,isoMonth:t,isoDay:e}){return`${Bi(n)}-${jt(t)}-${jt(e)}T00:00Z`}function xa(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Ft.objectMap=new WeakMap,Ft.MAX_CACHE_ENTRIES=1e3;var kn=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(t){let e=this.getFormatter(),r=new Date(t);if(t==="-271821-04-19T00:00Z"){let i=e.resolvedOptions();e=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return e.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${t}`)}}isoToCalendarDate(t,e){let{year:r,month:i,day:o}=t,a=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:o,id:this.id}),s=e.get(a);if(s)return s;let u=eu({isoYear:r,isoMonth:i,isoDay:o}),l=this.getCalendarParts(u),h={};for(let g=0;g<l.length;g++){let{type:E,value:S}=l[g];if(E!=="year"&&E!=="relatedYear"||(this.hasEra?h.eraYear=+S:h.year=+S),E==="month"){let k=/^([0-9]*)(.*?)$/.exec(S);if(!k||k.length!=3||!k[1]&&!k[2])throw new RangeError(`Unexpected month: ${S}`);if(h.month=k[1]?+k[1]:1,h.month<1)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);k[2]&&(h.monthExtra=k[2])}E==="day"&&(h.day=+S),this.hasEra&&E==="era"&&S!=null&&S!==""&&(h.era=S.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&h.eraYear===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let g=this.eras.find(E=>h.era===E.genericName);g&&(h.era=g.code)}if(this.reviseIntlEra){let{era:g,eraYear:E}=this.reviseIntlEra(h,t);h.era=g,h.eraYear=E}this.checkIcuBugs&&this.checkIcuBugs(t);let f=this.adjustCalendarDate(h,e,"constrain",!0);if(f.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(f.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(f.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,f),["constrain","reject"].forEach(g=>{let E=JSON.stringify({func:"calendarToIsoDate",year:f.year,month:f.month,day:f.day,overflow:g,id:this.id});e.set(E,t)}),f}validateCalendarDate(t){let{month:e,year:r,day:i,eraYear:o,monthCode:a,monthExtra:s}=t;if(s!==void 0)throw new RangeError("Unexpected `monthExtra` value");if(r===void 0&&o===void 0)throw new TypeError("year or eraYear is required");if(e===void 0&&a===void 0)throw new TypeError("month or monthCode is required");if(i===void 0)throw new RangeError("Missing day");if(a!==void 0){if(typeof a!="string")throw new RangeError("monthCode must be a string, not "+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw new RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&t.era===void 0!=(t.eraYear===void 0))throw new TypeError("properties era and eraYear must be provided together")}adjustCalendarDate(t,e=void 0,r="constrain",i=!1){if(this.calendarType==="lunisolar")throw new RangeError("Override required for lunisolar calendars");let o=t;this.validateCalendarDate(o);let a=this.monthsInYear(o,e),{month:s,monthCode:u}=o;return{month:s,monthCode:u}=Cs(o,r,a),{...o,month:s,monthCode:u}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(Ve(o,1,i),Ve(a,1,this.maximumMonthLength(t))):(o=vt(o,1,i),a=vt(a,1,this.maximumMonthLength({...t,month:o}))),{...t,month:o,day:a}}calendarToIsoDate(t,e="constrain",r){let i=t,o=this.adjustCalendarDate(t,r,e,!1);o=this.regulateMonthDayNaive(o,e,r);let{year:a,month:s,day:u}=o,l=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:u,overflow:e,id:this.id}),h,f=r.get(l);if(f||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==o.year||i.month!==o.month||i.day!==o.day)&&(h=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:e,id:this.id}),f=r.get(h),f))return f;let g=this.estimateIsoDate({year:a,month:s,day:u}),E=V=>{let G=this.addDaysIso(g,V);if(o.day>this.minimumMonthLength(o)){let U=this.isoToCalendarDate(G,r);for(;U.month!==s||U.year!==a;){if(e==="reject")throw new RangeError(`day ${u} does not exist in month ${s} of year ${a}`);G=this.addDaysIso(G,-1),U=this.isoToCalendarDate(G,r)}}return G},S=0,k=this.isoToCalendarDate(g,r),A=xa(o,k);if(A.years!==0||A.months!==0||A.days!==0){let V=365*A.years+30*A.months+A.days;g=this.addDaysIso(g,V),k=this.isoToCalendarDate(g,r),A=xa(o,k),A.years===0&&A.months===0?g=E(A.days):S=this.compareCalendarDates(o,k)}let B=8;for(;S;){g=this.addDaysIso(g,S*B);let V=k;k=this.isoToCalendarDate(g,r);let G=S;if(S=this.compareCalendarDates(o,k),S){if(A=xa(o,k),A.years===0&&A.months===0)g=E(A.days),S=0;else if(G&&S!==G)if(B>1)B/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(k,V)>0&&(g=this.addDaysIso(g,-1)),S=0}}}if(r.set(l,g),h&&r.set(h,g),o.year===void 0||o.month===void 0||o.day===void 0||o.monthCode===void 0||this.hasEra&&(o.era===void 0||o.eraYear===void 0))throw new RangeError("Unexpected missing property");return g}compareCalendarDates(t,e){return t.year!==e.year?Tt(t.year-e.year):t.month!==e.month?Tt(t.month-e.month):t.day!==e.day?Tt(t.day-e.day):0}regulateDate(t,e="constrain",r){let i=this.calendarToIsoDate(t,e,r);return this.isoToCalendarDate(i,r)}addDaysIso(t,e){return It(t.year,t.month,t.day+e)}addDaysCalendar(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.addDaysIso(i,e);return this.isoToCalendarDate(o,r)}addMonthsCalendar(t,e,r,i){let o=t,{day:a}=o;for(let s=0,u=Math.abs(e);s<u;s++){let{month:l}=o,h=o,f=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),g=this.calendarToIsoDate(o,"constrain",i),E=this.addDaysIso(g,f);if(o=this.isoToCalendarDate(E,i),e>0){let S=this.monthsInYear(h,i);for(;o.month-1!=l%S;)E=this.addDaysIso(E,-1),o=this.isoToCalendarDate(E,i)}o.day!==a&&(o=this.regulateDate({...o,day:a},"constrain",i))}if(r==="reject"&&o.day!==a)throw new RangeError(`Day ${a} does not exist in resulting calendar month`);return o}addCalendar(t,{years:e=0,months:r=0,weeks:i=0,days:o=0},a,s){let{year:u,day:l,monthCode:h}=t,f=this.adjustCalendarDate({year:u+e,monthCode:h,day:l},s),g=this.addMonthsCalendar(f,r,a,s),E=o+7*i;return this.addDaysCalendar(g,E,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,u=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let l=this.calendarDaysUntil(t,e,i);o=l%7,a=(l-o)/7;break}case"month":case"year":{let l=this.compareCalendarDates(e,t);if(!l)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,f=e.day-t.day;if(r==="year"&&h){let S=0;e.monthCode>t.monthCode&&(S=1),e.monthCode<t.monthCode&&(S=-1),S||(S=Math.sign(f)),u=S*l<0?h-l:h}let g,E=u?this.addCalendar(t,{years:u},"constrain",i):t;do s+=l,g=E,E=this.addMonthsCalendar(g,l,"constrain",i),E.day!==t.day&&(E=this.regulateDate({...E,day:t.day},"constrain",i));while(this.compareCalendarDates(e,E)*l>=0);s-=l,o=this.calendarDaysUntil(g,e,i);break}}return{years:u,months:s,weeks:a,days:o}}daysInMonth(t,e){let{day:r}=t,i=this.maximumMonthLength(t),o=this.minimumMonthLength(t);if(o===i)return o;let a=r<=i-o?i:o,s=this.calendarToIsoDate(t,"constrain",e),u=this.addDaysIso(s,a),l=this.isoToCalendarDate(u,e),h=this.addDaysIso(u,-l.day);return this.isoToCalendarDate(h,e).day}daysInPreviousMonth(t,e){let{day:r,month:i,year:o}=t,a={year:i>1?o:o-1,month:i,day:1},s=i>1?i-1:this.monthsInYear(a,e);a={...a,month:s};let u=this.minimumMonthLength(a),l=this.maximumMonthLength(a);if(u===l)return l;let h=this.calendarToIsoDate(t,"constrain",e),f=this.addDaysIso(h,-r);return this.isoToCalendarDate(f,e).day}startOfCalendarYear(t){return{year:t.year,month:1,monthCode:"M01",day:1}}startOfCalendarMonth(t){return{year:t.year,month:t.month,day:1}}calendarDaysUntil(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.calendarToIsoDate(e,"constrain",r);return tr(o.year,o.month-1,o.day)-tr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,u,{era:l,eraYear:h,year:f,month:g,monthCode:E,day:S}=t;if(g!==void 0&&f===void 0&&(!this.hasEra||l===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(E===void 0||f!==void 0||this.hasEra&&h!==void 0)&&({monthCode:E,day:S}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let k={year:this.monthDaySearchStartYear(E,S),month:12,day:31},A=this.isoToCalendarDate(k,r),B=A.monthCode>E||A.monthCode===E&&A.day>=S?A.year:A.year-1;for(let V=0;V<20;V++){let G=this.adjustCalendarDate({day:S,monthCode:E,year:B-V},r),U=this.calendarToIsoDate(G,"constrain",r),J=this.isoToCalendarDate(U,r);if({year:i,month:o,day:a}=U,J.monthCode===E&&J.day===S)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(J.monthCode);if(J.monthCode===E&&J.day===oe&&S>oe)return{month:o,day:a,year:i};(s===void 0||J.monthCode===s.monthCode&&J.day>s.day)&&(s=J,u=U)}}if(e==="constrain"&&u!==void 0)return u;throw new RangeError(`No recent ${this.id} year with monthCode ${E} and day ${S}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},Xa=class extends kn{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(t){let{year:e}=t;return(7*e+1)%19<7}monthsInYear(t){return this.inLeapYear(t)?13:12}minimumMonthLength(t){return this.minMaxMonthLength(t,"min")}maximumMonthLength(t){return this.minMaxMonthLength(t,"max")}minMaxMonthLength(t,e){let{month:r,year:i}=t,o=this.getMonthCode(i,r),a=Object.entries(this.months).find(u=>u[1].monthCode===o);if(a===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let s=a[1].days;return typeof s=="number"?s:s[e]}maxLengthOfMonthCodeInAnyYear(t){return["M04","M06","M08","M10","M12"].includes(t)?29:30}estimateIsoDate(t){let{year:e}=t;return{year:e-3760,month:1,day:1}}getMonthCode(t,e){return this.inLeapYear({year:t})?e===6?ln(5,!0):ln(e<6?e:e-1):ln(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:u,monthExtra:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(l){let h=this.months[l];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${l}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:u,monthCode:s}}if(this.validateCalendarDate(t),a===void 0)if(s.endsWith("L")){if(s!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);if(a=6,!this.inLeapYear({year:o})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${o} which is not a leap year`);a=6,s="M06"}}else{a=rr(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(Ve(a,1,this.monthsInYear({year:o})),Ve(u,1,this.maximumMonthLength({year:o,month:a}))):(a=vt(a,1,this.monthsInYear({year:o})),u=vt(u,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:u,month:a,monthCode:s,year:o}}},$n=class extends kn{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(t,e){let r={year:t.year,month:1,monthCode:"M01",day:1},i={year:t.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,e)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:Math.floor(e*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},Qa=class extends $n{constructor(){super(...arguments),this.id="islamic"}},es=class extends $n{constructor(){super(...arguments),this.id="islamic-umalqura"}},ts=class extends $n{constructor(){super(...arguments),this.id="islamic-tbla"}},ns=class extends $n{constructor(){super(...arguments),this.id="islamic-civil"}},rs=class extends $n{constructor(){super(...arguments),this.id="islamic-rgsa"}},is=class extends $n{constructor(){super(...arguments),this.id="islamicc"}},os=class extends kn{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(t,e){return this.daysInMonth({year:t.year,month:12,day:1},e)===30}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===12?29:e<=6?31:30}maximumMonthLength(t){let{month:e}=t;return e===12?30:e<=6?31:30}maxLengthOfMonthCodeInAnyYear(t){return rr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},as=class extends kn{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(t){return Is(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=rr(t),r=this.months[e];return r=r.leap??r,r.length}getMonthInfo(t){let{month:e}=t,r=this.months[e];if(r===void 0)throw new RangeError(`Invalid month: ${e}`);return this.inLeapYear(t)&&r.leap&&(r=r.leap),r}estimateIsoDate(t){let e=this.adjustCalendarDate(t),r=this.getMonthInfo(e);return It(e.year+78+(r.nextYear?1:0),r.month,r.day+e.day-1)}checkIcuBugs(t){if(this.vulnerableToBceBug&&t.year<1)throw new 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 Is(n){return n%4==0&&(n%100!=0||n%400==0)}var _o=class extends kn{constructor(t,e){super(),this.calendarType="solar",this.id=t,this.isoEpoch=e}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Is(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return li(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Mo=class extends kn{constructor(t,e){super(),this.hasEra=!0,this.calendarType="solar",this.id=t;let{eras:r,anchorEra:i}=function(o){let a,s=o;if(s.length===0)throw new RangeError("Invalid era data: eras are required");if(s.length===1&&s[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(s.length===1&&!s[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(s.filter(l=>l.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(l=>{if(l.isAnchor||!l.anchorEpoch&&!l.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=l,l.anchorEpoch={year:l.hasYearZero?0:1}}else if(!l.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(l=>l.code),s.forEach(l=>{let{reverseOf:h}=l;if(h){let f=s.find(g=>g.code===h);if(f===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);l.reverseOf=f,l.anchorEpoch=f.anchorEpoch,l.isoEpoch=f.isoEpoch}l.anchorEpoch.month===void 0&&(l.anchorEpoch.month=1),l.anchorEpoch.day===void 0&&(l.anchorEpoch.day=1)}),s.sort((l,h)=>{if(l.reverseOf)return 1;if(h.reverseOf)return-1;if(!l.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-l.isoEpoch.year});let u=s[s.length-1].reverseOf;if(u&&u!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((l,h)=>{l.genericName="era"+(s.length-1-h)}),{eras:s,anchorEra:a||s[0]}}(e);this.anchorEra=i,this.eras=r}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Is(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}completeEraYear(t){let e=(s,u,l)=>{let h=t[s];if(h!=null&&h!=u&&!(l||[]).includes(h)){let f=l?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${f?`${u} (also called ${f})`:u}`)}},r=s=>{let u,l={...t,year:s},h=this.eras.find((f,g)=>{if(g===this.eras.length-1){if(f.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${f.code}`);return u=f.anchorEpoch.year-s,!0}return u=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0}return this.compareCalendarDates(l,f.anchorEpoch)>=0&&(u=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:u,era:h.code,eraNames:h.names}},{year:i,eraYear:o,era:a}=t;if(i!=null){let s=r(i);({eraYear:o,era:a}=s),e("era",a,s?.eraNames),e("eraYear",o)}else{if(o==null)throw new RangeError("Either year or eraYear and era are required");{if(a===void 0)throw new RangeError("era and eraYear must be provided together");let s=this.eras.find(({code:u,names:l=[]})=>u===a||l.includes(a));if(!s)throw new RangeError(`Era ${a} (ISO year ${o}) was not matched by any era`);i=s.reverseOf?s.anchorEpoch.year-o:o+s.anchorEpoch.year-(s.hasYearZero?0:1),e("year",i),{eraYear:o,era:a}=r(i)}}return{...t,year:i,eraYear:o,era:a}}adjustCalendarDate(t,e,r="constrain"){let i=t,{month:o,monthCode:a}=i;return o===void 0&&(i={...i,month:rr(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return li(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},bi=class extends Mo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=ln(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},sn={inLeapYear(n){let{year:t}=n;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(n){let{month:t}=n;return t===13?this.inLeapYear(n)?6:5:30},maximumMonthLength(n){return this.minimumMonthLength(n)},maxLengthOfMonthCodeInAnyYear:n=>n==="M13"?6:30},ss=class extends _o{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},So=class extends Mo{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},cs=class extends ss{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},ls=class extends So{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},us=class extends So{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}}])}},ds=class extends bi{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},hs=class extends _o{constructor(){super("buddhist",{year:-543,month:1,day:1})}},ms=class extends bi{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(t){let{era:e,eraYear:r}=t;return e==="b"&&(e="gregory-inverse"),e==="a"&&(e="gregory"),{era:e,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},fs=class extends bi{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(t,e){let{era:r,eraYear:i}=t,{year:o}=e;return this.eras.find(a=>a.code===r)?{era:r,eraYear:i}:o<1?{era:"japanese-inverse",eraYear:1-o}:{era:"japanese",eraYear:o}}},ko=class extends kn{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(t,e){let r=this.getMonthList(t.year,e);return Object.entries(r).length===13}monthsInYear(t,e){return this.inLeapYear(t,e)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(t){return["M01L","M09L","M10L","M11L","M12L"].includes(t)?29:30}monthDaySearchStartYear(t,e){let r={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]}[t]??[1972,1972];return e<30?r[0]:r[1]}getMonthList(t,e){if(t===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:t,id:this.id}),i=e.get(r);if(i)return i;let o=this.getFormatter(),a=(A,B)=>{let V=eu({isoYear:A,isoMonth:2,isoDay:1}),G=new Date(V);G.setUTCDate(B+1);let U=o.formatToParts(G),J=U.find(ie=>ie.type==="month").value,oe=+U.find(ie=>ie.type==="day").value,ke=U.find(ie=>ie.type==="relatedYear"),Me;if(ke===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Me=+ke.value,{calendarMonthString:J,calendarDay:oe,calendarYearToVerify:Me}},s=17,{calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s);u!=="1"&&(s+=29,{calendarMonthString:u,calendarDay:l}=a(t,s)),s-=l-5;let f={},g,E,S=1,k=!1;do({calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s)),g&&(f[E].daysInMonth=g+30-l),h!==t?k=!0:(f[u]={monthIndex:S++},s+=30),g=l,E=u;while(!k);return f[E].daysInMonth=g+30-l,e.set(r,f),f}estimateIsoDate(t){let{year:e,month:r}=t;return{year:e,month:r>=12?12:r+1,day:1}}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthExtra:s,day:u,monthCode:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(s&&s!=="bis")throw new RangeError(`Unexpected leap month suffix: ${s}`);let h=ln(a,s!==void 0),f=`${a}${s||""}`,g=this.getMonthList(o,e)[f];if(g===void 0)throw new RangeError(`Unmatched month ${f} in Chinese year ${o}`);return a=g.monthIndex,{year:o,month:a,day:u,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),f=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let g=h[f];if(a=g&&g.monthIndex,a===void 0&&l.endsWith("L")&&l!="M13L"&&r==="constrain"){let E=+l.replace(/^M0?|L$/g,"");g=h[E],g&&(a=g.monthIndex,l=ln(E))}if(a===void 0)throw new RangeError(`Unmatched month ${l} in Chinese year ${o}`)}else if(l===void 0){let h=this.getMonthList(o,e),f=Object.entries(h),g=f.length;r==="reject"?(Ve(a,1,g),Ve(u,1,this.maximumMonthLength())):(a=vt(a,1,g),u=vt(u,1,this.maximumMonthLength()));let E=f.find(S=>S[1].monthIndex===a);if(E===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);l=ln(+E[0].replace("bis",""),E[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),f=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let g=h[f];if(!g)throw new RangeError(`Unmatched monthCode ${l} in Chinese year ${o}`);if(a!==g.monthIndex)throw new RangeError(`monthCode ${l} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:l,day:u}}},ps=class extends ko{constructor(){super(...arguments),this.id="chinese"}},gs=class extends ko{constructor(){super(...arguments),this.id="dangi"}},ys=class{constructor(t){this.helper=t}extraFields(t){return this.helper.hasEra&&t.includes("year")?["era","eraYear"]:[]}resolveFields(t){if(this.helper.calendarType!=="lunisolar"){let e=new Ft;Cs(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Ft,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Ft,i=this.helper.monthDayFromFields(t,e,r);return r.setObject(i),i}fieldKeysToIgnore(t){let e=new Set;for(let r=0;r<t.length;r++){let i=t[r];switch(e.add(i),i){case"era":e.add("eraYear"),e.add("year");break;case"eraYear":e.add("era"),e.add("year");break;case"year":e.add("era"),e.add("eraYear");break;case"month":e.add("monthCode"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"monthCode":e.add("month"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"day":this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"))}}return Xl(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Ft.getCacheForObject(t),u=this.helper.isoToCalendarDate(t,s),l=this.helper.addCalendar(u,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(l,"constrain",s);return Ft.getCacheForObject(h)||new Ft(s).setObject(h),h}dateUntil(t,e,r){let i=Ft.getCacheForObject(t),o=Ft.getCacheForObject(e),a=this.helper.isoToCalendarDate(t,i),s=this.helper.isoToCalendarDate(e,o);return this.helper.untilCalendar(a,s,r,i)}isoToDate(t,e){let r=Ft.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=ji.iso8601.isoToDate(t,{dayOfWeek:!0}).dayOfWeek),e.dayOfYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.calendarDaysUntil(o,i,r);i.dayOfYear=a+1}if(e.weekOfYear&&(i.weekOfYear=Ql(this.helper.id,t)),i.daysInWeek=7,e.daysInMonth&&(i.daysInMonth=this.helper.daysInMonth(i,r)),e.daysInYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.addCalendar(o,{years:1},"constrain",r);i.daysInYear=this.helper.calendarDaysUntil(o,a,r)}return e.monthsInYear&&(i.monthsInYear=this.helper.monthsInYear(i,r)),e.inLeapYear&&(i.inLeapYear=this.helper.inLeapYear(i,r)),i}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let n of[Xa,os,us,cs,ls,ps,gs,ds,as,hs,ms,fs,Qa,es,ts,ns,rs,is]){let t=new n;ji[t.id]=new ys(t)}Fa("calendarImpl",function(n){return ji[n]});var Di=Intl.DateTimeFormat;function fr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Di(m(n,pl),e(m(n,Aa))),function(r,i,o){let a=Co(r);if(a===void 0)throw new TypeError("Missing slots for the given container");if(a[i]===void 0)throw new TypeError(`tried to reset ${i} which was not set`);a[i]=o}(n,t,e)),e}function Jr(n){return Et(n,or)}var ir=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let f=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(E){if(E==null)throw new TypeError(`Expected object not ${E}`);return Object(E)}(o);let g=Object.create(null);for(let E=0;E<f.length;E++){let S=f[E];Object.prototype.hasOwnProperty.call(s,S)&&(g[S]=s[S])}s=g}else s=Object.create(null);let u=new Di(i,s),l=u.resolvedOptions();if(Tn(r),a){let f=Object.assign(Object.create(null),l);for(let g in f)Object.prototype.hasOwnProperty.call(s,g)||delete f[g];f.hour12=s.hour12,f.hourCycle=s.hourCycle,me(r,Aa,f)}else me(r,Aa,s);me(r,pl,l.locale),me(r,or,u),me(r,yr,l.timeZone),me(r,Qr,l.calendar),me(r,ll,gh),me(r,ul,fh),me(r,dl,ph),me(r,hl,mh),me(r,ml,yh),me(r,fl,vh);let h=a?s.timeZone:void 0;if(h===void 0)me(r,Ra,l.timeZone);else{let f=Ro(h);if(f.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");me(r,Ra,bt(f))}})(this,t,e)}get format(){x(this,Jr);let t=lh.bind(this);return Object.defineProperties(t,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:"",enumerable:!1,writable:!1,configurable:!0}}),t}formatRange(t,e){return x(this,Jr),dh.call(this,t,e)}formatToParts(t,...e){return x(this,Jr),uh.call(this,t,...e)}formatRangeToParts(t,e){return x(this,Jr),hh.call(this,t,e)}resolvedOptions(){return x(this,Jr),ch.call(this)}};"formatToParts"in Di.prototype||delete ir.prototype.formatToParts,"formatRangeToParts"in Di.prototype||delete ir.prototype.formatRangeToParts;var $t=function(n=void 0,t=void 0){return new ir(n,t)};function ch(){let n=m(this,or).resolvedOptions();return n.timeZone=m(this,Ra),n}function lh(n,...t){let e,r,i=Ir(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.format(...r)}function uh(n,...t){let e,r,i=Ir(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.formatToParts(...r)}function dh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(Mn(e)){if(!tu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=Ir(e,this),{epochNs:u,formatter:l}=Ir(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRange(...o)}function hh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(Mn(e)){if(!tu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=Ir(e,this),{epochNs:u,formatter:l}=Ir(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRangeToParts(...o)}function zi(n={},t={}){let e=Object.assign({},n),r=["year","month","day","hour","minute","second","weekday","dayPeriod","timeZoneName","dateStyle","timeStyle"];for(let i=0;i<r.length;i++){let o=r[i];e[o]=o in t?t[o]:e[o],e[o]!==!1&&e[o]!==void 0||delete e[o]}return e}function mh(n){let t=zi(n,{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"})),!Bo(t)){if(Ui(n))throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(n)}]`);Object.assign(t,{hour:"numeric",minute:"numeric",second:"numeric"})}return t}function fh(n){let t={short:{year:"2-digit",month:"numeric"},medium:{year:"numeric",month:"short"},long:{year:"numeric",month:"long"},full:{year:"numeric",month:"long"}},e=zi(n,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("year"in e||"month"in e||"era"in e)){if(Ui(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function ph(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=zi(n,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("month"in e)&&!("day"in e)){if(Ui(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function gh(n){let t=zi(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function yh(n){let t=zi(n,{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),!Bo(t)&&!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}return t}function vh(n){let t=n;return Bo(t)||$o(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function $o(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function Bo(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function Ui(n){return $o(n)||Bo(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function Mn(n){return Fe(n)||$e(n)||xe(n)||fe(n)||Je(n)||Ht(n)||Ze(n)}function To(n){return Mn(n)?n:Po(n)}function tu(n,t){return!(!Mn(n)||!Mn(t)||$e(n)&&!$e(t)||Fe(n)&&!Fe(t)||xe(n)&&!xe(t)||fe(n)&&!fe(t)||Je(n)&&!Je(t)||Ht(n)&&!Ht(t)||Ze(n)&&!Ze(t))}function Ir(n,t){if($e(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,He)};return{epochNs:rt(m(t,yr),e,"compatible"),formatter:fr(t,hl)}}if(Je(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:rt(m(t,yr),i,"compatible"),formatter:fr(t,ul)}}if(Ht(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:rt(m(t,yr),i,"compatible"),formatter:fr(t,dl)}}if(Fe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:rt(m(t,yr),i,"compatible"),formatter:fr(t,ll)}}if(xe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Ae);return{epochNs:rt(m(t,yr),i,"compatible"),formatter:fr(t,ml)}}if(fe(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return Ze(n)?{epochNs:m(n,se),formatter:fr(t,fl)}:{}}function nu(n){let t=Object.create(null);return t.years=m(n,ut),t.months=m(n,dt),t.weeks=m(n,St),t.days=m(n,ht),t.hours=m(n,mt),t.minutes=m(n,ft),t.seconds=m(n,pt),t.milliseconds=m(n,gt),t.microseconds=m(n,yt),t.nanoseconds=m(n,kt),t}ir.prototype.constructor=$t,Object.defineProperty($t,"prototype",{value:ir.prototype,writable:!1,enumerable:!1,configurable:!1}),$t.supportedLocalesOf=Di.supportedLocalesOf,Cn($t,"Intl.DateTimeFormat");var{format:wh,formatToParts:bh}=Intl.DurationFormat?.prototype??Object.create(null);function xs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=nu(Kt(n));return wh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=xs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=nu(Kt(n));return bh.call(this,t)});var vm=Object.freeze({__proto__:null,DateTimeFormat:$t,ModifiedIntlDurationFormatPrototypeFormat:xs}),Ei=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");Ll(this,Eo(t))}get epochMilliseconds(){return x(this,Ze),Zt(m(this,se),"floor")}get epochNanoseconds(){return x(this,Ze),Zl(T.default.BigInt(m(this,se)))}add(t){return x(this,Ze),Zc("add",this,t)}subtract(t){return x(this,Ze),Zc("subtract",this,t)}until(t,e=void 0){return x(this,Ze),zc("until",this,t,e)}since(t,e=void 0){return x(this,Ze),zc("since",this,t,e)}round(t){if(x(this,Ze),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Pr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn);return Rr(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),Xt(Wa(m(this,se),r,o,i))}equals(t){x(this,Ze);let e=ni(t),r=m(this,se),i=m(e,se);return T.default.equal(T.default.BigInt(r),T.default.BigInt(i))}toString(t=void 0){x(this,Ze);let e=te(t),r=Li(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let a=e.timeZone;a!==void 0&&(a=bt(a));let{precision:s,unit:u,increment:l}=Ni(o,r);return Lc(Xt(Wa(m(this,se),l,u,i)),a,s)}toJSON(){return x(this,Ze),Lc(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return x(this,Ze),new $t(t,e).format(this)}valueOf(){jn("Instant")}toZonedDateTimeISO(t){x(this,Ze);let e=bt(t);return tt(m(this,se),e,"iso8601")}static fromEpochMilliseconds(t){return Xt(Qt(Po(t)))}static fromEpochNanoseconds(t){return Xt(Eo(t))}static from(t){return ni(t)}static compare(t,e){let r=ni(t),i=ni(e),o=m(r,se),a=m(i,se);return T.default.lessThan(o,a)?-1:T.default.greaterThan(o,a)?1:0}};Cn(Ei,"Temporal.Instant");var _i=class{constructor(t,e,r,i="iso8601"){let o=ue(t),a=ue(e),s=ue(r),u=_t(i===void 0?"iso8601":Ue(i));Qn(o,a,s),Il(this,{year:o,month:a,day:s},u)}get calendarId(){return x(this,Fe),m(this,$)}get era(){return st(this,"era")}get eraYear(){return st(this,"eraYear")}get year(){return st(this,"year")}get month(){return st(this,"month")}get monthCode(){return st(this,"monthCode")}get day(){return st(this,"day")}get dayOfWeek(){return st(this,"dayOfWeek")}get dayOfYear(){return st(this,"dayOfYear")}get weekOfYear(){return st(this,"weekOfYear")?.week}get yearOfWeek(){return st(this,"weekOfYear")?.year}get daysInWeek(){return st(this,"daysInWeek")}get daysInMonth(){return st(this,"daysInMonth")}get daysInYear(){return st(this,"daysInYear")}get monthsInYear(){return st(this,"monthsInYear")}get inLeapYear(){return st(this,"inLeapYear")}with(t,e=void 0){if(x(this,Fe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Dt(r,m(this,ce));return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),wt(Yn(r,i,ve(te(e))),r)}withCalendar(t){x(this,Fe);let e=Yi(t);return wt(m(this,ce),e)}add(t,e=void 0){return x(this,Fe),Jc("add",this,t,e)}subtract(t,e=void 0){return x(this,Fe),Jc("subtract",this,t,e)}until(t,e=void 0){return x(this,Fe),Uc("until",this,t,e)}since(t,e=void 0){return x(this,Fe),Uc("since",this,t,e)}equals(t){x(this,Fe);let e=ei(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Fe),Nc(this,Ai(te(t)))}toJSON(){return x(this,Fe),Nc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Fe),new $t(t,e).format(this)}valueOf(){jn("PlainDate")}toPlainDateTime(t=void 0){x(this,Fe);let e=Cl(t);return qt(De(m(this,ce),e),m(this,$))}toZonedDateTime(t){let e,r;if(x(this,Fe),Ye(t)){let a=t.timeZone;a===void 0?e=bt(t):(e=bt(a),r=t.plainTime)}else e=bt(t);let i=m(this,ce),o;return r===void 0?o=Rn(e,i):(r=Ln(r),o=rt(e,De(i,m(r,He)),"compatible")),tt(o,e,m(this,$))}toPlainYearMonth(){x(this,Fe);let t=m(this,$);return Dr(pi(t,Dt(t,m(this,ce)),"constrain"),t)}toPlainMonthDay(){x(this,Fe);let t=m(this,$);return br(yo(t,Dt(t,m(this,ce)),"constrain"),t)}static from(t,e=void 0){return ei(t,e)}static compare(t,e){let r=ei(t),i=ei(e);return hn(m(r,ce),m(i,ce))}};function st(n,t){x(n,Fe);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(_i,"Temporal.PlainDate");var Mi=class{constructor(t,e,r,i=0,o=0,a=0,s=0,u=0,l=0,h="iso8601"){let f=ue(t),g=ue(e),E=ue(r),S=i===void 0?0:ue(i),k=o===void 0?0:ue(o),A=a===void 0?0:ue(a),B=s===void 0?0:ue(s),V=u===void 0?0:ue(u),G=l===void 0?0:ue(l),U=_t(h===void 0?"iso8601":Ue(h));Ms(f,g,E,S,k,A,B,V,G),xl(this,{isoDate:{year:f,month:g,day:E},time:{hour:S,minute:k,second:A,millisecond:B,microsecond:V,nanosecond:G}},U)}get calendarId(){return x(this,xe),m(this,$)}get year(){return ct(this,"year")}get month(){return ct(this,"month")}get monthCode(){return ct(this,"monthCode")}get day(){return ct(this,"day")}get hour(){return pr(this,"hour")}get minute(){return pr(this,"minute")}get second(){return pr(this,"second")}get millisecond(){return pr(this,"millisecond")}get microsecond(){return pr(this,"microsecond")}get nanosecond(){return pr(this,"nanosecond")}get era(){return ct(this,"era")}get eraYear(){return ct(this,"eraYear")}get dayOfWeek(){return ct(this,"dayOfWeek")}get dayOfYear(){return ct(this,"dayOfYear")}get weekOfYear(){return ct(this,"weekOfYear")?.week}get yearOfWeek(){return ct(this,"weekOfYear")?.year}get daysInWeek(){return ct(this,"daysInWeek")}get daysInYear(){return ct(this,"daysInYear")}get daysInMonth(){return ct(this,"daysInMonth")}get monthsInYear(){return ct(this,"monthsInYear")}get inLeapYear(){return ct(this,"inLeapYear")}with(t,e=void 0){if(x(this,xe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=m(this,Ae),o={...Dt(r,i.isoDate),...i.time};return o=Xn(r,o,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),qt(Fi(r,o,ve(te(e))),r)}withPlainTime(t=void 0){x(this,xe);let e=Cl(t);return qt(De(m(this,Ae).isoDate,e),m(this,$))}withCalendar(t){x(this,xe);let e=Yi(t);return qt(m(this,Ae),e)}add(t,e=void 0){return x(this,xe),Xc("add",this,t,e)}subtract(t,e=void 0){return x(this,xe),Xc("subtract",this,t,e)}until(t,e=void 0){return x(this,xe),Vc("until",this,t,e)}since(t,e=void 0){return x(this,xe),Vc("since",this,t,e)}round(t){if(x(this,xe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Pr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Rr(r,a,a===1);let s=m(this,Ae);return qt(r===1&&o==="nanosecond"?s:Ka(s,r,o,i),m(this,$))}equals(t){x(this,xe);let e=ti(t);return Cr(m(this,Ae),m(e,Ae))===0&&un(m(this,$),m(e,$))}toString(t=void 0){x(this,xe);let e=te(t),r=Ai(e),i=Li(e),o=en(e,"trunc"),a=Ct(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:u,increment:l}=Ni(a,i),h=Ka(m(this,Ae),l,u,o);return er(h),yi(h,m(this,$),s,r)}toJSON(){return x(this,xe),yi(m(this,Ae),m(this,$),"auto")}toLocaleString(t=void 0,e=void 0){return x(this,xe),new $t(t,e).format(this)}valueOf(){jn("PlainDateTime")}toZonedDateTime(t,e=void 0){x(this,xe);let r=bt(t),i=ui(te(e));return tt(rt(r,m(this,Ae),i),r,m(this,$))}toPlainDate(){return x(this,xe),wt(m(this,Ae).isoDate,m(this,$))}toPlainTime(){return x(this,xe),wn(m(this,Ae).time)}static from(t,e=void 0){return ti(t,e)}static compare(t,e){let r=ti(t),i=ti(e);return Cr(m(r,Ae),m(i,Ae))}};function ct(n,t){x(n,xe);let e=m(n,Ae).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function pr(n,t){return x(n,xe),m(n,Ae).time[t]}Cn(Mi,"Temporal.PlainDateTime");var Si=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,h=0){let f=t===void 0?0:Jt(t),g=e===void 0?0:Jt(e),E=r===void 0?0:Jt(r),S=i===void 0?0:Jt(i),k=o===void 0?0:Jt(o),A=a===void 0?0:Jt(a),B=s===void 0?0:Jt(s),V=u===void 0?0:Jt(u),G=l===void 0?0:Jt(l),U=h===void 0?0:Jt(h);Ho(f,g,E,S,k,A,B,V,G,U),Tn(this),me(this,ut,f),me(this,dt,g),me(this,St,E),me(this,ht,S),me(this,mt,k),me(this,ft,A),me(this,pt,B),me(this,gt,V),me(this,yt,G),me(this,kt,U)}get years(){return x(this,Oe),m(this,ut)}get months(){return x(this,Oe),m(this,dt)}get weeks(){return x(this,Oe),m(this,St)}get days(){return x(this,Oe),m(this,ht)}get hours(){return x(this,Oe),m(this,mt)}get minutes(){return x(this,Oe),m(this,ft)}get seconds(){return x(this,Oe),m(this,pt)}get milliseconds(){return x(this,Oe),m(this,gt)}get microseconds(){return x(this,Oe),m(this,yt)}get nanoseconds(){return x(this,Oe),m(this,kt)}get sign(){return x(this,Oe),bo(this)}get blank(){return x(this,Oe),bo(this)===0}with(t){x(this,Oe);let e=Tl(t),{years:r=m(this,ut),months:i=m(this,dt),weeks:o=m(this,St),days:a=m(this,ht),hours:s=m(this,mt),minutes:u=m(this,ft),seconds:l=m(this,pt),milliseconds:h=m(this,gt),microseconds:f=m(this,yt),nanoseconds:g=m(this,kt)}=e;return new n(r,i,o,a,s,u,l,h,f,g)}negated(){return x(this,Oe),xt(this)}abs(){return x(this,Oe),new n(Math.abs(m(this,ut)),Math.abs(m(this,dt)),Math.abs(m(this,St)),Math.abs(m(this,ht)),Math.abs(m(this,mt)),Math.abs(m(this,ft)),Math.abs(m(this,pt)),Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,kt)))}add(t){return x(this,Oe),Gc("add",this,t)}subtract(t){return x(this,Oe),Gc("subtract",this,t)}round(t){if(x(this,Oe),t===void 0)throw new TypeError("options parameter is required");let e=yn(this),r=typeof t=="string"?nr("smallestUnit",t):te(t),i=Ct(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ia(r),s=Pr(r),u=en(r,"halfExpand"),l=Ct(r,"smallestUnit","datetime",void 0),h=!0;l||(h=!1,l="nanosecond");let f=Dn(e,l),g=!0;if(i||(g=!1,i=f),i==="auto"&&(i=f),!h&&!g)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(Dn(i,l)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${l}`);let E={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[l];if(E!==void 0&&Rr(s,E,!1),s>1&&vn(l)==="date"&&i!==l)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let k=vr(this),A=m(a,_e),B=m(a,$),V=m(a,se);return k=Gl(V,oi(V,A,B,k),A,B,i,s,l,u),vn(i)==="date"&&(i="hour"),Wt(k,i)}if(o){let k=cn(this),A=Tr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},k.time),B=m(o,ce),V=m(o,$),G=Bt(V,B,nt(k.date,A.deltaDays),"constrain");return k=Kl(De(B,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(G,A),V,i,s,l,u),Wt(k,i)}if(an(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(an(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let S=cn(this);if(l==="day"){let{quotient:k,remainder:A}=S.time.divmod(fo),B=S.date.days+k+di(A,"day");B=Nn(B,s,u),S=En({years:0,months:0,weeks:0,days:B},Se.ZERO)}else S=En({years:0,months:0,weeks:0,days:0},Do(S.time,s,l,u));return Wt(S,i)}total(t){if(x(this,Oe),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?nr("unit",t):te(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ia(e),o=Ct(e,"unit","datetime",Sn);if(i){let s=vr(this),u=m(i,_e),l=m(i,$),h=m(i,se);return function(f,g,E,S,k){return vn(k)==="time"?di(Se.fromEpochNsDiff(g,f),k):jc(ql(f,g,E,S,k),g,Gt(E,f),E,S,k)}(h,oi(h,u,l,s),u,l,o)}if(r){let s=cn(this),u=Tr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),l=m(r,ce),h=m(r,$),f=Bt(h,l,nt(s.date,u.deltaDays),"constrain");return function(g,E,S,k){if(Cr(g,E)==0)return 0;er(g),er(E);let A=Vl(g,E,S,k);return k==="nanosecond"?T.default.toNumber(A.time.totalNs):jc(A,Xe(E),g,null,S,k)}(De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(f,u),h,o)}let a=yn(this);if(an(a))throw new RangeError(`a starting point is required for ${a}s total`);if(an(o))throw new RangeError(`a starting point is required for ${o}s total`);return di(cn(this).time,o)}toString(t=void 0){x(this,Oe);let e=te(t),r=Li(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour"||o==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:a,unit:s,increment:u}=Ni(o,r);if(s==="nanosecond"&&u===1)return lo(this,a);let l=yn(this),h=vr(this),f=Do(h.time,u,s,i);return h=En(h.date,f),lo(Wt(h,Dn(l,"second")),a)}toJSON(){return x(this,Oe),lo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(x(this,Oe),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return xs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),lo(this,"auto")}valueOf(){jn("Duration")}static from(t){return Kt(t)}static compare(t,e,r=void 0){let i=Kt(t),o=Kt(e),a=te(r),{plainRelativeTo:s,zonedRelativeTo:u}=Ia(a);if(m(i,ut)===m(o,ut)&&m(i,dt)===m(o,dt)&&m(i,St)===m(o,St)&&m(i,ht)===m(o,ht)&&m(i,mt)===m(o,mt)&&m(i,ft)===m(o,ft)&&m(i,pt)===m(o,pt)&&m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,kt)===m(o,kt))return 0;let l=yn(i),h=yn(o),f=vr(i),g=vr(o);if(u&&(vn(l)==="date"||vn(h)==="date")){let B=m(u,_e),V=m(u,$),G=m(u,se),U=oi(G,B,V,f),J=oi(G,B,V,g);return Tt(T.default.toNumber(T.default.subtract(U,J)))}let E=f.date.days,S=g.date.days;if(an(l)||an(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");E=Bc(f.date,s),S=Bc(g.date,s)}let k=f.time.add24HourDays(E),A=g.time.add24HourDays(S);return k.cmp(A)}};Cn(Si,"Temporal.Duration");var ki=class{constructor(t,e,r="iso8601",i=1972){let o=ue(t),a=ue(e),s=_t(r===void 0?"iso8601":Ue(r)),u=ue(i);Qn(u,o,a),Pl(this,{year:u,month:o,day:a},s)}get monthCode(){return rl(this,"monthCode")}get day(){return rl(this,"day")}get calendarId(){return x(this,Ht),m(this,$)}with(t,e=void 0){if(x(this,Ht),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Dt(r,m(this,ce),"month-day");return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),br(yo(r,i,ve(te(e))),r)}equals(t){x(this,Ht);let e=Rc(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Ht),Fc(this,Ai(te(t)))}toJSON(){return x(this,Ht),Fc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Ht),new $t(t,e).format(this)}valueOf(){jn("PlainMonthDay")}toPlainDate(t){if(x(this,Ht),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Dt(e,m(this,ce),"month-day"),zt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return Rc(t,e)}};function rl(n,t){x(n,Ht);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}function Pa(n){return Gt(n,Ja())}Cn(ki,"Temporal.PlainMonthDay");var ru={instant:()=>Xt(Ja()),plainDateTimeISO:(n=Zr())=>qt(Pa(bt(n)),"iso8601"),plainDateISO:(n=Zr())=>wt(Pa(bt(n)).isoDate,"iso8601"),plainTimeISO:(n=Zr())=>wn(Pa(bt(n)).time),timeZoneId:()=>Zr(),zonedDateTimeISO:(n=Zr())=>{let t=bt(n);return tt(Ja(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(ru,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Ti=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:ue(t),u=e===void 0?0:ue(e),l=r===void 0?0:ue(r),h=i===void 0?0:ue(i),f=o===void 0?0:ue(o),g=a===void 0?0:ue(a);Fo(s,u,l,h,f,g),Rl(this,{hour:s,minute:u,second:l,millisecond:h,microsecond:f,nanosecond:g})}get hour(){return x(this,$e),m(this,He).hour}get minute(){return x(this,$e),m(this,He).minute}get second(){return x(this,$e),m(this,He).second}get millisecond(){return x(this,$e),m(this,He).millisecond}get microsecond(){return x(this,$e),m(this,He).microsecond}get nanosecond(){return x(this,$e),m(this,He).nanosecond}with(t,e=void 0){if(x(this,$e),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=Ba(t,"partial"),i=Ba(this),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Object.assign(i,r),f=ve(te(e));return{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Lo(o,a,s,u,l,h,f),new n(o,a,s,u,l,h)}add(t){return x(this,$e),Qc("add",this,t)}subtract(t){return x(this,$e),Qc("subtract",this,t)}until(t,e=void 0){return x(this,$e),qc("until",this,t,e)}since(t,e=void 0){return x(this,$e),qc("since",this,t,e)}round(t){if(x(this,$e),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Pr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn);return Rr(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),wn(Ga(m(this,He),r,o,i))}equals(t){x(this,$e);let e=Ln(t);return Za(m(this,He),m(e,He))===0}toString(t=void 0){x(this,$e);let e=te(t),r=Li(e),i=en(e,"trunc"),o=Ct(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:a,unit:s,increment:u}=Ni(o,r);return Oc(Ga(m(this,He),u,s,i),a)}toJSON(){return x(this,$e),Oc(m(this,He),"auto")}toLocaleString(t=void 0,e=void 0){return x(this,$e),new $t(t,e).format(this)}valueOf(){jn("PlainTime")}static from(t,e=void 0){return Ln(t,e)}static compare(t,e){let r=Ln(t),i=Ln(e);return Za(m(r,He),m(i,He))}};Cn(Ti,"Temporal.PlainTime");var Ci=class{constructor(t,e,r="iso8601",i=1){let o=ue(t),a=ue(e),s=_t(r===void 0?"iso8601":Ue(r)),u=ue(i);Qn(o,a,u),Al(this,{year:o,month:a,day:u},s)}get year(){return pn(this,"year")}get month(){return pn(this,"month")}get monthCode(){return pn(this,"monthCode")}get calendarId(){return x(this,Je),m(this,$)}get era(){return pn(this,"era")}get eraYear(){return pn(this,"eraYear")}get daysInMonth(){return pn(this,"daysInMonth")}get daysInYear(){return pn(this,"daysInYear")}get monthsInYear(){return pn(this,"monthsInYear")}get inLeapYear(){return pn(this,"inLeapYear")}with(t,e=void 0){if(x(this,Je),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Dt(r,m(this,ce),"year-month");return i=Xn(r,i,zt(r,t,["year","month","monthCode"],[],"partial")),Dr(pi(r,i,ve(te(e))),r)}add(t,e=void 0){return x(this,Je),el("add",this,t,e)}subtract(t,e=void 0){return x(this,Je),el("subtract",this,t,e)}until(t,e=void 0){return x(this,Je),Wc("until",this,t,e)}since(t,e=void 0){return x(this,Je),Wc("since",this,t,e)}equals(t){x(this,Je);let e=ri(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return x(this,Je),Hc(this,Ai(te(t)))}toJSON(){return x(this,Je),Hc(this)}toLocaleString(t=void 0,e=void 0){return x(this,Je),new $t(t,e).format(this)}valueOf(){jn("PlainYearMonth")}toPlainDate(t){if(x(this,Je),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Dt(e,m(this,ce),"year-month"),zt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return ri(t,e)}static compare(t,e){let r=ri(t),i=ri(e);return hn(m(r,ce),m(i,ce))}};function pn(n,t){x(n,Je);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(Ci,"Temporal.PlainYearMonth");var Dh=$t.prototype.resolvedOptions,Ii=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Eo(t),o=Ue(e),{tzName:a,offsetMinutes:s}=On(o);if(s===void 0){let u=vo(a);if(!u)throw new RangeError(`unknown time zone ${a}`);o=u.identifier}else o=Ds(s);Nl(this,i,o,_t(r===void 0?"iso8601":Ue(r)))}get calendarId(){return x(this,fe),m(this,$)}get timeZoneId(){return x(this,fe),m(this,_e)}get year(){return lt(this,"year")}get month(){return lt(this,"month")}get monthCode(){return lt(this,"monthCode")}get day(){return lt(this,"day")}get hour(){return gr(this,"hour")}get minute(){return gr(this,"minute")}get second(){return gr(this,"second")}get millisecond(){return gr(this,"millisecond")}get microsecond(){return gr(this,"microsecond")}get nanosecond(){return gr(this,"nanosecond")}get era(){return lt(this,"era")}get eraYear(){return lt(this,"eraYear")}get epochMilliseconds(){return x(this,fe),Zt(m(this,se),"floor")}get epochNanoseconds(){return x(this,fe),Zl(m(this,se))}get dayOfWeek(){return lt(this,"dayOfWeek")}get dayOfYear(){return lt(this,"dayOfYear")}get weekOfYear(){return lt(this,"weekOfYear")?.week}get yearOfWeek(){return lt(this,"weekOfYear")?.year}get hoursInDay(){x(this,fe);let t=m(this,_e),e=on(this).isoDate,r=It(e.year,e.month,e.day+1),i=Rn(t,e),o=Rn(t,r);return di(Se.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return lt(this,"daysInWeek")}get daysInMonth(){return lt(this,"daysInMonth")}get daysInYear(){return lt(this,"daysInYear")}get monthsInYear(){return lt(this,"monthsInYear")}get inLeapYear(){return lt(this,"inLeapYear")}get offset(){return x(this,fe),ja(bn(m(this,_e),m(this,se)))}get offsetNanoseconds(){return x(this,fe),bn(m(this,_e),m(this,se))}with(t,e=void 0){if(x(this,fe),!Ye(t))throw new TypeError("invalid zoned-date-time-like");xr(t);let r=m(this,$),i=m(this,_e),o=bn(i,m(this,se)),a=on(this),s={...Dt(r,a.isoDate),...a.time,offset:ja(o)};s=Xn(r,s,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let u=te(e),l=ui(u),h=uo(u,"prefer"),f=Fi(r,s,ve(u)),g=Ar(s.offset);return tt(go(f.isoDate,f.time,"option",g,i,l,h,!1),i,r)}withPlainTime(t=void 0){x(this,fe);let e=m(this,_e),r=m(this,$),i=on(this).isoDate,o;return o=t===void 0?Rn(e,i):rt(e,De(i,m(Ln(t),He)),"compatible"),tt(o,e,r)}withTimeZone(t){x(this,fe);let e=bt(t);return tt(m(this,se),e,m(this,$))}withCalendar(t){x(this,fe);let e=Yi(t);return tt(m(this,se),m(this,_e),e)}add(t,e=void 0){return x(this,fe),tl("add",this,t,e)}subtract(t,e=void 0){return x(this,fe),tl("subtract",this,t,e)}until(t,e=void 0){return x(this,fe),Kc("until",this,t,e)}since(t,e=void 0){return x(this,fe),Kc("since",this,t,e)}round(t){if(x(this,fe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Pr(e),i=en(e,"halfExpand"),o=Ct(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Rr(r,a,a===1),o==="nanosecond"&&r===1)return tt(m(this,se),m(this,_e),m(this,$));let s=m(this,_e),u=m(this,se),l=on(this),h;if(o==="day"){let f=l.isoDate,g=It(f.year,f.month,f.day+1),E=Rn(s,f),S=Rn(s,g),k=T.default.subtract(S,E);h=Se.fromEpochNsDiff(u,E).round(k,i).addToEpochNs(E)}else{let f=Ka(l,r,o,i),g=bn(s,u);h=go(f.isoDate,f.time,"option",g,s,"compatible","prefer",!1)}return tt(h,s,m(this,$))}equals(t){x(this,fe);let e=ii(t),r=m(this,se),i=m(e,se);return!!T.default.equal(T.default.BigInt(r),T.default.BigInt(i))&&!!Ol(m(this,_e),m(e,_e))&&un(m(this,$),m(e,$))}toString(t=void 0){x(this,fe);let e=te(t),r=Ai(e),i=Li(e),o=function(g){return _n(g,"offset",["auto","never"],"auto")}(e),a=en(e,"trunc"),s=Ct(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let u=function(g){return _n(g,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:l,unit:h,increment:f}=Ni(s,i);return Yc(this,l,r,u,o,{unit:h,increment:f,roundingMode:a})}toLocaleString(t=void 0,e=void 0){x(this,fe);let r=te(e),i=Object.create(null);if(function(u,l,h,f){if(l==null)return;let g=Reflect.ownKeys(l);for(let E=0;E<g.length;E++){let S=g[E];if(!h.some(k=>Object.is(k,S))&&Object.prototype.propertyIsEnumerable.call(l,S)){let k=l[S];u[S]=k}}}(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=m(this,_e),$c(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new $t(t,i),a=Dh.call(o).calendar,s=m(this,$);if(s!=="iso8601"&&a!=="iso8601"&&!un(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(Xt(m(this,se)))}toJSON(){return x(this,fe),Yc(this,"auto")}valueOf(){jn("ZonedDateTime")}startOfDay(){x(this,fe);let t=m(this,_e);return tt(Rn(t,on(this).isoDate),t,m(this,$))}getTimeZoneTransition(t){x(this,fe);let e=m(this,_e);if(t===void 0)throw new TypeError("options parameter is required");let r=_n(typeof t=="string"?nr("direction",t):te(t),"direction",["next","previous"],Sn);if(r===void 0)throw new TypeError("direction option is required");if($c(e)||e==="UTC")return null;let i=m(this,se),o=r==="next"?_s(e,i):Ua(e,i);return o===null?null:tt(o,e,m(this,$))}toInstant(){return x(this,fe),Xt(m(this,se))}toPlainDate(){return x(this,fe),wt(on(this).isoDate,m(this,$))}toPlainTime(){return x(this,fe),wn(on(this).time)}toPlainDateTime(){return x(this,fe),qt(on(this),m(this,$))}static from(t,e=void 0){return ii(t,e)}static compare(t,e){let r=ii(t),i=ii(e),o=m(r,se),a=m(i,se);return T.default.lessThan(T.default.BigInt(o),T.default.BigInt(a))?-1:T.default.greaterThan(T.default.BigInt(o),T.default.BigInt(a))?1:0}};function on(n){return Gt(m(n,_e),m(n,se))}function lt(n,t){x(n,fe);let e=on(n).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function gr(n,t){return x(n,fe),on(n).time[t]}Cn(Ii,"Temporal.ZonedDateTime");var Pe=Object.freeze({__proto__:null,Duration:Si,Instant:Ei,Now:ru,PlainDate:_i,PlainDateTime:Mi,PlainMonthDay:ki,PlainTime:Ti,PlainYearMonth:Ci,ZonedDateTime:Ii}),wm=class{toTemporalInstant(){return Xt(Qt(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Eh=[Ei,_i,Mi,Si,ki,Ti,Ci,Ii];for(let n of Eh){let t=Object.getOwnPropertyDescriptor(n,"prototype");(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(n,"prototype",t))}var _h="https://yuna-backend.cbocher.workers.dev/mews",Mh="https://api.mews.com/api/distributor/v1",Sh="Yuna",kh="mewscache",Th=!1,Ch=13,Ih=8,xh=Pe.Duration.from({minutes:20}).milliseconds,Ph=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),we={base_url:_h,bookingEngine_url:Mh,bookingEngineClient:Sh,bypassCache:Th,headers:Ph,cache_key:kh,ttl:xh,beCheckInUTC:Ch,beCheckOutUTC:Ih};var jo=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var Nr=class{constructor(){Y(this,"dbName","MewsAPICache");Y(this,"version",2);Y(this,"db",null);Y(this,"initPromise",null);Y(this,"performanceMetrics",[]);this.initPromise=this.init()}async init(){return new Promise((t,e)=>{try{let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.error("Failed to initialize IndexedDB:",r.error),e(r.error)},r.onsuccess=()=>{this.db=r.result,t()},r.onupgradeneeded=i=>{let o=i.target.result,{oldVersion:a}=i;if(a>0)try{o.objectStoreNames.contains("api_cache")&&o.deleteObjectStore("api_cache"),o.objectStoreNames.contains("performance_metrics")&&o.deleteObjectStore("performance_metrics")}catch(l){console.warn("Error cleaning up old stores:",l)}let s=o.createObjectStore("api_cache",{keyPath:"cacheKey"});s.createIndex("by-timestamp","timestamp"),s.createIndex("by-enterprise","enterpriseId"),s.createIndex("by-size","size"),o.createObjectStore("performance_metrics",{keyPath:"timestamp"}).createIndex("by-operation","operation")},r.onblocked=()=>{console.warn("IndexedDB upgrade blocked by another tab")}}catch(r){console.error("Failed to initialize IndexedDB:",r),e(r)}})}async ensureDB(){if(!this.db&&(await this.initPromise,!this.db))throw new Error("Failed to initialize IndexedDB");return this.db}calculateDataSize(t){try{return new Blob([JSON.stringify(t)]).size}catch{return 0}}recordPerformanceMetric(t,e,r,i){let o=performance.now()-e,a={operation:t,duration:o,timestamp:Date.now(),cacheHit:r,dataSize:i};this.performanceMetrics.push(a),this.performanceMetrics.length>1e3&&(this.performanceMetrics=this.performanceMetrics.slice(-1e3)),this.storeMetricAsync(a).catch(console.error)}async storeMetricAsync(t){try{let e=await this.ensureDB();return new Promise(r=>{let a=e.transaction("performance_metrics","readwrite").objectStore("performance_metrics").add(t);a.onerror=()=>r(),a.onsuccess=()=>r()})}catch{}}async get(t,e){let r=performance.now();try{let i=await this.ensureDB();return new Promise(o=>{let u=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);u.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},u.onsuccess=()=>{let l=u.result;if(!l){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:we.ttl,f=Pe.Instant.fromEpochMilliseconds(l.timestamp);if(Pe.Now.instant().since(f,{smallestUnit:"milliseconds"}).milliseconds>h){this.delete(t).catch(console.error),this.recordPerformanceMetric("cache-expired",r,!1),o(null);return}this.recordPerformanceMetric("cache-hit",r,!0,l.size),o(l.data)}})}catch(i){return console.error("Error getting cached data:",i),this.recordPerformanceMetric("cache-error",r,!1),null}}async set(t,e,r){let i=performance.now();try{let o=await this.ensureDB(),a=this.calculateDataSize(e),s={cacheKey:t,data:e,timestamp:Pe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((u,l)=>{let g=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);g.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),l(g.error)},g.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),u()}})}catch(o){if(console.error("Error setting cached data:",o),this.recordPerformanceMetric("cache-write-error",i,!1),o instanceof Error&&o.name==="QuotaExceededError"){await this.cleanupOldEntries();try{let a=await this.ensureDB(),s={cacheKey:t,data:e,timestamp:Pe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((u,l)=>{let g=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);g.onerror=()=>l(g.error),g.onsuccess=()=>u()})}catch(a){console.error("Error setting cached data after cleanup:",a)}}}}async delete(t){try{let i=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((o,a)=>{let s=i.delete(t);s.onsuccess=()=>o(),s.onerror=()=>a(s.error)})}catch(e){console.error("Error deleting cached data:",e)}}async clearExpired(){let t=performance.now(),e=0;try{let r=await this.ensureDB(),i=Pe.Now.instant().epochMilliseconds-we.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),u=await new Promise((h,f)=>{let g=s.getAll(IDBKeyRange.upperBound(i));g.onsuccess=()=>h(g.result),g.onerror=()=>f(g.error)}),l=50;for(let h=0;h<u.length;h+=l){let f=u.slice(h,h+l);await Promise.all(f.map(g=>new Promise((E,S)=>{let k=a.delete(g.cacheKey);k.onsuccess=()=>E(),k.onerror=()=>S(k.error)}))),e+=f.length,h+l<u.length&&await new Promise(g=>setTimeout(g,0))}await new Promise((h,f)=>{o.oncomplete=()=>h(),o.onerror=()=>f(o.error)}),this.recordPerformanceMetric("cache-cleanup",t,!1)}catch(r){console.error("Error clearing expired cache:",r)}return e}async cleanupOldEntries(t=1e3){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite"),i=r.objectStore("api_cache"),o=i.index("by-timestamp"),a=await new Promise((s,u)=>{let l=o.getAll();l.onsuccess=()=>s(l.result),l.onerror=()=>u(l.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(u=>new Promise((l,h)=>{let f=i.delete(u.cacheKey);f.onsuccess=()=>l(),f.onerror=()=>h(f.error)})))}await new Promise((s,u)=>{r.oncomplete=()=>s(),r.onerror=()=>u(r.error)})}catch(e){console.error("Error cleaning up old entries:",e)}}async clearAll(){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((i,o)=>{let a=r.clear();a.onsuccess=()=>i(),a.onerror=()=>o(a.error)})}catch(t){console.error("Error clearing all cache:",t)}}async getCacheStats(){try{let r=(await this.ensureDB()).transaction("api_cache","readonly").objectStore("api_cache"),i=await new Promise((a,s)=>{let u=r.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>s(u.error)}),o={totalEntries:i.length,totalSize:i.reduce((a,s)=>a+(s.size||0),0),oldestEntry:i.length>0?Math.min(...i.map(a=>a.timestamp)):null,newestEntry:i.length>0?Math.max(...i.map(a=>a.timestamp)):null,entriesByEnterprise:{}};return i.forEach(a=>{let s=a.enterpriseId||"unknown";o.entriesByEnterprise[s]=(o.entriesByEnterprise[s]||0)+1}),o}catch(t){return console.error("Error getting cache stats:",t),{totalEntries:0,totalSize:0,oldestEntry:null,newestEntry:null,entriesByEnterprise:{}}}}getPerformanceMetrics(){return[...this.performanceMetrics]}getAveragePerformance(){let t=this.performanceMetrics,e=t.filter(o=>o.operation==="cache-hit"),r=t.filter(o=>o.operation==="cache-miss"),i=t.filter(o=>o.operation==="cache-write");return{averageCacheHitTime:e.length>0?e.reduce((o,a)=>o+a.duration,0)/e.length:0,averageCacheMissTime:r.length>0?r.reduce((o,a)=>o+a.duration,0)/r.length:0,averageWriteTime:i.length>0?i.reduce((o,a)=>o+a.duration,0)/i.length:0,cacheHitRate:e.length+r.length>0?e.length/(e.length+r.length):0,totalOperations:t.length}}async performMaintenance(){try{setTimeout(async()=>{await this.clearExpired(),(await this.getCacheStats()).totalEntries>2e3&&await this.cleanupOldEntries(1500)},0)}catch(t){console.error("Error during cache maintenance:",t)}}};var Ps=async(n,t,e=null,r=Pe.Duration.from({minutes:10}).milliseconds)=>{let i=new Nr,o=jo(`booking-engine:${n}`,e||"null",t.body);if(!we.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(u=>{console.error("Error setting booking engine cache:",u)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var iu=(n,t)=>{let e=`${we.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:we.headers,body:JSON.stringify(t)};return Ps(e,r,n)},ou=(n,t)=>{let e=`${we.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:we.headers,body:JSON.stringify(t)};return Ps(e,r,n)};var Rs=class{constructor(){Y(this,"listeners",new Map)}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e)}off(t,e){this.listeners.get(t)?.delete(e)}emit(t,e){this.listeners.get(t)?.forEach(r=>r(e))}},zo=new Rs;function qe(n,t){zo.emit(n,t)}function Pt(n,t){Array.isArray(n)?n.forEach(e=>zo.on(e,t)):zo.on(n,t)}var au={"en-US":{loading:"Loading...",night:"Night",chooseOption:"Choose an option",apartment:"Apartment",total:"In total",missingEnterpriseId:"Missing enterprise-ID",missingCategoryId:"Missing category-ID",minimumNights:"nights minimum",maximumNights:"nights maximum",booked:"Already Booked",select:"Select",fatalErrorMessage:"Oops! An unexpected error occurred. Please try reloading or contact support.",pleaseWait:"Please wait...","chargingMode:Once":"Once","chargingMode:PerTimeUnit":"Nightly","chargingMode:PerPersonPerTimeUnit":"Nightly per person",adults:"Adults",children:"Children (0-18 years old)",guestSingular:"Person",guestPlural:"People",couponValid:"Coupon is valid ;)",couponInvalid:"Coupon is invalid !",couponError:"Error validating coupon!",proceedToPayment:"Proceed to payment",completePayment:"Complete the payment"},"fr-FR":{loading:"Chargement...",night:"Nuit",chooseOption:"Choisir une option",apartment:"Appartement",total:"Au total",missingEnterpriseId:"ID d'entreprise manquant",missingCategoryId:"ID de cat\xE9gorie manquant",minimumNights:"nuits minimum",maximumNights:"nuits maximum",booked:"D\xE9j\xE0 r\xE9serv\xE9",select:"S\xE9lectionner",fatalErrorMessage:"Oups ! Une erreur inattendue s'est produite. Veuillez recharger la page ou contacter le support.",pleaseWait:"S'il vous pla\xEEt, attendez...","chargingMode:Once":"Une fois","chargingMode:PerTimeUnit":"Par nuit","chargingMode:PerPersonPerTimeUnit":"Par personne par nuit",adults:"Adultes",children:"Enfants (0-18 ans)",guestSingular:"Personne",guestPlural:"Personnes",couponValid:"Le coupon est valide ;)",couponInvalid:"Le coupon est invalide !",couponError:"Erreur lors de la validation du coupon !",proceedToPayment:"Proc\xE9der au paiement",completePayment:"Finalisez le paiement"}},Ce=n=>au[Or().bcp47][n]||au["fr-FR"][n],Ut=n=>{let t=Or().bcp47;return t in n?n[t]:(console.warn(`Translation [${t}] not found, falling back to default.`,n),n[t]||n["fr-FR"]||n["en-US"]||"")};var Or=()=>{let{lang:n}=document.documentElement,t={iso639:"fr",bcp47:"fr-FR"};return n.includes("en")&&(t={iso639:"en",bcp47:"en-US"}),t},tn=Or().bcp47,Um=Or().iso639;function As(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Ls=Object.assign;var Rh=Object.prototype.hasOwnProperty,Uo=(n,t)=>Rh.call(n,t),sr=Array.isArray,Vi=n=>su(n)==="[object Map]";var Ah=n=>typeof n=="string",Fr=n=>typeof n=="symbol",qi=n=>n!==null&&typeof n=="object";var Lh=Object.prototype.toString,su=n=>Lh.call(n),cu=n=>su(n).slice(8,-1);var Vo=n=>Ah(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var qo=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},Nh=/-(\w)/g,Wm=qo(n=>n.replace(Nh,(t,e)=>e?e.toUpperCase():"")),Oh=/\B([A-Z])/g,Km=qo(n=>n.replace(Oh,"-$1").toLowerCase()),Fh=qo(n=>n.charAt(0).toUpperCase()+n.slice(1)),Gm=qo(n=>n?`on${Fh(n)}`:""),cr=(n,t)=>!Object.is(n,t);var Hh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Zm=As(Hh+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Ns;var Le;var Os=new WeakSet,Go=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ns&&Ns.active&&Ns.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Os.has(this)&&(Os.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Yh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,lu(this),hu(this);let t=Le,e=nn;Le=this,nn=!0;try{return this.fn()}finally{mu(this),Le=t,nn=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Zs(t);this.deps=this.depsTail=void 0,lu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Os.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}},du=0,Ki,Gi;function Yh(n,t=!1){if(n.flags|=8,t){n.next=Gi,Gi=n;return}n.next=Ki,Ki=n}function Ks(){du++}function Gs(){if(--du>0)return;if(Gi){let t=Gi;for(Gi=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;Ki;){let t=Ki;for(Ki=void 0;t;){let e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){n||(n=r)}t=e}}if(n)throw n}function hu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function mu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),Zs(r),Bh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function Ys(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($h(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function $h(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Zo)||(n.globalVersion=Zo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Ys(n))))return;n.flags|=2;let t=n.dep,e=Le,r=nn;Le=n,nn=!0;try{hu(n);let i=n.fn(n._value);(t.version===0||cr(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=e,nn=r,mu(n),n.flags&=-3}}function Zs(n,t=!1){let{dep:e,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),e.subs===n&&(e.subs=r,!r&&e.computed)){e.computed.flags&=-5;for(let o=e.computed.deps;o;o=o.nextDep)Zs(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Bh(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function fu(n,t){n.effect instanceof Go&&(n=n.effect.fn);let e=new Go(n);t&&Ls(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var nn=!0,pu=[];function jh(){pu.push(nn),nn=!1}function zh(){let n=pu.pop();nn=n===void 0?!0:n}function lu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var Zo=0,$s=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Jo=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Le||!nn||Le===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Le)e=this.activeLink=new $s(Le,this),Le.deps?(e.prevDep=Le.depsTail,Le.depsTail.nextDep=e,Le.depsTail=e):Le.deps=Le.depsTail=e,gu(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){let r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=Le.depsTail,e.nextDep=void 0,Le.depsTail.nextDep=e,Le.depsTail=e,Le.deps===e&&(Le.deps=r)}return e}trigger(t){this.version++,Zo++,this.notify(t)}notify(t){Ks();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Gs()}}};function gu(n){if(n.dep.sc++,n.sub.flags&4){let t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)gu(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var Bs=new WeakMap,lr=Symbol(""),js=Symbol(""),Zi=Symbol("");function Rt(n,t,e){if(nn&&Le){let r=Bs.get(n);r||Bs.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new Jo),i.map=r,i.key=e),i.track()}}function zn(n,t,e,r,i,o){let a=Bs.get(n);if(!a){Zo++;return}let s=u=>{u&&u.trigger()};if(Ks(),t==="clear")a.forEach(s);else{let u=sr(n),l=u&&Vo(e);if(u&&e==="length"){let h=Number(r);a.forEach((f,g)=>{(g==="length"||g===Zi||!Fr(g)&&g>=h)&&s(f)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),l&&s(a.get(Zi)),t){case"add":u?l&&s(a.get("length")):(s(a.get(lr)),Vi(n)&&s(a.get(js)));break;case"delete":u||(s(a.get(lr)),Vi(n)&&s(a.get(js)));break;case"set":Vi(n)&&s(a.get(lr));break}}Gs()}function Hr(n){let t=Ie(n);return t===n?t:(Rt(t,"iterate",Zi),Un(n)?t:t.map(Mt))}function Js(n){return Rt(n=Ie(n),"iterate",Zi),n}var Uh={__proto__:null,[Symbol.iterator](){return Fs(this,Symbol.iterator,Mt)},concat(...n){return Hr(this).concat(...n.map(t=>sr(t)?Hr(t):t))},entries(){return Fs(this,"entries",n=>(n[1]=Mt(n[1]),n))},every(n,t){return In(this,"every",n,t,void 0,arguments)},filter(n,t){return In(this,"filter",n,t,e=>e.map(Mt),arguments)},find(n,t){return In(this,"find",n,t,Mt,arguments)},findIndex(n,t){return In(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return In(this,"findLast",n,t,Mt,arguments)},findLastIndex(n,t){return In(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return In(this,"forEach",n,t,void 0,arguments)},includes(...n){return Hs(this,"includes",n)},indexOf(...n){return Hs(this,"indexOf",n)},join(n){return Hr(this).join(n)},lastIndexOf(...n){return Hs(this,"lastIndexOf",n)},map(n,t){return In(this,"map",n,t,void 0,arguments)},pop(){return Wi(this,"pop")},push(...n){return Wi(this,"push",n)},reduce(n,...t){return uu(this,"reduce",n,t)},reduceRight(n,...t){return uu(this,"reduceRight",n,t)},shift(){return Wi(this,"shift")},some(n,t){return In(this,"some",n,t,void 0,arguments)},splice(...n){return Wi(this,"splice",n)},toReversed(){return Hr(this).toReversed()},toSorted(n){return Hr(this).toSorted(n)},toSpliced(...n){return Hr(this).toSpliced(...n)},unshift(...n){return Wi(this,"unshift",n)},values(){return Fs(this,"values",Mt)}};function Fs(n,t,e){let r=Js(n),i=r[t]();return r!==n&&!Un(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Vh=Array.prototype;function In(n,t,e,r,i,o){let a=Js(n),s=a!==n&&!Un(n),u=a[t];if(u!==Vh[t]){let f=u.apply(n,o);return s?Mt(f):f}let l=e;a!==n&&(s?l=function(f,g){return e.call(this,Mt(f),g,n)}:e.length>2&&(l=function(f,g){return e.call(this,f,g,n)}));let h=u.call(a,l,r);return s&&i?i(h):h}function uu(n,t,e,r){let i=Js(n),o=e;return i!==n&&(Un(n)?e.length>3&&(o=function(a,s,u){return e.call(this,a,s,u,n)}):o=function(a,s,u){return e.call(this,a,Mt(s),u,n)}),i[t](o,...r)}function Hs(n,t,e){let r=Ie(n);Rt(r,"iterate",Zi);let i=r[t](...e);return(i===-1||i===!1)&&im(e[0])?(e[0]=Ie(e[0]),r[t](...e)):i}function Wi(n,t,e=[]){jh(),Ks();let r=Ie(n)[t].apply(n,e);return Gs(),zh(),r}var qh=As("__proto__,__v_isRef,__isVue"),yu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Fr));function Wh(n){Fr(n)||(n=String(n));let t=Ie(this);return Rt(t,"has",n),t.hasOwnProperty(n)}var Xo=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,r){if(e==="__v_skip")return t.__v_skip;let i=this._isReadonly,o=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return o;if(e==="__v_raw")return r===(i?o?tm:bu:o?em:wu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=sr(t);if(!i){let u;if(a&&(u=Uh[e]))return u;if(e==="hasOwnProperty")return Wh}let s=Reflect.get(t,e,Yr(t)?t:r);return(Fr(e)?yu.has(e):qh(e))||(i||Rt(t,"get",e),o)?s:Yr(s)?a&&Vo(e)?s:s.value:qi(s)?i?Qo(s):Br(s):s}},zs=class extends Xo{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let u=$r(o);if(!Un(r)&&!$r(r)&&(o=Ie(o),r=Ie(r)),!sr(t)&&Yr(o)&&!Yr(r))return u?!1:(o.value=r,!0)}let a=sr(t)&&Vo(e)?Number(e)<t.length:Uo(t,e),s=Reflect.set(t,e,r,Yr(t)?t:i);return t===Ie(i)&&(a?cr(r,o)&&zn(t,"set",e,r,o):zn(t,"add",e,r)),s}deleteProperty(t,e){let r=Uo(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&zn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Fr(e)||!yu.has(e))&&Rt(t,"has",e),r}ownKeys(t){return Rt(t,"iterate",sr(t)?"length":lr),Reflect.ownKeys(t)}},Us=class extends Xo{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Kh=new zs,Gh=new Us;var Vs=n=>n,Wo=n=>Reflect.getPrototypeOf(n);function Zh(n,t,e){return function(...r){let i=this.__v_raw,o=Ie(i),a=Vi(o),s=n==="entries"||n===Symbol.iterator&&a,u=n==="keys"&&a,l=i[n](...r),h=e?Vs:t?qs:Mt;return!t&&Rt(o,"iterate",u?js:lr),{next(){let{value:f,done:g}=l.next();return g?{value:f,done:g}:{value:s?[h(f[0]),h(f[1])]:h(f),done:g}},[Symbol.iterator](){return this}}}}function Ko(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Jh(n,t){let e={get(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);n||(cr(i,s)&&Rt(a,"get",i),Rt(a,"get",s));let{has:u}=Wo(a),l=t?Vs:n?qs:Mt;if(u.call(a,i))return l(o.get(i));if(u.call(a,s))return l(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Rt(Ie(i),"iterate",lr),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);return n||(cr(i,s)&&Rt(a,"has",i),Rt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,u=Ie(s),l=t?Vs:n?qs:Mt;return!n&&Rt(u,"iterate",lr),s.forEach((h,f)=>i.call(o,l(h),l(f),a))}};return Ls(e,n?{add:Ko("add"),set:Ko("set"),delete:Ko("delete"),clear:Ko("clear")}:{add(i){!t&&!Un(i)&&!$r(i)&&(i=Ie(i));let o=Ie(this);return Wo(o).has.call(o,i)||(o.add(i),zn(o,"add",i,i)),this},set(i,o){!t&&!Un(o)&&!$r(o)&&(o=Ie(o));let a=Ie(this),{has:s,get:u}=Wo(a),l=s.call(a,i);l||(i=Ie(i),l=s.call(a,i));let h=u.call(a,i);return a.set(i,o),l?cr(o,h)&&zn(a,"set",i,o,h):zn(a,"add",i,o),this},delete(i){let o=Ie(this),{has:a,get:s}=Wo(o),u=a.call(o,i);u||(i=Ie(i),u=a.call(o,i));let l=s?s.call(o,i):void 0,h=o.delete(i);return u&&zn(o,"delete",i,void 0,l),h},clear(){let i=Ie(this),o=i.size!==0,a=void 0,s=i.clear();return o&&zn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Zh(i,n,t)}),e}function vu(n,t){let e=Jh(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Uo(e,i)&&i in r?e:r,i,o)}var Xh={get:vu(!1,!1)};var Qh={get:vu(!0,!1)};var wu=new WeakMap,em=new WeakMap,bu=new WeakMap,tm=new WeakMap;function nm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rm(n){return n.__v_skip||!Object.isExtensible(n)?0:nm(cu(n))}function Br(n){return $r(n)?n:Du(n,!1,Kh,Xh,wu)}function Qo(n){return Du(n,!0,Gh,Qh,bu)}function Du(n,t,e,r,i){if(!qi(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=rm(n);if(o===0)return n;let a=i.get(n);if(a)return a;let s=new Proxy(n,o===2?r:e);return i.set(n,s),s}function $r(n){return!!(n&&n.__v_isReadonly)}function Un(n){return!!(n&&n.__v_isShallow)}function im(n){return n?!!n.__v_raw:!1}function Ie(n){let t=n&&n.__v_raw;return t?Ie(t):n}var Mt=n=>qi(n)?Br(n):n,qs=n=>qi(n)?Qo(n):n;function Yr(n){return n?n.__v_isRef===!0:!1}function Be(n){return om(n,!1)}function om(n,t){return Yr(n)?n:new Ws(n,t)}var Ws=class{constructor(t,e){this.dep=new Jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Ie(t),this._value=e?t:Mt(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||Un(t)||$r(t);t=r?t:Ie(t),cr(t,e)&&(this._rawValue=t,this._value=r?t:Mt(t),this.dep.trigger())}};var We=async(n,t,e=null,r=!1)=>{let i=new Nr,o=jo(n,e||"null",t.body);if(!we.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(we.base_url);r&&(a.pathname=a.pathname.replace("/mews","/_adapter")),a.pathname+=n,a.searchParams.set("enterprise",e||"null");let s=await fetch(a.toString(),t),u=await s.json();if(s.ok)return i.set(o,u,e||"null").catch(l=>{console.error("Error setting cache:",l)}),u;throw new Error("FETCH_ERROR",{cause:u})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var Eu=(n,t={})=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/services/getAll",e,n)};function _u(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Ut(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Xs=Be({});async function Mu(n){if(Xs.value[n])return Xs.value[n];let t=await Eu(n),e=_u(t);return Xs.value[n]=e,e}var Su=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/ageCategories/getAll",e,n)};function ku(n){if(!n||!n.AgeCategories||!Array.isArray(n.AgeCategories))throw new Error("Invalid age categories response format");return n.AgeCategories.map(t=>({id:t.Id,name:Ut(t.Names),shortName:t.ShortNames?Ut(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Qs=Be({});async function Tu(n){if(Qs.value[n])return Qs.value[n];let t=await Su(n,{EnterpriseIds:[n]}),e=ku(t);return Qs.value[n]=e,e}var Cu=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/products/getAll",e,n)};function Iu(n){return{currency:n.Currency,datesUtc:n.DatesUtc.map(t=>t.split("T")[0]),timeUnitStartsUTC:n.TimeUnitStartsUtc,categoryPrices:n.CategoryPrices,relativeAdjustment:n.RelativeAdjustment,absoluteAdjustment:n.AbsoluteAdjustment}}function xu(n){let t={};for(let e of n)e.pricing?.datesUtc.forEach((r,i)=>{t[r]=t[r]||[],t[r].push({rate:e.rate,categoryPrices:e.pricing?.categoryPrices.map(o=>({categoryId:o.CategoryId,amountPrice:o.AmountPrices[i],price:o.Prices[i]}))||[]})});return t}function Pu(n){if(!n||!n.Rates||!Array.isArray(n.Rates))throw new Error("Invalid rates response format");return n.Rates.filter(t=>t.IsActive&&t.IsEnabled&&t.IsPublic).map(t=>({id:t.Id,serviceId:t.ServiceId,baseRateId:t.BaseRateId,isBaseRate:t.IsBaseRate,isActive:t.IsActive,isEnabled:t.IsEnabled,isPublic:t.IsPublic,isDefault:t.IsDefault,type:t.Type,name:Ut(t.Names),shortName:t.ShortName,description:Ut(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function Ji(n,t){return n.map(t)}function ec(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Ut(n.Names),shortName:Ut(n.ShortNames),description:Ut(n.Descriptions),options:n.Options,promotions:n.Promotions,classifications:n.Classifications,pricing:n.Pricing,imageIds:n.ImageIds||[],ordering:n.Ordering,consumptionMoment:n.ConsumptionMoment,chargingMode:n.ChargingMode}}function Ru(n){return{products:Ji(n.Products,ec),customerProducts:Ji(n.CustomerProducts,ec)}}var tc=Be({});async function Au(n,t){if(tc.value[t])return tc.value[t];let e=await Cu(n,{ServiceIds:[t]}),r=Ru(e);return tc.value[t]=r,r}var Lu=(n,t={})=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/rates/getAll",e,n)};var nc=Be({});async function Nu(n,t){if(nc.value[t])return nc.value[t];let e=await Lu(n,{ServiceIds:[t]}),r=Pu(e);return nc.value[t]=r,r}var Ou=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/services/getAvailability",e,n)};function Fu(n){if(!n||!n.CategoryAvailabilities||!Array.isArray(n.CategoryAvailabilities)||!n.TimeUnitStartsUtc)throw new Error("Invalid service availabilities response format");return n.CategoryAvailabilities.map(t=>({categoryId:t.CategoryId,timeUnitStartsUTC:n.TimeUnitStartsUtc,availabilities:t.Availabilities||[],adjustments:t.Adjustments||[]}))}var Z=class n{static getCurrentDate(){return Pe.Now.plainDateISO()}static fromString(t){return Pe.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(tn,e)}static formatForAPI(t){return(typeof t=="string"?Pe.PlainDate.from(t):Pe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:Pe.PlainTime.from("00:00")}).toInstant().toString()}static addDays(t,e){return t.add({days:e})}static daysBetween(t,e){return t.until(e).days}static isBefore(t,e){return Pe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return Pe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return Pe.PlainDate.compare(t,e)===0}static getDateRange(t,e){let r=[],i=t;for(;this.isBefore(i,e);)r.push(i),i=this.addDays(i,1);return r}static fromJSDate(t){return Pe.PlainDate.from({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()})}static toJSDate(t){return new Date(t.year,t.month-1,t.day)}static formatForCalendar(t,e="flatpickr"){if(e==="flatpickr")return t.toString();let r=String(t.day).padStart(2,"0"),i=String(t.month).padStart(2,"0");return`${r}/${i}/${t.year}`}static safeParsePlainDate(t){try{if(t.endsWith("Z")){let e=t.split("T")[0];return Pe.PlainDate.from(e)}return Pe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var _p=localStorage.getItem("dev")==="true";var Mp=3*60*60*1e3;var ea="calendar-day-price",Hu="DD/MM/YYYY",Yu="Y-m-d",rc=!1,am=365,ic=Z.getCurrentDate(),$u=Z.addDays(ic,am),ur=Z.getCurrentDate(),jr=Z.addDays(ur,3),sm=Z.getCurrentDate(),Sp=Z.addDays(sm,30);function dr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}function Bu(n=!0,t=document.body,e=Ce("fatalErrorMessage")){t.querySelectorAll('[data-fs-element="preloader"]').forEach(i=>{let o=i.querySelector('[data-fs-element="spinner"]'),a=i.querySelector('[data-fs-element="message"]'),s=i.firstChild;o&&o.classList.toggle("hide",n),a&&(n?(s.style.width="90%",a.textContent=e):(s.removeAttribute("style"),a.textContent=Ce("pleaseWait"))),i.classList.toggle("hide",!n)})}var oc=class{constructor(){Y(this,"state",Br({appartmentsData:[],today:Z.getCurrentDate(),lowestPricesByDate:{},isLoadingPrices:!1,isLoadingData:!1}))}setAppartmentsData(t){this.state.appartmentsData=t}setLowestPricesByDate(t){this.state.lowestPricesByDate=t}setLoadingPrices(t){this.state.isLoadingPrices=t}setLoadingData(t){this.state.isLoadingData=t}reset(){this.state.appartmentsData=[],this.state.lowestPricesByDate={},this.state.isLoadingPrices=!1,this.state.isLoadingData=!1}},Op=new oc;var hr={get:n=>{try{let t=localStorage.getItem(n);return t?JSON.parse(t):null}catch(t){return console.error(`Error reading from localStorage for key ${n}:`,t),null}},set:(n,t)=>{try{localStorage.setItem(n,JSON.stringify(t)),hr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=hr.get(n),r=t(e);hr.set(n,r)},remove:n=>{localStorage.removeItem(n),hr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",cm()||"root")}},cm=()=>localStorage.getItem("lastUpdater");var Vn=hr.get("form_state"),ju=Vn?{enterpriseId:Vn.enterpriseId||"",startDate:Vn.startDate||"",endDate:Vn.endDate||"",guests:Vn.guests||0,coupon:Vn.coupon||"",referrer:Vn.referrer||window.location.href,rooms:Vn.rooms||0}:{enterpriseId:"",startDate:null,endDate:null,guests:0,coupon:"",referrer:window.location.href,rooms:0},ye=Br(ju),lm=Qo(ju);fu(()=>{hr.set("form_state",ye)});var um="data-fs-element";var Ke=(n,t=document)=>t.querySelector(`[${um}="${n}"]`);var ac=Be({});async function zu(n,t,e,r){if(ac.value[t])return ac.value[t];let i=await Ou(n,{ServiceId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=Fu(i);return ac.value[t]=o,o}var Uu=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/restrictions/getAll",e,n)};function Vu(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var sc=Be({});async function qu(n,t,e,r){if(sc.value[t])return sc.value[t];let i=await Uu(n,{ServiceIds:[t],CollidingUtc:{StartUtc:Z.formatForAPI(e),EndUtc:Z.formatForAPI(r)},Origin:"User"}),o=Vu(i);return sc.value[t]=o,o}var Wu=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/rules/getAll",e,n)};function Ku(n){if(!n||!n.Rules||!Array.isArray(n.Rules))throw new Error("Invalid service rules response format");return n.Rules.map(t=>({id:t.Id,serviceId:t.ServiceId,conditions:t.Conditions,actions:n.RuleActions!=null?n.RuleActions.filter(e=>e.RuleId===t.Id):n.RuleActions}))}var cc=Be({});async function Gu(n,t){if(cc.value[t])return cc.value[t];let e=await Wu(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Ku(e);return cc.value[t]=r,r}var Zu=(n,t)=>{let e={method:"POST",headers:we.headers,body:JSON.stringify(t)};return We("/rates/getPricing",e,n)};var lc=Be({});async function Ju(n,t,e,r){if(lc.value[t])return lc.value[t];let i=await Zu(n,{RateId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=Iu(i);return lc.value[t]=o,o}var ta=class{constructor(t,e){Y(this,"enterprise");Y(this,"rate",null);Y(this,"pricing",null);this.enterprise=t,this.rate=e}getRate(){if(!this.rate)throw new Error("Rate is not initialized");return this.rate}async initPricing(t,e){if(!this.rate)throw new Error("Rate is not initialized");return this.pricing=await Ju(this.enterprise.getEnterpriseId(),this.rate.id,t,e),this.pricing}getPricing(){if(!this.pricing)throw new Error("Rate pricing is not initialized");return this.pricing}};var na=class{constructor(t,e){Y(this,"enterprise");Y(this,"service",null);Y(this,"products",[]);Y(this,"customerProducts",[]);Y(this,"restrictions",[]);Y(this,"availabilities",[]);Y(this,"rules",[]);Y(this,"ageCategories",[]);Y(this,"rates",[]);this.enterprise=t,this.service=e}getService(){return this.service}async initAvailabilities(t,e){if(!this.service)throw new Error("Service is not initialized");return this.availabilities=await zu(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.availabilities}getAvailabilities(){if(this.availabilities.length===0)throw new Error("Service availabilities are not initialized");return this.availabilities}async initRestrictions(t,e){if(!this.service)throw new Error("Service is not initialized");return this.restrictions=await qu(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.restrictions}getRestrictions(){if(this.restrictions.length===0)throw new Error("Service restrictions are not initialized");return this.restrictions}async initProducts(){if(!this.service)throw new Error("Service is not initialized");let t=await Au(this.enterprise.getEnterpriseId(),this.service.id);return this.products=t.products,this.customerProducts=t.customerProducts,t}getProducts(){if(this.products.length===0)throw new Error("Service products are not initialized");return this.products}async initRates(){if(!this.service)throw new Error("Service is not initialized");let t=await Nu(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new ta(this.enterprise,e)),this.rates.length===0)throw new Error("No rates found for the service");return this.rates}getRates(){if(this.rates.length===0)throw new Error("Service rates are not initialized");return this.rates?.map(t=>t.getRate())||[]}async initRules(){if(!this.service)throw new Error("Service is not initialized");return this.rules=await Gu(this.enterprise.getEnterpriseId(),this.service.id),this.rules}getRules(){if(this.rules.length===0)throw new Error("Service rules are not initialized");return this.rules}async initAgeCategories(){if(!this.service)throw new Error("Service is not initialized");return this.ageCategories=await Tu(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var zr=class{constructor(t){Y(this,"enterpriseId");Y(this,"services",[]);Y(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await Mu(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new na(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var ra=class{constructor(t){this.fsListInstance=t;Y(this,"cmsAparthotels",[]);Y(this,"state",{startDate:ye.startDate?Z.safeParsePlainDate(ye.startDate):ur,endDate:ye.endDate?Z.safeParsePlainDate(ye.endDate):jr,apiDataCache:new Map});Pt("loading:start",e=>dr(!0,e)),Pt("loading:end",e=>dr(!1,e))}shuffleArray(t){let e=[...t];for(let r=e.length-1;r>0;r--){let i=Math.floor(Math.random()*(r+1));[e[r],e[i]]=[e[i],e[r]]}return e}init(){qe("loading:start",this.fsListInstance.wrapperElement),this.fsListInstance.addHook("filter",async t=>{if(console.log("*** Filter hook triggered with items:",t),qe("loading:start",this.fsListInstance.wrapperElement),!ye.startDate||!ye.endDate)return qe("loading:end",this.fsListInstance.wrapperElement),t;await new Promise(r=>setTimeout(r,100)),await this.updateListItems(t,{startDate:this.state.startDate.toString(),endDate:this.state.endDate.toString(),guests:ye.guests||1,rooms:ye.rooms||1});let e=t.filter(r=>Number(r.fields["price-sort"]?.value||9999999)<9999999);return console.log("===> Filtered items:",e),this.fsListInstance.instance==="related"&&(e=this.shuffleArray(e),e=e.slice(0,3),console.log("===> Related items shuffled and limited to 3:",e)),qe("loading:end",this.fsListInstance.wrapperElement),e}),Pt("date:changed",t=>{console.log("Date changed:",t),this.state.startDate=t.startDate?Z.safeParsePlainDate(t.startDate):ur,this.state.endDate=t.endDate?Z.safeParsePlainDate(t.endDate):jr,ye.startDate=t.startDate||null,ye.endDate=t.endDate||null,this.fsListInstance.triggerHook("filter")})}groupItemsByEnterprise(t){let e={};return t.forEach(r=>{if(!r.fields["enterprise-id"]||!r.fields["resource-category-id"])return;let i=r.fields["enterprise-id"].value,o=r.fields["resource-category-id"].value;e[i]||(e[i]=[]),e[i].includes(o)||e[i].push(o)}),console.log("#=> Grouped by enterprise:",e),e}createCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i.sort().join(",")}`}async fetchApiData(t,e,r){let o=Date.now(),a=[],s=[];for(let[l,h]of Object.entries(r)){let f=this.createCacheKey(t,e,l,h),g=this.state.apiDataCache.get(f);if(g&&o-g.timestamp<3e5){console.log(`Using cached data for ${l} with ${h.length} categories`),a.push(g);continue}let E=(async()=>{try{let S=new zr(l);await S.initServices();let{reservableService:k}=S,A=k?.getService()?.id;if(!A)return console.warn(`No serviceId found for enterprise ${l}`),null;await k?.initAgeCategories();let B=k?.getAgeCategories()||[],V=await Promise.all([iu(l,{EnterpriseId:l,CategoryIds:h,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,Client:we.bookingEngineClient,LanguageCode:"fr-FR"}),ou(l,{Client:we.bookingEngineClient,EnterpriseId:l,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,CategoryIds:h,CurrencyCode:"EUR"})]),G=V[0],U=V[1],J={enterpriseId:l,ageCategories:B,availabilities:G,servicePricing:U,timestamp:o};return this.state.apiDataCache.set(f,J),J}catch(S){return console.error(`Error fetching data for enterprise ${l}:`,S),null}})();s.push(E)}let u=await Promise.all(s);return[...a,...u.filter(Boolean)]}async updateListItems(t,{startDate:e,endDate:r,guests:i,rooms:o}){let a=this.groupItemsByEnterprise(t),s=await this.fetchApiData(e,r,a);return console.log("#=> API Data:",s),(await Promise.all(t.map(async l=>{let h=!1,f=!0;if(this.screenItem(l,!0),!l.fields["enterprise-id"]){console.warn(`Item missing enterprise-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("missingEnterpriseId"));return}if(!l.fields["resource-category-id"]){console.warn(`Item missing resource-category-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("missingCategoryId"));return}let g=l.fields["enterprise-id"].value,E=l.fields["resource-category-id"].value,S=s.find(J=>J&&J.enterpriseId===g);if(!S){console.warn(`No data found for enterpriseId: ${g} in item: [${l.fields.title.value}]\u21FE[${l.fields.name.value}]`),l.element.style.opacity="0.5",this.screenItem(l,!1,Ce("booked"));return}let k=S.availabilities.ApplicableRestrictions||[],A={title:l.fields.title.value,name:l.fields.name.value,exactRateId:"",baseRateId:"",rateGroupId:"",categoryId:E,categoryType:"notVilla",guests:i,startDate:Z.fromString(e),endDate:Z.fromString(r)},B=this.checkReservationAgainstRestrictions(A,k);return console.log("Restriction Verdict:",B),f=S.availabilities.CategoryAvailabilities.find(J=>J.CategoryId===A.categoryId)?.Availabilities?.slice(0,-1).every(J=>J>0)||!1,h=B.block,h?this.screenItem(l,!1,B.message||Ce("booked")):this.screenItem(l,!0),this.updateItemPrice(l,S.servicePricing,E,{startDate:e,endDate:r,guests:i,isLimited:h,isReservable:f,restrictions:k,restrictionMessage:B.message,restrictionBlock:B.block}),l.collectFields(),l;return f?l:null}))).filter(l=>l!==null)}checkReservationAgainstRestrictions(t,e){console.log("Restrictions:",e);let r=e.filter(s=>this.matchesCondition(t,s.Conditions));if(console.log("Applicable Restrictions:",r),r.length===0)return{block:!1,message:null};let i=r.some(s=>{let{Exceptions:u}=s;return u.MaxAdvance==null&&u.MinAdvance==null&&u.MaxLength==null&&u.MinLength==null&&u.MaxPrice==null&&u.MinPrice==null&&u.MaxReservationCount==null&&u.MinReservationCount==null});if(console.log("Has full restriction:",i),i)return{block:!0,message:Ce("booked")};let o=this.getExtremesFromExceptions(r);console.log("Restriction Extremes:",o);let a=this.violatesException(t,o);return console.log("Violation:",a),a?{block:!0,message:a}:{block:!1,message:null}}matchesCondition(t,e){return(e.ExactRateId===null||t.exactRateId===e.ExactRateId)&&(e.BaseRateId===null||t.baseRateId===e.BaseRateId)&&(e.RateGroupId===null||t.rateGroupId===e.RateGroupId)&&(e.ResourceCategoryId===null||t.categoryId===e.ResourceCategoryId)&&(e.ResourceCategoryType===null||t.categoryType===e.ResourceCategoryType)&&e.Days.includes(t.startDate.toLocaleString("en-US",{weekday:"long"}))&&!0}getDurationInDays(t){if(!t)return null;try{return Pe.Duration.from(t).total({unit:"days"})}catch{return null}}getExtremesFromExceptions(t){let e=null,r=null,i=null,o=null,a=!1;for(let s of t){let u=this.getDurationInDays(s.Exceptions.MinAdvance),l=this.getDurationInDays(s.Exceptions.MaxAdvance),h=this.getDurationInDays(s.Exceptions.MinLength),f=this.getDurationInDays(s.Exceptions.MaxLength);u!==null&&(e=Math.max(e??u,u)),l!==null&&(r=Math.min(r??l,l)),h!==null&&(i=Math.max(i??h,h)),f!==null&&(o=Math.min(o??f,f)),!u&&!l&&!h&&!f&&(a=!0)}return{MinAdvance:e,MaxAdvance:r,MinLength:i,MaxLength:o,Restrict:a}}violatesException(t,e){let{startDate:r}=t,{endDate:i}=t,o=i.since(r,{largestUnit:"day"}).days,a=Z.getCurrentDate(),s=r.since(a,{largestUnit:"day"}).days;return e.MinLength&&o<e.MinLength?`${e.MinLength} ${Ce("minimumNights")}`:e.MaxLength&&o>e.MaxLength?`${e.MaxLength} ${Ce("maximumNights")}`:e.MinAdvance&&s<e.MinAdvance?Ce("booked"):e.MaxAdvance&&s>e.MaxAdvance?Ce("booked"):!e.MinLength&&!e.MaxLength&&!e.MinAdvance&&!e.MaxAdvance?Ce("booked"):null}updateItemPrice(t,e,r,{startDate:i,endDate:o,guests:a,isLimited:s,isReservable:u,restrictions:l,restrictionMessage:h,restrictionBlock:f}){console.groupCollapsed(`[${t.fields.title.value}] \u21FE [${t.fields.name.value}] PRICE UPDATE`),console.log(`Is Limited: ${s}`),console.log(`Is Reservable: ${u}`),console.log(`Restriction Block: ${f}`),console.log(`Restriction Message: ${h||"None"}`);let g=Ke("price",t.element),E=t.element.querySelector('[fs-list-field="price-sort"]'),S=Ke("total-price",t.element),k=Z.fromString(i).until(Z.fromString(o)).total({unit:"days"});s&&u&&E&&(E.textContent="999999"),!u&&E&&(E.textContent="9999999");let A=e?.CategoryPrices?.find(U=>U.CategoryId===r);if(console.log("Category Price:",A),console.log("Restrictions:",l),!A||s&&u){if(g){g.textContent="-";let U=g.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}E&&u&&(E.textContent="999999"),A||(console.warn(`No price found for categoryId: ${r}`),s||this.screenItem(t,!1,Ce("booked"))),console.groupEnd();return}if(!u){if(g){g.textContent="-";let U=g.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}console.warn(`No availability found for categoryId: ${r}`),this.screenItem(t,!1,Ce("booked")),console.groupEnd();return}let B=A.OccupancyPrices[0]?.RateGroupPrices.reduce((U,J)=>J.MinPrice.AverageAmountPerTimeUnit.GrossValue<U.MinPrice.AverageAmountPerTimeUnit.GrossValue?J:U);if(console.log("Lowest Price:",B),!B){g&&(g.textContent="-"),E&&u&&(E.textContent="999999"),console.groupEnd();return}let V=B.MinPrice.AverageAmountPerTimeUnit.GrossValue,G=V.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});if(g){g.textContent=G;let U=g.parentElement;U&&(U.style.opacity="1")}if(E&&(E.textContent=V.toString()),S){let J=(V*k).toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});S.textContent=`${J} ${Ce("total").toLowerCase()} (${k} ${Ce("night")}s)`;let oe=S.parentElement;oe&&(oe.style.opacity="1")}console.groupEnd()}screenItem(t,e,r=Ce("select")||""){let i=Ke("submit",t.element);i&&(e?(t.element.style.opacity="1",i.classList.remove("room-results_cta-disabled"),i.textContent=r):i.classList.contains("room-results_cta-disabled")||(i.classList.add("room-results_cta-disabled"),i.textContent=r))}};var Xu=()=>{};function Ur(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Xu}var ia=n=>n instanceof HTMLInputElement;var uc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Xi=n=>{let{value:t}=n;if(n.type==="checkbox"&&(t=n.checked.toString()),n.type==="radio"){let e=n.closest("form")?.querySelector(`input[name="${n.name}"]:checked`);t=ia(e)?e.value:""}return t.toString()};var Qi=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!ia(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}uc(n,["click","input","change"])};function Qu(n,t){return{rate:n,pricing:t}}function dc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function ed(n,t){let e=t.filter(o=>dm(n,o.Conditions));return!!(e.some(o=>{let{Exceptions:a}=o;return a.MaxAdvance==null&&a.MinAdvance==null&&a.MaxLength==null&&a.MinLength==null&&a.MaxPrice==null&&a.MinPrice==null&&a.MaxReservationCount==null&&a.MinReservationCount==null})||e.some(o=>hm(n,o.Exceptions)))}function dm(n,t){return(t.ExactRateId===null||n.rate.id===t.ExactRateId)&&(t.BaseRateId===null||n.rate.baseRateId===t.BaseRateId)&&(t.ExactRateId===null||n.rate.baseRateId===t.ExactRateId)&&(t.RateGroupId===null||n.rate.group?.Id===t.RateGroupId)&&t.ResourceCategoryId===null&&t.ResourceCategoryType===null&&n.pricing?.datesUtc.every(e=>{let r=Z.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function oa(n){if(!n)return null;try{return Pe.Duration.from(n).total({unit:"days"})}catch{return null}}function hm(n,t){let e=Z.fromString(n.pricing?.datesUtc[0]),r=Z.fromString(n.pricing?.datesUtc.at(-1));if(!e||!r)return console.warn("Missing date information, cannot check restrictions"),!0;let i=r.since(e,{largestUnit:"day"}).days,o=Z.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=oa(t.MinAdvance),u=oa(t.MaxAdvance),l=oa(t.MinLength),h=oa(t.MaxLength);return!!(l&&i<l||h&&i>h||s&&a<s||u&&a>u||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var td=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!ed(s,t)&&dc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=xu(r),a=mm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function mm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>dc(a.rate));for(let a of o)for(let s of a.categoryPrices)s.price<i&&(i=s.price);i!==1/0&&(t[e]=i)}return t}var hc=async n=>{let t=await Promise.all(n.map(async r=>{let i=new zr(r);await i.initServices();let o=i.reservableService;if(!o){console.error("No reservable service found for the enterprise.");return}await o.initRates();let a=[],s=await Promise.all(o.rates.map(async l=>{let h=await l.initPricing(Z.formatForAPI(ic.toString()),Z.formatForAPI($u.toString()));return Qu(l.getRate(),h)}));return td(s,a).lowestDatedPrices})),e={};for(let r of t)if(r)for(let[i,o]of Object.entries(r))(!e[i]||o<e[i])&&(e[i]=o);return e};var Ge=class Ge extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(Ge.parseDateTime(e,r,i));Y(this,"lang");this.lang=i}static parseDateTime(e,r="YYYY-MM-DD",i="en-US"){if(!e)return new Date(new Date().setHours(0,0,0,0));if(e instanceof Ge)return e.toJSDate();if(e instanceof Date)return e;if(/^-?\d{10,}$/.test(String(e)))return new Date(Number(e));if(typeof e=="string"){let o=[],a=null;for(;(a=Ge.regex.exec(r))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){let s={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};o[0].index>0&&(s.value+=".*?");for(let[l,h]of Object.entries(o)){let f=Number(l),{group:g,pattern:E}=Ge.formatPatterns(h[0],i);s[g]=f+1,s.value+=E,s.value+=".*?"}let u=new RegExp(`^${s.value}$`);if(u.test(e)){let l=u.exec(e),h=Number(l[s.year]),f=null;s.month?f=Number(l[s.month])-1:s.shortMonth?f=Ge.shortMonths(i).indexOf(l[s.shortMonth]):s.longMonth&&(f=Ge.longMonths(i).indexOf(l[s.longMonth]));let g=Number(l[s.day])||1,E=Number(l[s.hour]),S=Number.isNaN(E)?0:E,k=Number(l[s.minute]),A=Number.isNaN(k)?0:k,B=Number(l[s.second]),V=Number.isNaN(B)?0:B,G=l[s.ampm];return G&&G==="PM"&&(S+=12,S===24&&(S=0)),new Date(h,f,g,S,A,V,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"long"}))}static formatPatterns(e,r){switch(e){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${e.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${Ge.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${Ge.longMonths(r).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}getWeek(e){let r=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-e))%7;r.setDate(r.getDate()-i);let o=r.getTime();return r.setMonth(0,1),r.getDay()!==e&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((o-r.getTime())/6048e5)}clone(){return new Ge(this)}toJSDate(){return new Date(this)}inArray(e,r="[]"){return e.some(i=>i instanceof Array?this.isBetween(i[0],i[1],r):this.isSame(i,"day"))}isBetween(e,r,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"[)":return this.midnight_ts(this)>=this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"(]":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<=this.midnight_ts(r);case"[]":return this.midnight_ts()>=this.midnight_ts(e)&&this.midnight_ts()<=this.midnight_ts(r)}}isBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return e.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(e.getFullYear(),e.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>e.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()+e);break;case"month":case"months":this.setMonth(this.getMonth()+e)}return this}subtract(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()-e);break;case"month":case"months":this.setMonth(this.getMonth()-e)}return this}diff(e,r="days"){switch(r){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(e))/864e5);case"month":case"months":let i=12*(e.getFullYear()-this.getFullYear());return i-=e.getMonth(),i+=this.getMonth(),i}}format(e,r="en-US"){let i="",o=[],a=null;for(;(a=Ge.regex.exec(e))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(let[s,u]of Object.entries(o)){let l=Number(s);i+=this.formatTokens(u[0],r),o[l+1]&&(i+=e.substring(u.index+u[0].length,o[l+1].index)),l===o.length-1&&(i+=e.substring(u.index+u[0].length))}}return i.replace(/\\/g,"")}midnight_ts(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(e,r){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return Ge.shortMonths(r)[this.getMonth()];case"MMMM":return Ge.longMonths(r)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||this.getHours()===24?"am":"pm";case"A":return this.getHours()<12||this.getHours()===24?"AM":"PM";default:return""}}};Y(Ge,"regex",/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g),Y(Ge,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var de=Ge,mc=class{constructor(t){Y(this,"picker");this.picker=t}render(t,e){t||(t=new de),t.setDate(1),t.setHours(0,0,0,0),typeof this[`get${e}View`]=="function"&&this[`get${e}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){let e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),typeof this.picker.options.header=="string"&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){let e=document.createElement("main");this.picker.ui.container.appendChild(e);let r=document.createElement("div");r.className=`calendars grid-${this.picker.options.grid}`;for(let i=0;i<this.picker.options.calendars;i++){let o=document.createElement("div");o.className="calendar",r.appendChild(o);let a=this.getCalendarHeaderView(t.clone());o.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:i,target:a});let s=this.getCalendarDayNamesView();o.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:i,target:s});let u=this.getCalendarDaysView(t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:u});let l=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:l}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:i,target:o}),t.add(1,"month")}e.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:r}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){let e=document.createElement("footer"),r=document.createElement("div");r.className="footer-buttons";let i=document.createElement("button");i.className="cancel-button unit",i.innerHTML=this.picker.options.locale.cancel,r.appendChild(i);let o=document.createElement("button");o.className="apply-button unit",o.innerHTML=this.picker.options.locale.apply,o.disabled=!0,r.appendChild(o),e.appendChild(r),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){let e=document.createElement("div");e.className="header";let r=document.createElement("div");r.className="month-name",r.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span> ${t.format("YYYY")}`,e.appendChild(r);let i=document.createElement("button");i.className="previous-button unit",i.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(i);let o=document.createElement("button");return o.className="next-button unit",o.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(o),e}getCalendarDayNamesView(){let t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){let r=3+this.picker.options.firstDay+e,i=document.createElement("div");i.className="dayname",i.innerHTML=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),i.title=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(i),this.picker.trigger("view",{dayIdx:r,view:"CalendarDayName",target:i})}return t}getCalendarDaysView(t){let e=document.createElement("div");e.className="days-grid";let r=this.calcOffsetDays(t,this.picker.options.firstDay),i=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let o=0;o<r;o++){let a=document.createElement("div");a.className="offset",e.appendChild(a)}for(let o=1;o<=i;o++){t.setDate(o);let a=this.getCalendarDayView(t);e.appendChild(a),this.picker.trigger("view",{date:t,view:"CalendarDay",target:a})}return e}getCalendarDayView(t){let e=this.picker.options.date?new de(this.picker.options.date):null,r=new de,i=document.createElement("div");return i.className="day unit",i.innerHTML=t.format("D"),i.dataset.time=String(t.getTime()),t.isSame(r,"day")&&i.classList.add("today"),[0,6].includes(t.getDay())&&i.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&i.classList.add("selected"):e&&t.isSame(e,"day")&&i.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:i}),i}getCalendarFooterView(t,e){let r=document.createElement("div");return r.className="footer",r}calcOffsetDays(t,e){let r=t.getDay()-e;return r<0&&(r+=7),r}},fc=class{constructor(t){Y(this,"picker");Y(this,"instances",{});this.picker=t}initialize(){let t=[];this.picker.options.plugins.forEach(e=>{typeof e=="function"?t.push(new e):typeof e=="string"&&typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick: ${e} not found.`)}),t.sort((e,r)=>e.priority>r.priority?-1:e.priority<r.priority||e.dependencies.length>r.dependencies.length?1:e.dependencies.length<r.dependencies.length?-1:0),t.forEach(e=>{e.attach(this.picker),this.instances[e.getName()]=e})}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick: ${t} already added.`);else{if(typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,t)){let e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if(this.getPluginFn(t)!=="undefined"){let e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick: ${t} not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter(e=>typeof e=="function"&&new e().getName()===t).shift()}},aa=class{constructor(t){Y(this,"Calendar",new mc(this));Y(this,"PluginManager",new fc(this));Y(this,"calendars",[]);Y(this,"datePicked",[]);Y(this,"cssLoaded",0);Y(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});Y(this,"options",{doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]});Y(this,"ui",{container:null,shadowRoot:null,wrapper:null});Y(this,"version","1.2.1");let e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),typeof this.options.setup=="function"&&this.options.setup(this),this.on("click",this.onClick.bind(this));let r=this.options.scrollToDate?this.getDate():null;this.renderAll(r)}on(t,e,r={}){this.ui.container.addEventListener(t,e,r)}off(t,e,r={}){this.ui.container.removeEventListener(t,e,r)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),typeof this.options.documentClick=="function"&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach(t=>{this.PluginManager.removeInstance(t)}),this.ui.wrapper.remove()}onRender(t){let{view:e,date:r}=t.detail;this.Calendar.render(r,e)}onView(t){let{view:e,target:r}=t.detail;e==="Footer"&&this.datePicked.length&&(r.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){let e=new de(t.dataset.time);this.options.autoApply?(this.setDate(e),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=e,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){let e=this.datePicked[0].clone();this.setDate(e)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){let e=t.target;if(e instanceof HTMLElement){let r=e.closest(".unit");if(!(r instanceof HTMLElement))return;this.onClickHeaderButton(r),this.onClickCalendarDay(r),this.onClickApplyButton(r),this.onClickCancelButton(r)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;let e=t&&"target"in t?t.target:this.options.element,{top:r,left:i}=this.adjustPosition(e);this.ui.container.style.top=`${r}px`,this.ui.container.style.left=`${i}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){let e=new de(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof de?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){let t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",r=this.options.element;r instanceof HTMLInputElement?r.value=e:r instanceof HTMLElement&&(r.innerText=e)}hidePicker(t){let e=t.target,r=null;e.shadowRoot&&(e=t.composedPath()[0],r=e.getRootNode().host),this.isShown()&&r!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some(e=>t.classList.contains(e))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){let e=new de(t,this.options.format);e.setDate(1),this.calendars[0]=e.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new de(this.options.date,this.options.format):this.calendars[0]=new de}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach(t=>{let e=document.createElement("link");e.href=t,e.rel="stylesheet";let r=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",r),e.addEventListener("error",r),this.ui.shadowRoot.append(e)});else if(typeof this.options.css=="string"){let t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else typeof this.options.css=="function"&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){let e=t.getBoundingClientRect(),r=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");let i=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let o=e.bottom-r.bottom,a=e.left-r.left;return typeof window<"u"&&(window.innerHeight<o+i.height&&o-i.height>=0&&(o=e.top-r.top-i.height),window.innerWidth<a+i.width&&e.right-i.width>=0&&(a=e.right-r.right-i.width)),{left:a,top:o}}},ua=Object.freeze({__proto__:null,Core:aa,create:aa}),eo=class{constructor(){Y(this,"picker");Y(this,"options");Y(this,"priority",0);Y(this,"dependencies",[])}attach(t){let e=this.getName(),r={...this.options};this.options={...this.options,...t.options[e]||{}};for(let o of Object.keys(r))if(r[o]!==null&&typeof r[o]=="object"&&Object.keys(r[o]).length&&e in t.options&&o in t.options[e]){let a={...t.options[e][o]};a!==null&&typeof a=="object"&&Object.keys(a).length&&Object.keys(a).every(s=>Object.keys(r[o]).includes(s))&&(this.options[o]={...r[o],...a})}if(this.picker=t,this.dependenciesNotFound()){let o=this.dependencies.filter(a=>!this.pluginsAsStringArray().includes(a));return void console.warn(`${this.getName()}: required dependencies (${o.join(", ")}).`)}let i=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(i),this.onAttach()}detach(){let t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),typeof this.onDetach=="function"&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every(t=>this.pluginsAsStringArray().includes(t))}pluginsAsStringArray(){return this.picker.options.plugins.map(t=>typeof t=="function"?new t().getName():t)}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}},sa=class extends eo{constructor(){super(...arguments);Y(this,"priority",1);Y(this,"binds",{onView:this.onView.bind(this)});Y(this,"options",{minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null})}getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new de(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new de(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof de&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){let e=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(e)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){let e=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}: options ${e.join(", ")} required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(e){let{view:r,target:i,date:o}=e.detail;if(r==="CalendarHeader"&&(this.options.minDate instanceof de&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof de&&o.isSameOrAfter(this.options.maxDate,"month")&&i.classList.add("no-next-month")),r==="CalendarDay"){let a=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(o))return void i.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){let s=o.clone().subtract(this.options.minDays-1,"day"),u=o.clone().add(this.options.minDays-1,"day"),l=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){l=!0;break}s.add(1,"day")}for(;u.isAfter(o,"day");){if(this.testFilter(u)){h=!0;break}u.subtract(1,"day")}l&&h&&i.classList.add("not-available")}this.rangeIsNotAvailable(o,a)&&i.classList.add("not-available")}this.dateIsNotAvailable(o,a)&&i.classList.add("not-available")}if(this.options.presets&&r==="PresetPluginButton"){let a=new de(Number(i.dataset.start)),s=new de(Number(i.dataset.end)),u=s.diff(a,"day"),l=this.options.minDays&&u<this.options.minDays,h=this.options.maxDays&&u>this.options.maxDays;(l||h||this.lockMinDate(a)||this.lockMaxDate(a)||this.lockMinDate(s)||this.lockMaxDate(s)||this.rangeIsNotAvailable(a,s))&&i.setAttribute("disabled","disabled")}}dateIsNotAvailable(e,r){return this.lockMinDate(e)||this.lockMaxDate(e)||this.lockMinDays(e,r)||this.lockMaxDays(e,r)||this.lockSelectForward(e)||this.lockSelectBackward(e)}rangeIsNotAvailable(e,r){if(!e||!r)return!1;let i=(e.isSameOrBefore(r,"day")?e:r).clone(),o=(r.isSameOrAfter(e,"day")?r:e).clone();for(;i.isSameOrBefore(o,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(e){return this.options.minDate instanceof de&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof de&&e.isAfter(this.options.maxDate,"day")}lockMinDays(e,r){if(this.options.minDays&&r){let i=r.clone().subtract(this.options.minDays-1,"day"),o=r.clone().add(this.options.minDays-1,"day");return e.isBetween(i,o)}return!1}lockMaxDays(e,r){if(this.options.maxDays&&r){let i=r.clone().subtract(this.options.maxDays,"day"),o=r.clone().add(this.options.maxDays,"day");return!e.isBetween(i,o)}return!1}lockSelectForward(e){if(this.picker.datePicked.length===1&&this.options.selectForward){let r=this.picker.datePicked[0].clone();return e.isBefore(r,"day")}return!1}lockSelectBackward(e){if(this.picker.datePicked.length===1&&this.options.selectBackward){let r=this.picker.datePicked[0].clone();return e.isAfter(r,"day")}return!1}testFilter(e){return typeof this.options.filter=="function"&&this.options.filter(e,this.picker.datePicked)}};var ca=class extends eo{constructor(){super(...arguments);Y(this,"tooltipElement");Y(this,"triggerElement");Y(this,"binds",{setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)});Y(this,"options",{elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:e=>e,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)})}getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateValues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),typeof this.picker.options.documentClick=="function"&&(document.removeEventListener("click",this.picker.options.documentClick,!0),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){let[e,r]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?e&&r&&this.setDateRange(e,r):(e&&this.setStartDate(e),r&&this.setEndDate(r))}}updateValues(){let e=this.picker.options.element,r=this.options.elementEnd,i=this.picker.getStartDate(),o=this.picker.getEndDate(),a=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",s=o instanceof Date?o.format(this.picker.options.format,this.picker.options.lang):"";if(r)e instanceof HTMLInputElement?e.value=a:e instanceof HTMLElement&&(e.innerText=a),r instanceof HTMLInputElement?r.value=s:r instanceof HTMLElement&&(r.innerText=s);else{let u=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=u:e instanceof HTMLElement&&(e.innerText=u)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(e){let{target:r}=e.detail;this.triggerElement=r,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(e){let{view:r,target:i}=e.detail;if(r==="Main"&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",i.appendChild(this.tooltipElement)),r==="CalendarDay"){let o=new de(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),u=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&u&&(u.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,u)&&i.classList.add("in-range"))}if(r==="Footer"){let o=this.picker.datePicked.length===1&&!this.options.strict||this.picker.datePicked.length===2;i.querySelector(".apply-button").disabled=!o}}hidePicker(e){let r=e.target,i=null;r.shadowRoot&&(r=e.composedPath()[0],i=r.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&r!==this.picker.options.element&&r!==this.options.elementEnd&&this.picker.hide()}setStartDate(e){let r=new de(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new de(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new de(e,this.picker.options.format),o=new de(r,this.picker.options.format);this.options.startDate=i?i.clone():null,this.options.endDate=o?o.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(e){let r=e.target;if(r instanceof HTMLElement){this.isContainer(r)&&this.initializeRepick();let i=r.closest(".unit");if(!(i instanceof HTMLElement))return;if(this.picker.isCalendarDay(i)){if(this.picker.datePicked.length!==1)return;let o=this.picker.datePicked[0].clone(),a=new de(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let u=o.clone();o=a.clone(),a=u.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(u=>{let l=new de(u.dataset.time),h=this.picker.Calendar.getCalendarDayView(l);l.isBetween(o,a)&&h.classList.add("in-range"),l.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),u===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),u.className=h.className}),this.options.tooltip){let u=this.options.tooltipNumber(a.diff(o,"day")+1);if(u>0){let l=new Intl.PluralRules(this.picker.options.lang).select(u),h=`${u} ${this.options.locale[l]}`;this.showTooltip(i,h)}else this.hideTooltip()}}}}onMouseLeave(e){if(this.isContainer(e.target)&&this.options.repick){let r=this.getStartDate(),i=this.getEndDate();r&&i&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(e){if(this.picker.isCalendarDay(e)){this.picker.datePicked.length===2&&(this.picker.datePicked.length=0);let r=new de(e.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=r,this.picker.datePicked.length===2&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){let i=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=i.clone()}this.picker.datePicked.length!==1&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),this.picker.datePicked.length===1&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),this.picker.datePicked.length===2&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(e){this.picker.isApplyButton(e)&&(this.picker.datePicked.length!==1||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),this.picker.datePicked.length===2&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(e,r){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=r;let i=this.picker.ui.container.getBoundingClientRect(),o=this.tooltipElement.getBoundingClientRect(),a=e.getBoundingClientRect(),s=a.top,u=a.left;s-=i.top,u-=i.left,s-=o.height,u-=o.width/2,u+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${u}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;let e=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],r=Object.keys(this.options.locale);e.every(i=>r.includes(i))||console.warn(`${this.getName()}: provide locales (${e.join(", ")}) for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;let e=this.getStartDate(),r=this.getEndDate();r&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=r),e&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=e)}isContainer(e){return e===this.picker.ui.container}};var la=class extends eo{constructor(){super(...arguments);Y(this,"rangePlugin");Y(this,"lockPlugin");Y(this,"priority",10);Y(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});Y(this,"options",{dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}});Y(this,"matchMedia")}getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(e){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(e),this.handleResetButton(e),this.handleWeekNumbers(e)}onColorScheme(e){let r=e.matches?"dark":"light";this.picker.ui.container.dataset.theme=r}handleDropdown(e){let{view:r,target:i,date:o,index:a}=e.detail;if(r==="CalendarHeader"){let s=i.querySelector(".month-name");if(this.options.dropdown.months){s.childNodes[0].remove();let u=document.createElement("select");u.className="month-name--select month-name--dropdown";for(let l=0;l<12;l+=1){let h=document.createElement("option"),f=new de(new Date(o.getFullYear(),l,2,0,0,0)),g=new de(new Date(o.getFullYear(),l,1,0,0,0));h.value=String(l),h.text=f.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&g.isBefore(new de(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&g.isAfter(new de(this.lockPlugin.options.maxDate),"month")),h.selected=g.getMonth()===o.getMonth(),u.appendChild(h)}u.addEventListener("change",l=>{let h=l.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(u)}if(this.options.dropdown.years){s.childNodes[1].remove();let u=document.createElement("select");u.className="month-name--select";let l=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,u.appendChild(f)}for(let f=h;f>=l;f-=1){let g=document.createElement("option"),E=new de(new Date(f,0,1,0,0,0));g.value=String(f),g.text=String(f),this.lockPlugin&&(g.disabled=this.lockPlugin.options.minDate&&E.isBefore(new de(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&E.isAfter(new de(this.lockPlugin.options.maxDate),"year")),g.selected=o.getFullYear()===f,u.appendChild(g)}if(o.getFullYear()<l){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,u.appendChild(f)}if(this.options.dropdown.years==="asc"){let f=Array.prototype.slice.call(u.childNodes).reverse();u.innerHTML="",f.forEach(g=>{g.innerHTML=g.value,u.appendChild(g)})}u.addEventListener("change",f=>{let g=f.target;this.picker.calendars[0].setFullYear(Number(g.value)),this.picker.renderAll()}),s.appendChild(u)}}}handleResetButton(e){let{view:r,target:i}=e.detail;if(r==="CalendarHeader"&&this.options.resetButton){let o=document.createElement("button");o.className="reset-button unit",o.innerHTML=this.options.locale.resetButton,o.addEventListener("click",a=>{a.preventDefault();let s=!0;typeof this.options.resetButton=="function"&&(s=this.options.resetButton.call(this)),s&&this.picker.clear()}),i.appendChild(o)}}handleWeekNumbers(e){if(this.options.weekNumbers){let{view:r,target:i}=e.detail;if(r==="CalendarDayNames"){let o=document.createElement("div");o.className="wnum-header",o.innerHTML="Wk",i.prepend(o)}r==="CalendarDays"&&[...i.children].forEach((o,a)=>{if(a===0||a%7==0){let s;if(o.classList.contains("day"))s=new de(o.dataset.time);else{let h=i.querySelector(".day");s=new de(h.dataset.time)}let u=s.getWeek(this.picker.options.firstDay);u===53&&s.getMonth()===0&&(u="53/1");let l=document.createElement("div");l.className="wnum-item",l.innerHTML=String(u),i.insertBefore(l,o)}})}}};var da=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],qn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var ha={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},ma=ha;var it=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},At=function(n){return n===!0?1:0};function pc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var fa=function(n){return n instanceof Array?n:[n]};function ot(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Ee(n,t,e){var r=window.document.createElement(n);return t=t||"",e=e||"",r.className=t,e!==void 0&&(r.textContent=e),r}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function gc(n,t){if(t(n))return n;if(n.parentNode)return gc(n.parentNode,t)}function no(n,t){var e=Ee("div","numInputWrapper"),r=Ee("input","numInput "+n),i=Ee("span","arrowUp"),o=Ee("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return e.appendChild(r),e.appendChild(i),e.appendChild(o),e}function Lt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var yc=function(){},ro=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},nd={D:yc,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*At(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var r=parseInt(t),i=new Date(n.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+e.firstDayOfWeek),i},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:yc,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},u:function(n,t){return new Date(parseFloat(t))},w:yc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},xn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Vr={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[Vr.w(n,t,e)]},F:function(n,t,e){return ro(Vr.n(n,t,e)-1,!1,t)},G:function(n,t,e){return it(Vr.h(n,t,e))},H:function(n){return it(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[At(n.getHours()>11)]},M:function(n,t){return ro(n.getMonth(),!0,t)},S:function(n){return it(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return it(n.getFullYear(),4)},d:function(n){return it(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return it(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return it(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}};var vc=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ha:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,u,l){var h=l||i;return e.formatDate!==void 0&&!a?e.formatDate(s,u,h):u.split("").map(function(f,g,E){return Vr[f]&&E[g-1]!=="\\"?Vr[f](s,h,e):f!=="\\"?f:""}).join("")}},pa=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ha:r;return function(o,a,s,u){if(!(o!==0&&!o)){var l=u||i,h,f=o;if(o instanceof Date)h=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)h=new Date(o);else if(typeof o=="string"){var g=a||(e||qn).dateFormat,E=String(o).trim();if(E==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,g);else if(/Z$/.test(E)||/GMT$/.test(E))h=new Date(o);else{for(var S=void 0,k=[],A=0,B=0,V="";A<g.length;A++){var G=g[A],U=G==="\\",J=g[A-1]==="\\"||U;if(xn[G]&&!J){V+=xn[G];var oe=new RegExp(V).exec(o);oe&&(S=!0)&&k[G!=="Y"?"push":"unshift"]({fn:nd[G],val:oe[++B]})}else U||(V+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),k.forEach(function(ke){var Me=ke.fn,ie=ke.val;return h=Me(h,ie,l)||h}),h=S?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+f));return}return s===!0&&h.setHours(0,0,0,0),h}}};function Nt(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var rd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ga=function(n,t,e){return n*3600+t*60+e},id=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},od={DAY:864e5};function ya(n){var t=n.defaultHour,e=n.defaultMinute,r=n.defaultSeconds;if(n.minDate!==void 0){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();t<i&&(t=i),t===i&&e<o&&(e=o),t===i&&e===o&&r<a&&(r=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),u=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(u,e)),t===s&&e===u&&(r=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(u){return n[u]=s[u]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var at=function(){return at=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},at.apply(this,arguments)},ad=function(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;for(var r=Array(n),i=0,t=0;t<e;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},fm=300;function pm(n,t){var e={config:at(at({},qn),ze.defaultConfig),l10n:ma};e.parseDate=pa({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=k,e._setHoursFromDate=g,e._positionCalendar=Pn,e.changeMonth=_,e.changeYear=ee,e.clear=I,e.close=C,e.onMouseOver=pe,e._createElement=Ee,e.createDay=oe,e.destroy=F,e.isEnabled=q,e.jumpToDate=V,e.updateValue=fn,e.open=Re,e.redraw=ao,e.set=ud,e.setDate=dd,e.toggle=pd;function r(){e.utils={getDaysInMonth:function(p,w){return p===void 0&&(p=e.currentMonth),w===void 0&&(w=e.currentYear),p===1&&(w%4===0&&w%100!==0||w%400===0)?29:e.l10n.daysInMonth[p]}}}function i(){e.element=e.input=n,e.isOpen=!1,et(),Wn(),md(),hd(),r(),e.isMobile||J(),B(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&g(e.config.noCalendar?e.latestSelectedDateObj:void 0),fn(!1)),s();var p=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&p&&Pn(),Ne("onReady")}function o(){var p;return((p=e.calendarContainer)===null||p===void 0?void 0:p.getRootNode()).activeElement||document.activeElement}function a(p){return p.bind(e)}function s(){var p=e.config;p.weekNumbers===!1&&p.showMonths===1||p.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var w=(e.days.offsetWidth+1)*p.showMonths;e.daysContainer.style.width=w+"px",e.calendarContainer.style.width=w+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function u(p){if(e.selectedDates.length===0){var w=e.config.minDate===void 0||Nt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=ya(e.config);w.setHours(M.hours,M.minutes,M.seconds,w.getMilliseconds()),e.selectedDates=[w],e.latestSelectedDateObj=w}p!==void 0&&p.type!=="blur"&&vd(p);var P=e._input.value;f(),fn(),e._input.value!==P&&e._debouncedChange()}function l(p,w){return p%12+12*At(w===e.l10n.amPM[1])}function h(p){switch(p%24){case 0:case 12:return 12;default:return p%12}}function f(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var p=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,w=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(p=l(p,e.amPM.textContent));var P=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var K=ga(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),he=ga(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Q=ga(p,w,M);if(Q>he&&Q<K){var ge=id(K);p=ge[0],w=ge[1],M=ge[2]}}else{if(z){var X=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;p=Math.min(p,X.getHours()),p===X.getHours()&&(w=Math.min(w,X.getMinutes())),w===X.getMinutes()&&(M=Math.min(M,X.getSeconds()))}if(P){var ae=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;p=Math.max(p,ae.getHours()),p===ae.getHours()&&w<ae.getMinutes()&&(w=ae.getMinutes()),w===ae.getMinutes()&&(M=Math.max(M,ae.getSeconds()))}}E(p,w,M)}}function g(p){var w=p||e.latestSelectedDateObj;w&&w instanceof Date&&E(w.getHours(),w.getMinutes(),w.getSeconds())}function E(p,w,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(p%24,w,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=it(e.config.time_24hr?p:(12+p)%12+12*At(p%12===0)),e.minuteElement.value=it(w),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[At(p>=12)]),e.secondElement!==void 0&&(e.secondElement.value=it(M)))}function S(p){var w=Lt(p),M=parseInt(w.value)+(p.delta||0);(M/1e3>1||p.key==="Enter"&&!/[^\d]/.test(M.toString()))&&ee(M)}function k(p,w,M,P){if(w instanceof Array)return w.forEach(function(z){return k(p,z,M,P)});if(p instanceof Array)return p.forEach(function(z){return k(z,w,M,P)});p.addEventListener(w,M,P),e._handlers.push({remove:function(){return p.removeEventListener(w,M,P)}})}function A(){Ne("onChange")}function B(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(P){return k(P,"click",e[M])})}),e.isMobile){fd();return}var p=pc(be,50);if(e._debouncedChange=pc(A,fm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&k(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&pe(Lt(M))}),k(e._input,"keydown",le),e.calendarContainer!==void 0&&k(e.calendarContainer,"keydown",le),!e.config.inline&&!e.config.static&&k(window,"resize",p),window.ontouchstart!==void 0?k(window.document,"touchstart",W):k(window.document,"mousedown",W),k(window.document,"focus",W,{capture:!0}),e.config.clickOpens===!0&&(k(e._input,"focus",e.open),k(e._input,"click",e.open)),e.daysContainer!==void 0&&(k(e.monthNav,"click",yd),k(e.monthNav,["keyup","increment"],S),k(e.daysContainer,"click",wc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var w=function(M){return Lt(M).select()};k(e.timeContainer,["increment"],u),k(e.timeContainer,"blur",u,{capture:!0}),k(e.timeContainer,"click",G),k([e.hourElement,e.minuteElement],["focus","click"],w),e.secondElement!==void 0&&k(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&k(e.amPM,"click",function(M){u(M)})}e.config.allowInput&&k(e._input,"blur",re)}function V(p,w){var M=p!==void 0?e.parseDate(p):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),P=e.currentYear,z=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(K){K.message="Invalid date supplied: "+M,e.config.errorHandler(K)}w&&e.currentYear!==P&&(Ne("onYearChange"),ne()),w&&(e.currentYear!==P||e.currentMonth!==z)&&Ne("onMonthChange"),e.redraw()}function G(p){var w=Lt(p);~w.className.indexOf("arrow")&&U(p,w.classList.contains("arrowUp")?1:-1)}function U(p,w,M){var P=p&&Lt(p),z=M||P&&P.parentNode&&P.parentNode.firstChild,K=ba("increment");K.delta=w,z&&z.dispatchEvent(K)}function J(){var p=window.document.createDocumentFragment();if(e.calendarContainer=Ee("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(p.appendChild(c()),e.innerContainer=Ee("div","flatpickr-innerContainer"),e.config.weekNumbers){var w=b(),M=w.weekWrapper,P=w.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=P,e.weekWrapper=M}e.rContainer=Ee("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Ee("div","flatpickr-days"),e.daysContainer.tabIndex=-1),O(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),p.appendChild(e.innerContainer)}e.config.enableTime&&p.appendChild(d()),ot(e.calendarContainer,"rangeMode",e.config.mode==="range"),ot(e.calendarContainer,"animate",e.config.animate===!0),ot(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(p);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var K=Ee("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(K,e.element),K.appendChild(e.element),e.altInput&&K.appendChild(e.altInput),K.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function oe(p,w,M,P){var z=q(w,!0),K=Ee("span",p,w.getDate().toString());return K.dateObj=w,K.$i=P,K.setAttribute("aria-label",e.formatDate(w,e.config.ariaDateFormat)),p.indexOf("hidden")===-1&&Nt(w,e.now)===0&&(e.todayDateElem=K,K.classList.add("today"),K.setAttribute("aria-current","date")),z?(K.tabIndex=-1,Da(w)&&(K.classList.add("selected"),e.selectedDateElem=K,e.config.mode==="range"&&(ot(K,"startRange",e.selectedDates[0]&&Nt(w,e.selectedDates[0],!0)===0),ot(K,"endRange",e.selectedDates[1]&&Nt(w,e.selectedDates[1],!0)===0),p==="nextMonthDay"&&K.classList.add("inRange")))):K.classList.add("flatpickr-disabled"),e.config.mode==="range"&&gd(w)&&!Da(w)&&K.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&p!=="prevMonthDay"&&P%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(w)+"</span>"),Ne("onDayCreate",K),K}function ke(p){p.focus(),e.config.mode==="range"&&pe(p)}function Me(p){for(var w=p>0?0:e.config.showMonths-1,M=p>0?e.config.showMonths:-1,P=w;P!=M;P+=p)for(var z=e.daysContainer.children[P],K=p>0?0:z.children.length-1,he=p>0?z.children.length:-1,Q=K;Q!=he;Q+=p){var ge=z.children[Q];if(ge.className.indexOf("hidden")===-1&&q(ge.dateObj))return ge}}function ie(p,w){for(var M=p.className.indexOf("Month")===-1?p.dateObj.getMonth():e.currentMonth,P=w>0?e.config.showMonths:-1,z=w>0?1:-1,K=M-e.currentMonth;K!=P;K+=z)for(var he=e.daysContainer.children[K],Q=M-e.currentMonth===K?p.$i+w:w<0?he.children.length-1:0,ge=he.children.length,X=Q;X>=0&&X<ge&&X!=(w>0?ge:-1);X+=z){var ae=he.children[X];if(ae.className.indexOf("hidden")===-1&&q(ae.dateObj)&&Math.abs(p.$i-X)>=Math.abs(w))return ke(ae)}e.changeMonth(z),N(Me(z),0)}function N(p,w){var M=o(),P=j(M||document.body),z=p!==void 0?p:P?M:e.selectedDateElem!==void 0&&j(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&j(e.todayDateElem)?e.todayDateElem:Me(w>0?1:-1);z===void 0?e._input.focus():P?ie(z,w):ke(z)}function H(p,w){for(var M=(new Date(p,w,1).getDay()-e.l10n.firstDayOfWeek+7)%7,P=e.utils.getDaysInMonth((w-1+12)%12,p),z=e.utils.getDaysInMonth(w,p),K=window.document.createDocumentFragment(),he=e.config.showMonths>1,Q=he?"prevMonthDay hidden":"prevMonthDay",ge=he?"nextMonthDay hidden":"nextMonthDay",X=P+1-M,ae=0;X<=P;X++,ae++)K.appendChild(oe("flatpickr-day "+Q,new Date(p,w-1,X),X,ae));for(X=1;X<=z;X++,ae++)K.appendChild(oe("flatpickr-day",new Date(p,w,X),X,ae));for(var Te=z+1;Te<=42-M&&(e.config.showMonths===1||ae%7!==0);Te++,ae++)K.appendChild(oe("flatpickr-day "+ge,new Date(p,w+1,Te%z),Te,ae));var rn=Ee("div","dayContainer");return rn.appendChild(K),rn}function O(){if(e.daysContainer!==void 0){to(e.daysContainer),e.weekNumbers&&to(e.weekNumbers);for(var p=document.createDocumentFragment(),w=0;w<e.config.showMonths;w++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),p.appendChild(H(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(p),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&pe()}}function ne(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var p=function(P){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&P<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&P>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var w=0;w<12;w++)if(p(w)){var M=Ee("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,w).getMonth().toString(),M.textContent=ro(w,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===w&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function y(){var p=Ee("div","flatpickr-month"),w=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Ee("span","cur-month"):(e.monthsDropdownContainer=Ee("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),k(e.monthsDropdownContainer,"change",function(he){var Q=Lt(he),ge=parseInt(Q.value,10);e.changeMonth(ge-e.currentMonth),Ne("onMonthChange")}),ne(),M=e.monthsDropdownContainer);var P=no("cur-year",{tabindex:"-1"}),z=P.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var K=Ee("div","flatpickr-current-month");return K.appendChild(M),K.appendChild(P),w.appendChild(K),p.appendChild(w),{container:p,yearElement:z,monthElement:M}}function L(){to(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var p=e.config.showMonths;p--;){var w=y();e.yearElements.push(w.yearElement),e.monthElements.push(w.monthElement),e.monthNav.appendChild(w.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=Ee("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Ee("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Ee("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,L(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(p){e.__hidePrevMonthArrow!==p&&(ot(e.prevMonthNav,"flatpickr-disabled",p),e.__hidePrevMonthArrow=p)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(p){e.__hideNextMonthArrow!==p&&(ot(e.nextMonthNav,"flatpickr-disabled",p),e.__hideNextMonthArrow=p)}}),e.currentYearElement=e.yearElements[0],co(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var p=ya(e.config);e.timeContainer=Ee("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var w=Ee("span","flatpickr-time-separator",":"),M=no("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var P=no("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=P.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=it(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?p.hours:h(p.hours)),e.minuteElement.value=it(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():p.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(M),e.timeContainer.appendChild(w),e.timeContainer.appendChild(P),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=no("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=it(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():p.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Ee("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=Ee("span","flatpickr-am-pm",e.l10n.amPM[At((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function v(){e.weekdayContainer?to(e.weekdayContainer):e.weekdayContainer=Ee("div","flatpickr-weekdays");for(var p=e.config.showMonths;p--;){var w=Ee("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(w)}return D(),e.weekdayContainer}function D(){if(e.weekdayContainer){var p=e.l10n.firstDayOfWeek,w=ad(e.l10n.weekdays.shorthand);p>0&&p<w.length&&(w=ad(w.splice(p,w.length),w.splice(0,p)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
4
4
  <span class='flatpickr-weekday'>
5
5
  `+w.join("</span><span class='flatpickr-weekday'>")+`
6
6
  </span>
7
- `}}function b(){e.calendarContainer.classList.add("hasWeeks");var p=De("div","flatpickr-weekwrapper");p.appendChild(De("span","flatpickr-weekday",e.l10n.weekAbbreviation));var w=De("div","flatpickr-weeks");return p.appendChild(w),{weekWrapper:p,weekNumbers:w}}function _(p,w){w===void 0&&(w=!0);var M=w?p:p-e.currentMonth;M<0&&e._hidePrevMonthArrow===!0||M>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=M,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Ne("onYearChange"),ne()),O(),Ne("onMonthChange"),lo())}function I(p,w){if(p===void 0&&(p=!0),w===void 0&&(w=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,w===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=va(e.config),P=M.hours,z=M.minutes,K=M.seconds;E(P,z,K)}e.redraw(),p&&Ne("onChange")}function C(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Ne("onClose")}function F(){e.config!==void 0&&Ne("onDestroy");for(var p=e._handlers.length;p--;)e._handlers[p].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var w=e.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(M){try{delete e[M]}catch{}})}function R(p){return e.calendarContainer.contains(p)}function W(p){if(e.isOpen&&!e.config.inline){var w=Lt(p),M=R(w),P=w===e.input||w===e.altInput||e.element.contains(w)||p.path&&p.path.indexOf&&(~p.path.indexOf(e.input)||~p.path.indexOf(e.altInput)),z=!P&&!M&&!R(p.relatedTarget),K=!e.config.ignoredFocusElements.some(function(he){return he.contains(w)});z&&K&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ee(p){if(!(!p||e.config.minDate&&p<e.config.minDate.getFullYear()||e.config.maxDate&&p>e.config.maxDate.getFullYear())){var w=p,M=e.currentYear!==w;e.currentYear=w||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),M&&(e.redraw(),Ne("onYearChange"),ne())}}function q(p,w){var M;w===void 0&&(w=!0);var P=e.parseDate(p,void 0,w);if(e.config.minDate&&P&&Nt(P,e.config.minDate,w!==void 0?w:!e.minDateHasTime)<0||e.config.maxDate&&P&&Nt(P,e.config.maxDate,w!==void 0?w:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(P===void 0)return!1;for(var z=!!e.config.enable,K=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,he=0,Q=void 0;he<K.length;he++){if(Q=K[he],typeof Q=="function"&&Q(P))return z;if(Q instanceof Date&&P!==void 0&&Q.getTime()===P.getTime())return z;if(typeof Q=="string"){var ge=e.parseDate(Q,void 0,!0);return ge&&ge.getTime()===P.getTime()?z:!z}else if(typeof Q=="object"&&P!==void 0&&Q.from&&Q.to&&P.getTime()>=Q.from.getTime()&&P.getTime()<=Q.to.getTime())return z}return!z}function j(p){return e.daysContainer!==void 0?p.className.indexOf("hidden")===-1&&p.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(p):!1}function re(p){var w=p.target===e._input,M=e._input.value.trimEnd()!==_a();w&&M&&!(p.relatedTarget&&R(p.relatedTarget))&&e.setDate(e._input.value,!0,p.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function le(p){var w=Lt(p),M=e.config.wrap?n.contains(w):w===e._input,P=e.config.allowInput,z=e.isOpen&&(!P||!M),K=e.config.inline&&M&&!P;if(p.keyCode===13&&M){if(P)return e.setDate(e._input.value,!0,w===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),w.blur();e.open()}else if(R(w)||z||K){var he=!!e.timeContainer&&e.timeContainer.contains(w);switch(p.keyCode){case 13:he?(p.preventDefault(),u(),ba()):bc(p);break;case 27:p.preventDefault(),ba();break;case 8:case 46:M&&!e.config.allowInput&&(p.preventDefault(),e.clear());break;case 37:case 39:if(!he&&!M){p.preventDefault();var Q=o();if(e.daysContainer!==void 0&&(P===!1||Q&&j(Q))){var ge=p.keyCode===39?1:-1;p.ctrlKey?(p.stopPropagation(),_(ge),N(Me(1),0)):N(void 0,ge)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:p.preventDefault();var X=p.keyCode===40?1:-1;e.daysContainer&&w.$i!==void 0||w===e.input||w===e.altInput?p.ctrlKey?(p.stopPropagation(),ee(e.currentYear-X),N(Me(1),0)):he||N(void 0,X*7):w===e.currentYearElement?ee(e.currentYear-X):e.config.enableTime&&(!he&&e.hourElement&&e.hourElement.focus(),u(p),e._debouncedChange());break;case 9:if(he){var ae=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ot){return Ot}),Te=ae.indexOf(w);if(Te!==-1){var rn=ae[Te+(p.shiftKey?-1:1)];p.preventDefault(),(rn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(w)&&p.shiftKey&&(p.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&w===e.amPM)switch(p.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],f(),fn();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],f(),fn();break}(M||R(w))&&Ne("onKeyDown",p)}function pe(p,w){if(w===void 0&&(w="flatpickr-day"),!(e.selectedDates.length!==1||p&&(!p.classList.contains(w)||p.classList.contains("flatpickr-disabled")))){for(var M=p?p.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),P=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),z=Math.min(M,e.selectedDates[0].getTime()),K=Math.max(M,e.selectedDates[0].getTime()),he=!1,Q=0,ge=0,X=z;X<K;X+=od.DAY)q(new Date(X),!0)||(he=he||X>z&&X<K,X<P&&(!Q||X>Q)?Q=X:X>P&&(!ge||X<ge)&&(ge=X));var ae=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+w));ae.forEach(function(Te){var rn=Te.dateObj,Ot=rn.getTime(),Wr=Q>0&&Ot<Q||ge>0&&Ot>ge;if(Wr){Te.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fr){Te.classList.remove(fr)});return}else if(he&&!Wr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fr){Te.classList.remove(fr)}),p!==void 0&&(p.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),P<M&&Ot===P?Te.classList.add("startRange"):P>M&&Ot===P&&Te.classList.add("endRange"),Ot>=Q&&(ge===0||Ot<=ge)&&rd(Ot,P,M)&&Te.classList.add("inRange"))})}}function we(){e.isOpen&&!e.config.static&&!e.config.inline&&Rn()}function Re(p,w){if(w===void 0&&(w=e._positionElement),e.isMobile===!0){if(p){p.preventDefault();var M=Lt(p);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;var P=e.isOpen;e.isOpen=!0,P||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Ne("onOpen"),Rn(w)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(p===void 0||!e.timeContainer.contains(p.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function je(p){return function(w){var M=e.config["_"+p+"Date"]=e.parseDate(w,e.config.dateFormat),P=e.config["_"+(p==="min"?"max":"min")+"Date"];M!==void 0&&(e[p==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(z){return q(z)}),!e.selectedDates.length&&p==="min"&&g(M),fn()),e.daysContainer&&(so(),M!==void 0?e.currentYearElement[p]=M.getFullYear().toString():e.currentYearElement.removeAttribute(p),e.currentYearElement.disabled=!!P&&M!==void 0&&P.getFullYear()===M.getFullYear())}}function Xe(){var p=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],w=it(it({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=w.parseDate,e.config.formatDate=w.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ae){e.config._enable=Ec(ae)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ae){e.config._disable=Ec(ae)}});var P=w.mode==="time";if(!w.dateFormat&&(w.enableTime||P)){var z=ze.defaultConfig.dateFormat||Kn.dateFormat;M.dateFormat=w.noCalendar||P?"H:i"+(w.enableSeconds?":S":""):z+" H:i"+(w.enableSeconds?":S":"")}if(w.altInput&&(w.enableTime||P)&&!w.altFormat){var K=ze.defaultConfig.altFormat||Kn.altFormat;M.altFormat=w.noCalendar||P?"h:i"+(w.enableSeconds?":S K":" K"):K+(" h:i"+(w.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:je("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:je("max")});var he=function(ae){return function(Te){e.config[ae==="min"?"_minTime":"_maxTime"]=e.parseDate(Te,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:he("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:he("max")}),w.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,w);for(var Q=0;Q<p.length;Q++)e.config[p[Q]]=e.config[p[Q]]===!0||e.config[p[Q]]==="true";ha.filter(function(ae){return e.config[ae]!==void 0}).forEach(function(ae){e.config[ae]=pa(e.config[ae]||[]).map(a)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Q=0;Q<e.config.plugins.length;Q++){var ge=e.config.plugins[Q](e)||{};for(var X in ge)ha.indexOf(X)>-1?e.config[X]=pa(ge[X]).map(a).concat(e.config[X]):typeof w[X]>"u"&&(e.config[X]=ge[X])}w.altInputClass||(e.config.altInputClass=Vt().className+" "+e.config.altInputClass),Ne("onParseConfig")}function Vt(){return e.config.wrap?n.querySelector("[data-input]"):n}function Gn(){typeof e.config.locale!="object"&&typeof ze.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=it(it({},ze.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?ze.l10ns[e.config.locale]:void 0),Pn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Pn.l="("+e.l10n.weekdays.longhand.join("|")+")",Pn.M="("+e.l10n.months.shorthand.join("|")+")",Pn.F="("+e.l10n.months.longhand.join("|")+")",Pn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var p=it(it({},t),JSON.parse(JSON.stringify(n.dataset||{})));p.time_24hr===void 0&&ze.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=wc(e),e.parseDate=ga({config:e.config,l10n:e.l10n})}function Rn(p){if(typeof e.config.position=="function")return void e.config.position(e,p);if(e.calendarContainer!==void 0){Ne("onPreCalendarPosition");var w=p||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(kd,Td){return kd+Td.offsetHeight},0),P=e.calendarContainer.offsetWidth,z=e.config.position.split(" "),K=z[0],he=z.length>1?z[1]:null,Q=w.getBoundingClientRect(),ge=window.innerHeight-Q.bottom,X=K==="above"||K!=="below"&&ge<M&&Q.top>M,ae=window.pageYOffset+Q.top+(X?-M-2:w.offsetHeight+2);if(rt(e.calendarContainer,"arrowTop",!X),rt(e.calendarContainer,"arrowBottom",X),!e.config.inline){var Te=window.pageXOffset+Q.left,rn=!1,Ot=!1;he==="center"?(Te-=(P-Q.width)/2,rn=!0):he==="right"&&(Te-=P-Q.width,Ot=!0),rt(e.calendarContainer,"arrowLeft",!rn&&!Ot),rt(e.calendarContainer,"arrowCenter",rn),rt(e.calendarContainer,"arrowRight",Ot);var Wr=window.document.body.offsetWidth-(window.pageXOffset+Q.right),fr=Te+P>window.document.body.offsetWidth,wd=Wr+P>window.document.body.offsetWidth;if(rt(e.calendarContainer,"rightMost",fr),!e.config.static)if(e.calendarContainer.style.top=ae+"px",!fr)e.calendarContainer.style.left=Te+"px",e.calendarContainer.style.right="auto";else if(!wd)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Wr+"px";else{var Ma=qr();if(Ma===void 0)return;var bd=window.document.body.offsetWidth,Dd=Math.max(0,bd/2-P/2),Ed=".flatpickr-calendar.centerMost:before",_d=".flatpickr-calendar.centerMost:after",Md=Ma.cssRules.length,Sd="{left:"+Q.left+"px;right:auto;}";rt(e.calendarContainer,"rightMost",!1),rt(e.calendarContainer,"centerMost",!0),Ma.insertRule(Ed+","+_d+Sd,Md),e.calendarContainer.style.left=Dd+"px",e.calendarContainer.style.right="auto"}}}}function qr(){for(var p=null,w=0;w<document.styleSheets.length;w++){var M=document.styleSheets[w];if(M.cssRules){try{M.cssRules}catch{continue}p=M;break}}return p??ao()}function ao(){var p=document.createElement("style");return document.head.appendChild(p),p.sheet}function so(){e.config.noCalendar||e.isMobile||(ne(),lo(),O())}function ba(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function bc(p){p.preventDefault(),p.stopPropagation();var w=function(ae){return ae.classList&&ae.classList.contains("flatpickr-day")&&!ae.classList.contains("flatpickr-disabled")&&!ae.classList.contains("notAllowed")},M=yc(Lt(p),w);if(M!==void 0){var P=M,z=e.latestSelectedDateObj=new Date(P.dateObj.getTime()),K=(z.getMonth()<e.currentMonth||z.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=P,e.config.mode==="single")e.selectedDates=[z];else if(e.config.mode==="multiple"){var he=Ea(z);he?e.selectedDates.splice(parseInt(he),1):e.selectedDates.push(z)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=z,e.selectedDates.push(z),Nt(z,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(ae,Te){return ae.getTime()-Te.getTime()}));if(f(),K){var Q=e.currentYear!==z.getFullYear();e.currentYear=z.getFullYear(),e.currentMonth=z.getMonth(),Q&&(Ne("onYearChange"),ne()),Ne("onMonthChange")}if(lo(),O(),fn(),!K&&e.config.mode!=="range"&&e.config.showMonths===1?ke(P):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var ge=e.config.mode==="single"&&!e.config.enableTime,X=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(ge||X)&&ba()}A()}}var co={locale:[Gn,D],showMonths:[L,s,v],minDate:[V],maxDate:[V],positionElement:[_c],clickOpens:[function(){e.config.clickOpens===!0?(k(e._input,"focus",e.open),k(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function ud(p,w){if(p!==null&&typeof p=="object"){Object.assign(e.config,p);for(var M in p)co[M]!==void 0&&co[M].forEach(function(P){return P()})}else e.config[p]=w,co[p]!==void 0?co[p].forEach(function(P){return P()}):ha.indexOf(p)>-1&&(e.config[p]=pa(w));e.redraw(),fn(!0)}function Dc(p,w){var M=[];if(p instanceof Array)M=p.map(function(P){return e.parseDate(P,w)});else if(p instanceof Date||typeof p=="number")M=[e.parseDate(p,w)];else if(typeof p=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(p,w)];break;case"multiple":M=p.split(e.config.conjunction).map(function(P){return e.parseDate(P,w)});break;case"range":M=p.split(e.l10n.rangeSeparator).map(function(P){return e.parseDate(P,w)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(p)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(P){return P instanceof Date&&q(P,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(P,z){return P.getTime()-z.getTime()})}function dd(p,w,M){if(w===void 0&&(w=!1),M===void 0&&(M=e.config.dateFormat),p!==0&&!p||p instanceof Array&&p.length===0)return e.clear(w);Dc(p,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),V(void 0,w),g(),e.selectedDates.length===0&&e.clear(!1),fn(w),w&&Ne("onChange")}function Ec(p){return p.slice().map(function(w){return typeof w=="string"||typeof w=="number"||w instanceof Date?e.parseDate(w,void 0,!0):w&&typeof w=="object"&&w.from&&w.to?{from:e.parseDate(w.from,void 0),to:e.parseDate(w.to,void 0)}:w}).filter(function(w){return w})}function hd(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var p=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);p&&Dc(p,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function md(){if(e.input=Vt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=De(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),_c()}function _c(){e._positionElement=e.config.positionElement||e._input}function fd(){var p=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=De("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=p,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=p==="datetime-local"?"Y-m-d\\TH:i:S":p==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}k(e.mobileInput,"change",function(w){e.setDate(Lt(w).value,!1,e.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function pd(p){if(e.isOpen===!0)return e.close();e.open(p)}function Ne(p,w){if(e.config!==void 0){var M=e.config[p];if(M!==void 0&&M.length>0)for(var P=0;M[P]&&P<M.length;P++)M[P](e.selectedDates,e.input.value,e,w);p==="onChange"&&(e.input.dispatchEvent(Da("change")),e.input.dispatchEvent(Da("input")))}}function Da(p){var w=document.createEvent("Event");return w.initEvent(p,!0,!0),w}function Ea(p){for(var w=0;w<e.selectedDates.length;w++){var M=e.selectedDates[w];if(M instanceof Date&&Nt(M,p)===0)return""+w}return!1}function gd(p){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Nt(p,e.selectedDates[0])>=0&&Nt(p,e.selectedDates[1])<=0}function lo(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(p,w){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[w].textContent=io(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),p.value=M.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function _a(p){var w=p||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,w)}).filter(function(M,P,z){return e.config.mode!=="range"||e.config.enableTime||z.indexOf(M)===P}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function fn(p){p===void 0&&(p=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=_a(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=_a(e.config.altFormat)),p!==!1&&Ne("onValueUpdate")}function yd(p){var w=Lt(p),M=e.prevMonthNav.contains(w),P=e.nextMonthNav.contains(w);M||P?_(M?-1:1):e.yearElements.indexOf(w)>=0?w.select():w.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):w.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function vd(p){p.preventDefault();var w=p.type==="keydown",M=Lt(p),P=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]);var z=parseFloat(P.getAttribute("min")),K=parseFloat(P.getAttribute("max")),he=parseFloat(P.getAttribute("step")),Q=parseInt(P.value,10),ge=p.delta||(w?p.which===38?1:-1:0),X=Q+he*ge;if(typeof P.value<"u"&&P.value.length===2){var ae=P===e.hourElement,Te=P===e.minuteElement;X<z?(X=K+X+At(!ae)+(At(ae)&&At(!e.amPM)),Te&&U(void 0,-1,e.hourElement)):X>K&&(X=P===e.hourElement?X-K-At(!e.amPM):z,Te&&U(void 0,1,e.hourElement)),e.amPM&&ae&&(he===1?X+Q===23:Math.abs(X-Q)>he)&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]),P.value=nt(X)}}return i(),e}function Vr(n,t){for(var e=Array.prototype.slice.call(n).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<e.length;i++){var o=e[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=pm(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Vr(this,n)},HTMLElement.prototype.flatpickr=function(n){return Vr([this],n)});var ze=function(n,t){return typeof n=="string"?Vr(window.document.querySelectorAll(n),t):n instanceof Node?Vr([n],t):Vr(n,t)};ze.defaultConfig={};ze.l10ns={en:it({},fa),default:it({},fa)};ze.localize=function(n){ze.l10ns.default=it(it({},ze.l10ns.default),n)};ze.setDefaults=function(n){ze.defaultConfig=it(it({},ze.defaultConfig),n)};ze.parseDate=ga({});ze.formatDate=wc({});ze.compareDates=Nt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Vr(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=ze);var sd=ze;var oo=class{constructor(t,e){this.dateInputEl=t;H(this,"minDate");H(this,"maxDate");H(this,"defaultReservationDays");H(this,"hasPrices",!1);H(this,"prices",{});H(this,"availability",{});H(this,"disabledDates",[]);H(this,"selectedStartDate");H(this,"selectedEndDate");H(this,"config");H(this,"instance");H(this,"destroyInstance");H(this,"currentDate");H(this,"handleResize",()=>{let t=this.isMobileDevice();(t&&this.config.grid!==1||!t&&this.config.grid!==2)&&(this.config.grid=t?1:2,this.config.calendars=t?1:2,this.destroyInstance&&this.destroyInstance(),this.initialize())});this.isMobileDevice()&&(e.grid=1,e.calendars=1),this.dateInputEl=t,this.defaultReservationDays=e.defaultReservationDays??3,this.config={type:e.type,showPrices:e.showPrices??!1,defaultReservationDays:this.defaultReservationDays,grid:e.grid??2,calendars:e.calendars??2,darkMode:e.darkMode??!0,tooltip:e.tooltip??!0,repick:e.repick??!1,minDays:e.minDays??1,defaultStartDate:e.defaultStartDate??Z.getCurrentDate(),defaultEndDate:e.defaultEndDate??Z.getCurrentDate()},this.currentDate=Z.getCurrentDate(),this.selectedStartDate=this.config.defaultStartDate,this.selectedEndDate=this.config.defaultEndDate}isMobileDevice(){return window.innerWidth<=768}initialize(){switch(window.addEventListener("resize",this.handleResize),this.config.type){case"easepick":this.initEasepickCalendar();break;case"flatpickr":this.initFlatpickrCalendar();break;default:throw new Error(`Unsupported calendar type: ${this.config.type}`)}}setMinimumDate(t){this.minDate=t}setMaximumDate(t){this.maxDate=t}setStartDate(t){let e=Z.toJSDate(t),r=Z.toJSDate(this.selectedEndDate);this.selectedStartDate=t,this.instance instanceof da.Core?this.instance.setStartDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=Z.toJSDate(this.selectedStartDate),r=Z.toJSDate(t);this.selectedEndDate=t,this.instance instanceof da.Core?this.instance.setEndDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setDateRange(t,e){if(this.config.type==="flatpickr"){this.selectedStartDate=t,this.selectedEndDate=e;let r=Z.toJSDate(t),i=Z.toJSDate(e);this.instance.setDate([r,i],!0);return}this.setStartDate(t),this.setEndDate(e)}getSelectedDates(){return{startDate:this.selectedStartDate,endDate:this.selectedEndDate}}includePrices(t=!0){this.hasPrices=t}setPrices(t){this.prices=t}setAvailability(t){this.availability=t,this.disabledDates=Object.keys(t).filter(e=>!t[e])}initEasepickCalendar(){let t={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:Hu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:{tooltip:this.config.tooltip,repick:this.config.repick,startDate:new de(this.config.defaultStartDate.toString()),endDate:new de(this.config.defaultEndDate.toString()),tooltipNumber:r=>r-1,locale:{one:"nuit",other:"nuits"}},LockPlugin:{minDate:new de(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[ua,la,ca],setup:r=>{r.on("view",i=>{let{view:o,date:a,target:s}=i.detail,u=a?a.format("YYYY-MM-DD"):null;if(o==="CalendarDay"&&u&&this.prices[u]){let l=this.prices[u],h=s.querySelector(`.${ta}`)||document.createElement("span");h.className=ta,h.textContent=`${l.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,h.style.color="#c64509",h.style.fontWeight="bold",h.style.fontSize="10px",s.append(h)}}),r.on("select",i=>{let{start:o,end:a}=i.detail;this.selectedStartDate=Z.fromString(o.format("YYYY-MM-DD")),this.selectedEndDate=Z.fromString(a.format("YYYY-MM-DD"));let s={startDate:o.format("YYYY-MM-DD").toString(),endDate:a.format("YYYY-MM-DD").toString()};Et("date:changed",s)})}},e=new da.create(t);this.instance=e,this.destroyInstance=()=>e.destroy()}initFlatpickrCalendar(){let t=document.createElement("link");t.rel="stylesheet",t.href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.css",document.head.appendChild(t);let e={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),defaultDate:[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()],shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:$u,lang:document.documentElement.lang,zIndex:10,disable:this.disabledDates,onChange:i=>{if(i.length===2){this.selectedStartDate=Z.fromJSDate(i[0]),this.selectedEndDate=Z.fromJSDate(i[1]);let o={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};Et("date:changed",o);let a=Mt("label",this.dateInputEl);if(a){let s=this.formatDate(i[0]),u=this.formatDate(i[1]);a.textContent=`${s} - ${u}`}}else Ji()},onDayCreate:async(i,o,a,s)=>{let u=s.dateObj,l=Z.fromJSDate(u),h=Z.formatForAPI(l);if(this.prices[h]){let f=this.prices[h],g=document.createElement("span");g.style.marginTop="2px",g.style.color="#c64509",g.style.fontSize="10px",g.style.fontWeight="bold",g.className=ta,g.textContent=`${f.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,s.style.display="flex",s.style.flexDirection="column",s.style.alignItems="center",s.style.justifyContent="center",s.style.lineHeight="1.1",s.appendChild(g)}}},r=sd(this.dateInputEl,e);this.instance=r,this.destroyInstance=()=>r.destroy()}destroy(){window.removeEventListener("resize",this.handleResize),this.destroyInstance&&this.destroyInstance()}formatDate(t){let e=Z.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return tn==="en-US"?`${r}/${i}/${o}`:tn==="fr-FR"||tn==="de-DE"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var W0=Be({}),K0=Be([]);var ov=Be({});var wa=class{constructor(t,e=ic){this.fsListInstance=t;this.includePrices=e;H(this,"element");H(this,"apartmentInputEl");H(this,"dateInputEl");H(this,"guestsInputEl");H(this,"chambresInputEl");H(this,"calendarInstance");H(this,"uniqueEnterprises",[]);H(this,"state",{startDate:_e.startDate?Z.safeParsePlainDate(_e.startDate):xn,endDate:_e.endDate?Z.safeParsePlainDate(_e.endDate):qn});H(this,"populateApartmentsInput",()=>{if(!this.apartmentInputEl||!this.fsListInstance)return;let t=document.createDocumentFragment(),e=this.apartmentInputEl.querySelector("option");e&&t.appendChild(e),this.uniqueEnterprises.forEach(r=>{let i=document.createElement("option");i.value=r.id,i.textContent=r.title,t.appendChild(i)}),this.apartmentInputEl.replaceChildren(t),Xi(this.apartmentInputEl,"input",async r=>{let i=r.target,o=Qi(i);Et("apartment:changed",o)}),_e.enterpriseId&&eo(this.apartmentInputEl,_e.enterpriseId||"")});H(this,"populateCalendarInput",async t=>{if(!this.dateInputEl)return;this.dateInputEl.style.cursor="pointer";let e=new oo(this.dateInputEl,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1});if(e.setMinimumDate(xn),e.setMaximumDate(qn),e.includePrices(this.includePrices),this.includePrices){let r=await mc(this.uniqueEnterprises.map(i=>i.id).filter(i=>i!==t||t==null));e.setPrices(r)}return e.initialize(),e});if(this.element=Mt("booking-component"),!this.element)throw new Error("Filters component not found");this.apartmentInputEl=Mt("location-input",this.element),this.dateInputEl=Mt("date-input",this.element),this.guestsInputEl=Mt("guests-input",this.element),this.chambresInputEl=Mt("rooms-input",this.element),this.uniqueEnterprises=[];let r=new Set;this.fsListInstance.items.value.forEach(i=>{r.has(i.fields["enterprise-id"].value)||(r.add(i.fields["enterprise-id"].value),this.uniqueEnterprises.push({id:i.fields["enterprise-id"].value,title:i.fields.title.value}))}),Pt("loading:start",i=>hr(!0,i)),Pt("loading:end",i=>hr(!1,i)),Pt("apartment:changed",async i=>{i.length===0?_e.enterpriseId=null:_e.enterpriseId=i,this.calendarInstance&&_e.enterpriseId&&await this.updateCalendarForSelectedApartment(_e.enterpriseId)}),Pt("date:changed",async i=>{_e.startDate=i.startDate,_e.endDate=i.endDate}),Pt("guests:changed",async i=>{_e.guests=parseInt(i)}),Pt("n_rooms:changed",async i=>{_e.rooms=parseInt(i)}),Pt("coupon:changed",async i=>{_e.coupon=i}),Pt(["apartment:changed","date:changed","guests:changed","coupon:changed"],async()=>{})}async init(){Et("loading:start",this.element);try{return this.apartmentInputEl&&this.populateApartmentsInput(),this.guestsInputEl&&this.populateGuestsInput(),this.chambresInputEl&&this.populateChambresInput(),this.dateInputEl&&(this.calendarInstance=await this.populateCalendarInput(),this.state.startDate&&this.state.endDate&&this.calendarInstance?.setDateRange(this.state.startDate,this.state.endDate)),this}catch(t){throw t instanceof Error?console.error("Error initializing BookingComponent",t.name):console.error("Error initializing BookingComponent",t),t}}populateGuestsInput(){if(!this.guestsInputEl){console.warn("guests dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.guestsInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(a=>{r.add(a.fields.guests.value)});let i=Math.max(...Array.from(r).map(Number)),o=a=>`${a} ${Ce(a===1?"guestSingular":"guestPlural")}`;for(let a=1;a<=i;a++){let s=document.createElement("option");s.value=a.toString(),s.textContent=o(a),t.appendChild(s)}this.guestsInputEl.replaceChildren(t),Xi(this.guestsInputEl,"input",async a=>{let s=a.target,u=Qi(s);Et("guests:changed",u)}),_e.guests&&eo(this.guestsInputEl,_e.guests.toString())}populateChambresInput(){if(!this.chambresInputEl){console.warn("rooms dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.chambresInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(o=>{r.add(o.fields.rooms.value)});let i=Math.max(...Array.from(r).map(Number));for(let o=1;o<=i;o++){let a=document.createElement("option");a.value=o.toString(),a.textContent=o.toString(),t.appendChild(a)}this.chambresInputEl.replaceChildren(t),Xi(this.chambresInputEl,"input",async o=>{let a=o.target,s=Qi(a);Et("n_rooms:changed",s)}),_e.rooms&&eo(this.chambresInputEl,_e.rooms.toString())}async updateCalendarForSelectedApartment(t){if(this.dateInputEl)try{this.calendarInstance&&(this.calendarInstance.destroy?.(),this.calendarInstance=void 0),this.calendarInstance=await this.populateCalendarInput(t)}catch(e){console.error("Error updating calendar for selected apartment:",e)}}};var ld;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(ld||(ld={}));function gm(n){let t=n.find(i=>i.instance==="apparthotels");if(!t)throw new Error("List instance not found");new wa(t).init().then(i=>{Et("loading:end",i?.element)}).catch(i=>{throw ju(!0,void 0),console.error("Error initializing filters component:",i),i}),new ia(t).init()}window.FinsweetAttributes=window.FinsweetAttributes||[];window.FinsweetAttributes.push(["list",async n=>{gm(n)}]);})();
7
+ `}}function b(){e.calendarContainer.classList.add("hasWeeks");var p=Ee("div","flatpickr-weekwrapper");p.appendChild(Ee("span","flatpickr-weekday",e.l10n.weekAbbreviation));var w=Ee("div","flatpickr-weeks");return p.appendChild(w),{weekWrapper:p,weekNumbers:w}}function _(p,w){w===void 0&&(w=!0);var M=w?p:p-e.currentMonth;M<0&&e._hidePrevMonthArrow===!0||M>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=M,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Ne("onYearChange"),ne()),O(),Ne("onMonthChange"),co())}function I(p,w){if(p===void 0&&(p=!0),w===void 0&&(w=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,w===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=ya(e.config),P=M.hours,z=M.minutes,K=M.seconds;E(P,z,K)}e.redraw(),p&&Ne("onChange")}function C(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Ne("onClose")}function F(){e.config!==void 0&&Ne("onDestroy");for(var p=e._handlers.length;p--;)e._handlers[p].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var w=e.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(M){try{delete e[M]}catch{}})}function R(p){return e.calendarContainer.contains(p)}function W(p){if(e.isOpen&&!e.config.inline){var w=Lt(p),M=R(w),P=w===e.input||w===e.altInput||e.element.contains(w)||p.path&&p.path.indexOf&&(~p.path.indexOf(e.input)||~p.path.indexOf(e.altInput)),z=!P&&!M&&!R(p.relatedTarget),K=!e.config.ignoredFocusElements.some(function(he){return he.contains(w)});z&&K&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ee(p){if(!(!p||e.config.minDate&&p<e.config.minDate.getFullYear()||e.config.maxDate&&p>e.config.maxDate.getFullYear())){var w=p,M=e.currentYear!==w;e.currentYear=w||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),M&&(e.redraw(),Ne("onYearChange"),ne())}}function q(p,w){var M;w===void 0&&(w=!0);var P=e.parseDate(p,void 0,w);if(e.config.minDate&&P&&Nt(P,e.config.minDate,w!==void 0?w:!e.minDateHasTime)<0||e.config.maxDate&&P&&Nt(P,e.config.maxDate,w!==void 0?w:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(P===void 0)return!1;for(var z=!!e.config.enable,K=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,he=0,Q=void 0;he<K.length;he++){if(Q=K[he],typeof Q=="function"&&Q(P))return z;if(Q instanceof Date&&P!==void 0&&Q.getTime()===P.getTime())return z;if(typeof Q=="string"){var ge=e.parseDate(Q,void 0,!0);return ge&&ge.getTime()===P.getTime()?z:!z}else if(typeof Q=="object"&&P!==void 0&&Q.from&&Q.to&&P.getTime()>=Q.from.getTime()&&P.getTime()<=Q.to.getTime())return z}return!z}function j(p){return e.daysContainer!==void 0?p.className.indexOf("hidden")===-1&&p.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(p):!1}function re(p){var w=p.target===e._input,M=e._input.value.trimEnd()!==Ea();w&&M&&!(p.relatedTarget&&R(p.relatedTarget))&&e.setDate(e._input.value,!0,p.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function le(p){var w=Lt(p),M=e.config.wrap?n.contains(w):w===e._input,P=e.config.allowInput,z=e.isOpen&&(!P||!M),K=e.config.inline&&M&&!P;if(p.keyCode===13&&M){if(P)return e.setDate(e._input.value,!0,w===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),w.blur();e.open()}else if(R(w)||z||K){var he=!!e.timeContainer&&e.timeContainer.contains(w);switch(p.keyCode){case 13:he?(p.preventDefault(),u(),wa()):wc(p);break;case 27:p.preventDefault(),wa();break;case 8:case 46:M&&!e.config.allowInput&&(p.preventDefault(),e.clear());break;case 37:case 39:if(!he&&!M){p.preventDefault();var Q=o();if(e.daysContainer!==void 0&&(P===!1||Q&&j(Q))){var ge=p.keyCode===39?1:-1;p.ctrlKey?(p.stopPropagation(),_(ge),N(Me(1),0)):N(void 0,ge)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:p.preventDefault();var X=p.keyCode===40?1:-1;e.daysContainer&&w.$i!==void 0||w===e.input||w===e.altInput?p.ctrlKey?(p.stopPropagation(),ee(e.currentYear-X),N(Me(1),0)):he||N(void 0,X*7):w===e.currentYearElement?ee(e.currentYear-X):e.config.enableTime&&(!he&&e.hourElement&&e.hourElement.focus(),u(p),e._debouncedChange());break;case 9:if(he){var ae=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ot){return Ot}),Te=ae.indexOf(w);if(Te!==-1){var rn=ae[Te+(p.shiftKey?-1:1)];p.preventDefault(),(rn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(w)&&p.shiftKey&&(p.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&w===e.amPM)switch(p.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],f(),fn();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],f(),fn();break}(M||R(w))&&Ne("onKeyDown",p)}function pe(p,w){if(w===void 0&&(w="flatpickr-day"),!(e.selectedDates.length!==1||p&&(!p.classList.contains(w)||p.classList.contains("flatpickr-disabled")))){for(var M=p?p.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),P=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),z=Math.min(M,e.selectedDates[0].getTime()),K=Math.max(M,e.selectedDates[0].getTime()),he=!1,Q=0,ge=0,X=z;X<K;X+=od.DAY)q(new Date(X),!0)||(he=he||X>z&&X<K,X<P&&(!Q||X>Q)?Q=X:X>P&&(!ge||X<ge)&&(ge=X));var ae=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+w));ae.forEach(function(Te){var rn=Te.dateObj,Ot=rn.getTime(),Kr=Q>0&&Ot<Q||ge>0&&Ot>ge;if(Kr){Te.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(mr){Te.classList.remove(mr)});return}else if(he&&!Kr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(mr){Te.classList.remove(mr)}),p!==void 0&&(p.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),P<M&&Ot===P?Te.classList.add("startRange"):P>M&&Ot===P&&Te.classList.add("endRange"),Ot>=Q&&(ge===0||Ot<=ge)&&rd(Ot,P,M)&&Te.classList.add("inRange"))})}}function be(){e.isOpen&&!e.config.static&&!e.config.inline&&Pn()}function Re(p,w){if(w===void 0&&(w=e._positionElement),e.isMobile===!0){if(p){p.preventDefault();var M=Lt(p);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;var P=e.isOpen;e.isOpen=!0,P||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Ne("onOpen"),Pn(w)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(p===void 0||!e.timeContainer.contains(p.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function je(p){return function(w){var M=e.config["_"+p+"Date"]=e.parseDate(w,e.config.dateFormat),P=e.config["_"+(p==="min"?"max":"min")+"Date"];M!==void 0&&(e[p==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(z){return q(z)}),!e.selectedDates.length&&p==="min"&&g(M),fn()),e.daysContainer&&(ao(),M!==void 0?e.currentYearElement[p]=M.getFullYear().toString():e.currentYearElement.removeAttribute(p),e.currentYearElement.disabled=!!P&&M!==void 0&&P.getFullYear()===M.getFullYear())}}function et(){var p=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],w=at(at({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=w.parseDate,e.config.formatDate=w.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ae){e.config._enable=Dc(ae)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ae){e.config._disable=Dc(ae)}});var P=w.mode==="time";if(!w.dateFormat&&(w.enableTime||P)){var z=ze.defaultConfig.dateFormat||qn.dateFormat;M.dateFormat=w.noCalendar||P?"H:i"+(w.enableSeconds?":S":""):z+" H:i"+(w.enableSeconds?":S":"")}if(w.altInput&&(w.enableTime||P)&&!w.altFormat){var K=ze.defaultConfig.altFormat||qn.altFormat;M.altFormat=w.noCalendar||P?"h:i"+(w.enableSeconds?":S K":" K"):K+(" h:i"+(w.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:je("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:je("max")});var he=function(ae){return function(Te){e.config[ae==="min"?"_minTime":"_maxTime"]=e.parseDate(Te,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:he("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:he("max")}),w.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,w);for(var Q=0;Q<p.length;Q++)e.config[p[Q]]=e.config[p[Q]]===!0||e.config[p[Q]]==="true";da.filter(function(ae){return e.config[ae]!==void 0}).forEach(function(ae){e.config[ae]=fa(e.config[ae]||[]).map(a)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Q=0;Q<e.config.plugins.length;Q++){var ge=e.config.plugins[Q](e)||{};for(var X in ge)da.indexOf(X)>-1?e.config[X]=fa(ge[X]).map(a).concat(e.config[X]):typeof w[X]>"u"&&(e.config[X]=ge[X])}w.altInputClass||(e.config.altInputClass=Vt().className+" "+e.config.altInputClass),Ne("onParseConfig")}function Vt(){return e.config.wrap?n.querySelector("[data-input]"):n}function Wn(){typeof e.config.locale!="object"&&typeof ze.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=at(at({},ze.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?ze.l10ns[e.config.locale]:void 0),xn.D="("+e.l10n.weekdays.shorthand.join("|")+")",xn.l="("+e.l10n.weekdays.longhand.join("|")+")",xn.M="("+e.l10n.months.shorthand.join("|")+")",xn.F="("+e.l10n.months.longhand.join("|")+")",xn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var p=at(at({},t),JSON.parse(JSON.stringify(n.dataset||{})));p.time_24hr===void 0&&ze.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=vc(e),e.parseDate=pa({config:e.config,l10n:e.l10n})}function Pn(p){if(typeof e.config.position=="function")return void e.config.position(e,p);if(e.calendarContainer!==void 0){Ne("onPreCalendarPosition");var w=p||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(kd,Td){return kd+Td.offsetHeight},0),P=e.calendarContainer.offsetWidth,z=e.config.position.split(" "),K=z[0],he=z.length>1?z[1]:null,Q=w.getBoundingClientRect(),ge=window.innerHeight-Q.bottom,X=K==="above"||K!=="below"&&ge<M&&Q.top>M,ae=window.pageYOffset+Q.top+(X?-M-2:w.offsetHeight+2);if(ot(e.calendarContainer,"arrowTop",!X),ot(e.calendarContainer,"arrowBottom",X),!e.config.inline){var Te=window.pageXOffset+Q.left,rn=!1,Ot=!1;he==="center"?(Te-=(P-Q.width)/2,rn=!0):he==="right"&&(Te-=P-Q.width,Ot=!0),ot(e.calendarContainer,"arrowLeft",!rn&&!Ot),ot(e.calendarContainer,"arrowCenter",rn),ot(e.calendarContainer,"arrowRight",Ot);var Kr=window.document.body.offsetWidth-(window.pageXOffset+Q.right),mr=Te+P>window.document.body.offsetWidth,wd=Kr+P>window.document.body.offsetWidth;if(ot(e.calendarContainer,"rightMost",mr),!e.config.static)if(e.calendarContainer.style.top=ae+"px",!mr)e.calendarContainer.style.left=Te+"px",e.calendarContainer.style.right="auto";else if(!wd)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Kr+"px";else{var _a=Wr();if(_a===void 0)return;var bd=window.document.body.offsetWidth,Dd=Math.max(0,bd/2-P/2),Ed=".flatpickr-calendar.centerMost:before",_d=".flatpickr-calendar.centerMost:after",Md=_a.cssRules.length,Sd="{left:"+Q.left+"px;right:auto;}";ot(e.calendarContainer,"rightMost",!1),ot(e.calendarContainer,"centerMost",!0),_a.insertRule(Ed+","+_d+Sd,Md),e.calendarContainer.style.left=Dd+"px",e.calendarContainer.style.right="auto"}}}}function Wr(){for(var p=null,w=0;w<document.styleSheets.length;w++){var M=document.styleSheets[w];if(M.cssRules){try{M.cssRules}catch{continue}p=M;break}}return p??oo()}function oo(){var p=document.createElement("style");return document.head.appendChild(p),p.sheet}function ao(){e.config.noCalendar||e.isMobile||(ne(),co(),O())}function wa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function wc(p){p.preventDefault(),p.stopPropagation();var w=function(ae){return ae.classList&&ae.classList.contains("flatpickr-day")&&!ae.classList.contains("flatpickr-disabled")&&!ae.classList.contains("notAllowed")},M=gc(Lt(p),w);if(M!==void 0){var P=M,z=e.latestSelectedDateObj=new Date(P.dateObj.getTime()),K=(z.getMonth()<e.currentMonth||z.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=P,e.config.mode==="single")e.selectedDates=[z];else if(e.config.mode==="multiple"){var he=Da(z);he?e.selectedDates.splice(parseInt(he),1):e.selectedDates.push(z)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=z,e.selectedDates.push(z),Nt(z,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(ae,Te){return ae.getTime()-Te.getTime()}));if(f(),K){var Q=e.currentYear!==z.getFullYear();e.currentYear=z.getFullYear(),e.currentMonth=z.getMonth(),Q&&(Ne("onYearChange"),ne()),Ne("onMonthChange")}if(co(),O(),fn(),!K&&e.config.mode!=="range"&&e.config.showMonths===1?ke(P):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var ge=e.config.mode==="single"&&!e.config.enableTime,X=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(ge||X)&&wa()}A()}}var so={locale:[Wn,D],showMonths:[L,s,v],minDate:[V],maxDate:[V],positionElement:[Ec],clickOpens:[function(){e.config.clickOpens===!0?(k(e._input,"focus",e.open),k(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function ud(p,w){if(p!==null&&typeof p=="object"){Object.assign(e.config,p);for(var M in p)so[M]!==void 0&&so[M].forEach(function(P){return P()})}else e.config[p]=w,so[p]!==void 0?so[p].forEach(function(P){return P()}):da.indexOf(p)>-1&&(e.config[p]=fa(w));e.redraw(),fn(!0)}function bc(p,w){var M=[];if(p instanceof Array)M=p.map(function(P){return e.parseDate(P,w)});else if(p instanceof Date||typeof p=="number")M=[e.parseDate(p,w)];else if(typeof p=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(p,w)];break;case"multiple":M=p.split(e.config.conjunction).map(function(P){return e.parseDate(P,w)});break;case"range":M=p.split(e.l10n.rangeSeparator).map(function(P){return e.parseDate(P,w)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(p)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(P){return P instanceof Date&&q(P,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(P,z){return P.getTime()-z.getTime()})}function dd(p,w,M){if(w===void 0&&(w=!1),M===void 0&&(M=e.config.dateFormat),p!==0&&!p||p instanceof Array&&p.length===0)return e.clear(w);bc(p,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),V(void 0,w),g(),e.selectedDates.length===0&&e.clear(!1),fn(w),w&&Ne("onChange")}function Dc(p){return p.slice().map(function(w){return typeof w=="string"||typeof w=="number"||w instanceof Date?e.parseDate(w,void 0,!0):w&&typeof w=="object"&&w.from&&w.to?{from:e.parseDate(w.from,void 0),to:e.parseDate(w.to,void 0)}:w}).filter(function(w){return w})}function hd(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var p=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);p&&bc(p,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function md(){if(e.input=Vt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Ee(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),Ec()}function Ec(){e._positionElement=e.config.positionElement||e._input}function fd(){var p=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Ee("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=p,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=p==="datetime-local"?"Y-m-d\\TH:i:S":p==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}k(e.mobileInput,"change",function(w){e.setDate(Lt(w).value,!1,e.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function pd(p){if(e.isOpen===!0)return e.close();e.open(p)}function Ne(p,w){if(e.config!==void 0){var M=e.config[p];if(M!==void 0&&M.length>0)for(var P=0;M[P]&&P<M.length;P++)M[P](e.selectedDates,e.input.value,e,w);p==="onChange"&&(e.input.dispatchEvent(ba("change")),e.input.dispatchEvent(ba("input")))}}function ba(p){var w=document.createEvent("Event");return w.initEvent(p,!0,!0),w}function Da(p){for(var w=0;w<e.selectedDates.length;w++){var M=e.selectedDates[w];if(M instanceof Date&&Nt(M,p)===0)return""+w}return!1}function gd(p){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Nt(p,e.selectedDates[0])>=0&&Nt(p,e.selectedDates[1])<=0}function co(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(p,w){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[w].textContent=ro(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),p.value=M.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ea(p){var w=p||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,w)}).filter(function(M,P,z){return e.config.mode!=="range"||e.config.enableTime||z.indexOf(M)===P}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function fn(p){p===void 0&&(p=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ea(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ea(e.config.altFormat)),p!==!1&&Ne("onValueUpdate")}function yd(p){var w=Lt(p),M=e.prevMonthNav.contains(w),P=e.nextMonthNav.contains(w);M||P?_(M?-1:1):e.yearElements.indexOf(w)>=0?w.select():w.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):w.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function vd(p){p.preventDefault();var w=p.type==="keydown",M=Lt(p),P=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]);var z=parseFloat(P.getAttribute("min")),K=parseFloat(P.getAttribute("max")),he=parseFloat(P.getAttribute("step")),Q=parseInt(P.value,10),ge=p.delta||(w?p.which===38?1:-1:0),X=Q+he*ge;if(typeof P.value<"u"&&P.value.length===2){var ae=P===e.hourElement,Te=P===e.minuteElement;X<z?(X=K+X+At(!ae)+(At(ae)&&At(!e.amPM)),Te&&U(void 0,-1,e.hourElement)):X>K&&(X=P===e.hourElement?X-K-At(!e.amPM):z,Te&&U(void 0,1,e.hourElement)),e.amPM&&ae&&(he===1?X+Q===23:Math.abs(X-Q)>he)&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]),P.value=it(X)}}return i(),e}function qr(n,t){for(var e=Array.prototype.slice.call(n).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<e.length;i++){var o=e[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=pm(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return qr(this,n)},HTMLElement.prototype.flatpickr=function(n){return qr([this],n)});var ze=function(n,t){return typeof n=="string"?qr(window.document.querySelectorAll(n),t):n instanceof Node?qr([n],t):qr(n,t)};ze.defaultConfig={};ze.l10ns={en:at({},ma),default:at({},ma)};ze.localize=function(n){ze.l10ns.default=at(at({},ze.l10ns.default),n)};ze.setDefaults=function(n){ze.defaultConfig=at(at({},ze.defaultConfig),n)};ze.parseDate=pa({});ze.formatDate=vc({});ze.compareDates=Nt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return qr(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=ze);var sd=ze;var io=class{constructor(t,e){this.dateInputEl=t;Y(this,"minDate");Y(this,"maxDate");Y(this,"defaultReservationDays");Y(this,"hasPrices",!1);Y(this,"prices",{});Y(this,"availability",{});Y(this,"disabledDates",[]);Y(this,"selectedStartDate");Y(this,"selectedEndDate");Y(this,"config");Y(this,"instance");Y(this,"destroyInstance");Y(this,"currentDate");Y(this,"handleResize",()=>{let t=this.isMobileDevice();(t&&this.config.grid!==1||!t&&this.config.grid!==2)&&(this.config.grid=t?1:2,this.config.calendars=t?1:2,this.destroyInstance&&this.destroyInstance(),this.initialize())});this.isMobileDevice()&&(e.grid=1,e.calendars=1),this.dateInputEl=t,this.defaultReservationDays=e.defaultReservationDays??3;let r=e.startWithEmptyDates??!1;this.config={...e,type:e.type,showPrices:e.showPrices??!1,defaultReservationDays:this.defaultReservationDays,grid:e.grid??2,calendars:e.calendars??2,darkMode:e.darkMode??!0,tooltip:e.tooltip??!0,repick:e.repick??!1,minDays:e.minDays??1,defaultStartDate:e.defaultStartDate??Z.getCurrentDate(),defaultEndDate:e.defaultEndDate??Z.getCurrentDate(),startWithEmptyDates:r},this.currentDate=Z.getCurrentDate(),this.selectedStartDate=r?null:this.config.defaultStartDate,this.selectedEndDate=r?null:this.config.defaultEndDate}isMobileDevice(){return window.innerWidth<=768}initialize(){switch(window.addEventListener("resize",this.handleResize),this.config.type){case"easepick":this.initEasepickCalendar();break;case"flatpickr":this.initFlatpickrCalendar();break;default:throw new Error(`Unsupported calendar type: ${this.config.type}`)}}setMinimumDate(t){this.minDate=t}setMaximumDate(t){this.maxDate=t}setStartDate(t){let e=Z.toJSDate(t),r=this.selectedEndDate?Z.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof ua.Core?this.instance.setStartDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?Z.toJSDate(this.selectedStartDate):Z.toJSDate(t),r=Z.toJSDate(t);this.selectedEndDate=t,this.instance instanceof ua.Core?this.instance.setEndDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setDateRange(t,e){if(this.config.type==="flatpickr"){this.selectedStartDate=t,this.selectedEndDate=e;let r=Z.toJSDate(t),i=Z.toJSDate(e);this.instance.setDate([r,i],!0);return}this.setStartDate(t),this.setEndDate(e)}getSelectedDates(){return{startDate:this.selectedStartDate,endDate:this.selectedEndDate}}includePrices(t=!0){this.hasPrices=t}setPrices(t){this.prices=t}setAvailability(t){this.availability=t,this.disabledDates=Object.keys(t).filter(e=>!t[e])}initEasepickCalendar(){let t={tooltip:this.config.tooltip,repick:this.config.repick,tooltipNumber:i=>i-1,locale:{one:"nuit",other:"nuits"}};this.config.startWithEmptyDates||(t.startDate=new de(this.config.defaultStartDate.toString()),t.endDate=new de(this.config.defaultEndDate.toString()));let e={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:Hu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new de(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[la,ca,sa],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:u}=o.detail,l=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&l&&this.prices[l]){let h=this.prices[l],f=u.querySelector(`.${ea}`)||document.createElement("span");f.className=ea,f.textContent=`${h.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,f.style.color="#c64509",f.style.fontWeight="bold",f.style.fontSize="10px",u.append(f)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=Z.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=Z.fromString(s.format("YYYY-MM-DD"));let u={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};qe("date:changed",u)})}},r=new ua.create(e);this.instance=r,this.destroyInstance=()=>r.destroy()}initFlatpickrCalendar(){let t=document.createElement("link");t.rel="stylesheet",t.href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.css",document.head.appendChild(t);let e={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Yu,lang:document.documentElement.lang,zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(e.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(e,{onChange:i=>{let o=Ke("label",this.dateInputEl);if(i.length===2){this.selectedStartDate=Z.fromJSDate(i[0]),this.selectedEndDate=Z.fromJSDate(i[1]);let a={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(qe("date:changed",a),o){let s=this.formatDate(i[0]),u=this.formatDate(i[1]);o.textContent=`${s} - ${u}`}}else this.selectedStartDate=null,this.selectedEndDate=null,qe("date:changed",{startDate:"",endDate:""}),o&&(o.textContent="")},onDayCreate:async(i,o,a,s)=>{let u=s.dateObj,l=Z.fromJSDate(u),h=Z.formatForAPI(l);if(this.prices[h]){let f=this.prices[h],g=document.createElement("span");g.style.marginTop="2px",g.style.color="#c64509",g.style.fontSize="10px",g.style.fontWeight="bold",g.className=ea,g.textContent=`${f.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,s.style.display="flex",s.style.flexDirection="column",s.style.alignItems="center",s.style.justifyContent="center",s.style.lineHeight="1.1",s.appendChild(g)}}});let r=sd(this.dateInputEl,e);this.instance=r,this.destroyInstance=()=>r.destroy()}clear(){this.selectedStartDate=null,this.selectedEndDate=null,this.config.type==="flatpickr"&&this.instance.clear?.()}destroy(){window.removeEventListener("resize",this.handleResize),this.destroyInstance&&this.destroyInstance()}formatDate(t){let e=Z.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return tn==="en-US"?`${r}/${i}/${o}`:tn==="fr-FR"||tn==="de-DE"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var U0=Be({}),V0=Be([]);var nv=Be({});var va=class{constructor(t,e=rc){this.fsListInstance=t;this.includePrices=e;Y(this,"element");Y(this,"apartmentInputEl");Y(this,"dateInputEl");Y(this,"dateClearEl");Y(this,"guestsInputEl");Y(this,"chambresInputEl");Y(this,"calendarInstance");Y(this,"dateLabelPlaceholder","");Y(this,"uniqueEnterprises",[]);Y(this,"state",{startDate:ye.startDate?Z.safeParsePlainDate(ye.startDate):null,endDate:ye.endDate?Z.safeParsePlainDate(ye.endDate):null});Y(this,"populateApartmentsInput",()=>{if(!this.apartmentInputEl||!this.fsListInstance)return;let t=document.createDocumentFragment(),e=this.apartmentInputEl.querySelector("option");e&&t.appendChild(e),this.uniqueEnterprises.forEach(r=>{let i=document.createElement("option");i.value=r.id,i.textContent=r.title,t.appendChild(i)}),this.apartmentInputEl.replaceChildren(t),Ur(this.apartmentInputEl,"input",async r=>{let i=r.target,o=Xi(i);qe("apartment:changed",o)}),ye.enterpriseId&&Qi(this.apartmentInputEl,ye.enterpriseId||"")});Y(this,"populateCalendarInput",async t=>{if(!this.dateInputEl)return;this.dateInputEl.style.cursor="pointer";let e=!!(this.state.startDate&&this.state.endDate),r=new io(this.dateInputEl,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,startWithEmptyDates:!e,...e&&{defaultStartDate:this.state.startDate,defaultEndDate:this.state.endDate}});if(r.setMinimumDate(ur),r.setMaximumDate(jr),r.includePrices(this.includePrices),this.includePrices){let i=await hc(this.uniqueEnterprises.map(o=>o.id).filter(o=>o!==t||t==null));r.setPrices(i)}return r.initialize(),r});if(this.element=Ke("booking-component"),!this.element)throw new Error("Filters component not found");this.apartmentInputEl=Ke("location-input",this.element),this.dateInputEl=Ke("date-input",this.element),this.dateClearEl=Ke("date-clear",this.element),this.guestsInputEl=Ke("guests-input",this.element),this.chambresInputEl=Ke("rooms-input",this.element),this.uniqueEnterprises=[];let r=new Set;this.fsListInstance.items.value.forEach(i=>{r.has(i.fields["enterprise-id"].value)||(r.add(i.fields["enterprise-id"].value),this.uniqueEnterprises.push({id:i.fields["enterprise-id"].value,title:i.fields.title.value}))}),Pt("loading:start",i=>dr(!0,i)),Pt("loading:end",i=>dr(!1,i)),Pt("apartment:changed",async i=>{i.length===0?ye.enterpriseId=null:ye.enterpriseId=i,this.calendarInstance&&ye.enterpriseId&&await this.updateCalendarForSelectedApartment(ye.enterpriseId)}),Pt("date:changed",async i=>{ye.startDate=i.startDate||null,ye.endDate=i.endDate||null,this.updateDateClearVisibility()}),Pt("guests:changed",async i=>{ye.guests=parseInt(i)}),Pt("n_rooms:changed",async i=>{ye.rooms=parseInt(i)}),Pt("coupon:changed",async i=>{ye.coupon=i}),Pt(["apartment:changed","date:changed","guests:changed","coupon:changed"],async()=>{})}async init(){qe("loading:start",this.element);try{if(this.apartmentInputEl&&this.populateApartmentsInput(),this.guestsInputEl&&this.populateGuestsInput(),this.chambresInputEl&&this.populateChambresInput(),this.dateInputEl){let t=Ke("label",this.dateInputEl);this.dateLabelPlaceholder=t?.textContent?.trim()??"",this.calendarInstance=await this.populateCalendarInput(),this.state.startDate&&this.state.endDate&&this.calendarInstance?.setDateRange(this.state.startDate,this.state.endDate),this.updateDateClearVisibility(),this.setupDateClearClickHandler()}return this}catch(t){throw t instanceof Error?console.error("Error initializing BookingComponent",t.name):console.error("Error initializing BookingComponent",t),t}}updateDateClearVisibility(){if(!this.dateClearEl)return;let t=!!(ye.startDate&&ye.endDate);this.dateClearEl.style.display=t?"flex":"none"}setupDateClearClickHandler(){this.dateClearEl&&Ur(this.dateClearEl,"click",t=>{t.preventDefault(),ye.startDate=null,ye.endDate=null,this.state.startDate=null,this.state.endDate=null,this.calendarInstance?.clear();let e=this.dateInputEl?Ke("label",this.dateInputEl):null;e&&(e.textContent=this.dateLabelPlaceholder),qe("date:changed",{startDate:"",endDate:""}),this.updateDateClearVisibility()})}populateGuestsInput(){if(!this.guestsInputEl){console.warn("guests dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.guestsInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(a=>{r.add(a.fields.guests.value)});let i=Math.max(...Array.from(r).map(Number)),o=a=>`${a} ${Ce(a===1?"guestSingular":"guestPlural")}`;for(let a=1;a<=i;a++){let s=document.createElement("option");s.value=a.toString(),s.textContent=o(a),t.appendChild(s)}this.guestsInputEl.replaceChildren(t),Ur(this.guestsInputEl,"input",async a=>{let s=a.target,u=Xi(s);qe("guests:changed",u)}),ye.guests&&Qi(this.guestsInputEl,ye.guests.toString())}populateChambresInput(){if(!this.chambresInputEl){console.warn("rooms dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.chambresInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(o=>{r.add(o.fields.rooms.value)});let i=Math.max(...Array.from(r).map(Number));for(let o=1;o<=i;o++){let a=document.createElement("option");a.value=o.toString(),a.textContent=o.toString(),t.appendChild(a)}this.chambresInputEl.replaceChildren(t),Ur(this.chambresInputEl,"input",async o=>{let a=o.target,s=Xi(a);qe("n_rooms:changed",s)}),ye.rooms&&Qi(this.chambresInputEl,ye.rooms.toString())}async updateCalendarForSelectedApartment(t){if(this.dateInputEl)try{this.calendarInstance&&(this.calendarInstance.destroy?.(),this.calendarInstance=void 0),this.calendarInstance=await this.populateCalendarInput(t)}catch(e){console.error("Error updating calendar for selected apartment:",e)}}};var ld;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(ld||(ld={}));function gm(n){let t=n.find(i=>i.instance==="apparthotels");if(!t)throw new Error("List instance not found");new va(t).init().then(i=>{qe("loading:end",i?.element)}).catch(i=>{throw Bu(!0,void 0),console.error("Error initializing filters component:",i),i}),new ra(t).init()}window.FinsweetAttributes=window.FinsweetAttributes||[];window.FinsweetAttributes.push(["list",async n=>{gm(n)}]);})();
8
8
  /*! Bundled license information:
9
9
 
10
10
  @vue/shared/dist/shared.esm-bundler.js: