iobroker.admin 7.6.1 → 7.6.2

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.
Files changed (28) hide show
  1. package/README.md +3 -3
  2. package/adminWww/assets/{AdapterUpdateDialog-B6BExP8V.js → AdapterUpdateDialog-CdDzwRjx.js} +1 -1
  3. package/adminWww/assets/{Adapters-DIBIni4y.js → Adapters-BtSoe3ny.js} +1 -1
  4. package/adminWww/assets/{Config-YHxbcu7T.js → Config-DV-y10Fh.js} +1 -1
  5. package/adminWww/assets/{CustomModal-JqPz2I5-.js → CustomModal-CYOPWjwy.js} +1 -1
  6. package/adminWww/assets/CustomTab-cprIlE4B.js +1 -0
  7. package/adminWww/assets/{EasyMode-yY-I2xyh.js → EasyMode-Cd88-W7q.js} +1 -1
  8. package/adminWww/assets/{Enums-C5YwAYy_.js → Enums-nUibAZSg.js} +1 -1
  9. package/adminWww/assets/{Fields-DQnvUINT.js → Fields-vrlzBhCD.js} +1 -1
  10. package/adminWww/assets/{Files-D1MaiYKO.js → Files-DClcJEP9.js} +1 -1
  11. package/adminWww/assets/{Hosts-CdegJCob.js → Hosts-DLnI_Hxs.js} +1 -1
  12. package/adminWww/assets/{Instances-C53butsI.js → Instances-BaExCFtw.js} +1 -1
  13. package/adminWww/assets/{Intro-DK6ZJQFo.js → Intro-wT4JOxpS.js} +1 -1
  14. package/adminWww/assets/{Logs-D826DvR0.js → Logs-CSsFxtVG.js} +1 -1
  15. package/adminWww/assets/{Objects-CftJaIUZ.js → Objects-Bbrov7BJ.js} +3 -3
  16. package/adminWww/assets/{State-B-a9_a_1.js → State-CmEur1zC.js} +1 -1
  17. package/adminWww/assets/Users-CPHL5ErP.js +1 -0
  18. package/adminWww/assets/{bootstrap-CNGEzxvg.js → bootstrap-CoF0Rq1_.js} +108 -121
  19. package/adminWww/assets/index-8HslT92O.js +14 -0
  20. package/adminWww/assets/{index-7bHQZDF7.js → index-DO87nxhY.js} +2 -2
  21. package/adminWww/assets/{sentry-DA_P_z-O.js → sentry-Cc5WioqD.js} +1 -1
  22. package/adminWww/assets/{zh-cn-CqrEZCay.js → zh-cn-CzBq9Ifq.js} +1 -1
  23. package/adminWww/index.html +1 -1
  24. package/adminWww/mf-manifest.json +1 -1
  25. package/adminWww/remoteEntry.js +2 -2
  26. package/io-package.json +14 -14
  27. package/package.json +4 -4
  28. package/adminWww/assets/Users-DSiszZ5p.js +0 -1
@@ -1,2 +1,2 @@
1
- import{j as o,J as Jt,B as Kn,F as Ye,H as Se,E as fe}from"./DefaultPropsProvider-Beyggw1o.js";import{i as It}from"./iobroker_admin__loadShare__react__loadShare__-T96CJO0k.js";import{r as ps,j as zs,i as d,U as ge,f as at,I as pt,a as v,k as Qn,D as tr,l as ms,m as er,R as Gs,n as sr,c as wt,w as nr,o as rr,h as ir,g as or,T as ar}from"./bootstrap-CNGEzxvg.js";import{a as lr}from"./index-CFcKrkeG.js";import{C as cr}from"./Config-YHxbcu7T.js";import{S as et}from"./State-B-a9_a_1.js";import{s as ur,M as dr,C as hr}from"./sentry-DA_P_z-O.js";import{C as Et}from"./CustomModal-JqPz2I5-.js";import{a as pr}from"./blueGrey-BKTirx-Z.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-C8Lvs8Es.js";import"./_commonjsHelpers-BosuxZz1.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js";import"./ace-BAuRYJjv.js";import"./FilledInput-Bfz0Aef-.js";import"./preload-helper-C1FmrZbK.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-FMqZHPyC.js";import"./extends-CF3RwP-h.js";import"./iconBase-CxzgaDaB.js";import"./emotion-cache.browser.esm-B8BFze5o.js";var Wt={},U={},re={},St={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});var Oe={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.CronField=void 0;class rs{#t=!1;#e=[];static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[,*\d/-]+$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,e=!1){if(!Array.isArray(t))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.#e=t.sort(rs.sorter),this.#t=e}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get isWildcard(){return this.#t}get values(){return this.#e}static sorter(t,e){const s=typeof t=="number",r=typeof e=="number";return s&&r?t-e:!s&&!r?t.localeCompare(e):s?-1:1}serialize(){return{wildcard:this.#t,values:this.#e}}validate(){let t;const e=this.chars.length>0?` or chars ${this.chars.join("")}`:"",s=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),r=l=>(t=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(s(l)));if(!this.#e.every(r))throw new Error(`${this.constructor.name} Validation error, got value ${t} expected range ${this.min}-${this.max}${e}`);const a=this.#e.find((l,u)=>this.#e.indexOf(l)!==u);if(a)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${a}`)}}ht.CronField=rs;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.CronDayOfMonth=void 0;const mr=ht,fr=1,gr=31,yr=Object.freeze(["L"]);class xr extends mr.CronField{static get min(){return fr}static get max(){return gr}static get chars(){return yr}static get validChars(){return/^[?,*\dL/-]+$/}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Oe.CronDayOfMonth=xr;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.CronDayOfWeek=void 0;const vr=ht,wr=0,Sr=7,br=Object.freeze(["L"]);class Cr extends vr.CronField{static get min(){return wr}static get max(){return Sr}static get chars(){return br}static get validChars(){return/^[?,*\dL#/-]+$/}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Me.CronDayOfWeek=Cr;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.CronHour=void 0;const kr=ht,Tr=0,Dr=23,Or=Object.freeze([]);class Mr extends kr.CronField{static get min(){return Tr}static get max(){return Dr}static get chars(){return Or}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ie.CronHour=Mr;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.CronMinute=void 0;const Ir=ht,jr=0,Er=59,Nr=Object.freeze([]);class Fr extends Ir.CronField{static get min(){return jr}static get max(){return Er}static get chars(){return Nr}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}je.CronMinute=Fr;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.CronMonth=void 0;const Lr=ht,_r=1,Wr=12,$r=Object.freeze([]),Ar=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class Hr extends Lr.CronField{static get min(){return _r}static get max(){return Wr}static get chars(){return $r}static get daysInMonth(){return Ar}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ee.CronMonth=Hr;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.CronSecond=void 0;const Rr=ht,Vr=0,Pr=59,Br=Object.freeze([]);class Ur extends Rr.CronField{static get min(){return Vr}static get max(){return Pr}static get chars(){return Br}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ne.CronSecond=Ur;(function(n){var t=St&&St.__createBinding||(Object.create?function(s,r,i,a){a===void 0&&(a=i);var l=Object.getOwnPropertyDescriptor(r,i);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(s,a,l)}:function(s,r,i,a){a===void 0&&(a=i),s[a]=r[i]}),e=St&&St.__exportStar||function(s,r){for(var i in s)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,s,i)};Object.defineProperty(n,"__esModule",{value:!0}),e(Zs,n),e(Oe,n),e(Me,n),e(ht,n),e(Ie,n),e(je,n),e(Ee,n),e(Ne,n)})(St);Object.defineProperty(re,"__esModule",{value:!0});re.CronFieldCollection=void 0;const st=St;class At{#t;#e;#n;#i;#r;#a;static from(t,e){return new At({second:this.resolveField(st.CronSecond,t.second,e.second),minute:this.resolveField(st.CronMinute,t.minute,e.minute),hour:this.resolveField(st.CronHour,t.hour,e.hour),dayOfMonth:this.resolveField(st.CronDayOfMonth,t.dayOfMonth,e.dayOfMonth),month:this.resolveField(st.CronMonth,t.month,e.month),dayOfWeek:this.resolveField(st.CronDayOfWeek,t.dayOfWeek,e.dayOfWeek)})}static resolveField(t,e,s){return s?s instanceof st.CronField?s:new t(s):e}constructor({second:t,minute:e,hour:s,dayOfMonth:r,month:i,dayOfWeek:a}){if(!t)throw new Error("Validation error, Field second is missing");if(!e)throw new Error("Validation error, Field minute is missing");if(!s)throw new Error("Validation error, Field hour is missing");if(!r)throw new Error("Validation error, Field dayOfMonth is missing");if(!i)throw new Error("Validation error, Field month is missing");if(!a)throw new Error("Validation error, Field dayOfWeek is missing");if(i.values.length===1&&!(parseInt(r.values[0],10)<=st.CronMonth.daysInMonth[i.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#t=t,this.#e=e,this.#n=s,this.#r=i,this.#a=a,this.#i=r}get second(){return this.#t}get minute(){return this.#e}get hour(){return this.#n}get dayOfMonth(){return this.#i}get month(){return this.#r}get dayOfWeek(){return this.#a}static compactField(t){if(t.length===0)return[];const e=[];let s;return t.forEach((r,i,a)=>{if(s===void 0){s={start:r,count:1};return}const l=a[i-1]||s.start,u=a[i+1];if(r==="L"||r==="W"){e.push(s),e.push({start:r,count:1}),s=void 0;return}if(s.step===void 0&&u!==void 0){const h=r-l,m=u-r;if(h<=m){s={...s,count:2,end:r,step:h};return}s.step=1}r-(s.end??0)===s.step?(s.count++,s.end=r):(s.count===1?e.push({start:s.start,count:1}):s.count===2?(e.push({start:s.start,count:1}),e.push({start:s.end??l,count:1})):e.push(s),s={start:r,count:1})}),s&&e.push(s),e}static#s(t,e,s){const r=t.step;return r?r===1&&t.start===e&&t.end&&t.end>=s?"*":r!==1&&t.start===e&&t.end&&t.end>=s-r+1?`*/${r}`:null:null}static#o(t,e){const s=t.step;if(s===1)return`${t.start}-${t.end}`;const r=t.start===0?t.count-1:t.count;if(!s)throw new Error("Unexpected range step");if(!t.end)throw new Error("Unexpected range end");if(s*r>t.end){const i=(l,u)=>{if(typeof t.start!="number")throw new Error("Unexpected range start");return u%s===0?t.start+u:null};if(typeof t.start!="number")throw new Error("Unexpected range start");const a={length:t.end-t.start+1};return Array.from(a,i).filter(l=>l!==null).join(",")}return t.end===e-s+1?`${t.start}/${s}`:`${t.start}-${t.end}/${s}`}stringifyField(t){let e=t.max,s=t.values;if(t instanceof st.CronDayOfWeek){e=6;const i=this.#a.values;s=i[i.length-1]===7?i.slice(0,-1):i}t instanceof st.CronDayOfMonth&&(e=this.#r.values.length===1?st.CronMonth.daysInMonth[this.#r.values[0]-1]:t.max);const r=At.compactField(s);if(r.length===1){const i=At.#s(r[0],t.min,e);if(i)return i}return r.map(i=>i.count===1?i.start.toString():At.#o(i,e)).join(",")}stringify(t=!1){const e=[];return t&&e.push(this.stringifyField(this.#t)),e.push(this.stringifyField(this.#e),this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#r),this.stringifyField(this.#a)),e.join(" ")}serialize(){return{second:this.#t.serialize(),minute:this.#e.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#i.serialize(),month:this.#r.serialize(),dayOfWeek:this.#a.serialize()}}}re.CronFieldCollection=At;var lt={},z={};Object.defineProperty(z,"__esModule",{value:!0});class jt extends Error{}class zr extends jt{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Gr extends jt{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Zr extends jt{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Ht extends jt{}class Ys extends jt{constructor(t){super(`Invalid unit ${t}`)}}class L extends jt{}class gt extends jt{constructor(){super("Zone is an abstract class")}}const g="numeric",ct="short",G="long",be={year:g,month:g,day:g},qs={year:g,month:ct,day:g},Yr={year:g,month:ct,day:g,weekday:ct},Xs={year:g,month:G,day:g},Js={year:g,month:G,day:g,weekday:G},Ks={hour:g,minute:g},Qs={hour:g,minute:g,second:g},tn={hour:g,minute:g,second:g,timeZoneName:ct},en={hour:g,minute:g,second:g,timeZoneName:G},sn={hour:g,minute:g,hourCycle:"h23"},nn={hour:g,minute:g,second:g,hourCycle:"h23"},rn={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:ct},on={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:G},an={year:g,month:g,day:g,hour:g,minute:g},ln={year:g,month:g,day:g,hour:g,minute:g,second:g},cn={year:g,month:ct,day:g,hour:g,minute:g},un={year:g,month:ct,day:g,hour:g,minute:g,second:g},qr={year:g,month:ct,day:g,weekday:ct,hour:g,minute:g},dn={year:g,month:G,day:g,hour:g,minute:g,timeZoneName:ct},hn={year:g,month:G,day:g,hour:g,minute:g,second:g,timeZoneName:ct},pn={year:g,month:G,day:g,weekday:G,hour:g,minute:g,timeZoneName:G},mn={year:g,month:G,day:g,weekday:G,hour:g,minute:g,second:g,timeZoneName:G};class Bt{get type(){throw new gt}get name(){throw new gt}get ianaName(){return this.name}get isUniversal(){throw new gt}offsetName(t,e){throw new gt}formatOffset(t,e){throw new gt}offset(t){throw new gt}equals(t){throw new gt}get isValid(){throw new gt}}let Ae=null;class ie extends Bt{static get instance(){return Ae===null&&(Ae=new ie),Ae}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return kn(t,e,s)}formatOffset(t,e){return ee(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let ye={};function Xr(n){return ye[n]||(ye[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ye[n]}const Jr={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kr(n,t){const e=n.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,r,i,a,l,u,h,m]=s;return[a,r,i,l,u,h,m]}function Qr(n,t){const e=n.formatToParts(t),s=[];for(let r=0;r<e.length;r++){const{type:i,value:a}=e[r],l=Jr[i];i==="era"?s[l]=a:S(l)||(s[l]=parseInt(a,10))}return s}let ce={};class ut extends Bt{static create(t){return ce[t]||(ce[t]=new ut(t)),ce[t]}static resetCache(){ce={},ye={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ut.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return kn(t,e,s,this.name)}formatOffset(t,e){return ee(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const s=Xr(this.name);let[r,i,a,l,u,h,m]=s.formatToParts?Qr(s,e):Kr(s,e);l==="BC"&&(r=-Math.abs(r)+1);const f=Le({year:r,month:i,day:a,hour:u===24?0:u,minute:h,second:m,millisecond:0});let p=+e;const x=p%1e3;return p-=x>=0?x:1e3+x,(f-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let fs={};function ti(n,t={}){const e=JSON.stringify([n,t]);let s=fs[e];return s||(s=new Intl.ListFormat(n,t),fs[e]=s),s}let qe={};function Xe(n,t={}){const e=JSON.stringify([n,t]);let s=qe[e];return s||(s=new Intl.DateTimeFormat(n,t),qe[e]=s),s}let Je={};function ei(n,t={}){const e=JSON.stringify([n,t]);let s=Je[e];return s||(s=new Intl.NumberFormat(n,t),Je[e]=s),s}let Ke={};function si(n,t={}){const{base:e,...s}=t,r=JSON.stringify([n,s]);let i=Ke[r];return i||(i=new Intl.RelativeTimeFormat(n,t),Ke[r]=i),i}let Kt=null;function ni(){return Kt||(Kt=new Intl.DateTimeFormat().resolvedOptions().locale,Kt)}let gs={};function ri(n){let t=gs[n];if(!t){const e=new Intl.Locale(n);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,gs[n]=t}return t}function ii(n){const t=n.indexOf("-x-");t!==-1&&(n=n.substring(0,t));const e=n.indexOf("-u-");if(e===-1)return[n];{let s,r;try{s=Xe(n).resolvedOptions(),r=n}catch{const u=n.substring(0,e);s=Xe(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=s;return[r,i,a]}}function oi(n,t,e){return(e||t)&&(n.includes("-u-")||(n+="-u"),e&&(n+=`-ca-${e}`),t&&(n+=`-nu-${t}`)),n}function ai(n){const t=[];for(let e=1;e<=12;e++){const s=w.utc(2009,e,1);t.push(n(s))}return t}function li(n){const t=[];for(let e=1;e<=7;e++){const s=w.utc(2016,11,13+e);t.push(n(s))}return t}function ue(n,t,e,s){const r=n.listingMode();return r==="error"?null:r==="en"?e(t):s(t)}function ci(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class ui{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...a}=s;if(!e||Object.keys(a).length>0){const l={useGrouping:!1,...s};s.padTo>0&&(l.minimumIntegerDigits=s.padTo),this.inf=ei(t,l)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{const e=this.floor?Math.floor(t):cs(t,3);return I(e,this.padTo)}}}class di{constructor(t,e,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const a=-1*(t.offset/60),l=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;t.offset!==0&&ut.create(l).valid?(r=l,this.dt=t):(r="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,r=t.zone.name):(r="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Xe(e,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:s}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class hi{constructor(t,e,s){this.opts={style:"long",...s},!e&&bn()&&(this.rtf=si(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):Li(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const pi={firstDay:1,minimalDays:4,weekend:[6,7]};class T{static fromOpts(t){return T.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,s,r,i=!1){const a=t||M.defaultLocale,l=a||(i?"en-US":ni()),u=e||M.defaultNumberingSystem,h=s||M.defaultOutputCalendar,m=Qe(r)||M.defaultWeekSettings;return new T(l,u,h,m,a)}static resetCache(){Kt=null,qe={},Je={},Ke={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s,weekSettings:r}={}){return T.create(t,e,s,r)}constructor(t,e,s,r,i){const[a,l,u]=ii(t);this.locale=a,this.numberingSystem=e||l||null,this.outputCalendar=s||u||null,this.weekSettings=r,this.intl=oi(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ci(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:T.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Qe(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return ue(this,t,On,()=>{const s=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return this.monthsCache[r][t]||(this.monthsCache[r][t]=ai(i=>this.extract(i,s,"month"))),this.monthsCache[r][t]})}weekdays(t,e=!1){return ue(this,t,jn,()=>{const s=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=li(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][t]})}meridiems(){return ue(this,void 0,()=>En,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[w.utc(2016,11,13,9),w.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ue(this,t,Nn,()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[w.utc(-40,1,1),w.utc(2017,1,1)].map(s=>this.extract(s,e,"era"))),this.eraCache[t]})}extract(t,e,s){const r=this.dtFormatter(t,e),i=r.formatToParts(),a=i.find(l=>l.type.toLowerCase()===s);return a?a.value:null}numberFormatter(t={}){return new ui(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new di(t,this.intl,e)}relFormatter(t={}){return new hi(this.intl,this.isEnglish(),t)}listFormatter(t={}){return ti(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Cn()?ri(this.locale):pi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let He=null;class $ extends Bt{static get utcInstance(){return He===null&&(He=new $(0)),He}static instance(t){return t===0?$.utcInstance:new $(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new $(_e(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ee(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ee(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ee(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class fn extends Bt{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function bt(n,t){if(S(n)||n===null)return t;if(n instanceof Bt)return n;if(vi(n)){const e=n.toLowerCase();return e==="default"?t:e==="local"||e==="system"?ie.instance:e==="utc"||e==="gmt"?$.utcInstance:$.parseSpecifier(e)||ut.create(n)}else return Ct(n)?$.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new fn(n)}const is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ys={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},mi=is.hanidec.replace(/[\[|\]]/g,"").split("");function fi(n){let t=parseInt(n,10);if(isNaN(t)){t="";for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);if(n[e].search(is.hanidec)!==-1)t+=mi.indexOf(n[e]);else for(const r in ys){const[i,a]=ys[r];s>=i&&s<=a&&(t+=s-i)}}return parseInt(t,10)}else return t}let $t={};function gi(){$t={}}function nt({numberingSystem:n},t=""){const e=n||"latn";return $t[e]||($t[e]={}),$t[e][t]||($t[e][t]=new RegExp(`${is[e]}${t}`)),$t[e][t]}let xs=()=>Date.now(),vs="system",ws=null,Ss=null,bs=null,Cs=60,ks,Ts=null;class M{static get now(){return xs}static set now(t){xs=t}static set defaultZone(t){vs=t}static get defaultZone(){return bt(vs,ie.instance)}static get defaultLocale(){return ws}static set defaultLocale(t){ws=t}static get defaultNumberingSystem(){return Ss}static set defaultNumberingSystem(t){Ss=t}static get defaultOutputCalendar(){return bs}static set defaultOutputCalendar(t){bs=t}static get defaultWeekSettings(){return Ts}static set defaultWeekSettings(t){Ts=Qe(t)}static get twoDigitCutoffYear(){return Cs}static set twoDigitCutoffYear(t){Cs=t%100}static get throwOnInvalid(){return ks}static set throwOnInvalid(t){ks=t}static resetCaches(){T.resetCache(),ut.resetCache(),w.resetCache(),gi()}}class ot{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const gn=[0,31,59,90,120,151,181,212,243,273,304,334],yn=[0,31,60,91,121,152,182,213,244,274,305,335];function X(n,t){return new ot("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${n}, which is invalid`)}function os(n,t,e){const s=new Date(Date.UTC(n,t-1,e));n<100&&n>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function xn(n,t,e){return e+(oe(n)?yn:gn)[t-1]}function vn(n,t){const e=oe(n)?yn:gn,s=e.findIndex(i=>i<t),r=t-e[s];return{month:s+1,day:r}}function as(n,t){return(n-t+7)%7+1}function Ce(n,t=4,e=1){const{year:s,month:r,day:i}=n,a=xn(s,r,i),l=as(os(s,r,i),e);let u=Math.floor((a-l+14-t)/7),h;return u<1?(h=s-1,u=ne(h,t,e)):u>ne(s,t,e)?(h=s+1,u=1):h=s,{weekYear:h,weekNumber:u,weekday:l,...We(n)}}function Ds(n,t=4,e=1){const{weekYear:s,weekNumber:r,weekday:i}=n,a=as(os(s,1,t),e),l=Rt(s);let u=r*7+i-a-7+t,h;u<1?(h=s-1,u+=Rt(h)):u>l?(h=s+1,u-=Rt(s)):h=s;const{month:m,day:c}=vn(h,u);return{year:h,month:m,day:c,...We(n)}}function Re(n){const{year:t,month:e,day:s}=n,r=xn(t,e,s);return{year:t,ordinal:r,...We(n)}}function Os(n){const{year:t,ordinal:e}=n,{month:s,day:r}=vn(t,e);return{year:t,month:s,day:r,...We(n)}}function Ms(n,t){if(!S(n.localWeekday)||!S(n.localWeekNumber)||!S(n.localWeekYear)){if(!S(n.weekday)||!S(n.weekNumber)||!S(n.weekYear))throw new Ht("Cannot mix locale-based week fields with ISO-based week fields");return S(n.localWeekday)||(n.weekday=n.localWeekday),S(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),S(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function yi(n,t=4,e=1){const s=Fe(n.weekYear),r=J(n.weekNumber,1,ne(n.weekYear,t,e)),i=J(n.weekday,1,7);return s?r?i?!1:X("weekday",n.weekday):X("week",n.weekNumber):X("weekYear",n.weekYear)}function xi(n){const t=Fe(n.year),e=J(n.ordinal,1,Rt(n.year));return t?e?!1:X("ordinal",n.ordinal):X("year",n.year)}function wn(n){const t=Fe(n.year),e=J(n.month,1,12),s=J(n.day,1,ke(n.year,n.month));return t?e?s?!1:X("day",n.day):X("month",n.month):X("year",n.year)}function Sn(n){const{hour:t,minute:e,second:s,millisecond:r}=n,i=J(t,0,23)||t===24&&e===0&&s===0&&r===0,a=J(e,0,59),l=J(s,0,59),u=J(r,0,999);return i?a?l?u?!1:X("millisecond",r):X("second",s):X("minute",e):X("hour",t)}function S(n){return typeof n>"u"}function Ct(n){return typeof n=="number"}function Fe(n){return typeof n=="number"&&n%1===0}function vi(n){return typeof n=="string"}function wi(n){return Object.prototype.toString.call(n)==="[object Date]"}function bn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Si(n){return Array.isArray(n)?n:[n]}function Is(n,t,e){if(n.length!==0)return n.reduce((s,r)=>{const i=[t(r),r];return s&&e(s[0],i[0])===s[0]?s:i},null)[1]}function bi(n,t){return t.reduce((e,s)=>(e[s]=n[s],e),{})}function Pt(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Qe(n){if(n==null)return null;if(typeof n!="object")throw new L("Week settings must be an object");if(!J(n.firstDay,1,7)||!J(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(t=>!J(t,1,7)))throw new L("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function J(n,t,e){return Fe(n)&&n>=t&&n<=e}function Ci(n,t){return n-t*Math.floor(n/t)}function I(n,t=2){const e=n<0;let s;return e?s="-"+(""+-n).padStart(t,"0"):s=(""+n).padStart(t,"0"),s}function xt(n){if(!(S(n)||n===null||n===""))return parseInt(n,10)}function Tt(n){if(!(S(n)||n===null||n===""))return parseFloat(n)}function ls(n){if(!(S(n)||n===null||n==="")){const t=parseFloat("0."+n)*1e3;return Math.floor(t)}}function cs(n,t,e=!1){const s=10**t;return(e?Math.trunc:Math.round)(n*s)/s}function oe(n){return n%4===0&&(n%100!==0||n%400===0)}function Rt(n){return oe(n)?366:365}function ke(n,t){const e=Ci(t-1,12)+1,s=n+(t-e)/12;return e===2?oe(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Le(n){let t=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(t=new Date(t),t.setUTCFullYear(n.year,n.month-1,n.day)),+t}function js(n,t,e){return-as(os(n,1,t),e)+t-1}function ne(n,t=4,e=1){const s=js(n,t,e),r=js(n+1,t,e);return(Rt(n)-s+r)/7}function ts(n){return n>99?n:n>M.twoDigitCutoffYear?1900+n:2e3+n}function kn(n,t,e,s=null){const r=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const a={timeZoneName:t,...i},l=new Intl.DateTimeFormat(e,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return l?l.value:null}function _e(n,t){let e=parseInt(n,10);Number.isNaN(e)&&(e=0);const s=parseInt(t,10)||0,r=e<0||Object.is(e,-0)?-s:s;return e*60+r}function Tn(n){const t=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(t))throw new L(`Invalid unit value ${n}`);return t}function Te(n,t){const e={};for(const s in n)if(Pt(n,s)){const r=n[s];if(r==null)continue;e[t(s)]=Tn(r)}return e}function ee(n,t){const e=Math.trunc(Math.abs(n/60)),s=Math.trunc(Math.abs(n%60)),r=n>=0?"+":"-";switch(t){case"short":return`${r}${I(e,2)}:${I(s,2)}`;case"narrow":return`${r}${e}${s>0?`:${s}`:""}`;case"techie":return`${r}${I(e,2)}${I(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function We(n){return bi(n,["hour","minute","second","millisecond"])}const ki=["January","February","March","April","May","June","July","August","September","October","November","December"],Dn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ti=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(n){switch(n){case"narrow":return[...Ti];case"short":return[...Dn];case"long":return[...ki];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Mn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],In=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Di=["M","T","W","T","F","S","S"];function jn(n){switch(n){case"narrow":return[...Di];case"short":return[...In];case"long":return[...Mn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const En=["AM","PM"],Oi=["Before Christ","Anno Domini"],Mi=["BC","AD"],Ii=["B","A"];function Nn(n){switch(n){case"narrow":return[...Ii];case"short":return[...Mi];case"long":return[...Oi];default:return null}}function ji(n){return En[n.hour<12?0:1]}function Ei(n,t){return jn(t)[n.weekday-1]}function Ni(n,t){return On(t)[n.month-1]}function Fi(n,t){return Nn(t)[n.year<0?0:1]}function Li(n,t,e="always",s=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(e==="auto"&&i){const c=n==="days";switch(t){case 1:return c?"tomorrow":`next ${r[n][0]}`;case-1:return c?"yesterday":`last ${r[n][0]}`;case 0:return c?"today":`this ${r[n][0]}`}}const a=Object.is(t,-0)||t<0,l=Math.abs(t),u=l===1,h=r[n],m=s?u?h[1]:h[2]||h[1]:u?r[n][0]:n;return a?`${l} ${m} ago`:`in ${l} ${m}`}function Es(n,t){let e="";for(const s of n)s.literal?e+=s.val:e+=t(s.val);return e}const _i={D:be,DD:qs,DDD:Xs,DDDD:Js,t:Ks,tt:Qs,ttt:tn,tttt:en,T:sn,TT:nn,TTT:rn,TTTT:on,f:an,ff:cn,fff:dn,ffff:pn,F:ln,FF:un,FFF:hn,FFFF:mn};class W{static create(t,e={}){return new W(t,e)}static parseFormat(t){let e=null,s="",r=!1;const i=[];for(let a=0;a<t.length;a++){const l=t.charAt(a);l==="'"?(s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),e=null,s="",r=!r):r||l===e?s+=l:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=l,e=l)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return _i[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return I(t,e);const s={...this.opts};return e>0&&(s.padTo=e),this.loc.numberFormatter(s).format(t)}formatDateTimeFromString(t,e){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(p,x)=>this.loc.extract(t,p,x),a=p=>t.isOffsetFixed&&t.offset===0&&p.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,p.format):"",l=()=>s?ji(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(p,x)=>s?Ni(t,p):i(x?{month:p}:{month:p,day:"numeric"},"month"),h=(p,x)=>s?Ei(t,p):i(x?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),m=p=>{const x=W.macroTokenToFormatOpts(p);return x?this.formatWithSystemDefault(t,x):p},c=p=>s?Fi(t,p):i({era:p},"era"),f=p=>{switch(p){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return r?i({day:"numeric"},"day"):this.num(t.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(t.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(t.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return m(p)}};return Es(W.parseFormat(e),f)}formatDurationFromString(t,e){const s=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=u=>h=>{const m=s(h);return m?this.num(u.get(m),h.length):h},i=W.parseFormat(e),a=i.reduce((u,{literal:h,val:m})=>h?u:u.concat(m),[]),l=t.shiftTo(...a.map(s).filter(u=>u));return Es(i,r(l))}}const Fn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ut(...n){const t=n.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function zt(...n){return t=>n.reduce(([e,s,r],i)=>{const[a,l,u]=i(t,r);return[{...e,...a},l||s,u]},[{},null,1]).slice(0,2)}function Gt(n,...t){if(n==null)return[null,null];for(const[e,s]of t){const r=e.exec(n);if(r)return s(r)}return[null,null]}function Ln(...n){return(t,e)=>{const s={};let r;for(r=0;r<n.length;r++)s[n[r]]=xt(t[e+r]);return[s,null,e+r]}}const _n=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Wi=`(?:${_n.source}?(?:\\[(${Fn.source})\\])?)?`,us=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wn=RegExp(`${us.source}${Wi}`),ds=RegExp(`(?:T${Wn.source})?`),$i=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ai=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Hi=/(\d{4})-?(\d{3})/,Ri=Ln("weekYear","weekNumber","weekDay"),Vi=Ln("year","ordinal"),Pi=/(\d{4})-(\d\d)-(\d\d)/,$n=RegExp(`${us.source} ?(?:${_n.source}|(${Fn.source}))?`),Bi=RegExp(`(?: ${$n.source})?`);function Vt(n,t,e){const s=n[t];return S(s)?e:xt(s)}function Ui(n,t){return[{year:Vt(n,t),month:Vt(n,t+1,1),day:Vt(n,t+2,1)},null,t+3]}function Zt(n,t){return[{hours:Vt(n,t,0),minutes:Vt(n,t+1,0),seconds:Vt(n,t+2,0),milliseconds:ls(n[t+3])},null,t+4]}function ae(n,t){const e=!n[t]&&!n[t+1],s=_e(n[t+1],n[t+2]),r=e?null:$.instance(s);return[{},r,t+3]}function le(n,t){const e=n[t]?ut.create(n[t]):null;return[{},e,t+1]}const zi=RegExp(`^T?${us.source}$`),Gi=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Zi(n){const[t,e,s,r,i,a,l,u,h]=n,m=t[0]==="-",c=u&&u[0]==="-",f=(p,x=!1)=>p!==void 0&&(x||p&&m)?-p:p;return[{years:f(Tt(e)),months:f(Tt(s)),weeks:f(Tt(r)),days:f(Tt(i)),hours:f(Tt(a)),minutes:f(Tt(l)),seconds:f(Tt(u),u==="-0"),milliseconds:f(ls(h),c)}]}const Yi={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hs(n,t,e,s,r,i,a){const l={year:t.length===2?ts(xt(t)):xt(t),month:Dn.indexOf(e)+1,day:xt(s),hour:xt(r),minute:xt(i)};return a&&(l.second=xt(a)),n&&(l.weekday=n.length>3?Mn.indexOf(n)+1:In.indexOf(n)+1),l}const qi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Xi(n){const[,t,e,s,r,i,a,l,u,h,m,c]=n,f=hs(t,r,s,e,i,a,l);let p;return u?p=Yi[u]:h?p=0:p=_e(m,c),[f,new $(p)]}function Ji(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ki=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Qi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,to=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ns(n){const[,t,e,s,r,i,a,l]=n;return[hs(t,r,s,e,i,a,l),$.utcInstance]}function eo(n){const[,t,e,s,r,i,a,l]=n;return[hs(t,l,e,s,r,i,a),$.utcInstance]}const so=Ut($i,ds),no=Ut(Ai,ds),ro=Ut(Hi,ds),io=Ut(Wn),An=zt(Ui,Zt,ae,le),oo=zt(Ri,Zt,ae,le),ao=zt(Vi,Zt,ae,le),lo=zt(Zt,ae,le);function co(n){return Gt(n,[so,An],[no,oo],[ro,ao],[io,lo])}function uo(n){return Gt(Ji(n),[qi,Xi])}function ho(n){return Gt(n,[Ki,Ns],[Qi,Ns],[to,eo])}function po(n){return Gt(n,[Gi,Zi])}const mo=zt(Zt);function fo(n){return Gt(n,[zi,mo])}const go=Ut(Pi,Bi),yo=Ut($n),xo=zt(Zt,ae,le);function vo(n){return Gt(n,[go,An],[yo,xo])}const Fs="Invalid Duration",Hn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},wo={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Hn},Z=146097/400,Nt=146097/4800,So={years:{quarters:4,months:12,weeks:Z/7,days:Z,hours:Z*24,minutes:Z*24*60,seconds:Z*24*60*60,milliseconds:Z*24*60*60*1e3},quarters:{months:3,weeks:Z/28,days:Z/4,hours:Z*24/4,minutes:Z*24*60/4,seconds:Z*24*60*60/4,milliseconds:Z*24*60*60*1e3/4},months:{weeks:Nt/7,days:Nt,hours:Nt*24,minutes:Nt*24*60,seconds:Nt*24*60*60,milliseconds:Nt*24*60*60*1e3},...Hn},Mt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bo=Mt.slice(0).reverse();function yt(n,t,e=!1){const s={values:e?t.values:{...n.values,...t.values||{}},loc:n.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||n.conversionAccuracy,matrix:t.matrix||n.matrix};return new C(s)}function Rn(n,t){var e;let s=(e=t.milliseconds)!=null?e:0;for(const r of bo.slice(1))t[r]&&(s+=t[r]*n[r].milliseconds);return s}function Ls(n,t){const e=Rn(n,t)<0?-1:1;Mt.reduceRight((s,r)=>{if(S(t[r]))return s;if(s){const i=t[s]*e,a=n[r][s],l=Math.floor(i/a);t[r]+=l*e,t[s]-=l*a*e}return r},null),Mt.reduce((s,r)=>{if(S(t[r]))return s;if(s){const i=t[s]%1;t[s]-=i,t[r]+=i*n[s][r]}return r},null)}function Co(n){const t={};for(const[e,s]of Object.entries(n))s!==0&&(t[e]=s);return t}class C{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let s=e?So:wo;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||T.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return C.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new L(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new C({values:Te(t,C.normalizeUnit),loc:T.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Ct(t))return C.fromMillis(t);if(C.isDuration(t))return t;if(typeof t=="object")return C.fromObject(t);throw new L(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=po(t);return s?C.fromObject(s,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[s]=fo(t);return s?C.fromObject(s,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Duration is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new Zr(s);return new C({invalid:s})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new Ys(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const s={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?W.create(this.loc,s).formatDurationFromString(this,t):Fs}toHuman(t={}){if(!this.isValid)return Fs;const e=Mt.map(s=>{const r=this.values[s];return S(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:s.slice(0,-1)}).format(r)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=cs(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},w.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Rn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t),s={};for(const r of Mt)(Pt(e.values,r)||Pt(this.values,r))&&(s[r]=e.get(r)+this.get(r));return yt(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const s of Object.keys(this.values))e[s]=Tn(t(this.values[s],s));return yt(this,{values:e},!0)}get(t){return this[C.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...Te(t,C.normalizeUnit)};return yt(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:r}={}){const a={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:r,conversionAccuracy:s};return yt(this,a)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Ls(this.matrix,t),yt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Co(this.normalize().shiftToAll().toObject());return yt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(a=>C.normalizeUnit(a));const e={},s={},r=this.toObject();let i;for(const a of Mt)if(t.indexOf(a)>=0){i=a;let l=0;for(const h in s)l+=this.matrix[h][a]*s[h],s[h]=0;Ct(r[a])&&(l+=r[a]);const u=Math.trunc(l);e[a]=u,s[a]=(l*1e3-u*1e3)/1e3}else Ct(r[a])&&(s[a]=r[a]);for(const a in s)s[a]!==0&&(e[i]+=a===i?s[a]:s[a]/this.matrix[i][a]);return Ls(this.matrix,e),yt(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return yt(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of Mt)if(!e(this.values[s],t.values[s]))return!1;return!0}}const Ft="Invalid Interval";function ko(n,t){return!n||!n.isValid?O.invalid("missing or invalid start"):!t||!t.isValid?O.invalid("missing or invalid end"):t<n?O.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${t.toISO()}`):null}class O{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Interval is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new Gr(s);return new O({invalid:s})}static fromDateTimes(t,e){const s=Xt(t),r=Xt(e),i=ko(s,r);return i??new O({start:s,end:r})}static after(t,e){const s=C.fromDurationLike(e),r=Xt(t);return O.fromDateTimes(r,r.plus(s))}static before(t,e){const s=C.fromDurationLike(e),r=Xt(t);return O.fromDateTimes(r.minus(s),r)}static fromISO(t,e){const[s,r]=(t||"").split("/",2);if(s&&r){let i,a;try{i=w.fromISO(s,e),a=i.isValid}catch{a=!1}let l,u;try{l=w.fromISO(r,e),u=l.isValid}catch{u=!1}if(a&&u)return O.fromDateTimes(i,l);if(a){const h=C.fromISO(r,e);if(h.isValid)return O.after(i,h)}else if(u){const h=C.fromISO(s,e);if(h.isValid)return O.before(l,h)}}return O.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;const s=this.start.startOf(t,e);let r;return e!=null&&e.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(t,e),Math.floor(r.diff(s,t).get(t))+(r.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?O.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Xt).filter(a=>this.contains(a)).sort((a,l)=>a.toMillis()-l.toMillis()),s=[];let{s:r}=this,i=0;for(;r<this.e;){const a=e[i]||this.e,l=+a>+this.e?this.e:a;s.push(O.fromDateTimes(r,l)),r=l,i+=1}return s}splitBy(t){const e=C.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s}=this,r=1,i;const a=[];for(;s<this.e;){const l=this.start.plus(e.mapUnits(u=>u*r));i=+l>+this.e?this.e:l,a.push(O.fromDateTimes(s,i)),s=i,r+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return e>=s?null:O.fromDateTimes(e,s)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return O.fromDateTimes(e,s)}static merge(t){const[e,s]=t.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return s&&e.push(s),e}static xor(t){let e=null,s=0;const r=[],i=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),l=a.sort((u,h)=>u.time-h.time);for(const u of l)s+=u.type==="s"?1:-1,s===1?e=u.time:(e&&+e!=+u.time&&r.push(O.fromDateTimes(e,u.time)),e=null);return O.merge(r)}difference(...t){return O.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ft}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=be,e={}){return this.isValid?W.create(this.s.loc.clone(e),t).formatInterval(this):Ft}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ft}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ft}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ft}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:Ft}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):C.invalid(this.invalidReason)}mapEndpoints(t){return O.fromDateTimes(t(this.s),t(this.e))}}class Qt{static hasDST(t=M.defaultZone){const e=w.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return ut.isValidZone(t)}static normalizeZone(t){return bt(t,M.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(e,s,i)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(e,s,i)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||T.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||T.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return T.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return T.create(e,null,"gregory").eras(t)}static features(){return{relative:bn(),localeWeek:Cn()}}}function _s(n,t){const e=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(n);return Math.floor(C.fromMillis(s).as("days"))}function To(n,t,e){const s=[["years",(u,h)=>h.year-u.year],["quarters",(u,h)=>h.quarter-u.quarter+(h.year-u.year)*4],["months",(u,h)=>h.month-u.month+(h.year-u.year)*12],["weeks",(u,h)=>{const m=_s(u,h);return(m-m%7)/7}],["days",_s]],r={},i=n;let a,l;for(const[u,h]of s)e.indexOf(u)>=0&&(a=u,r[u]=h(n,t),l=i.plus(r),l>t?(r[u]--,n=i.plus(r),n>t&&(l=n,r[u]--,n=i.plus(r))):n=l);return[n,r,l,a]}function Do(n,t,e,s){let[r,i,a,l]=To(n,t,e);const u=t-r,h=e.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);h.length===0&&(a<t&&(a=r.plus({[l]:1})),a!==r&&(i[l]=(i[l]||0)+u/(a-r)));const m=C.fromObject(i,s);return h.length>0?C.fromMillis(u,s).shiftTo(...h).plus(m):m}const Oo="missing Intl.DateTimeFormat.formatToParts support";function k(n,t=e=>e){return{regex:n,deser:([e])=>t(fi(e))}}const Mo=" ",Vn=`[ ${Mo}]`,Pn=new RegExp(Vn,"g");function Io(n){return n.replace(/\./g,"\\.?").replace(Pn,Vn)}function Ws(n){return n.replace(/\./g,"").replace(Pn," ").toLowerCase()}function rt(n,t){return n===null?null:{regex:RegExp(n.map(Io).join("|")),deser:([e])=>n.findIndex(s=>Ws(e)===Ws(s))+t}}function $s(n,t){return{regex:n,deser:([,e,s])=>_e(e,s),groups:t}}function de(n){return{regex:n,deser:([t])=>t}}function jo(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Eo(n,t){const e=nt(t),s=nt(t,"{2}"),r=nt(t,"{3}"),i=nt(t,"{4}"),a=nt(t,"{6}"),l=nt(t,"{1,2}"),u=nt(t,"{1,3}"),h=nt(t,"{1,6}"),m=nt(t,"{1,9}"),c=nt(t,"{2,4}"),f=nt(t,"{4,6}"),p=D=>({regex:RegExp(jo(D.val)),deser:([E])=>E,literal:!0}),A=(D=>{if(n.literal)return p(D);switch(D.val){case"G":return rt(t.eras("short"),0);case"GG":return rt(t.eras("long"),0);case"y":return k(h);case"yy":return k(c,ts);case"yyyy":return k(i);case"yyyyy":return k(f);case"yyyyyy":return k(a);case"M":return k(l);case"MM":return k(s);case"MMM":return rt(t.months("short",!0),1);case"MMMM":return rt(t.months("long",!0),1);case"L":return k(l);case"LL":return k(s);case"LLL":return rt(t.months("short",!1),1);case"LLLL":return rt(t.months("long",!1),1);case"d":return k(l);case"dd":return k(s);case"o":return k(u);case"ooo":return k(r);case"HH":return k(s);case"H":return k(l);case"hh":return k(s);case"h":return k(l);case"mm":return k(s);case"m":return k(l);case"q":return k(l);case"qq":return k(s);case"s":return k(l);case"ss":return k(s);case"S":return k(u);case"SSS":return k(r);case"u":return de(m);case"uu":return de(l);case"uuu":return k(e);case"a":return rt(t.meridiems(),0);case"kkkk":return k(i);case"kk":return k(c,ts);case"W":return k(l);case"WW":return k(s);case"E":case"c":return k(e);case"EEE":return rt(t.weekdays("short",!1),1);case"EEEE":return rt(t.weekdays("long",!1),1);case"ccc":return rt(t.weekdays("short",!0),1);case"cccc":return rt(t.weekdays("long",!0),1);case"Z":case"ZZ":return $s(new RegExp(`([+-]${l.source})(?::(${s.source}))?`),2);case"ZZZ":return $s(new RegExp(`([+-]${l.source})(${s.source})?`),2);case"z":return de(/[a-z_+-/]{1,256}?/i);case" ":return de(/[^\S\n\r]/);default:return p(D)}})(n)||{invalidReason:Oo};return A.token=n,A}const No={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Fo(n,t,e){const{type:s,value:r}=n;if(s==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=t[s];let a=s;s==="hour"&&(t.hour12!=null?a=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?a="hour12":a="hour24":a=e.hour12?"hour12":"hour24");let l=No[a];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function Lo(n){return[`^${n.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,n]}function _o(n,t,e){const s=n.match(t);if(s){const r={};let i=1;for(const a in e)if(Pt(e,a)){const l=e[a],u=l.groups?l.groups+1:1;!l.literal&&l.token&&(r[l.token.val[0]]=l.deser(s.slice(i,i+u))),i+=u}return[s,r]}else return[s,{}]}function Wo(n){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let e=null,s;return S(n.z)||(e=ut.create(n.z)),S(n.Z)||(e||(e=new $(n.Z)),s=n.Z),S(n.q)||(n.M=(n.q-1)*3+1),S(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),S(n.u)||(n.S=ls(n.u)),[Object.keys(n).reduce((i,a)=>{const l=t(a);return l&&(i[l]=n[a]),i},{}),e,s]}let Ve=null;function $o(){return Ve||(Ve=w.fromMillis(1555555555555)),Ve}function Ao(n,t){if(n.literal)return n;const e=W.macroTokenToFormatOpts(n.val),s=Gn(e,t);return s==null||s.includes(void 0)?n:s}function Bn(n,t){return Array.prototype.concat(...n.map(e=>Ao(e,t)))}class Un{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Bn(W.parseFormat(e),t),this.units=this.tokens.map(s=>Eo(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=Lo(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(t){if(this.isValid){const[e,s]=_o(t,this.regex,this.handlers),[r,i,a]=s?Wo(s):[null,null,void 0];if(Pt(s,"a")&&Pt(s,"H"))throw new Ht("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:s,result:r,zone:i,specificOffset:a}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function zn(n,t,e){return new Un(n,e).explainFromTokens(t)}function Ho(n,t,e){const{result:s,zone:r,specificOffset:i,invalidReason:a}=zn(n,t,e);return[s,r,i,a]}function Gn(n,t){if(!n)return null;const s=W.create(t,n).dtFormatter($o()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(a=>Fo(a,n,i))}const Pe="Invalid DateTime",Ro=864e13;function te(n){return new ot("unsupported zone",`the zone "${n.name}" is not supported`)}function Be(n){return n.weekData===null&&(n.weekData=Ce(n.c)),n.weekData}function Ue(n){return n.localWeekData===null&&(n.localWeekData=Ce(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Dt(n,t){const e={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new w({...e,...t,old:e})}function Zn(n,t,e){let s=n-t*60*1e3;const r=e.offset(s);if(t===r)return[s,t];s-=(r-t)*60*1e3;const i=e.offset(s);return r===i?[s,r]:[n-Math.min(r,i)*60*1e3,Math.max(r,i)]}function he(n,t){n+=t*60*1e3;const e=new Date(n);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function xe(n,t,e){return Zn(Le(n),t,e)}function As(n,t){const e=n.o,s=n.c.year+Math.trunc(t.years),r=n.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...n.c,year:s,month:r,day:Math.min(n.c.day,ke(s,r))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},a=C.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Le(i);let[u,h]=Zn(l,e,n.zone);return a!==0&&(u+=a,h=n.zone.offset(u)),{ts:u,o:h}}function Lt(n,t,e,s,r,i){const{setZone:a,zone:l}=e;if(n&&Object.keys(n).length!==0||t){const u=t||l,h=w.fromObject(n,{...e,zone:u,specificOffset:i});return a?h:h.setZone(l)}else return w.invalid(new ot("unparsable",`the input "${r}" can't be parsed as ${s}`))}function pe(n,t,e=!0){return n.isValid?W.create(T.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(n,t):null}function ze(n,t){const e=n.c.year>9999||n.c.year<0;let s="";return e&&n.c.year>=0&&(s+="+"),s+=I(n.c.year,e?6:4),t?(s+="-",s+=I(n.c.month),s+="-",s+=I(n.c.day)):(s+=I(n.c.month),s+=I(n.c.day)),s}function Hs(n,t,e,s,r,i){let a=I(n.c.hour);return t?(a+=":",a+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!e)&&(a+=":")):a+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!e)&&(a+=I(n.c.second),(n.c.millisecond!==0||!s)&&(a+=".",a+=I(n.c.millisecond,3))),r&&(n.isOffsetFixed&&n.offset===0&&!i?a+="Z":n.o<0?(a+="-",a+=I(Math.trunc(-n.o/60)),a+=":",a+=I(Math.trunc(-n.o%60))):(a+="+",a+=I(Math.trunc(n.o/60)),a+=":",a+=I(Math.trunc(n.o%60)))),i&&(a+="["+n.zone.ianaName+"]"),a}const Yn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Vo={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Po={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qn=["year","month","day","hour","minute","second","millisecond"],Bo=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Uo=["year","ordinal","hour","minute","second","millisecond"];function zo(n){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!t)throw new Ys(n);return t}function Rs(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zo(n)}}function Go(n){return we[n]||(ve===void 0&&(ve=M.now()),we[n]=n.offset(ve)),we[n]}function Vs(n,t){const e=bt(t.zone,M.defaultZone);if(!e.isValid)return w.invalid(te(e));const s=T.fromObject(t);let r,i;if(S(n.year))r=M.now();else{for(const u of qn)S(n[u])&&(n[u]=Yn[u]);const a=wn(n)||Sn(n);if(a)return w.invalid(a);const l=Go(e);[r,i]=xe(n,l,e)}return new w({ts:r,zone:e,loc:s,o:i})}function Ps(n,t,e){const s=S(e.round)?!0:e.round,r=(a,l)=>(a=cs(a,s||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(a,l)),i=a=>e.calendary?t.hasSame(n,a)?0:t.startOf(a).diff(n.startOf(a),a).get(a):t.diff(n,a).get(a);if(e.unit)return r(i(e.unit),e.unit);for(const a of e.units){const l=i(a);if(Math.abs(l)>=1)return r(l,a)}return r(n>t?-0:0,e.units[e.units.length-1])}function Bs(n){let t={},e;return n.length>0&&typeof n[n.length-1]=="object"?(t=n[n.length-1],e=Array.from(n).slice(0,n.length-1)):e=Array.from(n),[t,e]}let ve,we={};class w{constructor(t){const e=t.zone||M.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new ot("invalid input"):null)||(e.isValid?null:te(e));this.ts=S(t.ts)?M.now():t.ts;let r=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[r,i]=[t.old.c,t.old.o];else{const l=Ct(t.o)&&!t.old?t.o:e.offset(this.ts);r=he(this.ts,l),s=Number.isNaN(r.year)?new ot("invalid input"):null,r=s?null:r,i=s?null:l}this._zone=e,this.loc=t.loc||T.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new w({})}static local(){const[t,e]=Bs(arguments),[s,r,i,a,l,u,h]=e;return Vs({year:s,month:r,day:i,hour:a,minute:l,second:u,millisecond:h},t)}static utc(){const[t,e]=Bs(arguments),[s,r,i,a,l,u,h]=e;return t.zone=$.utcInstance,Vs({year:s,month:r,day:i,hour:a,minute:l,second:u,millisecond:h},t)}static fromJSDate(t,e={}){const s=wi(t)?t.valueOf():NaN;if(Number.isNaN(s))return w.invalid("invalid input");const r=bt(e.zone,M.defaultZone);return r.isValid?new w({ts:s,zone:r,loc:T.fromObject(e)}):w.invalid(te(r))}static fromMillis(t,e={}){if(Ct(t))return t<-864e13||t>Ro?w.invalid("Timestamp out of range"):new w({ts:t,zone:bt(e.zone,M.defaultZone),loc:T.fromObject(e)});throw new L(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Ct(t))return new w({ts:t*1e3,zone:bt(e.zone,M.defaultZone),loc:T.fromObject(e)});throw new L("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=bt(e.zone,M.defaultZone);if(!s.isValid)return w.invalid(te(s));const r=T.fromObject(e),i=Te(t,Rs),{minDaysInFirstWeek:a,startOfWeek:l}=Ms(i,r),u=M.now(),h=S(e.specificOffset)?s.offset(u):e.specificOffset,m=!S(i.ordinal),c=!S(i.year),f=!S(i.month)||!S(i.day),p=c||f,x=i.weekYear||i.weekNumber;if((p||m)&&x)throw new Ht("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&m)throw new Ht("Can't mix ordinal dates with month/day");const A=x||i.weekday&&!p;let D,E,j=he(u,h);A?(D=Bo,E=Vo,j=Ce(j,a,l)):m?(D=Uo,E=Po,j=Re(j)):(D=qn,E=Yn);let K=!1;for(const qt of D){const Jn=i[qt];S(Jn)?K?i[qt]=E[qt]:i[qt]=j[qt]:K=!0}const Q=A?yi(i,a,l):m?xi(i):wn(i),tt=Q||Sn(i);if(tt)return w.invalid(tt);const mt=A?Ds(i,a,l):m?Os(i):i,[V,kt]=xe(mt,h,s),ft=new w({ts:V,zone:s,o:kt,loc:r});return i.weekday&&p&&t.weekday!==ft.weekday?w.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${ft.toISO()}`):ft.isValid?ft:w.invalid(ft.invalid)}static fromISO(t,e={}){const[s,r]=co(t);return Lt(s,r,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,r]=uo(t);return Lt(s,r,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,r]=ho(t);return Lt(s,r,e,"HTTP",e)}static fromFormat(t,e,s={}){if(S(t)||S(e))throw new L("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[l,u,h,m]=Ho(a,t,e);return m?w.invalid(m):Lt(l,u,s,`format ${e}`,t,h)}static fromString(t,e,s={}){return w.fromFormat(t,e,s)}static fromSQL(t,e={}){const[s,r]=vo(t);return Lt(s,r,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the DateTime is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new zr(s);return new w({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=Gn(t,T.fromObject(e));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(t,e={}){return Bn(W.parseFormat(t),T.fromObject(e)).map(r=>r.val).join("")}static resetCache(){ve=void 0,we={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Be(this).weekYear:NaN}get weekNumber(){return this.isValid?Be(this).weekNumber:NaN}get weekday(){return this.isValid?Be(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ue(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ue(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ue(this).weekYear:NaN}get ordinal(){return this.isValid?Re(this.c).ordinal:NaN}get monthShort(){return this.isValid?Qt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Qt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Qt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Qt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,s=Le(this.c),r=this.zone.offset(s-t),i=this.zone.offset(s+t),a=this.zone.offset(s-r*e),l=this.zone.offset(s-i*e);if(a===l)return[this];const u=s-a*e,h=s-l*e,m=he(u,a),c=he(h,l);return m.hour===c.hour&&m.minute===c.minute&&m.second===c.second&&m.millisecond===c.millisecond?[Dt(this,{ts:u}),Dt(this,{ts:h})]:[this]}get isInLeapYear(){return oe(this.year)}get daysInMonth(){return ke(this.year,this.month)}get daysInYear(){return this.isValid?Rt(this.year):NaN}get weeksInWeekYear(){return this.isValid?ne(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ne(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:s,calendar:r}=W.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:r}}toUTC(t=0,e={}){return this.setZone($.instance(t),e)}toLocal(){return this.setZone(M.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=bt(t,M.defaultZone),t.equals(this.zone))return this;if(t.isValid){let r=this.ts;if(e||s){const i=t.offset(this.ts),a=this.toObject();[r]=xe(a,i,t)}return Dt(this,{ts:r,zone:t})}else return w.invalid(te(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const r=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return Dt(this,{loc:r})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=Te(t,Rs),{minDaysInFirstWeek:s,startOfWeek:r}=Ms(e,this.loc),i=!S(e.weekYear)||!S(e.weekNumber)||!S(e.weekday),a=!S(e.ordinal),l=!S(e.year),u=!S(e.month)||!S(e.day),h=l||u,m=e.weekYear||e.weekNumber;if((h||a)&&m)throw new Ht("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Ht("Can't mix ordinal dates with month/day");let c;i?c=Ds({...Ce(this.c,s,r),...e},s,r):S(e.ordinal)?(c={...this.toObject(),...e},S(e.day)&&(c.day=Math.min(ke(c.year,c.month),c.day))):c=Os({...Re(this.c),...e});const[f,p]=xe(c,this.o,this.zone);return Dt(this,{ts:f,o:p})}plus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t);return Dt(this,As(this,e))}minus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t).negate();return Dt(this,As(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const s={},r=C.normalizeUnit(t);switch(r){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(r==="weeks")if(e){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?W.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Pe}toLocaleString(t=be,e={}){return this.isValid?W.create(this.loc.clone(e),t).formatDateTime(this):Pe}toLocaleParts(t={}){return this.isValid?W.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=t==="extended";let l=ze(this,a);return l+="T",l+=Hs(this,a,e,s,r,i),l}toISODate({format:t="extended"}={}){return this.isValid?ze(this,t==="extended"):null}toISOWeekDate(){return pe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Hs(this,a==="extended",e,t,s,i):null}toRFC2822(){return pe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return pe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ze(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(e||t)&&(s&&(r+=" "),e?r+="z":t&&(r+="ZZ")),pe(this,r,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Pe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",s={}){if(!this.isValid||!t.isValid)return C.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=Si(e).map(C.normalizeUnit),a=t.valueOf()>this.valueOf(),l=a?this:t,u=a?t:this,h=Do(l,u,i,r);return a?h.negate():h}diffNow(t="milliseconds",e={}){return this.diff(w.now(),t,e)}until(t){return this.isValid?O.fromDateTimes(this,t):this}hasSame(t,e,s){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(e,s)<=r&&r<=i.endOf(e,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||w.fromObject({},{zone:this.zone}),s=t.padding?this<e?-t.padding:t.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(r=t.unit,i=void 0),Ps(e,this.plus(s),{...t,numeric:"always",units:r,unit:i})}toRelativeCalendar(t={}){return this.isValid?Ps(t.base||w.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(w.isDateTime))throw new L("min requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(w.isDateTime))throw new L("max requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return zn(a,t,e)}static fromStringExplain(t,e,s={}){return w.fromFormatExplain(t,e,s)}static buildFormatParser(t,e={}){const{locale:s=null,numberingSystem:r=null}=e,i=T.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new Un(i,t)}static fromFormatParser(t,e,s={}){if(S(t)||S(e))throw new L("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!a.equals(e.locale))throw new L(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${e.locale}`);const{result:l,zone:u,specificOffset:h,invalidReason:m}=e.explainFromTokens(t);return m?w.invalid(m):Lt(l,u,s,`format ${e.format}`,t,h)}static get DATE_SHORT(){return be}static get DATE_MED(){return qs}static get DATE_MED_WITH_WEEKDAY(){return Yr}static get DATE_FULL(){return Xs}static get DATE_HUGE(){return Js}static get TIME_SIMPLE(){return Ks}static get TIME_WITH_SECONDS(){return Qs}static get TIME_WITH_SHORT_OFFSET(){return tn}static get TIME_WITH_LONG_OFFSET(){return en}static get TIME_24_SIMPLE(){return sn}static get TIME_24_WITH_SECONDS(){return nn}static get TIME_24_WITH_SHORT_OFFSET(){return rn}static get TIME_24_WITH_LONG_OFFSET(){return on}static get DATETIME_SHORT(){return an}static get DATETIME_SHORT_WITH_SECONDS(){return ln}static get DATETIME_MED(){return cn}static get DATETIME_MED_WITH_SECONDS(){return un}static get DATETIME_MED_WITH_WEEKDAY(){return qr}static get DATETIME_FULL(){return dn}static get DATETIME_FULL_WITH_SECONDS(){return hn}static get DATETIME_HUGE(){return pn}static get DATETIME_HUGE_WITH_SECONDS(){return mn}}function Xt(n){if(w.isDateTime(n))return n;if(n&&n.valueOf&&Ct(n.valueOf()))return w.fromJSDate(n);if(n&&typeof n=="object")return w.fromObject(n);throw new L(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Zo="3.5.0";z.DateTime=w;z.Duration=C;z.FixedOffsetZone=$;z.IANAZone=ut;z.Info=Qt;z.Interval=O;z.InvalidZone=fn;z.Settings=M;z.SystemZone=ie;z.VERSION=Zo;z.Zone=Bt;Object.defineProperty(lt,"__esModule",{value:!0});lt.CronDate=lt.DateMathOp=lt.TimeUnit=void 0;const Ot=z;var F;(function(n){n.Second="Second",n.Minute="Minute",n.Hour="Hour",n.Day="Day",n.Month="Month",n.Year="Year"})(F||(lt.TimeUnit=F={}));var De;(function(n){n.Add="Add",n.Subtract="Subtract"})(De||(lt.DateMathOp=De={}));class $e{#t;#e=null;#n=null;#i={add:{[F.Year]:this.addYear.bind(this),[F.Month]:this.addMonth.bind(this),[F.Day]:this.addDay.bind(this),[F.Hour]:this.addHour.bind(this),[F.Minute]:this.addMinute.bind(this),[F.Second]:this.addSecond.bind(this)},subtract:{[F.Year]:this.subtractYear.bind(this),[F.Month]:this.subtractMonth.bind(this),[F.Day]:this.subtractDay.bind(this),[F.Hour]:this.subtractHour.bind(this),[F.Minute]:this.subtractMinute.bind(this),[F.Second]:this.subtractSecond.bind(this)}};constructor(t,e){const s={zone:e};if(t?t instanceof $e?(this.#t=t.#t,this.#e=t.#e,this.#n=t.#n):t instanceof Date?this.#t=Ot.DateTime.fromJSDate(t,s):typeof t=="number"?this.#t=Ot.DateTime.fromMillis(t,s):(this.#t=Ot.DateTime.fromISO(t,s),this.#t.isValid||(this.#t=Ot.DateTime.fromRFC2822(t,s)),this.#t.isValid||(this.#t=Ot.DateTime.fromSQL(t,s)),this.#t.isValid||(this.#t=Ot.DateTime.fromFormat(t,"EEE, d MMM yyyy HH:mm:ss",s))):this.#t=Ot.DateTime.local(),!this.#t.isValid)throw new Error(`CronDate: unhandled timestamp: ${t}`);e&&e!==this.#t.zoneName&&(this.#t=this.#t.setZone(e))}get dstStart(){return this.#e}set dstStart(t){this.#e=t}get dstEnd(){return this.#n}set dstEnd(t){this.#n=t}addYear(){this.#t=this.#t.plus({years:1})}addMonth(){this.#t=this.#t.plus({months:1}).startOf("month")}addDay(){this.#t=this.#t.plus({days:1}).startOf("day")}addHour(){this.#t=this.#t.plus({hours:1}).startOf("hour")}addMinute(){this.#t=this.#t.plus({minutes:1}).startOf("minute")}addSecond(){this.#t=this.#t.plus({seconds:1})}subtractYear(){this.#t=this.#t.minus({years:1})}subtractMonth(){this.#t=this.#t.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#t=this.#t.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#t=this.#t.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#t=this.#t.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#t=this.#t.minus({seconds:1})}addUnit(t){this.#i.add[t]()}subtractUnit(t){this.#i.subtract[t]()}invokeDateOperation(t,e){if(t===De.Add){this.addUnit(e);return}if(t===De.Subtract){this.subtractUnit(e);return}throw new Error(`Invalid verb: ${t}`)}getDate(){return this.#t.day}getFullYear(){return this.#t.year}getDay(){const t=this.#t.weekday;return t===7?0:t}getMonth(){return this.#t.month-1}getHours(){return this.#t.hour}getMinutes(){return this.#t.minute}getSeconds(){return this.#t.second}getMilliseconds(){return this.#t.millisecond}getTime(){return this.#t.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const t=this.#r().weekday;return t===7?0:t}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#t.toUTC().toISO()}toJSON(){return this.#t.toJSON()}setDate(t){this.#t=this.#t.set({day:t})}setFullYear(t){this.#t=this.#t.set({year:t})}setDay(t){this.#t=this.#t.set({weekday:t})}setMonth(t){this.#t=this.#t.set({month:t+1})}setHours(t){this.#t=this.#t.set({hour:t})}setMinutes(t){this.#t=this.#t.set({minute:t})}setSeconds(t){this.#t=this.#t.set({second:t})}setMilliseconds(t){this.#t=this.#t.set({millisecond:t})}toString(){return this.toDate().toString()}toDate(){return this.#t.toJSDate()}isLastDayOfMonth(){const t=this.#t.plus({days:1}).startOf("day");return this.#t.month!==t.month}isLastWeekdayOfMonth(){const t=this.#t.plus({days:7}).startOf("day");return this.#t.month!==t.month}applyDateOperation(t,e,s){if(e===F.Month||e===F.Day){this.invokeDateOperation(t,e);return}const r=this.getHours();this.invokeDateOperation(t,e);const i=this.getHours(),a=i-r;a===2?s!==24&&(this.dstStart=i):a===0&&this.getMinutes()===0&&this.getSeconds()===0&&s!==24&&(this.dstEnd=i)}#r(){return this.#t.toUTC()}}lt.CronDate=$e;lt.default=$e;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CronExpression=void 0;const Yo=z,N=lt,Us=1e4;class R{#t;#e;#n;#i;#r;#a;#s;constructor(t,e){this.#t=e,this.#e=e.tz,this.#n=new N.CronDate(e.currentDate,this.#e),this.#i=e.startDate?new N.CronDate(e.startDate,this.#e):null,this.#r=e.endDate?new N.CronDate(e.endDate,this.#e):null,this.#a=e.nthDayOfWeek||0,this.#s=t}get fields(){return this.#s}static fieldsToExpression(t,e){return new R(t,e||{})}static#o(t,e){return e.some(s=>s===t)}static#l(t){return t.length>0&&t.some(e=>typeof e=="string"&&e.indexOf("L")>=0)}static#u(t,e){return t.some(s=>{if(!R.#l([s]))return!1;const r=parseInt(s.toString().charAt(0),10)%7;if(Number.isNaN(r))throw new Error(`Invalid last weekday of the month expression: ${s}`);return e.getDay()===r&&e.isLastWeekdayOfMonth()})}next(){return this.#c()}prev(){return this.#c(!0)}hasNext(){const t=this.#n;try{return this.#c(),!0}catch{return!1}finally{this.#n=t}}hasPrev(){const t=this.#n;try{return this.#c(!0),!0}catch{return!1}finally{this.#n=t}}take(t){const e=[];if(t>=0)for(let s=0;s<t;s++)try{e.push(this.next())}catch{return e}else for(let s=0;s>t;s--)try{e.push(this.prev())}catch{return e}return e}reset(t){this.#n=new N.CronDate(t||this.#t.currentDate)}stringify(t=!1){return this.#s.stringify(t)}includesDate(t){const{second:e,minute:s,hour:r,dayOfMonth:i,month:a,dayOfWeek:l}=this.#s,u=Yo.DateTime.fromISO(t.toISOString(),{zone:this.#e});return i.values.includes(u.day)&&l.values.includes(u.weekday)&&a.values.includes(u.month)&&r.values.includes(u.hour)&&s.values.includes(u.minute)&&e.values.includes(u.second)}toString(){return this.#t.expression||this.stringify(!0)}#d(t){const e=this.#s.dayOfMonth.isWildcard,s=!e,r=this.#s.dayOfWeek.isWildcard,i=!r,a=R.#o(t.getDate(),this.#s.dayOfMonth.values)||R.#l(this.#s.dayOfMonth.values)&&t.isLastDayOfMonth(),l=R.#o(t.getDay(),this.#s.dayOfWeek.values)||R.#l(this.#s.dayOfWeek.values)&&R.#u(this.#s.dayOfWeek.values,t);return!!(s&&i&&(a||l)||a&&!i||e&&!r&&l)}#h(t,e,s){const r=t.getHours(),i=R.#o(r,this.#s.hour.values),a=t.dstStart===r,l=t.dstEnd===r;return!i&&!a?(t.dstStart=null,t.applyDateOperation(e,N.TimeUnit.Hour,this.#s.hour.values.length),!1):a&&!R.#o(r-1,this.#s.hour.values)?(t.invokeDateOperation(e,N.TimeUnit.Hour),!1):l&&!s?(t.dstEnd=null,t.applyDateOperation(N.DateMathOp.Add,N.TimeUnit.Hour,this.#s.hour.values.length),!1):!0}#c(t=!1){const e=t?N.DateMathOp.Subtract:N.DateMathOp.Add,s=new N.CronDate(this.#n),r=this.#i,i=this.#r,a=s.getTime();let l=0;for(;l++<Us;){if(l>Us)throw new Error("Invalid expression, loop limit exceeded");if(t&&r&&r.getTime()>s.getTime())throw new Error("Out of the timespan range");if(!t&&i&&s.getTime()>i.getTime())throw new Error("Out of the timespan range");if(!this.#d(s)){s.applyDateOperation(e,N.TimeUnit.Day,this.#s.hour.values.length);continue}if(!(this.#a<=0||Math.ceil(s.getDate()/7)===this.#a)){s.applyDateOperation(e,N.TimeUnit.Day,this.#s.hour.values.length);continue}if(!R.#o(s.getMonth()+1,this.#s.month.values)){s.applyDateOperation(e,N.TimeUnit.Month,this.#s.hour.values.length);continue}if(this.#h(s,e,t)){if(!R.#o(s.getMinutes(),this.#s.minute.values)){s.applyDateOperation(e,N.TimeUnit.Minute,this.#s.hour.values.length);continue}if(!R.#o(s.getSeconds(),this.#s.second.values)){s.applyDateOperation(e,N.TimeUnit.Second,this.#s.hour.values.length);continue}if(a===s.getTime()){(e==="Add"||s.getMilliseconds()===0)&&s.applyDateOperation(e,N.TimeUnit.Second,this.#s.hour.values.length);continue}break}}return s.getMilliseconds()!==0&&s.setMilliseconds(0),this.#n=s,s}[Symbol.iterator](){return{next:()=>({value:this.#c(),done:!this.hasNext()})}}}Yt.CronExpression=R;Yt.default=R;Object.defineProperty(U,"__esModule",{value:!0});U.CronExpressionParser=U.DayOfWeek=U.Months=U.CronUnit=U.PredefinedExpressions=void 0;const qo=re,Xo=lt,Jo=Yt,Y=St;var es;(function(n){n["@yearly"]="0 0 0 1 1 *",n["@annually"]="0 0 0 1 1 *",n["@monthly"]="0 0 0 1 * *",n["@weekly"]="0 0 0 * * 0",n["@daily"]="0 0 0 * * *",n["@hourly"]="0 0 * * * *",n["@minutely"]="0 * * * * *",n["@secondly"]="* * * * * *",n["@weekdays"]="0 0 0 * * 1-5",n["@weekends"]="0 0 0 * * 0,6"})(es||(U.PredefinedExpressions=es={}));var q;(function(n){n.Second="Second",n.Minute="Minute",n.Hour="Hour",n.DayOfMonth="DayOfMonth",n.Month="Month",n.DayOfWeek="DayOfWeek"})(q||(U.CronUnit=q={}));var ss;(function(n){n[n.jan=1]="jan",n[n.feb=2]="feb",n[n.mar=3]="mar",n[n.apr=4]="apr",n[n.may=5]="may",n[n.jun=6]="jun",n[n.jul=7]="jul",n[n.aug=8]="aug",n[n.sep=9]="sep",n[n.oct=10]="oct",n[n.nov=11]="nov",n[n.dec=12]="dec"})(ss||(U.Months=ss={}));var ns;(function(n){n[n.sun=0]="sun",n[n.mon=1]="mon",n[n.tue=2]="tue",n[n.wed=3]="wed",n[n.thu=4]="thu",n[n.fri=5]="fri",n[n.sat=6]="sat"})(ns||(U.DayOfWeek=ns={}));class H{static parse(t,e={}){const{strict:s=!1}=e,r=e.currentDate||new Xo.CronDate(void 0,"UTC");t=es[t]||t;const i=H.#t(t,s);if(!(i.dayOfMonth==="*"||i.dayOfWeek==="*"||!s))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const a=H.#e(q.Second,i.second,Y.CronSecond.constraints),l=H.#e(q.Minute,i.minute,Y.CronMinute.constraints),u=H.#e(q.Hour,i.hour,Y.CronHour.constraints),h=H.#e(q.Month,i.month,Y.CronMonth.constraints),m=H.#e(q.DayOfMonth,i.dayOfMonth,Y.CronDayOfMonth.constraints),{dayOfWeek:c,nthDayOfWeek:f}=H.#l(i.dayOfWeek),p=H.#e(q.DayOfWeek,c,Y.CronDayOfWeek.constraints),x=new qo.CronFieldCollection({second:new Y.CronSecond(a,["*","?"].includes(i.second)),minute:new Y.CronMinute(l,["*","?"].includes(i.minute)),hour:new Y.CronHour(u,["*","?"].includes(i.hour)),dayOfMonth:new Y.CronDayOfMonth(m,["*","?"].includes(i.dayOfMonth)),month:new Y.CronMonth(h,["*","?"].includes(i.month)),dayOfWeek:new Y.CronDayOfWeek(p,["*","?"].includes(i.dayOfWeek))});return new Jo.CronExpression(x,{...e,expression:t,currentDate:r,nthDayOfWeek:f})}static#t(t,e){if(!(!e||t.length))throw new Error("Invalid cron expression");t=t||"0 * * * * *";const s=t.trim().split(/\s+/);if(!(!e||s.length===6))throw new Error("Invalid cron expression, expected 6 fields");if(s.length>6)throw new Error("Invalid cron expression, too many fields");const r=["*","*","*","*","*","0"];s.length<r.length&&s.unshift(...r.slice(s.length));const[i,a,l,u,h,m]=s;return{second:i,minute:a,hour:l,dayOfMonth:u,month:h,dayOfWeek:m}}static#e(t,e,s){if((t===q.Month||t===q.DayOfWeek)&&(e=e.replace(/[a-z]{3}/gi,r=>{r=r.toLowerCase();const i=ss[r]||ns[r];if(i===void 0)throw new Error(`Validation error, cannot resolve alias "${r}"`);return i.toString()})),!s.validChars.test(e))throw new Error(`Invalid characters, got value: ${e}`);return e=e.replace(/[*?]/g,s.min+"-"+s.max),H.#n(t,e,s)}static#n(t,e,s){const r=[];function i(l,u){if(Array.isArray(l))r.push(...l);else if(H.#u(u,l))r.push(l);else{const h=parseInt(l.toString(),10);if(!(h>=u.min&&h<=u.max))throw new Error(`Constraint error, got value ${l} expected range ${u.min}-${u.max}`);r.push(t===q.DayOfWeek?h%7:l)}}return e.split(",").forEach(l=>{if(!(l.length>0))throw new Error("Invalid list value format");i(H.#i(t,l,s),s)}),r}static#i(t,e,s){const r=e.split("/");if(r.length>2)throw new Error(`Invalid repeat: ${e}`);return r.length===2?(isNaN(parseInt(r[0],10))||(r[0]=`${r[0]}-${s.max}`),H.#o(t,r[0],parseInt(r[1],10),s)):H.#o(t,e,1,s)}static#r(t,e,s){if(!(!isNaN(t)&&!isNaN(e)&&t>=s.min&&e<=s.max))throw new Error(`Constraint error, got range ${t}-${e} expected range ${s.min}-${s.max}`);if(t>e)throw new Error(`Invalid range: ${t}-${e}, min(${t}) > max(${e})`)}static#a(t){if(!(!isNaN(t)&&t>0))throw new Error(`Constraint error, cannot repeat at every ${t} time.`)}static#s(t,e,s,r){const i=[];t===q.DayOfWeek&&s%7===0&&i.push(0);for(let a=e;a<=s;a+=r)i.indexOf(a)===-1&&i.push(a);return i}static#o(t,e,s,r){const i=e.split("-");if(i.length<=1)return isNaN(+e)?e:+e;const[a,l]=i.map(u=>parseInt(u,10));return this.#r(a,l,r),this.#a(s),this.#s(t,a,l,s)}static#l(t){const e=t.split("#");if(e.length<=1)return{dayOfWeek:e[0]};const s=+e[e.length-1],r=t.match(/([,-/])/);if(r!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r==null?void 0:r[0]}\` special characters are incompatible`);if(!(e.length<=2&&!isNaN(s)&&s>=1&&s<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:e[0],nthDayOfWeek:s}}static#u(t,e){return t.chars.some(s=>e.toString().includes(s))}}U.CronExpressionParser=H;var dt={},Ko=dt&&dt.__createBinding||(Object.create?function(n,t,e,s){s===void 0&&(s=e);var r=Object.getOwnPropertyDescriptor(t,e);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,s,r)}:function(n,t,e,s){s===void 0&&(s=e),n[s]=t[e]}),Qo=dt&&dt.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),ta=dt&&dt.__importStar||function(){var n=function(t){return n=Object.getOwnPropertyNames||function(e){var s=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[s.length]=r);return s},n(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=n(t),r=0;r<s.length;r++)s[r]!=="default"&&Ko(e,t,s[r]);return Qo(e,t),e}}();Object.defineProperty(dt,"__esModule",{value:!0});dt.CronFileParser=void 0;const ea=U;class se{static async parseFile(t){const{readFile:e}=await Promise.resolve().then(()=>ta(ps)),s=await e(t,"utf8");return se.#t(s)}static parseFileSync(t){const{readFileSync:e}=ps,s=e(t,"utf8");return se.#t(s)}static#t(t){const e=t.split(`
1
+ import{j as o,J as Jt,B as Kn,F as Ye,H as Se,E as fe}from"./DefaultPropsProvider-Beyggw1o.js";import{i as It}from"./iobroker_admin__loadShare__react__loadShare__-T96CJO0k.js";import{r as ps,j as zs,i as d,U as ge,f as at,I as pt,a as v,k as Qn,D as tr,l as ms,m as er,R as Gs,n as sr,c as wt,w as nr,o as rr,h as ir,g as or,T as ar}from"./bootstrap-CoF0Rq1_.js";import{a as lr}from"./index-CFcKrkeG.js";import{C as cr}from"./Config-DV-y10Fh.js";import{S as et}from"./State-CmEur1zC.js";import{s as ur,M as dr,C as hr}from"./sentry-Cc5WioqD.js";import{C as Et}from"./CustomModal-CYOPWjwy.js";import{a as pr}from"./blueGrey-BKTirx-Z.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-C8Lvs8Es.js";import"./_commonjsHelpers-BosuxZz1.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js";import"./ace-BAuRYJjv.js";import"./FilledInput-Bfz0Aef-.js";import"./preload-helper-C1FmrZbK.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-FMqZHPyC.js";import"./extends-CF3RwP-h.js";import"./iconBase-CxzgaDaB.js";import"./emotion-cache.browser.esm-B8BFze5o.js";var Wt={},U={},re={},St={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});var Oe={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.CronField=void 0;class rs{#t=!1;#e=[];static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[,*\d/-]+$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,e=!1){if(!Array.isArray(t))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.#e=t.sort(rs.sorter),this.#t=e}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get isWildcard(){return this.#t}get values(){return this.#e}static sorter(t,e){const s=typeof t=="number",r=typeof e=="number";return s&&r?t-e:!s&&!r?t.localeCompare(e):s?-1:1}serialize(){return{wildcard:this.#t,values:this.#e}}validate(){let t;const e=this.chars.length>0?` or chars ${this.chars.join("")}`:"",s=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),r=l=>(t=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(s(l)));if(!this.#e.every(r))throw new Error(`${this.constructor.name} Validation error, got value ${t} expected range ${this.min}-${this.max}${e}`);const a=this.#e.find((l,u)=>this.#e.indexOf(l)!==u);if(a)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${a}`)}}ht.CronField=rs;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.CronDayOfMonth=void 0;const mr=ht,fr=1,gr=31,yr=Object.freeze(["L"]);class xr extends mr.CronField{static get min(){return fr}static get max(){return gr}static get chars(){return yr}static get validChars(){return/^[?,*\dL/-]+$/}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Oe.CronDayOfMonth=xr;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});Me.CronDayOfWeek=void 0;const vr=ht,wr=0,Sr=7,br=Object.freeze(["L"]);class Cr extends vr.CronField{static get min(){return wr}static get max(){return Sr}static get chars(){return br}static get validChars(){return/^[?,*\dL#/-]+$/}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Me.CronDayOfWeek=Cr;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.CronHour=void 0;const kr=ht,Tr=0,Dr=23,Or=Object.freeze([]);class Mr extends kr.CronField{static get min(){return Tr}static get max(){return Dr}static get chars(){return Or}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ie.CronHour=Mr;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.CronMinute=void 0;const Ir=ht,jr=0,Er=59,Nr=Object.freeze([]);class Fr extends Ir.CronField{static get min(){return jr}static get max(){return Er}static get chars(){return Nr}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}je.CronMinute=Fr;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.CronMonth=void 0;const Lr=ht,_r=1,Wr=12,$r=Object.freeze([]),Ar=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class Hr extends Lr.CronField{static get min(){return _r}static get max(){return Wr}static get chars(){return $r}static get daysInMonth(){return Ar}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ee.CronMonth=Hr;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.CronSecond=void 0;const Rr=ht,Vr=0,Pr=59,Br=Object.freeze([]);class Ur extends Rr.CronField{static get min(){return Vr}static get max(){return Pr}static get chars(){return Br}constructor(t,e=!1){super(t,e),this.validate()}get values(){return super.values}}Ne.CronSecond=Ur;(function(n){var t=St&&St.__createBinding||(Object.create?function(s,r,i,a){a===void 0&&(a=i);var l=Object.getOwnPropertyDescriptor(r,i);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(s,a,l)}:function(s,r,i,a){a===void 0&&(a=i),s[a]=r[i]}),e=St&&St.__exportStar||function(s,r){for(var i in s)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,s,i)};Object.defineProperty(n,"__esModule",{value:!0}),e(Zs,n),e(Oe,n),e(Me,n),e(ht,n),e(Ie,n),e(je,n),e(Ee,n),e(Ne,n)})(St);Object.defineProperty(re,"__esModule",{value:!0});re.CronFieldCollection=void 0;const st=St;class At{#t;#e;#n;#i;#r;#a;static from(t,e){return new At({second:this.resolveField(st.CronSecond,t.second,e.second),minute:this.resolveField(st.CronMinute,t.minute,e.minute),hour:this.resolveField(st.CronHour,t.hour,e.hour),dayOfMonth:this.resolveField(st.CronDayOfMonth,t.dayOfMonth,e.dayOfMonth),month:this.resolveField(st.CronMonth,t.month,e.month),dayOfWeek:this.resolveField(st.CronDayOfWeek,t.dayOfWeek,e.dayOfWeek)})}static resolveField(t,e,s){return s?s instanceof st.CronField?s:new t(s):e}constructor({second:t,minute:e,hour:s,dayOfMonth:r,month:i,dayOfWeek:a}){if(!t)throw new Error("Validation error, Field second is missing");if(!e)throw new Error("Validation error, Field minute is missing");if(!s)throw new Error("Validation error, Field hour is missing");if(!r)throw new Error("Validation error, Field dayOfMonth is missing");if(!i)throw new Error("Validation error, Field month is missing");if(!a)throw new Error("Validation error, Field dayOfWeek is missing");if(i.values.length===1&&!(parseInt(r.values[0],10)<=st.CronMonth.daysInMonth[i.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#t=t,this.#e=e,this.#n=s,this.#r=i,this.#a=a,this.#i=r}get second(){return this.#t}get minute(){return this.#e}get hour(){return this.#n}get dayOfMonth(){return this.#i}get month(){return this.#r}get dayOfWeek(){return this.#a}static compactField(t){if(t.length===0)return[];const e=[];let s;return t.forEach((r,i,a)=>{if(s===void 0){s={start:r,count:1};return}const l=a[i-1]||s.start,u=a[i+1];if(r==="L"||r==="W"){e.push(s),e.push({start:r,count:1}),s=void 0;return}if(s.step===void 0&&u!==void 0){const h=r-l,m=u-r;if(h<=m){s={...s,count:2,end:r,step:h};return}s.step=1}r-(s.end??0)===s.step?(s.count++,s.end=r):(s.count===1?e.push({start:s.start,count:1}):s.count===2?(e.push({start:s.start,count:1}),e.push({start:s.end??l,count:1})):e.push(s),s={start:r,count:1})}),s&&e.push(s),e}static#s(t,e,s){const r=t.step;return r?r===1&&t.start===e&&t.end&&t.end>=s?"*":r!==1&&t.start===e&&t.end&&t.end>=s-r+1?`*/${r}`:null:null}static#o(t,e){const s=t.step;if(s===1)return`${t.start}-${t.end}`;const r=t.start===0?t.count-1:t.count;if(!s)throw new Error("Unexpected range step");if(!t.end)throw new Error("Unexpected range end");if(s*r>t.end){const i=(l,u)=>{if(typeof t.start!="number")throw new Error("Unexpected range start");return u%s===0?t.start+u:null};if(typeof t.start!="number")throw new Error("Unexpected range start");const a={length:t.end-t.start+1};return Array.from(a,i).filter(l=>l!==null).join(",")}return t.end===e-s+1?`${t.start}/${s}`:`${t.start}-${t.end}/${s}`}stringifyField(t){let e=t.max,s=t.values;if(t instanceof st.CronDayOfWeek){e=6;const i=this.#a.values;s=i[i.length-1]===7?i.slice(0,-1):i}t instanceof st.CronDayOfMonth&&(e=this.#r.values.length===1?st.CronMonth.daysInMonth[this.#r.values[0]-1]:t.max);const r=At.compactField(s);if(r.length===1){const i=At.#s(r[0],t.min,e);if(i)return i}return r.map(i=>i.count===1?i.start.toString():At.#o(i,e)).join(",")}stringify(t=!1){const e=[];return t&&e.push(this.stringifyField(this.#t)),e.push(this.stringifyField(this.#e),this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#r),this.stringifyField(this.#a)),e.join(" ")}serialize(){return{second:this.#t.serialize(),minute:this.#e.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#i.serialize(),month:this.#r.serialize(),dayOfWeek:this.#a.serialize()}}}re.CronFieldCollection=At;var lt={},z={};Object.defineProperty(z,"__esModule",{value:!0});class jt extends Error{}class zr extends jt{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Gr extends jt{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Zr extends jt{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Ht extends jt{}class Ys extends jt{constructor(t){super(`Invalid unit ${t}`)}}class L extends jt{}class gt extends jt{constructor(){super("Zone is an abstract class")}}const g="numeric",ct="short",G="long",be={year:g,month:g,day:g},qs={year:g,month:ct,day:g},Yr={year:g,month:ct,day:g,weekday:ct},Xs={year:g,month:G,day:g},Js={year:g,month:G,day:g,weekday:G},Ks={hour:g,minute:g},Qs={hour:g,minute:g,second:g},tn={hour:g,minute:g,second:g,timeZoneName:ct},en={hour:g,minute:g,second:g,timeZoneName:G},sn={hour:g,minute:g,hourCycle:"h23"},nn={hour:g,minute:g,second:g,hourCycle:"h23"},rn={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:ct},on={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:G},an={year:g,month:g,day:g,hour:g,minute:g},ln={year:g,month:g,day:g,hour:g,minute:g,second:g},cn={year:g,month:ct,day:g,hour:g,minute:g},un={year:g,month:ct,day:g,hour:g,minute:g,second:g},qr={year:g,month:ct,day:g,weekday:ct,hour:g,minute:g},dn={year:g,month:G,day:g,hour:g,minute:g,timeZoneName:ct},hn={year:g,month:G,day:g,hour:g,minute:g,second:g,timeZoneName:ct},pn={year:g,month:G,day:g,weekday:G,hour:g,minute:g,timeZoneName:G},mn={year:g,month:G,day:g,weekday:G,hour:g,minute:g,second:g,timeZoneName:G};class Bt{get type(){throw new gt}get name(){throw new gt}get ianaName(){return this.name}get isUniversal(){throw new gt}offsetName(t,e){throw new gt}formatOffset(t,e){throw new gt}offset(t){throw new gt}equals(t){throw new gt}get isValid(){throw new gt}}let Ae=null;class ie extends Bt{static get instance(){return Ae===null&&(Ae=new ie),Ae}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return kn(t,e,s)}formatOffset(t,e){return ee(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let ye={};function Xr(n){return ye[n]||(ye[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ye[n]}const Jr={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kr(n,t){const e=n.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,r,i,a,l,u,h,m]=s;return[a,r,i,l,u,h,m]}function Qr(n,t){const e=n.formatToParts(t),s=[];for(let r=0;r<e.length;r++){const{type:i,value:a}=e[r],l=Jr[i];i==="era"?s[l]=a:S(l)||(s[l]=parseInt(a,10))}return s}let ce={};class ut extends Bt{static create(t){return ce[t]||(ce[t]=new ut(t)),ce[t]}static resetCache(){ce={},ye={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ut.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return kn(t,e,s,this.name)}formatOffset(t,e){return ee(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const s=Xr(this.name);let[r,i,a,l,u,h,m]=s.formatToParts?Qr(s,e):Kr(s,e);l==="BC"&&(r=-Math.abs(r)+1);const f=Le({year:r,month:i,day:a,hour:u===24?0:u,minute:h,second:m,millisecond:0});let p=+e;const x=p%1e3;return p-=x>=0?x:1e3+x,(f-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let fs={};function ti(n,t={}){const e=JSON.stringify([n,t]);let s=fs[e];return s||(s=new Intl.ListFormat(n,t),fs[e]=s),s}let qe={};function Xe(n,t={}){const e=JSON.stringify([n,t]);let s=qe[e];return s||(s=new Intl.DateTimeFormat(n,t),qe[e]=s),s}let Je={};function ei(n,t={}){const e=JSON.stringify([n,t]);let s=Je[e];return s||(s=new Intl.NumberFormat(n,t),Je[e]=s),s}let Ke={};function si(n,t={}){const{base:e,...s}=t,r=JSON.stringify([n,s]);let i=Ke[r];return i||(i=new Intl.RelativeTimeFormat(n,t),Ke[r]=i),i}let Kt=null;function ni(){return Kt||(Kt=new Intl.DateTimeFormat().resolvedOptions().locale,Kt)}let gs={};function ri(n){let t=gs[n];if(!t){const e=new Intl.Locale(n);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,gs[n]=t}return t}function ii(n){const t=n.indexOf("-x-");t!==-1&&(n=n.substring(0,t));const e=n.indexOf("-u-");if(e===-1)return[n];{let s,r;try{s=Xe(n).resolvedOptions(),r=n}catch{const u=n.substring(0,e);s=Xe(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=s;return[r,i,a]}}function oi(n,t,e){return(e||t)&&(n.includes("-u-")||(n+="-u"),e&&(n+=`-ca-${e}`),t&&(n+=`-nu-${t}`)),n}function ai(n){const t=[];for(let e=1;e<=12;e++){const s=w.utc(2009,e,1);t.push(n(s))}return t}function li(n){const t=[];for(let e=1;e<=7;e++){const s=w.utc(2016,11,13+e);t.push(n(s))}return t}function ue(n,t,e,s){const r=n.listingMode();return r==="error"?null:r==="en"?e(t):s(t)}function ci(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class ui{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...a}=s;if(!e||Object.keys(a).length>0){const l={useGrouping:!1,...s};s.padTo>0&&(l.minimumIntegerDigits=s.padTo),this.inf=ei(t,l)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{const e=this.floor?Math.floor(t):cs(t,3);return I(e,this.padTo)}}}class di{constructor(t,e,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const a=-1*(t.offset/60),l=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;t.offset!==0&&ut.create(l).valid?(r=l,this.dt=t):(r="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,r=t.zone.name):(r="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Xe(e,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:s}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class hi{constructor(t,e,s){this.opts={style:"long",...s},!e&&bn()&&(this.rtf=si(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):Li(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const pi={firstDay:1,minimalDays:4,weekend:[6,7]};class T{static fromOpts(t){return T.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,s,r,i=!1){const a=t||M.defaultLocale,l=a||(i?"en-US":ni()),u=e||M.defaultNumberingSystem,h=s||M.defaultOutputCalendar,m=Qe(r)||M.defaultWeekSettings;return new T(l,u,h,m,a)}static resetCache(){Kt=null,qe={},Je={},Ke={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s,weekSettings:r}={}){return T.create(t,e,s,r)}constructor(t,e,s,r,i){const[a,l,u]=ii(t);this.locale=a,this.numberingSystem=e||l||null,this.outputCalendar=s||u||null,this.weekSettings=r,this.intl=oi(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ci(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:T.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Qe(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return ue(this,t,On,()=>{const s=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return this.monthsCache[r][t]||(this.monthsCache[r][t]=ai(i=>this.extract(i,s,"month"))),this.monthsCache[r][t]})}weekdays(t,e=!1){return ue(this,t,jn,()=>{const s=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=li(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][t]})}meridiems(){return ue(this,void 0,()=>En,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[w.utc(2016,11,13,9),w.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ue(this,t,Nn,()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[w.utc(-40,1,1),w.utc(2017,1,1)].map(s=>this.extract(s,e,"era"))),this.eraCache[t]})}extract(t,e,s){const r=this.dtFormatter(t,e),i=r.formatToParts(),a=i.find(l=>l.type.toLowerCase()===s);return a?a.value:null}numberFormatter(t={}){return new ui(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new di(t,this.intl,e)}relFormatter(t={}){return new hi(this.intl,this.isEnglish(),t)}listFormatter(t={}){return ti(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Cn()?ri(this.locale):pi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let He=null;class $ extends Bt{static get utcInstance(){return He===null&&(He=new $(0)),He}static instance(t){return t===0?$.utcInstance:new $(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new $(_e(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ee(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ee(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ee(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class fn extends Bt{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function bt(n,t){if(S(n)||n===null)return t;if(n instanceof Bt)return n;if(vi(n)){const e=n.toLowerCase();return e==="default"?t:e==="local"||e==="system"?ie.instance:e==="utc"||e==="gmt"?$.utcInstance:$.parseSpecifier(e)||ut.create(n)}else return Ct(n)?$.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new fn(n)}const is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ys={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},mi=is.hanidec.replace(/[\[|\]]/g,"").split("");function fi(n){let t=parseInt(n,10);if(isNaN(t)){t="";for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);if(n[e].search(is.hanidec)!==-1)t+=mi.indexOf(n[e]);else for(const r in ys){const[i,a]=ys[r];s>=i&&s<=a&&(t+=s-i)}}return parseInt(t,10)}else return t}let $t={};function gi(){$t={}}function nt({numberingSystem:n},t=""){const e=n||"latn";return $t[e]||($t[e]={}),$t[e][t]||($t[e][t]=new RegExp(`${is[e]}${t}`)),$t[e][t]}let xs=()=>Date.now(),vs="system",ws=null,Ss=null,bs=null,Cs=60,ks,Ts=null;class M{static get now(){return xs}static set now(t){xs=t}static set defaultZone(t){vs=t}static get defaultZone(){return bt(vs,ie.instance)}static get defaultLocale(){return ws}static set defaultLocale(t){ws=t}static get defaultNumberingSystem(){return Ss}static set defaultNumberingSystem(t){Ss=t}static get defaultOutputCalendar(){return bs}static set defaultOutputCalendar(t){bs=t}static get defaultWeekSettings(){return Ts}static set defaultWeekSettings(t){Ts=Qe(t)}static get twoDigitCutoffYear(){return Cs}static set twoDigitCutoffYear(t){Cs=t%100}static get throwOnInvalid(){return ks}static set throwOnInvalid(t){ks=t}static resetCaches(){T.resetCache(),ut.resetCache(),w.resetCache(),gi()}}class ot{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const gn=[0,31,59,90,120,151,181,212,243,273,304,334],yn=[0,31,60,91,121,152,182,213,244,274,305,335];function X(n,t){return new ot("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${n}, which is invalid`)}function os(n,t,e){const s=new Date(Date.UTC(n,t-1,e));n<100&&n>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function xn(n,t,e){return e+(oe(n)?yn:gn)[t-1]}function vn(n,t){const e=oe(n)?yn:gn,s=e.findIndex(i=>i<t),r=t-e[s];return{month:s+1,day:r}}function as(n,t){return(n-t+7)%7+1}function Ce(n,t=4,e=1){const{year:s,month:r,day:i}=n,a=xn(s,r,i),l=as(os(s,r,i),e);let u=Math.floor((a-l+14-t)/7),h;return u<1?(h=s-1,u=ne(h,t,e)):u>ne(s,t,e)?(h=s+1,u=1):h=s,{weekYear:h,weekNumber:u,weekday:l,...We(n)}}function Ds(n,t=4,e=1){const{weekYear:s,weekNumber:r,weekday:i}=n,a=as(os(s,1,t),e),l=Rt(s);let u=r*7+i-a-7+t,h;u<1?(h=s-1,u+=Rt(h)):u>l?(h=s+1,u-=Rt(s)):h=s;const{month:m,day:c}=vn(h,u);return{year:h,month:m,day:c,...We(n)}}function Re(n){const{year:t,month:e,day:s}=n,r=xn(t,e,s);return{year:t,ordinal:r,...We(n)}}function Os(n){const{year:t,ordinal:e}=n,{month:s,day:r}=vn(t,e);return{year:t,month:s,day:r,...We(n)}}function Ms(n,t){if(!S(n.localWeekday)||!S(n.localWeekNumber)||!S(n.localWeekYear)){if(!S(n.weekday)||!S(n.weekNumber)||!S(n.weekYear))throw new Ht("Cannot mix locale-based week fields with ISO-based week fields");return S(n.localWeekday)||(n.weekday=n.localWeekday),S(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),S(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function yi(n,t=4,e=1){const s=Fe(n.weekYear),r=J(n.weekNumber,1,ne(n.weekYear,t,e)),i=J(n.weekday,1,7);return s?r?i?!1:X("weekday",n.weekday):X("week",n.weekNumber):X("weekYear",n.weekYear)}function xi(n){const t=Fe(n.year),e=J(n.ordinal,1,Rt(n.year));return t?e?!1:X("ordinal",n.ordinal):X("year",n.year)}function wn(n){const t=Fe(n.year),e=J(n.month,1,12),s=J(n.day,1,ke(n.year,n.month));return t?e?s?!1:X("day",n.day):X("month",n.month):X("year",n.year)}function Sn(n){const{hour:t,minute:e,second:s,millisecond:r}=n,i=J(t,0,23)||t===24&&e===0&&s===0&&r===0,a=J(e,0,59),l=J(s,0,59),u=J(r,0,999);return i?a?l?u?!1:X("millisecond",r):X("second",s):X("minute",e):X("hour",t)}function S(n){return typeof n>"u"}function Ct(n){return typeof n=="number"}function Fe(n){return typeof n=="number"&&n%1===0}function vi(n){return typeof n=="string"}function wi(n){return Object.prototype.toString.call(n)==="[object Date]"}function bn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Si(n){return Array.isArray(n)?n:[n]}function Is(n,t,e){if(n.length!==0)return n.reduce((s,r)=>{const i=[t(r),r];return s&&e(s[0],i[0])===s[0]?s:i},null)[1]}function bi(n,t){return t.reduce((e,s)=>(e[s]=n[s],e),{})}function Pt(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Qe(n){if(n==null)return null;if(typeof n!="object")throw new L("Week settings must be an object");if(!J(n.firstDay,1,7)||!J(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(t=>!J(t,1,7)))throw new L("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function J(n,t,e){return Fe(n)&&n>=t&&n<=e}function Ci(n,t){return n-t*Math.floor(n/t)}function I(n,t=2){const e=n<0;let s;return e?s="-"+(""+-n).padStart(t,"0"):s=(""+n).padStart(t,"0"),s}function xt(n){if(!(S(n)||n===null||n===""))return parseInt(n,10)}function Tt(n){if(!(S(n)||n===null||n===""))return parseFloat(n)}function ls(n){if(!(S(n)||n===null||n==="")){const t=parseFloat("0."+n)*1e3;return Math.floor(t)}}function cs(n,t,e=!1){const s=10**t;return(e?Math.trunc:Math.round)(n*s)/s}function oe(n){return n%4===0&&(n%100!==0||n%400===0)}function Rt(n){return oe(n)?366:365}function ke(n,t){const e=Ci(t-1,12)+1,s=n+(t-e)/12;return e===2?oe(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Le(n){let t=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(t=new Date(t),t.setUTCFullYear(n.year,n.month-1,n.day)),+t}function js(n,t,e){return-as(os(n,1,t),e)+t-1}function ne(n,t=4,e=1){const s=js(n,t,e),r=js(n+1,t,e);return(Rt(n)-s+r)/7}function ts(n){return n>99?n:n>M.twoDigitCutoffYear?1900+n:2e3+n}function kn(n,t,e,s=null){const r=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const a={timeZoneName:t,...i},l=new Intl.DateTimeFormat(e,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return l?l.value:null}function _e(n,t){let e=parseInt(n,10);Number.isNaN(e)&&(e=0);const s=parseInt(t,10)||0,r=e<0||Object.is(e,-0)?-s:s;return e*60+r}function Tn(n){const t=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(t))throw new L(`Invalid unit value ${n}`);return t}function Te(n,t){const e={};for(const s in n)if(Pt(n,s)){const r=n[s];if(r==null)continue;e[t(s)]=Tn(r)}return e}function ee(n,t){const e=Math.trunc(Math.abs(n/60)),s=Math.trunc(Math.abs(n%60)),r=n>=0?"+":"-";switch(t){case"short":return`${r}${I(e,2)}:${I(s,2)}`;case"narrow":return`${r}${e}${s>0?`:${s}`:""}`;case"techie":return`${r}${I(e,2)}${I(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function We(n){return bi(n,["hour","minute","second","millisecond"])}const ki=["January","February","March","April","May","June","July","August","September","October","November","December"],Dn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ti=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(n){switch(n){case"narrow":return[...Ti];case"short":return[...Dn];case"long":return[...ki];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Mn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],In=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Di=["M","T","W","T","F","S","S"];function jn(n){switch(n){case"narrow":return[...Di];case"short":return[...In];case"long":return[...Mn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const En=["AM","PM"],Oi=["Before Christ","Anno Domini"],Mi=["BC","AD"],Ii=["B","A"];function Nn(n){switch(n){case"narrow":return[...Ii];case"short":return[...Mi];case"long":return[...Oi];default:return null}}function ji(n){return En[n.hour<12?0:1]}function Ei(n,t){return jn(t)[n.weekday-1]}function Ni(n,t){return On(t)[n.month-1]}function Fi(n,t){return Nn(t)[n.year<0?0:1]}function Li(n,t,e="always",s=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(e==="auto"&&i){const c=n==="days";switch(t){case 1:return c?"tomorrow":`next ${r[n][0]}`;case-1:return c?"yesterday":`last ${r[n][0]}`;case 0:return c?"today":`this ${r[n][0]}`}}const a=Object.is(t,-0)||t<0,l=Math.abs(t),u=l===1,h=r[n],m=s?u?h[1]:h[2]||h[1]:u?r[n][0]:n;return a?`${l} ${m} ago`:`in ${l} ${m}`}function Es(n,t){let e="";for(const s of n)s.literal?e+=s.val:e+=t(s.val);return e}const _i={D:be,DD:qs,DDD:Xs,DDDD:Js,t:Ks,tt:Qs,ttt:tn,tttt:en,T:sn,TT:nn,TTT:rn,TTTT:on,f:an,ff:cn,fff:dn,ffff:pn,F:ln,FF:un,FFF:hn,FFFF:mn};class W{static create(t,e={}){return new W(t,e)}static parseFormat(t){let e=null,s="",r=!1;const i=[];for(let a=0;a<t.length;a++){const l=t.charAt(a);l==="'"?(s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),e=null,s="",r=!r):r||l===e?s+=l:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=l,e=l)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return _i[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return I(t,e);const s={...this.opts};return e>0&&(s.padTo=e),this.loc.numberFormatter(s).format(t)}formatDateTimeFromString(t,e){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(p,x)=>this.loc.extract(t,p,x),a=p=>t.isOffsetFixed&&t.offset===0&&p.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,p.format):"",l=()=>s?ji(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(p,x)=>s?Ni(t,p):i(x?{month:p}:{month:p,day:"numeric"},"month"),h=(p,x)=>s?Ei(t,p):i(x?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),m=p=>{const x=W.macroTokenToFormatOpts(p);return x?this.formatWithSystemDefault(t,x):p},c=p=>s?Fi(t,p):i({era:p},"era"),f=p=>{switch(p){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return r?i({day:"numeric"},"day"):this.num(t.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(t.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(t.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return m(p)}};return Es(W.parseFormat(e),f)}formatDurationFromString(t,e){const s=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=u=>h=>{const m=s(h);return m?this.num(u.get(m),h.length):h},i=W.parseFormat(e),a=i.reduce((u,{literal:h,val:m})=>h?u:u.concat(m),[]),l=t.shiftTo(...a.map(s).filter(u=>u));return Es(i,r(l))}}const Fn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ut(...n){const t=n.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function zt(...n){return t=>n.reduce(([e,s,r],i)=>{const[a,l,u]=i(t,r);return[{...e,...a},l||s,u]},[{},null,1]).slice(0,2)}function Gt(n,...t){if(n==null)return[null,null];for(const[e,s]of t){const r=e.exec(n);if(r)return s(r)}return[null,null]}function Ln(...n){return(t,e)=>{const s={};let r;for(r=0;r<n.length;r++)s[n[r]]=xt(t[e+r]);return[s,null,e+r]}}const _n=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Wi=`(?:${_n.source}?(?:\\[(${Fn.source})\\])?)?`,us=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wn=RegExp(`${us.source}${Wi}`),ds=RegExp(`(?:T${Wn.source})?`),$i=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ai=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Hi=/(\d{4})-?(\d{3})/,Ri=Ln("weekYear","weekNumber","weekDay"),Vi=Ln("year","ordinal"),Pi=/(\d{4})-(\d\d)-(\d\d)/,$n=RegExp(`${us.source} ?(?:${_n.source}|(${Fn.source}))?`),Bi=RegExp(`(?: ${$n.source})?`);function Vt(n,t,e){const s=n[t];return S(s)?e:xt(s)}function Ui(n,t){return[{year:Vt(n,t),month:Vt(n,t+1,1),day:Vt(n,t+2,1)},null,t+3]}function Zt(n,t){return[{hours:Vt(n,t,0),minutes:Vt(n,t+1,0),seconds:Vt(n,t+2,0),milliseconds:ls(n[t+3])},null,t+4]}function ae(n,t){const e=!n[t]&&!n[t+1],s=_e(n[t+1],n[t+2]),r=e?null:$.instance(s);return[{},r,t+3]}function le(n,t){const e=n[t]?ut.create(n[t]):null;return[{},e,t+1]}const zi=RegExp(`^T?${us.source}$`),Gi=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Zi(n){const[t,e,s,r,i,a,l,u,h]=n,m=t[0]==="-",c=u&&u[0]==="-",f=(p,x=!1)=>p!==void 0&&(x||p&&m)?-p:p;return[{years:f(Tt(e)),months:f(Tt(s)),weeks:f(Tt(r)),days:f(Tt(i)),hours:f(Tt(a)),minutes:f(Tt(l)),seconds:f(Tt(u),u==="-0"),milliseconds:f(ls(h),c)}]}const Yi={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hs(n,t,e,s,r,i,a){const l={year:t.length===2?ts(xt(t)):xt(t),month:Dn.indexOf(e)+1,day:xt(s),hour:xt(r),minute:xt(i)};return a&&(l.second=xt(a)),n&&(l.weekday=n.length>3?Mn.indexOf(n)+1:In.indexOf(n)+1),l}const qi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Xi(n){const[,t,e,s,r,i,a,l,u,h,m,c]=n,f=hs(t,r,s,e,i,a,l);let p;return u?p=Yi[u]:h?p=0:p=_e(m,c),[f,new $(p)]}function Ji(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ki=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Qi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,to=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ns(n){const[,t,e,s,r,i,a,l]=n;return[hs(t,r,s,e,i,a,l),$.utcInstance]}function eo(n){const[,t,e,s,r,i,a,l]=n;return[hs(t,l,e,s,r,i,a),$.utcInstance]}const so=Ut($i,ds),no=Ut(Ai,ds),ro=Ut(Hi,ds),io=Ut(Wn),An=zt(Ui,Zt,ae,le),oo=zt(Ri,Zt,ae,le),ao=zt(Vi,Zt,ae,le),lo=zt(Zt,ae,le);function co(n){return Gt(n,[so,An],[no,oo],[ro,ao],[io,lo])}function uo(n){return Gt(Ji(n),[qi,Xi])}function ho(n){return Gt(n,[Ki,Ns],[Qi,Ns],[to,eo])}function po(n){return Gt(n,[Gi,Zi])}const mo=zt(Zt);function fo(n){return Gt(n,[zi,mo])}const go=Ut(Pi,Bi),yo=Ut($n),xo=zt(Zt,ae,le);function vo(n){return Gt(n,[go,An],[yo,xo])}const Fs="Invalid Duration",Hn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},wo={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Hn},Z=146097/400,Nt=146097/4800,So={years:{quarters:4,months:12,weeks:Z/7,days:Z,hours:Z*24,minutes:Z*24*60,seconds:Z*24*60*60,milliseconds:Z*24*60*60*1e3},quarters:{months:3,weeks:Z/28,days:Z/4,hours:Z*24/4,minutes:Z*24*60/4,seconds:Z*24*60*60/4,milliseconds:Z*24*60*60*1e3/4},months:{weeks:Nt/7,days:Nt,hours:Nt*24,minutes:Nt*24*60,seconds:Nt*24*60*60,milliseconds:Nt*24*60*60*1e3},...Hn},Mt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bo=Mt.slice(0).reverse();function yt(n,t,e=!1){const s={values:e?t.values:{...n.values,...t.values||{}},loc:n.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||n.conversionAccuracy,matrix:t.matrix||n.matrix};return new C(s)}function Rn(n,t){var e;let s=(e=t.milliseconds)!=null?e:0;for(const r of bo.slice(1))t[r]&&(s+=t[r]*n[r].milliseconds);return s}function Ls(n,t){const e=Rn(n,t)<0?-1:1;Mt.reduceRight((s,r)=>{if(S(t[r]))return s;if(s){const i=t[s]*e,a=n[r][s],l=Math.floor(i/a);t[r]+=l*e,t[s]-=l*a*e}return r},null),Mt.reduce((s,r)=>{if(S(t[r]))return s;if(s){const i=t[s]%1;t[s]-=i,t[r]+=i*n[s][r]}return r},null)}function Co(n){const t={};for(const[e,s]of Object.entries(n))s!==0&&(t[e]=s);return t}class C{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let s=e?So:wo;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||T.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return C.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new L(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new C({values:Te(t,C.normalizeUnit),loc:T.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Ct(t))return C.fromMillis(t);if(C.isDuration(t))return t;if(typeof t=="object")return C.fromObject(t);throw new L(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=po(t);return s?C.fromObject(s,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[s]=fo(t);return s?C.fromObject(s,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Duration is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new Zr(s);return new C({invalid:s})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new Ys(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const s={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?W.create(this.loc,s).formatDurationFromString(this,t):Fs}toHuman(t={}){if(!this.isValid)return Fs;const e=Mt.map(s=>{const r=this.values[s];return S(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:s.slice(0,-1)}).format(r)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=cs(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},w.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Rn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t),s={};for(const r of Mt)(Pt(e.values,r)||Pt(this.values,r))&&(s[r]=e.get(r)+this.get(r));return yt(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const s of Object.keys(this.values))e[s]=Tn(t(this.values[s],s));return yt(this,{values:e},!0)}get(t){return this[C.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...Te(t,C.normalizeUnit)};return yt(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:r}={}){const a={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:r,conversionAccuracy:s};return yt(this,a)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Ls(this.matrix,t),yt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Co(this.normalize().shiftToAll().toObject());return yt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(a=>C.normalizeUnit(a));const e={},s={},r=this.toObject();let i;for(const a of Mt)if(t.indexOf(a)>=0){i=a;let l=0;for(const h in s)l+=this.matrix[h][a]*s[h],s[h]=0;Ct(r[a])&&(l+=r[a]);const u=Math.trunc(l);e[a]=u,s[a]=(l*1e3-u*1e3)/1e3}else Ct(r[a])&&(s[a]=r[a]);for(const a in s)s[a]!==0&&(e[i]+=a===i?s[a]:s[a]/this.matrix[i][a]);return Ls(this.matrix,e),yt(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return yt(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of Mt)if(!e(this.values[s],t.values[s]))return!1;return!0}}const Ft="Invalid Interval";function ko(n,t){return!n||!n.isValid?O.invalid("missing or invalid start"):!t||!t.isValid?O.invalid("missing or invalid end"):t<n?O.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${t.toISO()}`):null}class O{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Interval is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new Gr(s);return new O({invalid:s})}static fromDateTimes(t,e){const s=Xt(t),r=Xt(e),i=ko(s,r);return i??new O({start:s,end:r})}static after(t,e){const s=C.fromDurationLike(e),r=Xt(t);return O.fromDateTimes(r,r.plus(s))}static before(t,e){const s=C.fromDurationLike(e),r=Xt(t);return O.fromDateTimes(r.minus(s),r)}static fromISO(t,e){const[s,r]=(t||"").split("/",2);if(s&&r){let i,a;try{i=w.fromISO(s,e),a=i.isValid}catch{a=!1}let l,u;try{l=w.fromISO(r,e),u=l.isValid}catch{u=!1}if(a&&u)return O.fromDateTimes(i,l);if(a){const h=C.fromISO(r,e);if(h.isValid)return O.after(i,h)}else if(u){const h=C.fromISO(s,e);if(h.isValid)return O.before(l,h)}}return O.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;const s=this.start.startOf(t,e);let r;return e!=null&&e.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(t,e),Math.floor(r.diff(s,t).get(t))+(r.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?O.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Xt).filter(a=>this.contains(a)).sort((a,l)=>a.toMillis()-l.toMillis()),s=[];let{s:r}=this,i=0;for(;r<this.e;){const a=e[i]||this.e,l=+a>+this.e?this.e:a;s.push(O.fromDateTimes(r,l)),r=l,i+=1}return s}splitBy(t){const e=C.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s}=this,r=1,i;const a=[];for(;s<this.e;){const l=this.start.plus(e.mapUnits(u=>u*r));i=+l>+this.e?this.e:l,a.push(O.fromDateTimes(s,i)),s=i,r+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return e>=s?null:O.fromDateTimes(e,s)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return O.fromDateTimes(e,s)}static merge(t){const[e,s]=t.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return s&&e.push(s),e}static xor(t){let e=null,s=0;const r=[],i=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),l=a.sort((u,h)=>u.time-h.time);for(const u of l)s+=u.type==="s"?1:-1,s===1?e=u.time:(e&&+e!=+u.time&&r.push(O.fromDateTimes(e,u.time)),e=null);return O.merge(r)}difference(...t){return O.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ft}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=be,e={}){return this.isValid?W.create(this.s.loc.clone(e),t).formatInterval(this):Ft}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ft}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ft}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ft}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:Ft}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):C.invalid(this.invalidReason)}mapEndpoints(t){return O.fromDateTimes(t(this.s),t(this.e))}}class Qt{static hasDST(t=M.defaultZone){const e=w.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return ut.isValidZone(t)}static normalizeZone(t){return bt(t,M.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||T.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(e,s,i)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(e,s,i)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||T.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||T.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return T.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return T.create(e,null,"gregory").eras(t)}static features(){return{relative:bn(),localeWeek:Cn()}}}function _s(n,t){const e=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(n);return Math.floor(C.fromMillis(s).as("days"))}function To(n,t,e){const s=[["years",(u,h)=>h.year-u.year],["quarters",(u,h)=>h.quarter-u.quarter+(h.year-u.year)*4],["months",(u,h)=>h.month-u.month+(h.year-u.year)*12],["weeks",(u,h)=>{const m=_s(u,h);return(m-m%7)/7}],["days",_s]],r={},i=n;let a,l;for(const[u,h]of s)e.indexOf(u)>=0&&(a=u,r[u]=h(n,t),l=i.plus(r),l>t?(r[u]--,n=i.plus(r),n>t&&(l=n,r[u]--,n=i.plus(r))):n=l);return[n,r,l,a]}function Do(n,t,e,s){let[r,i,a,l]=To(n,t,e);const u=t-r,h=e.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);h.length===0&&(a<t&&(a=r.plus({[l]:1})),a!==r&&(i[l]=(i[l]||0)+u/(a-r)));const m=C.fromObject(i,s);return h.length>0?C.fromMillis(u,s).shiftTo(...h).plus(m):m}const Oo="missing Intl.DateTimeFormat.formatToParts support";function k(n,t=e=>e){return{regex:n,deser:([e])=>t(fi(e))}}const Mo=" ",Vn=`[ ${Mo}]`,Pn=new RegExp(Vn,"g");function Io(n){return n.replace(/\./g,"\\.?").replace(Pn,Vn)}function Ws(n){return n.replace(/\./g,"").replace(Pn," ").toLowerCase()}function rt(n,t){return n===null?null:{regex:RegExp(n.map(Io).join("|")),deser:([e])=>n.findIndex(s=>Ws(e)===Ws(s))+t}}function $s(n,t){return{regex:n,deser:([,e,s])=>_e(e,s),groups:t}}function de(n){return{regex:n,deser:([t])=>t}}function jo(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Eo(n,t){const e=nt(t),s=nt(t,"{2}"),r=nt(t,"{3}"),i=nt(t,"{4}"),a=nt(t,"{6}"),l=nt(t,"{1,2}"),u=nt(t,"{1,3}"),h=nt(t,"{1,6}"),m=nt(t,"{1,9}"),c=nt(t,"{2,4}"),f=nt(t,"{4,6}"),p=D=>({regex:RegExp(jo(D.val)),deser:([E])=>E,literal:!0}),A=(D=>{if(n.literal)return p(D);switch(D.val){case"G":return rt(t.eras("short"),0);case"GG":return rt(t.eras("long"),0);case"y":return k(h);case"yy":return k(c,ts);case"yyyy":return k(i);case"yyyyy":return k(f);case"yyyyyy":return k(a);case"M":return k(l);case"MM":return k(s);case"MMM":return rt(t.months("short",!0),1);case"MMMM":return rt(t.months("long",!0),1);case"L":return k(l);case"LL":return k(s);case"LLL":return rt(t.months("short",!1),1);case"LLLL":return rt(t.months("long",!1),1);case"d":return k(l);case"dd":return k(s);case"o":return k(u);case"ooo":return k(r);case"HH":return k(s);case"H":return k(l);case"hh":return k(s);case"h":return k(l);case"mm":return k(s);case"m":return k(l);case"q":return k(l);case"qq":return k(s);case"s":return k(l);case"ss":return k(s);case"S":return k(u);case"SSS":return k(r);case"u":return de(m);case"uu":return de(l);case"uuu":return k(e);case"a":return rt(t.meridiems(),0);case"kkkk":return k(i);case"kk":return k(c,ts);case"W":return k(l);case"WW":return k(s);case"E":case"c":return k(e);case"EEE":return rt(t.weekdays("short",!1),1);case"EEEE":return rt(t.weekdays("long",!1),1);case"ccc":return rt(t.weekdays("short",!0),1);case"cccc":return rt(t.weekdays("long",!0),1);case"Z":case"ZZ":return $s(new RegExp(`([+-]${l.source})(?::(${s.source}))?`),2);case"ZZZ":return $s(new RegExp(`([+-]${l.source})(${s.source})?`),2);case"z":return de(/[a-z_+-/]{1,256}?/i);case" ":return de(/[^\S\n\r]/);default:return p(D)}})(n)||{invalidReason:Oo};return A.token=n,A}const No={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Fo(n,t,e){const{type:s,value:r}=n;if(s==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=t[s];let a=s;s==="hour"&&(t.hour12!=null?a=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?a="hour12":a="hour24":a=e.hour12?"hour12":"hour24");let l=No[a];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function Lo(n){return[`^${n.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,n]}function _o(n,t,e){const s=n.match(t);if(s){const r={};let i=1;for(const a in e)if(Pt(e,a)){const l=e[a],u=l.groups?l.groups+1:1;!l.literal&&l.token&&(r[l.token.val[0]]=l.deser(s.slice(i,i+u))),i+=u}return[s,r]}else return[s,{}]}function Wo(n){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let e=null,s;return S(n.z)||(e=ut.create(n.z)),S(n.Z)||(e||(e=new $(n.Z)),s=n.Z),S(n.q)||(n.M=(n.q-1)*3+1),S(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),S(n.u)||(n.S=ls(n.u)),[Object.keys(n).reduce((i,a)=>{const l=t(a);return l&&(i[l]=n[a]),i},{}),e,s]}let Ve=null;function $o(){return Ve||(Ve=w.fromMillis(1555555555555)),Ve}function Ao(n,t){if(n.literal)return n;const e=W.macroTokenToFormatOpts(n.val),s=Gn(e,t);return s==null||s.includes(void 0)?n:s}function Bn(n,t){return Array.prototype.concat(...n.map(e=>Ao(e,t)))}class Un{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Bn(W.parseFormat(e),t),this.units=this.tokens.map(s=>Eo(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=Lo(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(t){if(this.isValid){const[e,s]=_o(t,this.regex,this.handlers),[r,i,a]=s?Wo(s):[null,null,void 0];if(Pt(s,"a")&&Pt(s,"H"))throw new Ht("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:s,result:r,zone:i,specificOffset:a}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function zn(n,t,e){return new Un(n,e).explainFromTokens(t)}function Ho(n,t,e){const{result:s,zone:r,specificOffset:i,invalidReason:a}=zn(n,t,e);return[s,r,i,a]}function Gn(n,t){if(!n)return null;const s=W.create(t,n).dtFormatter($o()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(a=>Fo(a,n,i))}const Pe="Invalid DateTime",Ro=864e13;function te(n){return new ot("unsupported zone",`the zone "${n.name}" is not supported`)}function Be(n){return n.weekData===null&&(n.weekData=Ce(n.c)),n.weekData}function Ue(n){return n.localWeekData===null&&(n.localWeekData=Ce(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Dt(n,t){const e={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new w({...e,...t,old:e})}function Zn(n,t,e){let s=n-t*60*1e3;const r=e.offset(s);if(t===r)return[s,t];s-=(r-t)*60*1e3;const i=e.offset(s);return r===i?[s,r]:[n-Math.min(r,i)*60*1e3,Math.max(r,i)]}function he(n,t){n+=t*60*1e3;const e=new Date(n);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function xe(n,t,e){return Zn(Le(n),t,e)}function As(n,t){const e=n.o,s=n.c.year+Math.trunc(t.years),r=n.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...n.c,year:s,month:r,day:Math.min(n.c.day,ke(s,r))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},a=C.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Le(i);let[u,h]=Zn(l,e,n.zone);return a!==0&&(u+=a,h=n.zone.offset(u)),{ts:u,o:h}}function Lt(n,t,e,s,r,i){const{setZone:a,zone:l}=e;if(n&&Object.keys(n).length!==0||t){const u=t||l,h=w.fromObject(n,{...e,zone:u,specificOffset:i});return a?h:h.setZone(l)}else return w.invalid(new ot("unparsable",`the input "${r}" can't be parsed as ${s}`))}function pe(n,t,e=!0){return n.isValid?W.create(T.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(n,t):null}function ze(n,t){const e=n.c.year>9999||n.c.year<0;let s="";return e&&n.c.year>=0&&(s+="+"),s+=I(n.c.year,e?6:4),t?(s+="-",s+=I(n.c.month),s+="-",s+=I(n.c.day)):(s+=I(n.c.month),s+=I(n.c.day)),s}function Hs(n,t,e,s,r,i){let a=I(n.c.hour);return t?(a+=":",a+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!e)&&(a+=":")):a+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!e)&&(a+=I(n.c.second),(n.c.millisecond!==0||!s)&&(a+=".",a+=I(n.c.millisecond,3))),r&&(n.isOffsetFixed&&n.offset===0&&!i?a+="Z":n.o<0?(a+="-",a+=I(Math.trunc(-n.o/60)),a+=":",a+=I(Math.trunc(-n.o%60))):(a+="+",a+=I(Math.trunc(n.o/60)),a+=":",a+=I(Math.trunc(n.o%60)))),i&&(a+="["+n.zone.ianaName+"]"),a}const Yn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Vo={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Po={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qn=["year","month","day","hour","minute","second","millisecond"],Bo=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Uo=["year","ordinal","hour","minute","second","millisecond"];function zo(n){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!t)throw new Ys(n);return t}function Rs(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zo(n)}}function Go(n){return we[n]||(ve===void 0&&(ve=M.now()),we[n]=n.offset(ve)),we[n]}function Vs(n,t){const e=bt(t.zone,M.defaultZone);if(!e.isValid)return w.invalid(te(e));const s=T.fromObject(t);let r,i;if(S(n.year))r=M.now();else{for(const u of qn)S(n[u])&&(n[u]=Yn[u]);const a=wn(n)||Sn(n);if(a)return w.invalid(a);const l=Go(e);[r,i]=xe(n,l,e)}return new w({ts:r,zone:e,loc:s,o:i})}function Ps(n,t,e){const s=S(e.round)?!0:e.round,r=(a,l)=>(a=cs(a,s||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(a,l)),i=a=>e.calendary?t.hasSame(n,a)?0:t.startOf(a).diff(n.startOf(a),a).get(a):t.diff(n,a).get(a);if(e.unit)return r(i(e.unit),e.unit);for(const a of e.units){const l=i(a);if(Math.abs(l)>=1)return r(l,a)}return r(n>t?-0:0,e.units[e.units.length-1])}function Bs(n){let t={},e;return n.length>0&&typeof n[n.length-1]=="object"?(t=n[n.length-1],e=Array.from(n).slice(0,n.length-1)):e=Array.from(n),[t,e]}let ve,we={};class w{constructor(t){const e=t.zone||M.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new ot("invalid input"):null)||(e.isValid?null:te(e));this.ts=S(t.ts)?M.now():t.ts;let r=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[r,i]=[t.old.c,t.old.o];else{const l=Ct(t.o)&&!t.old?t.o:e.offset(this.ts);r=he(this.ts,l),s=Number.isNaN(r.year)?new ot("invalid input"):null,r=s?null:r,i=s?null:l}this._zone=e,this.loc=t.loc||T.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new w({})}static local(){const[t,e]=Bs(arguments),[s,r,i,a,l,u,h]=e;return Vs({year:s,month:r,day:i,hour:a,minute:l,second:u,millisecond:h},t)}static utc(){const[t,e]=Bs(arguments),[s,r,i,a,l,u,h]=e;return t.zone=$.utcInstance,Vs({year:s,month:r,day:i,hour:a,minute:l,second:u,millisecond:h},t)}static fromJSDate(t,e={}){const s=wi(t)?t.valueOf():NaN;if(Number.isNaN(s))return w.invalid("invalid input");const r=bt(e.zone,M.defaultZone);return r.isValid?new w({ts:s,zone:r,loc:T.fromObject(e)}):w.invalid(te(r))}static fromMillis(t,e={}){if(Ct(t))return t<-864e13||t>Ro?w.invalid("Timestamp out of range"):new w({ts:t,zone:bt(e.zone,M.defaultZone),loc:T.fromObject(e)});throw new L(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Ct(t))return new w({ts:t*1e3,zone:bt(e.zone,M.defaultZone),loc:T.fromObject(e)});throw new L("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=bt(e.zone,M.defaultZone);if(!s.isValid)return w.invalid(te(s));const r=T.fromObject(e),i=Te(t,Rs),{minDaysInFirstWeek:a,startOfWeek:l}=Ms(i,r),u=M.now(),h=S(e.specificOffset)?s.offset(u):e.specificOffset,m=!S(i.ordinal),c=!S(i.year),f=!S(i.month)||!S(i.day),p=c||f,x=i.weekYear||i.weekNumber;if((p||m)&&x)throw new Ht("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&m)throw new Ht("Can't mix ordinal dates with month/day");const A=x||i.weekday&&!p;let D,E,j=he(u,h);A?(D=Bo,E=Vo,j=Ce(j,a,l)):m?(D=Uo,E=Po,j=Re(j)):(D=qn,E=Yn);let K=!1;for(const qt of D){const Jn=i[qt];S(Jn)?K?i[qt]=E[qt]:i[qt]=j[qt]:K=!0}const Q=A?yi(i,a,l):m?xi(i):wn(i),tt=Q||Sn(i);if(tt)return w.invalid(tt);const mt=A?Ds(i,a,l):m?Os(i):i,[V,kt]=xe(mt,h,s),ft=new w({ts:V,zone:s,o:kt,loc:r});return i.weekday&&p&&t.weekday!==ft.weekday?w.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${ft.toISO()}`):ft.isValid?ft:w.invalid(ft.invalid)}static fromISO(t,e={}){const[s,r]=co(t);return Lt(s,r,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,r]=uo(t);return Lt(s,r,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,r]=ho(t);return Lt(s,r,e,"HTTP",e)}static fromFormat(t,e,s={}){if(S(t)||S(e))throw new L("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[l,u,h,m]=Ho(a,t,e);return m?w.invalid(m):Lt(l,u,s,`format ${e}`,t,h)}static fromString(t,e,s={}){return w.fromFormat(t,e,s)}static fromSQL(t,e={}){const[s,r]=vo(t);return Lt(s,r,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the DateTime is invalid");const s=t instanceof ot?t:new ot(t,e);if(M.throwOnInvalid)throw new zr(s);return new w({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=Gn(t,T.fromObject(e));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(t,e={}){return Bn(W.parseFormat(t),T.fromObject(e)).map(r=>r.val).join("")}static resetCache(){ve=void 0,we={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Be(this).weekYear:NaN}get weekNumber(){return this.isValid?Be(this).weekNumber:NaN}get weekday(){return this.isValid?Be(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ue(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ue(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ue(this).weekYear:NaN}get ordinal(){return this.isValid?Re(this.c).ordinal:NaN}get monthShort(){return this.isValid?Qt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Qt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Qt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Qt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,s=Le(this.c),r=this.zone.offset(s-t),i=this.zone.offset(s+t),a=this.zone.offset(s-r*e),l=this.zone.offset(s-i*e);if(a===l)return[this];const u=s-a*e,h=s-l*e,m=he(u,a),c=he(h,l);return m.hour===c.hour&&m.minute===c.minute&&m.second===c.second&&m.millisecond===c.millisecond?[Dt(this,{ts:u}),Dt(this,{ts:h})]:[this]}get isInLeapYear(){return oe(this.year)}get daysInMonth(){return ke(this.year,this.month)}get daysInYear(){return this.isValid?Rt(this.year):NaN}get weeksInWeekYear(){return this.isValid?ne(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ne(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:s,calendar:r}=W.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:r}}toUTC(t=0,e={}){return this.setZone($.instance(t),e)}toLocal(){return this.setZone(M.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=bt(t,M.defaultZone),t.equals(this.zone))return this;if(t.isValid){let r=this.ts;if(e||s){const i=t.offset(this.ts),a=this.toObject();[r]=xe(a,i,t)}return Dt(this,{ts:r,zone:t})}else return w.invalid(te(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const r=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return Dt(this,{loc:r})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=Te(t,Rs),{minDaysInFirstWeek:s,startOfWeek:r}=Ms(e,this.loc),i=!S(e.weekYear)||!S(e.weekNumber)||!S(e.weekday),a=!S(e.ordinal),l=!S(e.year),u=!S(e.month)||!S(e.day),h=l||u,m=e.weekYear||e.weekNumber;if((h||a)&&m)throw new Ht("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Ht("Can't mix ordinal dates with month/day");let c;i?c=Ds({...Ce(this.c,s,r),...e},s,r):S(e.ordinal)?(c={...this.toObject(),...e},S(e.day)&&(c.day=Math.min(ke(c.year,c.month),c.day))):c=Os({...Re(this.c),...e});const[f,p]=xe(c,this.o,this.zone);return Dt(this,{ts:f,o:p})}plus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t);return Dt(this,As(this,e))}minus(t){if(!this.isValid)return this;const e=C.fromDurationLike(t).negate();return Dt(this,As(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const s={},r=C.normalizeUnit(t);switch(r){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(r==="weeks")if(e){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?W.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Pe}toLocaleString(t=be,e={}){return this.isValid?W.create(this.loc.clone(e),t).formatDateTime(this):Pe}toLocaleParts(t={}){return this.isValid?W.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=t==="extended";let l=ze(this,a);return l+="T",l+=Hs(this,a,e,s,r,i),l}toISODate({format:t="extended"}={}){return this.isValid?ze(this,t==="extended"):null}toISOWeekDate(){return pe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Hs(this,a==="extended",e,t,s,i):null}toRFC2822(){return pe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return pe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ze(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(e||t)&&(s&&(r+=" "),e?r+="z":t&&(r+="ZZ")),pe(this,r,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Pe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",s={}){if(!this.isValid||!t.isValid)return C.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=Si(e).map(C.normalizeUnit),a=t.valueOf()>this.valueOf(),l=a?this:t,u=a?t:this,h=Do(l,u,i,r);return a?h.negate():h}diffNow(t="milliseconds",e={}){return this.diff(w.now(),t,e)}until(t){return this.isValid?O.fromDateTimes(this,t):this}hasSame(t,e,s){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(e,s)<=r&&r<=i.endOf(e,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||w.fromObject({},{zone:this.zone}),s=t.padding?this<e?-t.padding:t.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(r=t.unit,i=void 0),Ps(e,this.plus(s),{...t,numeric:"always",units:r,unit:i})}toRelativeCalendar(t={}){return this.isValid?Ps(t.base||w.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(w.isDateTime))throw new L("min requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(w.isDateTime))throw new L("max requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return zn(a,t,e)}static fromStringExplain(t,e,s={}){return w.fromFormatExplain(t,e,s)}static buildFormatParser(t,e={}){const{locale:s=null,numberingSystem:r=null}=e,i=T.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new Un(i,t)}static fromFormatParser(t,e,s={}){if(S(t)||S(e))throw new L("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=s,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!a.equals(e.locale))throw new L(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${e.locale}`);const{result:l,zone:u,specificOffset:h,invalidReason:m}=e.explainFromTokens(t);return m?w.invalid(m):Lt(l,u,s,`format ${e.format}`,t,h)}static get DATE_SHORT(){return be}static get DATE_MED(){return qs}static get DATE_MED_WITH_WEEKDAY(){return Yr}static get DATE_FULL(){return Xs}static get DATE_HUGE(){return Js}static get TIME_SIMPLE(){return Ks}static get TIME_WITH_SECONDS(){return Qs}static get TIME_WITH_SHORT_OFFSET(){return tn}static get TIME_WITH_LONG_OFFSET(){return en}static get TIME_24_SIMPLE(){return sn}static get TIME_24_WITH_SECONDS(){return nn}static get TIME_24_WITH_SHORT_OFFSET(){return rn}static get TIME_24_WITH_LONG_OFFSET(){return on}static get DATETIME_SHORT(){return an}static get DATETIME_SHORT_WITH_SECONDS(){return ln}static get DATETIME_MED(){return cn}static get DATETIME_MED_WITH_SECONDS(){return un}static get DATETIME_MED_WITH_WEEKDAY(){return qr}static get DATETIME_FULL(){return dn}static get DATETIME_FULL_WITH_SECONDS(){return hn}static get DATETIME_HUGE(){return pn}static get DATETIME_HUGE_WITH_SECONDS(){return mn}}function Xt(n){if(w.isDateTime(n))return n;if(n&&n.valueOf&&Ct(n.valueOf()))return w.fromJSDate(n);if(n&&typeof n=="object")return w.fromObject(n);throw new L(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Zo="3.5.0";z.DateTime=w;z.Duration=C;z.FixedOffsetZone=$;z.IANAZone=ut;z.Info=Qt;z.Interval=O;z.InvalidZone=fn;z.Settings=M;z.SystemZone=ie;z.VERSION=Zo;z.Zone=Bt;Object.defineProperty(lt,"__esModule",{value:!0});lt.CronDate=lt.DateMathOp=lt.TimeUnit=void 0;const Ot=z;var F;(function(n){n.Second="Second",n.Minute="Minute",n.Hour="Hour",n.Day="Day",n.Month="Month",n.Year="Year"})(F||(lt.TimeUnit=F={}));var De;(function(n){n.Add="Add",n.Subtract="Subtract"})(De||(lt.DateMathOp=De={}));class $e{#t;#e=null;#n=null;#i={add:{[F.Year]:this.addYear.bind(this),[F.Month]:this.addMonth.bind(this),[F.Day]:this.addDay.bind(this),[F.Hour]:this.addHour.bind(this),[F.Minute]:this.addMinute.bind(this),[F.Second]:this.addSecond.bind(this)},subtract:{[F.Year]:this.subtractYear.bind(this),[F.Month]:this.subtractMonth.bind(this),[F.Day]:this.subtractDay.bind(this),[F.Hour]:this.subtractHour.bind(this),[F.Minute]:this.subtractMinute.bind(this),[F.Second]:this.subtractSecond.bind(this)}};constructor(t,e){const s={zone:e};if(t?t instanceof $e?(this.#t=t.#t,this.#e=t.#e,this.#n=t.#n):t instanceof Date?this.#t=Ot.DateTime.fromJSDate(t,s):typeof t=="number"?this.#t=Ot.DateTime.fromMillis(t,s):(this.#t=Ot.DateTime.fromISO(t,s),this.#t.isValid||(this.#t=Ot.DateTime.fromRFC2822(t,s)),this.#t.isValid||(this.#t=Ot.DateTime.fromSQL(t,s)),this.#t.isValid||(this.#t=Ot.DateTime.fromFormat(t,"EEE, d MMM yyyy HH:mm:ss",s))):this.#t=Ot.DateTime.local(),!this.#t.isValid)throw new Error(`CronDate: unhandled timestamp: ${t}`);e&&e!==this.#t.zoneName&&(this.#t=this.#t.setZone(e))}get dstStart(){return this.#e}set dstStart(t){this.#e=t}get dstEnd(){return this.#n}set dstEnd(t){this.#n=t}addYear(){this.#t=this.#t.plus({years:1})}addMonth(){this.#t=this.#t.plus({months:1}).startOf("month")}addDay(){this.#t=this.#t.plus({days:1}).startOf("day")}addHour(){this.#t=this.#t.plus({hours:1}).startOf("hour")}addMinute(){this.#t=this.#t.plus({minutes:1}).startOf("minute")}addSecond(){this.#t=this.#t.plus({seconds:1})}subtractYear(){this.#t=this.#t.minus({years:1})}subtractMonth(){this.#t=this.#t.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#t=this.#t.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#t=this.#t.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#t=this.#t.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#t=this.#t.minus({seconds:1})}addUnit(t){this.#i.add[t]()}subtractUnit(t){this.#i.subtract[t]()}invokeDateOperation(t,e){if(t===De.Add){this.addUnit(e);return}if(t===De.Subtract){this.subtractUnit(e);return}throw new Error(`Invalid verb: ${t}`)}getDate(){return this.#t.day}getFullYear(){return this.#t.year}getDay(){const t=this.#t.weekday;return t===7?0:t}getMonth(){return this.#t.month-1}getHours(){return this.#t.hour}getMinutes(){return this.#t.minute}getSeconds(){return this.#t.second}getMilliseconds(){return this.#t.millisecond}getTime(){return this.#t.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const t=this.#r().weekday;return t===7?0:t}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#t.toUTC().toISO()}toJSON(){return this.#t.toJSON()}setDate(t){this.#t=this.#t.set({day:t})}setFullYear(t){this.#t=this.#t.set({year:t})}setDay(t){this.#t=this.#t.set({weekday:t})}setMonth(t){this.#t=this.#t.set({month:t+1})}setHours(t){this.#t=this.#t.set({hour:t})}setMinutes(t){this.#t=this.#t.set({minute:t})}setSeconds(t){this.#t=this.#t.set({second:t})}setMilliseconds(t){this.#t=this.#t.set({millisecond:t})}toString(){return this.toDate().toString()}toDate(){return this.#t.toJSDate()}isLastDayOfMonth(){const t=this.#t.plus({days:1}).startOf("day");return this.#t.month!==t.month}isLastWeekdayOfMonth(){const t=this.#t.plus({days:7}).startOf("day");return this.#t.month!==t.month}applyDateOperation(t,e,s){if(e===F.Month||e===F.Day){this.invokeDateOperation(t,e);return}const r=this.getHours();this.invokeDateOperation(t,e);const i=this.getHours(),a=i-r;a===2?s!==24&&(this.dstStart=i):a===0&&this.getMinutes()===0&&this.getSeconds()===0&&s!==24&&(this.dstEnd=i)}#r(){return this.#t.toUTC()}}lt.CronDate=$e;lt.default=$e;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CronExpression=void 0;const Yo=z,N=lt,Us=1e4;class R{#t;#e;#n;#i;#r;#a;#s;constructor(t,e){this.#t=e,this.#e=e.tz,this.#n=new N.CronDate(e.currentDate,this.#e),this.#i=e.startDate?new N.CronDate(e.startDate,this.#e):null,this.#r=e.endDate?new N.CronDate(e.endDate,this.#e):null,this.#a=e.nthDayOfWeek||0,this.#s=t}get fields(){return this.#s}static fieldsToExpression(t,e){return new R(t,e||{})}static#o(t,e){return e.some(s=>s===t)}static#l(t){return t.length>0&&t.some(e=>typeof e=="string"&&e.indexOf("L")>=0)}static#u(t,e){return t.some(s=>{if(!R.#l([s]))return!1;const r=parseInt(s.toString().charAt(0),10)%7;if(Number.isNaN(r))throw new Error(`Invalid last weekday of the month expression: ${s}`);return e.getDay()===r&&e.isLastWeekdayOfMonth()})}next(){return this.#c()}prev(){return this.#c(!0)}hasNext(){const t=this.#n;try{return this.#c(),!0}catch{return!1}finally{this.#n=t}}hasPrev(){const t=this.#n;try{return this.#c(!0),!0}catch{return!1}finally{this.#n=t}}take(t){const e=[];if(t>=0)for(let s=0;s<t;s++)try{e.push(this.next())}catch{return e}else for(let s=0;s>t;s--)try{e.push(this.prev())}catch{return e}return e}reset(t){this.#n=new N.CronDate(t||this.#t.currentDate)}stringify(t=!1){return this.#s.stringify(t)}includesDate(t){const{second:e,minute:s,hour:r,dayOfMonth:i,month:a,dayOfWeek:l}=this.#s,u=Yo.DateTime.fromISO(t.toISOString(),{zone:this.#e});return i.values.includes(u.day)&&l.values.includes(u.weekday)&&a.values.includes(u.month)&&r.values.includes(u.hour)&&s.values.includes(u.minute)&&e.values.includes(u.second)}toString(){return this.#t.expression||this.stringify(!0)}#d(t){const e=this.#s.dayOfMonth.isWildcard,s=!e,r=this.#s.dayOfWeek.isWildcard,i=!r,a=R.#o(t.getDate(),this.#s.dayOfMonth.values)||R.#l(this.#s.dayOfMonth.values)&&t.isLastDayOfMonth(),l=R.#o(t.getDay(),this.#s.dayOfWeek.values)||R.#l(this.#s.dayOfWeek.values)&&R.#u(this.#s.dayOfWeek.values,t);return!!(s&&i&&(a||l)||a&&!i||e&&!r&&l)}#h(t,e,s){const r=t.getHours(),i=R.#o(r,this.#s.hour.values),a=t.dstStart===r,l=t.dstEnd===r;return!i&&!a?(t.dstStart=null,t.applyDateOperation(e,N.TimeUnit.Hour,this.#s.hour.values.length),!1):a&&!R.#o(r-1,this.#s.hour.values)?(t.invokeDateOperation(e,N.TimeUnit.Hour),!1):l&&!s?(t.dstEnd=null,t.applyDateOperation(N.DateMathOp.Add,N.TimeUnit.Hour,this.#s.hour.values.length),!1):!0}#c(t=!1){const e=t?N.DateMathOp.Subtract:N.DateMathOp.Add,s=new N.CronDate(this.#n),r=this.#i,i=this.#r,a=s.getTime();let l=0;for(;l++<Us;){if(l>Us)throw new Error("Invalid expression, loop limit exceeded");if(t&&r&&r.getTime()>s.getTime())throw new Error("Out of the timespan range");if(!t&&i&&s.getTime()>i.getTime())throw new Error("Out of the timespan range");if(!this.#d(s)){s.applyDateOperation(e,N.TimeUnit.Day,this.#s.hour.values.length);continue}if(!(this.#a<=0||Math.ceil(s.getDate()/7)===this.#a)){s.applyDateOperation(e,N.TimeUnit.Day,this.#s.hour.values.length);continue}if(!R.#o(s.getMonth()+1,this.#s.month.values)){s.applyDateOperation(e,N.TimeUnit.Month,this.#s.hour.values.length);continue}if(this.#h(s,e,t)){if(!R.#o(s.getMinutes(),this.#s.minute.values)){s.applyDateOperation(e,N.TimeUnit.Minute,this.#s.hour.values.length);continue}if(!R.#o(s.getSeconds(),this.#s.second.values)){s.applyDateOperation(e,N.TimeUnit.Second,this.#s.hour.values.length);continue}if(a===s.getTime()){(e==="Add"||s.getMilliseconds()===0)&&s.applyDateOperation(e,N.TimeUnit.Second,this.#s.hour.values.length);continue}break}}return s.getMilliseconds()!==0&&s.setMilliseconds(0),this.#n=s,s}[Symbol.iterator](){return{next:()=>({value:this.#c(),done:!this.hasNext()})}}}Yt.CronExpression=R;Yt.default=R;Object.defineProperty(U,"__esModule",{value:!0});U.CronExpressionParser=U.DayOfWeek=U.Months=U.CronUnit=U.PredefinedExpressions=void 0;const qo=re,Xo=lt,Jo=Yt,Y=St;var es;(function(n){n["@yearly"]="0 0 0 1 1 *",n["@annually"]="0 0 0 1 1 *",n["@monthly"]="0 0 0 1 * *",n["@weekly"]="0 0 0 * * 0",n["@daily"]="0 0 0 * * *",n["@hourly"]="0 0 * * * *",n["@minutely"]="0 * * * * *",n["@secondly"]="* * * * * *",n["@weekdays"]="0 0 0 * * 1-5",n["@weekends"]="0 0 0 * * 0,6"})(es||(U.PredefinedExpressions=es={}));var q;(function(n){n.Second="Second",n.Minute="Minute",n.Hour="Hour",n.DayOfMonth="DayOfMonth",n.Month="Month",n.DayOfWeek="DayOfWeek"})(q||(U.CronUnit=q={}));var ss;(function(n){n[n.jan=1]="jan",n[n.feb=2]="feb",n[n.mar=3]="mar",n[n.apr=4]="apr",n[n.may=5]="may",n[n.jun=6]="jun",n[n.jul=7]="jul",n[n.aug=8]="aug",n[n.sep=9]="sep",n[n.oct=10]="oct",n[n.nov=11]="nov",n[n.dec=12]="dec"})(ss||(U.Months=ss={}));var ns;(function(n){n[n.sun=0]="sun",n[n.mon=1]="mon",n[n.tue=2]="tue",n[n.wed=3]="wed",n[n.thu=4]="thu",n[n.fri=5]="fri",n[n.sat=6]="sat"})(ns||(U.DayOfWeek=ns={}));class H{static parse(t,e={}){const{strict:s=!1}=e,r=e.currentDate||new Xo.CronDate(void 0,"UTC");t=es[t]||t;const i=H.#t(t,s);if(!(i.dayOfMonth==="*"||i.dayOfWeek==="*"||!s))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const a=H.#e(q.Second,i.second,Y.CronSecond.constraints),l=H.#e(q.Minute,i.minute,Y.CronMinute.constraints),u=H.#e(q.Hour,i.hour,Y.CronHour.constraints),h=H.#e(q.Month,i.month,Y.CronMonth.constraints),m=H.#e(q.DayOfMonth,i.dayOfMonth,Y.CronDayOfMonth.constraints),{dayOfWeek:c,nthDayOfWeek:f}=H.#l(i.dayOfWeek),p=H.#e(q.DayOfWeek,c,Y.CronDayOfWeek.constraints),x=new qo.CronFieldCollection({second:new Y.CronSecond(a,["*","?"].includes(i.second)),minute:new Y.CronMinute(l,["*","?"].includes(i.minute)),hour:new Y.CronHour(u,["*","?"].includes(i.hour)),dayOfMonth:new Y.CronDayOfMonth(m,["*","?"].includes(i.dayOfMonth)),month:new Y.CronMonth(h,["*","?"].includes(i.month)),dayOfWeek:new Y.CronDayOfWeek(p,["*","?"].includes(i.dayOfWeek))});return new Jo.CronExpression(x,{...e,expression:t,currentDate:r,nthDayOfWeek:f})}static#t(t,e){if(!(!e||t.length))throw new Error("Invalid cron expression");t=t||"0 * * * * *";const s=t.trim().split(/\s+/);if(!(!e||s.length===6))throw new Error("Invalid cron expression, expected 6 fields");if(s.length>6)throw new Error("Invalid cron expression, too many fields");const r=["*","*","*","*","*","0"];s.length<r.length&&s.unshift(...r.slice(s.length));const[i,a,l,u,h,m]=s;return{second:i,minute:a,hour:l,dayOfMonth:u,month:h,dayOfWeek:m}}static#e(t,e,s){if((t===q.Month||t===q.DayOfWeek)&&(e=e.replace(/[a-z]{3}/gi,r=>{r=r.toLowerCase();const i=ss[r]||ns[r];if(i===void 0)throw new Error(`Validation error, cannot resolve alias "${r}"`);return i.toString()})),!s.validChars.test(e))throw new Error(`Invalid characters, got value: ${e}`);return e=e.replace(/[*?]/g,s.min+"-"+s.max),H.#n(t,e,s)}static#n(t,e,s){const r=[];function i(l,u){if(Array.isArray(l))r.push(...l);else if(H.#u(u,l))r.push(l);else{const h=parseInt(l.toString(),10);if(!(h>=u.min&&h<=u.max))throw new Error(`Constraint error, got value ${l} expected range ${u.min}-${u.max}`);r.push(t===q.DayOfWeek?h%7:l)}}return e.split(",").forEach(l=>{if(!(l.length>0))throw new Error("Invalid list value format");i(H.#i(t,l,s),s)}),r}static#i(t,e,s){const r=e.split("/");if(r.length>2)throw new Error(`Invalid repeat: ${e}`);return r.length===2?(isNaN(parseInt(r[0],10))||(r[0]=`${r[0]}-${s.max}`),H.#o(t,r[0],parseInt(r[1],10),s)):H.#o(t,e,1,s)}static#r(t,e,s){if(!(!isNaN(t)&&!isNaN(e)&&t>=s.min&&e<=s.max))throw new Error(`Constraint error, got range ${t}-${e} expected range ${s.min}-${s.max}`);if(t>e)throw new Error(`Invalid range: ${t}-${e}, min(${t}) > max(${e})`)}static#a(t){if(!(!isNaN(t)&&t>0))throw new Error(`Constraint error, cannot repeat at every ${t} time.`)}static#s(t,e,s,r){const i=[];t===q.DayOfWeek&&s%7===0&&i.push(0);for(let a=e;a<=s;a+=r)i.indexOf(a)===-1&&i.push(a);return i}static#o(t,e,s,r){const i=e.split("-");if(i.length<=1)return isNaN(+e)?e:+e;const[a,l]=i.map(u=>parseInt(u,10));return this.#r(a,l,r),this.#a(s),this.#s(t,a,l,s)}static#l(t){const e=t.split("#");if(e.length<=1)return{dayOfWeek:e[0]};const s=+e[e.length-1],r=t.match(/([,-/])/);if(r!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r==null?void 0:r[0]}\` special characters are incompatible`);if(!(e.length<=2&&!isNaN(s)&&s>=1&&s<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:e[0],nthDayOfWeek:s}}static#u(t,e){return t.chars.some(s=>e.toString().includes(s))}}U.CronExpressionParser=H;var dt={},Ko=dt&&dt.__createBinding||(Object.create?function(n,t,e,s){s===void 0&&(s=e);var r=Object.getOwnPropertyDescriptor(t,e);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,s,r)}:function(n,t,e,s){s===void 0&&(s=e),n[s]=t[e]}),Qo=dt&&dt.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),ta=dt&&dt.__importStar||function(){var n=function(t){return n=Object.getOwnPropertyNames||function(e){var s=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[s.length]=r);return s},n(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=n(t),r=0;r<s.length;r++)s[r]!=="default"&&Ko(e,t,s[r]);return Qo(e,t),e}}();Object.defineProperty(dt,"__esModule",{value:!0});dt.CronFileParser=void 0;const ea=U;class se{static async parseFile(t){const{readFile:e}=await Promise.resolve().then(()=>ta(ps)),s=await e(t,"utf8");return se.#t(s)}static parseFileSync(t){const{readFileSync:e}=ps,s=e(t,"utf8");return se.#t(s)}static#t(t){const e=t.split(`
2
2
  `),s={variables:{},expressions:[],errors:{}};for(const r of e){const i=r.trim();if(i.length===0||i.startsWith("#"))continue;const a=i.match(/^(.*)=(.*)$/);if(a){const[,l,u]=a;s.variables[l]=u.replace(/["']/g,"");continue}try{const l=se.#e(i);s.expressions.push(l.interval)}catch(l){s.errors[i]=l}}return s}static#e(t){const e=t.split(" ");return{interval:ea.CronExpressionParser.parse(e.slice(0,5).join(" ")),command:e.slice(5,e.length)}}}dt.CronFileParser=se;(function(n){var t=Wt&&Wt.__createBinding||(Object.create?function(h,m,c,f){f===void 0&&(f=c);var p=Object.getOwnPropertyDescriptor(m,c);(!p||("get"in p?!m.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return m[c]}}),Object.defineProperty(h,f,p)}:function(h,m,c,f){f===void 0&&(f=c),h[f]=m[c]}),e=Wt&&Wt.__exportStar||function(h,m){for(var c in h)c!=="default"&&!Object.prototype.hasOwnProperty.call(m,c)&&t(m,h,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.CronFileParser=n.CronExpressionParser=n.CronExpression=n.CronFieldCollection=n.CronDate=void 0;const s=U;var r=lt;Object.defineProperty(n,"CronDate",{enumerable:!0,get:function(){return r.CronDate}});var i=re;Object.defineProperty(n,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var a=Yt;Object.defineProperty(n,"CronExpression",{enumerable:!0,get:function(){return a.CronExpression}});var l=U;Object.defineProperty(n,"CronExpressionParser",{enumerable:!0,get:function(){return l.CronExpressionParser}});var u=dt;Object.defineProperty(n,"CronFileParser",{enumerable:!0,get:function(){return u.CronFileParser}}),e(St,n),n.default=s.CronExpressionParser})(Wt);var sa={exports:{}};(function(n,t){(function(s,r){n.exports=r(zs)})(globalThis,e=>(()=>{var s={93:c=>{c.exports=e}},r={};function i(c){var f=r[c];if(f!==void 0)return f.exports;var p=r[c]={exports:{}};return s[c](p,p.exports,i),p.exports}i.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return i.d(f,{a:f}),f},i.d=(c,f)=>{for(var p in f)i.o(f,p)&&!i.o(c,p)&&Object.defineProperty(c,p,{enumerable:!0,get:f[p]})},i.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),i.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};i.r(a);var l=i(93),u=i.n(l),h=a;Object.defineProperty(h,"__esModule",{value:!0}),h.en=void 0;var m=function(){function c(){}return c.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},c.prototype.atX0MinutesPastTheHourGt20=function(){return null},c.prototype.commaMonthX0ThroughMonthX1=function(){return null},c.prototype.commaYearX0ThroughYearX1=function(){return null},c.prototype.use24HourTimeFormatByDefault=function(){return!1},c.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},c.prototype.everyMinute=function(){return"every minute"},c.prototype.everyHour=function(){return"every hour"},c.prototype.atSpace=function(){return"At "},c.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},c.prototype.at=function(){return"At"},c.prototype.spaceAnd=function(){return" and"},c.prototype.everySecond=function(){return"every second"},c.prototype.everyX0Seconds=function(){return"every %s seconds"},c.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},c.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},c.prototype.everyX0Minutes=function(){return"every %s minutes"},c.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},c.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},c.prototype.everyX0Hours=function(){return"every %s hours"},c.prototype.betweenX0AndX1=function(){return"between %s and %s"},c.prototype.atX0=function(){return"at %s"},c.prototype.commaEveryDay=function(){return", every day"},c.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},c.prototype.commaX0ThroughX1=function(){return", %s through %s"},c.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},c.prototype.first=function(){return"first"},c.prototype.second=function(){return"second"},c.prototype.third=function(){return"third"},c.prototype.fourth=function(){return"fourth"},c.prototype.fifth=function(){return"fifth"},c.prototype.commaOnThe=function(){return", on the "},c.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},c.prototype.lastDay=function(){return"the last day"},c.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},c.prototype.commaOnlyOnX0=function(){return", only on %s"},c.prototype.commaAndOnX0=function(){return", and on %s"},c.prototype.commaEveryX0Months=function(){return", every %s months"},c.prototype.commaOnlyInX0=function(){return", only in %s"},c.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},c.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},c.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},c.prototype.firstWeekday=function(){return"first weekday"},c.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},c.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},c.prototype.commaEveryX0Days=function(){return", every %s days"},c.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},c.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},c.prototype.commaEveryHour=function(){return", every hour"},c.prototype.commaEveryX0Years=function(){return", every %s years"},c.prototype.commaStartingX0=function(){return", starting %s"},c.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},c.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},c}();return h.en=m,u().locales.en=new m,a})())})(sa);var na={exports:{}};(function(n,t){(function(s,r){n.exports=r(zs)})(globalThis,e=>(()=>{var s={93:c=>{c.exports=e}},r={};function i(c){var f=r[c];if(f!==void 0)return f.exports;var p=r[c]={exports:{}};return s[c](p,p.exports,i),p.exports}i.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return i.d(f,{a:f}),f},i.d=(c,f)=>{for(var p in f)i.o(f,p)&&!i.o(c,p)&&Object.defineProperty(c,p,{enumerable:!0,get:f[p]})},i.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),i.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};i.r(a);var l=i(93),u=i.n(l),h=a;Object.defineProperty(h,"__esModule",{value:!0}),h.nl=void 0;var m=function(){function c(){}return c.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},c.prototype.atX0MinutesPastTheHourGt20=function(){return null},c.prototype.commaMonthX0ThroughMonthX1=function(){return null},c.prototype.commaYearX0ThroughYearX1=function(){return null},c.prototype.use24HourTimeFormatByDefault=function(){return!0},c.prototype.everyMinute=function(){return"elke minuut"},c.prototype.everyHour=function(){return"elk uur"},c.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"Er is een fout opgetreden bij het vertalen van de gegevens. Controleer de gegevens."},c.prototype.atSpace=function(){return"Om "},c.prototype.everyMinuteBetweenX0AndX1=function(){return"Elke minuut tussen %s en %s"},c.prototype.at=function(){return"Om"},c.prototype.spaceAnd=function(){return" en"},c.prototype.everySecond=function(){return"elke seconde"},c.prototype.everyX0Seconds=function(){return"elke %s seconden"},c.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconden %s t/m %s na de minuut"},c.prototype.atX0SecondsPastTheMinute=function(){return"op %s seconden na de minuut"},c.prototype.everyX0Minutes=function(){return"elke %s minuten"},c.prototype.minutesX0ThroughX1PastTheHour=function(){return"minuut %s t/m %s na het uur"},c.prototype.atX0MinutesPastTheHour=function(){return"op %s minuten na het uur"},c.prototype.everyX0Hours=function(){return"elke %s uur"},c.prototype.betweenX0AndX1=function(){return"tussen %s en %s"},c.prototype.atX0=function(){return"om %s"},c.prototype.commaEveryDay=function(){return", elke dag"},c.prototype.commaEveryX0DaysOfTheWeek=function(){return", elke %s dagen van de week"},c.prototype.commaX0ThroughX1=function(){return", %s t/m %s"},c.prototype.commaAndX0ThroughX1=function(){return", en %s t/m %s"},c.prototype.first=function(){return"eerste"},c.prototype.second=function(){return"tweede"},c.prototype.third=function(){return"derde"},c.prototype.fourth=function(){return"vierde"},c.prototype.fifth=function(){return"vijfde"},c.prototype.commaOnThe=function(){return", op de "},c.prototype.spaceX0OfTheMonth=function(){return" %s van de maand"},c.prototype.lastDay=function(){return"de laatste dag"},c.prototype.commaOnTheLastX0OfTheMonth=function(){return", op de laatste %s van de maand"},c.prototype.commaOnlyOnX0=function(){return", alleen op %s"},c.prototype.commaAndOnX0=function(){return", en op %s"},c.prototype.commaEveryX0Months=function(){return", elke %s maanden"},c.prototype.commaOnlyInX0=function(){return", alleen in %s"},c.prototype.commaOnTheLastDayOfTheMonth=function(){return", op de laatste dag van de maand"},c.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", op de laatste werkdag van de maand"},c.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s dagen vóór de laatste dag van de maand"},c.prototype.firstWeekday=function(){return"eerste werkdag"},c.prototype.weekdayNearestDayX0=function(){return"werkdag dichtst bij dag %s"},c.prototype.commaOnTheX0OfTheMonth=function(){return", op de %s van de maand"},c.prototype.commaEveryX0Days=function(){return", elke %s dagen"},c.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", tussen dag %s en %s van de maand"},c.prototype.commaOnDayX0OfTheMonth=function(){return", op dag %s van de maand"},c.prototype.commaEveryX0Years=function(){return", elke %s jaren"},c.prototype.commaStartingX0=function(){return", beginnend %s"},c.prototype.daysOfTheWeek=function(){return["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},c.prototype.monthsOfTheYear=function(){return["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},c}();return h.nl=m,u().locales.nl=new m,a})())})(na);const me={nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"},tooltip:{pointerEvents:"none"}},it=n=>o.jsxs(d.Grid2,{container:!0,title:n.icon?"":n.tooltip||"",alignItems:"center",direction:"row",spacing:1,style:me.nowrap,children:[n.icon&&o.jsx(d.Grid2,{style:{minWidth:24},children:o.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:me.tooltip}},children:n.icon})}),o.jsx(d.Grid2,{style:me.width,children:o.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:me.tooltip}},children:o.jsx(d.Typography,{component:"div",style:n.style,children:n.children})})})]}),ra="data:image/svg+xml,%3csvg%20width='256'%20height='230'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M251.22%20187.856c5.785%2010.045%206.345%2020.608%201.538%2028.958-4.8%208.357-14.192%2013.143-25.768%2013.143h-21.816c.259-4.068.431-8.17.431-12.302%200-4.628-.215-9.198-.531-13.754l14.35-.014c3.528%200%206.38-2.867%206.38-6.403a6.46%206.46%200%200%200-.768-3.053l-91.46-158.97a6.349%206.349%200%200%200-5.54-3.24%206.374%206.374%200%200%200-5.461%203.09l-14.522%2025.243c44.134%2033.27%2073.804%2084.813%2077.864%20143.333.316%204.548.531%209.119.531%2013.753%200%204.132-.172%208.228-.424%2012.302h-71.246c.388-4.053.611-8.148.611-12.302%200-4.649-.273-9.233-.776-13.753-3.52-32.206-19.286-60.748-42.503-80.89l-10.003%2017.376c17.54%2016.325%2029.512%2038.558%2032.767%2063.514.59%204.505.92%209.09.92%2013.753%200%204.154-.273%208.264-.74%2012.302H29.01c-11.576%200-20.968-4.793-25.768-13.15-4.807-8.35-4.247-18.905%201.538-28.958l13.56-23.238a79.42%2079.42%200%200%201%2020.715%2016.052l-8.083%2013.768a6.523%206.523%200%200%200-.77%203.054%206.383%206.383%200%200%200%206.382%206.395l32.033.015c-2.687-15.356-9.772-29.21-19.918-40.183-5.979-6.445-12.963-11.9-20.738-16.074l35.77-62.15a151.427%20151.427%200%200%201%2021.564%2014.624c30.827%2025.013%2051.644%2061.955%2055.416%20103.776h19.172c-3.91-48.892-28.477-92.006-64.937-120.548a171.205%20171.205%200%200%200-21.672-14.457l30.532-53.045C109.583%205.77%20118.42%200%20128.036%200c9.607%200%2018.438%205.77%2024.223%2015.823l98.961%20172.033z'%20fill='%23FB2D26'/%3e%3cline%20stroke-width='33'%20y2='223'%20x2='250.40002'%20y1='8'%20x1='6.40002'%20stroke='%23FB2D26'%20fill='none'/%3e%3cline%20stroke-width='32'%20y2='224'%20x2='8.40002'%20y1='7'%20x1='247.40002'%20stroke='%23FB2D26'%20fill='none'/%3e%3c/svg%3e",ia={img:{width:"100%",height:"100%"}};class oa extends It.Component{render(){if(!this.props.links||!this.props.links.length)return null;const t=this.props.links[0].port,e=this.props.links.find(s=>s.port!==t);return o.jsxs(d.Dialog,{onClose:()=>this.props.onClose(),open:!0,children:[o.jsx(d.DialogTitle,{style:{padding:"8px 0 0 0",textAlign:"center"},children:this.props.t("Links")}),o.jsx(d.List,{children:this.props.links.map(s=>o.jsxs(d.ListItemButton,{style:s.color?{backgroundColor:s.color,color:ge.getInvertedColor(s.color,this.props.themeType,!0)}:{},onClick:r=>{r.stopPropagation();let i=s.link;i=i.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//[$1]$2/"),window.open(i,this.props.instanceId),this.props.onClose()},children:[o.jsx(d.ListItemAvatar,{children:o.jsx(d.Avatar,{variant:"rounded",children:o.jsx("img",{style:ia.img,src:this.props.image,alt:this.props.instanceId})})}),o.jsx(d.ListItemText,{primary:at.getText(s.name,pt.getLanguage())+(e?` [:${s.port}]`:"")})]},at.getText(s.name,pt.getLanguage())))})]})}}const aa=["silly","debug","info","warn","error"],Ge=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],la="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",ca="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",Xn={root:n=>({position:"relative",m:"10px",width:300,minHeight:200,background:n.palette.background.default,boxShadow:la,display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:ca}}),imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},logLevel:{width:"100%",marginBottom:5},hostInfo:{width:"100%"},addCompact:{width:"100%",marginBottom:5},selectStyle:{display:"flex",margin:5,justifyContent:"space-around"},hide:{visibility:"hidden"},tooltip:{pointerEvents:"none"},deleting:{position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},enabled:{color:fe[400],"&:hover":{backgroundColor:fe[200]}},disabled:{color:Jt[400],"&:hover":{backgroundColor:Jt[200]}},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},displayFlex:{display:"flex"},marginLeft5:{marginLeft:5},marginRight5:{marginRight:5},instanceStateNotEnabled1:{backgroundColor:"rgba(192, 192, 192, 0.2)"},instanceStateNotEnabled2:{backgroundColor:"rgba(192, 192, 192, 0.15)"},instanceStateNotAlive1:{backgroundColor:"rgba(255,14,14,0.2)"},instanceStateNotAlive2:{backgroundColor:"rgba(255,14,14, 0.15)"},instanceStateAliveNotConnected1:{backgroundColor:"rgba(255, 177, 0, 0.1)"},instanceStateAliveNotConnected2:{backgroundColor:"rgba(255, 177, 0, 0.15)"},instanceStateAliveAndConnected1:{backgroundColor:"rgba(0, 255, 0, 0.1)"},instanceStateAliveAndConnected2:{backgroundColor:"rgba(0, 255, 0, 0.15)"},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},orangeDevice:{color:Se[300]},button:{padding:"5px",transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},smallAvatar:{width:24,height:24},statusIndicator:{marginLeft:8},green:{color:fe[700]},red:{color:Jt[700]},grey:{color:Ye[700]},blue:{color:"#0055a9"},orange:{color:Se[400]},transparent:{color:"transparent",backgroundColor:"transparent"},silly:{},debug:{backgroundColor:Ye[700]},info:{backgroundColor:Kn[700]},warn:{backgroundColor:pr[700]},error:{backgroundColor:Jt[700]},scheduleIcon:{color:"#dc8e00"},memoryIcon:{color:"#dc8e00"},contrast0:{filter:"contrast(0%)"},hidden:{display:"none"},okSymbol:{width:20,height:20,margin:2,borderRadius:2},okSymbolInner:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"},editButton:{minHeight:32,"& .admin-edit-button":at.isTouchDevice()?void 0:{display:"none",maxHeight:32},"&:hover":at.isTouchDevice()?void 0:{"& .admin-edit-button":{display:"block"}}}};class _ extends It.Component{componentDidMount(){this.props.context.onRegisterClose(this.props.id,this.commandClose)}componentWillUnmount(){this.props.context.onRegisterClose(this.props.id,null)}getDefaultState(t){return{openDialog:!1,openSelectCompactGroup:!1,openDialogCron:!1,openDialogSchedule:!1,openDialogName:!1,openDialogLogLevel:!1,openDialogDelete:!1,openDialogMemoryLimit:!1,openDialogHost:!1,openDialogCompact:!1,openDialogTier:!1,showLinks:!1,showStopAdminDialog:!1,logLevel:t.item.logLevel,logOnTheFly:!1,compactGroup:t.item.compactGroup||0,maxCompactGroupNumber:t.context.maxCompactGroupNumber,tier:t.item.tier,host:t.instance.host,deleteCustom:!1,visibleEdit:!1,expanded:!1}}static isCompact(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.runAsCompactMode)||!1}isSentry(){var t;return!!((t=this.props.context.states[`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`])!=null&&t.val)}static getSchedule(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.schedule)||""}static isRunning(t){var e,s;return((e=t==null?void 0:t.common)==null?void 0:e.onlyWWW)||((s=t==null?void 0:t.common)==null?void 0:s.enabled)}static isCompactGroup(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.compactGroup)||null}static getSentrySettings(t){var e,s;return!!((s=(e=t==null?void 0:t.common)==null?void 0:e.plugins)!=null&&s.sentry)}static isModeSchedule(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.mode)==="schedule"}static getMemoryLimitMB(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.memoryLimitMB)||0}static getRestartSchedule(t){var e;return(e=t==null?void 0:t.common)!=null&&e.restartSchedule?t.common.restartSchedule:""}async setCommonValue(t,e){try{await this.props.context.socket.extendObject(t,{common:e})}catch(s){window.alert(s)}}commandClose=()=>this.setState({expanded:!1});toggleSentry(){const t=!this.isSentry();this.props.context.socket.setState(`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`,t,!0).catch(e=>window.alert(`Cannot set sentry: ${e}`))}setTier(t,e){this.setCommonValue(`system.adapter.${t.id}`,{tier:e})}setName(t,e){this.setCommonValue(`system.adapter.${t.id}`,{titleLang:e})}setLogLevel(t,e,s){s?this.props.context.socket.setState(`system.adapter.${t.id}.logLevel`,e):this.setCommonValue(`system.adapter.${t.id}`,{loglevel:e})}setSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{schedule:e}):this.props.context.socket.getObject(`system.adapter.${t.id}`).then(s=>{s.common.schedule!==""&&(s.common.schedule="",this.props.context.socket.setObject(s._id,s).catch(r=>window.alert(`Cannot set schedule: ${r}`)))}).catch(s=>window.alert(`Cannot set schedule: ${s}`))}setMemoryLimitMB(t,e){this.setCommonValue(`system.adapter.${t.id}`,{memoryLimitMB:e})}toggleCompactMode(){this.setCommonValue(`system.adapter.${this.props.instance.id}`,{runAsCompactMode:!_.isCompact(this.props.instance.obj)})}setRestartSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{restartSchedule:e}):this.props.context.socket.getObject(`system.adapter.${t.id}`).then(s=>{s.common.restartSchedule!==""&&(s.common.restartSchedule="",this.props.context.socket.setObject(s._id,s))})}setHost(t,e){this.setCommonValue(`system.adapter.${t.id}`,{host:e})}setCompactGroup(t,e){e=e==="controller"?0:e==="default"?1:parseInt(e,10),this.setCommonValue(`system.adapter.${t.id}`,{compactGroup:e}),this.props.context.maxCompactGroupNumber<e&&this.props.context.setMaxCompactGroupNumber(e)}getMemory(){const t=this.props.context.states[`${this.props.id}.memRss`];return(t==null?void 0:t.val)||0}renderDeleteDialog(){return o.jsxs(d.Dialog,{onClose:()=>this.setState({openDialogDelete:!1,openDialog:!1}),open:!0,children:[o.jsx(d.DialogTitle,{children:this.props.context.t("Please confirm")}),o.jsxs(d.DialogContent,{children:[this.state.openDialogDelete===1?this.props.context.t('Are you sure you want to delete the instance "%s" or whole adapter "%s"?',this.props.instance.id,this.props.instance.id.split(".")[0]):this.props.context.t("Are you sure you want to delete the instance %s?",this.props.instance.id),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&o.jsx("br",{}),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&o.jsx(d.FormControlLabel,{control:o.jsx(d.Checkbox,{checked:this.state.deleteCustom,onChange:t=>this.setState({deleteCustom:t.target.checked})}),label:this.props.context.t("Delete all custom object settings of this adapter too")})]}),o.jsxs(d.DialogActions,{children:[this.state.openDialogDelete===1?o.jsx(d.Button,{startIcon:o.jsx(v.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom,!0),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",style:{background:"red",color:"white"},children:this.props.context.t("Delete adapter")}):null,o.jsx(d.Button,{startIcon:o.jsx(v.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",color:"primary",children:this.props.context.t("Delete instance")}),o.jsx(d.Button,{color:"grey",onClick:()=>this.setState({openDialogDelete:!1,openDialog:!1}),variant:"contained",startIcon:o.jsx(v.Close,{}),children:this.props.context.t("Cancel")})]})]})}renderEditNameDialog(){return o.jsx(Et,{theme:this.props.context.theme,title:this.props.context.t("Enter title for %s",this.props.instance.id),disableApplyIfNotChanged:!0,textInput:!0,defaultValue:at.getText(this.props.item.name,this.props.context.lang),onApply:t=>{this.setName(this.props.instance,t.toString()),this.setState({openDialogName:!1,openDialog:!1})},onClose:()=>this.setState({openDialogName:!1,openDialog:!1})})}renderEditLogLevelDialog(){return o.jsxs(Et,{theme:this.props.context.theme,title:this.props.context.t("Edit log level rule for %s",this.props.instance.id),onApply:()=>{this.setLogLevel(this.props.instance,this.state.logLevel,this.state.logOnTheFly),this.setState({openDialogLogLevel:!1,openDialog:!1})},disableApply:this.state.logLevel===this.props.item.logLevel,onClose:()=>this.setState({openDialogLogLevel:!1,logLevel:this.props.item.logLevel,openDialog:!1}),children:[o.jsxs(d.FormControl,{style:this.styles.logLevel,variant:"standard",children:[o.jsx(d.InputLabel,{children:this.props.context.t("log level")}),o.jsx(d.Select,{variant:"standard",value:this.state.logLevel,fullWidth:!0,onChange:t=>this.setState({logLevel:t.target.value}),children:aa.map(t=>o.jsx(d.MenuItem,{value:t,children:this.props.context.t(t)},t))})]}),o.jsxs(d.FormControl,{variant:"outlined",children:[o.jsx(d.FormControlLabel,{control:o.jsx(d.Checkbox,{checked:this.state.logOnTheFly,onChange:t=>this.setState({logOnTheFly:t.target.checked})}),label:this.props.context.t("Without restart")}),o.jsx(d.FormHelperText,{children:this.state.logOnTheFly?this.props.context.t("Will be reset to the saved log level after restart of adapter"):this.props.context.t("Log level will be saved permanently")})]})]})}renderEditMemoryLimitDialog(){return o.jsx(Et,{theme:this.props.context.theme,title:this.props.context.t("Edit memory limit rule for %s",this.props.instance.id),onApply:t=>{this.setMemoryLimitMB(this.props.instance,parseFloat(t.toString())||0),this.setState({openDialogMemoryLimit:!1,openDialog:!1})},disableApplyIfNotChanged:!0,textInput:!0,defaultValue:this.props.item.memoryLimitMB,help:this.props.context.t("Default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit)"),onClose:()=>this.setState({openDialogMemoryLimit:!1,openDialog:!1})})}renderEditHostDialog(){return o.jsx(Et,{theme:this.props.context.theme,title:this.props.context.t("Edit host for %s",this.props.instance.id),onApply:()=>{this.setHost(this.props.instance,this.state.host),this.setState({openDialogHost:!1,openDialog:!1})},disableApply:this.state.host===this.props.instance.host,onClose:()=>this.setState({openDialogHost:!1,host:this.props.instance.host,openDialog:!1}),children:o.jsx(Qn,{themeType:this.props.context.themeType,value:this.state.host,list:this.props.context.hosts,removePrefix:"system.host.",fullWidth:!0,style:this.styles.hostInfo,onChange:t=>this.setState({host:t}),lang:this.props.context.lang,t:this.props.context.t})})}renderEditCompactGroupDialog(){return o.jsx(Et,{theme:this.props.context.theme,title:this.props.context.t("Edit compact groups for %s",this.props.instance.id),onApply:()=>{this.setCompactGroup(this.props.instance,parseInt(this.state.compactGroup.toString(),10)||0),this.setState({openDialogCompact:!1,openDialog:!1})},disableApply:this.state.compactGroup===this.props.item.compactGroup,onClose:()=>this.setState({openDialogCompact:!1,openDialog:!1,compactGroup:this.props.item.compactGroup,maxCompactGroupNumber:this.props.context.maxCompactGroupNumber}),children:o.jsxs(d.FormControl,{style:this.styles.addCompact,variant:"standard",children:[o.jsx(d.InputLabel,{children:this.props.context.t("compact groups")}),o.jsxs(d.Select,{variant:"standard",autoWidth:!0,onClose:()=>this.setState({openSelectCompactGroup:!1}),onOpen:()=>this.setState({openSelectCompactGroup:!0}),open:this.state.openSelectCompactGroup,value:(this.state.compactGroup===1?"default":(this.state.compactGroup||"").toString()==="0"?"controller":this.state.compactGroup?this.state.compactGroup:"default")||"default",onChange:t=>this.setState({compactGroup:parseInt(t.target.value,10)}),children:[o.jsx("div",{onClick:t=>{t.preventDefault(),t.stopPropagation()},style:this.styles.selectStyle,children:o.jsx(d.Button,{color:"grey",onClick:()=>this.setState({openSelectCompactGroup:!1,compactGroup:this.state.maxCompactGroupNumber+1,maxCompactGroupNumber:this.state.maxCompactGroupNumber+1}),variant:"outlined",children:this.props.context.t("Add compact group")})}),o.jsx(d.MenuItem,{value:"controller",children:this.props.context.t("with js-controller")}),o.jsx(d.MenuItem,{value:"default",children:this.props.context.t("default group")}),Array(this.state.maxCompactGroupNumber-1).fill(0).map((t,e)=>o.jsx(d.MenuItem,{value:(e+2).toString(),children:e+2},e))]})]})})}renderEditTierDialog(){return o.jsx(Et,{theme:this.props.context.theme,title:this.props.context.t("Set tier for %s",this.props.instance.id),onApply:()=>{this.setTier(this.props.instance,this.state.tier),this.setState({openDialogTier:!1,openDialog:!1})},help:this.props.context.t("Tiers define the order of adapters when the system starts."),disableApply:this.state.tier===this.props.item.tier,onClose:()=>this.setState({openDialogTier:!1,tier:this.props.item.tier,openDialog:!1}),children:o.jsxs(d.FormControl,{style:this.styles.logLevel,variant:"standard",children:[o.jsx(d.InputLabel,{children:this.props.context.t("Tiers")}),o.jsx(d.Select,{variant:"standard",value:this.state.tier,fullWidth:!0,onChange:t=>this.setState({tier:parseInt(t.target.value,10)}),children:Ge.map(t=>o.jsx(d.MenuItem,{value:t.value,children:this.props.context.t(t.desc)},t.value))})]})})}renderStopAdminDialog(){return this.state.showStopAdminDialog?o.jsx(tr,{title:this.props.context.t("Please confirm"),text:this.props.context.t("stop_admin",this.props.context.adminInstance),ok:this.props.context.t("Stop admin"),onClose:t=>{t&&this.setCommonValue(this.state.showStopAdminDialog,{enabled:!1}),this.setState({showStopAdminDialog:!1,openDialog:!1})}}):null}renderLinksDialog(){return this.state.showLinks?o.jsx(oa,{image:this.props.instance.image,instanceId:this.props.instance.id,links:this.props.instance.links,onClose:()=>this.setState({showLinks:!1,openDialog:!1}),t:this.props.context.t,themeType:this.props.context.themeType}):null}renderCronDialog(){return o.jsx(ms,{title:this.props.context.t("Edit restart rule for %s",this.props.instance.id),clearButton:!0,cron:_.getRestartSchedule(this.props.instance.obj),onOk:t=>this.setRestartSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogCron:!1,openDialog:!1})})}renderScheduleDialog(){return o.jsx(ms,{title:this.props.context.t("Edit schedule rule for %s",this.props.instance.id),clearButton:!0,cron:_.getSchedule(this.props.instance.obj),onOk:t=>this.setSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogSchedule:!1,openDialog:!1})})}renderDialogs(){return this.state.openDialog?this.state.openDialogDelete?this.renderDeleteDialog():this.state.openDialogHost?this.renderEditHostDialog():this.state.openDialogTier?this.renderEditTierDialog():this.state.openDialogCompact?this.renderEditCompactGroupDialog():this.state.openDialogLogLevel?this.renderEditLogLevelDialog():this.state.openDialogName?this.renderEditNameDialog():this.state.showStopAdminDialog?this.renderStopAdminDialog():this.state.openDialogCron?this.renderCronDialog():this.state.openDialogSchedule?this.renderScheduleDialog():this.state.showLinks?this.renderLinksDialog():this.state.openDialogMemoryLimit?this.renderEditMemoryLimitDialog():null:null}renderModeIcon(t){return o.jsx("div",{style:{...this.styles.smallAvatar,...this.styles.statusIndicator,...this.props.instance.mode==="daemon"||this.props.instance.mode==="schedule"?this.styles[t]:this.styles.transparent,...this.props.item.connectedToHost&&this.props.item.alive&&this.props.item.connected===!1?this.styles.orangeDevice:void 0},children:this.getModeIcon(this.props.instance.mode,t,this.styles[`statusIcon_${t}`],this.props.item.stoppedWhenWebExtension)})}getModeIcon(t,e,s,r){return t==="daemon"?r?o.jsx("div",{style:{...s,...this.styles.okSymbol},children:o.jsx("div",{style:this.styles.okSymbolInner})}):e==="orange"?o.jsx(v.Warning,{style:s}):e==="green"?o.jsx("div",{style:{...s,...this.styles.okSymbol},children:o.jsx("div",{style:this.styles.okSymbolInner})}):o.jsx(v.Settings,{style:s}):t==="schedule"?o.jsx(v.Schedule,{style:s}):null}renderTooltip(){const{instance:t,item:e}=this.props;let s,r,i;if(t.mode==="schedule"&&t.schedule){try{i=er.toString(t.schedule,{locale:this.props.context.lang})}catch{i=t.schedule}if(t.enabled)try{const a=Wt.CronExpressionParser.parse(t.schedule);s=a.next().toDate(),r=a.prev().toDate()}catch{s=null,r=null}}return[e.stoppedWhenWebExtension!==void 0?o.jsx(et,{state:!0,children:this.props.context.t("Runs as web-extension")},1):"",t.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?o.jsx(et,{state:e.connectedToHost,children:this.props.context.t("Connected to host")},2):"",t.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?o.jsx(et,{state:e.alive,children:this.props.context.t("Heartbeat")},3):"",this.props.item.connected!==null&&this.props.item.stoppedWhenWebExtension===void 0?o.jsx(et,{state:!!e.connected,children:typeof e.connected=="string"?`${this.props.context.t("Connected:")} ${e.connected||"-"}`:this.props.context.t("Connected to device or service")},4):"",i?o.jsxs(et,{state:t.enabled,children:["CRON:",i]},5):null,s?o.jsx(et,{state:!0,children:this.props.context.t("Next start: %s",`${s.toLocaleDateString(this.props.context.lang)} ${s.toLocaleTimeString(this.props.context.lang)}`)},6):null,r?o.jsx(et,{state:!0,children:this.props.context.t("Last start: %s",`${r.toLocaleDateString(this.props.context.lang)} ${r.toLocaleTimeString(this.props.context.lang)}`)},7):null].filter(a=>a)}renderMemoryUsage(){return this.props.item.running&&o.jsx(it,{icon:o.jsx(v.Memory,{}),tooltip:this.props.context.t("RAM usage"),children:`${this.props.instance.mode==="daemon"&&!_.isCompact(this.props.instance.obj)?this.getMemory():"-.--"} MB`})}renderPlayPause(){return o.jsx(d.Tooltip,{title:this.props.context.t("Start/stop"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx("div",{children:o.jsx(d.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.item.running&&this.props.instance.id===this.props.context.adminInstance?this.setState({showStopAdminDialog:`system.adapter.${this.props.instance.id}`,openDialog:!0}):this.setCommonValue(`system.adapter.${this.props.instance.id}`,{enabled:!this.props.item.running})},onFocus:t=>t.stopPropagation(),sx:{...this.styles.button,...this.props.instance.canStart?this.props.item.running?this.styles.enabled:this.styles.disabled:this.styles.hide},children:this.props.item.running?o.jsx(v.Pause,{}):o.jsx(v.PlayArrow,{})})})})}renderSettingsButton(){return o.jsx(d.Tooltip,{title:this.props.instance.config?this.props.context.t("Settings"):"",slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx("div",{children:o.jsx(d.IconButton,{disabled:!this.props.instance.config,size:"small",style:{...this.styles.button,...this.props.instance.config?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.saveScrollPosition(),Gs.doNavigate("tab-instances","config",this.props.id)},children:o.jsx(v.Build,{})})})})}renderRestartButton(){return o.jsx(d.Tooltip,{title:this.props.context.t("Restart"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx("div",{children:o.jsx(d.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.context.socket.extendObject(`system.adapter.${this.props.instance.id}`,{})},onFocus:t=>t.stopPropagation(),style:{...this.styles.button,...this.props.instance.canStart?void 0:this.styles.hide},disabled:!this.props.item.running,children:o.jsx(v.Refresh,{})})})})}renderLink(){return o.jsx(d.Tooltip,{title:this.props.context.t("Instance link %s",this.props.instance.id),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx("div",{children:o.jsx(d.IconButton,{size:"small",style:{...this.styles.button,...!this.props.instance.links||!this.props.instance.links[0]?this.styles.hide:void 0},disabled:!this.props.item.running,onClick:t=>{if(t.stopPropagation(),t.preventDefault(),this.props.instance.links.length===1){let e=this.props.instance.links[0].link;e=e.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//$1$2/"),window.open(e,this.props.instance.id)}else this.setState({showLinks:!0,openDialog:!0})},onFocus:t=>t.stopPropagation(),children:o.jsx(v.Input,{})})})})}renderEditNameButton(){return o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:{...this.styles.button,...this.state.visibleEdit?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogName:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})}renderInputOutput(){return o.jsx(it,{icon:o.jsx(v.ImportExport,{}),children:o.jsxs("div",{style:this.styles.displayFlex,children:[o.jsx(d.Tooltip,{title:this.props.context.t("input events"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsxs("div",{style:this.styles.marginRight5,children:["⇥",this.props.item.inputOutput.stateInput]})}),"/",o.jsx(d.Tooltip,{title:this.props.context.t("output events"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsxs("div",{style:this.styles.marginLeft5,children:["↦",this.props.item.inputOutput.stateOutput]})})]})})}renderHost(){return o.jsx(sr,{value:this.props.instance.host,list:this.props.context.hosts,removePrefix:"system.host.",themeType:this.props.context.themeType,lang:this.props.context.lang})}renderEditHostButton(){return o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",style:this.styles.button,className:"admin-edit-button",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogHost:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})}renderSentry(){return o.jsx(d.Tooltip,{title:"sentry",slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleSentry()},children:o.jsx(d.CardMedia,{style:{...this.styles.sentry,...this.props.item.sentry?void 0:this.styles.contrast0},component:"img",image:this.props.item.sentry?ur:ra})})})}renderCompactGroupEnabled(){return o.jsx(d.Tooltip,{title:this.props.context.t("compact groups"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",style:{...this.styles.button,...this.props.context.expertMode&&this.props.item.checkCompact?void 0:this.styles.hide},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleCompactMode()},children:o.jsx(v.ViewCompact,{color:this.props.item.compact?"primary":"inherit"})})})}renderVersion(){return o.jsxs(it,{tooltip:this.props.context.t("Installed"),children:["v",this.props.instance.version]})}renderInfo(t){return o.jsxs(o.Fragment,{children:[t?void 0:o.jsx("span",{style:this.styles.instanceName,children:this.props.instance.id}),this.props.item.stoppedWhenWebExtension!==void 0&&o.jsx(et,{state:this.props.item.stoppedWhenWebExtension,children:this.props.context.t("Runs as web-extension")}),this.props.item.running&&this.props.instance.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0&&o.jsx(et,{state:this.props.item.connectedToHost,children:this.props.context.t("Connected to host")}),this.props.item.running&&this.props.instance.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0&&o.jsx(et,{state:this.props.item.alive,children:this.props.context.t("Heartbeat")}),this.props.item.running&&this.props.item.connected!==null&&this.props.item.stoppedWhenWebExtension===void 0&&o.jsx(et,{state:!!this.props.item.connected,children:typeof this.props.item.connected=="string"?`${this.props.context.t("Connected:")} ${this.props.item.connected||"-"}`:this.props.context.t("Connected to device or service")})]})}renderLogLevel(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:this.props.item.loglevelIcon,tooltip:this.props.item.logLevelObject===this.props.item.logLevel?`${this.props.context.t("loglevel")} ${this.props.item.logLevel}`:`${this.props.context.t("saved:")} ${this.props.item.logLevelObject} / ${this.props.context.t("actual:")} ${this.props.item.logLevel}`,children:this.props.item.logLevelObject===this.props.item.logLevel?this.props.item.logLevel:`${this.props.item.logLevelObject} / ${this.props.item.logLevel}`}),o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogLogLevel:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})]})}renderSchedule(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.Schedule,{}),tooltip:this.props.context.t("schedule_group"),children:_.getSchedule(this.props.instance.obj)||"-"}),o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogSchedule:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})]})}renderRestartSchedule(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.Schedule,{style:this.styles.scheduleIcon}),tooltip:this.props.context.t("restart"),children:_.getRestartSchedule(this.props.instance.obj)||"-"}),o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCron:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})]})}renderRamLimit(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.Memory,{style:this.styles.memoryIcon}),tooltip:this.props.context.t("RAM limit"),children:`${this.props.item.memoryLimitMB?this.props.item.memoryLimitMB:"-.--"} MB`}),o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogMemoryLimit:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})]})}renderCompactGroup(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.ViewCompact,{style:this.styles.marginRight5,color:"inherit"}),tooltip:this.props.context.t("compact groups"),children:(this.props.item.compactGroup===1?"default":(this.props.item.compactGroup||"").toString()==="0"?"controller":this.props.item.compactGroup?this.props.item.compactGroup:"default").toString()||"default"}),o.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCompact:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})})]})}renderTier(){var t;return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.LowPriority,{style:this.styles.marginRight5,color:"inherit"}),tooltip:this.props.context.t("Start order (tier)"),children:this.props.instance.adapter==="admin"?this.props.context.t("Always first"):this.props.context.t(((t=Ge.find(e=>e.value===this.props.item.tier))==null?void 0:t.desc)||Ge[2].desc)}),this.props.instance.adapter!=="admin"?o.jsx(d.Tooltip,{title:this.props.context.t("Edit start order (tier)"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogTier:!0,openDialog:!0})},children:o.jsx(v.Edit,{})})}):null]})}renderHostWithButton(){return o.jsxs(o.Fragment,{children:[o.jsx(it,{icon:o.jsx(v.Storage,{style:this.styles.marginRight5}),tooltip:this.props.context.t("Host for this instance"),children:this.renderHost()}),this.renderEditHostButton()]})}renderDeleteButton(){return o.jsx(d.Tooltip,{title:this.props.context.t("Delete"),slotProps:{popper:{sx:this.styles.tooltip}},children:o.jsx(d.IconButton,{size:"small",style:this.styles.button,onClick:async t=>{t.stopPropagation(),t.preventDefault();const e=await this.props.context.socket.getAdapterInstances(this.props.instance.id.split(".")[0]);this.setState({openDialogDelete:e.length||!0,openDialog:!0})},children:o.jsx(v.Delete,{})})})}render(){return o.jsx("div",{children:this.state.expanded})}}const b={...Xn,fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},collapse:n=>({height:"100%",backgroundColor:n.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",position:"absolute",width:"100%",zIndex:3,marginTop:"auto",bottom:0,transition:"height 0.3s",justifyContent:"space-between",display:"flex",flexDirection:"column"}),collapseOff:{height:0},close:{width:20,height:20,opacity:.9,cursor:"pointer",position:"relative",marginLeft:"auto",mb:"10px",transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},footerBlock:n=>({background:n.palette.background.default,p:"10px",display:"flex",justifyContent:"space-between"}),versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16},cardContent:{mt:2,paddingTop:0},cardContentH5:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},marginTop10:{marginTop:10},overflowAuto:{overflow:"auto"},collapseIcon:n=>({position:"sticky",right:0,top:0,background:n.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",zIndex:2}),enableButton:{display:"flex",justifyContent:"space-between"},instanceName:{fontSize:16,padding:4,paddingBottom:15,fontWeight:"bold"},img:{width:45,height:45,margin:"auto 0",position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.png") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},instanceStateNotEnabled1:n=>({backgroundColor:"rgba(192, 192, 192, 0.2)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateNotAlive1:n=>({backgroundColor:"rgba(192, 192, 192, 0.7)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateAliveNotConnected1:n=>({backgroundColor:"rgba(255, 177, 0, 0.4)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateAliveAndConnected1:n=>({backgroundColor:"rgba(0, 255, 0, 0.4)",color:n.palette.mode==="dark"?"#CCC":"#333"})};class ua extends _{styles=b;constructor(t){super(t),this.state=Object.assign(this.getDefaultState(t),{mouseOver:!1})}renderSecondCardInfo(){var s;if(this.props.deleting||!this.state.expanded)return null;const{item:t,instance:e}=this.props;return o.jsxs(d.Box,{component:"div",sx:ge.getStyle(this.props.context.theme,b.collapse,this.state.expanded?"":b.collapseOff,this.props.deleting&&b.deleting),children:[o.jsxs(d.CardContent,{sx:{"&.MuiCardContent-root":{...b.cardContent,...b.overflowAuto}},children:[o.jsx(d.Box,{component:"div",sx:b.collapseIcon,children:o.jsx(d.Box,{component:"div",sx:b.close,onClick:()=>{this.state.openDialog||this.setState({expanded:!1},()=>this.props.context.onToggleExpanded(this.props.id,!1))}})}),o.jsxs(d.Typography,{gutterBottom:!0,component:"span",variant:"body2",children:[this.renderInfo(),this.renderVersion(),this.renderMemoryUsage(),t.running&&this.props.context.expertMode&&o.jsx("div",{style:b.displayFlex,children:this.renderInputOutput()}),this.props.context.expertMode&&o.jsx("div",{style:b.displayFlex,children:this.renderRamLimit()}),this.props.context.expertMode&&o.jsx("div",{style:b.displayFlex,children:this.renderLogLevel()}),t.modeSchedule&&o.jsx("div",{style:b.displayFlex,children:this.renderSchedule()}),this.props.context.expertMode&&e.mode==="daemon"&&o.jsx("div",{style:b.displayFlex,children:this.renderRestartSchedule()}),this.props.context.expertMode&&t.checkCompact&&t.compact&&t.supportCompact&&o.jsx("div",{style:b.displayFlex,children:this.renderCompactGroup()}),this.props.context.expertMode&&o.jsx("div",{style:b.displayFlex,children:this.renderTier()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((s=this.props.context.hosts[0].common)==null?void 0:s.name)!==e.host?o.jsx("div",{style:b.displayFlex,children:this.renderHostWithButton()}):null,o.jsx(wt,{config:t,name:"allowInstanceSettings",children:o.jsx(d.Box,{component:"div",sx:{display:{sm:"none",xs:"inline-block"}},children:this.renderSettingsButton()})})]})]}),o.jsxs(d.Box,{component:"div",sx:b.footerBlock,children:[o.jsx(wt,{config:t,name:"allowInstanceDelete",children:o.jsx("div",{style:b.displayFlex,children:this.renderDeleteButton()})}),this.props.context.expertMode&&t.checkSentry&&o.jsx("div",{style:b.displayFlex,children:this.renderSentry()}),t.supportCompact&&this.props.context.expertMode&&t.checkCompact&&o.jsx("div",{style:b.displayFlex,children:this.renderCompactGroupEnabled()})]})]})}render(){const{item:t,instance:e}=this.props;return o.jsxs(d.Card,{sx:ge.getStyle(this.props.context.theme,b.root,this.props.hidden&&b.hidden),children:[this.state.openDialog&&this.renderDialogs(),this.renderSecondCardInfo(),o.jsxs(d.Box,{component:"div",sx:ge.getStyle(this.props.context.theme,b.imageBlock,(!t.running||e.mode!=="daemon"||t.stoppedWhenWebExtension!==void 0)&&b.instanceStateNotEnabled1,t.running&&e.mode==="daemon"&&t.stoppedWhenWebExtension===void 0&&(!t.connectedToHost||!t.alive)&&b.instanceStateNotAlive1,t.running&&t.connectedToHost&&t.alive&&t.connected===!1&&b.instanceStateAliveNotConnected1,t.running&&t.connectedToHost&&t.alive&&t.connected!==!1&&b.instanceStateAliveAndConnected1),children:[o.jsx(d.CardMedia,{sx:b.img,component:"img",image:e.image||"img/no-image.png"}),o.jsx("div",{style:b.adapter,children:e.id}),o.jsx("div",{style:b.versionDate}),this.state.expanded?null:o.jsx(d.Fab,{onMouseOver:()=>this.setState({mouseOver:!0}),onMouseOut:()=>this.setState({mouseOver:!1}),onClick:()=>this.setState({expanded:!0},()=>this.props.context.onToggleExpanded(this.props.id,!0)),style:b.fab,color:"primary","aria-label":"add",children:o.jsx(v.MoreVert,{})})]}),o.jsxs(d.CardContent,{style:b.cardContentH5,children:[o.jsx(d.Typography,{gutterBottom:!0,variant:"h5",component:"h5",children:o.jsxs("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:b.displayFlex,children:[at.getText(t.name,this.props.context.lang),this.renderEditNameButton()]})}),o.jsx("div",{style:b.marginTop10,children:o.jsxs(d.Typography,{component:"span",style:b.enableButton,children:[this.renderPlayPause(),o.jsx(d.Box,{component:"div",sx:{display:{sm:"inline-block",xs:"none"}},children:this.renderSettingsButton()}),this.renderRestartButton(),o.jsx(wt,{config:t,name:"allowInstanceLink",children:this.renderLink()})]})})]})]})}}const y={...Xn,row:{pl:1,pr:2,p:0},expanded:{minHeight:64},invisible:{opacity:0},instanceIcon:{height:42,width:42,"@media screen and (max-width: 800px)":{height:28,width:28,ml:"4px"}},hidden1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"none !important"}},visible1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"flex !important"}},visible1050:{display:"none","@media screen and (max-width: 1120px)":{display:"flex !important"}},hidden1050:{display:"flex","@media screen and (max-width: 1120px)":{display:"none !important"}},hidden800:{display:"flex","@media screen and (max-width: 800px)":{display:"none !important"}},visible800:{display:"none","@media screen and (max-width: 800px)":{display:"flex !important"}},hidden570:{display:"flex","@media screen and (max-width: 650px)":{display:"none !important"}},visible570:{display:"none","@media screen and (max-width: 650px)":{display:"flex !important"}},hidden1230:{"@media screen and (max-width: 1300px)":{display:"none !important"}},hidden380:{display:"flex","@media screen and (max-width: 380px)":{display:"none !important"}},instanceId:{overflow:"hidden",alignSelf:"center",fontSize:16,ml:"5px",maxWidth:150,minWidth:100,whiteSpace:"nowrap",textOverflow:"ellipsis",flexGrow:2,"@media screen and (max-width: 380px)":{width:"70px !important",minWidth:"70px !important"},"@media screen and (max-width: 480px)":{width:100}},secondaryHeading:{maxWidth:200,fontSize:12},secondaryHeadingDiv:{display:"flex",alignItems:"center",width:200},secondaryHeadingDivDiv:{whiteSpace:"nowrap",overflow:"hidden",padding:5,textOverflow:"ellipsis",maxWidth:200},gridStyle:{display:"flex",minWidth:270,lineHeight:"34px",justifyContent:"space-around",alignItems:"center","@media screen and (max-width: 480px)":{minWidth:"auto !important",ml:"10px"},"@media screen and (max-width: 335px)":{ml:"0px"}},paddingRight200:{},maxWidth300:{width:300,"@media screen and (max-width: 480px)":{width:"250px !important"}},width150:{width:150},desktopRow:{minHeight:0},desktopIcon:{height:32,width:32,mt:1},desktopRowContent:{mt:"2px",mb:"2px"},desktopButton:{},rowGridLine:{marginTop:-2}};class da extends _{desktop=window.innerWidth>1e3;styles=y;constructor(t){super(t),this.state=this.getDefaultState(t)}renderDetails(){var s;const{instance:t,item:e}=this.props;return o.jsx(d.AccordionDetails,{children:o.jsxs(d.Grid2,{container:!0,direction:"row",children:[o.jsxs(d.Grid2,{container:!0,direction:"row",size:{xs:10},children:[o.jsx(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderInfo(!0)}),o.jsx(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderVersion()}),o.jsxs(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},style:y.paddingRight200,children:[this.props.context.expertMode&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderLogLevel()}),e.running&&this.props.context.expertMode&&o.jsx(d.Box,{component:"div",sx:y.visible1250,children:this.renderInputOutput()}),o.jsx(d.Grid2,{sx:y.visible1050,children:this.renderMemoryUsage()}),e.modeSchedule&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderSchedule()}),this.props.context.expertMode&&t.mode==="daemon"&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderRestartSchedule()}),this.props.context.expertMode&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderRamLimit()}),this.props.context.expertMode&&e.checkCompact&&e.compact&&e.supportCompact&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderCompactGroup()}),this.props.context.expertMode&&o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderTier()}),o.jsxs(d.Box,{component:"div",sx:{...y.maxWidth300,...y.visible800,...y.editButton},children:[o.jsx(it,{children:at.getText(e.name,this.props.context.lang)}),this.renderEditNameButton()]}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((s=this.props.context.hosts[0].common)==null?void 0:s.name)!==t.host?o.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderHostWithButton()}):null]})]}),o.jsxs("div",{style:y.displayFlex,children:[o.jsx(wt,{config:e,name:"allowInstanceDelete",children:o.jsx(d.Box,{component:"div",sx:{display:{xs:"inline-block",md:"none"}},children:this.renderSettingsButton()})}),o.jsx(d.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderRestartButton()}),o.jsx(wt,{config:e,name:"allowInstanceLink",children:o.jsx(d.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderLink()})}),o.jsx(wt,{config:e,name:"allowInstanceDelete",children:this.renderDeleteButton()}),o.jsx(d.Box,{component:"div",sx:y.visible570,children:this.renderSentry()}),o.jsx(d.Box,{component:"div",sx:y.visible570,children:this.renderCompactGroupEnabled()})]})]})})}render(){var a;const{instance:t,item:e}=this.props,s=this.props.context.getInstanceStatus(t.obj),r=this.renderTooltip(),i={...y.row,...(!e.running||t.mode!=="daemon"||e.stoppedWhenWebExtension!==void 0)&&(this.props.idx%2===0?y.instanceStateNotEnabled1:y.instanceStateNotEnabled2),...e.running&&t.mode==="daemon"&&e.stoppedWhenWebExtension===void 0&&(!e.connectedToHost||!e.alive)?this.props.idx%2===0?y.instanceStateNotAlive1:y.instanceStateNotAlive2:void 0,...e.running&&e.connectedToHost&&e.alive&&e.connected===!1?this.props.idx%2===0?y.instanceStateAliveNotConnected1:y.instanceStateAliveNotConnected2:void 0,...e.running&&e.connectedToHost&&e.alive&&e.connected!==!1?this.props.idx%2===0?y.instanceStateAliveAndConnected1:y.instanceStateAliveAndConnected2:void 0,...this.desktop?y.desktopRow:void 0,...this.state.expanded&&!this.props.deleting?y.expanded:void 0};return o.jsxs(d.Accordion,{square:!0,sx:{"&.MuiAccordion-root":{...this.props.deleting?y.deleting:void 0,...this.props.hidden?y.hidden:void 0}},expanded:this.state.expanded&&!this.props.deleting,onChange:()=>{this.state.openDialog||this.setState({expanded:!this.state.expanded},()=>this.props.context.onToggleExpanded(this.props.id,this.state.expanded))},children:[o.jsxs(d.AccordionSummary,{sx:{"&.MuiAccordionSummary-root":i,"& .MuiAccordionSummary-content":this.desktop?y.desktopRowContent:void 0},expandIcon:o.jsx(v.ExpandMore,{style:this.desktop?y.desktopButton:void 0}),children:[this.renderDialogs(),o.jsxs(d.Grid2,{container:!0,spacing:1,alignItems:"center",direction:"row",wrap:"nowrap",style:y.rowGridLine,children:[o.jsxs(d.Box,{component:"div",style:y.gridStyle,children:[r.length?o.jsx(d.Tooltip,{slotProps:{popper:{sx:y.tooltip}},title:o.jsx("span",{style:{display:"flex",flexDirection:"column"},children:r}),children:this.renderModeIcon(s)}):this.renderModeIcon(s),o.jsx(d.Avatar,{variant:"square",alt:t.id,src:t.image,sx:{...y.instanceIcon,...this.desktop?y.desktopIcon:void 0}}),o.jsx(d.Box,{component:"div",sx:y.instanceId,children:t.id})]}),this.renderPlayPause(),o.jsx(wt,{config:e,name:"allowInstanceSettings",children:o.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderSettingsButton()})}),o.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderRestartButton()}),o.jsx(wt,{config:e,name:"allowInstanceLink",children:o.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderLink()})}),o.jsx(d.Typography,{sx:{...y.secondaryHeading,...y.hidden800},component:"div",children:o.jsxs("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:y.secondaryHeadingDiv,children:[o.jsx("div",{style:y.secondaryHeadingDivDiv,children:at.getText(e.name,this.props.context.lang)}),this.renderEditNameButton()]})}),this.props.context.expertMode&&o.jsx(d.Box,{component:"div",sx:{...y.hidden1250,...t.mode!=="daemon"||!e.running?y.invisible:void 0},children:this.renderInputOutput()}),this.props.context.expertMode&&o.jsx(d.Tooltip,{title:e.logLevelObject===e.logLevel?`${this.props.context.t("loglevel")} ${e.logLevel}`:`${this.props.context.t("saved:")} ${e.logLevelObject} / ${this.props.context.t("actual:")} ${e.logLevel}`,slotProps:{popper:{sx:y.tooltip}},children:o.jsx(d.Avatar,{sx:{...y.smallAvatar,...y.hidden380,...y[e.logLevel]},children:e.loglevelIcon})}),o.jsx(d.Grid2,{sx:{...y.hidden1050,...y.width150,...t.mode!=="daemon"||!e.running?y.invisible:void 0},children:this.renderMemoryUsage()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((a=this.props.context.hosts[0].common)==null?void 0:a.name)!==t.host?o.jsx(d.Grid2,{sx:y.hidden1230,children:this.renderHost()}):null]}),o.jsx(d.Box,{component:"div",sx:y.hidden570,children:this.renderSentry()}),o.jsx(d.Box,{component:"div",sx:y.hidden570,children:this.renderCompactGroupEnabled()})]}),this.state.expanded?this.renderDetails():null,this.renderDialogs()]})}}const ha="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23FB2D26'%3e%3cg%3e%3cpath%20d='M0,0h24%20M24,24H0'%20fill='currentColor'/%3e%3cpath%20d='M4.25,5.61C6.27,8.2,10,13,10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-6c0,0,3.72-4.8,5.74-7.39%20C20.25,4.95,19.78,4,18.95,4H5.04C4.21,4,3.74,4.95,4.25,5.61z'/%3e%3cpath%20d='M0,0h24v24H0V0z'%20fill='none'/%3e%3c/g%3e%3c/svg%3e",P={root:{width:"100%",padding:10},paper:{width:"100%",maxHeight:800},overflowHidden:{display:"flex",overflow:"hidden"},pre:{overflow:"auto",whiteSpace:"pre-wrap",margin:0},rowBlock:{display:"flex",width:"100%",justifyContent:"space-between",margin:"10px 0"},select:{minWidth:200},checkbox:{minWidth:160},statusIcon_1:{border:"2px solid grey",borderRadius:20,color:"grey"},statusIcon_2:{border:"2px solid grey",borderRadius:20,color:"#d32f2f"},statusIcon_3:{border:0,borderRadius:0,color:"#ffa726"},statusIcon_4:{border:"2px solid grey",borderRadius:20,color:"#0055a9"},statusIcon_5:{border:"2px solid grey",borderRadius:20},statusIcon_6:{border:"2px solid grey",borderRadius:20},menuWrapper:{display:"flex",alignItems:"center"},iconWrapper:{marginRight:10},textWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},square:{width:24,height:24,marginRight:10,filter:"invert(0%) sepia(90%) saturate(300%) hue-rotate(-537deg) brightness(99%) contrast(97%)"},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_gray:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},green:{color:fe[700]},red:{color:Jt[700]},grey:{color:Ye[700]},blue:{color:"#0055a9"},orange:{color:Se[400]},orangeDevice:{color:Se[300]},icon:{width:18,height:18,marginRight:8,display:"inline-block"},menuValue:{whiteSpace:"nowrap"}},pa=["none","daemon","schedule","once"],ma=(n,t)=>n===1?o.jsx(v.Lens,{style:t}):n===2?o.jsx(v.Lens,{style:t}):n===3?o.jsx(v.Warning,{style:t}):n===4?o.jsx(v.Schedule,{style:t}):n===5?o.jsx("div",{style:{...t,width:20,height:20,margin:2,borderRadius:2},children:o.jsx("div",{style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}})}):null,Ze={none:{text:"none",_class:"",status:""},disabled:{text:"disabled",_class:"statusIcon_grey",status:"grey"},not_alive:{text:"enabled, but not alive",_class:"statusIcon_red",status:"red"},alive_not_connected:{text:"enabled, alive, but not connected to controller",_class:"statusIcon_orange",status:"orange"},alive_no_device:{text:"enabled, alive, but not connected to device or service",_class:"statusIcon_orangeDevice",status:"orange"},ok:{text:"enabled and OK",_class:"statusIcon_green",status:"green"}},fa=({onClose:n,filterMode:t,filterStatus:e})=>{const[s,r]=It.useState(t),[i,a]=It.useState(e);return o.jsxs(d.Dialog,{onClose:()=>n(),open:!0,sx:{"& .MuiDialog-paper":P.paper},children:[o.jsx(d.DialogTitle,{style:{display:"flex"},children:o.jsxs("div",{style:{display:"flex"},children:[o.jsx(d.Avatar,{variant:"square",style:P.square,src:ha}),pt.t("Filter instances")]})}),o.jsx(d.DialogContent,{style:P.overflowHidden,dividers:!0,children:o.jsxs(d.Card,{style:P.root,children:[o.jsxs("div",{style:P.rowBlock,children:[o.jsx(d.FormControlLabel,{style:P.checkbox,control:o.jsx(d.Checkbox,{checked:!!s,onChange:l=>l.target.checked?r("daemon"):r(null)}),label:pt.t("Filter by mode")}),o.jsx(d.Select,{disabled:!s,variant:"standard",value:s||"none",style:P.select,onChange:l=>{l.target.value==="none"?r(null):r(l.target.value)},children:pa.map(l=>o.jsx(d.MenuItem,{value:l,children:pt.t(l)},l))})]}),o.jsxs("div",{style:P.rowBlock,children:[o.jsx(d.FormControlLabel,{style:P.checkbox,control:o.jsx(d.Checkbox,{checked:!!i,onChange:l=>l.target.checked?a("ok"):a(null)}),label:pt.t("Filter by status")}),o.jsx(d.Select,{disabled:!i,variant:"standard",value:i||"none",style:P.select,onChange:l=>{l.target.value==="none"?a(null):a(l.target.value)},children:Object.keys(Ze).map((l,u)=>o.jsx(d.MenuItem,{value:l,children:o.jsxs("div",{style:P.menuWrapper,children:[Ze[l].status?o.jsx("div",{style:P.iconWrapper,children:ma(u,P[`statusIcon_${u}`])}):null,o.jsx("div",{style:P.textWrapper,children:pt.t(Ze[l].text)})]})},l))})]})]})}),o.jsxs(d.DialogActions,{children:[o.jsx(d.Button,{variant:"contained",autoFocus:!0,disabled:s===t&&e===i,onClick:()=>{n({filterMode:s,filterStatus:i})},color:"primary",startIcon:o.jsx(v.Check,{}),children:pt.t("Apply")}),o.jsx(d.Button,{color:"grey",variant:"contained",onClick:()=>n(),startIcon:o.jsx(v.Close,{}),children:pt.t("Close")})]})]})},_t={row:{paddingLeft:8,flexDirection:"row-reverse",minHeight:"48px !important",height:48,fontWeight:"bold",fontSize:16},iconStyle:{marginRight:10},wrapperName:{margin:"0 10px",display:"flex",alignItems:"center"},wrapperChildren:{width:"100%"},accordionDetails:{padding:0},accordion:{margin:"1px 0 !important"}};function ga({name:n,key:t,children:e,expanded:s,onExpand:r}){return o.jsxs(d.Accordion,{expanded:!!s,onChange:()=>r(!s),style:_t.accordion,square:!0,children:[o.jsx(d.AccordionSummary,{style:_t.row,expandIcon:o.jsx(v.ExpandMore,{}),children:o.jsxs("div",{style:_t.wrapperName,children:[o.jsx(dr,{iconName:n,style:_t.iconStyle}),n]})}),o.jsx(d.AccordionDetails,{style:_t.accordionDetails,children:o.jsx("div",{style:_t.wrapperChildren,children:e})})]},t)}const B={paper:{height:"100%"},iframe:{height:"100%",width:"100%",color:"#000",borderRadius:4,boxShadow:"0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",border:"0px solid #888"},cards:{display:"flex",flexFlow:"wrap",justifyContent:"center"},filterActive:n=>({color:n.palette.primary.main}),tooltip:{pointerEvents:"none"},grow:{flexGrow:1}};class vt extends It.Component{static lastScrollPosition=0;localStorage;statePromise=null;states;adapters;statesUpdateTimer=null;typingTimer=null;hostsTimer=null;wordCache;t;inputRef;refTabContent;subscribed=!1;_cacheList=null;shouldUpdateAfterDialogClosed=!1;expanded="";closeCommands={};constructor(t){super(t),this.localStorage=window._localStorage||window.localStorage;let e=[];if(this.localStorage.getItem("Instances.expandedFolder"))try{e=JSON.parse(this.localStorage.getItem("Instances.expandedFolder"))}catch{}this.state={expertMode:this.props.expertMode,dialog:null,instances:null,dialogProp:null,playArrow:0,onlyCurrentHost:!1,viewMode:!1,viewCategory:!1,hostInfo:null,processes:null,mem:null,percent:null,memFree:null,filterText:this.localStorage.getItem("instances.filter")||"",compact:!1,maxCompactGroupNumber:1,filterCompactGroup:"All",deleting:null,deleteCustomSupported:!1,currentHost:this.props.currentHost,showFilterDialog:!1,expandedFolder:e,filterMode:this.localStorage.getItem("Instances.filterMode")?this.localStorage.getItem("Instances.filterMode")==="null"?null:this.localStorage.getItem("Instances.filterMode"):null,filterStatus:this.localStorage.getItem("Instances.filterStatus")?this.localStorage.getItem("Instances.filterStatus")==="null"?null:this.localStorage.getItem("Instances.filterStatus"):null},this.states={},this.adapters=[],this.statesUpdateTimer=null,this.wordCache={},this.t=this.translate,this.inputRef=It.createRef(),this.refTabContent=It.createRef()}translate=(t,e,s)=>e!==void 0?this.props.t(t,e,s):(this.wordCache[t]||(this.wordCache[t]=this.props.t(t)),this.wordCache[t]);async componentDidMount(){this.props.instancesWorker.registerHandler(this.getInstances),await this.updateData();const t=await this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM");t&&this.setState({deleteCustomSupported:t})}async updateData(){await this.getParamsLocalAndPanel(),await this.getData(),await this.getHostsData(),await this.getInstances()}componentWillUnmount(){this.subscribeStates(!0),this.props.instancesWorker.unregisterHandler(this.getInstances)}getStates(t){return t&&(this.statePromise=null),this.statePromise instanceof Promise||(this.statePromise=this.props.socket.getForeignStates("system.adapter.*")),this.statePromise}static getDerivedStateFromProps(t,e){const s=Gs.getLocation(),r={dialog:s.dialog,dialogProp:s.id};return t.expertMode!==e.expertMode&&(r.expertMode=t.expertMode),r}getInstances=async()=>{const t=Date.now();let e=[];const s=await this.props.instancesWorker.getObjects();if(!s){window.alert("Cannot read instances!");return}e=Object.values(s);let r=`${this.state.currentHost}.memRss`;this.states[r]=this.states[r]||await this.props.socket.getState(r);const i=this.states[r];let a=1,l=i&&parseFloat(i.val)||0;const u={};this.props.hosts.forEach(f=>u[f._id]=f);for(let f=0;f<e.length;f++){const p=e[f];if(!(!p||!p.common||p.common.host!==this.props.currentHostName)&&p.common.enabled&&p.common.mode==="daemon"&&!_.isCompact(p)){r=`${p._id}.memRss`,this.states[r]=this.states[r]||await this.props.socket.getState(r);const x=this.states[r];l+=x&&parseFloat(x.val)||0,a++}}const h={};e.sort((f,p)=>{const x=f._id.split("."),A=p._id.split("."),D=parseInt(x[x.length-1],10),E=parseInt(A[A.length-1],10),j=x[x.length-2],K=A[A.length-2];return j===K?D>E?1:D<E?-1:0:j>K?1:j<K?-1:0});let m=1;const c={};for(let f=0;f<e.length;f++){const p=e[f],x=p.common||null,A=parseInt(p._id.split(".").pop(),10);x.compactGroup&&typeof x.compactGroup=="number"&&m<x.compactGroup&&(m=x.compactGroup);const D={id:p._id.replace("system.adapter.",""),obj:p,compact:!!x.compact,host:x.host,name:this.getName(p),image:x.icon?`adapter/${x.name}/${x.icon}`:"img/no-image.png",enabled:x.enabled,canStart:!x.onlyWWW,config:x.adminUI.config!=="none",jsonConfig:x.adminUI.config==="json",materialize:x.adminUI.config==="materialize",compactMode:x.runAsCompactMode||!1,mode:x.mode||null,schedule:x.schedule===void 0||x.schedule===null?null:x.schedule,loglevel:x.loglevel||null,adapter:x.name||null,version:x.version||null,stoppedWhenWebExtension:p.common.mode==="daemon"&&p.common.webExtension!==void 0?!!p.common.webExtension:void 0,links:[]},E=x.localLinks||x.localLink||"";let j=null;E&&typeof E=="string"?j={_default:E}:E&&typeof E=="object"&&(j=E);const K=j?Object.keys(j):[];if(K.forEach(Q=>{D.links=D.links||[];let tt;typeof j[Q]=="string"?tt={link:j[Q]}:tt=j[Q];const mt=rr(tt.link,x.name,A,{instances:s,hostname:this.props.hostname,hosts:u,adminInstance:this.props.adminInstance})||[];let V=tt.name||Q;V==="_default"?V=K.length===1?"":this.t("default"):typeof V=="object"?V=at.getText(V,this.props.lang):V=this.t(V),mt.length===1?D.links.push({name:V,link:mt[0].url,port:mt[0].port,color:tt.color}):mt.length>1&&mt.forEach(kt=>{D.links.push({name:V,link:kt.url,port:kt.port,color:tt.color})})}),D.stoppedWhenWebExtension){const Q=this.states[`${D.id}.info.extension`]||await this.props.socket.getState(`${D.id}.info.extension`);D.stoppedWhenWebExtension=Q?!!Q.val:void 0}console.log(p._id),h[p._id]=D}console.log(`getInstances: ${Date.now()-t}`);for(let f=1;f<=m;f++){const p=`${this.state.currentHost}.compactgroup${f}.memRss`;this.states[p]=this.states[p]||await this.props.socket.getState(p);const x=this.states[p];x&&(l+=x&&parseFloat(x.val)||0,a++)}this.state.deleting&&!h[`system.adapter.${this.state.deleting}`]&&(c.deleting=null),c.maxCompactGroupNumber=m,c.processes=a,c.mem=Math.round(l),c.instances=h,this._cacheList=null,this.setState(c)};getParamsLocalAndPanel=async()=>{var l,u;let t=!1;try{t=!!((u=(l=(await this.props.socket.readBaseSettings(this.state.currentHost)).config)==null?void 0:l.system)!=null&&u.compact)}catch(h){window.alert(`Cannot read compact mode by host "${this.state.currentHost}": ${h}`)}let e=0,s="All";try{e=JSON.parse(this.localStorage.getItem("Instances.playArrow")),e.toString()==="true"?e=1:e.toString()==="false"&&(e=0),s=JSON.parse(this.localStorage.getItem("Instances.filterCompactGroup"))}catch{}const r=this.localStorage.getItem("Instances.onlyCurrentHost")==="true",i=this.localStorage.getItem("Instances.viewMode")==="true",a=this.localStorage.getItem("Instances.viewCategory")==="true";!s&&s!==0&&(s="All"),this._cacheList=null,this.setState({filterCompactGroup:s,compact:t,onlyCurrentHost:r,playArrow:e,viewMode:i,viewCategory:a})};async getData(t){try{const e=this.props.socket.getAdapters(t),s=this.getStates(),[r,i]=await Promise.all([s,e]);this.adapters=i||[],this.states=r||{}}catch(e){console.log(e)}this.states&&(this.subscribed||(this.subscribed=!0,this.subscribeStates()))}onStateChange=(t,e)=>{const s=this.states[t];this.states[t]=e,(!s&&e||s&&!e||s&&e&&s.val!==e.val)&&(this.state.dialog==="config"&&this.state.dialogProp?(this.statesUpdateTimer&&(clearTimeout(this.statesUpdateTimer),this.statesUpdateTimer=null),this.shouldUpdateAfterDialogClosed=!0):this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this._cacheList=null,this.forceUpdate()},1e3)))};subscribeStates(t){const e=t?this.props.socket.unsubscribeState:this.props.socket.subscribeState;e.call(this.props.socket,"system.adapter.*.alive",this.onStateChange),e.call(this.props.socket,"system.adapter.*.connected",this.onStateChange),e.call(this.props.socket,"system.adapter.*.inputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.memRss",this.onStateChange),e.call(this.props.socket,"system.adapter.*.outputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.logLevel",this.onStateChange),e.call(this.props.socket,"system.adapter.*.plugins.sentry.enabled",this.onStateChange),e.call(this.props.socket,"system.host.*.diskFree",this.onStateChange),e.call(this.props.socket,"system.host.*.diskSize",this.onStateChange),e.call(this.props.socket,"system.host.*.diskWarning",this.onStateChange),e.call(this.props.socket,"system.host.*.freemem",this.onStateChange),e.call(this.props.socket,"*.info.connection",this.onStateChange),e.call(this.props.socket,"*.info.extension",this.onStateChange)}getInstanceStatus=t=>{const e=t?t.common:null,s=(e==null?void 0:e.mode)||"";let r=s==="daemon"?"green":"blue";if(e!=null&&e.enabled&&(!e.webExtension||!t.native.webInstance||s==="daemon")){const i=this.states[`${t._id}.alive`],a=this.states[`${t._id}.connected`],l=this.states[`${t._id.replace("system.adapter.","")}.info.connection`];if(e.webExtension&&t.native.webInstance){const u=this.states[`${t._id.replace("system.adapter.","")}.info.extension`];if(u)return u.val?"green":"red"}(!(a!=null&&a.val)||!(i!=null&&i.val))&&(r=s==="daemon"?"red":"orangeDevice"),l&&!(l!=null&&l.val)&&r!=="red"&&(r="orange")}else r=s==="daemon"?"grey":"blue";return r};isCompactGroupCheck(t){var s;const e=this.adapters.find(({_id:r})=>r===`system.adapter.${t}`);return((s=e==null?void 0:e.common)==null?void 0:s.compact)||!1}getName(t){return t!=null&&t.common?t.common.titleLang?at.getText(t.common.titleLang,this.props.lang):at.getText(t.common.title,this.props.lang):""}getInputOutput(t){const e=this.states[`${t}.inputCount`],s=this.states[`${t}.outputCount`];return{stateInput:e!=null&&e.val?e.val:0,stateOutput:s!=null&&s.val?s.val:0}}isAlive(t){const e=this.states[`${t}.alive`];return!!(e!=null&&e.val)}isConnectedToHost(t){const e=this.states[`${t}.connected`];return!!(e!=null&&e.val)}isConnected(t){const e=this.state.instances[t];return this.states[`${e.id}.info.connection`]?this.states[`${e.id}.info.connection`].val:null}static getStatusFilter(t){switch(t){case"not_alive":return"red";case"alive_no_device":return"orangeDevice";case"alive_not_connected":return"orange";case"ok":return"green";case"disabled":default:return"grey"}}static getLogLevelIcon(t){return t==="debug"?o.jsx(v.BugReport,{}):t==="info"?o.jsx(v.Info,{}):t==="warn"?o.jsx(v.Warning,{}):t==="error"?o.jsx(v.Error,{}):null}onDeleteInstance=(t,e,s)=>{this.setState({deleting:t.id},()=>this.props.executeCommand(`del ${s?t.id.split(".")[0]:t.id}${e?" --custom":""}${this.props.expertMode?" --debug":""}`))};isSentry(t){var e;return!!((e=this.states[`${t}.plugins.sentry.enabled`])!=null&&e.val)}cacheInstances(){const t=this.state.currentHost.replace(/^system.host./,"");if(this._cacheList=Object.keys(this.state.instances).map(e=>{var V,kt,ft;const s=this.state.instances[e],r=_.isRunning(s.obj),i=_.isCompactGroup(s.obj),a=this.isCompactGroupCheck(s.adapter)&&this.state.compact,l=_.isCompact(s.obj),u=s.compact||!1,h=this.isAlive(e),m=this.isConnectedToHost(e),c=this.isConnected(e),f=this.getName(s.obj),p=((V=this.states[`${e}.logLevel`])==null?void 0:V.val)||s.loglevel,x=s.loglevel,A=((ft=(kt=s==null?void 0:s.obj)==null?void 0:kt.common)==null?void 0:ft.tier)||3,D=vt.getLogLevelIcon(p),E=this.getInputOutput(e),j=_.isModeSchedule(s.obj),K=_.getMemoryLimitMB(s.obj),Q=_.getSentrySettings(s.obj),tt=this.isSentry(e);return{id:e,running:r,host:s.host,nameId:s.id,compactGroup:i,checkCompact:a,mode:s.mode,sentry:tt,category:s.obj.common.type||"other",status:this.getInstanceStatus(s.obj),alive:h,compact:l,supportCompact:u,connectedToHost:m,connected:c,name:f,logLevel:p,logLevelObject:x,tier:A,loglevelIcon:D,inputOutput:E,modeSchedule:j,checkSentry:Q,memoryLimitMB:K,stoppedWhenWebExtension:s.stoppedWhenWebExtension,allowInstanceSettings:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceSettings:!0,allowInstanceDelete:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceDelete:!0,allowInstanceLink:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceLink:!0}}),this.state.playArrow&&(this._cacheList=this._cacheList.filter(({running:e})=>this.state.playArrow===1?e:!e)),this.state.onlyCurrentHost&&(this._cacheList=this._cacheList.filter(({host:e})=>e===t)),this.state.filterText){const e=this.state.filterText.toLowerCase();this._cacheList=this._cacheList.filter(({name:s,nameId:r})=>s.toLowerCase().includes(e)||r.toLowerCase().includes(e))}if(this.props.expertMode&&(this.state.filterCompactGroup||this.state.filterCompactGroup===0)&&this.state.compact&&(this._cacheList=this._cacheList.filter(({compactGroup:e})=>e===this.state.filterCompactGroup||this.state.filterCompactGroup==="All"||this.state.filterCompactGroup==="default"&&(e===null||e===1)||this.state.filterCompactGroup==="controller"&&e==="0")),this.state.filterMode&&(this._cacheList=this._cacheList.filter(e=>e.mode===this.state.filterMode)),this.state.filterStatus){const e=vt.getStatusFilter(this.state.filterStatus);this._cacheList=this._cacheList.filter(s=>e===s.status)}return this._cacheList}clearAllFilters(){const t={playArrow:0,onlyCurrentHost:!1,filterCompactGroup:"All",filterMode:null,filterStatus:null,filterText:""};this.localStorage.removeItem("instances.filter"),this.localStorage.removeItem("Instances.playArrow"),this.localStorage.removeItem("Instances.onlyCurrentHost"),this.localStorage.removeItem("Instances.filterCompactGroup"),this.localStorage.removeItem("Instances.filterMode"),this.localStorage.removeItem("Instances.filterStatus"),this._cacheList=null,this.setState(t,()=>{this.inputRef.current&&(this.inputRef.current.value=""),this.cacheInstances()})}onMaxCompactGroupNumber=t=>this.setState({maxCompactGroupNumber:t});onRegisterClose=(t,e)=>{this.closeCommands[t]=e};saveScrollPosition=()=>{var t,e;vt.lastScrollPosition=(e=(t=this.refTabContent.current)==null?void 0:t.parentNode)==null?void 0:e.scrollTop};getPanels(){this._cacheList||this.cacheInstances();const t={adminInstance:this.props.adminInstance,onDeleteInstance:this.onDeleteInstance,expertMode:this.props.expertMode,hosts:this.props.hosts,socket:this.props.socket,t:this.t,lang:this.props.lang,themeType:this.props.themeType,setMaxCompactGroupNumber:this.onMaxCompactGroupNumber,maxCompactGroupNumber:this.state.maxCompactGroupNumber,deleteCustomSupported:this.state.deleteCustomSupported,states:this.states,onToggleExpanded:this.onToggleExpanded,getInstanceStatus:this.getInstanceStatus,theme:this.props.theme,onRegisterClose:this.onRegisterClose},e=this._cacheList.map((s,r)=>{const i=s.id,a=this.state.instances[i];return this.state.viewMode?{category:s.category,render:o.jsx(ua,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===a.id,id:i,idx:r,instance:a,item:s,context:t},a.id)}:{category:s.category,render:o.jsx(da,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===a.id,id:i,idx:r,instance:a,item:s,context:t},a.id)}});if(!e.length)return o.jsx("div",{title:this.t("Click to clear all filters"),onClick:()=>this.clearAllFilters(),style:{margin:20,fontSize:26,textAlign:"center",cursor:"pointer"},children:this.t("all items are filtered out")});if(!this.state.viewMode&&this.state.viewCategory){const s=[];return e.forEach(({category:r})=>!s.includes(r)&&s.push(r)),s.sort((r,i)=>r==="general"&&i!=="general"?-1:r!=="general"&&i==="general"||r>i?1:r<i?-1:0),s.map(r=>o.jsx(ga,{name:r,expanded:this.state.expandedFolder.includes(r),onExpand:i=>{const a=[...this.state.expandedFolder],l=a.indexOf(r);i?l===-1&&(a.push(r),a.sort()):l!==-1&&a.splice(l,1),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(a)),this.setState({expandedFolder:a})},children:e.filter(({category:i})=>i===r).map(({render:i})=>i)},r))}return e.map(({render:s})=>s)}onToggleExpanded=(t,e)=>{this.expanded!==t&&e&&this.closeCommands[this.expanded]&&this.closeCommands[this.expanded](),this.expanded=e?t:null};async getHostsData(){this.props.socket.getHostInfo(this.state.currentHost,!1,1e4).catch(i=>(i.toString().includes("May not read")||window.alert(`Cannot read host information: ${i}`),{})).then(i=>{this._cacheList=null,this.setState({hostInfo:i})});let t;const e=await this.props.socket.getState(`${this.state.currentHost}.memAvailable`),s=await this.props.socket.getState(`${this.state.currentHost}.freemem`),r=await this.props.socket.getObject(`${this.state.currentHost}`);if(e?t=e:s&&(t=s),t){const i=((r==null?void 0:r.native.hardware.totalmem)||0)/1048576,a=Math.round(t.val/i*100);this._cacheList=null,this.setState({percent:a,memFree:t.val})}}changeStartedStopped=()=>{this._cacheList=null,this.setState(t=>{const e=t.playArrow?t.playArrow===1?2:0:1;return this.localStorage.setItem("Instances.playArrow",JSON.stringify(e)),{playArrow:e}})};changeCompactGroup(t){this._cacheList=null,this.localStorage.setItem("Instances.filterCompactGroup",JSON.stringify(t)),this.setState({filterCompactGroup:t})}handleFilterChange(t){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(e=>{this.typingTimer=null,this._cacheList=null,this.setState({filterText:e}),this.localStorage.setItem("instances.filter",e)},300,t.target.value)}renderFilterDialog(){return this.state.showFilterDialog?o.jsx(fa,{filterMode:this.state.filterMode,filterStatus:this.state.filterStatus,onClose:t=>{t&&(this._cacheList=null,this.localStorage.setItem("Instances.filterMode",t.filterMode),this.localStorage.setItem("Instances.filterStatus",t.filterStatus),this.setState(t)),this.setState({showFilterDialog:!1})}}):null}render(){if(!this.state.instances)return o.jsx(d.LinearProgress,{});if(this.props.currentHost!==this.state.currentHost&&(this.hostsTimer=this.hostsTimer||setTimeout(()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost},()=>this.updateData())},200)),this.state.dialog==="config"&&this.state.dialogProp){const e=this.state.instances[this.state.dialogProp]||null;if(e)return o.jsxs(d.Paper,{style:B.paper,children:[this.renderFilterDialog(),o.jsx(cr,{expertMode:this.props.expertMode,adapter:e.id.split(".")[0],adminInstance:this.props.adminInstance,style:B.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:e.image,instance:parseInt(e.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:e.jsonConfig,lang:this.props.lang,materialize:e.materialize,socket:this.props.socket,t:this.t,theme:this.props.theme,themeName:this.props.themeName,themeType:this.props.themeType,width:this.props.width,version:e.version,onRegisterIframeRef:s=>this.props.onRegisterIframeRef(s),onUnregisterIframeRef:s=>this.props.onUnregisterIframeRef(s),handleNavigation:this.props.handleNavigation})]})}else vt.lastScrollPosition&&(setTimeout(e=>{var s,r;(s=this.refTabContent.current)!=null&&s.parentNode&&(((r=this.refTabContent.current)==null?void 0:r.parentNode).scrollTop=e)},200,vt.lastScrollPosition),vt.lastScrollPosition=0);this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this.forceUpdate()},300)));const t=this.state.hostInfo?`${this.state.hostInfo["Disk free"]?`${this.t("Disk free")}: ${Math.round(this.state.hostInfo["Disk free"]/(this.state.hostInfo["Disk size"]/100))}%, `:""}${this.t("Total RAM usage")}: ${this.state.mem} Mb / ${this.t("Free")}: ${this.state.percent}% = ${this.state.memFree} Mb [${this.t("Host")}: ${this.props.currentHostName} - ${this.state.processes} ${this.state.processes===1?this.t("process"):this.t("processes")}]`:null;return o.jsxs(ir,{children:[this.renderFilterDialog(),o.jsxs(or,{children:[o.jsx(d.Tooltip,{title:this.t("Show / hide List"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({viewMode:!this.state.viewMode}),this.localStorage.setItem("Instances.viewMode",this.state.viewMode?"false":"true")},children:this.state.viewMode?o.jsx(v.ViewModule,{}):o.jsx(v.ViewList,{})})}),!this.state.viewMode&&o.jsx(d.Tooltip,{title:this.t("Category"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({viewCategory:!this.state.viewCategory}),this.localStorage.setItem("Instances.viewCategory",this.state.viewCategory?"false":"true")},children:o.jsx(v.List,{color:this.state.viewCategory?"primary":"inherit"})})}),!this.state.viewMode&&this.state.viewCategory&&o.jsxs(o.Fragment,{children:[o.jsx(d.Tooltip,{title:this.t("expand all"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>{const e=[];this._cacheList.forEach(({category:s})=>!e.includes(s)&&e.push(s)),e.sort(),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(e)),this.setState({expandedFolder:e})},children:o.jsx(v.FolderOpen,{})})}),o.jsx(d.Tooltip,{title:this.t("collapse all"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>{this.localStorage.removeItem("Instances.expandedFolder"),this.setState({expandedFolder:[]})},children:o.jsx(v.Folder,{})})})]}),o.jsx(d.Tooltip,{title:this.t("Reload"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>this.getData(!0),children:o.jsx(v.Refresh,{})})}),this.props.hosts.length>1?o.jsx(d.Tooltip,{title:this.t("Show instances only for current host"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({onlyCurrentHost:!this.state.onlyCurrentHost}),this.localStorage.setItem("Instances.onlyCurrentHost",this.state.onlyCurrentHost?"false":"true")},children:o.jsx(v.Devices,{color:this.state.onlyCurrentHost?"primary":"inherit"})})}):null,o.jsx(d.Tooltip,{title:this.t(this.state.playArrow?this.state.playArrow===1?"Showed only running instances":"Showed only stopped instances":"Show running or stopped instances"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>this.changeStartedStopped(),children:o.jsx(v.PlayArrow,{style:this.state.playArrow===2?{color:"red"}:null,color:this.state.playArrow===1?"primary":"inherit"})})}),o.jsx(d.Tooltip,{title:this.t("Filter instances"),slotProps:{popper:{sx:B.tooltip}},children:o.jsx(d.IconButton,{size:"large",onClick:()=>this.setState({showFilterDialog:!0}),sx:this.state.filterMode||this.state.filterStatus?B.filterActive:void 0,children:o.jsx(lr,{style:{width:16,height:16}})})}),this.props.expertMode&&this.state.compact?o.jsx(hr,{title:this.t("Filter specific compact group"),t:this.t,arrayItem:[{name:"All"},{name:"controller"},{name:"default"},...Array(this.state.maxCompactGroupNumber-1).fill(0).map((e,s)=>({name:s+2}))],buttonIcon:o.jsx(v.ViewCompact,{style:{marginRight:4},color:"primary"}),onClick:e=>this.changeCompactGroup(e),value:this.state.filterCompactGroup}):null,o.jsx("div",{style:B.grow}),o.jsx(d.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter"),sx:{margin:{xs:"0 0 2px 16px",md:"5px 0 5px 0"}},defaultValue:this.state.filterText,onChange:e=>this.handleFilterChange(e),slotProps:{input:{endAdornment:this.state.filterText?o.jsx(d.InputAdornment,{position:"end",children:o.jsx(d.IconButton,{size:"small",onClick:()=>{this.inputRef.current.value="",this._cacheList=null,this.setState({filterText:""}),this.localStorage.setItem("instances.filter","")},children:o.jsx(v.Close,{})})}):null}}}),o.jsx("div",{style:B.grow}),o.jsx(d.Box,{component:"span",sx:{display:{xs:"none",sm:"inline-block"}},children:t})]}),o.jsx(ar,{overflow:"auto",children:o.jsx("div",{ref:this.refTabContent,style:this.state.viewMode?B.cards:void 0,children:this.getPanels()})})]})}}const Aa=nr()(vt);export{Aa as default};