@influence-society-web/yuna-frontend 2.0.4 → 2.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
|
-
var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $(F,z){if(z&&(typeof z=="object"||typeof z=="function"))return z;if(z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(F)}function W(F,z){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,se){return Y.__proto__=se,Y},W(F,z)}function K(F,z){return r(F)||S(F,z)||Ce(F,z)||x()}function ee(F,z){if(typeof F!="object"||!F)return F;var Y=F[Symbol.toPrimitive];if(Y!==void 0){var se=Y.call(F,z||"default");if(typeof se!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(F)}function oe(F){var z=ee(F,"string");return typeof z=="symbol"?z:z+""}function ae(F){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},ae(F)}function Ce(F,z){if(F){if(typeof F=="string")return e(F,z);var Y={}.toString.call(F).slice(8,-1);return Y==="Object"&&F.constructor&&(Y=F.constructor.name),Y==="Map"||Y==="Set"?Array.from(F):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(F,z):void 0}}function Te(F){var z=typeof Map=="function"?new Map:void 0;return Te=function(Y){function se(){return s(Y,arguments,p(this).constructor)}if(Y===null||!w(Y))return Y;if(typeof Y!="function")throw new TypeError("Super expression must either be null or a function");if(z!==void 0){if(z.has(Y))return z.get(Y);z.set(Y,se)}return se.prototype=Object.create(Y.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),W(se,Y)},Te(F)}var ce=function(F){var z=Math.abs,Y=Math.max,se=Math.floor;function g(H,c){var d;if(a(this,g),d=o(this,g,[H]),d.sign=c,Object.setPrototypeOf(d,g.prototype),H>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,F),u(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var E=c.value;d.push((E&&(E>>>0).toString(16))+", ")}}catch(D){v.e(D)}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?g.__toStringGeneric(this,c,!1):g.__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 g(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 g.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(c,d,v){v>this.length&&(v=this.length);for(var E=32767&c,D=c>>>15,_=0,I=d,P=0;P<v;P++){var j=this.__digit(P),O=32767&j,X=j>>>15,re=g.__imul(O,E),Z=g.__imul(O,D),V=g.__imul(X,E),ue=g.__imul(X,D),pe=I+re+_;_=pe>>>30,pe&=1073741823,pe+=((32767&Z)<<15)+((32767&V)<<15),_+=pe>>>30,I=ue+(Z>>>15)+(V>>>15),this.__setDigit(P,1073741823&pe)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var E,D=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+c.__halfDigit(_)+D,D=E>>>15,this.__setHalfDigit(d+_,32767&E);return D}},{key:"__inplaceSub",value:function(c,d,v){var E=v-1>>>1,D=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,P=0;P<E;P++){var j=c.__digit(P),O=(_>>>15)-(32767&j)-D;D=1&O>>>15,this.__setDigit(d+P,(32767&O)<<15|32767&I),_=this.__digit(d+P+1),I=(32767&_)-(j>>>15)-D,D=1&I>>>15}var X=c.__digit(P),re=(_>>>15)-(32767&X)-D;D=1&re>>>15,this.__setDigit(d+P,(32767&re)<<15|32767&I);var Z=X>>>15;if(d+P+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+P+1),I=(32767&_)-Z-D,D=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var V=0;V<c.length-1;V++){var ue=this.__digit(d+V),pe=c.__digit(V),we=(32767&ue)-(32767&pe)-D;D=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-D;D=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var He=this.__digit(d+V),Ve=c.__digit(V),ot=(32767&He)-(32767&Ve)-D;D=1&ot>>>15;var Qt=0;!(1&v)&&(Qt=(He>>>15)-(Ve>>>15)-D,D=1&Qt>>>15),this.__setDigit(d+V,(32767&Qt)<<15|32767&ot)}return D}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,E=this.length-1,D=0;D<E;D++)d=this.__digit(D+1),this.__setDigit(D,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(E,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,E=this.__digit(v),D=1&c?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,D)}}],[{key:"BigInt",value:function(c){var d=Number.isFinite;if(typeof c=="number"){if(c===0)return g.__zero();if(g.__isOneDigitInt(c))return 0>c?g.__oneDigit(-c,!0):g.__oneDigit(c,!1);if(!d(c)||se(c)!==c)throw new RangeError("The number "+c+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(c)}if(typeof c=="string"){var v=g.__fromString(c);if(v===null)throw new SyntaxError("Cannot convert "+c+" to a BigInt");return v}if(typeof c=="boolean")return c===!0?g.__oneDigit(1,!1):g.__zero();if(ae(c)==="object"){if(c.constructor===g)return c;var E=g.__toPrimitive(c);return g.BigInt(E)}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 E=c.__digit(d-1),D=g.__clz30(E),_=30*d-D;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,P=E,j=d-1,O=D+3,X=O===32?0:P<<O;X>>>=12;var re=O-12,Z=12<=O?0:P<<20+O,V=20+O;for(0<re&&0<j&&(j--,P=c.__digit(j),X|=P>>>30-re,Z=P<<re+2,V=re+2);0<V&&0<j;)j--,P=c.__digit(j),Z|=30<=V?P<<V-30:P>>>30-V,V-=30;var ue=g.__decideRounding(c,V,j,P);if((ue===1||ue===0&&(1&Z)==1)&&(Z=Z+1>>>0,Z===0&&(X++,X>>>20!=0&&(X=0,I++,1023<I))))return c.sign?-1/0:1/0;var pe=c.sign?-2147483648:0;return I=I+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=pe|I|X,g.__kBitConversionInts[g.__kBitConversionIntLow]=Z,g.__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?g.__absoluteSubOne(c).__trim():g.__absoluteAddOne(c,!0)}},{key:"exponentiate",value:function(c,d){if(d.sign)throw new RangeError("Exponent must be positive");if(d.length===0)return g.__oneDigit(1,!1);if(c.length===0)return c;if(c.length===1&&c.__digit(0)===1)return c.sign&&!(1&d.__digit(0))?g.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>=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(c.length===1&&c.__digit(0)===2){var E=1+(0|v/30),D=c.sign&&(1&v)!=0,_=new g(E,D);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(E-1,I),_}var P=null,j=c;for(1&v&&(P=c),v>>=1;v!==0;v>>=1)j=g.multiply(j,j),1&v&&(P===null?P=j:P=g.multiply(P,j));return P}},{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 E=new g(v,c.sign!==d.sign);E.__initializeDigits();for(var D=0;D<c.length;D++)g.__multiplyAccumulate(d,c.__digit(D),E,D);return E.__trim()}},{key:"divide",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return g.__zero();var v,E=c.sign!==d.sign,D=d.__unsignedDigit(0);if(d.length===1&&32767>=D){if(D===1)return E===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,D,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=E,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return g.__zero();var E=g.__absoluteModSmall(c,v);return E===0?g.__zero():g.__oneDigit(E,c.sign)}var D=g.__absoluteDivLarge(c,d,!1,!0);return D.sign=c.sign,D.__trim()}},{key:"add",value:function(c,d){var v=c.sign;return v===d.sign?g.__absoluteAdd(c,d,v):0<=g.__absoluteCompare(c,d)?g.__absoluteSub(c,d,v):g.__absoluteSub(d,c,!v)}},{key:"subtract",value:function(c,d){var v=c.sign;return v===d.sign?0<=g.__absoluteCompare(c,d)?g.__absoluteSub(c,d,v):g.__absoluteSub(d,c,!v):g.__absoluteAdd(c,d,v)}},{key:"leftShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?g.__rightShiftByAbsolute(c,d):g.__leftShiftByAbsolute(c,d)}},{key:"signedRightShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?g.__leftShiftByAbsolute(c,d):g.__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>g.__compareToBigInt(c,d)}},{key:"lessThanOrEqual",value:function(c,d){return 0>=g.__compareToBigInt(c,d)}},{key:"greaterThan",value:function(c,d){return 0<g.__compareToBigInt(c,d)}},{key:"greaterThanOrEqual",value:function(c,d){return 0<=g.__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!g.equal(c,d)}},{key:"bitwiseAnd",value:function(c,d){if(!c.sign&&!d.sign)return g.__absoluteAnd(c,d).__trim();if(c.sign&&d.sign){var v=Y(c.length,d.length)+1,E=g.__absoluteSubOne(c,v),D=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,D,E),g.__absoluteAddOne(E,!0,E).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}return g.__absoluteAndNot(c,g.__absoluteSubOne(d)).__trim()}},{key:"bitwiseXor",value:function(c,d){if(!c.sign&&!d.sign)return g.__absoluteXor(c,d).__trim();if(c.sign&&d.sign){var v=Y(c.length,d.length),E=g.__absoluteSubOne(c,v),D=g.__absoluteSubOne(d);return g.__absoluteXor(E,D,E).__trim()}var _=Y(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var P=g.__absoluteSubOne(d,_);return P=g.__absoluteXor(P,c,P),g.__absoluteAddOne(P,!0,P).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=Y(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var E=g.__absoluteSubOne(c,v),D=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,D,E),g.__absoluteAddOne(E,!0,E).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var I=g.__absoluteSubOne(d,v);return I=g.__absoluteAndNot(I,c,I),g.__absoluteAddOne(I,!0,I).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=se(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return g.__zero();if(c>=g.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var E=d.__unsignedDigit(v-1),D=1<<(c-1)%30;if(d.length===v&&E<D)return d;var _=(E&D)===D;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(E&D-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&E===D?d:g.__truncateToNBits(c,d)}return g.__truncateAndSubFromPowerOfTwo(c,d,!1)}},{key:"asUintN",value:function(c,d){if(d.length===0)return d;if(c=se(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return g.__zero();if(d.sign){if(c>g.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(c,d,!1)}if(c>=g.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var E=c%30;if(d.length==v){if(E===0)return d;var D=d.__digit(v-1);if(!(D>>>E))return d}return g.__truncateToNBits(c,d)}},{key:"ADD",value:function(c,d){if(c=g.__toPrimitive(c),d=g.__toPrimitive(d),typeof c=="string")return typeof d!="string"&&(d=d.toString()),c+d;if(typeof d=="string")return c.toString()+d;if(c=g.__toNumeric(c),d=g.__toNumeric(d),g.__isBigInt(c)&&g.__isBigInt(d))return g.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 g.__compare(c,d,0)}},{key:"LE",value:function(c,d){return g.__compare(c,d,1)}},{key:"GT",value:function(c,d){return g.__compare(c,d,2)}},{key:"GE",value:function(c,d){return g.__compare(c,d,3)}},{key:"EQ",value:function(c,d){for(;;){if(g.__isBigInt(c))return g.__isBigInt(d)?g.equal(c,d):g.EQ(d,c);if(typeof c=="number"){if(g.__isBigInt(d))return g.__equalToNumber(d,c);if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="string"){if(g.__isBigInt(d))return c=g.__fromString(c),c!==null&&g.equal(c,d);if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="symbol"){if(g.__isBigInt(d))return!1;if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="object"){if(ae(d)==="object"&&d.constructor!==g)return c==d;c=g.__toPrimitive(c)}else return c==d}}},{key:"NE",value:function(c,d){return!g.EQ(c,d)}},{key:"DataViewGetBigInt64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return g.asIntN(64,g.DataViewGetBigUint64(c,d,v))}},{key:"DataViewGetBigUint64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2],E=v?[4,0]:[0,4],D=K(E,2),_=D[0],I=D[1],P=c.getUint32(d+_,v),j=c.getUint32(d+I,v),O=new g(3,!1);return O.__setDigit(0,1073741823&j),O.__setDigit(1,(268435455&P)<<2|j>>>30),O.__setDigit(2,P>>>28),O.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,E)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var D=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,D=I>>>2,2<v.length&&(D|=v.__digit(2)<<28)}var P=E?[4,0]:[0,4],j=K(P,2),O=j[0],X=j[1];c.setUint32(d+O,D,E),c.setUint32(d+X,_,E)}},{key:"__zero",value:function(){return new g(0,!1)}},{key:"__oneDigit",value:function(c,d){var v=new g(1,d);return v.__setDigit(0,c),v}},{key:"__decideRounding",value:function(c,d,v,E){if(0<d)return-1;var D;if(0>d)D=-d-1;else{if(v===0)return-1;v--,E=c.__digit(v),D=29}var _=1<<D;if(!(E&_))return-1;if(_-=1,(E&_)!=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;g.__kBitConversionDouble[0]=c;var v,E=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,D=E-1023,_=(0|D/30)+1,I=new g(_,d),P=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|P,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=D%30,Z=0;if(re<X){var V=X-re;Z=V+32,v=j>>>V,j=j<<32-V|O>>>V,O<<=32-V}else if(re===X)Z=32,v=j,j=O,O=0;else{var ue=re-X;Z=32-ue,v=j<<ue|O>>>32-ue,j=O<<ue,O=0}I.__setDigit(_-1,v);for(var pe=_-2;0<=pe;pe--)0<Z?(Z-=30,v=j>>>2,j=j<<30|O>>>2,O<<=30):v=0,I.__setDigit(pe,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,E=c.length,D=0;if(D===E)return g.__zero();for(var _=c.charCodeAt(D);g.__isWhitespace(_);){if(++D===E)return g.__zero();_=c.charCodeAt(D)}if(_===43){if(++D===E)return null;_=c.charCodeAt(D),v=1}else if(_===45){if(++D===E)return null;_=c.charCodeAt(D),v=-1}if(d===0){if(d=10,_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(d=16,++D===E)return null;_=c.charCodeAt(D)}else if(_===79||_===111){if(d=8,++D===E)return null;_=c.charCodeAt(D)}else if(_===66||_===98){if(d=2,++D===E)return null;_=c.charCodeAt(D)}}}else if(d===16&&_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(++D===E)return null;_=c.charCodeAt(D)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++D===E)return g.__zero();_=c.charCodeAt(D)}var I=E-D,P=g.__kMaxBitsPerChar[d],j=g.__kBitsPerCharTableMultiplier-1;if(I>1073741824/P)return null;var O=P*I+j>>>g.__kBitsPerCharTableShift,X=0|(O+29)/30,re=new g(X,!1),Z=10>d?d:10,V=10<d?d-10:0;if(d&d-1){re.__initializeDigits();var ot=!1,Qt=0;do{for(var cr,$n=0,oi=1;;){if(cr=void 0,_-48>>>0<Z)cr=_-48;else if((32|_)-97>>>0<V)cr=(32|_)-87;else{ot=!0;break}var bo=oi*d;if(1073741823<bo)break;if(oi=bo,$n=$n*d+cr,Qt++,++D===E){ot=!0;break}_=c.charCodeAt(D)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(P*Qt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(oi,$n,wo)}while(!ot)}else{P>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,He=0,Ve=0;;){if(_e=void 0,_-48>>>0<Z)_e=_-48;else if((32|_)-97>>>0<V)_e=(32|_)-87;else{we=!0;break}if(Ve+=P,He=He<<P|_e,++D===E){we=!0;break}if(_=c.charCodeAt(D),30<Ve+P)break}ue.push(He),pe.push(Ve)}while(!we);g.__fillFromParts(re,ue,pe)}if(D!==E){if(!g.__isWhitespace(_))return null;for(D++;D<E;D++)if(_=c.charCodeAt(D),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var E=0,D=0,_=0,I=d.length-1;0<=I;I--){var P=d[I],j=v[I];D|=P<<_,_+=j,_===30?(c.__setDigit(E++,D),_=0,D=0):30<_&&(c.__setDigit(E++,1073741823&D),_-=30,D=P>>>j-_)}if(D!==0){if(E>=c.length)throw new Error("implementation bug");c.__setDigit(E++,D)}for(;E<c.length;E++)c.__setDigit(E,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,E=d-1;E=(85&E>>>1)+(85&E),E=(51&E>>>2)+(51&E),E=(15&E>>>4)+(15&E);var D=E,_=d-1,I=c.__digit(v-1),P=g.__clz30(I),j=30*v-P,O=0|(j+D-1)/D;if(c.sign&&O++,268435456<O)throw new Error("string too long");for(var X=Array(O),re=O-1,Z=0,V=0,ue=0;ue<v-1;ue++){var pe=c.__digit(ue),we=(Z|pe<<V)&_;X[re--]=g.__kConversionChars[we];var _e=D-V;for(Z=pe>>>_e,V=30-_e;V>=D;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D,V-=D}var He=(Z|I<<V)&_;for(X[re--]=g.__kConversionChars[He],Z=I>>>D-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D;if(c.sign&&(X[re--]="-"),re!==-1)throw new Error("implementation bug");return X.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var E=c.length;if(E===0)return"";if(E===1){var D=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(D="-"+D),D}var _=30*E-g.__clz30(c.__digit(E-1)),I=g.__kMaxBitsPerChar[d],P=I-1,j=_*g.__kBitsPerCharTableMultiplier;j+=P-1,j=0|j/P;var O,X,re=j+1>>1,Z=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(re,!1)),V=Z.__unsignedDigit(0);if(Z.length===1&&32767>=V){O=new g(c.length,!1),O.__initializeDigits();for(var ue,pe=0,we=2*c.length-1;0<=we;we--)ue=pe<<15|c.__halfDigit(we),O.__setHalfDigit(we,0|ue/V),pe=0|ue%V;X=pe.toString(d)}else{var _e=g.__absoluteDivLarge(c,Z,!0,!0);O=_e.quotient;var He=_e.remainder.__trim();X=g.__toStringGeneric(He,d,!0)}O.__trim();for(var Ve=g.__toStringGeneric(O,d,!0);X.length<re;)X="0"+X;return v===!1&&c.sign&&(Ve="-"+Ve),Ve+X}},{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 g.__unequalSign(v);var E=g.__absoluteCompare(c,d);return 0<E?g.__absoluteGreater(v):0>E?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,E=0>d;if(v!==E)return g.__unequalSign(v);if(c.length===0){if(E)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var D=z(d),_=c.__unsignedDigit(0);return _>D?g.__absoluteGreater(v):_<D?g.__absoluteLess(v):0}return g.__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,E=0>d;if(v!==E)return g.__unequalSign(v);if(d===0)throw new Error("implementation bug: should be handled elsewhere");if(c.length===0)return-1;g.__kBitConversionDouble[0]=d;var D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(D==2047)throw new Error("implementation bug: handled elsewhere");var _=D-1023;if(0>_)return g.__absoluteGreater(v);var I=c.length,P=c.__digit(I-1),j=g.__clz30(P),O=30*I-j,X=_+1;if(O<X)return g.__absoluteLess(v);if(O>X)return g.__absoluteGreater(v);var re=1048576,Z=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],V=g.__kBitConversionInts[g.__kBitConversionIntLow],ue=20,pe=29-j;if(pe!==(0|(O-1)%30))throw new Error("implementation bug");var we,_e=0;if(pe<ue){var He=ue-pe;_e=He+32,we=Z>>>He,Z=Z<<32-He|V>>>He,V<<=32-He}else if(pe===ue)_e=32,we=Z,Z=V,V=0;else{var Ve=pe-ue;_e=32-Ve,we=Z<<Ve|V>>>32-Ve,Z=V<<Ve,V=0}if(P>>>=0,we>>>=0,P>we)return g.__absoluteGreater(v);if(P<we)return g.__absoluteLess(v);for(var ot=I-2;0<=ot;ot--){0<_e?(_e-=30,we=Z>>>2,Z=Z<<30|V>>>2,V<<=30):we=0;var Qt=c.__unsignedDigit(ot);if(Qt>we)return g.__absoluteGreater(v);if(Qt<we)return g.__absoluteLess(v)}if(Z!==0||V!==0){if(_e===0)throw new Error("implementation bug");return g.__absoluteLess(v)}return 0}},{key:"__equalToNumber",value:function(c,d){return g.__isOneDigitInt(d)?d===0?c.length===0:c.length===1&&c.sign===0>d&&c.__unsignedDigit(0)===z(d):g.__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=g.__toPrimitive(c),d=g.__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(g.__isBigInt(c)&&typeof d=="string")return d=g.__fromString(d),d!==null&&g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(typeof c=="string"&&g.__isBigInt(d))return c=g.__fromString(c),c!==null&&g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(c=g.__toNumeric(c),d=g.__toNumeric(d),g.__isBigInt(c)){if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(typeof d!="number")throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(c,d),v)}if(typeof c!="number")throw new Error("implementation bug");if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__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 g.__absoluteAdd(d,c,v);if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);var E=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&E++;for(var D,_=new g(E,v),I=0,P=0;P<d.length;P++)D=c.__digit(P)+d.__digit(P)+I,I=D>>>30,_.__setDigit(P,1073741823&D);for(;P<c.length;P++){var j=c.__digit(P)+I;I=j>>>30,_.__setDigit(P,1073741823&j)}return P<_.length&&_.__setDigit(P,I),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);for(var E,D=new g(c.length,v),_=0,I=0;I<d.length;I++)E=c.__digit(I)-d.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);for(;I<c.length;I++){var P=c.__digit(I)-_;_=1&P>>>30,D.__setDigit(I,1073741823&P)}return D.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length;v===null?v=new g(E,d):v.sign=d;for(var D,_=1,I=0;I<E;I++)D=c.__digit(I)+_,_=D>>>30,v.__setDigit(I,1073741823&D);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var E,D=new g(d,!1),_=1,I=0;I<v;I++)E=c.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var P=v;P<d;P++)D.__setDigit(P,0);return D}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=P}var j=_;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)&d.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;E<D&&(_=E);var I=E;v===null?v=new g(I,!1):I=v.length;for(var P=0;P<_;P++)v.__setDigit(P,c.__digit(P)&~d.__digit(P));for(;P<E;P++)v.__setDigit(P,c.__digit(P));for(;P<I;P++)v.__setDigit(P,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)|d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)^d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var E=c.length-1;0<=E&&c.__digit(E)===d.__digit(E);)E--;return 0>E?0:c.__unsignedDigit(E)>d.__unsignedDigit(E)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,E){if(d!==0){for(var D=32767&d,_=d>>>15,I=0,P=0,j=0;j<c.length;j++,E++){var O=v.__digit(E),X=c.__digit(j),re=32767&X,Z=X>>>15,V=g.__imul(re,D),ue=g.__imul(re,_),pe=g.__imul(Z,D),we=g.__imul(Z,_);O+=P+V+I,I=O>>>30,O&=1073741823,O+=((32767&ue)<<15)+((32767&pe)<<15),I+=O>>>30,P=we+(ue>>>15)+(pe>>>15),v.__setDigit(E,1073741823&O)}for(;I!==0||P!==0;E++){var _e=v.__digit(E);_e+=I+P,P=0,I=_e>>>30,v.__setDigit(E,1073741823&_e)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,E,D){for(var _=v,I=0,P=0;P<E;P++){var j=c.__digit(P),O=g.__imul(32767&j,d),X=g.__imul(j>>>15,d),re=O+((32767&X)<<15)+I+_;_=re>>>30,I=X>>>15,D.__setDigit(P,1073741823&re)}if(D.length>E)for(D.__setDigit(E++,_+I);E<D.length;)D.__setDigit(E++,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 g(c.length,!1));for(var E=0,D=2*c.length-1;0<=D;D-=2){var _=(E<<15|c.__halfDigit(D))>>>0,I=0|_/d;E=0|_%d,_=(E<<15|c.__halfDigit(D-1))>>>0;var P=0|_/d;E=0|_%d,v.__setDigit(D>>>1,I<<15|P)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,E=0,D=2*c.length-1;0<=D;D--)v=(E<<15|c.__halfDigit(D))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(c,d,v,E){var D=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-D,P=null;v&&(P=new g(I+2>>>1,!1),P.__initializeDigits());var j=new g(D+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(D-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(c,O,1),re=d.__halfDigit(D-1),Z=0,V=I;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+D);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+D-1))>>>0;ue=0|we/re;for(var _e=0|we%re,He=d.__halfDigit(D-2),Ve=X.__halfDigit(V+D-2);g.__imul(ue,He)>>>0>(_e<<16|Ve)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,D+1);ot!==0&&(ot=X.__inplaceAdd(d,V,D),X.__setHalfDigit(V+D,32767&X.__halfDigit(V+D)+ot),ue--),v&&(1&V?Z=ue<<15:P.__setDigit(V>>>1,Z|ue))}if(E)return X.__inplaceRightShift(O),v?{quotient:P,remainder:X}:X;if(v)return P;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var E=c.length,D=E+v,_=new g(D,!1);if(d===0){for(var I=0;I<E;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(E,0),_}for(var P,j=0,O=0;O<E;O++)P=c.__digit(O),_.__setDigit(O,1073741823&P<<d|j),j=P>>>30-d;return 0<v&&_.__setDigit(E,j),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var E=0|v/30,D=v%30,_=c.length,I=D!==0&&c.__digit(_-1)>>>30-D!=0,P=_+E+(I?1:0),j=new g(P,c.sign);if(D===0){for(var O=0;O<E;O++)j.__setDigit(O,0);for(;O<P;O++)j.__setDigit(O,c.__digit(O-E))}else{for(var X=0,re=0;re<E;re++)j.__setDigit(re,0);for(var Z,V=0;V<_;V++)Z=c.__digit(V),j.__setDigit(V+E,1073741823&Z<<D|X),X=Z>>>30-D;if(I)j.__setDigit(_+E,X);else if(X!==0)throw new Error("implementation bug")}return j.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,E=c.sign,D=g.__toShiftAmount(d);if(0>D)return g.__rightShiftByMaximum(E);var _=0|D/30,I=D%30,P=v-_;if(0>=P)return g.__rightShiftByMaximum(E);var j=!1;if(E){var O=(1<<I)-1;if(c.__digit(_)&O)j=!0;else for(var X=0;X<_;X++)if(c.__digit(X)!==0){j=!0;break}}if(j&&I===0){var re=c.__digit(v-1),Z=~re==0;Z&&P++}var V=new g(P,E);if(I===0){V.__setDigit(P-1,0);for(var ue=_;ue<v;ue++)V.__setDigit(ue-_,c.__digit(ue))}else{for(var pe,we=c.__digit(_)>>>I,_e=v-_-1,He=0;He<_e;He++)pe=c.__digit(He+_+1),V.__setDigit(He,1073741823&pe<<30-I|we),we=pe>>>I;V.__setDigit(_e,we)}return j&&(V=g.__absoluteAddOne(V,!0,V)),V.__trim()}},{key:"__rightShiftByMaximum",value:function(c){return c?g.__oneDigit(1,!0):g.__zero()}},{key:"__toShiftAmount",value:function(c){if(1<c.length)return-1;var d=c.__unsignedDigit(0);return d>g.__kMaxLengthBits?-1:d}},{key:"__toPrimitive",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"default";if(ae(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&ae(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(ae(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=c.valueOf;if(E){var D=E.call(c);if(ae(D)!=="object")return D}var _=c.toString;if(_){var I=_.call(c);if(ae(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return g.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return ae(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,E=new g(v,d.sign),D=v-1,_=0;_<D;_++)E.__setDigit(_,d.__digit(_));var I=d.__digit(D);if(c%30!=0){var P=32-c%30;I=I<<P>>>P}return E.__setDigit(D,I),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var E=Math.min,D,_=0|(c+29)/30,I=new g(_,v),P=0,j=_-1,O=0,X=E(j,d.length);P<X;P++)D=0-d.__digit(P)-O,O=1&D>>>30,I.__setDigit(P,1073741823&D);for(;P<j;P++)I.__setDigit(P,0|1073741823&-O);var re,Z=j<d.length?d.__digit(j):0,V=c%30;if(V===0)re=0-Z-O,re&=1073741823;else{var ue=32-V;Z=Z<<ue>>>ue;var pe=1<<32-ue;re=pe-Z-O,re&=pe-1}return I.__setDigit(j,re),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 g.__kBitConversionDouble[0]=-0,g.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(Te(Array));return ce.__kMaxLength=33554432,ce.__kMaxLengthBits=ce.__kMaxLength<<5,ce.__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],ce.__kBitsPerCharTableShift=5,ce.__kBitsPerCharTableMultiplier=1<<ce.__kBitsPerCharTableShift,ce.__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"],ce.__kBitConversionBuffer=new ArrayBuffer(8),ce.__kBitConversionDouble=new Float64Array(ce.__kBitConversionBuffer),ce.__kBitConversionInts=new Int32Array(ce.__kBitConversionBuffer),ce.__kBitConversionIntHigh=ce.__detectBigEndian()?0:1,ce.__kBitConversionIntLow=ce.__detectBigEndian()?1:0,ce.__clz30=t?function(F){return t(F)-2}:function(F){var z=Math.LN2,Y=Math.log;return F===0?30:0|29-(0|Y(F>>>0)/z)},ce.__imul=n||function(F,z){return 0|F*z},ce})});var Gu=qc((Dp,Wu)=>{Wu.exports=Am;function Am(n,t,e,r){var i,o,a;return function(){if(a=this,o=Array.prototype.slice.call(arguments),i&&(e||r))return;if(!e)return u(),i=setTimeout(l,t),i;i=setTimeout(u,t),n.apply(a,o);function l(){u(),n.apply(a,o)}function u(){clearTimeout(i),i=null}}}});var k=Wc(Kc(),1),Wt=k.default.BigInt(0),Mi=k.default.BigInt(1),Bs=k.default.BigInt(2),Dh=k.default.BigInt(10),Eh=k.default.BigInt(24),_h=k.default.BigInt(60),Mh=k.default.BigInt(1e3),ji=k.default.BigInt(1e6),vi=k.default.BigInt(1e9),Il=k.default.multiply(k.default.BigInt(3600),vi),Th=k.default.multiply(_h,vi),Gn=k.default.multiply(Il,Eh);function Tn(n){return typeof n=="bigint"?k.default.BigInt(n.toString(10)):n}function Rl(n){return k.default.equal(k.default.remainder(n,Bs),Wt)}function lr(n){return k.default.lessThan(n,Wt)?k.default.unaryMinus(n):n}function So(n,t){return k.default.lessThan(n,t)?-1:k.default.greaterThan(n,t)?1:0}function ui(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Zc,Jc,he="slot-epochNanoSeconds",me="slot-iso-date",Be="slot-iso-date-time",je="slot-time",U="slot-calendar",xl="slot-date-brand",Al="slot-year-month-brand",Ll="slot-month-day-brand",ke="slot-time-zone",gt="slot-years",yt="slot-months",xt="slot-weeks",vt="slot-days",bt="slot-hours",wt="slot-minutes",Dt="slot-seconds",Et="slot-milliseconds",_t="slot-microseconds",At="slot-nanoseconds",Nl="date",Ol="ym",Hl="md",Bl="time",Fl="datetime",Yl="instant",wr="original",Rr="timezone-canonical",Xa="timezone-original",di="calendar-id",$l="locale",Qa="options",jl=new WeakMap,es=Symbol.for("@@Temporal__GetSlots");(Zc=globalThis)[es]||(Zc[es]=function(n){return jl.get(n)});var jo=globalThis[es],ts=Symbol.for("@@Temporal__CreateSlots");(Jc=globalThis)[ts]||(Jc[ts]=function(n){jl.set(n,Object.create(null))});var On=globalThis[ts];function kt(n,...t){if(!n||typeof n!="object")return!1;let e=jo(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=jo(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function ve(n,t,e){let r=jo(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 ns={};function Hn(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))}rs(t,n),rs(`${t}.prototype`,n.prototype)}function rs(n,t){let e=`%${n}%`;if(ns[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);ns[e]=t}function it(n){return ns[n]}function Ar(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 Wa(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 zo(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 Uo(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 Re=class n{constructor(t){this.totalNs=Tn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,vi)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,vi))}static validateNew(t,e){if(k.default.greaterThan(lr(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=k.default.subtract(Tn(t),Tn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=k.default.add(k.default.add(k.default.add(k.default.add(k.default.add(k.default.BigInt(a),k.default.multiply(k.default.BigInt(o),Mh)),k.default.multiply(k.default.BigInt(i),ji)),k.default.multiply(k.default.BigInt(r),vi)),k.default.multiply(k.default.BigInt(e),Th)),k.default.multiply(k.default.BigInt(t),Il));return n.validateNew(s,"total")}abs(){return new n(lr(this.totalNs))}add(t){return n.validateNew(k.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(k.default.add(this.totalNs,k.default.multiply(k.default.BigInt(t),Gn)),"sum")}addToEpochNs(t){return k.default.add(Tn(t),this.totalNs)}cmp(t){return So(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=ui(this.totalNs,k.default.BigInt(t));return{quotient:k.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=Tn(t),r=k.default.BigInt(e),{quotient:i,remainder:o}=ui(this.totalNs,r),a=[],s,l=(k.default.lessThan(this.totalNs,Wt)?-1:1)*Math.sign(k.default.toNumber(e));for(;!k.default.equal(o,Wt)&&a.length<50;)o=k.default.multiply(o,Dh),{quotient:s,remainder:o}=ui(o,r),a.push(Math.abs(k.default.toNumber(s)));return l*+(lr(i).toString()+"."+a.join(""))}isZero(){return k.default.equal(this.totalNs,Wt)}round(t,e){let r=Tn(t);if(k.default.equal(r,Mi))return this;let{quotient:i,remainder:o}=ui(this.totalNs,r),a=k.default.lessThan(this.totalNs,Wt)?"negative":"positive",s=k.default.multiply(lr(i),r),l=k.default.add(s,r),u=So(lr(k.default.multiply(o,Bs)),r),h=zo(e,a),p=k.default.equal(lr(this.totalNs),s)?s:Uo(s,l,u,Rl(i),h),y=a==="positive"?p:k.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Wt))}subtract(t){return n.validateNew(k.default.subtract(this.totalNs,t.totalNs),"difference")}};Re.MAX=k.default.BigInt("9007199254740991999999999"),Re.ZERO=new Re(Wt);var Xc=/[A-Za-z._][A-Za-z._0-9+-]*/,zi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Xc.source})(?:\\/(?:${Xc.source}))*)`),zl=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,is=/(?:0[1-9]|[12]\d|3[01])/,Sh=new RegExp(`(${zl.source})(?:-(${Co.source})-(${is.source})|(${Co.source})(${is.source}))`),Ul=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Vl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,ql=new RegExp(`([zZ])|${Vl.source}?`),Hr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Ch=new RegExp([`^${Sh.source}`,`(?:(?:[tT]|\\s+)${Ul.source}(?:${ql.source})?)?`,`(?:\\[!?(${zi.source})\\])?`,`((?:${Hr.source})*)$`].join("")),kh=new RegExp([`^[tT]?${Ul.source}`,`(?:${ql.source})?`,`(?:\\[!?${zi.source}\\])?`,`((?:${Hr.source})*)$`].join("")),Ph=new RegExp(`^(${zl.source})-?(${Co.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ih=new RegExp(`^(?:--)?(${Co.source})-?(${is.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ga=/(\d+)(?:[.,](\d{1,9}))?/,Rh=new RegExp(`(?:${Ga.source}H)?(?:${Ga.source}M)?(?:${Ga.source}S)?`),xh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Rh.source})?$`,"i"),Kn=864e5,ko=1e6*Kn,Ah=6e10,Wl=1e8*Kn,Br=cn(Wl),Ti=k.default.unaryMinus(Br),Lh=k.default.add(k.default.subtract(Ti,Gn),Mi),Nh=k.default.subtract(k.default.add(Br,Gn),Mi),Oh=146097*Kn,Qc=-271821,el=275760,bi=Date.UTC(1847,0,1),Hh=["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"],Bh=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 ze(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Vo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function qo(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function fe(n){let t=Vo(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 tl(n,t){let e=fe(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 an(n){let t=Vo(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 Si(n,t){return String(n).padStart(t,"0")}function Ge(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function os(n,t){if(ze(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 as=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],Fh={era:qo,eraYear:fe,year:fe,month:tl,monthCode:function(n){let t=Ge(os(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:tl,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ge(os(n));return Wr(t),t},timeZone:St},Yh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Fr=[["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"]],nl=Object.fromEntries(Fr.map(n=>[n[0],n[1]])),$h=Object.fromEntries(Fr.map(([n,t])=>[t,n])),wi=Fr.map(([,n])=>n),Yr={day:ko,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Po=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],jh=Intl.DateTimeFormat,rl=new Map;function Gl(n){let t=Ri(n),e=rl.get(t);return e===void 0&&(e=new jh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),rl.set(t,e)),e}function tt(n){return kt(n,he)&&!kt(n,ke,U)}function Ye(n){return kt(n,gt,yt,vt,bt,wt,Dt,Et,_t,At)}function $e(n){return kt(n,xl)}function Ue(n){return kt(n,je)}function Ne(n){return kt(n,Be)}function nt(n){return kt(n,Al)}function qt(n){return kt(n,Ll)}function be(n){return kt(n,he,ke,U)}function R(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function Ur(n){if(kt(n,U)||kt(n,ke))throw new TypeError("with() does not support a calendar or timeZone property");if(Ue(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 Ui(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Hr.lastIndex=0;e=Hr.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 wn(n){let t=Ch.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Wo(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,l=+(t[6]??0),u=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),w=+p.slice(3,6),T=+p.slice(6,9),S,x=!1;t[13]?(S=void 0,x=!0):t[14]&&(S=t[14]);let $=t[15];return Us(i,o,a,l,u,h,y,w,T),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:h,millisecond:y,microsecond:w,nanosecond:T}:"start-of-day",tzAnnotation:$,offset:S,z:x,calendar:e}}function Kl(n){let t=kh.exec(n),e,r,i,o,a,s,l;if(t){l=Wo(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let u=(t[4]??t[7]??"")+"000000000";if(o=+u.slice(0,3),a=+u.slice(3,6),s=+u.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let u,h;if({time:u,z:h,calendar:l}=wn(n),u==="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}=u)}if(Jo(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:l};try{let{month:u,day:h}=Ys(n);pr(1972,u,h)}catch{try{let{year:u,month:h}=Fs(n);pr(u,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:l}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function Fs(n){let t=Ph.exec(n),e,r,i,o;if(t){i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ys(n){let t=Ih.exec(n),e,r,i,o;if(t){if(i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Zl=new RegExp(`^${zi.source}$`,"i"),Jl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Xl(n){let t=Uh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function Wn(n){return Zl.test(n)||Xl(n),Jl.test(n)?{offsetMinutes:Wr(n)/6e10}:{tzName:n}}function Di(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":pr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=fu(i,o,a))}return{year:i,month:o,day:a}}function Go(n,t,e,r,i,o,a){let s=n,l=t,u=e,h=r,p=i,y=o;switch(a){case"reject":Jo(s,l,u,h,p,y);break;case"constrain":s=Mt(s,0,23),l=Mt(l,0,59),u=Mt(u,0,59),h=Mt(h,0,999),p=Mt(p,0,999),y=Mt(y,0,999)}return{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function Ql(n){if(!ze(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]=an(o))}if(!e)throw new TypeError("invalid duration-like");return t}function st({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function Me(n,t){return{isoDate:n,time:t}}function Ee(n){return xn(n,"overflow",["constrain","reject"],"constrain")}function Ei(n){return xn(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function ln(n,t){return xn(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function To(n,t){return xn(n,"offset",["prefer","use","ignore","reject"],t)}function Vi(n){return xn(n,"calendarName",["auto","always","never","critical"],"auto")}function Vr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=fe(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function qr(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 qi(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(qo(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 Wi(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 Ln=Symbol("~required~");function Nt(n,t,e,r,i=[]){let o=[];for(let u=0;u<Fr.length;u++){let h=Fr[u],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===Ln?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let u=0;u<o.length;u++){let h=o[u],p=$h[h];p!==void 0&&s.push(p)}let l=xn(n,t,s,a);if(l===void 0&&r===Ln)throw new RangeError(`${t} is required`);return l&&l in nl?nl[l]:l}function Ka(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",l=!1;if(ze(t)){if(be(t))return{zonedRelativeTo:t};if($e(t))return{plainRelativeTo:t};if(Ne(t))return{plainRelativeTo:Tt(m(t,Be).isoDate,m(t,U))};i=Xi(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Ki(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,w;if({year:p,month:y,day:w,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ge(t)),u)o=St(u),h?s="exact":a||(s="wall"),l=!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=Pt(i),e={year:p,month:y,day:w}}return o===void 0?{plainRelativeTo:Tt(e,i)}:{zonedRelativeTo:at(Io(e,r,s,s==="option"?Wr(a):0,o,"compatible","reject",l),o,i)}}function Sn(n){return m(n,gt)!==0?"year":m(n,yt)!==0?"month":m(n,xt)!==0?"week":m(n,vt)!==0?"day":m(n,bt)!==0?"hour":m(n,wt)!==0?"minute":m(n,Dt)!==0?"second":m(n,Et)!==0?"millisecond":m(n,_t)!==0?"microsecond":"nanosecond"}function In(n,t){return wi.indexOf(n)>wi.indexOf(t)?t:n}function mn(n){return n==="year"||n==="month"||n==="week"}function Cn(n){return mn(n)||n==="day"?"date":"time"}function Xn(n){return it("%calendarImpl%")(n)}function Gi(n){return it("%calendarImpl%")(m(n,U))}function Ct(n,t,e="date"){let r=Object.create(null),i=Xn(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 Jt(n,t,e,r,i){let o=Xn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),l=!1;a.sort();for(let u=0;u<a.length;u++){let h=a[u],p=t[h];if(p!==void 0)l=!0,s[h]=(0,Fh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=Yh[h]}}if(i==="partial"&&!l)throw new TypeError("no supported properties found");return s}function ss(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]=fe(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function hi(n,t){if(ze(n)){if($e(n))return Ee(ie(t)),Tt(m(n,me),m(n,U));if(be(n)){let l=rn(m(n,ke),m(n,he));return Ee(ie(t)),Tt(l.isoDate,m(n,U))}if(Ne(n))return Ee(ie(t)),Tt(m(n,Be).isoDate,m(n,U));let s=Xi(n);return Tt(Zn(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=wn(Ge(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Pt(o),Ee(ie(t)),Tt({year:e,month:r,day:i},o)}function Ki(n,t,e){return Me(Zn(n,t,e),Go(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function mi(n,t){let e,r,i;if(ze(n)){if(Ne(n))return Ee(ie(t)),en(m(n,Be),m(n,U));if(be(n)){let s=rn(m(n,ke),m(n,he));return Ee(ie(t)),en(s,m(n,U))}if($e(n))return Ee(ie(t)),en(Me(m(n,me),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,U));i=Xi(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Ki(i,o,a))}else{let o,a,s,l;if({year:a,month:s,day:l,time:r,calendar:i,z:o}=wn(Ge(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}),Us(a,s,l,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Pt(i),Ee(ie(t)),e={year:a,month:s,day:l}}return en(Me(e,r),i)}function nn(n){let t=it("%Temporal.Duration%");if(Ye(n))return new t(m(n,gt),m(n,yt),m(n,xt),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At));if(!ze(n))return function(i){let{years:o,months:a,weeks:s,days:l,hours:u,minutes:h,seconds:p,milliseconds:y,microseconds:w,nanoseconds:T}=function(S){let x=xh.exec(S);if(!x)throw new RangeError(`invalid duration: ${S}`);if(x.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${S}`);let $=x[1]==="-"?-1:1,W=x[2]===void 0?0:fe(x[2])*$,K=x[3]===void 0?0:fe(x[3])*$,ee=x[4]===void 0?0:fe(x[4])*$,oe=x[5]===void 0?0:fe(x[5])*$,ae=x[6]===void 0?0:fe(x[6])*$,Ce=x[7],Te=x[8],ce=x[9],F=x[10],z=x[11],Y=0,se=0,g=0;if(Ce!==void 0){if(Te??ce??F??z)throw new RangeError("only the smallest unit can be fractional");g=3600*fe((Ce+"000000000").slice(0,9))*$}else if(Y=Te===void 0?0:fe(Te)*$,ce!==void 0){if(F??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((ce+"000000000").slice(0,9))*$}else se=F===void 0?0:fe(F)*$,z!==void 0&&(g=fe((z+"000000000").slice(0,9))*$);let H=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return se+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(W,K,ee,oe,ae,Y,se,d,c,H),{years:W,months:K,weeks:ee,days:oe,hours:ae,minutes:Y,seconds:se,milliseconds:d,microseconds:c,nanoseconds:H}}(i);return new(it("%Temporal.Duration%"))(o,a,s,l,u,h,p,y,w,T)}(Ge(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Ql(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 pi(n){let t;if(ze(n)){if(tt(n)||be(n))return sn(m(n,he));t=os(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(S){let x=wn(S);if(!x.z&&!x.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return x}(Ge(t)),{hour:l=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:w=0}=o==="start-of-day"?{}:o,T=Ii(e,r,i,l,u,h,p,y,w-(s?0:Wr(a)));return Or(T.isoDate),sn(rt(T))}function il(n,t){if(ze(n)){if(qt(n))return Ee(ie(t)),Lr(m(n,me),m(n,U));let s;return kt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Ji(s)),Lr(Ro(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ys(Ge(n));if(o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t)),o==="iso8601")return Lr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return Dr(a),a=Ro(o,Ct(o,a,"month-day"),"constrain"),Lr(a,o)}function Vn(n,t){let e;if(ze(n)){if(Ue(n))return Ee(ie(t)),kn(m(n,je));if(Ne(n))return Ee(ie(t)),kn(m(n,Be).time);if(be(n)){let u=rn(m(n,ke),m(n,he));return Ee(ie(t)),kn(u.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=ss(n);e=Go(r,i,o,a,s,l,Ee(ie(t)))}else e=Kl(Ge(n)),Ee(ie(t));return kn(e)}function eu(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Vn(n),je)}function fi(n,t){if(ze(n)){if(nt(n))return Ee(ie(t)),Nr(m(n,me),m(n,U));let s=Xi(n);return Nr(Ci(s,Jt(s,n,["year","month","monthCode"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=Fs(Ge(n));o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t));let a={year:e,month:r,day:i};return Vs(a),a=Ci(o,Ct(o,a,"year-month"),"constrain"),Nr(a,o)}function Io(n,t,e,r,i,o,a,s){if(t==="start-of-day")return zn(i,n);let l=Me(n,t);if(e==="wall"||a==="ignore")return ct(i,l,o);if(e==="exact"||a==="use"){let p=Ii(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Or(p.isoDate);let y=rt(p);return vn(y),y}Or(n);let u=rt(l),h=ki(i,l);for(let p=0;p<h.length;p++){let y=h[p],w=k.default.toNumber(k.default.subtract(u,y)),T=qn(w,6e10,"halfExpand");if(w===r||s&&T===r)return y}if(a==="reject"){let p=cs(r),y=Pi(l,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return lu(h,i,l,o)}function gi(n,t){let e,r,i,o,a,s,l,u=!1,h="option";if(ze(n)){if(be(n)){let S=ie(t);return Ei(S),To(S,"reject"),Ee(S),at(m(n,he),m(n,ke),m(n,U))}a=Xi(n);let y=Jt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=y),o===void 0&&(h="wall");let w=ie(t);s=Ei(w),l=To(w,"reject");let T=Ee(w);({isoDate:e,time:r}=Ki(a,y,T))}else{let y,w,T,S,x;({year:T,month:S,day:x,time:r,tzAnnotation:y,offset:o,z:w,calendar:a}=function(W){let K=wn(W);if(!K.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return K}(Ge(n))),i=St(y),w?h="exact":o||(h="wall"),a||(a="iso8601"),a=Pt(a),u=!0;let $=ie(t);s=Ei($),l=To($,"reject"),Ee($),e={year:T,month:S,day:x}}let p=0;return h==="option"&&(p=Wr(o)),at(Io(e,r,h,p,i,s,l,u),i,a)}function tu(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,xl,!0)}function Tt(n,t){let e=it("%Temporal.PlainDate%"),r=Object.create(e.prototype);return tu(r,n,t),r}function nu(n,t,e){fr(t),On(n),ve(n,Be,t),ve(n,U,e)}function en(n,t){let e=it("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return nu(r,n,t),r}function ru(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Ll,!0)}function Lr(n,t){let e=it("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return ru(r,n,t),r}function iu(n,t){On(n),ve(n,je,t)}function kn(n){let t=it("%Temporal.PlainTime%"),e=Object.create(t.prototype);return iu(e,n),e}function ou(n,t,e){Vs(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Al,!0)}function Nr(n,t){let e=it("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return ou(r,n,t),r}function au(n,t){vn(t),On(n),ve(n,he,t)}function sn(n){let t=it("%Temporal.Instant%"),e=Object.create(t.prototype);return au(e,n),e}function su(n,t,e,r){vn(t),On(n),ve(n,he,t),ve(n,ke,e),ve(n,U,r)}function at(n,t,e="iso8601"){let r=it("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return su(i,n,t,e),i}function ol(n){return as.filter(t=>n[t]!==void 0)}function mr(n,t,e){let r=ol(e),i=Xn(n).fieldKeysToIgnore(r),o=Object.create(null),a=ol(t);for(let s=0;s<as.length;s++){let l,u=as[s];a.includes(u)&&!i.includes(u)&&(l=t[u]),r.includes(u)&&(l=e[u]),l!==void 0&&(o[u]=l)}return o}function Kt(n,t,e,r){let i=Xn(n).dateAdd(t,e,r);return Dr(i),i}function Zi(n,t,e,r){return Xn(n).dateUntil(t,e,r)}function Ji(n){if(ze(n)&&kt(n,U))return m(n,U);let t=Ge(n);try{return Pt(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Kl(t))}catch{try{({calendar:e}=Fs(t))}catch{({calendar:e}=Ys(t))}}}return e||(e="iso8601"),Pt(e)}function Xi(n){if(kt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Ji(t)}function yn(n,t){return Pt(n)===Pt(t)}function Zn(n,t,e){let r=Xn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return Dr(i),i}function Ci(n,t,e){let r=Xn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Vs(i),i}function Ro(n,t,e){let r=Xn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return Dr(i),i}function St(n){if(ze(n)&&be(n))return m(n,ke);let t=Ge(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:l}=function(u){if(Zl.test(u))return{tzAnnotation:u,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=wn(u);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Xl(u)}(o);return a?Wn(a):l?Wn("UTC"):s?Wn(s):void 0}(t);if(r!==void 0)return $s(r);let i=xo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function cu(n,t){if(n===t)return!0;let e=Wn(n).offsetMinutes,r=Wn(t).offsetMinutes;if(e===void 0&&r===void 0){let i=xo(t);if(!i)return!1;let o=xo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function Pn(n,t){let e=Wn(n).offsetMinutes;return e!==void 0?6e10*e:ls(n,t)}function cs(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}${Ko(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function rn(n,t){let e=Pn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:l,millisecond:u,microsecond:h,nanosecond:p}}=hu(t);return Ii(r,i,o,a,s,l,u,h,p+e)}function ct(n,t,e){return lu(ki(n,t),n,t,e)}function lu(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=rt(e),a=k.default.subtract(o,Gn);vn(a);let s=Pn(t,a),l=k.default.add(o,Gn);vn(l);let u=Pn(t,l)-s;switch(r){case"earlier":{let h=Re.fromComponents(0,0,0,0,0,-u),p=$r(e.time,h);return ki(t,Me(Ot(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Re.fromComponents(0,0,0,0,0,u),p=$r(e.time,h),y=ki(t,Me(Ot(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function ki(n,t){if(n==="UTC")return Or(t.isoDate),[rt(t)];let e=Wn(n).offsetMinutes;if(e!==void 0){let r=Ii(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);Or(r.isoDate);let i=rt(r);return vn(i),[i]}return Or(t.isoDate),function(r,i){let o=rt(i),a=k.default.subtract(o,Gn);k.default.lessThan(a,Ti)&&(a=o);let s=k.default.add(o,Gn);k.default.greaterThan(s,Br)&&(s=o);let l=ls(r,a),u=ls(r,s);return(l===u?[l]:[l,u]).map(p=>{let y=k.default.subtract(o,k.default.BigInt(p)),w=function(T,S){let{epochMilliseconds:x,time:{millisecond:$,microsecond:W,nanosecond:K}}=hu(S),{year:ee,month:oe,day:ae,hour:Ce,minute:Te,second:ce}=mu(T,x);return Ii(ee,oe,ae,Ce,Te,ce,$,W,K)}(r,y);if(jr(i,w)===0)return vn(y),y}).filter(p=>p!==void 0)}(n,t)}function zn(n,t){let e=Me(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=ki(n,e);if(r.length)return r[0];let i=rt(e),o=k.default.subtract(i,Gn);return vn(o),zs(n,o)}function Qi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+Si(Math.abs(n),6):Si(n,4),t}function Zt(n){return Si(n,2)}function uu(n,t){let e;if(t==="auto"){if(n===0)return"";e=Si(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=Si(n,9).slice(0,t)}return`.${e}`}function Ko(n,t,e,r,i){let o=`${Zt(n)}:${Zt(t)}`;return i==="minute"||(o+=`:${Zt(e)}`,o+=uu(r,i)),o}function al(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=Pi(rn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=du(Pn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,gt),r=m(n,yt),i=m(n,xt),o=m(n,vt),a=m(n,bt),s=m(n,wt),l=Lo(n),u="";e!==0&&(u+=`${Math.abs(e)}Y`),r!==0&&(u+=`${Math.abs(r)}M`),i!==0&&(u+=`${Math.abs(i)}W`),o!==0&&(u+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=Re.fromComponents(0,0,m(n,Dt),m(n,Et),m(n,_t),m(n,At));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Sn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${uu(Math.abs(p.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function sl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${Qi(e)}-${Zt(r)}-${Zt(i)}${Ui(m(n,U),t)}`}function cl({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return Ko(n,t,e,1e6*r+1e3*i+o,a)}function Pi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${Qi(i)}-${Zt(o)}-${Zt(a)}T${Ko(s,l,u,1e6*h+1e3*p+y,e)}${Ui(t,r)}`}function ll(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Zt(r)}-${Zt(i)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Qi(e)}-${o}`);let s=Ui(a,t);return s&&(o+=s),o}function ul(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Qi(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=Ui(a,t);return s&&(o+=s),o}function dl(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,he);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=ms(a,p,h,y)}let s=m(n,ke),l=Pn(s,a),u=Pi(rn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=du(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=Ui(m(n,U),e),u}function hl(n){return Jl.test(n)}function Wr(n){let t=Vh.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 si,zh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(si===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){si=new Map;for(let a=0;a<o.length;a++){let s=o[a];si.set(Ri(s),s)}}else si=null}let t=Ri(n),e=si?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Gl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),Bh.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||zh[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 dr(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=mu(n,t),l=t%1e3;return l<0&&(l+=1e3),1e6*(js({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:l}})-t)}function ls(n,t){return dr(n,on(t,"floor"))}function $s(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${Ko(Math.floor(e/60),e%60,0,0,"minute")}`}function du(n){return $s(qn(n,Ah,"halfExpand")/6e10)}function js({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,l=(n-s)/400,u=new Date;return u.setUTCHours(r,i,o,a),u.setUTCFullYear(s,t-1,e),u.getTime()+Oh*l}function rt(n){let t=js(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(cn(t),k.default.BigInt(e))}function hu(n){let t=on(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,ji));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 zs(n,t){if(n==="UTC")return null;let e=on(t,"floor");if(e<bi)return zs(n,cn(bi));let r=Date.now(),i=Math.max(e,r)+366*Kn*3,o=e,a=dr(n,o),s=o,l=a;for(;a===l&&o<i;){if(s=o+2*Kn*7,s>Wl)return null;l=dr(n,s),a===l&&(o=s)}return a===l?null:cn(_u(u=>dr(n,u),o,s,a,l))}function us(n,t){if(n==="UTC")return null;let e=on(t,"ceil"),r=Date.now(),i=r+366*Kn*3;if(e>i){let u=us(n,cn(i));if(u===null||k.default.lessThan(u,cn(r)))return u}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(u<e)return us(n,cn(u))}let o=e-1;if(o<bi)return null;let a=dr(n,o),s=o,l=a;for(;a===l&&o>bi;){if(s=o-2*Kn*7,s<bi)return null;l=dr(n,s),a===l&&(o=s)}return a===l?null:cn(_u(u=>dr(n,u),s,o,l,a))}function mu(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 l=r[4]==="24"?0:+r[4],u=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(l)&&Number.isFinite(u)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:l,minute:u,second:h}}(Gl(n).format(t))}function Ao(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function hr(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]}[Ao(n)?"leapyear":"standard"][t-1]}function Lo(n){let t=[m(n,gt),m(n,yt),m(n,xt),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Zo(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 pu(n){let t=Zo(n.date);return t!==0?t:n.time.sign()}function ur(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 Ot(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}=ur(r,i));let a=146097;if(Math.abs(o)>a){let u=Math.trunc(o/a);r+=400*u,o-=u*a}let s=0,l=i>2?r:r-1;for(;s=Ao(l)?366:365,o<-s;)r-=1,l-=1,o+=s;for(l+=1;s=Ao(l)?366:365,o>s;)r+=1,l+=1,o-=s;for(;o<1;)({year:r,month:i}=ur(r,i-1)),o+=hr(r,i);for(;o>hr(r,i);)o-=hr(r,i),{year:r,month:i}=ur(r,i+1);return{year:r,month:i,day:o}}function Ii(n,t,e,r,i,o,a,s,l){let u=Un(r,i,o,a,s,l);return Me(Ot(n,t,e+u.deltaDays),u)}function Un(n,t,e,r,i,o){let a,s=n,l=t,u=e,h=r,p=i,y=o;({div:a,mod:y}=Ar(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Ar(p,3),h+=a,p<0&&(h-=1,p+=1e3),u+=Math.trunc(h/1e3),h%=1e3,h<0&&(u-=1,h+=1e3),l+=Math.trunc(u/60),u%=60,u<0&&(l-=1,u+=60),s+=Math.trunc(l/60),l%=60,l<0&&(s-=1,l+=60);let w=Math.trunc(s/24);return s%=24,s<0&&(w-=1,s+=24),w+=0,s+=0,l+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:w,hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function ml(n,t){let e=st(n,0);if(Zo(e)===0)return n.days;let r=m(t,me),i=Kt(m(t,U),r,e,"constrain"),o=gr(r.year,r.month-1,r.day),a=gr(i.year,i.month-1,i.day)-o;return n.days+a}function Ht(n){return new(it("%Temporal.Duration%"))(-m(n,gt),-m(n,yt),-m(n,xt),-m(n,vt),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,At))}function Mt(n,t,e){return Math.min(e,Math.max(t,n))}function fu(n,t,e){let r=Mt(t,1,12);return{year:n,month:r,day:Mt(e,1,hr(n,r))}}function Ke(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function pr(n,t,e){Ke(t,1,12),Ke(e,1,hr(n,t))}function Dr(n){fr(Me(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Jo(n,t,e,r,i,o){Ke(n,0,23),Ke(t,0,59),Ke(e,0,59),Ke(r,0,999),Ke(i,0,999),Ke(o,0,999)}function Us(n,t,e,r,i,o,a,s,l){pr(n,t,e),Jo(r,i,o,a,s,l)}function fr(n){let t=rt(n);(k.default.lessThan(t,Lh)||k.default.greaterThan(t,Nh))&&vn(t)}function ds(n){rt(n)}function vn(n){if(k.default.lessThan(n,Ti)||k.default.greaterThan(n,Br))throw new RangeError("date/time value is outside of supported range")}function Vs({year:n,month:t}){Ke(n,Qc,el),n===Qc?Ke(t,4,12):n===el&&Ke(t,1,9)}function Xo(n,t,e,r,i,o,a,s,l,u){let h=0,p=[n,t,e,r,i,o,a,s,l,u];for(let $=0;$<p.length;$++){let W=p[$];if(W===1/0||W===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(W!==0){let K=W<0?-1:1;if(h!==0&&K!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=K}}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 y=Ar(s,3),w=Ar(l,6),T=Ar(u,9),S=Ar(1e6*y.mod+1e3*w.mod+T.mod,9).div,x=86400*r+3600*i+60*o+a+y.div+w.div+T.div+S;if(!Number.isSafeInteger(x))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function xr(n){return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,xt),days:m(n,vt)},time:Re.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At))}}function fn(n){let t=Re.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At)).add24HourDays(m(n,vt));return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,xt),days:0},time:t}}function gu(n){let t=fn(n),e=Math.trunc(t.time.sec/86400);return Xo(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function tn(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,l=0,u=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,l=Math.trunc(s/60),s%=60,u=Math.trunc(l/24),l%=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,l=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=Wa(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Wa(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Wa(a,9,r),a=0}return new(it("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*u,e*l,e*s,e*a,e*o,e*i,e*r)}function Rn(n,t){return Zo(n),t.sign(),{date:n,time:t}}function gr(n,t,e){return js({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Kn}function Or({year:n,month:t,day:e}){if(Math.abs(gr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function qs(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 Re.fromComponents(e,r,i,o,a,s)}function Ws(n,t,e,r,i){let o=Re.fromEpochNsDiff(t,n);return o=No(o,e,r,i),Rn({years:0,months:0,weeks:0,days:0},o)}function yu(n,t,e,r){ds(n),ds(t);let i=qs(n.time,t.time),o=i.sign(),a=bn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Ot(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let l=In("day",r),u=Zi(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),Rn(u,i)}function vu(n,t,e,r,i){let o=k.default.subtract(t,n);if(k.default.equal(o,Wt))return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};let a=k.default.lessThan(o,Wt)?-1:1,s=rn(e,n),l=rn(e,t),u,h=0,p=a===1?2:1,y=qs(s.time,l.time);for(y.sign()===-a&&h++;h<=p;h++){u=Me(Ot(l.isoDate.year,l.isoDate.month,l.isoDate.day-h*a),s.time);let T=ct(e,u,"compatible");if(y=Re.fromEpochNsDiff(t,T),y.sign()!==-a)break}let w=In("day",i);return Rn(Zi(r,s.isoDate,u.isoDate,w),y)}function bu(n,t,e,r,i,o,a,s,l){let u,h,p,y,w=t;switch(s){case"year":{let Y=qn(w.date.years,a,"trunc");u=Y,h=Y+a*n,p={years:u,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let Y=qn(w.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,0,0,u),y=st(w.date,0,0,h);break}case"week":{let Y=st(w.date,0,0),se=Kt(o,r.isoDate,Y,"constrain"),g=Zi(o,se,Ot(se.year,se.month,se.day+w.date.days),"week"),H=qn(w.date.weeks+g.weeks,a,"trunc");u=H,h=H+a*n,p=st(w.date,0,u),y=st(w.date,0,h);break}case"day":{let Y=qn(w.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,u),y=st(w.date,h);break}}let T=Kt(o,r.isoDate,p,"constrain"),S=Kt(o,r.isoDate,y,"constrain"),x,$,W=Me(T,r.time),K=Me(S,r.time);i?(x=ct(i,W,"compatible"),$=ct(i,K,"compatible")):(x=rt(W),$=rt(K));let ee=Re.fromEpochNsDiff(e,x),oe=Re.fromEpochNsDiff($,x),ae=zo(l,n<0?"negative":"positive"),Ce=ee.add(ee).abs().subtract(oe.abs()).sign(),Te=Math.abs(u)/a%2==0,ce=ee.isZero()?Math.abs(u):ee.cmp(oe)?Uo(Math.abs(u),Math.abs(h),Ce,Te,ae):Math.abs(h),F=new Re(k.default.add(k.default.multiply(oe.totalNs,k.default.BigInt(u)),k.default.multiply(ee.totalNs,k.default.BigInt(a*n)))).fdiv(oe.totalNs),z=ce===Math.abs(h);return w={date:z?y:p,time:Re.ZERO},{nudgeResult:{duration:w,nudgedEpochNs:z?$:x,didExpandCalendarUnit:z},total:F}}function Qo(n,t,e,r,i,o,a,s,l){let u=n,h=mn(s)||r&&s==="day",p=pu(u)<0?-1:1,y;return h?{nudgeResult:y}=bu(p,u,t,e,r,i,a,s,l):y=r?function(w,T,S,x,$,W,K,ee){let oe=T,ae=Kt($,S.isoDate,oe.date,"constrain"),Ce=Me(ae,S.time),Te=Me(Ot(ae.year,ae.month,ae.day+w),S.time),ce=ct(x,Ce,"compatible"),F=ct(x,Te,"compatible"),z=Re.fromEpochNsDiff(F,ce);if(z.sign()!==w)throw new RangeError("time zone returned inconsistent Instants");let Y=k.default.BigInt(Yr[K]*W),se=oe.time.round(Y,ee),g=se.subtract(z),H=g.sign()!==-w,c,d;return H?(c=w,se=g.round(Y,ee),d=se.addToEpochNs(F)):(c=0,d=se.addToEpochNs(ce)),{duration:Rn(st(oe.date,oe.date.days+c),se),nudgedEpochNs:d,didExpandCalendarUnit:H}}(p,u,e,r,i,a,s,l):function(w,T,S,x,$,W){let K=w,ee=K.time.add24HourDays(K.date.days),oe=ee.round(k.default.BigInt(x*Yr[$]),W),ae=oe.subtract(ee),{quotient:Ce}=ee.divmod(ko),{quotient:Te}=oe.divmod(ko),ce=Math.sign(Te-Ce)===ee.sign(),F=ae.addToEpochNs(T),z=0,Y=oe;return Cn(S)==="date"&&(z=Te,Y=oe.add(Re.fromComponents(24*-Te,0,0,0,0,0))),{duration:{date:st(K.date,z),time:Y},nudgedEpochNs:F,didExpandCalendarUnit:ce}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(w,T,S,x,$,W,K,ee){let oe=T;if(ee===K)return oe;let ae=wi.indexOf(K);for(let Ce=wi.indexOf(ee)-1;Ce>=ae;Ce--){let Te=wi[Ce];if(Te==="week"&&K!=="week")continue;let ce;switch(Te){case"year":ce={years:oe.date.years+w,months:0,weeks:0,days:0};break;case"month":{let Y=oe.date.months+w;ce=st(oe.date,0,0,Y);break}case"week":{let Y=oe.date.weeks+w;ce=st(oe.date,0,Y);break}}let F=Me(Kt(W,x.isoDate,ce,"constrain"),x.time),z;if(z=$?ct($,F,"compatible"):rt(F),So(S,z)===-w)break;oe={date:ce,time:Re.ZERO}}return oe}(p,u,y.nudgedEpochNs,e,r,i,o,In(s,"day"))),u}function pl(n,t,e,r,i,o){return mn(o)||r&&o==="day"?bu(pu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:_i(n.time.add24HourDays(n.date.days),o)}function wu(n,t,e,r,i,o,a){if(jr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};fr(n),fr(t);let s=yu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,rt(t),n,null,e,r,i,o,a)}function Du(n,t,e,r,i,o,a,s){if(Cn(i)==="time")return Ws(n,t,o,a,s);let l=vu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Qo(l,t,rn(e,n),e,r,i,o,a,s)}function Gr(n,t,e,r,i,o){let a=Fr.reduce((w,T)=>{let S=T[0],x=T[1],$=T[2];return e!=="datetime"&&$!==e||r.includes(x)||w.push(x,S),w},[]),s=Nt(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=Vr(t),u=ln(t,"trunc");n==="since"&&(u=function(w){switch(w){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return w}}(u));let h=Nt(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=In(o,h);if(s==="auto"&&(s=p),In(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let y={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return y!==void 0&&qr(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:h}}function fl(n,t,e,r){let i=pi(e),o=Gr(n,ie(r),"time",[],"nanosecond","second"),a=tn(Ws(m(t,he),m(i,he),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=Ht(a)),a}function gl(n,t,e,r){let i=hi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"date",[],"day","day"),l=it("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new l;let p={date:Zi(o,u,h,s.largestUnit),time:Re.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let w=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,rt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),w,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=tn(p,"day");return n==="since"&&(y=Ht(y)),y}function yl(n,t,e,r){let i=mi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"datetime",[],"nanosecond","day"),l=it("%Temporal.Duration%"),u=m(t,Be),h=m(i,Be);if(jr(u,h)===0)return new l;let p=tn(wu(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Ht(p)),p}function vl(n,t,e,r){let i=Vn(e),o=Gr(n,ie(r),"time",[],"nanosecond","hour"),a=qs(m(t,je),m(i,je));a=No(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=tn(Rn({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Ht(s)),s}function bl(n,t,e,r){let i=fi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"date",["week","day"],"month","year"),l=it("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new l;let u=Ct(o,m(t,me),"year-month");u.day=1;let h=Zn(o,u,"constrain"),p=Ct(o,m(i,me),"year-month");p.day=1;let y=Zn(o,p,"constrain"),w={date:st(Zi(o,h,y,s.largestUnit),0,0),time:Re.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let S=Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});w=Qo(w,rt(Me(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),S,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let T=tn(w,"day");return n==="since"&&(T=Ht(T)),T}function wl(n,t,e,r){let i=gi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"datetime",[],"nanosecond","hour"),l=m(t,he),u=m(i,he),h=it("%Temporal.Duration%"),p;if(Cn(s.largestUnit)!=="date")p=tn(Ws(l,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,ke);if(!cu(y,m(i,ke)))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(k.default.equal(l,u))return new h;p=tn(Du(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Ht(p)),p}function $r({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,l=o;return s+=a.sec,l+=a.subsec,Un(n,t,s,r,i,l)}function hs(n,t){let e=t.addToEpochNs(n);return vn(e),e}function yi(n,t,e,r,i="constrain"){if(Zo(r.date)===0)return hs(n,r.time);let o=rn(t,n);return hs(ct(t,Me(Kt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function Dl(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=In(Sn(t),Sn(r));if(mn(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=fn(t),a=fn(r);return tn(Rn({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function El(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=Sn(r);if(Cn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=fn(r);return sn(hs(m(t,he),o.time))}function _l(n,t,e,r){let i=m(t,U),o=nn(e);n==="subtract"&&(o=Ht(o));let a=gu(o),s=Ee(ie(r));return Tt(Kt(i,m(t,me),a,s),i)}function Ml(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=m(t,U),s=fn(i),l=m(t,Be),u=$r(l.time,s.time),h=st(s.date,u.deltaDays);return Xo(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),en(Me(Kt(a,l.isoDate,h,o),u),a)}function Tl(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=fn(r),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=$r(m(t,je),i.time);return kn(Go(o,a,s,l,u,h,"reject"))}function Sl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=Lo(i),s=m(t,U),l=Ct(s,m(t,me),"year-month");l.day=1;let u=Zn(s,l,"constrain");if(a<0){let p=Kt(s,u,{months:1},"constrain");u=Ot(p.year,p.month,p.day-1)}let h=gu(i);return Dr(u),Nr(Ci(s,Ct(s,Kt(s,u,h,o),"year-month"),o),s)}function Cl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=m(t,ke),s=m(t,U),l=xr(i);return at(yi(m(t,he),a,s,l,o),a,s)}function qn(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,l=Lt(Math.abs(2*i)-t),u=a%2==0,h=zo(e,o),p=i===0?a:Uo(a,s,l,u,h);return t*(o==="positive"?p:-p)}function ms(n,t,e,r){let i=Yr[e]*t;return function(o,a,s){let l=Tn(o),u=Tn(a),h=k.default.divide(l,u),p=k.default.remainder(l,u),y=zo(s,"positive"),w,T;k.default.lessThan(l,Wt)?(w=k.default.subtract(h,Mi),T=h):(w=h,T=k.default.add(h,Mi));let S=So(lr(k.default.multiply(p,Bs)),u)*(k.default.lessThan(l,Wt)?-1:1)+0,x=k.default.equal(p,Wt)?h:Uo(w,T,S,Rl(w),y);return k.default.multiply(x,u)}(n,k.default.BigInt(i),r)}function ps(n,t,e,r){ds(n);let{year:i,month:o,day:a}=n.isoDate,s=fs(n.time,t,e,r);return Me(Ot(i,o,a+s.deltaDays),s)}function fs({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,l){let u;switch(s){case"day":case"hour":u=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":u=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":u=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":u=1e3*(1e3*r+i)+o;break;case"microsecond":u=1e3*i+o;break;case"nanosecond":u=o}let h=Yr[s],p=qn(u,h*a,l)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return Un(p,0,0,0,0,0);case"minute":return Un(n,p,0,0,0,0);case"second":return Un(n,t,p,0,0,0);case"millisecond":return Un(n,t,e,p,0,0);case"microsecond":return Un(n,t,e,r,p,0);case"nanosecond":return Un(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function No(n,t,e,r){let i=Yr[e];return n.round(k.default.BigInt(i*t),r)}function _i(n,t){let e=Yr[t];return n.fdiv(k.default.BigInt(e))}function bn(n,t){return n.year!==t.year?Lt(n.year-t.year):n.month!==t.month?Lt(n.month-t.month):n.day!==t.day?Lt(n.day-t.day):0}function gs(n,t){return n.hour!==t.hour?Lt(n.hour-t.hour):n.minute!==t.minute?Lt(n.minute-t.minute):n.second!==t.second?Lt(n.second-t.second):n.millisecond!==t.millisecond?Lt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Lt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Lt(n.nanosecond-t.nanosecond):0}function jr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:gs(n.time,t.time)}function Eu(n){let t=Oo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function on(n,t){let e=Tn(n),{quotient:r,remainder:i}=ui(e,ji),o=k.default.toNumber(r);return t==="floor"&&k.default.toNumber(i)<0&&(o-=1),t==="ceil"&&k.default.toNumber(i)>0&&(o+=1),o}function cn(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return k.default.multiply(k.default.BigInt(n),ji)}function Oo(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"?k.default.BigInt(t.toString(10)):k.default.BigInt(t)}var ys=(()=>{let n=k.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=k.default.BigInt(t),r=k.default.add(cn(t),n);return n=k.default.remainder(e,ji),k.default.greaterThan(r,Br)?Br:k.default.lessThan(r,Ti)?Ti:r}})();function ci(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Lt(n){return n<0?-1:n>0?1:n}function ie(n){if(n===void 0)return Object.create(null);if(ze(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function yr(n,t){let e=Object.create(null);return e[n]=t,e}function xn(n,t,e,r){let i=n[t];if(i!==void 0){if(i=qo(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Ln)throw new RangeError(`${t} option is required`);return r}function Pt(n){let t=Ri(n);if(!Hh.includes(Ri(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function Ri(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 Qn(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 Uh=new RegExp(`^${Vl.source}$`),Vh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function _u(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,l=i;for(;a-o>1;){let u=Math.trunc((o+a)/2),h=n(u);h===s?(o=u,s=h):h===l&&(a=u,l=h)}return a}function Mu(n){return[...n]}function Tu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=eo[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),l=e.getMinimalDaysInFirstWeek(),u=(i+7-s)%7,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=l&&++p,p==0)p=function(y,w,T,S){let x=(S-y-T+1)%7;x<0&&(x+=7);let $=Math.floor((T+x-1)/7);return 7-x>=w&&++$,$}(s,l,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let y=(u+a-o)%7;y<0&&(y+=7),6-y>=l&&o+7-u>a&&(p=1,r++)}return{week:p,year:r}}function kl(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 eo={};function vr(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 gn(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Gs(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"&&Ke(r,1,e),t==="constrain"&&(r=Mt(r,1,e)),i=gn(r)}else{let o=vr(i);if(i!==gn(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}}eo.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,Gs(n))},dateToISO:(n,t)=>Di(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=Di(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 Mu(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:l}=n;return a+=t,s+=e,{year:a,month:s}=ur(a,s),{year:a,month:s,day:l}=Di(a,s,l,o),l+=i+7*r,Ot(a,s,l)},dateUntil(n,t,e){let r=-bn(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);!kl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=ur(n.year+o,n.month+p);!kl(r,i.year,i.month,n.day,t);)a=p,p+=r,i=ur(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=ur(n.year+o,n.month+a);let s=fu(i.year,i.month,n.day),l=0,u=gr(t.year,t.month-1,t.day)-gr(s.year,s.month-1,s.day);return e==="week"&&(l=Math.trunc(u/7),u%=7),{years:o,months:a,weeks:l,days:u}},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=gn(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),l=a-100*s,u=(e+Math.floor(2.6*o-.2)+(l+Math.floor(l/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=u+(u<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=hr(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=Tu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=hr(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Ao(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Vt=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 Su({isoYear:n,isoMonth:t,isoDay:e}){return`${Qi(n)}-${Zt(t)}-${Zt(e)}T00:00Z`}function Za(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Vt.objectMap=new WeakMap,Vt.MAX_CACHE_ENTRIES=1e3;var Nn=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 l=Su({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(l),h={};for(let y=0;y<u.length;y++){let{type:w,value:T}=u[y];if(w!=="year"&&w!=="relatedYear"||(this.hasEra?h.eraYear=+T:h.year=+T),w==="month"){let S=/^([0-9]*)(.*?)$/.exec(T);if(!S||S.length!=3||!S[1]&&!S[2])throw new RangeError(`Unexpected month: ${T}`);if(h.month=S[1]?+S[1]:1,h.month<1)throw new RangeError(`Invalid month ${T} from ${l}[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 ${T} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);S[2]&&(h.monthExtra=S[2])}w==="day"&&(h.day=+T),this.hasEra&&w==="era"&&T!=null&&T!==""&&(h.era=T.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 y=this.eras.find(w=>h.era===w.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:w}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=w}this.checkIcuBugs&&this.checkIcuBugs(t);let p=this.adjustCalendarDate(h,e,"constrain",!0);if(p.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(p.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(p.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,p),["constrain","reject"].forEach(y=>{let w=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(w,t)}),p}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:l}=o;return{month:s,monthCode:l}=Gs(o,r,a),{...o,month:s,monthCode:l}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(Ke(o,1,i),Ke(a,1,this.maximumMonthLength(t))):(o=Mt(o,1,i),a=Mt(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:l}=o,u=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:l,overflow:e,id:this.id}),h,p=r.get(u);if(p||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}),p=r.get(h),p))return p;let y=this.estimateIsoDate({year:a,month:s,day:l}),w=W=>{let K=this.addDaysIso(y,W);if(o.day>this.minimumMonthLength(o)){let ee=this.isoToCalendarDate(K,r);for(;ee.month!==s||ee.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);K=this.addDaysIso(K,-1),ee=this.isoToCalendarDate(K,r)}}return K},T=0,S=this.isoToCalendarDate(y,r),x=Za(o,S);if(x.years!==0||x.months!==0||x.days!==0){let W=365*x.years+30*x.months+x.days;y=this.addDaysIso(y,W),S=this.isoToCalendarDate(y,r),x=Za(o,S),x.years===0&&x.months===0?y=w(x.days):T=this.compareCalendarDates(o,S)}let $=8;for(;T;){y=this.addDaysIso(y,T*$);let W=S;S=this.isoToCalendarDate(y,r);let K=T;if(T=this.compareCalendarDates(o,S),T){if(x=Za(o,S),x.years===0&&x.months===0)y=w(x.days),T=0;else if(K&&T!==K)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(S,W)>0&&(y=this.addDaysIso(y,-1)),T=0}}}if(r.set(u,y),h&&r.set(h,y),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 y}compareCalendarDates(t,e){return t.year!==e.year?Lt(t.year-e.year):t.month!==e.month?Lt(t.month-e.month):t.day!==e.day?Lt(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 Ot(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,l=Math.abs(e);s<l;s++){let{month:u}=o,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),w=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(w,i),e>0){let T=this.monthsInYear(h,i);for(;o.month-1!=u%T;)w=this.addDaysIso(w,-1),o=this.isoToCalendarDate(w,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:l,day:u,monthCode:h}=t,p=this.adjustCalendarDate({year:l+e,monthCode:h,day:u},s),y=this.addMonthsCalendar(p,r,a,s),w=o+7*i;return this.addDaysCalendar(y,w,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,l=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let u=this.calendarDaysUntil(t,e,i);o=u%7,a=(u-o)/7;break}case"month":case"year":{let u=this.compareCalendarDates(e,t);if(!u)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let T=0;e.monthCode>t.monthCode&&(T=1),e.monthCode<t.monthCode&&(T=-1),T||(T=Math.sign(p)),l=T*u<0?h-u:h}let y,w=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=w,w=this.addMonthsCalendar(y,u,"constrain",i),w.day!==t.day&&(w=this.regulateDate({...w,day:t.day},"constrain",i));while(this.compareCalendarDates(e,w)*u>=0);s-=u,o=this.calendarDaysUntil(y,e,i);break}}return{years:l,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),l=this.addDaysIso(s,a),u=this.isoToCalendarDate(l,e),h=this.addDaysIso(l,-u.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 l=this.minimumMonthLength(a),u=this.maximumMonthLength(a);if(l===u)return u;let h=this.calendarToIsoDate(t,"constrain",e),p=this.addDaysIso(h,-r);return this.isoToCalendarDate(p,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 gr(o.year,o.month-1,o.day)-gr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,l,{era:u,eraYear:h,year:p,month:y,monthCode:w,day:T}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||u===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(w===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:w,day:T}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let S={year:this.monthDaySearchStartYear(w,T),month:12,day:31},x=this.isoToCalendarDate(S,r),$=x.monthCode>w||x.monthCode===w&&x.day>=T?x.year:x.year-1;for(let W=0;W<20;W++){let K=this.adjustCalendarDate({day:T,monthCode:w,year:$-W},r),ee=this.calendarToIsoDate(K,"constrain",r),oe=this.isoToCalendarDate(ee,r);if({year:i,month:o,day:a}=ee,oe.monthCode===w&&oe.day===T)return{month:o,day:a,year:i};if(e==="constrain"){let ae=this.maxLengthOfMonthCodeInAnyYear(oe.monthCode);if(oe.monthCode===w&&oe.day===ae&&T>ae)return{month:o,day:a,year:i};(s===void 0||oe.monthCode===s.monthCode&&oe.day>s.day)&&(s=oe,l=ee)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${w} and day ${T}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},vs=class extends Nn{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(l=>l[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?gn(5,!0):gn(e<6?e:e-1):gn(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:l,monthExtra:u}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(u){let h=this.months[u];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:l,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=vr(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"?(Ke(a,1,this.monthsInYear({year:o})),Ke(l,1,this.maximumMonthLength({year:o,month:a}))):(a=Mt(a,1,this.monthsInYear({year:o})),l=Mt(l,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:l,month:a,monthCode:s,year:o}}},Jn=class extends Nn{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}}},bs=class extends Jn{constructor(){super(...arguments),this.id="islamic"}},ws=class extends Jn{constructor(){super(...arguments),this.id="islamic-umalqura"}},Ds=class extends Jn{constructor(){super(...arguments),this.id="islamic-tbla"}},Es=class extends Jn{constructor(){super(...arguments),this.id="islamic-civil"}},_s=class extends Jn{constructor(){super(...arguments),this.id="islamic-rgsa"}},Ms=class extends Jn{constructor(){super(...arguments),this.id="islamicc"}},Ts=class extends Nn{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 vr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ss=class extends Nn{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 Ks(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=vr(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 Ot(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 Ks(n){return n%4==0&&(n%100!=0||n%400==0)}var Ho=class extends Nn{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 Ks(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][vr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return Di(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Bo=class extends Nn{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(u=>u.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(u=>{if(u.isAnchor||!u.anchorEpoch&&!u.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=u,u.anchorEpoch={year:u.hasYearZero?0:1}}else if(!u.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(u=>u.code),s.forEach(u=>{let{reverseOf:h}=u;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);u.reverseOf=p,u.anchorEpoch=p.anchorEpoch,u.isoEpoch=p.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)}),s.sort((u,h)=>{if(u.reverseOf)return 1;if(h.reverseOf)return-1;if(!u.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-u.isoEpoch.year});let l=s[s.length-1].reverseOf;if(l&&l!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((u,h)=>{u.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 Ks(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][vr(t)-1]}completeEraYear(t){let e=(s,l,u)=>{let h=t[s];if(h!=null&&h!=l&&!(u||[]).includes(h)){let p=u?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${l} (also called ${p})`:l}`)}},r=s=>{let l,u={...t,year:s},h=this.eras.find((p,y)=>{if(y===this.eras.length-1){if(p.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${p.code}`);return l=p.anchorEpoch.year-s,!0}return l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(u,p.anchorEpoch)>=0&&(l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:l,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:l,names:u=[]})=>l===a||u.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:vr(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 Di(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},xi=class extends Bo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=gn(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},pn={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 Ho{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Fo=class extends Bo{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},ks=class extends Cs{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},Ps=class extends Fo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},Is=class extends Fo{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}}])}},Rs=class extends xi{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},xs=class extends Ho{constructor(){super("buddhist",{year:-543,month:1,day:1})}},As=class extends xi{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}},Ls=class extends xi{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}}},Yo=class extends Nn{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=(x,$)=>{let W=Su({isoYear:x,isoMonth:2,isoDay:1}),K=new Date(W);K.setUTCDate($+1);let ee=o.formatToParts(K),oe=ee.find(ce=>ce.type==="month").value,ae=+ee.find(ce=>ce.type==="day").value,Ce=ee.find(ce=>ce.type==="relatedYear"),Te;if(Ce===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Te=+Ce.value,{calendarMonthString:oe,calendarDay:ae,calendarYearToVerify:Te}},s=17,{calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s);l!=="1"&&(s+=29,{calendarMonthString:l,calendarDay:u}=a(t,s)),s-=u-5;let p={},y,w,T=1,S=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[w].daysInMonth=y+30-u),h!==t?S=!0:(p[l]={monthIndex:T++},s+=30),y=u,w=l;while(!S);return p[w].daysInMonth=y+30-u,e.set(r,p),p}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:l,monthCode:u}=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=gn(a,s!==void 0),p=`${a}${s||""}`,y=this.getMonthList(o,e)[p];if(y===void 0)throw new RangeError(`Unmatched month ${p} in Chinese year ${o}`);return a=y.monthIndex,{year:o,month:a,day:l,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let w=+u.replace(/^M0?|L$/g,"");y=h[w],y&&(a=y.monthIndex,u=gn(w))}if(a===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${o}`)}else if(u===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(Ke(a,1,y),Ke(l,1,this.maximumMonthLength())):(a=Mt(a,1,y),l=Mt(l,1,this.maximumMonthLength()));let w=p.find(T=>T[1].monthIndex===a);if(w===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+w[0].replace("bis",""),w[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(!y)throw new RangeError(`Unmatched monthCode ${u} in Chinese year ${o}`);if(a!==y.monthIndex)throw new RangeError(`monthCode ${u} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:u,day:l}}},Ns=class extends Yo{constructor(){super(...arguments),this.id="chinese"}},Os=class extends Yo{constructor(){super(...arguments),this.id="dangi"}},Hs=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 Vt;Gs(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Vt,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Vt,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 Mu(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Vt.getCacheForObject(t),l=this.helper.isoToCalendarDate(t,s),u=this.helper.addCalendar(l,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(u,"constrain",s);return Vt.getCacheForObject(h)||new Vt(s).setObject(h),h}dateUntil(t,e,r){let i=Vt.getCacheForObject(t),o=Vt.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=Vt.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=eo.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=Tu(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[vs,Ts,Is,ks,Ps,Ns,Os,Rs,Ss,xs,As,Ls,bs,ws,Ds,Es,_s,Ms]){let t=new n;eo[t.id]=new Hs(t)}rs("calendarImpl",function(n){return eo[n]});var Ai=Intl.DateTimeFormat;function kr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Ai(m(n,$l),e(m(n,Qa))),function(r,i,o){let a=jo(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 li(n){return kt(n,wr)}var br=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(w){if(w==null)throw new TypeError(`Expected object not ${w}`);return Object(w)}(o);let y=Object.create(null);for(let w=0;w<p.length;w++){let T=p[w];Object.prototype.hasOwnProperty.call(s,T)&&(y[T]=s[T])}s=y}else s=Object.create(null);let l=new Ai(i,s),u=l.resolvedOptions();if(On(r),a){let p=Object.assign(Object.create(null),u);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,ve(r,Qa,p)}else ve(r,Qa,s);ve(r,$l,u.locale),ve(r,wr,l),ve(r,Rr,u.timeZone),ve(r,di,u.calendar),ve(r,Nl,em),ve(r,Ol,Xh),ve(r,Hl,Qh),ve(r,Bl,Jh),ve(r,Fl,tm),ve(r,Yl,nm);let h=a?s.timeZone:void 0;if(h===void 0)ve(r,Xa,u.timeZone);else{let p=qo(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");ve(r,Xa,St(p))}})(this,t,e)}get format(){R(this,li);let t=Wh.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 R(this,li),Kh.call(this,t,e)}formatToParts(t,...e){return R(this,li),Gh.call(this,t,...e)}formatRangeToParts(t,e){return R(this,li),Zh.call(this,t,e)}resolvedOptions(){return R(this,li),qh.call(this)}};"formatToParts"in Ai.prototype||delete br.prototype.formatToParts,"formatRangeToParts"in Ai.prototype||delete br.prototype.formatRangeToParts;var Gt=function(n=void 0,t=void 0){return new br(n,t)};function qh(){let n=m(this,wr).resolvedOptions();return n.timeZone=m(this,Xa),n}function Wh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.format(...r)}function Gh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.formatToParts(...r)}function Kh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(An(e)){if(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,wr)),i.formatRange(...o)}function Zh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(An(e)){if(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,wr)),i.formatRangeToParts(...o)}function to(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 Jh(n){let t=to(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"})),!ta(t)){if(no(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 Xh(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=to(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(no(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Qh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=to(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(no(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function em(n){let t=to(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(no(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function tm(n){let t=to(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),!ta(t)&&!ea(t)){if(no(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 nm(n){let t=n;return ta(t)||ea(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function ea(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function ta(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function no(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function An(n){return $e(n)||Ue(n)||Ne(n)||be(n)||nt(n)||qt(n)||tt(n)}function $o(n){return An(n)?n:Vo(n)}function Cu(n,t){return!(!An(n)||!An(t)||Ue(n)&&!Ue(t)||$e(n)&&!$e(t)||Ne(n)&&!Ne(t)||be(n)&&!be(t)||nt(n)&&!nt(t)||qt(n)&&!qt(t)||tt(n)&&!tt(t))}function zr(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,je)};return{epochNs:ct(m(t,Rr),e,"compatible"),formatter:kr(t,Bl)}}if(nt(n)){let e=m(n,U),r=m(t,di);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Ol)}}if(qt(n)){let e=m(n,U),r=m(t,di);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Hl)}}if($e(n)){let e=m(n,U),r=m(t,di);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Nl)}}if(Ne(n)){let e=m(n,U),r=m(t,di);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Be);return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Fl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return tt(n)?{epochNs:m(n,he),formatter:kr(t,Yl)}:{}}function ku(n){let t=Object.create(null);return t.years=m(n,gt),t.months=m(n,yt),t.weeks=m(n,xt),t.days=m(n,vt),t.hours=m(n,bt),t.minutes=m(n,wt),t.seconds=m(n,Dt),t.milliseconds=m(n,Et),t.microseconds=m(n,_t),t.nanoseconds=m(n,At),t}br.prototype.constructor=Gt,Object.defineProperty(Gt,"prototype",{value:br.prototype,writable:!1,enumerable:!1,configurable:!1}),Gt.supportedLocalesOf=Ai.supportedLocalesOf,Hn(Gt,"Intl.DateTimeFormat");var{format:rm,formatToParts:im}=Intl.DurationFormat?.prototype??Object.create(null);function Zs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return rm.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Zs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return im.call(this,t)});var rp=Object.freeze({__proto__:null,DateTimeFormat:Gt,ModifiedIntlDurationFormatPrototypeFormat:Zs}),Li=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");au(this,Oo(t))}get epochMilliseconds(){return R(this,tt),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,tt),Eu(k.default.BigInt(m(this,he)))}add(t){return R(this,tt),El("add",this,t)}subtract(t){return R(this,tt),El("subtract",this,t)}until(t,e=void 0){return R(this,tt),fl("until",this,t,e)}since(t,e=void 0){return R(this,tt),fl("since",this,t,e)}round(t){if(R(this,tt),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln);return qr(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),sn(ms(m(this,he),r,o,i))}equals(t){R(this,tt);let e=pi(t),r=m(this,he),i=m(e,he);return k.default.equal(k.default.BigInt(r),k.default.BigInt(i))}toString(t=void 0){R(this,tt);let e=ie(t),r=qi(e),i=ln(e,"trunc"),o=Nt(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=St(a));let{precision:s,unit:l,increment:u}=Wi(o,r);return al(sn(ms(m(this,he),u,l,i)),a,s)}toJSON(){return R(this,tt),al(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return R(this,tt),new Gt(t,e).format(this)}valueOf(){Qn("Instant")}toZonedDateTimeISO(t){R(this,tt);let e=St(t);return at(m(this,he),e,"iso8601")}static fromEpochMilliseconds(t){return sn(cn(Vo(t)))}static fromEpochNanoseconds(t){return sn(Oo(t))}static from(t){return pi(t)}static compare(t,e){let r=pi(t),i=pi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};Hn(Li,"Temporal.Instant");var Ni=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),l=Pt(i===void 0?"iso8601":Ge(i));pr(o,a,s),tu(this,{year:o,month:a,day:s},l)}get calendarId(){return R(this,$e),m(this,U)}get era(){return mt(this,"era")}get eraYear(){return mt(this,"eraYear")}get year(){return mt(this,"year")}get month(){return mt(this,"month")}get monthCode(){return mt(this,"monthCode")}get day(){return mt(this,"day")}get dayOfWeek(){return mt(this,"dayOfWeek")}get dayOfYear(){return mt(this,"dayOfYear")}get weekOfYear(){return mt(this,"weekOfYear")?.week}get yearOfWeek(){return mt(this,"weekOfYear")?.year}get daysInWeek(){return mt(this,"daysInWeek")}get daysInMonth(){return mt(this,"daysInMonth")}get daysInYear(){return mt(this,"daysInYear")}get monthsInYear(){return mt(this,"monthsInYear")}get inLeapYear(){return mt(this,"inLeapYear")}with(t,e=void 0){if(R(this,$e),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me));return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Tt(Zn(r,i,Ee(ie(e))),r)}withCalendar(t){R(this,$e);let e=Ji(t);return Tt(m(this,me),e)}add(t,e=void 0){return R(this,$e),_l("add",this,t,e)}subtract(t,e=void 0){return R(this,$e),_l("subtract",this,t,e)}until(t,e=void 0){return R(this,$e),gl("until",this,t,e)}since(t,e=void 0){return R(this,$e),gl("since",this,t,e)}equals(t){R(this,$e);let e=hi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,$e),sl(this,Vi(ie(t)))}toJSON(){return R(this,$e),sl(this)}toLocaleString(t=void 0,e=void 0){return R(this,$e),new Gt(t,e).format(this)}valueOf(){Qn("PlainDate")}toPlainDateTime(t=void 0){R(this,$e);let e=eu(t);return en(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(R(this,$e),ze(t)){let a=t.timeZone;a===void 0?e=St(t):(e=St(a),r=t.plainTime)}else e=St(t);let i=m(this,me),o;return r===void 0?o=zn(e,i):(r=Vn(r),o=ct(e,Me(i,m(r,je)),"compatible")),at(o,e,m(this,U))}toPlainYearMonth(){R(this,$e);let t=m(this,U);return Nr(Ci(t,Ct(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){R(this,$e);let t=m(this,U);return Lr(Ro(t,Ct(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return hi(t,e)}static compare(t,e){let r=hi(t),i=hi(e);return bn(m(r,me),m(i,me))}};function mt(n,t){R(n,$e);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn(Ni,"Temporal.PlainDate");var Oi=class{constructor(t,e,r,i=0,o=0,a=0,s=0,l=0,u=0,h="iso8601"){let p=fe(t),y=fe(e),w=fe(r),T=i===void 0?0:fe(i),S=o===void 0?0:fe(o),x=a===void 0?0:fe(a),$=s===void 0?0:fe(s),W=l===void 0?0:fe(l),K=u===void 0?0:fe(u),ee=Pt(h===void 0?"iso8601":Ge(h));Us(p,y,w,T,S,x,$,W,K),nu(this,{isoDate:{year:p,month:y,day:w},time:{hour:T,minute:S,second:x,millisecond:$,microsecond:W,nanosecond:K}},ee)}get calendarId(){return R(this,Ne),m(this,U)}get year(){return pt(this,"year")}get month(){return pt(this,"month")}get monthCode(){return pt(this,"monthCode")}get day(){return pt(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 pt(this,"era")}get eraYear(){return pt(this,"eraYear")}get dayOfWeek(){return pt(this,"dayOfWeek")}get dayOfYear(){return pt(this,"dayOfYear")}get weekOfYear(){return pt(this,"weekOfYear")?.week}get yearOfWeek(){return pt(this,"weekOfYear")?.year}get daysInWeek(){return pt(this,"daysInWeek")}get daysInYear(){return pt(this,"daysInYear")}get daysInMonth(){return pt(this,"daysInMonth")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(R(this,Ne),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=m(this,Be),o={...Ct(r,i.isoDate),...i.time};return o=mr(r,o,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),en(Ki(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){R(this,Ne);let e=eu(t);return en(Me(m(this,Be).isoDate,e),m(this,U))}withCalendar(t){R(this,Ne);let e=Ji(t);return en(m(this,Be),e)}add(t,e=void 0){return R(this,Ne),Ml("add",this,t,e)}subtract(t,e=void 0){return R(this,Ne),Ml("subtract",this,t,e)}until(t,e=void 0){return R(this,Ne),yl("until",this,t,e)}since(t,e=void 0){return R(this,Ne),yl("since",this,t,e)}round(t){if(R(this,Ne),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];qr(r,a,a===1);let s=m(this,Be);return en(r===1&&o==="nanosecond"?s:ps(s,r,o,i),m(this,U))}equals(t){R(this,Ne);let e=mi(t);return jr(m(this,Be),m(e,Be))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,Ne);let e=ie(t),r=Vi(e),i=qi(e),o=ln(e,"trunc"),a=Nt(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:l,increment:u}=Wi(a,i),h=ps(m(this,Be),u,l,o);return fr(h),Pi(h,m(this,U),s,r)}toJSON(){return R(this,Ne),Pi(m(this,Be),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ne),new Gt(t,e).format(this)}valueOf(){Qn("PlainDateTime")}toZonedDateTime(t,e=void 0){R(this,Ne);let r=St(t),i=Ei(ie(e));return at(ct(r,m(this,Be),i),r,m(this,U))}toPlainDate(){return R(this,Ne),Tt(m(this,Be).isoDate,m(this,U))}toPlainTime(){return R(this,Ne),kn(m(this,Be).time)}static from(t,e=void 0){return mi(t,e)}static compare(t,e){let r=mi(t),i=mi(e);return jr(m(r,Be),m(i,Be))}};function pt(n,t){R(n,Ne);let e=m(n,Be).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Pr(n,t){return R(n,Ne),m(n,Be).time[t]}Hn(Oi,"Temporal.PlainDateTime");var Hi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,l=0,u=0,h=0){let p=t===void 0?0:an(t),y=e===void 0?0:an(e),w=r===void 0?0:an(r),T=i===void 0?0:an(i),S=o===void 0?0:an(o),x=a===void 0?0:an(a),$=s===void 0?0:an(s),W=l===void 0?0:an(l),K=u===void 0?0:an(u),ee=h===void 0?0:an(h);Xo(p,y,w,T,S,x,$,W,K,ee),On(this),ve(this,gt,p),ve(this,yt,y),ve(this,xt,w),ve(this,vt,T),ve(this,bt,S),ve(this,wt,x),ve(this,Dt,$),ve(this,Et,W),ve(this,_t,K),ve(this,At,ee)}get years(){return R(this,Ye),m(this,gt)}get months(){return R(this,Ye),m(this,yt)}get weeks(){return R(this,Ye),m(this,xt)}get days(){return R(this,Ye),m(this,vt)}get hours(){return R(this,Ye),m(this,bt)}get minutes(){return R(this,Ye),m(this,wt)}get seconds(){return R(this,Ye),m(this,Dt)}get milliseconds(){return R(this,Ye),m(this,Et)}get microseconds(){return R(this,Ye),m(this,_t)}get nanoseconds(){return R(this,Ye),m(this,At)}get sign(){return R(this,Ye),Lo(this)}get blank(){return R(this,Ye),Lo(this)===0}with(t){R(this,Ye);let e=Ql(t),{years:r=m(this,gt),months:i=m(this,yt),weeks:o=m(this,xt),days:a=m(this,vt),hours:s=m(this,bt),minutes:l=m(this,wt),seconds:u=m(this,Dt),milliseconds:h=m(this,Et),microseconds:p=m(this,_t),nanoseconds:y=m(this,At)}=e;return new n(r,i,o,a,s,l,u,h,p,y)}negated(){return R(this,Ye),Ht(this)}abs(){return R(this,Ye),new n(Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,xt)),Math.abs(m(this,vt)),Math.abs(m(this,bt)),Math.abs(m(this,wt)),Math.abs(m(this,Dt)),Math.abs(m(this,Et)),Math.abs(m(this,_t)),Math.abs(m(this,At)))}add(t){return R(this,Ye),Dl("add",this,t)}subtract(t){return R(this,Ye),Dl("subtract",this,t)}round(t){if(R(this,Ye),t===void 0)throw new TypeError("options parameter is required");let e=Sn(this),r=typeof t=="string"?yr("smallestUnit",t):ie(t),i=Nt(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ka(r),s=Vr(r),l=ln(r,"halfExpand"),u=Nt(r,"smallestUnit","datetime",void 0),h=!0;u||(h=!1,u="nanosecond");let p=In(e,u),y=!0;if(i||(y=!1,i=p),i==="auto"&&(i=p),!h&&!y)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(In(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let w={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(w!==void 0&&qr(s,w,!1),s>1&&Cn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let S=xr(this),x=m(a,ke),$=m(a,U),W=m(a,he);return S=Du(W,yi(W,x,$,S),x,$,i,s,u,l),Cn(i)==="date"&&(i="hour"),tn(S,i)}if(o){let S=fn(this),x=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},S.time),$=m(o,me),W=m(o,U),K=Kt(W,$,st(S.date,x.deltaDays),"constrain");return S=wu(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(K,x),W,i,s,u,l),tn(S,i)}if(mn(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(mn(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let T=fn(this);if(u==="day"){let{quotient:S,remainder:x}=T.time.divmod(ko),$=T.date.days+S+_i(x,"day");$=qn($,s,l),T=Rn({years:0,months:0,weeks:0,days:$},Re.ZERO)}else T=Rn({years:0,months:0,weeks:0,days:0},No(T.time,s,u,l));return tn(T,i)}total(t){if(R(this,Ye),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?yr("unit",t):ie(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ka(e),o=Nt(e,"unit","datetime",Ln);if(i){let s=xr(this),l=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,w,T,S){return Cn(S)==="time"?_i(Re.fromEpochNsDiff(y,p),S):pl(vu(p,y,w,T,S),y,rn(w,p),w,T,S)}(h,yi(h,l,u,s),l,u,o)}if(r){let s=fn(this),l=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),u=m(r,me),h=m(r,U),p=Kt(h,u,st(s.date,l.deltaDays),"constrain");return function(y,w,T,S){if(jr(y,w)==0)return 0;fr(y),fr(w);let x=yu(y,w,T,S);return S==="nanosecond"?k.default.toNumber(x.time.totalNs):pl(x,rt(w),y,null,T,S)}(Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(p,l),h,o)}let a=Sn(this);if(mn(a))throw new RangeError(`a starting point is required for ${a}s total`);if(mn(o))throw new RangeError(`a starting point is required for ${o}s total`);return _i(fn(this).time,o)}toString(t=void 0){R(this,Ye);let e=ie(t),r=qi(e),i=ln(e,"trunc"),o=Nt(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:l}=Wi(o,r);if(s==="nanosecond"&&l===1)return Mo(this,a);let u=Sn(this),h=xr(this),p=No(h.time,l,s,i);return h=Rn(h.date,p),Mo(tn(h,In(u,"second")),a)}toJSON(){return R(this,Ye),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(R(this,Ye),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Zs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),Mo(this,"auto")}valueOf(){Qn("Duration")}static from(t){return nn(t)}static compare(t,e,r=void 0){let i=nn(t),o=nn(e),a=ie(r),{plainRelativeTo:s,zonedRelativeTo:l}=Ka(a);if(m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,xt)===m(o,xt)&&m(i,vt)===m(o,vt)&&m(i,bt)===m(o,bt)&&m(i,wt)===m(o,wt)&&m(i,Dt)===m(o,Dt)&&m(i,Et)===m(o,Et)&&m(i,_t)===m(o,_t)&&m(i,At)===m(o,At))return 0;let u=Sn(i),h=Sn(o),p=xr(i),y=xr(o);if(l&&(Cn(u)==="date"||Cn(h)==="date")){let $=m(l,ke),W=m(l,U),K=m(l,he),ee=yi(K,$,W,p),oe=yi(K,$,W,y);return Lt(k.default.toNumber(k.default.subtract(ee,oe)))}let w=p.date.days,T=y.date.days;if(mn(u)||mn(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");w=ml(p.date,s),T=ml(y.date,s)}let S=p.time.add24HourDays(w),x=y.time.add24HourDays(T);return S.cmp(x)}};Hn(Hi,"Temporal.Duration");var Bi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);pr(l,o,a),ru(this,{year:l,month:o,day:a},s)}get monthCode(){return Pl(this,"monthCode")}get day(){return Pl(this,"day")}get calendarId(){return R(this,qt),m(this,U)}with(t,e=void 0){if(R(this,qt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me),"month-day");return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Lr(Ro(r,i,Ee(ie(e))),r)}equals(t){R(this,qt);let e=il(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,qt),ll(this,Vi(ie(t)))}toJSON(){return R(this,qt),ll(this)}toLocaleString(t=void 0,e=void 0){return R(this,qt),new Gt(t,e).format(this)}valueOf(){Qn("PlainMonthDay")}toPlainDate(t){if(R(this,qt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,Ct(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return il(t,e)}};function Pl(n,t){R(n,qt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ja(n){return rn(n,ys())}Hn(Bi,"Temporal.PlainMonthDay");var Pu={instant:()=>sn(ys()),plainDateTimeISO:(n=ci())=>en(Ja(St(n)),"iso8601"),plainDateISO:(n=ci())=>Tt(Ja(St(n)).isoDate,"iso8601"),plainTimeISO:(n=ci())=>kn(Ja(St(n)).time),timeZoneId:()=>ci(),zonedDateTimeISO:(n=ci())=>{let t=St(n);return at(ys(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Pu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Fi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:fe(t),l=e===void 0?0:fe(e),u=r===void 0?0:fe(r),h=i===void 0?0:fe(i),p=o===void 0?0:fe(o),y=a===void 0?0:fe(a);Jo(s,l,u,h,p,y),iu(this,{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return R(this,Ue),m(this,je).hour}get minute(){return R(this,Ue),m(this,je).minute}get second(){return R(this,Ue),m(this,je).second}get millisecond(){return R(this,Ue),m(this,je).millisecond}get microsecond(){return R(this,Ue),m(this,je).microsecond}get nanosecond(){return R(this,Ue),m(this,je).nanosecond}with(t,e=void 0){if(R(this,Ue),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=ss(t,"partial"),i=ss(this),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Object.assign(i,r),p=Ee(ie(e));return{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Go(o,a,s,l,u,h,p),new n(o,a,s,l,u,h)}add(t){return R(this,Ue),Tl("add",this,t)}subtract(t){return R(this,Ue),Tl("subtract",this,t)}until(t,e=void 0){return R(this,Ue),vl("until",this,t,e)}since(t,e=void 0){return R(this,Ue),vl("since",this,t,e)}round(t){if(R(this,Ue),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln);return qr(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),kn(fs(m(this,je),r,o,i))}equals(t){R(this,Ue);let e=Vn(t);return gs(m(this,je),m(e,je))===0}toString(t=void 0){R(this,Ue);let e=ie(t),r=qi(e),i=ln(e,"trunc"),o=Nt(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:l}=Wi(o,r);return cl(fs(m(this,je),l,s,i),a)}toJSON(){return R(this,Ue),cl(m(this,je),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ue),new Gt(t,e).format(this)}valueOf(){Qn("PlainTime")}static from(t,e=void 0){return Vn(t,e)}static compare(t,e){let r=Vn(t),i=Vn(e);return gs(m(r,je),m(i,je))}};Hn(Fi,"Temporal.PlainTime");var Yi=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);pr(o,a,l),ou(this,{year:o,month:a,day:l},s)}get year(){return Mn(this,"year")}get month(){return Mn(this,"month")}get monthCode(){return Mn(this,"monthCode")}get calendarId(){return R(this,nt),m(this,U)}get era(){return Mn(this,"era")}get eraYear(){return Mn(this,"eraYear")}get daysInMonth(){return Mn(this,"daysInMonth")}get daysInYear(){return Mn(this,"daysInYear")}get monthsInYear(){return Mn(this,"monthsInYear")}get inLeapYear(){return Mn(this,"inLeapYear")}with(t,e=void 0){if(R(this,nt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me),"year-month");return i=mr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Nr(Ci(r,i,Ee(ie(e))),r)}add(t,e=void 0){return R(this,nt),Sl("add",this,t,e)}subtract(t,e=void 0){return R(this,nt),Sl("subtract",this,t,e)}until(t,e=void 0){return R(this,nt),bl("until",this,t,e)}since(t,e=void 0){return R(this,nt),bl("since",this,t,e)}equals(t){R(this,nt);let e=fi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,nt),ul(this,Vi(ie(t)))}toJSON(){return R(this,nt),ul(this)}toLocaleString(t=void 0,e=void 0){return R(this,nt),new Gt(t,e).format(this)}valueOf(){Qn("PlainYearMonth")}toPlainDate(t){if(R(this,nt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,Ct(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return fi(t,e)}static compare(t,e){let r=fi(t),i=fi(e);return bn(m(r,me),m(i,me))}};function Mn(n,t){R(n,nt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn(Yi,"Temporal.PlainYearMonth");var om=Gt.prototype.resolvedOptions,$i=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Oo(t),o=Ge(e),{tzName:a,offsetMinutes:s}=Wn(o);if(s===void 0){let l=xo(a);if(!l)throw new RangeError(`unknown time zone ${a}`);o=l.identifier}else o=$s(s);su(this,i,o,Pt(r===void 0?"iso8601":Ge(r)))}get calendarId(){return R(this,be),m(this,U)}get timeZoneId(){return R(this,be),m(this,ke)}get year(){return ft(this,"year")}get month(){return ft(this,"month")}get monthCode(){return ft(this,"monthCode")}get day(){return ft(this,"day")}get hour(){return Ir(this,"hour")}get minute(){return Ir(this,"minute")}get second(){return Ir(this,"second")}get millisecond(){return Ir(this,"millisecond")}get microsecond(){return Ir(this,"microsecond")}get nanosecond(){return Ir(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}get epochMilliseconds(){return R(this,be),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,be),Eu(m(this,he))}get dayOfWeek(){return ft(this,"dayOfWeek")}get dayOfYear(){return ft(this,"dayOfYear")}get weekOfYear(){return ft(this,"weekOfYear")?.week}get yearOfWeek(){return ft(this,"weekOfYear")?.year}get hoursInDay(){R(this,be);let t=m(this,ke),e=hn(this).isoDate,r=Ot(e.year,e.month,e.day+1),i=zn(t,e),o=zn(t,r);return _i(Re.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ft(this,"daysInWeek")}get daysInMonth(){return ft(this,"daysInMonth")}get daysInYear(){return ft(this,"daysInYear")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}get offset(){return R(this,be),cs(Pn(m(this,ke),m(this,he)))}get offsetNanoseconds(){return R(this,be),Pn(m(this,ke),m(this,he))}with(t,e=void 0){if(R(this,be),!ze(t))throw new TypeError("invalid zoned-date-time-like");Ur(t);let r=m(this,U),i=m(this,ke),o=Pn(i,m(this,he)),a=hn(this),s={...Ct(r,a.isoDate),...a.time,offset:cs(o)};s=mr(r,s,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let l=ie(e),u=Ei(l),h=To(l,"prefer"),p=Ki(r,s,Ee(l)),y=Wr(s.offset);return at(Io(p.isoDate,p.time,"option",y,i,u,h,!1),i,r)}withPlainTime(t=void 0){R(this,be);let e=m(this,ke),r=m(this,U),i=hn(this).isoDate,o;return o=t===void 0?zn(e,i):ct(e,Me(i,m(Vn(t),je)),"compatible"),at(o,e,r)}withTimeZone(t){R(this,be);let e=St(t);return at(m(this,he),e,m(this,U))}withCalendar(t){R(this,be);let e=Ji(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return R(this,be),Cl("add",this,t,e)}subtract(t,e=void 0){return R(this,be),Cl("subtract",this,t,e)}until(t,e=void 0){return R(this,be),wl("until",this,t,e)}since(t,e=void 0){return R(this,be),wl("since",this,t,e)}round(t){if(R(this,be),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(qr(r,a,a===1),o==="nanosecond"&&r===1)return at(m(this,he),m(this,ke),m(this,U));let s=m(this,ke),l=m(this,he),u=hn(this),h;if(o==="day"){let p=u.isoDate,y=Ot(p.year,p.month,p.day+1),w=zn(s,p),T=zn(s,y),S=k.default.subtract(T,w);h=Re.fromEpochNsDiff(l,w).round(S,i).addToEpochNs(w)}else{let p=ps(u,r,o,i),y=Pn(s,l);h=Io(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return at(h,s,m(this,U))}equals(t){R(this,be);let e=gi(t),r=m(this,he),i=m(e,he);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!cu(m(this,ke),m(e,ke))&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,be);let e=ie(t),r=Vi(e),i=qi(e),o=function(y){return xn(y,"offset",["auto","never"],"auto")}(e),a=ln(e,"trunc"),s=Nt(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let l=function(y){return xn(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:h,increment:p}=Wi(s,i);return dl(this,u,r,l,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){R(this,be);let r=ie(e),i=Object.create(null);if(function(l,u,h,p){if(u==null)return;let y=Reflect.ownKeys(u);for(let w=0;w<y.length;w++){let T=y[w];if(!h.some(S=>Object.is(S,T))&&Object.prototype.propertyIsEnumerable.call(u,T)){let S=u[T];l[T]=S}}}(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,ke),hl(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Gt(t,i),a=om.call(o).calendar,s=m(this,U);if(s!=="iso8601"&&a!=="iso8601"&&!yn(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(sn(m(this,he)))}toJSON(){return R(this,be),dl(this,"auto")}valueOf(){Qn("ZonedDateTime")}startOfDay(){R(this,be);let t=m(this,ke);return at(zn(t,hn(this).isoDate),t,m(this,U))}getTimeZoneTransition(t){R(this,be);let e=m(this,ke);if(t===void 0)throw new TypeError("options parameter is required");let r=xn(typeof t=="string"?yr("direction",t):ie(t),"direction",["next","previous"],Ln);if(r===void 0)throw new TypeError("direction option is required");if(hl(e)||e==="UTC")return null;let i=m(this,he),o=r==="next"?zs(e,i):us(e,i);return o===null?null:at(o,e,m(this,U))}toInstant(){return R(this,be),sn(m(this,he))}toPlainDate(){return R(this,be),Tt(hn(this).isoDate,m(this,U))}toPlainTime(){return R(this,be),kn(hn(this).time)}toPlainDateTime(){return R(this,be),en(hn(this),m(this,U))}static from(t,e=void 0){return gi(t,e)}static compare(t,e){let r=gi(t),i=gi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(k.default.BigInt(o),k.default.BigInt(a))?-1:k.default.greaterThan(k.default.BigInt(o),k.default.BigInt(a))?1:0}};function hn(n){return rn(m(n,ke),m(n,he))}function ft(n,t){R(n,be);let e=hn(n).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ir(n,t){return R(n,be),hn(n).time[t]}Hn($i,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Hi,Instant:Li,Now:Pu,PlainDate:Ni,PlainDateTime:Oi,PlainMonthDay:Bi,PlainTime:Fi,PlainYearMonth:Yi,ZonedDateTime:$i}),ip=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,am=[Li,Ni,Oi,Hi,Bi,Fi,Yi,$i];for(let n of am){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))}function Js(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Xs=Object.assign;var sm=Object.prototype.hasOwnProperty,na=(n,t)=>sm.call(n,t),Er=Array.isArray,ro=n=>Ru(n)==="[object Map]";var Iu=n=>typeof n=="function",cm=n=>typeof n=="string",Kr=n=>typeof n=="symbol",io=n=>n!==null&&typeof n=="object";var lm=Object.prototype.toString,Ru=n=>lm.call(n),xu=n=>Ru(n).slice(8,-1);var ra=n=>cm(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var ia=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},um=/-(\w)/g,sp=ia(n=>n.replace(um,(t,e)=>e?e.toUpperCase():"")),dm=/\B([A-Z])/g,cp=ia(n=>n.replace(dm,"-$1").toLowerCase()),hm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),lp=ia(n=>n?`on${hm(n)}`:""),_r=(n,t)=>!Object.is(n,t);var mm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var up=Js(mm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Qs;var Oe;var ec=new WeakSet,sa=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,Qs&&Qs.active&&Qs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ec.has(this)&&(ec.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ou(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Au(this),Hu(this);let t=Oe,e=un;Oe=this,un=!0;try{return this.fn()}finally{Bu(this),Oe=t,un=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fc(t);this.deps=this.depsTail=void 0,Au(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ec.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){rc(this)&&this.run()}get dirty(){return rc(this)}},Nu=0,ao,so;function Ou(n,t=!1){if(n.flags|=8,t){n.next=so,so=n;return}n.next=ao,ao=n}function mc(){Nu++}function pc(){if(--Nu>0)return;if(so){let t=so;for(so=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;ao;){let t=ao;for(ao=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 Bu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),fc(r),pm(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function rc(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Fu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===co)||(n.globalVersion=co,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!rc(n))))return;n.flags|=2;let t=n.dep,e=Oe,r=un;Oe=n,un=!0;try{Hu(n);let i=n.fn(n._value);(t.version===0||_r(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Oe=e,un=r,Bu(n),n.flags&=-3}}function fc(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)fc(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function pm(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function Rt(n,t){n.effect instanceof sa&&(n=n.effect.fn);let e=new sa(n);t&&Xs(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var un=!0,Yu=[];function fm(){Yu.push(un),un=!1}function gm(){let n=Yu.pop();un=n===void 0?!0:n}function Au(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Oe;Oe=void 0;try{t()}finally{Oe=e}}}var co=0,ic=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}},lo=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(!Oe||!un||Oe===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Oe)e=this.activeLink=new ic(Oe,this),Oe.deps?(e.prevDep=Oe.depsTail,Oe.depsTail.nextDep=e,Oe.depsTail=e):Oe.deps=Oe.depsTail=e,$u(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=Oe.depsTail,e.nextDep=void 0,Oe.depsTail.nextDep=e,Oe.depsTail=e,Oe.deps===e&&(Oe.deps=r)}return e}trigger(t){this.version++,co++,this.notify(t)}notify(t){mc();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{pc()}}};function $u(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)$u(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var oc=new WeakMap,Mr=Symbol(""),ac=Symbol(""),uo=Symbol("");function Bt(n,t,e){if(un&&Oe){let r=oc.get(n);r||oc.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new lo),i.map=r,i.key=e),i.track()}}function er(n,t,e,r,i,o){let a=oc.get(n);if(!a){co++;return}let s=l=>{l&&l.trigger()};if(mc(),t==="clear")a.forEach(s);else{let l=Er(n),u=l&&ra(e);if(l&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===uo||!Kr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(uo)),t){case"add":l?u&&s(a.get("length")):(s(a.get(Mr)),ro(n)&&s(a.get(ac)));break;case"delete":l||(s(a.get(Mr)),ro(n)&&s(a.get(ac)));break;case"set":ro(n)&&s(a.get(Mr));break}}pc()}function Zr(n){let t=Le(n);return t===n?t:(Bt(t,"iterate",uo),tr(n)?t:t.map(It))}function gc(n){return Bt(n=Le(n),"iterate",uo),n}var ym={__proto__:null,[Symbol.iterator](){return tc(this,Symbol.iterator,It)},concat(...n){return Zr(this).concat(...n.map(t=>Er(t)?Zr(t):t))},entries(){return tc(this,"entries",n=>(n[1]=It(n[1]),n))},every(n,t){return Bn(this,"every",n,t,void 0,arguments)},filter(n,t){return Bn(this,"filter",n,t,e=>e.map(It),arguments)},find(n,t){return Bn(this,"find",n,t,It,arguments)},findIndex(n,t){return Bn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return Bn(this,"findLast",n,t,It,arguments)},findLastIndex(n,t){return Bn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return Bn(this,"forEach",n,t,void 0,arguments)},includes(...n){return nc(this,"includes",n)},indexOf(...n){return nc(this,"indexOf",n)},join(n){return Zr(this).join(n)},lastIndexOf(...n){return nc(this,"lastIndexOf",n)},map(n,t){return Bn(this,"map",n,t,void 0,arguments)},pop(){return oo(this,"pop")},push(...n){return oo(this,"push",n)},reduce(n,...t){return Lu(this,"reduce",n,t)},reduceRight(n,...t){return Lu(this,"reduceRight",n,t)},shift(){return oo(this,"shift")},some(n,t){return Bn(this,"some",n,t,void 0,arguments)},splice(...n){return oo(this,"splice",n)},toReversed(){return Zr(this).toReversed()},toSorted(n){return Zr(this).toSorted(n)},toSpliced(...n){return Zr(this).toSpliced(...n)},unshift(...n){return oo(this,"unshift",n)},values(){return tc(this,"values",It)}};function tc(n,t,e){let r=gc(n),i=r[t]();return r!==n&&!tr(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var vm=Array.prototype;function Bn(n,t,e,r,i,o){let a=gc(n),s=a!==n&&!tr(n),l=a[t];if(l!==vm[t]){let p=l.apply(n,o);return s?It(p):p}let u=e;a!==n&&(s?u=function(p,y){return e.call(this,It(p),y,n)}:e.length>2&&(u=function(p,y){return e.call(this,p,y,n)}));let h=l.call(a,u,r);return s&&i?i(h):h}function Lu(n,t,e,r){let i=gc(n),o=e;return i!==n&&(tr(n)?e.length>3&&(o=function(a,s,l){return e.call(this,a,s,l,n)}):o=function(a,s,l){return e.call(this,a,It(s),l,n)}),i[t](o,...r)}function nc(n,t,e){let r=Le(n);Bt(r,"iterate",uo);let i=r[t](...e);return(i===-1||i===!1)&&Rm(e[0])?(e[0]=Le(e[0]),r[t](...e)):i}function oo(n,t,e=[]){fm(),mc();let r=Le(n)[t].apply(n,e);return pc(),gm(),r}var bm=Js("__proto__,__v_isRef,__isVue"),ju=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Kr));function wm(n){Kr(n)||(n=String(n));let t=Le(this);return Bt(t,"has",n),t.hasOwnProperty(n)}var ca=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?km:Vu:o?Cm:Uu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Er(t);if(!i){let l;if(a&&(l=ym[e]))return l;if(e==="hasOwnProperty")return wm}let s=Reflect.get(t,e,Jr(t)?t:r);return(Kr(e)?ju.has(e):bm(e))||(i||Bt(t,"get",e),o)?s:Jr(s)?a&&ra(e)?s:s.value:io(s)?i?Qr(s):nr(s):s}},sc=class extends ca{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let l=Xr(o);if(!tr(r)&&!Xr(r)&&(o=Le(o),r=Le(r)),!Er(t)&&Jr(o)&&!Jr(r))return l?!1:(o.value=r,!0)}let a=Er(t)&&ra(e)?Number(e)<t.length:na(t,e),s=Reflect.set(t,e,r,Jr(t)?t:i);return t===Le(i)&&(a?_r(r,o)&&er(t,"set",e,r,o):er(t,"add",e,r)),s}deleteProperty(t,e){let r=na(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&er(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Kr(e)||!ju.has(e))&&Bt(t,"has",e),r}ownKeys(t){return Bt(t,"iterate",Er(t)?"length":Mr),Reflect.ownKeys(t)}},cc=class extends ca{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Dm=new sc,Em=new cc;var lc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function _m(n,t,e){return function(...r){let i=this.__v_raw,o=Le(i),a=ro(o),s=n==="entries"||n===Symbol.iterator&&a,l=n==="keys"&&a,u=i[n](...r),h=e?lc:t?uc:It;return!t&&Bt(o,"iterate",l?ac:Mr),{next(){let{value:p,done:y}=u.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function aa(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Mm(n,t){let e={get(i){let o=this.__v_raw,a=Le(o),s=Le(i);n||(_r(i,s)&&Bt(a,"get",i),Bt(a,"get",s));let{has:l}=oa(a),u=t?lc:n?uc:It;if(l.call(a,i))return u(o.get(i));if(l.call(a,s))return u(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Bt(Le(i),"iterate",Mr),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Le(o),s=Le(i);return n||(_r(i,s)&&Bt(a,"has",i),Bt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,l=Le(s),u=t?lc:n?uc:It;return!n&&Bt(l,"iterate",Mr),s.forEach((h,p)=>i.call(o,u(h),u(p),a))}};return Xs(e,n?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(i){!t&&!tr(i)&&!Xr(i)&&(i=Le(i));let o=Le(this);return oa(o).has.call(o,i)||(o.add(i),er(o,"add",i,i)),this},set(i,o){!t&&!tr(o)&&!Xr(o)&&(o=Le(o));let a=Le(this),{has:s,get:l}=oa(a),u=s.call(a,i);u||(i=Le(i),u=s.call(a,i));let h=l.call(a,i);return a.set(i,o),u?_r(o,h)&&er(a,"set",i,o,h):er(a,"add",i,o),this},delete(i){let o=Le(this),{has:a,get:s}=oa(o),l=a.call(o,i);l||(i=Le(i),l=a.call(o,i));let u=s?s.call(o,i):void 0,h=o.delete(i);return l&&er(o,"delete",i,void 0,u),h},clear(){let i=Le(this),o=i.size!==0,a=void 0,s=i.clear();return o&&er(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=_m(i,n,t)}),e}function zu(n,t){let e=Mm(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(na(e,i)&&i in r?e:r,i,o)}var Tm={get:zu(!1,!1)};var Sm={get:zu(!0,!1)};var Uu=new WeakMap,Cm=new WeakMap,Vu=new WeakMap,km=new WeakMap;function Pm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Im(n){return n.__v_skip||!Object.isExtensible(n)?0:Pm(xu(n))}function nr(n){return Xr(n)?n:qu(n,!1,Dm,Tm,Uu)}function Qr(n){return qu(n,!0,Em,Sm,Vu)}function qu(n,t,e,r,i){if(!io(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Im(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 Xr(n){return!!(n&&n.__v_isReadonly)}function tr(n){return!!(n&&n.__v_isShallow)}function Rm(n){return n?!!n.__v_raw:!1}function Le(n){let t=n&&n.__v_raw;return t?Le(t):n}var It=n=>io(n)?nr(n):n,uc=n=>io(n)?Qr(n):n;function Jr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return xm(n,!1)}function xm(n,t){return Jr(n)?n:new dc(n,t)}var dc=class{constructor(t,e){this.dep=new lo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Le(t),this._value=e?t:It(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||tr(t)||Xr(t);t=r?t:Le(t),_r(t,e)&&(this._rawValue=t,this._value=r?t:It(t),this.dep.trigger())}};var hc=class{constructor(t,e,r){this.fn=t,this.setter=e,this._value=void 0,this.dep=new lo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return Ou(this,!0),!0}get value(){let t=this.dep.track();return Fu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Xt(n,t,e=!1){let r,i;return Iu(n)?r=n:(r=n.get,i=n.set),new hc(r,i,e)}var $c=Wc(Gu(),1);var yc=class{constructor(){A(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))}},la=new yc;function Je(n,t){la.emit(n,t)}function rr(n,t){Array.isArray(n)?n.forEach(e=>la.on(e,t)):la.on(n,t)}var Ku={en:{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",viewHotelPage:"View Site",pricingProducts:"Products:",pricingProductsAndExtras:"Products & Extras:",pricingTaxes:"Taxes:",pricingSubtotal:"Subtotal:",pricingService:"service"},"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",viewHotelPage:"Voir le site",pricingProducts:"Produits :",pricingProductsAndExtras:"Produits et options :",pricingTaxes:"Taxes :",pricingSubtotal:"Sous-total :",pricingService:"service"},de:{loading:"Laden...",night:"Nacht",chooseOption:"Option ausw\xE4hlen",apartment:"Apartment",total:"Gesamt",missingEnterpriseId:"Unternehmens-ID fehlt",missingCategoryId:"Kategorie-ID fehlt",minimumNights:"Mindestn\xE4chte",maximumNights:"Maximale N\xE4chte",booked:"Bereits gebucht",select:"Ausw\xE4hlen",fatalErrorMessage:"Hoppla! Ein unerwarteter Fehler ist aufgetreten. Bitte laden Sie die Seite neu oder kontaktieren Sie den Support.",pleaseWait:"Bitte warten...","chargingMode:Once":"Einmal","chargingMode:PerTimeUnit":"Pro Nacht","chargingMode:PerPersonPerTimeUnit":"Pro Person und Nacht",adults:"Erwachsene",children:"Kinder (0-18 Jahre)",guestSingular:"Person",guestPlural:"Personen",couponValid:"Gutschein ist g\xFCltig ;)",couponInvalid:"Gutschein ist ung\xFCltig!",couponError:"Fehler bei der Gutscheinpr\xFCfung!",proceedToPayment:"Zur Zahlung fortfahren",completePayment:"Zahlung abschlie\xDFen",viewHotelPage:"Website ansehen",pricingProducts:"Produkte:",pricingProductsAndExtras:"Produkte & Extras:",pricingTaxes:"Steuern:",pricingSubtotal:"Zwischensumme:",pricingService:"Service"},es:{loading:"Cargando...",night:"Noche",chooseOption:"Elige una opci\xF3n",apartment:"Apartamento",total:"Total",missingEnterpriseId:"Falta el ID de empresa",missingCategoryId:"Falta el ID de categor\xEDa",minimumNights:"noches m\xEDnimas",maximumNights:"noches m\xE1ximas",booked:"Ya reservado",select:"Seleccionar",fatalErrorMessage:"\xA1Ups! Ha ocurrido un error inesperado. Por favor, recarga la p\xE1gina o contacta con soporte.",pleaseWait:"Por favor espera...","chargingMode:Once":"Una vez","chargingMode:PerTimeUnit":"Por noche","chargingMode:PerPersonPerTimeUnit":"Por persona y noche",adults:"Adultos",children:"Ni\xF1os (0-18 a\xF1os)",guestSingular:"Persona",guestPlural:"Personas",couponValid:"El cup\xF3n es v\xE1lido ;)",couponInvalid:"\xA1El cup\xF3n no es v\xE1lido!",couponError:"Error al validar el cup\xF3n!",proceedToPayment:"Ir al pago",completePayment:"Completar el pago",viewHotelPage:"Ver el sitio",pricingProducts:"Productos:",pricingProductsAndExtras:"Productos y extras:",pricingTaxes:"Impuestos:",pricingSubtotal:"Subtotal:",pricingService:"servicio"},it:{loading:"Caricamento...",night:"Notte",chooseOption:"Scegli un\u2019opzione",apartment:"Appartamento",total:"Totale",missingEnterpriseId:"ID azienda mancante",missingCategoryId:"ID categoria mancante",minimumNights:"notti minime",maximumNights:"notti massime",booked:"Gi\xE0 prenotato",select:"Seleziona",fatalErrorMessage:"Ops! Si \xE8 verificato un errore imprevisto. Ricarica la pagina o contatta il supporto.",pleaseWait:"Attendere prego...","chargingMode:Once":"Una volta","chargingMode:PerTimeUnit":"Per notte","chargingMode:PerPersonPerTimeUnit":"Per persona a notte",adults:"Adulti",children:"Bambini (0-18 anni)",guestSingular:"Persona",guestPlural:"Persone",couponValid:"Il coupon \xE8 valido ;)",couponInvalid:"Il coupon non \xE8 valido!",couponError:"Errore durante la verifica del coupon!",proceedToPayment:"Procedi al pagamento",completePayment:"Completa il pagamento",viewHotelPage:"Vedi il sito",pricingProducts:"Prodotti:",pricingProductsAndExtras:"Prodotti ed extra:",pricingTaxes:"Tasse:",pricingSubtotal:"Subtotale:",pricingService:"servizio"},pt:{loading:"A carregar...",night:"Noite",chooseOption:"Escolha uma op\xE7\xE3o",apartment:"Apartamento",total:"Total",missingEnterpriseId:"ID da empresa em falta",missingCategoryId:"ID da categoria em falta",minimumNights:"noites m\xEDnimas",maximumNights:"noites m\xE1ximas",booked:"J\xE1 reservado",select:"Selecionar",fatalErrorMessage:"Ops! Ocorreu um erro inesperado. Por favor, recarregue a p\xE1gina ou contacte o suporte.",pleaseWait:"Por favor, aguarde...","chargingMode:Once":"Uma vez","chargingMode:PerTimeUnit":"Por noite","chargingMode:PerPersonPerTimeUnit":"Por pessoa por noite",adults:"Adultos",children:"Crian\xE7as (0-18 anos)",guestSingular:"Pessoa",guestPlural:"Pessoas",couponValid:"O cup\xE3o \xE9 v\xE1lido ;)",couponInvalid:"O cup\xE3o \xE9 inv\xE1lido!",couponError:"Erro ao validar o cup\xE3o!",proceedToPayment:"Prosseguir para pagamento",completePayment:"Concluir pagamento",viewHotelPage:"Ver site",pricingProducts:"Produtos:",pricingProductsAndExtras:"Produtos e extras:",pricingTaxes:"Impostos:",pricingSubtotal:"Subtotal:",pricingService:"servi\xE7o"},zh:{loading:"\u52A0\u8F7D\u4E2D...",night:"\u665A",chooseOption:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879",apartment:"\u516C\u5BD3",total:"\u603B\u8BA1",missingEnterpriseId:"\u7F3A\u5C11\u4F01\u4E1AID",missingCategoryId:"\u7F3A\u5C11\u7C7B\u522BID",minimumNights:"\u6700\u5C11\u5165\u4F4F\u665A\u6570",maximumNights:"\u6700\u591A\u5165\u4F4F\u665A\u6570",booked:"\u5DF2\u9884\u8BA2",select:"\u9009\u62E9",fatalErrorMessage:"\u7CDF\u7CD5\uFF01\u53D1\u751F\u4E86\u610F\u5916\u9519\u8BEF\u3002\u8BF7\u5237\u65B0\u9875\u9762\u6216\u8054\u7CFB\u652F\u6301\u3002",pleaseWait:"\u8BF7\u7A0D\u5019...","chargingMode:Once":"\u4E00\u6B21","chargingMode:PerTimeUnit":"\u6BCF\u665A","chargingMode:PerPersonPerTimeUnit":"\u6BCF\u4EBA\u6BCF\u665A",adults:"\u6210\u4EBA",children:"\u513F\u7AE5\uFF080-18\u5C81\uFF09",guestSingular:"\u4EBA",guestPlural:"\u4EBA",couponValid:"\u4F18\u60E0\u5238\u6709\u6548 ;)",couponInvalid:"\u4F18\u60E0\u5238\u65E0\u6548\uFF01",couponError:"\u9A8C\u8BC1\u4F18\u60E0\u5238\u65F6\u51FA\u9519\uFF01",proceedToPayment:"\u524D\u5F80\u652F\u4ED8",completePayment:"\u5B8C\u6210\u652F\u4ED8",viewHotelPage:"\u67E5\u770B\u7F51\u7AD9",pricingProducts:"\u4EA7\u54C1\uFF1A",pricingProductsAndExtras:"\u4EA7\u54C1\u53CA\u9644\u52A0\u9879\uFF1A",pricingTaxes:"\u7A0E\u8D39\uFF1A",pricingSubtotal:"\u5C0F\u8BA1\uFF1A",pricingService:"\u670D\u52A1"},ar:{loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644...",night:"\u0644\u064A\u0644\u0629",chooseOption:"\u0627\u062E\u062A\u0631 \u062E\u064A\u0627\u0631\u064B\u0627",apartment:"\u0634\u0642\u0629",total:"\u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",missingEnterpriseId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0634\u0631\u0643\u0629 \u0645\u0641\u0642\u0648\u062F",missingCategoryId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0641\u0626\u0629 \u0645\u0641\u0642\u0648\u062F",minimumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",maximumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",booked:"\u0645\u062D\u062C\u0648\u0632 \u0628\u0627\u0644\u0641\u0639\u0644",select:"\u0627\u062E\u062A\u064A\u0627\u0631",fatalErrorMessage:"\u0639\u0630\u0631\u064B\u0627! \u062D\u062F\u062B \u062E\u0637\u0623 \u063A\u064A\u0631 \u0645\u062A\u0648\u0642\u0639. \u064A\u0631\u062C\u0649 \u0625\u0639\u0627\u062F\u0629 \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0635\u0641\u062D\u0629 \u0623\u0648 \u0627\u0644\u0627\u062A\u0635\u0627\u0644 \u0628\u0627\u0644\u062F\u0639\u0645.",pleaseWait:"\u064A\u0631\u062C\u0649 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631...","chargingMode:Once":"\u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629","chargingMode:PerTimeUnit":"\u0644\u0643\u0644 \u0644\u064A\u0644\u0629","chargingMode:PerPersonPerTimeUnit":"\u0644\u0643\u0644 \u0634\u062E\u0635 \u0641\u064A \u0627\u0644\u0644\u064A\u0644\u0629",adults:"\u0627\u0644\u0628\u0627\u0644\u063A\u0648\u0646",children:"\u0627\u0644\u0623\u0637\u0641\u0627\u0644 (0-18 \u0633\u0646\u0629)",guestSingular:"\u0634\u062E\u0635",guestPlural:"\u0623\u0634\u062E\u0627\u0635",couponValid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u0635\u0627\u0644\u062D\u0629 ;)",couponInvalid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629!",couponError:"\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u0644\u0642\u0633\u064A\u0645\u0629!",proceedToPayment:"\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0641\u0639",completePayment:"\u0625\u062A\u0645\u0627\u0645 \u0627\u0644\u062F\u0641\u0639",viewHotelPage:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0648\u0642\u0639",pricingProducts:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A:",pricingProductsAndExtras:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A \u0648\u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A:",pricingTaxes:"\u0627\u0644\u0636\u0631\u0627\u0626\u0628:",pricingSubtotal:"\u0627\u0644\u0645\u062C\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u0639\u064A:",pricingService:"\u0627\u0644\u062E\u062F\u0645\u0629"},ru:{loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",night:"\u041D\u043E\u0447\u044C",chooseOption:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442",apartment:"\u0410\u043F\u0430\u0440\u0442\u0430\u043C\u0435\u043D\u0442\u044B",total:"\u0418\u0442\u043E\u0433\u043E",missingEnterpriseId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",missingCategoryId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438",minimumNights:"\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",maximumNights:"\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",booked:"\u0423\u0436\u0435 \u0437\u0430\u0431\u0440\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",fatalErrorMessage:"\u0423\u043F\u0441! \u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u043E\u0439.",pleaseWait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435...","chargingMode:Once":"\u041E\u0434\u0438\u043D \u0440\u0430\u0437","chargingMode:PerTimeUnit":"\u0417\u0430 \u043D\u043E\u0447\u044C","chargingMode:PerPersonPerTimeUnit":"\u0417\u0430 \u0447\u0435\u043B\u043E\u0432\u0435\u043A\u0430 \u0437\u0430 \u043D\u043E\u0447\u044C",adults:"\u0412\u0437\u0440\u043E\u0441\u043B\u044B\u0435",children:"\u0414\u0435\u0442\u0438 (0-18 \u043B\u0435\u0442)",guestSingular:"\u0427\u0435\u043B\u043E\u0432\u0435\u043A",guestPlural:"\u041B\u044E\u0434\u0438",couponValid:"\u041A\u0443\u043F\u043E\u043D \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D ;)",couponInvalid:"\u041A\u0443\u043F\u043E\u043D \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D!",couponError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0443\u043F\u043E\u043D\u0430!",proceedToPayment:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u043F\u043B\u0430\u0442\u0435",completePayment:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u043F\u043B\u0430\u0442\u0443",viewHotelPage:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0430\u0439\u0442",pricingProducts:"\u0422\u043E\u0432\u0430\u0440\u044B:",pricingProductsAndExtras:"\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0434\u043E\u043F. \u0443\u0441\u043B\u0443\u0433\u0438:",pricingTaxes:"\u041D\u0430\u043B\u043E\u0433\u0438:",pricingSubtotal:"\u041F\u0440\u043E\u043C\u0435\u0436\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u0438\u0442\u043E\u0433:",pricingService:"\u0443\u0441\u043B\u0443\u0433\u0430"}},vc={en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"fr-FR":["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],de:["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],es:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],it:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],pt:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],zh:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ar:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],ru:["\u044F\u043D\u0432.","\u0444\u0435\u0432\u0440.","\u043C\u0430\u0440\u0442","\u0430\u043F\u0440.","\u043C\u0430\u0439","\u0438\u044E\u043D\u044C","\u0438\u044E\u043B\u044C","\u0430\u0432\u0433.","\u0441\u0435\u043D\u0442.","\u043E\u043A\u0442.","\u043D\u043E\u044F\u0431.","\u0434\u0435\u043A."]},Ju=()=>{let n=Dn().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in vc)return vc[r];return vc.en},Zu=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Lm=n=>{let t=[],e=o=>{o&&!t.includes(o)&&t.push(o)};e(n);let r=n.split("-")[0];return r&&r!==n&&e(r),({en:["en-US","en-GB"],es:["es-ES","es-MX","es-419"],de:["de-DE","de-AT","de-CH"],it:["it-IT","it-CH"],pt:["pt-PT","pt-BR"],zh:["zh-CN","zh-TW","zh-Hans","zh-Hant"],ar:["ar-SA","ar-EG"],ru:["ru-RU"],fr:["fr-FR","fr-CA","fr-BE","fr"]}[r]??[]).forEach(e),e("en-US"),e("en"),e("fr-FR"),e("fr"),t},Pe=n=>Ku[Dn().bcp47][n]||Ku["fr-FR"][n],Xe=n=>{let t=Dn().bcp47,e=t.split("-")[0],r=Zu(n,Lm(t));if(r!==void 0)return r;if(e){let a=Object.entries(n).find(([s])=>s===e||s.startsWith(`${e}-`));if(a&&a[1].trim()!=="")return a[1]}let i=Zu(n,["en-US","en","fr-FR","fr"]);if(i!==void 0)return i;let o=Object.values(n).find(a=>typeof a=="string"&&a.trim()!=="");return o!==void 0?o:(console.warn(`Translation [${t}] not found and no fallback strings were available.`,n),"")};var Nm={en:"en-US",fr:"fr-FR",de:"de-DE",es:"es-ES",it:"it-IT",pt:"pt-PT",zh:"zh-CN",ru:"ru-RU",ar:"en-US"},Xu=n=>Nm[n]||"fr-FR",Dn=()=>{let n=document.documentElement.lang.toLowerCase(),t={iso639:"fr",bcp47:"fr-FR"},r=Object.entries({en:{iso639:"en",bcp47:"en"},fr:{iso639:"fr",bcp47:"fr-FR"},de:{iso639:"de",bcp47:"de"},es:{iso639:"es",bcp47:"es"},it:{iso639:"it",bcp47:"it"},pt:{iso639:"pt",bcp47:"pt"},zh:{iso639:"zh",bcp47:"zh"},ar:{iso639:"ar",bcp47:"ar"},ru:{iso639:"ru",bcp47:"ru"}}).find(([i])=>n.startsWith(i))?.[1];return r&&(t=r),t},qe=Dn().bcp47,Pp=Dn().iso639;var J=class n{static getCurrentDate(){return xe.Now.plainDateISO()}static fromString(t){return xe.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(qe,e)}static formatForAPI(t){return(typeof t=="string"?xe.PlainDate.from(t):xe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:xe.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 xe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return xe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return xe.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 xe.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 xe.PlainDate.from(e)}return xe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var Bp=localStorage.getItem("dev")==="true";var Fp=3*60*60*1e3;var ua="calendar-day-price",Qu="DD/MM/YYYY",ed="Y-m-d",td=!1,Om=365,bc=J.getCurrentDate(),nd=J.addDays(bc,Om),Tr=J.getCurrentDate(),ei=J.addDays(Tr,3),Hm=J.getCurrentDate(),Yp=J.addDays(Hm,30);function ir(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}var da="data-fs-element";var G=(n,t=document)=>t.querySelector(`[${da}="${n}"]`);var rd=n=>`[${da}="${n.getAttribute(da)}"]`,id=n=>n.getAttribute(da);var wc=class{constructor(){A(this,"state",nr({appartmentsData:[],today:J.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}},df=new wc;var Sr={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)),Sr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Sr.get(n),r=t(e);Sr.set(n,r)},remove:n=>{localStorage.removeItem(n),Sr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",Fm()||"root")}},Fm=()=>localStorage.getItem("lastUpdater");var ha=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},or=Sr.get("form_state"),od=or?{enterpriseId:or.enterpriseId||"",startDate:or.startDate||ha(45),endDate:or.endDate||ha(48),guests:or.guests||2,coupon:or.coupon||"",referrer:or.referrer||window.location.href,rooms:or.rooms||0}:{enterpriseId:"",startDate:ha(45),endDate:ha(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},Ft=nr(od),Bm=Qr(od);Rt(()=>{Sr.set("form_state",Ft)});var Ym="https://yuna-backend.cbocher.workers.dev/mews",$m="https://api.mews.com/api/distributor/v1",jm="Yuna",zm="mewscache",Um=!1,Vm=13,qm=8,Wm=xe.Duration.from({minutes:20}).milliseconds,Gm=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),le={base_url:Ym,bookingEngine_url:$m,bookingEngineClient:jm,bypassCache:Um,headers:Gm,cache_key:zm,ttl:Wm,beCheckInUTC:Vm,beCheckOutUTC:qm};var ma=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ti=class{constructor(){A(this,"dbName","MewsAPICache");A(this,"version",2);A(this,"db",null);A(this,"initPromise",null);A(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(u){console.warn("Error cleaning up old stores:",u)}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 l=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);l.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},l.onsuccess=()=>{let u=l.result;if(!u){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:le.ttl,p=xe.Instant.fromEpochMilliseconds(u.timestamp);if(xe.Now.instant().since(p,{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,u.size),o(u.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:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((l,u)=>{let y=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),u(y.error)},y.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),l()}})}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:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((l,u)=>{let y=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>u(y.error),y.onsuccess=()=>l()})}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=xe.Now.instant().epochMilliseconds-le.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),l=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),u=50;for(let h=0;h<l.length;h+=u){let p=l.slice(h,h+u);await Promise.all(p.map(y=>new Promise((w,T)=>{let S=a.delete(y.cacheKey);S.onsuccess=()=>w(),S.onerror=()=>T(S.error)}))),e+=p.length,h+u<l.length&&await new Promise(y=>setTimeout(y,0))}await new Promise((h,p)=>{o.oncomplete=()=>h(),o.onerror=()=>p(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,l)=>{let u=o.getAll();u.onsuccess=()=>s(u.result),u.onerror=()=>l(u.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(l=>new Promise((u,h)=>{let p=i.delete(l.cacheKey);p.onsuccess=()=>u(),p.onerror=()=>h(p.error)})))}await new Promise((s,l)=>{r.oncomplete=()=>s(),r.onerror=()=>l(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 l=r.getAll();l.onsuccess=()=>a(l.result),l.onerror=()=>s(l.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 Fn=async(n,t,e=null,r=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new ti,o=ma(`booking-engine:${n}`,e||"null",t.body);if(!le.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(l=>{console.error("Error setting booking engine cache:",l)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var ad=async n=>{let t=`${le.bookingEngine_url}/hotels/get`,e={Client:le.bookingEngineClient,HotelId:n},r={method:"POST",headers:le.headers,body:JSON.stringify(e)};return Fn(t,r,n)};var pa=(n,t)=>{let e=`${le.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var sd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)},cd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var Qe=async(n,t,e=null,r=!1)=>{let i=new ti,o=ma(n,e||"null",t.body);if(!le.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(le.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),l=await s.json();if(s.ok)return i.set(o,l,e||"null").catch(u=>{console.error("Error setting cache:",u)}),l;throw new Error("FETCH_ERROR",{cause:l})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var ld=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAll",e,n)};function ud(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Xe(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Dc=Ze({});async function dd(n){if(Dc.value[n])return Dc.value[n];let t=await ld(n),e=ud(t);return Dc.value[n]=e,e}var hd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/ageCategories/getAll",e,n)};function md(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:Xe(t.Names),shortName:t.ShortNames?Xe(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Ec=Ze({});async function pd(n){if(Ec.value[n])return Ec.value[n];let t=await hd(n,{EnterpriseIds:[n]}),e=md(t);return Ec.value[n]=e,e}var fd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/products/getAll",e,n)};function gd(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 yd(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 vd(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:Xe(t.Names),shortName:t.ShortName,description:Xe(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function ho(n,t){return n.map(t)}function _c(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Xe(n.Names),shortName:Xe(n.ShortNames),description:Xe(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 bd(n){return{products:ho(n.Products,_c),customerProducts:ho(n.CustomerProducts,_c)}}var Mc=Ze({});async function wd(n,t){if(Mc.value[t])return Mc.value[t];let e=await fd(n,{ServiceIds:[t]}),r=bd(e);return Mc.value[t]=r,r}var Dd=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getAll",e,n)};var Tc=Ze({});async function fa(n,t){if(Tc.value[t])return Tc.value[t];let e=await Dd(n,{ServiceIds:[t]}),r=vd(e);return Tc.value[t]=r,r}var Ed=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAvailability",e,n)};function _d(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 Sc=Ze({});async function Md(n,t,e,r){if(Sc.value[t])return Sc.value[t];let i=await Ed(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=_d(i);return Sc.value[t]=o,o}var Td=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/restrictions/getAll",e,n)};function Sd(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Cc=Ze({});async function Cd(n,t,e,r){if(Cc.value[t])return Cc.value[t];let i=await Td(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Sd(i);return Cc.value[t]=o,o}var kd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rules/getAll",e,n)};function Pd(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 kc=Ze({});async function Id(n,t){if(kc.value[t])return kc.value[t];let e=await kd(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Pd(e);return kc.value[t]=r,r}var Rd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getPricing",e,n)};var Pc=Ze({});async function xd(n,t,e,r){if(Pc.value[t])return Pc.value[t];let i=await Rd(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=gd(i);return Pc.value[t]=o,o}var ga=class{constructor(t,e){A(this,"enterprise");A(this,"rate",null);A(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 xd(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 ya=class{constructor(t,e){A(this,"enterprise");A(this,"service",null);A(this,"products",[]);A(this,"customerProducts",[]);A(this,"restrictions",[]);A(this,"availabilities",[]);A(this,"rules",[]);A(this,"ageCategories",[]);A(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 Md(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 Cd(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 wd(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 fa(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new ga(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 Id(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 pd(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ni=class{constructor(t){A(this,"enterpriseId");A(this,"services",[]);A(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await dd(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ya(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var N,Ie,En,ar,Ic=class{constructor(){_o(this,En);_o(this,N,nr({loading:!1,error:null,isFetching:!1,cmsApartmentData:{},enterpriseInstance:null,reservableService:null,startDate:null,endDate:null,rooms:[],couponCode:"",hotel:null,availabilities:null,rates:[],servicePricing:null,reservationPricing:null,serviceOnlyPricing:null,ageCategories:[],products:[],selectedRateId:null,be_pricing:null}));_o(this,Ie,{nightsCount:Xt(()=>!C(this,N).startDate||!C(this,N).endDate?0:C(this,N).startDate.until(C(this,N).endDate).days),selectedProducts:Xt(()=>C(this,N).products.filter(t=>t.selected)),maxAllowedRooms:Xt(()=>{if(!C(this,N).availabilities)return 0;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:Xt(()=>C(this,N).servicePricing?.Rates?C(this,N).servicePricing.Rates.map(t=>{let e=C(this,N).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=C(this,N).servicePricing?.CategoryPrices.find(o=>o.CategoryId===C(this,N).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=C(this,N).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),l={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,w)=>y+w.value,0);return l[u]=p||0,{ageCategoryId:u,totalPersons:p}}),o.Occupancies.every(u=>{let h=l[u.AgeCategoryId];return h===void 0||u.PersonCount===h})})?.RateGroupPrices?.find(o=>o.MinRateId===t.Id);return{id:t.Id,name:Xe(t.Name),description:Xe(t.Description),isPrivate:t.IsPrivate,currencyCode:t.CurrencyCode,ordering:t.Ordering,groupId:e?.Id??"",groupOrdering:e?.Ordering||0,price:i?.MinPrice,selected:!1}}).filter(t=>t.price!==void 0&&t.price.TotalAmount?.GrossValue!==void 0&&t.price.TotalAmount?.GrossValue>0):[]),summary:Xt(()=>{let t=C(this,N).reservationPricing?.OccupancyPrices??[],e=C(this,N).serviceOnlyPricing?.OccupancyPrices??[],r=C(this,N).cmsApartmentData?.name??"",{rooms:i}=C(this,N),o="EUR";if(C(this,N).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let w of e){let T=w.Pricing.find($=>$.RateId===C(this,N).selectedRateId);if(!T)continue;let x=T.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,W)=>$+W.NetValue,0);a.set(`${w.AdultCount}-${w.ChildCount}`,x)}let s=new Map;for(let w of t){let T=w.Pricing.find(ae=>ae.RateId===C(this,N).selectedRateId);if(!T)continue;let S=`${w.AdultCount}-${w.ChildCount}`,x=T.Price.TotalAmount[o],$=a.get(S)??0,W=C(this,Ie).nightsCount.value||1,K=$/W,ee=x.TaxValues.filter(ae=>ae.TaxRateCode==="FR-R").reduce((ae,Ce)=>ae+Ce.Value,0),oe=x.GrossValue-$-ee;s.set(S,{rateId:T.RateId,pricing:{avgPerNight:K,service:$,products:oe,taxes:ee,subtotal:x.GrossValue}})}let l=new Map;for(let w of i){let T=0,S=0;for(let $ of w)$.isAdult?T+=$.value:S+=$.value;let x=`${T}-${S}`;l.has(x)?l.get(x).quantity+=1:l.set(x,{adults:T,children:S,quantity:1})}if(!Array.from(l.keys()).every(w=>s.has(w)))return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(l.values()).map(w=>{let T=`${w.adults}-${w.children}`,S=s.get(T);return S?{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:S.rateId,pricing:S.pricing}:(console.warn(`[BookingState] Pricing not yet available for occupancy ${T}`,{availableOccupancies:Array.from(s.keys()),selectedRateId:C(this,N).selectedRateId,occupancyPricesCount:t.length}),{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:C(this,N).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((w,T)=>(w.service+=T.pricing.service*T.quantity,w.products+=T.pricing.products*T.quantity,w.taxes+=T.pricing.taxes*T.quantity,w.grandTotal+=T.pricing.subtotal*T.quantity,w),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:p,totals:y}}),totalStayPrice:Xt(()=>{let t=C(this,Ie).rates.value.find(e=>e.id===C(this,N).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:Xt(()=>{if(!C(this,N).availabilities)return!1;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:Xt(()=>C(this,Ie).selectedProducts.value.reduce((e,r)=>{let i=0;switch(r.chargingMode){case"Once":i=r.price||0;break;case"PerTimeUnit":i=r.price*C(this,Ie).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*C(this,Ie).nightsCount.value*C(this,Ie).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:Xt(()=>C(this,Ie).totalStayPrice.value+C(this,Ie).productsTotalPrice.value),restrictionMessage:Xt(()=>{if(!C(this,N).availabilities)return null;let t=C(this,N).availabilities.ApplicableRestrictions??[];if(t.length===0)return null;let{categoryId:e}=C(this,N).cmsApartmentData,r=t.filter(a=>a.Conditions.ResourceCategoryId===null||a.Conditions.ResourceCategoryId===e);if(r.length===0)return null;let i=C(this,Ie).nightsCount.value;if(i<1)return`1 ${Pe("minimumNights")}`;let o=a=>{if(!a)return null;try{return xe.Duration.from(a).total({unit:"days"})}catch{return null}};for(let a of r){let{Exceptions:s}=a;if(s.MaxAdvance==null&&s.MinAdvance==null&&s.MaxLength==null&&s.MinLength==null&&s.MaxPrice==null&&s.MinPrice==null&&s.MaxReservationCount==null&&s.MinReservationCount==null)continue;let u=o(s.MinLength);if(u!==null&&i<u)return`${u} ${Pe("minimumNights")}`;let h=o(s.MaxLength);if(h!==null&&i>h)return`${h} ${Pe("maximumNights")}`}return null})})}get startDate(){return C(this,N).startDate}get endDate(){return C(this,N).endDate}get rooms(){return C(this,N).rooms}get couponCode(){return C(this,N).couponCode}get hotel(){return C(this,N).hotel}get availabilities(){return C(this,N).availabilities}get rates(){return C(this,N).rates}get servicePricing(){return C(this,N).servicePricing}get reservationPricing(){return C(this,N).reservationPricing}get ageCategories(){return C(this,N).ageCategories}get products(){return C(this,N).products}get selectedRateId(){return C(this,N).selectedRateId}get be_pricing(){return C(this,N).be_pricing}get cmsApartmentData(){return C(this,N).cmsApartmentData}get enterpriseInstance(){return C(this,N).enterpriseInstance}get reservableService(){return C(this,N).reservableService}get isFetching(){return C(this,N).isFetching}get nightsCount(){return C(this,Ie).nightsCount.value}get selectedProducts(){return C(this,Ie).selectedProducts.value}get maxAllowedRooms(){return C(this,Ie).maxAllowedRooms.value}get computedRates(){return C(this,Ie).rates.value}get computedSummary(){return C(this,Ie).summary.value}get totalStayPrice(){return C(this,Ie).totalStayPrice.value}get adultsCount(){return C(this,Ie).adultsCount.value}get childrenCount(){return C(this,Ie).childrenCount.value}get isAvailable(){return C(this,Ie).isAvailable.value}get productsTotalPrice(){return C(this,Ie).productsTotalPrice.value}get totalPrice(){return C(this,Ie).totalPrice.value}get restrictionMessage(){return C(this,Ie).restrictionMessage.value}setCmsApartmentData(t){C(this,N).cmsApartmentData=t,jn(this,En,ar).call(this)}updateStartDate(t){C(this,N).startDate=t,t&&(Ft.startDate=t.toString()),jn(this,En,ar).call(this)}updateEndDate(t){C(this,N).endDate=t,t&&(Ft.endDate=t.toString()),jn(this,En,ar).call(this)}updateRooms(t){C(this,N).rooms=t,jn(this,En,ar).call(this)}updateCouponCode(t){C(this,N).couponCode=t,jn(this,En,ar).call(this)}updateSelectedRateId(t){C(this,N).selectedRateId=t,jn(this,En,ar).call(this)}updateProducts(t){C(this,N).products=t,jn(this,En,ar).call(this)}async initializeResources(t){C(this,N).loading=!0,C(this,N).error=null;try{C(this,N).enterpriseInstance=new ni(t),await C(this,N).enterpriseInstance.initServices(),C(this,N).reservableService=C(this,N).enterpriseInstance.reservableService,await C(this,N).reservableService?.initAgeCategories(),C(this,N).ageCategories=C(this,N).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{C(this,N).loading=!1}}async initializeRooms(t=1,e=1){(Ft.rooms==null||Ft.rooms<1)&&(Ft.rooms=t);let r=[];for(let i=0;i<(Ft.rooms||t);i++){let o=C(this,N).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("children"),u=s?i===0&&(Ft.guests||e)||1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}});r.push(o)}C(this,N).rooms=r}async fetchHotel(t){C(this,N).loading=!0,C(this,N).error=null,C(this,N).isFetching=!0;try{let e=await ad(t);C(this,N).hotel=e,C(this,N).products=e?.Products.map(r=>({id:r.Id,name:Xe(r.Name),description:Xe(r.Description),categoryId:r.CategoryId,ordering:r.Ordering,imageIds:[r.ImageId],price:r.Prices.EUR,chargingMode:r.ChargingMode,selected:!1}))||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchAvailability(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,N).startDate,C(this,N).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await sd(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",Client:le.bookingEngineClient,LanguageCode:"fr-FR"});C(this,N).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchServicePricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchServicePricing: Invalid date range (0 nights), skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await cd(t,{Client:le.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:C(this,N).couponCode||void 0});C(this,N).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchReservationPricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchReservationPricing: Invalid date range (0 nights), skipping");return}if(C(this,N).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=C(this,N).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=C(this,Ie).selectedProducts.value.map(h=>h.id),s={Client:le.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:C(this,N).couponCode||void 0,Occupancies:o},l,u;return a.length===0?(l=await pa(t,{...s,ProductIds:[]}),u=l):[l,u]=await Promise.all([pa(t,{...s,ProductIds:a}),pa(t,{...s,ProductIds:[]})]),C(this,N).reservationPricing=l,C(this,N).serviceOnlyPricing=u,C(this,N).be_pricing=l,l}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchRates(t){if(!C(this,N).reservableService||!C(this,N).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}C(this,N).loading=!0;try{let e=C(this,N).reservableService.getService()?.id;C(this,N).rates=await fa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{C(this,N).loading=!1}}async fetchAllData(t,e){try{await this.initializeResources(t),await this.initializeRooms(),await this.fetchHotel(t),await this.fetchAvailability(t,e),await this.fetchServicePricing(t,e),await this.fetchReservationPricing(t,e),await this.fetchRates(t)}catch(r){throw console.error("[BXT] fetchAllData: Error in batch fetch",r),r}}getReadonlyState(){return Qr({...C(this,N),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}})}getState(){let{enterpriseInstance:t,reservableService:e,...r}=C(this,N);return{...JSON.parse(JSON.stringify(r)),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}}}};N=new WeakMap,Ie=new WeakMap,En=new WeakSet,ar=function(){C(this,N).isFetching};var B=new Ic;var Ad=()=>{};function lt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Ad}var va=n=>n instanceof HTMLInputElement;var Rc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Yt=(n,t=!0)=>n.cloneNode(t);var mo=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=va(e)?e.value:""}return t.toString()};var xc=(n,t)=>{n.querySelectorAll(t||"*").forEach(r=>r.remove())};var po=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!va(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}Rc(n,["click","input","change"])};function Ld(n,t){return{rate:n,pricing:t}}function Ac(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Nd(n,t){let e=t.filter(o=>Km(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=>Zm(n,o.Exceptions)))}function Km(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=J.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function ba(n){if(!n)return null;try{return xe.Duration.from(n).total({unit:"days"})}catch{return null}}function Zm(n,t){let e=J.fromString(n.pricing?.datesUtc[0]),r=J.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=J.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=ba(t.MinAdvance),l=ba(t.MaxAdvance),u=ba(t.MinLength),h=ba(t.MaxLength);return!!(u&&i<u||h&&i>h||s&&a<s||l&&a>l||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var Od=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Nd(s,t)&&Ac(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=yd(r),a=Jm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Jm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>Ac(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 Hd=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ni(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 u=>{let h=await u.initPricing(J.formatForAPI(bc.toString()),J.formatForAPI(nd.toString()));return Ld(u.getRate(),h)}));return Od(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 et=class et extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(et.parseDateTime(e,r,i));A(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 et)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=et.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[u,h]of Object.entries(o)){let p=Number(u),{group:y,pattern:w}=et.formatPatterns(h[0],i);s[y]=p+1,s.value+=w,s.value+=".*?"}let l=new RegExp(`^${s.value}$`);if(l.test(e)){let u=l.exec(e),h=Number(u[s.year]),p=null;s.month?p=Number(u[s.month])-1:s.shortMonth?p=et.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=et.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,w=Number(u[s.hour]),T=Number.isNaN(w)?0:w,S=Number(u[s.minute]),x=Number.isNaN(S)?0:S,$=Number(u[s.second]),W=Number.isNaN($)?0:$,K=u[s.ampm];return K&&K==="PM"&&(T+=12,T===24&&(T=0)),new Date(h,p,y,T,x,W,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return et.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return et.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:`(${et.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${et.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 et(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=et.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,l]of Object.entries(o)){let u=Number(s);i+=this.formatTokens(l[0],r),o[u+1]&&(i+=e.substring(l.index+l[0].length,o[u+1].index)),u===o.length-1&&(i+=e.substring(l.index+l[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 et.shortMonths(r)[this.getMonth()];case"MMMM":return et.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""}}};A(et,"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),A(et,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=et,Lc=class{constructor(t){A(this,"picker");this.picker=t}render(t,e){t||(t=new ge),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 l=this.getCalendarDaysView(t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:l});let u=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:u}),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 ge(this.picker.options.date):null,r=new ge,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}},Nc=class{constructor(t){A(this,"picker");A(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()}},wa=class{constructor(t){A(this,"Calendar",new Lc(this));A(this,"PluginManager",new Nc(this));A(this,"calendars",[]);A(this,"datePicked",[]);A(this,"cssLoaded",0);A(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});A(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:[]});A(this,"ui",{container:null,shadowRoot:null,wrapper:null});A(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 ge(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 ge(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof ge?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 ge(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 ge(this.options.date,this.options.format):this.calendars[0]=new ge}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}}},Ma=Object.freeze({__proto__:null,Core:wa,create:wa}),fo=class{constructor(){A(this,"picker");A(this,"options");A(this,"priority",0);A(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()}},Da=class extends fo{constructor(){super(...arguments);A(this,"priority",1);A(this,"binds",{onView:this.onView.bind(this)});A(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 ge(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new ge(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof ge&&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 ge&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof ge&&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"),l=o.clone().add(this.options.minDays-1,"day"),u=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){u=!0;break}s.add(1,"day")}for(;l.isAfter(o,"day");){if(this.testFilter(l)){h=!0;break}l.subtract(1,"day")}u&&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 ge(Number(i.dataset.start)),s=new ge(Number(i.dataset.end)),l=s.diff(a,"day"),u=this.options.minDays&&l<this.options.minDays,h=this.options.maxDays&&l>this.options.maxDays;(u||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 ge&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof ge&&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 Ea=class extends fo{constructor(){super(...arguments);A(this,"tooltipElement");A(this,"triggerElement");A(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)});A(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 l=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=l:e instanceof HTMLElement&&(e.innerText=l)}}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 ge(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),l=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&l&&(l.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,l)&&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 ge(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new ge(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new ge(e,this.picker.options.format),o=new ge(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 ge(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let l=o.clone();o=a.clone(),a=l.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(l=>{let u=new ge(l.dataset.time),h=this.picker.Calendar.getCalendarDayView(u);u.isBetween(o,a)&&h.classList.add("in-range"),u.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),l===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),l.className=h.className}),this.options.tooltip){let l=this.options.tooltipNumber(a.diff(o,"day")+1);if(l>0){let u=new Intl.PluralRules(this.picker.options.lang).select(l),h=`${l} ${this.options.locale[u]}`;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 ge(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,l=a.left;s-=i.top,l-=i.left,s-=o.height,l-=o.width/2,l+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${l}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 _a=class extends fo{constructor(){super(...arguments);A(this,"rangePlugin");A(this,"lockPlugin");A(this,"priority",10);A(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});A(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>'}});A(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 l=document.createElement("select");l.className="month-name--select month-name--dropdown";for(let u=0;u<12;u+=1){let h=document.createElement("option"),p=new ge(new Date(o.getFullYear(),u,2,0,0,0)),y=new ge(new Date(o.getFullYear(),u,1,0,0,0));h.value=String(u),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new ge(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new ge(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),l.appendChild(h)}l.addEventListener("change",u=>{let h=u.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(l)}if(this.options.dropdown.years){s.childNodes[1].remove();let l=document.createElement("select");l.className="month-name--select";let u=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}for(let p=h;p>=u;p-=1){let y=document.createElement("option"),w=new ge(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&w.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&w.isAfter(new ge(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,l.appendChild(y)}if(o.getFullYear()<u){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(l.childNodes).reverse();l.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,l.appendChild(y)})}l.addEventListener("change",p=>{let y=p.target;this.picker.calendars[0].setFullYear(Number(y.value)),this.picker.renderAll()}),s.appendChild(l)}}}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 ge(o.dataset.time);else{let h=i.querySelector(".day");s=new ge(h.dataset.time)}let l=s.getWeek(this.picker.options.firstDay);l===53&&s.getMonth()===0&&(l="53/1");let u=document.createElement("div");u.className="wnum-item",u.innerHTML=String(l),i.insertBefore(u,o)}})}}};var Ta=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],sr={_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 Sa={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},Ca=Sa;var ut=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Oc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var ka=function(n){return n instanceof Array?n:[n]};function dt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Se(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 go(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Hc(n,t){if(t(n))return n;if(n.parentNode)return Hc(n.parentNode,t)}function yo(n,t){var e=Se("div","numInputWrapper"),r=Se("input","numInput "+n),i=Se("span","arrowUp"),o=Se("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 jt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var Bc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Bd={D:Bc,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*$t(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:Bc,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:Bc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Yn={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})"},ri={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ri.w(n,t,e)]},F:function(n,t,e){return vo(ri.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ut(ri.h(n,t,e))},H:function(n){return ut(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[$t(n.getHours()>11)]},M:function(n,t){return vo(n.getMonth(),!0,t)},S:function(n){return ut(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ut(n.getFullYear(),4)},d:function(n){return ut(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ut(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ut(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 Fc=function(n){var t=n.config,e=t===void 0?sr:t,r=n.l10n,i=r===void 0?Sa:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,l,u){var h=u||i;return e.formatDate!==void 0&&!a?e.formatDate(s,l,h):l.split("").map(function(p,y,w){return ri[p]&&w[y-1]!=="\\"?ri[p](s,h,e):p!=="\\"?p:""}).join("")}},Pa=function(n){var t=n.config,e=t===void 0?sr:t,r=n.l10n,i=r===void 0?Sa:r;return function(o,a,s,l){if(!(o!==0&&!o)){var u=l||i,h,p=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 y=a||(e||sr).dateFormat,w=String(o).trim();if(w==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(w)||/GMT$/.test(w))h=new Date(o);else{for(var T=void 0,S=[],x=0,$=0,W="";x<y.length;x++){var K=y[x],ee=K==="\\",oe=y[x-1]==="\\"||ee;if(Yn[K]&&!oe){W+=Yn[K];var ae=new RegExp(W).exec(o);ae&&(T=!0)&&S[K!=="Y"?"push":"unshift"]({fn:Bd[K],val:ae[++$]})}else ee||(W+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),S.forEach(function(Ce){var Te=Ce.fn,ce=Ce.val;return h=Te(h,ce,u)||h}),h=T?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+p));return}return s===!0&&h.setHours(0,0,0,0),h}}};function zt(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 Fd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},Ia=function(n,t,e){return n*3600+t*60+e},Yd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},$d={DAY:864e5};function Ra(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(),l=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(l,e)),t===s&&e===l&&(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(l){return n[l]=s[l]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var ht=function(){return ht=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},ht.apply(this,arguments)},jd=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},Xm=300;function Qm(n,t){var e={config:ht(ht({},sr),We.defaultConfig),l10n:Ca};e.parseDate=Pa({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=S,e._setHoursFromDate=y,e._positionCalendar=$n,e.changeMonth=_,e.changeYear=re,e.clear=I,e.close=P,e.onMouseOver=we,e._createElement=Se,e.createDay=ae,e.destroy=j,e.isEnabled=Z,e.jumpToDate=W,e.updateValue=_n,e.open=He,e.redraw=wo,e.set=Zd,e.setDate=Jd,e.toggle=th;function r(){e.utils={getDaysInMonth:function(f,b){return f===void 0&&(f=e.currentMonth),b===void 0&&(b=e.currentYear),f===1&&(b%4===0&&b%100!==0||b%400===0)?29:e.l10n.daysInMonth[f]}}}function i(){e.element=e.input=n,e.isOpen=!1,ot(),cr(),Qd(),Xd(),r(),e.isMobile||oe(),$(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),_n(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&$n(),Fe("onReady")}function o(){var f;return((f=e.calendarContainer)===null||f===void 0?void 0:f.getRootNode()).activeElement||document.activeElement}function a(f){return f.bind(e)}function s(){var f=e.config;f.weekNumbers===!1&&f.showMonths===1||f.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 b=(e.days.offsetWidth+1)*f.showMonths;e.daysContainer.style.width=b+"px",e.calendarContainer.style.width=b+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function l(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||zt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=Ra(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&ih(f);var L=e._input.value;p(),_n(),e._input.value!==L&&e._debouncedChange()}function u(f,b){return f%12+12*$t(b===e.l10n.amPM[1])}function h(f){switch(f%24){case 0:case 12:return 12;default:return f%12}}function p(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var f=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,b=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(f=u(f,e.amPM.textContent));var L=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&zt(e.latestSelectedDateObj,e.config.minDate,!0)===0,q=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&zt(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 Q=Ia(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=Ia(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),ne=Ia(f,b,M);if(ne>ye&&ne<Q){var De=Yd(Q);f=De[0],b=De[1],M=De[2]}}else{if(q){var te=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,te.getHours()),f===te.getHours()&&(b=Math.min(b,te.getMinutes())),b===te.getMinutes()&&(M=Math.min(M,te.getSeconds()))}if(L){var de=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,de.getHours()),f===de.getHours()&&b<de.getMinutes()&&(b=de.getMinutes()),b===de.getMinutes()&&(M=Math.max(M,de.getSeconds()))}}w(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&w(b.getHours(),b.getMinutes(),b.getSeconds())}function w(f,b,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(f%24,b,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=ut(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=ut(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ut(M)))}function T(f){var b=jt(f),M=parseInt(b.value)+(f.delta||0);(M/1e3>1||f.key==="Enter"&&!/[^\d]/.test(M.toString()))&&re(M)}function S(f,b,M,L){if(b instanceof Array)return b.forEach(function(q){return S(f,q,M,L)});if(f instanceof Array)return f.forEach(function(q){return S(q,b,M,L)});f.addEventListener(b,M,L),e._handlers.push({remove:function(){return f.removeEventListener(b,M,L)}})}function x(){Fe("onChange")}function $(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(L){return S(L,"click",e[M])})}),e.isMobile){eh();return}var f=Oc(_e,50);if(e._debouncedChange=Oc(x,Xm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&S(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&we(jt(M))}),S(e._input,"keydown",pe),e.calendarContainer!==void 0&&S(e.calendarContainer,"keydown",pe),!e.config.inline&&!e.config.static&&S(window,"resize",f),window.ontouchstart!==void 0?S(window.document,"touchstart",X):S(window.document,"mousedown",X),S(window.document,"focus",X,{capture:!0}),e.config.clickOpens===!0&&(S(e._input,"focus",e.open),S(e._input,"click",e.open)),e.daysContainer!==void 0&&(S(e.monthNav,"click",rh),S(e.monthNav,["keyup","increment"],T),S(e.daysContainer,"click",jc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return jt(M).select()};S(e.timeContainer,["increment"],l),S(e.timeContainer,"blur",l,{capture:!0}),S(e.timeContainer,"click",K),S([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&S(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&S(e.amPM,"click",function(M){l(M)})}e.config.allowInput&&S(e._input,"blur",ue)}function W(f,b){var M=f!==void 0?e.parseDate(f):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),L=e.currentYear,q=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(Q){Q.message="Invalid date supplied: "+M,e.config.errorHandler(Q)}b&&e.currentYear!==L&&(Fe("onYearChange"),se()),b&&(e.currentYear!==L||e.currentMonth!==q)&&Fe("onMonthChange"),e.redraw()}function K(f){var b=jt(f);~b.className.indexOf("arrow")&&ee(f,b.classList.contains("arrowUp")?1:-1)}function ee(f,b,M){var L=f&&jt(f),q=M||L&&L.parentNode&&L.parentNode.firstChild,Q=Ya("increment");Q.delta=b,q&&q.dispatchEvent(Q)}function oe(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Se("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Se("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=D(),M=b.weekWrapper,L=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=L,e.weekWrapper=M}e.rContainer=Se("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Se("div","flatpickr-days"),e.daysContainer.tabIndex=-1),Y(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),dt(e.calendarContainer,"rangeMode",e.config.mode==="range"),dt(e.calendarContainer,"animate",e.config.animate===!0),dt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var q=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&&(!q&&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 Q=Se("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(Q,e.element),Q.appendChild(e.element),e.altInput&&Q.appendChild(e.altInput),Q.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function ae(f,b,M,L){var q=Z(b,!0),Q=Se("span",f,b.getDate().toString());return Q.dateObj=b,Q.$i=L,Q.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&zt(b,e.now)===0&&(e.todayDateElem=Q,Q.classList.add("today"),Q.setAttribute("aria-current","date")),q?(Q.tabIndex=-1,$a(b)&&(Q.classList.add("selected"),e.selectedDateElem=Q,e.config.mode==="range"&&(dt(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),dt(Q,"endRange",e.selectedDates[1]&&zt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&Q.classList.add("inRange")))):Q.classList.add("flatpickr-disabled"),e.config.mode==="range"&&nh(b)&&!$a(b)&&Q.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&L%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Fe("onDayCreate",Q),Q}function Ce(f){f.focus(),e.config.mode==="range"&&we(f)}function Te(f){for(var b=f>0?0:e.config.showMonths-1,M=f>0?e.config.showMonths:-1,L=b;L!=M;L+=f)for(var q=e.daysContainer.children[L],Q=f>0?0:q.children.length-1,ye=f>0?q.children.length:-1,ne=Q;ne!=ye;ne+=f){var De=q.children[ne];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function ce(f,b){for(var M=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,L=b>0?e.config.showMonths:-1,q=b>0?1:-1,Q=M-e.currentMonth;Q!=L;Q+=q)for(var ye=e.daysContainer.children[Q],ne=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,te=ne;te>=0&&te<De&&te!=(b>0?De:-1);te+=q){var de=ye.children[te];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-te)>=Math.abs(b))return Ce(de)}e.changeMonth(q),F(Te(q),0)}function F(f,b){var M=o(),L=V(M||document.body),q=f!==void 0?f:L?M:e.selectedDateElem!==void 0&&V(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&V(e.todayDateElem)?e.todayDateElem:Te(b>0?1:-1);q===void 0?e._input.focus():L?ce(q,b):Ce(q)}function z(f,b){for(var M=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,L=e.utils.getDaysInMonth((b-1+12)%12,f),q=e.utils.getDaysInMonth(b,f),Q=window.document.createDocumentFragment(),ye=e.config.showMonths>1,ne=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",te=L+1-M,de=0;te<=L;te++,de++)Q.appendChild(ae("flatpickr-day "+ne,new Date(f,b-1,te),te,de));for(te=1;te<=q;te++,de++)Q.appendChild(ae("flatpickr-day",new Date(f,b,te),te,de));for(var Ae=q+1;Ae<=42-M&&(e.config.showMonths===1||de%7!==0);Ae++,de++)Q.appendChild(ae("flatpickr-day "+De,new Date(f,b+1,Ae%q),Ae,de));var dn=Se("div","dayContainer");return dn.appendChild(Q),dn}function Y(){if(e.daysContainer!==void 0){go(e.daysContainer),e.weekNumbers&&go(e.weekNumbers);for(var f=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),f.appendChild(z(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&we()}}function se(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(L){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&L<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&L>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var M=Se("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,b).getMonth().toString(),M.textContent=vo(b,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===b&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var f=Se("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Se("span","cur-month"):(e.monthsDropdownContainer=Se("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),S(e.monthsDropdownContainer,"change",function(ye){var ne=jt(ye),De=parseInt(ne.value,10);e.changeMonth(De-e.currentMonth),Fe("onMonthChange")}),se(),M=e.monthsDropdownContainer);var L=yo("cur-year",{tabindex:"-1"}),q=L.getElementsByTagName("input")[0];q.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&q.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(q.setAttribute("max",e.config.maxDate.getFullYear().toString()),q.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var Q=Se("div","flatpickr-current-month");return Q.appendChild(M),Q.appendChild(L),b.appendChild(Q),f.appendChild(b),{container:f,yearElement:q,monthElement:M}}function H(){go(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var f=e.config.showMonths;f--;){var b=g();e.yearElements.push(b.yearElement),e.monthElements.push(b.monthElement),e.monthNav.appendChild(b.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=Se("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Se("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Se("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,H(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(dt(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(dt(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],Eo(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=Ra(e.config);e.timeContainer=Se("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Se("span","flatpickr-time-separator",":"),M=yo("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var L=yo("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=L.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():f.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(b),e.timeContainer.appendChild(L),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var q=yo("flatpickr-second");e.secondElement=q.getElementsByTagName("input")[0],e.secondElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():f.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(Se("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(q)}return e.config.time_24hr||(e.amPM=Se("span","flatpickr-am-pm",e.l10n.amPM[$t((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?go(e.weekdayContainer):e.weekdayContainer=Se("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Se("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return E(),e.weekdayContainer}function E(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=jd(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=jd(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
|
|
1
|
+
var yh=Object.create;var za=Object.defineProperty;var vh=Object.getOwnPropertyDescriptor;var bh=Object.getOwnPropertyNames;var wh=Object.getPrototypeOf,Dh=Object.prototype.hasOwnProperty;var Eh=(n,t,e)=>t in n?za(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var _h=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bh(t))!Dh.call(n,i)&&i!==e&&za(n,i,{get:()=>t[i],enumerable:!(r=vh(t,i))||r.enumerable});return n};var Kc=(n,t,e)=>(e=n!=null?yh(wh(n)):{},_h(t||!n||!n.__esModule?za(e,"default",{value:n,enumerable:!0}):e,n));var A=(n,t,e)=>(Eh(n,typeof t!="symbol"?t+"":t,e),e),Gc=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var S=(n,t,e)=>(Gc(n,t,"read from private field"),e?e.call(n):t.get(n)),_o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)};var jn=(n,t,e)=>(Gc(n,t,"access private method"),e);var Zc=Wc((Ua,Va)=>{(function(n,t){typeof Ua=="object"&&typeof Va<"u"?Va.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(Ua,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(F,z){(z==null||z>F.length)&&(z=F.length);for(var Y=0,se=Array(z);Y<z;Y++)se[Y]=F[Y];return se}function r(F){if(Array.isArray(F))return F}function i(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}function o(F,z,Y){return z=p(z),$(F,T()?Reflect.construct(z,Y||[],p(F).constructor):z.apply(F,Y))}function a(F,z){if(!(F instanceof z))throw new TypeError("Cannot call a class as a function")}function s(F,z,Y){if(T())return Reflect.construct.apply(null,arguments);var se=[null];se.push.apply(se,z);var g=new(F.bind.apply(F,se));return Y&&K(g,Y.prototype),g}function c(F,z){for(var Y,se=0;se<z.length;se++)Y=z[se],Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(F,oe(Y.key),Y)}function u(F,z,Y){return z&&c(F.prototype,z),Y&&c(F,Y),Object.defineProperty(F,"prototype",{writable:!1}),F}function h(F,z){var Y=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!Y){if(Array.isArray(F)||(Y=Pe(F))||z&&F&&typeof F.length=="number"){Y&&(F=Y);var se=0,g=function(){};return{s:g,n:function(){return se>=F.length?{done:!0}:{done:!1,value:F[se++]}},e:function(v){throw v},f:g}}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 B,l=!0,d=!1;return{s:function(){Y=Y.call(F)},n:function(){var v=Y.next();return l=v.done,v},e:function(v){d=!0,B=v},f:function(){try{l||Y.return==null||Y.return()}finally{if(d)throw B}}}}function p(F){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(z){return z.__proto__||Object.getPrototypeOf(z)},p(F)}function y(F,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");F.prototype=Object.create(z&&z.prototype,{constructor:{value:F,writable:!0,configurable:!0}}),Object.defineProperty(F,"prototype",{writable:!1}),z&&K(F,z)}function w(F){try{return Function.toString.call(F).indexOf("[native code]")!==-1}catch{return typeof F=="function"}}function T(){try{var F=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!F})()}function C(F,z){var Y=F==null?null:typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(Y!=null){var se,g,B,l,d=[],v=!0,E=!1;try{if(B=(Y=Y.call(F)).next,z===0){if(Object(Y)!==Y)return;v=!1}else for(;!(v=(se=B.call(Y)).done)&&(d.push(se.value),d.length!==z);v=!0);}catch(D){E=!0,g=D}finally{try{if(!v&&Y.return!=null&&(l=Y.return(),Object(l)!==l))return}finally{if(E)throw g}}return d}}function x(){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 $(F,z){if(z&&(typeof z=="object"||typeof z=="function"))return z;if(z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(F)}function K(F,z){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,se){return Y.__proto__=se,Y},K(F,z)}function G(F,z){return r(F)||C(F,z)||Pe(F,z)||x()}function ee(F,z){if(typeof F!="object"||!F)return F;var Y=F[Symbol.toPrimitive];if(Y!==void 0){var se=Y.call(F,z||"default");if(typeof se!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(F)}function oe(F){var z=ee(F,"string");return typeof z=="symbol"?z:z+""}function ae(F){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},ae(F)}function Pe(F,z){if(F){if(typeof F=="string")return e(F,z);var Y={}.toString.call(F).slice(8,-1);return Y==="Object"&&F.constructor&&(Y=F.constructor.name),Y==="Map"||Y==="Set"?Array.from(F):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(F,z):void 0}}function Te(F){var z=typeof Map=="function"?new Map:void 0;return Te=function(Y){function se(){return s(Y,arguments,p(this).constructor)}if(Y===null||!w(Y))return Y;if(typeof Y!="function")throw new TypeError("Super expression must either be null or a function");if(z!==void 0){if(z.has(Y))return z.get(Y);z.set(Y,se)}return se.prototype=Object.create(Y.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),K(se,Y)},Te(F)}var ce=function(F){var z=Math.abs,Y=Math.max,se=Math.floor;function g(B,l){var d;if(a(this,g),d=o(this,g,[B]),d.sign=l,Object.setPrototypeOf(d,g.prototype),B>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,F),u(g,[{key:"toDebugString",value:function(){var l,d=["BigInt["],v=h(this);try{for(v.s();!(l=v.n()).done;){var E=l.value;d.push((E&&(E>>>0).toString(16))+", ")}}catch(D){v.e(D)}finally{v.f()}return d.push("]"),d.join("")}},{key:"toString",value:function(){var l=0<arguments.length&&arguments[0]!==void 0?arguments[0]:10;if(2>l||36<l)throw new RangeError("toString() radix argument must be between 2 and 36");return this.length===0?"0":l&l-1?g.__toStringGeneric(this,l,!1):g.__toStringBasePowerOfTwo(this,l)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var l=new g(this.length,this.sign),d=0;d<this.length;d++)l[d]=this[d];return l}},{key:"__trim",value:function(){for(var l=this.length,d=this[l-1];d===0;)l--,d=this[l-1],this.pop();return l===0&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var l=0;l<this.length;l++)this[l]=0}},{key:"__clzmsd",value:function(){return g.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(l,d,v){v>this.length&&(v=this.length);for(var E=32767&l,D=l>>>15,_=0,I=d,k=0;k<v;k++){var j=this.__digit(k),O=32767&j,X=j>>>15,re=g.__imul(O,E),Z=g.__imul(O,D),V=g.__imul(X,E),ue=g.__imul(X,D),pe=I+re+_;_=pe>>>30,pe&=1073741823,pe+=((32767&Z)<<15)+((32767&V)<<15),_+=pe>>>30,I=ue+(Z>>>15)+(V>>>15),this.__setDigit(k,1073741823&pe)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(l,d,v){for(var E,D=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+l.__halfDigit(_)+D,D=E>>>15,this.__setHalfDigit(d+_,32767&E);return D}},{key:"__inplaceSub",value:function(l,d,v){var E=v-1>>>1,D=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,k=0;k<E;k++){var j=l.__digit(k),O=(_>>>15)-(32767&j)-D;D=1&O>>>15,this.__setDigit(d+k,(32767&O)<<15|32767&I),_=this.__digit(d+k+1),I=(32767&_)-(j>>>15)-D,D=1&I>>>15}var X=l.__digit(k),re=(_>>>15)-(32767&X)-D;D=1&re>>>15,this.__setDigit(d+k,(32767&re)<<15|32767&I);var Z=X>>>15;if(d+k+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+k+1),I=(32767&_)-Z-D,D=1&I>>>15,this.__setDigit(d+l.length,1073709056&_|32767&I))}else{d>>=1;for(var V=0;V<l.length-1;V++){var ue=this.__digit(d+V),pe=l.__digit(V),we=(32767&ue)-(32767&pe)-D;D=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-D;D=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var He=this.__digit(d+V),qe=l.__digit(V),ot=(32767&He)-(32767&qe)-D;D=1&ot>>>15;var Qt=0;!(1&v)&&(Qt=(He>>>15)-(qe>>>15)-D,D=1&Qt>>>15),this.__setDigit(d+V,(32767&Qt)<<15|32767&ot)}return D}},{key:"__inplaceRightShift",value:function(l){if(l!==0){for(var d,v=this.__digit(0)>>>l,E=this.length-1,D=0;D<E;D++)d=this.__digit(D+1),this.__setDigit(D,1073741823&d<<30-l|v),v=d>>>l;this.__setDigit(E,v)}}},{key:"__digit",value:function(l){return this[l]}},{key:"__unsignedDigit",value:function(l){return this[l]>>>0}},{key:"__setDigit",value:function(l,d){this[l]=0|d}},{key:"__setDigitGrow",value:function(l,d){this[l]=0|d}},{key:"__halfDigitLength",value:function(){var l=this.length;return 32767>=this.__unsignedDigit(l-1)?2*l-1:2*l}},{key:"__halfDigit",value:function(l){return 32767&this[l>>>1]>>>15*(1&l)}},{key:"__setHalfDigit",value:function(l,d){var v=l>>>1,E=this.__digit(v),D=1&l?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,D)}}],[{key:"BigInt",value:function(l){var d=Number.isFinite;if(typeof l=="number"){if(l===0)return g.__zero();if(g.__isOneDigitInt(l))return 0>l?g.__oneDigit(-l,!0):g.__oneDigit(l,!1);if(!d(l)||se(l)!==l)throw new RangeError("The number "+l+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(l)}if(typeof l=="string"){var v=g.__fromString(l);if(v===null)throw new SyntaxError("Cannot convert "+l+" to a BigInt");return v}if(typeof l=="boolean")return l===!0?g.__oneDigit(1,!1):g.__zero();if(ae(l)==="object"){if(l.constructor===g)return l;var E=g.__toPrimitive(l);return g.BigInt(E)}throw new TypeError("Cannot convert "+l+" to a BigInt")}},{key:"toNumber",value:function(l){var d=l.length;if(d===0)return 0;if(d===1){var v=l.__unsignedDigit(0);return l.sign?-v:v}var E=l.__digit(d-1),D=g.__clz30(E),_=30*d-D;if(1024<_)return l.sign?-1/0:1/0;var I=_-1,k=E,j=d-1,O=D+3,X=O===32?0:k<<O;X>>>=12;var re=O-12,Z=12<=O?0:k<<20+O,V=20+O;for(0<re&&0<j&&(j--,k=l.__digit(j),X|=k>>>30-re,Z=k<<re+2,V=re+2);0<V&&0<j;)j--,k=l.__digit(j),Z|=30<=V?k<<V-30:k>>>30-V,V-=30;var ue=g.__decideRounding(l,V,j,k);if((ue===1||ue===0&&(1&Z)==1)&&(Z=Z+1>>>0,Z===0&&(X++,X>>>20!=0&&(X=0,I++,1023<I))))return l.sign?-1/0:1/0;var pe=l.sign?-2147483648:0;return I=I+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=pe|I|X,g.__kBitConversionInts[g.__kBitConversionIntLow]=Z,g.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(l){if(l.length===0)return l;var d=l.__copy();return d.sign=!l.sign,d}},{key:"bitwiseNot",value:function(l){return l.sign?g.__absoluteSubOne(l).__trim():g.__absoluteAddOne(l,!0)}},{key:"exponentiate",value:function(l,d){if(d.sign)throw new RangeError("Exponent must be positive");if(d.length===0)return g.__oneDigit(1,!1);if(l.length===0)return l;if(l.length===1&&l.__digit(0)===1)return l.sign&&!(1&d.__digit(0))?g.unaryMinus(l):l;if(1<d.length)throw new RangeError("BigInt too big");var v=d.__unsignedDigit(0);if(v===1)return l;if(v>=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(l.length===1&&l.__digit(0)===2){var E=1+(0|v/30),D=l.sign&&(1&v)!=0,_=new g(E,D);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(E-1,I),_}var k=null,j=l;for(1&v&&(k=l),v>>=1;v!==0;v>>=1)j=g.multiply(j,j),1&v&&(k===null?k=j:k=g.multiply(k,j));return k}},{key:"multiply",value:function(l,d){if(l.length===0)return l;if(d.length===0)return d;var v=l.length+d.length;30<=l.__clzmsd()+d.__clzmsd()&&v--;var E=new g(v,l.sign!==d.sign);E.__initializeDigits();for(var D=0;D<l.length;D++)g.__multiplyAccumulate(d,l.__digit(D),E,D);return E.__trim()}},{key:"divide",value:function(l,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(l,d))return g.__zero();var v,E=l.sign!==d.sign,D=d.__unsignedDigit(0);if(d.length===1&&32767>=D){if(D===1)return E===l.sign?l:g.unaryMinus(l);v=g.__absoluteDivSmall(l,D,null)}else v=g.__absoluteDivLarge(l,d,!0,!1);return v.sign=E,v.__trim()}},{key:"remainder",value:function(l,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(l,d))return l;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return g.__zero();var E=g.__absoluteModSmall(l,v);return E===0?g.__zero():g.__oneDigit(E,l.sign)}var D=g.__absoluteDivLarge(l,d,!1,!0);return D.sign=l.sign,D.__trim()}},{key:"add",value:function(l,d){var v=l.sign;return v===d.sign?g.__absoluteAdd(l,d,v):0<=g.__absoluteCompare(l,d)?g.__absoluteSub(l,d,v):g.__absoluteSub(d,l,!v)}},{key:"subtract",value:function(l,d){var v=l.sign;return v===d.sign?0<=g.__absoluteCompare(l,d)?g.__absoluteSub(l,d,v):g.__absoluteSub(d,l,!v):g.__absoluteAdd(l,d,v)}},{key:"leftShift",value:function(l,d){return d.length===0||l.length===0?l:d.sign?g.__rightShiftByAbsolute(l,d):g.__leftShiftByAbsolute(l,d)}},{key:"signedRightShift",value:function(l,d){return d.length===0||l.length===0?l:d.sign?g.__leftShiftByAbsolute(l,d):g.__rightShiftByAbsolute(l,d)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(l,d){return 0>g.__compareToBigInt(l,d)}},{key:"lessThanOrEqual",value:function(l,d){return 0>=g.__compareToBigInt(l,d)}},{key:"greaterThan",value:function(l,d){return 0<g.__compareToBigInt(l,d)}},{key:"greaterThanOrEqual",value:function(l,d){return 0<=g.__compareToBigInt(l,d)}},{key:"equal",value:function(l,d){if(l.sign!==d.sign||l.length!==d.length)return!1;for(var v=0;v<l.length;v++)if(l.__digit(v)!==d.__digit(v))return!1;return!0}},{key:"notEqual",value:function(l,d){return!g.equal(l,d)}},{key:"bitwiseAnd",value:function(l,d){if(!l.sign&&!d.sign)return g.__absoluteAnd(l,d).__trim();if(l.sign&&d.sign){var v=Y(l.length,d.length)+1,E=g.__absoluteSubOne(l,v),D=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,D,E),g.__absoluteAddOne(E,!0,E).__trim()}if(l.sign){var _=[d,l];l=_[0],d=_[1]}return g.__absoluteAndNot(l,g.__absoluteSubOne(d)).__trim()}},{key:"bitwiseXor",value:function(l,d){if(!l.sign&&!d.sign)return g.__absoluteXor(l,d).__trim();if(l.sign&&d.sign){var v=Y(l.length,d.length),E=g.__absoluteSubOne(l,v),D=g.__absoluteSubOne(d);return g.__absoluteXor(E,D,E).__trim()}var _=Y(l.length,d.length)+1;if(l.sign){var I=[d,l];l=I[0],d=I[1]}var k=g.__absoluteSubOne(d,_);return k=g.__absoluteXor(k,l,k),g.__absoluteAddOne(k,!0,k).__trim()}},{key:"bitwiseOr",value:function(l,d){var v=Y(l.length,d.length);if(!l.sign&&!d.sign)return g.__absoluteOr(l,d).__trim();if(l.sign&&d.sign){var E=g.__absoluteSubOne(l,v),D=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,D,E),g.__absoluteAddOne(E,!0,E).__trim()}if(l.sign){var _=[d,l];l=_[0],d=_[1]}var I=g.__absoluteSubOne(d,v);return I=g.__absoluteAndNot(I,l,I),g.__absoluteAddOne(I,!0,I).__trim()}},{key:"asIntN",value:function(l,d){if(d.length===0)return d;if(l=se(l),0>l)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(l===0)return g.__zero();if(l>=g.__kMaxLengthBits)return d;var v=0|(l+29)/30;if(d.length<v)return d;var E=d.__unsignedDigit(v-1),D=1<<(l-1)%30;if(d.length===v&&E<D)return d;var _=(E&D)===D;if(!_)return g.__truncateToNBits(l,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(l,d,!0);if(!(E&D-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return g.__truncateAndSubFromPowerOfTwo(l,d,!1);return d.length===v&&E===D?d:g.__truncateToNBits(l,d)}return g.__truncateAndSubFromPowerOfTwo(l,d,!1)}},{key:"asUintN",value:function(l,d){if(d.length===0)return d;if(l=se(l),0>l)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(l===0)return g.__zero();if(d.sign){if(l>g.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(l,d,!1)}if(l>=g.__kMaxLengthBits)return d;var v=0|(l+29)/30;if(d.length<v)return d;var E=l%30;if(d.length==v){if(E===0)return d;var D=d.__digit(v-1);if(!(D>>>E))return d}return g.__truncateToNBits(l,d)}},{key:"ADD",value:function(l,d){if(l=g.__toPrimitive(l),d=g.__toPrimitive(d),typeof l=="string")return typeof d!="string"&&(d=d.toString()),l+d;if(typeof d=="string")return l.toString()+d;if(l=g.__toNumeric(l),d=g.__toNumeric(d),g.__isBigInt(l)&&g.__isBigInt(d))return g.add(l,d);if(typeof l=="number"&&typeof d=="number")return l+d;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(l,d){return g.__compare(l,d,0)}},{key:"LE",value:function(l,d){return g.__compare(l,d,1)}},{key:"GT",value:function(l,d){return g.__compare(l,d,2)}},{key:"GE",value:function(l,d){return g.__compare(l,d,3)}},{key:"EQ",value:function(l,d){for(;;){if(g.__isBigInt(l))return g.__isBigInt(d)?g.equal(l,d):g.EQ(d,l);if(typeof l=="number"){if(g.__isBigInt(d))return g.__equalToNumber(d,l);if(ae(d)!=="object")return l==d;d=g.__toPrimitive(d)}else if(typeof l=="string"){if(g.__isBigInt(d))return l=g.__fromString(l),l!==null&&g.equal(l,d);if(ae(d)!=="object")return l==d;d=g.__toPrimitive(d)}else if(typeof l=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+l);if(ae(d)!=="object")return l==d;d=g.__toPrimitive(d)}else if(ae(l)==="symbol"){if(g.__isBigInt(d))return!1;if(ae(d)!=="object")return l==d;d=g.__toPrimitive(d)}else if(ae(l)==="object"){if(ae(d)==="object"&&d.constructor!==g)return l==d;l=g.__toPrimitive(l)}else return l==d}}},{key:"NE",value:function(l,d){return!g.EQ(l,d)}},{key:"DataViewGetBigInt64",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return g.asIntN(64,g.DataViewGetBigUint64(l,d,v))}},{key:"DataViewGetBigUint64",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2],E=v?[4,0]:[0,4],D=G(E,2),_=D[0],I=D[1],k=l.getUint32(d+_,v),j=l.getUint32(d+I,v),O=new g(3,!1);return O.__setDigit(0,1073741823&j),O.__setDigit(1,(268435455&k)<<2|j>>>30),O.__setDigit(2,k>>>28),O.__trim()}},{key:"DataViewSetBigInt64",value:function(l,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(l,d,v,E)}},{key:"DataViewSetBigUint64",value:function(l,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var D=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,D=I>>>2,2<v.length&&(D|=v.__digit(2)<<28)}var k=E?[4,0]:[0,4],j=G(k,2),O=j[0],X=j[1];l.setUint32(d+O,D,E),l.setUint32(d+X,_,E)}},{key:"__zero",value:function(){return new g(0,!1)}},{key:"__oneDigit",value:function(l,d){var v=new g(1,d);return v.__setDigit(0,l),v}},{key:"__decideRounding",value:function(l,d,v,E){if(0<d)return-1;var D;if(0>d)D=-d-1;else{if(v===0)return-1;v--,E=l.__digit(v),D=29}var _=1<<D;if(!(E&_))return-1;if(_-=1,(E&_)!=0)return 1;for(;0<v;)if(v--,l.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(l){var d=0>l;g.__kBitConversionDouble[0]=l;var v,E=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,D=E-1023,_=(0|D/30)+1,I=new g(_,d),k=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|k,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=D%30,Z=0;if(re<X){var V=X-re;Z=V+32,v=j>>>V,j=j<<32-V|O>>>V,O<<=32-V}else if(re===X)Z=32,v=j,j=O,O=0;else{var ue=re-X;Z=32-ue,v=j<<ue|O>>>32-ue,j=O<<ue,O=0}I.__setDigit(_-1,v);for(var pe=_-2;0<=pe;pe--)0<Z?(Z-=30,v=j>>>2,j=j<<30|O>>>2,O<<=30):v=0,I.__setDigit(pe,v);return I.__trim()}},{key:"__isWhitespace",value:function(l){return 13>=l&&9<=l||(159>=l?l==32:131071>=l?l==160||l==5760:196607>=l?(l&=131071,10>=l||l==40||l==41||l==47||l==95||l==4096):l==65279)}},{key:"__fromString",value:function(l){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,E=l.length,D=0;if(D===E)return g.__zero();for(var _=l.charCodeAt(D);g.__isWhitespace(_);){if(++D===E)return g.__zero();_=l.charCodeAt(D)}if(_===43){if(++D===E)return null;_=l.charCodeAt(D),v=1}else if(_===45){if(++D===E)return null;_=l.charCodeAt(D),v=-1}if(d===0){if(d=10,_===48){if(++D===E)return g.__zero();if(_=l.charCodeAt(D),_===88||_===120){if(d=16,++D===E)return null;_=l.charCodeAt(D)}else if(_===79||_===111){if(d=8,++D===E)return null;_=l.charCodeAt(D)}else if(_===66||_===98){if(d=2,++D===E)return null;_=l.charCodeAt(D)}}}else if(d===16&&_===48){if(++D===E)return g.__zero();if(_=l.charCodeAt(D),_===88||_===120){if(++D===E)return null;_=l.charCodeAt(D)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++D===E)return g.__zero();_=l.charCodeAt(D)}var I=E-D,k=g.__kMaxBitsPerChar[d],j=g.__kBitsPerCharTableMultiplier-1;if(I>1073741824/k)return null;var O=k*I+j>>>g.__kBitsPerCharTableShift,X=0|(O+29)/30,re=new g(X,!1),Z=10>d?d:10,V=10<d?d-10:0;if(d&d-1){re.__initializeDigits();var ot=!1,Qt=0;do{for(var cr,$n=0,ai=1;;){if(cr=void 0,_-48>>>0<Z)cr=_-48;else if((32|_)-97>>>0<V)cr=(32|_)-87;else{ot=!0;break}var bo=ai*d;if(1073741823<bo)break;if(ai=bo,$n=$n*d+cr,Qt++,++D===E){ot=!0;break}_=l.charCodeAt(D)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(k*Qt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(ai,$n,wo)}while(!ot)}else{k>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,He=0,qe=0;;){if(_e=void 0,_-48>>>0<Z)_e=_-48;else if((32|_)-97>>>0<V)_e=(32|_)-87;else{we=!0;break}if(qe+=k,He=He<<k|_e,++D===E){we=!0;break}if(_=l.charCodeAt(D),30<qe+k)break}ue.push(He),pe.push(qe)}while(!we);g.__fillFromParts(re,ue,pe)}if(D!==E){if(!g.__isWhitespace(_))return null;for(D++;D<E;D++)if(_=l.charCodeAt(D),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(l,d,v){for(var E=0,D=0,_=0,I=d.length-1;0<=I;I--){var k=d[I],j=v[I];D|=k<<_,_+=j,_===30?(l.__setDigit(E++,D),_=0,D=0):30<_&&(l.__setDigit(E++,1073741823&D),_-=30,D=k>>>j-_)}if(D!==0){if(E>=l.length)throw new Error("implementation bug");l.__setDigit(E++,D)}for(;E<l.length;E++)l.__setDigit(E,0)}},{key:"__toStringBasePowerOfTwo",value:function(l,d){var v=l.length,E=d-1;E=(85&E>>>1)+(85&E),E=(51&E>>>2)+(51&E),E=(15&E>>>4)+(15&E);var D=E,_=d-1,I=l.__digit(v-1),k=g.__clz30(I),j=30*v-k,O=0|(j+D-1)/D;if(l.sign&&O++,268435456<O)throw new Error("string too long");for(var X=Array(O),re=O-1,Z=0,V=0,ue=0;ue<v-1;ue++){var pe=l.__digit(ue),we=(Z|pe<<V)&_;X[re--]=g.__kConversionChars[we];var _e=D-V;for(Z=pe>>>_e,V=30-_e;V>=D;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D,V-=D}var He=(Z|I<<V)&_;for(X[re--]=g.__kConversionChars[He],Z=I>>>D-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D;if(l.sign&&(X[re--]="-"),re!==-1)throw new Error("implementation bug");return X.join("")}},{key:"__toStringGeneric",value:function(l,d,v){var E=l.length;if(E===0)return"";if(E===1){var D=l.__unsignedDigit(0).toString(d);return v===!1&&l.sign&&(D="-"+D),D}var _=30*E-g.__clz30(l.__digit(E-1)),I=g.__kMaxBitsPerChar[d],k=I-1,j=_*g.__kBitsPerCharTableMultiplier;j+=k-1,j=0|j/k;var O,X,re=j+1>>1,Z=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(re,!1)),V=Z.__unsignedDigit(0);if(Z.length===1&&32767>=V){O=new g(l.length,!1),O.__initializeDigits();for(var ue,pe=0,we=2*l.length-1;0<=we;we--)ue=pe<<15|l.__halfDigit(we),O.__setHalfDigit(we,0|ue/V),pe=0|ue%V;X=pe.toString(d)}else{var _e=g.__absoluteDivLarge(l,Z,!0,!0);O=_e.quotient;var He=_e.remainder.__trim();X=g.__toStringGeneric(He,d,!0)}O.__trim();for(var qe=g.__toStringGeneric(O,d,!0);X.length<re;)X="0"+X;return v===!1&&l.sign&&(qe="-"+qe),qe+X}},{key:"__unequalSign",value:function(l){return l?-1:1}},{key:"__absoluteGreater",value:function(l){return l?-1:1}},{key:"__absoluteLess",value:function(l){return l?1:-1}},{key:"__compareToBigInt",value:function(l,d){var v=l.sign;if(v!==d.sign)return g.__unequalSign(v);var E=g.__absoluteCompare(l,d);return 0<E?g.__absoluteGreater(v):0>E?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(l,d){if(g.__isOneDigitInt(d)){var v=l.sign,E=0>d;if(v!==E)return g.__unequalSign(v);if(l.length===0){if(E)throw new Error("implementation bug");return d===0?0:-1}if(1<l.length)return g.__absoluteGreater(v);var D=z(d),_=l.__unsignedDigit(0);return _>D?g.__absoluteGreater(v):_<D?g.__absoluteLess(v):0}return g.__compareToDouble(l,d)}},{key:"__compareToDouble",value:function(l,d){if(d!==d)return d;if(d===1/0)return-1;if(d===-1/0)return 1;var v=l.sign,E=0>d;if(v!==E)return g.__unequalSign(v);if(d===0)throw new Error("implementation bug: should be handled elsewhere");if(l.length===0)return-1;g.__kBitConversionDouble[0]=d;var D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(D==2047)throw new Error("implementation bug: handled elsewhere");var _=D-1023;if(0>_)return g.__absoluteGreater(v);var I=l.length,k=l.__digit(I-1),j=g.__clz30(k),O=30*I-j,X=_+1;if(O<X)return g.__absoluteLess(v);if(O>X)return g.__absoluteGreater(v);var re=1048576,Z=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],V=g.__kBitConversionInts[g.__kBitConversionIntLow],ue=20,pe=29-j;if(pe!==(0|(O-1)%30))throw new Error("implementation bug");var we,_e=0;if(pe<ue){var He=ue-pe;_e=He+32,we=Z>>>He,Z=Z<<32-He|V>>>He,V<<=32-He}else if(pe===ue)_e=32,we=Z,Z=V,V=0;else{var qe=pe-ue;_e=32-qe,we=Z<<qe|V>>>32-qe,Z=V<<qe,V=0}if(k>>>=0,we>>>=0,k>we)return g.__absoluteGreater(v);if(k<we)return g.__absoluteLess(v);for(var ot=I-2;0<=ot;ot--){0<_e?(_e-=30,we=Z>>>2,Z=Z<<30|V>>>2,V<<=30):we=0;var Qt=l.__unsignedDigit(ot);if(Qt>we)return g.__absoluteGreater(v);if(Qt<we)return g.__absoluteLess(v)}if(Z!==0||V!==0){if(_e===0)throw new Error("implementation bug");return g.__absoluteLess(v)}return 0}},{key:"__equalToNumber",value:function(l,d){return g.__isOneDigitInt(d)?d===0?l.length===0:l.length===1&&l.sign===0>d&&l.__unsignedDigit(0)===z(d):g.__compareToDouble(l,d)===0}},{key:"__comparisonResultToBool",value:function(l,d){return d===0?0>l:d===1?0>=l:d===2?0<l:d===3?0<=l:void 0}},{key:"__compare",value:function(l,d,v){if(l=g.__toPrimitive(l),d=g.__toPrimitive(d),typeof l=="string"&&typeof d=="string")switch(v){case 0:return l<d;case 1:return l<=d;case 2:return l>d;case 3:return l>=d}if(g.__isBigInt(l)&&typeof d=="string")return d=g.__fromString(d),d!==null&&g.__comparisonResultToBool(g.__compareToBigInt(l,d),v);if(typeof l=="string"&&g.__isBigInt(d))return l=g.__fromString(l),l!==null&&g.__comparisonResultToBool(g.__compareToBigInt(l,d),v);if(l=g.__toNumeric(l),d=g.__toNumeric(d),g.__isBigInt(l)){if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__compareToBigInt(l,d),v);if(typeof d!="number")throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(l,d),v)}if(typeof l!="number")throw new Error("implementation bug");if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__compareToNumber(d,l),2^v);if(typeof d!="number")throw new Error("implementation bug");return v===0?l<d:v===1?l<=d:v===2?l>d:v===3?l>=d:void 0}},{key:"__absoluteAdd",value:function(l,d,v){if(l.length<d.length)return g.__absoluteAdd(d,l,v);if(l.length===0)return l;if(d.length===0)return l.sign===v?l:g.unaryMinus(l);var E=l.length;(l.__clzmsd()===0||d.length===l.length&&d.__clzmsd()===0)&&E++;for(var D,_=new g(E,v),I=0,k=0;k<d.length;k++)D=l.__digit(k)+d.__digit(k)+I,I=D>>>30,_.__setDigit(k,1073741823&D);for(;k<l.length;k++){var j=l.__digit(k)+I;I=j>>>30,_.__setDigit(k,1073741823&j)}return k<_.length&&_.__setDigit(k,I),_.__trim()}},{key:"__absoluteSub",value:function(l,d,v){if(l.length===0)return l;if(d.length===0)return l.sign===v?l:g.unaryMinus(l);for(var E,D=new g(l.length,v),_=0,I=0;I<d.length;I++)E=l.__digit(I)-d.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);for(;I<l.length;I++){var k=l.__digit(I)-_;_=1&k>>>30,D.__setDigit(I,1073741823&k)}return D.__trim()}},{key:"__absoluteAddOne",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=l.length;v===null?v=new g(E,d):v.sign=d;for(var D,_=1,I=0;I<E;I++)D=l.__digit(I)+_,_=D>>>30,v.__setDigit(I,1073741823&D);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(l,d){var v=l.length;d=d||v;for(var E,D=new g(d,!1),_=1,I=0;I<v;I++)E=l.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var k=v;k<d;k++)D.__setDigit(k,0);return D}},{key:"__absoluteAnd",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=l.length,D=d.length,_=D;if(E<D){_=E;var I=l,k=E;l=d,E=D,d=I,D=k}var j=_;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,l.__digit(O)&d.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteAndNot",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=l.length,D=d.length,_=D;E<D&&(_=E);var I=E;v===null?v=new g(I,!1):I=v.length;for(var k=0;k<_;k++)v.__setDigit(k,l.__digit(k)&~d.__digit(k));for(;k<E;k++)v.__setDigit(k,l.__digit(k));for(;k<I;k++)v.__setDigit(k,0);return v}},{key:"__absoluteOr",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=l.length,D=d.length,_=D;if(E<D){_=E;var I=l,k=E;l=d,E=D,d=I,D=k}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,l.__digit(O)|d.__digit(O));for(;O<E;O++)v.__setDigit(O,l.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteXor",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=l.length,D=d.length,_=D;if(E<D){_=E;var I=l,k=E;l=d,E=D,d=I,D=k}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,l.__digit(O)^d.__digit(O));for(;O<E;O++)v.__setDigit(O,l.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteCompare",value:function(l,d){var v=l.length-d.length;if(v!=0)return v;for(var E=l.length-1;0<=E&&l.__digit(E)===d.__digit(E);)E--;return 0>E?0:l.__unsignedDigit(E)>d.__unsignedDigit(E)?1:-1}},{key:"__multiplyAccumulate",value:function(l,d,v,E){if(d!==0){for(var D=32767&d,_=d>>>15,I=0,k=0,j=0;j<l.length;j++,E++){var O=v.__digit(E),X=l.__digit(j),re=32767&X,Z=X>>>15,V=g.__imul(re,D),ue=g.__imul(re,_),pe=g.__imul(Z,D),we=g.__imul(Z,_);O+=k+V+I,I=O>>>30,O&=1073741823,O+=((32767&ue)<<15)+((32767&pe)<<15),I+=O>>>30,k=we+(ue>>>15)+(pe>>>15),v.__setDigit(E,1073741823&O)}for(;I!==0||k!==0;E++){var _e=v.__digit(E);_e+=I+k,k=0,I=_e>>>30,v.__setDigit(E,1073741823&_e)}}}},{key:"__internalMultiplyAdd",value:function(l,d,v,E,D){for(var _=v,I=0,k=0;k<E;k++){var j=l.__digit(k),O=g.__imul(32767&j,d),X=g.__imul(j>>>15,d),re=O+((32767&X)<<15)+I+_;_=re>>>30,I=X>>>15,D.__setDigit(k,1073741823&re)}if(D.length>E)for(D.__setDigit(E++,_+I);E<D.length;)D.__setDigit(E++,0);else if(_+I!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(l,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new g(l.length,!1));for(var E=0,D=2*l.length-1;0<=D;D-=2){var _=(E<<15|l.__halfDigit(D))>>>0,I=0|_/d;E=0|_%d,_=(E<<15|l.__halfDigit(D-1))>>>0;var k=0|_/d;E=0|_%d,v.__setDigit(D>>>1,I<<15|k)}return v}},{key:"__absoluteModSmall",value:function(l,d){for(var v,E=0,D=2*l.length-1;0<=D;D--)v=(E<<15|l.__halfDigit(D))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(l,d,v,E){var D=d.__halfDigitLength(),_=d.length,I=l.__halfDigitLength()-D,k=null;v&&(k=new g(I+2>>>1,!1),k.__initializeDigits());var j=new g(D+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(D-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(l,O,1),re=d.__halfDigit(D-1),Z=0,V=I;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+D);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+D-1))>>>0;ue=0|we/re;for(var _e=0|we%re,He=d.__halfDigit(D-2),qe=X.__halfDigit(V+D-2);g.__imul(ue,He)>>>0>(_e<<16|qe)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,D+1);ot!==0&&(ot=X.__inplaceAdd(d,V,D),X.__setHalfDigit(V+D,32767&X.__halfDigit(V+D)+ot),ue--),v&&(1&V?Z=ue<<15:k.__setDigit(V>>>1,Z|ue))}if(E)return X.__inplaceRightShift(O),v?{quotient:k,remainder:X}:X;if(v)return k;throw new Error("unreachable")}},{key:"__clz15",value:function(l){return g.__clz30(l)-15}},{key:"__specialLeftShift",value:function(l,d,v){var E=l.length,D=E+v,_=new g(D,!1);if(d===0){for(var I=0;I<E;I++)_.__setDigit(I,l.__digit(I));return 0<v&&_.__setDigit(E,0),_}for(var k,j=0,O=0;O<E;O++)k=l.__digit(O),_.__setDigit(O,1073741823&k<<d|j),j=k>>>30-d;return 0<v&&_.__setDigit(E,j),_}},{key:"__leftShiftByAbsolute",value:function(l,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var E=0|v/30,D=v%30,_=l.length,I=D!==0&&l.__digit(_-1)>>>30-D!=0,k=_+E+(I?1:0),j=new g(k,l.sign);if(D===0){for(var O=0;O<E;O++)j.__setDigit(O,0);for(;O<k;O++)j.__setDigit(O,l.__digit(O-E))}else{for(var X=0,re=0;re<E;re++)j.__setDigit(re,0);for(var Z,V=0;V<_;V++)Z=l.__digit(V),j.__setDigit(V+E,1073741823&Z<<D|X),X=Z>>>30-D;if(I)j.__setDigit(_+E,X);else if(X!==0)throw new Error("implementation bug")}return j.__trim()}},{key:"__rightShiftByAbsolute",value:function(l,d){var v=l.length,E=l.sign,D=g.__toShiftAmount(d);if(0>D)return g.__rightShiftByMaximum(E);var _=0|D/30,I=D%30,k=v-_;if(0>=k)return g.__rightShiftByMaximum(E);var j=!1;if(E){var O=(1<<I)-1;if(l.__digit(_)&O)j=!0;else for(var X=0;X<_;X++)if(l.__digit(X)!==0){j=!0;break}}if(j&&I===0){var re=l.__digit(v-1),Z=~re==0;Z&&k++}var V=new g(k,E);if(I===0){V.__setDigit(k-1,0);for(var ue=_;ue<v;ue++)V.__setDigit(ue-_,l.__digit(ue))}else{for(var pe,we=l.__digit(_)>>>I,_e=v-_-1,He=0;He<_e;He++)pe=l.__digit(He+_+1),V.__setDigit(He,1073741823&pe<<30-I|we),we=pe>>>I;V.__setDigit(_e,we)}return j&&(V=g.__absoluteAddOne(V,!0,V)),V.__trim()}},{key:"__rightShiftByMaximum",value:function(l){return l?g.__oneDigit(1,!0):g.__zero()}},{key:"__toShiftAmount",value:function(l){if(1<l.length)return-1;var d=l.__unsignedDigit(0);return d>g.__kMaxLengthBits?-1:d}},{key:"__toPrimitive",value:function(l){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"default";if(ae(l)!=="object"||l.constructor===g)return l;if(typeof Symbol<"u"&&ae(Symbol.toPrimitive)==="symbol"&&l[Symbol.toPrimitive]){var v=l[Symbol.toPrimitive](d);if(ae(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=l.valueOf;if(E){var D=E.call(l);if(ae(D)!=="object")return D}var _=l.toString;if(_){var I=_.call(l);if(ae(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(l){return g.__isBigInt(l)?l:+l}},{key:"__isBigInt",value:function(l){return ae(l)==="object"&&l!==null&&l.constructor===g}},{key:"__truncateToNBits",value:function(l,d){for(var v=0|(l+29)/30,E=new g(v,d.sign),D=v-1,_=0;_<D;_++)E.__setDigit(_,d.__digit(_));var I=d.__digit(D);if(l%30!=0){var k=32-l%30;I=I<<k>>>k}return E.__setDigit(D,I),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(l,d,v){for(var E=Math.min,D,_=0|(l+29)/30,I=new g(_,v),k=0,j=_-1,O=0,X=E(j,d.length);k<X;k++)D=0-d.__digit(k)-O,O=1&D>>>30,I.__setDigit(k,1073741823&D);for(;k<j;k++)I.__setDigit(k,0|1073741823&-O);var re,Z=j<d.length?d.__digit(j):0,V=l%30;if(V===0)re=0-Z-O,re&=1073741823;else{var ue=32-V;Z=Z<<ue>>>ue;var pe=1<<32-ue;re=pe-Z-O,re&=pe-1}return I.__setDigit(j,re),I.__trim()}},{key:"__digitPow",value:function(l,d){for(var v=1;0<d;)1&d&&(v*=l),d>>>=1,l*=l;return v}},{key:"__detectBigEndian",value:function(){return g.__kBitConversionDouble[0]=-0,g.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(l){return(1073741823&l)===l}}])}(Te(Array));return ce.__kMaxLength=33554432,ce.__kMaxLengthBits=ce.__kMaxLength<<5,ce.__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],ce.__kBitsPerCharTableShift=5,ce.__kBitsPerCharTableMultiplier=1<<ce.__kBitsPerCharTableShift,ce.__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"],ce.__kBitConversionBuffer=new ArrayBuffer(8),ce.__kBitConversionDouble=new Float64Array(ce.__kBitConversionBuffer),ce.__kBitConversionInts=new Int32Array(ce.__kBitConversionBuffer),ce.__kBitConversionIntHigh=ce.__detectBigEndian()?0:1,ce.__kBitConversionIntLow=ce.__detectBigEndian()?1:0,ce.__clz30=t?function(F){return t(F)-2}:function(F){var z=Math.LN2,Y=Math.log;return F===0?30:0|29-(0|Y(F>>>0)/z)},ce.__imul=n||function(F,z){return 0|F*z},ce})});var Gu=Wc((Sp,Ku)=>{Ku.exports=Om;function Om(n,t,e,r){var i,o,a;return function(){if(a=this,o=Array.prototype.slice.call(arguments),i&&(e||r))return;if(!e)return u(),i=setTimeout(c,t),i;i=setTimeout(u,t),n.apply(a,o);function c(){u(),n.apply(a,o)}function u(){clearTimeout(i),i=null}}}});var P=Kc(Zc(),1),Wt=P.default.BigInt(0),Ti=P.default.BigInt(1),Hs=P.default.BigInt(2),Mh=P.default.BigInt(10),Th=P.default.BigInt(24),Sh=P.default.BigInt(60),Ch=P.default.BigInt(1e3),zi=P.default.BigInt(1e6),bi=P.default.BigInt(1e9),Rl=P.default.multiply(P.default.BigInt(3600),bi),Ph=P.default.multiply(Sh,bi),Kn=P.default.multiply(Rl,Th);function Tn(n){return typeof n=="bigint"?P.default.BigInt(n.toString(10)):n}function xl(n){return P.default.equal(P.default.remainder(n,Hs),Wt)}function lr(n){return P.default.lessThan(n,Wt)?P.default.unaryMinus(n):n}function So(n,t){return P.default.lessThan(n,t)?-1:P.default.greaterThan(n,t)?1:0}function di(n,t){return{quotient:P.default.divide(n,t),remainder:P.default.remainder(n,t)}}var Jc,Xc,he="slot-epochNanoSeconds",me="slot-iso-date",Be="slot-iso-date-time",je="slot-time",U="slot-calendar",Al="slot-date-brand",Ll="slot-year-month-brand",Nl="slot-month-day-brand",ke="slot-time-zone",gt="slot-years",yt="slot-months",xt="slot-weeks",vt="slot-days",bt="slot-hours",wt="slot-minutes",Dt="slot-seconds",Et="slot-milliseconds",_t="slot-microseconds",At="slot-nanoseconds",Ol="date",Hl="ym",Bl="md",Fl="time",Yl="datetime",$l="instant",wr="original",Rr="timezone-canonical",Ja="timezone-original",hi="calendar-id",jl="locale",Xa="options",zl=new WeakMap,Qa=Symbol.for("@@Temporal__GetSlots");(Jc=globalThis)[Qa]||(Jc[Qa]=function(n){return zl.get(n)});var jo=globalThis[Qa],es=Symbol.for("@@Temporal__CreateSlots");(Xc=globalThis)[es]||(Xc[es]=function(n){zl.set(n,Object.create(null))});var On=globalThis[es];function Pt(n,...t){if(!n||typeof n!="object")return!1;let e=jo(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=jo(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function ve(n,t,e){let r=jo(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 ts={};function Hn(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))}ns(t,n),ns(`${t}.prototype`,n.prototype)}function ns(n,t){let e=`%${n}%`;if(ts[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);ts[e]=t}function it(n){return ts[n]}function Ar(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 qa(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 zo(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 Uo(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 Re=class n{constructor(t){this.totalNs=Tn(t),this.sec=P.default.toNumber(P.default.divide(this.totalNs,bi)),this.subsec=P.default.toNumber(P.default.remainder(this.totalNs,bi))}static validateNew(t,e){if(P.default.greaterThan(lr(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=P.default.subtract(Tn(t),Tn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=P.default.add(P.default.add(P.default.add(P.default.add(P.default.add(P.default.BigInt(a),P.default.multiply(P.default.BigInt(o),Ch)),P.default.multiply(P.default.BigInt(i),zi)),P.default.multiply(P.default.BigInt(r),bi)),P.default.multiply(P.default.BigInt(e),Ph)),P.default.multiply(P.default.BigInt(t),Rl));return n.validateNew(s,"total")}abs(){return new n(lr(this.totalNs))}add(t){return n.validateNew(P.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(P.default.add(this.totalNs,P.default.multiply(P.default.BigInt(t),Kn)),"sum")}addToEpochNs(t){return P.default.add(Tn(t),this.totalNs)}cmp(t){return So(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=di(this.totalNs,P.default.BigInt(t));return{quotient:P.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=Tn(t),r=P.default.BigInt(e),{quotient:i,remainder:o}=di(this.totalNs,r),a=[],s,c=(P.default.lessThan(this.totalNs,Wt)?-1:1)*Math.sign(P.default.toNumber(e));for(;!P.default.equal(o,Wt)&&a.length<50;)o=P.default.multiply(o,Mh),{quotient:s,remainder:o}=di(o,r),a.push(Math.abs(P.default.toNumber(s)));return c*+(lr(i).toString()+"."+a.join(""))}isZero(){return P.default.equal(this.totalNs,Wt)}round(t,e){let r=Tn(t);if(P.default.equal(r,Ti))return this;let{quotient:i,remainder:o}=di(this.totalNs,r),a=P.default.lessThan(this.totalNs,Wt)?"negative":"positive",s=P.default.multiply(lr(i),r),c=P.default.add(s,r),u=So(lr(P.default.multiply(o,Hs)),r),h=zo(e,a),p=P.default.equal(lr(this.totalNs),s)?s:Uo(s,c,u,xl(i),h),y=a==="positive"?p:P.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Wt))}subtract(t){return n.validateNew(P.default.subtract(this.totalNs,t.totalNs),"difference")}};Re.MAX=P.default.BigInt("9007199254740991999999999"),Re.ZERO=new Re(Wt);var Qc=/[A-Za-z._][A-Za-z._0-9+-]*/,Ui=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Qc.source})(?:\\/(?:${Qc.source}))*)`),Ul=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,rs=/(?:0[1-9]|[12]\d|3[01])/,kh=new RegExp(`(${Ul.source})(?:-(${Co.source})-(${rs.source})|(${Co.source})(${rs.source}))`),Vl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,ql=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Wl=new RegExp(`([zZ])|${ql.source}?`),Hr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Ih=new RegExp([`^${kh.source}`,`(?:(?:[tT]|\\s+)${Vl.source}(?:${Wl.source})?)?`,`(?:\\[!?(${Ui.source})\\])?`,`((?:${Hr.source})*)$`].join("")),Rh=new RegExp([`^[tT]?${Vl.source}`,`(?:${Wl.source})?`,`(?:\\[!?${Ui.source}\\])?`,`((?:${Hr.source})*)$`].join("")),xh=new RegExp(`^(${Ul.source})-?(${Co.source})(?:\\[!?${Ui.source}\\])?((?:${Hr.source})*)$`),Ah=new RegExp(`^(?:--)?(${Co.source})-?(${rs.source})(?:\\[!?${Ui.source}\\])?((?:${Hr.source})*)$`),Wa=/(\d+)(?:[.,](\d{1,9}))?/,Lh=new RegExp(`(?:${Wa.source}H)?(?:${Wa.source}M)?(?:${Wa.source}S)?`),Nh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Lh.source})?$`,"i"),Gn=864e5,Po=1e6*Gn,Oh=6e10,Kl=1e8*Gn,Br=cn(Kl),Si=P.default.unaryMinus(Br),Hh=P.default.add(P.default.subtract(Si,Kn),Ti),Bh=P.default.subtract(P.default.add(Br,Kn),Ti),Fh=146097*Gn,el=-271821,tl=275760,wi=Date.UTC(1847,0,1),Yh=["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"],$h=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 ze(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Vo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function qo(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function fe(n){let t=Vo(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 nl(n,t){let e=fe(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 an(n){let t=Vo(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 Ci(n,t){return String(n).padStart(t,"0")}function Ke(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function is(n,t){if(ze(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 os=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],jh={era:qo,eraYear:fe,year:fe,month:nl,monthCode:function(n){let t=Ke(is(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:nl,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ke(is(n));return Wr(t),t},timeZone:St},zh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Fr=[["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"]],rl=Object.fromEntries(Fr.map(n=>[n[0],n[1]])),Uh=Object.fromEntries(Fr.map(([n,t])=>[t,n])),Di=Fr.map(([,n])=>n),Yr={day:Po,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},ko=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],Vh=Intl.DateTimeFormat,il=new Map;function Gl(n){let t=xi(n),e=il.get(t);return e===void 0&&(e=new Vh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),il.set(t,e)),e}function tt(n){return Pt(n,he)&&!Pt(n,ke,U)}function Ye(n){return Pt(n,gt,yt,vt,bt,wt,Dt,Et,_t,At)}function $e(n){return Pt(n,Al)}function Ue(n){return Pt(n,je)}function Ne(n){return Pt(n,Be)}function nt(n){return Pt(n,Ll)}function qt(n){return Pt(n,Nl)}function be(n){return Pt(n,he,ke,U)}function R(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function Ur(n){if(Pt(n,U)||Pt(n,ke))throw new TypeError("with() does not support a calendar or timeZone property");if(Ue(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 Vi(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Hr.lastIndex=0;e=Hr.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 wn(n){let t=Ih.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Wo(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,c=+(t[6]??0),u=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),w=+p.slice(3,6),T=+p.slice(6,9),C,x=!1;t[13]?(C=void 0,x=!0):t[14]&&(C=t[14]);let $=t[15];return zs(i,o,a,c,u,h,y,w,T),{year:i,month:o,day:a,time:s?{hour:c,minute:u,second:h,millisecond:y,microsecond:w,nanosecond:T}:"start-of-day",tzAnnotation:$,offset:C,z:x,calendar:e}}function Zl(n){let t=Rh.exec(n),e,r,i,o,a,s,c;if(t){c=Wo(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let u=(t[4]??t[7]??"")+"000000000";if(o=+u.slice(0,3),a=+u.slice(3,6),s=+u.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let u,h;if({time:u,z:h,calendar:c}=wn(n),u==="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}=u)}if(Jo(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:c};try{let{month:u,day:h}=Fs(n);pr(1972,u,h)}catch{try{let{year:u,month:h}=Bs(n);pr(u,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:c}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function Bs(n){let t=xh.exec(n),e,r,i,o;if(t){i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Fs(n){let t=Ah.exec(n),e,r,i,o;if(t){if(i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Jl=new RegExp(`^${Ui.source}$`,"i"),Xl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Ql(n){let t=Wh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function Wn(n){return Jl.test(n)||Ql(n),Xl.test(n)?{offsetMinutes:Wr(n)/6e10}:{tzName:n}}function Ei(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":pr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=gu(i,o,a))}return{year:i,month:o,day:a}}function Ko(n,t,e,r,i,o,a){let s=n,c=t,u=e,h=r,p=i,y=o;switch(a){case"reject":Jo(s,c,u,h,p,y);break;case"constrain":s=Mt(s,0,23),c=Mt(c,0,59),u=Mt(u,0,59),h=Mt(h,0,999),p=Mt(p,0,999),y=Mt(y,0,999)}return{hour:s,minute:c,second:u,millisecond:h,microsecond:p,nanosecond:y}}function eu(n){if(!ze(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<ko.length;r++){let i=ko[r],o=n[i];o!==void 0&&(e=!0,t[i]=an(o))}if(!e)throw new TypeError("invalid duration-like");return t}function st({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function Me(n,t){return{isoDate:n,time:t}}function Ee(n){return xn(n,"overflow",["constrain","reject"],"constrain")}function _i(n){return xn(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function ln(n,t){return xn(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function To(n,t){return xn(n,"offset",["prefer","use","ignore","reject"],t)}function qi(n){return xn(n,"calendarName",["auto","always","never","critical"],"auto")}function Vr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=fe(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function qr(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 Wi(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(qo(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 Ki(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 Ln=Symbol("~required~");function Nt(n,t,e,r,i=[]){let o=[];for(let u=0;u<Fr.length;u++){let h=Fr[u],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===Ln?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let u=0;u<o.length;u++){let h=o[u],p=Uh[h];p!==void 0&&s.push(p)}let c=xn(n,t,s,a);if(c===void 0&&r===Ln)throw new RangeError(`${t} is required`);return c&&c in rl?rl[c]:c}function Ka(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",c=!1;if(ze(t)){if(be(t))return{zonedRelativeTo:t};if($e(t))return{plainRelativeTo:t};if(Ne(t))return{plainRelativeTo:Tt(m(t,Be).isoDate,m(t,U))};i=Qi(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Zi(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,w;if({year:p,month:y,day:w,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ke(t)),u)o=St(u),h?s="exact":a||(s="wall"),c=!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=kt(i),e={year:p,month:y,day:w}}return o===void 0?{plainRelativeTo:Tt(e,i)}:{zonedRelativeTo:at(Io(e,r,s,s==="option"?Wr(a):0,o,"compatible","reject",c),o,i)}}function Sn(n){return m(n,gt)!==0?"year":m(n,yt)!==0?"month":m(n,xt)!==0?"week":m(n,vt)!==0?"day":m(n,bt)!==0?"hour":m(n,wt)!==0?"minute":m(n,Dt)!==0?"second":m(n,Et)!==0?"millisecond":m(n,_t)!==0?"microsecond":"nanosecond"}function In(n,t){return Di.indexOf(n)>Di.indexOf(t)?t:n}function mn(n){return n==="year"||n==="month"||n==="week"}function Cn(n){return mn(n)||n==="day"?"date":"time"}function Xn(n){return it("%calendarImpl%")(n)}function Gi(n){return it("%calendarImpl%")(m(n,U))}function Ct(n,t,e="date"){let r=Object.create(null),i=Xn(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 Jt(n,t,e,r,i){let o=Xn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),c=!1;a.sort();for(let u=0;u<a.length;u++){let h=a[u],p=t[h];if(p!==void 0)c=!0,s[h]=(0,jh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=zh[h]}}if(i==="partial"&&!c)throw new TypeError("no supported properties found");return s}function as(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]=fe(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function mi(n,t){if(ze(n)){if($e(n))return Ee(ie(t)),Tt(m(n,me),m(n,U));if(be(n)){let c=rn(m(n,ke),m(n,he));return Ee(ie(t)),Tt(c.isoDate,m(n,U))}if(Ne(n))return Ee(ie(t)),Tt(m(n,Be).isoDate,m(n,U));let s=Qi(n);return Tt(Zn(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=wn(Ke(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=kt(o),Ee(ie(t)),Tt({year:e,month:r,day:i},o)}function Zi(n,t,e){return Me(Zn(n,t,e),Ko(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function pi(n,t){let e,r,i;if(ze(n)){if(Ne(n))return Ee(ie(t)),en(m(n,Be),m(n,U));if(be(n)){let s=rn(m(n,ke),m(n,he));return Ee(ie(t)),en(s,m(n,U))}if($e(n))return Ee(ie(t)),en(Me(m(n,me),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,U));i=Qi(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Zi(i,o,a))}else{let o,a,s,c;if({year:a,month:s,day:c,time:r,calendar:i,z:o}=wn(Ke(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}),zs(a,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=kt(i),Ee(ie(t)),e={year:a,month:s,day:c}}return en(Me(e,r),i)}function nn(n){let t=it("%Temporal.Duration%");if(Ye(n))return new t(m(n,gt),m(n,yt),m(n,xt),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At));if(!ze(n))return function(i){let{years:o,months:a,weeks:s,days:c,hours:u,minutes:h,seconds:p,milliseconds:y,microseconds:w,nanoseconds:T}=function(C){let x=Nh.exec(C);if(!x)throw new RangeError(`invalid duration: ${C}`);if(x.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${C}`);let $=x[1]==="-"?-1:1,K=x[2]===void 0?0:fe(x[2])*$,G=x[3]===void 0?0:fe(x[3])*$,ee=x[4]===void 0?0:fe(x[4])*$,oe=x[5]===void 0?0:fe(x[5])*$,ae=x[6]===void 0?0:fe(x[6])*$,Pe=x[7],Te=x[8],ce=x[9],F=x[10],z=x[11],Y=0,se=0,g=0;if(Pe!==void 0){if(Te??ce??F??z)throw new RangeError("only the smallest unit can be fractional");g=3600*fe((Pe+"000000000").slice(0,9))*$}else if(Y=Te===void 0?0:fe(Te)*$,ce!==void 0){if(F??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((ce+"000000000").slice(0,9))*$}else se=F===void 0?0:fe(F)*$,z!==void 0&&(g=fe((z+"000000000").slice(0,9))*$);let B=g%1e3,l=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return se+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(K,G,ee,oe,ae,Y,se,d,l,B),{years:K,months:G,weeks:ee,days:oe,hours:ae,minutes:Y,seconds:se,milliseconds:d,microseconds:l,nanoseconds:B}}(i);return new(it("%Temporal.Duration%"))(o,a,s,c,u,h,p,y,w,T)}(Ke(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=eu(n);for(let i=0;i<ko.length;i++){let o=ko[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 fi(n){let t;if(ze(n)){if(tt(n)||be(n))return sn(m(n,he));t=is(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(C){let x=wn(C);if(!x.z&&!x.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return x}(Ke(t)),{hour:c=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:w=0}=o==="start-of-day"?{}:o,T=Ri(e,r,i,c,u,h,p,y,w-(s?0:Wr(a)));return Or(T.isoDate),sn(rt(T))}function ol(n,t){if(ze(n)){if(qt(n))return Ee(ie(t)),Lr(m(n,me),m(n,U));let s;return Pt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Xi(s)),Lr(Ro(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Fs(Ke(n));if(o===void 0&&(o="iso8601"),o=kt(o),Ee(ie(t)),o==="iso8601")return Lr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return Dr(a),a=Ro(o,Ct(o,a,"month-day"),"constrain"),Lr(a,o)}function Vn(n,t){let e;if(ze(n)){if(Ue(n))return Ee(ie(t)),Pn(m(n,je));if(Ne(n))return Ee(ie(t)),Pn(m(n,Be).time);if(be(n)){let u=rn(m(n,ke),m(n,he));return Ee(ie(t)),Pn(u.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:c}=as(n);e=Ko(r,i,o,a,s,c,Ee(ie(t)))}else e=Zl(Ke(n)),Ee(ie(t));return Pn(e)}function tu(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Vn(n),je)}function gi(n,t){if(ze(n)){if(nt(n))return Ee(ie(t)),Nr(m(n,me),m(n,U));let s=Qi(n);return Nr(Pi(s,Jt(s,n,["year","month","monthCode"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=Bs(Ke(n));o===void 0&&(o="iso8601"),o=kt(o),Ee(ie(t));let a={year:e,month:r,day:i};return Us(a),a=Pi(o,Ct(o,a,"year-month"),"constrain"),Nr(a,o)}function Io(n,t,e,r,i,o,a,s){if(t==="start-of-day")return zn(i,n);let c=Me(n,t);if(e==="wall"||a==="ignore")return ct(i,c,o);if(e==="exact"||a==="use"){let p=Ri(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Or(p.isoDate);let y=rt(p);return vn(y),y}Or(n);let u=rt(c),h=ki(i,c);for(let p=0;p<h.length;p++){let y=h[p],w=P.default.toNumber(P.default.subtract(u,y)),T=qn(w,6e10,"halfExpand");if(w===r||s&&T===r)return y}if(a==="reject"){let p=ss(r),y=Ii(c,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return uu(h,i,c,o)}function yi(n,t){let e,r,i,o,a,s,c,u=!1,h="option";if(ze(n)){if(be(n)){let C=ie(t);return _i(C),To(C,"reject"),Ee(C),at(m(n,he),m(n,ke),m(n,U))}a=Qi(n);let y=Jt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=y),o===void 0&&(h="wall");let w=ie(t);s=_i(w),c=To(w,"reject");let T=Ee(w);({isoDate:e,time:r}=Zi(a,y,T))}else{let y,w,T,C,x;({year:T,month:C,day:x,time:r,tzAnnotation:y,offset:o,z:w,calendar:a}=function(K){let G=wn(K);if(!G.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return G}(Ke(n))),i=St(y),w?h="exact":o||(h="wall"),a||(a="iso8601"),a=kt(a),u=!0;let $=ie(t);s=_i($),c=To($,"reject"),Ee($),e={year:T,month:C,day:x}}let p=0;return h==="option"&&(p=Wr(o)),at(Io(e,r,h,p,i,s,c,u),i,a)}function nu(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Al,!0)}function Tt(n,t){let e=it("%Temporal.PlainDate%"),r=Object.create(e.prototype);return nu(r,n,t),r}function ru(n,t,e){fr(t),On(n),ve(n,Be,t),ve(n,U,e)}function en(n,t){let e=it("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return ru(r,n,t),r}function iu(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Nl,!0)}function Lr(n,t){let e=it("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return iu(r,n,t),r}function ou(n,t){On(n),ve(n,je,t)}function Pn(n){let t=it("%Temporal.PlainTime%"),e=Object.create(t.prototype);return ou(e,n),e}function au(n,t,e){Us(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Ll,!0)}function Nr(n,t){let e=it("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return au(r,n,t),r}function su(n,t){vn(t),On(n),ve(n,he,t)}function sn(n){let t=it("%Temporal.Instant%"),e=Object.create(t.prototype);return su(e,n),e}function cu(n,t,e,r){vn(t),On(n),ve(n,he,t),ve(n,ke,e),ve(n,U,r)}function at(n,t,e="iso8601"){let r=it("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return cu(i,n,t,e),i}function al(n){return os.filter(t=>n[t]!==void 0)}function mr(n,t,e){let r=al(e),i=Xn(n).fieldKeysToIgnore(r),o=Object.create(null),a=al(t);for(let s=0;s<os.length;s++){let c,u=os[s];a.includes(u)&&!i.includes(u)&&(c=t[u]),r.includes(u)&&(c=e[u]),c!==void 0&&(o[u]=c)}return o}function Gt(n,t,e,r){let i=Xn(n).dateAdd(t,e,r);return Dr(i),i}function Ji(n,t,e,r){return Xn(n).dateUntil(t,e,r)}function Xi(n){if(ze(n)&&Pt(n,U))return m(n,U);let t=Ke(n);try{return kt(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Zl(t))}catch{try{({calendar:e}=Bs(t))}catch{({calendar:e}=Fs(t))}}}return e||(e="iso8601"),kt(e)}function Qi(n){if(Pt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Xi(t)}function yn(n,t){return kt(n)===kt(t)}function Zn(n,t,e){let r=Xn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return Dr(i),i}function Pi(n,t,e){let r=Xn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Us(i),i}function Ro(n,t,e){let r=Xn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return Dr(i),i}function St(n){if(ze(n)&&be(n))return m(n,ke);let t=Ke(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:c}=function(u){if(Jl.test(u))return{tzAnnotation:u,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=wn(u);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Ql(u)}(o);return a?Wn(a):c?Wn("UTC"):s?Wn(s):void 0}(t);if(r!==void 0)return Ys(r);let i=xo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function lu(n,t){if(n===t)return!0;let e=Wn(n).offsetMinutes,r=Wn(t).offsetMinutes;if(e===void 0&&r===void 0){let i=xo(t);if(!i)return!1;let o=xo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function kn(n,t){let e=Wn(n).offsetMinutes;return e!==void 0?6e10*e:cs(n,t)}function ss(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}${Go(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function rn(n,t){let e=kn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:c,millisecond:u,microsecond:h,nanosecond:p}}=mu(t);return Ri(r,i,o,a,s,c,u,h,p+e)}function ct(n,t,e){return uu(ki(n,t),n,t,e)}function uu(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=rt(e),a=P.default.subtract(o,Kn);vn(a);let s=kn(t,a),c=P.default.add(o,Kn);vn(c);let u=kn(t,c)-s;switch(r){case"earlier":{let h=Re.fromComponents(0,0,0,0,0,-u),p=$r(e.time,h);return ki(t,Me(Ot(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Re.fromComponents(0,0,0,0,0,u),p=$r(e.time,h),y=ki(t,Me(Ot(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function ki(n,t){if(n==="UTC")return Or(t.isoDate),[rt(t)];let e=Wn(n).offsetMinutes;if(e!==void 0){let r=Ri(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);Or(r.isoDate);let i=rt(r);return vn(i),[i]}return Or(t.isoDate),function(r,i){let o=rt(i),a=P.default.subtract(o,Kn);P.default.lessThan(a,Si)&&(a=o);let s=P.default.add(o,Kn);P.default.greaterThan(s,Br)&&(s=o);let c=cs(r,a),u=cs(r,s);return(c===u?[c]:[c,u]).map(p=>{let y=P.default.subtract(o,P.default.BigInt(p)),w=function(T,C){let{epochMilliseconds:x,time:{millisecond:$,microsecond:K,nanosecond:G}}=mu(C),{year:ee,month:oe,day:ae,hour:Pe,minute:Te,second:ce}=pu(T,x);return Ri(ee,oe,ae,Pe,Te,ce,$,K,G)}(r,y);if(jr(i,w)===0)return vn(y),y}).filter(p=>p!==void 0)}(n,t)}function zn(n,t){let e=Me(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=ki(n,e);if(r.length)return r[0];let i=rt(e),o=P.default.subtract(i,Kn);return vn(o),js(n,o)}function eo(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+Ci(Math.abs(n),6):Ci(n,4),t}function Zt(n){return Ci(n,2)}function du(n,t){let e;if(t==="auto"){if(n===0)return"";e=Ci(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=Ci(n,9).slice(0,t)}return`.${e}`}function Go(n,t,e,r,i){let o=`${Zt(n)}:${Zt(t)}`;return i==="minute"||(o+=`:${Zt(e)}`,o+=du(r,i)),o}function sl(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=Ii(rn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=hu(kn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,gt),r=m(n,yt),i=m(n,xt),o=m(n,vt),a=m(n,bt),s=m(n,wt),c=Lo(n),u="";e!==0&&(u+=`${Math.abs(e)}Y`),r!==0&&(u+=`${Math.abs(r)}M`),i!==0&&(u+=`${Math.abs(i)}W`),o!==0&&(u+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=Re.fromComponents(0,0,m(n,Dt),m(n,Et),m(n,_t),m(n,At));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Sn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${du(Math.abs(p.subsec),t)}S`);let y=`${c<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function cl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${eo(e)}-${Zt(r)}-${Zt(i)}${Vi(m(n,U),t)}`}function ll({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return Go(n,t,e,1e6*r+1e3*i+o,a)}function Ii(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:c,second:u,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${eo(i)}-${Zt(o)}-${Zt(a)}T${Go(s,c,u,1e6*h+1e3*p+y,e)}${Vi(t,r)}`}function ul(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Zt(r)}-${Zt(i)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${eo(e)}-${o}`);let s=Vi(a,t);return s&&(o+=s),o}function dl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${eo(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=Vi(a,t);return s&&(o+=s),o}function hl(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,he);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=hs(a,p,h,y)}let s=m(n,ke),c=kn(s,a),u=Ii(rn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=hu(c)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=Vi(m(n,U),e),u}function ml(n){return Xl.test(n)}function Wr(n){let t=Kh.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 ci,qh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(ci===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){ci=new Map;for(let a=0;a<o.length;a++){let s=o[a];ci.set(xi(s),s)}}else ci=null}let t=xi(n),e=ci?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Gl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),$h.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||qh[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 dr(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=pu(n,t),c=t%1e3;return c<0&&(c+=1e3),1e6*($s({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:c}})-t)}function cs(n,t){return dr(n,on(t,"floor"))}function Ys(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${Go(Math.floor(e/60),e%60,0,0,"minute")}`}function hu(n){return Ys(qn(n,Oh,"halfExpand")/6e10)}function $s({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,c=(n-s)/400,u=new Date;return u.setUTCHours(r,i,o,a),u.setUTCFullYear(s,t-1,e),u.getTime()+Fh*c}function rt(n){let t=$s(n),e=1e3*n.time.microsecond+n.time.nanosecond;return P.default.add(cn(t),P.default.BigInt(e))}function mu(n){let t=on(n,"trunc"),e=P.default.toNumber(P.default.remainder(n,zi));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 js(n,t){if(n==="UTC")return null;let e=on(t,"floor");if(e<wi)return js(n,cn(wi));let r=Date.now(),i=Math.max(e,r)+366*Gn*3,o=e,a=dr(n,o),s=o,c=a;for(;a===c&&o<i;){if(s=o+2*Gn*7,s>Kl)return null;c=dr(n,s),a===c&&(o=s)}return a===c?null:cn(Mu(u=>dr(n,u),o,s,a,c))}function ls(n,t){if(n==="UTC")return null;let e=on(t,"ceil"),r=Date.now(),i=r+366*Gn*3;if(e>i){let u=ls(n,cn(i));if(u===null||P.default.lessThan(u,cn(r)))return u}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(u<e)return ls(n,cn(u))}let o=e-1;if(o<wi)return null;let a=dr(n,o),s=o,c=a;for(;a===c&&o>wi;){if(s=o-2*Gn*7,s<wi)return null;c=dr(n,s),a===c&&(o=s)}return a===c?null:cn(Mu(u=>dr(n,u),s,o,c,a))}function pu(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 c=r[4]==="24"?0:+r[4],u=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(c)&&Number.isFinite(u)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:c,minute:u,second:h}}(Gl(n).format(t))}function Ao(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function hr(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]}[Ao(n)?"leapyear":"standard"][t-1]}function Lo(n){let t=[m(n,gt),m(n,yt),m(n,xt),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Zo(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 fu(n){let t=Zo(n.date);return t!==0?t:n.time.sign()}function ur(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 Ot(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}=ur(r,i));let a=146097;if(Math.abs(o)>a){let u=Math.trunc(o/a);r+=400*u,o-=u*a}let s=0,c=i>2?r:r-1;for(;s=Ao(c)?366:365,o<-s;)r-=1,c-=1,o+=s;for(c+=1;s=Ao(c)?366:365,o>s;)r+=1,c+=1,o-=s;for(;o<1;)({year:r,month:i}=ur(r,i-1)),o+=hr(r,i);for(;o>hr(r,i);)o-=hr(r,i),{year:r,month:i}=ur(r,i+1);return{year:r,month:i,day:o}}function Ri(n,t,e,r,i,o,a,s,c){let u=Un(r,i,o,a,s,c);return Me(Ot(n,t,e+u.deltaDays),u)}function Un(n,t,e,r,i,o){let a,s=n,c=t,u=e,h=r,p=i,y=o;({div:a,mod:y}=Ar(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Ar(p,3),h+=a,p<0&&(h-=1,p+=1e3),u+=Math.trunc(h/1e3),h%=1e3,h<0&&(u-=1,h+=1e3),c+=Math.trunc(u/60),u%=60,u<0&&(c-=1,u+=60),s+=Math.trunc(c/60),c%=60,c<0&&(s-=1,c+=60);let w=Math.trunc(s/24);return s%=24,s<0&&(w-=1,s+=24),w+=0,s+=0,c+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:w,hour:s,minute:c,second:u,millisecond:h,microsecond:p,nanosecond:y}}function pl(n,t){let e=st(n,0);if(Zo(e)===0)return n.days;let r=m(t,me),i=Gt(m(t,U),r,e,"constrain"),o=gr(r.year,r.month-1,r.day),a=gr(i.year,i.month-1,i.day)-o;return n.days+a}function Ht(n){return new(it("%Temporal.Duration%"))(-m(n,gt),-m(n,yt),-m(n,xt),-m(n,vt),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,At))}function Mt(n,t,e){return Math.min(e,Math.max(t,n))}function gu(n,t,e){let r=Mt(t,1,12);return{year:n,month:r,day:Mt(e,1,hr(n,r))}}function Ge(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function pr(n,t,e){Ge(t,1,12),Ge(e,1,hr(n,t))}function Dr(n){fr(Me(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Jo(n,t,e,r,i,o){Ge(n,0,23),Ge(t,0,59),Ge(e,0,59),Ge(r,0,999),Ge(i,0,999),Ge(o,0,999)}function zs(n,t,e,r,i,o,a,s,c){pr(n,t,e),Jo(r,i,o,a,s,c)}function fr(n){let t=rt(n);(P.default.lessThan(t,Hh)||P.default.greaterThan(t,Bh))&&vn(t)}function us(n){rt(n)}function vn(n){if(P.default.lessThan(n,Si)||P.default.greaterThan(n,Br))throw new RangeError("date/time value is outside of supported range")}function Us({year:n,month:t}){Ge(n,el,tl),n===el?Ge(t,4,12):n===tl&&Ge(t,1,9)}function Xo(n,t,e,r,i,o,a,s,c,u){let h=0,p=[n,t,e,r,i,o,a,s,c,u];for(let $=0;$<p.length;$++){let K=p[$];if(K===1/0||K===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(K!==0){let G=K<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 y=Ar(s,3),w=Ar(c,6),T=Ar(u,9),C=Ar(1e6*y.mod+1e3*w.mod+T.mod,9).div,x=86400*r+3600*i+60*o+a+y.div+w.div+T.div+C;if(!Number.isSafeInteger(x))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function xr(n){return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,xt),days:m(n,vt)},time:Re.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At))}}function fn(n){let t=Re.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,At)).add24HourDays(m(n,vt));return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,xt),days:0},time:t}}function yu(n){let t=fn(n),e=Math.trunc(t.time.sec/86400);return Xo(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function tn(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,c=0,u=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,c=Math.trunc(s/60),s%=60,u=Math.trunc(c/24),c%=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,c=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=qa(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=qa(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=qa(a,9,r),a=0}return new(it("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*u,e*c,e*s,e*a,e*o,e*i,e*r)}function Rn(n,t){return Zo(n),t.sign(),{date:n,time:t}}function gr(n,t,e){return $s({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Gn}function Or({year:n,month:t,day:e}){if(Math.abs(gr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Vs(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 Re.fromComponents(e,r,i,o,a,s)}function qs(n,t,e,r,i){let o=Re.fromEpochNsDiff(t,n);return o=No(o,e,r,i),Rn({years:0,months:0,weeks:0,days:0},o)}function vu(n,t,e,r){us(n),us(t);let i=Vs(n.time,t.time),o=i.sign(),a=bn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Ot(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let c=In("day",r),u=Ji(e,n.isoDate,s,c);return r!==c&&(i=i.add24HourDays(u.days),u.days=0),Rn(u,i)}function bu(n,t,e,r,i){let o=P.default.subtract(t,n);if(P.default.equal(o,Wt))return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};let a=P.default.lessThan(o,Wt)?-1:1,s=rn(e,n),c=rn(e,t),u,h=0,p=a===1?2:1,y=Vs(s.time,c.time);for(y.sign()===-a&&h++;h<=p;h++){u=Me(Ot(c.isoDate.year,c.isoDate.month,c.isoDate.day-h*a),s.time);let T=ct(e,u,"compatible");if(y=Re.fromEpochNsDiff(t,T),y.sign()!==-a)break}let w=In("day",i);return Rn(Ji(r,s.isoDate,u.isoDate,w),y)}function wu(n,t,e,r,i,o,a,s,c){let u,h,p,y,w=t;switch(s){case"year":{let Y=qn(w.date.years,a,"trunc");u=Y,h=Y+a*n,p={years:u,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let Y=qn(w.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,0,0,u),y=st(w.date,0,0,h);break}case"week":{let Y=st(w.date,0,0),se=Gt(o,r.isoDate,Y,"constrain"),g=Ji(o,se,Ot(se.year,se.month,se.day+w.date.days),"week"),B=qn(w.date.weeks+g.weeks,a,"trunc");u=B,h=B+a*n,p=st(w.date,0,u),y=st(w.date,0,h);break}case"day":{let Y=qn(w.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,u),y=st(w.date,h);break}}let T=Gt(o,r.isoDate,p,"constrain"),C=Gt(o,r.isoDate,y,"constrain"),x,$,K=Me(T,r.time),G=Me(C,r.time);i?(x=ct(i,K,"compatible"),$=ct(i,G,"compatible")):(x=rt(K),$=rt(G));let ee=Re.fromEpochNsDiff(e,x),oe=Re.fromEpochNsDiff($,x),ae=zo(c,n<0?"negative":"positive"),Pe=ee.add(ee).abs().subtract(oe.abs()).sign(),Te=Math.abs(u)/a%2==0,ce=ee.isZero()?Math.abs(u):ee.cmp(oe)?Uo(Math.abs(u),Math.abs(h),Pe,Te,ae):Math.abs(h),F=new Re(P.default.add(P.default.multiply(oe.totalNs,P.default.BigInt(u)),P.default.multiply(ee.totalNs,P.default.BigInt(a*n)))).fdiv(oe.totalNs),z=ce===Math.abs(h);return w={date:z?y:p,time:Re.ZERO},{nudgeResult:{duration:w,nudgedEpochNs:z?$:x,didExpandCalendarUnit:z},total:F}}function Qo(n,t,e,r,i,o,a,s,c){let u=n,h=mn(s)||r&&s==="day",p=fu(u)<0?-1:1,y;return h?{nudgeResult:y}=wu(p,u,t,e,r,i,a,s,c):y=r?function(w,T,C,x,$,K,G,ee){let oe=T,ae=Gt($,C.isoDate,oe.date,"constrain"),Pe=Me(ae,C.time),Te=Me(Ot(ae.year,ae.month,ae.day+w),C.time),ce=ct(x,Pe,"compatible"),F=ct(x,Te,"compatible"),z=Re.fromEpochNsDiff(F,ce);if(z.sign()!==w)throw new RangeError("time zone returned inconsistent Instants");let Y=P.default.BigInt(Yr[G]*K),se=oe.time.round(Y,ee),g=se.subtract(z),B=g.sign()!==-w,l,d;return B?(l=w,se=g.round(Y,ee),d=se.addToEpochNs(F)):(l=0,d=se.addToEpochNs(ce)),{duration:Rn(st(oe.date,oe.date.days+l),se),nudgedEpochNs:d,didExpandCalendarUnit:B}}(p,u,e,r,i,a,s,c):function(w,T,C,x,$,K){let G=w,ee=G.time.add24HourDays(G.date.days),oe=ee.round(P.default.BigInt(x*Yr[$]),K),ae=oe.subtract(ee),{quotient:Pe}=ee.divmod(Po),{quotient:Te}=oe.divmod(Po),ce=Math.sign(Te-Pe)===ee.sign(),F=ae.addToEpochNs(T),z=0,Y=oe;return Cn(C)==="date"&&(z=Te,Y=oe.add(Re.fromComponents(24*-Te,0,0,0,0,0))),{duration:{date:st(G.date,z),time:Y},nudgedEpochNs:F,didExpandCalendarUnit:ce}}(u,t,o,a,s,c),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(w,T,C,x,$,K,G,ee){let oe=T;if(ee===G)return oe;let ae=Di.indexOf(G);for(let Pe=Di.indexOf(ee)-1;Pe>=ae;Pe--){let Te=Di[Pe];if(Te==="week"&&G!=="week")continue;let ce;switch(Te){case"year":ce={years:oe.date.years+w,months:0,weeks:0,days:0};break;case"month":{let Y=oe.date.months+w;ce=st(oe.date,0,0,Y);break}case"week":{let Y=oe.date.weeks+w;ce=st(oe.date,0,Y);break}}let F=Me(Gt(K,x.isoDate,ce,"constrain"),x.time),z;if(z=$?ct($,F,"compatible"):rt(F),So(C,z)===-w)break;oe={date:ce,time:Re.ZERO}}return oe}(p,u,y.nudgedEpochNs,e,r,i,o,In(s,"day"))),u}function fl(n,t,e,r,i,o){return mn(o)||r&&o==="day"?wu(fu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:Mi(n.time.add24HourDays(n.date.days),o)}function Du(n,t,e,r,i,o,a){if(jr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};fr(n),fr(t);let s=vu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,rt(t),n,null,e,r,i,o,a)}function Eu(n,t,e,r,i,o,a,s){if(Cn(i)==="time")return qs(n,t,o,a,s);let c=bu(n,t,e,r,i);return a==="nanosecond"&&o===1?c:Qo(c,t,rn(e,n),e,r,i,o,a,s)}function Kr(n,t,e,r,i,o){let a=Fr.reduce((w,T)=>{let C=T[0],x=T[1],$=T[2];return e!=="datetime"&&$!==e||r.includes(x)||w.push(x,C),w},[]),s=Nt(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let c=Vr(t),u=ln(t,"trunc");n==="since"&&(u=function(w){switch(w){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return w}}(u));let h=Nt(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=In(o,h);if(s==="auto"&&(s=p),In(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let y={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return y!==void 0&&qr(c,y,!1),{largestUnit:s,roundingIncrement:c,roundingMode:u,smallestUnit:h}}function gl(n,t,e,r){let i=fi(e),o=Kr(n,ie(r),"time",[],"nanosecond","second"),a=tn(qs(m(t,he),m(i,he),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=Ht(a)),a}function yl(n,t,e,r){let i=mi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Kr(n,ie(r),"date",[],"day","day"),c=it("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new c;let p={date:Ji(o,u,h,s.largestUnit),time:Re.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let w=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,rt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),w,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=tn(p,"day");return n==="since"&&(y=Ht(y)),y}function vl(n,t,e,r){let i=pi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Kr(n,ie(r),"datetime",[],"nanosecond","day"),c=it("%Temporal.Duration%"),u=m(t,Be),h=m(i,Be);if(jr(u,h)===0)return new c;let p=tn(Du(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Ht(p)),p}function bl(n,t,e,r){let i=Vn(e),o=Kr(n,ie(r),"time",[],"nanosecond","hour"),a=Vs(m(t,je),m(i,je));a=No(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=tn(Rn({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Ht(s)),s}function wl(n,t,e,r){let i=gi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Kr(n,ie(r),"date",["week","day"],"month","year"),c=it("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new c;let u=Ct(o,m(t,me),"year-month");u.day=1;let h=Zn(o,u,"constrain"),p=Ct(o,m(i,me),"year-month");p.day=1;let y=Zn(o,p,"constrain"),w={date:st(Ji(o,h,y,s.largestUnit),0,0),time:Re.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let C=Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});w=Qo(w,rt(Me(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),C,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let T=tn(w,"day");return n==="since"&&(T=Ht(T)),T}function Dl(n,t,e,r){let i=yi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Kr(n,ie(r),"datetime",[],"nanosecond","hour"),c=m(t,he),u=m(i,he),h=it("%Temporal.Duration%"),p;if(Cn(s.largestUnit)!=="date")p=tn(qs(c,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,ke);if(!lu(y,m(i,ke)))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(P.default.equal(c,u))return new h;p=tn(Eu(c,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Ht(p)),p}function $r({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,c=o;return s+=a.sec,c+=a.subsec,Un(n,t,s,r,i,c)}function ds(n,t){let e=t.addToEpochNs(n);return vn(e),e}function vi(n,t,e,r,i="constrain"){if(Zo(r.date)===0)return ds(n,r.time);let o=rn(t,n);return ds(ct(t,Me(Gt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function El(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=In(Sn(t),Sn(r));if(mn(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=fn(t),a=fn(r);return tn(Rn({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function _l(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=Sn(r);if(Cn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=fn(r);return sn(ds(m(t,he),o.time))}function Ml(n,t,e,r){let i=m(t,U),o=nn(e);n==="subtract"&&(o=Ht(o));let a=yu(o),s=Ee(ie(r));return Tt(Gt(i,m(t,me),a,s),i)}function Tl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=m(t,U),s=fn(i),c=m(t,Be),u=$r(c.time,s.time),h=st(s.date,u.deltaDays);return Xo(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),en(Me(Gt(a,c.isoDate,h,o),u),a)}function Sl(n,t,e){let r=nn(e);n==="subtract"&&(r=Ht(r));let i=fn(r),{hour:o,minute:a,second:s,millisecond:c,microsecond:u,nanosecond:h}=$r(m(t,je),i.time);return Pn(Ko(o,a,s,c,u,h,"reject"))}function Cl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=Lo(i),s=m(t,U),c=Ct(s,m(t,me),"year-month");c.day=1;let u=Zn(s,c,"constrain");if(a<0){let p=Gt(s,u,{months:1},"constrain");u=Ot(p.year,p.month,p.day-1)}let h=yu(i);return Dr(u),Nr(Pi(s,Ct(s,Gt(s,u,h,o),"year-month"),o),s)}function Pl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Ht(i));let o=Ee(ie(r)),a=m(t,ke),s=m(t,U),c=xr(i);return at(vi(m(t,he),a,s,c,o),a,s)}function qn(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,c=Lt(Math.abs(2*i)-t),u=a%2==0,h=zo(e,o),p=i===0?a:Uo(a,s,c,u,h);return t*(o==="positive"?p:-p)}function hs(n,t,e,r){let i=Yr[e]*t;return function(o,a,s){let c=Tn(o),u=Tn(a),h=P.default.divide(c,u),p=P.default.remainder(c,u),y=zo(s,"positive"),w,T;P.default.lessThan(c,Wt)?(w=P.default.subtract(h,Ti),T=h):(w=h,T=P.default.add(h,Ti));let C=So(lr(P.default.multiply(p,Hs)),u)*(P.default.lessThan(c,Wt)?-1:1)+0,x=P.default.equal(p,Wt)?h:Uo(w,T,C,xl(w),y);return P.default.multiply(x,u)}(n,P.default.BigInt(i),r)}function ms(n,t,e,r){us(n);let{year:i,month:o,day:a}=n.isoDate,s=ps(n.time,t,e,r);return Me(Ot(i,o,a+s.deltaDays),s)}function ps({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,c){let u;switch(s){case"day":case"hour":u=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":u=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":u=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":u=1e3*(1e3*r+i)+o;break;case"microsecond":u=1e3*i+o;break;case"nanosecond":u=o}let h=Yr[s],p=qn(u,h*a,c)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return Un(p,0,0,0,0,0);case"minute":return Un(n,p,0,0,0,0);case"second":return Un(n,t,p,0,0,0);case"millisecond":return Un(n,t,e,p,0,0);case"microsecond":return Un(n,t,e,r,p,0);case"nanosecond":return Un(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function No(n,t,e,r){let i=Yr[e];return n.round(P.default.BigInt(i*t),r)}function Mi(n,t){let e=Yr[t];return n.fdiv(P.default.BigInt(e))}function bn(n,t){return n.year!==t.year?Lt(n.year-t.year):n.month!==t.month?Lt(n.month-t.month):n.day!==t.day?Lt(n.day-t.day):0}function fs(n,t){return n.hour!==t.hour?Lt(n.hour-t.hour):n.minute!==t.minute?Lt(n.minute-t.minute):n.second!==t.second?Lt(n.second-t.second):n.millisecond!==t.millisecond?Lt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Lt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Lt(n.nanosecond-t.nanosecond):0}function jr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:fs(n.time,t.time)}function _u(n){let t=Oo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function on(n,t){let e=Tn(n),{quotient:r,remainder:i}=di(e,zi),o=P.default.toNumber(r);return t==="floor"&&P.default.toNumber(i)<0&&(o-=1),t==="ceil"&&P.default.toNumber(i)>0&&(o+=1),o}function cn(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return P.default.multiply(P.default.BigInt(n),zi)}function Oo(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"?P.default.BigInt(t.toString(10)):P.default.BigInt(t)}var gs=(()=>{let n=P.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=P.default.BigInt(t),r=P.default.add(cn(t),n);return n=P.default.remainder(e,zi),P.default.greaterThan(r,Br)?Br:P.default.lessThan(r,Si)?Si:r}})();function li(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Lt(n){return n<0?-1:n>0?1:n}function ie(n){if(n===void 0)return Object.create(null);if(ze(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function yr(n,t){let e=Object.create(null);return e[n]=t,e}function xn(n,t,e,r){let i=n[t];if(i!==void 0){if(i=qo(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Ln)throw new RangeError(`${t} option is required`);return r}function kt(n){let t=xi(n);if(!Yh.includes(xi(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function xi(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 Qn(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 Wh=new RegExp(`^${ql.source}$`),Kh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Mu(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,c=i;for(;a-o>1;){let u=Math.trunc((o+a)/2),h=n(u);h===s?(o=u,s=h):h===c&&(a=u,c=h)}return a}function Tu(n){return[...n]}function Su(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=to[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),c=e.getMinimalDaysInFirstWeek(),u=(i+7-s)%7,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=c&&++p,p==0)p=function(y,w,T,C){let x=(C-y-T+1)%7;x<0&&(x+=7);let $=Math.floor((T+x-1)/7);return 7-x>=w&&++$,$}(s,c,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let y=(u+a-o)%7;y<0&&(y+=7),6-y>=c&&o+7-u>a&&(p=1,r++)}return{week:p,year:r}}function kl(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 to={};function vr(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 gn(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Ws(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"&&Ge(r,1,e),t==="constrain"&&(r=Mt(r,1,e)),i=gn(r)}else{let o=vr(i);if(i!==gn(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}}to.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,Ws(n))},dateToISO:(n,t)=>Ei(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=Ei(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 Tu(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:c}=n;return a+=t,s+=e,{year:a,month:s}=ur(a,s),{year:a,month:s,day:c}=Ei(a,s,c,o),c+=i+7*r,Ot(a,s,c)},dateUntil(n,t,e){let r=-bn(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);!kl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=ur(n.year+o,n.month+p);!kl(r,i.year,i.month,n.day,t);)a=p,p+=r,i=ur(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=ur(n.year+o,n.month+a);let s=gu(i.year,i.month,n.day),c=0,u=gr(t.year,t.month-1,t.day)-gr(s.year,s.month-1,s.day);return e==="week"&&(c=Math.trunc(u/7),u%=7),{years:o,months:a,weeks:c,days:u}},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=gn(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),c=a-100*s,u=(e+Math.floor(2.6*o-.2)+(c+Math.floor(c/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=u+(u<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=hr(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=Su("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=hr(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Ao(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Vt=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 Cu({isoYear:n,isoMonth:t,isoDay:e}){return`${eo(n)}-${Zt(t)}-${Zt(e)}T00:00Z`}function Ga(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Vt.objectMap=new WeakMap,Vt.MAX_CACHE_ENTRIES=1e3;var Nn=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 c=Cu({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(c),h={};for(let y=0;y<u.length;y++){let{type:w,value:T}=u[y];if(w!=="year"&&w!=="relatedYear"||(this.hasEra?h.eraYear=+T:h.year=+T),w==="month"){let C=/^([0-9]*)(.*?)$/.exec(T);if(!C||C.length!=3||!C[1]&&!C[2])throw new RangeError(`Unexpected month: ${T}`);if(h.month=C[1]?+C[1]:1,h.month<1)throw new RangeError(`Invalid month ${T} from ${c}[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 ${T} from ${c}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);C[2]&&(h.monthExtra=C[2])}w==="day"&&(h.day=+T),this.hasEra&&w==="era"&&T!=null&&T!==""&&(h.era=T.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 y=this.eras.find(w=>h.era===w.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:w}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=w}this.checkIcuBugs&&this.checkIcuBugs(t);let p=this.adjustCalendarDate(h,e,"constrain",!0);if(p.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(p.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(p.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,p),["constrain","reject"].forEach(y=>{let w=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(w,t)}),p}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:c}=o;return{month:s,monthCode:c}=Ws(o,r,a),{...o,month:s,monthCode:c}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(Ge(o,1,i),Ge(a,1,this.maximumMonthLength(t))):(o=Mt(o,1,i),a=Mt(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:c}=o,u=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:c,overflow:e,id:this.id}),h,p=r.get(u);if(p||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}),p=r.get(h),p))return p;let y=this.estimateIsoDate({year:a,month:s,day:c}),w=K=>{let G=this.addDaysIso(y,K);if(o.day>this.minimumMonthLength(o)){let ee=this.isoToCalendarDate(G,r);for(;ee.month!==s||ee.year!==a;){if(e==="reject")throw new RangeError(`day ${c} does not exist in month ${s} of year ${a}`);G=this.addDaysIso(G,-1),ee=this.isoToCalendarDate(G,r)}}return G},T=0,C=this.isoToCalendarDate(y,r),x=Ga(o,C);if(x.years!==0||x.months!==0||x.days!==0){let K=365*x.years+30*x.months+x.days;y=this.addDaysIso(y,K),C=this.isoToCalendarDate(y,r),x=Ga(o,C),x.years===0&&x.months===0?y=w(x.days):T=this.compareCalendarDates(o,C)}let $=8;for(;T;){y=this.addDaysIso(y,T*$);let K=C;C=this.isoToCalendarDate(y,r);let G=T;if(T=this.compareCalendarDates(o,C),T){if(x=Ga(o,C),x.years===0&&x.months===0)y=w(x.days),T=0;else if(G&&T!==G)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(C,K)>0&&(y=this.addDaysIso(y,-1)),T=0}}}if(r.set(u,y),h&&r.set(h,y),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 y}compareCalendarDates(t,e){return t.year!==e.year?Lt(t.year-e.year):t.month!==e.month?Lt(t.month-e.month):t.day!==e.day?Lt(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 Ot(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,c=Math.abs(e);s<c;s++){let{month:u}=o,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),w=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(w,i),e>0){let T=this.monthsInYear(h,i);for(;o.month-1!=u%T;)w=this.addDaysIso(w,-1),o=this.isoToCalendarDate(w,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:c,day:u,monthCode:h}=t,p=this.adjustCalendarDate({year:c+e,monthCode:h,day:u},s),y=this.addMonthsCalendar(p,r,a,s),w=o+7*i;return this.addDaysCalendar(y,w,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,c=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let u=this.calendarDaysUntil(t,e,i);o=u%7,a=(u-o)/7;break}case"month":case"year":{let u=this.compareCalendarDates(e,t);if(!u)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let T=0;e.monthCode>t.monthCode&&(T=1),e.monthCode<t.monthCode&&(T=-1),T||(T=Math.sign(p)),c=T*u<0?h-u:h}let y,w=c?this.addCalendar(t,{years:c},"constrain",i):t;do s+=u,y=w,w=this.addMonthsCalendar(y,u,"constrain",i),w.day!==t.day&&(w=this.regulateDate({...w,day:t.day},"constrain",i));while(this.compareCalendarDates(e,w)*u>=0);s-=u,o=this.calendarDaysUntil(y,e,i);break}}return{years:c,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),c=this.addDaysIso(s,a),u=this.isoToCalendarDate(c,e),h=this.addDaysIso(c,-u.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 c=this.minimumMonthLength(a),u=this.maximumMonthLength(a);if(c===u)return u;let h=this.calendarToIsoDate(t,"constrain",e),p=this.addDaysIso(h,-r);return this.isoToCalendarDate(p,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 gr(o.year,o.month-1,o.day)-gr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,c,{era:u,eraYear:h,year:p,month:y,monthCode:w,day:T}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||u===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(w===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:w,day:T}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let C={year:this.monthDaySearchStartYear(w,T),month:12,day:31},x=this.isoToCalendarDate(C,r),$=x.monthCode>w||x.monthCode===w&&x.day>=T?x.year:x.year-1;for(let K=0;K<20;K++){let G=this.adjustCalendarDate({day:T,monthCode:w,year:$-K},r),ee=this.calendarToIsoDate(G,"constrain",r),oe=this.isoToCalendarDate(ee,r);if({year:i,month:o,day:a}=ee,oe.monthCode===w&&oe.day===T)return{month:o,day:a,year:i};if(e==="constrain"){let ae=this.maxLengthOfMonthCodeInAnyYear(oe.monthCode);if(oe.monthCode===w&&oe.day===ae&&T>ae)return{month:o,day:a,year:i};(s===void 0||oe.monthCode===s.monthCode&&oe.day>s.day)&&(s=oe,c=ee)}}if(e==="constrain"&&c!==void 0)return c;throw new RangeError(`No recent ${this.id} year with monthCode ${w} and day ${T}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},ys=class extends Nn{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(c=>c[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?gn(5,!0):gn(e<6?e:e-1):gn(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:c,monthExtra:u}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(u){let h=this.months[u];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:c,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=vr(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"?(Ge(a,1,this.monthsInYear({year:o})),Ge(c,1,this.maximumMonthLength({year:o,month:a}))):(a=Mt(a,1,this.monthsInYear({year:o})),c=Mt(c,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:c,month:a,monthCode:s,year:o}}},Jn=class extends Nn{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}}},vs=class extends Jn{constructor(){super(...arguments),this.id="islamic"}},bs=class extends Jn{constructor(){super(...arguments),this.id="islamic-umalqura"}},ws=class extends Jn{constructor(){super(...arguments),this.id="islamic-tbla"}},Ds=class extends Jn{constructor(){super(...arguments),this.id="islamic-civil"}},Es=class extends Jn{constructor(){super(...arguments),this.id="islamic-rgsa"}},_s=class extends Jn{constructor(){super(...arguments),this.id="islamicc"}},Ms=class extends Nn{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 vr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ts=class extends Nn{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 Ks(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=vr(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 Ot(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 Ks(n){return n%4==0&&(n%100!=0||n%400==0)}var Ho=class extends Nn{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 Ks(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][vr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return Ei(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Bo=class extends Nn{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(u=>u.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(u=>{if(u.isAnchor||!u.anchorEpoch&&!u.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=u,u.anchorEpoch={year:u.hasYearZero?0:1}}else if(!u.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(u=>u.code),s.forEach(u=>{let{reverseOf:h}=u;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);u.reverseOf=p,u.anchorEpoch=p.anchorEpoch,u.isoEpoch=p.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)}),s.sort((u,h)=>{if(u.reverseOf)return 1;if(h.reverseOf)return-1;if(!u.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-u.isoEpoch.year});let c=s[s.length-1].reverseOf;if(c&&c!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((u,h)=>{u.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 Ks(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][vr(t)-1]}completeEraYear(t){let e=(s,c,u)=>{let h=t[s];if(h!=null&&h!=c&&!(u||[]).includes(h)){let p=u?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${c} (also called ${p})`:c}`)}},r=s=>{let c,u={...t,year:s},h=this.eras.find((p,y)=>{if(y===this.eras.length-1){if(p.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${p.code}`);return c=p.anchorEpoch.year-s,!0}return c=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(u,p.anchorEpoch)>=0&&(c=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:c,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:c,names:u=[]})=>c===a||u.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:vr(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 Ei(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},Ai=class extends Bo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=gn(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},pn={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 Ho{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Fo=class extends Bo{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Cs=class extends Ss{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},Ps=class extends Fo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},ks=class extends Fo{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}}])}},Is=class extends Ai{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},Rs=class extends Ho{constructor(){super("buddhist",{year:-543,month:1,day:1})}},xs=class extends Ai{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}},As=class extends Ai{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}}},Yo=class extends Nn{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=(x,$)=>{let K=Cu({isoYear:x,isoMonth:2,isoDay:1}),G=new Date(K);G.setUTCDate($+1);let ee=o.formatToParts(G),oe=ee.find(ce=>ce.type==="month").value,ae=+ee.find(ce=>ce.type==="day").value,Pe=ee.find(ce=>ce.type==="relatedYear"),Te;if(Pe===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Te=+Pe.value,{calendarMonthString:oe,calendarDay:ae,calendarYearToVerify:Te}},s=17,{calendarMonthString:c,calendarDay:u,calendarYearToVerify:h}=a(t,s);c!=="1"&&(s+=29,{calendarMonthString:c,calendarDay:u}=a(t,s)),s-=u-5;let p={},y,w,T=1,C=!1;do({calendarMonthString:c,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[w].daysInMonth=y+30-u),h!==t?C=!0:(p[c]={monthIndex:T++},s+=30),y=u,w=c;while(!C);return p[w].daysInMonth=y+30-u,e.set(r,p),p}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:c,monthCode:u}=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=gn(a,s!==void 0),p=`${a}${s||""}`,y=this.getMonthList(o,e)[p];if(y===void 0)throw new RangeError(`Unmatched month ${p} in Chinese year ${o}`);return a=y.monthIndex,{year:o,month:a,day:c,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let w=+u.replace(/^M0?|L$/g,"");y=h[w],y&&(a=y.monthIndex,u=gn(w))}if(a===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${o}`)}else if(u===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(Ge(a,1,y),Ge(c,1,this.maximumMonthLength())):(a=Mt(a,1,y),c=Mt(c,1,this.maximumMonthLength()));let w=p.find(T=>T[1].monthIndex===a);if(w===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+w[0].replace("bis",""),w[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(!y)throw new RangeError(`Unmatched monthCode ${u} in Chinese year ${o}`);if(a!==y.monthIndex)throw new RangeError(`monthCode ${u} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:u,day:c}}},Ls=class extends Yo{constructor(){super(...arguments),this.id="chinese"}},Ns=class extends Yo{constructor(){super(...arguments),this.id="dangi"}},Os=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 Vt;Ws(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Vt,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Vt,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 Tu(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Vt.getCacheForObject(t),c=this.helper.isoToCalendarDate(t,s),u=this.helper.addCalendar(c,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(u,"constrain",s);return Vt.getCacheForObject(h)||new Vt(s).setObject(h),h}dateUntil(t,e,r){let i=Vt.getCacheForObject(t),o=Vt.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=Vt.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=to.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=Su(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[ys,Ms,ks,Cs,Ps,Ls,Ns,Is,Ts,Rs,xs,As,vs,bs,ws,Ds,Es,_s]){let t=new n;to[t.id]=new Os(t)}ns("calendarImpl",function(n){return to[n]});var Li=Intl.DateTimeFormat;function Pr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Li(m(n,jl),e(m(n,Xa))),function(r,i,o){let a=jo(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 ui(n){return Pt(n,wr)}var br=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(w){if(w==null)throw new TypeError(`Expected object not ${w}`);return Object(w)}(o);let y=Object.create(null);for(let w=0;w<p.length;w++){let T=p[w];Object.prototype.hasOwnProperty.call(s,T)&&(y[T]=s[T])}s=y}else s=Object.create(null);let c=new Li(i,s),u=c.resolvedOptions();if(On(r),a){let p=Object.assign(Object.create(null),u);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,ve(r,Xa,p)}else ve(r,Xa,s);ve(r,jl,u.locale),ve(r,wr,c),ve(r,Rr,u.timeZone),ve(r,hi,u.calendar),ve(r,Ol,rm),ve(r,Hl,tm),ve(r,Bl,nm),ve(r,Fl,em),ve(r,Yl,im),ve(r,$l,om);let h=a?s.timeZone:void 0;if(h===void 0)ve(r,Ja,u.timeZone);else{let p=qo(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");ve(r,Ja,St(p))}})(this,t,e)}get format(){R(this,ui);let t=Zh.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 R(this,ui),Xh.call(this,t,e)}formatToParts(t,...e){return R(this,ui),Jh.call(this,t,...e)}formatRangeToParts(t,e){return R(this,ui),Qh.call(this,t,e)}resolvedOptions(){return R(this,ui),Gh.call(this)}};"formatToParts"in Li.prototype||delete br.prototype.formatToParts,"formatRangeToParts"in Li.prototype||delete br.prototype.formatRangeToParts;var Kt=function(n=void 0,t=void 0){return new br(n,t)};function Gh(){let n=m(this,wr).resolvedOptions();return n.timeZone=m(this,Ja),n}function Zh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.format(...r)}function Jh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.formatToParts(...r)}function Xh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(An(e)){if(!Pu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:c,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(c,"floor")])}return i||(i=m(this,wr)),i.formatRange(...o)}function Qh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(An(e)){if(!Pu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:c,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(c,"floor")])}return i||(i=m(this,wr)),i.formatRangeToParts(...o)}function no(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 em(n){let t=no(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"})),!ta(t)){if(ro(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 tm(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=no(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(ro(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function nm(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=no(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(ro(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function rm(n){let t=no(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(ro(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function im(n){let t=no(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),!ta(t)&&!ea(t)){if(ro(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 om(n){let t=n;return ta(t)||ea(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function ea(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function ta(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function ro(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function An(n){return $e(n)||Ue(n)||Ne(n)||be(n)||nt(n)||qt(n)||tt(n)}function $o(n){return An(n)?n:Vo(n)}function Pu(n,t){return!(!An(n)||!An(t)||Ue(n)&&!Ue(t)||$e(n)&&!$e(t)||Ne(n)&&!Ne(t)||be(n)&&!be(t)||nt(n)&&!nt(t)||qt(n)&&!qt(t)||tt(n)&&!tt(t))}function zr(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,je)};return{epochNs:ct(m(t,Rr),e,"compatible"),formatter:Pr(t,Fl)}}if(nt(n)){let e=m(n,U),r=m(t,hi);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:Pr(t,Hl)}}if(qt(n)){let e=m(n,U),r=m(t,hi);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:Pr(t,Bl)}}if($e(n)){let e=m(n,U),r=m(t,hi);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:Pr(t,Ol)}}if(Ne(n)){let e=m(n,U),r=m(t,hi);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Be);return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:Pr(t,Yl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return tt(n)?{epochNs:m(n,he),formatter:Pr(t,$l)}:{}}function ku(n){let t=Object.create(null);return t.years=m(n,gt),t.months=m(n,yt),t.weeks=m(n,xt),t.days=m(n,vt),t.hours=m(n,bt),t.minutes=m(n,wt),t.seconds=m(n,Dt),t.milliseconds=m(n,Et),t.microseconds=m(n,_t),t.nanoseconds=m(n,At),t}br.prototype.constructor=Kt,Object.defineProperty(Kt,"prototype",{value:br.prototype,writable:!1,enumerable:!1,configurable:!1}),Kt.supportedLocalesOf=Li.supportedLocalesOf,Hn(Kt,"Intl.DateTimeFormat");var{format:am,formatToParts:sm}=Intl.DurationFormat?.prototype??Object.create(null);function Gs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return am.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Gs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return sm.call(this,t)});var cp=Object.freeze({__proto__:null,DateTimeFormat:Kt,ModifiedIntlDurationFormatPrototypeFormat:Gs}),Ni=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");su(this,Oo(t))}get epochMilliseconds(){return R(this,tt),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,tt),_u(P.default.BigInt(m(this,he)))}add(t){return R(this,tt),_l("add",this,t)}subtract(t){return R(this,tt),_l("subtract",this,t)}until(t,e=void 0){return R(this,tt),gl("until",this,t,e)}since(t,e=void 0){return R(this,tt),gl("since",this,t,e)}round(t){if(R(this,tt),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln);return qr(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),sn(hs(m(this,he),r,o,i))}equals(t){R(this,tt);let e=fi(t),r=m(this,he),i=m(e,he);return P.default.equal(P.default.BigInt(r),P.default.BigInt(i))}toString(t=void 0){R(this,tt);let e=ie(t),r=Wi(e),i=ln(e,"trunc"),o=Nt(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=St(a));let{precision:s,unit:c,increment:u}=Ki(o,r);return sl(sn(hs(m(this,he),u,c,i)),a,s)}toJSON(){return R(this,tt),sl(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return R(this,tt),new Kt(t,e).format(this)}valueOf(){Qn("Instant")}toZonedDateTimeISO(t){R(this,tt);let e=St(t);return at(m(this,he),e,"iso8601")}static fromEpochMilliseconds(t){return sn(cn(Vo(t)))}static fromEpochNanoseconds(t){return sn(Oo(t))}static from(t){return fi(t)}static compare(t,e){let r=fi(t),i=fi(e),o=m(r,he),a=m(i,he);return P.default.lessThan(o,a)?-1:P.default.greaterThan(o,a)?1:0}};Hn(Ni,"Temporal.Instant");var Oi=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),c=kt(i===void 0?"iso8601":Ke(i));pr(o,a,s),nu(this,{year:o,month:a,day:s},c)}get calendarId(){return R(this,$e),m(this,U)}get era(){return mt(this,"era")}get eraYear(){return mt(this,"eraYear")}get year(){return mt(this,"year")}get month(){return mt(this,"month")}get monthCode(){return mt(this,"monthCode")}get day(){return mt(this,"day")}get dayOfWeek(){return mt(this,"dayOfWeek")}get dayOfYear(){return mt(this,"dayOfYear")}get weekOfYear(){return mt(this,"weekOfYear")?.week}get yearOfWeek(){return mt(this,"weekOfYear")?.year}get daysInWeek(){return mt(this,"daysInWeek")}get daysInMonth(){return mt(this,"daysInMonth")}get daysInYear(){return mt(this,"daysInYear")}get monthsInYear(){return mt(this,"monthsInYear")}get inLeapYear(){return mt(this,"inLeapYear")}with(t,e=void 0){if(R(this,$e),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me));return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Tt(Zn(r,i,Ee(ie(e))),r)}withCalendar(t){R(this,$e);let e=Xi(t);return Tt(m(this,me),e)}add(t,e=void 0){return R(this,$e),Ml("add",this,t,e)}subtract(t,e=void 0){return R(this,$e),Ml("subtract",this,t,e)}until(t,e=void 0){return R(this,$e),yl("until",this,t,e)}since(t,e=void 0){return R(this,$e),yl("since",this,t,e)}equals(t){R(this,$e);let e=mi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,$e),cl(this,qi(ie(t)))}toJSON(){return R(this,$e),cl(this)}toLocaleString(t=void 0,e=void 0){return R(this,$e),new Kt(t,e).format(this)}valueOf(){Qn("PlainDate")}toPlainDateTime(t=void 0){R(this,$e);let e=tu(t);return en(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(R(this,$e),ze(t)){let a=t.timeZone;a===void 0?e=St(t):(e=St(a),r=t.plainTime)}else e=St(t);let i=m(this,me),o;return r===void 0?o=zn(e,i):(r=Vn(r),o=ct(e,Me(i,m(r,je)),"compatible")),at(o,e,m(this,U))}toPlainYearMonth(){R(this,$e);let t=m(this,U);return Nr(Pi(t,Ct(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){R(this,$e);let t=m(this,U);return Lr(Ro(t,Ct(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return mi(t,e)}static compare(t,e){let r=mi(t),i=mi(e);return bn(m(r,me),m(i,me))}};function mt(n,t){R(n,$e);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn(Oi,"Temporal.PlainDate");var Hi=class{constructor(t,e,r,i=0,o=0,a=0,s=0,c=0,u=0,h="iso8601"){let p=fe(t),y=fe(e),w=fe(r),T=i===void 0?0:fe(i),C=o===void 0?0:fe(o),x=a===void 0?0:fe(a),$=s===void 0?0:fe(s),K=c===void 0?0:fe(c),G=u===void 0?0:fe(u),ee=kt(h===void 0?"iso8601":Ke(h));zs(p,y,w,T,C,x,$,K,G),ru(this,{isoDate:{year:p,month:y,day:w},time:{hour:T,minute:C,second:x,millisecond:$,microsecond:K,nanosecond:G}},ee)}get calendarId(){return R(this,Ne),m(this,U)}get year(){return pt(this,"year")}get month(){return pt(this,"month")}get monthCode(){return pt(this,"monthCode")}get day(){return pt(this,"day")}get hour(){return kr(this,"hour")}get minute(){return kr(this,"minute")}get second(){return kr(this,"second")}get millisecond(){return kr(this,"millisecond")}get microsecond(){return kr(this,"microsecond")}get nanosecond(){return kr(this,"nanosecond")}get era(){return pt(this,"era")}get eraYear(){return pt(this,"eraYear")}get dayOfWeek(){return pt(this,"dayOfWeek")}get dayOfYear(){return pt(this,"dayOfYear")}get weekOfYear(){return pt(this,"weekOfYear")?.week}get yearOfWeek(){return pt(this,"weekOfYear")?.year}get daysInWeek(){return pt(this,"daysInWeek")}get daysInYear(){return pt(this,"daysInYear")}get daysInMonth(){return pt(this,"daysInMonth")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(R(this,Ne),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=m(this,Be),o={...Ct(r,i.isoDate),...i.time};return o=mr(r,o,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),en(Zi(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){R(this,Ne);let e=tu(t);return en(Me(m(this,Be).isoDate,e),m(this,U))}withCalendar(t){R(this,Ne);let e=Xi(t);return en(m(this,Be),e)}add(t,e=void 0){return R(this,Ne),Tl("add",this,t,e)}subtract(t,e=void 0){return R(this,Ne),Tl("subtract",this,t,e)}until(t,e=void 0){return R(this,Ne),vl("until",this,t,e)}since(t,e=void 0){return R(this,Ne),vl("since",this,t,e)}round(t){if(R(this,Ne),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];qr(r,a,a===1);let s=m(this,Be);return en(r===1&&o==="nanosecond"?s:ms(s,r,o,i),m(this,U))}equals(t){R(this,Ne);let e=pi(t);return jr(m(this,Be),m(e,Be))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,Ne);let e=ie(t),r=qi(e),i=Wi(e),o=ln(e,"trunc"),a=Nt(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:c,increment:u}=Ki(a,i),h=ms(m(this,Be),u,c,o);return fr(h),Ii(h,m(this,U),s,r)}toJSON(){return R(this,Ne),Ii(m(this,Be),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ne),new Kt(t,e).format(this)}valueOf(){Qn("PlainDateTime")}toZonedDateTime(t,e=void 0){R(this,Ne);let r=St(t),i=_i(ie(e));return at(ct(r,m(this,Be),i),r,m(this,U))}toPlainDate(){return R(this,Ne),Tt(m(this,Be).isoDate,m(this,U))}toPlainTime(){return R(this,Ne),Pn(m(this,Be).time)}static from(t,e=void 0){return pi(t,e)}static compare(t,e){let r=pi(t),i=pi(e);return jr(m(r,Be),m(i,Be))}};function pt(n,t){R(n,Ne);let e=m(n,Be).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function kr(n,t){return R(n,Ne),m(n,Be).time[t]}Hn(Hi,"Temporal.PlainDateTime");var Bi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,c=0,u=0,h=0){let p=t===void 0?0:an(t),y=e===void 0?0:an(e),w=r===void 0?0:an(r),T=i===void 0?0:an(i),C=o===void 0?0:an(o),x=a===void 0?0:an(a),$=s===void 0?0:an(s),K=c===void 0?0:an(c),G=u===void 0?0:an(u),ee=h===void 0?0:an(h);Xo(p,y,w,T,C,x,$,K,G,ee),On(this),ve(this,gt,p),ve(this,yt,y),ve(this,xt,w),ve(this,vt,T),ve(this,bt,C),ve(this,wt,x),ve(this,Dt,$),ve(this,Et,K),ve(this,_t,G),ve(this,At,ee)}get years(){return R(this,Ye),m(this,gt)}get months(){return R(this,Ye),m(this,yt)}get weeks(){return R(this,Ye),m(this,xt)}get days(){return R(this,Ye),m(this,vt)}get hours(){return R(this,Ye),m(this,bt)}get minutes(){return R(this,Ye),m(this,wt)}get seconds(){return R(this,Ye),m(this,Dt)}get milliseconds(){return R(this,Ye),m(this,Et)}get microseconds(){return R(this,Ye),m(this,_t)}get nanoseconds(){return R(this,Ye),m(this,At)}get sign(){return R(this,Ye),Lo(this)}get blank(){return R(this,Ye),Lo(this)===0}with(t){R(this,Ye);let e=eu(t),{years:r=m(this,gt),months:i=m(this,yt),weeks:o=m(this,xt),days:a=m(this,vt),hours:s=m(this,bt),minutes:c=m(this,wt),seconds:u=m(this,Dt),milliseconds:h=m(this,Et),microseconds:p=m(this,_t),nanoseconds:y=m(this,At)}=e;return new n(r,i,o,a,s,c,u,h,p,y)}negated(){return R(this,Ye),Ht(this)}abs(){return R(this,Ye),new n(Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,xt)),Math.abs(m(this,vt)),Math.abs(m(this,bt)),Math.abs(m(this,wt)),Math.abs(m(this,Dt)),Math.abs(m(this,Et)),Math.abs(m(this,_t)),Math.abs(m(this,At)))}add(t){return R(this,Ye),El("add",this,t)}subtract(t){return R(this,Ye),El("subtract",this,t)}round(t){if(R(this,Ye),t===void 0)throw new TypeError("options parameter is required");let e=Sn(this),r=typeof t=="string"?yr("smallestUnit",t):ie(t),i=Nt(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ka(r),s=Vr(r),c=ln(r,"halfExpand"),u=Nt(r,"smallestUnit","datetime",void 0),h=!0;u||(h=!1,u="nanosecond");let p=In(e,u),y=!0;if(i||(y=!1,i=p),i==="auto"&&(i=p),!h&&!y)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(In(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let w={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(w!==void 0&&qr(s,w,!1),s>1&&Cn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let C=xr(this),x=m(a,ke),$=m(a,U),K=m(a,he);return C=Eu(K,vi(K,x,$,C),x,$,i,s,u,c),Cn(i)==="date"&&(i="hour"),tn(C,i)}if(o){let C=fn(this),x=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},C.time),$=m(o,me),K=m(o,U),G=Gt(K,$,st(C.date,x.deltaDays),"constrain");return C=Du(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(G,x),K,i,s,u,c),tn(C,i)}if(mn(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(mn(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let T=fn(this);if(u==="day"){let{quotient:C,remainder:x}=T.time.divmod(Po),$=T.date.days+C+Mi(x,"day");$=qn($,s,c),T=Rn({years:0,months:0,weeks:0,days:$},Re.ZERO)}else T=Rn({years:0,months:0,weeks:0,days:0},No(T.time,s,u,c));return tn(T,i)}total(t){if(R(this,Ye),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?yr("unit",t):ie(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ka(e),o=Nt(e,"unit","datetime",Ln);if(i){let s=xr(this),c=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,w,T,C){return Cn(C)==="time"?Mi(Re.fromEpochNsDiff(y,p),C):fl(bu(p,y,w,T,C),y,rn(w,p),w,T,C)}(h,vi(h,c,u,s),c,u,o)}if(r){let s=fn(this),c=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),u=m(r,me),h=m(r,U),p=Gt(h,u,st(s.date,c.deltaDays),"constrain");return function(y,w,T,C){if(jr(y,w)==0)return 0;fr(y),fr(w);let x=vu(y,w,T,C);return C==="nanosecond"?P.default.toNumber(x.time.totalNs):fl(x,rt(w),y,null,T,C)}(Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(p,c),h,o)}let a=Sn(this);if(mn(a))throw new RangeError(`a starting point is required for ${a}s total`);if(mn(o))throw new RangeError(`a starting point is required for ${o}s total`);return Mi(fn(this).time,o)}toString(t=void 0){R(this,Ye);let e=ie(t),r=Wi(e),i=ln(e,"trunc"),o=Nt(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:c}=Ki(o,r);if(s==="nanosecond"&&c===1)return Mo(this,a);let u=Sn(this),h=xr(this),p=No(h.time,c,s,i);return h=Rn(h.date,p),Mo(tn(h,In(u,"second")),a)}toJSON(){return R(this,Ye),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(R(this,Ye),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Gs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),Mo(this,"auto")}valueOf(){Qn("Duration")}static from(t){return nn(t)}static compare(t,e,r=void 0){let i=nn(t),o=nn(e),a=ie(r),{plainRelativeTo:s,zonedRelativeTo:c}=Ka(a);if(m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,xt)===m(o,xt)&&m(i,vt)===m(o,vt)&&m(i,bt)===m(o,bt)&&m(i,wt)===m(o,wt)&&m(i,Dt)===m(o,Dt)&&m(i,Et)===m(o,Et)&&m(i,_t)===m(o,_t)&&m(i,At)===m(o,At))return 0;let u=Sn(i),h=Sn(o),p=xr(i),y=xr(o);if(c&&(Cn(u)==="date"||Cn(h)==="date")){let $=m(c,ke),K=m(c,U),G=m(c,he),ee=vi(G,$,K,p),oe=vi(G,$,K,y);return Lt(P.default.toNumber(P.default.subtract(ee,oe)))}let w=p.date.days,T=y.date.days;if(mn(u)||mn(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");w=pl(p.date,s),T=pl(y.date,s)}let C=p.time.add24HourDays(w),x=y.time.add24HourDays(T);return C.cmp(x)}};Hn(Bi,"Temporal.Duration");var Fi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=kt(r===void 0?"iso8601":Ke(r)),c=fe(i);pr(c,o,a),iu(this,{year:c,month:o,day:a},s)}get monthCode(){return Il(this,"monthCode")}get day(){return Il(this,"day")}get calendarId(){return R(this,qt),m(this,U)}with(t,e=void 0){if(R(this,qt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me),"month-day");return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Lr(Ro(r,i,Ee(ie(e))),r)}equals(t){R(this,qt);let e=ol(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,qt),ul(this,qi(ie(t)))}toJSON(){return R(this,qt),ul(this)}toLocaleString(t=void 0,e=void 0){return R(this,qt),new Kt(t,e).format(this)}valueOf(){Qn("PlainMonthDay")}toPlainDate(t){if(R(this,qt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,Ct(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return ol(t,e)}};function Il(n,t){R(n,qt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}function Za(n){return rn(n,gs())}Hn(Fi,"Temporal.PlainMonthDay");var Iu={instant:()=>sn(gs()),plainDateTimeISO:(n=li())=>en(Za(St(n)),"iso8601"),plainDateISO:(n=li())=>Tt(Za(St(n)).isoDate,"iso8601"),plainTimeISO:(n=li())=>Pn(Za(St(n)).time),timeZoneId:()=>li(),zonedDateTimeISO:(n=li())=>{let t=St(n);return at(gs(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Iu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Yi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:fe(t),c=e===void 0?0:fe(e),u=r===void 0?0:fe(r),h=i===void 0?0:fe(i),p=o===void 0?0:fe(o),y=a===void 0?0:fe(a);Jo(s,c,u,h,p,y),ou(this,{hour:s,minute:c,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return R(this,Ue),m(this,je).hour}get minute(){return R(this,Ue),m(this,je).minute}get second(){return R(this,Ue),m(this,je).second}get millisecond(){return R(this,Ue),m(this,je).millisecond}get microsecond(){return R(this,Ue),m(this,je).microsecond}get nanosecond(){return R(this,Ue),m(this,je).nanosecond}with(t,e=void 0){if(R(this,Ue),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=as(t,"partial"),i=as(this),{hour:o,minute:a,second:s,millisecond:c,microsecond:u,nanosecond:h}=Object.assign(i,r),p=Ee(ie(e));return{hour:o,minute:a,second:s,millisecond:c,microsecond:u,nanosecond:h}=Ko(o,a,s,c,u,h,p),new n(o,a,s,c,u,h)}add(t){return R(this,Ue),Sl("add",this,t)}subtract(t){return R(this,Ue),Sl("subtract",this,t)}until(t,e=void 0){return R(this,Ue),bl("until",this,t,e)}since(t,e=void 0){return R(this,Ue),bl("since",this,t,e)}round(t){if(R(this,Ue),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln);return qr(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),Pn(ps(m(this,je),r,o,i))}equals(t){R(this,Ue);let e=Vn(t);return fs(m(this,je),m(e,je))===0}toString(t=void 0){R(this,Ue);let e=ie(t),r=Wi(e),i=ln(e,"trunc"),o=Nt(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:c}=Ki(o,r);return ll(ps(m(this,je),c,s,i),a)}toJSON(){return R(this,Ue),ll(m(this,je),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ue),new Kt(t,e).format(this)}valueOf(){Qn("PlainTime")}static from(t,e=void 0){return Vn(t,e)}static compare(t,e){let r=Vn(t),i=Vn(e);return fs(m(r,je),m(i,je))}};Hn(Yi,"Temporal.PlainTime");var $i=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=kt(r===void 0?"iso8601":Ke(r)),c=fe(i);pr(o,a,c),au(this,{year:o,month:a,day:c},s)}get year(){return Mn(this,"year")}get month(){return Mn(this,"month")}get monthCode(){return Mn(this,"monthCode")}get calendarId(){return R(this,nt),m(this,U)}get era(){return Mn(this,"era")}get eraYear(){return Mn(this,"eraYear")}get daysInMonth(){return Mn(this,"daysInMonth")}get daysInYear(){return Mn(this,"daysInYear")}get monthsInYear(){return Mn(this,"monthsInYear")}get inLeapYear(){return Mn(this,"inLeapYear")}with(t,e=void 0){if(R(this,nt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=Ct(r,m(this,me),"year-month");return i=mr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Nr(Pi(r,i,Ee(ie(e))),r)}add(t,e=void 0){return R(this,nt),Cl("add",this,t,e)}subtract(t,e=void 0){return R(this,nt),Cl("subtract",this,t,e)}until(t,e=void 0){return R(this,nt),wl("until",this,t,e)}since(t,e=void 0){return R(this,nt),wl("since",this,t,e)}equals(t){R(this,nt);let e=gi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,nt),dl(this,qi(ie(t)))}toJSON(){return R(this,nt),dl(this)}toLocaleString(t=void 0,e=void 0){return R(this,nt),new Kt(t,e).format(this)}valueOf(){Qn("PlainYearMonth")}toPlainDate(t){if(R(this,nt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,Ct(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return gi(t,e)}static compare(t,e){let r=gi(t),i=gi(e);return bn(m(r,me),m(i,me))}};function Mn(n,t){R(n,nt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn($i,"Temporal.PlainYearMonth");var cm=Kt.prototype.resolvedOptions,ji=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Oo(t),o=Ke(e),{tzName:a,offsetMinutes:s}=Wn(o);if(s===void 0){let c=xo(a);if(!c)throw new RangeError(`unknown time zone ${a}`);o=c.identifier}else o=Ys(s);cu(this,i,o,kt(r===void 0?"iso8601":Ke(r)))}get calendarId(){return R(this,be),m(this,U)}get timeZoneId(){return R(this,be),m(this,ke)}get year(){return ft(this,"year")}get month(){return ft(this,"month")}get monthCode(){return ft(this,"monthCode")}get day(){return ft(this,"day")}get hour(){return Ir(this,"hour")}get minute(){return Ir(this,"minute")}get second(){return Ir(this,"second")}get millisecond(){return Ir(this,"millisecond")}get microsecond(){return Ir(this,"microsecond")}get nanosecond(){return Ir(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}get epochMilliseconds(){return R(this,be),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,be),_u(m(this,he))}get dayOfWeek(){return ft(this,"dayOfWeek")}get dayOfYear(){return ft(this,"dayOfYear")}get weekOfYear(){return ft(this,"weekOfYear")?.week}get yearOfWeek(){return ft(this,"weekOfYear")?.year}get hoursInDay(){R(this,be);let t=m(this,ke),e=hn(this).isoDate,r=Ot(e.year,e.month,e.day+1),i=zn(t,e),o=zn(t,r);return Mi(Re.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ft(this,"daysInWeek")}get daysInMonth(){return ft(this,"daysInMonth")}get daysInYear(){return ft(this,"daysInYear")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}get offset(){return R(this,be),ss(kn(m(this,ke),m(this,he)))}get offsetNanoseconds(){return R(this,be),kn(m(this,ke),m(this,he))}with(t,e=void 0){if(R(this,be),!ze(t))throw new TypeError("invalid zoned-date-time-like");Ur(t);let r=m(this,U),i=m(this,ke),o=kn(i,m(this,he)),a=hn(this),s={...Ct(r,a.isoDate),...a.time,offset:ss(o)};s=mr(r,s,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let c=ie(e),u=_i(c),h=To(c,"prefer"),p=Zi(r,s,Ee(c)),y=Wr(s.offset);return at(Io(p.isoDate,p.time,"option",y,i,u,h,!1),i,r)}withPlainTime(t=void 0){R(this,be);let e=m(this,ke),r=m(this,U),i=hn(this).isoDate,o;return o=t===void 0?zn(e,i):ct(e,Me(i,m(Vn(t),je)),"compatible"),at(o,e,r)}withTimeZone(t){R(this,be);let e=St(t);return at(m(this,he),e,m(this,U))}withCalendar(t){R(this,be);let e=Xi(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return R(this,be),Pl("add",this,t,e)}subtract(t,e=void 0){return R(this,be),Pl("subtract",this,t,e)}until(t,e=void 0){return R(this,be),Dl("until",this,t,e)}since(t,e=void 0){return R(this,be),Dl("since",this,t,e)}round(t){if(R(this,be),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Nt(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(qr(r,a,a===1),o==="nanosecond"&&r===1)return at(m(this,he),m(this,ke),m(this,U));let s=m(this,ke),c=m(this,he),u=hn(this),h;if(o==="day"){let p=u.isoDate,y=Ot(p.year,p.month,p.day+1),w=zn(s,p),T=zn(s,y),C=P.default.subtract(T,w);h=Re.fromEpochNsDiff(c,w).round(C,i).addToEpochNs(w)}else{let p=ms(u,r,o,i),y=kn(s,c);h=Io(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return at(h,s,m(this,U))}equals(t){R(this,be);let e=yi(t),r=m(this,he),i=m(e,he);return!!P.default.equal(P.default.BigInt(r),P.default.BigInt(i))&&!!lu(m(this,ke),m(e,ke))&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,be);let e=ie(t),r=qi(e),i=Wi(e),o=function(y){return xn(y,"offset",["auto","never"],"auto")}(e),a=ln(e,"trunc"),s=Nt(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let c=function(y){return xn(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:h,increment:p}=Ki(s,i);return hl(this,u,r,c,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){R(this,be);let r=ie(e),i=Object.create(null);if(function(c,u,h,p){if(u==null)return;let y=Reflect.ownKeys(u);for(let w=0;w<y.length;w++){let T=y[w];if(!h.some(C=>Object.is(C,T))&&Object.prototype.propertyIsEnumerable.call(u,T)){let C=u[T];c[T]=C}}}(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,ke),ml(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Kt(t,i),a=cm.call(o).calendar,s=m(this,U);if(s!=="iso8601"&&a!=="iso8601"&&!yn(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(sn(m(this,he)))}toJSON(){return R(this,be),hl(this,"auto")}valueOf(){Qn("ZonedDateTime")}startOfDay(){R(this,be);let t=m(this,ke);return at(zn(t,hn(this).isoDate),t,m(this,U))}getTimeZoneTransition(t){R(this,be);let e=m(this,ke);if(t===void 0)throw new TypeError("options parameter is required");let r=xn(typeof t=="string"?yr("direction",t):ie(t),"direction",["next","previous"],Ln);if(r===void 0)throw new TypeError("direction option is required");if(ml(e)||e==="UTC")return null;let i=m(this,he),o=r==="next"?js(e,i):ls(e,i);return o===null?null:at(o,e,m(this,U))}toInstant(){return R(this,be),sn(m(this,he))}toPlainDate(){return R(this,be),Tt(hn(this).isoDate,m(this,U))}toPlainTime(){return R(this,be),Pn(hn(this).time)}toPlainDateTime(){return R(this,be),en(hn(this),m(this,U))}static from(t,e=void 0){return yi(t,e)}static compare(t,e){let r=yi(t),i=yi(e),o=m(r,he),a=m(i,he);return P.default.lessThan(P.default.BigInt(o),P.default.BigInt(a))?-1:P.default.greaterThan(P.default.BigInt(o),P.default.BigInt(a))?1:0}};function hn(n){return rn(m(n,ke),m(n,he))}function ft(n,t){R(n,be);let e=hn(n).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ir(n,t){return R(n,be),hn(n).time[t]}Hn(ji,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Bi,Instant:Ni,Now:Iu,PlainDate:Oi,PlainDateTime:Hi,PlainMonthDay:Fi,PlainTime:Yi,PlainYearMonth:$i,ZonedDateTime:ji}),lp=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,lm=[Ni,Oi,Hi,Bi,Fi,Yi,$i,ji];for(let n of lm){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))}function Zs(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Js=Object.assign;var um=Object.prototype.hasOwnProperty,na=(n,t)=>um.call(n,t),Er=Array.isArray,io=n=>xu(n)==="[object Map]";var Ru=n=>typeof n=="function",dm=n=>typeof n=="string",Gr=n=>typeof n=="symbol",oo=n=>n!==null&&typeof n=="object";var hm=Object.prototype.toString,xu=n=>hm.call(n),Au=n=>xu(n).slice(8,-1);var ra=n=>dm(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var ia=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},mm=/-(\w)/g,hp=ia(n=>n.replace(mm,(t,e)=>e?e.toUpperCase():"")),pm=/\B([A-Z])/g,mp=ia(n=>n.replace(pm,"-$1").toLowerCase()),fm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),pp=ia(n=>n?`on${fm(n)}`:""),_r=(n,t)=>!Object.is(n,t);var gm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var fp=Zs(gm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Xs;var Oe;var Qs=new WeakSet,sa=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,Xs&&Xs.active&&Xs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Qs.has(this)&&(Qs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Hu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Lu(this),Bu(this);let t=Oe,e=un;Oe=this,un=!0;try{return this.fn()}finally{Fu(this),Oe=t,un=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)pc(t);this.deps=this.depsTail=void 0,Lu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Qs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){nc(this)&&this.run()}get dirty(){return nc(this)}},Ou=0,so,co;function Hu(n,t=!1){if(n.flags|=8,t){n.next=co,co=n;return}n.next=so,so=n}function hc(){Ou++}function mc(){if(--Ou>0)return;if(co){let t=co;for(co=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;so;){let t=so;for(so=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 Bu(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),pc(r),ym(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function nc(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Yu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Yu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===lo)||(n.globalVersion=lo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!nc(n))))return;n.flags|=2;let t=n.dep,e=Oe,r=un;Oe=n,un=!0;try{Bu(n);let i=n.fn(n._value);(t.version===0||_r(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Oe=e,un=r,Fu(n),n.flags&=-3}}function pc(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)pc(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function ym(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function Rt(n,t){n.effect instanceof sa&&(n=n.effect.fn);let e=new sa(n);t&&Js(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var un=!0,$u=[];function vm(){$u.push(un),un=!1}function bm(){let n=$u.pop();un=n===void 0?!0:n}function Lu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Oe;Oe=void 0;try{t()}finally{Oe=e}}}var lo=0,rc=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}},uo=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(!Oe||!un||Oe===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Oe)e=this.activeLink=new rc(Oe,this),Oe.deps?(e.prevDep=Oe.depsTail,Oe.depsTail.nextDep=e,Oe.depsTail=e):Oe.deps=Oe.depsTail=e,ju(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=Oe.depsTail,e.nextDep=void 0,Oe.depsTail.nextDep=e,Oe.depsTail=e,Oe.deps===e&&(Oe.deps=r)}return e}trigger(t){this.version++,lo++,this.notify(t)}notify(t){hc();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{mc()}}};function ju(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)ju(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var ic=new WeakMap,Mr=Symbol(""),oc=Symbol(""),ho=Symbol("");function Bt(n,t,e){if(un&&Oe){let r=ic.get(n);r||ic.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new uo),i.map=r,i.key=e),i.track()}}function er(n,t,e,r,i,o){let a=ic.get(n);if(!a){lo++;return}let s=c=>{c&&c.trigger()};if(hc(),t==="clear")a.forEach(s);else{let c=Er(n),u=c&&ra(e);if(c&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===ho||!Gr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(ho)),t){case"add":c?u&&s(a.get("length")):(s(a.get(Mr)),io(n)&&s(a.get(oc)));break;case"delete":c||(s(a.get(Mr)),io(n)&&s(a.get(oc)));break;case"set":io(n)&&s(a.get(Mr));break}}mc()}function Zr(n){let t=Le(n);return t===n?t:(Bt(t,"iterate",ho),tr(n)?t:t.map(It))}function fc(n){return Bt(n=Le(n),"iterate",ho),n}var wm={__proto__:null,[Symbol.iterator](){return ec(this,Symbol.iterator,It)},concat(...n){return Zr(this).concat(...n.map(t=>Er(t)?Zr(t):t))},entries(){return ec(this,"entries",n=>(n[1]=It(n[1]),n))},every(n,t){return Bn(this,"every",n,t,void 0,arguments)},filter(n,t){return Bn(this,"filter",n,t,e=>e.map(It),arguments)},find(n,t){return Bn(this,"find",n,t,It,arguments)},findIndex(n,t){return Bn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return Bn(this,"findLast",n,t,It,arguments)},findLastIndex(n,t){return Bn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return Bn(this,"forEach",n,t,void 0,arguments)},includes(...n){return tc(this,"includes",n)},indexOf(...n){return tc(this,"indexOf",n)},join(n){return Zr(this).join(n)},lastIndexOf(...n){return tc(this,"lastIndexOf",n)},map(n,t){return Bn(this,"map",n,t,void 0,arguments)},pop(){return ao(this,"pop")},push(...n){return ao(this,"push",n)},reduce(n,...t){return Nu(this,"reduce",n,t)},reduceRight(n,...t){return Nu(this,"reduceRight",n,t)},shift(){return ao(this,"shift")},some(n,t){return Bn(this,"some",n,t,void 0,arguments)},splice(...n){return ao(this,"splice",n)},toReversed(){return Zr(this).toReversed()},toSorted(n){return Zr(this).toSorted(n)},toSpliced(...n){return Zr(this).toSpliced(...n)},unshift(...n){return ao(this,"unshift",n)},values(){return ec(this,"values",It)}};function ec(n,t,e){let r=fc(n),i=r[t]();return r!==n&&!tr(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Dm=Array.prototype;function Bn(n,t,e,r,i,o){let a=fc(n),s=a!==n&&!tr(n),c=a[t];if(c!==Dm[t]){let p=c.apply(n,o);return s?It(p):p}let u=e;a!==n&&(s?u=function(p,y){return e.call(this,It(p),y,n)}:e.length>2&&(u=function(p,y){return e.call(this,p,y,n)}));let h=c.call(a,u,r);return s&&i?i(h):h}function Nu(n,t,e,r){let i=fc(n),o=e;return i!==n&&(tr(n)?e.length>3&&(o=function(a,s,c){return e.call(this,a,s,c,n)}):o=function(a,s,c){return e.call(this,a,It(s),c,n)}),i[t](o,...r)}function tc(n,t,e){let r=Le(n);Bt(r,"iterate",ho);let i=r[t](...e);return(i===-1||i===!1)&&Lm(e[0])?(e[0]=Le(e[0]),r[t](...e)):i}function ao(n,t,e=[]){vm(),hc();let r=Le(n)[t].apply(n,e);return mc(),bm(),r}var Em=Zs("__proto__,__v_isRef,__isVue"),zu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Gr));function _m(n){Gr(n)||(n=String(n));let t=Le(this);return Bt(t,"has",n),t.hasOwnProperty(n)}var ca=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?Rm:qu:o?Im:Vu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Er(t);if(!i){let c;if(a&&(c=wm[e]))return c;if(e==="hasOwnProperty")return _m}let s=Reflect.get(t,e,Jr(t)?t:r);return(Gr(e)?zu.has(e):Em(e))||(i||Bt(t,"get",e),o)?s:Jr(s)?a&&ra(e)?s:s.value:oo(s)?i?Qr(s):nr(s):s}},ac=class extends ca{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let c=Xr(o);if(!tr(r)&&!Xr(r)&&(o=Le(o),r=Le(r)),!Er(t)&&Jr(o)&&!Jr(r))return c?!1:(o.value=r,!0)}let a=Er(t)&&ra(e)?Number(e)<t.length:na(t,e),s=Reflect.set(t,e,r,Jr(t)?t:i);return t===Le(i)&&(a?_r(r,o)&&er(t,"set",e,r,o):er(t,"add",e,r)),s}deleteProperty(t,e){let r=na(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&er(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Gr(e)||!zu.has(e))&&Bt(t,"has",e),r}ownKeys(t){return Bt(t,"iterate",Er(t)?"length":Mr),Reflect.ownKeys(t)}},sc=class extends ca{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Mm=new ac,Tm=new sc;var cc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function Sm(n,t,e){return function(...r){let i=this.__v_raw,o=Le(i),a=io(o),s=n==="entries"||n===Symbol.iterator&&a,c=n==="keys"&&a,u=i[n](...r),h=e?cc:t?lc:It;return!t&&Bt(o,"iterate",c?oc:Mr),{next(){let{value:p,done:y}=u.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function aa(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Cm(n,t){let e={get(i){let o=this.__v_raw,a=Le(o),s=Le(i);n||(_r(i,s)&&Bt(a,"get",i),Bt(a,"get",s));let{has:c}=oa(a),u=t?cc:n?lc:It;if(c.call(a,i))return u(o.get(i));if(c.call(a,s))return u(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Bt(Le(i),"iterate",Mr),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Le(o),s=Le(i);return n||(_r(i,s)&&Bt(a,"has",i),Bt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,c=Le(s),u=t?cc:n?lc:It;return!n&&Bt(c,"iterate",Mr),s.forEach((h,p)=>i.call(o,u(h),u(p),a))}};return Js(e,n?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(i){!t&&!tr(i)&&!Xr(i)&&(i=Le(i));let o=Le(this);return oa(o).has.call(o,i)||(o.add(i),er(o,"add",i,i)),this},set(i,o){!t&&!tr(o)&&!Xr(o)&&(o=Le(o));let a=Le(this),{has:s,get:c}=oa(a),u=s.call(a,i);u||(i=Le(i),u=s.call(a,i));let h=c.call(a,i);return a.set(i,o),u?_r(o,h)&&er(a,"set",i,o,h):er(a,"add",i,o),this},delete(i){let o=Le(this),{has:a,get:s}=oa(o),c=a.call(o,i);c||(i=Le(i),c=a.call(o,i));let u=s?s.call(o,i):void 0,h=o.delete(i);return c&&er(o,"delete",i,void 0,u),h},clear(){let i=Le(this),o=i.size!==0,a=void 0,s=i.clear();return o&&er(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Sm(i,n,t)}),e}function Uu(n,t){let e=Cm(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(na(e,i)&&i in r?e:r,i,o)}var Pm={get:Uu(!1,!1)};var km={get:Uu(!0,!1)};var Vu=new WeakMap,Im=new WeakMap,qu=new WeakMap,Rm=new WeakMap;function xm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Am(n){return n.__v_skip||!Object.isExtensible(n)?0:xm(Au(n))}function nr(n){return Xr(n)?n:Wu(n,!1,Mm,Pm,Vu)}function Qr(n){return Wu(n,!0,Tm,km,qu)}function Wu(n,t,e,r,i){if(!oo(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Am(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 Xr(n){return!!(n&&n.__v_isReadonly)}function tr(n){return!!(n&&n.__v_isShallow)}function Lm(n){return n?!!n.__v_raw:!1}function Le(n){let t=n&&n.__v_raw;return t?Le(t):n}var It=n=>oo(n)?nr(n):n,lc=n=>oo(n)?Qr(n):n;function Jr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return Nm(n,!1)}function Nm(n,t){return Jr(n)?n:new uc(n,t)}var uc=class{constructor(t,e){this.dep=new uo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Le(t),this._value=e?t:It(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||tr(t)||Xr(t);t=r?t:Le(t),_r(t,e)&&(this._rawValue=t,this._value=r?t:It(t),this.dep.trigger())}};var dc=class{constructor(t,e,r){this.fn=t,this.setter=e,this._value=void 0,this.dep=new uo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return Hu(this,!0),!0}get value(){let t=this.dep.track();return Yu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Xt(n,t,e=!1){let r,i;return Ru(n)?r=n:(r=n.get,i=n.set),new dc(r,i,e)}var jc=Kc(Gu(),1);var gc=class{constructor(){A(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))}},la=new gc;function Je(n,t){la.emit(n,t)}function rr(n,t){Array.isArray(n)?n.forEach(e=>la.on(e,t)):la.on(n,t)}var Zu={en:{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",viewHotelPage:"View Site",pricingProducts:"Products:",pricingProductsAndExtras:"Products & Extras:",pricingTaxes:"Taxes:",pricingSubtotal:"Subtotal:",pricingService:"service"},"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",viewHotelPage:"Voir le site",pricingProducts:"Produits :",pricingProductsAndExtras:"Produits et options :",pricingTaxes:"Taxes :",pricingSubtotal:"Sous-total :",pricingService:"service"},de:{loading:"Laden...",night:"Nacht",chooseOption:"Option ausw\xE4hlen",apartment:"Apartment",total:"Gesamt",missingEnterpriseId:"Unternehmens-ID fehlt",missingCategoryId:"Kategorie-ID fehlt",minimumNights:"Mindestn\xE4chte",maximumNights:"Maximale N\xE4chte",booked:"Bereits gebucht",select:"Ausw\xE4hlen",fatalErrorMessage:"Hoppla! Ein unerwarteter Fehler ist aufgetreten. Bitte laden Sie die Seite neu oder kontaktieren Sie den Support.",pleaseWait:"Bitte warten...","chargingMode:Once":"Einmal","chargingMode:PerTimeUnit":"Pro Nacht","chargingMode:PerPersonPerTimeUnit":"Pro Person und Nacht",adults:"Erwachsene",children:"Kinder (0-18 Jahre)",guestSingular:"Person",guestPlural:"Personen",couponValid:"Gutschein ist g\xFCltig ;)",couponInvalid:"Gutschein ist ung\xFCltig!",couponError:"Fehler bei der Gutscheinpr\xFCfung!",proceedToPayment:"Zur Zahlung fortfahren",completePayment:"Zahlung abschlie\xDFen",viewHotelPage:"Website ansehen",pricingProducts:"Produkte:",pricingProductsAndExtras:"Produkte & Extras:",pricingTaxes:"Steuern:",pricingSubtotal:"Zwischensumme:",pricingService:"Service"},es:{loading:"Cargando...",night:"Noche",chooseOption:"Elige una opci\xF3n",apartment:"Apartamento",total:"Total",missingEnterpriseId:"Falta el ID de empresa",missingCategoryId:"Falta el ID de categor\xEDa",minimumNights:"noches m\xEDnimas",maximumNights:"noches m\xE1ximas",booked:"Ya reservado",select:"Seleccionar",fatalErrorMessage:"\xA1Ups! Ha ocurrido un error inesperado. Por favor, recarga la p\xE1gina o contacta con soporte.",pleaseWait:"Por favor espera...","chargingMode:Once":"Una vez","chargingMode:PerTimeUnit":"Por noche","chargingMode:PerPersonPerTimeUnit":"Por persona y noche",adults:"Adultos",children:"Ni\xF1os (0-18 a\xF1os)",guestSingular:"Persona",guestPlural:"Personas",couponValid:"El cup\xF3n es v\xE1lido ;)",couponInvalid:"\xA1El cup\xF3n no es v\xE1lido!",couponError:"Error al validar el cup\xF3n!",proceedToPayment:"Ir al pago",completePayment:"Completar el pago",viewHotelPage:"Ver el sitio",pricingProducts:"Productos:",pricingProductsAndExtras:"Productos y extras:",pricingTaxes:"Impuestos:",pricingSubtotal:"Subtotal:",pricingService:"servicio"},it:{loading:"Caricamento...",night:"Notte",chooseOption:"Scegli un\u2019opzione",apartment:"Appartamento",total:"Totale",missingEnterpriseId:"ID azienda mancante",missingCategoryId:"ID categoria mancante",minimumNights:"notti minime",maximumNights:"notti massime",booked:"Gi\xE0 prenotato",select:"Seleziona",fatalErrorMessage:"Ops! Si \xE8 verificato un errore imprevisto. Ricarica la pagina o contatta il supporto.",pleaseWait:"Attendere prego...","chargingMode:Once":"Una volta","chargingMode:PerTimeUnit":"Per notte","chargingMode:PerPersonPerTimeUnit":"Per persona a notte",adults:"Adulti",children:"Bambini (0-18 anni)",guestSingular:"Persona",guestPlural:"Persone",couponValid:"Il coupon \xE8 valido ;)",couponInvalid:"Il coupon non \xE8 valido!",couponError:"Errore durante la verifica del coupon!",proceedToPayment:"Procedi al pagamento",completePayment:"Completa il pagamento",viewHotelPage:"Vedi il sito",pricingProducts:"Prodotti:",pricingProductsAndExtras:"Prodotti ed extra:",pricingTaxes:"Tasse:",pricingSubtotal:"Subtotale:",pricingService:"servizio"},pt:{loading:"A carregar...",night:"Noite",chooseOption:"Escolha uma op\xE7\xE3o",apartment:"Apartamento",total:"Total",missingEnterpriseId:"ID da empresa em falta",missingCategoryId:"ID da categoria em falta",minimumNights:"noites m\xEDnimas",maximumNights:"noites m\xE1ximas",booked:"J\xE1 reservado",select:"Selecionar",fatalErrorMessage:"Ops! Ocorreu um erro inesperado. Por favor, recarregue a p\xE1gina ou contacte o suporte.",pleaseWait:"Por favor, aguarde...","chargingMode:Once":"Uma vez","chargingMode:PerTimeUnit":"Por noite","chargingMode:PerPersonPerTimeUnit":"Por pessoa por noite",adults:"Adultos",children:"Crian\xE7as (0-18 anos)",guestSingular:"Pessoa",guestPlural:"Pessoas",couponValid:"O cup\xE3o \xE9 v\xE1lido ;)",couponInvalid:"O cup\xE3o \xE9 inv\xE1lido!",couponError:"Erro ao validar o cup\xE3o!",proceedToPayment:"Prosseguir para pagamento",completePayment:"Concluir pagamento",viewHotelPage:"Ver site",pricingProducts:"Produtos:",pricingProductsAndExtras:"Produtos e extras:",pricingTaxes:"Impostos:",pricingSubtotal:"Subtotal:",pricingService:"servi\xE7o"},zh:{loading:"\u52A0\u8F7D\u4E2D...",night:"\u665A",chooseOption:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879",apartment:"\u516C\u5BD3",total:"\u603B\u8BA1",missingEnterpriseId:"\u7F3A\u5C11\u4F01\u4E1AID",missingCategoryId:"\u7F3A\u5C11\u7C7B\u522BID",minimumNights:"\u6700\u5C11\u5165\u4F4F\u665A\u6570",maximumNights:"\u6700\u591A\u5165\u4F4F\u665A\u6570",booked:"\u5DF2\u9884\u8BA2",select:"\u9009\u62E9",fatalErrorMessage:"\u7CDF\u7CD5\uFF01\u53D1\u751F\u4E86\u610F\u5916\u9519\u8BEF\u3002\u8BF7\u5237\u65B0\u9875\u9762\u6216\u8054\u7CFB\u652F\u6301\u3002",pleaseWait:"\u8BF7\u7A0D\u5019...","chargingMode:Once":"\u4E00\u6B21","chargingMode:PerTimeUnit":"\u6BCF\u665A","chargingMode:PerPersonPerTimeUnit":"\u6BCF\u4EBA\u6BCF\u665A",adults:"\u6210\u4EBA",children:"\u513F\u7AE5\uFF080-18\u5C81\uFF09",guestSingular:"\u4EBA",guestPlural:"\u4EBA",couponValid:"\u4F18\u60E0\u5238\u6709\u6548 ;)",couponInvalid:"\u4F18\u60E0\u5238\u65E0\u6548\uFF01",couponError:"\u9A8C\u8BC1\u4F18\u60E0\u5238\u65F6\u51FA\u9519\uFF01",proceedToPayment:"\u524D\u5F80\u652F\u4ED8",completePayment:"\u5B8C\u6210\u652F\u4ED8",viewHotelPage:"\u67E5\u770B\u7F51\u7AD9",pricingProducts:"\u4EA7\u54C1\uFF1A",pricingProductsAndExtras:"\u4EA7\u54C1\u53CA\u9644\u52A0\u9879\uFF1A",pricingTaxes:"\u7A0E\u8D39\uFF1A",pricingSubtotal:"\u5C0F\u8BA1\uFF1A",pricingService:"\u670D\u52A1"},ar:{loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644...",night:"\u0644\u064A\u0644\u0629",chooseOption:"\u0627\u062E\u062A\u0631 \u062E\u064A\u0627\u0631\u064B\u0627",apartment:"\u0634\u0642\u0629",total:"\u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",missingEnterpriseId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0634\u0631\u0643\u0629 \u0645\u0641\u0642\u0648\u062F",missingCategoryId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0641\u0626\u0629 \u0645\u0641\u0642\u0648\u062F",minimumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",maximumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",booked:"\u0645\u062D\u062C\u0648\u0632 \u0628\u0627\u0644\u0641\u0639\u0644",select:"\u0627\u062E\u062A\u064A\u0627\u0631",fatalErrorMessage:"\u0639\u0630\u0631\u064B\u0627! \u062D\u062F\u062B \u062E\u0637\u0623 \u063A\u064A\u0631 \u0645\u062A\u0648\u0642\u0639. \u064A\u0631\u062C\u0649 \u0625\u0639\u0627\u062F\u0629 \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0635\u0641\u062D\u0629 \u0623\u0648 \u0627\u0644\u0627\u062A\u0635\u0627\u0644 \u0628\u0627\u0644\u062F\u0639\u0645.",pleaseWait:"\u064A\u0631\u062C\u0649 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631...","chargingMode:Once":"\u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629","chargingMode:PerTimeUnit":"\u0644\u0643\u0644 \u0644\u064A\u0644\u0629","chargingMode:PerPersonPerTimeUnit":"\u0644\u0643\u0644 \u0634\u062E\u0635 \u0641\u064A \u0627\u0644\u0644\u064A\u0644\u0629",adults:"\u0627\u0644\u0628\u0627\u0644\u063A\u0648\u0646",children:"\u0627\u0644\u0623\u0637\u0641\u0627\u0644 (0-18 \u0633\u0646\u0629)",guestSingular:"\u0634\u062E\u0635",guestPlural:"\u0623\u0634\u062E\u0627\u0635",couponValid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u0635\u0627\u0644\u062D\u0629 ;)",couponInvalid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629!",couponError:"\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u0644\u0642\u0633\u064A\u0645\u0629!",proceedToPayment:"\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0641\u0639",completePayment:"\u0625\u062A\u0645\u0627\u0645 \u0627\u0644\u062F\u0641\u0639",viewHotelPage:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0648\u0642\u0639",pricingProducts:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A:",pricingProductsAndExtras:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A \u0648\u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A:",pricingTaxes:"\u0627\u0644\u0636\u0631\u0627\u0626\u0628:",pricingSubtotal:"\u0627\u0644\u0645\u062C\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u0639\u064A:",pricingService:"\u0627\u0644\u062E\u062F\u0645\u0629"},ru:{loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",night:"\u041D\u043E\u0447\u044C",chooseOption:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442",apartment:"\u0410\u043F\u0430\u0440\u0442\u0430\u043C\u0435\u043D\u0442\u044B",total:"\u0418\u0442\u043E\u0433\u043E",missingEnterpriseId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",missingCategoryId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438",minimumNights:"\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",maximumNights:"\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",booked:"\u0423\u0436\u0435 \u0437\u0430\u0431\u0440\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",fatalErrorMessage:"\u0423\u043F\u0441! \u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u043E\u0439.",pleaseWait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435...","chargingMode:Once":"\u041E\u0434\u0438\u043D \u0440\u0430\u0437","chargingMode:PerTimeUnit":"\u0417\u0430 \u043D\u043E\u0447\u044C","chargingMode:PerPersonPerTimeUnit":"\u0417\u0430 \u0447\u0435\u043B\u043E\u0432\u0435\u043A\u0430 \u0437\u0430 \u043D\u043E\u0447\u044C",adults:"\u0412\u0437\u0440\u043E\u0441\u043B\u044B\u0435",children:"\u0414\u0435\u0442\u0438 (0-18 \u043B\u0435\u0442)",guestSingular:"\u0427\u0435\u043B\u043E\u0432\u0435\u043A",guestPlural:"\u041B\u044E\u0434\u0438",couponValid:"\u041A\u0443\u043F\u043E\u043D \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D ;)",couponInvalid:"\u041A\u0443\u043F\u043E\u043D \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D!",couponError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0443\u043F\u043E\u043D\u0430!",proceedToPayment:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u043F\u043B\u0430\u0442\u0435",completePayment:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u043F\u043B\u0430\u0442\u0443",viewHotelPage:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0430\u0439\u0442",pricingProducts:"\u0422\u043E\u0432\u0430\u0440\u044B:",pricingProductsAndExtras:"\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0434\u043E\u043F. \u0443\u0441\u043B\u0443\u0433\u0438:",pricingTaxes:"\u041D\u0430\u043B\u043E\u0433\u0438:",pricingSubtotal:"\u041F\u0440\u043E\u043C\u0435\u0436\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u0438\u0442\u043E\u0433:",pricingService:"\u0443\u0441\u043B\u0443\u0433\u0430"}},yc={en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"fr-FR":["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],de:["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],es:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],it:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],pt:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],zh:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ar:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],ru:["\u044F\u043D\u0432.","\u0444\u0435\u0432\u0440.","\u043C\u0430\u0440\u0442","\u0430\u043F\u0440.","\u043C\u0430\u0439","\u0438\u044E\u043D\u044C","\u0438\u044E\u043B\u044C","\u0430\u0432\u0433.","\u0441\u0435\u043D\u0442.","\u043E\u043A\u0442.","\u043D\u043E\u044F\u0431.","\u0434\u0435\u043A."]},Xu=()=>{let n=Dn().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in yc)return yc[r];return yc.en},Ju=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Hm=n=>{let t=[],e=o=>{o&&!t.includes(o)&&t.push(o)};e(n);let r=n.split("-")[0];return r&&r!==n&&e(r),({en:["en-US","en-GB"],es:["es-ES","es-MX","es-419"],de:["de-DE","de-AT","de-CH"],it:["it-IT","it-CH"],pt:["pt-PT","pt-BR"],zh:["zh-CN","zh-TW","zh-Hans","zh-Hant"],ar:["ar-SA","ar-EG"],ru:["ru-RU"],fr:["fr-FR","fr-CA","fr-BE","fr"]}[r]??[]).forEach(e),e("en-US"),e("en"),e("fr-FR"),e("fr"),t},Se=n=>Zu[Dn().bcp47][n]||Zu["fr-FR"][n],Xe=n=>{let t=Dn().bcp47,e=t.split("-")[0],r=Ju(n,Hm(t));if(r!==void 0)return r;if(e){let a=Object.entries(n).find(([s])=>s===e||s.startsWith(`${e}-`));if(a&&a[1].trim()!=="")return a[1]}let i=Ju(n,["en-US","en","fr-FR","fr"]);if(i!==void 0)return i;let o=Object.values(n).find(a=>typeof a=="string"&&a.trim()!=="");return o!==void 0?o:(console.warn(`Translation [${t}] not found and no fallback strings were available.`,n),"")};var Bm={en:"en-US",fr:"fr-FR",de:"de-DE",es:"es-ES",it:"it-IT",pt:"pt-PT",zh:"zh-CN",ru:"ru-RU",ar:"en-US"},Qu=n=>Bm[n]||"fr-FR",Dn=()=>{let n=document.documentElement.lang.toLowerCase(),t={iso639:"fr",bcp47:"fr-FR"},r=Object.entries({en:{iso639:"en",bcp47:"en"},fr:{iso639:"fr",bcp47:"fr-FR"},de:{iso639:"de",bcp47:"de"},es:{iso639:"es",bcp47:"es"},it:{iso639:"it",bcp47:"it"},pt:{iso639:"pt",bcp47:"pt"},zh:{iso639:"zh",bcp47:"zh"},ar:{iso639:"ar",bcp47:"ar"},ru:{iso639:"ru",bcp47:"ru"}}).find(([i])=>n.startsWith(i))?.[1];return r&&(t=r),t},Ve=Dn().bcp47,Lp=Dn().iso639;var J=class n{static getCurrentDate(){return xe.Now.plainDateISO()}static fromString(t){return xe.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(Ve,e)}static formatForAPI(t){return(typeof t=="string"?xe.PlainDate.from(t):xe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:xe.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 xe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return xe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return xe.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 xe.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 xe.PlainDate.from(e)}return xe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var zp=localStorage.getItem("dev")==="true";var Up=3*60*60*1e3;var ua="calendar-day-price",ed="DD/MM/YYYY",td="Y-m-d",nd=!1,Fm=365,vc=J.getCurrentDate(),rd=J.addDays(vc,Fm),Tr=J.getCurrentDate(),ei=J.addDays(Tr,3),Ym=J.getCurrentDate(),Vp=J.addDays(Ym,30);function ir(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}var id="data-fs-element";var q=(n,t=document)=>t.querySelector(`[${id}="${n}"]`);var od=n=>n.getAttribute(id);var bc=class{constructor(){A(this,"state",nr({appartmentsData:[],today:J.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}},gf=new bc;var Sr={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)),Sr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Sr.get(n),r=t(e);Sr.set(n,r)},remove:n=>{localStorage.removeItem(n),Sr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",jm()||"root")}},jm=()=>localStorage.getItem("lastUpdater");var da=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},or=Sr.get("form_state"),ad=or?{enterpriseId:or.enterpriseId||"",startDate:or.startDate||da(45),endDate:or.endDate||da(48),guests:or.guests||2,coupon:or.coupon||"",referrer:or.referrer||window.location.href,rooms:or.rooms||0}:{enterpriseId:"",startDate:da(45),endDate:da(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},Ft=nr(ad),$m=Qr(ad);Rt(()=>{Sr.set("form_state",Ft)});var zm="https://yuna-backend.cbocher.workers.dev/mews",Um="https://api.mews.com/api/distributor/v1",Vm="Yuna",qm="mewscache",Wm=!1,Km=13,Gm=8,Zm=xe.Duration.from({minutes:20}).milliseconds,Jm=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),le={base_url:zm,bookingEngine_url:Um,bookingEngineClient:Vm,bypassCache:Wm,headers:Jm,cache_key:qm,ttl:Zm,beCheckInUTC:Km,beCheckOutUTC:Gm};var ha=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ti=class{constructor(){A(this,"dbName","MewsAPICache");A(this,"version",2);A(this,"db",null);A(this,"initPromise",null);A(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(u){console.warn("Error cleaning up old stores:",u)}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 c=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);c.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},c.onsuccess=()=>{let u=c.result;if(!u){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:le.ttl,p=xe.Instant.fromEpochMilliseconds(u.timestamp);if(xe.Now.instant().since(p,{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,u.size),o(u.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:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((c,u)=>{let y=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),u(y.error)},y.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),c()}})}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:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((c,u)=>{let y=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>u(y.error),y.onsuccess=()=>c()})}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=xe.Now.instant().epochMilliseconds-le.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),c=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),u=50;for(let h=0;h<c.length;h+=u){let p=c.slice(h,h+u);await Promise.all(p.map(y=>new Promise((w,T)=>{let C=a.delete(y.cacheKey);C.onsuccess=()=>w(),C.onerror=()=>T(C.error)}))),e+=p.length,h+u<c.length&&await new Promise(y=>setTimeout(y,0))}await new Promise((h,p)=>{o.oncomplete=()=>h(),o.onerror=()=>p(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,c)=>{let u=o.getAll();u.onsuccess=()=>s(u.result),u.onerror=()=>c(u.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(c=>new Promise((u,h)=>{let p=i.delete(c.cacheKey);p.onsuccess=()=>u(),p.onerror=()=>h(p.error)})))}await new Promise((s,c)=>{r.oncomplete=()=>s(),r.onerror=()=>c(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 c=r.getAll();c.onsuccess=()=>a(c.result),c.onerror=()=>s(c.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 Fn=async(n,t,e=null,r=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new ti,o=ha(`booking-engine:${n}`,e||"null",t.body);if(!le.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(c=>{console.error("Error setting booking engine cache:",c)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var sd=async n=>{let t=`${le.bookingEngine_url}/hotels/get`,e={Client:le.bookingEngineClient,HotelId:n},r={method:"POST",headers:le.headers,body:JSON.stringify(e)};return Fn(t,r,n)};var ma=(n,t)=>{let e=`${le.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var cd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)},ld=(n,t)=>{let e=`${le.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var Qe=async(n,t,e=null,r=!1)=>{let i=new ti,o=ha(n,e||"null",t.body);if(!le.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(le.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),c=await s.json();if(s.ok)return i.set(o,c,e||"null").catch(u=>{console.error("Error setting cache:",u)}),c;throw new Error("FETCH_ERROR",{cause:c})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var ud=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAll",e,n)};function dd(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Xe(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var wc=Ze({});async function hd(n){if(wc.value[n])return wc.value[n];let t=await ud(n),e=dd(t);return wc.value[n]=e,e}var md=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/ageCategories/getAll",e,n)};function pd(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:Xe(t.Names),shortName:t.ShortNames?Xe(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Dc=Ze({});async function fd(n){if(Dc.value[n])return Dc.value[n];let t=await md(n,{EnterpriseIds:[n]}),e=pd(t);return Dc.value[n]=e,e}var gd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/products/getAll",e,n)};function yd(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 vd(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 bd(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:Xe(t.Names),shortName:t.ShortName,description:Xe(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function mo(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:Xe(n.Names),shortName:Xe(n.ShortNames),description:Xe(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 wd(n){return{products:mo(n.Products,Ec),customerProducts:mo(n.CustomerProducts,Ec)}}var _c=Ze({});async function Dd(n,t){if(_c.value[t])return _c.value[t];let e=await gd(n,{ServiceIds:[t]}),r=wd(e);return _c.value[t]=r,r}var Ed=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getAll",e,n)};var Mc=Ze({});async function pa(n,t){if(Mc.value[t])return Mc.value[t];let e=await Ed(n,{ServiceIds:[t]}),r=bd(e);return Mc.value[t]=r,r}var _d=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAvailability",e,n)};function Md(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 Tc=Ze({});async function Td(n,t,e,r){if(Tc.value[t])return Tc.value[t];let i=await _d(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=Md(i);return Tc.value[t]=o,o}var Sd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/restrictions/getAll",e,n)};function Cd(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Sc=Ze({});async function Pd(n,t,e,r){if(Sc.value[t])return Sc.value[t];let i=await Sd(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Cd(i);return Sc.value[t]=o,o}var kd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rules/getAll",e,n)};function Id(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=Ze({});async function Rd(n,t){if(Cc.value[t])return Cc.value[t];let e=await kd(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Id(e);return Cc.value[t]=r,r}var xd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getPricing",e,n)};var Pc=Ze({});async function Ad(n,t,e,r){if(Pc.value[t])return Pc.value[t];let i=await xd(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=yd(i);return Pc.value[t]=o,o}var fa=class{constructor(t,e){A(this,"enterprise");A(this,"rate",null);A(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 Ad(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 ga=class{constructor(t,e){A(this,"enterprise");A(this,"service",null);A(this,"products",[]);A(this,"customerProducts",[]);A(this,"restrictions",[]);A(this,"availabilities",[]);A(this,"rules",[]);A(this,"ageCategories",[]);A(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 Td(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 Pd(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 Dd(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 pa(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new fa(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 Rd(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 fd(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ni=class{constructor(t){A(this,"enterpriseId");A(this,"services",[]);A(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await hd(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ga(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};function Xm(n,t){if(n.ordering!==t.ordering)return n.ordering-t.ordering;let e=n.name.localeCompare(t.name,void 0,{sensitivity:"base"});return e!==0?e:n.id.localeCompare(t.id)}function kc(n){return[...n].sort(Xm)}var L,Ie,En,ar,Ic=class{constructor(){_o(this,En);_o(this,L,nr({loading:!1,error:null,isFetching:!1,cmsApartmentData:{},enterpriseInstance:null,reservableService:null,startDate:null,endDate:null,rooms:[],couponCode:"",hotel:null,availabilities:null,rates:[],servicePricing:null,reservationPricing:null,serviceOnlyPricing:null,ageCategories:[],products:[],selectedRateId:null,be_pricing:null}));_o(this,Ie,{nightsCount:Xt(()=>!S(this,L).startDate||!S(this,L).endDate?0:S(this,L).startDate.until(S(this,L).endDate).days),selectedProducts:Xt(()=>S(this,L).products.filter(t=>t.selected)),maxAllowedRooms:Xt(()=>{if(!S(this,L).availabilities)return 0;let{categoryId:t}=S(this,L).cmsApartmentData,e=S(this,L).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:Xt(()=>S(this,L).servicePricing?.Rates?S(this,L).servicePricing.Rates.map(t=>{let e=S(this,L).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=S(this,L).servicePricing?.CategoryPrices.find(o=>o.CategoryId===S(this,L).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=S(this,L).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),c={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,w)=>y+w.value,0);return c[u]=p||0,{ageCategoryId:u,totalPersons:p}}),o.Occupancies.every(u=>{let h=c[u.AgeCategoryId];return h===void 0||u.PersonCount===h})})?.RateGroupPrices?.find(o=>o.MinRateId===t.Id);return{id:t.Id,name:Xe(t.Name),description:Xe(t.Description),isPrivate:t.IsPrivate,currencyCode:t.CurrencyCode,ordering:t.Ordering,groupId:e?.Id??"",groupOrdering:e?.Ordering||0,price:i?.MinPrice,selected:!1}}).filter(t=>t.price!==void 0&&t.price.TotalAmount?.GrossValue!==void 0&&t.price.TotalAmount?.GrossValue>0):[]),summary:Xt(()=>{let t=S(this,L).reservationPricing?.OccupancyPrices??[],e=S(this,L).serviceOnlyPricing?.OccupancyPrices??[],r=S(this,L).cmsApartmentData?.name??"",{rooms:i}=S(this,L),o="EUR";if(S(this,L).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let w of e){let T=w.Pricing.find($=>$.RateId===S(this,L).selectedRateId);if(!T)continue;let x=T.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,K)=>$+K.NetValue,0);a.set(`${w.AdultCount}-${w.ChildCount}`,x)}let s=new Map;for(let w of t){let T=w.Pricing.find(ae=>ae.RateId===S(this,L).selectedRateId);if(!T)continue;let C=`${w.AdultCount}-${w.ChildCount}`,x=T.Price.TotalAmount[o],$=a.get(C)??0,K=S(this,Ie).nightsCount.value||1,G=$/K,ee=x.TaxValues.filter(ae=>ae.TaxRateCode==="FR-R").reduce((ae,Pe)=>ae+Pe.Value,0),oe=x.GrossValue-$-ee;s.set(C,{rateId:T.RateId,pricing:{avgPerNight:G,service:$,products:oe,taxes:ee,subtotal:x.GrossValue}})}let c=new Map;for(let w of i){let T=0,C=0;for(let $ of w)$.isAdult?T+=$.value:C+=$.value;let x=`${T}-${C}`;c.has(x)?c.get(x).quantity+=1:c.set(x,{adults:T,children:C,quantity:1})}if(!Array.from(c.keys()).every(w=>s.has(w)))return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(c.values()).map(w=>{let T=`${w.adults}-${w.children}`,C=s.get(T);return C?{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:C.rateId,pricing:C.pricing}:(console.warn(`[BookingState] Pricing not yet available for occupancy ${T}`,{availableOccupancies:Array.from(s.keys()),selectedRateId:S(this,L).selectedRateId,occupancyPricesCount:t.length}),{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:S(this,L).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((w,T)=>(w.service+=T.pricing.service*T.quantity,w.products+=T.pricing.products*T.quantity,w.taxes+=T.pricing.taxes*T.quantity,w.grandTotal+=T.pricing.subtotal*T.quantity,w),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:p,totals:y}}),totalStayPrice:Xt(()=>{let t=S(this,Ie).rates.value.find(e=>e.id===S(this,L).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:Xt(()=>S(this,L).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:Xt(()=>S(this,L).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:Xt(()=>{if(!S(this,L).availabilities)return!1;let{categoryId:t}=S(this,L).cmsApartmentData,e=S(this,L).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:Xt(()=>S(this,Ie).selectedProducts.value.reduce((e,r)=>{let i=0;switch(r.chargingMode){case"Once":i=r.price||0;break;case"PerTimeUnit":i=r.price*S(this,Ie).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*S(this,Ie).nightsCount.value*S(this,Ie).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:Xt(()=>S(this,Ie).totalStayPrice.value+S(this,Ie).productsTotalPrice.value),restrictionMessage:Xt(()=>{if(!S(this,L).availabilities)return null;let t=S(this,L).availabilities.ApplicableRestrictions??[];if(t.length===0)return null;let{categoryId:e}=S(this,L).cmsApartmentData,r=t.filter(a=>a.Conditions.ResourceCategoryId===null||a.Conditions.ResourceCategoryId===e);if(r.length===0)return null;let i=S(this,Ie).nightsCount.value;if(i<1)return`1 ${Se("minimumNights")}`;let o=a=>{if(!a)return null;try{return xe.Duration.from(a).total({unit:"days"})}catch{return null}};for(let a of r){let{Exceptions:s}=a;if(s.MaxAdvance==null&&s.MinAdvance==null&&s.MaxLength==null&&s.MinLength==null&&s.MaxPrice==null&&s.MinPrice==null&&s.MaxReservationCount==null&&s.MinReservationCount==null)continue;let u=o(s.MinLength);if(u!==null&&i<u)return`${u} ${Se("minimumNights")}`;let h=o(s.MaxLength);if(h!==null&&i>h)return`${h} ${Se("maximumNights")}`}return null})})}get startDate(){return S(this,L).startDate}get endDate(){return S(this,L).endDate}get rooms(){return S(this,L).rooms}get couponCode(){return S(this,L).couponCode}get hotel(){return S(this,L).hotel}get availabilities(){return S(this,L).availabilities}get rates(){return S(this,L).rates}get servicePricing(){return S(this,L).servicePricing}get reservationPricing(){return S(this,L).reservationPricing}get ageCategories(){return S(this,L).ageCategories}get products(){return S(this,L).products}get sortedProducts(){return kc(S(this,L).products)}get selectedRateId(){return S(this,L).selectedRateId}get be_pricing(){return S(this,L).be_pricing}get cmsApartmentData(){return S(this,L).cmsApartmentData}get enterpriseInstance(){return S(this,L).enterpriseInstance}get reservableService(){return S(this,L).reservableService}get isFetching(){return S(this,L).isFetching}get nightsCount(){return S(this,Ie).nightsCount.value}get selectedProducts(){return S(this,Ie).selectedProducts.value}get maxAllowedRooms(){return S(this,Ie).maxAllowedRooms.value}get computedRates(){return S(this,Ie).rates.value}get computedSummary(){return S(this,Ie).summary.value}get totalStayPrice(){return S(this,Ie).totalStayPrice.value}get adultsCount(){return S(this,Ie).adultsCount.value}get childrenCount(){return S(this,Ie).childrenCount.value}get isAvailable(){return S(this,Ie).isAvailable.value}get productsTotalPrice(){return S(this,Ie).productsTotalPrice.value}get totalPrice(){return S(this,Ie).totalPrice.value}get restrictionMessage(){return S(this,Ie).restrictionMessage.value}setCmsApartmentData(t){S(this,L).cmsApartmentData=t,jn(this,En,ar).call(this)}updateStartDate(t){S(this,L).startDate=t,t&&(Ft.startDate=t.toString()),jn(this,En,ar).call(this)}updateEndDate(t){S(this,L).endDate=t,t&&(Ft.endDate=t.toString()),jn(this,En,ar).call(this)}updateRooms(t){S(this,L).rooms=t,jn(this,En,ar).call(this)}updateCouponCode(t){S(this,L).couponCode=t,jn(this,En,ar).call(this)}updateSelectedRateId(t){S(this,L).selectedRateId=t,jn(this,En,ar).call(this)}updateProducts(t){S(this,L).products=kc(t),jn(this,En,ar).call(this)}async initializeResources(t){S(this,L).loading=!0,S(this,L).error=null;try{S(this,L).enterpriseInstance=new ni(t),await S(this,L).enterpriseInstance.initServices(),S(this,L).reservableService=S(this,L).enterpriseInstance.reservableService,await S(this,L).reservableService?.initAgeCategories(),S(this,L).ageCategories=S(this,L).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,L).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{S(this,L).loading=!1}}async initializeRooms(t=1,e=1){(Ft.rooms==null||Ft.rooms<1)&&(Ft.rooms=t);let r=[];for(let i=0;i<(Ft.rooms||t);i++){let o=S(this,L).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",c=s?Se("adults"):Se("children"),u=s?i===0&&(Ft.guests||e)||1:0;return{isAdult:s,ageCategoryId:a.id,name:c,value:u}});r.push(o)}S(this,L).rooms=r}async fetchHotel(t){S(this,L).loading=!0,S(this,L).error=null,S(this,L).isFetching=!0;try{let e=await sd(t);S(this,L).hotel=e,S(this,L).products=e?.Products.map(r=>({id:r.Id,name:Xe(r.Name),description:Xe(r.Description),categoryId:r.CategoryId,ordering:r.Ordering,imageIds:r.ImageId?[r.ImageId]:[],price:r.Prices.EUR,chargingMode:r.ChargingMode,selected:!1}))||[],S(this,L).products=kc(S(this,L).products)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,L).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{S(this,L).loading=!1,S(this,L).isFetching=!1}}async fetchAvailability(t,e){if(!S(this,L).startDate||!S(this,L).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(S(this,L).startDate,S(this,L).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}S(this,L).loading=!0,S(this,L).isFetching=!0;try{let r=J.formatForAPI(S(this,L).startDate),i=J.formatForAPI(S(this,L).endDate),o=await cd(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:S(this,L).reservableService?.getService()?.id||"",Client:le.bookingEngineClient,LanguageCode:"fr-FR"});S(this,L).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,L).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{S(this,L).loading=!1,S(this,L).isFetching=!1}}async fetchServicePricing(t,e){if(!S(this,L).startDate||!S(this,L).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(S(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchServicePricing: Invalid date range (0 nights), skipping");return}S(this,L).loading=!0,S(this,L).isFetching=!0;try{let r=J.formatForAPI(S(this,L).startDate),i=J.formatForAPI(S(this,L).endDate),o=await ld(t,{Client:le.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:S(this,L).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:S(this,L).couponCode||void 0});S(this,L).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,L).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{S(this,L).loading=!1,S(this,L).isFetching=!1}}async fetchReservationPricing(t,e){if(!S(this,L).startDate||!S(this,L).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(S(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchReservationPricing: Invalid date range (0 nights), skipping");return}if(S(this,L).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}S(this,L).loading=!0,S(this,L).isFetching=!0;try{let r=J.formatForAPI(S(this,L).startDate),i=J.formatForAPI(S(this,L).endDate),o=S(this,L).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=S(this,Ie).selectedProducts.value.map(h=>h.id),s={Client:le.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:S(this,L).couponCode||void 0,Occupancies:o},c,u;return a.length===0?(c=await ma(t,{...s,ProductIds:[]}),u=c):[c,u]=await Promise.all([ma(t,{...s,ProductIds:a}),ma(t,{...s,ProductIds:[]})]),S(this,L).reservationPricing=c,S(this,L).serviceOnlyPricing=u,S(this,L).be_pricing=c,c}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,L).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{S(this,L).loading=!1,S(this,L).isFetching=!1}}async fetchRates(t){if(!S(this,L).reservableService||!S(this,L).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}S(this,L).loading=!0;try{let e=S(this,L).reservableService.getService()?.id;S(this,L).rates=await pa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,L).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{S(this,L).loading=!1}}async fetchAllData(t,e){try{await this.initializeResources(t),await this.initializeRooms(),await this.fetchHotel(t),await this.fetchAvailability(t,e),await this.fetchServicePricing(t,e),await this.fetchReservationPricing(t,e),await this.fetchRates(t)}catch(r){throw console.error("[BXT] fetchAllData: Error in batch fetch",r),r}}getReadonlyState(){return Qr({...S(this,L),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}})}getState(){let{enterpriseInstance:t,reservableService:e,...r}=S(this,L);return{...JSON.parse(JSON.stringify(r)),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}}}};L=new WeakMap,Ie=new WeakMap,En=new WeakSet,ar=function(){S(this,L).isFetching};var H=new Ic;var Ld=()=>{};function lt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Ld}var ya=n=>n instanceof HTMLInputElement;var Rc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Yt=(n,t=!0)=>n.cloneNode(t);var xc=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=ya(e)?e.value:""}return t.toString()};var Ac=(n,t)=>{n.querySelectorAll(t||"*").forEach(r=>r.remove())};var po=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!ya(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}Rc(n,["click","input","change"])};function Nd(n,t){return{rate:n,pricing:t}}function Lc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Od(n,t){let e=t.filter(o=>Qm(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=>ep(n,o.Exceptions)))}function Qm(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=J.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function va(n){if(!n)return null;try{return xe.Duration.from(n).total({unit:"days"})}catch{return null}}function ep(n,t){let e=J.fromString(n.pricing?.datesUtc[0]),r=J.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=J.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=va(t.MinAdvance),c=va(t.MaxAdvance),u=va(t.MinLength),h=va(t.MaxLength);return!!(u&&i<u||h&&i>h||s&&a<s||c&&a>c||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var Hd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Od(s,t)&&Lc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=vd(r),a=tp(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function tp(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>Lc(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 Bd=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ni(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 u=>{let h=await u.initPricing(J.formatForAPI(vc.toString()),J.formatForAPI(rd.toString()));return Nd(u.getRate(),h)}));return Hd(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 et=class et extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(et.parseDateTime(e,r,i));A(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 et)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=et.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[u,h]of Object.entries(o)){let p=Number(u),{group:y,pattern:w}=et.formatPatterns(h[0],i);s[y]=p+1,s.value+=w,s.value+=".*?"}let c=new RegExp(`^${s.value}$`);if(c.test(e)){let u=c.exec(e),h=Number(u[s.year]),p=null;s.month?p=Number(u[s.month])-1:s.shortMonth?p=et.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=et.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,w=Number(u[s.hour]),T=Number.isNaN(w)?0:w,C=Number(u[s.minute]),x=Number.isNaN(C)?0:C,$=Number(u[s.second]),K=Number.isNaN($)?0:$,G=u[s.ampm];return G&&G==="PM"&&(T+=12,T===24&&(T=0)),new Date(h,p,y,T,x,K,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return et.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return et.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:`(${et.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${et.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 et(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=et.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,c]of Object.entries(o)){let u=Number(s);i+=this.formatTokens(c[0],r),o[u+1]&&(i+=e.substring(c.index+c[0].length,o[u+1].index)),u===o.length-1&&(i+=e.substring(c.index+c[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 et.shortMonths(r)[this.getMonth()];case"MMMM":return et.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""}}};A(et,"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),A(et,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=et,Nc=class{constructor(t){A(this,"picker");this.picker=t}render(t,e){t||(t=new ge),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 c=this.getCalendarDaysView(t.clone());o.appendChild(c),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:c});let u=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:u}),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 ge(this.picker.options.date):null,r=new ge,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}},Oc=class{constructor(t){A(this,"picker");A(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()}},ba=class{constructor(t){A(this,"Calendar",new Nc(this));A(this,"PluginManager",new Oc(this));A(this,"calendars",[]);A(this,"datePicked",[]);A(this,"cssLoaded",0);A(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});A(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:[]});A(this,"ui",{container:null,shadowRoot:null,wrapper:null});A(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 ge(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 ge(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof ge?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 ge(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 ge(this.options.date,this.options.format):this.calendars[0]=new ge}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}}},_a=Object.freeze({__proto__:null,Core:ba,create:ba}),fo=class{constructor(){A(this,"picker");A(this,"options");A(this,"priority",0);A(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()}},wa=class extends fo{constructor(){super(...arguments);A(this,"priority",1);A(this,"binds",{onView:this.onView.bind(this)});A(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 ge(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new ge(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof ge&&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 ge&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof ge&&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"),c=o.clone().add(this.options.minDays-1,"day"),u=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){u=!0;break}s.add(1,"day")}for(;c.isAfter(o,"day");){if(this.testFilter(c)){h=!0;break}c.subtract(1,"day")}u&&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 ge(Number(i.dataset.start)),s=new ge(Number(i.dataset.end)),c=s.diff(a,"day"),u=this.options.minDays&&c<this.options.minDays,h=this.options.maxDays&&c>this.options.maxDays;(u||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 ge&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof ge&&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 Da=class extends fo{constructor(){super(...arguments);A(this,"tooltipElement");A(this,"triggerElement");A(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)});A(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 c=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=c:e instanceof HTMLElement&&(e.innerText=c)}}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 ge(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),c=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&c&&(c.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,c)&&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 ge(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new ge(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new ge(e,this.picker.options.format),o=new ge(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 ge(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let c=o.clone();o=a.clone(),a=c.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(c=>{let u=new ge(c.dataset.time),h=this.picker.Calendar.getCalendarDayView(u);u.isBetween(o,a)&&h.classList.add("in-range"),u.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),c===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),c.className=h.className}),this.options.tooltip){let c=this.options.tooltipNumber(a.diff(o,"day")+1);if(c>0){let u=new Intl.PluralRules(this.picker.options.lang).select(c),h=`${c} ${this.options.locale[u]}`;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 ge(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,c=a.left;s-=i.top,c-=i.left,s-=o.height,c-=o.width/2,c+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${c}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 Ea=class extends fo{constructor(){super(...arguments);A(this,"rangePlugin");A(this,"lockPlugin");A(this,"priority",10);A(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});A(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>'}});A(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 c=document.createElement("select");c.className="month-name--select month-name--dropdown";for(let u=0;u<12;u+=1){let h=document.createElement("option"),p=new ge(new Date(o.getFullYear(),u,2,0,0,0)),y=new ge(new Date(o.getFullYear(),u,1,0,0,0));h.value=String(u),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new ge(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new ge(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),c.appendChild(h)}c.addEventListener("change",u=>{let h=u.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(c)}if(this.options.dropdown.years){s.childNodes[1].remove();let c=document.createElement("select");c.className="month-name--select";let u=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,c.appendChild(p)}for(let p=h;p>=u;p-=1){let y=document.createElement("option"),w=new ge(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&w.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&w.isAfter(new ge(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,c.appendChild(y)}if(o.getFullYear()<u){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,c.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(c.childNodes).reverse();c.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,c.appendChild(y)})}c.addEventListener("change",p=>{let y=p.target;this.picker.calendars[0].setFullYear(Number(y.value)),this.picker.renderAll()}),s.appendChild(c)}}}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 ge(o.dataset.time);else{let h=i.querySelector(".day");s=new ge(h.dataset.time)}let c=s.getWeek(this.picker.options.firstDay);c===53&&s.getMonth()===0&&(c="53/1");let u=document.createElement("div");u.className="wnum-item",u.innerHTML=String(c),i.insertBefore(u,o)}})}}};var Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],sr={_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 Ta={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},Sa=Ta;var ut=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Hc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var Ca=function(n){return n instanceof Array?n:[n]};function dt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Ce(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 go(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Bc(n,t){if(t(n))return n;if(n.parentNode)return Bc(n.parentNode,t)}function yo(n,t){var e=Ce("div","numInputWrapper"),r=Ce("input","numInput "+n),i=Ce("span","arrowUp"),o=Ce("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 jt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var Fc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Fd={D:Fc,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*$t(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:Fc,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:Fc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Yn={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})"},ri={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ri.w(n,t,e)]},F:function(n,t,e){return vo(ri.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ut(ri.h(n,t,e))},H:function(n){return ut(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[$t(n.getHours()>11)]},M:function(n,t){return vo(n.getMonth(),!0,t)},S:function(n){return ut(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ut(n.getFullYear(),4)},d:function(n){return ut(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ut(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ut(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 Yc=function(n){var t=n.config,e=t===void 0?sr:t,r=n.l10n,i=r===void 0?Ta:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,c,u){var h=u||i;return e.formatDate!==void 0&&!a?e.formatDate(s,c,h):c.split("").map(function(p,y,w){return ri[p]&&w[y-1]!=="\\"?ri[p](s,h,e):p!=="\\"?p:""}).join("")}},Pa=function(n){var t=n.config,e=t===void 0?sr:t,r=n.l10n,i=r===void 0?Ta:r;return function(o,a,s,c){if(!(o!==0&&!o)){var u=c||i,h,p=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 y=a||(e||sr).dateFormat,w=String(o).trim();if(w==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(w)||/GMT$/.test(w))h=new Date(o);else{for(var T=void 0,C=[],x=0,$=0,K="";x<y.length;x++){var G=y[x],ee=G==="\\",oe=y[x-1]==="\\"||ee;if(Yn[G]&&!oe){K+=Yn[G];var ae=new RegExp(K).exec(o);ae&&(T=!0)&&C[G!=="Y"?"push":"unshift"]({fn:Fd[G],val:ae[++$]})}else ee||(K+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),C.forEach(function(Pe){var Te=Pe.fn,ce=Pe.val;return h=Te(h,ce,u)||h}),h=T?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+p));return}return s===!0&&h.setHours(0,0,0,0),h}}};function zt(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 Yd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ka=function(n,t,e){return n*3600+t*60+e},$d=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},jd={DAY:864e5};function Ia(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(),c=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(c,e)),t===s&&e===c&&(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(c){return n[c]=s[c]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var ht=function(){return ht=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},ht.apply(this,arguments)},zd=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},np=300;function rp(n,t){var e={config:ht(ht({},sr),We.defaultConfig),l10n:Sa};e.parseDate=Pa({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=y,e._positionCalendar=$n,e.changeMonth=_,e.changeYear=re,e.clear=I,e.close=k,e.onMouseOver=we,e._createElement=Ce,e.createDay=ae,e.destroy=j,e.isEnabled=Z,e.jumpToDate=K,e.updateValue=_n,e.open=He,e.redraw=wo,e.set=Qd,e.setDate=eh,e.toggle=ih;function r(){e.utils={getDaysInMonth:function(f,b){return f===void 0&&(f=e.currentMonth),b===void 0&&(b=e.currentYear),f===1&&(b%4===0&&b%100!==0||b%400===0)?29:e.l10n.daysInMonth[f]}}}function i(){e.element=e.input=n,e.isOpen=!1,ot(),cr(),nh(),th(),r(),e.isMobile||oe(),$(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),_n(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&$n(),Fe("onReady")}function o(){var f;return((f=e.calendarContainer)===null||f===void 0?void 0:f.getRootNode()).activeElement||document.activeElement}function a(f){return f.bind(e)}function s(){var f=e.config;f.weekNumbers===!1&&f.showMonths===1||f.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 b=(e.days.offsetWidth+1)*f.showMonths;e.daysContainer.style.width=b+"px",e.calendarContainer.style.width=b+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function c(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||zt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=Ia(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&sh(f);var N=e._input.value;p(),_n(),e._input.value!==N&&e._debouncedChange()}function u(f,b){return f%12+12*$t(b===e.l10n.amPM[1])}function h(f){switch(f%24){case 0:case 12:return 12;default:return f%12}}function p(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var f=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,b=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(f=u(f,e.amPM.textContent));var N=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&zt(e.latestSelectedDateObj,e.config.minDate,!0)===0,W=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&zt(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 Q=ka(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=ka(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),ne=ka(f,b,M);if(ne>ye&&ne<Q){var De=$d(Q);f=De[0],b=De[1],M=De[2]}}else{if(W){var te=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,te.getHours()),f===te.getHours()&&(b=Math.min(b,te.getMinutes())),b===te.getMinutes()&&(M=Math.min(M,te.getSeconds()))}if(N){var de=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,de.getHours()),f===de.getHours()&&b<de.getMinutes()&&(b=de.getMinutes()),b===de.getMinutes()&&(M=Math.max(M,de.getSeconds()))}}w(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&w(b.getHours(),b.getMinutes(),b.getSeconds())}function w(f,b,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(f%24,b,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=ut(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=ut(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ut(M)))}function T(f){var b=jt(f),M=parseInt(b.value)+(f.delta||0);(M/1e3>1||f.key==="Enter"&&!/[^\d]/.test(M.toString()))&&re(M)}function C(f,b,M,N){if(b instanceof Array)return b.forEach(function(W){return C(f,W,M,N)});if(f instanceof Array)return f.forEach(function(W){return C(W,b,M,N)});f.addEventListener(b,M,N),e._handlers.push({remove:function(){return f.removeEventListener(b,M,N)}})}function x(){Fe("onChange")}function $(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(N){return C(N,"click",e[M])})}),e.isMobile){rh();return}var f=Hc(_e,50);if(e._debouncedChange=Hc(x,np),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&we(jt(M))}),C(e._input,"keydown",pe),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",pe),!e.config.inline&&!e.config.static&&C(window,"resize",f),window.ontouchstart!==void 0?C(window.document,"touchstart",X):C(window.document,"mousedown",X),C(window.document,"focus",X,{capture:!0}),e.config.clickOpens===!0&&(C(e._input,"focus",e.open),C(e._input,"click",e.open)),e.daysContainer!==void 0&&(C(e.monthNav,"click",ah),C(e.monthNav,["keyup","increment"],T),C(e.daysContainer,"click",zc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return jt(M).select()};C(e.timeContainer,["increment"],c),C(e.timeContainer,"blur",c,{capture:!0}),C(e.timeContainer,"click",G),C([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&C(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&C(e.amPM,"click",function(M){c(M)})}e.config.allowInput&&C(e._input,"blur",ue)}function K(f,b){var M=f!==void 0?e.parseDate(f):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),N=e.currentYear,W=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(Q){Q.message="Invalid date supplied: "+M,e.config.errorHandler(Q)}b&&e.currentYear!==N&&(Fe("onYearChange"),se()),b&&(e.currentYear!==N||e.currentMonth!==W)&&Fe("onMonthChange"),e.redraw()}function G(f){var b=jt(f);~b.className.indexOf("arrow")&&ee(f,b.classList.contains("arrowUp")?1:-1)}function ee(f,b,M){var N=f&&jt(f),W=M||N&&N.parentNode&&N.parentNode.firstChild,Q=Fa("increment");Q.delta=b,W&&W.dispatchEvent(Q)}function oe(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Ce("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(l()),e.innerContainer=Ce("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=D(),M=b.weekWrapper,N=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=N,e.weekWrapper=M}e.rContainer=Ce("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Ce("div","flatpickr-days"),e.daysContainer.tabIndex=-1),Y(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),dt(e.calendarContainer,"rangeMode",e.config.mode==="range"),dt(e.calendarContainer,"animate",e.config.animate===!0),dt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var W=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&&(!W&&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 Q=Ce("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(Q,e.element),Q.appendChild(e.element),e.altInput&&Q.appendChild(e.altInput),Q.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function ae(f,b,M,N){var W=Z(b,!0),Q=Ce("span",f,b.getDate().toString());return Q.dateObj=b,Q.$i=N,Q.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&zt(b,e.now)===0&&(e.todayDateElem=Q,Q.classList.add("today"),Q.setAttribute("aria-current","date")),W?(Q.tabIndex=-1,Ya(b)&&(Q.classList.add("selected"),e.selectedDateElem=Q,e.config.mode==="range"&&(dt(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),dt(Q,"endRange",e.selectedDates[1]&&zt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&Q.classList.add("inRange")))):Q.classList.add("flatpickr-disabled"),e.config.mode==="range"&&oh(b)&&!Ya(b)&&Q.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&N%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Fe("onDayCreate",Q),Q}function Pe(f){f.focus(),e.config.mode==="range"&&we(f)}function Te(f){for(var b=f>0?0:e.config.showMonths-1,M=f>0?e.config.showMonths:-1,N=b;N!=M;N+=f)for(var W=e.daysContainer.children[N],Q=f>0?0:W.children.length-1,ye=f>0?W.children.length:-1,ne=Q;ne!=ye;ne+=f){var De=W.children[ne];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function ce(f,b){for(var M=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,N=b>0?e.config.showMonths:-1,W=b>0?1:-1,Q=M-e.currentMonth;Q!=N;Q+=W)for(var ye=e.daysContainer.children[Q],ne=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,te=ne;te>=0&&te<De&&te!=(b>0?De:-1);te+=W){var de=ye.children[te];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-te)>=Math.abs(b))return Pe(de)}e.changeMonth(W),F(Te(W),0)}function F(f,b){var M=o(),N=V(M||document.body),W=f!==void 0?f:N?M:e.selectedDateElem!==void 0&&V(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&V(e.todayDateElem)?e.todayDateElem:Te(b>0?1:-1);W===void 0?e._input.focus():N?ce(W,b):Pe(W)}function z(f,b){for(var M=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((b-1+12)%12,f),W=e.utils.getDaysInMonth(b,f),Q=window.document.createDocumentFragment(),ye=e.config.showMonths>1,ne=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",te=N+1-M,de=0;te<=N;te++,de++)Q.appendChild(ae("flatpickr-day "+ne,new Date(f,b-1,te),te,de));for(te=1;te<=W;te++,de++)Q.appendChild(ae("flatpickr-day",new Date(f,b,te),te,de));for(var Ae=W+1;Ae<=42-M&&(e.config.showMonths===1||de%7!==0);Ae++,de++)Q.appendChild(ae("flatpickr-day "+De,new Date(f,b+1,Ae%W),Ae,de));var dn=Ce("div","dayContainer");return dn.appendChild(Q),dn}function Y(){if(e.daysContainer!==void 0){go(e.daysContainer),e.weekNumbers&&go(e.weekNumbers);for(var f=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),f.appendChild(z(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&we()}}function se(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(N){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var M=Ce("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,b).getMonth().toString(),M.textContent=vo(b,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===b&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var f=Ce("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Ce("span","cur-month"):(e.monthsDropdownContainer=Ce("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),C(e.monthsDropdownContainer,"change",function(ye){var ne=jt(ye),De=parseInt(ne.value,10);e.changeMonth(De-e.currentMonth),Fe("onMonthChange")}),se(),M=e.monthsDropdownContainer);var N=yo("cur-year",{tabindex:"-1"}),W=N.getElementsByTagName("input")[0];W.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&W.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(W.setAttribute("max",e.config.maxDate.getFullYear().toString()),W.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var Q=Ce("div","flatpickr-current-month");return Q.appendChild(M),Q.appendChild(N),b.appendChild(Q),f.appendChild(b),{container:f,yearElement:W,monthElement:M}}function B(){go(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var f=e.config.showMonths;f--;){var b=g();e.yearElements.push(b.yearElement),e.monthElements.push(b.monthElement),e.monthNav.appendChild(b.container)}e.monthNav.appendChild(e.nextMonthNav)}function l(){return e.monthNav=Ce("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Ce("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Ce("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,B(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(dt(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(dt(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],Eo(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=Ia(e.config);e.timeContainer=Ce("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Ce("span","flatpickr-time-separator",":"),M=yo("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var N=yo("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=N.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():f.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(b),e.timeContainer.appendChild(N),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var W=yo("flatpickr-second");e.secondElement=W.getElementsByTagName("input")[0],e.secondElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():f.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(Ce("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(W)}return e.config.time_24hr||(e.amPM=Ce("span","flatpickr-am-pm",e.l10n.amPM[$t((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?go(e.weekdayContainer):e.weekdayContainer=Ce("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Ce("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return E(),e.weekdayContainer}function E(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=zd(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=zd(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
|
|
4
4
|
<span class='flatpickr-weekday'>
|
|
5
5
|
`+b.join("</span><span class='flatpickr-weekday'>")+`
|
|
6
6
|
</span>
|
|
7
|
-
`}}function D(){e.calendarContainer.classList.add("hasWeeks");var f=Se("div","flatpickr-weekwrapper");f.appendChild(Se("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Se("div","flatpickr-weeks");return f.appendChild(b),{weekWrapper:f,weekNumbers:b}}function _(f,b){b===void 0&&(b=!0);var M=b?f:f-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,Fe("onYearChange"),se()),Y(),Fe("onMonthChange"),Eo())}function I(f,b){if(f===void 0&&(f=!0),b===void 0&&(b=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=Ra(e.config),L=M.hours,q=M.minutes,Q=M.seconds;w(L,q,Q)}e.redraw(),f&&Fe("onChange")}function P(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Fe("onClose")}function j(){e.config!==void 0&&Fe("onDestroy");for(var f=e._handlers.length;f--;)e._handlers[f].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 b=e.calendarContainer.parentNode;if(b.lastChild&&b.removeChild(b.lastChild),b.parentNode){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}}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 O(f){return e.calendarContainer.contains(f)}function X(f){if(e.isOpen&&!e.config.inline){var b=jt(f),M=O(b),L=b===e.input||b===e.altInput||e.element.contains(b)||f.path&&f.path.indexOf&&(~f.path.indexOf(e.input)||~f.path.indexOf(e.altInput)),q=!L&&!M&&!O(f.relatedTarget),Q=!e.config.ignoredFocusElements.some(function(ye){return ye.contains(b)});q&&Q&&(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&&l(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function re(f){if(!(!f||e.config.minDate&&f<e.config.minDate.getFullYear()||e.config.maxDate&&f>e.config.maxDate.getFullYear())){var b=f,M=e.currentYear!==b;e.currentYear=b||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(),Fe("onYearChange"),se())}}function Z(f,b){var M;b===void 0&&(b=!0);var L=e.parseDate(f,void 0,b);if(e.config.minDate&&L&&zt(L,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&L&&zt(L,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(L===void 0)return!1;for(var q=!!e.config.enable,Q=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,ye=0,ne=void 0;ye<Q.length;ye++){if(ne=Q[ye],typeof ne=="function"&&ne(L))return q;if(ne instanceof Date&&L!==void 0&&ne.getTime()===L.getTime())return q;if(typeof ne=="string"){var De=e.parseDate(ne,void 0,!0);return De&&De.getTime()===L.getTime()?q:!q}else if(typeof ne=="object"&&L!==void 0&&ne.from&&ne.to&&L.getTime()>=ne.from.getTime()&&L.getTime()<=ne.to.getTime())return q}return!q}function V(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function ue(f){var b=f.target===e._input,M=e._input.value.trimEnd()!==ja();b&&M&&!(f.relatedTarget&&O(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function pe(f){var b=jt(f),M=e.config.wrap?n.contains(b):b===e._input,L=e.config.allowInput,q=e.isOpen&&(!L||!M),Q=e.config.inline&&M&&!L;if(f.keyCode===13&&M){if(L)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(O(b)||q||Q){var ye=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:ye?(f.preventDefault(),l(),Fa()):jc(f);break;case 27:f.preventDefault(),Fa();break;case 8:case 46:M&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!ye&&!M){f.preventDefault();var ne=o();if(e.daysContainer!==void 0&&(L===!1||ne&&V(ne))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),F(Te(1),0)):F(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var te=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-te),F(Te(1),0)):ye||F(void 0,te*7):b===e.currentYearElement?re(e.currentYear-te):e.config.enableTime&&(!ye&&e.hourElement&&e.hourElement.focus(),l(f),e._debouncedChange());break;case 9:if(ye){var de=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ut){return Ut}),Ae=de.indexOf(b);if(Ae!==-1){var dn=de[Ae+(f.shiftKey?-1:1)];f.preventDefault(),(dn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&f.shiftKey&&(f.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&b===e.amPM)switch(f.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],p(),_n();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),_n();break}(M||O(b))&&Fe("onKeyDown",f)}function we(f,b){if(b===void 0&&(b="flatpickr-day"),!(e.selectedDates.length!==1||f&&(!f.classList.contains(b)||f.classList.contains("flatpickr-disabled")))){for(var M=f?f.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),L=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),q=Math.min(M,e.selectedDates[0].getTime()),Q=Math.max(M,e.selectedDates[0].getTime()),ye=!1,ne=0,De=0,te=q;te<Q;te+=$d.DAY)Z(new Date(te),!0)||(ye=ye||te>q&&te<Q,te<L&&(!ne||te>ne)?ne=te:te>L&&(!De||te<De)&&(De=te));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(Ae){var dn=Ae.dateObj,Ut=dn.getTime(),ai=ne>0&&Ut<ne||De>0&&Ut>De;if(ai){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Cr){Ae.classList.remove(Cr)});return}else if(ye&&!ai)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Cr){Ae.classList.remove(Cr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),L<M&&Ut===L?Ae.classList.add("startRange"):L>M&&Ut===L&&Ae.classList.add("endRange"),Ut>=ne&&(De===0||Ut<=De)&&Fd(Ut,L,M)&&Ae.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&$n()}function He(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var M=jt(f);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Fe("onOpen");return}else if(e._input.disabled||e.config.inline)return;var L=e.isOpen;e.isOpen=!0,L||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Fe("onOpen"),$n(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(f===void 0||!e.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Ve(f){return function(b){var M=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),L=e.config["_"+(f==="min"?"max":"min")+"Date"];M!==void 0&&(e[f==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(q){return Z(q)}),!e.selectedDates.length&&f==="min"&&y(M),_n()),e.daysContainer&&(wo(),M!==void 0?e.currentYearElement[f]=M.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!L&&M!==void 0&&L.getFullYear()===M.getFullYear())}}function ot(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=ht(ht({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(de){e.config._enable=Uc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=Uc(de)}});var L=b.mode==="time";if(!b.dateFormat&&(b.enableTime||L)){var q=We.defaultConfig.dateFormat||sr.dateFormat;M.dateFormat=b.noCalendar||L?"H:i"+(b.enableSeconds?":S":""):q+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||L)&&!b.altFormat){var Q=We.defaultConfig.altFormat||sr.altFormat;M.altFormat=b.noCalendar||L?"h:i"+(b.enableSeconds?":S K":" K"):Q+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Ve("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Ve("max")});var ye=function(de){return function(Ae){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(Ae,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:ye("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:ye("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,b);for(var ne=0;ne<f.length;ne++)e.config[f[ne]]=e.config[f[ne]]===!0||e.config[f[ne]]==="true";Ta.filter(function(de){return e.config[de]!==void 0}).forEach(function(de){e.config[de]=ka(e.config[de]||[]).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 ne=0;ne<e.config.plugins.length;ne++){var De=e.config.plugins[ne](e)||{};for(var te in De)Ta.indexOf(te)>-1?e.config[te]=ka(De[te]).map(a).concat(e.config[te]):typeof b[te]>"u"&&(e.config[te]=De[te])}b.altInputClass||(e.config.altInputClass=Qt().className+" "+e.config.altInputClass),Fe("onParseConfig")}function Qt(){return e.config.wrap?n.querySelector("[data-input]"):n}function cr(){typeof e.config.locale!="object"&&typeof We.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ht(ht({},We.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?We.l10ns[e.config.locale]:void 0),Yn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Yn.l="("+e.l10n.weekdays.longhand.join("|")+")",Yn.M="("+e.l10n.months.shorthand.join("|")+")",Yn.F="("+e.l10n.months.longhand.join("|")+")",Yn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=ht(ht({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&We.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Fc(e),e.parseDate=Pa({config:e.config,l10n:e.l10n})}function $n(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Fe("onPreCalendarPosition");var b=f||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(hh,mh){return hh+mh.offsetHeight},0),L=e.calendarContainer.offsetWidth,q=e.config.position.split(" "),Q=q[0],ye=q.length>1?q[1]:null,ne=b.getBoundingClientRect(),De=window.innerHeight-ne.bottom,te=Q==="above"||Q!=="below"&&De<M&&ne.top>M,de=window.pageYOffset+ne.top+(te?-M-2:b.offsetHeight+2);if(dt(e.calendarContainer,"arrowTop",!te),dt(e.calendarContainer,"arrowBottom",te),!e.config.inline){var Ae=window.pageXOffset+ne.left,dn=!1,Ut=!1;ye==="center"?(Ae-=(L-ne.width)/2,dn=!0):ye==="right"&&(Ae-=L-ne.width,Ut=!0),dt(e.calendarContainer,"arrowLeft",!dn&&!Ut),dt(e.calendarContainer,"arrowCenter",dn),dt(e.calendarContainer,"arrowRight",Ut);var ai=window.document.body.offsetWidth-(window.pageXOffset+ne.right),Cr=Ae+L>window.document.body.offsetWidth,oh=ai+L>window.document.body.offsetWidth;if(dt(e.calendarContainer,"rightMost",Cr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Cr)e.calendarContainer.style.left=Ae+"px",e.calendarContainer.style.right="auto";else if(!oh)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ai+"px";else{var za=oi();if(za===void 0)return;var ah=window.document.body.offsetWidth,sh=Math.max(0,ah/2-L/2),ch=".flatpickr-calendar.centerMost:before",lh=".flatpickr-calendar.centerMost:after",uh=za.cssRules.length,dh="{left:"+ne.left+"px;right:auto;}";dt(e.calendarContainer,"rightMost",!1),dt(e.calendarContainer,"centerMost",!0),za.insertRule(ch+","+lh+dh,uh),e.calendarContainer.style.left=sh+"px",e.calendarContainer.style.right="auto"}}}}function oi(){for(var f=null,b=0;b<document.styleSheets.length;b++){var M=document.styleSheets[b];if(M.cssRules){try{M.cssRules}catch{continue}f=M;break}}return f??bo()}function bo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function wo(){e.config.noCalendar||e.isMobile||(se(),Eo(),Y())}function Fa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function jc(f){f.preventDefault(),f.stopPropagation();var b=function(de){return de.classList&&de.classList.contains("flatpickr-day")&&!de.classList.contains("flatpickr-disabled")&&!de.classList.contains("notAllowed")},M=Hc(jt(f),b);if(M!==void 0){var L=M,q=e.latestSelectedDateObj=new Date(L.dateObj.getTime()),Q=(q.getMonth()<e.currentMonth||q.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=L,e.config.mode==="single")e.selectedDates=[q];else if(e.config.mode==="multiple"){var ye=$a(q);ye?e.selectedDates.splice(parseInt(ye),1):e.selectedDates.push(q)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=q,e.selectedDates.push(q),zt(q,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(de,Ae){return de.getTime()-Ae.getTime()}));if(p(),Q){var ne=e.currentYear!==q.getFullYear();e.currentYear=q.getFullYear(),e.currentMonth=q.getMonth(),ne&&(Fe("onYearChange"),se()),Fe("onMonthChange")}if(Eo(),Y(),_n(),!Q&&e.config.mode!=="range"&&e.config.showMonths===1?Ce(L):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 De=e.config.mode==="single"&&!e.config.enableTime,te=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||te)&&Fa()}x()}}var Do={locale:[cr,E],showMonths:[H,s,v],minDate:[W],maxDate:[W],positionElement:[Vc],clickOpens:[function(){e.config.clickOpens===!0?(S(e._input,"focus",e.open),S(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Zd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var M in f)Do[M]!==void 0&&Do[M].forEach(function(L){return L()})}else e.config[f]=b,Do[f]!==void 0?Do[f].forEach(function(L){return L()}):Ta.indexOf(f)>-1&&(e.config[f]=ka(b));e.redraw(),_n(!0)}function zc(f,b){var M=[];if(f instanceof Array)M=f.map(function(L){return e.parseDate(L,b)});else if(f instanceof Date||typeof f=="number")M=[e.parseDate(f,b)];else if(typeof f=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(f,b)];break;case"multiple":M=f.split(e.config.conjunction).map(function(L){return e.parseDate(L,b)});break;case"range":M=f.split(e.l10n.rangeSeparator).map(function(L){return e.parseDate(L,b)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(L){return L instanceof Date&&Z(L,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(L,q){return L.getTime()-q.getTime()})}function Jd(f,b,M){if(b===void 0&&(b=!1),M===void 0&&(M=e.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return e.clear(b);zc(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),W(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),_n(b),b&&Fe("onChange")}function Uc(f){return f.slice().map(function(b){return typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b}).filter(function(b){return b})}function Xd(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var f=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);f&&zc(f,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 Qd(){if(e.input=Qt(),!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=Se(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"),Vc()}function Vc(){e._positionElement=e.config.positionElement||e._input}function eh(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Se("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=f,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="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{}S(e.mobileInput,"change",function(b){e.setDate(jt(b).value,!1,e.mobileFormatStr),Fe("onChange"),Fe("onClose")})}function th(f){if(e.isOpen===!0)return e.close();e.open(f)}function Fe(f,b){if(e.config!==void 0){var M=e.config[f];if(M!==void 0&&M.length>0)for(var L=0;M[L]&&L<M.length;L++)M[L](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Ya("change")),e.input.dispatchEvent(Ya("input")))}}function Ya(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function $a(f){for(var b=0;b<e.selectedDates.length;b++){var M=e.selectedDates[b];if(M instanceof Date&&zt(M,f)===0)return""+b}return!1}function nh(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:zt(f,e.selectedDates[0])>=0&&zt(f,e.selectedDates[1])<=0}function Eo(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(f,b){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=vo(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),f.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 ja(f){var b=f||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,b)}).filter(function(M,L,q){return e.config.mode!=="range"||e.config.enableTime||q.indexOf(M)===L}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function _n(f){f===void 0&&(f=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=ja(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=ja(e.config.altFormat)),f!==!1&&Fe("onValueUpdate")}function rh(f){var b=jt(f),M=e.prevMonthNav.contains(b),L=e.nextMonthNav.contains(b);M||L?_(M?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function ih(f){f.preventDefault();var b=f.type==="keydown",M=jt(f),L=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]);var q=parseFloat(L.getAttribute("min")),Q=parseFloat(L.getAttribute("max")),ye=parseFloat(L.getAttribute("step")),ne=parseInt(L.value,10),De=f.delta||(b?f.which===38?1:-1:0),te=ne+ye*De;if(typeof L.value<"u"&&L.value.length===2){var de=L===e.hourElement,Ae=L===e.minuteElement;te<q?(te=Q+te+$t(!de)+($t(de)&&$t(!e.amPM)),Ae&&ee(void 0,-1,e.hourElement)):te>Q&&(te=L===e.hourElement?te-Q-$t(!e.amPM):q,Ae&&ee(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?te+ne===23:Math.abs(te-ne)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),L.value=ut(te)}}return i(),e}function ii(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=Qm(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 ii(this,n)},HTMLElement.prototype.flatpickr=function(n){return ii([this],n)});var We=function(n,t){return typeof n=="string"?ii(window.document.querySelectorAll(n),t):n instanceof Node?ii([n],t):ii(n,t)};We.defaultConfig={};We.l10ns={en:ht({},Ca),default:ht({},Ca)};We.localize=function(n){We.l10ns.default=ht(ht({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=ht(ht({},We.defaultConfig),n)};We.parseDate=Pa({});We.formatDate=Fc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ii(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=We);var zd=We;var xa=class{constructor(t,e){this.dateInputEl=t;A(this,"minDate");A(this,"maxDate");A(this,"defaultReservationDays");A(this,"hasPrices",!1);A(this,"prices",{});A(this,"availability",{});A(this,"disabledDates",[]);A(this,"selectedStartDate");A(this,"selectedEndDate");A(this,"config");A(this,"instance");A(this,"destroyInstance");A(this,"currentDate");A(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??J.getCurrentDate(),defaultEndDate:e.defaultEndDate??J.getCurrentDate(),startWithEmptyDates:r},this.currentDate=J.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=J.toJSDate(t),r=this.selectedEndDate?J.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof Ma.Core?this.instance.setStartDate(new ge(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?J.toJSDate(this.selectedStartDate):J.toJSDate(t),r=J.toJSDate(t);this.selectedEndDate=t,this.instance instanceof Ma.Core?this.instance.setEndDate(new ge(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=J.toJSDate(t),i=J.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 ge(this.config.defaultStartDate.toString()),t.endDate=new ge(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:Qu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new ge(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[_a,Ea,Da],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:l}=o.detail,u=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&u&&this.prices[u]){let h=this.prices[u],p=l.querySelector(`.${ua}`)||document.createElement("span");p.className=ua,p.textContent=`${h.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",l.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=J.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=J.fromString(s.format("YYYY-MM-DD"));let l={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};Je("date:changed",l)})}},r=new Ma.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=Ju(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:ed,locale:{months:{shorthand:e,longhand:e}},zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(r.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(r,{onChange:o=>{let a=G("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=null,Je("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=J.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(Je("date:changed",s),a){let l=this.formatDate(o[0]),u=this.formatDate(o[1]);a.textContent=`${l} - ${u}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(J.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,Je("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,l)=>{let u=l.dateObj,h=J.fromJSDate(u),p=J.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],w=document.createElement("span");w.style.marginTop="2px",w.style.color="#c64509",w.style.fontSize="10px",w.style.fontWeight="bold",w.className=ua,w.textContent=`${y.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,l.style.display="flex",l.style.flexDirection="column",l.style.alignItems="center",l.style.justifyContent="center",l.style.lineHeight="1.1",l.appendChild(w)}}});let i=zd(this.dateInputEl,r);this.instance=i,this.destroyInstance=()=>i.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=J.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return qe==="en"?`${r}/${i}/${o}`:qe==="fr-FR"||qe==="de"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var Aa=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"nightsCountElement");A(this,"startDateElement");A(this,"endDateElement");A(this,"dateElement");A(this,"roomsWrapperElement");A(this,"roomElementTemplate");A(this,"addRoomElement");A(this,"rooms",[]);A(this,"includePrices",td);A(this,"populateCalendarInput",async()=>{if(!this.dateElement){console.error("Date element not found");return}let t=new xa(this.dateElement,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,defaultStartDate:B.startDate||Tr,defaultEndDate:B.endDate||ei});if(t.setMinimumDate(Tr),t.setMaximumDate(ei),t.includePrices(this.includePrices),this.includePrices){let e=await Hd([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});rr("date:changed",e=>{B.updateStartDate(J.fromString(e.startDate)),B.updateEndDate(J.fromString(e.endDate))}),this.element=G("details-box"),this.nightsCountElement=G("nights",this.element),this.startDateElement=G("start-date",this.element),this.endDateElement=G("end-date",this.element),this.dateElement=G("date-element",this.element),this.roomsWrapperElement=G("room-box-wrapper",this.element),this.roomElementTemplate=G("room-box",this.element),this.addRoomElement=G("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){Rt(()=>{this.startDateElement.textContent=B.startDate?J.formatForDisplay(B.startDate):"?"}),Rt(()=>{this.endDateElement.textContent=B.endDate?J.formatForDisplay(B.endDate):"?"}),Rt(()=>{this.nightsCountElement.textContent=`${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}`}),Rt(()=>{let t=document.createDocumentFragment();B.rooms.forEach((r,i)=>{let o=Yt(this.roomElementTemplate,!0),a=G("room",o);a.textContent=`${Pe("apartment")} ${i+1}`;let s=G("categories-wrapper",o),l=G("age-category",s),u=document.createDocumentFragment();r.forEach(p=>{let y=Yt(l,!0),w=G("category-name",y);w.textContent=p.name;let T=G("input",y);po(T,p.value.toString()),lt(y,"click",S=>{S.preventDefault();let x=i;switch(id(S.target)){case"decrement":if(p.isAdult){if(r.filter(W=>W.isAdult).reduce((W,K)=>W+K.value,0)>1&&p.value>0){let W=B.rooms.map((K,ee)=>ee===x?K.map(oe=>oe.ageCategoryId===p.ageCategoryId?{...oe,value:oe.value-1}:{...oe}):K);B.updateRooms(W)}}else if(p.value>0){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value-1}:{...ee}):W);B.updateRooms($)}break;case"increment":if(this.computations(r).hasCapacity){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value+1}:{...ee}):W);B.updateRooms($)}break}},{once:!1}),u.appendChild(y)}),s.innerHTML="",s.appendChild(u);let h=G("remove-room-button",o);h&&(h.classList.toggle("hide",B.rooms.length<=1),lt(h,"click",p=>{p.preventDefault();let y=B.rooms.filter((w,T)=>T!==i);B.updateRooms(y)})),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${B.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&B.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${B.rooms.length} >= max allowed ${e}`),this.addRoomElement.classList.add("hide")):e<=0?(console.log(`<<debug>> Max allowed rooms is non-positive (${e}), using available rooms ${this.parentComponent.apartmentProperties.availableRooms} as limit`),B.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${B.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${B.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),lt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};if(B.rooms.length<e){let i=B.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}}),o=[...B.rooms,i];B.updateRooms(o)}})}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}computations(t){let e=t.some(a=>a.value>0),r=t.reduce((a,s)=>a+s.value,0),i=r<this.parentComponent.apartmentProperties.capacity,o=t.filter(a=>a.isAdult).reduce((a,s)=>a+s.value,0);return{hasOccupants:e,totalOccupants:r,hasCapacity:i,totalAdults:o}}};var Ud=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/images/getUrls",e,n)};function Vd(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var Yc=Ze({}),qd={width:160,height:160};async function Wd(n,t){if(t.every(i=>Yc.value[i]))return t.map(i=>Yc.value[i]).flat();let e=await Ud(n,{Images:t.map(i=>({ImageId:i,Width:qd.width,Height:qd.height,ResizeMode:"Cover"}))}),r=Vd(e);return r.forEach(i=>{Yc.value[i.imageId]=i}),r}var La=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"productsWrapperElement");A(this,"productTemplateElement");A(this,"productTemplateHTML");A(this,"showMoreButtonElement");this.element=G("options-box"),this.productsWrapperElement=G("options-list",this.element),this.productTemplateElement=G("option-wrapper",this.element),this.productTemplateHTML=this.productTemplateElement.outerHTML,this.showMoreButtonElement=G("more-button",this.element)}init(){try{this.updateDOM(),lt(this.showMoreButtonElement,"click",()=>{let t=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!t)})}catch(t){console.error("Error initializing OptionsSection:",t)}}refresh(){try{this.updateDOM()}catch(t){console.error("Error refreshing OptionsSection:",t)}}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){let t=document.createDocumentFragment(),e=[...B.products].sort((r,i)=>{if(r.ordering!==i.ordering)return(r.ordering??0)-(i.ordering??0);let o=r.name,a=i.name;return o<a?-1:o>a?1:(r.ordering===i.ordering,0)});e.forEach((r,i)=>{let o=document.createElement("div");o.innerHTML=this.productTemplateHTML;let a=o.firstElementChild;a.removeAttribute("id");let s=G("name",a);s.textContent=r.name||"";let l=G("price",a);l.textContent=r.price.toLocaleString(qe,{style:"currency",currency:"EUR"});let u=G("label",a);u.textContent=Pe(`chargingMode:${r.chargingMode}`),Wd(this.parentComponent.apartmentProperties.enterpriseId,r.imageIds).then(p=>{let y=G("image",a),w=p[0]?.url;y&&w&&(y.src=w)});let h=G("checkbox",a);lt(h,"change",()=>{let p=mo(h),y=B.products.map(w=>w.id===r.id?{...w,selected:p==="true"}:w);B.updateProducts(y)}),a.classList.toggle("hide",i>3),t.appendChild(a)}),xc(this.productsWrapperElement),this.productsWrapperElement.appendChild(t),this.showMoreButtonElement.classList.toggle("hide",e.length<=4)}showMoreProducts(t=4){let e=this.productsWrapperElement.querySelectorAll(`${rd(this.productTemplateElement)}.hide`);return e.forEach((r,i)=>{i<t&&r.classList.toggle("hide",!1)}),e.length>t}};var Gd=(n,t)=>{let e=`${le.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return fetch(e,r).then(o=>o.json())};var Na=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"modalContent");A(this,"modalBg");A(this,"openModalBtn");A(this,"closeModalBtn");A(this,"fNameInput");A(this,"lNameInput");A(this,"emailInput");A(this,"phoneInput");A(this,"countryInput");A(this,"notesInput");A(this,"submitPaymentBtn");A(this,"customer",null);this.element=G("payment-modal"),this.modalContent=G("modal-content",this.element),this.modalBg=G("modal-bg",this.element),this.openModalBtn=G("open-modal"),this.closeModalBtn=G("close-modal"),this.fNameInput=G("fname-input",this.element),this.lNameInput=G("lname-input",this.element),this.emailInput=G("email-input",this.element),this.phoneInput=G("phone-input",this.element),this.countryInput=G("country-input",this.element),this.notesInput=G("notes-input",this.element),this.submitPaymentBtn=G("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){lt(this.openModalBtn,"click",()=>{this.openModalBtn.hasAttribute("disabled")||(this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"}))}),this.submitPaymentBtn?lt(this.submitPaymentBtn,"click",t=>{t.preventDefault(),this.handleSubmit()}):console.error("Submit Payment button not found in the DOM.")}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),t?(this.element.style.display="flex",this.element.style.opacity="1",this.modalContent.style.opacity="1",this.element.querySelectorAll("div").forEach(e=>{e.style.opacity="1"})):(this.element.style.opacity="0",this.element.style.display="none")}validateInputs(){if(!this.fNameInput.value||!this.lNameInput.value||!this.emailInput.value||!this.phoneInput.value||!this.countryInput.value)throw new Error("First name, last name, email, phone, and nationality are required.");if(!this.emailInput.checkValidity())throw new Error("Invalid email format.");if(!this.phoneInput.checkValidity())throw new Error("Invalid phone number format. Only numbers and spaces are allowed.");if(!this.countryInput.value)throw new Error("Country is required.")}async handleSubmit(){if(!B.startDate||!B.endDate)throw new Error("Start date and end date are required to submit the payment form.");try{this.validateInputs()}catch(s){console.error("Validation error:",s),alert(s instanceof Error?s.message:"An unexpected error occurred.");return}let{startDate:t,endDate:e}={startDate:B.startDate,endDate:B.endDate};this.customer={Email:this.emailInput.value,FirstName:this.fNameInput.value,LastName:this.lNameInput.value,Telephone:this.phoneInput.value,NationalityCode:this.countryInput.value,SendMarketingEmails:!1};let r={Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:B.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:B.couponCode||void 0,RateId:B.selectedRateId||"",AdultCount:s.filter(l=>l.isAdult).reduce((l,u)=>l+u.value,0),ChildCount:s.filter(l=>!l.isAdult).reduce((l,u)=>l+u.value,0),ProductIds:B.selectedProducts.map(l=>l.id),Notes:this.notesInput.value||""}))};console.log("Payload for reservation group:",r);let i=JSON.stringify(r,null,2);console.log("JSON Payload:",i);let o=this.submitPaymentBtn.textContent?.trim()??Pe("proceedToPayment");this.submitPaymentBtn.textContent=Pe("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await Gd(this.parentComponent.apartmentProperties.enterpriseId,r);if(console.log("Reservation Response:",a),"PaymentRequestId"in a&&a.PaymentRequestId){let l=Dn().iso639,u=Xu(l),h=new URL(window.location.href);h.pathname=l==="fr"?"/reservation-confirmee":`/${l}/confirmed-reservation`;let p=`https://app.mews.com/navigator/payment-requests/detail/${a.PaymentRequestId}?ccy=EUR&language=${encodeURIComponent(u)}&returnUrl=${btoa(h.toString())}`;console.log("Payment URL:",p),window.open(p,"_blank")}else if("Id"in a&&a.Id){console.log("Free reservation created successfully:",a);let l=Dn().iso639,u=new URL(window.location.href);u.pathname=l==="fr"?"/reservation-confirmee":`/${l}/confirmed-reservation`,u.searchParams.set("reservationId",a.Id),console.log("Confirmation URL:",u.toString()),window.location.href=u.toString()}else{this.submitPaymentBtn.classList.remove("is-disabled"),this.submitPaymentBtn.textContent=o;let s="Message"in a&&a.Message?a.Message:"Reservation could not be created. Please try again later or contact Support.";console.error("Reservation creation failed:",a),alert(s);return}}};var Kd=(n,t)=>{let e=`${le.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var Oa=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"summaryItemWrapperElement");A(this,"summaryItemElement");A(this,"itemNameTemplateElement");A(this,"itemRowTemplateElement");A(this,"totalPriceElement");A(this,"taxElement");A(this,"submitElement");A(this,"couponInputElement");A(this,"couponApplyElement");A(this,"statusTextElement");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.element=G("summary-box"),this.summaryItemWrapperElement=G("summary-items-wrapper",this.element),this.summaryItemElement=G("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=G("name",this.summaryItemElement),this.itemRowTemplateElement=G("row",this.summaryItemElement),this.totalPriceElement=G("total",this.element),this.taxElement=G("tax",this.element),this.submitElement=G("submit",this.element),this.couponInputElement=G("coupon-input",this.element),this.couponApplyElement=G("apply-coupon",this.element),this.statusTextElement=G("status-text",this.element)}init(){this.updateDOM(),Je("loading:end",this.element)}refresh(){Je("loading:end",this.element)}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),Array.from(this.element.children).forEach(e=>{e instanceof HTMLDivElement&&e.classList.toggle("hide",!t)})}updateDOM(){lt(this.couponInputElement,"input",()=>{B.updateCouponCode(mo(this.couponInputElement))}),lt(this.couponApplyElement,"click",async t=>{t.preventDefault(),Je("loading:start",this.element),Kd(this.parentComponent.apartmentProperties.enterpriseId,{Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:B.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?Pe("couponValid"):Pe("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{Je("loading:start",this.element),await this.parentComponent.fetchReservationPricing(),console.log("Reservation pricing updated with voucher code")}catch(i){console.error("Error updating reservation pricing with voucher code:",i),this.statusTextElement.textContent=Pe("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=Pe("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{Je("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),Rt(()=>{this.couponInputElement.value!==B.couponCode&&po(this.couponInputElement,B.couponCode);let e=B.getReadonlyState().computed.summary;if(B.isFetching){ir(!0,this.element);return}ir(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=G("name",o),s=G("row",o),l=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=Yt(a,!0);p.textContent=`[${u} ${Pe("adults").toLowerCase()}${h>0?`, ${h} ${Pe("children").toLowerCase()}`:""}] x ${i.quantity}`,l.appendChild(p);let y=Yt(a,!0);y.textContent=`${i.pricing.avgPerNight.toLocaleString(qe,{style:"currency",currency:"EUR"})}/ ${Pe("night")}`,l.appendChild(y);let w=Yt(s,!0),T=G("label",w),S=G("price",w);if(T.textContent=`${Pe("pricingService")} (${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}):`,S.textContent=i.pricing.service.toLocaleString?.(qe,{style:"currency",currency:"EUR"})??null,l.appendChild(w),B.selectedProducts.length>0){let ce=Yt(s,!0),F=G("label",ce);G("price",ce).remove();let Y=B.selectedProducts.map(se=>se.name).join(", ");F.textContent=`${Pe("pricingProducts")} ${Y}`,l.appendChild(ce)}let x=Yt(s,!0),$=G("label",x);$.textContent=Pe("pricingProductsAndExtras");let W=G("price",x);W.textContent=i.pricing.products.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(x);let K=Yt(s,!0),ee=G("label",K);ee.textContent=Pe("pricingTaxes");let oe=G("price",K);oe.textContent=i.pricing.taxes.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(K);let ae=Yt(s,!0),Ce=G("label",ae);Ce.textContent=Pe("pricingSubtotal");let Te=G("price",ae);Te.textContent=i.pricing.subtotal.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(ae),o.innerHTML="",o.appendChild(l),this.summaryItemWrapperElement.appendChild(o)});let r=e.totals.taxes||0;this.taxElement.textContent=r>0?r.toLocaleString(qe,{style:"currency",currency:"EUR"}):"--",this.totalPriceElement.textContent=e.totals.grandTotal.toLocaleString(qe,{style:"currency",currency:"EUR"})})}};var Ha=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"tariffsWrapperElement");A(this,"tariffTemplateElement");this.element=G("offer-box"),this.tariffsWrapperElement=G("offers-list",this.element),this.tariffTemplateElement=G("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){Rt(()=>{if(B.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(B.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:B.computedRates.length,isFetching:B.isFetching});let t=document.createDocumentFragment(),e=B.computedRates.sort((a,s)=>{let l=a.price?.AverageAmountPerTimeUnit?.GrossValue||0,u=s.price?.AverageAmountPerTimeUnit?.GrossValue||0;return l-u}),r=B.selectedRateId,i=r!==null&&e.some(a=>a.id===r),o=i?r:e[0]?.id;!i&&o&&queueMicrotask(()=>B.updateSelectedRateId(o)),e.forEach(a=>{let s=Yt(this.tariffTemplateElement,!0);s.removeAttribute("id");let l=G("name",s);l.textContent=a.name;let u=G("description",s);u.textContent=a.description;let h=G("price",s),p=a.price?.AverageAmountPerTimeUnit?.GrossValue||0;h.textContent=p.toLocaleString(qe,{style:"currency",currency:"EUR"});let y=B.rates.find($=>$.id===a.id),w=G("label",s),T=G("discount-badge",s),S=G("discount-label",T);if(y)if(w.textContent=y.shortName,y.pricing?.DependentRatePricing){let $=y.pricing?.DependentRatePricing.RelativeAdjustment*100;$===0?T.classList.add("hide"):S.textContent=`${$>0?"+":""}${$}%`}else T.classList.add("hide");else w.classList.add("hide"),T.classList.add("hide");let x=G("radio-input",s);x.value=a.id,a.id===o&&(x.checked=!0,x.previousElementSibling?.classList.add("w--redirected-checked")),lt(x,"change",()=>{x.checked&&B.updateSelectedRateId(a.id)}),t.appendChild(s)}),this.tariffsWrapperElement.innerHTML="",this.tariffsWrapperElement.appendChild(t)})}};var Ba=class{constructor(t){A(this,"apartmentProperties");A(this,"detailsSection");A(this,"optionsSection");A(this,"tariffsSection");A(this,"summarySection");A(this,"paymentModal");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.apartmentProperties=t,B.setCmsApartmentData(t)}init(){Je("loading:start",document.body);let t=Ft.startDate?J.safeParsePlainDate(Ft.startDate):Tr,e=Ft.endDate?J.safeParsePlainDate(Ft.endDate):ei,r=t&&e?t.until(e).days:0,i=r>=1?t:Tr,o=r>=1?e:ei;i&&B.updateStartDate(i),o&&B.updateEndDate(o),this.fetchAPIData().then(()=>this.parseAPIData()).then(()=>this.initUIComponents()).catch(a=>{console.error("[ReservationComponent] fetchAPIData failed:",a),this.initUIComponents()}),console.log("#=> State:",B.getReadonlyState())}initUIComponents(){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);console.log("#=> Default Rate:",t),B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.computedRates[0]?.id||null),this.detailsSection=new Aa(this),this.detailsSection.init(),this.optionsSection=new La(this),this.optionsSection.toggleVisibility(!0),this.optionsSection.init(),this.tariffsSection=new Ha(this),this.tariffsSection.toggleVisibility(!0),this.tariffsSection.init(),this.summarySection=new Oa(this),this.summarySection.toggleVisibility(!0),this.summarySection.init(),this.paymentModal=new Na(this),this.paymentModal.toggleVisibility(!1),this.paymentModal.init(),this.initPricingButler(),this.initAvailabilityPricingUpdater(),Je("loading:end",document.body)}initPricingButler(){let t=(0,$c.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);Rt(()=>{let{rooms:e}=B,{startDate:r}=B,{endDate:i}=B,{selectedProducts:o}=B,{selectedRateId:a}=B,{couponCode:s}=B;if(console.log("[PricingButler] Dependencies changed:",{roomsCount:e.length,startDate:r?.toString(),endDate:i?.toString(),selectedProductsCount:o.length,selectedRateId:a,couponCode:s}),e.length===0){console.log("[PricingButler] No rooms set, skipping pricing update.");return}if(!r||!i){console.log("[PricingButler] Start date or end date is not set, skipping pricing update.");return}if(J.isBefore(r,i)){console.log("[PricingButler] Start date is after or equal to end date, skipping pricing update.");return}t()})}initAvailabilityPricingUpdater(){let t=(0,$c.default)(async()=>{try{await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),Je("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);Rt(()=>{Je("loading:start",document.body);let{startDate:e,endDate:r}={startDate:B.startDate,endDate:B.endDate};if(!e||!r){console.warn("Start date or end date is not set, skipping availability and pricing updates.");return}if(J.isBefore(e,r)){console.warn("Start date is after or equal to end date, skipping API requests.");return}t()}),Rt(()=>{Je("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i,restrictionMessage:o}={availabilities:B.availabilities,servicePricing:B.servicePricing,isAvailable:B.isAvailable,restrictionMessage:B.restrictionMessage};if(this.updateAvailabilityBanners(i,o),this.optionsSection&&this.optionsSection.toggleVisibility(i),this.tariffsSection&&this.tariffsSection.toggleVisibility(i),this.summarySection&&this.summarySection.toggleVisibility(i),r&&!B.selectedRateId&&B.computedRates.length>0){let a=B.rates.find(s=>s.isDefault||s.isBaseRate);B.updateSelectedRateId(a?.id||B.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await B.initializeResources(this.apartmentProperties.enterpriseId),await B.initializeRooms(),await B.fetchHotel(this.apartmentProperties.enterpriseId),await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(B.computedRates.length>0&&!B.selectedRateId){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}this.updateAvailabilityBanners(B.isAvailable,B.restrictionMessage),this.optionsSection&&(this.optionsSection.toggleVisibility(B.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(B.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(B.isAvailable),this.summarySection.refresh()),Je("loading:end",document.body)}updateAvailabilityBanners(t,e){let r=G("banner-box"),i=G("banner-box-restriction"),o=G("banner-restriction-text"),a=G("open-modal");a&&(!!e||!t?a.setAttribute("disabled",""):a.removeAttribute("disabled")),e?(o&&(o.textContent=e),i&&i.classList.remove("hide"),r&&r.classList.add("hide")):t?(r&&r.classList.add("hide"),i&&i.classList.add("hide")):(r&&r.classList.remove("hide"),i&&i.classList.add("hide"))}async fetchReservationPricing(){try{await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);return this.refreshUIComponents(),t}catch(t){throw console.error("Error fetching reservation pricing:",t),t}}handleDateChange(t,e){return t&&e&&xe.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&B.updateStartDate(t),e&&B.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function tp(){try{let n=window.WebflowCMSData_apartment;console.log("#=> Properties",n),new Ba(n).init()}catch(n){console.error("Error initializing reservation component",n)}}window.Webflow||(window.Webflow=[]);window.Webflow.push(async()=>{tp()});export{tp as initApparthotelsBookingTemplate};
|
|
7
|
+
`}}function D(){e.calendarContainer.classList.add("hasWeeks");var f=Ce("div","flatpickr-weekwrapper");f.appendChild(Ce("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Ce("div","flatpickr-weeks");return f.appendChild(b),{weekWrapper:f,weekNumbers:b}}function _(f,b){b===void 0&&(b=!0);var M=b?f:f-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,Fe("onYearChange"),se()),Y(),Fe("onMonthChange"),Eo())}function I(f,b){if(f===void 0&&(f=!0),b===void 0&&(b=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=Ia(e.config),N=M.hours,W=M.minutes,Q=M.seconds;w(N,W,Q)}e.redraw(),f&&Fe("onChange")}function k(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Fe("onClose")}function j(){e.config!==void 0&&Fe("onDestroy");for(var f=e._handlers.length;f--;)e._handlers[f].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 b=e.calendarContainer.parentNode;if(b.lastChild&&b.removeChild(b.lastChild),b.parentNode){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}}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 O(f){return e.calendarContainer.contains(f)}function X(f){if(e.isOpen&&!e.config.inline){var b=jt(f),M=O(b),N=b===e.input||b===e.altInput||e.element.contains(b)||f.path&&f.path.indexOf&&(~f.path.indexOf(e.input)||~f.path.indexOf(e.altInput)),W=!N&&!M&&!O(f.relatedTarget),Q=!e.config.ignoredFocusElements.some(function(ye){return ye.contains(b)});W&&Q&&(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&&c(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function re(f){if(!(!f||e.config.minDate&&f<e.config.minDate.getFullYear()||e.config.maxDate&&f>e.config.maxDate.getFullYear())){var b=f,M=e.currentYear!==b;e.currentYear=b||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(),Fe("onYearChange"),se())}}function Z(f,b){var M;b===void 0&&(b=!0);var N=e.parseDate(f,void 0,b);if(e.config.minDate&&N&&zt(N,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&N&&zt(N,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var W=!!e.config.enable,Q=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,ye=0,ne=void 0;ye<Q.length;ye++){if(ne=Q[ye],typeof ne=="function"&&ne(N))return W;if(ne instanceof Date&&N!==void 0&&ne.getTime()===N.getTime())return W;if(typeof ne=="string"){var De=e.parseDate(ne,void 0,!0);return De&&De.getTime()===N.getTime()?W:!W}else if(typeof ne=="object"&&N!==void 0&&ne.from&&ne.to&&N.getTime()>=ne.from.getTime()&&N.getTime()<=ne.to.getTime())return W}return!W}function V(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function ue(f){var b=f.target===e._input,M=e._input.value.trimEnd()!==$a();b&&M&&!(f.relatedTarget&&O(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function pe(f){var b=jt(f),M=e.config.wrap?n.contains(b):b===e._input,N=e.config.allowInput,W=e.isOpen&&(!N||!M),Q=e.config.inline&&M&&!N;if(f.keyCode===13&&M){if(N)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(O(b)||W||Q){var ye=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:ye?(f.preventDefault(),c(),Ba()):zc(f);break;case 27:f.preventDefault(),Ba();break;case 8:case 46:M&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!ye&&!M){f.preventDefault();var ne=o();if(e.daysContainer!==void 0&&(N===!1||ne&&V(ne))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),F(Te(1),0)):F(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var te=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-te),F(Te(1),0)):ye||F(void 0,te*7):b===e.currentYearElement?re(e.currentYear-te):e.config.enableTime&&(!ye&&e.hourElement&&e.hourElement.focus(),c(f),e._debouncedChange());break;case 9:if(ye){var de=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ut){return Ut}),Ae=de.indexOf(b);if(Ae!==-1){var dn=de[Ae+(f.shiftKey?-1:1)];f.preventDefault(),(dn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&f.shiftKey&&(f.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&b===e.amPM)switch(f.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],p(),_n();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),_n();break}(M||O(b))&&Fe("onKeyDown",f)}function we(f,b){if(b===void 0&&(b="flatpickr-day"),!(e.selectedDates.length!==1||f&&(!f.classList.contains(b)||f.classList.contains("flatpickr-disabled")))){for(var M=f?f.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),W=Math.min(M,e.selectedDates[0].getTime()),Q=Math.max(M,e.selectedDates[0].getTime()),ye=!1,ne=0,De=0,te=W;te<Q;te+=jd.DAY)Z(new Date(te),!0)||(ye=ye||te>W&&te<Q,te<N&&(!ne||te>ne)?ne=te:te>N&&(!De||te<De)&&(De=te));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(Ae){var dn=Ae.dateObj,Ut=dn.getTime(),si=ne>0&&Ut<ne||De>0&&Ut>De;if(si){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Cr){Ae.classList.remove(Cr)});return}else if(ye&&!si)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Cr){Ae.classList.remove(Cr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<M&&Ut===N?Ae.classList.add("startRange"):N>M&&Ut===N&&Ae.classList.add("endRange"),Ut>=ne&&(De===0||Ut<=De)&&Yd(Ut,N,M)&&Ae.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&$n()}function He(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var M=jt(f);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Fe("onOpen");return}else if(e._input.disabled||e.config.inline)return;var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Fe("onOpen"),$n(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(f===void 0||!e.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function qe(f){return function(b){var M=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),N=e.config["_"+(f==="min"?"max":"min")+"Date"];M!==void 0&&(e[f==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(W){return Z(W)}),!e.selectedDates.length&&f==="min"&&y(M),_n()),e.daysContainer&&(wo(),M!==void 0?e.currentYearElement[f]=M.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!N&&M!==void 0&&N.getFullYear()===M.getFullYear())}}function ot(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=ht(ht({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(de){e.config._enable=Vc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=Vc(de)}});var N=b.mode==="time";if(!b.dateFormat&&(b.enableTime||N)){var W=We.defaultConfig.dateFormat||sr.dateFormat;M.dateFormat=b.noCalendar||N?"H:i"+(b.enableSeconds?":S":""):W+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||N)&&!b.altFormat){var Q=We.defaultConfig.altFormat||sr.altFormat;M.altFormat=b.noCalendar||N?"h:i"+(b.enableSeconds?":S K":" K"):Q+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:qe("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:qe("max")});var ye=function(de){return function(Ae){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(Ae,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:ye("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:ye("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,b);for(var ne=0;ne<f.length;ne++)e.config[f[ne]]=e.config[f[ne]]===!0||e.config[f[ne]]==="true";Ma.filter(function(de){return e.config[de]!==void 0}).forEach(function(de){e.config[de]=Ca(e.config[de]||[]).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 ne=0;ne<e.config.plugins.length;ne++){var De=e.config.plugins[ne](e)||{};for(var te in De)Ma.indexOf(te)>-1?e.config[te]=Ca(De[te]).map(a).concat(e.config[te]):typeof b[te]>"u"&&(e.config[te]=De[te])}b.altInputClass||(e.config.altInputClass=Qt().className+" "+e.config.altInputClass),Fe("onParseConfig")}function Qt(){return e.config.wrap?n.querySelector("[data-input]"):n}function cr(){typeof e.config.locale!="object"&&typeof We.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ht(ht({},We.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?We.l10ns[e.config.locale]:void 0),Yn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Yn.l="("+e.l10n.weekdays.longhand.join("|")+")",Yn.M="("+e.l10n.months.shorthand.join("|")+")",Yn.F="("+e.l10n.months.longhand.join("|")+")",Yn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=ht(ht({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&We.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Yc(e),e.parseDate=Pa({config:e.config,l10n:e.l10n})}function $n(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Fe("onPreCalendarPosition");var b=f||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(fh,gh){return fh+gh.offsetHeight},0),N=e.calendarContainer.offsetWidth,W=e.config.position.split(" "),Q=W[0],ye=W.length>1?W[1]:null,ne=b.getBoundingClientRect(),De=window.innerHeight-ne.bottom,te=Q==="above"||Q!=="below"&&De<M&&ne.top>M,de=window.pageYOffset+ne.top+(te?-M-2:b.offsetHeight+2);if(dt(e.calendarContainer,"arrowTop",!te),dt(e.calendarContainer,"arrowBottom",te),!e.config.inline){var Ae=window.pageXOffset+ne.left,dn=!1,Ut=!1;ye==="center"?(Ae-=(N-ne.width)/2,dn=!0):ye==="right"&&(Ae-=N-ne.width,Ut=!0),dt(e.calendarContainer,"arrowLeft",!dn&&!Ut),dt(e.calendarContainer,"arrowCenter",dn),dt(e.calendarContainer,"arrowRight",Ut);var si=window.document.body.offsetWidth-(window.pageXOffset+ne.right),Cr=Ae+N>window.document.body.offsetWidth,ch=si+N>window.document.body.offsetWidth;if(dt(e.calendarContainer,"rightMost",Cr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Cr)e.calendarContainer.style.left=Ae+"px",e.calendarContainer.style.right="auto";else if(!ch)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=si+"px";else{var ja=ai();if(ja===void 0)return;var lh=window.document.body.offsetWidth,uh=Math.max(0,lh/2-N/2),dh=".flatpickr-calendar.centerMost:before",hh=".flatpickr-calendar.centerMost:after",mh=ja.cssRules.length,ph="{left:"+ne.left+"px;right:auto;}";dt(e.calendarContainer,"rightMost",!1),dt(e.calendarContainer,"centerMost",!0),ja.insertRule(dh+","+hh+ph,mh),e.calendarContainer.style.left=uh+"px",e.calendarContainer.style.right="auto"}}}}function ai(){for(var f=null,b=0;b<document.styleSheets.length;b++){var M=document.styleSheets[b];if(M.cssRules){try{M.cssRules}catch{continue}f=M;break}}return f??bo()}function bo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function wo(){e.config.noCalendar||e.isMobile||(se(),Eo(),Y())}function Ba(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function zc(f){f.preventDefault(),f.stopPropagation();var b=function(de){return de.classList&&de.classList.contains("flatpickr-day")&&!de.classList.contains("flatpickr-disabled")&&!de.classList.contains("notAllowed")},M=Bc(jt(f),b);if(M!==void 0){var N=M,W=e.latestSelectedDateObj=new Date(N.dateObj.getTime()),Q=(W.getMonth()<e.currentMonth||W.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=N,e.config.mode==="single")e.selectedDates=[W];else if(e.config.mode==="multiple"){var ye=Ya(W);ye?e.selectedDates.splice(parseInt(ye),1):e.selectedDates.push(W)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=W,e.selectedDates.push(W),zt(W,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(de,Ae){return de.getTime()-Ae.getTime()}));if(p(),Q){var ne=e.currentYear!==W.getFullYear();e.currentYear=W.getFullYear(),e.currentMonth=W.getMonth(),ne&&(Fe("onYearChange"),se()),Fe("onMonthChange")}if(Eo(),Y(),_n(),!Q&&e.config.mode!=="range"&&e.config.showMonths===1?Pe(N):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 De=e.config.mode==="single"&&!e.config.enableTime,te=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||te)&&Ba()}x()}}var Do={locale:[cr,E],showMonths:[B,s,v],minDate:[K],maxDate:[K],positionElement:[qc],clickOpens:[function(){e.config.clickOpens===!0?(C(e._input,"focus",e.open),C(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Qd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var M in f)Do[M]!==void 0&&Do[M].forEach(function(N){return N()})}else e.config[f]=b,Do[f]!==void 0?Do[f].forEach(function(N){return N()}):Ma.indexOf(f)>-1&&(e.config[f]=Ca(b));e.redraw(),_n(!0)}function Uc(f,b){var M=[];if(f instanceof Array)M=f.map(function(N){return e.parseDate(N,b)});else if(f instanceof Date||typeof f=="number")M=[e.parseDate(f,b)];else if(typeof f=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(f,b)];break;case"multiple":M=f.split(e.config.conjunction).map(function(N){return e.parseDate(N,b)});break;case"range":M=f.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,b)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(N){return N instanceof Date&&Z(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,W){return N.getTime()-W.getTime()})}function eh(f,b,M){if(b===void 0&&(b=!1),M===void 0&&(M=e.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return e.clear(b);Uc(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),K(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),_n(b),b&&Fe("onChange")}function Vc(f){return f.slice().map(function(b){return typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b}).filter(function(b){return b})}function th(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var f=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);f&&Uc(f,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 nh(){if(e.input=Qt(),!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=Ce(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"),qc()}function qc(){e._positionElement=e.config.positionElement||e._input}function rh(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Ce("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=f,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="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{}C(e.mobileInput,"change",function(b){e.setDate(jt(b).value,!1,e.mobileFormatStr),Fe("onChange"),Fe("onClose")})}function ih(f){if(e.isOpen===!0)return e.close();e.open(f)}function Fe(f,b){if(e.config!==void 0){var M=e.config[f];if(M!==void 0&&M.length>0)for(var N=0;M[N]&&N<M.length;N++)M[N](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Fa("change")),e.input.dispatchEvent(Fa("input")))}}function Fa(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function Ya(f){for(var b=0;b<e.selectedDates.length;b++){var M=e.selectedDates[b];if(M instanceof Date&&zt(M,f)===0)return""+b}return!1}function oh(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:zt(f,e.selectedDates[0])>=0&&zt(f,e.selectedDates[1])<=0}function Eo(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(f,b){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=vo(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),f.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(f){var b=f||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,b)}).filter(function(M,N,W){return e.config.mode!=="range"||e.config.enableTime||W.indexOf(M)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function _n(f){f===void 0&&(f=!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)),f!==!1&&Fe("onValueUpdate")}function ah(f){var b=jt(f),M=e.prevMonthNav.contains(b),N=e.nextMonthNav.contains(b);M||N?_(M?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function sh(f){f.preventDefault();var b=f.type==="keydown",M=jt(f),N=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]);var W=parseFloat(N.getAttribute("min")),Q=parseFloat(N.getAttribute("max")),ye=parseFloat(N.getAttribute("step")),ne=parseInt(N.value,10),De=f.delta||(b?f.which===38?1:-1:0),te=ne+ye*De;if(typeof N.value<"u"&&N.value.length===2){var de=N===e.hourElement,Ae=N===e.minuteElement;te<W?(te=Q+te+$t(!de)+($t(de)&&$t(!e.amPM)),Ae&&ee(void 0,-1,e.hourElement)):te>Q&&(te=N===e.hourElement?te-Q-$t(!e.amPM):W,Ae&&ee(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?te+ne===23:Math.abs(te-ne)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),N.value=ut(te)}}return i(),e}function ii(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=rp(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 ii(this,n)},HTMLElement.prototype.flatpickr=function(n){return ii([this],n)});var We=function(n,t){return typeof n=="string"?ii(window.document.querySelectorAll(n),t):n instanceof Node?ii([n],t):ii(n,t)};We.defaultConfig={};We.l10ns={en:ht({},Sa),default:ht({},Sa)};We.localize=function(n){We.l10ns.default=ht(ht({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=ht(ht({},We.defaultConfig),n)};We.parseDate=Pa({});We.formatDate=Yc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ii(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=We);var Ud=We;var Ra=class{constructor(t,e){this.dateInputEl=t;A(this,"minDate");A(this,"maxDate");A(this,"defaultReservationDays");A(this,"hasPrices",!1);A(this,"prices",{});A(this,"availability",{});A(this,"disabledDates",[]);A(this,"selectedStartDate");A(this,"selectedEndDate");A(this,"config");A(this,"instance");A(this,"destroyInstance");A(this,"currentDate");A(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??J.getCurrentDate(),defaultEndDate:e.defaultEndDate??J.getCurrentDate(),startWithEmptyDates:r},this.currentDate=J.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=J.toJSDate(t),r=this.selectedEndDate?J.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof _a.Core?this.instance.setStartDate(new ge(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?J.toJSDate(this.selectedStartDate):J.toJSDate(t),r=J.toJSDate(t);this.selectedEndDate=t,this.instance instanceof _a.Core?this.instance.setEndDate(new ge(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=J.toJSDate(t),i=J.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 ge(this.config.defaultStartDate.toString()),t.endDate=new ge(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:ed,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new ge(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[Ea,Da,wa],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:c}=o.detail,u=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&u&&this.prices[u]){let h=this.prices[u],p=c.querySelector(`.${ua}`)||document.createElement("span");p.className=ua,p.textContent=`${h.toLocaleString(Ve,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",c.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=J.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=J.fromString(s.format("YYYY-MM-DD"));let c={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};Je("date:changed",c)})}},r=new _a.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=Xu(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:td,locale:{months:{shorthand:e,longhand:e}},zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(r.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(r,{onChange:o=>{let a=q("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=null,Je("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=J.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(Je("date:changed",s),a){let c=this.formatDate(o[0]),u=this.formatDate(o[1]);a.textContent=`${c} - ${u}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(J.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,Je("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,c)=>{let u=c.dateObj,h=J.fromJSDate(u),p=J.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],w=document.createElement("span");w.style.marginTop="2px",w.style.color="#c64509",w.style.fontSize="10px",w.style.fontWeight="bold",w.className=ua,w.textContent=`${y.toLocaleString(Ve,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.justifyContent="center",c.style.lineHeight="1.1",c.appendChild(w)}}});let i=Ud(this.dateInputEl,r);this.instance=i,this.destroyInstance=()=>i.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=J.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return Ve==="en"?`${r}/${i}/${o}`:Ve==="fr-FR"||Ve==="de"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var xa=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"nightsCountElement");A(this,"startDateElement");A(this,"endDateElement");A(this,"dateElement");A(this,"roomsWrapperElement");A(this,"roomElementTemplate");A(this,"addRoomElement");A(this,"rooms",[]);A(this,"includePrices",nd);A(this,"populateCalendarInput",async()=>{if(!this.dateElement){console.error("Date element not found");return}let t=new Ra(this.dateElement,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,defaultStartDate:H.startDate||Tr,defaultEndDate:H.endDate||ei});if(t.setMinimumDate(Tr),t.setMaximumDate(ei),t.includePrices(this.includePrices),this.includePrices){let e=await Bd([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});rr("date:changed",e=>{H.updateStartDate(J.fromString(e.startDate)),H.updateEndDate(J.fromString(e.endDate))}),this.element=q("details-box"),this.nightsCountElement=q("nights",this.element),this.startDateElement=q("start-date",this.element),this.endDateElement=q("end-date",this.element),this.dateElement=q("date-element",this.element),this.roomsWrapperElement=q("room-box-wrapper",this.element),this.roomElementTemplate=q("room-box",this.element),this.addRoomElement=q("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){Rt(()=>{this.startDateElement.textContent=H.startDate?J.formatForDisplay(H.startDate):"?"}),Rt(()=>{this.endDateElement.textContent=H.endDate?J.formatForDisplay(H.endDate):"?"}),Rt(()=>{this.nightsCountElement.textContent=`${H.nightsCount} ${Se("night").toLowerCase()}${H.nightsCount>1?"s":""}`}),Rt(()=>{let t=document.createDocumentFragment();H.rooms.forEach((r,i)=>{let o=Yt(this.roomElementTemplate,!0),a=q("room",o);a.textContent=`${Se("apartment")} ${i+1}`;let s=q("categories-wrapper",o),c=q("age-category",s),u=document.createDocumentFragment();r.forEach(p=>{let y=Yt(c,!0),w=q("category-name",y);w.textContent=p.name;let T=q("input",y);po(T,p.value.toString()),lt(y,"click",C=>{C.preventDefault();let x=i;switch(od(C.target)){case"decrement":if(p.isAdult){if(r.filter(K=>K.isAdult).reduce((K,G)=>K+G.value,0)>1&&p.value>0){let K=H.rooms.map((G,ee)=>ee===x?G.map(oe=>oe.ageCategoryId===p.ageCategoryId?{...oe,value:oe.value-1}:{...oe}):G);H.updateRooms(K)}}else if(p.value>0){let $=H.rooms.map((K,G)=>G===x?K.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value-1}:{...ee}):K);H.updateRooms($)}break;case"increment":if(this.computations(r).hasCapacity){let $=H.rooms.map((K,G)=>G===x?K.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value+1}:{...ee}):K);H.updateRooms($)}break}},{once:!1}),u.appendChild(y)}),s.innerHTML="",s.appendChild(u);let h=q("remove-room-button",o);h&&(h.classList.toggle("hide",H.rooms.length<=1),lt(h,"click",p=>{p.preventDefault();let y=H.rooms.filter((w,T)=>T!==i);H.updateRooms(y)})),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:H.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${H.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&H.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${H.rooms.length} >= max allowed ${e}`),this.addRoomElement.classList.add("hide")):e<=0?(console.log(`<<debug>> Max allowed rooms is non-positive (${e}), using available rooms ${this.parentComponent.apartmentProperties.availableRooms} as limit`),H.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${H.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${H.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),lt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:H.maxAllowedRooms};if(H.rooms.length<e){let i=H.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",c=s?Se("adults"):Se("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:c,value:u}}),o=[...H.rooms,i];H.updateRooms(o)}})}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}computations(t){let e=t.some(a=>a.value>0),r=t.reduce((a,s)=>a+s.value,0),i=r<this.parentComponent.apartmentProperties.capacity,o=t.filter(a=>a.isAdult).reduce((a,s)=>a+s.value,0);return{hasOccupants:e,totalOccupants:r,hasCapacity:i,totalAdults:o}}};var Vd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/images/getUrls",e,n)};function qd(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var oi=Ze({}),Wd=new Set,$c=new Map,Kd={width:160,height:160};function op(n,t){return`${n}:${[...t].sort().join(",")}`}async function Gd(n,t){let e=t.filter(Boolean);if(e.length===0)return[];let r=e.filter(s=>!oi.value[s]&&!Wd.has(s));if(r.length===0)return e.map(s=>oi.value[s]).filter(Boolean);let i=op(n,r),o=$c.get(i);if(o)return o;let a=(async()=>{try{let s=await Vd(n,{Images:r.map(u=>({ImageId:u,Width:Kd.width,Height:Kd.height,ResizeMode:"Cover"}))});return qd(s).forEach(u=>{oi.value[u.imageId]=u}),e.map(u=>oi.value[u]).filter(Boolean)}catch(s){return r.forEach(c=>Wd.add(c)),console.error("[imageStore] Failed to load images:",s),e.map(c=>oi.value[c]).filter(Boolean)}finally{$c.delete(i)}})();return $c.set(i,a),a}function Zd(n){return oi.value[n]||null}var Aa=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"productsWrapperElement");A(this,"productTemplateElement");A(this,"productTemplateHTML");A(this,"showMoreButtonElement");A(this,"requestedImageKeys",new Set);A(this,"visibleProductCount",4);A(this,"lastProductIdsKey","");this.element=q("options-box"),this.productsWrapperElement=q("options-list",this.element),this.productTemplateElement=q("option-wrapper",this.element),this.productTemplateHTML=this.productTemplateElement.outerHTML,this.showMoreButtonElement=q("more-button",this.element)}init(){try{this.updateDOM(),lt(this.showMoreButtonElement,"click",t=>{t.preventDefault();let e=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!e)})}catch(t){console.error("Error initializing OptionsSection:",t)}}refresh(){try{if(this.canPatchExistingDOM()){this.patchDOM();return}this.updateDOM()}catch(t){console.error("Error refreshing OptionsSection:",t)}}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){let t=H.sortedProducts,e=t.map(i=>i.id).join(",");e!==this.lastProductIdsKey&&(this.visibleProductCount=4,this.lastProductIdsKey=e);let r=document.createDocumentFragment();t.forEach((i,o)=>{let a=document.createElement("div");a.innerHTML=this.productTemplateHTML;let s=a.firstElementChild;s.classList.remove("hide"),s.style.removeProperty("display"),s.style.order=String(o),s.removeAttribute("id"),s.dataset.productId=i.id;let c=q("name",s);c.textContent=i.name||"";let u=q("price",s);u.textContent=i.price.toLocaleString(Ve,{style:"currency",currency:"EUR"});let h=q("label",s);h.textContent=Se(`chargingMode:${i.chargingMode}`),this.applyProductImage(this.parentComponent.apartmentProperties.enterpriseId,i.imageIds,s),this.bindProductCheckbox(s,i.id,i.selected),r.appendChild(s)}),Ac(this.productsWrapperElement),this.productsWrapperElement.appendChild(r),this.syncProductVisibility(),this.showMoreButtonElement.classList.toggle("hide",t.length<=this.visibleProductCount)}canPatchExistingDOM(){let t=H.sortedProducts;return t.length!==this.productsWrapperElement.children.length?!1:t.every((e,r)=>this.productsWrapperElement.children[r]?.dataset.productId===e.id)}patchDOM(){let t=H.sortedProducts;t.forEach((e,r)=>{let i=this.productsWrapperElement.children[r];i.style.order=String(r);let o=q("name",i);o.textContent=e.name||"";let a=q("price",i);a.textContent=e.price.toLocaleString(Ve,{style:"currency",currency:"EUR"});let s=q("label",i);s.textContent=Se(`chargingMode:${e.chargingMode}`);let c=q("checkbox",i);this.syncProductCheckboxState(c,e.selected)}),this.syncProductVisibility(),this.showMoreButtonElement.classList.toggle("hide",t.length<=this.visibleProductCount)}syncProductVisibility(){Array.from(this.productsWrapperElement.children).forEach((t,e)=>{t.classList.toggle("hide",e>=this.visibleProductCount)})}bindProductCheckbox(t,e,r){let i=q("checkbox",t),o=i.closest("label.w-checkbox");o&&(i.name=`addon-${e}`,i.id=`addon-${e}`,this.syncProductCheckboxState(i,r),lt(o,"click",a=>{a.preventDefault(),a.stopPropagation();let c=!(H.products.find(u=>u.id===e)?.selected??i.checked);this.syncProductCheckboxState(i,c),H.updateProducts(H.products.map(u=>u.id===e?{...u,selected:c}:u))}))}syncProductCheckboxState(t,e){t.checked=e;let r=t.previousElementSibling;e?r?.classList.add("w--redirected-checked"):r?.classList.remove("w--redirected-checked")}applyProductImage(t,e,r){let i=e.filter(Boolean);if(i.length===0)return;let o=q("image",r);if(!o)return;o.loading="eager";let a=i.map(c=>Zd(c)).find(c=>c?.url);if(a){o.src=a.url;return}let s=`${t}:${i.join(",")}`;this.requestedImageKeys.has(s)||(this.requestedImageKeys.add(s),Gd(t,i).then(c=>{let u=c[0]?.url;o.isConnected&&u&&(o.src=u)}))}showMoreProducts(t=3){let e=Array.from(this.productsWrapperElement.children),r=e.length,i=this.visibleProductCount;return this.visibleProductCount=Math.min(this.visibleProductCount+t,r),e.slice(i,this.visibleProductCount).forEach(o=>{o.classList.remove("hide")}),this.visibleProductCount<r}};var Jd=(n,t)=>{let e=`${le.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return fetch(e,r).then(o=>o.json())};var La=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"modalContent");A(this,"modalBg");A(this,"openModalBtn");A(this,"closeModalBtn");A(this,"fNameInput");A(this,"lNameInput");A(this,"emailInput");A(this,"phoneInput");A(this,"countryInput");A(this,"notesInput");A(this,"submitPaymentBtn");A(this,"customer",null);this.element=q("payment-modal"),this.modalContent=q("modal-content",this.element),this.modalBg=q("modal-bg",this.element),this.openModalBtn=q("open-modal"),this.closeModalBtn=q("close-modal"),this.fNameInput=q("fname-input",this.element),this.lNameInput=q("lname-input",this.element),this.emailInput=q("email-input",this.element),this.phoneInput=q("phone-input",this.element),this.countryInput=q("country-input",this.element),this.notesInput=q("notes-input",this.element),this.submitPaymentBtn=q("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){lt(this.openModalBtn,"click",()=>{this.openModalBtn.hasAttribute("disabled")||(this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"}))}),this.submitPaymentBtn?lt(this.submitPaymentBtn,"click",t=>{t.preventDefault(),this.handleSubmit()}):console.error("Submit Payment button not found in the DOM.")}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),t?(this.element.style.display="flex",this.element.style.opacity="1",this.modalContent.style.opacity="1",this.element.querySelectorAll("div").forEach(e=>{e.style.opacity="1"})):(this.element.style.opacity="0",this.element.style.display="none")}validateInputs(){if(!this.fNameInput.value||!this.lNameInput.value||!this.emailInput.value||!this.phoneInput.value||!this.countryInput.value)throw new Error("First name, last name, email, phone, and nationality are required.");if(!this.emailInput.checkValidity())throw new Error("Invalid email format.");if(!this.phoneInput.checkValidity())throw new Error("Invalid phone number format. Only numbers and spaces are allowed.");if(!this.countryInput.value)throw new Error("Country is required.")}async handleSubmit(){if(!H.startDate||!H.endDate)throw new Error("Start date and end date are required to submit the payment form.");try{this.validateInputs()}catch(s){console.error("Validation error:",s),alert(s instanceof Error?s.message:"An unexpected error occurred.");return}let{startDate:t,endDate:e}={startDate:H.startDate,endDate:H.endDate};this.customer={Email:this.emailInput.value,FirstName:this.fNameInput.value,LastName:this.lNameInput.value,Telephone:this.phoneInput.value,NationalityCode:this.countryInput.value,SendMarketingEmails:!1};let r={Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:H.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:H.couponCode||void 0,RateId:H.selectedRateId||"",AdultCount:s.filter(c=>c.isAdult).reduce((c,u)=>c+u.value,0),ChildCount:s.filter(c=>!c.isAdult).reduce((c,u)=>c+u.value,0),ProductIds:H.selectedProducts.map(c=>c.id),Notes:this.notesInput.value||""}))};console.log("Payload for reservation group:",r);let i=JSON.stringify(r,null,2);console.log("JSON Payload:",i);let o=this.submitPaymentBtn.textContent?.trim()??Se("proceedToPayment");this.submitPaymentBtn.textContent=Se("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await Jd(this.parentComponent.apartmentProperties.enterpriseId,r);if(console.log("Reservation Response:",a),"PaymentRequestId"in a&&a.PaymentRequestId){let c=Dn().iso639,u=Qu(c),h=new URL(window.location.href);h.pathname=c==="fr"?"/reservation-confirmee":`/${c}/confirmed-reservation`;let p=`https://app.mews.com/navigator/payment-requests/detail/${a.PaymentRequestId}?ccy=EUR&language=${encodeURIComponent(u)}&returnUrl=${btoa(h.toString())}`;console.log("Payment URL:",p),window.open(p,"_blank")}else if("Id"in a&&a.Id){console.log("Free reservation created successfully:",a);let c=Dn().iso639,u=new URL(window.location.href);u.pathname=c==="fr"?"/reservation-confirmee":`/${c}/confirmed-reservation`,u.searchParams.set("reservationId",a.Id),console.log("Confirmation URL:",u.toString()),window.location.href=u.toString()}else{this.submitPaymentBtn.classList.remove("is-disabled"),this.submitPaymentBtn.textContent=o;let s="Message"in a&&a.Message?a.Message:"Reservation could not be created. Please try again later or contact Support.";console.error("Reservation creation failed:",a),alert(s);return}}};var Xd=(n,t)=>{let e=`${le.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var Na=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"summaryItemWrapperElement");A(this,"summaryItemElement");A(this,"itemNameTemplateElement");A(this,"itemRowTemplateElement");A(this,"totalPriceElement");A(this,"taxElement");A(this,"submitElement");A(this,"couponInputElement");A(this,"couponApplyElement");A(this,"statusTextElement");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.element=q("summary-box"),this.summaryItemWrapperElement=q("summary-items-wrapper",this.element),this.summaryItemElement=q("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=q("name",this.summaryItemElement),this.itemRowTemplateElement=q("row",this.summaryItemElement),this.totalPriceElement=q("total",this.element),this.taxElement=q("tax",this.element),this.submitElement=q("submit",this.element),this.couponInputElement=q("coupon-input",this.element),this.couponApplyElement=q("apply-coupon",this.element),this.statusTextElement=q("status-text",this.element)}init(){this.updateDOM(),Je("loading:end",this.element)}refresh(){Je("loading:end",this.element)}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),Array.from(this.element.children).forEach(e=>{e instanceof HTMLDivElement&&e.classList.toggle("hide",!t)})}updateDOM(){lt(this.couponInputElement,"input",()=>{H.updateCouponCode(xc(this.couponInputElement))}),lt(this.couponApplyElement,"click",async t=>{t.preventDefault(),Je("loading:start",this.element),Xd(this.parentComponent.apartmentProperties.enterpriseId,{Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:H.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?Se("couponValid"):Se("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{Je("loading:start",this.element),await this.parentComponent.fetchReservationPricing(),console.log("Reservation pricing updated with voucher code")}catch(i){console.error("Error updating reservation pricing with voucher code:",i),this.statusTextElement.textContent=Se("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=Se("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{Je("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),Rt(()=>{this.couponInputElement.value!==H.couponCode&&po(this.couponInputElement,H.couponCode);let e=H.getReadonlyState().computed.summary;if(H.isFetching){ir(!0,this.element);return}ir(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=q("name",o),s=q("row",o),c=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=Yt(a,!0);p.textContent=`[${u} ${Se("adults").toLowerCase()}${h>0?`, ${h} ${Se("children").toLowerCase()}`:""}] x ${i.quantity}`,c.appendChild(p);let y=Yt(a,!0);y.textContent=`${i.pricing.avgPerNight.toLocaleString(Ve,{style:"currency",currency:"EUR"})}/ ${Se("night")}`,c.appendChild(y);let w=Yt(s,!0),T=q("label",w),C=q("price",w);if(T.textContent=`${Se("pricingService")} (${H.nightsCount} ${Se("night").toLowerCase()}${H.nightsCount>1?"s":""}):`,C.textContent=i.pricing.service.toLocaleString?.(Ve,{style:"currency",currency:"EUR"})??null,c.appendChild(w),H.selectedProducts.length>0){let ce=Yt(s,!0),F=q("label",ce);q("price",ce).remove();let Y=H.selectedProducts.map(se=>se.name).join(", ");F.textContent=`${Se("pricingProducts")} ${Y}`,c.appendChild(ce)}let x=Yt(s,!0),$=q("label",x);$.textContent=Se("pricingProductsAndExtras");let K=q("price",x);K.textContent=i.pricing.products.toLocaleString(Ve,{style:"currency",currency:"EUR"}),c.appendChild(x);let G=Yt(s,!0),ee=q("label",G);ee.textContent=Se("pricingTaxes");let oe=q("price",G);oe.textContent=i.pricing.taxes.toLocaleString(Ve,{style:"currency",currency:"EUR"}),c.appendChild(G);let ae=Yt(s,!0),Pe=q("label",ae);Pe.textContent=Se("pricingSubtotal");let Te=q("price",ae);Te.textContent=i.pricing.subtotal.toLocaleString(Ve,{style:"currency",currency:"EUR"}),c.appendChild(ae),o.innerHTML="",o.appendChild(c),this.summaryItemWrapperElement.appendChild(o)});let r=e.totals.taxes||0;this.taxElement.textContent=r>0?r.toLocaleString(Ve,{style:"currency",currency:"EUR"}):"--",this.totalPriceElement.textContent=e.totals.grandTotal.toLocaleString(Ve,{style:"currency",currency:"EUR"})})}};var Oa=class{constructor(t){this.parentComponent=t;A(this,"element");A(this,"tariffsWrapperElement");A(this,"tariffTemplateElement");this.element=q("offer-box"),this.tariffsWrapperElement=q("offers-list",this.element),this.tariffTemplateElement=q("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){Rt(()=>{if(H.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(H.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:H.computedRates.length,isFetching:H.isFetching});let t=document.createDocumentFragment(),e=H.computedRates.sort((a,s)=>{let c=a.price?.AverageAmountPerTimeUnit?.GrossValue||0,u=s.price?.AverageAmountPerTimeUnit?.GrossValue||0;return c-u}),r=H.selectedRateId,i=r!==null&&e.some(a=>a.id===r),o=i?r:e[0]?.id;!i&&o&&queueMicrotask(()=>H.updateSelectedRateId(o)),e.forEach(a=>{let s=Yt(this.tariffTemplateElement,!0);s.removeAttribute("id");let c=q("name",s);c.textContent=a.name;let u=q("description",s);u.textContent=a.description;let h=q("price",s),p=a.price?.AverageAmountPerTimeUnit?.GrossValue||0;h.textContent=p.toLocaleString(Ve,{style:"currency",currency:"EUR"});let y=H.rates.find($=>$.id===a.id),w=q("label",s),T=q("discount-badge",s),C=q("discount-label",T);if(y)if(w.textContent=y.shortName,y.pricing?.DependentRatePricing){let $=y.pricing?.DependentRatePricing.RelativeAdjustment*100;$===0?T.classList.add("hide"):C.textContent=`${$>0?"+":""}${$}%`}else T.classList.add("hide");else w.classList.add("hide"),T.classList.add("hide");let x=q("radio-input",s);x.value=a.id,a.id===o&&(x.checked=!0,x.previousElementSibling?.classList.add("w--redirected-checked")),lt(x,"change",()=>{x.checked&&H.updateSelectedRateId(a.id)}),t.appendChild(s)}),this.tariffsWrapperElement.innerHTML="",this.tariffsWrapperElement.appendChild(t)})}};var Ha=class{constructor(t){A(this,"apartmentProperties");A(this,"detailsSection");A(this,"optionsSection");A(this,"tariffsSection");A(this,"summarySection");A(this,"paymentModal");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.apartmentProperties=t,H.setCmsApartmentData(t)}init(){Je("loading:start",document.body);let t=Ft.startDate?J.safeParsePlainDate(Ft.startDate):Tr,e=Ft.endDate?J.safeParsePlainDate(Ft.endDate):ei,r=t&&e?t.until(e).days:0,i=r>=1?t:Tr,o=r>=1?e:ei;i&&H.updateStartDate(i),o&&H.updateEndDate(o),this.fetchAPIData().then(()=>this.parseAPIData()).then(()=>this.initUIComponents()).catch(a=>{console.error("[ReservationComponent] fetchAPIData failed:",a),this.initUIComponents()}),console.log("#=> State:",H.getReadonlyState())}initUIComponents(){let t=H.rates.find(e=>e.isDefault||e.isBaseRate);console.log("#=> Default Rate:",t),H.updateSelectedRateId(t?.id||H.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||H.computedRates[0]?.id||null),this.detailsSection=new xa(this),this.detailsSection.init(),this.optionsSection=new Aa(this),this.optionsSection.toggleVisibility(!0),this.optionsSection.init(),this.tariffsSection=new Oa(this),this.tariffsSection.toggleVisibility(!0),this.tariffsSection.init(),this.summarySection=new Na(this),this.summarySection.toggleVisibility(!0),this.summarySection.init(),this.paymentModal=new La(this),this.paymentModal.toggleVisibility(!1),this.paymentModal.init(),this.initPricingButler(),this.initAvailabilityPricingUpdater(),Je("loading:end",document.body)}initPricingButler(){let t=(0,jc.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await H.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);Rt(()=>{let{rooms:e}=H,{startDate:r}=H,{endDate:i}=H,{selectedProducts:o}=H,{selectedRateId:a}=H,{couponCode:s}=H;if(console.log("[PricingButler] Dependencies changed:",{roomsCount:e.length,startDate:r?.toString(),endDate:i?.toString(),selectedProductsCount:o.length,selectedRateId:a,couponCode:s}),e.length===0){console.log("[PricingButler] No rooms set, skipping pricing update.");return}if(!r||!i){console.log("[PricingButler] Start date or end date is not set, skipping pricing update.");return}if(J.isBefore(r,i)){console.log("[PricingButler] Start date is after or equal to end date, skipping pricing update.");return}t()})}initAvailabilityPricingUpdater(){let t=(0,jc.default)(async()=>{try{await H.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await H.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),Je("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);Rt(()=>{Je("loading:start",document.body);let{startDate:e,endDate:r}={startDate:H.startDate,endDate:H.endDate};if(!e||!r){console.warn("Start date or end date is not set, skipping availability and pricing updates.");return}if(J.isBefore(e,r)){console.warn("Start date is after or equal to end date, skipping API requests.");return}t()}),Rt(()=>{Je("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i,restrictionMessage:o}={availabilities:H.availabilities,servicePricing:H.servicePricing,isAvailable:H.isAvailable,restrictionMessage:H.restrictionMessage};if(this.updateAvailabilityBanners(i,o),this.optionsSection&&this.optionsSection.toggleVisibility(i),this.tariffsSection&&this.tariffsSection.toggleVisibility(i),this.summarySection&&this.summarySection.toggleVisibility(i),r&&!H.selectedRateId&&H.computedRates.length>0){let a=H.rates.find(s=>s.isDefault||s.isBaseRate);H.updateSelectedRateId(a?.id||H.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||H.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await H.initializeResources(this.apartmentProperties.enterpriseId),await H.initializeRooms(),await H.fetchHotel(this.apartmentProperties.enterpriseId),await H.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await H.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await H.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await H.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(H.computedRates.length>0&&!H.selectedRateId){let t=H.rates.find(e=>e.isDefault||e.isBaseRate);H.updateSelectedRateId(t?.id||H.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||H.computedRates[0]?.id||null)}this.updateAvailabilityBanners(H.isAvailable,H.restrictionMessage),this.optionsSection&&(this.optionsSection.toggleVisibility(H.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(H.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(H.isAvailable),this.summarySection.refresh()),Je("loading:end",document.body)}updateAvailabilityBanners(t,e){let r=q("banner-box"),i=q("banner-box-restriction"),o=q("banner-restriction-text"),a=q("open-modal");a&&(!!e||!t?a.setAttribute("disabled",""):a.removeAttribute("disabled")),e?(o&&(o.textContent=e),i&&i.classList.remove("hide"),r&&r.classList.add("hide")):t?(r&&r.classList.add("hide"),i&&i.classList.add("hide")):(r&&r.classList.remove("hide"),i&&i.classList.add("hide"))}async fetchReservationPricing(){try{await H.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await H.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);return this.refreshUIComponents(),t}catch(t){throw console.error("Error fetching reservation pricing:",t),t}}handleDateChange(t,e){return t&&e&&xe.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&H.updateStartDate(t),e&&H.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function ap(){try{let n=window.WebflowCMSData_apartment;console.log("#=> Properties",n),new Ha(n).init()}catch(n){console.error("Error initializing reservation component",n)}}window.Webflow||(window.Webflow=[]);window.Webflow.push(async()=>{ap()});export{ap as initApparthotelsBookingTemplate};
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
@vue/shared/dist/shared.esm-bundler.js:
|