@influence-society-web/yuna-frontend 2.0.1 → 2.0.3

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 Nd=Object.create;var Sa=Object.defineProperty;var Od=Object.getOwnPropertyDescriptor;var Fd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,Yd=Object.prototype.hasOwnProperty;var $d=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Bd=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var jd=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fd(t))!Yd.call(n,i)&&i!==e&&Sa(n,i,{get:()=>t[i],enumerable:!(r=Od(t,i))||r.enumerable});return n};var zd=(n,t,e)=>(e=n!=null?Nd(Hd(n)):{},jd(t||!n||!n.__esModule?Sa(e,"default",{value:n,enumerable:!0}):e,n));var Y=(n,t,e)=>($d(n,typeof t!="symbol"?t+"":t,e),e);var kc=Bd((ka,Ta)=>{(function(n,t){typeof ka=="object"&&typeof Ta<"u"?Ta.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(ka,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(N,H){(H==null||H>N.length)&&(H=N.length);for(var O=0,ne=Array(H);O<H;O++)ne[O]=N[O];return ne}function r(N){if(Array.isArray(N))return N}function i(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function o(N,H,O){return H=p(H),B(N,S()?Reflect.construct(H,O||[],p(N).constructor):H.apply(N,O))}function a(N,H){if(!(N instanceof H))throw new TypeError("Cannot call a class as a function")}function s(N,H,O){if(S())return Reflect.construct.apply(null,arguments);var ne=[null];ne.push.apply(ne,H);var g=new(N.bind.apply(N,ne));return O&&V(g,O.prototype),g}function u(N,H){for(var O,ne=0;ne<H.length;ne++)O=H[ne],O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,J(O.key),O)}function l(N,H,O){return H&&u(N.prototype,H),O&&u(N,O),Object.defineProperty(N,"prototype",{writable:!1}),N}function h(N,H){var O=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!O){if(Array.isArray(N)||(O=Te(N))||H&&N&&typeof N.length=="number"){O&&(N=O);var ne=0,g=function(){};return{s:g,n:function(){return ne>=N.length?{done:!0}:{done:!1,value:N[ne++]}},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 L,c=!0,d=!1;return{s:function(){O=O.call(N)},n:function(){var v=O.next();return c=v.done,v},e:function(v){d=!0,L=v},f:function(){try{c||O.return==null||O.return()}finally{if(d)throw L}}}}function p(N){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(H){return H.__proto__||Object.getPrototypeOf(H)},p(N)}function y(N,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(H&&H.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),H&&V(N,H)}function E(N){try{return Function.toString.call(N).indexOf("[native code]")!==-1}catch{return typeof N=="function"}}function S(){try{var N=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S=function(){return!!N})()}function k(N,H){var O=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(O!=null){var ne,g,L,c,d=[],v=!0,D=!1;try{if(L=(O=O.call(N)).next,H===0){if(Object(O)!==O)return;v=!1}else for(;!(v=(ne=L.call(O)).done)&&(d.push(ne.value),d.length!==H);v=!0);}catch(w){D=!0,g=w}finally{try{if(!v&&O.return!=null&&(c=O.return(),Object(c)!==c))return}finally{if(D)throw g}}return d}}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(N,H){if(H&&(typeof H=="object"||typeof H=="function"))return H;if(H!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(N)}function V(N,H){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,ne){return O.__proto__=ne,O},V(N,H)}function G(N,H){return r(N)||k(N,H)||Te(N,H)||A()}function U(N,H){if(typeof N!="object"||!N)return N;var O=N[Symbol.toPrimitive];if(O!==void 0){var ne=O.call(N,H||"default");if(typeof ne!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(N)}function J(N){var H=U(N,"string");return typeof H=="symbol"?H:H+""}function oe(N){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},oe(N)}function Te(N,H){if(N){if(typeof N=="string")return e(N,H);var O={}.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?e(N,H):void 0}}function Me(N){var H=typeof Map=="function"?new Map:void 0;return Me=function(O){function ne(){return s(O,arguments,p(this).constructor)}if(O===null||!E(O))return O;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(H!==void 0){if(H.has(O))return H.get(O);H.set(O,ne)}return ne.prototype=Object.create(O.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),V(ne,O)},Me(N)}var ie=function(N){var H=Math.abs,O=Math.max,ne=Math.floor;function g(L,c){var d;if(a(this,g),d=o(this,g,[L]),d.sign=c,Object.setPrototypeOf(d,g.prototype),L>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,N),l(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var D=c.value;d.push((D&&(D>>>0).toString(16))+", ")}}catch(w){v.e(w)}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 D=32767&c,w=c>>>15,_=0,I=d,C=0;C<v;C++){var F=this.__digit(C),R=32767&F,W=F>>>15,ee=g.__imul(R,D),q=g.__imul(R,w),j=g.__imul(W,D),re=g.__imul(W,w),le=I+ee+_;_=le>>>30,le&=1073741823,le+=((32767&q)<<15)+((32767&j)<<15),_+=le>>>30,I=re+(q>>>15)+(j>>>15),this.__setDigit(C,1073741823&le)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var D,w=0,_=0;_<v;_++)D=this.__halfDigit(d+_)+c.__halfDigit(_)+w,w=D>>>15,this.__setHalfDigit(d+_,32767&D);return w}},{key:"__inplaceSub",value:function(c,d,v){var D=v-1>>>1,w=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,C=0;C<D;C++){var F=c.__digit(C),R=(_>>>15)-(32767&F)-w;w=1&R>>>15,this.__setDigit(d+C,(32767&R)<<15|32767&I),_=this.__digit(d+C+1),I=(32767&_)-(F>>>15)-w,w=1&I>>>15}var W=c.__digit(C),ee=(_>>>15)-(32767&W)-w;w=1&ee>>>15,this.__setDigit(d+C,(32767&ee)<<15|32767&I);var q=W>>>15;if(d+C+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+C+1),I=(32767&_)-q-w,w=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var j=0;j<c.length-1;j++){var re=this.__digit(d+j),le=c.__digit(j),ge=(32767&re)-(32767&le)-w;w=1&ge>>>15;var we=(re>>>15)-(le>>>15)-w;w=1&we>>>15,this.__setDigit(d+j,(32767&we)<<15|32767&ge)}var Re=this.__digit(d+j),ze=c.__digit(j),tt=(32767&Re)-(32767&ze)-w;w=1&tt>>>15;var Vt=0;!(1&v)&&(Vt=(Re>>>15)-(ze>>>15)-w,w=1&Vt>>>15),this.__setDigit(d+j,(32767&Vt)<<15|32767&tt)}return w}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,D=this.length-1,w=0;w<D;w++)d=this.__digit(w+1),this.__setDigit(w,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(D,v)}}},{key:"__digit",value:function(c){return this[c]}},{key:"__unsignedDigit",value:function(c){return this[c]>>>0}},{key:"__setDigit",value:function(c,d){this[c]=0|d}},{key:"__setDigitGrow",value:function(c,d){this[c]=0|d}},{key:"__halfDigitLength",value:function(){var c=this.length;return 32767>=this.__unsignedDigit(c-1)?2*c-1:2*c}},{key:"__halfDigit",value:function(c){return 32767&this[c>>>1]>>>15*(1&c)}},{key:"__setHalfDigit",value:function(c,d){var v=c>>>1,D=this.__digit(v),w=1&c?32767&D|d<<15:1073709056&D|32767&d;this.__setDigit(v,w)}}],[{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)||ne(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(oe(c)==="object"){if(c.constructor===g)return c;var D=g.__toPrimitive(c);return g.BigInt(D)}throw new TypeError("Cannot convert "+c+" to a BigInt")}},{key:"toNumber",value:function(c){var d=c.length;if(d===0)return 0;if(d===1){var v=c.__unsignedDigit(0);return c.sign?-v:v}var D=c.__digit(d-1),w=g.__clz30(D),_=30*d-w;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,C=D,F=d-1,R=w+3,W=R===32?0:C<<R;W>>>=12;var ee=R-12,q=12<=R?0:C<<20+R,j=20+R;for(0<ee&&0<F&&(F--,C=c.__digit(F),W|=C>>>30-ee,q=C<<ee+2,j=ee+2);0<j&&0<F;)F--,C=c.__digit(F),q|=30<=j?C<<j-30:C>>>30-j,j-=30;var re=g.__decideRounding(c,j,F,C);if((re===1||re===0&&(1&q)==1)&&(q=q+1>>>0,q===0&&(W++,W>>>20!=0&&(W=0,I++,1023<I))))return c.sign?-1/0:1/0;var le=c.sign?-2147483648:0;return I=I+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=le|I|W,g.__kBitConversionInts[g.__kBitConversionIntLow]=q,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 D=1+(0|v/30),w=c.sign&&(1&v)!=0,_=new g(D,w);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(D-1,I),_}var C=null,F=c;for(1&v&&(C=c),v>>=1;v!==0;v>>=1)F=g.multiply(F,F),1&v&&(C===null?C=F:C=g.multiply(C,F));return C}},{key:"multiply",value:function(c,d){if(c.length===0)return c;if(d.length===0)return d;var v=c.length+d.length;30<=c.__clzmsd()+d.__clzmsd()&&v--;var D=new g(v,c.sign!==d.sign);D.__initializeDigits();for(var w=0;w<c.length;w++)g.__multiplyAccumulate(d,c.__digit(w),D,w);return D.__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,D=c.sign!==d.sign,w=d.__unsignedDigit(0);if(d.length===1&&32767>=w){if(w===1)return D===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,w,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=D,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return g.__zero();var D=g.__absoluteModSmall(c,v);return D===0?g.__zero():g.__oneDigit(D,c.sign)}var w=g.__absoluteDivLarge(c,d,!1,!0);return w.sign=c.sign,w.__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=O(c.length,d.length)+1,D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return D=g.__absoluteOr(D,w,D),g.__absoluteAddOne(D,!0,D).__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=O(c.length,d.length),D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return g.__absoluteXor(D,w,D).__trim()}var _=O(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var C=g.__absoluteSubOne(d,_);return C=g.__absoluteXor(C,c,C),g.__absoluteAddOne(C,!0,C).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=O(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return D=g.__absoluteAnd(D,w,D),g.__absoluteAddOne(D,!0,D).__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=ne(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 D=d.__unsignedDigit(v-1),w=1<<(c-1)%30;if(d.length===v&&D<w)return d;var _=(D&w)===w;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(D&w-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&D===w?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=ne(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 D=c%30;if(d.length==v){if(D===0)return d;var w=d.__digit(v-1);if(!(w>>>D))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(oe(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(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="symbol"){if(g.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(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],D=v?[4,0]:[0,4],w=G(D,2),_=w[0],I=w[1],C=c.getUint32(d+_,v),F=c.getUint32(d+I,v),R=new g(3,!1);return R.__setDigit(0,1073741823&F),R.__setDigit(1,(268435455&C)<<2|F>>>30),R.__setDigit(2,C>>>28),R.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,D)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var w=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,w=I>>>2,2<v.length&&(w|=v.__digit(2)<<28)}var C=D?[4,0]:[0,4],F=G(C,2),R=F[0],W=F[1];c.setUint32(d+R,w,D),c.setUint32(d+W,_,D)}},{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,D){if(0<d)return-1;var w;if(0>d)w=-d-1;else{if(v===0)return-1;v--,D=c.__digit(v),w=29}var _=1<<w;if(!(D&_))return-1;if(_-=1,(D&_)!=0)return 1;for(;0<v;)if(v--,c.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(c){var d=0>c;g.__kBitConversionDouble[0]=c;var v,D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,w=D-1023,_=(0|w/30)+1,I=new g(_,d),C=1048576,F=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|C,R=g.__kBitConversionInts[g.__kBitConversionIntLow],W=20,ee=w%30,q=0;if(ee<W){var j=W-ee;q=j+32,v=F>>>j,F=F<<32-j|R>>>j,R<<=32-j}else if(ee===W)q=32,v=F,F=R,R=0;else{var re=ee-W;q=32-re,v=F<<re|R>>>32-re,F=R<<re,R=0}I.__setDigit(_-1,v);for(var le=_-2;0<=le;le--)0<q?(q-=30,v=F>>>2,F=F<<30|R>>>2,R<<=30):v=0,I.__setDigit(le,v);return I.__trim()}},{key:"__isWhitespace",value:function(c){return 13>=c&&9<=c||(159>=c?c==32:131071>=c?c==160||c==5760:196607>=c?(c&=131071,10>=c||c==40||c==41||c==47||c==95||c==4096):c==65279)}},{key:"__fromString",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,D=c.length,w=0;if(w===D)return g.__zero();for(var _=c.charCodeAt(w);g.__isWhitespace(_);){if(++w===D)return g.__zero();_=c.charCodeAt(w)}if(_===43){if(++w===D)return null;_=c.charCodeAt(w),v=1}else if(_===45){if(++w===D)return null;_=c.charCodeAt(w),v=-1}if(d===0){if(d=10,_===48){if(++w===D)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(d=16,++w===D)return null;_=c.charCodeAt(w)}else if(_===79||_===111){if(d=8,++w===D)return null;_=c.charCodeAt(w)}else if(_===66||_===98){if(d=2,++w===D)return null;_=c.charCodeAt(w)}}}else if(d===16&&_===48){if(++w===D)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(++w===D)return null;_=c.charCodeAt(w)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++w===D)return g.__zero();_=c.charCodeAt(w)}var I=D-w,C=g.__kMaxBitsPerChar[d],F=g.__kBitsPerCharTableMultiplier-1;if(I>1073741824/C)return null;var R=C*I+F>>>g.__kBitsPerCharTableShift,W=0|(R+29)/30,ee=new g(W,!1),q=10>d?d:10,j=10<d?d-10:0;if(d&d-1){ee.__initializeDigits();var tt=!1,Vt=0;do{for(var Wn,xn=0,Wr=1;;){if(Wn=void 0,_-48>>>0<q)Wn=_-48;else if((32|_)-97>>>0<j)Wn=(32|_)-87;else{tt=!0;break}var oo=Wr*d;if(1073741823<oo)break;if(Wr=oo,xn=xn*d+Wn,Vt++,++w===D){tt=!0;break}_=c.charCodeAt(w)}F=30*g.__kBitsPerCharTableMultiplier-1;var ao=0|(C*Vt+F>>>g.__kBitsPerCharTableShift)/30;ee.__inplaceMultiplyAdd(Wr,xn,ao)}while(!tt)}else{C>>=g.__kBitsPerCharTableShift;var re=[],le=[],ge=!1;do{for(var we,Re=0,ze=0;;){if(we=void 0,_-48>>>0<q)we=_-48;else if((32|_)-97>>>0<j)we=(32|_)-87;else{ge=!0;break}if(ze+=C,Re=Re<<C|we,++w===D){ge=!0;break}if(_=c.charCodeAt(w),30<ze+C)break}re.push(Re),le.push(ze)}while(!ge);g.__fillFromParts(ee,re,le)}if(w!==D){if(!g.__isWhitespace(_))return null;for(w++;w<D;w++)if(_=c.charCodeAt(w),!g.__isWhitespace(_))return null}return ee.sign=v===-1,ee.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var D=0,w=0,_=0,I=d.length-1;0<=I;I--){var C=d[I],F=v[I];w|=C<<_,_+=F,_===30?(c.__setDigit(D++,w),_=0,w=0):30<_&&(c.__setDigit(D++,1073741823&w),_-=30,w=C>>>F-_)}if(w!==0){if(D>=c.length)throw new Error("implementation bug");c.__setDigit(D++,w)}for(;D<c.length;D++)c.__setDigit(D,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,D=d-1;D=(85&D>>>1)+(85&D),D=(51&D>>>2)+(51&D),D=(15&D>>>4)+(15&D);var w=D,_=d-1,I=c.__digit(v-1),C=g.__clz30(I),F=30*v-C,R=0|(F+w-1)/w;if(c.sign&&R++,268435456<R)throw new Error("string too long");for(var W=Array(R),ee=R-1,q=0,j=0,re=0;re<v-1;re++){var le=c.__digit(re),ge=(q|le<<j)&_;W[ee--]=g.__kConversionChars[ge];var we=w-j;for(q=le>>>we,j=30-we;j>=w;)W[ee--]=g.__kConversionChars[q&_],q>>>=w,j-=w}var Re=(q|I<<j)&_;for(W[ee--]=g.__kConversionChars[Re],q=I>>>w-j;q!==0;)W[ee--]=g.__kConversionChars[q&_],q>>>=w;if(c.sign&&(W[ee--]="-"),ee!==-1)throw new Error("implementation bug");return W.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var D=c.length;if(D===0)return"";if(D===1){var w=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(w="-"+w),w}var _=30*D-g.__clz30(c.__digit(D-1)),I=g.__kMaxBitsPerChar[d],C=I-1,F=_*g.__kBitsPerCharTableMultiplier;F+=C-1,F=0|F/C;var R,W,ee=F+1>>1,q=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(ee,!1)),j=q.__unsignedDigit(0);if(q.length===1&&32767>=j){R=new g(c.length,!1),R.__initializeDigits();for(var re,le=0,ge=2*c.length-1;0<=ge;ge--)re=le<<15|c.__halfDigit(ge),R.__setHalfDigit(ge,0|re/j),le=0|re%j;W=le.toString(d)}else{var we=g.__absoluteDivLarge(c,q,!0,!0);R=we.quotient;var Re=we.remainder.__trim();W=g.__toStringGeneric(Re,d,!0)}R.__trim();for(var ze=g.__toStringGeneric(R,d,!0);W.length<ee;)W="0"+W;return v===!1&&c.sign&&(ze="-"+ze),ze+W}},{key:"__unequalSign",value:function(c){return c?-1:1}},{key:"__absoluteGreater",value:function(c){return c?-1:1}},{key:"__absoluteLess",value:function(c){return c?1:-1}},{key:"__compareToBigInt",value:function(c,d){var v=c.sign;if(v!==d.sign)return g.__unequalSign(v);var D=g.__absoluteCompare(c,d);return 0<D?g.__absoluteGreater(v):0>D?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,D=0>d;if(v!==D)return g.__unequalSign(v);if(c.length===0){if(D)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var w=H(d),_=c.__unsignedDigit(0);return _>w?g.__absoluteGreater(v):_<w?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,D=0>d;if(v!==D)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 w=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(w==2047)throw new Error("implementation bug: handled elsewhere");var _=w-1023;if(0>_)return g.__absoluteGreater(v);var I=c.length,C=c.__digit(I-1),F=g.__clz30(C),R=30*I-F,W=_+1;if(R<W)return g.__absoluteLess(v);if(R>W)return g.__absoluteGreater(v);var ee=1048576,q=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],j=g.__kBitConversionInts[g.__kBitConversionIntLow],re=20,le=29-F;if(le!==(0|(R-1)%30))throw new Error("implementation bug");var ge,we=0;if(le<re){var Re=re-le;we=Re+32,ge=q>>>Re,q=q<<32-Re|j>>>Re,j<<=32-Re}else if(le===re)we=32,ge=q,q=j,j=0;else{var ze=le-re;we=32-ze,ge=q<<ze|j>>>32-ze,q=j<<ze,j=0}if(C>>>=0,ge>>>=0,C>ge)return g.__absoluteGreater(v);if(C<ge)return g.__absoluteLess(v);for(var tt=I-2;0<=tt;tt--){0<we?(we-=30,ge=q>>>2,q=q<<30|j>>>2,j<<=30):ge=0;var Vt=c.__unsignedDigit(tt);if(Vt>ge)return g.__absoluteGreater(v);if(Vt<ge)return g.__absoluteLess(v)}if(q!==0||j!==0){if(we===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)===H(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 D=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&D++;for(var w,_=new g(D,v),I=0,C=0;C<d.length;C++)w=c.__digit(C)+d.__digit(C)+I,I=w>>>30,_.__setDigit(C,1073741823&w);for(;C<c.length;C++){var F=c.__digit(C)+I;I=F>>>30,_.__setDigit(C,1073741823&F)}return C<_.length&&_.__setDigit(C,I),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);for(var D,w=new g(c.length,v),_=0,I=0;I<d.length;I++)D=c.__digit(I)-d.__digit(I)-_,_=1&D>>>30,w.__setDigit(I,1073741823&D);for(;I<c.length;I++){var C=c.__digit(I)-_;_=1&C>>>30,w.__setDigit(I,1073741823&C)}return w.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length;v===null?v=new g(D,d):v.sign=d;for(var w,_=1,I=0;I<D;I++)w=c.__digit(I)+_,_=w>>>30,v.__setDigit(I,1073741823&w);return _!==0&&v.__setDigitGrow(D,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var D,w=new g(d,!1),_=1,I=0;I<v;I++)D=c.__digit(I)-_,_=1&D>>>30,w.__setDigit(I,1073741823&D);if(_!==0)throw new Error("implementation bug");for(var C=v;C<d;C++)w.__setDigit(C,0);return w}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=_;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)&d.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;D<w&&(_=D);var I=D;v===null?v=new g(I,!1):I=v.length;for(var C=0;C<_;C++)v.__setDigit(C,c.__digit(C)&~d.__digit(C));for(;C<D;C++)v.__setDigit(C,c.__digit(C));for(;C<I;C++)v.__setDigit(C,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=D;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)|d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=D;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)^d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var D=c.length-1;0<=D&&c.__digit(D)===d.__digit(D);)D--;return 0>D?0:c.__unsignedDigit(D)>d.__unsignedDigit(D)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,D){if(d!==0){for(var w=32767&d,_=d>>>15,I=0,C=0,F=0;F<c.length;F++,D++){var R=v.__digit(D),W=c.__digit(F),ee=32767&W,q=W>>>15,j=g.__imul(ee,w),re=g.__imul(ee,_),le=g.__imul(q,w),ge=g.__imul(q,_);R+=C+j+I,I=R>>>30,R&=1073741823,R+=((32767&re)<<15)+((32767&le)<<15),I+=R>>>30,C=ge+(re>>>15)+(le>>>15),v.__setDigit(D,1073741823&R)}for(;I!==0||C!==0;D++){var we=v.__digit(D);we+=I+C,C=0,I=we>>>30,v.__setDigit(D,1073741823&we)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,D,w){for(var _=v,I=0,C=0;C<D;C++){var F=c.__digit(C),R=g.__imul(32767&F,d),W=g.__imul(F>>>15,d),ee=R+((32767&W)<<15)+I+_;_=ee>>>30,I=W>>>15,w.__setDigit(C,1073741823&ee)}if(w.length>D)for(w.__setDigit(D++,_+I);D<w.length;)w.__setDigit(D++,0);else if(_+I!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new g(c.length,!1));for(var D=0,w=2*c.length-1;0<=w;w-=2){var _=(D<<15|c.__halfDigit(w))>>>0,I=0|_/d;D=0|_%d,_=(D<<15|c.__halfDigit(w-1))>>>0;var C=0|_/d;D=0|_%d,v.__setDigit(w>>>1,I<<15|C)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,D=0,w=2*c.length-1;0<=w;w--)v=(D<<15|c.__halfDigit(w))>>>0,D=0|v%d;return D}},{key:"__absoluteDivLarge",value:function(c,d,v,D){var w=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-w,C=null;v&&(C=new g(I+2>>>1,!1),C.__initializeDigits());var F=new g(w+2>>>1,!1);F.__initializeDigits();var R=g.__clz15(d.__halfDigit(w-1));0<R&&(d=g.__specialLeftShift(d,R,0));for(var W=g.__specialLeftShift(c,R,1),ee=d.__halfDigit(w-1),q=0,j=I;0<=j;j--){var re=32767,le=W.__halfDigit(j+w);if(le!==ee){var ge=(le<<15|W.__halfDigit(j+w-1))>>>0;re=0|ge/ee;for(var we=0|ge%ee,Re=d.__halfDigit(w-2),ze=W.__halfDigit(j+w-2);g.__imul(re,Re)>>>0>(we<<16|ze)>>>0&&(re--,we+=ee,!(32767<we)););}g.__internalMultiplyAdd(d,re,0,_,F);var tt=W.__inplaceSub(F,j,w+1);tt!==0&&(tt=W.__inplaceAdd(d,j,w),W.__setHalfDigit(j+w,32767&W.__halfDigit(j+w)+tt),re--),v&&(1&j?q=re<<15:C.__setDigit(j>>>1,q|re))}if(D)return W.__inplaceRightShift(R),v?{quotient:C,remainder:W}:W;if(v)return C;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var D=c.length,w=D+v,_=new g(w,!1);if(d===0){for(var I=0;I<D;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(D,0),_}for(var C,F=0,R=0;R<D;R++)C=c.__digit(R),_.__setDigit(R,1073741823&C<<d|F),F=C>>>30-d;return 0<v&&_.__setDigit(D,F),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var D=0|v/30,w=v%30,_=c.length,I=w!==0&&c.__digit(_-1)>>>30-w!=0,C=_+D+(I?1:0),F=new g(C,c.sign);if(w===0){for(var R=0;R<D;R++)F.__setDigit(R,0);for(;R<C;R++)F.__setDigit(R,c.__digit(R-D))}else{for(var W=0,ee=0;ee<D;ee++)F.__setDigit(ee,0);for(var q,j=0;j<_;j++)q=c.__digit(j),F.__setDigit(j+D,1073741823&q<<w|W),W=q>>>30-w;if(I)F.__setDigit(_+D,W);else if(W!==0)throw new Error("implementation bug")}return F.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,D=c.sign,w=g.__toShiftAmount(d);if(0>w)return g.__rightShiftByMaximum(D);var _=0|w/30,I=w%30,C=v-_;if(0>=C)return g.__rightShiftByMaximum(D);var F=!1;if(D){var R=(1<<I)-1;if(c.__digit(_)&R)F=!0;else for(var W=0;W<_;W++)if(c.__digit(W)!==0){F=!0;break}}if(F&&I===0){var ee=c.__digit(v-1),q=~ee==0;q&&C++}var j=new g(C,D);if(I===0){j.__setDigit(C-1,0);for(var re=_;re<v;re++)j.__setDigit(re-_,c.__digit(re))}else{for(var le,ge=c.__digit(_)>>>I,we=v-_-1,Re=0;Re<we;Re++)le=c.__digit(Re+_+1),j.__setDigit(Re,1073741823&le<<30-I|ge),ge=le>>>I;j.__setDigit(we,ge)}return F&&(j=g.__absoluteAddOne(j,!0,j)),j.__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(oe(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var D=c.valueOf;if(D){var w=D.call(c);if(oe(w)!=="object")return w}var _=c.toString;if(_){var I=_.call(c);if(oe(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return g.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return oe(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,D=new g(v,d.sign),w=v-1,_=0;_<w;_++)D.__setDigit(_,d.__digit(_));var I=d.__digit(w);if(c%30!=0){var C=32-c%30;I=I<<C>>>C}return D.__setDigit(w,I),D.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var D=Math.min,w,_=0|(c+29)/30,I=new g(_,v),C=0,F=_-1,R=0,W=D(F,d.length);C<W;C++)w=0-d.__digit(C)-R,R=1&w>>>30,I.__setDigit(C,1073741823&w);for(;C<F;C++)I.__setDigit(C,0|1073741823&-R);var ee,q=F<d.length?d.__digit(F):0,j=c%30;if(j===0)ee=0-q-R,ee&=1073741823;else{var re=32-j;q=q<<re>>>re;var le=1<<32-re;ee=le-q-R,ee&=le-1}return I.__setDigit(F,ee),I.__trim()}},{key:"__digitPow",value:function(c,d){for(var v=1;0<d;)1&d&&(v*=c),d>>>=1,c*=c;return v}},{key:"__detectBigEndian",value:function(){return g.__kBitConversionDouble[0]=-0,g.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(Me(Array));return ie.__kMaxLength=33554432,ie.__kMaxLengthBits=ie.__kMaxLength<<5,ie.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],ie.__kBitsPerCharTableShift=5,ie.__kBitsPerCharTableMultiplier=1<<ie.__kBitsPerCharTableShift,ie.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ie.__kBitConversionBuffer=new ArrayBuffer(8),ie.__kBitConversionDouble=new Float64Array(ie.__kBitConversionBuffer),ie.__kBitConversionInts=new Int32Array(ie.__kBitConversionBuffer),ie.__kBitConversionIntHigh=ie.__detectBigEndian()?0:1,ie.__kBitConversionIntLow=ie.__detectBigEndian()?1:0,ie.__clz30=t?function(N){return t(N)-2}:function(N){var H=Math.LN2,O=Math.log;return N===0?30:0|29-(0|O(N>>>0)/H)},ie.__imul=n||function(N,H){return 0|N*H},ie})});var T=zd(kc(),1),Yt=T.default.BigInt(0),hi=T.default.BigInt(1),bs=T.default.BigInt(2),Ud=T.default.BigInt(10),Vd=T.default.BigInt(24),qd=T.default.BigInt(60),Wd=T.default.BigInt(1e3),Pi=T.default.BigInt(1e6),ai=T.default.BigInt(1e9),sl=T.default.multiply(T.default.BigInt(3600),ai),Kd=T.default.multiply(qd,ai),Fn=T.default.multiply(sl,Vd);function gn(n){return typeof n=="bigint"?T.default.BigInt(n.toString(10)):n}function cl(n){return T.default.equal(T.default.remainder(n,bs),Yt)}function Kn(n){return T.default.lessThan(n,Yt)?T.default.unaryMinus(n):n}function ho(n,t){return T.default.lessThan(n,t)?-1:T.default.greaterThan(n,t)?1:0}function Xr(n,t){return{quotient:T.default.divide(n,t),remainder:T.default.remainder(n,t)}}var Tc,Cc,se="slot-epochNanoSeconds",ce="slot-iso-date",Ae="slot-iso-date-time",He="slot-time",$="slot-calendar",ll="slot-date-brand",ul="slot-year-month-brand",dl="slot-month-day-brand",_e="slot-time-zone",dt="slot-years",ht="slot-months",kt="slot-weeks",mt="slot-days",pt="slot-hours",ft="slot-minutes",gt="slot-seconds",yt="slot-milliseconds",vt="slot-microseconds",Tt="slot-nanoseconds",hl="date",ml="ym",pl="md",fl="time",gl="datetime",yl="instant",or="original",vr="timezone-canonical",Aa="timezone-original",Qr="calendar-id",vl="locale",La="options",bl=new WeakMap,Na=Symbol.for("@@Temporal__GetSlots");(Tc=globalThis)[Na]||(Tc[Na]=function(n){return bl.get(n)});var Co=globalThis[Na],Oa=Symbol.for("@@Temporal__CreateSlots");(Cc=globalThis)[Oa]||(Cc[Oa]=function(n){bl.set(n,Object.create(null))});var Tn=globalThis[Oa];function _t(n,...t){if(!n||typeof n!="object")return!1;let e=Co(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=Co(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function me(n,t,e){let r=Co(n);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=e}var Fa={};function Cn(n,t){Object.defineProperty(n.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let e=Object.getOwnPropertyNames(n);for(let i=0;i<e.length;i++){let o=e[i],a=Object.getOwnPropertyDescriptor(n,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n,o,a))}let r=Object.getOwnPropertyNames(n.prototype);for(let i=0;i<r.length;i++){let o=r[i],a=Object.getOwnPropertyDescriptor(n.prototype,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n.prototype,o,a))}Ha(t,n),Ha(`${t}.prototype`,n.prototype)}function Ha(n,t){let e=`%${n}%`;if(Fa[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);Fa[e]=t}function Qe(n){return Fa[n]}function wr(n,t){let e=n;if(e===0)return{div:e,mod:e};let r=Math.sign(e);e=Math.abs(e);let i=Math.trunc(1+Math.log10(e));if(t>=i)return{div:0*r,mod:r*e};if(t===0)return{div:r*e,mod:0*r};let o=e.toPrecision(i);return{div:r*Number.parseInt(o.slice(0,i-t),10),mod:r*Number.parseInt(o.slice(i-t),10)}}function Ca(n,t,e){let r=n,i=e;if(r===0)return i;let o=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return o*Number.parseInt(a+"0".repeat(t),10);let s=a+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,"0");return o*Number.parseInt(s,10)}function Io(n,t){let e=t==="negative";switch(n){case"ceil":return e?"zero":"infinity";case"floor":return e?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return e?"half-zero":"half-infinity";case"halfFloor":return e?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function Po(n,t,e,r,i){return i==="zero"?n:i==="infinity"?t:e<0?n:e>0?t:i==="half-zero"?n:i==="half-infinity"?t:r?n:t}var Se=class n{constructor(t){this.totalNs=gn(t),this.sec=T.default.toNumber(T.default.divide(this.totalNs,ai)),this.subsec=T.default.toNumber(T.default.remainder(this.totalNs,ai))}static validateNew(t,e){if(T.default.greaterThan(Kn(t),n.MAX))throw new RangeError(`${e} of duration time units cannot exceed ${n.MAX} s`);return new n(t)}static fromEpochNsDiff(t,e){let r=T.default.subtract(gn(t),gn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=T.default.add(T.default.add(T.default.add(T.default.add(T.default.add(T.default.BigInt(a),T.default.multiply(T.default.BigInt(o),Wd)),T.default.multiply(T.default.BigInt(i),Pi)),T.default.multiply(T.default.BigInt(r),ai)),T.default.multiply(T.default.BigInt(e),Kd)),T.default.multiply(T.default.BigInt(t),sl));return n.validateNew(s,"total")}abs(){return new n(Kn(this.totalNs))}add(t){return n.validateNew(T.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(T.default.add(this.totalNs,T.default.multiply(T.default.BigInt(t),Fn)),"sum")}addToEpochNs(t){return T.default.add(gn(t),this.totalNs)}cmp(t){return ho(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=Xr(this.totalNs,T.default.BigInt(t));return{quotient:T.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=gn(t),r=T.default.BigInt(e),{quotient:i,remainder:o}=Xr(this.totalNs,r),a=[],s,u=(T.default.lessThan(this.totalNs,Yt)?-1:1)*Math.sign(T.default.toNumber(e));for(;!T.default.equal(o,Yt)&&a.length<50;)o=T.default.multiply(o,Ud),{quotient:s,remainder:o}=Xr(o,r),a.push(Math.abs(T.default.toNumber(s)));return u*+(Kn(i).toString()+"."+a.join(""))}isZero(){return T.default.equal(this.totalNs,Yt)}round(t,e){let r=gn(t);if(T.default.equal(r,hi))return this;let{quotient:i,remainder:o}=Xr(this.totalNs,r),a=T.default.lessThan(this.totalNs,Yt)?"negative":"positive",s=T.default.multiply(Kn(i),r),u=T.default.add(s,r),l=ho(Kn(T.default.multiply(o,bs)),r),h=Io(e,a),p=T.default.equal(Kn(this.totalNs),s)?s:Po(s,u,l,cl(i),h),y=a==="positive"?p:T.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Yt))}subtract(t){return n.validateNew(T.default.subtract(this.totalNs,t.totalNs),"difference")}};Se.MAX=T.default.BigInt("9007199254740991999999999"),Se.ZERO=new Se(Yt);var Ic=/[A-Za-z._][A-Za-z._0-9+-]*/,xi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Ic.source})(?:\\/(?:${Ic.source}))*)`),wl=/(?:[+-]\d{6}|\d{4})/,mo=/(?:0[1-9]|1[0-2])/,Ya=/(?:0[1-9]|[12]\d|3[01])/,Gd=new RegExp(`(${wl.source})(?:-(${mo.source})-(${Ya.source})|(${mo.source})(${Ya.source}))`),Dl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,El=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,_l=new RegExp(`([zZ])|${El.source}?`),Mr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Zd=new RegExp([`^${Gd.source}`,`(?:(?:[tT]|\\s+)${Dl.source}(?:${_l.source})?)?`,`(?:\\[!?(${xi.source})\\])?`,`((?:${Mr.source})*)$`].join("")),Jd=new RegExp([`^[tT]?${Dl.source}`,`(?:${_l.source})?`,`(?:\\[!?${xi.source}\\])?`,`((?:${Mr.source})*)$`].join("")),Xd=new RegExp(`^(${wl.source})-?(${mo.source})(?:\\[!?${xi.source}\\])?((?:${Mr.source})*)$`),Qd=new RegExp(`^(?:--)?(${mo.source})-?(${Ya.source})(?:\\[!?${xi.source}\\])?((?:${Mr.source})*)$`),Ia=/(\d+)(?:[.,](\d{1,9}))?/,eh=new RegExp(`(?:${Ia.source}H)?(?:${Ia.source}M)?(?:${Ia.source}S)?`),th=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${eh.source})?$`,"i"),Hn=864e5,po=1e6*Hn,nh=6e10,Ml=1e8*Hn,Sr=Qt(Ml),mi=T.default.unaryMinus(Sr),rh=T.default.add(T.default.subtract(mi,Fn),hi),ih=T.default.subtract(T.default.add(Sr,Fn),hi),oh=146097*Hn,Pc=-271821,xc=275760,si=Date.UTC(1847,0,1),ah=["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"],sh=new Set(["ACT","AET","AGT","ART","AST","BET","BST","CAT","CNT","CST","CTT","EAT","ECT","IET","IST","JST","MIT","NET","NST","PLT","PNT","PRT","PST","SST","VST"]);function Ye(n){return typeof n=="object"&&n!==null||typeof n=="function"}function xo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function Ro(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function ue(n){let t=xo(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 Rc(n,t){let e=ue(n);if(e<=0)throw t!==void 0?new RangeError(`property '${t}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return e}function Jt(n){let t=xo(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 pi(n,t){return String(n).padStart(t,"0")}function Ve(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function $a(n,t){if(Ye(n)){let e=n?.toString();if(typeof e=="string"||typeof e=="number")return e;throw new TypeError("Cannot convert object to primitive value")}return n}var Ba=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],ch={era:Ro,eraYear:ue,year:ue,month:Rc,monthCode:function(n){let t=Ve($a(n));if(t.length<3||t.length>4||t[0]!=="M"||"0123456789".indexOf(t[1])===-1||"0123456789".indexOf(t[2])===-1||t[1]+t[2]==="00"&&t[3]!=="L"||t[3]!=="L"&&t[3]!==void 0)throw new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:Rc,hour:ue,minute:ue,second:ue,millisecond:ue,microsecond:ue,nanosecond:ue,offset:function(n){let t=Ve($a(n));return Lr(t),t},timeZone:Dt},lh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},kr=[["years","year","date"],["months","month","date"],["weeks","week","date"],["days","day","date"],["hours","hour","time"],["minutes","minute","time"],["seconds","second","time"],["milliseconds","millisecond","time"],["microseconds","microsecond","time"],["nanoseconds","nanosecond","time"]],Ac=Object.fromEntries(kr.map(n=>[n[0],n[1]])),uh=Object.fromEntries(kr.map(([n,t])=>[t,n])),ci=kr.map(([,n])=>n),Tr={day:po,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},fo=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],dh=Intl.DateTimeFormat,Lc=new Map;function Sl(n){let t=bi(n),e=Lc.get(t);return e===void 0&&(e=new dh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Lc.set(t,e)),e}function Ze(n){return _t(n,se)&&!_t(n,_e,$)}function Oe(n){return _t(n,dt,ht,mt,pt,ft,gt,yt,vt,Tt)}function Fe(n){return _t(n,ll)}function $e(n){return _t(n,He)}function Pe(n){return _t(n,Ae)}function Je(n){return _t(n,ul)}function Ht(n){return _t(n,dl)}function pe(n){return _t(n,se,_e,$)}function P(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function xr(n){if(_t(n,$)||_t(n,_e))throw new TypeError("with() does not support a calendar or timeZone property");if($e(n))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(n.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(n.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Ri(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Ao(n){let t,e,r=!1;for(Mr.lastIndex=0;e=Mr.exec(n);){let{1:i,2:o,3:a}=e;if(o==="u-ca"){if(t===void 0)t=a,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${n}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${o}=${a}`)}return t}function mn(n){let t=Zd.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Ao(t[16]),r=t[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);let i=+r,o=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=t[6]!==void 0,u=+(t[6]??0),l=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),E=+p.slice(3,6),S=+p.slice(6,9),k,A=!1;t[13]?(k=void 0,A=!0):t[14]&&(k=t[14]);let B=t[15];return Ss(i,o,a,u,l,h,y,E,S),{year:i,month:o,day:a,time:s?{hour:u,minute:l,second:h,millisecond:y,microsecond:E,nanosecond:S}:"start-of-day",tzAnnotation:B,offset:k,z:A,calendar:e}}function kl(n){let t=Jd.exec(n),e,r,i,o,a,s,u;if(t){u=Ao(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let l=(t[4]??t[7]??"")+"000000000";if(o=+l.slice(0,3),a=+l.slice(3,6),s=+l.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let l,h;if({time:l,z:h,calendar:u}=mn(n),l==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=l)}if(Fo(e,r,i,o,a,s),/[tT ][0-9][0-9]/.test(n))return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u};try{let{month:l,day:h}=Ds(n);Qn(1972,l,h)}catch{try{let{year:l,month:h}=ws(n);Qn(l,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function ws(n){let t=Xd.exec(n),e,r,i,o;if(t){i=Ao(t[3]);let a=t[1];if(a==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);if(e=+a,r=+t[2],o=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let a;if({year:e,month:r,calendar:i,day:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ds(n){let t=Qd.exec(n),e,r,i,o;if(t){if(i=Ao(t[3]),e=+t[1],r=+t[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let a;if({month:e,day:r,calendar:i,year:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Tl=new RegExp(`^${xi.source}$`,"i"),Cl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Il(n){let t=mh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function On(n){return Tl.test(n)||Il(n),Cl.test(n)?{offsetMinutes:Lr(n)/6e10}:{tzName:n}}function li(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":Qn(i,o,a);break;case"constrain":({year:i,month:o,day:a}=ql(i,o,a))}return{year:i,month:o,day:a}}function Lo(n,t,e,r,i,o,a){let s=n,u=t,l=e,h=r,p=i,y=o;switch(a){case"reject":Fo(s,u,l,h,p,y);break;case"constrain":s=bt(s,0,23),u=bt(u,0,59),l=bt(l,0,59),h=bt(h,0,999),p=bt(p,0,999),y=bt(y,0,999)}return{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}function Pl(n){if(!Ye(n))throw new TypeError("invalid duration-like");let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},e=!1;for(let r=0;r<fo.length;r++){let i=fo[r],o=n[i];o!==void 0&&(e=!0,t[i]=Jt(o))}if(!e)throw new TypeError("invalid duration-like");return t}function rt({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function De(n,t){return{isoDate:n,time:t}}function ve(n){return _n(n,"overflow",["constrain","reject"],"constrain")}function ui(n){return _n(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function en(n,t){return _n(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function uo(n,t){return _n(n,"offset",["prefer","use","ignore","reject"],t)}function Ai(n){return _n(n,"calendarName",["auto","always","never","critical"],"auto")}function Rr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=ue(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Ar(n,t,e){let r=e?t:t-1;if(n>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${n}`);if(t%n!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function Li(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(Ro(t)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}let e=Math.floor(t);if(!Number.isFinite(e)||e<0||e>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return e}function Ni(n,t){switch(n){case"minute":return{precision:"minute",unit:"minute",increment:1};case"second":return{precision:0,unit:"second",increment:1};case"millisecond":return{precision:3,unit:"millisecond",increment:1};case"microsecond":return{precision:6,unit:"microsecond",increment:1};case"nanosecond":return{precision:9,unit:"nanosecond",increment:1}}switch(t){case"auto":return{precision:t,unit:"nanosecond",increment:1};case 0:return{precision:t,unit:"second",increment:1};case 1:case 2:case 3:return{precision:t,unit:"millisecond",increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:"microsecond",increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:"nanosecond",increment:10**(9-t)};default:throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}var Sn=Symbol("~required~");function It(n,t,e,r,i=[]){let o=[];for(let l=0;l<kr.length;l++){let h=kr[l],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===Sn?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let l=0;l<o.length;l++){let h=o[l],p=uh[h];p!==void 0&&s.push(p)}let u=_n(n,t,s,a);if(u===void 0&&r===Sn)throw new RangeError(`${t} is required`);return u&&u in Ac?Ac[u]:u}function Pa(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",u=!1;if(Ye(t)){if(pe(t))return{zonedRelativeTo:t};if(Fe(t))return{plainRelativeTo:t};if(Pe(t))return{plainRelativeTo:wt(m(t,Ae).isoDate,m(t,$))};i=$i(t);let l=zt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Fi(i,l,"constrain")),{offset:a,timeZone:o}=l,a===void 0&&(s="wall")}else{let l,h,p,y,E;if({year:p,month:y,day:E,time:r,calendar:i,tzAnnotation:l,offset:a,z:h}=mn(Ve(t)),l)o=Dt(l),h?s="exact":a||(s="wall"),u=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=Mt(i),e={year:p,month:y,day:E}}return o===void 0?{plainRelativeTo:wt(e,i)}:{zonedRelativeTo:nt(go(e,r,s,s==="option"?Lr(a):0,o,"compatible","reject",u),o,i)}}function yn(n){return m(n,dt)!==0?"year":m(n,ht)!==0?"month":m(n,kt)!==0?"week":m(n,mt)!==0?"day":m(n,pt)!==0?"hour":m(n,ft)!==0?"minute":m(n,gt)!==0?"second":m(n,yt)!==0?"millisecond":m(n,vt)!==0?"microsecond":"nanosecond"}function Dn(n,t){return ci.indexOf(n)>ci.indexOf(t)?t:n}function an(n){return n==="year"||n==="month"||n==="week"}function vn(n){return an(n)||n==="day"?"date":"time"}function Bn(n){return Qe("%calendarImpl%")(n)}function Oi(n){return Qe("%calendarImpl%")(m(n,$))}function Et(n,t,e="date"){let r=Object.create(null),i=Bn(n).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,e!=="month-day"&&e!=="date"||(r.day=i.day),e!=="year-month"&&e!=="date"||(r.year=i.year),r}function zt(n,t,e,r,i){let o=Bn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),u=!1;a.sort();for(let l=0;l<a.length;l++){let h=a[l],p=t[h];if(p!==void 0)u=!0,s[h]=(0,ch[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=lh[h]}}if(i==="partial"&&!u)throw new TypeError("no supported properties found");return s}function ja(n,t="complete"){let e=["hour","microsecond","millisecond","minute","nanosecond","second"],r=!1,i=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],s=n[a];s!==void 0?(i[a]=ue(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function ei(n,t){if(Ye(n)){if(Fe(n))return ve(te(t)),wt(m(n,ce),m(n,$));if(pe(n)){let u=Gt(m(n,_e),m(n,se));return ve(te(t)),wt(u.isoDate,m(n,$))}if(Pe(n))return ve(te(t)),wt(m(n,Ae).isoDate,m(n,$));let s=$i(n);return wt(Yn(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=mn(Ve(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Mt(o),ve(te(t)),wt({year:e,month:r,day:i},o)}function Fi(n,t,e){return De(Yn(n,t,e),Lo(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function ti(n,t){let e,r,i;if(Ye(n)){if(Pe(n))return ve(te(t)),qt(m(n,Ae),m(n,$));if(pe(n)){let s=Gt(m(n,_e),m(n,se));return ve(te(t)),qt(s,m(n,$))}if(Fe(n))return ve(te(t)),qt(De(m(n,ce),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,$));i=$i(n);let o=zt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=ve(te(t));({isoDate:e,time:r}=Fi(i,o,a))}else{let o,a,s,u;if({year:a,month:s,day:u,time:r,calendar:i,z:o}=mn(Ve(n)),o)throw new RangeError("Z designator not supported for PlainDateTime");r==="start-of-day"&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Ss(a,s,u,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Mt(i),ve(te(t)),e={year:a,month:s,day:u}}return qt(De(e,r),i)}function Kt(n){let t=Qe("%Temporal.Duration%");if(Oe(n))return new t(m(n,dt),m(n,ht),m(n,kt),m(n,mt),m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt));if(!Ye(n))return function(i){let{years:o,months:a,weeks:s,days:u,hours:l,minutes:h,seconds:p,milliseconds:y,microseconds:E,nanoseconds:S}=function(k){let A=th.exec(k);if(!A)throw new RangeError(`invalid duration: ${k}`);if(A.every((v,D)=>D<2||v===void 0))throw new RangeError(`invalid duration: ${k}`);let B=A[1]==="-"?-1:1,V=A[2]===void 0?0:ue(A[2])*B,G=A[3]===void 0?0:ue(A[3])*B,U=A[4]===void 0?0:ue(A[4])*B,J=A[5]===void 0?0:ue(A[5])*B,oe=A[6]===void 0?0:ue(A[6])*B,Te=A[7],Me=A[8],ie=A[9],N=A[10],H=A[11],O=0,ne=0,g=0;if(Te!==void 0){if(Me??ie??N??H)throw new RangeError("only the smallest unit can be fractional");g=3600*ue((Te+"000000000").slice(0,9))*B}else if(O=Me===void 0?0:ue(Me)*B,ie!==void 0){if(N??H)throw new RangeError("only the smallest unit can be fractional");g=60*ue((ie+"000000000").slice(0,9))*B}else ne=N===void 0?0:ue(N)*B,H!==void 0&&(g=ue((H+"000000000").slice(0,9))*B);let L=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return ne+=Math.trunc(g/1e9)%60,O+=Math.trunc(g/6e10),Ho(V,G,U,J,oe,O,ne,d,c,L),{years:V,months:G,weeks:U,days:J,hours:oe,minutes:O,seconds:ne,milliseconds:d,microseconds:c,nanoseconds:L}}(i);return new(Qe("%Temporal.Duration%"))(o,a,s,u,l,h,p,y,E,S)}(Ve(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Pl(n);for(let i=0;i<fo.length;i++){let o=fo[i],a=r[o];a!==void 0&&(e[o]=a)}return new t(e.years,e.months,e.weeks,e.days,e.hours,e.minutes,e.seconds,e.milliseconds,e.microseconds,e.nanoseconds)}function ni(n){let t;if(Ye(n)){if(Ze(n)||pe(n))return Xt(m(n,se));t=$a(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(k){let A=mn(k);if(!A.z&&!A.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return A}(Ve(t)),{hour:u=0,minute:l=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:E=0}=o==="start-of-day"?{}:o,S=vi(e,r,i,u,l,h,p,y,E-(s?0:Lr(a)));return _r(S.isoDate),Xt(Xe(S))}function Nc(n,t){if(Ye(n)){if(Ht(n))return ve(te(t)),Dr(m(n,ce),m(n,$));let s;return _t(n,$)?s=m(n,$):(s=n.calendar,s===void 0&&(s="iso8601"),s=Yi(s)),Dr(yo(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ds(Ve(n));if(o===void 0&&(o="iso8601"),o=Mt(o),ve(te(t)),o==="iso8601")return Dr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return ar(a),a=yo(o,Et(o,a,"month-day"),"constrain"),Dr(a,o)}function Ln(n,t){let e;if(Ye(n)){if($e(n))return ve(te(t)),bn(m(n,He));if(Pe(n))return ve(te(t)),bn(m(n,Ae).time);if(pe(n)){let l=Gt(m(n,_e),m(n,se));return ve(te(t)),bn(l.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:u}=ja(n);e=Lo(r,i,o,a,s,u,ve(te(t)))}else e=kl(Ve(n)),ve(te(t));return bn(e)}function xl(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Ln(n),He)}function ri(n,t){if(Ye(n)){if(Je(n))return ve(te(t)),Er(m(n,ce),m(n,$));let s=$i(n);return Er(fi(s,zt(s,n,["year","month","monthCode"],[],[]),ve(te(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=ws(Ve(n));o===void 0&&(o="iso8601"),o=Mt(o),ve(te(t));let a={year:e,month:r,day:i};return ks(a),a=fi(o,Et(o,a,"year-month"),"constrain"),Er(a,o)}function go(n,t,e,r,i,o,a,s){if(t==="start-of-day")return Rn(i,n);let u=De(n,t);if(e==="wall"||a==="ignore")return it(i,u,o);if(e==="exact"||a==="use"){let p=vi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);_r(p.isoDate);let y=Xe(p);return dn(y),y}_r(n);let l=Xe(u),h=gi(i,u);for(let p=0;p<h.length;p++){let y=h[p],E=T.default.toNumber(T.default.subtract(l,y)),S=Nn(E,6e10,"halfExpand");if(E===r||s&&S===r)return y}if(a==="reject"){let p=za(r),y=yi(u,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return $l(h,i,u,o)}function ii(n,t){let e,r,i,o,a,s,u,l=!1,h="option";if(Ye(n)){if(pe(n)){let k=te(t);return ui(k),uo(k,"reject"),ve(k),nt(m(n,se),m(n,_e),m(n,$))}a=$i(n);let y=zt(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 E=te(t);s=ui(E),u=uo(E,"reject");let S=ve(E);({isoDate:e,time:r}=Fi(a,y,S))}else{let y,E,S,k,A;({year:S,month:k,day:A,time:r,tzAnnotation:y,offset:o,z:E,calendar:a}=function(V){let G=mn(V);if(!G.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return G}(Ve(n))),i=Dt(y),E?h="exact":o||(h="wall"),a||(a="iso8601"),a=Mt(a),l=!0;let B=te(t);s=ui(B),u=uo(B,"reject"),ve(B),e={year:S,month:k,day:A}}let p=0;return h==="option"&&(p=Lr(o)),nt(go(e,r,h,p,i,s,u,l),i,a)}function Rl(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,ll,!0)}function wt(n,t){let e=Qe("%Temporal.PlainDate%"),r=Object.create(e.prototype);return Rl(r,n,t),r}function Al(n,t,e){er(t),Tn(n),me(n,Ae,t),me(n,$,e)}function qt(n,t){let e=Qe("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return Al(r,n,t),r}function Ll(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,dl,!0)}function Dr(n,t){let e=Qe("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return Ll(r,n,t),r}function Nl(n,t){Tn(n),me(n,He,t)}function bn(n){let t=Qe("%Temporal.PlainTime%"),e=Object.create(t.prototype);return Nl(e,n),e}function Ol(n,t,e){ks(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,ul,!0)}function Er(n,t){let e=Qe("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return Ol(r,n,t),r}function Fl(n,t){dn(t),Tn(n),me(n,se,t)}function Xt(n){let t=Qe("%Temporal.Instant%"),e=Object.create(t.prototype);return Fl(e,n),e}function Hl(n,t,e,r){dn(t),Tn(n),me(n,se,t),me(n,_e,e),me(n,$,r)}function nt(n,t,e="iso8601"){let r=Qe("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return Hl(i,n,t,e),i}function Oc(n){return Ba.filter(t=>n[t]!==void 0)}function Xn(n,t,e){let r=Oc(e),i=Bn(n).fieldKeysToIgnore(r),o=Object.create(null),a=Oc(t);for(let s=0;s<Ba.length;s++){let u,l=Ba[s];a.includes(l)&&!i.includes(l)&&(u=t[l]),r.includes(l)&&(u=e[l]),u!==void 0&&(o[l]=u)}return o}function Bt(n,t,e,r){let i=Bn(n).dateAdd(t,e,r);return ar(i),i}function Hi(n,t,e,r){return Bn(n).dateUntil(t,e,r)}function Yi(n){if(Ye(n)&&_t(n,$))return m(n,$);let t=Ve(n);try{return Mt(t)}catch{}let e;try{({calendar:e}=mn(t))}catch{try{({calendar:e}=kl(t))}catch{try{({calendar:e}=ws(t))}catch{({calendar:e}=Ds(t))}}}return e||(e="iso8601"),Mt(e)}function $i(n){if(_t(n,$))return m(n,$);let{calendar:t}=n;return t===void 0?"iso8601":Yi(t)}function un(n,t){return Mt(n)===Mt(t)}function Yn(n,t,e){let r=Bn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return ar(i),i}function fi(n,t,e){let r=Bn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return ks(i),i}function yo(n,t,e){let r=Bn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return ar(i),i}function Dt(n){if(Ye(n)&&pe(n))return m(n,_e);let t=Ve(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:u}=function(l){if(Tl.test(l))return{tzAnnotation:l,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=mn(l);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Il(l)}(o);return a?On(a):u?On("UTC"):s?On(s):void 0}(t);if(r!==void 0)return Es(r);let i=vo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function Yl(n,t){if(n===t)return!0;let e=On(n).offsetMinutes,r=On(t).offsetMinutes;if(e===void 0&&r===void 0){let i=vo(t);if(!i)return!1;let o=vo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function wn(n,t){let e=On(n).offsetMinutes;return e!==void 0?6e10*e:Ua(n,t)}function za(n){let t=n<0?"-":"+",e=Math.abs(n),r=Math.floor(e/36e11),i=Math.floor(e/6e10)%60,o=Math.floor(e/1e9)%60,a=e%1e9;return`${t}${No(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function Gt(n,t){let e=wn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:u,millisecond:l,microsecond:h,nanosecond:p}}=zl(t);return vi(r,i,o,a,s,u,l,h,p+e)}function it(n,t,e){return $l(gi(n,t),n,t,e)}function $l(n,t,e,r){let i=n.length;if(i===1)return n[0];if(i)switch(r){case"compatible":case"earlier":return n[0];case"later":return n[i-1];case"reject":throw new RangeError("multiple instants found")}if(r==="reject")throw new RangeError("multiple instants found");let o=Xe(e),a=T.default.subtract(o,Fn);dn(a);let s=wn(t,a),u=T.default.add(o,Fn);dn(u);let l=wn(t,u)-s;switch(r){case"earlier":{let h=Se.fromComponents(0,0,0,0,0,-l),p=Cr(e.time,h);return gi(t,De(Pt(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Se.fromComponents(0,0,0,0,0,l),p=Cr(e.time,h),y=gi(t,De(Pt(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function gi(n,t){if(n==="UTC")return _r(t.isoDate),[Xe(t)];let e=On(n).offsetMinutes;if(e!==void 0){let r=vi(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-e,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);_r(r.isoDate);let i=Xe(r);return dn(i),[i]}return _r(t.isoDate),function(r,i){let o=Xe(i),a=T.default.subtract(o,Fn);T.default.lessThan(a,mi)&&(a=o);let s=T.default.add(o,Fn);T.default.greaterThan(s,Sr)&&(s=o);let u=Ua(r,a),l=Ua(r,s);return(u===l?[u]:[u,l]).map(p=>{let y=T.default.subtract(o,T.default.BigInt(p)),E=function(S,k){let{epochMilliseconds:A,time:{millisecond:B,microsecond:V,nanosecond:G}}=zl(k),{year:U,month:J,day:oe,hour:Te,minute:Me,second:ie}=Ul(S,A);return vi(U,J,oe,Te,Me,ie,B,V,G)}(r,y);if(Ir(i,E)===0)return dn(y),y}).filter(p=>p!==void 0)}(n,t)}function Rn(n,t){let e=De(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=gi(n,e);if(r.length)return r[0];let i=Xe(e),o=T.default.subtract(i,Fn);return dn(o),Ms(n,o)}function Bi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+pi(Math.abs(n),6):pi(n,4),t}function jt(n){return pi(n,2)}function Bl(n,t){let e;if(t==="auto"){if(n===0)return"";e=pi(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=pi(n,9).slice(0,t)}return`.${e}`}function No(n,t,e,r,i){let o=`${jt(n)}:${jt(t)}`;return i==="minute"||(o+=`:${jt(e)}`,o+=Bl(r,i)),o}function Fc(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,se),o=yi(Gt(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=jl(wn(r,i))),`${o}${a}`}function lo(n,t){let e=m(n,dt),r=m(n,ht),i=m(n,kt),o=m(n,mt),a=m(n,pt),s=m(n,ft),u=wo(n),l="";e!==0&&(l+=`${Math.abs(e)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),o!==0&&(l+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=Se.fromComponents(0,0,m(n,gt),m(n,yt),m(n,vt),m(n,Tt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(yn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${Bl(Math.abs(p.subsec),t)}S`);let y=`${u<0?"-":""}P${l}`;return h&&(y=`${y}T${h}`),y}function Hc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce);return`${Bi(e)}-${jt(r)}-${jt(i)}${Ri(m(n,$),t)}`}function Yc({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return No(n,t,e,1e6*r+1e3*i+o,a)}function yi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${Bi(i)}-${jt(o)}-${jt(a)}T${No(s,u,l,1e6*h+1e3*p+y,e)}${Ri(t,r)}`}function $c(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${jt(r)}-${jt(i)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Bi(e)}-${o}`);let s=Ri(a,t);return s&&(o+=s),o}function Bc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${Bi(e)}-${jt(r)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${jt(i)}`);let s=Ri(a,t);return s&&(o+=s),o}function jc(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,se);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=Ka(a,p,h,y)}let s=m(n,_e),u=wn(s,a),l=yi(Gt(s,a),"iso8601",t,"never");return i!=="never"&&(l+=jl(u)),r!=="never"&&(l+=`[${r==="critical"?"!":""}${s}]`),l+=Ri(m(n,$),e),l}function zc(n){return Cl.test(n)}function Lr(n){let t=ph.exec(n);if(!t)throw new RangeError(`invalid time zone offset: ${n}; must match \xB1HH:MM[:SS.SSSSSSSSS]`);return(t[1]==="-"?-1:1)*(1e9*(60*(60*+t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+"000000000").slice(0,9))}var Gr,hh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function vo(n){if(Gr===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){Gr=new Map;for(let a=0;a<o.length;a++){let s=o[a];Gr.set(bi(s),s)}}else Gr=null}let t=bi(n),e=Gr?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Sl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),sh.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||hh[t[a-1]]?o.toUpperCase():o).join("").split("/");if(r.length===1)return t==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:e}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:e};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:e};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:e};let i=new Map([["Act","ACT"],["Lhi","LHI"],["Nsw","NSW"],["Dar_Es_Salaam","Dar_es_Salaam"],["Port_Of_Spain","Port_of_Spain"],["Port-Au-Prince","Port-au-Prince"],["Isle_Of_Man","Isle_of_Man"],["Comodrivadavia","ComodRivadavia"],["Knox_In","Knox_IN"],["Dumontdurville","DumontDUrville"],["Mcmurdo","McMurdo"],["Denoronha","DeNoronha"],["Easterisland","EasterIsland"],["Bajanorte","BajaNorte"],["Bajasur","BajaSur"]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join("/"),primaryIdentifier:e}}function Zn(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=Ul(n,t),u=t%1e3;return u<0&&(u+=1e3),1e6*(_s({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:u}})-t)}function Ua(n,t){return Zn(n,Zt(t,"floor"))}function Es(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${No(Math.floor(e/60),e%60,0,0,"minute")}`}function jl(n){return Es(Nn(n,nh,"halfExpand")/6e10)}function _s({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,u=(n-s)/400,l=new Date;return l.setUTCHours(r,i,o,a),l.setUTCFullYear(s,t-1,e),l.getTime()+oh*u}function Xe(n){let t=_s(n),e=1e3*n.time.microsecond+n.time.nanosecond;return T.default.add(Qt(t),T.default.BigInt(e))}function zl(n){let t=Zt(n,"trunc"),e=T.default.toNumber(T.default.remainder(n,Pi));e<0&&(e+=1e6,t-=1);let r=Math.floor(e/1e3)%1e3,i=e%1e3,o=new Date(t);return{epochMilliseconds:t,isoDate:{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()},time:{hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function Ms(n,t){if(n==="UTC")return null;let e=Zt(t,"floor");if(e<si)return Ms(n,Qt(si));let r=Date.now(),i=Math.max(e,r)+366*Hn*3,o=e,a=Zn(n,o),s=o,u=a;for(;a===u&&o<i;){if(s=o+2*Hn*7,s>Ml)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(eu(l=>Zn(n,l),o,s,a,u))}function Va(n,t){if(n==="UTC")return null;let e=Zt(t,"ceil"),r=Date.now(),i=r+366*Hn*3;if(e>i){let l=Va(n,Qt(i));if(l===null||T.default.lessThan(l,Qt(r)))return l}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let l=Date.UTC(2088,0,1);if(l<e)return Va(n,Qt(l))}let o=e-1;if(o<si)return null;let a=Zn(n,o),s=o,u=a;for(;a===u&&o>si;){if(s=o-2*Hn*7,s<si)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(eu(l=>Zn(n,l),s,o,u,a))}function Ul(n,t){return function(e){let r=e.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${e}`);let i=+r[0],o=+r[1],a=+r[2],s=r[3];if(s[0]==="b"||s[0]==="B")a=1-a;else if(s[0]!=="a"&&s[0]!=="A")throw new RangeError(`Unknown era ${s} in "${e}`);let u=r[4]==="24"?0:+r[4],l=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(u)&&Number.isFinite(l)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:u,minute:l,second:h}}(Sl(n).format(t))}function bo(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function Jn(n,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[bo(n)?"leapyear":"standard"][t-1]}function wo(n){let t=[m(n,dt),m(n,ht),m(n,kt),m(n,mt),m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Oo(n){let t=["years","months","weeks","days"];for(let e=0;e<t.length;e++){let r=n[t[e]];if(r!==0)return r<0?-1:1}return 0}function Vl(n){let t=Oo(n.date);return t!==0?t:n.time.sign()}function Gn(n,t){let e=n,r=t;if(!Number.isFinite(e)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,e+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:e,month:r}}function Pt(n,t,e){let r=n,i=t,o=e;if(!Number.isFinite(o))throw new RangeError("infinity is out of range");({year:r,month:i}=Gn(r,i));let a=146097;if(Math.abs(o)>a){let l=Math.trunc(o/a);r+=400*l,o-=l*a}let s=0,u=i>2?r:r-1;for(;s=bo(u)?366:365,o<-s;)r-=1,u-=1,o+=s;for(u+=1;s=bo(u)?366:365,o>s;)r+=1,u+=1,o-=s;for(;o<1;)({year:r,month:i}=Gn(r,i-1)),o+=Jn(r,i);for(;o>Jn(r,i);)o-=Jn(r,i),{year:r,month:i}=Gn(r,i+1);return{year:r,month:i,day:o}}function vi(n,t,e,r,i,o,a,s,u){let l=An(r,i,o,a,s,u);return De(Pt(n,t,e+l.deltaDays),l)}function An(n,t,e,r,i,o){let a,s=n,u=t,l=e,h=r,p=i,y=o;({div:a,mod:y}=wr(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=wr(p,3),h+=a,p<0&&(h-=1,p+=1e3),l+=Math.trunc(h/1e3),h%=1e3,h<0&&(l-=1,h+=1e3),u+=Math.trunc(l/60),l%=60,l<0&&(u-=1,l+=60),s+=Math.trunc(u/60),u%=60,u<0&&(s-=1,u+=60);let E=Math.trunc(s/24);return s%=24,s<0&&(E-=1,s+=24),E+=0,s+=0,u+=0,l+=0,h+=0,p+=0,y+=0,{deltaDays:E,hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}function Uc(n,t){let e=rt(n,0);if(Oo(e)===0)return n.days;let r=m(t,ce),i=Bt(m(t,$),r,e,"constrain"),o=tr(r.year,r.month-1,r.day),a=tr(i.year,i.month-1,i.day)-o;return n.days+a}function xt(n){return new(Qe("%Temporal.Duration%"))(-m(n,dt),-m(n,ht),-m(n,kt),-m(n,mt),-m(n,pt),-m(n,ft),-m(n,gt),-m(n,yt),-m(n,vt),-m(n,Tt))}function bt(n,t,e){return Math.min(e,Math.max(t,n))}function ql(n,t,e){let r=bt(t,1,12);return{year:n,month:r,day:bt(e,1,Jn(n,r))}}function We(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function Qn(n,t,e){We(t,1,12),We(e,1,Jn(n,t))}function ar(n){er(De(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Fo(n,t,e,r,i,o){We(n,0,23),We(t,0,59),We(e,0,59),We(r,0,999),We(i,0,999),We(o,0,999)}function Ss(n,t,e,r,i,o,a,s,u){Qn(n,t,e),Fo(r,i,o,a,s,u)}function er(n){let t=Xe(n);(T.default.lessThan(t,rh)||T.default.greaterThan(t,ih))&&dn(t)}function qa(n){Xe(n)}function dn(n){if(T.default.lessThan(n,mi)||T.default.greaterThan(n,Sr))throw new RangeError("date/time value is outside of supported range")}function ks({year:n,month:t}){We(n,Pc,xc),n===Pc?We(t,4,12):n===xc&&We(t,1,9)}function Ho(n,t,e,r,i,o,a,s,u,l){let h=0,p=[n,t,e,r,i,o,a,s,u,l];for(let B=0;B<p.length;B++){let V=p[B];if(V===1/0||V===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(V!==0){let G=V<0?-1:1;if(h!==0&&G!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=G}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let y=wr(s,3),E=wr(u,6),S=wr(l,9),k=wr(1e6*y.mod+1e3*E.mod+S.mod,9).div,A=86400*r+3600*i+60*o+a+y.div+E.div+S.div+k;if(!Number.isSafeInteger(A))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function br(n){return{date:{years:m(n,dt),months:m(n,ht),weeks:m(n,kt),days:m(n,mt)},time:Se.fromComponents(m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt))}}function cn(n){let t=Se.fromComponents(m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt)).add24HourDays(m(n,mt));return{date:{years:m(n,dt),months:m(n,ht),weeks:m(n,kt),days:0},time:t}}function Wl(n){let t=cn(n),e=Math.trunc(t.time.sec/86400);return Ho(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function Wt(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,u=0,l=0;switch(t){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60,l=Math.trunc(u/24),u%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,o=Ca(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Ca(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Ca(a,9,r),a=0}return new(Qe("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*l,e*u,e*s,e*a,e*o,e*i,e*r)}function En(n,t){return Oo(n),t.sign(),{date:n,time:t}}function tr(n,t,e){return _s({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Hn}function _r({year:n,month:t,day:e}){if(Math.abs(tr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Ts(n,t){let e=t.hour-n.hour,r=t.minute-n.minute,i=t.second-n.second,o=t.millisecond-n.millisecond,a=t.microsecond-n.microsecond,s=t.nanosecond-n.nanosecond;return Se.fromComponents(e,r,i,o,a,s)}function Cs(n,t,e,r,i){let o=Se.fromEpochNsDiff(t,n);return o=Do(o,e,r,i),En({years:0,months:0,weeks:0,days:0},o)}function Kl(n,t,e,r){qa(n),qa(t);let i=Ts(n.time,t.time),o=i.sign(),a=hn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Pt(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let u=Dn("day",r),l=Hi(e,n.isoDate,s,u);return r!==u&&(i=i.add24HourDays(l.days),l.days=0),En(l,i)}function Gl(n,t,e,r,i){let o=T.default.subtract(t,n);if(T.default.equal(o,Yt))return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};let a=T.default.lessThan(o,Yt)?-1:1,s=Gt(e,n),u=Gt(e,t),l,h=0,p=a===1?2:1,y=Ts(s.time,u.time);for(y.sign()===-a&&h++;h<=p;h++){l=De(Pt(u.isoDate.year,u.isoDate.month,u.isoDate.day-h*a),s.time);let S=it(e,l,"compatible");if(y=Se.fromEpochNsDiff(t,S),y.sign()!==-a)break}let E=Dn("day",i);return En(Hi(r,s.isoDate,l.isoDate,E),y)}function Zl(n,t,e,r,i,o,a,s,u){let l,h,p,y,E=t;switch(s){case"year":{let O=Nn(E.date.years,a,"trunc");l=O,h=O+a*n,p={years:l,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let O=Nn(E.date.months,a,"trunc");l=O,h=O+a*n,p=rt(E.date,0,0,l),y=rt(E.date,0,0,h);break}case"week":{let O=rt(E.date,0,0),ne=Bt(o,r.isoDate,O,"constrain"),g=Hi(o,ne,Pt(ne.year,ne.month,ne.day+E.date.days),"week"),L=Nn(E.date.weeks+g.weeks,a,"trunc");l=L,h=L+a*n,p=rt(E.date,0,l),y=rt(E.date,0,h);break}case"day":{let O=Nn(E.date.days,a,"trunc");l=O,h=O+a*n,p=rt(E.date,l),y=rt(E.date,h);break}}let S=Bt(o,r.isoDate,p,"constrain"),k=Bt(o,r.isoDate,y,"constrain"),A,B,V=De(S,r.time),G=De(k,r.time);i?(A=it(i,V,"compatible"),B=it(i,G,"compatible")):(A=Xe(V),B=Xe(G));let U=Se.fromEpochNsDiff(e,A),J=Se.fromEpochNsDiff(B,A),oe=Io(u,n<0?"negative":"positive"),Te=U.add(U).abs().subtract(J.abs()).sign(),Me=Math.abs(l)/a%2==0,ie=U.isZero()?Math.abs(l):U.cmp(J)?Po(Math.abs(l),Math.abs(h),Te,Me,oe):Math.abs(h),N=new Se(T.default.add(T.default.multiply(J.totalNs,T.default.BigInt(l)),T.default.multiply(U.totalNs,T.default.BigInt(a*n)))).fdiv(J.totalNs),H=ie===Math.abs(h);return E={date:H?y:p,time:Se.ZERO},{nudgeResult:{duration:E,nudgedEpochNs:H?B:A,didExpandCalendarUnit:H},total:N}}function Yo(n,t,e,r,i,o,a,s,u){let l=n,h=an(s)||r&&s==="day",p=Vl(l)<0?-1:1,y;return h?{nudgeResult:y}=Zl(p,l,t,e,r,i,a,s,u):y=r?function(E,S,k,A,B,V,G,U){let J=S,oe=Bt(B,k.isoDate,J.date,"constrain"),Te=De(oe,k.time),Me=De(Pt(oe.year,oe.month,oe.day+E),k.time),ie=it(A,Te,"compatible"),N=it(A,Me,"compatible"),H=Se.fromEpochNsDiff(N,ie);if(H.sign()!==E)throw new RangeError("time zone returned inconsistent Instants");let O=T.default.BigInt(Tr[G]*V),ne=J.time.round(O,U),g=ne.subtract(H),L=g.sign()!==-E,c,d;return L?(c=E,ne=g.round(O,U),d=ne.addToEpochNs(N)):(c=0,d=ne.addToEpochNs(ie)),{duration:En(rt(J.date,J.date.days+c),ne),nudgedEpochNs:d,didExpandCalendarUnit:L}}(p,l,e,r,i,a,s,u):function(E,S,k,A,B,V){let G=E,U=G.time.add24HourDays(G.date.days),J=U.round(T.default.BigInt(A*Tr[B]),V),oe=J.subtract(U),{quotient:Te}=U.divmod(po),{quotient:Me}=J.divmod(po),ie=Math.sign(Me-Te)===U.sign(),N=oe.addToEpochNs(S),H=0,O=J;return vn(k)==="date"&&(H=Me,O=J.add(Se.fromComponents(24*-Me,0,0,0,0,0))),{duration:{date:rt(G.date,H),time:O},nudgedEpochNs:N,didExpandCalendarUnit:ie}}(l,t,o,a,s,u),l=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(l=function(E,S,k,A,B,V,G,U){let J=S;if(U===G)return J;let oe=ci.indexOf(G);for(let Te=ci.indexOf(U)-1;Te>=oe;Te--){let Me=ci[Te];if(Me==="week"&&G!=="week")continue;let ie;switch(Me){case"year":ie={years:J.date.years+E,months:0,weeks:0,days:0};break;case"month":{let O=J.date.months+E;ie=rt(J.date,0,0,O);break}case"week":{let O=J.date.weeks+E;ie=rt(J.date,0,O);break}}let N=De(Bt(V,A.isoDate,ie,"constrain"),A.time),H;if(H=B?it(B,N,"compatible"):Xe(N),ho(k,H)===-E)break;J={date:ie,time:Se.ZERO}}return J}(p,l,y.nudgedEpochNs,e,r,i,o,Dn(s,"day"))),l}function Vc(n,t,e,r,i,o){return an(o)||r&&o==="day"?Zl(Vl(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:di(n.time.add24HourDays(n.date.days),o)}function Jl(n,t,e,r,i,o,a){if(Ir(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Se.ZERO};er(n),er(t);let s=Kl(n,t,e,r);return o==="nanosecond"&&i===1?s:Yo(s,Xe(t),n,null,e,r,i,o,a)}function Xl(n,t,e,r,i,o,a,s){if(vn(i)==="time")return Cs(n,t,o,a,s);let u=Gl(n,t,e,r,i);return a==="nanosecond"&&o===1?u:Yo(u,t,Gt(e,n),e,r,i,o,a,s)}function Nr(n,t,e,r,i,o){let a=kr.reduce((E,S)=>{let k=S[0],A=S[1],B=S[2];return e!=="datetime"&&B!==e||r.includes(A)||E.push(A,k),E},[]),s=It(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let u=Rr(t),l=en(t,"trunc");n==="since"&&(l=function(E){switch(E){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return E}}(l));let h=It(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=Dn(o,h);if(s==="auto"&&(s=p),Dn(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&&Ar(u,y,!1),{largestUnit:s,roundingIncrement:u,roundingMode:l,smallestUnit:h}}function qc(n,t,e,r){let i=ni(e),o=Nr(n,te(r),"time",[],"nanosecond","second"),a=Wt(Cs(m(t,se),m(i,se),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=xt(a)),a}function Wc(n,t,e,r){let i=ei(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",[],"day","day"),u=Qe("%Temporal.Duration%"),l=m(t,ce),h=m(i,ce);if(hn(l,h)===0)return new u;let p={date:Hi(o,l,h,s.largestUnit),time:Se.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let E=De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Yo(p,Xe(De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),E,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=Wt(p,"day");return n==="since"&&(y=xt(y)),y}function Kc(n,t,e,r){let i=ti(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","day"),u=Qe("%Temporal.Duration%"),l=m(t,Ae),h=m(i,Ae);if(Ir(l,h)===0)return new u;let p=Wt(Jl(l,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=xt(p)),p}function Gc(n,t,e,r){let i=Ln(e),o=Nr(n,te(r),"time",[],"nanosecond","hour"),a=Ts(m(t,He),m(i,He));a=Do(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=Wt(En({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=xt(s)),s}function Zc(n,t,e,r){let i=ri(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",["week","day"],"month","year"),u=Qe("%Temporal.Duration%");if(hn(m(t,ce),m(i,ce))==0)return new u;let l=Et(o,m(t,ce),"year-month");l.day=1;let h=Yn(o,l,"constrain"),p=Et(o,m(i,ce),"year-month");p.day=1;let y=Yn(o,p,"constrain"),E={date:rt(Hi(o,h,y,s.largestUnit),0,0),time:Se.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let k=De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});E=Yo(E,Xe(De(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),k,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let S=Wt(E,"day");return n==="since"&&(S=xt(S)),S}function Jc(n,t,e,r){let i=ii(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","hour"),u=m(t,se),l=m(i,se),h=Qe("%Temporal.Duration%"),p;if(vn(s.largestUnit)!=="date")p=Wt(Cs(u,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,_e);if(!Yl(y,m(i,_e)))throw new RangeError("When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.");if(T.default.equal(u,l))return new h;p=Wt(Xl(u,l,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=xt(p)),p}function Cr({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,u=o;return s+=a.sec,u+=a.subsec,An(n,t,s,r,i,u)}function Wa(n,t){let e=t.addToEpochNs(n);return dn(e),e}function oi(n,t,e,r,i="constrain"){if(Oo(r.date)===0)return Wa(n,r.time);let o=Gt(t,n);return Wa(it(t,De(Bt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function Xc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=Dn(yn(t),yn(r));if(an(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=cn(t),a=cn(r);return Wt(En({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function Qc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=yn(r);if(vn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=cn(r);return Xt(Wa(m(t,se),o.time))}function el(n,t,e,r){let i=m(t,$),o=Kt(e);n==="subtract"&&(o=xt(o));let a=Wl(o),s=ve(te(r));return wt(Bt(i,m(t,ce),a,s),i)}function tl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,$),s=cn(i),u=m(t,Ae),l=Cr(u.time,s.time),h=rt(s.date,l.deltaDays);return Ho(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),qt(De(Bt(a,u.isoDate,h,o),l),a)}function nl(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=cn(r),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Cr(m(t,He),i.time);return bn(Lo(o,a,s,u,l,h,"reject"))}function rl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=wo(i),s=m(t,$),u=Et(s,m(t,ce),"year-month");u.day=1;let l=Yn(s,u,"constrain");if(a<0){let p=Bt(s,l,{months:1},"constrain");l=Pt(p.year,p.month,p.day-1)}let h=Wl(i);return ar(l),Er(fi(s,Et(s,Bt(s,l,h,o),"year-month"),o),s)}function il(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,_e),s=m(t,$),u=br(i);return nt(oi(m(t,se),a,s,u,o),a,s)}function Nn(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,u=Ct(Math.abs(2*i)-t),l=a%2==0,h=Io(e,o),p=i===0?a:Po(a,s,u,l,h);return t*(o==="positive"?p:-p)}function Ka(n,t,e,r){let i=Tr[e]*t;return function(o,a,s){let u=gn(o),l=gn(a),h=T.default.divide(u,l),p=T.default.remainder(u,l),y=Io(s,"positive"),E,S;T.default.lessThan(u,Yt)?(E=T.default.subtract(h,hi),S=h):(E=h,S=T.default.add(h,hi));let k=ho(Kn(T.default.multiply(p,bs)),l)*(T.default.lessThan(u,Yt)?-1:1)+0,A=T.default.equal(p,Yt)?h:Po(E,S,k,cl(E),y);return T.default.multiply(A,l)}(n,T.default.BigInt(i),r)}function Ga(n,t,e,r){qa(n);let{year:i,month:o,day:a}=n.isoDate,s=Za(n.time,t,e,r);return De(Pt(i,o,a+s.deltaDays),s)}function Za({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,u){let l;switch(s){case"day":case"hour":l=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":l=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":l=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":l=1e3*(1e3*r+i)+o;break;case"microsecond":l=1e3*i+o;break;case"nanosecond":l=o}let h=Tr[s],p=Nn(l,h*a,u)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return An(p,0,0,0,0,0);case"minute":return An(n,p,0,0,0,0);case"second":return An(n,t,p,0,0,0);case"millisecond":return An(n,t,e,p,0,0);case"microsecond":return An(n,t,e,r,p,0);case"nanosecond":return An(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function Do(n,t,e,r){let i=Tr[e];return n.round(T.default.BigInt(i*t),r)}function di(n,t){let e=Tr[t];return n.fdiv(T.default.BigInt(e))}function hn(n,t){return n.year!==t.year?Ct(n.year-t.year):n.month!==t.month?Ct(n.month-t.month):n.day!==t.day?Ct(n.day-t.day):0}function Ja(n,t){return n.hour!==t.hour?Ct(n.hour-t.hour):n.minute!==t.minute?Ct(n.minute-t.minute):n.second!==t.second?Ct(n.second-t.second):n.millisecond!==t.millisecond?Ct(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Ct(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Ct(n.nanosecond-t.nanosecond):0}function Ir(n,t){let e=hn(n.isoDate,t.isoDate);return e!==0?e:Ja(n.time,t.time)}function Ql(n){let t=Eo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function Zt(n,t){let e=gn(n),{quotient:r,remainder:i}=Xr(e,Pi),o=T.default.toNumber(r);return t==="floor"&&T.default.toNumber(i)<0&&(o-=1),t==="ceil"&&T.default.toNumber(i)>0&&(o+=1),o}function Qt(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return T.default.multiply(T.default.BigInt(n),Pi)}function Eo(n){let t=n;if(typeof n=="object"){let e=n[Symbol.toPrimitive];e&&typeof e=="function"&&(t=e.call(n,"number"))}if(typeof t=="number")throw new TypeError("cannot convert number to bigint");return typeof t=="bigint"?T.default.BigInt(t.toString(10)):T.default.BigInt(t)}var Xa=(()=>{let n=T.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=T.default.BigInt(t),r=T.default.add(Qt(t),n);return n=T.default.remainder(e,Pi),T.default.greaterThan(r,Sr)?Sr:T.default.lessThan(r,mi)?mi:r}})();function Zr(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Ct(n){return n<0?-1:n>0?1:n}function te(n){if(n===void 0)return Object.create(null);if(Ye(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function nr(n,t){let e=Object.create(null);return e[n]=t,e}function _n(n,t,e,r){let i=n[t];if(i!==void 0){if(i=Ro(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Sn)throw new RangeError(`${t} option is required`);return r}function Mt(n){let t=bi(n);if(!ah.includes(bi(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function bi(n){let t="";for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function jn(n){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${n==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${n}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}var mh=new RegExp(`^${El.source}$`),ph=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function eu(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,u=i;for(;a-o>1;){let l=Math.trunc((o+a)/2),h=n(l);h===s?(o=l,s=h):h===u&&(a=l,u=h)}return a}function tu(n){return[...n]}function nu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=ji[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),u=e.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=u&&++p,p==0)p=function(y,E,S,k){let A=(k-y-S+1)%7;A<0&&(A+=7);let B=Math.floor((S+A-1)/7);return 7-A>=E&&++B,B}(s,u,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let y=(l+a-o)%7;y<0&&(y+=7),6-y>=u&&o+7-l>a&&(p=1,r++)}return{week:p,year:r}}function ol(n,t,e,r,i){if(t!==i.year){if(n*(t-i.year)>0)return!0}else if(e!==i.month){if(n*(e-i.month)>0)return!0}else if(r!==i.day&&n*(r-i.day)>0)return!0;return!1}var ji={};function rr(n){if(!n.startsWith("M"))throw new RangeError(`Invalid month code: ${n}. Month codes must start with M.`);let t=+n.slice(1);if(Number.isNaN(t))throw new RangeError(`Invalid month code: ${n}`);return t}function ln(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Is(n,t=void 0,e=12){let{month:r,monthCode:i}=n;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");t==="reject"&&We(r,1,e),t==="constrain"&&(r=bt(r,1,e)),i=ln(r)}else{let o=rr(i);if(i!==ln(o))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==o)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=o,r<1||r>e)throw new RangeError(`Invalid monthCode: ${i}`)}return{...n,month:r,monthCode:i}}ji.iso8601={resolveFields(n,t){if((t==="date"||t==="year-month")&&n.year===void 0)throw new TypeError("year is required");if((t==="date"||t==="month-day")&&n.day===void 0)throw new TypeError("day is required");Object.assign(n,Is(n))},dateToISO:(n,t)=>li(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=li(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return tu(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:u}=n;return a+=t,s+=e,{year:a,month:s}=Gn(a,s),{year:a,month:s,day:u}=li(a,s,u,o),u+=i+7*r,Pt(a,s,u)},dateUntil(n,t,e){let r=-hn(n,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,o=0,a=0;if(e==="year"||e==="month"){let h=t.year-n.year;for(h!==0&&(h-=r);!ol(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=Gn(n.year+o,n.month+p);!ol(r,i.year,i.month,n.day,t);)a=p,p+=r,i=Gn(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=Gn(n.year+o,n.month+a);let s=ql(i.year,i.month,n.day),u=0,l=tr(t.year,t.month-1,t.day)-tr(s.year,s.month-1,s.day);return e==="week"&&(u=Math.trunc(l/7),l%=7),{years:o,months:a,weeks:u,days:l}},isoToDate({year:n,month:t,day:e},r){let i={era:void 0,eraYear:void 0,year:n,month:t,day:e,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=ln(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),u=a-100*s,l=(e+Math.floor(2.6*o-.2)+(u+Math.floor(u/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=l+(l<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=Jn(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=nu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=Jn(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=bo(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Ft=class n{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let e=0;for(let r of t.map.entries()){if(++e>n.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(t){let e=this.map.get(t);return e&&(this.hits++,this.report()),this.calls++,e}set(t,e){this.map.set(t,e),this.misses++,this.report()}report(){}setObject(t){if(n.objectMap.get(t))throw new RangeError("object already cached");n.objectMap.set(t,this),this.report()}static getCacheForObject(t){let e=n.objectMap.get(t);return e||(e=new n,n.objectMap.set(t,e)),e}};function ru({isoYear:n,isoMonth:t,isoDay:e}){return`${Bi(n)}-${jt(t)}-${jt(e)}T00:00Z`}function xa(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Ft.objectMap=new WeakMap,Ft.MAX_CACHE_ENTRIES=1e3;var kn=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:"numeric",month:"numeric",year:"numeric",era:"short",timeZone:"UTC"})),this.formatter}getCalendarParts(t){let e=this.getFormatter(),r=new Date(t);if(t==="-271821-04-19T00:00Z"){let i=e.resolvedOptions();e=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return e.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${t}`)}}isoToCalendarDate(t,e){let{year:r,month:i,day:o}=t,a=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:o,id:this.id}),s=e.get(a);if(s)return s;let u=ru({isoYear:r,isoMonth:i,isoDay:o}),l=this.getCalendarParts(u),h={};for(let y=0;y<l.length;y++){let{type:E,value:S}=l[y];if(E!=="year"&&E!=="relatedYear"||(this.hasEra?h.eraYear=+S:h.year=+S),E==="month"){let k=/^([0-9]*)(.*?)$/.exec(S);if(!k||k.length!=3||!k[1]&&!k[2])throw new RangeError(`Unexpected month: ${S}`);if(h.month=k[1]?+k[1]:1,h.month<1)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${S} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);k[2]&&(h.monthExtra=k[2])}E==="day"&&(h.day=+S),this.hasEra&&E==="era"&&S!=null&&S!==""&&(h.era=S.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&h.eraYear===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let y=this.eras.find(E=>h.era===E.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:E}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=E}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 E=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(E,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:u}=o;return{month:s,monthCode:u}=Is(o,r,a),{...o,month:s,monthCode:u}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(We(o,1,i),We(a,1,this.maximumMonthLength(t))):(o=bt(o,1,i),a=bt(a,1,this.maximumMonthLength({...t,month:o}))),{...t,month:o,day:a}}calendarToIsoDate(t,e="constrain",r){let i=t,o=this.adjustCalendarDate(t,r,e,!1);o=this.regulateMonthDayNaive(o,e,r);let{year:a,month:s,day:u}=o,l=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:u,overflow:e,id:this.id}),h,p=r.get(l);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:u}),E=V=>{let G=this.addDaysIso(y,V);if(o.day>this.minimumMonthLength(o)){let U=this.isoToCalendarDate(G,r);for(;U.month!==s||U.year!==a;){if(e==="reject")throw new RangeError(`day ${u} does not exist in month ${s} of year ${a}`);G=this.addDaysIso(G,-1),U=this.isoToCalendarDate(G,r)}}return G},S=0,k=this.isoToCalendarDate(y,r),A=xa(o,k);if(A.years!==0||A.months!==0||A.days!==0){let V=365*A.years+30*A.months+A.days;y=this.addDaysIso(y,V),k=this.isoToCalendarDate(y,r),A=xa(o,k),A.years===0&&A.months===0?y=E(A.days):S=this.compareCalendarDates(o,k)}let B=8;for(;S;){y=this.addDaysIso(y,S*B);let V=k;k=this.isoToCalendarDate(y,r);let G=S;if(S=this.compareCalendarDates(o,k),S){if(A=xa(o,k),A.years===0&&A.months===0)y=E(A.days),S=0;else if(G&&S!==G)if(B>1)B/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(k,V)>0&&(y=this.addDaysIso(y,-1)),S=0}}}if(r.set(l,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?Ct(t.year-e.year):t.month!==e.month?Ct(t.month-e.month):t.day!==e.day?Ct(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 Pt(t.year,t.month,t.day+e)}addDaysCalendar(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.addDaysIso(i,e);return this.isoToCalendarDate(o,r)}addMonthsCalendar(t,e,r,i){let o=t,{day:a}=o;for(let s=0,u=Math.abs(e);s<u;s++){let{month:l}=o,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),E=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(E,i),e>0){let S=this.monthsInYear(h,i);for(;o.month-1!=l%S;)E=this.addDaysIso(E,-1),o=this.isoToCalendarDate(E,i)}o.day!==a&&(o=this.regulateDate({...o,day:a},"constrain",i))}if(r==="reject"&&o.day!==a)throw new RangeError(`Day ${a} does not exist in resulting calendar month`);return o}addCalendar(t,{years:e=0,months:r=0,weeks:i=0,days:o=0},a,s){let{year:u,day:l,monthCode:h}=t,p=this.adjustCalendarDate({year:u+e,monthCode:h,day:l},s),y=this.addMonthsCalendar(p,r,a,s),E=o+7*i;return this.addDaysCalendar(y,E,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,u=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let l=this.calendarDaysUntil(t,e,i);o=l%7,a=(l-o)/7;break}case"month":case"year":{let l=this.compareCalendarDates(e,t);if(!l)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let S=0;e.monthCode>t.monthCode&&(S=1),e.monthCode<t.monthCode&&(S=-1),S||(S=Math.sign(p)),u=S*l<0?h-l:h}let y,E=u?this.addCalendar(t,{years:u},"constrain",i):t;do s+=l,y=E,E=this.addMonthsCalendar(y,l,"constrain",i),E.day!==t.day&&(E=this.regulateDate({...E,day:t.day},"constrain",i));while(this.compareCalendarDates(e,E)*l>=0);s-=l,o=this.calendarDaysUntil(y,e,i);break}}return{years:u,months:s,weeks:a,days:o}}daysInMonth(t,e){let{day:r}=t,i=this.maximumMonthLength(t),o=this.minimumMonthLength(t);if(o===i)return o;let a=r<=i-o?i:o,s=this.calendarToIsoDate(t,"constrain",e),u=this.addDaysIso(s,a),l=this.isoToCalendarDate(u,e),h=this.addDaysIso(u,-l.day);return this.isoToCalendarDate(h,e).day}daysInPreviousMonth(t,e){let{day:r,month:i,year:o}=t,a={year:i>1?o:o-1,month:i,day:1},s=i>1?i-1:this.monthsInYear(a,e);a={...a,month:s};let u=this.minimumMonthLength(a),l=this.maximumMonthLength(a);if(u===l)return l;let h=this.calendarToIsoDate(t,"constrain",e),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 tr(o.year,o.month-1,o.day)-tr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,u,{era:l,eraYear:h,year:p,month:y,monthCode:E,day:S}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||l===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(E===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:E,day:S}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let k={year:this.monthDaySearchStartYear(E,S),month:12,day:31},A=this.isoToCalendarDate(k,r),B=A.monthCode>E||A.monthCode===E&&A.day>=S?A.year:A.year-1;for(let V=0;V<20;V++){let G=this.adjustCalendarDate({day:S,monthCode:E,year:B-V},r),U=this.calendarToIsoDate(G,"constrain",r),J=this.isoToCalendarDate(U,r);if({year:i,month:o,day:a}=U,J.monthCode===E&&J.day===S)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(J.monthCode);if(J.monthCode===E&&J.day===oe&&S>oe)return{month:o,day:a,year:i};(s===void 0||J.monthCode===s.monthCode&&J.day>s.day)&&(s=J,u=U)}}if(e==="constrain"&&u!==void 0)return u;throw new RangeError(`No recent ${this.id} year with monthCode ${E} and day ${S}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},Qa=class extends kn{constructor(){super(...arguments),this.id="hebrew",this.calendarType="lunisolar",this.months={Tishri:{leap:1,regular:1,monthCode:"M01",days:30},Heshvan:{leap:2,regular:2,monthCode:"M02",days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:"M03",days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:"M04",days:29},Shevat:{leap:5,regular:5,monthCode:"M05",days:30},Adar:{leap:void 0,regular:6,monthCode:"M06",days:29},"Adar I":{leap:6,regular:void 0,monthCode:"M05L",days:30},"Adar II":{leap:7,regular:void 0,monthCode:"M06",days:29},Nisan:{leap:8,regular:7,monthCode:"M07",days:30},Iyar:{leap:9,regular:8,monthCode:"M08",days:29},Sivan:{leap:10,regular:9,monthCode:"M09",days:30},Tamuz:{leap:11,regular:10,monthCode:"M10",days:29},Av:{leap:12,regular:11,monthCode:"M11",days:30},Elul:{leap:13,regular:12,monthCode:"M12",days:29}}}inLeapYear(t){let{year:e}=t;return(7*e+1)%19<7}monthsInYear(t){return this.inLeapYear(t)?13:12}minimumMonthLength(t){return this.minMaxMonthLength(t,"min")}maximumMonthLength(t){return this.minMaxMonthLength(t,"max")}minMaxMonthLength(t,e){let{month:r,year:i}=t,o=this.getMonthCode(i,r),a=Object.entries(this.months).find(u=>u[1].monthCode===o);if(a===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let s=a[1].days;return typeof s=="number"?s:s[e]}maxLengthOfMonthCodeInAnyYear(t){return["M04","M06","M08","M10","M12"].includes(t)?29:30}estimateIsoDate(t){let{year:e}=t;return{year:e-3760,month:1,day:1}}getMonthCode(t,e){return this.inLeapYear({year:t})?e===6?ln(5,!0):ln(e<6?e:e-1):ln(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:u,monthExtra:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(l){let h=this.months[l];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${l}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:u,monthCode:s}}if(this.validateCalendarDate(t),a===void 0)if(s.endsWith("L")){if(s!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);if(a=6,!this.inLeapYear({year:o})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${o} which is not a leap year`);a=6,s="M06"}}else{a=rr(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(We(a,1,this.monthsInYear({year:o})),We(u,1,this.maximumMonthLength({year:o,month:a}))):(a=bt(a,1,this.monthsInYear({year:o})),u=bt(u,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:u,month:a,monthCode:s,year:o}}},$n=class extends kn{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(t,e){let r={year:t.year,month:1,monthCode:"M01",day:1},i={year:t.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,e)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:Math.floor(e*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},es=class extends $n{constructor(){super(...arguments),this.id="islamic"}},ts=class extends $n{constructor(){super(...arguments),this.id="islamic-umalqura"}},ns=class extends $n{constructor(){super(...arguments),this.id="islamic-tbla"}},rs=class extends $n{constructor(){super(...arguments),this.id="islamic-civil"}},is=class extends $n{constructor(){super(...arguments),this.id="islamic-rgsa"}},os=class extends $n{constructor(){super(...arguments),this.id="islamicc"}},as=class extends kn{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(t,e){return this.daysInMonth({year:t.year,month:12,day:1},e)===30}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===12?29:e<=6?31:30}maximumMonthLength(t){let{month:e}=t;return e===12?30:e<=6?31:30}maxLengthOfMonthCodeInAnyYear(t){return rr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},ss=class extends kn{constructor(){super(...arguments),this.id="indian",this.calendarType="solar",this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date("0000-01-01T00:00Z").toLocaleDateString("en-US-u-ca-indian",{timeZone:"UTC"})!=="10/11/-79 Saka"}inLeapYear(t){return Ps(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=rr(t),r=this.months[e];return r=r.leap??r,r.length}getMonthInfo(t){let{month:e}=t,r=this.months[e];if(r===void 0)throw new RangeError(`Invalid month: ${e}`);return this.inLeapYear(t)&&r.leap&&(r=r.leap),r}estimateIsoDate(t){let e=this.adjustCalendarDate(t),r=this.getMonthInfo(e);return Pt(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 Ps(n){return n%4==0&&(n%100!=0||n%400==0)}var _o=class extends kn{constructor(t,e){super(),this.calendarType="solar",this.id=t,this.isoEpoch=e}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Ps(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return li(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Mo=class extends kn{constructor(t,e){super(),this.hasEra=!0,this.calendarType="solar",this.id=t;let{eras:r,anchorEra:i}=function(o){let a,s=o;if(s.length===0)throw new RangeError("Invalid era data: eras are required");if(s.length===1&&s[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(s.length===1&&!s[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(s.filter(l=>l.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(l=>{if(l.isAnchor||!l.anchorEpoch&&!l.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=l,l.anchorEpoch={year:l.hasYearZero?0:1}}else if(!l.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(l=>l.code),s.forEach(l=>{let{reverseOf:h}=l;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);l.reverseOf=p,l.anchorEpoch=p.anchorEpoch,l.isoEpoch=p.isoEpoch}l.anchorEpoch.month===void 0&&(l.anchorEpoch.month=1),l.anchorEpoch.day===void 0&&(l.anchorEpoch.day=1)}),s.sort((l,h)=>{if(l.reverseOf)return 1;if(h.reverseOf)return-1;if(!l.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-l.isoEpoch.year});let u=s[s.length-1].reverseOf;if(u&&u!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((l,h)=>{l.genericName="era"+(s.length-1-h)}),{eras:s,anchorEra:a||s[0]}}(e);this.anchorEra=i,this.eras=r}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Ps(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}completeEraYear(t){let e=(s,u,l)=>{let h=t[s];if(h!=null&&h!=u&&!(l||[]).includes(h)){let p=l?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${u} (also called ${p})`:u}`)}},r=s=>{let u,l={...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 u=p.anchorEpoch.year-s,!0}return u=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(l,p.anchorEpoch)>=0&&(u=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:u,era:h.code,eraNames:h.names}},{year:i,eraYear:o,era:a}=t;if(i!=null){let s=r(i);({eraYear:o,era:a}=s),e("era",a,s?.eraNames),e("eraYear",o)}else{if(o==null)throw new RangeError("Either year or eraYear and era are required");{if(a===void 0)throw new RangeError("era and eraYear must be provided together");let s=this.eras.find(({code:u,names:l=[]})=>u===a||l.includes(a));if(!s)throw new RangeError(`Era ${a} (ISO year ${o}) was not matched by any era`);i=s.reverseOf?s.anchorEpoch.year-o:o+s.anchorEpoch.year-(s.hasYearZero?0:1),e("year",i),{eraYear:o,era:a}=r(i)}}return{...t,year:i,eraYear:o,era:a}}adjustCalendarDate(t,e,r="constrain"){let i=t,{month:o,monthCode:a}=i;return o===void 0&&(i={...i,month:rr(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return li(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},wi=class extends Mo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=ln(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},sn={inLeapYear(n){let{year:t}=n;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(n){let{month:t}=n;return t===13?this.inLeapYear(n)?6:5:30},maximumMonthLength(n){return this.minimumMonthLength(n)},maxLengthOfMonthCodeInAnyYear:n=>n==="M13"?6:30},cs=class extends _o{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},So=class extends Mo{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},ls=class extends cs{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},us=class extends So{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},ds=class extends So{constructor(){super("ethiopic",[{code:"ethioaa",names:["ethiopic-amete-alem","mundi"],isoEpoch:{year:-5492,month:7,day:17}},{code:"ethiopic",names:["incar"],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},hs=class extends wi{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},ms=class extends _o{constructor(){super("buddhist",{year:-543,month:1,day:1})}},ps=class extends wi{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(t){let{era:e,eraYear:r}=t;return e==="b"&&(e="gregory-inverse"),e==="a"&&(e="gregory"),{era:e,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},fs=class extends wi{constructor(){super("japanese",[{code:"reiwa",isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:"heisei",isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:"showa",isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:"taisho",isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:"meiji",isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:"japanese",names:["japanese","gregory","ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"japanese-inverse",names:["japanese-inverse","gregory-inverse","bc","bce"],reverseOf:"japanese"}]),this.erasBeginMidYear=!0}reviseIntlEra(t,e){let{era:r,eraYear:i}=t,{year:o}=e;return this.eras.find(a=>a.code===r)?{era:r,eraYear:i}:o<1?{era:"japanese-inverse",eraYear:1-o}:{era:"japanese",eraYear:o}}},ko=class extends kn{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(t,e){let r=this.getMonthList(t.year,e);return Object.entries(r).length===13}monthsInYear(t,e){return this.inLeapYear(t,e)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(t){return["M01L","M09L","M10L","M11L","M12L"].includes(t)?29:30}monthDaySearchStartYear(t,e){let r={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[t]??[1972,1972];return e<30?r[0]:r[1]}getMonthList(t,e){if(t===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:t,id:this.id}),i=e.get(r);if(i)return i;let o=this.getFormatter(),a=(A,B)=>{let V=ru({isoYear:A,isoMonth:2,isoDay:1}),G=new Date(V);G.setUTCDate(B+1);let U=o.formatToParts(G),J=U.find(ie=>ie.type==="month").value,oe=+U.find(ie=>ie.type==="day").value,Te=U.find(ie=>ie.type==="relatedYear"),Me;if(Te===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Me=+Te.value,{calendarMonthString:J,calendarDay:oe,calendarYearToVerify:Me}},s=17,{calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s);u!=="1"&&(s+=29,{calendarMonthString:u,calendarDay:l}=a(t,s)),s-=l-5;let p={},y,E,S=1,k=!1;do({calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s)),y&&(p[E].daysInMonth=y+30-l),h!==t?k=!0:(p[u]={monthIndex:S++},s+=30),y=l,E=u;while(!k);return p[E].daysInMonth=y+30-l,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:u,monthCode:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(s&&s!=="bis")throw new RangeError(`Unexpected leap month suffix: ${s}`);let h=ln(a,s!==void 0),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:u,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&l.endsWith("L")&&l!="M13L"&&r==="constrain"){let E=+l.replace(/^M0?|L$/g,"");y=h[E],y&&(a=y.monthIndex,l=ln(E))}if(a===void 0)throw new RangeError(`Unmatched month ${l} in Chinese year ${o}`)}else if(l===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(We(a,1,y),We(u,1,this.maximumMonthLength())):(a=bt(a,1,y),u=bt(u,1,this.maximumMonthLength()));let E=p.find(S=>S[1].monthIndex===a);if(E===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);l=ln(+E[0].replace("bis",""),E[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(!y)throw new RangeError(`Unmatched monthCode ${l} in Chinese year ${o}`);if(a!==y.monthIndex)throw new RangeError(`monthCode ${l} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:l,day:u}}},gs=class extends ko{constructor(){super(...arguments),this.id="chinese"}},ys=class extends ko{constructor(){super(...arguments),this.id="dangi"}},vs=class{constructor(t){this.helper=t}extraFields(t){return this.helper.hasEra&&t.includes("year")?["era","eraYear"]:[]}resolveFields(t){if(this.helper.calendarType!=="lunisolar"){let e=new Ft;Is(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Ft,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Ft,i=this.helper.monthDayFromFields(t,e,r);return r.setObject(i),i}fieldKeysToIgnore(t){let e=new Set;for(let r=0;r<t.length;r++){let i=t[r];switch(e.add(i),i){case"era":e.add("eraYear"),e.add("year");break;case"eraYear":e.add("era"),e.add("year");break;case"year":e.add("era"),e.add("eraYear");break;case"month":e.add("monthCode"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"monthCode":e.add("month"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"day":this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"))}}return tu(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Ft.getCacheForObject(t),u=this.helper.isoToCalendarDate(t,s),l=this.helper.addCalendar(u,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(l,"constrain",s);return Ft.getCacheForObject(h)||new Ft(s).setObject(h),h}dateUntil(t,e,r){let i=Ft.getCacheForObject(t),o=Ft.getCacheForObject(e),a=this.helper.isoToCalendarDate(t,i),s=this.helper.isoToCalendarDate(e,o);return this.helper.untilCalendar(a,s,r,i)}isoToDate(t,e){let r=Ft.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=ji.iso8601.isoToDate(t,{dayOfWeek:!0}).dayOfWeek),e.dayOfYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.calendarDaysUntil(o,i,r);i.dayOfYear=a+1}if(e.weekOfYear&&(i.weekOfYear=nu(this.helper.id,t)),i.daysInWeek=7,e.daysInMonth&&(i.daysInMonth=this.helper.daysInMonth(i,r)),e.daysInYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.addCalendar(o,{years:1},"constrain",r);i.daysInYear=this.helper.calendarDaysUntil(o,a,r)}return e.monthsInYear&&(i.monthsInYear=this.helper.monthsInYear(i,r)),e.inLeapYear&&(i.inLeapYear=this.helper.inLeapYear(i,r)),i}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let n of[Qa,as,ds,ls,us,gs,ys,hs,ss,ms,ps,fs,es,ts,ns,rs,is,os]){let t=new n;ji[t.id]=new vs(t)}Ha("calendarImpl",function(n){return ji[n]});var Di=Intl.DateTimeFormat;function fr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Di(m(n,vl),e(m(n,La))),function(r,i,o){let a=Co(r);if(a===void 0)throw new TypeError("Missing slots for the given container");if(a[i]===void 0)throw new TypeError(`tried to reset ${i} which was not set`);a[i]=o}(n,t,e)),e}function Jr(n){return _t(n,or)}var ir=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(E){if(E==null)throw new TypeError(`Expected object not ${E}`);return Object(E)}(o);let y=Object.create(null);for(let E=0;E<p.length;E++){let S=p[E];Object.prototype.hasOwnProperty.call(s,S)&&(y[S]=s[S])}s=y}else s=Object.create(null);let u=new Di(i,s),l=u.resolvedOptions();if(Tn(r),a){let p=Object.assign(Object.create(null),l);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,me(r,La,p)}else me(r,La,s);me(r,vl,l.locale),me(r,or,u),me(r,vr,l.timeZone),me(r,Qr,l.calendar),me(r,hl,_h),me(r,ml,Dh),me(r,pl,Eh),me(r,fl,wh),me(r,gl,Mh),me(r,yl,Sh);let h=a?s.timeZone:void 0;if(h===void 0)me(r,Aa,l.timeZone);else{let p=Ro(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");me(r,Aa,Dt(p))}})(this,t,e)}get format(){P(this,Jr);let t=gh.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 P(this,Jr),vh.call(this,t,e)}formatToParts(t,...e){return P(this,Jr),yh.call(this,t,...e)}formatRangeToParts(t,e){return P(this,Jr),bh.call(this,t,e)}resolvedOptions(){return P(this,Jr),fh.call(this)}};"formatToParts"in Di.prototype||delete ir.prototype.formatToParts,"formatRangeToParts"in Di.prototype||delete ir.prototype.formatRangeToParts;var $t=function(n=void 0,t=void 0){return new ir(n,t)};function fh(){let n=m(this,or).resolvedOptions();return n.timeZone=m(this,Aa),n}function gh(n,...t){let e,r,i=Pr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.format(...r)}function yh(n,...t){let e,r,i=Pr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.formatToParts(...r)}function vh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(Mn(e)){if(!iu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=Pr(e,this),{epochNs:u,formatter:l}=Pr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRange(...o)}function bh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Mn(e)!==Mn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(Mn(e)){if(!iu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=Pr(e,this),{epochNs:u,formatter:l}=Pr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRangeToParts(...o)}function zi(n={},t={}){let e=Object.assign({},n),r=["year","month","day","hour","minute","second","weekday","dayPeriod","timeZoneName","dateStyle","timeStyle"];for(let i=0;i<r.length;i++){let o=r[i];e[o]=o in t?t[o]:e[o],e[o]!==!1&&e[o]!==void 0||delete e[o]}return e}function wh(n){let t=zi(n,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!=="long"&&t.timeStyle!=="full"||(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"})),!Bo(t)){if(Ui(n))throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(n)}]`);Object.assign(t,{hour:"numeric",minute:"numeric",second:"numeric"})}return t}function Dh(n){let t={short:{year:"2-digit",month:"numeric"},medium:{year:"numeric",month:"short"},long:{year:"numeric",month:"long"},full:{year:"numeric",month:"long"}},e=zi(n,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("year"in e||"month"in e||"era"in e)){if(Ui(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Eh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=zi(n,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("month"in e)&&!("day"in e)){if(Ui(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function _h(n){let t=zi(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function Mh(n){let t=zi(n,{timeZoneName:!1});if((t.timeStyle==="long"||t.timeStyle==="full")&&(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"}),t.dateStyle)&&(Object.assign(t,{short:{year:"numeric",month:"numeric",day:"numeric"},medium:{year:"numeric",month:"short",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{year:"numeric",month:"long",day:"numeric",weekday:"long"}}[t.dateStyle]),delete t.dateStyle),!Bo(t)&&!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}return t}function Sh(n){let t=n;return Bo(t)||$o(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function $o(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function Bo(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function Ui(n){return $o(n)||Bo(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function Mn(n){return Fe(n)||$e(n)||Pe(n)||pe(n)||Je(n)||Ht(n)||Ze(n)}function To(n){return Mn(n)?n:xo(n)}function iu(n,t){return!(!Mn(n)||!Mn(t)||$e(n)&&!$e(t)||Fe(n)&&!Fe(t)||Pe(n)&&!Pe(t)||pe(n)&&!pe(t)||Je(n)&&!Je(t)||Ht(n)&&!Ht(t)||Ze(n)&&!Ze(t))}function Pr(n,t){if($e(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,He)};return{epochNs:it(m(t,vr),e,"compatible"),formatter:fr(t,fl)}}if(Je(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,ml)}}if(Ht(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,pl)}}if(Fe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,hl)}}if(Pe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Ae);return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,gl)}}if(pe(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return Ze(n)?{epochNs:m(n,se),formatter:fr(t,yl)}:{}}function ou(n){let t=Object.create(null);return t.years=m(n,dt),t.months=m(n,ht),t.weeks=m(n,kt),t.days=m(n,mt),t.hours=m(n,pt),t.minutes=m(n,ft),t.seconds=m(n,gt),t.milliseconds=m(n,yt),t.microseconds=m(n,vt),t.nanoseconds=m(n,Tt),t}ir.prototype.constructor=$t,Object.defineProperty($t,"prototype",{value:ir.prototype,writable:!1,enumerable:!1,configurable:!1}),$t.supportedLocalesOf=Di.supportedLocalesOf,Cn($t,"Intl.DateTimeFormat");var{format:kh,formatToParts:Th}=Intl.DurationFormat?.prototype??Object.create(null);function xs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ou(Kt(n));return kh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=xs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ou(Kt(n));return Th.call(this,t)});var Tm=Object.freeze({__proto__:null,DateTimeFormat:$t,ModifiedIntlDurationFormatPrototypeFormat:xs}),Ei=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");Fl(this,Eo(t))}get epochMilliseconds(){return P(this,Ze),Zt(m(this,se),"floor")}get epochNanoseconds(){return P(this,Ze),Ql(T.default.BigInt(m(this,se)))}add(t){return P(this,Ze),Qc("add",this,t)}subtract(t){return P(this,Ze),Qc("subtract",this,t)}until(t,e=void 0){return P(this,Ze),qc("until",this,t,e)}since(t,e=void 0){return P(this,Ze),qc("since",this,t,e)}round(t){if(P(this,Ze),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Sn);return Ar(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),Xt(Ka(m(this,se),r,o,i))}equals(t){P(this,Ze);let e=ni(t),r=m(this,se),i=m(e,se);return T.default.equal(T.default.BigInt(r),T.default.BigInt(i))}toString(t=void 0){P(this,Ze);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(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=Dt(a));let{precision:s,unit:u,increment:l}=Ni(o,r);return Fc(Xt(Ka(m(this,se),l,u,i)),a,s)}toJSON(){return P(this,Ze),Fc(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return P(this,Ze),new $t(t,e).format(this)}valueOf(){jn("Instant")}toZonedDateTimeISO(t){P(this,Ze);let e=Dt(t);return nt(m(this,se),e,"iso8601")}static fromEpochMilliseconds(t){return Xt(Qt(xo(t)))}static fromEpochNanoseconds(t){return Xt(Eo(t))}static from(t){return ni(t)}static compare(t,e){let r=ni(t),i=ni(e),o=m(r,se),a=m(i,se);return T.default.lessThan(o,a)?-1:T.default.greaterThan(o,a)?1:0}};Cn(Ei,"Temporal.Instant");var _i=class{constructor(t,e,r,i="iso8601"){let o=ue(t),a=ue(e),s=ue(r),u=Mt(i===void 0?"iso8601":Ve(i));Qn(o,a,s),Rl(this,{year:o,month:a,day:s},u)}get calendarId(){return P(this,Fe),m(this,$)}get era(){return ct(this,"era")}get eraYear(){return ct(this,"eraYear")}get year(){return ct(this,"year")}get month(){return ct(this,"month")}get monthCode(){return ct(this,"monthCode")}get day(){return ct(this,"day")}get dayOfWeek(){return ct(this,"dayOfWeek")}get dayOfYear(){return ct(this,"dayOfYear")}get weekOfYear(){return ct(this,"weekOfYear")?.week}get yearOfWeek(){return ct(this,"weekOfYear")?.year}get daysInWeek(){return ct(this,"daysInWeek")}get daysInMonth(){return ct(this,"daysInMonth")}get daysInYear(){return ct(this,"daysInYear")}get monthsInYear(){return ct(this,"monthsInYear")}get inLeapYear(){return ct(this,"inLeapYear")}with(t,e=void 0){if(P(this,Fe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce));return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),wt(Yn(r,i,ve(te(e))),r)}withCalendar(t){P(this,Fe);let e=Yi(t);return wt(m(this,ce),e)}add(t,e=void 0){return P(this,Fe),el("add",this,t,e)}subtract(t,e=void 0){return P(this,Fe),el("subtract",this,t,e)}until(t,e=void 0){return P(this,Fe),Wc("until",this,t,e)}since(t,e=void 0){return P(this,Fe),Wc("since",this,t,e)}equals(t){P(this,Fe);let e=ei(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Fe),Hc(this,Ai(te(t)))}toJSON(){return P(this,Fe),Hc(this)}toLocaleString(t=void 0,e=void 0){return P(this,Fe),new $t(t,e).format(this)}valueOf(){jn("PlainDate")}toPlainDateTime(t=void 0){P(this,Fe);let e=xl(t);return qt(De(m(this,ce),e),m(this,$))}toZonedDateTime(t){let e,r;if(P(this,Fe),Ye(t)){let a=t.timeZone;a===void 0?e=Dt(t):(e=Dt(a),r=t.plainTime)}else e=Dt(t);let i=m(this,ce),o;return r===void 0?o=Rn(e,i):(r=Ln(r),o=it(e,De(i,m(r,He)),"compatible")),nt(o,e,m(this,$))}toPlainYearMonth(){P(this,Fe);let t=m(this,$);return Er(fi(t,Et(t,m(this,ce)),"constrain"),t)}toPlainMonthDay(){P(this,Fe);let t=m(this,$);return Dr(yo(t,Et(t,m(this,ce)),"constrain"),t)}static from(t,e=void 0){return ei(t,e)}static compare(t,e){let r=ei(t),i=ei(e);return hn(m(r,ce),m(i,ce))}};function ct(n,t){P(n,Fe);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(_i,"Temporal.PlainDate");var Mi=class{constructor(t,e,r,i=0,o=0,a=0,s=0,u=0,l=0,h="iso8601"){let p=ue(t),y=ue(e),E=ue(r),S=i===void 0?0:ue(i),k=o===void 0?0:ue(o),A=a===void 0?0:ue(a),B=s===void 0?0:ue(s),V=u===void 0?0:ue(u),G=l===void 0?0:ue(l),U=Mt(h===void 0?"iso8601":Ve(h));Ss(p,y,E,S,k,A,B,V,G),Al(this,{isoDate:{year:p,month:y,day:E},time:{hour:S,minute:k,second:A,millisecond:B,microsecond:V,nanosecond:G}},U)}get calendarId(){return P(this,Pe),m(this,$)}get year(){return lt(this,"year")}get month(){return lt(this,"month")}get monthCode(){return lt(this,"monthCode")}get day(){return lt(this,"day")}get hour(){return gr(this,"hour")}get minute(){return gr(this,"minute")}get second(){return gr(this,"second")}get millisecond(){return gr(this,"millisecond")}get microsecond(){return gr(this,"microsecond")}get nanosecond(){return gr(this,"nanosecond")}get era(){return lt(this,"era")}get eraYear(){return lt(this,"eraYear")}get dayOfWeek(){return lt(this,"dayOfWeek")}get dayOfYear(){return lt(this,"dayOfYear")}get weekOfYear(){return lt(this,"weekOfYear")?.week}get yearOfWeek(){return lt(this,"weekOfYear")?.year}get daysInWeek(){return lt(this,"daysInWeek")}get daysInYear(){return lt(this,"daysInYear")}get daysInMonth(){return lt(this,"daysInMonth")}get monthsInYear(){return lt(this,"monthsInYear")}get inLeapYear(){return lt(this,"inLeapYear")}with(t,e=void 0){if(P(this,Pe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=m(this,Ae),o={...Et(r,i.isoDate),...i.time};return o=Xn(r,o,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),qt(Fi(r,o,ve(te(e))),r)}withPlainTime(t=void 0){P(this,Pe);let e=xl(t);return qt(De(m(this,Ae).isoDate,e),m(this,$))}withCalendar(t){P(this,Pe);let e=Yi(t);return qt(m(this,Ae),e)}add(t,e=void 0){return P(this,Pe),tl("add",this,t,e)}subtract(t,e=void 0){return P(this,Pe),tl("subtract",this,t,e)}until(t,e=void 0){return P(this,Pe),Kc("until",this,t,e)}since(t,e=void 0){return P(this,Pe),Kc("since",this,t,e)}round(t){if(P(this,Pe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Ar(r,a,a===1);let s=m(this,Ae);return qt(r===1&&o==="nanosecond"?s:Ga(s,r,o,i),m(this,$))}equals(t){P(this,Pe);let e=ti(t);return Ir(m(this,Ae),m(e,Ae))===0&&un(m(this,$),m(e,$))}toString(t=void 0){P(this,Pe);let e=te(t),r=Ai(e),i=Li(e),o=en(e,"trunc"),a=It(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:u,increment:l}=Ni(a,i),h=Ga(m(this,Ae),l,u,o);return er(h),yi(h,m(this,$),s,r)}toJSON(){return P(this,Pe),yi(m(this,Ae),m(this,$),"auto")}toLocaleString(t=void 0,e=void 0){return P(this,Pe),new $t(t,e).format(this)}valueOf(){jn("PlainDateTime")}toZonedDateTime(t,e=void 0){P(this,Pe);let r=Dt(t),i=ui(te(e));return nt(it(r,m(this,Ae),i),r,m(this,$))}toPlainDate(){return P(this,Pe),wt(m(this,Ae).isoDate,m(this,$))}toPlainTime(){return P(this,Pe),bn(m(this,Ae).time)}static from(t,e=void 0){return ti(t,e)}static compare(t,e){let r=ti(t),i=ti(e);return Ir(m(r,Ae),m(i,Ae))}};function lt(n,t){P(n,Pe);let e=m(n,Ae).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function gr(n,t){return P(n,Pe),m(n,Ae).time[t]}Cn(Mi,"Temporal.PlainDateTime");var Si=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,h=0){let p=t===void 0?0:Jt(t),y=e===void 0?0:Jt(e),E=r===void 0?0:Jt(r),S=i===void 0?0:Jt(i),k=o===void 0?0:Jt(o),A=a===void 0?0:Jt(a),B=s===void 0?0:Jt(s),V=u===void 0?0:Jt(u),G=l===void 0?0:Jt(l),U=h===void 0?0:Jt(h);Ho(p,y,E,S,k,A,B,V,G,U),Tn(this),me(this,dt,p),me(this,ht,y),me(this,kt,E),me(this,mt,S),me(this,pt,k),me(this,ft,A),me(this,gt,B),me(this,yt,V),me(this,vt,G),me(this,Tt,U)}get years(){return P(this,Oe),m(this,dt)}get months(){return P(this,Oe),m(this,ht)}get weeks(){return P(this,Oe),m(this,kt)}get days(){return P(this,Oe),m(this,mt)}get hours(){return P(this,Oe),m(this,pt)}get minutes(){return P(this,Oe),m(this,ft)}get seconds(){return P(this,Oe),m(this,gt)}get milliseconds(){return P(this,Oe),m(this,yt)}get microseconds(){return P(this,Oe),m(this,vt)}get nanoseconds(){return P(this,Oe),m(this,Tt)}get sign(){return P(this,Oe),wo(this)}get blank(){return P(this,Oe),wo(this)===0}with(t){P(this,Oe);let e=Pl(t),{years:r=m(this,dt),months:i=m(this,ht),weeks:o=m(this,kt),days:a=m(this,mt),hours:s=m(this,pt),minutes:u=m(this,ft),seconds:l=m(this,gt),milliseconds:h=m(this,yt),microseconds:p=m(this,vt),nanoseconds:y=m(this,Tt)}=e;return new n(r,i,o,a,s,u,l,h,p,y)}negated(){return P(this,Oe),xt(this)}abs(){return P(this,Oe),new n(Math.abs(m(this,dt)),Math.abs(m(this,ht)),Math.abs(m(this,kt)),Math.abs(m(this,mt)),Math.abs(m(this,pt)),Math.abs(m(this,ft)),Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,vt)),Math.abs(m(this,Tt)))}add(t){return P(this,Oe),Xc("add",this,t)}subtract(t){return P(this,Oe),Xc("subtract",this,t)}round(t){if(P(this,Oe),t===void 0)throw new TypeError("options parameter is required");let e=yn(this),r=typeof t=="string"?nr("smallestUnit",t):te(t),i=It(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Pa(r),s=Rr(r),u=en(r,"halfExpand"),l=It(r,"smallestUnit","datetime",void 0),h=!0;l||(h=!1,l="nanosecond");let p=Dn(e,l),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(Dn(i,l)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${l}`);let E={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[l];if(E!==void 0&&Ar(s,E,!1),s>1&&vn(l)==="date"&&i!==l)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let k=br(this),A=m(a,_e),B=m(a,$),V=m(a,se);return k=Xl(V,oi(V,A,B,k),A,B,i,s,l,u),vn(i)==="date"&&(i="hour"),Wt(k,i)}if(o){let k=cn(this),A=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},k.time),B=m(o,ce),V=m(o,$),G=Bt(V,B,rt(k.date,A.deltaDays),"constrain");return k=Jl(De(B,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(G,A),V,i,s,l,u),Wt(k,i)}if(an(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(an(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let S=cn(this);if(l==="day"){let{quotient:k,remainder:A}=S.time.divmod(po),B=S.date.days+k+di(A,"day");B=Nn(B,s,u),S=En({years:0,months:0,weeks:0,days:B},Se.ZERO)}else S=En({years:0,months:0,weeks:0,days:0},Do(S.time,s,l,u));return Wt(S,i)}total(t){if(P(this,Oe),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?nr("unit",t):te(t),{plainRelativeTo:r,zonedRelativeTo:i}=Pa(e),o=It(e,"unit","datetime",Sn);if(i){let s=br(this),u=m(i,_e),l=m(i,$),h=m(i,se);return function(p,y,E,S,k){return vn(k)==="time"?di(Se.fromEpochNsDiff(y,p),k):Vc(Gl(p,y,E,S,k),y,Gt(E,p),E,S,k)}(h,oi(h,u,l,s),u,l,o)}if(r){let s=cn(this),u=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),l=m(r,ce),h=m(r,$),p=Bt(h,l,rt(s.date,u.deltaDays),"constrain");return function(y,E,S,k){if(Ir(y,E)==0)return 0;er(y),er(E);let A=Kl(y,E,S,k);return k==="nanosecond"?T.default.toNumber(A.time.totalNs):Vc(A,Xe(E),y,null,S,k)}(De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(p,u),h,o)}let a=yn(this);if(an(a))throw new RangeError(`a starting point is required for ${a}s total`);if(an(o))throw new RangeError(`a starting point is required for ${o}s total`);return di(cn(this).time,o)}toString(t=void 0){P(this,Oe);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(e,"smallestUnit","time",void 0);if(o==="hour"||o==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:a,unit:s,increment:u}=Ni(o,r);if(s==="nanosecond"&&u===1)return lo(this,a);let l=yn(this),h=br(this),p=Do(h.time,u,s,i);return h=En(h.date,p),lo(Wt(h,Dn(l,"second")),a)}toJSON(){return P(this,Oe),lo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(P(this,Oe),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return xs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),lo(this,"auto")}valueOf(){jn("Duration")}static from(t){return Kt(t)}static compare(t,e,r=void 0){let i=Kt(t),o=Kt(e),a=te(r),{plainRelativeTo:s,zonedRelativeTo:u}=Pa(a);if(m(i,dt)===m(o,dt)&&m(i,ht)===m(o,ht)&&m(i,kt)===m(o,kt)&&m(i,mt)===m(o,mt)&&m(i,pt)===m(o,pt)&&m(i,ft)===m(o,ft)&&m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,vt)===m(o,vt)&&m(i,Tt)===m(o,Tt))return 0;let l=yn(i),h=yn(o),p=br(i),y=br(o);if(u&&(vn(l)==="date"||vn(h)==="date")){let B=m(u,_e),V=m(u,$),G=m(u,se),U=oi(G,B,V,p),J=oi(G,B,V,y);return Ct(T.default.toNumber(T.default.subtract(U,J)))}let E=p.date.days,S=y.date.days;if(an(l)||an(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");E=Uc(p.date,s),S=Uc(y.date,s)}let k=p.time.add24HourDays(E),A=y.time.add24HourDays(S);return k.cmp(A)}};Cn(Si,"Temporal.Duration");var ki=class{constructor(t,e,r="iso8601",i=1972){let o=ue(t),a=ue(e),s=Mt(r===void 0?"iso8601":Ve(r)),u=ue(i);Qn(u,o,a),Ll(this,{year:u,month:o,day:a},s)}get monthCode(){return al(this,"monthCode")}get day(){return al(this,"day")}get calendarId(){return P(this,Ht),m(this,$)}with(t,e=void 0){if(P(this,Ht),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce),"month-day");return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),Dr(yo(r,i,ve(te(e))),r)}equals(t){P(this,Ht);let e=Nc(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Ht),$c(this,Ai(te(t)))}toJSON(){return P(this,Ht),$c(this)}toLocaleString(t=void 0,e=void 0){return P(this,Ht),new $t(t,e).format(this)}valueOf(){jn("PlainMonthDay")}toPlainDate(t){if(P(this,Ht),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Et(e,m(this,ce),"month-day"),zt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return Nc(t,e)}};function al(n,t){P(n,Ht);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}function Ra(n){return Gt(n,Xa())}Cn(ki,"Temporal.PlainMonthDay");var au={instant:()=>Xt(Xa()),plainDateTimeISO:(n=Zr())=>qt(Ra(Dt(n)),"iso8601"),plainDateISO:(n=Zr())=>wt(Ra(Dt(n)).isoDate,"iso8601"),plainTimeISO:(n=Zr())=>bn(Ra(Dt(n)).time),timeZoneId:()=>Zr(),zonedDateTimeISO:(n=Zr())=>{let t=Dt(n);return nt(Xa(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(au,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Ti=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:ue(t),u=e===void 0?0:ue(e),l=r===void 0?0:ue(r),h=i===void 0?0:ue(i),p=o===void 0?0:ue(o),y=a===void 0?0:ue(a);Fo(s,u,l,h,p,y),Nl(this,{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return P(this,$e),m(this,He).hour}get minute(){return P(this,$e),m(this,He).minute}get second(){return P(this,$e),m(this,He).second}get millisecond(){return P(this,$e),m(this,He).millisecond}get microsecond(){return P(this,$e),m(this,He).microsecond}get nanosecond(){return P(this,$e),m(this,He).nanosecond}with(t,e=void 0){if(P(this,$e),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=ja(t,"partial"),i=ja(this),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Object.assign(i,r),p=ve(te(e));return{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Lo(o,a,s,u,l,h,p),new n(o,a,s,u,l,h)}add(t){return P(this,$e),nl("add",this,t)}subtract(t){return P(this,$e),nl("subtract",this,t)}until(t,e=void 0){return P(this,$e),Gc("until",this,t,e)}since(t,e=void 0){return P(this,$e),Gc("since",this,t,e)}round(t){if(P(this,$e),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Sn);return Ar(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),bn(Za(m(this,He),r,o,i))}equals(t){P(this,$e);let e=Ln(t);return Ja(m(this,He),m(e,He))===0}toString(t=void 0){P(this,$e);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:a,unit:s,increment:u}=Ni(o,r);return Yc(Za(m(this,He),u,s,i),a)}toJSON(){return P(this,$e),Yc(m(this,He),"auto")}toLocaleString(t=void 0,e=void 0){return P(this,$e),new $t(t,e).format(this)}valueOf(){jn("PlainTime")}static from(t,e=void 0){return Ln(t,e)}static compare(t,e){let r=Ln(t),i=Ln(e);return Ja(m(r,He),m(i,He))}};Cn(Ti,"Temporal.PlainTime");var Ci=class{constructor(t,e,r="iso8601",i=1){let o=ue(t),a=ue(e),s=Mt(r===void 0?"iso8601":Ve(r)),u=ue(i);Qn(o,a,u),Ol(this,{year:o,month:a,day:u},s)}get year(){return fn(this,"year")}get month(){return fn(this,"month")}get monthCode(){return fn(this,"monthCode")}get calendarId(){return P(this,Je),m(this,$)}get era(){return fn(this,"era")}get eraYear(){return fn(this,"eraYear")}get daysInMonth(){return fn(this,"daysInMonth")}get daysInYear(){return fn(this,"daysInYear")}get monthsInYear(){return fn(this,"monthsInYear")}get inLeapYear(){return fn(this,"inLeapYear")}with(t,e=void 0){if(P(this,Je),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce),"year-month");return i=Xn(r,i,zt(r,t,["year","month","monthCode"],[],"partial")),Er(fi(r,i,ve(te(e))),r)}add(t,e=void 0){return P(this,Je),rl("add",this,t,e)}subtract(t,e=void 0){return P(this,Je),rl("subtract",this,t,e)}until(t,e=void 0){return P(this,Je),Zc("until",this,t,e)}since(t,e=void 0){return P(this,Je),Zc("since",this,t,e)}equals(t){P(this,Je);let e=ri(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Je),Bc(this,Ai(te(t)))}toJSON(){return P(this,Je),Bc(this)}toLocaleString(t=void 0,e=void 0){return P(this,Je),new $t(t,e).format(this)}valueOf(){jn("PlainYearMonth")}toPlainDate(t){if(P(this,Je),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Et(e,m(this,ce),"year-month"),zt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return ri(t,e)}static compare(t,e){let r=ri(t),i=ri(e);return hn(m(r,ce),m(i,ce))}};function fn(n,t){P(n,Je);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(Ci,"Temporal.PlainYearMonth");var Ch=$t.prototype.resolvedOptions,Ii=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Eo(t),o=Ve(e),{tzName:a,offsetMinutes:s}=On(o);if(s===void 0){let u=vo(a);if(!u)throw new RangeError(`unknown time zone ${a}`);o=u.identifier}else o=Es(s);Hl(this,i,o,Mt(r===void 0?"iso8601":Ve(r)))}get calendarId(){return P(this,pe),m(this,$)}get timeZoneId(){return P(this,pe),m(this,_e)}get year(){return ut(this,"year")}get month(){return ut(this,"month")}get monthCode(){return ut(this,"monthCode")}get day(){return ut(this,"day")}get hour(){return yr(this,"hour")}get minute(){return yr(this,"minute")}get second(){return yr(this,"second")}get millisecond(){return yr(this,"millisecond")}get microsecond(){return yr(this,"microsecond")}get nanosecond(){return yr(this,"nanosecond")}get era(){return ut(this,"era")}get eraYear(){return ut(this,"eraYear")}get epochMilliseconds(){return P(this,pe),Zt(m(this,se),"floor")}get epochNanoseconds(){return P(this,pe),Ql(m(this,se))}get dayOfWeek(){return ut(this,"dayOfWeek")}get dayOfYear(){return ut(this,"dayOfYear")}get weekOfYear(){return ut(this,"weekOfYear")?.week}get yearOfWeek(){return ut(this,"weekOfYear")?.year}get hoursInDay(){P(this,pe);let t=m(this,_e),e=on(this).isoDate,r=Pt(e.year,e.month,e.day+1),i=Rn(t,e),o=Rn(t,r);return di(Se.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ut(this,"daysInWeek")}get daysInMonth(){return ut(this,"daysInMonth")}get daysInYear(){return ut(this,"daysInYear")}get monthsInYear(){return ut(this,"monthsInYear")}get inLeapYear(){return ut(this,"inLeapYear")}get offset(){return P(this,pe),za(wn(m(this,_e),m(this,se)))}get offsetNanoseconds(){return P(this,pe),wn(m(this,_e),m(this,se))}with(t,e=void 0){if(P(this,pe),!Ye(t))throw new TypeError("invalid zoned-date-time-like");xr(t);let r=m(this,$),i=m(this,_e),o=wn(i,m(this,se)),a=on(this),s={...Et(r,a.isoDate),...a.time,offset:za(o)};s=Xn(r,s,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let u=te(e),l=ui(u),h=uo(u,"prefer"),p=Fi(r,s,ve(u)),y=Lr(s.offset);return nt(go(p.isoDate,p.time,"option",y,i,l,h,!1),i,r)}withPlainTime(t=void 0){P(this,pe);let e=m(this,_e),r=m(this,$),i=on(this).isoDate,o;return o=t===void 0?Rn(e,i):it(e,De(i,m(Ln(t),He)),"compatible"),nt(o,e,r)}withTimeZone(t){P(this,pe);let e=Dt(t);return nt(m(this,se),e,m(this,$))}withCalendar(t){P(this,pe);let e=Yi(t);return nt(m(this,se),m(this,_e),e)}add(t,e=void 0){return P(this,pe),il("add",this,t,e)}subtract(t,e=void 0){return P(this,pe),il("subtract",this,t,e)}until(t,e=void 0){return P(this,pe),Jc("until",this,t,e)}since(t,e=void 0){return P(this,pe),Jc("since",this,t,e)}round(t){if(P(this,pe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Sn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Ar(r,a,a===1),o==="nanosecond"&&r===1)return nt(m(this,se),m(this,_e),m(this,$));let s=m(this,_e),u=m(this,se),l=on(this),h;if(o==="day"){let p=l.isoDate,y=Pt(p.year,p.month,p.day+1),E=Rn(s,p),S=Rn(s,y),k=T.default.subtract(S,E);h=Se.fromEpochNsDiff(u,E).round(k,i).addToEpochNs(E)}else{let p=Ga(l,r,o,i),y=wn(s,u);h=go(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return nt(h,s,m(this,$))}equals(t){P(this,pe);let e=ii(t),r=m(this,se),i=m(e,se);return!!T.default.equal(T.default.BigInt(r),T.default.BigInt(i))&&!!Yl(m(this,_e),m(e,_e))&&un(m(this,$),m(e,$))}toString(t=void 0){P(this,pe);let e=te(t),r=Ai(e),i=Li(e),o=function(y){return _n(y,"offset",["auto","never"],"auto")}(e),a=en(e,"trunc"),s=It(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let u=function(y){return _n(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:l,unit:h,increment:p}=Ni(s,i);return jc(this,l,r,u,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){P(this,pe);let r=te(e),i=Object.create(null);if(function(u,l,h,p){if(l==null)return;let y=Reflect.ownKeys(l);for(let E=0;E<y.length;E++){let S=y[E];if(!h.some(k=>Object.is(k,S))&&Object.prototype.propertyIsEnumerable.call(l,S)){let k=l[S];u[S]=k}}}(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=m(this,_e),zc(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new $t(t,i),a=Ch.call(o).calendar,s=m(this,$);if(s!=="iso8601"&&a!=="iso8601"&&!un(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(Xt(m(this,se)))}toJSON(){return P(this,pe),jc(this,"auto")}valueOf(){jn("ZonedDateTime")}startOfDay(){P(this,pe);let t=m(this,_e);return nt(Rn(t,on(this).isoDate),t,m(this,$))}getTimeZoneTransition(t){P(this,pe);let e=m(this,_e);if(t===void 0)throw new TypeError("options parameter is required");let r=_n(typeof t=="string"?nr("direction",t):te(t),"direction",["next","previous"],Sn);if(r===void 0)throw new TypeError("direction option is required");if(zc(e)||e==="UTC")return null;let i=m(this,se),o=r==="next"?Ms(e,i):Va(e,i);return o===null?null:nt(o,e,m(this,$))}toInstant(){return P(this,pe),Xt(m(this,se))}toPlainDate(){return P(this,pe),wt(on(this).isoDate,m(this,$))}toPlainTime(){return P(this,pe),bn(on(this).time)}toPlainDateTime(){return P(this,pe),qt(on(this),m(this,$))}static from(t,e=void 0){return ii(t,e)}static compare(t,e){let r=ii(t),i=ii(e),o=m(r,se),a=m(i,se);return T.default.lessThan(T.default.BigInt(o),T.default.BigInt(a))?-1:T.default.greaterThan(T.default.BigInt(o),T.default.BigInt(a))?1:0}};function on(n){return Gt(m(n,_e),m(n,se))}function ut(n,t){P(n,pe);let e=on(n).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function yr(n,t){return P(n,pe),on(n).time[t]}Cn(Ii,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Si,Instant:Ei,Now:au,PlainDate:_i,PlainDateTime:Mi,PlainMonthDay:ki,PlainTime:Ti,PlainYearMonth:Ci,ZonedDateTime:Ii}),Cm=class{toTemporalInstant(){return Xt(Qt(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Ih=[Ei,_i,Mi,Si,ki,Ti,Ci,Ii];for(let n of Ih){let t=Object.getOwnPropertyDescriptor(n,"prototype");(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(n,"prototype",t))}var Ph="https://yuna-backend.cbocher.workers.dev/mews",xh="https://api.mews.com/api/distributor/v1",Rh="Yuna",Ah="mewscache",Lh=!1,Nh=13,Oh=8,Fh=xe.Duration.from({minutes:20}).milliseconds,Hh=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),be={base_url:Ph,bookingEngine_url:xh,bookingEngineClient:Rh,bypassCache:Lh,headers:Hh,cache_key:Ah,ttl:Fh,beCheckInUTC:Nh,beCheckOutUTC:Oh};var jo=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var Or=class{constructor(){Y(this,"dbName","MewsAPICache");Y(this,"version",2);Y(this,"db",null);Y(this,"initPromise",null);Y(this,"performanceMetrics",[]);this.initPromise=this.init()}async init(){return new Promise((t,e)=>{try{let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.error("Failed to initialize IndexedDB:",r.error),e(r.error)},r.onsuccess=()=>{this.db=r.result,t()},r.onupgradeneeded=i=>{let o=i.target.result,{oldVersion:a}=i;if(a>0)try{o.objectStoreNames.contains("api_cache")&&o.deleteObjectStore("api_cache"),o.objectStoreNames.contains("performance_metrics")&&o.deleteObjectStore("performance_metrics")}catch(l){console.warn("Error cleaning up old stores:",l)}let s=o.createObjectStore("api_cache",{keyPath:"cacheKey"});s.createIndex("by-timestamp","timestamp"),s.createIndex("by-enterprise","enterpriseId"),s.createIndex("by-size","size"),o.createObjectStore("performance_metrics",{keyPath:"timestamp"}).createIndex("by-operation","operation")},r.onblocked=()=>{console.warn("IndexedDB upgrade blocked by another tab")}}catch(r){console.error("Failed to initialize IndexedDB:",r),e(r)}})}async ensureDB(){if(!this.db&&(await this.initPromise,!this.db))throw new Error("Failed to initialize IndexedDB");return this.db}calculateDataSize(t){try{return new Blob([JSON.stringify(t)]).size}catch{return 0}}recordPerformanceMetric(t,e,r,i){let o=performance.now()-e,a={operation:t,duration:o,timestamp:Date.now(),cacheHit:r,dataSize:i};this.performanceMetrics.push(a),this.performanceMetrics.length>1e3&&(this.performanceMetrics=this.performanceMetrics.slice(-1e3)),this.storeMetricAsync(a).catch(console.error)}async storeMetricAsync(t){try{let e=await this.ensureDB();return new Promise(r=>{let a=e.transaction("performance_metrics","readwrite").objectStore("performance_metrics").add(t);a.onerror=()=>r(),a.onsuccess=()=>r()})}catch{}}async get(t,e){let r=performance.now();try{let i=await this.ensureDB();return new Promise(o=>{let u=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);u.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},u.onsuccess=()=>{let l=u.result;if(!l){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:be.ttl,p=xe.Instant.fromEpochMilliseconds(l.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,l.size),o(l.data)}})}catch(i){return console.error("Error getting cached data:",i),this.recordPerformanceMetric("cache-error",r,!1),null}}async set(t,e,r){let i=performance.now();try{let o=await this.ensureDB(),a=this.calculateDataSize(e),s={cacheKey:t,data:e,timestamp:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((u,l)=>{let y=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),l(y.error)},y.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),u()}})}catch(o){if(console.error("Error setting cached data:",o),this.recordPerformanceMetric("cache-write-error",i,!1),o instanceof Error&&o.name==="QuotaExceededError"){await this.cleanupOldEntries();try{let a=await this.ensureDB(),s={cacheKey:t,data:e,timestamp:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((u,l)=>{let y=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>l(y.error),y.onsuccess=()=>u()})}catch(a){console.error("Error setting cached data after cleanup:",a)}}}}async delete(t){try{let i=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((o,a)=>{let s=i.delete(t);s.onsuccess=()=>o(),s.onerror=()=>a(s.error)})}catch(e){console.error("Error deleting cached data:",e)}}async clearExpired(){let t=performance.now(),e=0;try{let r=await this.ensureDB(),i=xe.Now.instant().epochMilliseconds-be.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),u=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),l=50;for(let h=0;h<u.length;h+=l){let p=u.slice(h,h+l);await Promise.all(p.map(y=>new Promise((E,S)=>{let k=a.delete(y.cacheKey);k.onsuccess=()=>E(),k.onerror=()=>S(k.error)}))),e+=p.length,h+l<u.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,u)=>{let l=o.getAll();l.onsuccess=()=>s(l.result),l.onerror=()=>u(l.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(u=>new Promise((l,h)=>{let p=i.delete(u.cacheKey);p.onsuccess=()=>l(),p.onerror=()=>h(p.error)})))}await new Promise((s,u)=>{r.oncomplete=()=>s(),r.onerror=()=>u(r.error)})}catch(e){console.error("Error cleaning up old entries:",e)}}async clearAll(){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((i,o)=>{let a=r.clear();a.onsuccess=()=>i(),a.onerror=()=>o(a.error)})}catch(t){console.error("Error clearing all cache:",t)}}async getCacheStats(){try{let r=(await this.ensureDB()).transaction("api_cache","readonly").objectStore("api_cache"),i=await new Promise((a,s)=>{let u=r.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>s(u.error)}),o={totalEntries:i.length,totalSize:i.reduce((a,s)=>a+(s.size||0),0),oldestEntry:i.length>0?Math.min(...i.map(a=>a.timestamp)):null,newestEntry:i.length>0?Math.max(...i.map(a=>a.timestamp)):null,entriesByEnterprise:{}};return i.forEach(a=>{let s=a.enterpriseId||"unknown";o.entriesByEnterprise[s]=(o.entriesByEnterprise[s]||0)+1}),o}catch(t){return console.error("Error getting cache stats:",t),{totalEntries:0,totalSize:0,oldestEntry:null,newestEntry:null,entriesByEnterprise:{}}}}getPerformanceMetrics(){return[...this.performanceMetrics]}getAveragePerformance(){let t=this.performanceMetrics,e=t.filter(o=>o.operation==="cache-hit"),r=t.filter(o=>o.operation==="cache-miss"),i=t.filter(o=>o.operation==="cache-write");return{averageCacheHitTime:e.length>0?e.reduce((o,a)=>o+a.duration,0)/e.length:0,averageCacheMissTime:r.length>0?r.reduce((o,a)=>o+a.duration,0)/r.length:0,averageWriteTime:i.length>0?i.reduce((o,a)=>o+a.duration,0)/i.length:0,cacheHitRate:e.length+r.length>0?e.length/(e.length+r.length):0,totalOperations:t.length}}async performMaintenance(){try{setTimeout(async()=>{await this.clearExpired(),(await this.getCacheStats()).totalEntries>2e3&&await this.cleanupOldEntries(1500)},0)}catch(t){console.error("Error during cache maintenance:",t)}}};var Rs=async(n,t,e=null,r=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new Or,o=jo(`booking-engine:${n}`,e||"null",t.body);if(!be.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(u=>{console.error("Error setting booking engine cache:",u)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var su=(n,t)=>{let e=`${be.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Rs(e,r,n)},cu=(n,t)=>{let e=`${be.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Rs(e,r,n)};var As=class{constructor(){Y(this,"listeners",new Map)}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e)}off(t,e){this.listeners.get(t)?.delete(e)}emit(t,e){this.listeners.get(t)?.forEach(r=>r(e))}},zo=new As;function qe(n,t){zo.emit(n,t)}function et(n,t){Array.isArray(n)?n.forEach(e=>zo.on(e,t)):zo.on(n,t)}var lu={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"}},Ls={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."]},du=()=>{let n=sr().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in Ls)return Ls[r];return Ls.en},uu=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Yh=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},ke=n=>lu[sr().bcp47][n]||lu["fr-FR"][n],Ut=n=>{let t=sr().bcp47,e=t.split("-")[0],r=uu(n,Yh(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=uu(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 sr=()=>{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},tn=sr().bcp47,Qm=sr().iso639;function Ns(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Os=Object.assign;var $h=Object.prototype.hasOwnProperty,Uo=(n,t)=>$h.call(n,t),cr=Array.isArray,Vi=n=>hu(n)==="[object Map]";var Bh=n=>typeof n=="string",Fr=n=>typeof n=="symbol",qi=n=>n!==null&&typeof n=="object";var jh=Object.prototype.toString,hu=n=>jh.call(n),mu=n=>hu(n).slice(8,-1);var Vo=n=>Bh(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var qo=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},zh=/-(\w)/g,np=qo(n=>n.replace(zh,(t,e)=>e?e.toUpperCase():"")),Uh=/\B([A-Z])/g,rp=qo(n=>n.replace(Uh,"-$1").toLowerCase()),Vh=qo(n=>n.charAt(0).toUpperCase()+n.slice(1)),ip=qo(n=>n?`on${Vh(n)}`:""),lr=(n,t)=>!Object.is(n,t);var qh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var op=Ns(qh+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Fs;var Le;var Hs=new WeakSet,Go=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Fs&&Fs.active&&Fs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hs.has(this)&&(Hs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Wh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,pu(this),yu(this);let t=Le,e=nn;Le=this,nn=!0;try{return this.fn()}finally{vu(this),Le=t,nn=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Xs(t);this.deps=this.depsTail=void 0,pu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Bs(this)&&this.run()}get dirty(){return Bs(this)}},gu=0,Ki,Gi;function Wh(n,t=!1){if(n.flags|=8,t){n.next=Gi,Gi=n;return}n.next=Ki,Ki=n}function Zs(){gu++}function Js(){if(--gu>0)return;if(Gi){let t=Gi;for(Gi=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;Ki;){let t=Ki;for(Ki=void 0;t;){let e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){n||(n=r)}t=e}}if(n)throw n}function yu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),Xs(r),Gh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function Bs(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Kh(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Kh(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Zo)||(n.globalVersion=Zo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Bs(n))))return;n.flags|=2;let t=n.dep,e=Le,r=nn;Le=n,nn=!0;try{yu(n);let i=n.fn(n._value);(t.version===0||lr(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=e,nn=r,vu(n),n.flags&=-3}}function Xs(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)Xs(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Gh(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function bu(n,t){n.effect instanceof Go&&(n=n.effect.fn);let e=new Go(n);t&&Os(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var nn=!0,wu=[];function Zh(){wu.push(nn),nn=!1}function Jh(){let n=wu.pop();nn=n===void 0?!0:n}function pu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var Zo=0,js=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Jo=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Le||!nn||Le===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Le)e=this.activeLink=new js(Le,this),Le.deps?(e.prevDep=Le.depsTail,Le.depsTail.nextDep=e,Le.depsTail=e):Le.deps=Le.depsTail=e,Du(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){let r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=Le.depsTail,e.nextDep=void 0,Le.depsTail.nextDep=e,Le.depsTail=e,Le.deps===e&&(Le.deps=r)}return e}trigger(t){this.version++,Zo++,this.notify(t)}notify(t){Zs();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Js()}}};function Du(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)Du(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var zs=new WeakMap,ur=Symbol(""),Us=Symbol(""),Zi=Symbol("");function Rt(n,t,e){if(nn&&Le){let r=zs.get(n);r||zs.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new Jo),i.map=r,i.key=e),i.track()}}function zn(n,t,e,r,i,o){let a=zs.get(n);if(!a){Zo++;return}let s=u=>{u&&u.trigger()};if(Zs(),t==="clear")a.forEach(s);else{let u=cr(n),l=u&&Vo(e);if(u&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===Zi||!Fr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),l&&s(a.get(Zi)),t){case"add":u?l&&s(a.get("length")):(s(a.get(ur)),Vi(n)&&s(a.get(Us)));break;case"delete":u||(s(a.get(ur)),Vi(n)&&s(a.get(Us)));break;case"set":Vi(n)&&s(a.get(ur));break}}Js()}function Hr(n){let t=Ie(n);return t===n?t:(Rt(t,"iterate",Zi),Un(n)?t:t.map(St))}function Qs(n){return Rt(n=Ie(n),"iterate",Zi),n}var Xh={__proto__:null,[Symbol.iterator](){return Ys(this,Symbol.iterator,St)},concat(...n){return Hr(this).concat(...n.map(t=>cr(t)?Hr(t):t))},entries(){return Ys(this,"entries",n=>(n[1]=St(n[1]),n))},every(n,t){return In(this,"every",n,t,void 0,arguments)},filter(n,t){return In(this,"filter",n,t,e=>e.map(St),arguments)},find(n,t){return In(this,"find",n,t,St,arguments)},findIndex(n,t){return In(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return In(this,"findLast",n,t,St,arguments)},findLastIndex(n,t){return In(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return In(this,"forEach",n,t,void 0,arguments)},includes(...n){return $s(this,"includes",n)},indexOf(...n){return $s(this,"indexOf",n)},join(n){return Hr(this).join(n)},lastIndexOf(...n){return $s(this,"lastIndexOf",n)},map(n,t){return In(this,"map",n,t,void 0,arguments)},pop(){return Wi(this,"pop")},push(...n){return Wi(this,"push",n)},reduce(n,...t){return fu(this,"reduce",n,t)},reduceRight(n,...t){return fu(this,"reduceRight",n,t)},shift(){return Wi(this,"shift")},some(n,t){return In(this,"some",n,t,void 0,arguments)},splice(...n){return Wi(this,"splice",n)},toReversed(){return Hr(this).toReversed()},toSorted(n){return Hr(this).toSorted(n)},toSpliced(...n){return Hr(this).toSpliced(...n)},unshift(...n){return Wi(this,"unshift",n)},values(){return Ys(this,"values",St)}};function Ys(n,t,e){let r=Qs(n),i=r[t]();return r!==n&&!Un(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Qh=Array.prototype;function In(n,t,e,r,i,o){let a=Qs(n),s=a!==n&&!Un(n),u=a[t];if(u!==Qh[t]){let p=u.apply(n,o);return s?St(p):p}let l=e;a!==n&&(s?l=function(p,y){return e.call(this,St(p),y,n)}:e.length>2&&(l=function(p,y){return e.call(this,p,y,n)}));let h=u.call(a,l,r);return s&&i?i(h):h}function fu(n,t,e,r){let i=Qs(n),o=e;return i!==n&&(Un(n)?e.length>3&&(o=function(a,s,u){return e.call(this,a,s,u,n)}):o=function(a,s,u){return e.call(this,a,St(s),u,n)}),i[t](o,...r)}function $s(n,t,e){let r=Ie(n);Rt(r,"iterate",Zi);let i=r[t](...e);return(i===-1||i===!1)&&hm(e[0])?(e[0]=Ie(e[0]),r[t](...e)):i}function Wi(n,t,e=[]){Zh(),Zs();let r=Ie(n)[t].apply(n,e);return Js(),Jh(),r}var em=Ns("__proto__,__v_isRef,__isVue"),Eu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Fr));function tm(n){Fr(n)||(n=String(n));let t=Ie(this);return Rt(t,"has",n),t.hasOwnProperty(n)}var Xo=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,r){if(e==="__v_skip")return t.__v_skip;let i=this._isReadonly,o=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return o;if(e==="__v_raw")return r===(i?o?lm:Su:o?cm:Mu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=cr(t);if(!i){let u;if(a&&(u=Xh[e]))return u;if(e==="hasOwnProperty")return tm}let s=Reflect.get(t,e,Yr(t)?t:r);return(Fr(e)?Eu.has(e):em(e))||(i||Rt(t,"get",e),o)?s:Yr(s)?a&&Vo(e)?s:s.value:qi(s)?i?Qo(s):Br(s):s}},Vs=class extends Xo{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let u=$r(o);if(!Un(r)&&!$r(r)&&(o=Ie(o),r=Ie(r)),!cr(t)&&Yr(o)&&!Yr(r))return u?!1:(o.value=r,!0)}let a=cr(t)&&Vo(e)?Number(e)<t.length:Uo(t,e),s=Reflect.set(t,e,r,Yr(t)?t:i);return t===Ie(i)&&(a?lr(r,o)&&zn(t,"set",e,r,o):zn(t,"add",e,r)),s}deleteProperty(t,e){let r=Uo(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&zn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Fr(e)||!Eu.has(e))&&Rt(t,"has",e),r}ownKeys(t){return Rt(t,"iterate",cr(t)?"length":ur),Reflect.ownKeys(t)}},qs=class extends Xo{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},nm=new Vs,rm=new qs;var Ws=n=>n,Wo=n=>Reflect.getPrototypeOf(n);function im(n,t,e){return function(...r){let i=this.__v_raw,o=Ie(i),a=Vi(o),s=n==="entries"||n===Symbol.iterator&&a,u=n==="keys"&&a,l=i[n](...r),h=e?Ws:t?Ks:St;return!t&&Rt(o,"iterate",u?Us:ur),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function Ko(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function om(n,t){let e={get(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);n||(lr(i,s)&&Rt(a,"get",i),Rt(a,"get",s));let{has:u}=Wo(a),l=t?Ws:n?Ks:St;if(u.call(a,i))return l(o.get(i));if(u.call(a,s))return l(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Rt(Ie(i),"iterate",ur),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);return n||(lr(i,s)&&Rt(a,"has",i),Rt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,u=Ie(s),l=t?Ws:n?Ks:St;return!n&&Rt(u,"iterate",ur),s.forEach((h,p)=>i.call(o,l(h),l(p),a))}};return Os(e,n?{add:Ko("add"),set:Ko("set"),delete:Ko("delete"),clear:Ko("clear")}:{add(i){!t&&!Un(i)&&!$r(i)&&(i=Ie(i));let o=Ie(this);return Wo(o).has.call(o,i)||(o.add(i),zn(o,"add",i,i)),this},set(i,o){!t&&!Un(o)&&!$r(o)&&(o=Ie(o));let a=Ie(this),{has:s,get:u}=Wo(a),l=s.call(a,i);l||(i=Ie(i),l=s.call(a,i));let h=u.call(a,i);return a.set(i,o),l?lr(o,h)&&zn(a,"set",i,o,h):zn(a,"add",i,o),this},delete(i){let o=Ie(this),{has:a,get:s}=Wo(o),u=a.call(o,i);u||(i=Ie(i),u=a.call(o,i));let l=s?s.call(o,i):void 0,h=o.delete(i);return u&&zn(o,"delete",i,void 0,l),h},clear(){let i=Ie(this),o=i.size!==0,a=void 0,s=i.clear();return o&&zn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=im(i,n,t)}),e}function _u(n,t){let e=om(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Uo(e,i)&&i in r?e:r,i,o)}var am={get:_u(!1,!1)};var sm={get:_u(!0,!1)};var Mu=new WeakMap,cm=new WeakMap,Su=new WeakMap,lm=new WeakMap;function um(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dm(n){return n.__v_skip||!Object.isExtensible(n)?0:um(mu(n))}function Br(n){return $r(n)?n:ku(n,!1,nm,am,Mu)}function Qo(n){return ku(n,!0,rm,sm,Su)}function ku(n,t,e,r,i){if(!qi(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=dm(n);if(o===0)return n;let a=i.get(n);if(a)return a;let s=new Proxy(n,o===2?r:e);return i.set(n,s),s}function $r(n){return!!(n&&n.__v_isReadonly)}function Un(n){return!!(n&&n.__v_isShallow)}function hm(n){return n?!!n.__v_raw:!1}function Ie(n){let t=n&&n.__v_raw;return t?Ie(t):n}var St=n=>qi(n)?Br(n):n,Ks=n=>qi(n)?Qo(n):n;function Yr(n){return n?n.__v_isRef===!0:!1}function Be(n){return mm(n,!1)}function mm(n,t){return Yr(n)?n:new Gs(n,t)}var Gs=class{constructor(t,e){this.dep=new Jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Ie(t),this._value=e?t:St(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||Un(t)||$r(t);t=r?t:Ie(t),lr(t,e)&&(this._rawValue=t,this._value=r?t:St(t),this.dep.trigger())}};var Ke=async(n,t,e=null,r=!1)=>{let i=new Or,o=jo(n,e||"null",t.body);if(!be.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(be.base_url);r&&(a.pathname=a.pathname.replace("/mews","/_adapter")),a.pathname+=n,a.searchParams.set("enterprise",e||"null");let s=await fetch(a.toString(),t),u=await s.json();if(s.ok)return i.set(o,u,e||"null").catch(l=>{console.error("Error setting cache:",l)}),u;throw new Error("FETCH_ERROR",{cause:u})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var Tu=(n,t={})=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/services/getAll",e,n)};function Cu(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Ut(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var ec=Be({});async function Iu(n){if(ec.value[n])return ec.value[n];let t=await Tu(n),e=Cu(t);return ec.value[n]=e,e}var Pu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/ageCategories/getAll",e,n)};function xu(n){if(!n||!n.AgeCategories||!Array.isArray(n.AgeCategories))throw new Error("Invalid age categories response format");return n.AgeCategories.map(t=>({id:t.Id,name:Ut(t.Names),shortName:t.ShortNames?Ut(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var tc=Be({});async function Ru(n){if(tc.value[n])return tc.value[n];let t=await Pu(n,{EnterpriseIds:[n]}),e=xu(t);return tc.value[n]=e,e}var Au=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/products/getAll",e,n)};function Lu(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 Nu(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 Ou(n){if(!n||!n.Rates||!Array.isArray(n.Rates))throw new Error("Invalid rates response format");return n.Rates.filter(t=>t.IsActive&&t.IsEnabled&&t.IsPublic).map(t=>({id:t.Id,serviceId:t.ServiceId,baseRateId:t.BaseRateId,isBaseRate:t.IsBaseRate,isActive:t.IsActive,isEnabled:t.IsEnabled,isPublic:t.IsPublic,isDefault:t.IsDefault,type:t.Type,name:Ut(t.Names),shortName:t.ShortName,description:Ut(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function Ji(n,t){return n.map(t)}function nc(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Ut(n.Names),shortName:Ut(n.ShortNames),description:Ut(n.Descriptions),options:n.Options,promotions:n.Promotions,classifications:n.Classifications,pricing:n.Pricing,imageIds:n.ImageIds||[],ordering:n.Ordering,consumptionMoment:n.ConsumptionMoment,chargingMode:n.ChargingMode}}function Fu(n){return{products:Ji(n.Products,nc),customerProducts:Ji(n.CustomerProducts,nc)}}var rc=Be({});async function Hu(n,t){if(rc.value[t])return rc.value[t];let e=await Au(n,{ServiceIds:[t]}),r=Fu(e);return rc.value[t]=r,r}var Yu=(n,t={})=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rates/getAll",e,n)};var ic=Be({});async function $u(n,t){if(ic.value[t])return ic.value[t];let e=await Yu(n,{ServiceIds:[t]}),r=Ou(e);return ic.value[t]=r,r}var Bu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/services/getAvailability",e,n)};function ju(n){if(!n||!n.CategoryAvailabilities||!Array.isArray(n.CategoryAvailabilities)||!n.TimeUnitStartsUtc)throw new Error("Invalid service availabilities response format");return n.CategoryAvailabilities.map(t=>({categoryId:t.CategoryId,timeUnitStartsUTC:n.TimeUnitStartsUtc,availabilities:t.Availabilities||[],adjustments:t.Adjustments||[]}))}var Z=class n{static getCurrentDate(){return 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(tn,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 Rf=localStorage.getItem("dev")==="true";var Af=3*60*60*1e3;var ea="calendar-day-price",zu="DD/MM/YYYY",Uu="Y-m-d",oc=!1,pm=365,ac=Z.getCurrentDate(),Vu=Z.addDays(ac,pm),dr=Z.getCurrentDate(),jr=Z.addDays(dr,3),fm=Z.getCurrentDate(),Lf=Z.addDays(fm,30);function hr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}function qu(n=!0,t=document.body,e=ke("fatalErrorMessage")){t.querySelectorAll('[data-fs-element="preloader"]').forEach(i=>{let o=i.querySelector('[data-fs-element="spinner"]'),a=i.querySelector('[data-fs-element="message"]'),s=i.firstChild;o&&o.classList.toggle("hide",n),a&&(n?(s.style.width="90%",a.textContent=e):(s.removeAttribute("style"),a.textContent=ke("pleaseWait"))),i.classList.toggle("hide",!n)})}var sc=class{constructor(){Y(this,"state",Br({appartmentsData:[],today:Z.getCurrentDate(),lowestPricesByDate:{},isLoadingPrices:!1,isLoadingData:!1}))}setAppartmentsData(t){this.state.appartmentsData=t}setLowestPricesByDate(t){this.state.lowestPricesByDate=t}setLoadingPrices(t){this.state.isLoadingPrices=t}setLoadingData(t){this.state.isLoadingData=t}reset(){this.state.appartmentsData=[],this.state.lowestPricesByDate={},this.state.isLoadingPrices=!1,this.state.isLoadingData=!1}},Vf=new sc;var mr={get:n=>{try{let t=localStorage.getItem(n);return t?JSON.parse(t):null}catch(t){return console.error(`Error reading from localStorage for key ${n}:`,t),null}},set:(n,t)=>{try{localStorage.setItem(n,JSON.stringify(t)),mr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=mr.get(n),r=t(e);mr.set(n,r)},remove:n=>{localStorage.removeItem(n),mr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",gm()||"root")}},gm=()=>localStorage.getItem("lastUpdater");var ta=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},Vn=mr.get("form_state"),Wu=Vn?{enterpriseId:Vn.enterpriseId||"",startDate:Vn.startDate||ta(45),endDate:Vn.endDate||ta(48),guests:Vn.guests||2,coupon:Vn.coupon||"",referrer:Vn.referrer||window.location.href,rooms:Vn.rooms||0}:{enterpriseId:"",startDate:ta(45),endDate:ta(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},fe=Br(Wu),ym=Qo(Wu);bu(()=>{mr.set("form_state",fe)});var vm="data-fs-element";var je=(n,t=document)=>t.querySelector(`[${vm}="${n}"]`);var cc=Be({});async function Ku(n,t,e,r){if(cc.value[t])return cc.value[t];let i=await Bu(n,{ServiceId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=ju(i);return cc.value[t]=o,o}var Gu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/restrictions/getAll",e,n)};function Zu(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var lc=Be({});async function Ju(n,t,e,r){if(lc.value[t])return lc.value[t];let i=await Gu(n,{ServiceIds:[t],CollidingUtc:{StartUtc:Z.formatForAPI(e),EndUtc:Z.formatForAPI(r)},Origin:"User"}),o=Zu(i);return lc.value[t]=o,o}var Xu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rules/getAll",e,n)};function Qu(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 uc=Be({});async function ed(n,t){if(uc.value[t])return uc.value[t];let e=await Xu(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Qu(e);return uc.value[t]=r,r}var td=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rates/getPricing",e,n)};var dc=Be({});async function nd(n,t,e,r){if(dc.value[t])return dc.value[t];let i=await td(n,{RateId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=Lu(i);return dc.value[t]=o,o}var na=class{constructor(t,e){Y(this,"enterprise");Y(this,"rate",null);Y(this,"pricing",null);this.enterprise=t,this.rate=e}getRate(){if(!this.rate)throw new Error("Rate is not initialized");return this.rate}async initPricing(t,e){if(!this.rate)throw new Error("Rate is not initialized");return this.pricing=await nd(this.enterprise.getEnterpriseId(),this.rate.id,t,e),this.pricing}getPricing(){if(!this.pricing)throw new Error("Rate pricing is not initialized");return this.pricing}};var ra=class{constructor(t,e){Y(this,"enterprise");Y(this,"service",null);Y(this,"products",[]);Y(this,"customerProducts",[]);Y(this,"restrictions",[]);Y(this,"availabilities",[]);Y(this,"rules",[]);Y(this,"ageCategories",[]);Y(this,"rates",[]);this.enterprise=t,this.service=e}getService(){return this.service}async initAvailabilities(t,e){if(!this.service)throw new Error("Service is not initialized");return this.availabilities=await Ku(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 Ju(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 Hu(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 $u(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new na(this.enterprise,e)),this.rates.length===0)throw new Error("No rates found for the service");return this.rates}getRates(){if(this.rates.length===0)throw new Error("Service rates are not initialized");return this.rates?.map(t=>t.getRate())||[]}async initRules(){if(!this.service)throw new Error("Service is not initialized");return this.rules=await ed(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 Ru(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var zr=class{constructor(t){Y(this,"enterpriseId");Y(this,"services",[]);Y(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await Iu(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ra(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var hc=new Set;function rd(n,t){return`${n}::${t}`}var bm={"f461699f-a1f6-43cf-9a1b-b02e006e7eb4":"north-west","bb3b0e7e-57aa-411c-a792-aac700d98f74":"north-west","46ca4a98-0aad-448d-91e5-b12a00993f1a":"north-west","9db867c2-6b95-4a24-ac25-aac700d7a2c8":"center-left","13be5e61-3a0f-4fd8-84d5-b02e006dd9db":"center-left","9b5c8357-dbb4-41cb-94af-ae9300f5b16b":"center-left"};function id(n){return bm[n]??null}var ia=class{constructor(t){this.fsListInstance=t;Y(this,"cmsAparthotels",[]);Y(this,"showUnavailableItems",!1);Y(this,"state",{startDate:fe.startDate?Z.safeParsePlainDate(fe.startDate):dr,endDate:fe.endDate?Z.safeParsePlainDate(fe.endDate):jr,apiDataCache:new Map});et("loading:start",e=>hr(!0,e)),et("loading:end",e=>hr(!1,e))}filterAvailableItems(t){return t.filter(e=>Number(e.fields["price-sort"]?.value||9999999)<999999)}applyRelatedListFilters(t){if(this.fsListInstance.instance!=="related")return t;let e=this.filterAvailableItems(t),r=fe.guests||1,o=e.filter(h=>{let p=Number(h.fields.guests?.value||0);return p>=r&&p<=r+2}).filter(h=>{let p=h.fields["enterprise-id"]?.value,y=h.fields["resource-category-id"]?.value;return!p||!y?!0:!hc.has(rd(p,y))}),a=fe.enterpriseId,s=a?id(a):null,u=[],l=[];for(let h of o){let p=h.fields["enterprise-id"]?.value||"";s&&id(p)===s?u.push(h):l.push(h)}return[...this.shuffleArray(u),...this.shuffleArray(l)].slice(0,4)}shuffleArray(t){let e=[...t];for(let r=e.length-1;r>0;r--){let i=Math.floor(Math.random()*(r+1));[e[r],e[i]]=[e[i],e[r]]}return e}init(){qe("loading:start",this.fsListInstance.wrapperElement),this.fsListInstance.addHook("filter",async t=>{console.log("*** Filter hook triggered with items:",t),qe("loading:start",this.fsListInstance.wrapperElement);let e=!!(fe.startDate&&fe.endDate);if(!e)t.forEach(a=>this.resetItemState(a));else if(e&&(await new Promise(a=>setTimeout(a,100)),await this.updateListItems(t,{startDate:this.state.startDate.toString(),endDate:this.state.endDate.toString(),guests:fe.guests||1,rooms:fe.rooms||1}),this.fsListInstance.instance!=="related")){hc.clear();for(let a of this.filterAvailableItems(t)){let s=a.fields["enterprise-id"]?.value,u=a.fields["resource-category-id"]?.value;s&&u&&hc.add(rd(s,u))}qe("mainlist:available:updated",void 0)}let r=je("aparthotels-count");if(r&&this.fsListInstance.instance!=="related"){let a=e?this.filterAvailableItems(t):t;r.textContent=String(a.length)}let i=this.applyRelatedListFilters(t),o=e&&!this.showUnavailableItems&&this.fsListInstance.instance!=="related"?i.filter(a=>Number(a.fields["price-sort"]?.value||9999999)<9999999):i;return qe("loading:end",this.fsListInstance.wrapperElement),o}),this.fsListInstance.instance==="related"&&(et("mainlist:available:updated",()=>{this.fsListInstance.triggerHook("filter")}),et("guests:changed",()=>{this.fsListInstance.triggerHook("filter")}),et("apartment:changed",()=>{this.fsListInstance.triggerHook("filter")})),et("date:changed",t=>{console.log("Date changed:",t),this.state.startDate=t.startDate?Z.safeParsePlainDate(t.startDate):dr,this.state.endDate=t.endDate?Z.safeParsePlainDate(t.endDate):jr,fe.startDate=t.startDate||null,fe.endDate=t.endDate||null,this.fsListInstance.triggerHook("filter")})}groupItemsByEnterprise(t){let e={};return t.forEach(r=>{if(!r.fields["enterprise-id"]||!r.fields["resource-category-id"])return;let i=r.fields["enterprise-id"].value,o=r.fields["resource-category-id"].value;e[i]||(e[i]=[]),e[i].includes(o)||e[i].push(o)}),console.log("#=> Grouped by enterprise:",e),e}createCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i.sort().join(",")}`}async fetchApiData(t,e,r){let o=Date.now(),a=[],s=[];for(let[l,h]of Object.entries(r)){let p=this.createCacheKey(t,e,l,h),y=this.state.apiDataCache.get(p);if(y&&o-y.timestamp<3e5){console.log(`Using cached data for ${l} with ${h.length} categories`),a.push(y);continue}let E=(async()=>{try{let S=new zr(l);await S.initServices();let{reservableService:k}=S,A=k?.getService()?.id;if(!A)return console.warn(`No serviceId found for enterprise ${l}`),null;await k?.initAgeCategories();let B=k?.getAgeCategories()||[],V=await Promise.all([su(l,{EnterpriseId:l,CategoryIds:h,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,Client:be.bookingEngineClient,LanguageCode:"fr-FR"}),cu(l,{Client:be.bookingEngineClient,EnterpriseId:l,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,CategoryIds:h,CurrencyCode:"EUR"})]),G=V[0],U=V[1],J={enterpriseId:l,ageCategories:B,availabilities:G,servicePricing:U,timestamp:o};return this.state.apiDataCache.set(p,J),J}catch(S){return console.error(`Error fetching data for enterprise ${l}:`,S),null}})();s.push(E)}let u=await Promise.all(s);return[...a,...u.filter(Boolean)]}async updateListItems(t,{startDate:e,endDate:r,guests:i,rooms:o}){let a=this.groupItemsByEnterprise(t),s=await this.fetchApiData(e,r,a);return console.log("#=> API Data:",s),(await Promise.all(t.map(async l=>{let h=!1,p=!0;if(this.screenItem(l,!0),!l.fields["enterprise-id"]){console.warn(`Item missing enterprise-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,ke("missingEnterpriseId"));return}if(!l.fields["resource-category-id"]){console.warn(`Item missing resource-category-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,ke("missingCategoryId"));return}let y=l.fields["enterprise-id"].value,E=l.fields["resource-category-id"].value,S=s.find(J=>J&&J.enterpriseId===y);if(!S){console.warn(`No data found for enterpriseId: ${y} in item: [${l.fields.title.value}]\u21FE[${l.fields.name.value}]`),l.element.style.opacity="0.5",this.screenItem(l,!1,ke("booked"));return}let k=S.availabilities.ApplicableRestrictions||[],A={title:l.fields.title.value,name:l.fields.name.value,exactRateId:"",baseRateId:"",rateGroupId:"",categoryId:E,categoryType:"notVilla",guests:i,startDate:Z.fromString(e),endDate:Z.fromString(r)},B=this.checkReservationAgainstRestrictions(A,k);return console.log("Restriction Verdict:",B),p=S.availabilities.CategoryAvailabilities.find(J=>J.CategoryId===A.categoryId)?.Availabilities?.slice(0,-1).every(J=>J>0)||!1,h=B.block,h?this.screenItem(l,!1,B.message||ke("booked")):this.screenItem(l,!0),this.updateItemPrice(l,S.servicePricing,E,{startDate:e,endDate:r,guests:i,isLimited:h,isReservable:p,restrictions:k,restrictionMessage:B.message,restrictionBlock:B.block}),l.collectFields(),l}))).filter(l=>l!==null)}checkReservationAgainstRestrictions(t,e){console.log("Restrictions:",e);let r=e.filter(s=>this.matchesCondition(t,s.Conditions));if(console.log("Applicable Restrictions:",r),r.length===0)return{block:!1,message:null};let i=r.some(s=>{let{Exceptions:u}=s;return u.MaxAdvance==null&&u.MinAdvance==null&&u.MaxLength==null&&u.MinLength==null&&u.MaxPrice==null&&u.MinPrice==null&&u.MaxReservationCount==null&&u.MinReservationCount==null});if(console.log("Has full restriction:",i),i)return{block:!0,message:ke("booked")};let o=this.getExtremesFromExceptions(r);console.log("Restriction Extremes:",o);let a=this.violatesException(t,o);return console.log("Violation:",a),a?{block:!0,message:a}:{block:!1,message:null}}matchesCondition(t,e){return(e.ExactRateId===null||t.exactRateId===e.ExactRateId)&&(e.BaseRateId===null||t.baseRateId===e.BaseRateId)&&(e.RateGroupId===null||t.rateGroupId===e.RateGroupId)&&(e.ResourceCategoryId===null||t.categoryId===e.ResourceCategoryId)&&(e.ResourceCategoryType===null||t.categoryType===e.ResourceCategoryType)&&e.Days.includes(t.startDate.toLocaleString("en-US",{weekday:"long"}))&&!0}getDurationInDays(t){if(!t)return null;try{return xe.Duration.from(t).total({unit:"days"})}catch{return null}}getExtremesFromExceptions(t){let e=null,r=null,i=null,o=null,a=!1;for(let s of t){let u=this.getDurationInDays(s.Exceptions.MinAdvance),l=this.getDurationInDays(s.Exceptions.MaxAdvance),h=this.getDurationInDays(s.Exceptions.MinLength),p=this.getDurationInDays(s.Exceptions.MaxLength);u!==null&&(e=Math.max(e??u,u)),l!==null&&(r=Math.min(r??l,l)),h!==null&&(i=Math.max(i??h,h)),p!==null&&(o=Math.min(o??p,p)),!u&&!l&&!h&&!p&&(a=!0)}return{MinAdvance:e,MaxAdvance:r,MinLength:i,MaxLength:o,Restrict:a}}violatesException(t,e){let{startDate:r}=t,{endDate:i}=t,o=i.since(r,{largestUnit:"day"}).days,a=Z.getCurrentDate(),s=r.since(a,{largestUnit:"day"}).days;return e.MinLength&&o<e.MinLength?`${e.MinLength} ${ke("minimumNights")}`:e.MaxLength&&o>e.MaxLength?`${e.MaxLength} ${ke("maximumNights")}`:e.MinAdvance&&s<e.MinAdvance?ke("booked"):e.MaxAdvance&&s>e.MaxAdvance?ke("booked"):!e.MinLength&&!e.MaxLength&&!e.MinAdvance&&!e.MaxAdvance?ke("booked"):null}updateItemPrice(t,e,r,{startDate:i,endDate:o,guests:a,isLimited:s,isReservable:u,restrictions:l,restrictionMessage:h,restrictionBlock:p}){console.groupCollapsed(`[${t.fields.title.value}] \u21FE [${t.fields.name.value}] PRICE UPDATE`),console.log(`Is Limited: ${s}`),console.log(`Is Reservable: ${u}`),console.log(`Restriction Block: ${p}`),console.log(`Restriction Message: ${h||"None"}`);let y=je("price",t.element),E=t.element.querySelector('[fs-list-field="price-sort"]'),S=je("total-price",t.element),k=Z.fromString(i).until(Z.fromString(o)).total({unit:"days"});s&&u&&E&&(E.textContent="999999"),!u&&E&&(E.textContent="9999999");let A=e?.CategoryPrices?.find(U=>U.CategoryId===r);if(console.log("Category Price:",A),console.log("Restrictions:",l),!A||s&&u){if(y){y.textContent="-";let U=y.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${ke("total").toLowerCase()} (${k} ${ke("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}E&&u&&(E.textContent="999999"),A||(console.warn(`No price found for categoryId: ${r}`),s||this.screenItem(t,!1,ke("booked"))),console.groupEnd();return}if(!u){if(y){y.textContent="-";let U=y.parentElement;U&&(U.style.opacity="0")}if(S){S.textContent=`- ${ke("total").toLowerCase()} (${k} ${ke("night")}s)`;let U=S.parentElement;U&&(U.style.opacity="0")}console.warn(`No availability found for categoryId: ${r}`),this.screenItem(t,!1,ke("booked")),console.groupEnd();return}let B=A.OccupancyPrices[0]?.RateGroupPrices.reduce((U,J)=>J.MinPrice.AverageAmountPerTimeUnit.GrossValue<U.MinPrice.AverageAmountPerTimeUnit.GrossValue?J:U);if(console.log("Lowest Price:",B),!B){y&&(y.textContent="-"),E&&u&&(E.textContent="999999"),console.groupEnd();return}let V=B.MinPrice.AverageAmountPerTimeUnit.GrossValue,G=V.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});if(y){y.textContent=G;let U=y.parentElement;U&&(U.style.opacity="1")}if(E&&(E.textContent=V.toString()),S){let J=(V*k).toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});S.textContent=`${J} ${ke("total").toLowerCase()} (${k} ${ke("night")}s)`;let oe=S.parentElement;oe&&(oe.style.opacity="1")}console.groupEnd()}resetItemState(t){let e=t.element.querySelector('[fs-list-field="price-sort"]');Number(e?.textContent||0)!==999999&&this.screenItem(t,!0),e&&(e.textContent="");let i=je("price",t.element);i&&(i.textContent="",i.parentElement&&(i.parentElement.style.opacity="0"));let o=je("total-price",t.element);o&&(o.textContent="",o.parentElement&&(o.parentElement.style.opacity="0")),t.element.style.opacity="1",t.collectFields()}screenItem(t,e,r=ke("select")||""){let i=je("submit",t.element);i&&(e?(t.element.style.opacity="1",i.classList.remove("room-results_cta-disabled"),i.textContent=r):i.classList.contains("room-results_cta-disabled")||(i.classList.add("room-results_cta-disabled"),i.textContent=r))}};var od=()=>{};function Ur(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):od}var oa=n=>n instanceof HTMLInputElement;var mc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Xi=n=>{let{value:t}=n;if(n.type==="checkbox"&&(t=n.checked.toString()),n.type==="radio"){let e=n.closest("form")?.querySelector(`input[name="${n.name}"]:checked`);t=oa(e)?e.value:""}return t.toString()};var Qi=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!oa(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}mc(n,["click","input","change"])};function ad(n,t){return{rate:n,pricing:t}}function pc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function sd(n,t){let e=t.filter(o=>wm(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=>Dm(n,o.Exceptions)))}function wm(n,t){return(t.ExactRateId===null||n.rate.id===t.ExactRateId)&&(t.BaseRateId===null||n.rate.baseRateId===t.BaseRateId)&&(t.ExactRateId===null||n.rate.baseRateId===t.ExactRateId)&&(t.RateGroupId===null||n.rate.group?.Id===t.RateGroupId)&&t.ResourceCategoryId===null&&t.ResourceCategoryType===null&&n.pricing?.datesUtc.every(e=>{let r=Z.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function aa(n){if(!n)return null;try{return xe.Duration.from(n).total({unit:"days"})}catch{return null}}function Dm(n,t){let e=Z.fromString(n.pricing?.datesUtc[0]),r=Z.fromString(n.pricing?.datesUtc.at(-1));if(!e||!r)return console.warn("Missing date information, cannot check restrictions"),!0;let i=r.since(e,{largestUnit:"day"}).days,o=Z.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=aa(t.MinAdvance),u=aa(t.MaxAdvance),l=aa(t.MinLength),h=aa(t.MaxLength);return!!(l&&i<l||h&&i>h||s&&a<s||u&&a>u||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var cd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!sd(s,t)&&pc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=Nu(r),a=Em(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Em(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>pc(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 fc=async n=>{let t=await Promise.all(n.map(async r=>{let i=new zr(r);await i.initServices();let o=i.reservableService;if(!o){console.error("No reservable service found for the enterprise.");return}await o.initRates();let a=[],s=await Promise.all(o.rates.map(async l=>{let h=await l.initPricing(Z.formatForAPI(ac.toString()),Z.formatForAPI(Vu.toString()));return ad(l.getRate(),h)}));return cd(s,a).lowestDatedPrices})),e={};for(let r of t)if(r)for(let[i,o]of Object.entries(r))(!e[i]||o<e[i])&&(e[i]=o);return e};var Ge=class Ge extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(Ge.parseDateTime(e,r,i));Y(this,"lang");this.lang=i}static parseDateTime(e,r="YYYY-MM-DD",i="en-US"){if(!e)return new Date(new Date().setHours(0,0,0,0));if(e instanceof Ge)return e.toJSDate();if(e instanceof Date)return e;if(/^-?\d{10,}$/.test(String(e)))return new Date(Number(e));if(typeof e=="string"){let o=[],a=null;for(;(a=Ge.regex.exec(r))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){let s={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};o[0].index>0&&(s.value+=".*?");for(let[l,h]of Object.entries(o)){let p=Number(l),{group:y,pattern:E}=Ge.formatPatterns(h[0],i);s[y]=p+1,s.value+=E,s.value+=".*?"}let u=new RegExp(`^${s.value}$`);if(u.test(e)){let l=u.exec(e),h=Number(l[s.year]),p=null;s.month?p=Number(l[s.month])-1:s.shortMonth?p=Ge.shortMonths(i).indexOf(l[s.shortMonth]):s.longMonth&&(p=Ge.longMonths(i).indexOf(l[s.longMonth]));let y=Number(l[s.day])||1,E=Number(l[s.hour]),S=Number.isNaN(E)?0:E,k=Number(l[s.minute]),A=Number.isNaN(k)?0:k,B=Number(l[s.second]),V=Number.isNaN(B)?0:B,G=l[s.ampm];return G&&G==="PM"&&(S+=12,S===24&&(S=0)),new Date(h,p,y,S,A,V,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"long"}))}static formatPatterns(e,r){switch(e){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${e.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${Ge.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${Ge.longMonths(r).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}getWeek(e){let r=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-e))%7;r.setDate(r.getDate()-i);let o=r.getTime();return r.setMonth(0,1),r.getDay()!==e&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((o-r.getTime())/6048e5)}clone(){return new Ge(this)}toJSDate(){return new Date(this)}inArray(e,r="[]"){return e.some(i=>i instanceof Array?this.isBetween(i[0],i[1],r):this.isSame(i,"day"))}isBetween(e,r,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"[)":return this.midnight_ts(this)>=this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"(]":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<=this.midnight_ts(r);case"[]":return this.midnight_ts()>=this.midnight_ts(e)&&this.midnight_ts()<=this.midnight_ts(r)}}isBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return e.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(e.getFullYear(),e.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>e.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()+e);break;case"month":case"months":this.setMonth(this.getMonth()+e)}return this}subtract(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()-e);break;case"month":case"months":this.setMonth(this.getMonth()-e)}return this}diff(e,r="days"){switch(r){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(e))/864e5);case"month":case"months":let i=12*(e.getFullYear()-this.getFullYear());return i-=e.getMonth(),i+=this.getMonth(),i}}format(e,r="en-US"){let i="",o=[],a=null;for(;(a=Ge.regex.exec(e))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(let[s,u]of Object.entries(o)){let l=Number(s);i+=this.formatTokens(u[0],r),o[l+1]&&(i+=e.substring(u.index+u[0].length,o[l+1].index)),l===o.length-1&&(i+=e.substring(u.index+u[0].length))}}return i.replace(/\\/g,"")}midnight_ts(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(e,r){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return Ge.shortMonths(r)[this.getMonth()];case"MMMM":return Ge.longMonths(r)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||this.getHours()===24?"am":"pm";case"A":return this.getHours()<12||this.getHours()===24?"AM":"PM";default:return""}}};Y(Ge,"regex",/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g),Y(Ge,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var de=Ge,gc=class{constructor(t){Y(this,"picker");this.picker=t}render(t,e){t||(t=new de),t.setDate(1),t.setHours(0,0,0,0),typeof this[`get${e}View`]=="function"&&this[`get${e}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){let e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),typeof this.picker.options.header=="string"&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){let e=document.createElement("main");this.picker.ui.container.appendChild(e);let r=document.createElement("div");r.className=`calendars grid-${this.picker.options.grid}`;for(let i=0;i<this.picker.options.calendars;i++){let o=document.createElement("div");o.className="calendar",r.appendChild(o);let a=this.getCalendarHeaderView(t.clone());o.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:i,target:a});let s=this.getCalendarDayNamesView();o.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:i,target:s});let u=this.getCalendarDaysView(t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:u});let l=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:l}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:i,target:o}),t.add(1,"month")}e.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:r}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){let e=document.createElement("footer"),r=document.createElement("div");r.className="footer-buttons";let i=document.createElement("button");i.className="cancel-button unit",i.innerHTML=this.picker.options.locale.cancel,r.appendChild(i);let o=document.createElement("button");o.className="apply-button unit",o.innerHTML=this.picker.options.locale.apply,o.disabled=!0,r.appendChild(o),e.appendChild(r),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){let e=document.createElement("div");e.className="header";let r=document.createElement("div");r.className="month-name",r.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span> ${t.format("YYYY")}`,e.appendChild(r);let i=document.createElement("button");i.className="previous-button unit",i.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(i);let o=document.createElement("button");return o.className="next-button unit",o.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(o),e}getCalendarDayNamesView(){let t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){let r=3+this.picker.options.firstDay+e,i=document.createElement("div");i.className="dayname",i.innerHTML=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),i.title=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(i),this.picker.trigger("view",{dayIdx:r,view:"CalendarDayName",target:i})}return t}getCalendarDaysView(t){let e=document.createElement("div");e.className="days-grid";let r=this.calcOffsetDays(t,this.picker.options.firstDay),i=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let o=0;o<r;o++){let a=document.createElement("div");a.className="offset",e.appendChild(a)}for(let o=1;o<=i;o++){t.setDate(o);let a=this.getCalendarDayView(t);e.appendChild(a),this.picker.trigger("view",{date:t,view:"CalendarDay",target:a})}return e}getCalendarDayView(t){let e=this.picker.options.date?new de(this.picker.options.date):null,r=new de,i=document.createElement("div");return i.className="day unit",i.innerHTML=t.format("D"),i.dataset.time=String(t.getTime()),t.isSame(r,"day")&&i.classList.add("today"),[0,6].includes(t.getDay())&&i.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&i.classList.add("selected"):e&&t.isSame(e,"day")&&i.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:i}),i}getCalendarFooterView(t,e){let r=document.createElement("div");return r.className="footer",r}calcOffsetDays(t,e){let r=t.getDay()-e;return r<0&&(r+=7),r}},yc=class{constructor(t){Y(this,"picker");Y(this,"instances",{});this.picker=t}initialize(){let t=[];this.picker.options.plugins.forEach(e=>{typeof e=="function"?t.push(new e):typeof e=="string"&&typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick: ${e} not found.`)}),t.sort((e,r)=>e.priority>r.priority?-1:e.priority<r.priority||e.dependencies.length>r.dependencies.length?1:e.dependencies.length<r.dependencies.length?-1:0),t.forEach(e=>{e.attach(this.picker),this.instances[e.getName()]=e})}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick: ${t} already added.`);else{if(typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,t)){let e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if(this.getPluginFn(t)!=="undefined"){let e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick: ${t} not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter(e=>typeof e=="function"&&new e().getName()===t).shift()}},sa=class{constructor(t){Y(this,"Calendar",new gc(this));Y(this,"PluginManager",new yc(this));Y(this,"calendars",[]);Y(this,"datePicked",[]);Y(this,"cssLoaded",0);Y(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});Y(this,"options",{doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]});Y(this,"ui",{container:null,shadowRoot:null,wrapper:null});Y(this,"version","1.2.1");let e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),typeof this.options.setup=="function"&&this.options.setup(this),this.on("click",this.onClick.bind(this));let r=this.options.scrollToDate?this.getDate():null;this.renderAll(r)}on(t,e,r={}){this.ui.container.addEventListener(t,e,r)}off(t,e,r={}){this.ui.container.removeEventListener(t,e,r)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),typeof this.options.documentClick=="function"&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach(t=>{this.PluginManager.removeInstance(t)}),this.ui.wrapper.remove()}onRender(t){let{view:e,date:r}=t.detail;this.Calendar.render(r,e)}onView(t){let{view:e,target:r}=t.detail;e==="Footer"&&this.datePicked.length&&(r.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){let e=new de(t.dataset.time);this.options.autoApply?(this.setDate(e),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=e,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){let e=this.datePicked[0].clone();this.setDate(e)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){let e=t.target;if(e instanceof HTMLElement){let r=e.closest(".unit");if(!(r instanceof HTMLElement))return;this.onClickHeaderButton(r),this.onClickCalendarDay(r),this.onClickApplyButton(r),this.onClickCancelButton(r)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;let e=t&&"target"in t?t.target:this.options.element,{top:r,left:i}=this.adjustPosition(e);this.ui.container.style.top=`${r}px`,this.ui.container.style.left=`${i}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){let e=new de(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof de?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){let t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",r=this.options.element;r instanceof HTMLInputElement?r.value=e:r instanceof HTMLElement&&(r.innerText=e)}hidePicker(t){let e=t.target,r=null;e.shadowRoot&&(e=t.composedPath()[0],r=e.getRootNode().host),this.isShown()&&r!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some(e=>t.classList.contains(e))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){let e=new de(t,this.options.format);e.setDate(1),this.calendars[0]=e.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new de(this.options.date,this.options.format):this.calendars[0]=new de}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach(t=>{let e=document.createElement("link");e.href=t,e.rel="stylesheet";let r=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",r),e.addEventListener("error",r),this.ui.shadowRoot.append(e)});else if(typeof this.options.css=="string"){let t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else typeof this.options.css=="function"&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){let e=t.getBoundingClientRect(),r=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");let i=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let o=e.bottom-r.bottom,a=e.left-r.left;return typeof window<"u"&&(window.innerHeight<o+i.height&&o-i.height>=0&&(o=e.top-r.top-i.height),window.innerWidth<a+i.width&&e.right-i.width>=0&&(a=e.right-r.right-i.width)),{left:a,top:o}}},da=Object.freeze({__proto__:null,Core:sa,create:sa}),eo=class{constructor(){Y(this,"picker");Y(this,"options");Y(this,"priority",0);Y(this,"dependencies",[])}attach(t){let e=this.getName(),r={...this.options};this.options={...this.options,...t.options[e]||{}};for(let o of Object.keys(r))if(r[o]!==null&&typeof r[o]=="object"&&Object.keys(r[o]).length&&e in t.options&&o in t.options[e]){let a={...t.options[e][o]};a!==null&&typeof a=="object"&&Object.keys(a).length&&Object.keys(a).every(s=>Object.keys(r[o]).includes(s))&&(this.options[o]={...r[o],...a})}if(this.picker=t,this.dependenciesNotFound()){let o=this.dependencies.filter(a=>!this.pluginsAsStringArray().includes(a));return void console.warn(`${this.getName()}: required dependencies (${o.join(", ")}).`)}let i=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(i),this.onAttach()}detach(){let t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),typeof this.onDetach=="function"&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every(t=>this.pluginsAsStringArray().includes(t))}pluginsAsStringArray(){return this.picker.options.plugins.map(t=>typeof t=="function"?new t().getName():t)}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}},ca=class extends eo{constructor(){super(...arguments);Y(this,"priority",1);Y(this,"binds",{onView:this.onView.bind(this)});Y(this,"options",{minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null})}getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new de(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new de(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof de&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){let e=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(e)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){let e=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}: options ${e.join(", ")} required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(e){let{view:r,target:i,date:o}=e.detail;if(r==="CalendarHeader"&&(this.options.minDate instanceof de&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof de&&o.isSameOrAfter(this.options.maxDate,"month")&&i.classList.add("no-next-month")),r==="CalendarDay"){let a=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(o))return void i.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){let s=o.clone().subtract(this.options.minDays-1,"day"),u=o.clone().add(this.options.minDays-1,"day"),l=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){l=!0;break}s.add(1,"day")}for(;u.isAfter(o,"day");){if(this.testFilter(u)){h=!0;break}u.subtract(1,"day")}l&&h&&i.classList.add("not-available")}this.rangeIsNotAvailable(o,a)&&i.classList.add("not-available")}this.dateIsNotAvailable(o,a)&&i.classList.add("not-available")}if(this.options.presets&&r==="PresetPluginButton"){let a=new de(Number(i.dataset.start)),s=new de(Number(i.dataset.end)),u=s.diff(a,"day"),l=this.options.minDays&&u<this.options.minDays,h=this.options.maxDays&&u>this.options.maxDays;(l||h||this.lockMinDate(a)||this.lockMaxDate(a)||this.lockMinDate(s)||this.lockMaxDate(s)||this.rangeIsNotAvailable(a,s))&&i.setAttribute("disabled","disabled")}}dateIsNotAvailable(e,r){return this.lockMinDate(e)||this.lockMaxDate(e)||this.lockMinDays(e,r)||this.lockMaxDays(e,r)||this.lockSelectForward(e)||this.lockSelectBackward(e)}rangeIsNotAvailable(e,r){if(!e||!r)return!1;let i=(e.isSameOrBefore(r,"day")?e:r).clone(),o=(r.isSameOrAfter(e,"day")?r:e).clone();for(;i.isSameOrBefore(o,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(e){return this.options.minDate instanceof de&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof de&&e.isAfter(this.options.maxDate,"day")}lockMinDays(e,r){if(this.options.minDays&&r){let i=r.clone().subtract(this.options.minDays-1,"day"),o=r.clone().add(this.options.minDays-1,"day");return e.isBetween(i,o)}return!1}lockMaxDays(e,r){if(this.options.maxDays&&r){let i=r.clone().subtract(this.options.maxDays,"day"),o=r.clone().add(this.options.maxDays,"day");return!e.isBetween(i,o)}return!1}lockSelectForward(e){if(this.picker.datePicked.length===1&&this.options.selectForward){let r=this.picker.datePicked[0].clone();return e.isBefore(r,"day")}return!1}lockSelectBackward(e){if(this.picker.datePicked.length===1&&this.options.selectBackward){let r=this.picker.datePicked[0].clone();return e.isAfter(r,"day")}return!1}testFilter(e){return typeof this.options.filter=="function"&&this.options.filter(e,this.picker.datePicked)}};var la=class extends eo{constructor(){super(...arguments);Y(this,"tooltipElement");Y(this,"triggerElement");Y(this,"binds",{setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)});Y(this,"options",{elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:e=>e,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)})}getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateValues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),typeof this.picker.options.documentClick=="function"&&(document.removeEventListener("click",this.picker.options.documentClick,!0),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){let[e,r]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?e&&r&&this.setDateRange(e,r):(e&&this.setStartDate(e),r&&this.setEndDate(r))}}updateValues(){let e=this.picker.options.element,r=this.options.elementEnd,i=this.picker.getStartDate(),o=this.picker.getEndDate(),a=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",s=o instanceof Date?o.format(this.picker.options.format,this.picker.options.lang):"";if(r)e instanceof HTMLInputElement?e.value=a:e instanceof HTMLElement&&(e.innerText=a),r instanceof HTMLInputElement?r.value=s:r instanceof HTMLElement&&(r.innerText=s);else{let u=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=u:e instanceof HTMLElement&&(e.innerText=u)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(e){let{target:r}=e.detail;this.triggerElement=r,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(e){let{view:r,target:i}=e.detail;if(r==="Main"&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",i.appendChild(this.tooltipElement)),r==="CalendarDay"){let o=new de(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),u=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&u&&(u.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,u)&&i.classList.add("in-range"))}if(r==="Footer"){let o=this.picker.datePicked.length===1&&!this.options.strict||this.picker.datePicked.length===2;i.querySelector(".apply-button").disabled=!o}}hidePicker(e){let r=e.target,i=null;r.shadowRoot&&(r=e.composedPath()[0],i=r.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&r!==this.picker.options.element&&r!==this.options.elementEnd&&this.picker.hide()}setStartDate(e){let r=new de(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new de(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new de(e,this.picker.options.format),o=new de(r,this.picker.options.format);this.options.startDate=i?i.clone():null,this.options.endDate=o?o.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(e){let r=e.target;if(r instanceof HTMLElement){this.isContainer(r)&&this.initializeRepick();let i=r.closest(".unit");if(!(i instanceof HTMLElement))return;if(this.picker.isCalendarDay(i)){if(this.picker.datePicked.length!==1)return;let o=this.picker.datePicked[0].clone(),a=new de(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let u=o.clone();o=a.clone(),a=u.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(u=>{let l=new de(u.dataset.time),h=this.picker.Calendar.getCalendarDayView(l);l.isBetween(o,a)&&h.classList.add("in-range"),l.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),u===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),u.className=h.className}),this.options.tooltip){let u=this.options.tooltipNumber(a.diff(o,"day")+1);if(u>0){let l=new Intl.PluralRules(this.picker.options.lang).select(u),h=`${u} ${this.options.locale[l]}`;this.showTooltip(i,h)}else this.hideTooltip()}}}}onMouseLeave(e){if(this.isContainer(e.target)&&this.options.repick){let r=this.getStartDate(),i=this.getEndDate();r&&i&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(e){if(this.picker.isCalendarDay(e)){this.picker.datePicked.length===2&&(this.picker.datePicked.length=0);let r=new de(e.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=r,this.picker.datePicked.length===2&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){let i=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=i.clone()}this.picker.datePicked.length!==1&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),this.picker.datePicked.length===1&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),this.picker.datePicked.length===2&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(e){this.picker.isApplyButton(e)&&(this.picker.datePicked.length!==1||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),this.picker.datePicked.length===2&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(e,r){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=r;let i=this.picker.ui.container.getBoundingClientRect(),o=this.tooltipElement.getBoundingClientRect(),a=e.getBoundingClientRect(),s=a.top,u=a.left;s-=i.top,u-=i.left,s-=o.height,u-=o.width/2,u+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${u}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;let e=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],r=Object.keys(this.options.locale);e.every(i=>r.includes(i))||console.warn(`${this.getName()}: provide locales (${e.join(", ")}) for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;let e=this.getStartDate(),r=this.getEndDate();r&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=r),e&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=e)}isContainer(e){return e===this.picker.ui.container}};var ua=class extends eo{constructor(){super(...arguments);Y(this,"rangePlugin");Y(this,"lockPlugin");Y(this,"priority",10);Y(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});Y(this,"options",{dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}});Y(this,"matchMedia")}getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(e){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(e),this.handleResetButton(e),this.handleWeekNumbers(e)}onColorScheme(e){let r=e.matches?"dark":"light";this.picker.ui.container.dataset.theme=r}handleDropdown(e){let{view:r,target:i,date:o,index:a}=e.detail;if(r==="CalendarHeader"){let s=i.querySelector(".month-name");if(this.options.dropdown.months){s.childNodes[0].remove();let u=document.createElement("select");u.className="month-name--select month-name--dropdown";for(let l=0;l<12;l+=1){let h=document.createElement("option"),p=new de(new Date(o.getFullYear(),l,2,0,0,0)),y=new de(new Date(o.getFullYear(),l,1,0,0,0));h.value=String(l),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new de(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new de(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),u.appendChild(h)}u.addEventListener("change",l=>{let h=l.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(u)}if(this.options.dropdown.years){s.childNodes[1].remove();let u=document.createElement("select");u.className="month-name--select";let l=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,u.appendChild(p)}for(let p=h;p>=l;p-=1){let y=document.createElement("option"),E=new de(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&E.isBefore(new de(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&E.isAfter(new de(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,u.appendChild(y)}if(o.getFullYear()<l){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,u.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(u.childNodes).reverse();u.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,u.appendChild(y)})}u.addEventListener("change",p=>{let y=p.target;this.picker.calendars[0].setFullYear(Number(y.value)),this.picker.renderAll()}),s.appendChild(u)}}}handleResetButton(e){let{view:r,target:i}=e.detail;if(r==="CalendarHeader"&&this.options.resetButton){let o=document.createElement("button");o.className="reset-button unit",o.innerHTML=this.options.locale.resetButton,o.addEventListener("click",a=>{a.preventDefault();let s=!0;typeof this.options.resetButton=="function"&&(s=this.options.resetButton.call(this)),s&&this.picker.clear()}),i.appendChild(o)}}handleWeekNumbers(e){if(this.options.weekNumbers){let{view:r,target:i}=e.detail;if(r==="CalendarDayNames"){let o=document.createElement("div");o.className="wnum-header",o.innerHTML="Wk",i.prepend(o)}r==="CalendarDays"&&[...i.children].forEach((o,a)=>{if(a===0||a%7==0){let s;if(o.classList.contains("day"))s=new de(o.dataset.time);else{let h=i.querySelector(".day");s=new de(h.dataset.time)}let u=s.getWeek(this.picker.options.firstDay);u===53&&s.getMonth()===0&&(u="53/1");let l=document.createElement("div");l.className="wnum-item",l.innerHTML=String(u),i.insertBefore(l,o)}})}}};var ha=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],qn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var ma={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pa=ma;var ot=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},At=function(n){return n===!0?1:0};function vc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var fa=function(n){return n instanceof Array?n:[n]};function at(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Ee(n,t,e){var r=window.document.createElement(n);return t=t||"",e=e||"",r.className=t,e!==void 0&&(r.textContent=e),r}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function bc(n,t){if(t(n))return n;if(n.parentNode)return bc(n.parentNode,t)}function no(n,t){var e=Ee("div","numInputWrapper"),r=Ee("input","numInput "+n),i=Ee("span","arrowUp"),o=Ee("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return e.appendChild(r),e.appendChild(i),e.appendChild(o),e}function Lt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var wc=function(){},ro=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},ld={D:wc,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*At(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var r=parseInt(t),i=new Date(n.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+e.firstDayOfWeek),i},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:wc,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:wc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Pn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Vr={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[Vr.w(n,t,e)]},F:function(n,t,e){return ro(Vr.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ot(Vr.h(n,t,e))},H:function(n){return ot(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[At(n.getHours()>11)]},M:function(n,t){return ro(n.getMonth(),!0,t)},S:function(n){return ot(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ot(n.getFullYear(),4)},d:function(n){return ot(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ot(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ot(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 Dc=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ma:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,u,l){var h=l||i;return e.formatDate!==void 0&&!a?e.formatDate(s,u,h):u.split("").map(function(p,y,E){return Vr[p]&&E[y-1]!=="\\"?Vr[p](s,h,e):p!=="\\"?p:""}).join("")}},ga=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ma:r;return function(o,a,s,u){if(!(o!==0&&!o)){var l=u||i,h,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||qn).dateFormat,E=String(o).trim();if(E==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(E)||/GMT$/.test(E))h=new Date(o);else{for(var S=void 0,k=[],A=0,B=0,V="";A<y.length;A++){var G=y[A],U=G==="\\",J=y[A-1]==="\\"||U;if(Pn[G]&&!J){V+=Pn[G];var oe=new RegExp(V).exec(o);oe&&(S=!0)&&k[G!=="Y"?"push":"unshift"]({fn:ld[G],val:oe[++B]})}else U||(V+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),k.forEach(function(Te){var Me=Te.fn,ie=Te.val;return h=Me(h,ie,l)||h}),h=S?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+p));return}return s===!0&&h.setHours(0,0,0,0),h}}};function Nt(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var ud=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ya=function(n,t,e){return n*3600+t*60+e},dd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},hd={DAY:864e5};function va(n){var t=n.defaultHour,e=n.defaultMinute,r=n.defaultSeconds;if(n.minDate!==void 0){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();t<i&&(t=i),t===i&&e<o&&(e=o),t===i&&e===o&&r<a&&(r=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),u=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(u,e)),t===s&&e===u&&(r=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(u){return n[u]=s[u]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var st=function(){return st=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},st.apply(this,arguments)},md=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},_m=300;function Mm(n,t){var e={config:st(st({},qn),Ue.defaultConfig),l10n:pa};e.parseDate=ga({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=k,e._setHoursFromDate=y,e._positionCalendar=xn,e.changeMonth=_,e.changeYear=ee,e.clear=I,e.close=C,e.onMouseOver=ge,e._createElement=Ee,e.createDay=oe,e.destroy=F,e.isEnabled=q,e.jumpToDate=V,e.updateValue=pn,e.open=Re,e.redraw=ao,e.set=yd,e.setDate=vd,e.toggle=Ed;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,tt(),Wn(),wd(),bd(),r(),e.isMobile||J(),B(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),pn(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&xn(),Ne("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 u(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||Nt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=va(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&Sd(f);var x=e._input.value;p(),pn(),e._input.value!==x&&e._debouncedChange()}function l(f,b){return f%12+12*At(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=l(f,e.amPM.textContent));var x=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var K=ya(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),he=ya(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Q=ya(f,b,M);if(Q>he&&Q<K){var ye=dd(K);f=ye[0],b=ye[1],M=ye[2]}}else{if(z){var X=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,X.getHours()),f===X.getHours()&&(b=Math.min(b,X.getMinutes())),b===X.getMinutes()&&(M=Math.min(M,X.getSeconds()))}if(x){var ae=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,ae.getHours()),f===ae.getHours()&&b<ae.getMinutes()&&(b=ae.getMinutes()),b===ae.getMinutes()&&(M=Math.max(M,ae.getSeconds()))}}E(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&E(b.getHours(),b.getMinutes(),b.getSeconds())}function E(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=ot(e.config.time_24hr?f:(12+f)%12+12*At(f%12===0)),e.minuteElement.value=ot(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[At(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ot(M)))}function S(f){var b=Lt(f),M=parseInt(b.value)+(f.delta||0);(M/1e3>1||f.key==="Enter"&&!/[^\d]/.test(M.toString()))&&ee(M)}function k(f,b,M,x){if(b instanceof Array)return b.forEach(function(z){return k(f,z,M,x)});if(f instanceof Array)return f.forEach(function(z){return k(z,b,M,x)});f.addEventListener(b,M,x),e._handlers.push({remove:function(){return f.removeEventListener(b,M,x)}})}function A(){Ne("onChange")}function B(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(x){return k(x,"click",e[M])})}),e.isMobile){Dd();return}var f=vc(we,50);if(e._debouncedChange=vc(A,_m),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&k(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&ge(Lt(M))}),k(e._input,"keydown",le),e.calendarContainer!==void 0&&k(e.calendarContainer,"keydown",le),!e.config.inline&&!e.config.static&&k(window,"resize",f),window.ontouchstart!==void 0?k(window.document,"touchstart",W):k(window.document,"mousedown",W),k(window.document,"focus",W,{capture:!0}),e.config.clickOpens===!0&&(k(e._input,"focus",e.open),k(e._input,"click",e.open)),e.daysContainer!==void 0&&(k(e.monthNav,"click",Md),k(e.monthNav,["keyup","increment"],S),k(e.daysContainer,"click",Ec)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return Lt(M).select()};k(e.timeContainer,["increment"],u),k(e.timeContainer,"blur",u,{capture:!0}),k(e.timeContainer,"click",G),k([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&k(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&k(e.amPM,"click",function(M){u(M)})}e.config.allowInput&&k(e._input,"blur",re)}function V(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),x=e.currentYear,z=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(K){K.message="Invalid date supplied: "+M,e.config.errorHandler(K)}b&&e.currentYear!==x&&(Ne("onYearChange"),ne()),b&&(e.currentYear!==x||e.currentMonth!==z)&&Ne("onMonthChange"),e.redraw()}function G(f){var b=Lt(f);~b.className.indexOf("arrow")&&U(f,b.classList.contains("arrowUp")?1:-1)}function U(f,b,M){var x=f&&Lt(f),z=M||x&&x.parentNode&&x.parentNode.firstChild,K=Da("increment");K.delta=b,z&&z.dispatchEvent(K)}function J(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Ee("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Ee("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=w(),M=b.weekWrapper,x=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=x,e.weekWrapper=M}e.rContainer=Ee("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Ee("div","flatpickr-days"),e.daysContainer.tabIndex=-1),O(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),at(e.calendarContainer,"rangeMode",e.config.mode==="range"),at(e.calendarContainer,"animate",e.config.animate===!0),at(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var K=Ee("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(K,e.element),K.appendChild(e.element),e.altInput&&K.appendChild(e.altInput),K.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function oe(f,b,M,x){var z=q(b,!0),K=Ee("span",f,b.getDate().toString());return K.dateObj=b,K.$i=x,K.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&Nt(b,e.now)===0&&(e.todayDateElem=K,K.classList.add("today"),K.setAttribute("aria-current","date")),z?(K.tabIndex=-1,Ea(b)&&(K.classList.add("selected"),e.selectedDateElem=K,e.config.mode==="range"&&(at(K,"startRange",e.selectedDates[0]&&Nt(b,e.selectedDates[0],!0)===0),at(K,"endRange",e.selectedDates[1]&&Nt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&K.classList.add("inRange")))):K.classList.add("flatpickr-disabled"),e.config.mode==="range"&&_d(b)&&!Ea(b)&&K.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&x%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Ne("onDayCreate",K),K}function Te(f){f.focus(),e.config.mode==="range"&&ge(f)}function Me(f){for(var b=f>0?0:e.config.showMonths-1,M=f>0?e.config.showMonths:-1,x=b;x!=M;x+=f)for(var z=e.daysContainer.children[x],K=f>0?0:z.children.length-1,he=f>0?z.children.length:-1,Q=K;Q!=he;Q+=f){var ye=z.children[Q];if(ye.className.indexOf("hidden")===-1&&q(ye.dateObj))return ye}}function ie(f,b){for(var M=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,x=b>0?e.config.showMonths:-1,z=b>0?1:-1,K=M-e.currentMonth;K!=x;K+=z)for(var he=e.daysContainer.children[K],Q=M-e.currentMonth===K?f.$i+b:b<0?he.children.length-1:0,ye=he.children.length,X=Q;X>=0&&X<ye&&X!=(b>0?ye:-1);X+=z){var ae=he.children[X];if(ae.className.indexOf("hidden")===-1&&q(ae.dateObj)&&Math.abs(f.$i-X)>=Math.abs(b))return Te(ae)}e.changeMonth(z),N(Me(z),0)}function N(f,b){var M=o(),x=j(M||document.body),z=f!==void 0?f:x?M:e.selectedDateElem!==void 0&&j(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&j(e.todayDateElem)?e.todayDateElem:Me(b>0?1:-1);z===void 0?e._input.focus():x?ie(z,b):Te(z)}function H(f,b){for(var M=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,x=e.utils.getDaysInMonth((b-1+12)%12,f),z=e.utils.getDaysInMonth(b,f),K=window.document.createDocumentFragment(),he=e.config.showMonths>1,Q=he?"prevMonthDay hidden":"prevMonthDay",ye=he?"nextMonthDay hidden":"nextMonthDay",X=x+1-M,ae=0;X<=x;X++,ae++)K.appendChild(oe("flatpickr-day "+Q,new Date(f,b-1,X),X,ae));for(X=1;X<=z;X++,ae++)K.appendChild(oe("flatpickr-day",new Date(f,b,X),X,ae));for(var Ce=z+1;Ce<=42-M&&(e.config.showMonths===1||ae%7!==0);Ce++,ae++)K.appendChild(oe("flatpickr-day "+ye,new Date(f,b+1,Ce%z),Ce,ae));var rn=Ee("div","dayContainer");return rn.appendChild(K),rn}function O(){if(e.daysContainer!==void 0){to(e.daysContainer),e.weekNumbers&&to(e.weekNumbers);for(var 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(H(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&ge()}}function ne(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(x){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&x<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&x>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var M=Ee("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,b).getMonth().toString(),M.textContent=ro(b,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===b&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var f=Ee("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Ee("span","cur-month"):(e.monthsDropdownContainer=Ee("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),k(e.monthsDropdownContainer,"change",function(he){var Q=Lt(he),ye=parseInt(Q.value,10);e.changeMonth(ye-e.currentMonth),Ne("onMonthChange")}),ne(),M=e.monthsDropdownContainer);var x=no("cur-year",{tabindex:"-1"}),z=x.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var K=Ee("div","flatpickr-current-month");return K.appendChild(M),K.appendChild(x),b.appendChild(K),f.appendChild(b),{container:f,yearElement:z,monthElement:M}}function L(){to(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=Ee("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Ee("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Ee("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,L(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(at(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(at(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],co(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=va(e.config);e.timeContainer=Ee("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Ee("span","flatpickr-time-separator",":"),M=no("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var x=no("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=x.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ot(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ot(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(x),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=no("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=ot(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(Ee("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=Ee("span","flatpickr-am-pm",e.l10n.amPM[At((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function v(){e.weekdayContainer?to(e.weekdayContainer):e.weekdayContainer=Ee("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Ee("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return D(),e.weekdayContainer}function D(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=md(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=md(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
1
+ var Nd=Object.create;var Ma=Object.defineProperty;var Od=Object.getOwnPropertyDescriptor;var Fd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,Yd=Object.prototype.hasOwnProperty;var $d=(n,t,e)=>t in n?Ma(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Bd=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var jd=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fd(t))!Yd.call(n,i)&&i!==e&&Ma(n,i,{get:()=>t[i],enumerable:!(r=Od(t,i))||r.enumerable});return n};var zd=(n,t,e)=>(e=n!=null?Nd(Hd(n)):{},jd(t||!n||!n.__esModule?Ma(e,"default",{value:n,enumerable:!0}):e,n));var Y=(n,t,e)=>($d(n,typeof t!="symbol"?t+"":t,e),e);var kc=Bd((ka,Ta)=>{(function(n,t){typeof ka=="object"&&typeof Ta<"u"?Ta.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(ka,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(N,H){(H==null||H>N.length)&&(H=N.length);for(var O=0,ne=Array(H);O<H;O++)ne[O]=N[O];return ne}function r(N){if(Array.isArray(N))return N}function i(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function o(N,H,O){return H=p(H),B(N,M()?Reflect.construct(H,O||[],p(N).constructor):H.apply(N,O))}function a(N,H){if(!(N instanceof H))throw new TypeError("Cannot call a class as a function")}function s(N,H,O){if(M())return Reflect.construct.apply(null,arguments);var ne=[null];ne.push.apply(ne,H);var g=new(N.bind.apply(N,ne));return O&&V(g,O.prototype),g}function u(N,H){for(var O,ne=0;ne<H.length;ne++)O=H[ne],O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,J(O.key),O)}function l(N,H,O){return H&&u(N.prototype,H),O&&u(N,O),Object.defineProperty(N,"prototype",{writable:!1}),N}function h(N,H){var O=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!O){if(Array.isArray(N)||(O=Te(N))||H&&N&&typeof N.length=="number"){O&&(N=O);var ne=0,g=function(){};return{s:g,n:function(){return ne>=N.length?{done:!0}:{done:!1,value:N[ne++]}},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 L,c=!0,d=!1;return{s:function(){O=O.call(N)},n:function(){var v=O.next();return c=v.done,v},e:function(v){d=!0,L=v},f:function(){try{c||O.return==null||O.return()}finally{if(d)throw L}}}}function p(N){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(H){return H.__proto__||Object.getPrototypeOf(H)},p(N)}function y(N,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(H&&H.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),H&&V(N,H)}function E(N){try{return Function.toString.call(N).indexOf("[native code]")!==-1}catch{return typeof N=="function"}}function M(){try{var N=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M=function(){return!!N})()}function k(N,H){var O=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(O!=null){var ne,g,L,c,d=[],v=!0,D=!1;try{if(L=(O=O.call(N)).next,H===0){if(Object(O)!==O)return;v=!1}else for(;!(v=(ne=L.call(O)).done)&&(d.push(ne.value),d.length!==H);v=!0);}catch(w){D=!0,g=w}finally{try{if(!v&&O.return!=null&&(c=O.return(),Object(c)!==c))return}finally{if(D)throw g}}return d}}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(N,H){if(H&&(typeof H=="object"||typeof H=="function"))return H;if(H!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(N)}function V(N,H){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,ne){return O.__proto__=ne,O},V(N,H)}function G(N,H){return r(N)||k(N,H)||Te(N,H)||A()}function U(N,H){if(typeof N!="object"||!N)return N;var O=N[Symbol.toPrimitive];if(O!==void 0){var ne=O.call(N,H||"default");if(typeof ne!="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(N)}function J(N){var H=U(N,"string");return typeof H=="symbol"?H:H+""}function oe(N){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},oe(N)}function Te(N,H){if(N){if(typeof N=="string")return e(N,H);var O={}.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?e(N,H):void 0}}function Se(N){var H=typeof Map=="function"?new Map:void 0;return Se=function(O){function ne(){return s(O,arguments,p(this).constructor)}if(O===null||!E(O))return O;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(H!==void 0){if(H.has(O))return H.get(O);H.set(O,ne)}return ne.prototype=Object.create(O.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),V(ne,O)},Se(N)}var ie=function(N){var H=Math.abs,O=Math.max,ne=Math.floor;function g(L,c){var d;if(a(this,g),d=o(this,g,[L]),d.sign=c,Object.setPrototypeOf(d,g.prototype),L>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,N),l(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var D=c.value;d.push((D&&(D>>>0).toString(16))+", ")}}catch(w){v.e(w)}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 D=32767&c,w=c>>>15,_=0,I=d,C=0;C<v;C++){var F=this.__digit(C),R=32767&F,W=F>>>15,ee=g.__imul(R,D),q=g.__imul(R,w),j=g.__imul(W,D),re=g.__imul(W,w),le=I+ee+_;_=le>>>30,le&=1073741823,le+=((32767&q)<<15)+((32767&j)<<15),_+=le>>>30,I=re+(q>>>15)+(j>>>15),this.__setDigit(C,1073741823&le)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var D,w=0,_=0;_<v;_++)D=this.__halfDigit(d+_)+c.__halfDigit(_)+w,w=D>>>15,this.__setHalfDigit(d+_,32767&D);return w}},{key:"__inplaceSub",value:function(c,d,v){var D=v-1>>>1,w=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,C=0;C<D;C++){var F=c.__digit(C),R=(_>>>15)-(32767&F)-w;w=1&R>>>15,this.__setDigit(d+C,(32767&R)<<15|32767&I),_=this.__digit(d+C+1),I=(32767&_)-(F>>>15)-w,w=1&I>>>15}var W=c.__digit(C),ee=(_>>>15)-(32767&W)-w;w=1&ee>>>15,this.__setDigit(d+C,(32767&ee)<<15|32767&I);var q=W>>>15;if(d+C+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+C+1),I=(32767&_)-q-w,w=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var j=0;j<c.length-1;j++){var re=this.__digit(d+j),le=c.__digit(j),ge=(32767&re)-(32767&le)-w;w=1&ge>>>15;var we=(re>>>15)-(le>>>15)-w;w=1&we>>>15,this.__setDigit(d+j,(32767&we)<<15|32767&ge)}var Re=this.__digit(d+j),ze=c.__digit(j),tt=(32767&Re)-(32767&ze)-w;w=1&tt>>>15;var Vt=0;!(1&v)&&(Vt=(Re>>>15)-(ze>>>15)-w,w=1&Vt>>>15),this.__setDigit(d+j,(32767&Vt)<<15|32767&tt)}return w}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,D=this.length-1,w=0;w<D;w++)d=this.__digit(w+1),this.__setDigit(w,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(D,v)}}},{key:"__digit",value:function(c){return this[c]}},{key:"__unsignedDigit",value:function(c){return this[c]>>>0}},{key:"__setDigit",value:function(c,d){this[c]=0|d}},{key:"__setDigitGrow",value:function(c,d){this[c]=0|d}},{key:"__halfDigitLength",value:function(){var c=this.length;return 32767>=this.__unsignedDigit(c-1)?2*c-1:2*c}},{key:"__halfDigit",value:function(c){return 32767&this[c>>>1]>>>15*(1&c)}},{key:"__setHalfDigit",value:function(c,d){var v=c>>>1,D=this.__digit(v),w=1&c?32767&D|d<<15:1073709056&D|32767&d;this.__setDigit(v,w)}}],[{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)||ne(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(oe(c)==="object"){if(c.constructor===g)return c;var D=g.__toPrimitive(c);return g.BigInt(D)}throw new TypeError("Cannot convert "+c+" to a BigInt")}},{key:"toNumber",value:function(c){var d=c.length;if(d===0)return 0;if(d===1){var v=c.__unsignedDigit(0);return c.sign?-v:v}var D=c.__digit(d-1),w=g.__clz30(D),_=30*d-w;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,C=D,F=d-1,R=w+3,W=R===32?0:C<<R;W>>>=12;var ee=R-12,q=12<=R?0:C<<20+R,j=20+R;for(0<ee&&0<F&&(F--,C=c.__digit(F),W|=C>>>30-ee,q=C<<ee+2,j=ee+2);0<j&&0<F;)F--,C=c.__digit(F),q|=30<=j?C<<j-30:C>>>30-j,j-=30;var re=g.__decideRounding(c,j,F,C);if((re===1||re===0&&(1&q)==1)&&(q=q+1>>>0,q===0&&(W++,W>>>20!=0&&(W=0,I++,1023<I))))return c.sign?-1/0:1/0;var le=c.sign?-2147483648:0;return I=I+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=le|I|W,g.__kBitConversionInts[g.__kBitConversionIntLow]=q,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 D=1+(0|v/30),w=c.sign&&(1&v)!=0,_=new g(D,w);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(D-1,I),_}var C=null,F=c;for(1&v&&(C=c),v>>=1;v!==0;v>>=1)F=g.multiply(F,F),1&v&&(C===null?C=F:C=g.multiply(C,F));return C}},{key:"multiply",value:function(c,d){if(c.length===0)return c;if(d.length===0)return d;var v=c.length+d.length;30<=c.__clzmsd()+d.__clzmsd()&&v--;var D=new g(v,c.sign!==d.sign);D.__initializeDigits();for(var w=0;w<c.length;w++)g.__multiplyAccumulate(d,c.__digit(w),D,w);return D.__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,D=c.sign!==d.sign,w=d.__unsignedDigit(0);if(d.length===1&&32767>=w){if(w===1)return D===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,w,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=D,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return g.__zero();var D=g.__absoluteModSmall(c,v);return D===0?g.__zero():g.__oneDigit(D,c.sign)}var w=g.__absoluteDivLarge(c,d,!1,!0);return w.sign=c.sign,w.__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=O(c.length,d.length)+1,D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return D=g.__absoluteOr(D,w,D),g.__absoluteAddOne(D,!0,D).__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=O(c.length,d.length),D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return g.__absoluteXor(D,w,D).__trim()}var _=O(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var C=g.__absoluteSubOne(d,_);return C=g.__absoluteXor(C,c,C),g.__absoluteAddOne(C,!0,C).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=O(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var D=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return D=g.__absoluteAnd(D,w,D),g.__absoluteAddOne(D,!0,D).__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=ne(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 D=d.__unsignedDigit(v-1),w=1<<(c-1)%30;if(d.length===v&&D<w)return d;var _=(D&w)===w;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(D&w-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&D===w?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=ne(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 D=c%30;if(d.length==v){if(D===0)return d;var w=d.__digit(v-1);if(!(w>>>D))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(oe(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(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="symbol"){if(g.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(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],D=v?[4,0]:[0,4],w=G(D,2),_=w[0],I=w[1],C=c.getUint32(d+_,v),F=c.getUint32(d+I,v),R=new g(3,!1);return R.__setDigit(0,1073741823&F),R.__setDigit(1,(268435455&C)<<2|F>>>30),R.__setDigit(2,C>>>28),R.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,D)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var w=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,w=I>>>2,2<v.length&&(w|=v.__digit(2)<<28)}var C=D?[4,0]:[0,4],F=G(C,2),R=F[0],W=F[1];c.setUint32(d+R,w,D),c.setUint32(d+W,_,D)}},{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,D){if(0<d)return-1;var w;if(0>d)w=-d-1;else{if(v===0)return-1;v--,D=c.__digit(v),w=29}var _=1<<w;if(!(D&_))return-1;if(_-=1,(D&_)!=0)return 1;for(;0<v;)if(v--,c.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(c){var d=0>c;g.__kBitConversionDouble[0]=c;var v,D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,w=D-1023,_=(0|w/30)+1,I=new g(_,d),C=1048576,F=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|C,R=g.__kBitConversionInts[g.__kBitConversionIntLow],W=20,ee=w%30,q=0;if(ee<W){var j=W-ee;q=j+32,v=F>>>j,F=F<<32-j|R>>>j,R<<=32-j}else if(ee===W)q=32,v=F,F=R,R=0;else{var re=ee-W;q=32-re,v=F<<re|R>>>32-re,F=R<<re,R=0}I.__setDigit(_-1,v);for(var le=_-2;0<=le;le--)0<q?(q-=30,v=F>>>2,F=F<<30|R>>>2,R<<=30):v=0,I.__setDigit(le,v);return I.__trim()}},{key:"__isWhitespace",value:function(c){return 13>=c&&9<=c||(159>=c?c==32:131071>=c?c==160||c==5760:196607>=c?(c&=131071,10>=c||c==40||c==41||c==47||c==95||c==4096):c==65279)}},{key:"__fromString",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,D=c.length,w=0;if(w===D)return g.__zero();for(var _=c.charCodeAt(w);g.__isWhitespace(_);){if(++w===D)return g.__zero();_=c.charCodeAt(w)}if(_===43){if(++w===D)return null;_=c.charCodeAt(w),v=1}else if(_===45){if(++w===D)return null;_=c.charCodeAt(w),v=-1}if(d===0){if(d=10,_===48){if(++w===D)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(d=16,++w===D)return null;_=c.charCodeAt(w)}else if(_===79||_===111){if(d=8,++w===D)return null;_=c.charCodeAt(w)}else if(_===66||_===98){if(d=2,++w===D)return null;_=c.charCodeAt(w)}}}else if(d===16&&_===48){if(++w===D)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(++w===D)return null;_=c.charCodeAt(w)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++w===D)return g.__zero();_=c.charCodeAt(w)}var I=D-w,C=g.__kMaxBitsPerChar[d],F=g.__kBitsPerCharTableMultiplier-1;if(I>1073741824/C)return null;var R=C*I+F>>>g.__kBitsPerCharTableShift,W=0|(R+29)/30,ee=new g(W,!1),q=10>d?d:10,j=10<d?d-10:0;if(d&d-1){ee.__initializeDigits();var tt=!1,Vt=0;do{for(var Wn,xn=0,Wr=1;;){if(Wn=void 0,_-48>>>0<q)Wn=_-48;else if((32|_)-97>>>0<j)Wn=(32|_)-87;else{tt=!0;break}var oo=Wr*d;if(1073741823<oo)break;if(Wr=oo,xn=xn*d+Wn,Vt++,++w===D){tt=!0;break}_=c.charCodeAt(w)}F=30*g.__kBitsPerCharTableMultiplier-1;var ao=0|(C*Vt+F>>>g.__kBitsPerCharTableShift)/30;ee.__inplaceMultiplyAdd(Wr,xn,ao)}while(!tt)}else{C>>=g.__kBitsPerCharTableShift;var re=[],le=[],ge=!1;do{for(var we,Re=0,ze=0;;){if(we=void 0,_-48>>>0<q)we=_-48;else if((32|_)-97>>>0<j)we=(32|_)-87;else{ge=!0;break}if(ze+=C,Re=Re<<C|we,++w===D){ge=!0;break}if(_=c.charCodeAt(w),30<ze+C)break}re.push(Re),le.push(ze)}while(!ge);g.__fillFromParts(ee,re,le)}if(w!==D){if(!g.__isWhitespace(_))return null;for(w++;w<D;w++)if(_=c.charCodeAt(w),!g.__isWhitespace(_))return null}return ee.sign=v===-1,ee.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var D=0,w=0,_=0,I=d.length-1;0<=I;I--){var C=d[I],F=v[I];w|=C<<_,_+=F,_===30?(c.__setDigit(D++,w),_=0,w=0):30<_&&(c.__setDigit(D++,1073741823&w),_-=30,w=C>>>F-_)}if(w!==0){if(D>=c.length)throw new Error("implementation bug");c.__setDigit(D++,w)}for(;D<c.length;D++)c.__setDigit(D,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,D=d-1;D=(85&D>>>1)+(85&D),D=(51&D>>>2)+(51&D),D=(15&D>>>4)+(15&D);var w=D,_=d-1,I=c.__digit(v-1),C=g.__clz30(I),F=30*v-C,R=0|(F+w-1)/w;if(c.sign&&R++,268435456<R)throw new Error("string too long");for(var W=Array(R),ee=R-1,q=0,j=0,re=0;re<v-1;re++){var le=c.__digit(re),ge=(q|le<<j)&_;W[ee--]=g.__kConversionChars[ge];var we=w-j;for(q=le>>>we,j=30-we;j>=w;)W[ee--]=g.__kConversionChars[q&_],q>>>=w,j-=w}var Re=(q|I<<j)&_;for(W[ee--]=g.__kConversionChars[Re],q=I>>>w-j;q!==0;)W[ee--]=g.__kConversionChars[q&_],q>>>=w;if(c.sign&&(W[ee--]="-"),ee!==-1)throw new Error("implementation bug");return W.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var D=c.length;if(D===0)return"";if(D===1){var w=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(w="-"+w),w}var _=30*D-g.__clz30(c.__digit(D-1)),I=g.__kMaxBitsPerChar[d],C=I-1,F=_*g.__kBitsPerCharTableMultiplier;F+=C-1,F=0|F/C;var R,W,ee=F+1>>1,q=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(ee,!1)),j=q.__unsignedDigit(0);if(q.length===1&&32767>=j){R=new g(c.length,!1),R.__initializeDigits();for(var re,le=0,ge=2*c.length-1;0<=ge;ge--)re=le<<15|c.__halfDigit(ge),R.__setHalfDigit(ge,0|re/j),le=0|re%j;W=le.toString(d)}else{var we=g.__absoluteDivLarge(c,q,!0,!0);R=we.quotient;var Re=we.remainder.__trim();W=g.__toStringGeneric(Re,d,!0)}R.__trim();for(var ze=g.__toStringGeneric(R,d,!0);W.length<ee;)W="0"+W;return v===!1&&c.sign&&(ze="-"+ze),ze+W}},{key:"__unequalSign",value:function(c){return c?-1:1}},{key:"__absoluteGreater",value:function(c){return c?-1:1}},{key:"__absoluteLess",value:function(c){return c?1:-1}},{key:"__compareToBigInt",value:function(c,d){var v=c.sign;if(v!==d.sign)return g.__unequalSign(v);var D=g.__absoluteCompare(c,d);return 0<D?g.__absoluteGreater(v):0>D?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,D=0>d;if(v!==D)return g.__unequalSign(v);if(c.length===0){if(D)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var w=H(d),_=c.__unsignedDigit(0);return _>w?g.__absoluteGreater(v):_<w?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,D=0>d;if(v!==D)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 w=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(w==2047)throw new Error("implementation bug: handled elsewhere");var _=w-1023;if(0>_)return g.__absoluteGreater(v);var I=c.length,C=c.__digit(I-1),F=g.__clz30(C),R=30*I-F,W=_+1;if(R<W)return g.__absoluteLess(v);if(R>W)return g.__absoluteGreater(v);var ee=1048576,q=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],j=g.__kBitConversionInts[g.__kBitConversionIntLow],re=20,le=29-F;if(le!==(0|(R-1)%30))throw new Error("implementation bug");var ge,we=0;if(le<re){var Re=re-le;we=Re+32,ge=q>>>Re,q=q<<32-Re|j>>>Re,j<<=32-Re}else if(le===re)we=32,ge=q,q=j,j=0;else{var ze=le-re;we=32-ze,ge=q<<ze|j>>>32-ze,q=j<<ze,j=0}if(C>>>=0,ge>>>=0,C>ge)return g.__absoluteGreater(v);if(C<ge)return g.__absoluteLess(v);for(var tt=I-2;0<=tt;tt--){0<we?(we-=30,ge=q>>>2,q=q<<30|j>>>2,j<<=30):ge=0;var Vt=c.__unsignedDigit(tt);if(Vt>ge)return g.__absoluteGreater(v);if(Vt<ge)return g.__absoluteLess(v)}if(q!==0||j!==0){if(we===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)===H(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 D=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&D++;for(var w,_=new g(D,v),I=0,C=0;C<d.length;C++)w=c.__digit(C)+d.__digit(C)+I,I=w>>>30,_.__setDigit(C,1073741823&w);for(;C<c.length;C++){var F=c.__digit(C)+I;I=F>>>30,_.__setDigit(C,1073741823&F)}return C<_.length&&_.__setDigit(C,I),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);for(var D,w=new g(c.length,v),_=0,I=0;I<d.length;I++)D=c.__digit(I)-d.__digit(I)-_,_=1&D>>>30,w.__setDigit(I,1073741823&D);for(;I<c.length;I++){var C=c.__digit(I)-_;_=1&C>>>30,w.__setDigit(I,1073741823&C)}return w.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length;v===null?v=new g(D,d):v.sign=d;for(var w,_=1,I=0;I<D;I++)w=c.__digit(I)+_,_=w>>>30,v.__setDigit(I,1073741823&w);return _!==0&&v.__setDigitGrow(D,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var D,w=new g(d,!1),_=1,I=0;I<v;I++)D=c.__digit(I)-_,_=1&D>>>30,w.__setDigit(I,1073741823&D);if(_!==0)throw new Error("implementation bug");for(var C=v;C<d;C++)w.__setDigit(C,0);return w}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=_;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)&d.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;D<w&&(_=D);var I=D;v===null?v=new g(I,!1):I=v.length;for(var C=0;C<_;C++)v.__setDigit(C,c.__digit(C)&~d.__digit(C));for(;C<D;C++)v.__setDigit(C,c.__digit(C));for(;C<I;C++)v.__setDigit(C,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=D;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)|d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,w=d.length,_=w;if(D<w){_=D;var I=c,C=D;c=d,D=w,d=I,w=C}var F=D;v===null?v=new g(F,!1):F=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)^d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<F;R++)v.__setDigit(R,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var D=c.length-1;0<=D&&c.__digit(D)===d.__digit(D);)D--;return 0>D?0:c.__unsignedDigit(D)>d.__unsignedDigit(D)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,D){if(d!==0){for(var w=32767&d,_=d>>>15,I=0,C=0,F=0;F<c.length;F++,D++){var R=v.__digit(D),W=c.__digit(F),ee=32767&W,q=W>>>15,j=g.__imul(ee,w),re=g.__imul(ee,_),le=g.__imul(q,w),ge=g.__imul(q,_);R+=C+j+I,I=R>>>30,R&=1073741823,R+=((32767&re)<<15)+((32767&le)<<15),I+=R>>>30,C=ge+(re>>>15)+(le>>>15),v.__setDigit(D,1073741823&R)}for(;I!==0||C!==0;D++){var we=v.__digit(D);we+=I+C,C=0,I=we>>>30,v.__setDigit(D,1073741823&we)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,D,w){for(var _=v,I=0,C=0;C<D;C++){var F=c.__digit(C),R=g.__imul(32767&F,d),W=g.__imul(F>>>15,d),ee=R+((32767&W)<<15)+I+_;_=ee>>>30,I=W>>>15,w.__setDigit(C,1073741823&ee)}if(w.length>D)for(w.__setDigit(D++,_+I);D<w.length;)w.__setDigit(D++,0);else if(_+I!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new g(c.length,!1));for(var D=0,w=2*c.length-1;0<=w;w-=2){var _=(D<<15|c.__halfDigit(w))>>>0,I=0|_/d;D=0|_%d,_=(D<<15|c.__halfDigit(w-1))>>>0;var C=0|_/d;D=0|_%d,v.__setDigit(w>>>1,I<<15|C)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,D=0,w=2*c.length-1;0<=w;w--)v=(D<<15|c.__halfDigit(w))>>>0,D=0|v%d;return D}},{key:"__absoluteDivLarge",value:function(c,d,v,D){var w=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-w,C=null;v&&(C=new g(I+2>>>1,!1),C.__initializeDigits());var F=new g(w+2>>>1,!1);F.__initializeDigits();var R=g.__clz15(d.__halfDigit(w-1));0<R&&(d=g.__specialLeftShift(d,R,0));for(var W=g.__specialLeftShift(c,R,1),ee=d.__halfDigit(w-1),q=0,j=I;0<=j;j--){var re=32767,le=W.__halfDigit(j+w);if(le!==ee){var ge=(le<<15|W.__halfDigit(j+w-1))>>>0;re=0|ge/ee;for(var we=0|ge%ee,Re=d.__halfDigit(w-2),ze=W.__halfDigit(j+w-2);g.__imul(re,Re)>>>0>(we<<16|ze)>>>0&&(re--,we+=ee,!(32767<we)););}g.__internalMultiplyAdd(d,re,0,_,F);var tt=W.__inplaceSub(F,j,w+1);tt!==0&&(tt=W.__inplaceAdd(d,j,w),W.__setHalfDigit(j+w,32767&W.__halfDigit(j+w)+tt),re--),v&&(1&j?q=re<<15:C.__setDigit(j>>>1,q|re))}if(D)return W.__inplaceRightShift(R),v?{quotient:C,remainder:W}:W;if(v)return C;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var D=c.length,w=D+v,_=new g(w,!1);if(d===0){for(var I=0;I<D;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(D,0),_}for(var C,F=0,R=0;R<D;R++)C=c.__digit(R),_.__setDigit(R,1073741823&C<<d|F),F=C>>>30-d;return 0<v&&_.__setDigit(D,F),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var D=0|v/30,w=v%30,_=c.length,I=w!==0&&c.__digit(_-1)>>>30-w!=0,C=_+D+(I?1:0),F=new g(C,c.sign);if(w===0){for(var R=0;R<D;R++)F.__setDigit(R,0);for(;R<C;R++)F.__setDigit(R,c.__digit(R-D))}else{for(var W=0,ee=0;ee<D;ee++)F.__setDigit(ee,0);for(var q,j=0;j<_;j++)q=c.__digit(j),F.__setDigit(j+D,1073741823&q<<w|W),W=q>>>30-w;if(I)F.__setDigit(_+D,W);else if(W!==0)throw new Error("implementation bug")}return F.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,D=c.sign,w=g.__toShiftAmount(d);if(0>w)return g.__rightShiftByMaximum(D);var _=0|w/30,I=w%30,C=v-_;if(0>=C)return g.__rightShiftByMaximum(D);var F=!1;if(D){var R=(1<<I)-1;if(c.__digit(_)&R)F=!0;else for(var W=0;W<_;W++)if(c.__digit(W)!==0){F=!0;break}}if(F&&I===0){var ee=c.__digit(v-1),q=~ee==0;q&&C++}var j=new g(C,D);if(I===0){j.__setDigit(C-1,0);for(var re=_;re<v;re++)j.__setDigit(re-_,c.__digit(re))}else{for(var le,ge=c.__digit(_)>>>I,we=v-_-1,Re=0;Re<we;Re++)le=c.__digit(Re+_+1),j.__setDigit(Re,1073741823&le<<30-I|ge),ge=le>>>I;j.__setDigit(we,ge)}return F&&(j=g.__absoluteAddOne(j,!0,j)),j.__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(oe(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var D=c.valueOf;if(D){var w=D.call(c);if(oe(w)!=="object")return w}var _=c.toString;if(_){var I=_.call(c);if(oe(I)!=="object")return I}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return g.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return oe(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,D=new g(v,d.sign),w=v-1,_=0;_<w;_++)D.__setDigit(_,d.__digit(_));var I=d.__digit(w);if(c%30!=0){var C=32-c%30;I=I<<C>>>C}return D.__setDigit(w,I),D.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var D=Math.min,w,_=0|(c+29)/30,I=new g(_,v),C=0,F=_-1,R=0,W=D(F,d.length);C<W;C++)w=0-d.__digit(C)-R,R=1&w>>>30,I.__setDigit(C,1073741823&w);for(;C<F;C++)I.__setDigit(C,0|1073741823&-R);var ee,q=F<d.length?d.__digit(F):0,j=c%30;if(j===0)ee=0-q-R,ee&=1073741823;else{var re=32-j;q=q<<re>>>re;var le=1<<32-re;ee=le-q-R,ee&=le-1}return I.__setDigit(F,ee),I.__trim()}},{key:"__digitPow",value:function(c,d){for(var v=1;0<d;)1&d&&(v*=c),d>>>=1,c*=c;return v}},{key:"__detectBigEndian",value:function(){return g.__kBitConversionDouble[0]=-0,g.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(Se(Array));return ie.__kMaxLength=33554432,ie.__kMaxLengthBits=ie.__kMaxLength<<5,ie.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],ie.__kBitsPerCharTableShift=5,ie.__kBitsPerCharTableMultiplier=1<<ie.__kBitsPerCharTableShift,ie.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ie.__kBitConversionBuffer=new ArrayBuffer(8),ie.__kBitConversionDouble=new Float64Array(ie.__kBitConversionBuffer),ie.__kBitConversionInts=new Int32Array(ie.__kBitConversionBuffer),ie.__kBitConversionIntHigh=ie.__detectBigEndian()?0:1,ie.__kBitConversionIntLow=ie.__detectBigEndian()?1:0,ie.__clz30=t?function(N){return t(N)-2}:function(N){var H=Math.LN2,O=Math.log;return N===0?30:0|29-(0|O(N>>>0)/H)},ie.__imul=n||function(N,H){return 0|N*H},ie})});var T=zd(kc(),1),Yt=T.default.BigInt(0),hi=T.default.BigInt(1),bs=T.default.BigInt(2),Ud=T.default.BigInt(10),Vd=T.default.BigInt(24),qd=T.default.BigInt(60),Wd=T.default.BigInt(1e3),Pi=T.default.BigInt(1e6),ai=T.default.BigInt(1e9),sl=T.default.multiply(T.default.BigInt(3600),ai),Kd=T.default.multiply(qd,ai),Fn=T.default.multiply(sl,Vd);function gn(n){return typeof n=="bigint"?T.default.BigInt(n.toString(10)):n}function cl(n){return T.default.equal(T.default.remainder(n,bs),Yt)}function Kn(n){return T.default.lessThan(n,Yt)?T.default.unaryMinus(n):n}function ho(n,t){return T.default.lessThan(n,t)?-1:T.default.greaterThan(n,t)?1:0}function Xr(n,t){return{quotient:T.default.divide(n,t),remainder:T.default.remainder(n,t)}}var Tc,Cc,se="slot-epochNanoSeconds",ce="slot-iso-date",Ae="slot-iso-date-time",He="slot-time",$="slot-calendar",ll="slot-date-brand",ul="slot-year-month-brand",dl="slot-month-day-brand",_e="slot-time-zone",dt="slot-years",ht="slot-months",kt="slot-weeks",mt="slot-days",pt="slot-hours",ft="slot-minutes",gt="slot-seconds",yt="slot-milliseconds",vt="slot-microseconds",Tt="slot-nanoseconds",hl="date",ml="ym",pl="md",fl="time",gl="datetime",yl="instant",or="original",vr="timezone-canonical",Aa="timezone-original",Qr="calendar-id",vl="locale",La="options",bl=new WeakMap,Na=Symbol.for("@@Temporal__GetSlots");(Tc=globalThis)[Na]||(Tc[Na]=function(n){return bl.get(n)});var Co=globalThis[Na],Oa=Symbol.for("@@Temporal__CreateSlots");(Cc=globalThis)[Oa]||(Cc[Oa]=function(n){bl.set(n,Object.create(null))});var Tn=globalThis[Oa];function _t(n,...t){if(!n||typeof n!="object")return!1;let e=Co(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=Co(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function me(n,t,e){let r=Co(n);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=e}var Fa={};function Cn(n,t){Object.defineProperty(n.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let e=Object.getOwnPropertyNames(n);for(let i=0;i<e.length;i++){let o=e[i],a=Object.getOwnPropertyDescriptor(n,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n,o,a))}let r=Object.getOwnPropertyNames(n.prototype);for(let i=0;i<r.length;i++){let o=r[i],a=Object.getOwnPropertyDescriptor(n.prototype,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n.prototype,o,a))}Ha(t,n),Ha(`${t}.prototype`,n.prototype)}function Ha(n,t){let e=`%${n}%`;if(Fa[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);Fa[e]=t}function Qe(n){return Fa[n]}function wr(n,t){let e=n;if(e===0)return{div:e,mod:e};let r=Math.sign(e);e=Math.abs(e);let i=Math.trunc(1+Math.log10(e));if(t>=i)return{div:0*r,mod:r*e};if(t===0)return{div:r*e,mod:0*r};let o=e.toPrecision(i);return{div:r*Number.parseInt(o.slice(0,i-t),10),mod:r*Number.parseInt(o.slice(i-t),10)}}function Ca(n,t,e){let r=n,i=e;if(r===0)return i;let o=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return o*Number.parseInt(a+"0".repeat(t),10);let s=a+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,"0");return o*Number.parseInt(s,10)}function Io(n,t){let e=t==="negative";switch(n){case"ceil":return e?"zero":"infinity";case"floor":return e?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return e?"half-zero":"half-infinity";case"halfFloor":return e?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function Po(n,t,e,r,i){return i==="zero"?n:i==="infinity"?t:e<0?n:e>0?t:i==="half-zero"?n:i==="half-infinity"?t:r?n:t}var ke=class n{constructor(t){this.totalNs=gn(t),this.sec=T.default.toNumber(T.default.divide(this.totalNs,ai)),this.subsec=T.default.toNumber(T.default.remainder(this.totalNs,ai))}static validateNew(t,e){if(T.default.greaterThan(Kn(t),n.MAX))throw new RangeError(`${e} of duration time units cannot exceed ${n.MAX} s`);return new n(t)}static fromEpochNsDiff(t,e){let r=T.default.subtract(gn(t),gn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=T.default.add(T.default.add(T.default.add(T.default.add(T.default.add(T.default.BigInt(a),T.default.multiply(T.default.BigInt(o),Wd)),T.default.multiply(T.default.BigInt(i),Pi)),T.default.multiply(T.default.BigInt(r),ai)),T.default.multiply(T.default.BigInt(e),Kd)),T.default.multiply(T.default.BigInt(t),sl));return n.validateNew(s,"total")}abs(){return new n(Kn(this.totalNs))}add(t){return n.validateNew(T.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(T.default.add(this.totalNs,T.default.multiply(T.default.BigInt(t),Fn)),"sum")}addToEpochNs(t){return T.default.add(gn(t),this.totalNs)}cmp(t){return ho(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=Xr(this.totalNs,T.default.BigInt(t));return{quotient:T.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=gn(t),r=T.default.BigInt(e),{quotient:i,remainder:o}=Xr(this.totalNs,r),a=[],s,u=(T.default.lessThan(this.totalNs,Yt)?-1:1)*Math.sign(T.default.toNumber(e));for(;!T.default.equal(o,Yt)&&a.length<50;)o=T.default.multiply(o,Ud),{quotient:s,remainder:o}=Xr(o,r),a.push(Math.abs(T.default.toNumber(s)));return u*+(Kn(i).toString()+"."+a.join(""))}isZero(){return T.default.equal(this.totalNs,Yt)}round(t,e){let r=gn(t);if(T.default.equal(r,hi))return this;let{quotient:i,remainder:o}=Xr(this.totalNs,r),a=T.default.lessThan(this.totalNs,Yt)?"negative":"positive",s=T.default.multiply(Kn(i),r),u=T.default.add(s,r),l=ho(Kn(T.default.multiply(o,bs)),r),h=Io(e,a),p=T.default.equal(Kn(this.totalNs),s)?s:Po(s,u,l,cl(i),h),y=a==="positive"?p:T.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Yt))}subtract(t){return n.validateNew(T.default.subtract(this.totalNs,t.totalNs),"difference")}};ke.MAX=T.default.BigInt("9007199254740991999999999"),ke.ZERO=new ke(Yt);var Ic=/[A-Za-z._][A-Za-z._0-9+-]*/,xi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Ic.source})(?:\\/(?:${Ic.source}))*)`),wl=/(?:[+-]\d{6}|\d{4})/,mo=/(?:0[1-9]|1[0-2])/,Ya=/(?:0[1-9]|[12]\d|3[01])/,Gd=new RegExp(`(${wl.source})(?:-(${mo.source})-(${Ya.source})|(${mo.source})(${Ya.source}))`),Dl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,El=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,_l=new RegExp(`([zZ])|${El.source}?`),Sr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Zd=new RegExp([`^${Gd.source}`,`(?:(?:[tT]|\\s+)${Dl.source}(?:${_l.source})?)?`,`(?:\\[!?(${xi.source})\\])?`,`((?:${Sr.source})*)$`].join("")),Jd=new RegExp([`^[tT]?${Dl.source}`,`(?:${_l.source})?`,`(?:\\[!?${xi.source}\\])?`,`((?:${Sr.source})*)$`].join("")),Xd=new RegExp(`^(${wl.source})-?(${mo.source})(?:\\[!?${xi.source}\\])?((?:${Sr.source})*)$`),Qd=new RegExp(`^(?:--)?(${mo.source})-?(${Ya.source})(?:\\[!?${xi.source}\\])?((?:${Sr.source})*)$`),Ia=/(\d+)(?:[.,](\d{1,9}))?/,eh=new RegExp(`(?:${Ia.source}H)?(?:${Ia.source}M)?(?:${Ia.source}S)?`),th=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${eh.source})?$`,"i"),Hn=864e5,po=1e6*Hn,nh=6e10,Sl=1e8*Hn,Mr=Qt(Sl),mi=T.default.unaryMinus(Mr),rh=T.default.add(T.default.subtract(mi,Fn),hi),ih=T.default.subtract(T.default.add(Mr,Fn),hi),oh=146097*Hn,Pc=-271821,xc=275760,si=Date.UTC(1847,0,1),ah=["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"],sh=new Set(["ACT","AET","AGT","ART","AST","BET","BST","CAT","CNT","CST","CTT","EAT","ECT","IET","IST","JST","MIT","NET","NST","PLT","PNT","PRT","PST","SST","VST"]);function Ye(n){return typeof n=="object"&&n!==null||typeof n=="function"}function xo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function Ro(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function ue(n){let t=xo(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 Rc(n,t){let e=ue(n);if(e<=0)throw t!==void 0?new RangeError(`property '${t}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return e}function Jt(n){let t=xo(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 pi(n,t){return String(n).padStart(t,"0")}function Ve(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function $a(n,t){if(Ye(n)){let e=n?.toString();if(typeof e=="string"||typeof e=="number")return e;throw new TypeError("Cannot convert object to primitive value")}return n}var Ba=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],ch={era:Ro,eraYear:ue,year:ue,month:Rc,monthCode:function(n){let t=Ve($a(n));if(t.length<3||t.length>4||t[0]!=="M"||"0123456789".indexOf(t[1])===-1||"0123456789".indexOf(t[2])===-1||t[1]+t[2]==="00"&&t[3]!=="L"||t[3]!=="L"&&t[3]!==void 0)throw new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:Rc,hour:ue,minute:ue,second:ue,millisecond:ue,microsecond:ue,nanosecond:ue,offset:function(n){let t=Ve($a(n));return Lr(t),t},timeZone:Dt},lh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},kr=[["years","year","date"],["months","month","date"],["weeks","week","date"],["days","day","date"],["hours","hour","time"],["minutes","minute","time"],["seconds","second","time"],["milliseconds","millisecond","time"],["microseconds","microsecond","time"],["nanoseconds","nanosecond","time"]],Ac=Object.fromEntries(kr.map(n=>[n[0],n[1]])),uh=Object.fromEntries(kr.map(([n,t])=>[t,n])),ci=kr.map(([,n])=>n),Tr={day:po,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},fo=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],dh=Intl.DateTimeFormat,Lc=new Map;function Ml(n){let t=bi(n),e=Lc.get(t);return e===void 0&&(e=new dh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Lc.set(t,e)),e}function Ze(n){return _t(n,se)&&!_t(n,_e,$)}function Oe(n){return _t(n,dt,ht,mt,pt,ft,gt,yt,vt,Tt)}function Fe(n){return _t(n,ll)}function Be(n){return _t(n,He)}function Pe(n){return _t(n,Ae)}function Je(n){return _t(n,ul)}function Ht(n){return _t(n,dl)}function pe(n){return _t(n,se,_e,$)}function P(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function xr(n){if(_t(n,$)||_t(n,_e))throw new TypeError("with() does not support a calendar or timeZone property");if(Be(n))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(n.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(n.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Ri(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Ao(n){let t,e,r=!1;for(Sr.lastIndex=0;e=Sr.exec(n);){let{1:i,2:o,3:a}=e;if(o==="u-ca"){if(t===void 0)t=a,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${n}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${o}=${a}`)}return t}function mn(n){let t=Zd.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Ao(t[16]),r=t[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);let i=+r,o=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=t[6]!==void 0,u=+(t[6]??0),l=+(t[7]??t[10]??0),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),E=+p.slice(3,6),M=+p.slice(6,9),k,A=!1;t[13]?(k=void 0,A=!0):t[14]&&(k=t[14]);let B=t[15];return Ms(i,o,a,u,l,h,y,E,M),{year:i,month:o,day:a,time:s?{hour:u,minute:l,second:h,millisecond:y,microsecond:E,nanosecond:M}:"start-of-day",tzAnnotation:B,offset:k,z:A,calendar:e}}function kl(n){let t=Jd.exec(n),e,r,i,o,a,s,u;if(t){u=Ao(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let l=(t[4]??t[7]??"")+"000000000";if(o=+l.slice(0,3),a=+l.slice(3,6),s=+l.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let l,h;if({time:l,z:h,calendar:u}=mn(n),l==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=l)}if(Fo(e,r,i,o,a,s),/[tT ][0-9][0-9]/.test(n))return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u};try{let{month:l,day:h}=Ds(n);Qn(1972,l,h)}catch{try{let{year:l,month:h}=ws(n);Qn(l,h,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:u}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function ws(n){let t=Xd.exec(n),e,r,i,o;if(t){i=Ao(t[3]);let a=t[1];if(a==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);if(e=+a,r=+t[2],o=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let a;if({year:e,month:r,calendar:i,day:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ds(n){let t=Qd.exec(n),e,r,i,o;if(t){if(i=Ao(t[3]),e=+t[1],r=+t[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let a;if({month:e,day:r,calendar:i,year:o,z:a}=mn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Tl=new RegExp(`^${xi.source}$`,"i"),Cl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Il(n){let t=mh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function On(n){return Tl.test(n)||Il(n),Cl.test(n)?{offsetMinutes:Lr(n)/6e10}:{tzName:n}}function li(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":Qn(i,o,a);break;case"constrain":({year:i,month:o,day:a}=ql(i,o,a))}return{year:i,month:o,day:a}}function Lo(n,t,e,r,i,o,a){let s=n,u=t,l=e,h=r,p=i,y=o;switch(a){case"reject":Fo(s,u,l,h,p,y);break;case"constrain":s=bt(s,0,23),u=bt(u,0,59),l=bt(l,0,59),h=bt(h,0,999),p=bt(p,0,999),y=bt(y,0,999)}return{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}function Pl(n){if(!Ye(n))throw new TypeError("invalid duration-like");let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},e=!1;for(let r=0;r<fo.length;r++){let i=fo[r],o=n[i];o!==void 0&&(e=!0,t[i]=Jt(o))}if(!e)throw new TypeError("invalid duration-like");return t}function rt({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function De(n,t){return{isoDate:n,time:t}}function ve(n){return _n(n,"overflow",["constrain","reject"],"constrain")}function ui(n){return _n(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function en(n,t){return _n(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function uo(n,t){return _n(n,"offset",["prefer","use","ignore","reject"],t)}function Ai(n){return _n(n,"calendarName",["auto","always","never","critical"],"auto")}function Rr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=ue(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Ar(n,t,e){let r=e?t:t-1;if(n>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${n}`);if(t%n!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function Li(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(Ro(t)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}let e=Math.floor(t);if(!Number.isFinite(e)||e<0||e>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return e}function Ni(n,t){switch(n){case"minute":return{precision:"minute",unit:"minute",increment:1};case"second":return{precision:0,unit:"second",increment:1};case"millisecond":return{precision:3,unit:"millisecond",increment:1};case"microsecond":return{precision:6,unit:"microsecond",increment:1};case"nanosecond":return{precision:9,unit:"nanosecond",increment:1}}switch(t){case"auto":return{precision:t,unit:"nanosecond",increment:1};case 0:return{precision:t,unit:"second",increment:1};case 1:case 2:case 3:return{precision:t,unit:"millisecond",increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:"microsecond",increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:"nanosecond",increment:10**(9-t)};default:throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}var Mn=Symbol("~required~");function It(n,t,e,r,i=[]){let o=[];for(let l=0;l<kr.length;l++){let h=kr[l],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===Mn?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let l=0;l<o.length;l++){let h=o[l],p=uh[h];p!==void 0&&s.push(p)}let u=_n(n,t,s,a);if(u===void 0&&r===Mn)throw new RangeError(`${t} is required`);return u&&u in Ac?Ac[u]:u}function Pa(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",u=!1;if(Ye(t)){if(pe(t))return{zonedRelativeTo:t};if(Fe(t))return{plainRelativeTo:t};if(Pe(t))return{plainRelativeTo:wt(m(t,Ae).isoDate,m(t,$))};i=$i(t);let l=zt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Fi(i,l,"constrain")),{offset:a,timeZone:o}=l,a===void 0&&(s="wall")}else{let l,h,p,y,E;if({year:p,month:y,day:E,time:r,calendar:i,tzAnnotation:l,offset:a,z:h}=mn(Ve(t)),l)o=Dt(l),h?s="exact":a||(s="wall"),u=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=St(i),e={year:p,month:y,day:E}}return o===void 0?{plainRelativeTo:wt(e,i)}:{zonedRelativeTo:nt(go(e,r,s,s==="option"?Lr(a):0,o,"compatible","reject",u),o,i)}}function yn(n){return m(n,dt)!==0?"year":m(n,ht)!==0?"month":m(n,kt)!==0?"week":m(n,mt)!==0?"day":m(n,pt)!==0?"hour":m(n,ft)!==0?"minute":m(n,gt)!==0?"second":m(n,yt)!==0?"millisecond":m(n,vt)!==0?"microsecond":"nanosecond"}function Dn(n,t){return ci.indexOf(n)>ci.indexOf(t)?t:n}function an(n){return n==="year"||n==="month"||n==="week"}function vn(n){return an(n)||n==="day"?"date":"time"}function Bn(n){return Qe("%calendarImpl%")(n)}function Oi(n){return Qe("%calendarImpl%")(m(n,$))}function Et(n,t,e="date"){let r=Object.create(null),i=Bn(n).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,e!=="month-day"&&e!=="date"||(r.day=i.day),e!=="year-month"&&e!=="date"||(r.year=i.year),r}function zt(n,t,e,r,i){let o=Bn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),u=!1;a.sort();for(let l=0;l<a.length;l++){let h=a[l],p=t[h];if(p!==void 0)u=!0,s[h]=(0,ch[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=lh[h]}}if(i==="partial"&&!u)throw new TypeError("no supported properties found");return s}function ja(n,t="complete"){let e=["hour","microsecond","millisecond","minute","nanosecond","second"],r=!1,i=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],s=n[a];s!==void 0?(i[a]=ue(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function ei(n,t){if(Ye(n)){if(Fe(n))return ve(te(t)),wt(m(n,ce),m(n,$));if(pe(n)){let u=Gt(m(n,_e),m(n,se));return ve(te(t)),wt(u.isoDate,m(n,$))}if(Pe(n))return ve(te(t)),wt(m(n,Ae).isoDate,m(n,$));let s=$i(n);return wt(Yn(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=mn(Ve(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=St(o),ve(te(t)),wt({year:e,month:r,day:i},o)}function Fi(n,t,e){return De(Yn(n,t,e),Lo(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function ti(n,t){let e,r,i;if(Ye(n)){if(Pe(n))return ve(te(t)),qt(m(n,Ae),m(n,$));if(pe(n)){let s=Gt(m(n,_e),m(n,se));return ve(te(t)),qt(s,m(n,$))}if(Fe(n))return ve(te(t)),qt(De(m(n,ce),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,$));i=$i(n);let o=zt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=ve(te(t));({isoDate:e,time:r}=Fi(i,o,a))}else{let o,a,s,u;if({year:a,month:s,day:u,time:r,calendar:i,z:o}=mn(Ve(n)),o)throw new RangeError("Z designator not supported for PlainDateTime");r==="start-of-day"&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Ms(a,s,u,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=St(i),ve(te(t)),e={year:a,month:s,day:u}}return qt(De(e,r),i)}function Kt(n){let t=Qe("%Temporal.Duration%");if(Oe(n))return new t(m(n,dt),m(n,ht),m(n,kt),m(n,mt),m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt));if(!Ye(n))return function(i){let{years:o,months:a,weeks:s,days:u,hours:l,minutes:h,seconds:p,milliseconds:y,microseconds:E,nanoseconds:M}=function(k){let A=th.exec(k);if(!A)throw new RangeError(`invalid duration: ${k}`);if(A.every((v,D)=>D<2||v===void 0))throw new RangeError(`invalid duration: ${k}`);let B=A[1]==="-"?-1:1,V=A[2]===void 0?0:ue(A[2])*B,G=A[3]===void 0?0:ue(A[3])*B,U=A[4]===void 0?0:ue(A[4])*B,J=A[5]===void 0?0:ue(A[5])*B,oe=A[6]===void 0?0:ue(A[6])*B,Te=A[7],Se=A[8],ie=A[9],N=A[10],H=A[11],O=0,ne=0,g=0;if(Te!==void 0){if(Se??ie??N??H)throw new RangeError("only the smallest unit can be fractional");g=3600*ue((Te+"000000000").slice(0,9))*B}else if(O=Se===void 0?0:ue(Se)*B,ie!==void 0){if(N??H)throw new RangeError("only the smallest unit can be fractional");g=60*ue((ie+"000000000").slice(0,9))*B}else ne=N===void 0?0:ue(N)*B,H!==void 0&&(g=ue((H+"000000000").slice(0,9))*B);let L=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return ne+=Math.trunc(g/1e9)%60,O+=Math.trunc(g/6e10),Ho(V,G,U,J,oe,O,ne,d,c,L),{years:V,months:G,weeks:U,days:J,hours:oe,minutes:O,seconds:ne,milliseconds:d,microseconds:c,nanoseconds:L}}(i);return new(Qe("%Temporal.Duration%"))(o,a,s,u,l,h,p,y,E,M)}(Ve(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Pl(n);for(let i=0;i<fo.length;i++){let o=fo[i],a=r[o];a!==void 0&&(e[o]=a)}return new t(e.years,e.months,e.weeks,e.days,e.hours,e.minutes,e.seconds,e.milliseconds,e.microseconds,e.nanoseconds)}function ni(n){let t;if(Ye(n)){if(Ze(n)||pe(n))return Xt(m(n,se));t=$a(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(k){let A=mn(k);if(!A.z&&!A.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return A}(Ve(t)),{hour:u=0,minute:l=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:E=0}=o==="start-of-day"?{}:o,M=vi(e,r,i,u,l,h,p,y,E-(s?0:Lr(a)));return _r(M.isoDate),Xt(Xe(M))}function Nc(n,t){if(Ye(n)){if(Ht(n))return ve(te(t)),Dr(m(n,ce),m(n,$));let s;return _t(n,$)?s=m(n,$):(s=n.calendar,s===void 0&&(s="iso8601"),s=Yi(s)),Dr(yo(s,zt(s,n,["year","month","monthCode","day"],[],[]),ve(te(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ds(Ve(n));if(o===void 0&&(o="iso8601"),o=St(o),ve(te(t)),o==="iso8601")return Dr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return ar(a),a=yo(o,Et(o,a,"month-day"),"constrain"),Dr(a,o)}function Ln(n,t){let e;if(Ye(n)){if(Be(n))return ve(te(t)),bn(m(n,He));if(Pe(n))return ve(te(t)),bn(m(n,Ae).time);if(pe(n)){let l=Gt(m(n,_e),m(n,se));return ve(te(t)),bn(l.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:u}=ja(n);e=Lo(r,i,o,a,s,u,ve(te(t)))}else e=kl(Ve(n)),ve(te(t));return bn(e)}function xl(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Ln(n),He)}function ri(n,t){if(Ye(n)){if(Je(n))return ve(te(t)),Er(m(n,ce),m(n,$));let s=$i(n);return Er(fi(s,zt(s,n,["year","month","monthCode"],[],[]),ve(te(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=ws(Ve(n));o===void 0&&(o="iso8601"),o=St(o),ve(te(t));let a={year:e,month:r,day:i};return ks(a),a=fi(o,Et(o,a,"year-month"),"constrain"),Er(a,o)}function go(n,t,e,r,i,o,a,s){if(t==="start-of-day")return Rn(i,n);let u=De(n,t);if(e==="wall"||a==="ignore")return it(i,u,o);if(e==="exact"||a==="use"){let p=vi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);_r(p.isoDate);let y=Xe(p);return dn(y),y}_r(n);let l=Xe(u),h=gi(i,u);for(let p=0;p<h.length;p++){let y=h[p],E=T.default.toNumber(T.default.subtract(l,y)),M=Nn(E,6e10,"halfExpand");if(E===r||s&&M===r)return y}if(a==="reject"){let p=za(r),y=yi(u,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return $l(h,i,u,o)}function ii(n,t){let e,r,i,o,a,s,u,l=!1,h="option";if(Ye(n)){if(pe(n)){let k=te(t);return ui(k),uo(k,"reject"),ve(k),nt(m(n,se),m(n,_e),m(n,$))}a=$i(n);let y=zt(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 E=te(t);s=ui(E),u=uo(E,"reject");let M=ve(E);({isoDate:e,time:r}=Fi(a,y,M))}else{let y,E,M,k,A;({year:M,month:k,day:A,time:r,tzAnnotation:y,offset:o,z:E,calendar:a}=function(V){let G=mn(V);if(!G.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return G}(Ve(n))),i=Dt(y),E?h="exact":o||(h="wall"),a||(a="iso8601"),a=St(a),l=!0;let B=te(t);s=ui(B),u=uo(B,"reject"),ve(B),e={year:M,month:k,day:A}}let p=0;return h==="option"&&(p=Lr(o)),nt(go(e,r,h,p,i,s,u,l),i,a)}function Rl(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,ll,!0)}function wt(n,t){let e=Qe("%Temporal.PlainDate%"),r=Object.create(e.prototype);return Rl(r,n,t),r}function Al(n,t,e){er(t),Tn(n),me(n,Ae,t),me(n,$,e)}function qt(n,t){let e=Qe("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return Al(r,n,t),r}function Ll(n,t,e){ar(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,dl,!0)}function Dr(n,t){let e=Qe("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return Ll(r,n,t),r}function Nl(n,t){Tn(n),me(n,He,t)}function bn(n){let t=Qe("%Temporal.PlainTime%"),e=Object.create(t.prototype);return Nl(e,n),e}function Ol(n,t,e){ks(t),Tn(n),me(n,ce,t),me(n,$,e),me(n,ul,!0)}function Er(n,t){let e=Qe("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return Ol(r,n,t),r}function Fl(n,t){dn(t),Tn(n),me(n,se,t)}function Xt(n){let t=Qe("%Temporal.Instant%"),e=Object.create(t.prototype);return Fl(e,n),e}function Hl(n,t,e,r){dn(t),Tn(n),me(n,se,t),me(n,_e,e),me(n,$,r)}function nt(n,t,e="iso8601"){let r=Qe("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return Hl(i,n,t,e),i}function Oc(n){return Ba.filter(t=>n[t]!==void 0)}function Xn(n,t,e){let r=Oc(e),i=Bn(n).fieldKeysToIgnore(r),o=Object.create(null),a=Oc(t);for(let s=0;s<Ba.length;s++){let u,l=Ba[s];a.includes(l)&&!i.includes(l)&&(u=t[l]),r.includes(l)&&(u=e[l]),u!==void 0&&(o[l]=u)}return o}function Bt(n,t,e,r){let i=Bn(n).dateAdd(t,e,r);return ar(i),i}function Hi(n,t,e,r){return Bn(n).dateUntil(t,e,r)}function Yi(n){if(Ye(n)&&_t(n,$))return m(n,$);let t=Ve(n);try{return St(t)}catch{}let e;try{({calendar:e}=mn(t))}catch{try{({calendar:e}=kl(t))}catch{try{({calendar:e}=ws(t))}catch{({calendar:e}=Ds(t))}}}return e||(e="iso8601"),St(e)}function $i(n){if(_t(n,$))return m(n,$);let{calendar:t}=n;return t===void 0?"iso8601":Yi(t)}function un(n,t){return St(n)===St(t)}function Yn(n,t,e){let r=Bn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return ar(i),i}function fi(n,t,e){let r=Bn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return ks(i),i}function yo(n,t,e){let r=Bn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return ar(i),i}function Dt(n){if(Ye(n)&&pe(n))return m(n,_e);let t=Ve(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:u}=function(l){if(Tl.test(l))return{tzAnnotation:l,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=mn(l);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Il(l)}(o);return a?On(a):u?On("UTC"):s?On(s):void 0}(t);if(r!==void 0)return Es(r);let i=vo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function Yl(n,t){if(n===t)return!0;let e=On(n).offsetMinutes,r=On(t).offsetMinutes;if(e===void 0&&r===void 0){let i=vo(t);if(!i)return!1;let o=vo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function wn(n,t){let e=On(n).offsetMinutes;return e!==void 0?6e10*e:Ua(n,t)}function za(n){let t=n<0?"-":"+",e=Math.abs(n),r=Math.floor(e/36e11),i=Math.floor(e/6e10)%60,o=Math.floor(e/1e9)%60,a=e%1e9;return`${t}${No(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function Gt(n,t){let e=wn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:u,millisecond:l,microsecond:h,nanosecond:p}}=zl(t);return vi(r,i,o,a,s,u,l,h,p+e)}function it(n,t,e){return $l(gi(n,t),n,t,e)}function $l(n,t,e,r){let i=n.length;if(i===1)return n[0];if(i)switch(r){case"compatible":case"earlier":return n[0];case"later":return n[i-1];case"reject":throw new RangeError("multiple instants found")}if(r==="reject")throw new RangeError("multiple instants found");let o=Xe(e),a=T.default.subtract(o,Fn);dn(a);let s=wn(t,a),u=T.default.add(o,Fn);dn(u);let l=wn(t,u)-s;switch(r){case"earlier":{let h=ke.fromComponents(0,0,0,0,0,-l),p=Cr(e.time,h);return gi(t,De(Pt(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=ke.fromComponents(0,0,0,0,0,l),p=Cr(e.time,h),y=gi(t,De(Pt(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function gi(n,t){if(n==="UTC")return _r(t.isoDate),[Xe(t)];let e=On(n).offsetMinutes;if(e!==void 0){let r=vi(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-e,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);_r(r.isoDate);let i=Xe(r);return dn(i),[i]}return _r(t.isoDate),function(r,i){let o=Xe(i),a=T.default.subtract(o,Fn);T.default.lessThan(a,mi)&&(a=o);let s=T.default.add(o,Fn);T.default.greaterThan(s,Mr)&&(s=o);let u=Ua(r,a),l=Ua(r,s);return(u===l?[u]:[u,l]).map(p=>{let y=T.default.subtract(o,T.default.BigInt(p)),E=function(M,k){let{epochMilliseconds:A,time:{millisecond:B,microsecond:V,nanosecond:G}}=zl(k),{year:U,month:J,day:oe,hour:Te,minute:Se,second:ie}=Ul(M,A);return vi(U,J,oe,Te,Se,ie,B,V,G)}(r,y);if(Ir(i,E)===0)return dn(y),y}).filter(p=>p!==void 0)}(n,t)}function Rn(n,t){let e=De(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=gi(n,e);if(r.length)return r[0];let i=Xe(e),o=T.default.subtract(i,Fn);return dn(o),Ss(n,o)}function Bi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+pi(Math.abs(n),6):pi(n,4),t}function jt(n){return pi(n,2)}function Bl(n,t){let e;if(t==="auto"){if(n===0)return"";e=pi(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=pi(n,9).slice(0,t)}return`.${e}`}function No(n,t,e,r,i){let o=`${jt(n)}:${jt(t)}`;return i==="minute"||(o+=`:${jt(e)}`,o+=Bl(r,i)),o}function Fc(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,se),o=yi(Gt(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=jl(wn(r,i))),`${o}${a}`}function lo(n,t){let e=m(n,dt),r=m(n,ht),i=m(n,kt),o=m(n,mt),a=m(n,pt),s=m(n,ft),u=wo(n),l="";e!==0&&(l+=`${Math.abs(e)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),o!==0&&(l+=`${Math.abs(o)}D`);let h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=ke.fromComponents(0,0,m(n,gt),m(n,yt),m(n,vt),m(n,Tt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(yn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${Bl(Math.abs(p.subsec),t)}S`);let y=`${u<0?"-":""}P${l}`;return h&&(y=`${y}T${h}`),y}function Hc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce);return`${Bi(e)}-${jt(r)}-${jt(i)}${Ri(m(n,$),t)}`}function Yc({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return No(n,t,e,1e6*r+1e3*i+o,a)}function yi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${Bi(i)}-${jt(o)}-${jt(a)}T${No(s,u,l,1e6*h+1e3*p+y,e)}${Ri(t,r)}`}function $c(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${jt(r)}-${jt(i)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Bi(e)}-${o}`);let s=Ri(a,t);return s&&(o+=s),o}function Bc(n,t="auto"){let{year:e,month:r,day:i}=m(n,ce),o=`${Bi(e)}-${jt(r)}`,a=m(n,$);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${jt(i)}`);let s=Ri(a,t);return s&&(o+=s),o}function jc(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,se);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=Ka(a,p,h,y)}let s=m(n,_e),u=wn(s,a),l=yi(Gt(s,a),"iso8601",t,"never");return i!=="never"&&(l+=jl(u)),r!=="never"&&(l+=`[${r==="critical"?"!":""}${s}]`),l+=Ri(m(n,$),e),l}function zc(n){return Cl.test(n)}function Lr(n){let t=ph.exec(n);if(!t)throw new RangeError(`invalid time zone offset: ${n}; must match \xB1HH:MM[:SS.SSSSSSSSS]`);return(t[1]==="-"?-1:1)*(1e9*(60*(60*+t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+"000000000").slice(0,9))}var Gr,hh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function vo(n){if(Gr===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){Gr=new Map;for(let a=0;a<o.length;a++){let s=o[a];Gr.set(bi(s),s)}}else Gr=null}let t=bi(n),e=Gr?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Ml(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),sh.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||hh[t[a-1]]?o.toUpperCase():o).join("").split("/");if(r.length===1)return t==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:e}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:e};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:e};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:e};let i=new Map([["Act","ACT"],["Lhi","LHI"],["Nsw","NSW"],["Dar_Es_Salaam","Dar_es_Salaam"],["Port_Of_Spain","Port_of_Spain"],["Port-Au-Prince","Port-au-Prince"],["Isle_Of_Man","Isle_of_Man"],["Comodrivadavia","ComodRivadavia"],["Knox_In","Knox_IN"],["Dumontdurville","DumontDUrville"],["Mcmurdo","McMurdo"],["Denoronha","DeNoronha"],["Easterisland","EasterIsland"],["Bajanorte","BajaNorte"],["Bajasur","BajaSur"]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join("/"),primaryIdentifier:e}}function Zn(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=Ul(n,t),u=t%1e3;return u<0&&(u+=1e3),1e6*(_s({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:u}})-t)}function Ua(n,t){return Zn(n,Zt(t,"floor"))}function Es(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${No(Math.floor(e/60),e%60,0,0,"minute")}`}function jl(n){return Es(Nn(n,nh,"halfExpand")/6e10)}function _s({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,u=(n-s)/400,l=new Date;return l.setUTCHours(r,i,o,a),l.setUTCFullYear(s,t-1,e),l.getTime()+oh*u}function Xe(n){let t=_s(n),e=1e3*n.time.microsecond+n.time.nanosecond;return T.default.add(Qt(t),T.default.BigInt(e))}function zl(n){let t=Zt(n,"trunc"),e=T.default.toNumber(T.default.remainder(n,Pi));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 Ss(n,t){if(n==="UTC")return null;let e=Zt(t,"floor");if(e<si)return Ss(n,Qt(si));let r=Date.now(),i=Math.max(e,r)+366*Hn*3,o=e,a=Zn(n,o),s=o,u=a;for(;a===u&&o<i;){if(s=o+2*Hn*7,s>Sl)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(eu(l=>Zn(n,l),o,s,a,u))}function Va(n,t){if(n==="UTC")return null;let e=Zt(t,"ceil"),r=Date.now(),i=r+366*Hn*3;if(e>i){let l=Va(n,Qt(i));if(l===null||T.default.lessThan(l,Qt(r)))return l}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let l=Date.UTC(2088,0,1);if(l<e)return Va(n,Qt(l))}let o=e-1;if(o<si)return null;let a=Zn(n,o),s=o,u=a;for(;a===u&&o>si;){if(s=o-2*Hn*7,s<si)return null;u=Zn(n,s),a===u&&(o=s)}return a===u?null:Qt(eu(l=>Zn(n,l),s,o,u,a))}function Ul(n,t){return function(e){let r=e.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${e}`);let i=+r[0],o=+r[1],a=+r[2],s=r[3];if(s[0]==="b"||s[0]==="B")a=1-a;else if(s[0]!=="a"&&s[0]!=="A")throw new RangeError(`Unknown era ${s} in "${e}`);let u=r[4]==="24"?0:+r[4],l=+r[5],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(u)&&Number.isFinite(l)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:u,minute:l,second:h}}(Ml(n).format(t))}function bo(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function Jn(n,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[bo(n)?"leapyear":"standard"][t-1]}function wo(n){let t=[m(n,dt),m(n,ht),m(n,kt),m(n,mt),m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Oo(n){let t=["years","months","weeks","days"];for(let e=0;e<t.length;e++){let r=n[t[e]];if(r!==0)return r<0?-1:1}return 0}function Vl(n){let t=Oo(n.date);return t!==0?t:n.time.sign()}function Gn(n,t){let e=n,r=t;if(!Number.isFinite(e)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,e+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:e,month:r}}function Pt(n,t,e){let r=n,i=t,o=e;if(!Number.isFinite(o))throw new RangeError("infinity is out of range");({year:r,month:i}=Gn(r,i));let a=146097;if(Math.abs(o)>a){let l=Math.trunc(o/a);r+=400*l,o-=l*a}let s=0,u=i>2?r:r-1;for(;s=bo(u)?366:365,o<-s;)r-=1,u-=1,o+=s;for(u+=1;s=bo(u)?366:365,o>s;)r+=1,u+=1,o-=s;for(;o<1;)({year:r,month:i}=Gn(r,i-1)),o+=Jn(r,i);for(;o>Jn(r,i);)o-=Jn(r,i),{year:r,month:i}=Gn(r,i+1);return{year:r,month:i,day:o}}function vi(n,t,e,r,i,o,a,s,u){let l=An(r,i,o,a,s,u);return De(Pt(n,t,e+l.deltaDays),l)}function An(n,t,e,r,i,o){let a,s=n,u=t,l=e,h=r,p=i,y=o;({div:a,mod:y}=wr(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=wr(p,3),h+=a,p<0&&(h-=1,p+=1e3),l+=Math.trunc(h/1e3),h%=1e3,h<0&&(l-=1,h+=1e3),u+=Math.trunc(l/60),l%=60,l<0&&(u-=1,l+=60),s+=Math.trunc(u/60),u%=60,u<0&&(s-=1,u+=60);let E=Math.trunc(s/24);return s%=24,s<0&&(E-=1,s+=24),E+=0,s+=0,u+=0,l+=0,h+=0,p+=0,y+=0,{deltaDays:E,hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y}}function Uc(n,t){let e=rt(n,0);if(Oo(e)===0)return n.days;let r=m(t,ce),i=Bt(m(t,$),r,e,"constrain"),o=tr(r.year,r.month-1,r.day),a=tr(i.year,i.month-1,i.day)-o;return n.days+a}function xt(n){return new(Qe("%Temporal.Duration%"))(-m(n,dt),-m(n,ht),-m(n,kt),-m(n,mt),-m(n,pt),-m(n,ft),-m(n,gt),-m(n,yt),-m(n,vt),-m(n,Tt))}function bt(n,t,e){return Math.min(e,Math.max(t,n))}function ql(n,t,e){let r=bt(t,1,12);return{year:n,month:r,day:bt(e,1,Jn(n,r))}}function We(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function Qn(n,t,e){We(t,1,12),We(e,1,Jn(n,t))}function ar(n){er(De(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Fo(n,t,e,r,i,o){We(n,0,23),We(t,0,59),We(e,0,59),We(r,0,999),We(i,0,999),We(o,0,999)}function Ms(n,t,e,r,i,o,a,s,u){Qn(n,t,e),Fo(r,i,o,a,s,u)}function er(n){let t=Xe(n);(T.default.lessThan(t,rh)||T.default.greaterThan(t,ih))&&dn(t)}function qa(n){Xe(n)}function dn(n){if(T.default.lessThan(n,mi)||T.default.greaterThan(n,Mr))throw new RangeError("date/time value is outside of supported range")}function ks({year:n,month:t}){We(n,Pc,xc),n===Pc?We(t,4,12):n===xc&&We(t,1,9)}function Ho(n,t,e,r,i,o,a,s,u,l){let h=0,p=[n,t,e,r,i,o,a,s,u,l];for(let B=0;B<p.length;B++){let V=p[B];if(V===1/0||V===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(V!==0){let G=V<0?-1:1;if(h!==0&&G!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=G}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let y=wr(s,3),E=wr(u,6),M=wr(l,9),k=wr(1e6*y.mod+1e3*E.mod+M.mod,9).div,A=86400*r+3600*i+60*o+a+y.div+E.div+M.div+k;if(!Number.isSafeInteger(A))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function br(n){return{date:{years:m(n,dt),months:m(n,ht),weeks:m(n,kt),days:m(n,mt)},time:ke.fromComponents(m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt))}}function cn(n){let t=ke.fromComponents(m(n,pt),m(n,ft),m(n,gt),m(n,yt),m(n,vt),m(n,Tt)).add24HourDays(m(n,mt));return{date:{years:m(n,dt),months:m(n,ht),weeks:m(n,kt),days:0},time:t}}function Wl(n){let t=cn(n),e=Math.trunc(t.time.sec/86400);return Ho(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function Wt(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,u=0,l=0;switch(t){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60,l=Math.trunc(u/24),u%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,u=Math.trunc(s/60),s%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,o=Ca(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Ca(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Ca(a,9,r),a=0}return new(Qe("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*l,e*u,e*s,e*a,e*o,e*i,e*r)}function En(n,t){return Oo(n),t.sign(),{date:n,time:t}}function tr(n,t,e){return _s({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Hn}function _r({year:n,month:t,day:e}){if(Math.abs(tr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Ts(n,t){let e=t.hour-n.hour,r=t.minute-n.minute,i=t.second-n.second,o=t.millisecond-n.millisecond,a=t.microsecond-n.microsecond,s=t.nanosecond-n.nanosecond;return ke.fromComponents(e,r,i,o,a,s)}function Cs(n,t,e,r,i){let o=ke.fromEpochNsDiff(t,n);return o=Do(o,e,r,i),En({years:0,months:0,weeks:0,days:0},o)}function Kl(n,t,e,r){qa(n),qa(t);let i=Ts(n.time,t.time),o=i.sign(),a=hn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Pt(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let u=Dn("day",r),l=Hi(e,n.isoDate,s,u);return r!==u&&(i=i.add24HourDays(l.days),l.days=0),En(l,i)}function Gl(n,t,e,r,i){let o=T.default.subtract(t,n);if(T.default.equal(o,Yt))return{date:{years:0,months:0,weeks:0,days:0},time:ke.ZERO};let a=T.default.lessThan(o,Yt)?-1:1,s=Gt(e,n),u=Gt(e,t),l,h=0,p=a===1?2:1,y=Ts(s.time,u.time);for(y.sign()===-a&&h++;h<=p;h++){l=De(Pt(u.isoDate.year,u.isoDate.month,u.isoDate.day-h*a),s.time);let M=it(e,l,"compatible");if(y=ke.fromEpochNsDiff(t,M),y.sign()!==-a)break}let E=Dn("day",i);return En(Hi(r,s.isoDate,l.isoDate,E),y)}function Zl(n,t,e,r,i,o,a,s,u){let l,h,p,y,E=t;switch(s){case"year":{let O=Nn(E.date.years,a,"trunc");l=O,h=O+a*n,p={years:l,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let O=Nn(E.date.months,a,"trunc");l=O,h=O+a*n,p=rt(E.date,0,0,l),y=rt(E.date,0,0,h);break}case"week":{let O=rt(E.date,0,0),ne=Bt(o,r.isoDate,O,"constrain"),g=Hi(o,ne,Pt(ne.year,ne.month,ne.day+E.date.days),"week"),L=Nn(E.date.weeks+g.weeks,a,"trunc");l=L,h=L+a*n,p=rt(E.date,0,l),y=rt(E.date,0,h);break}case"day":{let O=Nn(E.date.days,a,"trunc");l=O,h=O+a*n,p=rt(E.date,l),y=rt(E.date,h);break}}let M=Bt(o,r.isoDate,p,"constrain"),k=Bt(o,r.isoDate,y,"constrain"),A,B,V=De(M,r.time),G=De(k,r.time);i?(A=it(i,V,"compatible"),B=it(i,G,"compatible")):(A=Xe(V),B=Xe(G));let U=ke.fromEpochNsDiff(e,A),J=ke.fromEpochNsDiff(B,A),oe=Io(u,n<0?"negative":"positive"),Te=U.add(U).abs().subtract(J.abs()).sign(),Se=Math.abs(l)/a%2==0,ie=U.isZero()?Math.abs(l):U.cmp(J)?Po(Math.abs(l),Math.abs(h),Te,Se,oe):Math.abs(h),N=new ke(T.default.add(T.default.multiply(J.totalNs,T.default.BigInt(l)),T.default.multiply(U.totalNs,T.default.BigInt(a*n)))).fdiv(J.totalNs),H=ie===Math.abs(h);return E={date:H?y:p,time:ke.ZERO},{nudgeResult:{duration:E,nudgedEpochNs:H?B:A,didExpandCalendarUnit:H},total:N}}function Yo(n,t,e,r,i,o,a,s,u){let l=n,h=an(s)||r&&s==="day",p=Vl(l)<0?-1:1,y;return h?{nudgeResult:y}=Zl(p,l,t,e,r,i,a,s,u):y=r?function(E,M,k,A,B,V,G,U){let J=M,oe=Bt(B,k.isoDate,J.date,"constrain"),Te=De(oe,k.time),Se=De(Pt(oe.year,oe.month,oe.day+E),k.time),ie=it(A,Te,"compatible"),N=it(A,Se,"compatible"),H=ke.fromEpochNsDiff(N,ie);if(H.sign()!==E)throw new RangeError("time zone returned inconsistent Instants");let O=T.default.BigInt(Tr[G]*V),ne=J.time.round(O,U),g=ne.subtract(H),L=g.sign()!==-E,c,d;return L?(c=E,ne=g.round(O,U),d=ne.addToEpochNs(N)):(c=0,d=ne.addToEpochNs(ie)),{duration:En(rt(J.date,J.date.days+c),ne),nudgedEpochNs:d,didExpandCalendarUnit:L}}(p,l,e,r,i,a,s,u):function(E,M,k,A,B,V){let G=E,U=G.time.add24HourDays(G.date.days),J=U.round(T.default.BigInt(A*Tr[B]),V),oe=J.subtract(U),{quotient:Te}=U.divmod(po),{quotient:Se}=J.divmod(po),ie=Math.sign(Se-Te)===U.sign(),N=oe.addToEpochNs(M),H=0,O=J;return vn(k)==="date"&&(H=Se,O=J.add(ke.fromComponents(24*-Se,0,0,0,0,0))),{duration:{date:rt(G.date,H),time:O},nudgedEpochNs:N,didExpandCalendarUnit:ie}}(l,t,o,a,s,u),l=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(l=function(E,M,k,A,B,V,G,U){let J=M;if(U===G)return J;let oe=ci.indexOf(G);for(let Te=ci.indexOf(U)-1;Te>=oe;Te--){let Se=ci[Te];if(Se==="week"&&G!=="week")continue;let ie;switch(Se){case"year":ie={years:J.date.years+E,months:0,weeks:0,days:0};break;case"month":{let O=J.date.months+E;ie=rt(J.date,0,0,O);break}case"week":{let O=J.date.weeks+E;ie=rt(J.date,0,O);break}}let N=De(Bt(V,A.isoDate,ie,"constrain"),A.time),H;if(H=B?it(B,N,"compatible"):Xe(N),ho(k,H)===-E)break;J={date:ie,time:ke.ZERO}}return J}(p,l,y.nudgedEpochNs,e,r,i,o,Dn(s,"day"))),l}function Vc(n,t,e,r,i,o){return an(o)||r&&o==="day"?Zl(Vl(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:di(n.time.add24HourDays(n.date.days),o)}function Jl(n,t,e,r,i,o,a){if(Ir(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:ke.ZERO};er(n),er(t);let s=Kl(n,t,e,r);return o==="nanosecond"&&i===1?s:Yo(s,Xe(t),n,null,e,r,i,o,a)}function Xl(n,t,e,r,i,o,a,s){if(vn(i)==="time")return Cs(n,t,o,a,s);let u=Gl(n,t,e,r,i);return a==="nanosecond"&&o===1?u:Yo(u,t,Gt(e,n),e,r,i,o,a,s)}function Nr(n,t,e,r,i,o){let a=kr.reduce((E,M)=>{let k=M[0],A=M[1],B=M[2];return e!=="datetime"&&B!==e||r.includes(A)||E.push(A,k),E},[]),s=It(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let u=Rr(t),l=en(t,"trunc");n==="since"&&(l=function(E){switch(E){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return E}}(l));let h=It(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=Dn(o,h);if(s==="auto"&&(s=p),Dn(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&&Ar(u,y,!1),{largestUnit:s,roundingIncrement:u,roundingMode:l,smallestUnit:h}}function qc(n,t,e,r){let i=ni(e),o=Nr(n,te(r),"time",[],"nanosecond","second"),a=Wt(Cs(m(t,se),m(i,se),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=xt(a)),a}function Wc(n,t,e,r){let i=ei(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",[],"day","day"),u=Qe("%Temporal.Duration%"),l=m(t,ce),h=m(i,ce);if(hn(l,h)===0)return new u;let p={date:Hi(o,l,h,s.largestUnit),time:ke.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let E=De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Yo(p,Xe(De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),E,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=Wt(p,"day");return n==="since"&&(y=xt(y)),y}function Kc(n,t,e,r){let i=ti(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","day"),u=Qe("%Temporal.Duration%"),l=m(t,Ae),h=m(i,Ae);if(Ir(l,h)===0)return new u;let p=Wt(Jl(l,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=xt(p)),p}function Gc(n,t,e,r){let i=Ln(e),o=Nr(n,te(r),"time",[],"nanosecond","hour"),a=Ts(m(t,He),m(i,He));a=Do(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=Wt(En({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=xt(s)),s}function Zc(n,t,e,r){let i=ri(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Nr(n,te(r),"date",["week","day"],"month","year"),u=Qe("%Temporal.Duration%");if(hn(m(t,ce),m(i,ce))==0)return new u;let l=Et(o,m(t,ce),"year-month");l.day=1;let h=Yn(o,l,"constrain"),p=Et(o,m(i,ce),"year-month");p.day=1;let y=Yn(o,p,"constrain"),E={date:rt(Hi(o,h,y,s.largestUnit),0,0),time:ke.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let k=De(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});E=Yo(E,Xe(De(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),k,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let M=Wt(E,"day");return n==="since"&&(M=xt(M)),M}function Jc(n,t,e,r){let i=ii(e),o=m(t,$),a=m(i,$);if(!un(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Nr(n,te(r),"datetime",[],"nanosecond","hour"),u=m(t,se),l=m(i,se),h=Qe("%Temporal.Duration%"),p;if(vn(s.largestUnit)!=="date")p=Wt(Cs(u,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,_e);if(!Yl(y,m(i,_e)))throw new RangeError("When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.");if(T.default.equal(u,l))return new h;p=Wt(Xl(u,l,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=xt(p)),p}function Cr({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,u=o;return s+=a.sec,u+=a.subsec,An(n,t,s,r,i,u)}function Wa(n,t){let e=t.addToEpochNs(n);return dn(e),e}function oi(n,t,e,r,i="constrain"){if(Oo(r.date)===0)return Wa(n,r.time);let o=Gt(t,n);return Wa(it(t,De(Bt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function Xc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=Dn(yn(t),yn(r));if(an(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=cn(t),a=cn(r);return Wt(En({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function Qc(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=yn(r);if(vn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=cn(r);return Xt(Wa(m(t,se),o.time))}function el(n,t,e,r){let i=m(t,$),o=Kt(e);n==="subtract"&&(o=xt(o));let a=Wl(o),s=ve(te(r));return wt(Bt(i,m(t,ce),a,s),i)}function tl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,$),s=cn(i),u=m(t,Ae),l=Cr(u.time,s.time),h=rt(s.date,l.deltaDays);return Ho(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),qt(De(Bt(a,u.isoDate,h,o),l),a)}function nl(n,t,e){let r=Kt(e);n==="subtract"&&(r=xt(r));let i=cn(r),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Cr(m(t,He),i.time);return bn(Lo(o,a,s,u,l,h,"reject"))}function rl(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=wo(i),s=m(t,$),u=Et(s,m(t,ce),"year-month");u.day=1;let l=Yn(s,u,"constrain");if(a<0){let p=Bt(s,l,{months:1},"constrain");l=Pt(p.year,p.month,p.day-1)}let h=Wl(i);return ar(l),Er(fi(s,Et(s,Bt(s,l,h,o),"year-month"),o),s)}function il(n,t,e,r){let i=Kt(e);n==="subtract"&&(i=xt(i));let o=ve(te(r)),a=m(t,_e),s=m(t,$),u=br(i);return nt(oi(m(t,se),a,s,u,o),a,s)}function Nn(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,u=Ct(Math.abs(2*i)-t),l=a%2==0,h=Io(e,o),p=i===0?a:Po(a,s,u,l,h);return t*(o==="positive"?p:-p)}function Ka(n,t,e,r){let i=Tr[e]*t;return function(o,a,s){let u=gn(o),l=gn(a),h=T.default.divide(u,l),p=T.default.remainder(u,l),y=Io(s,"positive"),E,M;T.default.lessThan(u,Yt)?(E=T.default.subtract(h,hi),M=h):(E=h,M=T.default.add(h,hi));let k=ho(Kn(T.default.multiply(p,bs)),l)*(T.default.lessThan(u,Yt)?-1:1)+0,A=T.default.equal(p,Yt)?h:Po(E,M,k,cl(E),y);return T.default.multiply(A,l)}(n,T.default.BigInt(i),r)}function Ga(n,t,e,r){qa(n);let{year:i,month:o,day:a}=n.isoDate,s=Za(n.time,t,e,r);return De(Pt(i,o,a+s.deltaDays),s)}function Za({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,u){let l;switch(s){case"day":case"hour":l=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":l=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":l=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":l=1e3*(1e3*r+i)+o;break;case"microsecond":l=1e3*i+o;break;case"nanosecond":l=o}let h=Tr[s],p=Nn(l,h*a,u)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return An(p,0,0,0,0,0);case"minute":return An(n,p,0,0,0,0);case"second":return An(n,t,p,0,0,0);case"millisecond":return An(n,t,e,p,0,0);case"microsecond":return An(n,t,e,r,p,0);case"nanosecond":return An(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function Do(n,t,e,r){let i=Tr[e];return n.round(T.default.BigInt(i*t),r)}function di(n,t){let e=Tr[t];return n.fdiv(T.default.BigInt(e))}function hn(n,t){return n.year!==t.year?Ct(n.year-t.year):n.month!==t.month?Ct(n.month-t.month):n.day!==t.day?Ct(n.day-t.day):0}function Ja(n,t){return n.hour!==t.hour?Ct(n.hour-t.hour):n.minute!==t.minute?Ct(n.minute-t.minute):n.second!==t.second?Ct(n.second-t.second):n.millisecond!==t.millisecond?Ct(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Ct(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Ct(n.nanosecond-t.nanosecond):0}function Ir(n,t){let e=hn(n.isoDate,t.isoDate);return e!==0?e:Ja(n.time,t.time)}function Ql(n){let t=Eo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function Zt(n,t){let e=gn(n),{quotient:r,remainder:i}=Xr(e,Pi),o=T.default.toNumber(r);return t==="floor"&&T.default.toNumber(i)<0&&(o-=1),t==="ceil"&&T.default.toNumber(i)>0&&(o+=1),o}function Qt(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return T.default.multiply(T.default.BigInt(n),Pi)}function Eo(n){let t=n;if(typeof n=="object"){let e=n[Symbol.toPrimitive];e&&typeof e=="function"&&(t=e.call(n,"number"))}if(typeof t=="number")throw new TypeError("cannot convert number to bigint");return typeof t=="bigint"?T.default.BigInt(t.toString(10)):T.default.BigInt(t)}var Xa=(()=>{let n=T.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=T.default.BigInt(t),r=T.default.add(Qt(t),n);return n=T.default.remainder(e,Pi),T.default.greaterThan(r,Mr)?Mr:T.default.lessThan(r,mi)?mi:r}})();function Zr(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Ct(n){return n<0?-1:n>0?1:n}function te(n){if(n===void 0)return Object.create(null);if(Ye(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function nr(n,t){let e=Object.create(null);return e[n]=t,e}function _n(n,t,e,r){let i=n[t];if(i!==void 0){if(i=Ro(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===Mn)throw new RangeError(`${t} option is required`);return r}function St(n){let t=bi(n);if(!ah.includes(bi(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function bi(n){let t="";for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function jn(n){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${n==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${n}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}var mh=new RegExp(`^${El.source}$`),ph=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function eu(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,u=i;for(;a-o>1;){let l=Math.trunc((o+a)/2),h=n(l);h===s?(o=l,s=h):h===u&&(a=l,u=h)}return a}function tu(n){return[...n]}function nu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=ji[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),u=e.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=u&&++p,p==0)p=function(y,E,M,k){let A=(k-y-M+1)%7;A<0&&(A+=7);let B=Math.floor((M+A-1)/7);return 7-A>=E&&++B,B}(s,u,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let y=(l+a-o)%7;y<0&&(y+=7),6-y>=u&&o+7-l>a&&(p=1,r++)}return{week:p,year:r}}function ol(n,t,e,r,i){if(t!==i.year){if(n*(t-i.year)>0)return!0}else if(e!==i.month){if(n*(e-i.month)>0)return!0}else if(r!==i.day&&n*(r-i.day)>0)return!0;return!1}var ji={};function rr(n){if(!n.startsWith("M"))throw new RangeError(`Invalid month code: ${n}. Month codes must start with M.`);let t=+n.slice(1);if(Number.isNaN(t))throw new RangeError(`Invalid month code: ${n}`);return t}function ln(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Is(n,t=void 0,e=12){let{month:r,monthCode:i}=n;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");t==="reject"&&We(r,1,e),t==="constrain"&&(r=bt(r,1,e)),i=ln(r)}else{let o=rr(i);if(i!==ln(o))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==o)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=o,r<1||r>e)throw new RangeError(`Invalid monthCode: ${i}`)}return{...n,month:r,monthCode:i}}ji.iso8601={resolveFields(n,t){if((t==="date"||t==="year-month")&&n.year===void 0)throw new TypeError("year is required");if((t==="date"||t==="month-day")&&n.day===void 0)throw new TypeError("day is required");Object.assign(n,Is(n))},dateToISO:(n,t)=>li(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=li(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return tu(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:u}=n;return a+=t,s+=e,{year:a,month:s}=Gn(a,s),{year:a,month:s,day:u}=li(a,s,u,o),u+=i+7*r,Pt(a,s,u)},dateUntil(n,t,e){let r=-hn(n,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,o=0,a=0;if(e==="year"||e==="month"){let h=t.year-n.year;for(h!==0&&(h-=r);!ol(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=Gn(n.year+o,n.month+p);!ol(r,i.year,i.month,n.day,t);)a=p,p+=r,i=Gn(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=Gn(n.year+o,n.month+a);let s=ql(i.year,i.month,n.day),u=0,l=tr(t.year,t.month-1,t.day)-tr(s.year,s.month-1,s.day);return e==="week"&&(u=Math.trunc(l/7),l%=7),{years:o,months:a,weeks:u,days:l}},isoToDate({year:n,month:t,day:e},r){let i={era:void 0,eraYear:void 0,year:n,month:t,day:e,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=ln(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),u=a-100*s,l=(e+Math.floor(2.6*o-.2)+(u+Math.floor(u/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=l+(l<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=Jn(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=nu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=Jn(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=bo(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Ft=class n{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let e=0;for(let r of t.map.entries()){if(++e>n.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(t){let e=this.map.get(t);return e&&(this.hits++,this.report()),this.calls++,e}set(t,e){this.map.set(t,e),this.misses++,this.report()}report(){}setObject(t){if(n.objectMap.get(t))throw new RangeError("object already cached");n.objectMap.set(t,this),this.report()}static getCacheForObject(t){let e=n.objectMap.get(t);return e||(e=new n,n.objectMap.set(t,e)),e}};function ru({isoYear:n,isoMonth:t,isoDay:e}){return`${Bi(n)}-${jt(t)}-${jt(e)}T00:00Z`}function xa(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Ft.objectMap=new WeakMap,Ft.MAX_CACHE_ENTRIES=1e3;var kn=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:"numeric",month:"numeric",year:"numeric",era:"short",timeZone:"UTC"})),this.formatter}getCalendarParts(t){let e=this.getFormatter(),r=new Date(t);if(t==="-271821-04-19T00:00Z"){let i=e.resolvedOptions();e=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return e.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${t}`)}}isoToCalendarDate(t,e){let{year:r,month:i,day:o}=t,a=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:o,id:this.id}),s=e.get(a);if(s)return s;let u=ru({isoYear:r,isoMonth:i,isoDay:o}),l=this.getCalendarParts(u),h={};for(let y=0;y<l.length;y++){let{type:E,value:M}=l[y];if(E!=="year"&&E!=="relatedYear"||(this.hasEra?h.eraYear=+M:h.year=+M),E==="month"){let k=/^([0-9]*)(.*?)$/.exec(M);if(!k||k.length!=3||!k[1]&&!k[2])throw new RangeError(`Unexpected month: ${M}`);if(h.month=k[1]?+k[1]:1,h.month<1)throw new RangeError(`Invalid month ${M} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${M} from ${u}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);k[2]&&(h.monthExtra=k[2])}E==="day"&&(h.day=+M),this.hasEra&&E==="era"&&M!=null&&M!==""&&(h.era=M.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(E=>h.era===E.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:E}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=E}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 E=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(E,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:u}=o;return{month:s,monthCode:u}=Is(o,r,a),{...o,month:s,monthCode:u}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?(We(o,1,i),We(a,1,this.maximumMonthLength(t))):(o=bt(o,1,i),a=bt(a,1,this.maximumMonthLength({...t,month:o}))),{...t,month:o,day:a}}calendarToIsoDate(t,e="constrain",r){let i=t,o=this.adjustCalendarDate(t,r,e,!1);o=this.regulateMonthDayNaive(o,e,r);let{year:a,month:s,day:u}=o,l=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:u,overflow:e,id:this.id}),h,p=r.get(l);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:u}),E=V=>{let G=this.addDaysIso(y,V);if(o.day>this.minimumMonthLength(o)){let U=this.isoToCalendarDate(G,r);for(;U.month!==s||U.year!==a;){if(e==="reject")throw new RangeError(`day ${u} does not exist in month ${s} of year ${a}`);G=this.addDaysIso(G,-1),U=this.isoToCalendarDate(G,r)}}return G},M=0,k=this.isoToCalendarDate(y,r),A=xa(o,k);if(A.years!==0||A.months!==0||A.days!==0){let V=365*A.years+30*A.months+A.days;y=this.addDaysIso(y,V),k=this.isoToCalendarDate(y,r),A=xa(o,k),A.years===0&&A.months===0?y=E(A.days):M=this.compareCalendarDates(o,k)}let B=8;for(;M;){y=this.addDaysIso(y,M*B);let V=k;k=this.isoToCalendarDate(y,r);let G=M;if(M=this.compareCalendarDates(o,k),M){if(A=xa(o,k),A.years===0&&A.months===0)y=E(A.days),M=0;else if(G&&M!==G)if(B>1)B/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(k,V)>0&&(y=this.addDaysIso(y,-1)),M=0}}}if(r.set(l,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?Ct(t.year-e.year):t.month!==e.month?Ct(t.month-e.month):t.day!==e.day?Ct(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 Pt(t.year,t.month,t.day+e)}addDaysCalendar(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.addDaysIso(i,e);return this.isoToCalendarDate(o,r)}addMonthsCalendar(t,e,r,i){let o=t,{day:a}=o;for(let s=0,u=Math.abs(e);s<u;s++){let{month:l}=o,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),E=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(E,i),e>0){let M=this.monthsInYear(h,i);for(;o.month-1!=l%M;)E=this.addDaysIso(E,-1),o=this.isoToCalendarDate(E,i)}o.day!==a&&(o=this.regulateDate({...o,day:a},"constrain",i))}if(r==="reject"&&o.day!==a)throw new RangeError(`Day ${a} does not exist in resulting calendar month`);return o}addCalendar(t,{years:e=0,months:r=0,weeks:i=0,days:o=0},a,s){let{year:u,day:l,monthCode:h}=t,p=this.adjustCalendarDate({year:u+e,monthCode:h,day:l},s),y=this.addMonthsCalendar(p,r,a,s),E=o+7*i;return this.addDaysCalendar(y,E,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,u=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let l=this.calendarDaysUntil(t,e,i);o=l%7,a=(l-o)/7;break}case"month":case"year":{let l=this.compareCalendarDates(e,t);if(!l)return{years:0,months:0,weeks:0,days:0};let h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let M=0;e.monthCode>t.monthCode&&(M=1),e.monthCode<t.monthCode&&(M=-1),M||(M=Math.sign(p)),u=M*l<0?h-l:h}let y,E=u?this.addCalendar(t,{years:u},"constrain",i):t;do s+=l,y=E,E=this.addMonthsCalendar(y,l,"constrain",i),E.day!==t.day&&(E=this.regulateDate({...E,day:t.day},"constrain",i));while(this.compareCalendarDates(e,E)*l>=0);s-=l,o=this.calendarDaysUntil(y,e,i);break}}return{years:u,months:s,weeks:a,days:o}}daysInMonth(t,e){let{day:r}=t,i=this.maximumMonthLength(t),o=this.minimumMonthLength(t);if(o===i)return o;let a=r<=i-o?i:o,s=this.calendarToIsoDate(t,"constrain",e),u=this.addDaysIso(s,a),l=this.isoToCalendarDate(u,e),h=this.addDaysIso(u,-l.day);return this.isoToCalendarDate(h,e).day}daysInPreviousMonth(t,e){let{day:r,month:i,year:o}=t,a={year:i>1?o:o-1,month:i,day:1},s=i>1?i-1:this.monthsInYear(a,e);a={...a,month:s};let u=this.minimumMonthLength(a),l=this.maximumMonthLength(a);if(u===l)return l;let h=this.calendarToIsoDate(t,"constrain",e),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 tr(o.year,o.month-1,o.day)-tr(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,u,{era:l,eraYear:h,year:p,month:y,monthCode:E,day:M}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||l===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(E===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:E,day:M}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let k={year:this.monthDaySearchStartYear(E,M),month:12,day:31},A=this.isoToCalendarDate(k,r),B=A.monthCode>E||A.monthCode===E&&A.day>=M?A.year:A.year-1;for(let V=0;V<20;V++){let G=this.adjustCalendarDate({day:M,monthCode:E,year:B-V},r),U=this.calendarToIsoDate(G,"constrain",r),J=this.isoToCalendarDate(U,r);if({year:i,month:o,day:a}=U,J.monthCode===E&&J.day===M)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(J.monthCode);if(J.monthCode===E&&J.day===oe&&M>oe)return{month:o,day:a,year:i};(s===void 0||J.monthCode===s.monthCode&&J.day>s.day)&&(s=J,u=U)}}if(e==="constrain"&&u!==void 0)return u;throw new RangeError(`No recent ${this.id} year with monthCode ${E} and day ${M}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},Qa=class extends kn{constructor(){super(...arguments),this.id="hebrew",this.calendarType="lunisolar",this.months={Tishri:{leap:1,regular:1,monthCode:"M01",days:30},Heshvan:{leap:2,regular:2,monthCode:"M02",days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:"M03",days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:"M04",days:29},Shevat:{leap:5,regular:5,monthCode:"M05",days:30},Adar:{leap:void 0,regular:6,monthCode:"M06",days:29},"Adar I":{leap:6,regular:void 0,monthCode:"M05L",days:30},"Adar II":{leap:7,regular:void 0,monthCode:"M06",days:29},Nisan:{leap:8,regular:7,monthCode:"M07",days:30},Iyar:{leap:9,regular:8,monthCode:"M08",days:29},Sivan:{leap:10,regular:9,monthCode:"M09",days:30},Tamuz:{leap:11,regular:10,monthCode:"M10",days:29},Av:{leap:12,regular:11,monthCode:"M11",days:30},Elul:{leap:13,regular:12,monthCode:"M12",days:29}}}inLeapYear(t){let{year:e}=t;return(7*e+1)%19<7}monthsInYear(t){return this.inLeapYear(t)?13:12}minimumMonthLength(t){return this.minMaxMonthLength(t,"min")}maximumMonthLength(t){return this.minMaxMonthLength(t,"max")}minMaxMonthLength(t,e){let{month:r,year:i}=t,o=this.getMonthCode(i,r),a=Object.entries(this.months).find(u=>u[1].monthCode===o);if(a===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let s=a[1].days;return typeof s=="number"?s:s[e]}maxLengthOfMonthCodeInAnyYear(t){return["M04","M06","M08","M10","M12"].includes(t)?29:30}estimateIsoDate(t){let{year:e}=t;return{year:e-3760,month:1,day:1}}getMonthCode(t,e){return this.inLeapYear({year:t})?e===6?ln(5,!0):ln(e<6?e:e-1):ln(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:u,monthExtra:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(l){let h=this.months[l];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${l}`);a=this.inLeapYear({year:o})?h.leap:h.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:u,monthCode:s}}if(this.validateCalendarDate(t),a===void 0)if(s.endsWith("L")){if(s!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);if(a=6,!this.inLeapYear({year:o})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${o} which is not a leap year`);a=6,s="M06"}}else{a=rr(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(We(a,1,this.monthsInYear({year:o})),We(u,1,this.maximumMonthLength({year:o,month:a}))):(a=bt(a,1,this.monthsInYear({year:o})),u=bt(u,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:u,month:a,monthCode:s,year:o}}},$n=class extends kn{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(t,e){let r={year:t.year,month:1,monthCode:"M01",day:1},i={year:t.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,e)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:Math.floor(e*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},es=class extends $n{constructor(){super(...arguments),this.id="islamic"}},ts=class extends $n{constructor(){super(...arguments),this.id="islamic-umalqura"}},ns=class extends $n{constructor(){super(...arguments),this.id="islamic-tbla"}},rs=class extends $n{constructor(){super(...arguments),this.id="islamic-civil"}},is=class extends $n{constructor(){super(...arguments),this.id="islamic-rgsa"}},os=class extends $n{constructor(){super(...arguments),this.id="islamicc"}},as=class extends kn{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(t,e){return this.daysInMonth({year:t.year,month:12,day:1},e)===30}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===12?29:e<=6?31:30}maximumMonthLength(t){let{month:e}=t;return e===12?30:e<=6?31:30}maxLengthOfMonthCodeInAnyYear(t){return rr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},ss=class extends kn{constructor(){super(...arguments),this.id="indian",this.calendarType="solar",this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date("0000-01-01T00:00Z").toLocaleDateString("en-US-u-ca-indian",{timeZone:"UTC"})!=="10/11/-79 Saka"}inLeapYear(t){return Ps(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=rr(t),r=this.months[e];return r=r.leap??r,r.length}getMonthInfo(t){let{month:e}=t,r=this.months[e];if(r===void 0)throw new RangeError(`Invalid month: ${e}`);return this.inLeapYear(t)&&r.leap&&(r=r.leap),r}estimateIsoDate(t){let e=this.adjustCalendarDate(t),r=this.getMonthInfo(e);return Pt(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 Ps(n){return n%4==0&&(n%100!=0||n%400==0)}var _o=class extends kn{constructor(t,e){super(),this.calendarType="solar",this.id=t,this.isoEpoch=e}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Ps(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return li(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},So=class extends kn{constructor(t,e){super(),this.hasEra=!0,this.calendarType="solar",this.id=t;let{eras:r,anchorEra:i}=function(o){let a,s=o;if(s.length===0)throw new RangeError("Invalid era data: eras are required");if(s.length===1&&s[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(s.length===1&&!s[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(s.filter(l=>l.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(l=>{if(l.isAnchor||!l.anchorEpoch&&!l.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=l,l.anchorEpoch={year:l.hasYearZero?0:1}}else if(!l.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(l=>l.code),s.forEach(l=>{let{reverseOf:h}=l;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);l.reverseOf=p,l.anchorEpoch=p.anchorEpoch,l.isoEpoch=p.isoEpoch}l.anchorEpoch.month===void 0&&(l.anchorEpoch.month=1),l.anchorEpoch.day===void 0&&(l.anchorEpoch.day=1)}),s.sort((l,h)=>{if(l.reverseOf)return 1;if(h.reverseOf)return-1;if(!l.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.isoEpoch.year-l.isoEpoch.year});let u=s[s.length-1].reverseOf;if(u&&u!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((l,h)=>{l.genericName="era"+(s.length-1-h)}),{eras:s,anchorEra:a||s[0]}}(e);this.anchorEra=i,this.eras=r}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Ps(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][rr(t)-1]}completeEraYear(t){let e=(s,u,l)=>{let h=t[s];if(h!=null&&h!=u&&!(l||[]).includes(h)){let p=l?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${u} (also called ${p})`:u}`)}},r=s=>{let u,l={...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 u=p.anchorEpoch.year-s,!0}return u=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(l,p.anchorEpoch)>=0&&(u=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:u,era:h.code,eraNames:h.names}},{year:i,eraYear:o,era:a}=t;if(i!=null){let s=r(i);({eraYear:o,era:a}=s),e("era",a,s?.eraNames),e("eraYear",o)}else{if(o==null)throw new RangeError("Either year or eraYear and era are required");{if(a===void 0)throw new RangeError("era and eraYear must be provided together");let s=this.eras.find(({code:u,names:l=[]})=>u===a||l.includes(a));if(!s)throw new RangeError(`Era ${a} (ISO year ${o}) was not matched by any era`);i=s.reverseOf?s.anchorEpoch.year-o:o+s.anchorEpoch.year-(s.hasYearZero?0:1),e("year",i),{eraYear:o,era:a}=r(i)}}return{...t,year:i,eraYear:o,era:a}}adjustCalendarDate(t,e,r="constrain"){let i=t,{month:o,monthCode:a}=i;return o===void 0&&(i={...i,month:rr(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return li(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},wi=class extends So{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=ln(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},sn={inLeapYear(n){let{year:t}=n;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(n){let{month:t}=n;return t===13?this.inLeapYear(n)?6:5:30},maximumMonthLength(n){return this.minimumMonthLength(n)},maxLengthOfMonthCodeInAnyYear:n=>n==="M13"?6:30},cs=class extends _o{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},Mo=class extends So{constructor(t,e){super(t,e),this.inLeapYear=sn.inLeapYear,this.monthsInYear=sn.monthsInYear,this.minimumMonthLength=sn.minimumMonthLength,this.maximumMonthLength=sn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=sn.maxLengthOfMonthCodeInAnyYear}},ls=class extends cs{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},us=class extends Mo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},ds=class extends Mo{constructor(){super("ethiopic",[{code:"ethioaa",names:["ethiopic-amete-alem","mundi"],isoEpoch:{year:-5492,month:7,day:17}},{code:"ethiopic",names:["incar"],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},hs=class extends wi{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},ms=class extends _o{constructor(){super("buddhist",{year:-543,month:1,day:1})}},ps=class extends wi{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(t){let{era:e,eraYear:r}=t;return e==="b"&&(e="gregory-inverse"),e==="a"&&(e="gregory"),{era:e,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},fs=class extends wi{constructor(){super("japanese",[{code:"reiwa",isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:"heisei",isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:"showa",isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:"taisho",isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:"meiji",isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:"japanese",names:["japanese","gregory","ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"japanese-inverse",names:["japanese-inverse","gregory-inverse","bc","bce"],reverseOf:"japanese"}]),this.erasBeginMidYear=!0}reviseIntlEra(t,e){let{era:r,eraYear:i}=t,{year:o}=e;return this.eras.find(a=>a.code===r)?{era:r,eraYear:i}:o<1?{era:"japanese-inverse",eraYear:1-o}:{era:"japanese",eraYear:o}}},ko=class extends kn{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(t,e){let r=this.getMonthList(t.year,e);return Object.entries(r).length===13}monthsInYear(t,e){return this.inLeapYear(t,e)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(t){return["M01L","M09L","M10L","M11L","M12L"].includes(t)?29:30}monthDaySearchStartYear(t,e){let r={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[t]??[1972,1972];return e<30?r[0]:r[1]}getMonthList(t,e){if(t===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:t,id:this.id}),i=e.get(r);if(i)return i;let o=this.getFormatter(),a=(A,B)=>{let V=ru({isoYear:A,isoMonth:2,isoDay:1}),G=new Date(V);G.setUTCDate(B+1);let U=o.formatToParts(G),J=U.find(ie=>ie.type==="month").value,oe=+U.find(ie=>ie.type==="day").value,Te=U.find(ie=>ie.type==="relatedYear"),Se;if(Te===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Se=+Te.value,{calendarMonthString:J,calendarDay:oe,calendarYearToVerify:Se}},s=17,{calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s);u!=="1"&&(s+=29,{calendarMonthString:u,calendarDay:l}=a(t,s)),s-=l-5;let p={},y,E,M=1,k=!1;do({calendarMonthString:u,calendarDay:l,calendarYearToVerify:h}=a(t,s)),y&&(p[E].daysInMonth=y+30-l),h!==t?k=!0:(p[u]={monthIndex:M++},s+=30),y=l,E=u;while(!k);return p[E].daysInMonth=y+30-l,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:u,monthCode:l}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(s&&s!=="bis")throw new RangeError(`Unexpected leap month suffix: ${s}`);let h=ln(a,s!==void 0),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:u,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&l.endsWith("L")&&l!="M13L"&&r==="constrain"){let E=+l.replace(/^M0?|L$/g,"");y=h[E],y&&(a=y.monthIndex,l=ln(E))}if(a===void 0)throw new RangeError(`Unmatched month ${l} in Chinese year ${o}`)}else if(l===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(We(a,1,y),We(u,1,this.maximumMonthLength())):(a=bt(a,1,y),u=bt(u,1,this.maximumMonthLength()));let E=p.find(M=>M[1].monthIndex===a);if(E===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);l=ln(+E[0].replace("bis",""),E[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=l.replace(/^M|L$/g,E=>E==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(!y)throw new RangeError(`Unmatched monthCode ${l} in Chinese year ${o}`);if(a!==y.monthIndex)throw new RangeError(`monthCode ${l} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:l,day:u}}},gs=class extends ko{constructor(){super(...arguments),this.id="chinese"}},ys=class extends ko{constructor(){super(...arguments),this.id="dangi"}},vs=class{constructor(t){this.helper=t}extraFields(t){return this.helper.hasEra&&t.includes("year")?["era","eraYear"]:[]}resolveFields(t){if(this.helper.calendarType!=="lunisolar"){let e=new Ft;Is(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Ft,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Ft,i=this.helper.monthDayFromFields(t,e,r);return r.setObject(i),i}fieldKeysToIgnore(t){let e=new Set;for(let r=0;r<t.length;r++){let i=t[r];switch(e.add(i),i){case"era":e.add("eraYear"),e.add("year");break;case"eraYear":e.add("era"),e.add("year");break;case"year":e.add("era"),e.add("eraYear");break;case"month":e.add("monthCode"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"monthCode":e.add("month"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"day":this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"))}}return tu(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Ft.getCacheForObject(t),u=this.helper.isoToCalendarDate(t,s),l=this.helper.addCalendar(u,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(l,"constrain",s);return Ft.getCacheForObject(h)||new Ft(s).setObject(h),h}dateUntil(t,e,r){let i=Ft.getCacheForObject(t),o=Ft.getCacheForObject(e),a=this.helper.isoToCalendarDate(t,i),s=this.helper.isoToCalendarDate(e,o);return this.helper.untilCalendar(a,s,r,i)}isoToDate(t,e){let r=Ft.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=ji.iso8601.isoToDate(t,{dayOfWeek:!0}).dayOfWeek),e.dayOfYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.calendarDaysUntil(o,i,r);i.dayOfYear=a+1}if(e.weekOfYear&&(i.weekOfYear=nu(this.helper.id,t)),i.daysInWeek=7,e.daysInMonth&&(i.daysInMonth=this.helper.daysInMonth(i,r)),e.daysInYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.addCalendar(o,{years:1},"constrain",r);i.daysInYear=this.helper.calendarDaysUntil(o,a,r)}return e.monthsInYear&&(i.monthsInYear=this.helper.monthsInYear(i,r)),e.inLeapYear&&(i.inLeapYear=this.helper.inLeapYear(i,r)),i}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let n of[Qa,as,ds,ls,us,gs,ys,hs,ss,ms,ps,fs,es,ts,ns,rs,is,os]){let t=new n;ji[t.id]=new vs(t)}Ha("calendarImpl",function(n){return ji[n]});var Di=Intl.DateTimeFormat;function fr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Di(m(n,vl),e(m(n,La))),function(r,i,o){let a=Co(r);if(a===void 0)throw new TypeError("Missing slots for the given container");if(a[i]===void 0)throw new TypeError(`tried to reset ${i} which was not set`);a[i]=o}(n,t,e)),e}function Jr(n){return _t(n,or)}var ir=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(E){if(E==null)throw new TypeError(`Expected object not ${E}`);return Object(E)}(o);let y=Object.create(null);for(let E=0;E<p.length;E++){let M=p[E];Object.prototype.hasOwnProperty.call(s,M)&&(y[M]=s[M])}s=y}else s=Object.create(null);let u=new Di(i,s),l=u.resolvedOptions();if(Tn(r),a){let p=Object.assign(Object.create(null),l);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,me(r,La,p)}else me(r,La,s);me(r,vl,l.locale),me(r,or,u),me(r,vr,l.timeZone),me(r,Qr,l.calendar),me(r,hl,_h),me(r,ml,Dh),me(r,pl,Eh),me(r,fl,wh),me(r,gl,Sh),me(r,yl,Mh);let h=a?s.timeZone:void 0;if(h===void 0)me(r,Aa,l.timeZone);else{let p=Ro(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");me(r,Aa,Dt(p))}})(this,t,e)}get format(){P(this,Jr);let t=gh.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 P(this,Jr),vh.call(this,t,e)}formatToParts(t,...e){return P(this,Jr),yh.call(this,t,...e)}formatRangeToParts(t,e){return P(this,Jr),bh.call(this,t,e)}resolvedOptions(){return P(this,Jr),fh.call(this)}};"formatToParts"in Di.prototype||delete ir.prototype.formatToParts,"formatRangeToParts"in Di.prototype||delete ir.prototype.formatRangeToParts;var $t=function(n=void 0,t=void 0){return new ir(n,t)};function fh(){let n=m(this,or).resolvedOptions();return n.timeZone=m(this,Aa),n}function gh(n,...t){let e,r,i=Pr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.format(...r)}function yh(n,...t){let e,r,i=Pr(n,this);return i.formatter?(e=i.formatter,r=[Zt(i.epochNs,"floor")]):(e=m(this,or),r=[n,...t]),e.formatToParts(...r)}function vh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Sn(e)!==Sn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(Sn(e)){if(!iu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=Pr(e,this),{epochNs:u,formatter:l}=Pr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRange(...o)}function bh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=To(n),r=To(t),i,o=[e,r];if(Sn(e)!==Sn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(Sn(e)){if(!iu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=Pr(e,this),{epochNs:u,formatter:l}=Pr(r,this);s&&(i=s,o=[Zt(a,"floor"),Zt(u,"floor")])}return i||(i=m(this,or)),i.formatRangeToParts(...o)}function zi(n={},t={}){let e=Object.assign({},n),r=["year","month","day","hour","minute","second","weekday","dayPeriod","timeZoneName","dateStyle","timeStyle"];for(let i=0;i<r.length;i++){let o=r[i];e[o]=o in t?t[o]:e[o],e[o]!==!1&&e[o]!==void 0||delete e[o]}return e}function wh(n){let t=zi(n,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!=="long"&&t.timeStyle!=="full"||(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"})),!Bo(t)){if(Ui(n))throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(n)}]`);Object.assign(t,{hour:"numeric",minute:"numeric",second:"numeric"})}return t}function Dh(n){let t={short:{year:"2-digit",month:"numeric"},medium:{year:"numeric",month:"short"},long:{year:"numeric",month:"long"},full:{year:"numeric",month:"long"}},e=zi(n,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("year"in e||"month"in e||"era"in e)){if(Ui(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Eh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=zi(n,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("month"in e)&&!("day"in e)){if(Ui(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function _h(n){let t=zi(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function Sh(n){let t=zi(n,{timeZoneName:!1});if((t.timeStyle==="long"||t.timeStyle==="full")&&(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"}),t.dateStyle)&&(Object.assign(t,{short:{year:"numeric",month:"numeric",day:"numeric"},medium:{year:"numeric",month:"short",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{year:"numeric",month:"long",day:"numeric",weekday:"long"}}[t.dateStyle]),delete t.dateStyle),!Bo(t)&&!$o(t)){if(Ui(n))throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}return t}function Mh(n){let t=n;return Bo(t)||$o(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function $o(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function Bo(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function Ui(n){return $o(n)||Bo(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function Sn(n){return Fe(n)||Be(n)||Pe(n)||pe(n)||Je(n)||Ht(n)||Ze(n)}function To(n){return Sn(n)?n:xo(n)}function iu(n,t){return!(!Sn(n)||!Sn(t)||Be(n)&&!Be(t)||Fe(n)&&!Fe(t)||Pe(n)&&!Pe(t)||pe(n)&&!pe(t)||Je(n)&&!Je(t)||Ht(n)&&!Ht(t)||Ze(n)&&!Ze(t))}function Pr(n,t){if(Be(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,He)};return{epochNs:it(m(t,vr),e,"compatible"),formatter:fr(t,fl)}}if(Je(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,ml)}}if(Ht(n)){let e=m(n,$),r=m(t,Qr);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,pl)}}if(Fe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=De(m(n,ce),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,hl)}}if(Pe(n)){let e=m(n,$),r=m(t,Qr);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Ae);return{epochNs:it(m(t,vr),i,"compatible"),formatter:fr(t,gl)}}if(pe(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return Ze(n)?{epochNs:m(n,se),formatter:fr(t,yl)}:{}}function ou(n){let t=Object.create(null);return t.years=m(n,dt),t.months=m(n,ht),t.weeks=m(n,kt),t.days=m(n,mt),t.hours=m(n,pt),t.minutes=m(n,ft),t.seconds=m(n,gt),t.milliseconds=m(n,yt),t.microseconds=m(n,vt),t.nanoseconds=m(n,Tt),t}ir.prototype.constructor=$t,Object.defineProperty($t,"prototype",{value:ir.prototype,writable:!1,enumerable:!1,configurable:!1}),$t.supportedLocalesOf=Di.supportedLocalesOf,Cn($t,"Intl.DateTimeFormat");var{format:kh,formatToParts:Th}=Intl.DurationFormat?.prototype??Object.create(null);function xs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ou(Kt(n));return kh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=xs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ou(Kt(n));return Th.call(this,t)});var Tm=Object.freeze({__proto__:null,DateTimeFormat:$t,ModifiedIntlDurationFormatPrototypeFormat:xs}),Ei=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");Fl(this,Eo(t))}get epochMilliseconds(){return P(this,Ze),Zt(m(this,se),"floor")}get epochNanoseconds(){return P(this,Ze),Ql(T.default.BigInt(m(this,se)))}add(t){return P(this,Ze),Qc("add",this,t)}subtract(t){return P(this,Ze),Qc("subtract",this,t)}until(t,e=void 0){return P(this,Ze),qc("until",this,t,e)}since(t,e=void 0){return P(this,Ze),qc("since",this,t,e)}round(t){if(P(this,Ze),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Mn);return Ar(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),Xt(Ka(m(this,se),r,o,i))}equals(t){P(this,Ze);let e=ni(t),r=m(this,se),i=m(e,se);return T.default.equal(T.default.BigInt(r),T.default.BigInt(i))}toString(t=void 0){P(this,Ze);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(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=Dt(a));let{precision:s,unit:u,increment:l}=Ni(o,r);return Fc(Xt(Ka(m(this,se),l,u,i)),a,s)}toJSON(){return P(this,Ze),Fc(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return P(this,Ze),new $t(t,e).format(this)}valueOf(){jn("Instant")}toZonedDateTimeISO(t){P(this,Ze);let e=Dt(t);return nt(m(this,se),e,"iso8601")}static fromEpochMilliseconds(t){return Xt(Qt(xo(t)))}static fromEpochNanoseconds(t){return Xt(Eo(t))}static from(t){return ni(t)}static compare(t,e){let r=ni(t),i=ni(e),o=m(r,se),a=m(i,se);return T.default.lessThan(o,a)?-1:T.default.greaterThan(o,a)?1:0}};Cn(Ei,"Temporal.Instant");var _i=class{constructor(t,e,r,i="iso8601"){let o=ue(t),a=ue(e),s=ue(r),u=St(i===void 0?"iso8601":Ve(i));Qn(o,a,s),Rl(this,{year:o,month:a,day:s},u)}get calendarId(){return P(this,Fe),m(this,$)}get era(){return ct(this,"era")}get eraYear(){return ct(this,"eraYear")}get year(){return ct(this,"year")}get month(){return ct(this,"month")}get monthCode(){return ct(this,"monthCode")}get day(){return ct(this,"day")}get dayOfWeek(){return ct(this,"dayOfWeek")}get dayOfYear(){return ct(this,"dayOfYear")}get weekOfYear(){return ct(this,"weekOfYear")?.week}get yearOfWeek(){return ct(this,"weekOfYear")?.year}get daysInWeek(){return ct(this,"daysInWeek")}get daysInMonth(){return ct(this,"daysInMonth")}get daysInYear(){return ct(this,"daysInYear")}get monthsInYear(){return ct(this,"monthsInYear")}get inLeapYear(){return ct(this,"inLeapYear")}with(t,e=void 0){if(P(this,Fe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce));return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),wt(Yn(r,i,ve(te(e))),r)}withCalendar(t){P(this,Fe);let e=Yi(t);return wt(m(this,ce),e)}add(t,e=void 0){return P(this,Fe),el("add",this,t,e)}subtract(t,e=void 0){return P(this,Fe),el("subtract",this,t,e)}until(t,e=void 0){return P(this,Fe),Wc("until",this,t,e)}since(t,e=void 0){return P(this,Fe),Wc("since",this,t,e)}equals(t){P(this,Fe);let e=ei(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Fe),Hc(this,Ai(te(t)))}toJSON(){return P(this,Fe),Hc(this)}toLocaleString(t=void 0,e=void 0){return P(this,Fe),new $t(t,e).format(this)}valueOf(){jn("PlainDate")}toPlainDateTime(t=void 0){P(this,Fe);let e=xl(t);return qt(De(m(this,ce),e),m(this,$))}toZonedDateTime(t){let e,r;if(P(this,Fe),Ye(t)){let a=t.timeZone;a===void 0?e=Dt(t):(e=Dt(a),r=t.plainTime)}else e=Dt(t);let i=m(this,ce),o;return r===void 0?o=Rn(e,i):(r=Ln(r),o=it(e,De(i,m(r,He)),"compatible")),nt(o,e,m(this,$))}toPlainYearMonth(){P(this,Fe);let t=m(this,$);return Er(fi(t,Et(t,m(this,ce)),"constrain"),t)}toPlainMonthDay(){P(this,Fe);let t=m(this,$);return Dr(yo(t,Et(t,m(this,ce)),"constrain"),t)}static from(t,e=void 0){return ei(t,e)}static compare(t,e){let r=ei(t),i=ei(e);return hn(m(r,ce),m(i,ce))}};function ct(n,t){P(n,Fe);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(_i,"Temporal.PlainDate");var Si=class{constructor(t,e,r,i=0,o=0,a=0,s=0,u=0,l=0,h="iso8601"){let p=ue(t),y=ue(e),E=ue(r),M=i===void 0?0:ue(i),k=o===void 0?0:ue(o),A=a===void 0?0:ue(a),B=s===void 0?0:ue(s),V=u===void 0?0:ue(u),G=l===void 0?0:ue(l),U=St(h===void 0?"iso8601":Ve(h));Ms(p,y,E,M,k,A,B,V,G),Al(this,{isoDate:{year:p,month:y,day:E},time:{hour:M,minute:k,second:A,millisecond:B,microsecond:V,nanosecond:G}},U)}get calendarId(){return P(this,Pe),m(this,$)}get year(){return lt(this,"year")}get month(){return lt(this,"month")}get monthCode(){return lt(this,"monthCode")}get day(){return lt(this,"day")}get hour(){return gr(this,"hour")}get minute(){return gr(this,"minute")}get second(){return gr(this,"second")}get millisecond(){return gr(this,"millisecond")}get microsecond(){return gr(this,"microsecond")}get nanosecond(){return gr(this,"nanosecond")}get era(){return lt(this,"era")}get eraYear(){return lt(this,"eraYear")}get dayOfWeek(){return lt(this,"dayOfWeek")}get dayOfYear(){return lt(this,"dayOfYear")}get weekOfYear(){return lt(this,"weekOfYear")?.week}get yearOfWeek(){return lt(this,"weekOfYear")?.year}get daysInWeek(){return lt(this,"daysInWeek")}get daysInYear(){return lt(this,"daysInYear")}get daysInMonth(){return lt(this,"daysInMonth")}get monthsInYear(){return lt(this,"monthsInYear")}get inLeapYear(){return lt(this,"inLeapYear")}with(t,e=void 0){if(P(this,Pe),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=m(this,Ae),o={...Et(r,i.isoDate),...i.time};return o=Xn(r,o,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),qt(Fi(r,o,ve(te(e))),r)}withPlainTime(t=void 0){P(this,Pe);let e=xl(t);return qt(De(m(this,Ae).isoDate,e),m(this,$))}withCalendar(t){P(this,Pe);let e=Yi(t);return qt(m(this,Ae),e)}add(t,e=void 0){return P(this,Pe),tl("add",this,t,e)}subtract(t,e=void 0){return P(this,Pe),tl("subtract",this,t,e)}until(t,e=void 0){return P(this,Pe),Kc("until",this,t,e)}since(t,e=void 0){return P(this,Pe),Kc("since",this,t,e)}round(t){if(P(this,Pe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Mn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Ar(r,a,a===1);let s=m(this,Ae);return qt(r===1&&o==="nanosecond"?s:Ga(s,r,o,i),m(this,$))}equals(t){P(this,Pe);let e=ti(t);return Ir(m(this,Ae),m(e,Ae))===0&&un(m(this,$),m(e,$))}toString(t=void 0){P(this,Pe);let e=te(t),r=Ai(e),i=Li(e),o=en(e,"trunc"),a=It(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:u,increment:l}=Ni(a,i),h=Ga(m(this,Ae),l,u,o);return er(h),yi(h,m(this,$),s,r)}toJSON(){return P(this,Pe),yi(m(this,Ae),m(this,$),"auto")}toLocaleString(t=void 0,e=void 0){return P(this,Pe),new $t(t,e).format(this)}valueOf(){jn("PlainDateTime")}toZonedDateTime(t,e=void 0){P(this,Pe);let r=Dt(t),i=ui(te(e));return nt(it(r,m(this,Ae),i),r,m(this,$))}toPlainDate(){return P(this,Pe),wt(m(this,Ae).isoDate,m(this,$))}toPlainTime(){return P(this,Pe),bn(m(this,Ae).time)}static from(t,e=void 0){return ti(t,e)}static compare(t,e){let r=ti(t),i=ti(e);return Ir(m(r,Ae),m(i,Ae))}};function lt(n,t){P(n,Pe);let e=m(n,Ae).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function gr(n,t){return P(n,Pe),m(n,Ae).time[t]}Cn(Si,"Temporal.PlainDateTime");var Mi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,h=0){let p=t===void 0?0:Jt(t),y=e===void 0?0:Jt(e),E=r===void 0?0:Jt(r),M=i===void 0?0:Jt(i),k=o===void 0?0:Jt(o),A=a===void 0?0:Jt(a),B=s===void 0?0:Jt(s),V=u===void 0?0:Jt(u),G=l===void 0?0:Jt(l),U=h===void 0?0:Jt(h);Ho(p,y,E,M,k,A,B,V,G,U),Tn(this),me(this,dt,p),me(this,ht,y),me(this,kt,E),me(this,mt,M),me(this,pt,k),me(this,ft,A),me(this,gt,B),me(this,yt,V),me(this,vt,G),me(this,Tt,U)}get years(){return P(this,Oe),m(this,dt)}get months(){return P(this,Oe),m(this,ht)}get weeks(){return P(this,Oe),m(this,kt)}get days(){return P(this,Oe),m(this,mt)}get hours(){return P(this,Oe),m(this,pt)}get minutes(){return P(this,Oe),m(this,ft)}get seconds(){return P(this,Oe),m(this,gt)}get milliseconds(){return P(this,Oe),m(this,yt)}get microseconds(){return P(this,Oe),m(this,vt)}get nanoseconds(){return P(this,Oe),m(this,Tt)}get sign(){return P(this,Oe),wo(this)}get blank(){return P(this,Oe),wo(this)===0}with(t){P(this,Oe);let e=Pl(t),{years:r=m(this,dt),months:i=m(this,ht),weeks:o=m(this,kt),days:a=m(this,mt),hours:s=m(this,pt),minutes:u=m(this,ft),seconds:l=m(this,gt),milliseconds:h=m(this,yt),microseconds:p=m(this,vt),nanoseconds:y=m(this,Tt)}=e;return new n(r,i,o,a,s,u,l,h,p,y)}negated(){return P(this,Oe),xt(this)}abs(){return P(this,Oe),new n(Math.abs(m(this,dt)),Math.abs(m(this,ht)),Math.abs(m(this,kt)),Math.abs(m(this,mt)),Math.abs(m(this,pt)),Math.abs(m(this,ft)),Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,vt)),Math.abs(m(this,Tt)))}add(t){return P(this,Oe),Xc("add",this,t)}subtract(t){return P(this,Oe),Xc("subtract",this,t)}round(t){if(P(this,Oe),t===void 0)throw new TypeError("options parameter is required");let e=yn(this),r=typeof t=="string"?nr("smallestUnit",t):te(t),i=It(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Pa(r),s=Rr(r),u=en(r,"halfExpand"),l=It(r,"smallestUnit","datetime",void 0),h=!0;l||(h=!1,l="nanosecond");let p=Dn(e,l),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(Dn(i,l)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${l}`);let E={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[l];if(E!==void 0&&Ar(s,E,!1),s>1&&vn(l)==="date"&&i!==l)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let k=br(this),A=m(a,_e),B=m(a,$),V=m(a,se);return k=Xl(V,oi(V,A,B,k),A,B,i,s,l,u),vn(i)==="date"&&(i="hour"),Wt(k,i)}if(o){let k=cn(this),A=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},k.time),B=m(o,ce),V=m(o,$),G=Bt(V,B,rt(k.date,A.deltaDays),"constrain");return k=Jl(De(B,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(G,A),V,i,s,l,u),Wt(k,i)}if(an(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(an(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let M=cn(this);if(l==="day"){let{quotient:k,remainder:A}=M.time.divmod(po),B=M.date.days+k+di(A,"day");B=Nn(B,s,u),M=En({years:0,months:0,weeks:0,days:B},ke.ZERO)}else M=En({years:0,months:0,weeks:0,days:0},Do(M.time,s,l,u));return Wt(M,i)}total(t){if(P(this,Oe),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?nr("unit",t):te(t),{plainRelativeTo:r,zonedRelativeTo:i}=Pa(e),o=It(e,"unit","datetime",Mn);if(i){let s=br(this),u=m(i,_e),l=m(i,$),h=m(i,se);return function(p,y,E,M,k){return vn(k)==="time"?di(ke.fromEpochNsDiff(y,p),k):Vc(Gl(p,y,E,M,k),y,Gt(E,p),E,M,k)}(h,oi(h,u,l,s),u,l,o)}if(r){let s=cn(this),u=Cr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),l=m(r,ce),h=m(r,$),p=Bt(h,l,rt(s.date,u.deltaDays),"constrain");return function(y,E,M,k){if(Ir(y,E)==0)return 0;er(y),er(E);let A=Kl(y,E,M,k);return k==="nanosecond"?T.default.toNumber(A.time.totalNs):Vc(A,Xe(E),y,null,M,k)}(De(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),De(p,u),h,o)}let a=yn(this);if(an(a))throw new RangeError(`a starting point is required for ${a}s total`);if(an(o))throw new RangeError(`a starting point is required for ${o}s total`);return di(cn(this).time,o)}toString(t=void 0){P(this,Oe);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(e,"smallestUnit","time",void 0);if(o==="hour"||o==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:a,unit:s,increment:u}=Ni(o,r);if(s==="nanosecond"&&u===1)return lo(this,a);let l=yn(this),h=br(this),p=Do(h.time,u,s,i);return h=En(h.date,p),lo(Wt(h,Dn(l,"second")),a)}toJSON(){return P(this,Oe),lo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(P(this,Oe),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return xs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),lo(this,"auto")}valueOf(){jn("Duration")}static from(t){return Kt(t)}static compare(t,e,r=void 0){let i=Kt(t),o=Kt(e),a=te(r),{plainRelativeTo:s,zonedRelativeTo:u}=Pa(a);if(m(i,dt)===m(o,dt)&&m(i,ht)===m(o,ht)&&m(i,kt)===m(o,kt)&&m(i,mt)===m(o,mt)&&m(i,pt)===m(o,pt)&&m(i,ft)===m(o,ft)&&m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,vt)===m(o,vt)&&m(i,Tt)===m(o,Tt))return 0;let l=yn(i),h=yn(o),p=br(i),y=br(o);if(u&&(vn(l)==="date"||vn(h)==="date")){let B=m(u,_e),V=m(u,$),G=m(u,se),U=oi(G,B,V,p),J=oi(G,B,V,y);return Ct(T.default.toNumber(T.default.subtract(U,J)))}let E=p.date.days,M=y.date.days;if(an(l)||an(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");E=Uc(p.date,s),M=Uc(y.date,s)}let k=p.time.add24HourDays(E),A=y.time.add24HourDays(M);return k.cmp(A)}};Cn(Mi,"Temporal.Duration");var ki=class{constructor(t,e,r="iso8601",i=1972){let o=ue(t),a=ue(e),s=St(r===void 0?"iso8601":Ve(r)),u=ue(i);Qn(u,o,a),Ll(this,{year:u,month:o,day:a},s)}get monthCode(){return al(this,"monthCode")}get day(){return al(this,"day")}get calendarId(){return P(this,Ht),m(this,$)}with(t,e=void 0){if(P(this,Ht),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce),"month-day");return i=Xn(r,i,zt(r,t,["year","month","monthCode","day"],[],"partial")),Dr(yo(r,i,ve(te(e))),r)}equals(t){P(this,Ht);let e=Nc(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Ht),$c(this,Ai(te(t)))}toJSON(){return P(this,Ht),$c(this)}toLocaleString(t=void 0,e=void 0){return P(this,Ht),new $t(t,e).format(this)}valueOf(){jn("PlainMonthDay")}toPlainDate(t){if(P(this,Ht),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Et(e,m(this,ce),"month-day"),zt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return Nc(t,e)}};function al(n,t){P(n,Ht);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}function Ra(n){return Gt(n,Xa())}Cn(ki,"Temporal.PlainMonthDay");var au={instant:()=>Xt(Xa()),plainDateTimeISO:(n=Zr())=>qt(Ra(Dt(n)),"iso8601"),plainDateISO:(n=Zr())=>wt(Ra(Dt(n)).isoDate,"iso8601"),plainTimeISO:(n=Zr())=>bn(Ra(Dt(n)).time),timeZoneId:()=>Zr(),zonedDateTimeISO:(n=Zr())=>{let t=Dt(n);return nt(Xa(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(au,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Ti=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:ue(t),u=e===void 0?0:ue(e),l=r===void 0?0:ue(r),h=i===void 0?0:ue(i),p=o===void 0?0:ue(o),y=a===void 0?0:ue(a);Fo(s,u,l,h,p,y),Nl(this,{hour:s,minute:u,second:l,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return P(this,Be),m(this,He).hour}get minute(){return P(this,Be),m(this,He).minute}get second(){return P(this,Be),m(this,He).second}get millisecond(){return P(this,Be),m(this,He).millisecond}get microsecond(){return P(this,Be),m(this,He).microsecond}get nanosecond(){return P(this,Be),m(this,He).nanosecond}with(t,e=void 0){if(P(this,Be),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=ja(t,"partial"),i=ja(this),{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Object.assign(i,r),p=ve(te(e));return{hour:o,minute:a,second:s,millisecond:u,microsecond:l,nanosecond:h}=Lo(o,a,s,u,l,h,p),new n(o,a,s,u,l,h)}add(t){return P(this,Be),nl("add",this,t)}subtract(t){return P(this,Be),nl("subtract",this,t)}until(t,e=void 0){return P(this,Be),Gc("until",this,t,e)}since(t,e=void 0){return P(this,Be),Gc("since",this,t,e)}round(t){if(P(this,Be),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Mn);return Ar(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),bn(Za(m(this,He),r,o,i))}equals(t){P(this,Be);let e=Ln(t);return Ja(m(this,He),m(e,He))===0}toString(t=void 0){P(this,Be);let e=te(t),r=Li(e),i=en(e,"trunc"),o=It(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:a,unit:s,increment:u}=Ni(o,r);return Yc(Za(m(this,He),u,s,i),a)}toJSON(){return P(this,Be),Yc(m(this,He),"auto")}toLocaleString(t=void 0,e=void 0){return P(this,Be),new $t(t,e).format(this)}valueOf(){jn("PlainTime")}static from(t,e=void 0){return Ln(t,e)}static compare(t,e){let r=Ln(t),i=Ln(e);return Ja(m(r,He),m(i,He))}};Cn(Ti,"Temporal.PlainTime");var Ci=class{constructor(t,e,r="iso8601",i=1){let o=ue(t),a=ue(e),s=St(r===void 0?"iso8601":Ve(r)),u=ue(i);Qn(o,a,u),Ol(this,{year:o,month:a,day:u},s)}get year(){return fn(this,"year")}get month(){return fn(this,"month")}get monthCode(){return fn(this,"monthCode")}get calendarId(){return P(this,Je),m(this,$)}get era(){return fn(this,"era")}get eraYear(){return fn(this,"eraYear")}get daysInMonth(){return fn(this,"daysInMonth")}get daysInYear(){return fn(this,"daysInYear")}get monthsInYear(){return fn(this,"monthsInYear")}get inLeapYear(){return fn(this,"inLeapYear")}with(t,e=void 0){if(P(this,Je),!Ye(t))throw new TypeError("invalid argument");xr(t);let r=m(this,$),i=Et(r,m(this,ce),"year-month");return i=Xn(r,i,zt(r,t,["year","month","monthCode"],[],"partial")),Er(fi(r,i,ve(te(e))),r)}add(t,e=void 0){return P(this,Je),rl("add",this,t,e)}subtract(t,e=void 0){return P(this,Je),rl("subtract",this,t,e)}until(t,e=void 0){return P(this,Je),Zc("until",this,t,e)}since(t,e=void 0){return P(this,Je),Zc("since",this,t,e)}equals(t){P(this,Je);let e=ri(t);return hn(m(this,ce),m(e,ce))===0&&un(m(this,$),m(e,$))}toString(t=void 0){return P(this,Je),Bc(this,Ai(te(t)))}toJSON(){return P(this,Je),Bc(this)}toLocaleString(t=void 0,e=void 0){return P(this,Je),new $t(t,e).format(this)}valueOf(){jn("PlainYearMonth")}toPlainDate(t){if(P(this,Je),!Ye(t))throw new TypeError("argument should be an object");let e=m(this,$);return wt(Yn(e,Xn(e,Et(e,m(this,ce),"year-month"),zt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return ri(t,e)}static compare(t,e){let r=ri(t),i=ri(e);return hn(m(r,ce),m(i,ce))}};function fn(n,t){P(n,Je);let e=m(n,ce);return Oi(n).isoToDate(e,{[t]:!0})[t]}Cn(Ci,"Temporal.PlainYearMonth");var Ch=$t.prototype.resolvedOptions,Ii=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Eo(t),o=Ve(e),{tzName:a,offsetMinutes:s}=On(o);if(s===void 0){let u=vo(a);if(!u)throw new RangeError(`unknown time zone ${a}`);o=u.identifier}else o=Es(s);Hl(this,i,o,St(r===void 0?"iso8601":Ve(r)))}get calendarId(){return P(this,pe),m(this,$)}get timeZoneId(){return P(this,pe),m(this,_e)}get year(){return ut(this,"year")}get month(){return ut(this,"month")}get monthCode(){return ut(this,"monthCode")}get day(){return ut(this,"day")}get hour(){return yr(this,"hour")}get minute(){return yr(this,"minute")}get second(){return yr(this,"second")}get millisecond(){return yr(this,"millisecond")}get microsecond(){return yr(this,"microsecond")}get nanosecond(){return yr(this,"nanosecond")}get era(){return ut(this,"era")}get eraYear(){return ut(this,"eraYear")}get epochMilliseconds(){return P(this,pe),Zt(m(this,se),"floor")}get epochNanoseconds(){return P(this,pe),Ql(m(this,se))}get dayOfWeek(){return ut(this,"dayOfWeek")}get dayOfYear(){return ut(this,"dayOfYear")}get weekOfYear(){return ut(this,"weekOfYear")?.week}get yearOfWeek(){return ut(this,"weekOfYear")?.year}get hoursInDay(){P(this,pe);let t=m(this,_e),e=on(this).isoDate,r=Pt(e.year,e.month,e.day+1),i=Rn(t,e),o=Rn(t,r);return di(ke.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ut(this,"daysInWeek")}get daysInMonth(){return ut(this,"daysInMonth")}get daysInYear(){return ut(this,"daysInYear")}get monthsInYear(){return ut(this,"monthsInYear")}get inLeapYear(){return ut(this,"inLeapYear")}get offset(){return P(this,pe),za(wn(m(this,_e),m(this,se)))}get offsetNanoseconds(){return P(this,pe),wn(m(this,_e),m(this,se))}with(t,e=void 0){if(P(this,pe),!Ye(t))throw new TypeError("invalid zoned-date-time-like");xr(t);let r=m(this,$),i=m(this,_e),o=wn(i,m(this,se)),a=on(this),s={...Et(r,a.isoDate),...a.time,offset:za(o)};s=Xn(r,s,zt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let u=te(e),l=ui(u),h=uo(u,"prefer"),p=Fi(r,s,ve(u)),y=Lr(s.offset);return nt(go(p.isoDate,p.time,"option",y,i,l,h,!1),i,r)}withPlainTime(t=void 0){P(this,pe);let e=m(this,_e),r=m(this,$),i=on(this).isoDate,o;return o=t===void 0?Rn(e,i):it(e,De(i,m(Ln(t),He)),"compatible"),nt(o,e,r)}withTimeZone(t){P(this,pe);let e=Dt(t);return nt(m(this,se),e,m(this,$))}withCalendar(t){P(this,pe);let e=Yi(t);return nt(m(this,se),m(this,_e),e)}add(t,e=void 0){return P(this,pe),il("add",this,t,e)}subtract(t,e=void 0){return P(this,pe),il("subtract",this,t,e)}until(t,e=void 0){return P(this,pe),Jc("until",this,t,e)}since(t,e=void 0){return P(this,pe),Jc("since",this,t,e)}round(t){if(P(this,pe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?nr("smallestUnit",t):te(t),r=Rr(e),i=en(e,"halfExpand"),o=It(e,"smallestUnit","time",Mn,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Ar(r,a,a===1),o==="nanosecond"&&r===1)return nt(m(this,se),m(this,_e),m(this,$));let s=m(this,_e),u=m(this,se),l=on(this),h;if(o==="day"){let p=l.isoDate,y=Pt(p.year,p.month,p.day+1),E=Rn(s,p),M=Rn(s,y),k=T.default.subtract(M,E);h=ke.fromEpochNsDiff(u,E).round(k,i).addToEpochNs(E)}else{let p=Ga(l,r,o,i),y=wn(s,u);h=go(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return nt(h,s,m(this,$))}equals(t){P(this,pe);let e=ii(t),r=m(this,se),i=m(e,se);return!!T.default.equal(T.default.BigInt(r),T.default.BigInt(i))&&!!Yl(m(this,_e),m(e,_e))&&un(m(this,$),m(e,$))}toString(t=void 0){P(this,pe);let e=te(t),r=Ai(e),i=Li(e),o=function(y){return _n(y,"offset",["auto","never"],"auto")}(e),a=en(e,"trunc"),s=It(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let u=function(y){return _n(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:l,unit:h,increment:p}=Ni(s,i);return jc(this,l,r,u,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){P(this,pe);let r=te(e),i=Object.create(null);if(function(u,l,h,p){if(l==null)return;let y=Reflect.ownKeys(l);for(let E=0;E<y.length;E++){let M=y[E];if(!h.some(k=>Object.is(k,M))&&Object.prototype.propertyIsEnumerable.call(l,M)){let k=l[M];u[M]=k}}}(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=m(this,_e),zc(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new $t(t,i),a=Ch.call(o).calendar,s=m(this,$);if(s!=="iso8601"&&a!=="iso8601"&&!un(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(Xt(m(this,se)))}toJSON(){return P(this,pe),jc(this,"auto")}valueOf(){jn("ZonedDateTime")}startOfDay(){P(this,pe);let t=m(this,_e);return nt(Rn(t,on(this).isoDate),t,m(this,$))}getTimeZoneTransition(t){P(this,pe);let e=m(this,_e);if(t===void 0)throw new TypeError("options parameter is required");let r=_n(typeof t=="string"?nr("direction",t):te(t),"direction",["next","previous"],Mn);if(r===void 0)throw new TypeError("direction option is required");if(zc(e)||e==="UTC")return null;let i=m(this,se),o=r==="next"?Ss(e,i):Va(e,i);return o===null?null:nt(o,e,m(this,$))}toInstant(){return P(this,pe),Xt(m(this,se))}toPlainDate(){return P(this,pe),wt(on(this).isoDate,m(this,$))}toPlainTime(){return P(this,pe),bn(on(this).time)}toPlainDateTime(){return P(this,pe),qt(on(this),m(this,$))}static from(t,e=void 0){return ii(t,e)}static compare(t,e){let r=ii(t),i=ii(e),o=m(r,se),a=m(i,se);return T.default.lessThan(T.default.BigInt(o),T.default.BigInt(a))?-1:T.default.greaterThan(T.default.BigInt(o),T.default.BigInt(a))?1:0}};function on(n){return Gt(m(n,_e),m(n,se))}function ut(n,t){P(n,pe);let e=on(n).isoDate;return Oi(n).isoToDate(e,{[t]:!0})[t]}function yr(n,t){return P(n,pe),on(n).time[t]}Cn(Ii,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Mi,Instant:Ei,Now:au,PlainDate:_i,PlainDateTime:Si,PlainMonthDay:ki,PlainTime:Ti,PlainYearMonth:Ci,ZonedDateTime:Ii}),Cm=class{toTemporalInstant(){return Xt(Qt(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Ih=[Ei,_i,Si,Mi,ki,Ti,Ci,Ii];for(let n of Ih){let t=Object.getOwnPropertyDescriptor(n,"prototype");(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(n,"prototype",t))}var Ph="https://yuna-backend.cbocher.workers.dev/mews",xh="https://api.mews.com/api/distributor/v1",Rh="Yuna",Ah="mewscache",Lh=!1,Nh=13,Oh=8,Fh=xe.Duration.from({minutes:20}).milliseconds,Hh=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),be={base_url:Ph,bookingEngine_url:xh,bookingEngineClient:Rh,bypassCache:Lh,headers:Hh,cache_key:Ah,ttl:Fh,beCheckInUTC:Nh,beCheckOutUTC:Oh};var jo=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var Or=class{constructor(){Y(this,"dbName","MewsAPICache");Y(this,"version",2);Y(this,"db",null);Y(this,"initPromise",null);Y(this,"performanceMetrics",[]);this.initPromise=this.init()}async init(){return new Promise((t,e)=>{try{let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.error("Failed to initialize IndexedDB:",r.error),e(r.error)},r.onsuccess=()=>{this.db=r.result,t()},r.onupgradeneeded=i=>{let o=i.target.result,{oldVersion:a}=i;if(a>0)try{o.objectStoreNames.contains("api_cache")&&o.deleteObjectStore("api_cache"),o.objectStoreNames.contains("performance_metrics")&&o.deleteObjectStore("performance_metrics")}catch(l){console.warn("Error cleaning up old stores:",l)}let s=o.createObjectStore("api_cache",{keyPath:"cacheKey"});s.createIndex("by-timestamp","timestamp"),s.createIndex("by-enterprise","enterpriseId"),s.createIndex("by-size","size"),o.createObjectStore("performance_metrics",{keyPath:"timestamp"}).createIndex("by-operation","operation")},r.onblocked=()=>{console.warn("IndexedDB upgrade blocked by another tab")}}catch(r){console.error("Failed to initialize IndexedDB:",r),e(r)}})}async ensureDB(){if(!this.db&&(await this.initPromise,!this.db))throw new Error("Failed to initialize IndexedDB");return this.db}calculateDataSize(t){try{return new Blob([JSON.stringify(t)]).size}catch{return 0}}recordPerformanceMetric(t,e,r,i){let o=performance.now()-e,a={operation:t,duration:o,timestamp:Date.now(),cacheHit:r,dataSize:i};this.performanceMetrics.push(a),this.performanceMetrics.length>1e3&&(this.performanceMetrics=this.performanceMetrics.slice(-1e3)),this.storeMetricAsync(a).catch(console.error)}async storeMetricAsync(t){try{let e=await this.ensureDB();return new Promise(r=>{let a=e.transaction("performance_metrics","readwrite").objectStore("performance_metrics").add(t);a.onerror=()=>r(),a.onsuccess=()=>r()})}catch{}}async get(t,e){let r=performance.now();try{let i=await this.ensureDB();return new Promise(o=>{let u=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);u.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},u.onsuccess=()=>{let l=u.result;if(!l){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let h=e!==void 0?e:be.ttl,p=xe.Instant.fromEpochMilliseconds(l.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,l.size),o(l.data)}})}catch(i){return console.error("Error getting cached data:",i),this.recordPerformanceMetric("cache-error",r,!1),null}}async set(t,e,r){let i=performance.now();try{let o=await this.ensureDB(),a=this.calculateDataSize(e),s={cacheKey:t,data:e,timestamp:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((u,l)=>{let y=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),l(y.error)},y.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),u()}})}catch(o){if(console.error("Error setting cached data:",o),this.recordPerformanceMetric("cache-write-error",i,!1),o instanceof Error&&o.name==="QuotaExceededError"){await this.cleanupOldEntries();try{let a=await this.ensureDB(),s={cacheKey:t,data:e,timestamp:xe.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((u,l)=>{let y=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>l(y.error),y.onsuccess=()=>u()})}catch(a){console.error("Error setting cached data after cleanup:",a)}}}}async delete(t){try{let i=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((o,a)=>{let s=i.delete(t);s.onsuccess=()=>o(),s.onerror=()=>a(s.error)})}catch(e){console.error("Error deleting cached data:",e)}}async clearExpired(){let t=performance.now(),e=0;try{let r=await this.ensureDB(),i=xe.Now.instant().epochMilliseconds-be.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),u=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),l=50;for(let h=0;h<u.length;h+=l){let p=u.slice(h,h+l);await Promise.all(p.map(y=>new Promise((E,M)=>{let k=a.delete(y.cacheKey);k.onsuccess=()=>E(),k.onerror=()=>M(k.error)}))),e+=p.length,h+l<u.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,u)=>{let l=o.getAll();l.onsuccess=()=>s(l.result),l.onerror=()=>u(l.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(u=>new Promise((l,h)=>{let p=i.delete(u.cacheKey);p.onsuccess=()=>l(),p.onerror=()=>h(p.error)})))}await new Promise((s,u)=>{r.oncomplete=()=>s(),r.onerror=()=>u(r.error)})}catch(e){console.error("Error cleaning up old entries:",e)}}async clearAll(){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((i,o)=>{let a=r.clear();a.onsuccess=()=>i(),a.onerror=()=>o(a.error)})}catch(t){console.error("Error clearing all cache:",t)}}async getCacheStats(){try{let r=(await this.ensureDB()).transaction("api_cache","readonly").objectStore("api_cache"),i=await new Promise((a,s)=>{let u=r.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>s(u.error)}),o={totalEntries:i.length,totalSize:i.reduce((a,s)=>a+(s.size||0),0),oldestEntry:i.length>0?Math.min(...i.map(a=>a.timestamp)):null,newestEntry:i.length>0?Math.max(...i.map(a=>a.timestamp)):null,entriesByEnterprise:{}};return i.forEach(a=>{let s=a.enterpriseId||"unknown";o.entriesByEnterprise[s]=(o.entriesByEnterprise[s]||0)+1}),o}catch(t){return console.error("Error getting cache stats:",t),{totalEntries:0,totalSize:0,oldestEntry:null,newestEntry:null,entriesByEnterprise:{}}}}getPerformanceMetrics(){return[...this.performanceMetrics]}getAveragePerformance(){let t=this.performanceMetrics,e=t.filter(o=>o.operation==="cache-hit"),r=t.filter(o=>o.operation==="cache-miss"),i=t.filter(o=>o.operation==="cache-write");return{averageCacheHitTime:e.length>0?e.reduce((o,a)=>o+a.duration,0)/e.length:0,averageCacheMissTime:r.length>0?r.reduce((o,a)=>o+a.duration,0)/r.length:0,averageWriteTime:i.length>0?i.reduce((o,a)=>o+a.duration,0)/i.length:0,cacheHitRate:e.length+r.length>0?e.length/(e.length+r.length):0,totalOperations:t.length}}async performMaintenance(){try{setTimeout(async()=>{await this.clearExpired(),(await this.getCacheStats()).totalEntries>2e3&&await this.cleanupOldEntries(1500)},0)}catch(t){console.error("Error during cache maintenance:",t)}}};var Rs=async(n,t,e=null,r=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new Or,o=jo(`booking-engine:${n}`,e||"null",t.body);if(!be.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(u=>{console.error("Error setting booking engine cache:",u)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var su=(n,t)=>{let e=`${be.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Rs(e,r,n)},cu=(n,t)=>{let e=`${be.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Rs(e,r,n)};var As=class{constructor(){Y(this,"listeners",new Map)}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e)}off(t,e){this.listeners.get(t)?.delete(e)}emit(t,e){this.listeners.get(t)?.forEach(r=>r(e))}},zo=new As;function qe(n,t){zo.emit(n,t)}function et(n,t){Array.isArray(n)?n.forEach(e=>zo.on(e,t)):zo.on(n,t)}var lu={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"}},Ls={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."]},du=()=>{let n=sr().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in Ls)return Ls[r];return Ls.en},uu=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Yh=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},Me=n=>lu[sr().bcp47][n]||lu["fr-FR"][n],Ut=n=>{let t=sr().bcp47,e=t.split("-")[0],r=uu(n,Yh(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=uu(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 sr=()=>{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},tn=sr().bcp47,Qm=sr().iso639;function Ns(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Os=Object.assign;var $h=Object.prototype.hasOwnProperty,Uo=(n,t)=>$h.call(n,t),cr=Array.isArray,Vi=n=>hu(n)==="[object Map]";var Bh=n=>typeof n=="string",Fr=n=>typeof n=="symbol",qi=n=>n!==null&&typeof n=="object";var jh=Object.prototype.toString,hu=n=>jh.call(n),mu=n=>hu(n).slice(8,-1);var Vo=n=>Bh(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var qo=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},zh=/-(\w)/g,np=qo(n=>n.replace(zh,(t,e)=>e?e.toUpperCase():"")),Uh=/\B([A-Z])/g,rp=qo(n=>n.replace(Uh,"-$1").toLowerCase()),Vh=qo(n=>n.charAt(0).toUpperCase()+n.slice(1)),ip=qo(n=>n?`on${Vh(n)}`:""),lr=(n,t)=>!Object.is(n,t);var qh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var op=Ns(qh+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Fs;var Le;var Hs=new WeakSet,Go=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Fs&&Fs.active&&Fs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hs.has(this)&&(Hs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Wh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,pu(this),yu(this);let t=Le,e=nn;Le=this,nn=!0;try{return this.fn()}finally{vu(this),Le=t,nn=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Xs(t);this.deps=this.depsTail=void 0,pu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Bs(this)&&this.run()}get dirty(){return Bs(this)}},gu=0,Ki,Gi;function Wh(n,t=!1){if(n.flags|=8,t){n.next=Gi,Gi=n;return}n.next=Ki,Ki=n}function Zs(){gu++}function Js(){if(--gu>0)return;if(Gi){let t=Gi;for(Gi=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;Ki;){let t=Ki;for(Ki=void 0;t;){let e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){n||(n=r)}t=e}}if(n)throw n}function yu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),Xs(r),Gh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function Bs(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Kh(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Kh(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Zo)||(n.globalVersion=Zo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Bs(n))))return;n.flags|=2;let t=n.dep,e=Le,r=nn;Le=n,nn=!0;try{yu(n);let i=n.fn(n._value);(t.version===0||lr(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=e,nn=r,vu(n),n.flags&=-3}}function Xs(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)Xs(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Gh(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function bu(n,t){n.effect instanceof Go&&(n=n.effect.fn);let e=new Go(n);t&&Os(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var nn=!0,wu=[];function Zh(){wu.push(nn),nn=!1}function Jh(){let n=wu.pop();nn=n===void 0?!0:n}function pu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var Zo=0,js=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Jo=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Le||!nn||Le===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Le)e=this.activeLink=new js(Le,this),Le.deps?(e.prevDep=Le.depsTail,Le.depsTail.nextDep=e,Le.depsTail=e):Le.deps=Le.depsTail=e,Du(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){let r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=Le.depsTail,e.nextDep=void 0,Le.depsTail.nextDep=e,Le.depsTail=e,Le.deps===e&&(Le.deps=r)}return e}trigger(t){this.version++,Zo++,this.notify(t)}notify(t){Zs();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Js()}}};function Du(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)Du(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var zs=new WeakMap,ur=Symbol(""),Us=Symbol(""),Zi=Symbol("");function Rt(n,t,e){if(nn&&Le){let r=zs.get(n);r||zs.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new Jo),i.map=r,i.key=e),i.track()}}function zn(n,t,e,r,i,o){let a=zs.get(n);if(!a){Zo++;return}let s=u=>{u&&u.trigger()};if(Zs(),t==="clear")a.forEach(s);else{let u=cr(n),l=u&&Vo(e);if(u&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===Zi||!Fr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),l&&s(a.get(Zi)),t){case"add":u?l&&s(a.get("length")):(s(a.get(ur)),Vi(n)&&s(a.get(Us)));break;case"delete":u||(s(a.get(ur)),Vi(n)&&s(a.get(Us)));break;case"set":Vi(n)&&s(a.get(ur));break}}Js()}function Hr(n){let t=Ie(n);return t===n?t:(Rt(t,"iterate",Zi),Un(n)?t:t.map(Mt))}function Qs(n){return Rt(n=Ie(n),"iterate",Zi),n}var Xh={__proto__:null,[Symbol.iterator](){return Ys(this,Symbol.iterator,Mt)},concat(...n){return Hr(this).concat(...n.map(t=>cr(t)?Hr(t):t))},entries(){return Ys(this,"entries",n=>(n[1]=Mt(n[1]),n))},every(n,t){return In(this,"every",n,t,void 0,arguments)},filter(n,t){return In(this,"filter",n,t,e=>e.map(Mt),arguments)},find(n,t){return In(this,"find",n,t,Mt,arguments)},findIndex(n,t){return In(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return In(this,"findLast",n,t,Mt,arguments)},findLastIndex(n,t){return In(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return In(this,"forEach",n,t,void 0,arguments)},includes(...n){return $s(this,"includes",n)},indexOf(...n){return $s(this,"indexOf",n)},join(n){return Hr(this).join(n)},lastIndexOf(...n){return $s(this,"lastIndexOf",n)},map(n,t){return In(this,"map",n,t,void 0,arguments)},pop(){return Wi(this,"pop")},push(...n){return Wi(this,"push",n)},reduce(n,...t){return fu(this,"reduce",n,t)},reduceRight(n,...t){return fu(this,"reduceRight",n,t)},shift(){return Wi(this,"shift")},some(n,t){return In(this,"some",n,t,void 0,arguments)},splice(...n){return Wi(this,"splice",n)},toReversed(){return Hr(this).toReversed()},toSorted(n){return Hr(this).toSorted(n)},toSpliced(...n){return Hr(this).toSpliced(...n)},unshift(...n){return Wi(this,"unshift",n)},values(){return Ys(this,"values",Mt)}};function Ys(n,t,e){let r=Qs(n),i=r[t]();return r!==n&&!Un(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Qh=Array.prototype;function In(n,t,e,r,i,o){let a=Qs(n),s=a!==n&&!Un(n),u=a[t];if(u!==Qh[t]){let p=u.apply(n,o);return s?Mt(p):p}let l=e;a!==n&&(s?l=function(p,y){return e.call(this,Mt(p),y,n)}:e.length>2&&(l=function(p,y){return e.call(this,p,y,n)}));let h=u.call(a,l,r);return s&&i?i(h):h}function fu(n,t,e,r){let i=Qs(n),o=e;return i!==n&&(Un(n)?e.length>3&&(o=function(a,s,u){return e.call(this,a,s,u,n)}):o=function(a,s,u){return e.call(this,a,Mt(s),u,n)}),i[t](o,...r)}function $s(n,t,e){let r=Ie(n);Rt(r,"iterate",Zi);let i=r[t](...e);return(i===-1||i===!1)&&hm(e[0])?(e[0]=Ie(e[0]),r[t](...e)):i}function Wi(n,t,e=[]){Zh(),Zs();let r=Ie(n)[t].apply(n,e);return Js(),Jh(),r}var em=Ns("__proto__,__v_isRef,__isVue"),Eu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Fr));function tm(n){Fr(n)||(n=String(n));let t=Ie(this);return Rt(t,"has",n),t.hasOwnProperty(n)}var Xo=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,r){if(e==="__v_skip")return t.__v_skip;let i=this._isReadonly,o=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return o;if(e==="__v_raw")return r===(i?o?lm:Mu:o?cm:Su).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=cr(t);if(!i){let u;if(a&&(u=Xh[e]))return u;if(e==="hasOwnProperty")return tm}let s=Reflect.get(t,e,Yr(t)?t:r);return(Fr(e)?Eu.has(e):em(e))||(i||Rt(t,"get",e),o)?s:Yr(s)?a&&Vo(e)?s:s.value:qi(s)?i?Qo(s):Br(s):s}},Vs=class extends Xo{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let u=$r(o);if(!Un(r)&&!$r(r)&&(o=Ie(o),r=Ie(r)),!cr(t)&&Yr(o)&&!Yr(r))return u?!1:(o.value=r,!0)}let a=cr(t)&&Vo(e)?Number(e)<t.length:Uo(t,e),s=Reflect.set(t,e,r,Yr(t)?t:i);return t===Ie(i)&&(a?lr(r,o)&&zn(t,"set",e,r,o):zn(t,"add",e,r)),s}deleteProperty(t,e){let r=Uo(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&zn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Fr(e)||!Eu.has(e))&&Rt(t,"has",e),r}ownKeys(t){return Rt(t,"iterate",cr(t)?"length":ur),Reflect.ownKeys(t)}},qs=class extends Xo{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},nm=new Vs,rm=new qs;var Ws=n=>n,Wo=n=>Reflect.getPrototypeOf(n);function im(n,t,e){return function(...r){let i=this.__v_raw,o=Ie(i),a=Vi(o),s=n==="entries"||n===Symbol.iterator&&a,u=n==="keys"&&a,l=i[n](...r),h=e?Ws:t?Ks:Mt;return!t&&Rt(o,"iterate",u?Us:ur),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function Ko(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function om(n,t){let e={get(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);n||(lr(i,s)&&Rt(a,"get",i),Rt(a,"get",s));let{has:u}=Wo(a),l=t?Ws:n?Ks:Mt;if(u.call(a,i))return l(o.get(i));if(u.call(a,s))return l(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&Rt(Ie(i),"iterate",ur),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Ie(o),s=Ie(i);return n||(lr(i,s)&&Rt(a,"has",i),Rt(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,u=Ie(s),l=t?Ws:n?Ks:Mt;return!n&&Rt(u,"iterate",ur),s.forEach((h,p)=>i.call(o,l(h),l(p),a))}};return Os(e,n?{add:Ko("add"),set:Ko("set"),delete:Ko("delete"),clear:Ko("clear")}:{add(i){!t&&!Un(i)&&!$r(i)&&(i=Ie(i));let o=Ie(this);return Wo(o).has.call(o,i)||(o.add(i),zn(o,"add",i,i)),this},set(i,o){!t&&!Un(o)&&!$r(o)&&(o=Ie(o));let a=Ie(this),{has:s,get:u}=Wo(a),l=s.call(a,i);l||(i=Ie(i),l=s.call(a,i));let h=u.call(a,i);return a.set(i,o),l?lr(o,h)&&zn(a,"set",i,o,h):zn(a,"add",i,o),this},delete(i){let o=Ie(this),{has:a,get:s}=Wo(o),u=a.call(o,i);u||(i=Ie(i),u=a.call(o,i));let l=s?s.call(o,i):void 0,h=o.delete(i);return u&&zn(o,"delete",i,void 0,l),h},clear(){let i=Ie(this),o=i.size!==0,a=void 0,s=i.clear();return o&&zn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=im(i,n,t)}),e}function _u(n,t){let e=om(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Uo(e,i)&&i in r?e:r,i,o)}var am={get:_u(!1,!1)};var sm={get:_u(!0,!1)};var Su=new WeakMap,cm=new WeakMap,Mu=new WeakMap,lm=new WeakMap;function um(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dm(n){return n.__v_skip||!Object.isExtensible(n)?0:um(mu(n))}function Br(n){return $r(n)?n:ku(n,!1,nm,am,Su)}function Qo(n){return ku(n,!0,rm,sm,Mu)}function ku(n,t,e,r,i){if(!qi(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=dm(n);if(o===0)return n;let a=i.get(n);if(a)return a;let s=new Proxy(n,o===2?r:e);return i.set(n,s),s}function $r(n){return!!(n&&n.__v_isReadonly)}function Un(n){return!!(n&&n.__v_isShallow)}function hm(n){return n?!!n.__v_raw:!1}function Ie(n){let t=n&&n.__v_raw;return t?Ie(t):n}var Mt=n=>qi(n)?Br(n):n,Ks=n=>qi(n)?Qo(n):n;function Yr(n){return n?n.__v_isRef===!0:!1}function je(n){return mm(n,!1)}function mm(n,t){return Yr(n)?n:new Gs(n,t)}var Gs=class{constructor(t,e){this.dep=new Jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Ie(t),this._value=e?t:Mt(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||Un(t)||$r(t);t=r?t:Ie(t),lr(t,e)&&(this._rawValue=t,this._value=r?t:Mt(t),this.dep.trigger())}};var Ke=async(n,t,e=null,r=!1)=>{let i=new Or,o=jo(n,e||"null",t.body);if(!be.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(be.base_url);r&&(a.pathname=a.pathname.replace("/mews","/_adapter")),a.pathname+=n,a.searchParams.set("enterprise",e||"null");let s=await fetch(a.toString(),t),u=await s.json();if(s.ok)return i.set(o,u,e||"null").catch(l=>{console.error("Error setting cache:",l)}),u;throw new Error("FETCH_ERROR",{cause:u})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var Tu=(n,t={})=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/services/getAll",e,n)};function Cu(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Ut(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var ec=je({});async function Iu(n){if(ec.value[n])return ec.value[n];let t=await Tu(n),e=Cu(t);return ec.value[n]=e,e}var Pu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/ageCategories/getAll",e,n)};function xu(n){if(!n||!n.AgeCategories||!Array.isArray(n.AgeCategories))throw new Error("Invalid age categories response format");return n.AgeCategories.map(t=>({id:t.Id,name:Ut(t.Names),shortName:t.ShortNames?Ut(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var tc=je({});async function Ru(n){if(tc.value[n])return tc.value[n];let t=await Pu(n,{EnterpriseIds:[n]}),e=xu(t);return tc.value[n]=e,e}var Au=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/products/getAll",e,n)};function Lu(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 Nu(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 Ou(n){if(!n||!n.Rates||!Array.isArray(n.Rates))throw new Error("Invalid rates response format");return n.Rates.filter(t=>t.IsActive&&t.IsEnabled&&t.IsPublic).map(t=>({id:t.Id,serviceId:t.ServiceId,baseRateId:t.BaseRateId,isBaseRate:t.IsBaseRate,isActive:t.IsActive,isEnabled:t.IsEnabled,isPublic:t.IsPublic,isDefault:t.IsDefault,type:t.Type,name:Ut(t.Names),shortName:t.ShortName,description:Ut(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function Ji(n,t){return n.map(t)}function nc(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Ut(n.Names),shortName:Ut(n.ShortNames),description:Ut(n.Descriptions),options:n.Options,promotions:n.Promotions,classifications:n.Classifications,pricing:n.Pricing,imageIds:n.ImageIds||[],ordering:n.Ordering,consumptionMoment:n.ConsumptionMoment,chargingMode:n.ChargingMode}}function Fu(n){return{products:Ji(n.Products,nc),customerProducts:Ji(n.CustomerProducts,nc)}}var rc=je({});async function Hu(n,t){if(rc.value[t])return rc.value[t];let e=await Au(n,{ServiceIds:[t]}),r=Fu(e);return rc.value[t]=r,r}var Yu=(n,t={})=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rates/getAll",e,n)};var ic=je({});async function $u(n,t){if(ic.value[t])return ic.value[t];let e=await Yu(n,{ServiceIds:[t]}),r=Ou(e);return ic.value[t]=r,r}var Bu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/services/getAvailability",e,n)};function ju(n){if(!n||!n.CategoryAvailabilities||!Array.isArray(n.CategoryAvailabilities)||!n.TimeUnitStartsUtc)throw new Error("Invalid service availabilities response format");return n.CategoryAvailabilities.map(t=>({categoryId:t.CategoryId,timeUnitStartsUTC:n.TimeUnitStartsUtc,availabilities:t.Availabilities||[],adjustments:t.Adjustments||[]}))}var Z=class n{static getCurrentDate(){return 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(tn,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 Rf=localStorage.getItem("dev")==="true";var Af=3*60*60*1e3;var ea="calendar-day-price",zu="DD/MM/YYYY",Uu="Y-m-d",oc=!1,pm=365,ac=Z.getCurrentDate(),Vu=Z.addDays(ac,pm),dr=Z.getCurrentDate(),jr=Z.addDays(dr,3),fm=Z.getCurrentDate(),Lf=Z.addDays(fm,30);function hr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}function qu(n=!0,t=document.body,e=Me("fatalErrorMessage")){t.querySelectorAll('[data-fs-element="preloader"]').forEach(i=>{let o=i.querySelector('[data-fs-element="spinner"]'),a=i.querySelector('[data-fs-element="message"]'),s=i.firstChild;o&&o.classList.toggle("hide",n),a&&(n?(s.style.width="90%",a.textContent=e):(s.removeAttribute("style"),a.textContent=Me("pleaseWait"))),i.classList.toggle("hide",!n)})}var sc=class{constructor(){Y(this,"state",Br({appartmentsData:[],today:Z.getCurrentDate(),lowestPricesByDate:{},isLoadingPrices:!1,isLoadingData:!1}))}setAppartmentsData(t){this.state.appartmentsData=t}setLowestPricesByDate(t){this.state.lowestPricesByDate=t}setLoadingPrices(t){this.state.isLoadingPrices=t}setLoadingData(t){this.state.isLoadingData=t}reset(){this.state.appartmentsData=[],this.state.lowestPricesByDate={},this.state.isLoadingPrices=!1,this.state.isLoadingData=!1}},Vf=new sc;var mr={get:n=>{try{let t=localStorage.getItem(n);return t?JSON.parse(t):null}catch(t){return console.error(`Error reading from localStorage for key ${n}:`,t),null}},set:(n,t)=>{try{localStorage.setItem(n,JSON.stringify(t)),mr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=mr.get(n),r=t(e);mr.set(n,r)},remove:n=>{localStorage.removeItem(n),mr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",gm()||"root")}},gm=()=>localStorage.getItem("lastUpdater");var ta=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},Vn=mr.get("form_state"),Wu=Vn?{enterpriseId:Vn.enterpriseId||"",startDate:Vn.startDate||ta(45),endDate:Vn.endDate||ta(48),guests:Vn.guests||2,coupon:Vn.coupon||"",referrer:Vn.referrer||window.location.href,rooms:Vn.rooms||0}:{enterpriseId:"",startDate:ta(45),endDate:ta(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},fe=Br(Wu),ym=Qo(Wu);bu(()=>{mr.set("form_state",fe)});var vm="data-fs-element";var $e=(n,t=document)=>t.querySelector(`[${vm}="${n}"]`);var cc=je({});async function Ku(n,t,e,r){if(cc.value[t])return cc.value[t];let i=await Bu(n,{ServiceId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=ju(i);return cc.value[t]=o,o}var Gu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/restrictions/getAll",e,n)};function Zu(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var lc=je({});async function Ju(n,t,e,r){if(lc.value[t])return lc.value[t];let i=await Gu(n,{ServiceIds:[t],CollidingUtc:{StartUtc:Z.formatForAPI(e),EndUtc:Z.formatForAPI(r)},Origin:"User"}),o=Zu(i);return lc.value[t]=o,o}var Xu=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rules/getAll",e,n)};function Qu(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 uc=je({});async function ed(n,t){if(uc.value[t])return uc.value[t];let e=await Xu(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Qu(e);return uc.value[t]=r,r}var td=(n,t)=>{let e={method:"POST",headers:be.headers,body:JSON.stringify(t)};return Ke("/rates/getPricing",e,n)};var dc=je({});async function nd(n,t,e,r){if(dc.value[t])return dc.value[t];let i=await td(n,{RateId:t,FirstTimeUnitStartUtc:Z.formatForAPI(e),LastTimeUnitStartUtc:Z.formatForAPI(r)}),o=Lu(i);return dc.value[t]=o,o}var na=class{constructor(t,e){Y(this,"enterprise");Y(this,"rate",null);Y(this,"pricing",null);this.enterprise=t,this.rate=e}getRate(){if(!this.rate)throw new Error("Rate is not initialized");return this.rate}async initPricing(t,e){if(!this.rate)throw new Error("Rate is not initialized");return this.pricing=await nd(this.enterprise.getEnterpriseId(),this.rate.id,t,e),this.pricing}getPricing(){if(!this.pricing)throw new Error("Rate pricing is not initialized");return this.pricing}};var ra=class{constructor(t,e){Y(this,"enterprise");Y(this,"service",null);Y(this,"products",[]);Y(this,"customerProducts",[]);Y(this,"restrictions",[]);Y(this,"availabilities",[]);Y(this,"rules",[]);Y(this,"ageCategories",[]);Y(this,"rates",[]);this.enterprise=t,this.service=e}getService(){return this.service}async initAvailabilities(t,e){if(!this.service)throw new Error("Service is not initialized");return this.availabilities=await Ku(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 Ju(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 Hu(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 $u(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new na(this.enterprise,e)),this.rates.length===0)throw new Error("No rates found for the service");return this.rates}getRates(){if(this.rates.length===0)throw new Error("Service rates are not initialized");return this.rates?.map(t=>t.getRate())||[]}async initRules(){if(!this.service)throw new Error("Service is not initialized");return this.rules=await ed(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 Ru(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var zr=class{constructor(t){Y(this,"enterpriseId");Y(this,"services",[]);Y(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await Iu(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ra(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var hc=new Set;function rd(n,t){return`${n}::${t}`}var bm={"f461699f-a1f6-43cf-9a1b-b02e006e7eb4":"north-west","bb3b0e7e-57aa-411c-a792-aac700d98f74":"north-west","46ca4a98-0aad-448d-91e5-b12a00993f1a":"north-west","9db867c2-6b95-4a24-ac25-aac700d7a2c8":"center-left","13be5e61-3a0f-4fd8-84d5-b02e006dd9db":"center-left","9b5c8357-dbb4-41cb-94af-ae9300f5b16b":"center-left"};function id(n){return bm[n]??null}var ia=class{constructor(t){this.fsListInstance=t;Y(this,"cmsAparthotels",[]);Y(this,"showUnavailableItems",!1);Y(this,"state",{startDate:fe.startDate?Z.safeParsePlainDate(fe.startDate):dr,endDate:fe.endDate?Z.safeParsePlainDate(fe.endDate):jr,apiDataCache:new Map});et("loading:start",e=>hr(!0,e)),et("loading:end",e=>hr(!1,e))}filterAvailableItems(t){return t.filter(e=>Number(e.fields["price-sort"]?.value||9999999)<999999)}applyRelatedListFilters(t){if(this.fsListInstance.instance!=="related")return t;let e=this.filterAvailableItems(t),r=fe.guests||1,o=e.filter(h=>{let p=Number(h.fields.guests?.value||0);return p>=r&&p<=r+2}).filter(h=>{let p=h.fields["enterprise-id"]?.value,y=h.fields["resource-category-id"]?.value;return!p||!y?!0:!hc.has(rd(p,y))}),a=fe.enterpriseId,s=a?id(a):null,u=[],l=[];for(let h of o){let p=h.fields["enterprise-id"]?.value||"";s&&id(p)===s?u.push(h):l.push(h)}return[...this.shuffleArray(u),...this.shuffleArray(l)].slice(0,4)}shuffleArray(t){let e=[...t];for(let r=e.length-1;r>0;r--){let i=Math.floor(Math.random()*(r+1));[e[r],e[i]]=[e[i],e[r]]}return e}init(){qe("loading:start",this.fsListInstance.wrapperElement),this.fsListInstance.addHook("filter",async t=>{console.log("*** Filter hook triggered with items:",t),qe("loading:start",this.fsListInstance.wrapperElement);let e=!!(fe.startDate&&fe.endDate);if(!e)t.forEach(a=>this.resetItemState(a));else if(e&&(await new Promise(a=>setTimeout(a,100)),await this.updateListItems(t,{startDate:this.state.startDate.toString(),endDate:this.state.endDate.toString(),guests:fe.guests||1,rooms:fe.rooms||1}),this.fsListInstance.instance!=="related")){hc.clear();for(let a of this.filterAvailableItems(t)){let s=a.fields["enterprise-id"]?.value,u=a.fields["resource-category-id"]?.value;s&&u&&hc.add(rd(s,u))}qe("mainlist:available:updated",void 0)}let r=this.applyRelatedListFilters(t),i=e&&!this.showUnavailableItems&&this.fsListInstance.instance!=="related"?r.filter(a=>Number(a.fields["price-sort"]?.value||9999999)<9999999):r,o=$e("aparthotels-count");if(o&&this.fsListInstance.instance!=="related"){let a=e?this.filterAvailableItems(t):t;o.textContent=String(a.length)}return qe("loading:end",this.fsListInstance.wrapperElement),i}),this.fsListInstance.instance==="related"&&(et("mainlist:available:updated",()=>{this.fsListInstance.triggerHook("filter")}),et("guests:changed",()=>{this.fsListInstance.triggerHook("filter")}),et("apartment:changed",()=>{this.fsListInstance.triggerHook("filter")})),et("date:changed",t=>{console.log("Date changed:",t),this.state.startDate=t.startDate?Z.safeParsePlainDate(t.startDate):dr,this.state.endDate=t.endDate?Z.safeParsePlainDate(t.endDate):jr,fe.startDate=t.startDate||null,fe.endDate=t.endDate||null,this.fsListInstance.triggerHook("filter")})}groupItemsByEnterprise(t){let e={};return t.forEach(r=>{if(!r.fields["enterprise-id"]||!r.fields["resource-category-id"])return;let i=r.fields["enterprise-id"].value,o=r.fields["resource-category-id"].value;e[i]||(e[i]=[]),e[i].includes(o)||e[i].push(o)}),console.log("#=> Grouped by enterprise:",e),e}createCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i.sort().join(",")}`}async fetchApiData(t,e,r){let o=Date.now(),a=[],s=[];for(let[l,h]of Object.entries(r)){let p=this.createCacheKey(t,e,l,h),y=this.state.apiDataCache.get(p);if(y&&o-y.timestamp<3e5){console.log(`Using cached data for ${l} with ${h.length} categories`),a.push(y);continue}let E=(async()=>{try{let M=new zr(l);await M.initServices();let{reservableService:k}=M,A=k?.getService()?.id;if(!A)return console.warn(`No serviceId found for enterprise ${l}`),null;await k?.initAgeCategories();let B=k?.getAgeCategories()||[],V=await Promise.all([su(l,{EnterpriseId:l,CategoryIds:h,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,Client:be.bookingEngineClient,LanguageCode:"fr-FR"}),cu(l,{Client:be.bookingEngineClient,EnterpriseId:l,StartUtc:Z.formatForAPI(t),EndUtc:Z.formatForAPI(e),ServiceId:A,CategoryIds:h,CurrencyCode:"EUR"})]),G=V[0],U=V[1],J={enterpriseId:l,ageCategories:B,availabilities:G,servicePricing:U,timestamp:o};return this.state.apiDataCache.set(p,J),J}catch(M){return console.error(`Error fetching data for enterprise ${l}:`,M),null}})();s.push(E)}let u=await Promise.all(s);return[...a,...u.filter(Boolean)]}async updateListItems(t,{startDate:e,endDate:r,guests:i,rooms:o}){let a=this.groupItemsByEnterprise(t),s=await this.fetchApiData(e,r,a);return console.log("#=> API Data:",s),(await Promise.all(t.map(async l=>{try{let h=!1,p=!0;if(this.screenItem(l,!0),!l.fields["enterprise-id"])return console.warn(`Item missing enterprise-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Me("missingEnterpriseId")),this.markItemUnavailableForFiltering(l),null;if(!l.fields["resource-category-id"])return console.warn(`Item missing resource-category-id field: [${l.fields.title?.value||""}]\u21FE[${l.fields.name?.value||""}]`,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Me("missingCategoryId")),this.markItemUnavailableForFiltering(l),null;let y=l.fields["enterprise-id"].value,E=l.fields["resource-category-id"].value,M=s.find(J=>J&&J.enterpriseId===y);if(!M)return console.warn(`No data found for enterpriseId: ${y} in item: [${l.fields.title.value}]\u21FE[${l.fields.name.value}]`),l.element.style.opacity="0.5",this.screenItem(l,!1,Me("booked")),this.markItemUnavailableForFiltering(l),null;let k=M.availabilities.ApplicableRestrictions||[],A={title:l.fields.title.value,name:l.fields.name.value,exactRateId:"",baseRateId:"",rateGroupId:"",categoryId:E,categoryType:"notVilla",guests:i,startDate:Z.fromString(e),endDate:Z.fromString(r)},B=this.checkReservationAgainstRestrictions(A,k);return console.log("Restriction Verdict:",B),p=M.availabilities.CategoryAvailabilities.find(J=>J.CategoryId===A.categoryId)?.Availabilities?.slice(0,-1).every(J=>J>0)||!1,h=B.block,h?this.screenItem(l,!1,B.message||Me("booked")):this.screenItem(l,!0),this.updateItemPrice(l,M.servicePricing,E,{startDate:e,endDate:r,guests:i,isLimited:h,isReservable:p,restrictions:k,restrictionMessage:B.message,restrictionBlock:B.block}),l.collectFields(),l}catch(h){return console.error("Error processing list item; hiding item:",h,l),l.element.style.opacity="0.5",this.screenItem(l,!1,Me("booked")),this.markItemUnavailableForFiltering(l),null}}))).filter(l=>l!==null)}checkReservationAgainstRestrictions(t,e){console.log("Restrictions:",e);let r=e.filter(s=>this.matchesCondition(t,s.Conditions));if(console.log("Applicable Restrictions:",r),r.length===0)return{block:!1,message:null};let i=r.some(s=>{let{Exceptions:u}=s;return u.MaxAdvance==null&&u.MinAdvance==null&&u.MaxLength==null&&u.MinLength==null&&u.MaxPrice==null&&u.MinPrice==null&&u.MaxReservationCount==null&&u.MinReservationCount==null});if(console.log("Has full restriction:",i),i)return{block:!0,message:Me("booked")};let o=this.getExtremesFromExceptions(r);console.log("Restriction Extremes:",o);let a=this.violatesException(t,o);return console.log("Violation:",a),a?{block:!0,message:a}:{block:!1,message:null}}matchesCondition(t,e){return(e.ExactRateId===null||t.exactRateId===e.ExactRateId)&&(e.BaseRateId===null||t.baseRateId===e.BaseRateId)&&(e.RateGroupId===null||t.rateGroupId===e.RateGroupId)&&(e.ResourceCategoryId===null||t.categoryId===e.ResourceCategoryId)&&(e.ResourceCategoryType===null||t.categoryType===e.ResourceCategoryType)&&e.Days.includes(t.startDate.toLocaleString("en-US",{weekday:"long"}))&&!0}getDurationInDays(t){if(!t)return null;try{return xe.Duration.from(t).total({unit:"days"})}catch{return null}}getExtremesFromExceptions(t){let e=null,r=null,i=null,o=null,a=!1;for(let s of t){let u=this.getDurationInDays(s.Exceptions.MinAdvance),l=this.getDurationInDays(s.Exceptions.MaxAdvance),h=this.getDurationInDays(s.Exceptions.MinLength),p=this.getDurationInDays(s.Exceptions.MaxLength);u!==null&&(e=Math.max(e??u,u)),l!==null&&(r=Math.min(r??l,l)),h!==null&&(i=Math.max(i??h,h)),p!==null&&(o=Math.min(o??p,p)),!u&&!l&&!h&&!p&&(a=!0)}return{MinAdvance:e,MaxAdvance:r,MinLength:i,MaxLength:o,Restrict:a}}violatesException(t,e){let{startDate:r}=t,{endDate:i}=t,o=i.since(r,{largestUnit:"day"}).days,a=Z.getCurrentDate(),s=r.since(a,{largestUnit:"day"}).days;return e.MinLength&&o<e.MinLength?`${e.MinLength} ${Me("minimumNights")}`:e.MaxLength&&o>e.MaxLength?`${e.MaxLength} ${Me("maximumNights")}`:e.MinAdvance&&s<e.MinAdvance?Me("booked"):e.MaxAdvance&&s>e.MaxAdvance?Me("booked"):!e.MinLength&&!e.MaxLength&&!e.MinAdvance&&!e.MaxAdvance?Me("booked"):null}updateItemPrice(t,e,r,{startDate:i,endDate:o,guests:a,isLimited:s,isReservable:u,restrictions:l,restrictionMessage:h,restrictionBlock:p}){console.groupCollapsed(`[${t.fields.title.value}] \u21FE [${t.fields.name.value}] PRICE UPDATE`),console.log(`Is Limited: ${s}`),console.log(`Is Reservable: ${u}`),console.log(`Restriction Block: ${p}`),console.log(`Restriction Message: ${h||"None"}`);let y=$e("price",t.element),E=t.element.querySelector('[fs-list-field="price-sort"]'),M=$e("total-price",t.element),k=Z.fromString(i).until(Z.fromString(o)).total({unit:"days"});s&&u&&E&&(E.textContent="999999"),!u&&E&&(E.textContent="9999999");let A=e?.CategoryPrices?.find(U=>U.CategoryId===r);if(console.log("Category Price:",A),console.log("Restrictions:",l),!A||s&&u){if(y){y.textContent="-";let U=y.parentElement;U&&(U.style.opacity="0")}if(M){M.textContent=`- ${Me("total").toLowerCase()} (${k} ${Me("night")}s)`;let U=M.parentElement;U&&(U.style.opacity="0")}E&&u&&(E.textContent="999999"),A||(console.warn(`No price found for categoryId: ${r}`),s||this.screenItem(t,!1,Me("booked"))),console.groupEnd();return}if(!u){if(y){y.textContent="-";let U=y.parentElement;U&&(U.style.opacity="0")}if(M){M.textContent=`- ${Me("total").toLowerCase()} (${k} ${Me("night")}s)`;let U=M.parentElement;U&&(U.style.opacity="0")}console.warn(`No availability found for categoryId: ${r}`),this.screenItem(t,!1,Me("booked")),console.groupEnd();return}let B=A.OccupancyPrices[0]?.RateGroupPrices.reduce((U,J)=>J.MinPrice.AverageAmountPerTimeUnit.GrossValue<U.MinPrice.AverageAmountPerTimeUnit.GrossValue?J:U);if(console.log("Lowest Price:",B),!B){y&&(y.textContent="-"),E&&u&&(E.textContent="999999"),console.groupEnd();return}let V=B.MinPrice.AverageAmountPerTimeUnit.GrossValue,G=V.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});if(y){y.textContent=G;let U=y.parentElement;U&&(U.style.opacity="1")}if(E&&(E.textContent=V.toString()),M){let J=(V*k).toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:2});M.textContent=`${J} ${Me("total").toLowerCase()} (${k} ${Me("night")}s)`;let oe=M.parentElement;oe&&(oe.style.opacity="1")}console.groupEnd()}markItemUnavailableForFiltering(t){let e=t.element.querySelector('[fs-list-field="price-sort"]');e&&(e.textContent="9999999");let r=$e("price",t.element);r&&(r.textContent="-",r.parentElement&&(r.parentElement.style.opacity="0"));let i=$e("total-price",t.element);i&&(i.textContent="",i.parentElement&&(i.parentElement.style.opacity="0")),t.collectFields()}shouldDisplayBookingItem(t){return Number(t.fields["price-sort"]?.value||9999999)<9999999}resetItemState(t){let e=t.element.querySelector('[fs-list-field="price-sort"]');Number(e?.textContent||0)!==999999&&this.screenItem(t,!0),e&&(e.textContent="");let i=$e("price",t.element);i&&(i.textContent="",i.parentElement&&(i.parentElement.style.opacity="0"));let o=$e("total-price",t.element);o&&(o.textContent="",o.parentElement&&(o.parentElement.style.opacity="0")),t.element.style.opacity="1",t.collectFields()}screenItem(t,e,r=Me("select")||""){let i=$e("submit",t.element);i&&(e?(t.element.style.opacity="1",i.classList.remove("room-results_cta-disabled"),i.textContent=r):i.classList.contains("room-results_cta-disabled")||(i.classList.add("room-results_cta-disabled"),i.textContent=r))}};var od=()=>{};function Ur(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):od}var oa=n=>n instanceof HTMLInputElement;var mc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var Xi=n=>{let{value:t}=n;if(n.type==="checkbox"&&(t=n.checked.toString()),n.type==="radio"){let e=n.closest("form")?.querySelector(`input[name="${n.name}"]:checked`);t=oa(e)?e.value:""}return t.toString()};var Qi=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!oa(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}mc(n,["click","input","change"])};function ad(n,t){return{rate:n,pricing:t}}function pc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function sd(n,t){let e=t.filter(o=>wm(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=>Dm(n,o.Exceptions)))}function wm(n,t){return(t.ExactRateId===null||n.rate.id===t.ExactRateId)&&(t.BaseRateId===null||n.rate.baseRateId===t.BaseRateId)&&(t.ExactRateId===null||n.rate.baseRateId===t.ExactRateId)&&(t.RateGroupId===null||n.rate.group?.Id===t.RateGroupId)&&t.ResourceCategoryId===null&&t.ResourceCategoryType===null&&n.pricing?.datesUtc.every(e=>{let r=Z.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function aa(n){if(!n)return null;try{return xe.Duration.from(n).total({unit:"days"})}catch{return null}}function Dm(n,t){let e=Z.fromString(n.pricing?.datesUtc[0]),r=Z.fromString(n.pricing?.datesUtc.at(-1));if(!e||!r)return console.warn("Missing date information, cannot check restrictions"),!0;let i=r.since(e,{largestUnit:"day"}).days,o=Z.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=aa(t.MinAdvance),u=aa(t.MaxAdvance),l=aa(t.MinLength),h=aa(t.MaxLength);return!!(l&&i<l||h&&i>h||s&&a<s||u&&a>u||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var cd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!sd(s,t)&&pc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=Nu(r),a=Em(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Em(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>pc(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 fc=async n=>{let t=await Promise.all(n.map(async r=>{let i=new zr(r);await i.initServices();let o=i.reservableService;if(!o){console.error("No reservable service found for the enterprise.");return}await o.initRates();let a=[],s=await Promise.all(o.rates.map(async l=>{let h=await l.initPricing(Z.formatForAPI(ac.toString()),Z.formatForAPI(Vu.toString()));return ad(l.getRate(),h)}));return cd(s,a).lowestDatedPrices})),e={};for(let r of t)if(r)for(let[i,o]of Object.entries(r))(!e[i]||o<e[i])&&(e[i]=o);return e};var Ge=class Ge extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(Ge.parseDateTime(e,r,i));Y(this,"lang");this.lang=i}static parseDateTime(e,r="YYYY-MM-DD",i="en-US"){if(!e)return new Date(new Date().setHours(0,0,0,0));if(e instanceof Ge)return e.toJSDate();if(e instanceof Date)return e;if(/^-?\d{10,}$/.test(String(e)))return new Date(Number(e));if(typeof e=="string"){let o=[],a=null;for(;(a=Ge.regex.exec(r))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){let s={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};o[0].index>0&&(s.value+=".*?");for(let[l,h]of Object.entries(o)){let p=Number(l),{group:y,pattern:E}=Ge.formatPatterns(h[0],i);s[y]=p+1,s.value+=E,s.value+=".*?"}let u=new RegExp(`^${s.value}$`);if(u.test(e)){let l=u.exec(e),h=Number(l[s.year]),p=null;s.month?p=Number(l[s.month])-1:s.shortMonth?p=Ge.shortMonths(i).indexOf(l[s.shortMonth]):s.longMonth&&(p=Ge.longMonths(i).indexOf(l[s.longMonth]));let y=Number(l[s.day])||1,E=Number(l[s.hour]),M=Number.isNaN(E)?0:E,k=Number(l[s.minute]),A=Number.isNaN(k)?0:k,B=Number(l[s.second]),V=Number.isNaN(B)?0:B,G=l[s.ampm];return G&&G==="PM"&&(M+=12,M===24&&(M=0)),new Date(h,p,y,M,A,V,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return Ge.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"long"}))}static formatPatterns(e,r){switch(e){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${e.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${Ge.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${Ge.longMonths(r).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}getWeek(e){let r=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-e))%7;r.setDate(r.getDate()-i);let o=r.getTime();return r.setMonth(0,1),r.getDay()!==e&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((o-r.getTime())/6048e5)}clone(){return new Ge(this)}toJSDate(){return new Date(this)}inArray(e,r="[]"){return e.some(i=>i instanceof Array?this.isBetween(i[0],i[1],r):this.isSame(i,"day"))}isBetween(e,r,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"[)":return this.midnight_ts(this)>=this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"(]":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<=this.midnight_ts(r);case"[]":return this.midnight_ts()>=this.midnight_ts(e)&&this.midnight_ts()<=this.midnight_ts(r)}}isBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return e.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(e.getFullYear(),e.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>e.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()+e);break;case"month":case"months":this.setMonth(this.getMonth()+e)}return this}subtract(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()-e);break;case"month":case"months":this.setMonth(this.getMonth()-e)}return this}diff(e,r="days"){switch(r){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(e))/864e5);case"month":case"months":let i=12*(e.getFullYear()-this.getFullYear());return i-=e.getMonth(),i+=this.getMonth(),i}}format(e,r="en-US"){let i="",o=[],a=null;for(;(a=Ge.regex.exec(e))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(let[s,u]of Object.entries(o)){let l=Number(s);i+=this.formatTokens(u[0],r),o[l+1]&&(i+=e.substring(u.index+u[0].length,o[l+1].index)),l===o.length-1&&(i+=e.substring(u.index+u[0].length))}}return i.replace(/\\/g,"")}midnight_ts(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(e,r){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return Ge.shortMonths(r)[this.getMonth()];case"MMMM":return Ge.longMonths(r)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||this.getHours()===24?"am":"pm";case"A":return this.getHours()<12||this.getHours()===24?"AM":"PM";default:return""}}};Y(Ge,"regex",/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g),Y(Ge,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var de=Ge,gc=class{constructor(t){Y(this,"picker");this.picker=t}render(t,e){t||(t=new de),t.setDate(1),t.setHours(0,0,0,0),typeof this[`get${e}View`]=="function"&&this[`get${e}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){let e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),typeof this.picker.options.header=="string"&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){let e=document.createElement("main");this.picker.ui.container.appendChild(e);let r=document.createElement("div");r.className=`calendars grid-${this.picker.options.grid}`;for(let i=0;i<this.picker.options.calendars;i++){let o=document.createElement("div");o.className="calendar",r.appendChild(o);let a=this.getCalendarHeaderView(t.clone());o.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:i,target:a});let s=this.getCalendarDayNamesView();o.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:i,target:s});let u=this.getCalendarDaysView(t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:u});let l=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:l}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:i,target:o}),t.add(1,"month")}e.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:r}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){let e=document.createElement("footer"),r=document.createElement("div");r.className="footer-buttons";let i=document.createElement("button");i.className="cancel-button unit",i.innerHTML=this.picker.options.locale.cancel,r.appendChild(i);let o=document.createElement("button");o.className="apply-button unit",o.innerHTML=this.picker.options.locale.apply,o.disabled=!0,r.appendChild(o),e.appendChild(r),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){let e=document.createElement("div");e.className="header";let r=document.createElement("div");r.className="month-name",r.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span> ${t.format("YYYY")}`,e.appendChild(r);let i=document.createElement("button");i.className="previous-button unit",i.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(i);let o=document.createElement("button");return o.className="next-button unit",o.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(o),e}getCalendarDayNamesView(){let t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){let r=3+this.picker.options.firstDay+e,i=document.createElement("div");i.className="dayname",i.innerHTML=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),i.title=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(i),this.picker.trigger("view",{dayIdx:r,view:"CalendarDayName",target:i})}return t}getCalendarDaysView(t){let e=document.createElement("div");e.className="days-grid";let r=this.calcOffsetDays(t,this.picker.options.firstDay),i=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let o=0;o<r;o++){let a=document.createElement("div");a.className="offset",e.appendChild(a)}for(let o=1;o<=i;o++){t.setDate(o);let a=this.getCalendarDayView(t);e.appendChild(a),this.picker.trigger("view",{date:t,view:"CalendarDay",target:a})}return e}getCalendarDayView(t){let e=this.picker.options.date?new de(this.picker.options.date):null,r=new de,i=document.createElement("div");return i.className="day unit",i.innerHTML=t.format("D"),i.dataset.time=String(t.getTime()),t.isSame(r,"day")&&i.classList.add("today"),[0,6].includes(t.getDay())&&i.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&i.classList.add("selected"):e&&t.isSame(e,"day")&&i.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:i}),i}getCalendarFooterView(t,e){let r=document.createElement("div");return r.className="footer",r}calcOffsetDays(t,e){let r=t.getDay()-e;return r<0&&(r+=7),r}},yc=class{constructor(t){Y(this,"picker");Y(this,"instances",{});this.picker=t}initialize(){let t=[];this.picker.options.plugins.forEach(e=>{typeof e=="function"?t.push(new e):typeof e=="string"&&typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick: ${e} not found.`)}),t.sort((e,r)=>e.priority>r.priority?-1:e.priority<r.priority||e.dependencies.length>r.dependencies.length?1:e.dependencies.length<r.dependencies.length?-1:0),t.forEach(e=>{e.attach(this.picker),this.instances[e.getName()]=e})}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick: ${t} already added.`);else{if(typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,t)){let e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if(this.getPluginFn(t)!=="undefined"){let e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick: ${t} not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter(e=>typeof e=="function"&&new e().getName()===t).shift()}},sa=class{constructor(t){Y(this,"Calendar",new gc(this));Y(this,"PluginManager",new yc(this));Y(this,"calendars",[]);Y(this,"datePicked",[]);Y(this,"cssLoaded",0);Y(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});Y(this,"options",{doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]});Y(this,"ui",{container:null,shadowRoot:null,wrapper:null});Y(this,"version","1.2.1");let e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),typeof this.options.setup=="function"&&this.options.setup(this),this.on("click",this.onClick.bind(this));let r=this.options.scrollToDate?this.getDate():null;this.renderAll(r)}on(t,e,r={}){this.ui.container.addEventListener(t,e,r)}off(t,e,r={}){this.ui.container.removeEventListener(t,e,r)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),typeof this.options.documentClick=="function"&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach(t=>{this.PluginManager.removeInstance(t)}),this.ui.wrapper.remove()}onRender(t){let{view:e,date:r}=t.detail;this.Calendar.render(r,e)}onView(t){let{view:e,target:r}=t.detail;e==="Footer"&&this.datePicked.length&&(r.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){let e=new de(t.dataset.time);this.options.autoApply?(this.setDate(e),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=e,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){let e=this.datePicked[0].clone();this.setDate(e)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){let e=t.target;if(e instanceof HTMLElement){let r=e.closest(".unit");if(!(r instanceof HTMLElement))return;this.onClickHeaderButton(r),this.onClickCalendarDay(r),this.onClickApplyButton(r),this.onClickCancelButton(r)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;let e=t&&"target"in t?t.target:this.options.element,{top:r,left:i}=this.adjustPosition(e);this.ui.container.style.top=`${r}px`,this.ui.container.style.left=`${i}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){let e=new de(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof de?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){let t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",r=this.options.element;r instanceof HTMLInputElement?r.value=e:r instanceof HTMLElement&&(r.innerText=e)}hidePicker(t){let e=t.target,r=null;e.shadowRoot&&(e=t.composedPath()[0],r=e.getRootNode().host),this.isShown()&&r!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some(e=>t.classList.contains(e))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){let e=new de(t,this.options.format);e.setDate(1),this.calendars[0]=e.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new de(this.options.date,this.options.format):this.calendars[0]=new de}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach(t=>{let e=document.createElement("link");e.href=t,e.rel="stylesheet";let r=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",r),e.addEventListener("error",r),this.ui.shadowRoot.append(e)});else if(typeof this.options.css=="string"){let t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else typeof this.options.css=="function"&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){let e=t.getBoundingClientRect(),r=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");let i=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let o=e.bottom-r.bottom,a=e.left-r.left;return typeof window<"u"&&(window.innerHeight<o+i.height&&o-i.height>=0&&(o=e.top-r.top-i.height),window.innerWidth<a+i.width&&e.right-i.width>=0&&(a=e.right-r.right-i.width)),{left:a,top:o}}},da=Object.freeze({__proto__:null,Core:sa,create:sa}),eo=class{constructor(){Y(this,"picker");Y(this,"options");Y(this,"priority",0);Y(this,"dependencies",[])}attach(t){let e=this.getName(),r={...this.options};this.options={...this.options,...t.options[e]||{}};for(let o of Object.keys(r))if(r[o]!==null&&typeof r[o]=="object"&&Object.keys(r[o]).length&&e in t.options&&o in t.options[e]){let a={...t.options[e][o]};a!==null&&typeof a=="object"&&Object.keys(a).length&&Object.keys(a).every(s=>Object.keys(r[o]).includes(s))&&(this.options[o]={...r[o],...a})}if(this.picker=t,this.dependenciesNotFound()){let o=this.dependencies.filter(a=>!this.pluginsAsStringArray().includes(a));return void console.warn(`${this.getName()}: required dependencies (${o.join(", ")}).`)}let i=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(i),this.onAttach()}detach(){let t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),typeof this.onDetach=="function"&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every(t=>this.pluginsAsStringArray().includes(t))}pluginsAsStringArray(){return this.picker.options.plugins.map(t=>typeof t=="function"?new t().getName():t)}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}},ca=class extends eo{constructor(){super(...arguments);Y(this,"priority",1);Y(this,"binds",{onView:this.onView.bind(this)});Y(this,"options",{minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null})}getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new de(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new de(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof de&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){let e=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(e)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){let e=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}: options ${e.join(", ")} required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(e){let{view:r,target:i,date:o}=e.detail;if(r==="CalendarHeader"&&(this.options.minDate instanceof de&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof de&&o.isSameOrAfter(this.options.maxDate,"month")&&i.classList.add("no-next-month")),r==="CalendarDay"){let a=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(o))return void i.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){let s=o.clone().subtract(this.options.minDays-1,"day"),u=o.clone().add(this.options.minDays-1,"day"),l=!1,h=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){l=!0;break}s.add(1,"day")}for(;u.isAfter(o,"day");){if(this.testFilter(u)){h=!0;break}u.subtract(1,"day")}l&&h&&i.classList.add("not-available")}this.rangeIsNotAvailable(o,a)&&i.classList.add("not-available")}this.dateIsNotAvailable(o,a)&&i.classList.add("not-available")}if(this.options.presets&&r==="PresetPluginButton"){let a=new de(Number(i.dataset.start)),s=new de(Number(i.dataset.end)),u=s.diff(a,"day"),l=this.options.minDays&&u<this.options.minDays,h=this.options.maxDays&&u>this.options.maxDays;(l||h||this.lockMinDate(a)||this.lockMaxDate(a)||this.lockMinDate(s)||this.lockMaxDate(s)||this.rangeIsNotAvailable(a,s))&&i.setAttribute("disabled","disabled")}}dateIsNotAvailable(e,r){return this.lockMinDate(e)||this.lockMaxDate(e)||this.lockMinDays(e,r)||this.lockMaxDays(e,r)||this.lockSelectForward(e)||this.lockSelectBackward(e)}rangeIsNotAvailable(e,r){if(!e||!r)return!1;let i=(e.isSameOrBefore(r,"day")?e:r).clone(),o=(r.isSameOrAfter(e,"day")?r:e).clone();for(;i.isSameOrBefore(o,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(e){return this.options.minDate instanceof de&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof de&&e.isAfter(this.options.maxDate,"day")}lockMinDays(e,r){if(this.options.minDays&&r){let i=r.clone().subtract(this.options.minDays-1,"day"),o=r.clone().add(this.options.minDays-1,"day");return e.isBetween(i,o)}return!1}lockMaxDays(e,r){if(this.options.maxDays&&r){let i=r.clone().subtract(this.options.maxDays,"day"),o=r.clone().add(this.options.maxDays,"day");return!e.isBetween(i,o)}return!1}lockSelectForward(e){if(this.picker.datePicked.length===1&&this.options.selectForward){let r=this.picker.datePicked[0].clone();return e.isBefore(r,"day")}return!1}lockSelectBackward(e){if(this.picker.datePicked.length===1&&this.options.selectBackward){let r=this.picker.datePicked[0].clone();return e.isAfter(r,"day")}return!1}testFilter(e){return typeof this.options.filter=="function"&&this.options.filter(e,this.picker.datePicked)}};var la=class extends eo{constructor(){super(...arguments);Y(this,"tooltipElement");Y(this,"triggerElement");Y(this,"binds",{setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)});Y(this,"options",{elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:e=>e,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)})}getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateValues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),typeof this.picker.options.documentClick=="function"&&(document.removeEventListener("click",this.picker.options.documentClick,!0),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){let[e,r]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?e&&r&&this.setDateRange(e,r):(e&&this.setStartDate(e),r&&this.setEndDate(r))}}updateValues(){let e=this.picker.options.element,r=this.options.elementEnd,i=this.picker.getStartDate(),o=this.picker.getEndDate(),a=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",s=o instanceof Date?o.format(this.picker.options.format,this.picker.options.lang):"";if(r)e instanceof HTMLInputElement?e.value=a:e instanceof HTMLElement&&(e.innerText=a),r instanceof HTMLInputElement?r.value=s:r instanceof HTMLElement&&(r.innerText=s);else{let u=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=u:e instanceof HTMLElement&&(e.innerText=u)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(e){let{target:r}=e.detail;this.triggerElement=r,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(e){let{view:r,target:i}=e.detail;if(r==="Main"&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",i.appendChild(this.tooltipElement)),r==="CalendarDay"){let o=new de(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),u=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&u&&(u.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,u)&&i.classList.add("in-range"))}if(r==="Footer"){let o=this.picker.datePicked.length===1&&!this.options.strict||this.picker.datePicked.length===2;i.querySelector(".apply-button").disabled=!o}}hidePicker(e){let r=e.target,i=null;r.shadowRoot&&(r=e.composedPath()[0],i=r.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&r!==this.picker.options.element&&r!==this.options.elementEnd&&this.picker.hide()}setStartDate(e){let r=new de(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new de(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new de(e,this.picker.options.format),o=new de(r,this.picker.options.format);this.options.startDate=i?i.clone():null,this.options.endDate=o?o.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(e){let r=e.target;if(r instanceof HTMLElement){this.isContainer(r)&&this.initializeRepick();let i=r.closest(".unit");if(!(i instanceof HTMLElement))return;if(this.picker.isCalendarDay(i)){if(this.picker.datePicked.length!==1)return;let o=this.picker.datePicked[0].clone(),a=new de(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let u=o.clone();o=a.clone(),a=u.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(u=>{let l=new de(u.dataset.time),h=this.picker.Calendar.getCalendarDayView(l);l.isBetween(o,a)&&h.classList.add("in-range"),l.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),u===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),u.className=h.className}),this.options.tooltip){let u=this.options.tooltipNumber(a.diff(o,"day")+1);if(u>0){let l=new Intl.PluralRules(this.picker.options.lang).select(u),h=`${u} ${this.options.locale[l]}`;this.showTooltip(i,h)}else this.hideTooltip()}}}}onMouseLeave(e){if(this.isContainer(e.target)&&this.options.repick){let r=this.getStartDate(),i=this.getEndDate();r&&i&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(e){if(this.picker.isCalendarDay(e)){this.picker.datePicked.length===2&&(this.picker.datePicked.length=0);let r=new de(e.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=r,this.picker.datePicked.length===2&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){let i=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=i.clone()}this.picker.datePicked.length!==1&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),this.picker.datePicked.length===1&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),this.picker.datePicked.length===2&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(e){this.picker.isApplyButton(e)&&(this.picker.datePicked.length!==1||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),this.picker.datePicked.length===2&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(e,r){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=r;let i=this.picker.ui.container.getBoundingClientRect(),o=this.tooltipElement.getBoundingClientRect(),a=e.getBoundingClientRect(),s=a.top,u=a.left;s-=i.top,u-=i.left,s-=o.height,u-=o.width/2,u+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${u}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;let e=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],r=Object.keys(this.options.locale);e.every(i=>r.includes(i))||console.warn(`${this.getName()}: provide locales (${e.join(", ")}) for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;let e=this.getStartDate(),r=this.getEndDate();r&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=r),e&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=e)}isContainer(e){return e===this.picker.ui.container}};var ua=class extends eo{constructor(){super(...arguments);Y(this,"rangePlugin");Y(this,"lockPlugin");Y(this,"priority",10);Y(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});Y(this,"options",{dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}});Y(this,"matchMedia")}getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(e){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(e),this.handleResetButton(e),this.handleWeekNumbers(e)}onColorScheme(e){let r=e.matches?"dark":"light";this.picker.ui.container.dataset.theme=r}handleDropdown(e){let{view:r,target:i,date:o,index:a}=e.detail;if(r==="CalendarHeader"){let s=i.querySelector(".month-name");if(this.options.dropdown.months){s.childNodes[0].remove();let u=document.createElement("select");u.className="month-name--select month-name--dropdown";for(let l=0;l<12;l+=1){let h=document.createElement("option"),p=new de(new Date(o.getFullYear(),l,2,0,0,0)),y=new de(new Date(o.getFullYear(),l,1,0,0,0));h.value=String(l),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new de(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new de(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),u.appendChild(h)}u.addEventListener("change",l=>{let h=l.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.value)),this.picker.renderAll()}),s.prepend(u)}if(this.options.dropdown.years){s.childNodes[1].remove();let u=document.createElement("select");u.className="month-name--select";let l=this.options.dropdown.minYear,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,u.appendChild(p)}for(let p=h;p>=l;p-=1){let y=document.createElement("option"),E=new de(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&E.isBefore(new de(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&E.isAfter(new de(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,u.appendChild(y)}if(o.getFullYear()<l){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,u.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(u.childNodes).reverse();u.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,u.appendChild(y)})}u.addEventListener("change",p=>{let y=p.target;this.picker.calendars[0].setFullYear(Number(y.value)),this.picker.renderAll()}),s.appendChild(u)}}}handleResetButton(e){let{view:r,target:i}=e.detail;if(r==="CalendarHeader"&&this.options.resetButton){let o=document.createElement("button");o.className="reset-button unit",o.innerHTML=this.options.locale.resetButton,o.addEventListener("click",a=>{a.preventDefault();let s=!0;typeof this.options.resetButton=="function"&&(s=this.options.resetButton.call(this)),s&&this.picker.clear()}),i.appendChild(o)}}handleWeekNumbers(e){if(this.options.weekNumbers){let{view:r,target:i}=e.detail;if(r==="CalendarDayNames"){let o=document.createElement("div");o.className="wnum-header",o.innerHTML="Wk",i.prepend(o)}r==="CalendarDays"&&[...i.children].forEach((o,a)=>{if(a===0||a%7==0){let s;if(o.classList.contains("day"))s=new de(o.dataset.time);else{let h=i.querySelector(".day");s=new de(h.dataset.time)}let u=s.getWeek(this.picker.options.firstDay);u===53&&s.getMonth()===0&&(u="53/1");let l=document.createElement("div");l.className="wnum-item",l.innerHTML=String(u),i.insertBefore(l,o)}})}}};var ha=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],qn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var ma={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pa=ma;var ot=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},At=function(n){return n===!0?1:0};function vc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var fa=function(n){return n instanceof Array?n:[n]};function at(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Ee(n,t,e){var r=window.document.createElement(n);return t=t||"",e=e||"",r.className=t,e!==void 0&&(r.textContent=e),r}function to(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function bc(n,t){if(t(n))return n;if(n.parentNode)return bc(n.parentNode,t)}function no(n,t){var e=Ee("div","numInputWrapper"),r=Ee("input","numInput "+n),i=Ee("span","arrowUp"),o=Ee("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return e.appendChild(r),e.appendChild(i),e.appendChild(o),e}function Lt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var wc=function(){},ro=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},ld={D:wc,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*At(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var r=parseInt(t),i=new Date(n.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+e.firstDayOfWeek),i},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:wc,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:wc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Pn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Vr={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[Vr.w(n,t,e)]},F:function(n,t,e){return ro(Vr.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ot(Vr.h(n,t,e))},H:function(n){return ot(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[At(n.getHours()>11)]},M:function(n,t){return ro(n.getMonth(),!0,t)},S:function(n){return ot(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ot(n.getFullYear(),4)},d:function(n){return ot(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ot(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ot(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 Dc=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ma:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,u,l){var h=l||i;return e.formatDate!==void 0&&!a?e.formatDate(s,u,h):u.split("").map(function(p,y,E){return Vr[p]&&E[y-1]!=="\\"?Vr[p](s,h,e):p!=="\\"?p:""}).join("")}},ga=function(n){var t=n.config,e=t===void 0?qn:t,r=n.l10n,i=r===void 0?ma:r;return function(o,a,s,u){if(!(o!==0&&!o)){var l=u||i,h,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||qn).dateFormat,E=String(o).trim();if(E==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(E)||/GMT$/.test(E))h=new Date(o);else{for(var M=void 0,k=[],A=0,B=0,V="";A<y.length;A++){var G=y[A],U=G==="\\",J=y[A-1]==="\\"||U;if(Pn[G]&&!J){V+=Pn[G];var oe=new RegExp(V).exec(o);oe&&(M=!0)&&k[G!=="Y"?"push":"unshift"]({fn:ld[G],val:oe[++B]})}else U||(V+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),k.forEach(function(Te){var Se=Te.fn,ie=Te.val;return h=Se(h,ie,l)||h}),h=M?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 Nt(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var ud=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ya=function(n,t,e){return n*3600+t*60+e},dd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},hd={DAY:864e5};function va(n){var t=n.defaultHour,e=n.defaultMinute,r=n.defaultSeconds;if(n.minDate!==void 0){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();t<i&&(t=i),t===i&&e<o&&(e=o),t===i&&e===o&&r<a&&(r=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),u=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(u,e)),t===s&&e===u&&(r=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(u){return n[u]=s[u]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var st=function(){return st=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},st.apply(this,arguments)},md=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},_m=300;function Sm(n,t){var e={config:st(st({},qn),Ue.defaultConfig),l10n:pa};e.parseDate=ga({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=k,e._setHoursFromDate=y,e._positionCalendar=xn,e.changeMonth=_,e.changeYear=ee,e.clear=I,e.close=C,e.onMouseOver=ge,e._createElement=Ee,e.createDay=oe,e.destroy=F,e.isEnabled=q,e.jumpToDate=V,e.updateValue=pn,e.open=Re,e.redraw=ao,e.set=yd,e.setDate=vd,e.toggle=Ed;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,tt(),Wn(),wd(),bd(),r(),e.isMobile||J(),B(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),pn(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&xn(),Ne("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 u(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||Nt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),S=va(e.config);b.setHours(S.hours,S.minutes,S.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&Md(f);var x=e._input.value;p(),pn(),e._input.value!==x&&e._debouncedChange()}function l(f,b){return f%12+12*At(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,S=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(f=l(f,e.amPM.textContent));var x=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Nt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var K=ya(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),he=ya(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Q=ya(f,b,S);if(Q>he&&Q<K){var ye=dd(K);f=ye[0],b=ye[1],S=ye[2]}}else{if(z){var X=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,X.getHours()),f===X.getHours()&&(b=Math.min(b,X.getMinutes())),b===X.getMinutes()&&(S=Math.min(S,X.getSeconds()))}if(x){var ae=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,ae.getHours()),f===ae.getHours()&&b<ae.getMinutes()&&(b=ae.getMinutes()),b===ae.getMinutes()&&(S=Math.max(S,ae.getSeconds()))}}E(f,b,S)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&E(b.getHours(),b.getMinutes(),b.getSeconds())}function E(f,b,S){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(f%24,b,S||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=ot(e.config.time_24hr?f:(12+f)%12+12*At(f%12===0)),e.minuteElement.value=ot(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[At(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ot(S)))}function M(f){var b=Lt(f),S=parseInt(b.value)+(f.delta||0);(S/1e3>1||f.key==="Enter"&&!/[^\d]/.test(S.toString()))&&ee(S)}function k(f,b,S,x){if(b instanceof Array)return b.forEach(function(z){return k(f,z,S,x)});if(f instanceof Array)return f.forEach(function(z){return k(z,b,S,x)});f.addEventListener(b,S,x),e._handlers.push({remove:function(){return f.removeEventListener(b,S,x)}})}function A(){Ne("onChange")}function B(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(S){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+S+"]"),function(x){return k(x,"click",e[S])})}),e.isMobile){Dd();return}var f=vc(we,50);if(e._debouncedChange=vc(A,_m),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&k(e.daysContainer,"mouseover",function(S){e.config.mode==="range"&&ge(Lt(S))}),k(e._input,"keydown",le),e.calendarContainer!==void 0&&k(e.calendarContainer,"keydown",le),!e.config.inline&&!e.config.static&&k(window,"resize",f),window.ontouchstart!==void 0?k(window.document,"touchstart",W):k(window.document,"mousedown",W),k(window.document,"focus",W,{capture:!0}),e.config.clickOpens===!0&&(k(e._input,"focus",e.open),k(e._input,"click",e.open)),e.daysContainer!==void 0&&(k(e.monthNav,"click",Sd),k(e.monthNav,["keyup","increment"],M),k(e.daysContainer,"click",Ec)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(S){return Lt(S).select()};k(e.timeContainer,["increment"],u),k(e.timeContainer,"blur",u,{capture:!0}),k(e.timeContainer,"click",G),k([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&k(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&k(e.amPM,"click",function(S){u(S)})}e.config.allowInput&&k(e._input,"blur",re)}function V(f,b){var S=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),x=e.currentYear,z=e.currentMonth;try{S!==void 0&&(e.currentYear=S.getFullYear(),e.currentMonth=S.getMonth())}catch(K){K.message="Invalid date supplied: "+S,e.config.errorHandler(K)}b&&e.currentYear!==x&&(Ne("onYearChange"),ne()),b&&(e.currentYear!==x||e.currentMonth!==z)&&Ne("onMonthChange"),e.redraw()}function G(f){var b=Lt(f);~b.className.indexOf("arrow")&&U(f,b.classList.contains("arrowUp")?1:-1)}function U(f,b,S){var x=f&&Lt(f),z=S||x&&x.parentNode&&x.parentNode.firstChild,K=Da("increment");K.delta=b,z&&z.dispatchEvent(K)}function J(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Ee("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Ee("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=w(),S=b.weekWrapper,x=b.weekNumbers;e.innerContainer.appendChild(S),e.weekNumbers=x,e.weekWrapper=S}e.rContainer=Ee("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Ee("div","flatpickr-days"),e.daysContainer.tabIndex=-1),O(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),at(e.calendarContainer,"rangeMode",e.config.mode==="range"),at(e.calendarContainer,"animate",e.config.animate===!0),at(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var K=Ee("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(K,e.element),K.appendChild(e.element),e.altInput&&K.appendChild(e.altInput),K.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function oe(f,b,S,x){var z=q(b,!0),K=Ee("span",f,b.getDate().toString());return K.dateObj=b,K.$i=x,K.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&Nt(b,e.now)===0&&(e.todayDateElem=K,K.classList.add("today"),K.setAttribute("aria-current","date")),z?(K.tabIndex=-1,Ea(b)&&(K.classList.add("selected"),e.selectedDateElem=K,e.config.mode==="range"&&(at(K,"startRange",e.selectedDates[0]&&Nt(b,e.selectedDates[0],!0)===0),at(K,"endRange",e.selectedDates[1]&&Nt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&K.classList.add("inRange")))):K.classList.add("flatpickr-disabled"),e.config.mode==="range"&&_d(b)&&!Ea(b)&&K.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&x%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Ne("onDayCreate",K),K}function Te(f){f.focus(),e.config.mode==="range"&&ge(f)}function Se(f){for(var b=f>0?0:e.config.showMonths-1,S=f>0?e.config.showMonths:-1,x=b;x!=S;x+=f)for(var z=e.daysContainer.children[x],K=f>0?0:z.children.length-1,he=f>0?z.children.length:-1,Q=K;Q!=he;Q+=f){var ye=z.children[Q];if(ye.className.indexOf("hidden")===-1&&q(ye.dateObj))return ye}}function ie(f,b){for(var S=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,x=b>0?e.config.showMonths:-1,z=b>0?1:-1,K=S-e.currentMonth;K!=x;K+=z)for(var he=e.daysContainer.children[K],Q=S-e.currentMonth===K?f.$i+b:b<0?he.children.length-1:0,ye=he.children.length,X=Q;X>=0&&X<ye&&X!=(b>0?ye:-1);X+=z){var ae=he.children[X];if(ae.className.indexOf("hidden")===-1&&q(ae.dateObj)&&Math.abs(f.$i-X)>=Math.abs(b))return Te(ae)}e.changeMonth(z),N(Se(z),0)}function N(f,b){var S=o(),x=j(S||document.body),z=f!==void 0?f:x?S:e.selectedDateElem!==void 0&&j(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&j(e.todayDateElem)?e.todayDateElem:Se(b>0?1:-1);z===void 0?e._input.focus():x?ie(z,b):Te(z)}function H(f,b){for(var S=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,x=e.utils.getDaysInMonth((b-1+12)%12,f),z=e.utils.getDaysInMonth(b,f),K=window.document.createDocumentFragment(),he=e.config.showMonths>1,Q=he?"prevMonthDay hidden":"prevMonthDay",ye=he?"nextMonthDay hidden":"nextMonthDay",X=x+1-S,ae=0;X<=x;X++,ae++)K.appendChild(oe("flatpickr-day "+Q,new Date(f,b-1,X),X,ae));for(X=1;X<=z;X++,ae++)K.appendChild(oe("flatpickr-day",new Date(f,b,X),X,ae));for(var Ce=z+1;Ce<=42-S&&(e.config.showMonths===1||ae%7!==0);Ce++,ae++)K.appendChild(oe("flatpickr-day "+ye,new Date(f,b+1,Ce%z),Ce,ae));var rn=Ee("div","dayContainer");return rn.appendChild(K),rn}function O(){if(e.daysContainer!==void 0){to(e.daysContainer),e.weekNumbers&&to(e.weekNumbers);for(var f=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var S=new Date(e.currentYear,e.currentMonth,1);S.setMonth(e.currentMonth+b),f.appendChild(H(S.getFullYear(),S.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&ge()}}function ne(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(x){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&x<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&x>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var S=Ee("option","flatpickr-monthDropdown-month");S.value=new Date(e.currentYear,b).getMonth().toString(),S.textContent=ro(b,e.config.shorthandCurrentMonth,e.l10n),S.tabIndex=-1,e.currentMonth===b&&(S.selected=!0),e.monthsDropdownContainer.appendChild(S)}}}function g(){var f=Ee("div","flatpickr-month"),b=window.document.createDocumentFragment(),S;e.config.showMonths>1||e.config.monthSelectorType==="static"?S=Ee("span","cur-month"):(e.monthsDropdownContainer=Ee("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),k(e.monthsDropdownContainer,"change",function(he){var Q=Lt(he),ye=parseInt(Q.value,10);e.changeMonth(ye-e.currentMonth),Ne("onMonthChange")}),ne(),S=e.monthsDropdownContainer);var x=no("cur-year",{tabindex:"-1"}),z=x.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var K=Ee("div","flatpickr-current-month");return K.appendChild(S),K.appendChild(x),b.appendChild(K),f.appendChild(b),{container:f,yearElement:z,monthElement:S}}function L(){to(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=Ee("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Ee("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Ee("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,L(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(at(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(at(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],co(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=va(e.config);e.timeContainer=Ee("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Ee("span","flatpickr-time-separator",":"),S=no("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=S.getElementsByTagName("input")[0];var x=no("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=x.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ot(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ot(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(S),e.timeContainer.appendChild(b),e.timeContainer.appendChild(x),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=no("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=ot(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(Ee("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=Ee("span","flatpickr-am-pm",e.l10n.amPM[At((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function v(){e.weekdayContainer?to(e.weekdayContainer):e.weekdayContainer=Ee("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Ee("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return D(),e.weekdayContainer}function D(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=md(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=md(b.splice(f,b.length),b.splice(0,f)));for(var S=e.config.showMonths;S--;)e.weekdayContainer.children[S].innerHTML=`
4
4
  <span class='flatpickr-weekday'>
5
5
  `+b.join("</span><span class='flatpickr-weekday'>")+`
6
6
  </span>
7
- `}}function w(){e.calendarContainer.classList.add("hasWeeks");var f=Ee("div","flatpickr-weekwrapper");f.appendChild(Ee("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Ee("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,Ne("onYearChange"),ne()),O(),Ne("onMonthChange"),co())}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=va(e.config),x=M.hours,z=M.minutes,K=M.seconds;E(x,z,K)}e.redraw(),f&&Ne("onChange")}function C(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Ne("onClose")}function F(){e.config!==void 0&&Ne("onDestroy");for(var 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 R(f){return e.calendarContainer.contains(f)}function W(f){if(e.isOpen&&!e.config.inline){var b=Lt(f),M=R(b),x=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)),z=!x&&!M&&!R(f.relatedTarget),K=!e.config.ignoredFocusElements.some(function(he){return he.contains(b)});z&&K&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ee(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(),Ne("onYearChange"),ne())}}function q(f,b){var M;b===void 0&&(b=!0);var x=e.parseDate(f,void 0,b);if(e.config.minDate&&x&&Nt(x,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&x&&Nt(x,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(x===void 0)return!1;for(var z=!!e.config.enable,K=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,he=0,Q=void 0;he<K.length;he++){if(Q=K[he],typeof Q=="function"&&Q(x))return z;if(Q instanceof Date&&x!==void 0&&Q.getTime()===x.getTime())return z;if(typeof Q=="string"){var ye=e.parseDate(Q,void 0,!0);return ye&&ye.getTime()===x.getTime()?z:!z}else if(typeof Q=="object"&&x!==void 0&&Q.from&&Q.to&&x.getTime()>=Q.from.getTime()&&x.getTime()<=Q.to.getTime())return z}return!z}function j(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function re(f){var b=f.target===e._input,M=e._input.value.trimEnd()!==_a();b&&M&&!(f.relatedTarget&&R(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function le(f){var b=Lt(f),M=e.config.wrap?n.contains(b):b===e._input,x=e.config.allowInput,z=e.isOpen&&(!x||!M),K=e.config.inline&&M&&!x;if(f.keyCode===13&&M){if(x)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(R(b)||z||K){var he=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:he?(f.preventDefault(),u(),wa()):Ec(f);break;case 27:f.preventDefault(),wa();break;case 8:case 46:M&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!he&&!M){f.preventDefault();var Q=o();if(e.daysContainer!==void 0&&(x===!1||Q&&j(Q))){var ye=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(ye),N(Me(1),0)):N(void 0,ye)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var X=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),ee(e.currentYear-X),N(Me(1),0)):he||N(void 0,X*7):b===e.currentYearElement?ee(e.currentYear-X):e.config.enableTime&&(!he&&e.hourElement&&e.hourElement.focus(),u(f),e._debouncedChange());break;case 9:if(he){var ae=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ot){return Ot}),Ce=ae.indexOf(b);if(Ce!==-1){var rn=ae[Ce+(f.shiftKey?-1:1)];f.preventDefault(),(rn||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(),pn();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),pn();break}(M||R(b))&&Ne("onKeyDown",f)}function ge(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(),x=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),z=Math.min(M,e.selectedDates[0].getTime()),K=Math.max(M,e.selectedDates[0].getTime()),he=!1,Q=0,ye=0,X=z;X<K;X+=hd.DAY)q(new Date(X),!0)||(he=he||X>z&&X<K,X<x&&(!Q||X>Q)?Q=X:X>x&&(!ye||X<ye)&&(ye=X));var ae=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));ae.forEach(function(Ce){var rn=Ce.dateObj,Ot=rn.getTime(),Kr=Q>0&&Ot<Q||ye>0&&Ot>ye;if(Kr){Ce.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(pr){Ce.classList.remove(pr)});return}else if(he&&!Kr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(pr){Ce.classList.remove(pr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),x<M&&Ot===x?Ce.classList.add("startRange"):x>M&&Ot===x&&Ce.classList.add("endRange"),Ot>=Q&&(ye===0||Ot<=ye)&&ud(Ot,x,M)&&Ce.classList.add("inRange"))})}}function we(){e.isOpen&&!e.config.static&&!e.config.inline&&xn()}function Re(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var M=Lt(f);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;var x=e.isOpen;e.isOpen=!0,x||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Ne("onOpen"),xn(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 ze(f){return function(b){var M=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),x=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(z){return q(z)}),!e.selectedDates.length&&f==="min"&&y(M),pn()),e.daysContainer&&(ao(),M!==void 0?e.currentYearElement[f]=M.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!x&&M!==void 0&&x.getFullYear()===M.getFullYear())}}function tt(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=st(st({},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(ae){e.config._enable=Mc(ae)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ae){e.config._disable=Mc(ae)}});var x=b.mode==="time";if(!b.dateFormat&&(b.enableTime||x)){var z=Ue.defaultConfig.dateFormat||qn.dateFormat;M.dateFormat=b.noCalendar||x?"H:i"+(b.enableSeconds?":S":""):z+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||x)&&!b.altFormat){var K=Ue.defaultConfig.altFormat||qn.altFormat;M.altFormat=b.noCalendar||x?"h:i"+(b.enableSeconds?":S K":" K"):K+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:ze("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:ze("max")});var he=function(ae){return function(Ce){e.config[ae==="min"?"_minTime":"_maxTime"]=e.parseDate(Ce,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:he("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:he("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,b);for(var Q=0;Q<f.length;Q++)e.config[f[Q]]=e.config[f[Q]]===!0||e.config[f[Q]]==="true";ha.filter(function(ae){return e.config[ae]!==void 0}).forEach(function(ae){e.config[ae]=fa(e.config[ae]||[]).map(a)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Q=0;Q<e.config.plugins.length;Q++){var ye=e.config.plugins[Q](e)||{};for(var X in ye)ha.indexOf(X)>-1?e.config[X]=fa(ye[X]).map(a).concat(e.config[X]):typeof b[X]>"u"&&(e.config[X]=ye[X])}b.altInputClass||(e.config.altInputClass=Vt().className+" "+e.config.altInputClass),Ne("onParseConfig")}function Vt(){return e.config.wrap?n.querySelector("[data-input]"):n}function Wn(){typeof e.config.locale!="object"&&typeof Ue.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=st(st({},Ue.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?Ue.l10ns[e.config.locale]:void 0),Pn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Pn.l="("+e.l10n.weekdays.longhand.join("|")+")",Pn.M="("+e.l10n.months.shorthand.join("|")+")",Pn.F="("+e.l10n.months.longhand.join("|")+")",Pn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=st(st({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&Ue.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Dc(e),e.parseDate=ga({config:e.config,l10n:e.l10n})}function xn(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Ne("onPreCalendarPosition");var b=f||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(Ad,Ld){return Ad+Ld.offsetHeight},0),x=e.calendarContainer.offsetWidth,z=e.config.position.split(" "),K=z[0],he=z.length>1?z[1]:null,Q=b.getBoundingClientRect(),ye=window.innerHeight-Q.bottom,X=K==="above"||K!=="below"&&ye<M&&Q.top>M,ae=window.pageYOffset+Q.top+(X?-M-2:b.offsetHeight+2);if(at(e.calendarContainer,"arrowTop",!X),at(e.calendarContainer,"arrowBottom",X),!e.config.inline){var Ce=window.pageXOffset+Q.left,rn=!1,Ot=!1;he==="center"?(Ce-=(x-Q.width)/2,rn=!0):he==="right"&&(Ce-=x-Q.width,Ot=!0),at(e.calendarContainer,"arrowLeft",!rn&&!Ot),at(e.calendarContainer,"arrowCenter",rn),at(e.calendarContainer,"arrowRight",Ot);var Kr=window.document.body.offsetWidth-(window.pageXOffset+Q.right),pr=Ce+x>window.document.body.offsetWidth,kd=Kr+x>window.document.body.offsetWidth;if(at(e.calendarContainer,"rightMost",pr),!e.config.static)if(e.calendarContainer.style.top=ae+"px",!pr)e.calendarContainer.style.left=Ce+"px",e.calendarContainer.style.right="auto";else if(!kd)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Kr+"px";else{var Ma=Wr();if(Ma===void 0)return;var Td=window.document.body.offsetWidth,Cd=Math.max(0,Td/2-x/2),Id=".flatpickr-calendar.centerMost:before",Pd=".flatpickr-calendar.centerMost:after",xd=Ma.cssRules.length,Rd="{left:"+Q.left+"px;right:auto;}";at(e.calendarContainer,"rightMost",!1),at(e.calendarContainer,"centerMost",!0),Ma.insertRule(Id+","+Pd+Rd,xd),e.calendarContainer.style.left=Cd+"px",e.calendarContainer.style.right="auto"}}}}function Wr(){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??oo()}function oo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function ao(){e.config.noCalendar||e.isMobile||(ne(),co(),O())}function wa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function Ec(f){f.preventDefault(),f.stopPropagation();var b=function(ae){return ae.classList&&ae.classList.contains("flatpickr-day")&&!ae.classList.contains("flatpickr-disabled")&&!ae.classList.contains("notAllowed")},M=bc(Lt(f),b);if(M!==void 0){var x=M,z=e.latestSelectedDateObj=new Date(x.dateObj.getTime()),K=(z.getMonth()<e.currentMonth||z.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=x,e.config.mode==="single")e.selectedDates=[z];else if(e.config.mode==="multiple"){var he=Ea(z);he?e.selectedDates.splice(parseInt(he),1):e.selectedDates.push(z)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=z,e.selectedDates.push(z),Nt(z,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(ae,Ce){return ae.getTime()-Ce.getTime()}));if(p(),K){var Q=e.currentYear!==z.getFullYear();e.currentYear=z.getFullYear(),e.currentMonth=z.getMonth(),Q&&(Ne("onYearChange"),ne()),Ne("onMonthChange")}if(co(),O(),pn(),!K&&e.config.mode!=="range"&&e.config.showMonths===1?Te(x):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 ye=e.config.mode==="single"&&!e.config.enableTime,X=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(ye||X)&&wa()}A()}}var so={locale:[Wn,D],showMonths:[L,s,v],minDate:[V],maxDate:[V],positionElement:[Sc],clickOpens:[function(){e.config.clickOpens===!0?(k(e._input,"focus",e.open),k(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function yd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var M in f)so[M]!==void 0&&so[M].forEach(function(x){return x()})}else e.config[f]=b,so[f]!==void 0?so[f].forEach(function(x){return x()}):ha.indexOf(f)>-1&&(e.config[f]=fa(b));e.redraw(),pn(!0)}function _c(f,b){var M=[];if(f instanceof Array)M=f.map(function(x){return e.parseDate(x,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(x){return e.parseDate(x,b)});break;case"range":M=f.split(e.l10n.rangeSeparator).map(function(x){return e.parseDate(x,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(x){return x instanceof Date&&q(x,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(x,z){return x.getTime()-z.getTime()})}function vd(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);_c(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),V(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),pn(b),b&&Ne("onChange")}function Mc(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 bd(){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&&_c(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 wd(){if(e.input=Vt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Ee(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),Sc()}function Sc(){e._positionElement=e.config.positionElement||e._input}function Dd(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Ee("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=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{}k(e.mobileInput,"change",function(b){e.setDate(Lt(b).value,!1,e.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function Ed(f){if(e.isOpen===!0)return e.close();e.open(f)}function Ne(f,b){if(e.config!==void 0){var M=e.config[f];if(M!==void 0&&M.length>0)for(var x=0;M[x]&&x<M.length;x++)M[x](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Da("change")),e.input.dispatchEvent(Da("input")))}}function Da(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function Ea(f){for(var b=0;b<e.selectedDates.length;b++){var M=e.selectedDates[b];if(M instanceof Date&&Nt(M,f)===0)return""+b}return!1}function _d(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Nt(f,e.selectedDates[0])>=0&&Nt(f,e.selectedDates[1])<=0}function co(){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=ro(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,x,z){return e.config.mode!=="range"||e.config.enableTime||z.indexOf(M)===x}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function pn(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&&Ne("onValueUpdate")}function Md(f){var b=Lt(f),M=e.prevMonthNav.contains(b),x=e.nextMonthNav.contains(b);M||x?_(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 Sd(f){f.preventDefault();var b=f.type==="keydown",M=Lt(f),x=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]);var z=parseFloat(x.getAttribute("min")),K=parseFloat(x.getAttribute("max")),he=parseFloat(x.getAttribute("step")),Q=parseInt(x.value,10),ye=f.delta||(b?f.which===38?1:-1:0),X=Q+he*ye;if(typeof x.value<"u"&&x.value.length===2){var ae=x===e.hourElement,Ce=x===e.minuteElement;X<z?(X=K+X+At(!ae)+(At(ae)&&At(!e.amPM)),Ce&&U(void 0,-1,e.hourElement)):X>K&&(X=x===e.hourElement?X-K-At(!e.amPM):z,Ce&&U(void 0,1,e.hourElement)),e.amPM&&ae&&(he===1?X+Q===23:Math.abs(X-Q)>he)&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]),x.value=ot(X)}}return i(),e}function qr(n,t){for(var e=Array.prototype.slice.call(n).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<e.length;i++){var o=e[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=Mm(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return qr(this,n)},HTMLElement.prototype.flatpickr=function(n){return qr([this],n)});var Ue=function(n,t){return typeof n=="string"?qr(window.document.querySelectorAll(n),t):n instanceof Node?qr([n],t):qr(n,t)};Ue.defaultConfig={};Ue.l10ns={en:st({},pa),default:st({},pa)};Ue.localize=function(n){Ue.l10ns.default=st(st({},Ue.l10ns.default),n)};Ue.setDefaults=function(n){Ue.defaultConfig=st(st({},Ue.defaultConfig),n)};Ue.parseDate=ga({});Ue.formatDate=Dc({});Ue.compareDates=Nt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return qr(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Ue);var pd=Ue;var io=class{constructor(t,e){this.dateInputEl=t;Y(this,"minDate");Y(this,"maxDate");Y(this,"defaultReservationDays");Y(this,"hasPrices",!1);Y(this,"prices",{});Y(this,"availability",{});Y(this,"disabledDates",[]);Y(this,"selectedStartDate");Y(this,"selectedEndDate");Y(this,"config");Y(this,"instance");Y(this,"destroyInstance");Y(this,"currentDate");Y(this,"handleResize",()=>{let t=this.isMobileDevice();(t&&this.config.grid!==1||!t&&this.config.grid!==2)&&(this.config.grid=t?1:2,this.config.calendars=t?1:2,this.destroyInstance&&this.destroyInstance(),this.initialize())});this.isMobileDevice()&&(e.grid=1,e.calendars=1),this.dateInputEl=t,this.defaultReservationDays=e.defaultReservationDays??3;let r=e.startWithEmptyDates??!1;this.config={...e,type:e.type,showPrices:e.showPrices??!1,defaultReservationDays:this.defaultReservationDays,grid:e.grid??2,calendars:e.calendars??2,darkMode:e.darkMode??!0,tooltip:e.tooltip??!0,repick:e.repick??!1,minDays:e.minDays??1,defaultStartDate:e.defaultStartDate??Z.getCurrentDate(),defaultEndDate:e.defaultEndDate??Z.getCurrentDate(),startWithEmptyDates:r},this.currentDate=Z.getCurrentDate(),this.selectedStartDate=r?null:this.config.defaultStartDate,this.selectedEndDate=r?null:this.config.defaultEndDate}isMobileDevice(){return window.innerWidth<=768}initialize(){switch(window.addEventListener("resize",this.handleResize),this.config.type){case"easepick":this.initEasepickCalendar();break;case"flatpickr":this.initFlatpickrCalendar();break;default:throw new Error(`Unsupported calendar type: ${this.config.type}`)}}setMinimumDate(t){this.minDate=t}setMaximumDate(t){this.maxDate=t}setStartDate(t){let e=Z.toJSDate(t),r=this.selectedEndDate?Z.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof da.Core?this.instance.setStartDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?Z.toJSDate(this.selectedStartDate):Z.toJSDate(t),r=Z.toJSDate(t);this.selectedEndDate=t,this.instance instanceof da.Core?this.instance.setEndDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setDateRange(t,e){if(this.config.type==="flatpickr"){this.selectedStartDate=t,this.selectedEndDate=e;let r=Z.toJSDate(t),i=Z.toJSDate(e);this.instance.setDate([r,i],!0);return}this.setStartDate(t),this.setEndDate(e)}getSelectedDates(){return{startDate:this.selectedStartDate,endDate:this.selectedEndDate}}includePrices(t=!0){this.hasPrices=t}setPrices(t){this.prices=t}setAvailability(t){this.availability=t,this.disabledDates=Object.keys(t).filter(e=>!t[e])}initEasepickCalendar(){let t={tooltip:this.config.tooltip,repick:this.config.repick,tooltipNumber:i=>i-1,locale:{one:"nuit",other:"nuits"}};this.config.startWithEmptyDates||(t.startDate=new de(this.config.defaultStartDate.toString()),t.endDate=new de(this.config.defaultEndDate.toString()));let e={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:zu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new de(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[ua,la,ca],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:u}=o.detail,l=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&l&&this.prices[l]){let h=this.prices[l],p=u.querySelector(`.${ea}`)||document.createElement("span");p.className=ea,p.textContent=`${h.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",u.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=Z.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=Z.fromString(s.format("YYYY-MM-DD"));let u={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};qe("date:changed",u)})}},r=new da.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=du(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Uu,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=je("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=Z.fromJSDate(o[0]),this.selectedEndDate=null,qe("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=Z.fromJSDate(o[0]),this.selectedEndDate=Z.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(qe("date:changed",s),a){let u=this.formatDate(o[0]),l=this.formatDate(o[1]);a.textContent=`${u} - ${l}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(Z.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,qe("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,u)=>{let l=u.dateObj,h=Z.fromJSDate(l),p=Z.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],E=document.createElement("span");E.style.marginTop="2px",E.style.color="#c64509",E.style.fontSize="10px",E.style.fontWeight="bold",E.className=ea,E.textContent=`${y.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,u.style.display="flex",u.style.flexDirection="column",u.style.alignItems="center",u.style.justifyContent="center",u.style.lineHeight="1.1",u.appendChild(E)}}});let i=pd(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=Z.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return tn==="en"?`${r}/${i}/${o}`:tn==="fr-FR"||tn==="de"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var e0=Be({}),t0=Be([]);var h0=Be({});var ba=class{constructor(t,e=oc){this.fsListInstance=t;this.includePrices=e;Y(this,"element");Y(this,"apartmentInputEl");Y(this,"dateInputEl");Y(this,"dateClearEl");Y(this,"guestsInputEl");Y(this,"chambresInputEl");Y(this,"calendarInstance");Y(this,"dateLabelPlaceholder","");Y(this,"uniqueEnterprises",[]);Y(this,"state",{startDate:fe.startDate?Z.safeParsePlainDate(fe.startDate):null,endDate:fe.endDate?Z.safeParsePlainDate(fe.endDate):null});Y(this,"populateApartmentsInput",()=>{if(!this.apartmentInputEl||!this.fsListInstance)return;let t=document.createDocumentFragment(),e=this.apartmentInputEl.querySelector("option");e&&t.appendChild(e),this.uniqueEnterprises.forEach(r=>{let i=document.createElement("option");i.value=r.id,i.textContent=r.title,t.appendChild(i)}),this.apartmentInputEl.replaceChildren(t),Ur(this.apartmentInputEl,"input",async r=>{let i=r.target,o=Xi(i);qe("apartment:changed",o)}),fe.enterpriseId&&Qi(this.apartmentInputEl,fe.enterpriseId||"")});Y(this,"populateCalendarInput",async t=>{if(!this.dateInputEl)return;this.dateInputEl.style.cursor="pointer";let e=!!(this.state.startDate&&this.state.endDate),r=new io(this.dateInputEl,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,startWithEmptyDates:!e,...e&&{defaultStartDate:this.state.startDate,defaultEndDate:this.state.endDate}});if(r.setMinimumDate(dr),r.setMaximumDate(jr),r.includePrices(this.includePrices),this.includePrices){let i=await fc(this.uniqueEnterprises.map(o=>o.id).filter(o=>o!==t||t==null));r.setPrices(i)}return r.initialize(),r});if(this.element=je("booking-component"),!this.element)throw new Error("Filters component not found");this.apartmentInputEl=je("location-input",this.element),this.dateInputEl=je("date-input",this.element),this.dateClearEl=je("date-clear",this.element),this.guestsInputEl=je("guests-input",this.element),this.chambresInputEl=je("rooms-input",this.element),this.uniqueEnterprises=[];let r=new Set;this.fsListInstance.items.value.forEach(i=>{r.has(i.fields["enterprise-id"].value)||(r.add(i.fields["enterprise-id"].value),this.uniqueEnterprises.push({id:i.fields["enterprise-id"].value,title:i.fields.title.value}))}),et("loading:start",i=>hr(!0,i)),et("loading:end",i=>hr(!1,i)),et("apartment:changed",async i=>{i.length===0?fe.enterpriseId=null:fe.enterpriseId=i,this.calendarInstance&&fe.enterpriseId&&await this.updateCalendarForSelectedApartment(fe.enterpriseId)}),et("date:changed",async i=>{fe.startDate=i.startDate||null,fe.endDate=i.endDate||null,this.updateDateClearVisibility()}),et("guests:changed",async i=>{fe.guests=parseInt(i)}),et("n_rooms:changed",async i=>{fe.rooms=parseInt(i)}),et("coupon:changed",async i=>{fe.coupon=i}),et(["apartment:changed","date:changed","guests:changed","coupon:changed"],async()=>{})}async init(){qe("loading:start",this.element);try{if(this.apartmentInputEl&&this.populateApartmentsInput(),this.guestsInputEl&&this.populateGuestsInput(),this.chambresInputEl&&this.populateChambresInput(),this.dateInputEl){let t=je("label",this.dateInputEl);this.dateLabelPlaceholder=t?.textContent?.trim()??"",this.calendarInstance=await this.populateCalendarInput(),this.state.startDate&&this.state.endDate?this.calendarInstance?.setDateRange(this.state.startDate,this.state.endDate):this.fsListInstance.triggerHook("filter"),this.updateDateClearVisibility(),this.setupDateClearClickHandler()}return this}catch(t){throw t instanceof Error?console.error("Error initializing BookingComponent",t.name):console.error("Error initializing BookingComponent",t),t}}updateDateClearVisibility(){if(!this.dateClearEl)return;let t=!!(fe.startDate&&fe.endDate);this.dateClearEl.style.display=t?"flex":"none"}setupDateClearClickHandler(){this.dateClearEl&&Ur(this.dateClearEl,"click",t=>{t.preventDefault(),fe.startDate=null,fe.endDate=null,this.state.startDate=null,this.state.endDate=null,this.calendarInstance?.clear();let e=this.dateInputEl?je("label",this.dateInputEl):null;e&&(e.textContent=this.dateLabelPlaceholder),qe("date:changed",{startDate:"",endDate:""}),this.updateDateClearVisibility()})}populateGuestsInput(){if(!this.guestsInputEl){console.warn("guests dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.guestsInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(a=>{r.add(a.fields.guests.value)});let i=Math.max(...Array.from(r).map(Number)),o=a=>`${a} ${ke(a===1?"guestSingular":"guestPlural")}`;for(let a=1;a<=i;a++){let s=document.createElement("option");s.value=a.toString(),s.textContent=o(a),t.appendChild(s)}this.guestsInputEl.replaceChildren(t),Ur(this.guestsInputEl,"input",async a=>{let s=a.target,u=Xi(s);qe("guests:changed",u)}),fe.guests&&Qi(this.guestsInputEl,fe.guests.toString())}populateChambresInput(){if(!this.chambresInputEl){console.warn("rooms dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.chambresInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(o=>{r.add(o.fields.rooms.value)});let i=Math.max(...Array.from(r).map(Number));for(let o=1;o<=i;o++){let a=document.createElement("option");a.value=o.toString(),a.textContent=o.toString(),t.appendChild(a)}this.chambresInputEl.replaceChildren(t),Ur(this.chambresInputEl,"input",async o=>{let a=o.target,s=Xi(a);qe("n_rooms:changed",s)}),fe.rooms&&Qi(this.chambresInputEl,fe.rooms.toString())}async updateCalendarForSelectedApartment(t){if(this.dateInputEl)try{this.calendarInstance&&(this.calendarInstance.destroy?.(),this.calendarInstance=void 0),this.calendarInstance=await this.populateCalendarInput(t)}catch(e){console.error("Error updating calendar for selected apartment:",e)}}};var gd;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(gd||(gd={}));function Sm(n){let t=n.find(i=>i.instance==="apparthotels");if(!t)throw new Error("List instance not found");new ba(t).init().then(i=>{qe("loading:end",i?.element)}).catch(i=>{throw qu(!0,void 0),console.error("Error initializing filters component:",i),i});let r=new ia(t);r.showUnavailableItems=!0,r.init()}window.FinsweetAttributes=window.FinsweetAttributes||[];window.FinsweetAttributes.push(["list",async n=>{Sm(n)}]);export{Sm as initApparthotelsTemplate};
7
+ `}}function w(){e.calendarContainer.classList.add("hasWeeks");var f=Ee("div","flatpickr-weekwrapper");f.appendChild(Ee("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Ee("div","flatpickr-weeks");return f.appendChild(b),{weekWrapper:f,weekNumbers:b}}function _(f,b){b===void 0&&(b=!0);var S=b?f:f-e.currentMonth;S<0&&e._hidePrevMonthArrow===!0||S>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=S,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Ne("onYearChange"),ne()),O(),Ne("onMonthChange"),co())}function I(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 S=va(e.config),x=S.hours,z=S.minutes,K=S.seconds;E(x,z,K)}e.redraw(),f&&Ne("onChange")}function C(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Ne("onClose")}function F(){e.config!==void 0&&Ne("onDestroy");for(var 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(S){try{delete e[S]}catch{}})}function R(f){return e.calendarContainer.contains(f)}function W(f){if(e.isOpen&&!e.config.inline){var b=Lt(f),S=R(b),x=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)),z=!x&&!S&&!R(f.relatedTarget),K=!e.config.ignoredFocusElements.some(function(he){return he.contains(b)});z&&K&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ee(f){if(!(!f||e.config.minDate&&f<e.config.minDate.getFullYear()||e.config.maxDate&&f>e.config.maxDate.getFullYear())){var b=f,S=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)),S&&(e.redraw(),Ne("onYearChange"),ne())}}function q(f,b){var S;b===void 0&&(b=!0);var x=e.parseDate(f,void 0,b);if(e.config.minDate&&x&&Nt(x,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&x&&Nt(x,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(x===void 0)return!1;for(var z=!!e.config.enable,K=(S=e.config.enable)!==null&&S!==void 0?S:e.config.disable,he=0,Q=void 0;he<K.length;he++){if(Q=K[he],typeof Q=="function"&&Q(x))return z;if(Q instanceof Date&&x!==void 0&&Q.getTime()===x.getTime())return z;if(typeof Q=="string"){var ye=e.parseDate(Q,void 0,!0);return ye&&ye.getTime()===x.getTime()?z:!z}else if(typeof Q=="object"&&x!==void 0&&Q.from&&Q.to&&x.getTime()>=Q.from.getTime()&&x.getTime()<=Q.to.getTime())return z}return!z}function j(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function re(f){var b=f.target===e._input,S=e._input.value.trimEnd()!==_a();b&&S&&!(f.relatedTarget&&R(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function le(f){var b=Lt(f),S=e.config.wrap?n.contains(b):b===e._input,x=e.config.allowInput,z=e.isOpen&&(!x||!S),K=e.config.inline&&S&&!x;if(f.keyCode===13&&S){if(x)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(R(b)||z||K){var he=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:he?(f.preventDefault(),u(),wa()):Ec(f);break;case 27:f.preventDefault(),wa();break;case 8:case 46:S&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!he&&!S){f.preventDefault();var Q=o();if(e.daysContainer!==void 0&&(x===!1||Q&&j(Q))){var ye=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(ye),N(Se(1),0)):N(void 0,ye)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var X=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),ee(e.currentYear-X),N(Se(1),0)):he||N(void 0,X*7):b===e.currentYearElement?ee(e.currentYear-X):e.config.enableTime&&(!he&&e.hourElement&&e.hourElement.focus(),u(f),e._debouncedChange());break;case 9:if(he){var ae=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ot){return Ot}),Ce=ae.indexOf(b);if(Ce!==-1){var rn=ae[Ce+(f.shiftKey?-1:1)];f.preventDefault(),(rn||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(),pn();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),pn();break}(S||R(b))&&Ne("onKeyDown",f)}function ge(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 S=f?f.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),x=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),z=Math.min(S,e.selectedDates[0].getTime()),K=Math.max(S,e.selectedDates[0].getTime()),he=!1,Q=0,ye=0,X=z;X<K;X+=hd.DAY)q(new Date(X),!0)||(he=he||X>z&&X<K,X<x&&(!Q||X>Q)?Q=X:X>x&&(!ye||X<ye)&&(ye=X));var ae=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));ae.forEach(function(Ce){var rn=Ce.dateObj,Ot=rn.getTime(),Kr=Q>0&&Ot<Q||ye>0&&Ot>ye;if(Kr){Ce.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(pr){Ce.classList.remove(pr)});return}else if(he&&!Kr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(pr){Ce.classList.remove(pr)}),f!==void 0&&(f.classList.add(S<=e.selectedDates[0].getTime()?"startRange":"endRange"),x<S&&Ot===x?Ce.classList.add("startRange"):x>S&&Ot===x&&Ce.classList.add("endRange"),Ot>=Q&&(ye===0||Ot<=ye)&&ud(Ot,x,S)&&Ce.classList.add("inRange"))})}}function we(){e.isOpen&&!e.config.static&&!e.config.inline&&xn()}function Re(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var S=Lt(f);S&&S.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;var x=e.isOpen;e.isOpen=!0,x||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Ne("onOpen"),xn(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 ze(f){return function(b){var S=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),x=e.config["_"+(f==="min"?"max":"min")+"Date"];S!==void 0&&(e[f==="min"?"minDateHasTime":"maxDateHasTime"]=S.getHours()>0||S.getMinutes()>0||S.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(z){return q(z)}),!e.selectedDates.length&&f==="min"&&y(S),pn()),e.daysContainer&&(ao(),S!==void 0?e.currentYearElement[f]=S.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!x&&S!==void 0&&x.getFullYear()===S.getFullYear())}}function tt(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=st(st({},JSON.parse(JSON.stringify(n.dataset||{}))),t),S={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ae){e.config._enable=Sc(ae)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ae){e.config._disable=Sc(ae)}});var x=b.mode==="time";if(!b.dateFormat&&(b.enableTime||x)){var z=Ue.defaultConfig.dateFormat||qn.dateFormat;S.dateFormat=b.noCalendar||x?"H:i"+(b.enableSeconds?":S":""):z+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||x)&&!b.altFormat){var K=Ue.defaultConfig.altFormat||qn.altFormat;S.altFormat=b.noCalendar||x?"h:i"+(b.enableSeconds?":S K":" K"):K+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:ze("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:ze("max")});var he=function(ae){return function(Ce){e.config[ae==="min"?"_minTime":"_maxTime"]=e.parseDate(Ce,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:he("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:he("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,S,b);for(var Q=0;Q<f.length;Q++)e.config[f[Q]]=e.config[f[Q]]===!0||e.config[f[Q]]==="true";ha.filter(function(ae){return e.config[ae]!==void 0}).forEach(function(ae){e.config[ae]=fa(e.config[ae]||[]).map(a)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Q=0;Q<e.config.plugins.length;Q++){var ye=e.config.plugins[Q](e)||{};for(var X in ye)ha.indexOf(X)>-1?e.config[X]=fa(ye[X]).map(a).concat(e.config[X]):typeof b[X]>"u"&&(e.config[X]=ye[X])}b.altInputClass||(e.config.altInputClass=Vt().className+" "+e.config.altInputClass),Ne("onParseConfig")}function Vt(){return e.config.wrap?n.querySelector("[data-input]"):n}function Wn(){typeof e.config.locale!="object"&&typeof Ue.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=st(st({},Ue.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?Ue.l10ns[e.config.locale]:void 0),Pn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Pn.l="("+e.l10n.weekdays.longhand.join("|")+")",Pn.M="("+e.l10n.months.shorthand.join("|")+")",Pn.F="("+e.l10n.months.longhand.join("|")+")",Pn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=st(st({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&Ue.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Dc(e),e.parseDate=ga({config:e.config,l10n:e.l10n})}function xn(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Ne("onPreCalendarPosition");var b=f||e._positionElement,S=Array.prototype.reduce.call(e.calendarContainer.children,function(Ad,Ld){return Ad+Ld.offsetHeight},0),x=e.calendarContainer.offsetWidth,z=e.config.position.split(" "),K=z[0],he=z.length>1?z[1]:null,Q=b.getBoundingClientRect(),ye=window.innerHeight-Q.bottom,X=K==="above"||K!=="below"&&ye<S&&Q.top>S,ae=window.pageYOffset+Q.top+(X?-S-2:b.offsetHeight+2);if(at(e.calendarContainer,"arrowTop",!X),at(e.calendarContainer,"arrowBottom",X),!e.config.inline){var Ce=window.pageXOffset+Q.left,rn=!1,Ot=!1;he==="center"?(Ce-=(x-Q.width)/2,rn=!0):he==="right"&&(Ce-=x-Q.width,Ot=!0),at(e.calendarContainer,"arrowLeft",!rn&&!Ot),at(e.calendarContainer,"arrowCenter",rn),at(e.calendarContainer,"arrowRight",Ot);var Kr=window.document.body.offsetWidth-(window.pageXOffset+Q.right),pr=Ce+x>window.document.body.offsetWidth,kd=Kr+x>window.document.body.offsetWidth;if(at(e.calendarContainer,"rightMost",pr),!e.config.static)if(e.calendarContainer.style.top=ae+"px",!pr)e.calendarContainer.style.left=Ce+"px",e.calendarContainer.style.right="auto";else if(!kd)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Kr+"px";else{var Sa=Wr();if(Sa===void 0)return;var Td=window.document.body.offsetWidth,Cd=Math.max(0,Td/2-x/2),Id=".flatpickr-calendar.centerMost:before",Pd=".flatpickr-calendar.centerMost:after",xd=Sa.cssRules.length,Rd="{left:"+Q.left+"px;right:auto;}";at(e.calendarContainer,"rightMost",!1),at(e.calendarContainer,"centerMost",!0),Sa.insertRule(Id+","+Pd+Rd,xd),e.calendarContainer.style.left=Cd+"px",e.calendarContainer.style.right="auto"}}}}function Wr(){for(var f=null,b=0;b<document.styleSheets.length;b++){var S=document.styleSheets[b];if(S.cssRules){try{S.cssRules}catch{continue}f=S;break}}return f??oo()}function oo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function ao(){e.config.noCalendar||e.isMobile||(ne(),co(),O())}function wa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function Ec(f){f.preventDefault(),f.stopPropagation();var b=function(ae){return ae.classList&&ae.classList.contains("flatpickr-day")&&!ae.classList.contains("flatpickr-disabled")&&!ae.classList.contains("notAllowed")},S=bc(Lt(f),b);if(S!==void 0){var x=S,z=e.latestSelectedDateObj=new Date(x.dateObj.getTime()),K=(z.getMonth()<e.currentMonth||z.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=x,e.config.mode==="single")e.selectedDates=[z];else if(e.config.mode==="multiple"){var he=Ea(z);he?e.selectedDates.splice(parseInt(he),1):e.selectedDates.push(z)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=z,e.selectedDates.push(z),Nt(z,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(ae,Ce){return ae.getTime()-Ce.getTime()}));if(p(),K){var Q=e.currentYear!==z.getFullYear();e.currentYear=z.getFullYear(),e.currentMonth=z.getMonth(),Q&&(Ne("onYearChange"),ne()),Ne("onMonthChange")}if(co(),O(),pn(),!K&&e.config.mode!=="range"&&e.config.showMonths===1?Te(x):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 ye=e.config.mode==="single"&&!e.config.enableTime,X=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(ye||X)&&wa()}A()}}var so={locale:[Wn,D],showMonths:[L,s,v],minDate:[V],maxDate:[V],positionElement:[Mc],clickOpens:[function(){e.config.clickOpens===!0?(k(e._input,"focus",e.open),k(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function yd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var S in f)so[S]!==void 0&&so[S].forEach(function(x){return x()})}else e.config[f]=b,so[f]!==void 0?so[f].forEach(function(x){return x()}):ha.indexOf(f)>-1&&(e.config[f]=fa(b));e.redraw(),pn(!0)}function _c(f,b){var S=[];if(f instanceof Array)S=f.map(function(x){return e.parseDate(x,b)});else if(f instanceof Date||typeof f=="number")S=[e.parseDate(f,b)];else if(typeof f=="string")switch(e.config.mode){case"single":case"time":S=[e.parseDate(f,b)];break;case"multiple":S=f.split(e.config.conjunction).map(function(x){return e.parseDate(x,b)});break;case"range":S=f.split(e.l10n.rangeSeparator).map(function(x){return e.parseDate(x,b)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));e.selectedDates=e.config.allowInvalidPreload?S:S.filter(function(x){return x instanceof Date&&q(x,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(x,z){return x.getTime()-z.getTime()})}function vd(f,b,S){if(b===void 0&&(b=!1),S===void 0&&(S=e.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return e.clear(b);_c(f,S),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),V(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),pn(b),b&&Ne("onChange")}function Sc(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 bd(){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&&_c(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 wd(){if(e.input=Vt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Ee(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),Mc()}function Mc(){e._positionElement=e.config.positionElement||e._input}function Dd(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Ee("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=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{}k(e.mobileInput,"change",function(b){e.setDate(Lt(b).value,!1,e.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function Ed(f){if(e.isOpen===!0)return e.close();e.open(f)}function Ne(f,b){if(e.config!==void 0){var S=e.config[f];if(S!==void 0&&S.length>0)for(var x=0;S[x]&&x<S.length;x++)S[x](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Da("change")),e.input.dispatchEvent(Da("input")))}}function Da(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function Ea(f){for(var b=0;b<e.selectedDates.length;b++){var S=e.selectedDates[b];if(S instanceof Date&&Nt(S,f)===0)return""+b}return!1}function _d(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Nt(f,e.selectedDates[0])>=0&&Nt(f,e.selectedDates[1])<=0}function co(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(f,b){var S=new Date(e.currentYear,e.currentMonth,1);S.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=ro(S.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=S.getMonth().toString(),f.value=S.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(S){return e.formatDate(S,b)}).filter(function(S,x,z){return e.config.mode!=="range"||e.config.enableTime||z.indexOf(S)===x}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function pn(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&&Ne("onValueUpdate")}function Sd(f){var b=Lt(f),S=e.prevMonthNav.contains(b),x=e.nextMonthNav.contains(b);S||x?_(S?-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 Md(f){f.preventDefault();var b=f.type==="keydown",S=Lt(f),x=S;e.amPM!==void 0&&S===e.amPM&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]);var z=parseFloat(x.getAttribute("min")),K=parseFloat(x.getAttribute("max")),he=parseFloat(x.getAttribute("step")),Q=parseInt(x.value,10),ye=f.delta||(b?f.which===38?1:-1:0),X=Q+he*ye;if(typeof x.value<"u"&&x.value.length===2){var ae=x===e.hourElement,Ce=x===e.minuteElement;X<z?(X=K+X+At(!ae)+(At(ae)&&At(!e.amPM)),Ce&&U(void 0,-1,e.hourElement)):X>K&&(X=x===e.hourElement?X-K-At(!e.amPM):z,Ce&&U(void 0,1,e.hourElement)),e.amPM&&ae&&(he===1?X+Q===23:Math.abs(X-Q)>he)&&(e.amPM.textContent=e.l10n.amPM[At(e.amPM.textContent===e.l10n.amPM[0])]),x.value=ot(X)}}return i(),e}function qr(n,t){for(var e=Array.prototype.slice.call(n).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<e.length;i++){var o=e[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=Sm(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return qr(this,n)},HTMLElement.prototype.flatpickr=function(n){return qr([this],n)});var Ue=function(n,t){return typeof n=="string"?qr(window.document.querySelectorAll(n),t):n instanceof Node?qr([n],t):qr(n,t)};Ue.defaultConfig={};Ue.l10ns={en:st({},pa),default:st({},pa)};Ue.localize=function(n){Ue.l10ns.default=st(st({},Ue.l10ns.default),n)};Ue.setDefaults=function(n){Ue.defaultConfig=st(st({},Ue.defaultConfig),n)};Ue.parseDate=ga({});Ue.formatDate=Dc({});Ue.compareDates=Nt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return qr(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Ue);var pd=Ue;var io=class{constructor(t,e){this.dateInputEl=t;Y(this,"minDate");Y(this,"maxDate");Y(this,"defaultReservationDays");Y(this,"hasPrices",!1);Y(this,"prices",{});Y(this,"availability",{});Y(this,"disabledDates",[]);Y(this,"selectedStartDate");Y(this,"selectedEndDate");Y(this,"config");Y(this,"instance");Y(this,"destroyInstance");Y(this,"currentDate");Y(this,"handleResize",()=>{let t=this.isMobileDevice();(t&&this.config.grid!==1||!t&&this.config.grid!==2)&&(this.config.grid=t?1:2,this.config.calendars=t?1:2,this.destroyInstance&&this.destroyInstance(),this.initialize())});this.isMobileDevice()&&(e.grid=1,e.calendars=1),this.dateInputEl=t,this.defaultReservationDays=e.defaultReservationDays??3;let r=e.startWithEmptyDates??!1;this.config={...e,type:e.type,showPrices:e.showPrices??!1,defaultReservationDays:this.defaultReservationDays,grid:e.grid??2,calendars:e.calendars??2,darkMode:e.darkMode??!0,tooltip:e.tooltip??!0,repick:e.repick??!1,minDays:e.minDays??1,defaultStartDate:e.defaultStartDate??Z.getCurrentDate(),defaultEndDate:e.defaultEndDate??Z.getCurrentDate(),startWithEmptyDates:r},this.currentDate=Z.getCurrentDate(),this.selectedStartDate=r?null:this.config.defaultStartDate,this.selectedEndDate=r?null:this.config.defaultEndDate}isMobileDevice(){return window.innerWidth<=768}initialize(){switch(window.addEventListener("resize",this.handleResize),this.config.type){case"easepick":this.initEasepickCalendar();break;case"flatpickr":this.initFlatpickrCalendar();break;default:throw new Error(`Unsupported calendar type: ${this.config.type}`)}}setMinimumDate(t){this.minDate=t}setMaximumDate(t){this.maxDate=t}setStartDate(t){let e=Z.toJSDate(t),r=this.selectedEndDate?Z.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof da.Core?this.instance.setStartDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?Z.toJSDate(this.selectedStartDate):Z.toJSDate(t),r=Z.toJSDate(t);this.selectedEndDate=t,this.instance instanceof da.Core?this.instance.setEndDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setDateRange(t,e){if(this.config.type==="flatpickr"){this.selectedStartDate=t,this.selectedEndDate=e;let r=Z.toJSDate(t),i=Z.toJSDate(e);this.instance.setDate([r,i],!0);return}this.setStartDate(t),this.setEndDate(e)}getSelectedDates(){return{startDate:this.selectedStartDate,endDate:this.selectedEndDate}}includePrices(t=!0){this.hasPrices=t}setPrices(t){this.prices=t}setAvailability(t){this.availability=t,this.disabledDates=Object.keys(t).filter(e=>!t[e])}initEasepickCalendar(){let t={tooltip:this.config.tooltip,repick:this.config.repick,tooltipNumber:i=>i-1,locale:{one:"nuit",other:"nuits"}};this.config.startWithEmptyDates||(t.startDate=new de(this.config.defaultStartDate.toString()),t.endDate=new de(this.config.defaultEndDate.toString()));let e={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:zu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new de(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[ua,la,ca],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:u}=o.detail,l=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&l&&this.prices[l]){let h=this.prices[l],p=u.querySelector(`.${ea}`)||document.createElement("span");p.className=ea,p.textContent=`${h.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",u.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=Z.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=Z.fromString(s.format("YYYY-MM-DD"));let u={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};qe("date:changed",u)})}},r=new da.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=du(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Uu,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=$e("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=Z.fromJSDate(o[0]),this.selectedEndDate=null,qe("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=Z.fromJSDate(o[0]),this.selectedEndDate=Z.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(qe("date:changed",s),a){let u=this.formatDate(o[0]),l=this.formatDate(o[1]);a.textContent=`${u} - ${l}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(Z.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,qe("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,u)=>{let l=u.dateObj,h=Z.fromJSDate(l),p=Z.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],E=document.createElement("span");E.style.marginTop="2px",E.style.color="#c64509",E.style.fontSize="10px",E.style.fontWeight="bold",E.className=ea,E.textContent=`${y.toLocaleString(tn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,u.style.display="flex",u.style.flexDirection="column",u.style.alignItems="center",u.style.justifyContent="center",u.style.lineHeight="1.1",u.appendChild(E)}}});let i=pd(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=Z.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return tn==="en"?`${r}/${i}/${o}`:tn==="fr-FR"||tn==="de"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var e0=je({}),t0=je([]);var h0=je({});var ba=class{constructor(t,e=oc){this.fsListInstance=t;this.includePrices=e;Y(this,"element");Y(this,"apartmentInputEl");Y(this,"dateInputEl");Y(this,"dateClearEl");Y(this,"guestsInputEl");Y(this,"chambresInputEl");Y(this,"calendarInstance");Y(this,"dateLabelPlaceholder","");Y(this,"uniqueEnterprises",[]);Y(this,"state",{startDate:fe.startDate?Z.safeParsePlainDate(fe.startDate):null,endDate:fe.endDate?Z.safeParsePlainDate(fe.endDate):null});Y(this,"populateApartmentsInput",()=>{if(!this.apartmentInputEl||!this.fsListInstance)return;let t=document.createDocumentFragment(),e=this.apartmentInputEl.querySelector("option");e&&t.appendChild(e),this.uniqueEnterprises.forEach(r=>{let i=document.createElement("option");i.value=r.id,i.textContent=r.title,t.appendChild(i)}),this.apartmentInputEl.replaceChildren(t),Ur(this.apartmentInputEl,"input",async r=>{let i=r.target,o=Xi(i);qe("apartment:changed",o)}),fe.enterpriseId&&Qi(this.apartmentInputEl,fe.enterpriseId||"")});Y(this,"populateCalendarInput",async t=>{if(!this.dateInputEl)return;this.dateInputEl.style.cursor="pointer";let e=!!(this.state.startDate&&this.state.endDate),r=new io(this.dateInputEl,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,startWithEmptyDates:!e,...e&&{defaultStartDate:this.state.startDate,defaultEndDate:this.state.endDate}});if(r.setMinimumDate(dr),r.setMaximumDate(jr),r.includePrices(this.includePrices),this.includePrices){let i=await fc(this.uniqueEnterprises.map(o=>o.id).filter(o=>o!==t||t==null));r.setPrices(i)}return r.initialize(),r});if(this.element=$e("booking-component"),!this.element)throw new Error("Filters component not found");this.apartmentInputEl=$e("location-input",this.element),this.dateInputEl=$e("date-input",this.element),this.dateClearEl=$e("date-clear",this.element),this.guestsInputEl=$e("guests-input",this.element),this.chambresInputEl=$e("rooms-input",this.element),this.uniqueEnterprises=[];let r=new Set;this.fsListInstance.items.value.forEach(i=>{r.has(i.fields["enterprise-id"].value)||(r.add(i.fields["enterprise-id"].value),this.uniqueEnterprises.push({id:i.fields["enterprise-id"].value,title:i.fields.title.value}))}),et("loading:start",i=>hr(!0,i)),et("loading:end",i=>hr(!1,i)),et("apartment:changed",async i=>{i.length===0?fe.enterpriseId=null:fe.enterpriseId=i,this.calendarInstance&&fe.enterpriseId&&await this.updateCalendarForSelectedApartment(fe.enterpriseId)}),et("date:changed",async i=>{fe.startDate=i.startDate||null,fe.endDate=i.endDate||null,this.updateDateClearVisibility()}),et("guests:changed",async i=>{fe.guests=parseInt(i)}),et("n_rooms:changed",async i=>{fe.rooms=parseInt(i)}),et("coupon:changed",async i=>{fe.coupon=i}),et(["apartment:changed","date:changed","guests:changed","coupon:changed"],async()=>{})}async init(){qe("loading:start",this.element);try{if(this.apartmentInputEl&&this.populateApartmentsInput(),this.guestsInputEl&&this.populateGuestsInput(),this.chambresInputEl&&this.populateChambresInput(),this.dateInputEl){let t=$e("label",this.dateInputEl);this.dateLabelPlaceholder=t?.textContent?.trim()??"",this.calendarInstance=await this.populateCalendarInput(),this.state.startDate&&this.state.endDate?this.calendarInstance?.setDateRange(this.state.startDate,this.state.endDate):this.fsListInstance.triggerHook("filter"),this.updateDateClearVisibility(),this.setupDateClearClickHandler()}return this}catch(t){throw t instanceof Error?console.error("Error initializing BookingComponent",t.name):console.error("Error initializing BookingComponent",t),t}}updateDateClearVisibility(){if(!this.dateClearEl)return;let t=!!(fe.startDate&&fe.endDate);this.dateClearEl.style.display=t?"flex":"none"}setupDateClearClickHandler(){this.dateClearEl&&Ur(this.dateClearEl,"click",t=>{t.preventDefault(),fe.startDate=null,fe.endDate=null,this.state.startDate=null,this.state.endDate=null,this.calendarInstance?.clear();let e=this.dateInputEl?$e("label",this.dateInputEl):null;e&&(e.textContent=this.dateLabelPlaceholder),qe("date:changed",{startDate:"",endDate:""}),this.updateDateClearVisibility()})}populateGuestsInput(){if(!this.guestsInputEl){console.warn("guests dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.guestsInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(a=>{r.add(a.fields.guests.value)});let i=Math.max(...Array.from(r).map(Number)),o=a=>`${a} ${Me(a===1?"guestSingular":"guestPlural")}`;for(let a=1;a<=i;a++){let s=document.createElement("option");s.value=a.toString(),s.textContent=o(a),t.appendChild(s)}this.guestsInputEl.replaceChildren(t),Ur(this.guestsInputEl,"input",async a=>{let s=a.target,u=Xi(s);qe("guests:changed",u)}),fe.guests&&Qi(this.guestsInputEl,fe.guests.toString())}populateChambresInput(){if(!this.chambresInputEl){console.warn("rooms dropdown not found. skipping...");return}let t=document.createDocumentFragment(),e=this.chambresInputEl.querySelector("option");e&&t.appendChild(e);let r=new Set;this.fsListInstance.items.value.forEach(o=>{r.add(o.fields.rooms.value)});let i=Math.max(...Array.from(r).map(Number));for(let o=1;o<=i;o++){let a=document.createElement("option");a.value=o.toString(),a.textContent=o.toString(),t.appendChild(a)}this.chambresInputEl.replaceChildren(t),Ur(this.chambresInputEl,"input",async o=>{let a=o.target,s=Xi(a);qe("n_rooms:changed",s)}),fe.rooms&&Qi(this.chambresInputEl,fe.rooms.toString())}async updateCalendarForSelectedApartment(t){if(this.dateInputEl)try{this.calendarInstance&&(this.calendarInstance.destroy?.(),this.calendarInstance=void 0),this.calendarInstance=await this.populateCalendarInput(t)}catch(e){console.error("Error updating calendar for selected apartment:",e)}}};var gd;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(gd||(gd={}));function Mm(n){let t=n.find(i=>i.instance==="apparthotels");if(!t)throw new Error("List instance not found");new ba(t).init().then(i=>{qe("loading:end",i?.element)}).catch(i=>{throw qu(!0,void 0),console.error("Error initializing filters component:",i),i});let r=new ia(t);r.showUnavailableItems=!0,r.init()}window.FinsweetAttributes=window.FinsweetAttributes||[];window.FinsweetAttributes.push(["list",async n=>{Mm(n)}]);export{Mm as initApparthotelsTemplate};
8
8
  /*! Bundled license information:
9
9
 
10
10
  @vue/shared/dist/shared.esm-bundler.js: