tempest.games 0.1.34 → 0.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +1,76 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var P3=Object.create;var{getPrototypeOf:s3,defineProperty:va,getOwnPropertyNames:r3}=Object;var t3=Object.prototype.hasOwnProperty;var $a=(n,i,o)=>{o=n!=null?P3(s3(n)):{};let c=i||!n||!n.__esModule?va(o,"default",{value:n,enumerable:!0}):o;for(let p of r3(n))if(!t3.call(c,p))va(c,p,{get:()=>n[p],enumerable:!0});return c};var C=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var g3=(n,i)=>{for(var o in i)va(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Sn=import.meta.require;var pJ=C((cJ)=>{Object.defineProperty(cJ,"__esModule",{value:!0});class to extends Error{}class e1 extends to{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class nw extends to{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class iw extends to{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Mc extends to{}class qa extends to{constructor(n){super(`Invalid unit ${n}`)}}class wi extends to{}class Vo extends to{constructor(){super("Zone is an abstract class")}}var j="numeric",mo="short",Li="long",Om={year:j,month:j,day:j},ow={year:j,month:mo,day:j},x7={year:j,month:mo,day:j,weekday:mo},cw={year:j,month:Li,day:j},pw={year:j,month:Li,day:j,weekday:Li},xw={hour:j,minute:j},mw={hour:j,minute:j,second:j},fw={hour:j,minute:j,second:j,timeZoneName:mo},aw={hour:j,minute:j,second:j,timeZoneName:Li},vw={hour:j,minute:j,hourCycle:"h23"},$w={hour:j,minute:j,second:j,hourCycle:"h23"},ww={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:mo},Jw={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:Li},Aw={year:j,month:j,day:j,hour:j,minute:j},Tw={year:j,month:j,day:j,hour:j,minute:j,second:j},Fw={year:j,month:mo,day:j,hour:j,minute:j},Rw={year:j,month:mo,day:j,hour:j,minute:j,second:j},m7={year:j,month:mo,day:j,weekday:mo,hour:j,minute:j},Xw={year:j,month:Li,day:j,hour:j,minute:j,timeZoneName:mo},Ww={year:j,month:Li,day:j,hour:j,minute:j,second:j,timeZoneName:mo},Kw={year:j,month:Li,day:j,weekday:Li,hour:j,minute:j,timeZoneName:Li},Sw={year:j,month:Li,day:j,weekday:Li,hour:j,minute:j,second:j,timeZoneName:Li};class Qc{get type(){throw new Vo}get name(){throw new Vo}get ianaName(){return this.name}get isUniversal(){throw new Vo}offsetName(n,i){throw new Vo}formatOffset(n,i){throw new Vo}offset(n){throw new Vo}equals(n){throw new Vo}get isValid(){throw new Vo}}var _a=null;class Wx extends Qc{static get instance(){if(_a===null)_a=new Wx;return _a}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return _w(n,i,o)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Mm={};function f7(n){if(!Mm[n])Mm[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"});return Mm[n]}var a7={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function v7(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,f,a,v,$]=c;return[m,p,x,f,a,v,$]}function $7(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],f=a7[x];if(x==="era")c[f]=m;else if(!nn(f))c[f]=parseInt(m,10)}return c}var Sm={};class Go extends Qc{static create(n){if(!Sm[n])Sm[n]=new Go(n);return Sm[n]}static resetCache(){Sm={},Mm={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=Go.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return _w(n,i,o,this.name)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=f7(this.name),[c,p,x,m,f,a,v]=o.formatToParts?$7(o,i):v7(o,i);if(m==="BC")c=-Math.abs(c)+1;let w=bm({year:c,month:p,day:x,hour:f===24?0:f,minute:a,second:v,millisecond:0}),J=+i,X=J%1000;return J-=X>=0?X:1000+X,(w-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var l1={};function w7(n,i={}){let o=JSON.stringify([n,i]),c=l1[o];if(!c)c=new Intl.ListFormat(n,i),l1[o]=c;return c}var Ca={};function ua(n,i={}){let o=JSON.stringify([n,i]),c=Ca[o];if(!c)c=new Intl.DateTimeFormat(n,i),Ca[o]=c;return c}var Ia={};function J7(n,i={}){let o=JSON.stringify([n,i]),c=Ia[o];if(!c)c=new Intl.NumberFormat(n,i),Ia[o]=c;return c}var ya={};function A7(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=ya[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),ya[p]=x;return x}var Tx=null;function T7(){if(Tx)return Tx;else return Tx=new Intl.DateTimeFormat().resolvedOptions().locale,Tx}var H1={};function F7(n){let i=H1[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,H1[n]=i}return i}function R7(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=ua(n).resolvedOptions(),p=n}catch(f){let a=n.substring(0,o);c=ua(a).resolvedOptions(),p=a}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function X7(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function W7(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function K7(n){let i=[];for(let o=1;o<=7;o++){let c=e.utc(2016,11,13+o);i.push(n(c))}return i}function Gm(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function S7(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Gw{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=J7(n,m)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):da(n,3);return rn(i,this.padTo)}}}class Yw{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let x=-1*(n.offset/60),m=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Go.create(m).valid)c=m,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=ua(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class lw{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&Uw())this.rtf=A7(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return I7(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var G7={firstDay:1,minimalDays:4,weekend:[6,7]};class Yn{static fromOpts(n){return Yn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Nn.defaultLocale,m=x||(p?"en-US":T7()),f=i||Nn.defaultNumberingSystem,a=o||Nn.defaultOutputCalendar,v=ka(c)||Nn.defaultWeekSettings;return new Yn(m,f,a,v,x)}static resetCache(){Tx=null,Ca={},Ia={},ya={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Yn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,f]=R7(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||f||null,this.weekSettings=c,this.intl=X7(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=S7(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return Yn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,ka(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Gm(this,n,jw,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=W7((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Gm(this,n,Nw,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=K7((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Gm(this,void 0,()=>hw,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[e.utc(2016,11,13,9),e.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Gm(this,n,Cw,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[e.utc(-40,1,1),e.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),x=p.find((m)=>m.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new Gw(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new Yw(n,this.intl,i)}relFormatter(n={}){return new lw(this.intl,this.isEnglish(),n)}listFormatter(n={}){return w7(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!Vw())return G7;else return F7(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}var Ba=null;class Si extends Qc{static get utcInstance(){if(Ba===null)Ba=new Si(0);return Ba}static instance(n){return n===0?Si.utcInstance:new Si(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Si(jm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Rx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Rx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Rx(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class Pa extends Qc{constructor(n){super();this.zoneName=n}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 so(n,i){if(nn(n)||n===null)return i;else if(n instanceof Qc)return n;else if(Q7(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Wx.instance;else if(o==="utc"||o==="gmt")return Si.utcInstance;else return Si.parseSpecifier(o)||Go.create(n)}else if(ro(n))return Si.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new Pa(n)}var sa={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},M1={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]},Y7=sa.hanidec.replace(/[\[|\]]/g,"").split("");function l7(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(sa.hanidec)!==-1)i+=Y7.indexOf(n[o]);else for(let p in M1){let[x,m]=M1[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var fp={};function H7(){fp={}}function po({numberingSystem:n},i=""){let o=n||"latn";if(!fp[o])fp[o]={};if(!fp[o][i])fp[o][i]=new RegExp(`${sa[o]}${i}`);return fp[o][i]}var z1=()=>Date.now(),Q1="system",E1=null,O1=null,U1=null,V1=60,_1,B1=null;class Nn{static get now(){return z1}static set now(n){z1=n}static set defaultZone(n){Q1=n}static get defaultZone(){return so(Q1,Wx.instance)}static get defaultLocale(){return E1}static set defaultLocale(n){E1=n}static get defaultNumberingSystem(){return O1}static set defaultNumberingSystem(n){O1=n}static get defaultOutputCalendar(){return U1}static set defaultOutputCalendar(n){U1=n}static get defaultWeekSettings(){return B1}static set defaultWeekSettings(n){B1=ka(n)}static get twoDigitCutoffYear(){return V1}static set twoDigitCutoffYear(n){V1=n%100}static get throwOnInvalid(){return _1}static set throwOnInvalid(n){_1=n}static resetCaches(){Yn.resetCache(),Go.resetCache(),e.resetCache(),H7()}}class Pi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var Hw=[0,31,59,90,120,151,181,212,243,273,304,334],Mw=[0,31,60,91,121,152,182,213,244,274,305,335];function si(n,i){return new Pi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function ra(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function zw(n,i,o){return o+(Kx(n)?Mw:Hw)[i-1]}function Qw(n,i){let o=Kx(n)?Mw:Hw,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function ta(n,i){return(n-i+7)%7+1}function Um(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=zw(c,p,x),f=ta(ra(c,p,x),o),a=Math.floor((m-f+14-i)/7),v;if(a<1)v=c-1,a=Xx(v,i,o);else if(a>Xx(c,i,o))v=c+1,a=1;else v=c;return{weekYear:v,weekNumber:a,weekday:f,...Lm(n)}}function b1(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=ta(ra(c,1,i),o),f=vp(c),a=p*7+x-m-7+i,v;if(a<1)v=c-1,a+=vp(v);else if(a>f)v=c+1,a-=vp(c);else v=c;let{month:$,day:w}=Qw(v,a);return{year:v,month:$,day:w,...Lm(n)}}function ba(n){let{year:i,month:o,day:c}=n,p=zw(i,o,c);return{year:i,ordinal:p,...Lm(n)}}function j1(n){let{year:i,ordinal:o}=n,{month:c,day:p}=Qw(i,o);return{year:i,month:c,day:p,...Lm(n)}}function L1(n,i){if(!nn(n.localWeekday)||!nn(n.localWeekNumber)||!nn(n.localWeekYear)){if(!nn(n.weekday)||!nn(n.weekNumber)||!nn(n.weekYear))throw new Mc("Cannot mix locale-based week fields with ISO-based week fields");if(!nn(n.localWeekday))n.weekday=n.localWeekday;if(!nn(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!nn(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function M7(n,i=4,o=1){let c=Bm(n.weekYear),p=ri(n.weekNumber,1,Xx(n.weekYear,i,o)),x=ri(n.weekday,1,7);if(!c)return si("weekYear",n.weekYear);else if(!p)return si("week",n.weekNumber);else if(!x)return si("weekday",n.weekday);else return!1}function z7(n){let i=Bm(n.year),o=ri(n.ordinal,1,vp(n.year));if(!i)return si("year",n.year);else if(!o)return si("ordinal",n.ordinal);else return!1}function Ew(n){let i=Bm(n.year),o=ri(n.month,1,12),c=ri(n.day,1,Vm(n.year,n.month));if(!i)return si("year",n.year);else if(!o)return si("month",n.month);else if(!c)return si("day",n.day);else return!1}function Ow(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=ri(i,0,23)||i===24&&o===0&&c===0&&p===0,m=ri(o,0,59),f=ri(c,0,59),a=ri(p,0,999);if(!x)return si("hour",i);else if(!m)return si("minute",o);else if(!f)return si("second",c);else if(!a)return si("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function ro(n){return typeof n==="number"}function Bm(n){return typeof n==="number"&&n%1===0}function Q7(n){return typeof n==="string"}function E7(n){return Object.prototype.toString.call(n)==="[object Date]"}function Uw(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function Vw(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function O7(n){return Array.isArray(n)?n:[n]}function D1(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function U7(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function wp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function ka(n){if(n==null)return null;else if(typeof n!=="object")throw new wi("Week settings must be an object");else{if(!ri(n.firstDay,1,7)||!ri(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!ri(i,1,7)))throw new wi("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function ri(n,i,o){return Bm(n)&&n>=i&&n<=o}function V7(n,i){return n-i*Math.floor(n/i)}function rn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function Po(n){if(nn(n)||n===null||n==="")return;else return parseInt(n,10)}function lc(n){if(nn(n)||n===null||n==="")return;else return parseFloat(n)}function ga(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function da(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Kx(n){return n%4===0&&(n%100!==0||n%400===0)}function vp(n){return Kx(n)?366:365}function Vm(n,i){let o=V7(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Kx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function bm(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function N1(n,i,o){return-ta(ra(n,1,i),o)+i-1}function Xx(n,i=4,o=1){let c=N1(n,i,o),p=N1(n+1,i,o);return(vp(n)-c+p)/7}function Za(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function _w(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let m={timeZoneName:i,...x},f=new Intl.DateTimeFormat(o,m).formatToParts(p).find((a)=>a.type.toLowerCase()==="timezonename");return f?f.value:null}function jm(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function Bw(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new wi(`Invalid unit value ${n}`);return i}function _m(n,i){let o={};for(let c in n)if(wp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=Bw(p)}return o}function Rx(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${rn(o,2)}:${rn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${rn(o,2)}${rn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Lm(n){return U7(n,["hour","minute","second","millisecond"])}var _7=["January","February","March","April","May","June","July","August","September","October","November","December"],bw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B7=["J","F","M","A","M","J","J","A","S","O","N","D"];function jw(n){switch(n){case"narrow":return[...B7];case"short":return[...bw];case"long":return[..._7];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}}var Lw=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dw=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],b7=["M","T","W","T","F","S","S"];function Nw(n){switch(n){case"narrow":return[...b7];case"short":return[...Dw];case"long":return[...Lw];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var hw=["AM","PM"],j7=["Before Christ","Anno Domini"],L7=["BC","AD"],D7=["B","A"];function Cw(n){switch(n){case"narrow":return[...D7];case"short":return[...L7];case"long":return[...j7];default:return null}}function N7(n){return hw[n.hour<12?0:1]}function h7(n,i){return Nw(i)[n.weekday-1]}function C7(n,i){return jw(i)[n.month-1]}function u7(n,i){return Cw(i)[n.year<0?0:1]}function I7(n,i,o="always",c=!1){let p={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."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){let w=n==="days";switch(i){case 1:return w?"tomorrow":`next ${p[n][0]}`;case-1:return w?"yesterday":`last ${p[n][0]}`;case 0:return w?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,f=Math.abs(i),a=f===1,v=p[n],$=c?a?v[1]:v[2]||v[1]:a?p[n][0]:n;return m?`${f} ${$} ago`:`in ${f} ${$}`}function h1(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var y7={D:Om,DD:ow,DDD:cw,DDDD:pw,t:xw,tt:mw,ttt:fw,tttt:aw,T:vw,TT:$w,TTT:ww,TTTT:Jw,f:Aw,ff:Fw,fff:Xw,ffff:Kw,F:Tw,FF:Rw,FFF:Ww,FFFF:Sw};class Ki{static create(n,i={}){return new Ki(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let m=n.charAt(x);if(m==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=m;else if(m===i)o+=m;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=m,i=m}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return y7[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return rn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(J,X)=>this.loc.extract(n,J,X),x=(J)=>{if(n.isOffsetFixed&&n.offset===0&&J.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,J.format):""},m=()=>o?N7(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(J,X)=>o?C7(n,J):p(X?{month:J}:{month:J,day:"numeric"},"month"),a=(J,X)=>o?h7(n,J):p(X?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),v=(J)=>{let X=Ki.macroTokenToFormatOpts(J);if(X)return this.formatWithSystemDefault(n,X);else return J},$=(J)=>o?u7(n,J):p({era:J},"era"),w=(J)=>{switch(J){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return m();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return a("short",!0);case"cccc":return a("long",!0);case"ccccc":return a("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return a("short",!1);case"EEEE":return a("long",!1);case"EEEEE":return a("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return $("short");case"GG":return $("long");case"GGGGG":return $("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return v(J)}};return h1(Ki.parseFormat(i),w)}formatDurationFromString(n,i){let o=(f)=>{switch(f[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}},c=(f)=>(a)=>{let v=o(a);if(v)return this.num(f.get(v),a.length);else return a},p=Ki.parseFormat(i),x=p.reduce((f,{literal:a,val:v})=>a?f:f.concat(v),[]),m=n.shiftTo(...x.map(o).filter((f)=>f));return h1(p,c(m))}}var uw=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Jp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function Ap(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[m,f,a]=x(i,p);return[{...o,...m},f||c,a]},[{},null,1]).slice(0,2)}function Tp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function Iw(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=Po(i[o+p]);return[c,null,o+p]}}var yw=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,k7=`(?:${yw.source}?(?:\\[(${uw.source})\\])?)?`,ea=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,kw=RegExp(`${ea.source}${k7}`),nv=RegExp(`(?:T${kw.source})?`),Z7=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,q7=/(\d{4})-?W(\d\d)(?:-?(\d))?/,P7=/(\d{4})-?(\d{3})/,s7=Iw("weekYear","weekNumber","weekDay"),r7=Iw("year","ordinal"),t7=/(\d{4})-(\d\d)-(\d\d)/,Zw=RegExp(`${ea.source} ?(?:${yw.source}|(${uw.source}))?`),g7=RegExp(`(?: ${Zw.source})?`);function $p(n,i,o){let c=n[i];return nn(c)?o:Po(c)}function d7(n,i){return[{year:$p(n,i),month:$p(n,i+1,1),day:$p(n,i+2,1)},null,i+3]}function Fp(n,i){return[{hours:$p(n,i,0),minutes:$p(n,i+1,0),seconds:$p(n,i+2,0),milliseconds:ga(n[i+3])},null,i+4]}function Sx(n,i){let o=!n[i]&&!n[i+1],c=jm(n[i+1],n[i+2]),p=o?null:Si.instance(c);return[{},p,i+3]}function Gx(n,i){let o=n[i]?Go.create(n[i]):null;return[{},o,i+1]}var e7=RegExp(`^T?${ea.source}$`),nX=/^-?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 iX(n){let[i,o,c,p,x,m,f,a,v]=n,$=i[0]==="-",w=a&&a[0]==="-",J=(X,W=!1)=>X!==void 0&&(W||X&&$)?-X:X;return[{years:J(lc(o)),months:J(lc(c)),weeks:J(lc(p)),days:J(lc(x)),hours:J(lc(m)),minutes:J(lc(f)),seconds:J(lc(a),a==="-0"),milliseconds:J(ga(v),w)}]}var oX={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function iv(n,i,o,c,p,x,m){let f={year:i.length===2?Za(Po(i)):Po(i),month:bw.indexOf(o)+1,day:Po(c),hour:Po(p),minute:Po(x)};if(m)f.second=Po(m);if(n)f.weekday=n.length>3?Lw.indexOf(n)+1:Dw.indexOf(n)+1;return f}var cX=/^(?:(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 pX(n){let[,i,o,c,p,x,m,f,a,v,$,w]=n,J=iv(i,p,c,o,x,m,f),X;if(a)X=oX[a];else if(v)X=0;else X=jm($,w);return[J,new Si(X)]}function xX(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var mX=/^(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$/,fX=/^(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$/,aX=/^(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 C1(n){let[,i,o,c,p,x,m,f]=n;return[iv(i,p,c,o,x,m,f),Si.utcInstance]}function vX(n){let[,i,o,c,p,x,m,f]=n;return[iv(i,f,o,c,p,x,m),Si.utcInstance]}var $X=Jp(Z7,nv),wX=Jp(q7,nv),JX=Jp(P7,nv),AX=Jp(kw),qw=Ap(d7,Fp,Sx,Gx),TX=Ap(s7,Fp,Sx,Gx),FX=Ap(r7,Fp,Sx,Gx),RX=Ap(Fp,Sx,Gx);function XX(n){return Tp(n,[$X,qw],[wX,TX],[JX,FX],[AX,RX])}function WX(n){return Tp(xX(n),[cX,pX])}function KX(n){return Tp(n,[mX,C1],[fX,C1],[aX,vX])}function SX(n){return Tp(n,[nX,iX])}var GX=Ap(Fp);function YX(n){return Tp(n,[e7,GX])}var lX=Jp(t7,g7),HX=Jp(Zw),MX=Ap(Fp,Sx,Gx);function zX(n){return Tp(n,[lX,qw],[HX,MX])}var u1="Invalid Duration",Pw={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},QX={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...Pw},qi=365.2425,pp=30.436875,EX={years:{quarters:4,months:12,weeks:qi/7,days:qi,hours:qi*24,minutes:qi*24*60,seconds:qi*24*60*60,milliseconds:qi*24*60*60*1000},quarters:{months:3,weeks:qi/28,days:qi/4,hours:qi*24/4,minutes:qi*24*60/4,seconds:qi*24*60*60/4,milliseconds:qi*24*60*60*1000/4},months:{weeks:pp/7,days:pp,hours:pp*24,minutes:pp*24*60,seconds:pp*24*60*60,milliseconds:pp*24*60*60*1000},...Pw},zc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],OX=zc.slice(0).reverse();function qo(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new An(c)}function sw(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of OX.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function I1(n,i){let o=sw(n,i)<0?-1:1;zc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],f=Math.floor(x/m);i[p]+=f*o,i[c]-=f*m*o}return p}else return c},null),zc.reduce((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*n[c][p]}return p}else return c},null)}function UX(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class An{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?EX:QX;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Yn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return An.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new wi(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new An({values:_m(n,An.normalizeUnit),loc:Yn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(ro(n))return An.fromMillis(n);else if(An.isDuration(n))return n;else if(typeof n==="object")return An.fromObject(n);else throw new wi(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=SX(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=YX(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Duration is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new iw(o);else return new An({invalid:o})}static normalizeUnit(n){let i={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"}[n?n.toLowerCase():n];if(!i)throw new qa(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Ki.create(this.loc,o).formatDurationFromString(this,n):u1}toHuman(n={}){if(!this.isValid)return u1;let i=zc.map((o)=>{let c=this.values[o];if(nn(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=da(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},e.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return sw(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n),o={};for(let c of zc)if(wp(i.values,c)||wp(this.values,c))o[c]=i.get(c)+this.get(c);return qo(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=Bw(n(this.values[o],o));return qo(this,{values:i},!0)}get(n){return this[An.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,..._m(n,An.normalizeUnit)};return qo(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return qo(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return I1(this.matrix,n),qo(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=UX(this.normalize().shiftToAll().toObject());return qo(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>An.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of zc)if(n.indexOf(x)>=0){p=x;let m=0;for(let a in o)m+=this.matrix[a][x]*o[a],o[a]=0;if(ro(c[x]))m+=c[x];let f=Math.trunc(m);i[x]=f,o[x]=(m*1000-f*1000)/1000}else if(ro(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return I1(this.matrix,i),qo(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return qo(this,{values:n},!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(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of zc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var xp="Invalid Interval";function VX(n,i){if(!n||!n.isValid)return Cn.invalid("missing or invalid start");else if(!i||!i.isValid)return Cn.invalid("missing or invalid end");else if(i<n)return Cn.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class Cn{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Interval is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new nw(o);else return new Cn({invalid:o})}static fromDateTimes(n,i){let o=Ax(n),c=Ax(i),p=VX(o,c);if(p==null)return new Cn({start:o,end:c});else return p}static after(n,i){let o=An.fromDurationLike(i),c=Ax(n);return Cn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=An.fromDurationLike(i),c=Ax(n);return Cn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=e.fromISO(o,i),x=p.isValid}catch(a){x=!1}let m,f;try{m=e.fromISO(c,i),f=m.isValid}catch(a){f=!1}if(x&&f)return Cn.fromDateTimes(p,m);if(x){let a=An.fromISO(c,i);if(a.isValid)return Cn.after(p,a)}else if(f){let a=An.fromISO(o,i);if(a.isValid)return Cn.before(m,a)}}return Cn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.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(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return Cn.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(Ax).filter((x)=>this.contains(x)).sort((x,m)=>x.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,m=+x>+this.e?this.e:x;o.push(Cn.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=An.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let m=this.start.plus(i.mapUnits((f)=>f*c));p=+m>+this.e?this.e:m,x.push(Cn.fromDateTimes(o,p)),o=p,c+=1}return x}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return Cn.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return Cn.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((f)=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((f,a)=>f.time-a.time);for(let f of m)if(o+=f.type==="s"?1:-1,o===1)i=f.time;else{if(i&&+i!==+f.time)c.push(Cn.fromDateTimes(i,f.time));i=null}return Cn.merge(c)}difference(...n){return Cn.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return xp;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=Om,i={}){return this.isValid?Ki.create(this.s.loc.clone(i),n).formatInterval(this):xp}toISO(n){if(!this.isValid)return xp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return xp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return xp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return xp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return An.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return Cn.fromDateTimes(n(this.s),n(this.e))}}class ap{static hasDST(n=Nn.defaultZone){let i=e.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return Go.isValidZone(n)}static normalizeZone(n){return so(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Yn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Yn.create(i,null,"gregory").eras(n)}static features(){return{relative:Uw(),localeWeek:Vw()}}}function y1(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(An.fromMillis(c).as("days"))}function _X(n,i,o){let c=[["years",(a,v)=>v.year-a.year],["quarters",(a,v)=>v.quarter-a.quarter+(v.year-a.year)*4],["months",(a,v)=>v.month-a.month+(v.year-a.year)*12],["weeks",(a,v)=>{let $=y1(a,v);return($-$%7)/7}],["days",y1]],p={},x=n,m,f;for(let[a,v]of c)if(o.indexOf(a)>=0)if(m=a,p[a]=v(n,i),f=x.plus(p),f>i){if(p[a]--,n=x.plus(p),n>i)f=n,p[a]--,n=x.plus(p)}else n=f;return[n,p,f,m]}function BX(n,i,o,c){let[p,x,m,f]=_X(n,i,o),a=i-p,v=o.filter((w)=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);if(v.length===0){if(m<i)m=p.plus({[f]:1});if(m!==p)x[f]=(x[f]||0)+a/(m-p)}let $=An.fromObject(x,c);if(v.length>0)return An.fromMillis(a,c).shiftTo(...v).plus($);else return $}var bX="missing Intl.DateTimeFormat.formatToParts support";function Wn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(l7(o))}}var jX=String.fromCharCode(160),rw=`[ ${jX}]`,tw=new RegExp(rw,"g");function LX(n){return n.replace(/\./g,"\\.?").replace(tw,rw)}function k1(n){return n.replace(/\./g,"").replace(tw," ").toLowerCase()}function xo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(LX).join("|")),deser:([o])=>n.findIndex((c)=>k1(o)===k1(c))+i}}function Z1(n,i){return{regex:n,deser:([,o,c])=>jm(o,c),groups:i}}function Ym(n){return{regex:n,deser:([i])=>i}}function DX(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function NX(n,i){let o=po(i),c=po(i,"{2}"),p=po(i,"{3}"),x=po(i,"{4}"),m=po(i,"{6}"),f=po(i,"{1,2}"),a=po(i,"{1,3}"),v=po(i,"{1,6}"),$=po(i,"{1,9}"),w=po(i,"{2,4}"),J=po(i,"{4,6}"),X=(S)=>({regex:RegExp(DX(S.val)),deser:([l])=>l,literal:!0}),R=((S)=>{if(n.literal)return X(S);switch(S.val){case"G":return xo(i.eras("short"),0);case"GG":return xo(i.eras("long"),0);case"y":return Wn(v);case"yy":return Wn(w,Za);case"yyyy":return Wn(x);case"yyyyy":return Wn(J);case"yyyyyy":return Wn(m);case"M":return Wn(f);case"MM":return Wn(c);case"MMM":return xo(i.months("short",!0),1);case"MMMM":return xo(i.months("long",!0),1);case"L":return Wn(f);case"LL":return Wn(c);case"LLL":return xo(i.months("short",!1),1);case"LLLL":return xo(i.months("long",!1),1);case"d":return Wn(f);case"dd":return Wn(c);case"o":return Wn(a);case"ooo":return Wn(p);case"HH":return Wn(c);case"H":return Wn(f);case"hh":return Wn(c);case"h":return Wn(f);case"mm":return Wn(c);case"m":return Wn(f);case"q":return Wn(f);case"qq":return Wn(c);case"s":return Wn(f);case"ss":return Wn(c);case"S":return Wn(a);case"SSS":return Wn(p);case"u":return Ym($);case"uu":return Ym(f);case"uuu":return Wn(o);case"a":return xo(i.meridiems(),0);case"kkkk":return Wn(x);case"kk":return Wn(w,Za);case"W":return Wn(f);case"WW":return Wn(c);case"E":case"c":return Wn(o);case"EEE":return xo(i.weekdays("short",!1),1);case"EEEE":return xo(i.weekdays("long",!1),1);case"ccc":return xo(i.weekdays("short",!0),1);case"cccc":return xo(i.weekdays("long",!0),1);case"Z":case"ZZ":return Z1(new RegExp(`([+-]${f.source})(?::(${c.source}))?`),2);case"ZZZ":return Z1(new RegExp(`([+-]${f.source})(${c.source})?`),2);case"z":return Ym(/[a-z_+-/]{1,256}?/i);case" ":return Ym(/[^\S\n\r]/);default:return X(S)}})(n)||{invalidReason:bX};return R.token=n,R}var hX={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 CX(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let a=/^\s+$/.test(p);return{literal:!a,val:a?" ":p}}let x=i[c],m=c;if(c==="hour")if(i.hour12!=null)m=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")m="hour12";else m="hour24";else m=o.hour12?"hour12":"hour24";let f=hX[m];if(typeof f==="object")f=f[x];if(f)return{literal:!1,val:f};return}function uX(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function IX(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(wp(o,m)){let f=o[m],a=f.groups?f.groups+1:1;if(!f.literal&&f.token)p[f.token.val[0]]=f.deser(c.slice(x,x+a));x+=a}return[c,p]}else return[c,{}]}function yX(n){let i=(x)=>{switch(x){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}},o=null,c;if(!nn(n.z))o=Go.create(n.z);if(!nn(n.Z)){if(!o)o=new Si(n.Z);c=n.Z}if(!nn(n.q))n.M=(n.q-1)*3+1;if(!nn(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!nn(n.u))n.S=ga(n.u);return[Object.keys(n).reduce((x,m)=>{let f=i(m);if(f)x[f]=n[m];return x},{}),o,c]}var ja=null;function kX(){if(!ja)ja=e.fromMillis(1555555555555);return ja}function ZX(n,i){if(n.literal)return n;let o=Ki.macroTokenToFormatOpts(n.val),c=ew(o,i);if(c==null||c.includes(void 0))return n;return c}function gw(n,i){return Array.prototype.concat(...n.map((o)=>ZX(o,i)))}class ov{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=gw(Ki.parseFormat(i),n),this.units=this.tokens.map((o)=>NX(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=uX(this.units);this.regex=RegExp(o,"i"),this.handlers=c}}explainFromTokens(n){if(!this.isValid)return{input:n,tokens:this.tokens,invalidReason:this.invalidReason};else{let[i,o]=IX(n,this.regex,this.handlers),[c,p,x]=o?yX(o):[null,null,void 0];if(wp(o,"a")&&wp(o,"H"))throw new Mc("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:this.tokens,regex:this.regex,rawMatches:i,matches:o,result:c,zone:p,specificOffset:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function dw(n,i,o){return new ov(n,o).explainFromTokens(i)}function qX(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=dw(n,i,o);return[c,p,x,m]}function ew(n,i){if(!n)return null;let c=Ki.create(i,n).dtFormatter(kX()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>CX(m,n,x))}var La="Invalid DateTime",q1=8640000000000000;function Fx(n){return new Pi("unsupported zone",`the zone "${n.name}" is not supported`)}function Da(n){if(n.weekData===null)n.weekData=Um(n.c);return n.weekData}function Na(n){if(n.localWeekData===null)n.localWeekData=Um(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Hc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new e({...o,...i,old:o})}function nJ(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function lm(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function zm(n,i,o){return nJ(bm(n),i,o)}function P1(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,x={...n.c,year:c,month:p,day:Math.min(n.c.day,Vm(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=An.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),f=bm(x),[a,v]=nJ(f,o,n.zone);if(m!==0)a+=m,v=n.zone.offset(a);return{ts:a,o:v}}function mp(n,i,o,c,p,x){let{setZone:m,zone:f}=o;if(n&&Object.keys(n).length!==0||i){let a=i||f,v=e.fromObject(n,{...o,zone:a,specificOffset:x});return m?v:v.setZone(f)}else return e.invalid(new Pi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Hm(n,i,o=!0){return n.isValid?Ki.create(Yn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function ha(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=rn(n.c.year,o?6:4),i)c+="-",c+=rn(n.c.month),c+="-",c+=rn(n.c.day);else c+=rn(n.c.month),c+=rn(n.c.day);return c}function s1(n,i,o,c,p,x){let m=rn(n.c.hour);if(i){if(m+=":",m+=rn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=rn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=rn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=rn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)m+="Z";else if(n.o<0)m+="-",m+=rn(Math.trunc(-n.o/60)),m+=":",m+=rn(Math.trunc(-n.o%60));else m+="+",m+=rn(Math.trunc(n.o/60)),m+=":",m+=rn(Math.trunc(n.o%60));if(x)m+="["+n.zone.ianaName+"]";return m}var iJ={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},PX={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},sX={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oJ=["year","month","day","hour","minute","second","millisecond"],rX=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],tX=["year","ordinal","hour","minute","second","millisecond"];function gX(n){let i={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(!i)throw new qa(n);return i}function r1(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return gX(n)}}function dX(n){if(!Em[n]){if(Qm===void 0)Qm=Nn.now();Em[n]=n.offset(Qm)}return Em[n]}function t1(n,i){let o=so(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p,x;if(!nn(n.year)){for(let a of oJ)if(nn(n[a]))n[a]=iJ[a];let m=Ew(n)||Ow(n);if(m)return e.invalid(m);let f=dX(o);[p,x]=zm(n,f,o)}else p=Nn.now();return new e({ts:p,zone:o,loc:c,o:x})}function g1(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,f)=>{return m=da(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,f)},x=(m)=>{if(o.calendary)if(!i.hasSame(n,m))return i.startOf(m).diff(n.startOf(m),m).get(m);else return 0;else return i.diff(n,m).get(m)};if(o.unit)return p(x(o.unit),o.unit);for(let m of o.units){let f=x(m);if(Math.abs(f)>=1)return p(f,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function d1(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}var Qm,Em={};class e{constructor(n){let i=n.zone||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new Pi("invalid input"):null)||(!i.isValid?Fx(i):null);this.ts=nn(n.ts)?Nn.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let m=ro(n.o)&&!n.old?n.o:i.offset(this.ts);c=lm(this.ts,m),o=Number.isNaN(c.year)?new Pi("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||Yn.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[n,i]=d1(arguments),[o,c,p,x,m,f,a]=i;return t1({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static utc(){let[n,i]=d1(arguments),[o,c,p,x,m,f,a]=i;return n.zone=Si.utcInstance,t1({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static fromJSDate(n,i={}){let o=E7(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=so(i.zone,Nn.defaultZone);if(!c.isValid)return e.invalid(Fx(c));return new e({ts:o,zone:c,loc:Yn.fromObject(i)})}static fromMillis(n,i={}){if(!ro(n))throw new wi(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-q1||n>q1)return e.invalid("Timestamp out of range");else return new e({ts:n,zone:so(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromSeconds(n,i={}){if(!ro(n))throw new wi("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:so(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=so(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p=_m(n,r1),{minDaysInFirstWeek:x,startOfWeek:m}=L1(p,c),f=Nn.now(),a=!nn(i.specificOffset)?i.specificOffset:o.offset(f),v=!nn(p.ordinal),$=!nn(p.year),w=!nn(p.month)||!nn(p.day),J=$||w,X=p.weekYear||p.weekNumber;if((J||v)&&X)throw new Mc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&v)throw new Mc("Can't mix ordinal dates with month/day");let W=X||p.weekday&&!J,R,S,l=lm(f,a);if(W)R=rX,S=PX,l=Um(l,x,m);else if(v)R=tX,S=sX,l=ba(l);else R=oJ,S=iJ;let H=!1;for(let y of R){let M=p[y];if(!nn(M))H=!0;else if(H)p[y]=S[y];else p[y]=l[y]}let I=W?M7(p,x,m):v?z7(p):Ew(p),Y=I||Ow(p);if(Y)return e.invalid(Y);let z=W?b1(p,x,m):v?j1(p):p,[E,Q]=zm(z,a,o),b=new e({ts:E,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==b.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${b.toISO()}`);if(!b.isValid)return e.invalid(b.invalid);return b}static fromISO(n,i={}){let[o,c]=XX(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=WX(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=KX(n);return mp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,f,a,v]=qX(x,n,i);if(v)return e.invalid(v);else return mp(m,f,o,`format ${i}`,n,a)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=zX(n);return mp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the DateTime is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new e1(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=ew(n,Yn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return gw(Ki.parseFormat(n),Yn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Qm=void 0,Em={}}get(n){return this[n]}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?Da(this).weekYear:NaN}get weekNumber(){return this.isValid?Da(this).weekNumber:NaN}get weekday(){return this.isValid?Da(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Na(this).weekday:NaN}get localWeekNumber(){return this.isValid?Na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Na(this).weekYear:NaN}get ordinal(){return this.isValid?ba(this.c).ordinal:NaN}get monthShort(){return this.isValid?ap.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ap.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ap.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ap.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=bm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(x===m)return[this];let f=o-x*i,a=o-m*i,v=lm(f,x),$=lm(a,m);if(v.hour===$.hour&&v.minute===$.minute&&v.second===$.second&&v.millisecond===$.millisecond)return[Hc(this,{ts:f}),Hc(this,{ts:a})];return[this]}get isInLeapYear(){return Kx(this.year)}get daysInMonth(){return Vm(this.year,this.month)}get daysInYear(){return this.isValid?vp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Xx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Xx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Ki.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Si.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=so(n,Nn.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return e.invalid(Fx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=zm(x,p,n)}return Hc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Hc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=_m(n,r1),{minDaysInFirstWeek:o,startOfWeek:c}=L1(i,this.loc),p=!nn(i.weekYear)||!nn(i.weekNumber)||!nn(i.weekday),x=!nn(i.ordinal),m=!nn(i.year),f=!nn(i.month)||!nn(i.day),a=m||f,v=i.weekYear||i.weekNumber;if((a||x)&&v)throw new Mc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&x)throw new Mc("Can't mix ordinal dates with month/day");let $;if(p)$=b1({...Um(this.c,o,c),...i},o,c);else if(!nn(i.ordinal))$=j1({...ba(this.c),...i});else if($={...this.toObject(),...i},nn(i.day))$.day=Math.min(Vm($.year,$.month),$.day);let[w,J]=zm($,this.o,this.zone);return Hc(this,{ts:w,o:J})}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return Hc(this,P1(this,i))}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n).negate();return Hc(this,P1(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=An.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:x}=this;if(x<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Ki.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):La}toLocaleString(n=Om,i={}){return this.isValid?Ki.create(this.loc.clone(i),n).formatDateTime(this):La}toLocaleParts(n={}){return this.isValid?Ki.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let x=n==="extended",m=ha(this,x);return m+="T",m+=s1(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return ha(this,n==="extended")}toISOWeekDate(){return Hm(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+s1(this,x==="extended",i,n,o,p)}toRFC2822(){return Hm(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hm(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return ha(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return Hm(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():La}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return An.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=O7(i).map(An.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,f=x?n:this,a=BX(m,f,p,c);return x?a.negate():a}diffNow(n="milliseconds",i={}){return this.diff(e.now(),n,i)}until(n){return this.isValid?Cn.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||e.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return g1(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return g1(n.base||e.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(e.isDateTime))throw new wi("min requires all arguments be DateTimes");return D1(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new wi("max requires all arguments be DateTimes");return D1(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return dw(x,n,i)}static fromStringExplain(n,i,o={}){return e.fromFormatExplain(n,i,o)}static buildFormatParser(n,i={}){let{locale:o=null,numberingSystem:c=null}=i,p=Yn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new ov(p,n)}static fromFormatParser(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new wi(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:f,specificOffset:a,invalidReason:v}=i.explainFromTokens(n);if(v)return e.invalid(v);else return mp(m,f,o,`format ${i.format}`,n,a)}static get DATE_SHORT(){return Om}static get DATE_MED(){return ow}static get DATE_MED_WITH_WEEKDAY(){return x7}static get DATE_FULL(){return cw}static get DATE_HUGE(){return pw}static get TIME_SIMPLE(){return xw}static get TIME_WITH_SECONDS(){return mw}static get TIME_WITH_SHORT_OFFSET(){return fw}static get TIME_WITH_LONG_OFFSET(){return aw}static get TIME_24_SIMPLE(){return vw}static get TIME_24_WITH_SECONDS(){return $w}static get TIME_24_WITH_SHORT_OFFSET(){return ww}static get TIME_24_WITH_LONG_OFFSET(){return Jw}static get DATETIME_SHORT(){return Aw}static get DATETIME_SHORT_WITH_SECONDS(){return Tw}static get DATETIME_MED(){return Fw}static get DATETIME_MED_WITH_SECONDS(){return Rw}static get DATETIME_MED_WITH_WEEKDAY(){return m7}static get DATETIME_FULL(){return Xw}static get DATETIME_FULL_WITH_SECONDS(){return Ww}static get DATETIME_HUGE(){return Kw}static get DATETIME_HUGE_WITH_SECONDS(){return Sw}}function Ax(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&ro(n.valueOf()))return e.fromJSDate(n);else if(n&&typeof n==="object")return e.fromObject(n);else throw new wi(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var eX="3.5.0";cJ.DateTime=e;cJ.Duration=An;cJ.FixedOffsetZone=Si;cJ.IANAZone=Go;cJ.Info=ap;cJ.Interval=Cn;cJ.InvalidZone=Pa;cJ.Settings=Nn;cJ.SystemZone=Wx;cJ.VERSION=eX;cJ.Zone=Qc});var vJ=C((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});xJ.RE_RANGE=xJ.RE_WILDCARDS=xJ.PRESETS=xJ.TIME_UNITS_LEN=xJ.TIME_UNITS=xJ.TIME_UNITS_MAP=xJ.ALIASES=xJ.PARSE_DEFAULTS=xJ.CONSTRAINTS=void 0;xJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});xJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});xJ.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});xJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});xJ.TIME_UNITS=Object.freeze(Object.values(xJ.TIME_UNITS_MAP));xJ.TIME_UNITS_LEN=xJ.TIME_UNITS.length;xJ.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});xJ.RE_WILDCARDS=/\*/g;xJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var pv=C((wJ)=>{Object.defineProperty(wJ,"__esModule",{value:!0});wJ.ExclusiveParametersError=wJ.CronError=void 0;class cv extends Error{}wJ.CronError=cv;class $J extends cv{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}wJ.ExclusiveParametersError=$J});var Dm=C((AJ)=>{Object.defineProperty(AJ,"__esModule",{value:!0});AJ.CronTime=void 0;var Yo=pJ(),Gi=vJ(),Yi=pv();class xv{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new Yi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Yo.DateTime.fromObject({},{zone:i}).isValid)throw new Yi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof Yo.DateTime)this.source=n instanceof Date?Yo.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}static validateCronExpression(n){try{return new xv(n),{valid:!0}}catch(i){return{valid:!1,error:i}}}_getWeekDay(n){return n.weekday===7?0:n.weekday}sendAt(n){let i=this.realDate&&this.source instanceof Yo.DateTime?this.source:Yo.DateTime.local();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),x=Math.abs(this.utcOffset-c*60),m=String(x).padStart(2,"0"),f=`UTC${o}${p}:${m}`;if(i=i.setZone(f),!i.isValid)throw new Yi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Yo.DateTime.local()>i)throw new Yi.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Yo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return Gi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=Yo.DateTime.fromJSDate(n);let c=n,p=n.toMillis();if(i)c=c.setZone(i);if(!this.realDate){if(c.millisecond>0)c=c.set({millisecond:0,second:c.second+1})}if(!c.isValid)throw new Yi.CronError("ERROR: You specified an invalid date.");let x=Yo.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>x)throw new Yi.CronError(`Something went wrong. No execution date was found in the next 8 years.
3
+ var n3=Object.create;var{getPrototypeOf:i3,defineProperty:$f,getOwnPropertyNames:o3}=Object;var c3=Object.prototype.hasOwnProperty;var wf=(n,i,o)=>{o=n!=null?n3(i3(n)):{};let c=i||!n||!n.__esModule?$f(o,"default",{value:n,enumerable:!0}):o;for(let p of o3(n))if(!c3.call(c,p))$f(c,p,{get:()=>n[p],enumerable:!0});return c};var C=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var p3=(n,i)=>{for(var o in i)$f(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Kn=import.meta.require;var aJ=C((mJ)=>{Object.defineProperty(mJ,"__esModule",{value:!0});class ro extends Error{}class iw extends ro{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class ow extends ro{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class cw extends ro{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Hc extends ro{}class Pf extends ro{constructor(n){super(`Invalid unit ${n}`)}}class wi extends ro{}class Vo extends ro{constructor(){super("Zone is an abstract class")}}var u="numeric",ao="short",ji="long",Um={year:u,month:u,day:u},pw={year:u,month:ao,day:u},J3={year:u,month:ao,day:u,weekday:ao},xw={year:u,month:ji,day:u},mw={year:u,month:ji,day:u,weekday:ji},aw={hour:u,minute:u},fw={hour:u,minute:u,second:u},vw={hour:u,minute:u,second:u,timeZoneName:ao},$w={hour:u,minute:u,second:u,timeZoneName:ji},ww={hour:u,minute:u,hourCycle:"h23"},Jw={hour:u,minute:u,second:u,hourCycle:"h23"},Aw={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:ao},Fw={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:ji},Tw={year:u,month:u,day:u,hour:u,minute:u},Rw={year:u,month:u,day:u,hour:u,minute:u,second:u},Sw={year:u,month:ao,day:u,hour:u,minute:u},Xw={year:u,month:ao,day:u,hour:u,minute:u,second:u},A3={year:u,month:ao,day:u,weekday:ao,hour:u,minute:u},Ww={year:u,month:ji,day:u,hour:u,minute:u,timeZoneName:ao},Kw={year:u,month:ji,day:u,hour:u,minute:u,second:u,timeZoneName:ao},lw={year:u,month:ji,day:u,weekday:ji,hour:u,minute:u,timeZoneName:ji},Gw={year:u,month:ji,day:u,weekday:ji,hour:u,minute:u,second:u,timeZoneName:ji};class Qc{get type(){throw new Vo}get name(){throw new Vo}get ianaName(){return this.name}get isUniversal(){throw new Vo}offsetName(n,i){throw new Vo}formatOffset(n,i){throw new Vo}offset(n){throw new Vo}equals(n){throw new Vo}get isValid(){throw new Vo}}var uf=null;class Wx extends Qc{static get instance(){if(uf===null)uf=new Wx;return uf}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o)}formatOffset(n,i){return Sx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var zm={};function F3(n){if(!zm[n])zm[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"});return zm[n]}var T3={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function R3(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,a,f,v,$]=c;return[m,p,x,a,f,v,$]}function S3(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],a=T3[x];if(x==="era")c[a]=m;else if(!nn(a))c[a]=parseInt(m,10)}return c}var lm={};class Go extends Qc{static create(n){if(!lm[n])lm[n]=new Go(n);return lm[n]}static resetCache(){lm={},zm={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=Go.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o,this.name)}formatOffset(n,i){return Sx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=F3(this.name),[c,p,x,m,a,f,v]=o.formatToParts?S3(o,i):R3(o,i);if(m==="BC")c=-Math.abs(c)+1;let w=Bm({year:c,month:p,day:x,hour:a===24?0:a,minute:f,second:v,millisecond:0}),J=+i,S=J%1000;return J-=S>=0?S:1000+S,(w-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var H1={};function X3(n,i={}){let o=JSON.stringify([n,i]),c=H1[o];if(!c)c=new Intl.ListFormat(n,i),H1[o]=c;return c}var If={};function yf(n,i={}){let o=JSON.stringify([n,i]),c=If[o];if(!c)c=new Intl.DateTimeFormat(n,i),If[o]=c;return c}var kf={};function W3(n,i={}){let o=JSON.stringify([n,i]),c=kf[o];if(!c)c=new Intl.NumberFormat(n,i),kf[o]=c;return c}var Zf={};function K3(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=Zf[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),Zf[p]=x;return x}var Fx=null;function l3(){if(Fx)return Fx;else return Fx=new Intl.DateTimeFormat().resolvedOptions().locale,Fx}var Qm={};function Mw(n){if(!Qm[n])Qm[n]=new Intl.DateTimeFormat(n).resolvedOptions();return Qm[n]}var z1={};function G3(n){let i=z1[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,z1[n]=i}return i}function M3(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=yf(n).resolvedOptions(),p=n}catch(a){let f=n.substring(0,o);c=yf(f).resolvedOptions(),p=f}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function Y3(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function H3(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function z3(n){let i=[];for(let o=1;o<=7;o++){let c=e.utc(2016,11,13+o);i.push(n(c))}return i}function Gm(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function Q3(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||Mw(n.locale).numberingSystem==="latn"}class Yw{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=W3(n,m)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):nv(n,3);return tn(i,this.padTo)}}}class Hw{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let x=-1*(n.offset/60),m=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Go.create(m).valid)c=m,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=yf(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class zw{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&bw())this.rtf=K3(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return t3(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var E3={firstDay:1,minimalDays:4,weekend:[6,7]};class ln{static fromOpts(n){return ln.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Ln.defaultLocale,m=x||(p?"en-US":l3()),a=i||Ln.defaultNumberingSystem,f=o||Ln.defaultOutputCalendar,v=qf(c)||Ln.defaultWeekSettings;return new ln(m,a,f,v,x)}static resetCache(){Fx=null,If={},kf={},Zf={},Qm={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return ln.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,a]=M3(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||a||null,this.weekSettings=c,this.intl=Y3(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=Q3(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return ln.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,qf(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Gm(this,n,Lw,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=H3((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Gm(this,n,Cw,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=z3((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Gm(this,void 0,()=>Iw,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[e.utc(2016,11,13,9),e.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Gm(this,n,yw,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[e.utc(-40,1,1),e.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),x=p.find((m)=>m.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new Yw(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new Hw(n,this.intl,i)}relFormatter(n={}){return new zw(this.intl,this.isEnglish(),n)}listFormatter(n={}){return X3(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Mw(this.intl).locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!uw())return E3;else return G3(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}var Bf=null;class Ki extends Qc{static get utcInstance(){if(Bf===null)Bf=new Ki(0);return Bf}static instance(n){return n===0?Ki.utcInstance:new Ki(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Ki(jm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Sx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Sx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Sx(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class tf extends Qc{constructor(n){super();this.zoneName=n}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 Po(n,i){if(nn(n)||n===null)return i;else if(n instanceof Qc)return n;else if(u3(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Wx.instance;else if(o==="utc"||o==="gmt")return Ki.utcInstance;else return Ki.parseSpecifier(o)||Go.create(n)}else if(to(n))return Ki.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new tf(n)}var rf={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Q1={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]},O3=rf.hanidec.replace(/[\[|\]]/g,"").split("");function U3(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(rf.hanidec)!==-1)i+=O3.indexOf(n[o]);else for(let p in Q1){let[x,m]=Q1[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var ap={};function V3(){ap={}}function xo({numberingSystem:n},i=""){let o=n||"latn";if(!ap[o])ap[o]={};if(!ap[o][i])ap[o][i]=new RegExp(`${rf[o]}${i}`);return ap[o][i]}var E1=()=>Date.now(),O1="system",U1=null,V1=null,_1=null,b1=60,u1,B1=null;class Ln{static get now(){return E1}static set now(n){E1=n}static set defaultZone(n){O1=n}static get defaultZone(){return Po(O1,Wx.instance)}static get defaultLocale(){return U1}static set defaultLocale(n){U1=n}static get defaultNumberingSystem(){return V1}static set defaultNumberingSystem(n){V1=n}static get defaultOutputCalendar(){return _1}static set defaultOutputCalendar(n){_1=n}static get defaultWeekSettings(){return B1}static set defaultWeekSettings(n){B1=qf(n)}static get twoDigitCutoffYear(){return b1}static set twoDigitCutoffYear(n){b1=n%100}static get throwOnInvalid(){return u1}static set throwOnInvalid(n){u1=n}static resetCaches(){ln.resetCache(),Go.resetCache(),e.resetCache(),V3()}}class Pi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var Qw=[0,31,59,90,120,151,181,212,243,273,304,334],Ew=[0,31,60,91,121,152,182,213,244,274,305,335];function ti(n,i){return new Pi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function df(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function Ow(n,i,o){return o+(Kx(n)?Ew:Qw)[i-1]}function Uw(n,i){let o=Kx(n)?Ew:Qw,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function gf(n,i){return(n-i+7)%7+1}function Vm(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=Ow(c,p,x),a=gf(df(c,p,x),o),f=Math.floor((m-a+14-i)/7),v;if(f<1)v=c-1,f=Xx(v,i,o);else if(f>Xx(c,i,o))v=c+1,f=1;else v=c;return{weekYear:v,weekNumber:f,weekday:a,...Dm(n)}}function j1(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=gf(df(c,1,i),o),a=vp(c),f=p*7+x-m-7+i,v;if(f<1)v=c-1,f+=vp(v);else if(f>a)v=c+1,f-=vp(c);else v=c;let{month:$,day:w}=Uw(v,f);return{year:v,month:$,day:w,...Dm(n)}}function jf(n){let{year:i,month:o,day:c}=n,p=Ow(i,o,c);return{year:i,ordinal:p,...Dm(n)}}function D1(n){let{year:i,ordinal:o}=n,{month:c,day:p}=Uw(i,o);return{year:i,month:c,day:p,...Dm(n)}}function L1(n,i){if(!nn(n.localWeekday)||!nn(n.localWeekNumber)||!nn(n.localWeekYear)){if(!nn(n.weekday)||!nn(n.weekNumber)||!nn(n.weekYear))throw new Hc("Cannot mix locale-based week fields with ISO-based week fields");if(!nn(n.localWeekday))n.weekday=n.localWeekday;if(!nn(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!nn(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function _3(n,i=4,o=1){let c=um(n.weekYear),p=ri(n.weekNumber,1,Xx(n.weekYear,i,o)),x=ri(n.weekday,1,7);if(!c)return ti("weekYear",n.weekYear);else if(!p)return ti("week",n.weekNumber);else if(!x)return ti("weekday",n.weekday);else return!1}function b3(n){let i=um(n.year),o=ri(n.ordinal,1,vp(n.year));if(!i)return ti("year",n.year);else if(!o)return ti("ordinal",n.ordinal);else return!1}function Vw(n){let i=um(n.year),o=ri(n.month,1,12),c=ri(n.day,1,_m(n.year,n.month));if(!i)return ti("year",n.year);else if(!o)return ti("month",n.month);else if(!c)return ti("day",n.day);else return!1}function _w(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=ri(i,0,23)||i===24&&o===0&&c===0&&p===0,m=ri(o,0,59),a=ri(c,0,59),f=ri(p,0,999);if(!x)return ti("hour",i);else if(!m)return ti("minute",o);else if(!a)return ti("second",c);else if(!f)return ti("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function to(n){return typeof n==="number"}function um(n){return typeof n==="number"&&n%1===0}function u3(n){return typeof n==="string"}function B3(n){return Object.prototype.toString.call(n)==="[object Date]"}function bw(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function uw(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function j3(n){return Array.isArray(n)?n:[n]}function N1(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function D3(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function wp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function qf(n){if(n==null)return null;else if(typeof n!=="object")throw new wi("Week settings must be an object");else{if(!ri(n.firstDay,1,7)||!ri(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!ri(i,1,7)))throw new wi("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function ri(n,i,o){return um(n)&&n>=i&&n<=o}function L3(n,i){return n-i*Math.floor(n/i)}function tn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function so(n){if(nn(n)||n===null||n==="")return;else return parseInt(n,10)}function Mc(n){if(nn(n)||n===null||n==="")return;else return parseFloat(n)}function ef(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function nv(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Kx(n){return n%4===0&&(n%100!==0||n%400===0)}function vp(n){return Kx(n)?366:365}function _m(n,i){let o=L3(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Kx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function Bm(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function h1(n,i,o){return-gf(df(n,1,i),o)+i-1}function Xx(n,i=4,o=1){let c=h1(n,i,o),p=h1(n+1,i,o);return(vp(n)-c+p)/7}function sf(n){if(n>99)return n;else return n>Ln.twoDigitCutoffYear?1900+n:2000+n}function Bw(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let m={timeZoneName:i,...x},a=new Intl.DateTimeFormat(o,m).formatToParts(p).find((f)=>f.type.toLowerCase()==="timezonename");return a?a.value:null}function jm(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function jw(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new wi(`Invalid unit value ${n}`);return i}function bm(n,i){let o={};for(let c in n)if(wp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=jw(p)}return o}function Sx(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${tn(o,2)}:${tn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${tn(o,2)}${tn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Dm(n){return D3(n,["hour","minute","second","millisecond"])}var N3=["January","February","March","April","May","June","July","August","September","October","November","December"],Dw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h3=["J","F","M","A","M","J","J","A","S","O","N","D"];function Lw(n){switch(n){case"narrow":return[...h3];case"short":return[...Dw];case"long":return[...N3];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}}var Nw=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],hw=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],C3=["M","T","W","T","F","S","S"];function Cw(n){switch(n){case"narrow":return[...C3];case"short":return[...hw];case"long":return[...Nw];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Iw=["AM","PM"],I3=["Before Christ","Anno Domini"],y3=["BC","AD"],k3=["B","A"];function yw(n){switch(n){case"narrow":return[...k3];case"short":return[...y3];case"long":return[...I3];default:return null}}function Z3(n){return Iw[n.hour<12?0:1]}function q3(n,i){return Cw(i)[n.weekday-1]}function s3(n,i){return Lw(i)[n.month-1]}function P3(n,i){return yw(i)[n.year<0?0:1]}function t3(n,i,o="always",c=!1){let p={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."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){let w=n==="days";switch(i){case 1:return w?"tomorrow":`next ${p[n][0]}`;case-1:return w?"yesterday":`last ${p[n][0]}`;case 0:return w?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,a=Math.abs(i),f=a===1,v=p[n],$=c?f?v[1]:v[2]||v[1]:f?p[n][0]:n;return m?`${a} ${$} ago`:`in ${a} ${$}`}function C1(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var r3={D:Um,DD:pw,DDD:xw,DDDD:mw,t:aw,tt:fw,ttt:vw,tttt:$w,T:ww,TT:Jw,TTT:Aw,TTTT:Fw,f:Tw,ff:Sw,fff:Ww,ffff:lw,F:Rw,FF:Xw,FFF:Kw,FFFF:Gw};class Wi{static create(n,i={}){return new Wi(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let m=n.charAt(x);if(m==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=m;else if(m===i)o+=m;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=m,i=m}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return r3[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return tn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(J,S)=>this.loc.extract(n,J,S),x=(J)=>{if(n.isOffsetFixed&&n.offset===0&&J.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,J.format):""},m=()=>o?Z3(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(J,S)=>o?s3(n,J):p(S?{month:J}:{month:J,day:"numeric"},"month"),f=(J,S)=>o?q3(n,J):p(S?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),v=(J)=>{let S=Wi.macroTokenToFormatOpts(J);if(S)return this.formatWithSystemDefault(n,S);else return J},$=(J)=>o?P3(n,J):p({era:J},"era"),w=(J)=>{switch(J){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return m();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return $("short");case"GG":return $("long");case"GGGGG":return $("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return v(J)}};return C1(Wi.parseFormat(i),w)}formatDurationFromString(n,i){let o=(a)=>{switch(a[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}},c=(a)=>(f)=>{let v=o(f);if(v)return this.num(a.get(v),f.length);else return f},p=Wi.parseFormat(i),x=p.reduce((a,{literal:f,val:v})=>f?a:a.concat(v),[]),m=n.shiftTo(...x.map(o).filter((a)=>a));return C1(p,c(m))}}var kw=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Jp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function Ap(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[m,a,f]=x(i,p);return[{...o,...m},a||c,f]},[{},null,1]).slice(0,2)}function Fp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function Zw(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=so(i[o+p]);return[c,null,o+p]}}var qw=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,d3=`(?:${qw.source}?(?:\\[(${kw.source})\\])?)?`,iv=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,sw=RegExp(`${iv.source}${d3}`),ov=RegExp(`(?:T${sw.source})?`),g3=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,e3=/(\d{4})-?W(\d\d)(?:-?(\d))?/,n7=/(\d{4})-?(\d{3})/,i7=Zw("weekYear","weekNumber","weekDay"),o7=Zw("year","ordinal"),c7=/(\d{4})-(\d\d)-(\d\d)/,Pw=RegExp(`${iv.source} ?(?:${qw.source}|(${kw.source}))?`),p7=RegExp(`(?: ${Pw.source})?`);function $p(n,i,o){let c=n[i];return nn(c)?o:so(c)}function x7(n,i){return[{year:$p(n,i),month:$p(n,i+1,1),day:$p(n,i+2,1)},null,i+3]}function Tp(n,i){return[{hours:$p(n,i,0),minutes:$p(n,i+1,0),seconds:$p(n,i+2,0),milliseconds:ef(n[i+3])},null,i+4]}function lx(n,i){let o=!n[i]&&!n[i+1],c=jm(n[i+1],n[i+2]),p=o?null:Ki.instance(c);return[{},p,i+3]}function Gx(n,i){let o=n[i]?Go.create(n[i]):null;return[{},o,i+1]}var m7=RegExp(`^T?${iv.source}$`),a7=/^-?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 f7(n){let[i,o,c,p,x,m,a,f,v]=n,$=i[0]==="-",w=f&&f[0]==="-",J=(S,X=!1)=>S!==void 0&&(X||S&&$)?-S:S;return[{years:J(Mc(o)),months:J(Mc(c)),weeks:J(Mc(p)),days:J(Mc(x)),hours:J(Mc(m)),minutes:J(Mc(a)),seconds:J(Mc(f),f==="-0"),milliseconds:J(ef(v),w)}]}var v7={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function cv(n,i,o,c,p,x,m){let a={year:i.length===2?sf(so(i)):so(i),month:Dw.indexOf(o)+1,day:so(c),hour:so(p),minute:so(x)};if(m)a.second=so(m);if(n)a.weekday=n.length>3?Nw.indexOf(n)+1:hw.indexOf(n)+1;return a}var $7=/^(?:(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 w7(n){let[,i,o,c,p,x,m,a,f,v,$,w]=n,J=cv(i,p,c,o,x,m,a),S;if(f)S=v7[f];else if(v)S=0;else S=jm($,w);return[J,new Ki(S)]}function J7(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var A7=/^(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$/,F7=/^(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$/,T7=/^(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 I1(n){let[,i,o,c,p,x,m,a]=n;return[cv(i,p,c,o,x,m,a),Ki.utcInstance]}function R7(n){let[,i,o,c,p,x,m,a]=n;return[cv(i,a,o,c,p,x,m),Ki.utcInstance]}var S7=Jp(g3,ov),X7=Jp(e3,ov),W7=Jp(n7,ov),K7=Jp(sw),tw=Ap(x7,Tp,lx,Gx),l7=Ap(i7,Tp,lx,Gx),G7=Ap(o7,Tp,lx,Gx),M7=Ap(Tp,lx,Gx);function Y7(n){return Fp(n,[S7,tw],[X7,l7],[W7,G7],[K7,M7])}function H7(n){return Fp(J7(n),[$7,w7])}function z7(n){return Fp(n,[A7,I1],[F7,I1],[T7,R7])}function Q7(n){return Fp(n,[a7,f7])}var E7=Ap(Tp);function O7(n){return Fp(n,[m7,E7])}var U7=Jp(c7,p7),V7=Jp(Pw),_7=Ap(Tp,lx,Gx);function b7(n){return Fp(n,[U7,tw],[V7,_7])}var y1="Invalid Duration",rw={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},u7={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...rw},si=365.2425,pp=30.436875,B7={years:{quarters:4,months:12,weeks:si/7,days:si,hours:si*24,minutes:si*24*60,seconds:si*24*60*60,milliseconds:si*24*60*60*1000},quarters:{months:3,weeks:si/28,days:si/4,hours:si*24/4,minutes:si*24*60/4,seconds:si*24*60*60/4,milliseconds:si*24*60*60*1000/4},months:{weeks:pp/7,days:pp,hours:pp*24,minutes:pp*24*60,seconds:pp*24*60*60,milliseconds:pp*24*60*60*1000},...rw},zc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],j7=zc.slice(0).reverse();function qo(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new An(c)}function dw(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of j7.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function k1(n,i){let o=dw(n,i)<0?-1:1;zc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],a=Math.floor(x/m);i[p]+=a*o,i[c]-=a*m*o}return p}else return c},null),zc.reduce((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*n[c][p]}return p}else return c},null)}function D7(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class An{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?B7:u7;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||ln.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return An.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new wi(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new An({values:bm(n,An.normalizeUnit),loc:ln.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(to(n))return An.fromMillis(n);else if(An.isDuration(n))return n;else if(typeof n==="object")return An.fromObject(n);else throw new wi(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=Q7(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=O7(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Duration is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new cw(o);else return new An({invalid:o})}static normalizeUnit(n){let i={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"}[n?n.toLowerCase():n];if(!i)throw new Pf(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Wi.create(this.loc,o).formatDurationFromString(this,n):y1}toHuman(n={}){if(!this.isValid)return y1;let i=zc.map((o)=>{let c=this.values[o];if(nn(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=nv(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},e.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return dw(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n),o={};for(let c of zc)if(wp(i.values,c)||wp(this.values,c))o[c]=i.get(c)+this.get(c);return qo(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=jw(n(this.values[o],o));return qo(this,{values:i},!0)}get(n){return this[An.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...bm(n,An.normalizeUnit)};return qo(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return qo(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return k1(this.matrix,n),qo(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=D7(this.normalize().shiftToAll().toObject());return qo(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>An.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of zc)if(n.indexOf(x)>=0){p=x;let m=0;for(let f in o)m+=this.matrix[f][x]*o[f],o[f]=0;if(to(c[x]))m+=c[x];let a=Math.trunc(m);i[x]=a,o[x]=(m*1000-a*1000)/1000}else if(to(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return k1(this.matrix,i),qo(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return qo(this,{values:n},!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(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of zc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var xp="Invalid Interval";function L7(n,i){if(!n||!n.isValid)return hn.invalid("missing or invalid start");else if(!i||!i.isValid)return hn.invalid("missing or invalid end");else if(i<n)return hn.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class hn{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Interval is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new ow(o);else return new hn({invalid:o})}static fromDateTimes(n,i){let o=Ax(n),c=Ax(i),p=L7(o,c);if(p==null)return new hn({start:o,end:c});else return p}static after(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=e.fromISO(o,i),x=p.isValid}catch(f){x=!1}let m,a;try{m=e.fromISO(c,i),a=m.isValid}catch(f){a=!1}if(x&&a)return hn.fromDateTimes(p,m);if(x){let f=An.fromISO(c,i);if(f.isValid)return hn.after(p,f)}else if(a){let f=An.fromISO(o,i);if(f.isValid)return hn.before(m,f)}}return hn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid?this.e?this.e.minus(1):null: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(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return hn.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(Ax).filter((x)=>this.contains(x)).sort((x,m)=>x.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,m=+x>+this.e?this.e:x;o.push(hn.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=An.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let m=this.start.plus(i.mapUnits((a)=>a*c));p=+m>+this.e?this.e:m,x.push(hn.fromDateTimes(o,p)),o=p,c+=1}return x}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return hn.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return hn.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((a)=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((a,f)=>a.time-f.time);for(let a of m)if(o+=a.type==="s"?1:-1,o===1)i=a.time;else{if(i&&+i!==+a.time)c.push(hn.fromDateTimes(i,a.time));i=null}return hn.merge(c)}difference(...n){return hn.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return xp;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=Um,i={}){return this.isValid?Wi.create(this.s.loc.clone(i),n).formatInterval(this):xp}toISO(n){if(!this.isValid)return xp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return xp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return xp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return xp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return An.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return hn.fromDateTimes(n(this.s),n(this.e))}}class fp{static hasDST(n=Ln.defaultZone){let i=e.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return Go.isValidZone(n)}static normalizeZone(n){return Po(n,Ln.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||ln.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||ln.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||ln.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||ln.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return ln.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return ln.create(i,null,"gregory").eras(n)}static features(){return{relative:bw(),localeWeek:uw()}}}function Z1(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(An.fromMillis(c).as("days"))}function N7(n,i,o){let c=[["years",(f,v)=>v.year-f.year],["quarters",(f,v)=>v.quarter-f.quarter+(v.year-f.year)*4],["months",(f,v)=>v.month-f.month+(v.year-f.year)*12],["weeks",(f,v)=>{let $=Z1(f,v);return($-$%7)/7}],["days",Z1]],p={},x=n,m,a;for(let[f,v]of c)if(o.indexOf(f)>=0)if(m=f,p[f]=v(n,i),a=x.plus(p),a>i){if(p[f]--,n=x.plus(p),n>i)a=n,p[f]--,n=x.plus(p)}else n=a;return[n,p,a,m]}function h7(n,i,o,c){let[p,x,m,a]=N7(n,i,o),f=i-p,v=o.filter((w)=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);if(v.length===0){if(m<i)m=p.plus({[a]:1});if(m!==p)x[a]=(x[a]||0)+f/(m-p)}let $=An.fromObject(x,c);if(v.length>0)return An.fromMillis(f,c).shiftTo(...v).plus($);else return $}var C7="missing Intl.DateTimeFormat.formatToParts support";function Xn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(U3(o))}}var I7=String.fromCharCode(160),gw=`[ ${I7}]`,ew=new RegExp(gw,"g");function y7(n){return n.replace(/\./g,"\\.?").replace(ew,gw)}function q1(n){return n.replace(/\./g,"").replace(ew," ").toLowerCase()}function mo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(y7).join("|")),deser:([o])=>n.findIndex((c)=>q1(o)===q1(c))+i}}function s1(n,i){return{regex:n,deser:([,o,c])=>jm(o,c),groups:i}}function Mm(n){return{regex:n,deser:([i])=>i}}function k7(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Z7(n,i){let o=xo(i),c=xo(i,"{2}"),p=xo(i,"{3}"),x=xo(i,"{4}"),m=xo(i,"{6}"),a=xo(i,"{1,2}"),f=xo(i,"{1,3}"),v=xo(i,"{1,6}"),$=xo(i,"{1,9}"),w=xo(i,"{2,4}"),J=xo(i,"{4,6}"),S=(K)=>({regex:RegExp(k7(K.val)),deser:([M])=>M,literal:!0}),R=((K)=>{if(n.literal)return S(K);switch(K.val){case"G":return mo(i.eras("short"),0);case"GG":return mo(i.eras("long"),0);case"y":return Xn(v);case"yy":return Xn(w,sf);case"yyyy":return Xn(x);case"yyyyy":return Xn(J);case"yyyyyy":return Xn(m);case"M":return Xn(a);case"MM":return Xn(c);case"MMM":return mo(i.months("short",!0),1);case"MMMM":return mo(i.months("long",!0),1);case"L":return Xn(a);case"LL":return Xn(c);case"LLL":return mo(i.months("short",!1),1);case"LLLL":return mo(i.months("long",!1),1);case"d":return Xn(a);case"dd":return Xn(c);case"o":return Xn(f);case"ooo":return Xn(p);case"HH":return Xn(c);case"H":return Xn(a);case"hh":return Xn(c);case"h":return Xn(a);case"mm":return Xn(c);case"m":return Xn(a);case"q":return Xn(a);case"qq":return Xn(c);case"s":return Xn(a);case"ss":return Xn(c);case"S":return Xn(f);case"SSS":return Xn(p);case"u":return Mm($);case"uu":return Mm(a);case"uuu":return Xn(o);case"a":return mo(i.meridiems(),0);case"kkkk":return Xn(x);case"kk":return Xn(w,sf);case"W":return Xn(a);case"WW":return Xn(c);case"E":case"c":return Xn(o);case"EEE":return mo(i.weekdays("short",!1),1);case"EEEE":return mo(i.weekdays("long",!1),1);case"ccc":return mo(i.weekdays("short",!0),1);case"cccc":return mo(i.weekdays("long",!0),1);case"Z":case"ZZ":return s1(new RegExp(`([+-]${a.source})(?::(${c.source}))?`),2);case"ZZZ":return s1(new RegExp(`([+-]${a.source})(${c.source})?`),2);case"z":return Mm(/[a-z_+-/]{1,256}?/i);case" ":return Mm(/[^\S\n\r]/);default:return S(K)}})(n)||{invalidReason:C7};return R.token=n,R}var q7={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 s7(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let f=/^\s+$/.test(p);return{literal:!f,val:f?" ":p}}let x=i[c],m=c;if(c==="hour")if(i.hour12!=null)m=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")m="hour12";else m="hour24";else m=o.hour12?"hour12":"hour24";let a=q7[m];if(typeof a==="object")a=a[x];if(a)return{literal:!1,val:a};return}function P7(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function t7(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(wp(o,m)){let a=o[m],f=a.groups?a.groups+1:1;if(!a.literal&&a.token)p[a.token.val[0]]=a.deser(c.slice(x,x+f));x+=f}return[c,p]}else return[c,{}]}function r7(n){let i=(x)=>{switch(x){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}},o=null,c;if(!nn(n.z))o=Go.create(n.z);if(!nn(n.Z)){if(!o)o=new Ki(n.Z);c=n.Z}if(!nn(n.q))n.M=(n.q-1)*3+1;if(!nn(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!nn(n.u))n.S=ef(n.u);return[Object.keys(n).reduce((x,m)=>{let a=i(m);if(a)x[a]=n[m];return x},{}),o,c]}var Df=null;function d7(){if(!Df)Df=e.fromMillis(1555555555555);return Df}function g7(n,i){if(n.literal)return n;let o=Wi.macroTokenToFormatOpts(n.val),c=oJ(o,i);if(c==null||c.includes(void 0))return n;return c}function nJ(n,i){return Array.prototype.concat(...n.map((o)=>g7(o,i)))}class pv{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=nJ(Wi.parseFormat(i),n),this.units=this.tokens.map((o)=>Z7(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=P7(this.units);this.regex=RegExp(o,"i"),this.handlers=c}}explainFromTokens(n){if(!this.isValid)return{input:n,tokens:this.tokens,invalidReason:this.invalidReason};else{let[i,o]=t7(n,this.regex,this.handlers),[c,p,x]=o?r7(o):[null,null,void 0];if(wp(o,"a")&&wp(o,"H"))throw new Hc("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:this.tokens,regex:this.regex,rawMatches:i,matches:o,result:c,zone:p,specificOffset:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function iJ(n,i,o){return new pv(n,o).explainFromTokens(i)}function e7(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=iJ(n,i,o);return[c,p,x,m]}function oJ(n,i){if(!n)return null;let c=Wi.create(i,n).dtFormatter(d7()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>s7(m,n,x))}var Lf="Invalid DateTime",P1=8640000000000000;function Tx(n){return new Pi("unsupported zone",`the zone "${n.name}" is not supported`)}function Nf(n){if(n.weekData===null)n.weekData=Vm(n.c);return n.weekData}function hf(n){if(n.localWeekData===null)n.localWeekData=Vm(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Yc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new e({...o,...i,old:o})}function cJ(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function Ym(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function Em(n,i,o){return cJ(Bm(n),i,o)}function t1(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,x={...n.c,year:c,month:p,day:Math.min(n.c.day,_m(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=An.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),a=Bm(x),[f,v]=cJ(a,o,n.zone);if(m!==0)f+=m,v=n.zone.offset(f);return{ts:f,o:v}}function mp(n,i,o,c,p,x){let{setZone:m,zone:a}=o;if(n&&Object.keys(n).length!==0||i){let f=i||a,v=e.fromObject(n,{...o,zone:f,specificOffset:x});return m?v:v.setZone(a)}else return e.invalid(new Pi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Hm(n,i,o=!0){return n.isValid?Wi.create(ln.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function Cf(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=tn(n.c.year,o?6:4),i)c+="-",c+=tn(n.c.month),c+="-",c+=tn(n.c.day);else c+=tn(n.c.month),c+=tn(n.c.day);return c}function r1(n,i,o,c,p,x){let m=tn(n.c.hour);if(i){if(m+=":",m+=tn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=tn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=tn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=tn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)m+="Z";else if(n.o<0)m+="-",m+=tn(Math.trunc(-n.o/60)),m+=":",m+=tn(Math.trunc(-n.o%60));else m+="+",m+=tn(Math.trunc(n.o/60)),m+=":",m+=tn(Math.trunc(n.o%60));if(x)m+="["+n.zone.ianaName+"]";return m}var pJ={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nX={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iX={ordinal:1,hour:0,minute:0,second:0,millisecond:0},xJ=["year","month","day","hour","minute","second","millisecond"],oX=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cX=["year","ordinal","hour","minute","second","millisecond"];function pX(n){let i={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(!i)throw new Pf(n);return i}function d1(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return pX(n)}}function xX(n){if(Rx===void 0)Rx=Ln.now();if(n.type!=="iana")return n.offset(Rx);let i=n.name;if(!Om[i])Om[i]=n.offset(Rx);return Om[i]}function g1(n,i){let o=Po(i.zone,Ln.defaultZone);if(!o.isValid)return e.invalid(Tx(o));let c=ln.fromObject(i),p,x;if(!nn(n.year)){for(let f of xJ)if(nn(n[f]))n[f]=pJ[f];let m=Vw(n)||_w(n);if(m)return e.invalid(m);let a=xX(o);[p,x]=Em(n,a,o)}else p=Ln.now();return new e({ts:p,zone:o,loc:c,o:x})}function e1(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,a)=>{return m=nv(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,a)},x=(m)=>{if(o.calendary)if(!i.hasSame(n,m))return i.startOf(m).diff(n.startOf(m),m).get(m);else return 0;else return i.diff(n,m).get(m)};if(o.unit)return p(x(o.unit),o.unit);for(let m of o.units){let a=x(m);if(Math.abs(a)>=1)return p(a,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function nw(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}var Rx,Om={};class e{constructor(n){let i=n.zone||Ln.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new Pi("invalid input"):null)||(!i.isValid?Tx(i):null);this.ts=nn(n.ts)?Ln.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let m=to(n.o)&&!n.old?n.o:i.offset(this.ts);c=Ym(this.ts,m),o=Number.isNaN(c.year)?new Pi("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||ln.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[n,i]=nw(arguments),[o,c,p,x,m,a,f]=i;return g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static utc(){let[n,i]=nw(arguments),[o,c,p,x,m,a,f]=i;return n.zone=Ki.utcInstance,g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static fromJSDate(n,i={}){let o=B3(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=Po(i.zone,Ln.defaultZone);if(!c.isValid)return e.invalid(Tx(c));return new e({ts:o,zone:c,loc:ln.fromObject(i)})}static fromMillis(n,i={}){if(!to(n))throw new wi(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-P1||n>P1)return e.invalid("Timestamp out of range");else return new e({ts:n,zone:Po(i.zone,Ln.defaultZone),loc:ln.fromObject(i)})}static fromSeconds(n,i={}){if(!to(n))throw new wi("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:Po(i.zone,Ln.defaultZone),loc:ln.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=Po(i.zone,Ln.defaultZone);if(!o.isValid)return e.invalid(Tx(o));let c=ln.fromObject(i),p=bm(n,d1),{minDaysInFirstWeek:x,startOfWeek:m}=L1(p,c),a=Ln.now(),f=!nn(i.specificOffset)?i.specificOffset:o.offset(a),v=!nn(p.ordinal),$=!nn(p.year),w=!nn(p.month)||!nn(p.day),J=$||w,S=p.weekYear||p.weekNumber;if((J||v)&&S)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&v)throw new Hc("Can't mix ordinal dates with month/day");let X=S||p.weekday&&!J,R,K,M=Ym(a,f);if(X)R=oX,K=nX,M=Vm(M,x,m);else if(v)R=cX,K=iX,M=jf(M);else R=xJ,K=pJ;let Y=!1;for(let y of R){let H=p[y];if(!nn(H))Y=!0;else if(Y)p[y]=K[y];else p[y]=M[y]}let I=X?_3(p,x,m):v?b3(p):Vw(p),G=I||_w(p);if(G)return e.invalid(G);let z=X?j1(p,x,m):v?D1(p):p,[E,Q]=Em(z,f,o),b=new e({ts:E,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==b.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${b.toISO()}`);if(!b.isValid)return e.invalid(b.invalid);return b}static fromISO(n,i={}){let[o,c]=Y7(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=H7(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=z7(n);return mp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,a,f,v]=e7(x,n,i);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i}`,n,f)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=b7(n);return mp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the DateTime is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new iw(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=oJ(n,ln.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return nJ(Wi.parseFormat(n),ln.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Rx=void 0,Om={}}get(n){return this[n]}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?Nf(this).weekYear:NaN}get weekNumber(){return this.isValid?Nf(this).weekNumber:NaN}get weekday(){return this.isValid?Nf(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?hf(this).weekday:NaN}get localWeekNumber(){return this.isValid?hf(this).weekNumber:NaN}get localWeekYear(){return this.isValid?hf(this).weekYear:NaN}get ordinal(){return this.isValid?jf(this.c).ordinal:NaN}get monthShort(){return this.isValid?fp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=Bm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(x===m)return[this];let a=o-x*i,f=o-m*i,v=Ym(a,x),$=Ym(f,m);if(v.hour===$.hour&&v.minute===$.minute&&v.second===$.second&&v.millisecond===$.millisecond)return[Yc(this,{ts:a}),Yc(this,{ts:f})];return[this]}get isInLeapYear(){return Kx(this.year)}get daysInMonth(){return _m(this.year,this.month)}get daysInYear(){return this.isValid?vp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Xx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Xx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Wi.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Ki.instance(n),i)}toLocal(){return this.setZone(Ln.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=Po(n,Ln.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return e.invalid(Tx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=Em(x,p,n)}return Yc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Yc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=bm(n,d1),{minDaysInFirstWeek:o,startOfWeek:c}=L1(i,this.loc),p=!nn(i.weekYear)||!nn(i.weekNumber)||!nn(i.weekday),x=!nn(i.ordinal),m=!nn(i.year),a=!nn(i.month)||!nn(i.day),f=m||a,v=i.weekYear||i.weekNumber;if((f||x)&&v)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&x)throw new Hc("Can't mix ordinal dates with month/day");let $;if(p)$=j1({...Vm(this.c,o,c),...i},o,c);else if(!nn(i.ordinal))$=D1({...jf(this.c),...i});else if($={...this.toObject(),...i},nn(i.day))$.day=Math.min(_m($.year,$.month),$.day);let[w,J]=Em($,this.o,this.zone);return Yc(this,{ts:w,o:J})}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return Yc(this,t1(this,i))}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n).negate();return Yc(this,t1(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=An.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:x}=this;if(x<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Wi.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):Lf}toLocaleString(n=Um,i={}){return this.isValid?Wi.create(this.loc.clone(i),n).formatDateTime(this):Lf}toLocaleParts(n={}){return this.isValid?Wi.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let x=n==="extended",m=Cf(this,x);return m+="T",m+=r1(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return Cf(this,n==="extended")}toISOWeekDate(){return Hm(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+r1(this,x==="extended",i,n,o,p)}toRFC2822(){return Hm(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hm(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return Cf(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return Hm(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():Lf}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return An.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=j3(i).map(An.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,a=x?n:this,f=h7(m,a,p,c);return x?f.negate():f}diffNow(n="milliseconds",i={}){return this.diff(e.now(),n,i)}until(n){return this.isValid?hn.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||e.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return e1(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return e1(n.base||e.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(e.isDateTime))throw new wi("min requires all arguments be DateTimes");return N1(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new wi("max requires all arguments be DateTimes");return N1(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return iJ(x,n,i)}static fromStringExplain(n,i,o={}){return e.fromFormatExplain(n,i,o)}static buildFormatParser(n,i={}){let{locale:o=null,numberingSystem:c=null}=i,p=ln.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new pv(p,n)}static fromFormatParser(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new wi(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:a,specificOffset:f,invalidReason:v}=i.explainFromTokens(n);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i.format}`,n,f)}static get DATE_SHORT(){return Um}static get DATE_MED(){return pw}static get DATE_MED_WITH_WEEKDAY(){return J3}static get DATE_FULL(){return xw}static get DATE_HUGE(){return mw}static get TIME_SIMPLE(){return aw}static get TIME_WITH_SECONDS(){return fw}static get TIME_WITH_SHORT_OFFSET(){return vw}static get TIME_WITH_LONG_OFFSET(){return $w}static get TIME_24_SIMPLE(){return ww}static get TIME_24_WITH_SECONDS(){return Jw}static get TIME_24_WITH_SHORT_OFFSET(){return Aw}static get TIME_24_WITH_LONG_OFFSET(){return Fw}static get DATETIME_SHORT(){return Tw}static get DATETIME_SHORT_WITH_SECONDS(){return Rw}static get DATETIME_MED(){return Sw}static get DATETIME_MED_WITH_SECONDS(){return Xw}static get DATETIME_MED_WITH_WEEKDAY(){return A3}static get DATETIME_FULL(){return Ww}static get DATETIME_FULL_WITH_SECONDS(){return Kw}static get DATETIME_HUGE(){return lw}static get DATETIME_HUGE_WITH_SECONDS(){return Gw}}function Ax(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&to(n.valueOf()))return e.fromJSDate(n);else if(n&&typeof n==="object")return e.fromObject(n);else throw new wi(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var mX="3.6.0";mJ.DateTime=e;mJ.Duration=An;mJ.FixedOffsetZone=Ki;mJ.IANAZone=Go;mJ.Info=fp;mJ.Interval=hn;mJ.InvalidZone=tf;mJ.Settings=Ln;mJ.SystemZone=Wx;mJ.VERSION=mX;mJ.Zone=Qc});var JJ=C((fJ)=>{Object.defineProperty(fJ,"__esModule",{value:!0});fJ.RE_RANGE=fJ.RE_WILDCARDS=fJ.PRESETS=fJ.TIME_UNITS_LEN=fJ.TIME_UNITS=fJ.TIME_UNITS_MAP=fJ.ALIASES=fJ.PARSE_DEFAULTS=fJ.CONSTRAINTS=void 0;fJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});fJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});fJ.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});fJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});fJ.TIME_UNITS=Object.freeze(Object.values(fJ.TIME_UNITS_MAP));fJ.TIME_UNITS_LEN=fJ.TIME_UNITS.length;fJ.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});fJ.RE_WILDCARDS=/\*/g;fJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var mv=C((FJ)=>{Object.defineProperty(FJ,"__esModule",{value:!0});FJ.ExclusiveParametersError=FJ.CronError=void 0;class xv extends Error{}FJ.CronError=xv;class AJ extends xv{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}FJ.ExclusiveParametersError=AJ});var Lm=C((RJ)=>{Object.defineProperty(RJ,"__esModule",{value:!0});RJ.CronTime=void 0;var Di=aJ(),li=JJ(),_i=mv();class av{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new _i.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Di.DateTime.fromObject({},{zone:i}).isValid)throw new _i.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(i==null&&o==null){let c=Intl.DateTimeFormat().resolvedOptions().timeZone;this.timeZone=c}if(n instanceof Date||n instanceof Di.DateTime)this.source=n instanceof Date?Di.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}static validateCronExpression(n){try{return new av(n),{valid:!0}}catch(i){return{valid:!1,error:i}}}_getWeekDay(n){return n.weekday===7?0:n.weekday}sendAt(n){let i=this.realDate&&this.source instanceof Di.DateTime?this.source:Di.DateTime.utc();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),x=Math.abs(this.utcOffset-c*60),m=String(x).padStart(2,"0"),a=`UTC${o}${p}:${m}`;if(i=i.setZone(a),!i.isValid)throw new _i.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Di.DateTime.local()>i)throw new _i.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Di.DateTime.utc().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return li.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o,c;if(n instanceof Date)n=Di.DateTime.fromJSDate(n);if(i)n=n.setZone(i);else i=(o=n.zone.zoneName)!==null&&o!==void 0?o:n.zone.fixed;let p=Di.DateTime.fromFormat(`${n.year}-${n.month}-${n.day} ${n.hour}:${n.minute}:${n.second}`,"yyyy-M-d H:m:s",{zone:"UTC"}),x=p.toMillis();if(!this.realDate){if(p.millisecond>0)p=p.set({millisecond:0,second:p.second+1})}if(!p.isValid)throw new _i.CronError("ERROR: You specified an invalid date.");let m=Di.DateTime.now().plus({years:8});while(!0){if(p>m)throw new _i.CronError(`Something went wrong. No execution date was found in the next 8 years.
4
4
  Please provide the following string if you would like to help debug:
5
- Time Zone: ${(o=i===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${c.offset} - current Date: ${Yo.DateTime.local().toString()}`);if(!(c.month in this.month)&&Object.keys(this.month).length!==12){if(c=c.plus({months:1}),c=c.set({day:1,hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[f,a]=this._findPreviousDSTJump(c);if(c=a,f)break}continue}if(!(c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[f,a]=this._findPreviousDSTJump(c);if(c=a,f)break}continue}if(!(this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[f,a]=this._findPreviousDSTJump(c);if(c=a,f)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let f=c.hour===23&&m>86400000?0:c.hour+1,a=c.minute;if(c=c.set({hour:f}),c=c.set({minute:0,second:0}),this._forwardDSTJump(f,a,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let f=c.minute===59&&m>3600000?0:c.minute+1,a=c.hour+(f===60?1:0);if(c=c.set({minute:f}),c=c.set({second:0}),this._forwardDSTJump(a,f,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let f=c.second===59&&m>60000?0:c.second+1,a=c.minute+(f===60?1:0),v=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump(v,a,c)){let[$,w]=this._findPreviousDSTJump(c);if(c=w,$)break}continue}if(c.toMillis()===p){let f=c.second+1,a=c.minute+(f===60?1:0),v=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump(v,a,c)){let[$,w]=this._findPreviousDSTJump(c);if(c=w,$)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,x,m=n,f=1440,a=0;do{if(++a>f)throw new Yi.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(i=n.toISO())!==null&&i!==void 0?i:n.toMillis()}) is within 24 hours of a DST jump.`);if(o=m.minute-1,c=m.hour,o<0)o+=60,c=(c+24-1)%24;m=m.minus({minute:1}),p=m.minute,x=m.hour}while(o===p&&c===x);let v=m.plus({minute:1}).set({second:0,millisecond:0}),$=v.minus({second:1});if(n.month in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange($,v),v];return[!1,v]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,x=o===0&&i.minute===0;if(p===2&&x)return c in this.hour;else if(p===1)return c in this.hour&&this._checkTimeInSkippedRangeSingleHour(o,i.minute);else return this._checkTimeInSkippedRangeMultiHour(c,o,i.hour,i.minute)}_checkTimeInSkippedRangeSingleHour(n,i){for(let o=n;o<i;++o)if(o in this.minute)return!0;return i in this.minute&&0 in this.second}_checkTimeInSkippedRangeMultiHour(n,i,o,c){if(n>=o)throw new Yi.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${n}) is less than the end hour (${o})`);let p=Array.from({length:60-i},(a,v)=>i+v),x=Array.from({length:c},(a,v)=>v),m=Array.from({length:60},(a,v)=>v),f=(a)=>{if(a===n)return p;else if(a===o)return x;else return m};for(let a=n;a<=o;++a){if(!(a in this.hour))continue;let v=f(a);for(let $ of v)if($ in this.minute)return!0}return o in this.hour&&c in this.minute&&0 in this.second}_forwardDSTJump(n,i,o){let{hour:c,minute:p}=o,x=n%24<c,m=i%60<p;return x||m}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=Gi.CONSTRAINTS[n],o=i[0],c=n===Gi.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(Gi.PRESETS).includes(n))n=Gi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(Gi.ALIASES).includes(p))return Gi.ALIASES[p].toString();throw new Yi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<Gi.TIME_UNITS_LEN-1)throw new Yi.CronError("Too few fields");if(o.length>Gi.TIME_UNITS_LEN)throw new Yi.CronError("Too many fields");let c=o.length;for(let p of Gi.TIME_UNITS){let x=Gi.TIME_UNITS.indexOf(p),m=(i=o[x-(Gi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:Gi.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=Gi.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((v)=>{let $=v.indexOf("*");if($!==-1&&$!==0)throw new Yi.CronError(`Field (${v}) has an invalid wildcard expression`)}),n=n.replace(Gi.RE_WILDCARDS,`${x}-${m}`);let a=n.split(",");for(let v of a){let $=[...v.matchAll(Gi.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,w,J,X]=$,W=parseInt(w,10),R=J!==void 0?parseInt(J,10):void 0,S=X!==void 0,l=parseInt(X!==null&&X!==void 0?X:"1",10);if(l===0)throw new Yi.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&W>R)throw new Yi.CronError(`Field (${i}) has an invalid range`);if(W<x||R!==void 0&&R>m||R===void 0&&W>m)throw new Yi.CronError(`Field value (${n}) is out of range`);if(W=Math.min(Math.max(x,~~Math.abs(W)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=S?m:W;c=W;do o[c]=!0,c+=l;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Yi.CronError(`Field (${i}) cannot be parsed`)}}}AJ.CronTime=xv});var RJ=C((Rp)=>{var Nm=Rp&&Rp.__awaiter||function(n,i,o,c){function p(x){return x instanceof o?x:new o(function(m){m(x)})}return new(o||(o=Promise))(function(x,m){function f($){try{v(c.next($))}catch(w){m(w)}}function a($){try{v(c.throw($))}catch(w){m(w)}}function v($){$.done?x($.value):p($.value).then(f,a)}v((c=c.apply(n,i||[])).next())})};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CronJob=void 0;var FJ=Sn("child_process"),mv=pv(),hm=Dm();class Yx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,f,a,v,$){if(this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this.waitForCompletion=!1,this._isActive=!1,this._isCallbackRunning=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,this.waitForCompletion=Boolean(v),this.errorHandler=$,p!=null&&f!=null)throw new mv.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new hm.CronTime(n,p,null);else if(f!=null)this.cronTime=new hm.CronTime(n,null,f);else this.cronTime=new hm.CronTime(n,p,f);if(a!=null)this.unrefTimeout=a;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),m)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new mv.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Yx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else if(n.utcOffset!=null)return new Yx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Yx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return FJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return FJ.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof hm.CronTime))throw new mv.CronError("time must be an instance of CronTime.");let i=this._isActive;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){return Nm(this,void 0,void 0,function*(){if(this.waitForCompletion&&this._isCallbackRunning)return;this._isCallbackRunning=!0;try{for(let n of this._callbacks){let i=n.call(this.context,this.onComplete);if(this.waitForCompletion)yield i}}catch(n){if(this.errorHandler!=null)this.errorHandler(n);else console.error("[Cron] error in callback",n)}finally{this._isCallbackRunning=!1}})}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this._isActive)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(m)=>{if(c=Date.now(),this._timeout=setTimeout(x,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let m=c+i-Date.now();if(m>0){let f=this.cronTime.getTimeout();if(f>m)f=m;o+=f}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this._isActive=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this._isActive=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}_executeOnComplete(){return Nm(this,void 0,void 0,function*(){if(typeof this.onComplete!=="function")return;try{yield this.onComplete.call(this.context)}catch(n){console.error("[Cron] error in onComplete callback:",n)}})}_waitForJobCompletion(){return Nm(this,void 0,void 0,function*(){while(this._isCallbackRunning)yield new Promise((n)=>setTimeout(n,100))})}stop(){if(this._timeout)clearTimeout(this._timeout);if(this._isActive=!1,!this.waitForCompletion){this._executeOnComplete();return}Promise.resolve().then(()=>Nm(this,void 0,void 0,function*(){yield this._waitForJobCompletion(),yield this._executeOnComplete()}))}}Rp.CronJob=Yx});var av=C((Cm)=>{Object.defineProperty(Cm,"__esModule",{value:!0});Cm.validateCronExpression=Cm.timeout=Cm.sendAt=Cm.CronTime=Cm.CronJob=void 0;var fv=Dm(),WW=RJ();Object.defineProperty(Cm,"CronJob",{enumerable:!0,get:function(){return WW.CronJob}});var KW=Dm();Object.defineProperty(Cm,"CronTime",{enumerable:!0,get:function(){return KW.CronTime}});var SW=(n)=>new fv.CronTime(n).sendAt();Cm.sendAt=SW;var GW=(n)=>new fv.CronTime(n).getTimeout();Cm.timeout=GW;Cm.validateCronExpression=fv.CronTime.validateCronExpression});var fF=C((UD,Qv)=>{Qv.exports=mF;Qv.exports.preferredCharsets=mF;var _W=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function BW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=bW(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function bW(n,i){var o=_W.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{charset:c,q:p,i}}function jW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=LW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function LW(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function mF(n,i){var o=BW(n===void 0?"*":n||"");if(!i)return o.filter(xF).sort(pF).map(DW);var c=i.map(function p(x,m){return jW(x,o,m)});return c.filter(xF).sort(pF).map(function p(x){return i[c.indexOf(x)]})}function pF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function DW(n){return n.charset}function xF(n){return n.q>0}});var JF=C((VD,Ev)=>{Ev.exports=wF;Ev.exports.preferredEncodings=wF;var NW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function hW(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=CW(i[p].trim(),p);if(m)i[x++]=m,o=o||$F("identity",m),c=Math.min(c,m.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function CW(n,i){var o=NW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{encoding:c,q:p,i}}function uW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=$F(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function $F(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function wF(n,i){var o=hW(n||"");if(!i)return o.filter(vF).sort(aF).map(IW);var c=i.map(function p(x,m){return uW(x,o,m)});return c.filter(vF).sort(aF).map(function p(x){return i[c.indexOf(x)]})}function aF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function IW(n){return n.encoding}function vF(n){return n.q>0}});var XF=C((_D,Ov)=>{Ov.exports=RF;Ov.exports.preferredLanguages=RF;var yW=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function kW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=FF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function FF(n,i){var o=yW.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var m=1;if(o[3]){var f=o[3].split(";");for(var a=0;a<f.length;a++){var v=f[a].split("=");if(v[0]==="q")m=parseFloat(v[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function ZW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=qW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function qW(n,i,o){var c=FF(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function RF(n,i){var o=kW(n===void 0?"*":n||"");if(!i)return o.filter(TF).sort(AF).map(PW);var c=i.map(function p(x,m){return ZW(x,o,m)});return c.filter(TF).sort(AF).map(function p(x){return i[c.indexOf(x)]})}function AF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function PW(n){return n.full}function TF(n){return n.q>0}});var lF=C((BD,Uv)=>{Uv.exports=GF;Uv.exports.preferredMediaTypes=GF;var sW=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function rW(n){var i=n5(n);for(var o=0,c=0;o<i.length;o++){var p=SF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function SF(n,i){var o=sW.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var f=i5(o[3]).map(eW);for(var a=0;a<f.length;a++){var v=f[a],$=v[0].toLowerCase(),w=v[1],J=w&&w[0]==='"'&&w[w.length-1]==='"'?w.substr(1,w.length-2):w;if($==="q"){p=parseFloat(J);break}c[$]=J}}return{type:m,subtype:x,params:c,q:p,i}}function tW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=gW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function gW(n,i,o){var c=SF(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var x=Object.keys(i.params);if(x.length>0)if(x.every(function(m){return i.params[m]=="*"||(i.params[m]||"").toLowerCase()==(c.params[m]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function GF(n,i){var o=rW(n===void 0?"*/*":n||"");if(!i)return o.filter(KF).sort(WF).map(dW);var c=i.map(function p(x,m){return tW(x,o,m)});return c.filter(KF).sort(WF).map(function p(x){return i[c.indexOf(x)]})}function WF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function dW(n){return n.type+"/"+n.subtype}function KF(n){return n.q>0}function YF(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function eW(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function n5(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(YF(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function i5(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(YF(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var HF=C((bD,Vv)=>{/*!
5
+ Time Zone: ${(c=i===null||i===void 0?void 0:i.toString())!==null&&c!==void 0?c:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${p.offset} - current Date: ${Di.DateTime.local().toString()}`);if(!(p.month in this.month)&&Object.keys(this.month).length!==12){p=p.plus({month:1}),p=p.set({day:1,hour:0,minute:0,second:0});continue}if(!(p.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(p)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)||!(this._getWeekDay(p)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((p.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){p=p.plus({days:1}),p=p.set({hour:0,minute:0,second:0});continue}if(!(p.hour in this.hour)&&Object.keys(this.hour).length!==24){p=p.plus({hour:1}),p=p.set({minute:0,second:0});continue}if(!(p.minute in this.minute)&&Object.keys(this.minute).length!==60){p=p.plus({minute:1}),p=p.set({second:0});continue}if(p.toMillis()===x||!(p.second in this.second)&&Object.keys(this.second).length!==60){p=p.plus({second:1});continue}break}let{hour:a,minute:f}=p;p=Di.DateTime.fromFormat(`${p.year}-${p.month}-${p.day} ${p.hour}:${p.minute}:${p.second}`,"yyyy-M-d H:m:s",{zone:i});let v=Di.DateTime.fromFormat(`${p.year}-1-1 0:0:0`,"yyyy-M-d H:m:s",{zone:i});if((a!==p.hour||f!==p.minute)&&v.offset!==p.offset){while(p.minus({minute:1}).offset!==v.offset)p=p.minus({minute:1});return p}let $=p.minus({hour:1}),w=p.minus({hour:2});if(($.hour===p.hour||w.hour===$.hour)&&$>n)p=$;let J=p.minus({minute:30});if((J.minute===p.minute||$.minute===J.minute)&&J>n)p=J;return p}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=li.CONSTRAINTS[n],o=i[0],c=n===li.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(li.PRESETS).includes(n))n=li.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(li.ALIASES).includes(p))return li.ALIASES[p].toString();throw new _i.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<li.TIME_UNITS_LEN-1)throw new _i.CronError("Too few fields");if(o.length>li.TIME_UNITS_LEN)throw new _i.CronError("Too many fields");let c=o.length;for(let p of li.TIME_UNITS){let x=li.TIME_UNITS.indexOf(p),m=(i=o[x-(li.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:li.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=li.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((v)=>{let $=v.indexOf("*");if($!==-1&&$!==0)throw new _i.CronError(`Field (${v}) has an invalid wildcard expression`)}),n=n.replace(li.RE_WILDCARDS,`${x}-${m}`);let f=n.split(",");for(let v of f){let $=[...v.matchAll(li.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,w,J,S]=$,X=parseInt(w,10),R=J!==void 0?parseInt(J,10):void 0,K=S!==void 0,M=parseInt(S!==null&&S!==void 0?S:"1",10);if(M===0)throw new _i.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&X>R)throw new _i.CronError(`Field (${i}) has an invalid range`);if(X<x||R!==void 0&&R>m||R===void 0&&X>m)throw new _i.CronError(`Field value (${n}) is out of range`);if(X=Math.min(Math.max(x,~~Math.abs(X)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=K?m:X;c=X;do o[c]=!0,c+=M;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new _i.CronError(`Field (${i}) cannot be parsed`)}}}RJ.CronTime=av});var WJ=C((Rp)=>{var Nm=Rp&&Rp.__awaiter||function(n,i,o,c){function p(x){return x instanceof o?x:new o(function(m){m(x)})}return new(o||(o=Promise))(function(x,m){function a($){try{v(c.next($))}catch(w){m(w)}}function f($){try{v(c.throw($))}catch(w){m(w)}}function v($){$.done?x($.value):p($.value).then(a,f)}v((c=c.apply(n,i||[])).next())})};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CronJob=void 0;var XJ=Kn("node:child_process"),fv=mv(),hm=Lm();class Mx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,a,f,v,$){if(this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this.waitForCompletion=!1,this._isActive=!1,this._isCallbackRunning=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,this.waitForCompletion=Boolean(v),this.errorHandler=$,p!=null&&a!=null)throw new fv.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new hm.CronTime(n,p,null);else if(a!=null)this.cronTime=new hm.CronTime(n,null,a);else this.cronTime=new hm.CronTime(n,p,a);if(f!=null)this.unrefTimeout=f;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),m)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new fv.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else if(n.utcOffset!=null)return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return XJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return XJ.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof hm.CronTime))throw new fv.CronError("time must be an instance of CronTime.");let i=this._isActive;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){return Nm(this,void 0,void 0,function*(){if(this.waitForCompletion&&this._isCallbackRunning)return;this._isCallbackRunning=!0;try{for(let n of this._callbacks){let i=n.call(this.context,this.onComplete);if(this.waitForCompletion)yield i}}catch(n){if(this.errorHandler!=null)this.errorHandler(n);else console.error("[Cron] error in callback",n)}finally{this._isCallbackRunning=!1}})}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this._isActive)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(m)=>{if(c=Date.now(),this._timeout=setTimeout(x,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let m=c+i-Date.now();if(m>0){let a=this.cronTime.getTimeout();if(a>m)a=m;o+=a}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this._isActive=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this._isActive=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}_executeOnComplete(){return Nm(this,void 0,void 0,function*(){if(typeof this.onComplete!=="function")return;try{yield this.onComplete.call(this.context)}catch(n){console.error("[Cron] error in onComplete callback:",n)}})}_waitForJobCompletion(){return Nm(this,void 0,void 0,function*(){while(this._isCallbackRunning)yield new Promise((n)=>setTimeout(n,100))})}stop(){if(this._timeout)clearTimeout(this._timeout);if(this._isActive=!1,!this.waitForCompletion){this._executeOnComplete();return}Promise.resolve().then(()=>Nm(this,void 0,void 0,function*(){yield this._waitForJobCompletion(),yield this._executeOnComplete()}))}}Rp.CronJob=Mx});var $v=C((Cm)=>{Object.defineProperty(Cm,"__esModule",{value:!0});Cm.validateCronExpression=Cm.timeout=Cm.sendAt=Cm.CronTime=Cm.CronJob=void 0;var vv=Lm(),HX=WJ();Object.defineProperty(Cm,"CronJob",{enumerable:!0,get:function(){return HX.CronJob}});var zX=Lm();Object.defineProperty(Cm,"CronTime",{enumerable:!0,get:function(){return zX.CronTime}});var QX=(n)=>new vv.CronTime(n).sendAt();Cm.sendAt=QX;var EX=(n)=>new vv.CronTime(n).getTimeout();Cm.timeout=EX;Cm.validateCronExpression=vv.CronTime.validateCronExpression});var FT=C((DD,Ov)=>{Ov.exports=AT;Ov.exports.preferredCharsets=AT;var NX=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function hX(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=CX(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function CX(n,i){var o=NX.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{charset:c,q:p,i}}function IX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=yX(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function yX(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function AT(n,i){var o=hX(n===void 0?"*":n||"");if(!i)return o.filter(JT).sort(wT).map(kX);var c=i.map(function p(x,m){return IX(x,o,m)});return c.filter(JT).sort(wT).map(function p(x){return i[c.indexOf(x)]})}function wT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function kX(n){return n.charset}function JT(n){return n.q>0}});var WT=C((LD,Uv)=>{Uv.exports=XT;Uv.exports.preferredEncodings=XT;var ZX=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function qX(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=sX(i[p].trim(),p);if(m)i[x++]=m,o=o||ST("identity",m),c=Math.min(c,m.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function sX(n,i){var o=ZX.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{encoding:c,q:p,i}}function PX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=ST(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function ST(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function XT(n,i){var o=qX(n||"");if(!i)return o.filter(RT).sort(TT).map(tX);var c=i.map(function p(x,m){return PX(x,o,m)});return c.filter(RT).sort(TT).map(function p(x){return i[c.indexOf(x)]})}function TT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function tX(n){return n.encoding}function RT(n){return n.q>0}});var YT=C((ND,Vv)=>{Vv.exports=MT;Vv.exports.preferredLanguages=MT;var rX=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function dX(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=GT(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function GT(n,i){var o=rX.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var m=1;if(o[3]){var a=o[3].split(";");for(var f=0;f<a.length;f++){var v=a[f].split("=");if(v[0]==="q")m=parseFloat(v[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function gX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=eX(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function eX(n,i,o){var c=GT(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function MT(n,i){var o=dX(n===void 0?"*":n||"");if(!i)return o.filter(lT).sort(KT).map(nW);var c=i.map(function p(x,m){return gX(x,o,m)});return c.filter(lT).sort(KT).map(function p(x){return i[c.indexOf(x)]})}function KT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function nW(n){return n.full}function lT(n){return n.q>0}});var UT=C((hD,_v)=>{_v.exports=ET;_v.exports.preferredMediaTypes=ET;var iW=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function oW(n){var i=aW(n);for(var o=0,c=0;o<i.length;o++){var p=QT(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function QT(n,i){var o=iW.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var a=fW(o[3]).map(mW);for(var f=0;f<a.length;f++){var v=a[f],$=v[0].toLowerCase(),w=v[1],J=w&&w[0]==='"'&&w[w.length-1]==='"'?w.substr(1,w.length-2):w;if($==="q"){p=parseFloat(J);break}c[$]=J}}return{type:m,subtype:x,params:c,q:p,i}}function cW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=pW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function pW(n,i,o){var c=QT(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var x=Object.keys(i.params);if(x.length>0)if(x.every(function(m){return i.params[m]=="*"||(i.params[m]||"").toLowerCase()==(c.params[m]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function ET(n,i){var o=oW(n===void 0?"*/*":n||"");if(!i)return o.filter(zT).sort(HT).map(xW);var c=i.map(function p(x,m){return cW(x,o,m)});return c.filter(zT).sort(HT).map(function p(x){return i[c.indexOf(x)]})}function HT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function xW(n){return n.type+"/"+n.subtype}function zT(n){return n.q>0}function OT(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function mW(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function aW(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(OT(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function fW(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(OT(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var VT=C((CD,bv)=>{/*!
6
6
  * negotiator
7
7
  * Copyright(c) 2012 Federico Romero
8
8
  * Copyright(c) 2012-2014 Isaac Z. Schlueter
9
9
  * Copyright(c) 2015 Douglas Christopher Wilson
10
10
  * MIT Licensed
11
- */var o5=fF(),c5=JF(),p5=XF(),x5=lF();Vv.exports=Mn;Vv.exports.Negotiator=Mn;function Mn(n){if(!(this instanceof Mn))return new Mn(n);this.request=n}Mn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Mn.prototype.charsets=function n(i){return o5(this.request.headers["accept-charset"],i)};Mn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Mn.prototype.encodings=function n(i){return c5(this.request.headers["accept-encoding"],i)};Mn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Mn.prototype.languages=function n(i){return p5(this.request.headers["accept-language"],i)};Mn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Mn.prototype.mediaTypes=function n(i){return x5(this.request.headers.accept,i)};Mn.prototype.preferredCharset=Mn.prototype.charset;Mn.prototype.preferredCharsets=Mn.prototype.charsets;Mn.prototype.preferredEncoding=Mn.prototype.encoding;Mn.prototype.preferredEncodings=Mn.prototype.encodings;Mn.prototype.preferredLanguage=Mn.prototype.language;Mn.prototype.preferredLanguages=Mn.prototype.languages;Mn.prototype.preferredMediaType=Mn.prototype.mediaType;Mn.prototype.preferredMediaTypes=Mn.prototype.mediaTypes});var MF=C((jD,m5)=>{m5.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var QF=C((LD,zF)=>{/*!
11
+ */var vW=FT(),$W=WT(),wW=YT(),JW=UT();bv.exports=Hn;bv.exports.Negotiator=Hn;function Hn(n){if(!(this instanceof Hn))return new Hn(n);this.request=n}Hn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Hn.prototype.charsets=function n(i){return vW(this.request.headers["accept-charset"],i)};Hn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Hn.prototype.encodings=function n(i){return $W(this.request.headers["accept-encoding"],i)};Hn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Hn.prototype.languages=function n(i){return wW(this.request.headers["accept-language"],i)};Hn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Hn.prototype.mediaTypes=function n(i){return JW(this.request.headers.accept,i)};Hn.prototype.preferredCharset=Hn.prototype.charset;Hn.prototype.preferredCharsets=Hn.prototype.charsets;Hn.prototype.preferredEncoding=Hn.prototype.encoding;Hn.prototype.preferredEncodings=Hn.prototype.encodings;Hn.prototype.preferredLanguage=Hn.prototype.language;Hn.prototype.preferredLanguages=Hn.prototype.languages;Hn.prototype.preferredMediaType=Hn.prototype.mediaType;Hn.prototype.preferredMediaTypes=Hn.prototype.mediaTypes});var _T=C((ID,AW)=>{AW.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var uT=C((yD,bT)=>{/*!
12
12
  * mime-db
13
13
  * Copyright(c) 2014 Jonathan Ong
14
14
  * Copyright(c) 2015-2022 Douglas Christopher Wilson
15
15
  * MIT Licensed
16
- */zF.exports=MF()});var _F=C((A5)=>{/*!
16
+ */bT.exports=_T()});var NT=C((KW)=>{/*!
17
17
  * mime-types
18
18
  * Copyright(c) 2014 Jonathan Ong
19
19
  * Copyright(c) 2015 Douglas Christopher Wilson
20
20
  * MIT Licensed
21
- */var af=QF(),f5=Sn("path").extname,EF=/^\s*([^;\s]*)(?:;|\s|$)/,a5=/^text\//i;A5.charset=OF;A5.charsets={lookup:OF};A5.contentType=v5;A5.extension=$5;A5.extensions=Object.create(null);A5.lookup=w5;A5.types=Object.create(null);J5(A5.extensions,A5.types);function OF(n){if(!n||typeof n!=="string")return!1;var i=EF.exec(n),o=i&&af[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&a5.test(i[1]))return"UTF-8";return!1}function v5(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?A5.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=A5.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function $5(n){if(!n||typeof n!=="string")return!1;var i=EF.exec(n),o=i&&A5.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function w5(n){if(!n||typeof n!=="string")return!1;var i=f5("x."+n).toLowerCase().substr(1);if(!i)return!1;return A5.types[i]||!1}function J5(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(af).forEach(function c(p){var x=af[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var f=0;f<m.length;f++){var a=m[f];if(i[a]){var v=o.indexOf(af[i[a]].source),$=o.indexOf(x.source);if(i[a]!=="application/octet-stream"&&(v>$||v===$&&i[a].substr(0,12)==="application/"))continue}i[a]=p}})}});var vf=C((ND,BF)=>{/*!
21
+ */var fa=uT(),FW=Kn("node:path").extname,BT=/^\s*([^;\s]*)(?:;|\s|$)/,TW=/^text\//i;KW.charset=jT;KW.charsets={lookup:jT};KW.contentType=RW;KW.extension=SW;KW.extensions=Object.create(null);KW.lookup=XW;KW.types=Object.create(null);WW(KW.extensions,KW.types);function jT(n){if(!n||typeof n!=="string")return!1;var i=BT.exec(n),o=i&&fa[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&TW.test(i[1]))return"UTF-8";return!1}function RW(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?KW.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=KW.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function SW(n){if(!n||typeof n!=="string")return!1;var i=BT.exec(n),o=i&&KW.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function XW(n){if(!n||typeof n!=="string")return!1;var i=FW("x."+n).toLowerCase().substr(1);if(!i)return!1;return KW.types[i]||!1}function WW(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(fa).forEach(function c(p){var x=fa[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var a=0;a<m.length;a++){var f=m[a];if(i[f]){var v=o.indexOf(fa[i[f]].source),$=o.indexOf(x.source);if(i[f]!=="application/octet-stream"&&(v>$||v===$&&i[f].substr(0,12)==="application/"))continue}i[f]=p}})}});var va=C((ZD,hT)=>{/*!
22
22
  * accepts
23
23
  * Copyright(c) 2014 Jonathan Ong
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var X5=HF(),W5=_F();BF.exports=hi;function hi(n){if(!(this instanceof hi))return new hi(n);this.headers=n.headers,this.negotiator=new X5(n)}hi.prototype.type=hi.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(K5),p=this.negotiator.mediaTypes(c.filter(S5)),x=p[0];return x?i[c.indexOf(x)]:!1};hi.prototype.encoding=hi.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};hi.prototype.charset=hi.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};hi.prototype.lang=hi.prototype.langs=hi.prototype.language=hi.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function K5(n){return n.indexOf("/")===-1?W5.lookup(n):n}function S5(n){return typeof n==="string"}});var jv=C((bF,jF)=>{/*!
26
+ */var YW=VT(),HW=NT();hT.exports=hi;function hi(n){if(!(this instanceof hi))return new hi(n);this.headers=n.headers,this.negotiator=new YW(n)}hi.prototype.type=hi.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(zW),p=this.negotiator.mediaTypes(c.filter(QW)),x=p[0];return x?i[c.indexOf(x)]:!1};hi.prototype.encoding=hi.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};hi.prototype.charset=hi.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};hi.prototype.lang=hi.prototype.langs=hi.prototype.language=hi.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function zW(n){return n.indexOf("/")===-1?HW.lookup(n):n}function QW(n){return typeof n==="string"}});var Dv=C((CT,IT)=>{/*!
27
27
  * base64id v0.1.0
28
- */var _x=Sn("crypto"),bv=function(){};bv.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return _x.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return _x.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,_x.randomBytes(i,function(m,f){o.bytesBuffer=f,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return _x.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};bv.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),_x.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};bF=jF.exports=new bv});var $f=C((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.ERROR_PACKET=DF.PACKET_TYPES_REVERSE=DF.PACKET_TYPES=void 0;var Mo=Object.create(null);DF.PACKET_TYPES=Mo;Mo.open="0";Mo.close="1";Mo.ping="2";Mo.pong="3";Mo.message="4";Mo.upgrade="5";Mo.noop="6";var LF=Object.create(null);DF.PACKET_TYPES_REVERSE=LF;Object.keys(Mo).forEach((n)=>{LF[Mo[n]]=n});var G5={type:"error",data:"parser error"};DF.ERROR_PACKET=G5});var uF=C((CF)=>{Object.defineProperty(CF,"__esModule",{value:!0});CF.encodePacket=void 0;CF.encodePacketToBinary=z5;var H5=$f(),M5=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+hF(i,!0).toString("base64"));return c(H5.PACKET_TYPES[n]+(i||""))};CF.encodePacket=M5;var hF=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},Lv;function z5(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(hF(n.data,!1));CF.encodePacket(n,!0,(o)=>{if(!Lv)Lv=new TextEncoder;i(Lv.encode(o))})}});var ZF=C((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});yF.decodePacket=void 0;var wf=$f(),E5=(n,i)=>{if(typeof n!=="string")return{type:"message",data:IF(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:IF(c,i)}}if(!wf.PACKET_TYPES_REVERSE[o])return wf.ERROR_PACKET;return n.length>1?{type:wf.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:wf.PACKET_TYPES_REVERSE[o]}};yF.decodePacket=E5;var IF=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var Bx=C((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});Tf.decodePayload=Tf.decodePacket=Tf.encodePayload=Tf.encodePacket=Tf.protocol=void 0;Tf.createPacketEncoderStream=V5;Tf.createPacketDecoderStream=_5;var hv=uF();Object.defineProperty(Tf,"encodePacket",{enumerable:!0,get:function(){return hv.encodePacket}});var Cv=ZF();Object.defineProperty(Tf,"decodePacket",{enumerable:!0,get:function(){return Cv.decodePacket}});var qF=$f(),PF=String.fromCharCode(30),O5=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{hv.encodePacket(x,!1,(f)=>{if(c[m]=f,++p===o)i(c.join(PF))})})};Tf.encodePayload=O5;var U5=(n,i)=>{let o=n.split(PF),c=[];for(let p=0;p<o.length;p++){let x=Cv.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Tf.decodePayload=U5;function V5(){return new TransformStream({transform(n,i){hv.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var Nv;function Jf(n){return n.reduce((i,o)=>i+o.length,0)}function Af(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function _5(n,i){if(!Nv)Nv=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,f){o.push(m);while(!0){if(c===0){if(Jf(o)<1)break;let a=Af(o,1);if(x=(a[0]&128)===128,p=a[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Jf(o)<2)break;let a=Af(o,2);p=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),c=3}else if(c===2){if(Jf(o)<8)break;let a=Af(o,8),v=new DataView(a.buffer,a.byteOffset,a.length),$=v.getUint32(0);if($>Math.pow(2,21)-1){f.enqueue(qF.ERROR_PACKET);break}p=$*Math.pow(2,32)+v.getUint32(4),c=3}else{if(Jf(o)<p)break;let a=Af(o,p);f.enqueue(Cv.decodePacket(x?a:Nv.decode(a),i)),c=0}if(p===0||p>n){f.enqueue(qF.ERROR_PACKET);break}}}})}Tf.protocol=4});var dF=C((ZD,gF)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var oc=String.fromCharCode;function rF(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function D5(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=oc(c>>>10&1023|55296),c=56320|c&1023;p+=oc(c)}return p}function tF(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function uv(n,i){return oc(n>>i&63|128)}function N5(n,i){if((n&4294967168)==0)return oc(n);var o="";if((n&4294965248)==0)o=oc(n>>6&31|192);else if((n&4294901760)==0){if(!tF(n,i))n=65533;o=oc(n>>12&15|224),o+=uv(n,6)}else if((n&4292870144)==0)o=oc(n>>18&7|240),o+=uv(n,12),o+=uv(n,6);return o+=oc(n&63|128),o}function h5(n,i){i=i||{};var o=i.strict!==!1,c=rF(n),p=c.length,x=-1,m,f="";while(++x<p)m=c[x],f+=N5(m,o);return f}function Wp(){if(cc>=Rf)throw Error("Invalid byte index");var n=Ff[cc]&255;if(cc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function C5(n){var i,o,c,p,x;if(cc>Rf)throw Error("Invalid byte index");if(cc==Rf)return!1;if(i=Ff[cc]&255,cc++,(i&128)==0)return i;if((i&224)==192)if(o=Wp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Wp(),c=Wp(),x=(i&15)<<12|o<<6|c,x>=2048)return tF(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Wp(),c=Wp(),p=Wp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ff,Rf,cc;function u5(n,i){i=i||{};var o=i.strict!==!1;Ff=rF(n),Rf=Ff.length,cc=0;var c=[],p;while((p=C5(o))!==!1)c.push(p);return D5(c)}gF.exports={version:"2.1.2",encode:h5,decode:u5}});var f4=C((m4)=>{Object.defineProperty(m4,"__esModule",{value:!0});m4.packets=m4.protocol=void 0;m4.encodePacket=Iv;m4.encodeBase64Packet=i4;m4.decodePacket=yv;m4.decodeBase64Packet=o4;m4.encodePayload=Z5;m4.decodePayload=P5;m4.encodePayloadAsBinary=p4;m4.decodePayloadAsBinary=x4;var n4=dF();m4.protocol=3;var I5=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};m4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Kp=Object.keys(m4.packets),vo={type:"error",data:"parser error"},y5=Buffer.concat([]);function Iv(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return eF(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return eF({type:n.type,data:kv(n.data)},i,c);var p=m4.packets[n.type];if(n.data!==void 0)p+=o?n4.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function eF(n,i,o){if(!i)return i4(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=m4.packets[n.type],o(Buffer.concat([p,c]))}function i4(n,i){var o=Buffer.isBuffer(n.data)?n.data:kv(n.data),c="b"+m4.packets[n.type];return c+=o.toString("base64"),i(c)}function yv(n,i,o){if(n===void 0)return vo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return o4(n.slice(1),i);if(o){if(n=k5(n),n===!1)return vo}if(Number(c)!=c||!Kp[c])return vo;if(n.length>1)return{type:Kp[c],data:n.slice(1)};else return{type:Kp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Kp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=kv(n);return c=n[0],{type:Kp[c],data:n.slice(1)}}function k5(n){try{n=n4.decode(n,{strict:!1})}catch(i){return!1}return n}function o4(n,i){var o=Kp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function Z5(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&I5(n))return p4(n,o);if(!n.length)return o("0:");function c(p,x){Iv(p,i,!1,function(m){x(null,q5(m))})}c4(n,c,function(p,x){return o(x.join(""))})}function q5(n){return n.length+":"+n}function c4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,f)=>{if(c[x]=f,++p===n.length)o(null,c)})}function P5(n,i,o){if(typeof n!=="string")return x4(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(vo,0,1);var c="",p,x,m;for(var f=0,a=n.length;f<a;f++){var v=n.charAt(f);if(v!==":"){c+=v;continue}if(c===""||c!=(p=Number(c)))return o(vo,0,1);if(x=n.slice(f+1,f+1+p),c!=x.length)return o(vo,0,1);if(x.length){if(m=yv(x,i,!1),vo.type===m.type&&vo.data===m.data)return o(vo,0,1);var $=o(m,f+p,a);if($===!1)return}f+=p,c=""}if(c!=="")return o(vo,0,1)}function s5(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function r5(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function kv(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function p4(n,i){if(!n.length)return i(y5);c4(n,t5,function(o,c){return i(Buffer.concat(c))})}function t5(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);return x[x.length-1]=255,i(null,Buffer.concat([x,r5(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}Iv(n,!0,!0,o)}function x4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",f=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o(vo,0,1);m+=""+c[x]}c=c.slice(m.length+1);var a=parseInt(m,10),v=c.slice(1,a+1);if(f)v=s5(v);p.push(v),c=c.slice(a+1)}var $=p.length;for(x=0;x<$;x++){var w=p[x];o(yv(w,i,!0),x,$)}}});var v4=C((PD,a4)=>{var Gp=1000,Yp=Gp*60,lp=Yp*60,Uc=lp*24,mK=Uc*7,fK=Uc*365.25;a4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return aK(n);else if(o==="number"&&isFinite(n))return i.long?$K(n):vK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function aK(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*fK;case"weeks":case"week":case"w":return o*mK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*lp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Yp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Gp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function vK(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=lp)return Math.round(n/lp)+"h";if(i>=Yp)return Math.round(n/Yp)+"m";if(i>=Gp)return Math.round(n/Gp)+"s";return n+"ms"}function $K(n){var i=Math.abs(n);if(i>=Uc)return Xf(n,i,Uc,"day");if(i>=lp)return Xf(n,i,lp,"hour");if(i>=Yp)return Xf(n,i,Yp,"minute");if(i>=Gp)return Xf(n,i,Gp,"second");return n+" ms"}function Xf(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var Zv=C((sD,$4)=>{function wK(n){o.debug=o,o.default=o,o.coerce=a,o.disable=x,o.enable=p,o.enabled=m,o.humanize=v4(),o.destroy=v,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let w=0;for(let J=0;J<$.length;J++)w=(w<<5)-w+$.charCodeAt(J),w|=0;return o.colors[Math.abs(w)%o.colors.length]}o.selectColor=i;function o($){let w,J=null,X,W;function R(...S){if(!R.enabled)return;let l=R,H=Number(new Date),I=H-(w||H);if(l.diff=I,l.prev=w,l.curr=H,w=H,S[0]=o.coerce(S[0]),typeof S[0]!=="string")S.unshift("%O");let Y=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(E,Q)=>{if(E==="%%")return"%";Y++;let b=o.formatters[Q];if(typeof b==="function"){let y=S[Y];E=b.call(l,y),S.splice(Y,1),Y--}return E}),o.formatArgs.call(l,S),(l.log||o.log).apply(l,S)}if(R.namespace=$,R.useColors=o.useColors(),R.color=o.selectColor($),R.extend=c,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(J!==null)return J;if(X!==o.namespaces)X=o.namespaces,W=o.enabled($);return W},set:(S)=>{J=S}}),typeof o.init==="function")o.init(R);return R}function c($,w){let J=o(this.namespace+(typeof w==="undefined"?":":w)+$);return J.log=this.log,J}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let w,J=(typeof $==="string"?$:"").split(/[\s,]+/),X=J.length;for(w=0;w<X;w++){if(!J[w])continue;if($=J[w].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(f),...o.skips.map(f).map((w)=>"-"+w)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let w,J;for(w=0,J=o.skips.length;w<J;w++)if(o.skips[w].test($))return!1;for(w=0,J=o.names.length;w<J;w++)if(o.names[w].test($))return!0;return!1}function f($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function a($){if($ instanceof Error)return $.stack||$.message;return $}function v(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}$4.exports=wK});var J4=C((w4,Kf)=>{w4.formatArgs=AK;w4.save=TK;w4.load=FK;w4.useColors=JK;w4.storage=RK();w4.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();w4.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function JK(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function AK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Kf.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}w4.log=console.debug||console.log||(()=>{});function TK(n){try{if(n)w4.storage.setItem("debug",n);else w4.storage.removeItem("debug")}catch(i){}}function FK(){let n;try{n=w4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function RK(){try{return localStorage}catch(n){}}Kf.exports=Zv()(w4);var{formatters:XK}=Kf.exports;XK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var T4=C((tD,A4)=>{A4.exports=(n,i=process.argv)=>{let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1||c<p)}});var X4=C((gD,R4)=>{var MK=Sn("os"),F4=Sn("tty"),gi=T4(),{env:ai}=process,Sf;if(gi("no-color")||gi("no-colors")||gi("color=false")||gi("color=never"))Sf=0;else if(gi("color")||gi("colors")||gi("color=true")||gi("color=always"))Sf=1;function zK(){if("FORCE_COLOR"in ai){if(ai.FORCE_COLOR==="true")return 1;if(ai.FORCE_COLOR==="false")return 0;return ai.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ai.FORCE_COLOR,10),3)}}function QK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function EK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=zK();if(c!==void 0)Sf=c;let p=o?Sf:c;if(p===0)return 0;if(o){if(gi("color=16m")||gi("color=full")||gi("color=truecolor"))return 3;if(gi("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if(ai.TERM==="dumb")return x;if(process.platform==="win32"){let m=MK.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in ai){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in ai))||ai.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in ai)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ai.TEAMCITY_VERSION)?1:0;if(ai.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ai){let m=Number.parseInt((ai.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ai.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ai.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ai.TERM))return 1;if("COLORTERM"in ai)return 1;return x}function qv(n,i={}){let o=EK(n,{streamIsTTY:n&&n.isTTY,...i});return QK(o)}R4.exports={supportsColor:qv,stdout:qv({isTTY:F4.isatty(1)}),stderr:qv({isTTY:F4.isatty(2)})}});var G4=C((K4,Yf)=>{var OK=Sn("tty"),Gf=Sn("util");K4.init=LK;K4.log=BK;K4.formatArgs=VK;K4.save=bK;K4.load=jK;K4.useColors=UK;K4.destroy=Gf.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");K4.colors=[6,2,3,4,5,1];try{let n=X4();if(n&&(n.stderr||n).level>=2)K4.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}K4.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,x)=>{return x.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function UK(){return"colors"in K4.inspectOpts?Boolean(K4.inspectOpts.colors):OK.isatty(process.stderr.fd)}function VK(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
28
+ */var bx=Kn("node:crypto"),jv=function(){};jv.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return bx.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return bx.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,bx.randomBytes(i,function(m,a){o.bytesBuffer=a,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return bx.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};jv.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),bx.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};CT=IT.exports=new jv});var $a=C((kT)=>{Object.defineProperty(kT,"__esModule",{value:!0});kT.ERROR_PACKET=kT.PACKET_TYPES_REVERSE=kT.PACKET_TYPES=void 0;var Ho=Object.create(null);kT.PACKET_TYPES=Ho;Ho.open="0";Ho.close="1";Ho.ping="2";Ho.pong="3";Ho.message="4";Ho.upgrade="5";Ho.noop="6";var yT=Object.create(null);kT.PACKET_TYPES_REVERSE=yT;Object.keys(Ho).forEach((n)=>{yT[Ho[n]]=n});var EW={type:"error",data:"parser error"};kT.ERROR_PACKET=EW});var PT=C((sT)=>{Object.defineProperty(sT,"__esModule",{value:!0});sT.encodePacket=void 0;sT.encodePacketToBinary=bW;var VW=$a(),_W=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+qT(i,!0).toString("base64"));return c(VW.PACKET_TYPES[n]+(i||""))};sT.encodePacket=_W;var qT=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},Lv;function bW(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(qT(n.data,!1));sT.encodePacket(n,!0,(o)=>{if(!Lv)Lv=new TextEncoder;i(Lv.encode(o))})}});var gT=C((rT)=>{Object.defineProperty(rT,"__esModule",{value:!0});rT.decodePacket=void 0;var wa=$a(),BW=(n,i)=>{if(typeof n!=="string")return{type:"message",data:tT(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:tT(c,i)}}if(!wa.PACKET_TYPES_REVERSE[o])return wa.ERROR_PACKET;return n.length>1?{type:wa.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:wa.PACKET_TYPES_REVERSE[o]}};rT.decodePacket=BW;var tT=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var ux=C((Fa)=>{Object.defineProperty(Fa,"__esModule",{value:!0});Fa.decodePayload=Fa.decodePacket=Fa.encodePayload=Fa.encodePacket=Fa.protocol=void 0;Fa.createPacketEncoderStream=LW;Fa.createPacketDecoderStream=NW;var Cv=PT();Object.defineProperty(Fa,"encodePacket",{enumerable:!0,get:function(){return Cv.encodePacket}});var Iv=gT();Object.defineProperty(Fa,"decodePacket",{enumerable:!0,get:function(){return Iv.decodePacket}});var eT=$a(),n4=String.fromCharCode(30),jW=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{Cv.encodePacket(x,!1,(a)=>{if(c[m]=a,++p===o)i(c.join(n4))})})};Fa.encodePayload=jW;var DW=(n,i)=>{let o=n.split(n4),c=[];for(let p=0;p<o.length;p++){let x=Iv.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Fa.decodePayload=DW;function LW(){return new TransformStream({transform(n,i){Cv.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var hv;function Ja(n){return n.reduce((i,o)=>i+o.length,0)}function Aa(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function NW(n,i){if(!hv)hv=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,a){o.push(m);while(!0){if(c===0){if(Ja(o)<1)break;let f=Aa(o,1);if(x=(f[0]&128)===128,p=f[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Ja(o)<2)break;let f=Aa(o,2);p=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),c=3}else if(c===2){if(Ja(o)<8)break;let f=Aa(o,8),v=new DataView(f.buffer,f.byteOffset,f.length),$=v.getUint32(0);if($>Math.pow(2,21)-1){a.enqueue(eT.ERROR_PACKET);break}p=$*Math.pow(2,32)+v.getUint32(4),c=3}else{if(Ja(o)<p)break;let f=Aa(o,p);a.enqueue(Iv.decodePacket(x?f:hv.decode(f),i)),c=0}if(p===0||p>n){a.enqueue(eT.ERROR_PACKET);break}}}})}Fa.protocol=4});var x4=C((gD,p4)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var oc=String.fromCharCode;function o4(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function kW(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=oc(c>>>10&1023|55296),c=56320|c&1023;p+=oc(c)}return p}function c4(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function yv(n,i){return oc(n>>i&63|128)}function ZW(n,i){if((n&4294967168)==0)return oc(n);var o="";if((n&4294965248)==0)o=oc(n>>6&31|192);else if((n&4294901760)==0){if(!c4(n,i))n=65533;o=oc(n>>12&15|224),o+=yv(n,6)}else if((n&4292870144)==0)o=oc(n>>18&7|240),o+=yv(n,12),o+=yv(n,6);return o+=oc(n&63|128),o}function qW(n,i){i=i||{};var o=i.strict!==!1,c=o4(n),p=c.length,x=-1,m,a="";while(++x<p)m=c[x],a+=ZW(m,o);return a}function Xp(){if(cc>=Ra)throw Error("Invalid byte index");var n=Ta[cc]&255;if(cc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function sW(n){var i,o,c,p,x;if(cc>Ra)throw Error("Invalid byte index");if(cc==Ra)return!1;if(i=Ta[cc]&255,cc++,(i&128)==0)return i;if((i&224)==192)if(o=Xp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Xp(),c=Xp(),x=(i&15)<<12|o<<6|c,x>=2048)return c4(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Xp(),c=Xp(),p=Xp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ta,Ra,cc;function PW(n,i){i=i||{};var o=i.strict!==!1;Ta=o4(n),Ra=Ta.length,cc=0;var c=[],p;while((p=sW(o))!==!1)c.push(p);return kW(c)}p4.exports={version:"2.1.2",encode:qW,decode:PW}});var F4=C((A4)=>{Object.defineProperty(A4,"__esModule",{value:!0});A4.packets=A4.protocol=void 0;A4.encodePacket=kv;A4.encodeBase64Packet=f4;A4.decodePacket=Zv;A4.decodeBase64Packet=v4;A4.encodePayload=gW;A4.decodePayload=nK;A4.encodePayloadAsBinary=w4;A4.decodePayloadAsBinary=J4;var a4=x4();A4.protocol=3;var tW=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};A4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Wp=Object.keys(A4.packets),$o={type:"error",data:"parser error"},rW=Buffer.concat([]);function kv(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return m4(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return m4({type:n.type,data:qv(n.data)},i,c);var p=A4.packets[n.type];if(n.data!==void 0)p+=o?a4.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function m4(n,i,o){if(!i)return f4(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=A4.packets[n.type],o(Buffer.concat([p,c]))}function f4(n,i){var o=Buffer.isBuffer(n.data)?n.data:qv(n.data),c="b"+A4.packets[n.type];return c+=o.toString("base64"),i(c)}function Zv(n,i,o){if(n===void 0)return $o;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return v4(n.slice(1),i);if(o){if(n=dW(n),n===!1)return $o}if(Number(c)!=c||!Wp[c])return $o;if(n.length>1)return{type:Wp[c],data:n.slice(1)};else return{type:Wp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Wp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=qv(n);return c=n[0],{type:Wp[c],data:n.slice(1)}}function dW(n){try{n=a4.decode(n,{strict:!1})}catch(i){return!1}return n}function v4(n,i){var o=Wp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function gW(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&tW(n))return w4(n,o);if(!n.length)return o("0:");function c(p,x){kv(p,i,!1,function(m){x(null,eW(m))})}$4(n,c,function(p,x){return o(x.join(""))})}function eW(n){return n.length+":"+n}function $4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,a)=>{if(c[x]=a,++p===n.length)o(null,c)})}function nK(n,i,o){if(typeof n!=="string")return J4(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o($o,0,1);var c="",p,x,m;for(var a=0,f=n.length;a<f;a++){var v=n.charAt(a);if(v!==":"){c+=v;continue}if(c===""||c!=(p=Number(c)))return o($o,0,1);if(x=n.slice(a+1,a+1+p),c!=x.length)return o($o,0,1);if(x.length){if(m=Zv(x,i,!1),$o.type===m.type&&$o.data===m.data)return o($o,0,1);var $=o(m,a+p,f);if($===!1)return}a+=p,c=""}if(c!=="")return o($o,0,1)}function iK(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function oK(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function qv(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function w4(n,i){if(!n.length)return i(rW);$4(n,cK,function(o,c){return i(Buffer.concat(c))})}function cK(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);return x[x.length-1]=255,i(null,Buffer.concat([x,oK(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}kv(n,!0,!0,o)}function J4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",a=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o($o,0,1);m+=""+c[x]}c=c.slice(m.length+1);var f=parseInt(m,10),v=c.slice(1,f+1);if(a)v=iK(v);p.push(v),c=c.slice(f+1)}var $=p.length;for(x=0;x<$;x++){var w=p[x];o(Zv(w,i,!0),x,$)}}});var R4=C((nL,T4)=>{var lp=1000,Gp=lp*60,Mp=Gp*60,Uc=Mp*24,AK=Uc*7,FK=Uc*365.25;T4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return TK(n);else if(o==="number"&&isFinite(n))return i.long?SK(n):RK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function TK(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*FK;case"weeks":case"week":case"w":return o*AK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Mp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Gp;case"seconds":case"second":case"secs":case"sec":case"s":return o*lp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function RK(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=Mp)return Math.round(n/Mp)+"h";if(i>=Gp)return Math.round(n/Gp)+"m";if(i>=lp)return Math.round(n/lp)+"s";return n+"ms"}function SK(n){var i=Math.abs(n);if(i>=Uc)return Sa(n,i,Uc,"day");if(i>=Mp)return Sa(n,i,Mp,"hour");if(i>=Gp)return Sa(n,i,Gp,"minute");if(i>=lp)return Sa(n,i,lp,"second");return n+" ms"}function Sa(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var sv=C((iL,S4)=>{function XK(n){o.debug=o,o.default=o,o.coerce=f,o.disable=x,o.enable=p,o.enabled=m,o.humanize=R4(),o.destroy=v,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let w=0;for(let J=0;J<$.length;J++)w=(w<<5)-w+$.charCodeAt(J),w|=0;return o.colors[Math.abs(w)%o.colors.length]}o.selectColor=i;function o($){let w,J=null,S,X;function R(...K){if(!R.enabled)return;let M=R,Y=Number(new Date),I=Y-(w||Y);if(M.diff=I,M.prev=w,M.curr=Y,w=Y,K[0]=o.coerce(K[0]),typeof K[0]!=="string")K.unshift("%O");let G=0;K[0]=K[0].replace(/%([a-zA-Z%])/g,(E,Q)=>{if(E==="%%")return"%";G++;let b=o.formatters[Q];if(typeof b==="function"){let y=K[G];E=b.call(M,y),K.splice(G,1),G--}return E}),o.formatArgs.call(M,K),(M.log||o.log).apply(M,K)}if(R.namespace=$,R.useColors=o.useColors(),R.color=o.selectColor($),R.extend=c,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(J!==null)return J;if(S!==o.namespaces)S=o.namespaces,X=o.enabled($);return X},set:(K)=>{J=K}}),typeof o.init==="function")o.init(R);return R}function c($,w){let J=o(this.namespace+(typeof w==="undefined"?":":w)+$);return J.log=this.log,J}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let w,J=(typeof $==="string"?$:"").split(/[\s,]+/),S=J.length;for(w=0;w<S;w++){if(!J[w])continue;if($=J[w].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(a),...o.skips.map(a).map((w)=>"-"+w)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let w,J;for(w=0,J=o.skips.length;w<J;w++)if(o.skips[w].test($))return!1;for(w=0,J=o.names.length;w<J;w++)if(o.names[w].test($))return!0;return!1}function a($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function f($){if($ instanceof Error)return $.stack||$.message;return $}function v(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}S4.exports=XK});var W4=C((X4,Wa)=>{X4.formatArgs=KK;X4.save=lK;X4.load=GK;X4.useColors=WK;X4.storage=MK();X4.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();X4.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function WK(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function KK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Wa.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}X4.log=console.debug||console.log||(()=>{});function lK(n){try{if(n)X4.storage.setItem("debug",n);else X4.storage.removeItem("debug")}catch(i){}}function GK(){let n;try{n=X4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function MK(){try{return localStorage}catch(n){}}Wa.exports=sv()(X4);var{formatters:YK}=Wa.exports;YK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var l4=C((cL,K4)=>{K4.exports=(n,i=process.argv)=>{let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1||c<p)}});var Y4=C((pL,M4)=>{var _K=Kn("node:os"),G4=Kn("node:tty"),gi=l4(),{env:ai}=process,Ka;if(gi("no-color")||gi("no-colors")||gi("color=false")||gi("color=never"))Ka=0;else if(gi("color")||gi("colors")||gi("color=true")||gi("color=always"))Ka=1;function bK(){if("FORCE_COLOR"in ai){if(ai.FORCE_COLOR==="true")return 1;if(ai.FORCE_COLOR==="false")return 0;return ai.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ai.FORCE_COLOR,10),3)}}function uK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function BK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=bK();if(c!==void 0)Ka=c;let p=o?Ka:c;if(p===0)return 0;if(o){if(gi("color=16m")||gi("color=full")||gi("color=truecolor"))return 3;if(gi("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if(ai.TERM==="dumb")return x;if(process.platform==="win32"){let m=_K.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in ai){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in ai))||ai.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in ai)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ai.TEAMCITY_VERSION)?1:0;if(ai.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ai){let m=Number.parseInt((ai.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ai.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ai.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ai.TERM))return 1;if("COLORTERM"in ai)return 1;return x}function Pv(n,i={}){let o=BK(n,{streamIsTTY:n&&n.isTTY,...i});return uK(o)}M4.exports={supportsColor:Pv,stdout:Pv({isTTY:G4.isatty(1)}),stderr:Pv({isTTY:G4.isatty(2)})}});var E4=C((z4,Ga)=>{var jK=Kn("node:tty"),la=Kn("node:util");z4.init=yK;z4.log=hK;z4.formatArgs=LK;z4.save=CK;z4.load=IK;z4.useColors=DK;z4.destroy=la.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");z4.colors=[6,2,3,4,5,1];try{let n=Y4();if(n&&(n.stderr||n).level>=2)z4.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}z4.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,x)=>{return x.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function DK(){return"colors"in z4.inspectOpts?Boolean(z4.inspectOpts.colors):jK.isatty(process.stderr.fd)}function LK(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
29
29
  `).join(`
30
- `+x),n.push(p+"m+"+Yf.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=_K()+i+" "+n[0]}function _K(){if(K4.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function BK(...n){return process.stderr.write(Gf.formatWithOptions(K4.inspectOpts,...n)+`
31
- `)}function bK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function jK(){return process.env.DEBUG}function LK(n){n.inspectOpts={};let i=Object.keys(K4.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=K4.inspectOpts[i[o]]}Yf.exports=Zv()(K4);var{formatters:W4}=Yf.exports;W4.o=function(n){return this.inspectOpts.colors=this.useColors,Gf.inspect(n,this.inspectOpts).split(`
32
- `).map((i)=>i.trim()).join(" ")};W4.O=function(n){return this.inspectOpts.colors=this.useColors,Gf.inspect(n,this.inspectOpts)}});var vi=C((eD,Pv)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)Pv.exports=J4();else Pv.exports=G4()});var _c=C((H4)=>{Object.defineProperty(H4,"__esModule",{value:!0});H4.Transport=void 0;var kK=Sn("events"),ZK=Bx(),qK=f4(),PK=vi(),Y4=PK.default("engine:transport");function sK(){}class l4 extends kK.EventEmitter{get readyState(){return this._readyState}set readyState(n){Y4("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?ZK:qK,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||sK)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else Y4("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}H4.Transport=l4});var sv=C((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.Polling=void 0;var rK=_c(),z4=Sn("zlib"),tK=vf(),gK=vi(),Ci=gK.default("engine:polling"),dK={gzip:z4.createGzip,deflate:z4.createDeflate};class Q4 extends rK.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){Ci("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}Ci("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)Ci("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",m),n.removeListener("end",f),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(a)=>{let v;if(o)c=Buffer.concat([c,a]),v=c.length;else c+=a,v=Buffer.byteLength(c);if(v>this.maxHttpBufferSize)i.writeHead(413).end(),p()},f=()=>{this.onData(c);let a={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,a)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",f)}onData(n){Ci('received "%s"',n);let i=(o)=>{if(o.type==="close")return Ci("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)Ci("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){Ci('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{x["Content-Length"]=typeof v==="string"?Buffer.byteLength(v):v.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(v),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let a=tK(this.req).encodings(["gzip","deflate"]);if(!a){m(n);return}this.compress(n,a,(v,$)=>{if(v){this.res.writeHead(500),this.res.end(),o(v);return}x["Content-Encoding"]=a,m($)})}compress(n,i,o){Ci("compressing");let c=[],p=0;dK[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){Ci("closing");let i;if(this.dataReq)Ci("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)Ci("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)Ci("transport discarded - closing right away"),o();else Ci("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}E4.Polling=Q4});var B4=C((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});V4.JSONP=void 0;var eK=sv(),nS=Sn("querystring"),iS=/\\\\n/g,oS=/(\\)?\\n/g;class U4 extends eK.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=nS.parse(n).d,typeof n==="string")n=n.replace(oS,function(i,o){return o?i:`
33
- `}),super.onData(n.replace(iS,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}V4.JSONP=U4});var N4=C((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.WebSocket=void 0;var cS=_c(),pS=vi(),b4=pS.default("engine:ws");class j4 extends cS.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();b4('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){b4("closing"),this.socket.close(),n&&n()}}L4.WebSocket=j4});var rv=C((C4)=>{Object.defineProperty(C4,"__esModule",{value:!0});C4.WebTransport=void 0;var xS=_c(),mS=vi(),fS=Bx(),Hp=mS.default("engine:webtransport");class h4 extends xS.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=fS.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Hp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){Hp("session is closed");break}Hp("received chunk: %o",p),this.onPacket(p)}}catch(p){Hp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Hp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Hp("closing WebTransport session"),this.session.close(),n&&n()}}C4.WebTransport=h4});var tv=C((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});var aS=sv(),vS=B4(),$S=N4(),wS=rv();y4.default={polling:I4,websocket:$S.WebSocket,webtransport:wS.WebTransport};function I4(n){if(typeof n._query.j==="string")return new vS.JSONP(n);else return new aS.Polling(n)}I4.upgradesTo=["websocket","webtransport"]});var gv=C((Z4)=>{Object.defineProperty(Z4,"__esModule",{value:!0});Z4.Socket=void 0;var AS=Sn("events"),TS=vi(),bo=Sn("timers"),Zn=TS.default("engine:socket");class k4 extends AS.EventEmitter{get readyState(){return this._readyState}set readyState(n){Zn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return Zn("packet received with closed socket");switch(Zn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got pong"),bo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){Zn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=bo.setTimeout(()=>{Zn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){bo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=bo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),x=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}onDrain(){if(this.sentCallbackFn.length>0){Zn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){Zn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=bo.setTimeout(()=>{if(Zn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(v)=>{if(v.type==="ping"&&v.data==="probe")Zn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(v.type==="upgrade"&&this.readyState!=="closed"){if(Zn("got upgrade packet - upgrading"),x(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else x(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)Zn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},x=()=>{this.upgrading=!1,clearInterval(o),bo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",f),n.removeListener("error",m),this.removeListener("close",a)},m=(v)=>{Zn("client did not complete upgrade - %s",v),x(),n.close(),n=null},f=()=>{m("transport closed")},a=()=>{m("socket closed")};n.on("packet",c),n.once("close",f),n.once("error",m),this.once("close",a)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){Zn("error triggered by discarded transport")}),this.transport.close(),bo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",bo.clearTimeout(this.pingIntervalTimer),bo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){Zn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Zn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){Zn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Zn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}Zn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(Zn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}Z4.Socket=k4});var r4=C((zS)=>{/*!
30
+ `+x),n.push(p+"m+"+Ga.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=NK()+i+" "+n[0]}function NK(){if(z4.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function hK(...n){return process.stderr.write(la.formatWithOptions(z4.inspectOpts,...n)+`
31
+ `)}function CK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function IK(){return process.env.DEBUG}function yK(n){n.inspectOpts={};let i=Object.keys(z4.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=z4.inspectOpts[i[o]]}Ga.exports=sv()(z4);var{formatters:H4}=Ga.exports;H4.o=function(n){return this.inspectOpts.colors=this.useColors,la.inspect(n,this.inspectOpts).split(`
32
+ `).map((i)=>i.trim()).join(" ")};H4.O=function(n){return this.inspectOpts.colors=this.useColors,la.inspect(n,this.inspectOpts)}});var fi=C((mL,tv)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)tv.exports=W4();else tv.exports=E4()});var _c=C((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});V4.Transport=void 0;var dK=Kn("node:events"),gK=ux(),eK=F4(),n5=fi(),O4=n5.default("engine:transport");function i5(){}class U4 extends dK.EventEmitter{get readyState(){return this._readyState}set readyState(n){O4("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?gK:eK,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||i5)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else O4("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}V4.Transport=U4});var rv=C((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.Polling=void 0;var o5=_c(),b4=Kn("node:zlib"),c5=va(),p5=fi(),Ci=p5.default("engine:polling"),x5={gzip:b4.createGzip,deflate:b4.createDeflate};class u4 extends o5.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){Ci("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}Ci("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)Ci("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",m),n.removeListener("end",a),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(f)=>{let v;if(o)c=Buffer.concat([c,f]),v=c.length;else c+=f,v=Buffer.byteLength(c);if(v>this.maxHttpBufferSize)i.writeHead(413).end(),p()},a=()=>{this.onData(c);let f={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,f)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",a)}onData(n){Ci('received "%s"',n);let i=(o)=>{if(o.type==="close")return Ci("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)Ci("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){Ci('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{x["Content-Length"]=typeof v==="string"?Buffer.byteLength(v):v.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(v),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=c5(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeHead(500),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){Ci("compressing");let c=[],p=0;x5[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){Ci("closing");let i;if(this.dataReq)Ci("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)Ci("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)Ci("transport discarded - closing right away"),o();else Ci("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}B4.Polling=u4});var h4=C((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.JSONP=void 0;var m5=rv(),a5=Kn("node:querystring"),f5=/\\\\n/g,v5=/(\\)?\\n/g;class D4 extends m5.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=a5.parse(n).d,typeof n==="string")n=n.replace(v5,function(i,o){return o?i:`
33
+ `}),super.onData(n.replace(f5,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}L4.JSONP=D4});var Z4=C((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});y4.WebSocket=void 0;var $5=_c(),w5=fi(),C4=w5.default("engine:ws");class I4 extends $5.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();C4('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){C4("closing"),this.socket.close(),n&&n()}}y4.WebSocket=I4});var dv=C((s4)=>{Object.defineProperty(s4,"__esModule",{value:!0});s4.WebTransport=void 0;var J5=_c(),A5=fi(),F5=ux(),Yp=A5.default("engine:webtransport");class q4 extends J5.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=F5.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Yp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){Yp("session is closed");break}Yp("received chunk: %o",p),this.onPacket(p)}}catch(p){Yp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Yp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Yp("closing WebTransport session"),this.session.close(),n&&n()}}s4.WebTransport=q4});var gv=C((r4)=>{Object.defineProperty(r4,"__esModule",{value:!0});var T5=rv(),R5=h4(),S5=Z4(),X5=dv();r4.default={polling:t4,websocket:S5.WebSocket,webtransport:X5.WebTransport};function t4(n){if(typeof n._query.j==="string")return new R5.JSONP(n);else return new T5.Polling(n)}t4.upgradesTo=["websocket","webtransport"]});var ev=C((g4)=>{Object.defineProperty(g4,"__esModule",{value:!0});g4.Socket=void 0;var K5=Kn("node:events"),l5=fi(),uo=Kn("node:timers"),Zn=l5.default("engine:socket");class d4 extends K5.EventEmitter{get readyState(){return this._readyState}set readyState(n){Zn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return Zn("packet received with closed socket");switch(Zn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got pong"),uo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){Zn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=uo.setTimeout(()=>{Zn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){uo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=uo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),x=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}onDrain(){if(this.sentCallbackFn.length>0){Zn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){Zn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=uo.setTimeout(()=>{if(Zn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(v)=>{if(v.type==="ping"&&v.data==="probe")Zn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(v.type==="upgrade"&&this.readyState!=="closed"){if(Zn("got upgrade packet - upgrading"),x(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else x(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)Zn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},x=()=>{this.upgrading=!1,clearInterval(o),uo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",a),n.removeListener("error",m),this.removeListener("close",f)},m=(v)=>{Zn("client did not complete upgrade - %s",v),x(),n.close(),n=null},a=()=>{m("transport closed")},f=()=>{m("socket closed")};n.on("packet",c),n.once("close",a),n.once("error",m),this.once("close",f)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){Zn("error triggered by discarded transport")}),this.transport.close(),uo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",uo.clearTimeout(this.pingIntervalTimer),uo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){Zn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Zn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){Zn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Zn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}Zn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(Zn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}g4.Socket=d4});var o8=C((b5)=>{/*!
34
34
  * cookie
35
35
  * Copyright(c) 2012-2014 Roman Shtylman
36
36
  * Copyright(c) 2015 Douglas Christopher Wilson
37
37
  * MIT Licensed
38
- */zS.parse=GS;zS.serialize=YS;var FS=Object.prototype.toString,RS=Object.prototype.hasOwnProperty,XS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,WS=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,KS=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,SS=/^[\u0020-\u003A\u003D-\u007E]*$/;function GS(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||lS,x=0,m=0,f=0;do{if(m=n.indexOf("=",x),m===-1)break;if(f=n.indexOf(";",x),f===-1)f=c;else if(m>f){x=n.lastIndexOf(";",m-1)+1;continue}var a=P4(n,x,m),v=s4(n,m,a),$=n.slice(a,v);if(!RS.call(o,$)){var w=P4(n,m+1,f),J=s4(n,f,w);if(n.charCodeAt(w)===34&&n.charCodeAt(J-1)===34)w++,J--;var X=n.slice(w,J);o[$]=MS(X,p)}x=f+1}while(x<c);return o}function P4(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function s4(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function YS(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!XS.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!WS.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var m=Math.floor(o.maxAge);if(!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+m}if(o.domain){if(!KS.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!SS.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var f=o.expires;if(!HS(f)||isNaN(f.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+f.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var a=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(a){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var v=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.sameSite;switch(v){case!0:x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"strict":x+="; SameSite=Strict";break;case"none":x+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return x}function lS(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function HS(n){return FS.call(n)==="[object Date]"}function MS(n,i){try{return i(n)}catch(o){return n}}});var d4=C((aN,g4)=>{var t4=Object.getOwnPropertySymbols,OS=Object.prototype.hasOwnProperty,US=Object.prototype.propertyIsEnumerable;function VS(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function _S(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}g4.exports=_S()?Object.assign:function(n,i){var o,c=VS(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(OS.call(o,m))c[m]=o[m];if(t4){p=t4(o);for(var f=0;f<p.length;f++)if(US.call(o,p[f]))c[p[f]]=o[p[f]]}}return c}});var i8=C((vN,dv)=>{/*!
38
+ */b5.parse=E5;b5.serialize=O5;var G5=Object.prototype.toString,M5=Object.prototype.hasOwnProperty,Y5=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,H5=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,z5=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Q5=/^[\u0020-\u003A\u003D-\u007E]*$/;function E5(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||U5,x=0,m=0,a=0;do{if(m=n.indexOf("=",x),m===-1)break;if(a=n.indexOf(";",x),a===-1)a=c;else if(m>a){x=n.lastIndexOf(";",m-1)+1;continue}var f=n8(n,x,m),v=i8(n,m,f),$=n.slice(f,v);if(!M5.call(o,$)){var w=n8(n,m+1,a),J=i8(n,a,w);if(n.charCodeAt(w)===34&&n.charCodeAt(J-1)===34)w++,J--;var S=n.slice(w,J);o[$]=_5(S,p)}x=a+1}while(x<c);return o}function n8(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function i8(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function O5(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!Y5.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!H5.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var m=Math.floor(o.maxAge);if(!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+m}if(o.domain){if(!z5.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!Q5.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var a=o.expires;if(!V5(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+a.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var f=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(f){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var v=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.sameSite;switch(v){case!0:x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"strict":x+="; SameSite=Strict";break;case"none":x+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return x}function U5(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function V5(n){return G5.call(n)==="[object Date]"}function _5(n,i){try{return i(n)}catch(o){return n}}});var x8=C((TL,p8)=>{var c8=Object.getOwnPropertySymbols,j5=Object.prototype.hasOwnProperty,D5=Object.prototype.propertyIsEnumerable;function L5(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function N5(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}p8.exports=N5()?Object.assign:function(n,i){var o,c=L5(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(j5.call(o,m))c[m]=o[m];if(c8){p=c8(o);for(var a=0;a<p.length;a++)if(D5.call(o,p[a]))c[p[a]]=o[p[a]]}}return c}});var f8=C((RL,n$)=>{/*!
39
39
  * vary
40
40
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
41
41
  * MIT Licensed
42
- */dv.exports=bS;dv.exports.append=n8;var BS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function n8(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?e4(String(i)):i;for(var c=0;c<o.length;c++)if(!BS.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=e4(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var f=o[m].toLowerCase();if(x.indexOf(f)===-1)x.push(f),p=p?p+", "+o[m]:o[m]}return p}function e4(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function bS(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=n8(c,i))n.setHeader("Vary",o)}});var ev=C(($N,o8)=>{(function(){var n=d4(),i=i8(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(W){return typeof W==="string"||W instanceof String}function p(W,R){if(Array.isArray(R)){for(var S=0;S<R.length;++S)if(p(W,R[S]))return!0;return!1}else if(c(R))return W===R;else if(R instanceof RegExp)return R.test(W);else return!!R}function x(W,R){var S=R.headers.origin,l=[],H;if(!W.origin||W.origin==="*")l.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(W.origin))l.push([{key:"Access-Control-Allow-Origin",value:W.origin}]),l.push([{key:"Vary",value:"Origin"}]);else H=p(S,W.origin),l.push([{key:"Access-Control-Allow-Origin",value:H?S:!1}]),l.push([{key:"Vary",value:"Origin"}]);return l}function m(W){var R=W.methods;if(R.join)R=W.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function f(W){if(W.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function a(W,R){var S=W.allowedHeaders||W.headers,l=[];if(!S)S=R.headers["access-control-request-headers"],l.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(S.join)S=S.join(",");if(S&&S.length)l.push([{key:"Access-Control-Allow-Headers",value:S}]);return l}function v(W){var R=W.exposedHeaders;if(!R)return null;else if(R.join)R=R.join(",");if(R&&R.length)return{key:"Access-Control-Expose-Headers",value:R};return null}function $(W){var R=(typeof W.maxAge==="number"||W.maxAge)&&W.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function w(W,R){for(var S=0,l=W.length;S<l;S++){var H=W[S];if(H){if(Array.isArray(H))w(H,R);else if(H.key==="Vary"&&H.value)i(R,H.value);else if(H.value)R.setHeader(H.key,H.value)}}}function J(W,R,S,l){var H=[],I=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(I==="OPTIONS")if(H.push(x(W,R)),H.push(f(W,R)),H.push(m(W,R)),H.push(a(W,R)),H.push($(W,R)),H.push(v(W,R)),w(H,S),W.preflightContinue)l();else S.statusCode=W.optionsSuccessStatus,S.setHeader("Content-Length","0"),S.end();else H.push(x(W,R)),H.push(f(W,R)),H.push(v(W,R)),w(H,S),l()}function X(W){var R=null;if(typeof W==="function")R=W;else R=function(S,l){l(null,W)};return function S(l,H,I){R(l,function(Y,z){if(Y)I(Y);else{var E=n({},o,z),Q=null;if(E.origin&&typeof E.origin==="function")Q=E.origin;else if(E.origin)Q=function(b,y){y(null,E.origin)};if(Q)Q(l.headers.origin,function(b,y){if(b||!y)I(b);else E.origin=y,J(E,l,H,I)});else I()}})}}o8.exports=X})()});var n0=C((v8)=>{Object.defineProperty(v8,"__esModule",{value:!0});v8.Server=v8.BaseServer=void 0;var jS=Sn("querystring"),LS=Sn("url"),c8=jv(),lf=tv(),DS=Sn("events"),p8=gv(),NS=vi(),hS=r4(),CS=Sn("ws"),x8=rv(),uS=Bx(),xn=NS.default("engine"),Mp=Symbol("responseHeaders");function IS(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class jx extends DS.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:CS.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(ev()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return lf.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return xn('unknown transport "%s"',c),o(zn.errors.UNKNOWN_TRANSPORT,{transport:c});if(yS(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,xn("origin header invalid"),o(zn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return xn('unknown sid "%s"',x),o(zn.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return xn("bad request: unexpected transport without upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(zn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return xn("invalid transport upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,f)=>{if(!f)return o(zn.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return xn("no middleware to apply, skipping"),o();let c=(p)=>{xn("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){xn("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return c8.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){xn("unsupported protocol version"),this.emit("connection_error",{req:i,code:zn.errors.UNSUPPORTED_PROTOCOL_VERSION,message:zn.errorMessages[zn.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(zn.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(f){xn("error while generating an id"),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:f}}),o(zn.errors.BAD_REQUEST);return}xn('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(f){xn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:f}}),o(zn.errors.BAD_REQUEST);return}let m=new p8.Socket(p,this,x,i,c);return x.on("headers",(f,a)=>{if(!a._query.sid){if(this.opts.cookie)f["Set-Cookie"]=[hS.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",f,a)}this.emit("headers",f,a)}),x.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),x}async onWebTransportSession(n){let i=setTimeout(()=>{xn("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){xn("session is closed");return}let p=c.value,x=uS.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:f,done:a}=await m.read();if(a){xn("stream is closed");return}if(clearTimeout(i),f.type!=="open")return xn("invalid WebTransport handshake"),n.close();if(f.data===void 0){let w=new x8.WebTransport(n,p,m),J=c8.generateId();xn('handshaking client "%s" (WebTransport)',J);let X=new p8.Socket(J,this,w,null,4);this.clients[J]=X,this.clientsCount++,X.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",X);return}let v=IS(f.data);if(!v)return xn("invalid WebTransport handshake"),n.close();let $=this.clients[v];if(!$)xn("upgrade attempt for closed client"),n.close();else if($.upgrading)xn("transport has already been trying to upgrade"),n.close();else if($.upgraded)xn("transport had already been upgraded"),n.close();else{xn("upgrading existing transport");let w=new x8.WebTransport(n,p,m);$._maybeUpgrade(w)}}}v8.BaseServer=jx;jx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};jx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class a8{constructor(n,i){this.req=n,this.socket=i,n[Mp]={}}setHeader(n,i){this.req[Mp][n]=i}getHeader(n){return this.req[Mp][n]}removeHeader(n){delete this.req[Mp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class zn extends jx{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[Mp]||{};if(delete i[Mp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),xn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)xn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?jS.parse(LS.parse(n.url).query):{}}createTransport(n,i){return new lf.default[n](i)}handleRequest(n,i){xn('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:zn.errorMessages[c],context:p}),m8(i,c,p);return}if(n._query.sid)xn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,f)=>m8(i,m,f);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new a8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:zn.errorMessages[x],context:m}),f8(i,x,m);return}let f=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,f,(a)=>{this.onWebSocket(n,i,a)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),lf.default[n._query.transport]!==void 0&&!lf.default[n._query.transport].prototype.handlesUpgrades){xn("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)xn("upgrade attempt for closed client"),o.close();else if(x.upgrading)xn("transport has already been trying to upgrade"),o.close();else if(x.upgraded)xn("transport had already been upgraded"),o.close();else{xn("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(m)}}else{let x=(m,f)=>f8(i,m,f);this.handshake(n._query.transport,n,x)}function p(){xn("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(m){return o===m.url.slice(0,o.length)}let x=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(m,f)=>{if(p(m))xn('intercepting request for path "%s"',o),this.handleRequest(m,f);else{let a=0,v=x.length;for(;a<v;a++)x[a].call(n,m,f)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,f,a)=>{if(p(m))this.handleUpgrade(m,f,a);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(f.writable&&f.bytesWritten<=0)return f.on("error",(v)=>{xn("error while destroying upgrade: %s",v.message)}),f.end()},c)})}}v8.Server=zn;function m8(n,i,o){let c=i===zn.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:zn.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function f8(n,i,o={}){if(n.on("error",()=>{xn("ignoring error from closed connection")}),n.writable){let c=o.message||zn.errorMessages[i],p=Buffer.byteLength(c);n.write(`HTTP/1.1 400 Bad Request\r
42
+ */n$.exports=C5;n$.exports.append=a8;var h5=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function a8(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?m8(String(i)):i;for(var c=0;c<o.length;c++)if(!h5.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=m8(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var a=o[m].toLowerCase();if(x.indexOf(a)===-1)x.push(a),p=p?p+", "+o[m]:o[m]}return p}function m8(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function C5(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=a8(c,i))n.setHeader("Vary",o)}});var i$=C((SL,v8)=>{(function(){var n=x8(),i=f8(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(X){return typeof X==="string"||X instanceof String}function p(X,R){if(Array.isArray(R)){for(var K=0;K<R.length;++K)if(p(X,R[K]))return!0;return!1}else if(c(R))return X===R;else if(R instanceof RegExp)return R.test(X);else return!!R}function x(X,R){var K=R.headers.origin,M=[],Y;if(!X.origin||X.origin==="*")M.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(X.origin))M.push([{key:"Access-Control-Allow-Origin",value:X.origin}]),M.push([{key:"Vary",value:"Origin"}]);else Y=p(K,X.origin),M.push([{key:"Access-Control-Allow-Origin",value:Y?K:!1}]),M.push([{key:"Vary",value:"Origin"}]);return M}function m(X){var R=X.methods;if(R.join)R=X.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function a(X){if(X.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function f(X,R){var K=X.allowedHeaders||X.headers,M=[];if(!K)K=R.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(K.join)K=K.join(",");if(K&&K.length)M.push([{key:"Access-Control-Allow-Headers",value:K}]);return M}function v(X){var R=X.exposedHeaders;if(!R)return null;else if(R.join)R=R.join(",");if(R&&R.length)return{key:"Access-Control-Expose-Headers",value:R};return null}function $(X){var R=(typeof X.maxAge==="number"||X.maxAge)&&X.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function w(X,R){for(var K=0,M=X.length;K<M;K++){var Y=X[K];if(Y){if(Array.isArray(Y))w(Y,R);else if(Y.key==="Vary"&&Y.value)i(R,Y.value);else if(Y.value)R.setHeader(Y.key,Y.value)}}}function J(X,R,K,M){var Y=[],I=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(I==="OPTIONS")if(Y.push(x(X,R)),Y.push(a(X,R)),Y.push(m(X,R)),Y.push(f(X,R)),Y.push($(X,R)),Y.push(v(X,R)),w(Y,K),X.preflightContinue)M();else K.statusCode=X.optionsSuccessStatus,K.setHeader("Content-Length","0"),K.end();else Y.push(x(X,R)),Y.push(a(X,R)),Y.push(v(X,R)),w(Y,K),M()}function S(X){var R=null;if(typeof X==="function")R=X;else R=function(K,M){M(null,X)};return function K(M,Y,I){R(M,function(G,z){if(G)I(G);else{var E=n({},o,z),Q=null;if(E.origin&&typeof E.origin==="function")Q=E.origin;else if(E.origin)Q=function(b,y){y(null,E.origin)};if(Q)Q(M.headers.origin,function(b,y){if(b||!y)I(b);else E.origin=y,J(E,M,Y,I)});else I()}})}}v8.exports=S})()});var o$=C((R8)=>{Object.defineProperty(R8,"__esModule",{value:!0});R8.Server=R8.BaseServer=void 0;var I5=Kn("node:querystring"),y5=Kn("node:url"),$8=Dv(),Ma=gv(),k5=Kn("node:events"),w8=ev(),Z5=fi(),q5=o8(),s5=Kn("ws"),J8=dv(),P5=ux(),xn=Z5.default("engine"),Hp=Symbol("responseHeaders");function t5(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class jx extends k5.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:s5.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(i$()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return Ma.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return xn('unknown transport "%s"',c),o(zn.errors.UNKNOWN_TRANSPORT,{transport:c});if(r5(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,xn("origin header invalid"),o(zn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return xn('unknown sid "%s"',x),o(zn.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return xn("bad request: unexpected transport without upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(zn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return xn("invalid transport upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,a)=>{if(!a)return o(zn.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return xn("no middleware to apply, skipping"),o();let c=(p)=>{xn("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){xn("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return $8.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){xn("unsupported protocol version"),this.emit("connection_error",{req:i,code:zn.errors.UNSUPPORTED_PROTOCOL_VERSION,message:zn.errorMessages[zn.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(zn.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(a){xn("error while generating an id"),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}xn('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(a){xn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}let m=new w8.Socket(p,this,x,i,c);return x.on("headers",(a,f)=>{if(!f._query.sid){if(this.opts.cookie)a["Set-Cookie"]=[q5.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",a,f)}this.emit("headers",a,f)}),x.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),x}async onWebTransportSession(n){let i=setTimeout(()=>{xn("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){xn("session is closed");return}let p=c.value,x=P5.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:a,done:f}=await m.read();if(f){xn("stream is closed");return}if(clearTimeout(i),a.type!=="open")return xn("invalid WebTransport handshake"),n.close();if(a.data===void 0){let w=new J8.WebTransport(n,p,m),J=$8.generateId();xn('handshaking client "%s" (WebTransport)',J);let S=new w8.Socket(J,this,w,null,4);this.clients[J]=S,this.clientsCount++,S.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",S);return}let v=t5(a.data);if(!v)return xn("invalid WebTransport handshake"),n.close();let $=this.clients[v];if(!$)xn("upgrade attempt for closed client"),n.close();else if($.upgrading)xn("transport has already been trying to upgrade"),n.close();else if($.upgraded)xn("transport had already been upgraded"),n.close();else{xn("upgrading existing transport");let w=new J8.WebTransport(n,p,m);$._maybeUpgrade(w)}}}R8.BaseServer=jx;jx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};jx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class T8{constructor(n,i){this.req=n,this.socket=i,n[Hp]={}}setHeader(n,i){this.req[Hp][n]=i}getHeader(n){return this.req[Hp][n]}removeHeader(n){delete this.req[Hp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class zn extends jx{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[Hp]||{};if(delete i[Hp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),xn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)xn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?I5.parse(y5.parse(n.url).query):{}}createTransport(n,i){return new Ma.default[n](i)}handleRequest(n,i){xn('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:zn.errorMessages[c],context:p}),A8(i,c,p);return}if(n._query.sid)xn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,a)=>A8(i,m,a);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new T8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:zn.errorMessages[x],context:m}),F8(i,x,m);return}let a=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,a,(f)=>{this.onWebSocket(n,i,f)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Ma.default[n._query.transport]!==void 0&&!Ma.default[n._query.transport].prototype.handlesUpgrades){xn("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)xn("upgrade attempt for closed client"),o.close();else if(x.upgrading)xn("transport has already been trying to upgrade"),o.close();else if(x.upgraded)xn("transport had already been upgraded"),o.close();else{xn("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(m)}}else{let x=(m,a)=>F8(i,m,a);this.handshake(n._query.transport,n,x)}function p(){xn("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(m){return o===m.url.slice(0,o.length)}let x=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(m,a)=>{if(p(m))xn('intercepting request for path "%s"',o),this.handleRequest(m,a);else{let f=0,v=x.length;for(;f<v;f++)x[f].call(n,m,a)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,a,f)=>{if(p(m))this.handleUpgrade(m,a,f);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(a.writable&&a.bytesWritten<=0)return a.on("error",(v)=>{xn("error while destroying upgrade: %s",v.message)}),a.end()},c)})}}R8.Server=zn;function A8(n,i,o){let c=i===zn.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:zn.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function F8(n,i,o={}){if(n.on("error",()=>{xn("ignoring error from closed connection")}),n.writable){let c=o.message||zn.errorMessages[i],p=Buffer.byteLength(c);n.write(`HTTP/1.1 400 Bad Request\r
43
43
  Connection: close\r
44
44
  Content-type: text/html\r
45
45
  Content-Length: `+p+`\r
46
46
  \r
47
- `+c)}n.destroy()}var bx=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function yS(n){if(n+="",n.length<1)return!1;if(!bx[n.charCodeAt(0)])return xn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!bx[n.charCodeAt(1)])return xn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!bx[n.charCodeAt(2)])return xn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!bx[n.charCodeAt(3)])return xn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!bx[n.charCodeAt(i)])return xn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var F8=C((A8)=>{Object.defineProperty(A8,"__esModule",{value:!0});A8.Polling=void 0;var ZS=_c(),w8=Sn("zlib"),qS=vf(),PS=vi(),di=PS.default("engine:polling"),sS={gzip:w8.createGzip,deflate:w8.createDeflate};class J8 extends ZS.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){di("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}di("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)di("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,x=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let a in m)i.writeHeader(a,String(m[a]));let f=(a)=>{this.onData(a.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((a,v)=>{let $=x+a.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(v){f(Buffer.from(a));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(a).copy(p,x),v){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}f(p);return}x=$})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){di('received "%s"',n);let i=(o)=>{if(o.type==="close")return di("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)di("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){di('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(v)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let a=qS(this.req).encodings(["gzip","deflate"]);if(!a){m(n);return}this.compress(n,a,(v,$)=>{if(v){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(v);return}x["Content-Encoding"]=a,m($)})}compress(n,i,o){di("compressing");let c=[],p=0;sS[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){di("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)di("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)di("transport discarded - closing right away"),o();else di("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}A8.Polling=J8});var S8=C((W8)=>{Object.defineProperty(W8,"__esModule",{value:!0});W8.WebSocket=void 0;var rS=_c(),tS=vi(),R8=tS.default("engine:ws");class X8 extends rS.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(x)=>{let m=typeof x!=="string",f=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(R8('writing "%s"',x),this.socket.send(x,m,f),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){R8("closing"),n&&n(),this.socket.end()}}W8.WebSocket=X8});var Y8=C((G8)=>{Object.defineProperty(G8,"__esModule",{value:!0});var gS=F8(),dS=S8();G8.default={polling:gS.Polling,websocket:dS.WebSocket}});var Q8=C((M8)=>{Object.defineProperty(M8,"__esModule",{value:!0});M8.uServer=void 0;var n9=vi(),Bc=n0(),i9=Y8(),pc=n9.default("engine:uws");class l8 extends Bc.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{pc("response has been aborted")})}createTransport(n,i){return new i9.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new H8(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){pc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:Bc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)pc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,f)=>this.abortRequest(n,m,f);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(Bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){pc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:Bc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,f;if(m){let a=this.clients[m];if(!a)return pc("upgrade attempt for closed client"),n.close();else if(a.upgrading)return pc("transport has already been trying to upgrade"),n.close();else if(a.upgraded)return pc("transport had already been upgraded"),n.close();else pc("upgrading existing transport"),f=this.createTransport(i._query.transport,i),a._maybeUpgrade(f)}else if(f=await this.handshake(i._query.transport,i,(a,v)=>this.abortRequest(n,a,v)),!f)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:f},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(Bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===Bc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:Bc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}M8.uServer=l8;class H8{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var _8=C((zp)=>{Object.defineProperty(zp,"__esModule",{value:!0});zp.protocol=zp.Transport=zp.Socket=zp.uServer=zp.parser=zp.transports=zp.Server=void 0;zp.listen=f9;zp.attach=U8;var o9=Sn("http"),E8=n0();Object.defineProperty(zp,"Server",{enumerable:!0,get:function(){return E8.Server}});var c9=tv();zp.transports=c9.default;var O8=Bx();zp.parser=O8;var p9=Q8();Object.defineProperty(zp,"uServer",{enumerable:!0,get:function(){return p9.uServer}});var x9=gv();Object.defineProperty(zp,"Socket",{enumerable:!0,get:function(){return x9.Socket}});var m9=_c();Object.defineProperty(zp,"Transport",{enumerable:!0,get:function(){return m9.Transport}});zp.protocol=O8.protocol;function f9(n,i,o){if(typeof i==="function")o=i,i={};let c=o9.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=U8(c,i);return p.httpServer=c,c.listen(n,o),p}function U8(n,i){let o=new E8.Server(i);return o.attach(n,i),o}});var B8=C((A9)=>{A9.Emitter=Oi;function Oi(n){if(n)return J9(n)}function J9(n){for(var i in Oi.prototype)n[i]=Oi.prototype[i];return n}Oi.prototype.on=Oi.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Oi.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Oi.prototype.off=Oi.prototype.removeListener=Oi.prototype.removeAllListeners=Oi.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Oi.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Oi.prototype.emitReserved=Oi.prototype.emit;Oi.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Oi.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var i0=C((L8)=>{Object.defineProperty(L8,"__esModule",{value:!0});L8.hasBinary=L8.isBinary=void 0;var F9=typeof ArrayBuffer==="function",R9=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},b8=Object.prototype.toString,X9=typeof Blob==="function"||typeof Blob!=="undefined"&&b8.call(Blob)==="[object BlobConstructor]",W9=typeof File==="function"||typeof File!=="undefined"&&b8.call(File)==="[object FileConstructor]";function j8(n){return F9&&(n instanceof ArrayBuffer||R9(n))||X9&&n instanceof Blob||W9&&n instanceof File}L8.isBinary=j8;function Hf(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Hf(n[o]))return!0;return!1}if(j8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Hf(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Hf(n[o]))return!0;return!1}L8.hasBinary=Hf});var C8=C((N8)=>{Object.defineProperty(N8,"__esModule",{value:!0});N8.reconstructPacket=N8.deconstructPacket=void 0;var S9=i0();function G9(n){let i=[],o=n.data,c=n;return c.data=o0(o,i),c.attachments=i.length,{packet:c,buffers:i}}N8.deconstructPacket=G9;function o0(n,i){if(!n)return n;if(S9.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=o0(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=o0(n[c],i);return o}return n}function Y9(n,i){return n.data=c0(n.data,i),delete n.attachments,n}N8.reconstructPacket=Y9;function c0(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=c0(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=c0(n[o],i)}return n}});var Lx=C((P8)=>{Object.defineProperty(P8,"__esModule",{value:!0});P8.Decoder=P8.Encoder=P8.PacketType=P8.protocol=void 0;var H9=B8(),y8=C8(),k8=i0(),M9=vi(),p0=M9.default("socket.io-parser"),z9=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];P8.protocol=5;var yn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(yn=P8.PacketType||(P8.PacketType={}));class Z8{constructor(n){this.replacer=n}encode(n){if(p0("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(k8.hasBinary(n))return this.encodeAsBinary({type:n.type===yn.EVENT?yn.BINARY_EVENT:yn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===yn.BINARY_EVENT||n.type===yn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return p0("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=y8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}P8.Encoder=Z8;function u8(n){return Object.prototype.toString.call(n)==="[object Object]"}class x0 extends H9.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===yn.BINARY_EVENT;if(o||i.type===yn.BINARY_ACK){if(i.type=o?yn.EVENT:yn.ACK,this.reconstructor=new q8(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(k8.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(yn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===yn.BINARY_EVENT||o.type===yn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let x=n.charAt(i);if(x==null||Number(x)!=x){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(x0.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return p0("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case yn.CONNECT:return u8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||u8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&z9.indexOf(i[0])===-1);case yn.ACK:case yn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}P8.Decoder=x0;class q8{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=y8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var d8=C((t8)=>{Object.defineProperty(t8,"__esModule",{value:!0});t8.Client=void 0;var Mf=Lx(),O9=vi(),U9=Sn("url"),$o=O9("socket.io:client");class r8{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)$o("no namespace joined yet, close the client"),this.close();else $o("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return $o("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else $o("creation of namespace %s was denied",n),this._packet({type:Mf.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else $o("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")$o("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){$o("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){$o("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){$o("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=U9.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===Mf.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Mf.PacketType.CONNECT&&n.type!==Mf.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else $o("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){$o("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}t8.Client=r8});var zf=C((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});n6.StrictEventEmitter=void 0;var V9=Sn("events");class e8 extends V9.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}n6.StrictEventEmitter=e8});var m0=C((o6)=>{Object.defineProperty(o6,"__esModule",{value:!0});o6.RESERVED_EVENTS=void 0;o6.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var a0=C((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});p6.RemoteSocket=p6.BroadcastOperator=void 0;var _9=m0(),B9=Lx();class jo{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new jo(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new jo(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new jo(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new jo(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new jo(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new jo(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(_9.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:B9.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let x=o.pop(),m=!1,f=[],a=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:f])},this.flags.timeout),v=-1,$=0,w=0,J=()=>{if(!m&&v===$&&f.length===w)clearTimeout(a),x.apply(this,[null,this.flags.expectSingleResponse?f[0]:f])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(X)=>{w+=X,$++,J()},(X)=>{f.push(X),J()}),this.adapter.serverCount().then((X)=>{v=X,J()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new f0(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}p6.BroadcastOperator=jo;class f0{constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new jo(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}p6.RemoteSocket=f0});var v0=C((Qp)=>{var a6=Qp&&Qp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Socket=void 0;var ei=Lx(),j9=a6(vi()),L9=zf(),m6=a6(jv()),D9=a0(),N9=m0(),li=j9.default("socket.io:socket"),h9=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function f6(){}class v6 extends L9.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:ei.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=m6.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=m6.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",f6)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(N9.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:ei.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let x=this.nsp._ids++;li("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((x,m)=>{if(o)return x?p(x):c(m);else return c(x)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{li("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return li("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return li("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(li("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:ei.PacketType.CONNECT});else this.packet({type:ei.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(li("got packet %j",n),n.type){case ei.PacketType.EVENT:this.onevent(n);break;case ei.PacketType.BINARY_EVENT:this.onevent(n);break;case ei.PacketType.ACK:this.onack(n);break;case ei.PacketType.BINARY_ACK:this.onack(n);break;case ei.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(li("emitting event %j",i),n.id!=null)li("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);li("sending ack %j",c),i.packet({id:n,type:ei.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")li("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else li("bad ack %s",n.id)}ondisconnect(){li("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(li("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&h9.has(n))li("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=f6}_error(n){this.packet({type:ei.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:ei.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){li("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else li("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new D9.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Qp.Socket=v6});var $0=C((Lo)=>{var C9=Lo&&Lo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.Namespace=Lo.RESERVED_EVENTS=void 0;var $6=v0(),u9=zf(),I9=C9(vi()),ui=a0(),Dx=I9.default("socket.io:namespace");Lo.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class w6 extends u9.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new ui.BroadcastOperator(this.adapter).to(n)}in(n){return new ui.BroadcastOperator(this.adapter).in(n)}except(n){return new ui.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Dx("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Dx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Dx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(x){Dx("error while restoring session: %s",x)}if(p)return Dx("connection state recovered for sid %s",p.sid),new $6.Socket(this,n,i,p)}return new $6.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new ui.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(Lo.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new ui.BroadcastOperator(this.adapter).allSockets()}compress(n){return new ui.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new ui.BroadcastOperator(this.adapter).volatile}get local(){return new ui.BroadcastOperator(this.adapter).local}timeout(n){return new ui.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new ui.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new ui.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new ui.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new ui.BroadcastOperator(this.adapter).disconnectSockets(n)}}Lo.Namespace=w6});var W6=C((R6)=>{Object.defineProperty(R6,"__esModule",{value:!0});R6.yeast=R6.decode=R6.encode=void 0;var T6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Qf=64,F6={},J6=0,xc=0,A6;function w0(n){let i="";do i=T6[n%Qf]+i,n=Math.floor(n/Qf);while(n>0);return i}R6.encode=w0;function y9(n){let i=0;for(xc=0;xc<n.length;xc++)i=i*Qf+F6[n.charAt(xc)];return i}R6.decode=y9;function k9(){let n=w0(+new Date);if(n!==A6)return J6=0,A6=n;return n+"."+w0(J6++)}R6.yeast=k9;for(;xc<Qf;xc++)F6[T6[xc]]=xc});var T0=C((S6)=>{var J0;Object.defineProperty(S6,"__esModule",{value:!0});S6.SessionAwareAdapter=S6.Adapter=void 0;var P9=Sn("events"),s9=W6(),Ef=Sn("ws"),r9=typeof((J0=Ef===null||Ef===void 0?void 0:Ef.Sender)===null||J0===void 0?void 0:J0.frame)==="function";class A0 extends P9.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,x),f=0;this.apply(i,(a)=>{if(f++,a.acks.set(n.id,c),typeof a.notifyOutgoingListeners==="function")a.notifyOutgoingListeners(n);a.client.writeToEngine(m,x)}),o(f)}_encode(n,i){let o=this.encoder.encode(n);if(r9&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Ef.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let x of o){if(!this.rooms.has(x))continue;for(let m of this.rooms.get(x)){if(p.has(m)||c.has(m))continue;let f=this.nsp.sockets.get(m);if(f)i(f),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}S6.Adapter=A0;class K6 extends A0{constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((m)=>m.id===i);if(p===-1)return null;let x=[];for(let m=p+1;m<this.packets.length;m++){let f=this.packets[m];if(t9(o.rooms,f.opts))x.push(f.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let m=s9.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}S6.SessionAwareAdapter=K6;function t9(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var l6=C((wo)=>{var d9=wo&&wo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(wo,"__esModule",{value:!0});wo.ClusterAdapterWithHeartbeat=wo.ClusterAdapter=wo.MessageType=void 0;var e9=T0(),nG=vi(),iG=Sn("crypto"),qn=nG.debug("socket.io-adapter"),oG="emitter",Of=5000;function Op(){return iG.randomBytes(8).toString("hex")}var on;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(on=wo.MessageType||(wo.MessageType={}));function bc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function Ep(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class F0 extends e9.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Op()}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Ep(n.data.opts),(c)=>{qn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{qn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=Ep(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case on.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case on.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case on.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case on.FETCH_SOCKETS:{qn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Ep(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:on.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,m=d9(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case on.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(m)=>{if(p)return;p=!0,qn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:on.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,x]);break}case on.BROADCAST_CLIENT_COUNT:case on.BROADCAST_ACK:case on.FETCH_SOCKETS_RESPONSE:case on.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:qn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case on.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case on.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case on.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:qn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:on.BROADCAST,data:{packet:n,opts:bc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return qn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,x=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&m)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let m=Op();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:on.BROADCAST,data:{packet:n,requestId:m,opts:bc(i)}}),setTimeout(()=>{this.ackRequests.delete(m)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_JOIN,data:{opts:bc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_LEAVE,data:{opts:bc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.DISCONNECT_SOCKETS,data:{opts:bc(n),close:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,f)=>{let a=setTimeout(()=>{let $=this.requests.get(x);if($)f(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||Of),v={type:on.FETCH_SOCKETS,resolve:m,timeout:a,current:0,expected:p,responses:o};this.requests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:bc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let f=this.requests.get(p);if(f)o(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`),f.responses),this.requests.delete(p)},Of),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{qn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{qn("[%s] error while publishing response: %s",this.uid,o)})}}wo.ClusterAdapter=F0;class Y6 extends F0{constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)qn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:on.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:on.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:on.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==oG)this.nodesMap.set(n.uid,Date.now());switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.INITIAL_HEARTBEAT:this.publish({type:on.HEARTBEAT});break;case on.HEARTBEAT:break;case on.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let f=this.customRequests.get(p);if(f)o(new Error(`timeout reached: missing ${f.missingUids.size} responses`),f.responses),this.customRequests.delete(p)},Of),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,f)=>{let a=setTimeout(()=>{let $=this.customRequests.get(x);if($)f(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Of),v={type:on.FETCH_SOCKETS,resolve:m,timeout:a,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:bc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case on.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===on.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===on.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}wo.ClusterAdapterWithHeartbeat=Y6});var Uf=C((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.MessageType=jc.ClusterAdapterWithHeartbeat=jc.ClusterAdapter=jc.SessionAwareAdapter=jc.Adapter=void 0;var H6=T0();Object.defineProperty(jc,"Adapter",{enumerable:!0,get:function(){return H6.Adapter}});Object.defineProperty(jc,"SessionAwareAdapter",{enumerable:!0,get:function(){return H6.SessionAwareAdapter}});var R0=l6();Object.defineProperty(jc,"ClusterAdapter",{enumerable:!0,get:function(){return R0.ClusterAdapter}});Object.defineProperty(jc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return R0.ClusterAdapterWithHeartbeat}});Object.defineProperty(jc,"MessageType",{enumerable:!0,get:function(){return R0.MessageType}})});var E6=C((Up)=>{var pG=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var M6=$0(),xG=Uf(),mG=pG(vi()),z6=mG.default("socket.io:parent-namespace");class Vf extends M6.Namespace{constructor(n){super(n,"/_"+Vf.count++);this.children=new Set}_initAdapter(){this.adapter=new Q6(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){z6("creating child namespace %s",n);let i=new M6.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)z6("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Up.ParentNamespace=Vf;Vf.count=0;class Q6 extends xG.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var b6=C((Dc)=>{var fG=Dc&&Dc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.patchAdapter=vG;Dc.restoreAdapter=$G;Dc.serveFile=JG;var Lc=Uf(),O6=Sn("fs"),aG=fG(vi()),_f=aG.default("socket.io:adapter-uws"),X0="\x1F",{addAll:V6,del:_6,broadcast:B6}=Lc.Adapter.prototype;function vG(n){Lc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);V6.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){U6(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)U6(this.nsp.name,p,c,x)})},Lc.Adapter.prototype.del=function(i,o){_6.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,x=c.conn.transport.socket,m=`${this.nsp.name}${X0}${o}`;_f("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},Lc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){B6.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),f=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${X0}${o.rooms.keys().next().value}`;_f("fast publish to %s",f),m.forEach((a)=>{let v=typeof a!=="string";n.publish(f,v?a:"4"+a,v)}),this.apply(o,(a)=>{if(a.conn.transport.name!=="websocket")a.client.writeToEngine(m,x)})}}function U6(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)_f("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let f=`${n}${X0}${m}`;_f("subscribe connection %s to topic %s",p,f),x.subscribe(f)})}function $G(){Lc.Adapter.prototype.addAll=V6,Lc.Adapter.prototype.del=_6,Lc.Adapter.prototype.broadcast=B6}var wG=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function JG(n,i){let{size:o}=O6.statSync(i),c=O6.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(f)=>{throw p(),f},m=(f)=>{let a=wG(f);n.cork(()=>{let v=n.getWriteOffset(),[$,w]=n.tryEnd(a,o);if(!w&&!$)c.pause(),n.onWritable((J)=>{let[X,W]=n.tryEnd(a.slice(J-v),o);if(!W&&X)c.resume();return X})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var j6=C((uN,AG)=>{AG.exports={name:"socket.io",version:"4.8.1",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var k6=C((Hi,Nx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",TG=Hi&&Hi.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),FG=Hi&&Hi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),RG=Hi&&Hi.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))TG(i,n,o)}return FG(i,n),i},I6=Hi&&Hi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.Namespace=Hi.Socket=Hi.Server=void 0;var XG=Sn("http"),WG=Sn("fs"),W0=Sn("zlib"),KG=vf(),Bf=Sn("stream"),L6=Sn("path"),D6=_8(),SG=d8(),N6=Sn("events"),S0=$0();Object.defineProperty(Hi,"Namespace",{enumerable:!0,get:function(){return S0.Namespace}});var GG=E6(),h6=Uf(),YG=RG(Lx()),lG=I6(vi()),y6=v0();Object.defineProperty(Hi,"Socket",{enumerable:!0,get:function(){return y6.Socket}});var HG=zf(),K0=b6(),MG=I6(ev()),ji=lG.default("socket.io:server"),C6=j6().version,u6=/\.map/;class Vp extends HG.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||YG,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||h6.SessionAwareAdapter);else this.adapter(i.adapter||h6.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=MG.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let x=c.next();if(x.done)return o(!1);x.value(n,i,(m,f)=>{if(m||!f)return p();if(this._nsps.has(n))return ji("dynamic namespace %s already exists",n),o(this._nsps.get(n));let a=this.parentNsps.get(x.value).createChild(n);ji("dynamic namespace %s was created",n),o(a)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){ji("creating http server and binding to %d",n);let o=n;n=XG.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,ji("creating uWebSockets.js-based engine with opts %j",i);let o=new D6.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=u6.test(x),f=m?"map":"source",a='"'+C6+'"',v="W/"+a,$=p.getHeader("if-none-match");if($){if(a===$||v===$){ji("serve client %s 304",f),c.writeStatus("304 Not Modified"),c.end();return}}ji("serve client %s",f),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",a);let w=L6.join(__dirname,"../client-dist/",x);K0.serveFile(c,w)});K0.patchAdapter(n)}initEngine(n,i){if(ji("creating engine.io instance with opts %j",i),this.eio=D6.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){ji("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=u6.test(o),p=c?"map":"source",x='"'+C6+'"',m="W/"+x,f=n.headers["if-none-match"];if(f){if(x===f||m===f){ji("serve client %s 304",p),i.writeHead(304),i.end();return}}ji("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",x),Vp.sendFile(o,n,i)}static sendFile(n,i,o){let c=WG.createReadStream(L6.join(__dirname,"../client-dist/",n)),p=KG(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),Bf.pipeline(c,W0.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),Bf.pipeline(c,W0.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),Bf.pipeline(c,W0.createDeflate(),o,x);break;default:o.writeHead(200),Bf.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){ji("incoming connection with id %s",n.id);let i=new SG.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new GG.ParentNamespace(this);if(ji("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,m)=>m(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return ji("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(ji("initializing namespace %s",n),o=new S0.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),K0.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Hi.Server=Vp;var zG=Object.keys(N6.EventEmitter.prototype).filter(function(n){return typeof N6.EventEmitter.prototype[n]==="function"});zG.forEach(function(n){Vp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Nx.exports=(n,i)=>new Vp(n,i);Nx.exports.Server=Vp;Nx.exports.Namespace=S0.Namespace;Nx.exports.Socket=y6.Socket});import{createHash as gR}from"crypto";import{createServer as k2}from"http";import{createServer as Z2}from"https";function mm(n=Math.random){return n().toString(36).slice(2)}class cx extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function Y$(n){return Object.entries(n)}var l$=(n,i,o=d.STORE)=>{return wa(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function B(n){while(n.child!==null)n=n.child;return n}class $n{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class Ja extends $n{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Jc(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=i.default,W={key:w,default:X instanceof Function?X(a):X};if(i.effects)W.effects=i.effects(a);let R=Ac(J,W,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(a)=>Jc(a,i),internalRoles:o});return n.families.set(i.key,f),n.defaults.set(i.key,i.default),c}function H$(n,i){if("mutable"in i)return px(n,i);return Jc(n,i)}function Io(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=xx(J,{key:w,get:i.get(a)},$);return x.next({type:"state_creation",token:X}),X},c,{internalRoles:o,subject:x,install:(a)=>Io(a,i),default:(a)=>{return i.get(a)({get:(...$)=>ln(n,...$),find:(...$)=>r(n,...$),json:($)=>ni(n,$)})}});return n.families.set(i.key,f),c}function M$(n,i){if("set"in i)return mx(n,i);return Io(n,i)}class fm{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new fm([...this._buffer]);return n._index=this._index,n}}var d3={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function z$(n,i){let o=wn(i),c=`${n.key}(${o})`,p=d3[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function So(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class ii{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let x of o){c??=x,p??=x;let m=this.relations.get(x);if(m){if(m.size===1)this.relations.delete(x);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let m=this.relations.get(x);if(m)m.add(n);else m=new Set().add(n),this.relations.set(x,m)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let x=this.isAType?.(c)?c:void 0,m=x===void 0?c:void 0;for(let f of p)x??=f,m??=f,this.addRelation(x,m)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,o,c;switch(n.length){case 1:{let p=n[0];i=p[this.a],o=p[this.b],c=void 0;break}case 2:{let p=n[0];if(typeof p==="string")[i,o]=n;else i=p[this.a],o=p[this.b],c=n[1];break}default:{i=n[0],o=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{let p=this.getRelatedKey(i);if(p&&p!==o)this.delete(i,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==i)this.delete(p,o)}break;case"n:n":}if(c){let p=this.makeContentKey(i,o);this.setContent(p,c)}return this.addRelation(i,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let x of p){let m=this.makeContentKey(n,x),f=i[x];this.setContent(m,f)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function oi(n){return"epoch"in n.transactionMeta}function Gn(n){return"phase"in n.transactionMeta}var Q$=(n)=>{let i=B(n);if(!Gn(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};function Hn(n){return n[0].toUpperCase()+n.slice(1)}function Ko(n){return n.type.split("_").map(Hn).join(" ")}class Tc extends Error{constructor(n,i){super(`${Ko(n)} ${wn(n.key)} not found in store "${i.config.name}".`)}}function gc(n,i,o){return(...c)=>{let p=Fn(n,i);if(p)return p.run(c,o);throw new Tc(i,n)}}var am=(n)=>(i)=>n instanceof Function?n(i):n;var yo=(n,i)=>{if(n.valueMap.has(i.key))return n.logger.info("\uD83D\uDCD6",i.type,i.key,"reading cached value"),E$(i,n);if(i.type==="selector"||i.type==="readonly_selector")return n.logger.info("\uD83E\uDDEE",i.type,i.key,"computing value"),i.get();let o=i.default instanceof Function?i.default():i.default;return n.logger.info("\uD83D\uDC81","atom",i.key,"could not find cached value; using default",o),i.default instanceof Function?i.default():i.default};var O$=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!Gn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},U$=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},V$=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},dc=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var _$=(n,i,o)=>{switch(i.type){case"mutable_atom":n.logger.info("\uD83D\uDCE2",i.type,i.key,"is now (",o.newValue,") subscribers:",i.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":n.logger.info("\uD83D\uDCE2",i.type,i.key,"went (",o.oldValue,"->",o.newValue,") subscribers:",i.subject.subscribers)}i.subject.next(o)};var Aa=(n,i)=>{let o=B(n),c=o.selectorAtoms.getRelatedKeys(i.key);if(o.logger.info("\uD83E\uDDF9",i.type,i.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",i.type,i.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(V$(o,p))continue;B$(p,o),dc(o,p)}}};function e3(n,i){if(j$(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var b$=(n,i,o)=>{let{key:c}=i,p=B(n);if(!Gn(p)||p.transactionMeta.phase!=="building"){n.logger.error("\uD83D\uDC1E","atom",c,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!e3(c,o))return;let m={type:"atom_update",key:c,...o};if(i.family)m.family=i.family;p.transactionMeta.update.updates.push(m),n.logger.info("\uD83D\uDCC1","atom",c,"stowed (",o.oldValue,"->",o.newValue,")")};var L$=(n,i,o)=>{let c=yo(o,n),p=c;if(n.type==="mutable_atom"&&Gn(o)){let{parent:m}=o;p=fx(o,n,m)}if(p=am(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=ki(o,n.key,p,n.subject),D$(o,n.key))N$(o,n.key);dc(o,n.key),Aa(o,n);let x={oldValue:c,newValue:p};if(oi(o))_$(o,n,x);else if(o.parent){if(o.on.transactionApplying.state===null)b$(o,n,x);else if(n.key.startsWith("*")){let m=n.key.slice(1),f=o.atoms.get(m),a=o.valueMap.get(m);if(f.type==="mutable_atom"&&Gn(o)){let{parent:$}=o;a=fx(o,f,$)}if(a.do(x.newValue)===null)Aa(o,f)}}};var vm=(n,i,o)=>{switch(i.type){case"atom":case"mutable_atom":L$(i,o,n);break;case"selector":i.set(o);break}};function h$(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function On(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=h$(n,o)??null,c)p=o.family?mi(o.family.subKey):null,o=r(n,c,p)}else c=i[0],p=i[1],x=i[2],o=r(n,c,p);if("counterfeit"in o&&"family"in o){let a=o.family.subKey,v=n.disposalTraces.buffer.find(($)=>$?.key===a);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,v?`This state was previously disposed:
48
- ${v.trace}`:"No previous disposal trace was found.");return}let m=O$(n,o);if(m){let a=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{a(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),On(n,o,x)});return}let f=Fn(n,o);vm(n,f,x),U$(n)}function $m(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,f={key:c,type:"atom"};if(i.family)Object.assign(f,{family:i.family});On(o,f,m)}function C$(n){let{stack:i}=n;if(i)return`
47
+ `+c)}n.destroy()}var Bx=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function r5(n){if(n+="",n.length<1)return!1;if(!Bx[n.charCodeAt(0)])return xn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!Bx[n.charCodeAt(1)])return xn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!Bx[n.charCodeAt(2)])return xn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!Bx[n.charCodeAt(3)])return xn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!Bx[n.charCodeAt(i)])return xn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var G8=C((K8)=>{Object.defineProperty(K8,"__esModule",{value:!0});K8.Polling=void 0;var g5=_c(),X8=Kn("node:zlib"),e5=va(),nl=fi(),ei=nl.default("engine:polling"),il={gzip:X8.createGzip,deflate:X8.createDeflate};class W8 extends g5.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){ei("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}ei("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)ei("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,x=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let f in m)i.writeHeader(f,String(m[f]));let a=(f)=>{this.onData(f.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((f,v)=>{let $=x+f.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(v){a(Buffer.from(f));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(f).copy(p,x),v){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}a(p);return}x=$})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){ei('received "%s"',n);let i=(o)=>{if(o.type==="close")return ei("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)ei("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){ei('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(v)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=e5(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){ei("compressing");let c=[],p=0;il[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){ei("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)ei("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)ei("transport discarded - closing right away"),o();else ei("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}K8.Polling=W8});var Q8=C((H8)=>{Object.defineProperty(H8,"__esModule",{value:!0});H8.WebSocket=void 0;var ol=_c(),cl=fi(),M8=cl.default("engine:ws");class Y8 extends ol.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(x)=>{let m=typeof x!=="string",a=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(M8('writing "%s"',x),this.socket.send(x,m,a),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){M8("closing"),n&&n(),this.socket.end()}}H8.WebSocket=Y8});var O8=C((E8)=>{Object.defineProperty(E8,"__esModule",{value:!0});var pl=G8(),xl=Q8();E8.default={polling:pl.Polling,websocket:xl.WebSocket}});var u8=C((_8)=>{Object.defineProperty(_8,"__esModule",{value:!0});_8.uServer=void 0;var al=fi(),bc=o$(),fl=O8(),pc=al.default("engine:uws");class U8 extends bc.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{pc("response has been aborted")})}createTransport(n,i){return new fl.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new V8(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){pc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:bc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)pc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,a)=>this.abortRequest(n,m,a);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){pc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:bc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,a;if(m){let f=this.clients[m];if(!f)return pc("upgrade attempt for closed client"),n.close();else if(f.upgrading)return pc("transport has already been trying to upgrade"),n.close();else if(f.upgraded)return pc("transport had already been upgraded"),n.close();else pc("upgrading existing transport"),a=this.createTransport(i._query.transport,i),f._maybeUpgrade(a)}else if(a=await this.handshake(i._query.transport,i,(f,v)=>this.abortRequest(n,f,v)),!a)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:a},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===bc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:bc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}_8.uServer=U8;class V8{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var N8=C((zp)=>{Object.defineProperty(zp,"__esModule",{value:!0});zp.protocol=zp.Transport=zp.Socket=zp.uServer=zp.parser=zp.transports=zp.Server=void 0;zp.listen=Fl;zp.attach=D8;var vl=Kn("node:http"),B8=o$();Object.defineProperty(zp,"Server",{enumerable:!0,get:function(){return B8.Server}});var $l=gv();zp.transports=$l.default;var j8=ux();zp.parser=j8;var wl=u8();Object.defineProperty(zp,"uServer",{enumerable:!0,get:function(){return wl.uServer}});var Jl=ev();Object.defineProperty(zp,"Socket",{enumerable:!0,get:function(){return Jl.Socket}});var Al=_c();Object.defineProperty(zp,"Transport",{enumerable:!0,get:function(){return Al.Transport}});zp.protocol=j8.protocol;function Fl(n,i,o){if(typeof i==="function")o=i,i={};let c=vl.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=D8(c,i);return p.httpServer=c,c.listen(n,o),p}function D8(n,i){let o=new B8.Server(i);return o.attach(n,i),o}});var h8=C((Kl)=>{Kl.Emitter=Ei;function Ei(n){if(n)return Wl(n)}function Wl(n){for(var i in Ei.prototype)n[i]=Ei.prototype[i];return n}Ei.prototype.on=Ei.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Ei.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Ei.prototype.off=Ei.prototype.removeListener=Ei.prototype.removeAllListeners=Ei.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Ei.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Ei.prototype.emitReserved=Ei.prototype.emit;Ei.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Ei.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var c$=C((y8)=>{Object.defineProperty(y8,"__esModule",{value:!0});y8.hasBinary=y8.isBinary=void 0;var Gl=typeof ArrayBuffer==="function",Ml=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},C8=Object.prototype.toString,Yl=typeof Blob==="function"||typeof Blob!=="undefined"&&C8.call(Blob)==="[object BlobConstructor]",Hl=typeof File==="function"||typeof File!=="undefined"&&C8.call(File)==="[object FileConstructor]";function I8(n){return Gl&&(n instanceof ArrayBuffer||Ml(n))||Yl&&n instanceof Blob||Hl&&n instanceof File}y8.isBinary=I8;function Ya(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Ya(n[o]))return!0;return!1}if(I8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Ya(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Ya(n[o]))return!0;return!1}y8.hasBinary=Ya});var s8=C((Z8)=>{Object.defineProperty(Z8,"__esModule",{value:!0});Z8.reconstructPacket=Z8.deconstructPacket=void 0;var Ql=c$();function El(n){let i=[],o=n.data,c=n;return c.data=p$(o,i),c.attachments=i.length,{packet:c,buffers:i}}Z8.deconstructPacket=El;function p$(n,i){if(!n)return n;if(Ql.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=p$(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=p$(n[c],i);return o}return n}function Ol(n,i){return n.data=x$(n.data,i),delete n.attachments,n}Z8.reconstructPacket=Ol;function x$(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=x$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=x$(n[o],i)}return n}});var Dx=C((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});n6.Decoder=n6.Encoder=n6.PacketType=n6.protocol=void 0;var Vl=h8(),r8=s8(),d8=c$(),_l=fi(),m$=_l.default("socket.io-parser"),bl=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];n6.protocol=5;var yn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(yn=n6.PacketType||(n6.PacketType={}));class g8{constructor(n){this.replacer=n}encode(n){if(m$("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(d8.hasBinary(n))return this.encodeAsBinary({type:n.type===yn.EVENT?yn.BINARY_EVENT:yn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===yn.BINARY_EVENT||n.type===yn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return m$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=r8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}n6.Encoder=g8;function P8(n){return Object.prototype.toString.call(n)==="[object Object]"}class a$ extends Vl.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===yn.BINARY_EVENT;if(o||i.type===yn.BINARY_ACK){if(i.type=o?yn.EVENT:yn.ACK,this.reconstructor=new e8(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(d8.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(yn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===yn.BINARY_EVENT||o.type===yn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let x=n.charAt(i);if(x==null||Number(x)!=x){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(a$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return m$("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case yn.CONNECT:return P8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||P8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&bl.indexOf(i[0])===-1);case yn.ACK:case yn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}n6.Decoder=a$;class e8{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=r8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var x6=C((c6)=>{Object.defineProperty(c6,"__esModule",{value:!0});c6.Client=void 0;var Ha=Dx(),jl=fi(),Dl=Kn("node:url"),wo=jl("socket.io:client");class o6{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)wo("no namespace joined yet, close the client"),this.close();else wo("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return wo("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else wo("creation of namespace %s was denied",n),this._packet({type:Ha.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else wo("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")wo("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){wo("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){wo("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){wo("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=Dl.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===Ha.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Ha.PacketType.CONNECT&&n.type!==Ha.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else wo("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){wo("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}c6.Client=o6});var za=C((a6)=>{Object.defineProperty(a6,"__esModule",{value:!0});a6.StrictEventEmitter=void 0;var Ll=Kn("node:events");class m6 extends Ll.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}a6.StrictEventEmitter=m6});var f$=C((v6)=>{Object.defineProperty(v6,"__esModule",{value:!0});v6.RESERVED_EVENTS=void 0;v6.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var $$=C((w6)=>{Object.defineProperty(w6,"__esModule",{value:!0});w6.RemoteSocket=w6.BroadcastOperator=void 0;var Nl=f$(),hl=Dx();class Bo{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new Bo(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new Bo(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new Bo(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new Bo(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new Bo(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new Bo(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(Nl.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:hl.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let x=o.pop(),m=!1,a=[],f=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:a])},this.flags.timeout),v=-1,$=0,w=0,J=()=>{if(!m&&v===$&&a.length===w)clearTimeout(f),x.apply(this,[null,this.flags.expectSingleResponse?a[0]:a])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(S)=>{w+=S,$++,J()},(S)=>{a.push(S),J()}),this.adapter.serverCount().then((S)=>{v=S,J()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new v$(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}w6.BroadcastOperator=Bo;class v${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new Bo(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}w6.RemoteSocket=v$});var w$=C((Qp)=>{var T6=Qp&&Qp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Socket=void 0;var no=Dx(),Il=T6(fi()),yl=za(),A6=T6(Dv()),kl=$$(),Zl=f$(),Gi=Il.default("socket.io:socket"),ql=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function F6(){}class R6 extends yl.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:no.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=A6.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=A6.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",F6)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(Zl.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:no.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let x=this.nsp._ids++;Gi("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((x,m)=>{if(o)return x?p(x):c(m);else return c(x)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{Gi("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return Gi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Gi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Gi("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:no.PacketType.CONNECT});else this.packet({type:no.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(Gi("got packet %j",n),n.type){case no.PacketType.EVENT:this.onevent(n);break;case no.PacketType.BINARY_EVENT:this.onevent(n);break;case no.PacketType.ACK:this.onack(n);break;case no.PacketType.BINARY_ACK:this.onack(n);break;case no.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(Gi("emitting event %j",i),n.id!=null)Gi("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);Gi("sending ack %j",c),i.packet({id:n,type:no.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")Gi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Gi("bad ack %s",n.id)}ondisconnect(){Gi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Gi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&ql.has(n))Gi("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=F6}_error(n){this.packet({type:no.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:no.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){Gi("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else Gi("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new kl.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Qp.Socket=R6});var J$=C((jo)=>{var sl=jo&&jo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jo,"__esModule",{value:!0});jo.Namespace=jo.RESERVED_EVENTS=void 0;var S6=w$(),Pl=za(),tl=sl(fi()),Ii=$$(),Lx=tl.default("socket.io:namespace");jo.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class X6 extends Pl.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new Ii.BroadcastOperator(this.adapter).to(n)}in(n){return new Ii.BroadcastOperator(this.adapter).in(n)}except(n){return new Ii.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Lx("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Lx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Lx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(x){Lx("error while restoring session: %s",x)}if(p)return Lx("connection state recovered for sid %s",p.sid),new S6.Socket(this,n,i,p)}return new S6.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new Ii.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(jo.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new Ii.BroadcastOperator(this.adapter).allSockets()}compress(n){return new Ii.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new Ii.BroadcastOperator(this.adapter).volatile}get local(){return new Ii.BroadcastOperator(this.adapter).local}timeout(n){return new Ii.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new Ii.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new Ii.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new Ii.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new Ii.BroadcastOperator(this.adapter).disconnectSockets(n)}}jo.Namespace=X6});var H6=C((M6)=>{Object.defineProperty(M6,"__esModule",{value:!0});M6.yeast=M6.decode=M6.encode=void 0;var l6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Qa=64,G6={},W6=0,xc=0,K6;function A$(n){let i="";do i=l6[n%Qa]+i,n=Math.floor(n/Qa);while(n>0);return i}M6.encode=A$;function rl(n){let i=0;for(xc=0;xc<n.length;xc++)i=i*Qa+G6[n.charAt(xc)];return i}M6.decode=rl;function dl(){let n=A$(+new Date);if(n!==K6)return W6=0,K6=n;return n+"."+A$(W6++)}M6.yeast=dl;for(;xc<Qa;xc++)G6[l6[xc]]=xc});var R$=C((Q6)=>{var F$;Object.defineProperty(Q6,"__esModule",{value:!0});Q6.SessionAwareAdapter=Q6.Adapter=void 0;var n9=Kn("node:events"),i9=H6(),Ea=Kn("ws"),o9=typeof((F$=Ea===null||Ea===void 0?void 0:Ea.Sender)===null||F$===void 0?void 0:F$.frame)==="function";class T$ extends n9.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,x),a=0;this.apply(i,(f)=>{if(a++,f.acks.set(n.id,c),typeof f.notifyOutgoingListeners==="function")f.notifyOutgoingListeners(n);f.client.writeToEngine(m,x)}),o(a)}_encode(n,i){let o=this.encoder.encode(n);if(o9&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Ea.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let x of o){if(!this.rooms.has(x))continue;for(let m of this.rooms.get(x)){if(p.has(m)||c.has(m))continue;let a=this.nsp.sockets.get(m);if(a)i(a),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}Q6.Adapter=T$;class z6 extends T${constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((m)=>m.id===i);if(p===-1)return null;let x=[];for(let m=p+1;m<this.packets.length;m++){let a=this.packets[m];if(c9(o.rooms,a.opts))x.push(a.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let m=i9.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}Q6.SessionAwareAdapter=z6;function c9(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var U6=C((Jo)=>{var x9=Jo&&Jo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ClusterAdapterWithHeartbeat=Jo.ClusterAdapter=Jo.MessageType=void 0;var m9=R$(),a9=fi(),f9=Kn("node:crypto"),qn=a9.debug("socket.io-adapter"),v9="emitter",Oa=5000;function Op(){return f9.randomBytes(8).toString("hex")}var on;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(on=Jo.MessageType||(Jo.MessageType={}));function uc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function Ep(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class S$ extends m9.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Op()}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Ep(n.data.opts),(c)=>{qn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{qn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=Ep(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case on.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case on.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case on.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case on.FETCH_SOCKETS:{qn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Ep(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:on.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,m=x9(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case on.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(m)=>{if(p)return;p=!0,qn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:on.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,x]);break}case on.BROADCAST_CLIENT_COUNT:case on.BROADCAST_ACK:case on.FETCH_SOCKETS_RESPONSE:case on.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:qn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case on.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case on.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case on.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:qn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:on.BROADCAST,data:{packet:n,opts:uc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return qn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,x=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&m)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let m=Op();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:on.BROADCAST,data:{packet:n,requestId:m,opts:uc(i)}}),setTimeout(()=>{this.ackRequests.delete(m)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_JOIN,data:{opts:uc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_LEAVE,data:{opts:uc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.DISCONNECT_SOCKETS,data:{opts:uc(n),close:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.requests.get(x);if($)a(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||Oa),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,current:0,expected:p,responses:o};this.requests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:uc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.requests.get(p);if(a)o(new Error(`timeout reached: only ${a.current} responses received out of ${a.expected}`),a.responses),this.requests.delete(p)},Oa),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{qn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{qn("[%s] error while publishing response: %s",this.uid,o)})}}Jo.ClusterAdapter=S$;class O6 extends S${constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)qn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:on.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:on.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:on.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==v9)this.nodesMap.set(n.uid,Date.now());switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.INITIAL_HEARTBEAT:this.publish({type:on.HEARTBEAT});break;case on.HEARTBEAT:break;case on.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.customRequests.get(p);if(a)o(new Error(`timeout reached: missing ${a.missingUids.size} responses`),a.responses),this.customRequests.delete(p)},Oa),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.customRequests.get(x);if($)a(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Oa),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:uc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case on.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===on.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===on.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}Jo.ClusterAdapterWithHeartbeat=O6});var Ua=C((Bc)=>{Object.defineProperty(Bc,"__esModule",{value:!0});Bc.MessageType=Bc.ClusterAdapterWithHeartbeat=Bc.ClusterAdapter=Bc.SessionAwareAdapter=Bc.Adapter=void 0;var V6=R$();Object.defineProperty(Bc,"Adapter",{enumerable:!0,get:function(){return V6.Adapter}});Object.defineProperty(Bc,"SessionAwareAdapter",{enumerable:!0,get:function(){return V6.SessionAwareAdapter}});var X$=U6();Object.defineProperty(Bc,"ClusterAdapter",{enumerable:!0,get:function(){return X$.ClusterAdapter}});Object.defineProperty(Bc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return X$.ClusterAdapterWithHeartbeat}});Object.defineProperty(Bc,"MessageType",{enumerable:!0,get:function(){return X$.MessageType}})});var B6=C((Up)=>{var w9=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var _6=J$(),J9=Ua(),A9=w9(fi()),b6=A9.default("socket.io:parent-namespace");class Va extends _6.Namespace{constructor(n){super(n,"/_"+Va.count++);this.children=new Set}_initAdapter(){this.adapter=new u6(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){b6("creating child namespace %s",n);let i=new _6.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)b6("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Up.ParentNamespace=Va;Va.count=0;class u6 extends J9.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var C6=C((Dc)=>{var F9=Dc&&Dc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.patchAdapter=R9;Dc.restoreAdapter=S9;Dc.serveFile=W9;var jc=Ua(),j6=Kn("node:fs"),T9=F9(fi()),_a=T9.default("socket.io:adapter-uws"),W$="\x1F",{addAll:L6,del:N6,broadcast:h6}=jc.Adapter.prototype;function R9(n){jc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);L6.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){D6(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)D6(this.nsp.name,p,c,x)})},jc.Adapter.prototype.del=function(i,o){N6.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,x=c.conn.transport.socket,m=`${this.nsp.name}${W$}${o}`;_a("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},jc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){h6.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),a=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${W$}${o.rooms.keys().next().value}`;_a("fast publish to %s",a),m.forEach((f)=>{let v=typeof f!=="string";n.publish(a,v?f:"4"+f,v)}),this.apply(o,(f)=>{if(f.conn.transport.name!=="websocket")f.client.writeToEngine(m,x)})}}function D6(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)_a("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let a=`${n}${W$}${m}`;_a("subscribe connection %s to topic %s",p,a),x.subscribe(a)})}function S9(){jc.Adapter.prototype.addAll=L6,jc.Adapter.prototype.del=N6,jc.Adapter.prototype.broadcast=h6}var X9=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function W9(n,i){let{size:o}=j6.statSync(i),c=j6.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(a)=>{throw p(),a},m=(a)=>{let f=X9(a);n.cork(()=>{let v=n.getWriteOffset(),[$,w]=n.tryEnd(f,o);if(!w&&!$)c.pause(),n.onWritable((J)=>{let[S,X]=n.tryEnd(f.slice(J-v),o);if(!X&&S)c.resume();return S})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var I6=C((PL,K9)=>{K9.exports={name:"socket.io",version:"4.8.1",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var d6=C((Mi,Nx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",l9=Mi&&Mi.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),G9=Mi&&Mi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),M9=Mi&&Mi.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))l9(i,n,o)}return G9(i,n),i},t6=Mi&&Mi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.Namespace=Mi.Socket=Mi.Server=void 0;var Y9=Kn("node:http"),H9=Kn("node:fs"),K$=Kn("node:zlib"),z9=va(),ba=Kn("node:stream"),y6=Kn("node:path"),k6=N8(),Q9=x6(),Z6=Kn("node:events"),G$=J$();Object.defineProperty(Mi,"Namespace",{enumerable:!0,get:function(){return G$.Namespace}});var E9=B6(),q6=Ua(),O9=M9(Dx()),U9=t6(fi()),r6=w$();Object.defineProperty(Mi,"Socket",{enumerable:!0,get:function(){return r6.Socket}});var V9=za(),l$=C6(),_9=t6(i$()),Bi=U9.default("socket.io:server"),s6=I6().version,P6=/\.map/;class Vp extends V9.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||O9,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||q6.SessionAwareAdapter);else this.adapter(i.adapter||q6.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=_9.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let x=c.next();if(x.done)return o(!1);x.value(n,i,(m,a)=>{if(m||!a)return p();if(this._nsps.has(n))return Bi("dynamic namespace %s already exists",n),o(this._nsps.get(n));let f=this.parentNsps.get(x.value).createChild(n);Bi("dynamic namespace %s was created",n),o(f)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){Bi("creating http server and binding to %d",n);let o=n;n=Y9.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,Bi("creating uWebSockets.js-based engine with opts %j",i);let o=new k6.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=P6.test(x),a=m?"map":"source",f='"'+s6+'"',v="W/"+f,$=p.getHeader("if-none-match");if($){if(f===$||v===$){Bi("serve client %s 304",a),c.writeStatus("304 Not Modified"),c.end();return}}Bi("serve client %s",a),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",f);let w=y6.join(__dirname,"../client-dist/",x);l$.serveFile(c,w)});l$.patchAdapter(n)}initEngine(n,i){if(Bi("creating engine.io instance with opts %j",i),this.eio=k6.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){Bi("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=P6.test(o),p=c?"map":"source",x='"'+s6+'"',m="W/"+x,a=n.headers["if-none-match"];if(a){if(x===a||m===a){Bi("serve client %s 304",p),i.writeHead(304),i.end();return}}Bi("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",x),Vp.sendFile(o,n,i)}static sendFile(n,i,o){let c=H9.createReadStream(y6.join(__dirname,"../client-dist/",n)),p=z9(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),ba.pipeline(c,K$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),ba.pipeline(c,K$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),ba.pipeline(c,K$.createDeflate(),o,x);break;default:o.writeHead(200),ba.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){Bi("incoming connection with id %s",n.id);let i=new Q9.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new E9.ParentNamespace(this);if(Bi("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,m)=>m(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return Bi("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(Bi("initializing namespace %s",n),o=new G$.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),l$.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Mi.Server=Vp;var b9=Object.keys(Z6.EventEmitter.prototype).filter(function(n){return typeof Z6.EventEmitter.prototype[n]==="function"});b9.forEach(function(n){Vp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Nx.exports=(n,i)=>new Vp(n,i);Nx.exports.Server=Vp;Nx.exports.Namespace=G$.Namespace;Nx.exports.Socket=r6.Socket});import{createHash as pS}from"node:crypto";import{createServer as dM}from"node:http";import{createServer as gM}from"node:https";function am(n=Math.random){return n().toString(36).slice(2)}class cx extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function Y0(n){return Object.entries(n)}var H0=(n,i,o=g.STORE)=>{return Jf(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function j(n){while(n.child!==null)n=n.child;return n}class $n{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class Af extends $n{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Jc(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=i.default,X={key:w,default:S instanceof Function?S(f):S};if(i.effects)X.effects=i.effects(f);let R=Ac(J,X,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(f)=>Jc(f,i),internalRoles:o});return n.families.set(i.key,a),n.defaults.set(i.key,i.default),c}function z0(n,i){if("mutable"in i)return px(n,i);return Jc(n,i)}function Io(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=xx(J,{key:w,get:i.get(f)},$);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(f)=>Io(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:(...$)=>t(n,...$),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function Q0(n,i){if("set"in i)return mx(n,i);return Io(n,i)}class fm{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new fm([...this._buffer]);return n._index=this._index,n}}var x3={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function E0(n,i){let o=wn(i),c=`${n.key}(${o})`,p=x3[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function lo(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class ii{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let x of o){c??=x,p??=x;let m=this.relations.get(x);if(m){if(m.size===1)this.relations.delete(x);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let m=this.relations.get(x);if(m)m.add(n);else m=new Set().add(n),this.relations.set(x,m)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let x=this.isAType?.(c)?c:void 0,m=x===void 0?c:void 0;for(let a of p)x??=a,m??=a,this.addRelation(x,m)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,o,c;switch(n.length){case 1:{let p=n[0];i=p[this.a],o=p[this.b],c=void 0;break}case 2:{let p=n[0];if(typeof p==="string")[i,o]=n;else i=p[this.a],o=p[this.b],c=n[1];break}default:{i=n[0],o=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{let p=this.getRelatedKey(i);if(p&&p!==o)this.delete(i,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==i)this.delete(p,o)}break;case"n:n":}if(c){let p=this.makeContentKey(i,o);this.setContent(p,c)}return this.addRelation(i,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let x of p){let m=this.makeContentKey(n,x),a=i[x];this.setContent(m,a)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function $i(n){return"epoch"in n.transactionMeta}function Mn(n){return"phase"in n.transactionMeta}var O0=(n)=>{let i=j(n);if(!Mn(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};function Yn(n){return n[0].toUpperCase()+n.slice(1)}function Ko(n){return n.type.split("_").map(Yn).join(" ")}class Fc extends Error{constructor(n,i){super(`${Ko(n)} ${wn(n.key)} not found in store "${i.config.name}".`)}}function dc(n,i,o){return(...c)=>{let p=Tn(n,i);if(p)return p.run(c,o);throw new Fc(i,n)}}var vm=(n)=>(i)=>n instanceof Function?n(i):n;var yo=(n,i)=>{if(n.valueMap.has(i.key))return n.logger.info("\uD83D\uDCD6",i.type,i.key,"reading cached value"),U0(i,n);switch(i.type){case"selector":case"readonly_selector":return n.logger.info("\uD83E\uDDEE",i.type,i.key,"computing value"),i.get();case"atom":case"mutable_atom":{let o=i.default,c;if(o instanceof Function)c=o();else c=o;return n.logger.info("\uD83D\uDC81","atom",i.key,"could not find cached value; using default",c),c}}};var V0=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!Mn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},_0=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},b0=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},gc=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var u0=(n,i,o)=>{switch(i.type){case"mutable_atom":n.logger.info("\uD83D\uDCE2",i.type,i.key,"is now (",o.newValue,") subscribers:",i.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":n.logger.info("\uD83D\uDCE2",i.type,i.key,"went (",o.oldValue,"->",o.newValue,") subscribers:",i.subject.subscribers)}i.subject.next(o)};var Ff=(n,i)=>{let o=j(n),c=o.selectorAtoms.getRelatedKeys(i.key);if(o.logger.info("\uD83E\uDDF9",i.type,i.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",i.type,i.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(b0(o,p))continue;B0(p,o),gc(o,p)}}};var j0=(n,i,o)=>{let c=yo(n,i),p=c;if(i.type==="mutable_atom"&&Mn(n)){let{parent:m}=n;p=ax(n,i,m)}if(p=vm(o)(p),n.logger.info("\uD83D\uDCDD","atom",i.key,"set to",p),p=Zi(n,i.key,p,i.subject),L0(n,i.key))N0(n,i.key);gc(n,i.key),Ff(n,i);let x={oldValue:c,newValue:p};if(!Mn(n)){u0(n,i,x);return}if(n.on.transactionApplying.state===null){let{key:m}=i;if(D0(x.newValue))return;let a={type:"atom_update",key:m,...x};if(i.family)a.family=i.family;n.transactionMeta.update.updates.push(a),n.logger.info("\uD83D\uDCC1","atom",m,"stowed (",x.oldValue,"->",x.newValue,")")}else if(i.key.startsWith("*")){let m=i.key.slice(1),a=n.atoms.get(m),f=n.valueMap.get(m);if(a.type==="mutable_atom"&&Mn(n)){let{parent:$}=n;f=ax(n,a,$)}if(f.do(x.newValue)===null)Ff(n,a)}};var $m=(n,i,o)=>{switch(i.type){case"atom":case"mutable_atom":j0(n,i,o);break;case"selector":i.set(o);break}};function h0(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function On(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=h0(n,o)??null,c)p=o.family?xi(o.family.subKey):null,o=t(n,c,p)}else c=i[0],p=i[1],x=i[2],o=t(n,c,p);if("counterfeit"in o&&"family"in o){let f=o.family.subKey,v=n.disposalTraces.buffer.find(($)=>$?.key===f);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,v?`This state was previously disposed:
48
+ ${v.trace}`:"No previous disposal trace was found.");return}let m=V0(n,o);if(m){let f=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{f(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),On(n,o,x)});return}let a=Tn(n,o);$m(n,a,x),_0(n)}function wm(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,a={key:c,type:"atom"};if(i.family)Object.assign(a,{family:i.family});On(o,a,m)}function C0(n){let{stack:i}=n;if(i)return`
49
49
  `+i.split(`
50
50
  `)?.slice(1)?.join(`
51
- `);return""}function u$(n,i=d.STORE){let o={key:n,stringKey:wn(n),dependsOn:"any"};return i.molecules.set(wn(n),o),n}function Fc(n,i,o,c="any"){let p=i,x=wn(o),m=[],f=B(n);if(Array.isArray(p))for(let $ of p){let w=wn($);if(f.molecules.get(w))n.moleculeGraph.set(w,x,{source:w});else m.push(w)}else{let $=wn(p);if(f.molecules.get($))n.moleculeGraph.set($,x,{source:$});else m.push($)}if(m.length===0)f.molecules.set(x,{key:o,stringKey:x,dependsOn:c});let a={type:"molecule_creation",key:o,provenance:p};if(Gn(f)&&f.transactionMeta.phase==="building")f.transactionMeta.update.updates.push(a);else f.on.moleculeCreation.next(a);for(let $ of m){let w=n.disposalTraces.buffer.find((J)=>J?.key===$);n.logger.error("\u274C","molecule",o,"allocation failed:",`Could not allocate to ${$} in store "${n.config.name}".`,w?`
51
+ `);return""}function I0(n,i=g.STORE){let o={key:n,stringKey:wn(n),dependsOn:"any"};return i.molecules.set(wn(n),o),n}function Tc(n,i,o,c="any"){let p=i,x=wn(o),m=[],a=j(n);if(Array.isArray(p))for(let $ of p){let w=wn($);if(a.molecules.get(w))n.moleculeGraph.set(w,x,{source:w});else m.push(w)}else{let $=wn(p);if(a.molecules.get($))n.moleculeGraph.set($,x,{source:$});else m.push($)}if(m.length===0)a.molecules.set(x,{key:o,stringKey:x,dependsOn:c});let f={type:"molecule_creation",key:o,provenance:p};if(Mn(a)&&a.transactionMeta.phase==="building")a.transactionMeta.update.updates.push(f);else a.on.moleculeCreation.next(f);for(let $ of m){let w=n.disposalTraces.buffer.find((J)=>J?.key===$);n.logger.error("\u274C","molecule",o,"allocation failed:",`Could not allocate to ${$} in store "${n.config.name}".`,w?`
52
52
  ${$} was most recently disposed
53
- ${w.trace}`:`No previous disposal trace for ${$} was found.`)}return o}function I$(n,i,o,c){let p=`T$--${i}==${o}++${c}`;return Fc(n,[o,c],p,"all"),p}function Rc(n,i){let o=wn(i),c=n.molecules.get(o);if(!c){let X=n.disposalTraces.buffer.find((W)=>W?.key===o);n.logger.error("\u274C","molecule",i,"deallocation failed:",`Could not find allocation for ${o} in store "${n.config.name}".`,X?`
53
+ ${w.trace}`:`No previous disposal trace for ${$} was found.`)}return o}function y0(n,i,o,c){let p=`T$--${i}==${o}++${c}`;return Tc(n,[o,c],p,"all"),p}function Rc(n,i){let o=wn(i),c=n.molecules.get(o);if(!c){let S=n.disposalTraces.buffer.find((X)=>X?.key===o);n.logger.error("\u274C","molecule",i,"deallocation failed:",`Could not find allocation for ${o} in store "${n.config.name}".`,S?`
54
54
  This state was most recently deallocated
55
- ${X.trace}`:`No previous disposal trace for ${o} was found.`);return}let p=n.moleculeJoins.getRelatedKeys(c.key);if(p)for(let X of p){let W=n.joins.get(X);if(W)W.relations.delete(c.key),W.molecules.delete(c.stringKey)}n.moleculeJoins.delete(c.stringKey);let x=[],m=[],f={type:"molecule_disposal",key:c.key,values:m,provenance:x},a=B(n);a.molecules.delete(o);let v=Gn(a)&&a.transactionMeta.phase==="building";if(v)a.transactionMeta.update.updates.push(f);let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey});if($)for(let[X,{source:W}]of $)if(W===c.stringKey){let R=mi(X);Rc(n,R)}else x.push(W);let w=a.moleculeData.getRelatedKeys(c.stringKey);if(w)for(let X of w){let W=a.families.get(X),R=r(n,W,c.key);m.push([W.key,R]),Xc(n,R)}if(a.moleculeGraph.delete(c.stringKey),a.moleculeJoins.delete(c.stringKey),a.moleculeData.delete(c.stringKey),!v)a.on.moleculeDisposal.next(f);a.molecules.delete(c.stringKey);let J=C$(new Error);n.disposalTraces.add({key:o,trace:J})}function ec(n,i,o,c){let p=wn(o),x=B(n),m=x.molecules.get(p);if(!m){let J=n.disposalTraces.buffer.find((X)=>X?.key===p);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${p} in store "${n.config.name}".`,J?`
55
+ ${S.trace}`:`No previous disposal trace for ${o} was found.`);return}let p=n.moleculeJoins.getRelatedKeys(c.key);if(p)for(let S of p){let X=n.joins.get(S);if(X)X.relations.delete(c.key),X.molecules.delete(c.stringKey)}n.moleculeJoins.delete(c.stringKey);let x=[],m=[],a={type:"molecule_disposal",key:c.key,values:m,provenance:x},f=j(n);f.molecules.delete(o);let v=Mn(f)&&f.transactionMeta.phase==="building";if(v)f.transactionMeta.update.updates.push(a);let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey});if($)for(let[S,{source:X}]of $)if(X===c.stringKey){let R=xi(S);Rc(n,R)}else x.push(X);let w=f.moleculeData.getRelatedKeys(c.stringKey);if(w)for(let S of w){let X=f.families.get(S),R=t(n,X,c.key);m.push([X.key,R]),Sc(n,R)}if(f.moleculeGraph.delete(c.stringKey),f.moleculeJoins.delete(c.stringKey),f.moleculeData.delete(c.stringKey),!v)f.on.moleculeDisposal.next(a);f.molecules.delete(c.stringKey);let J=C0(new Error);n.disposalTraces.add({key:o,trace:J})}function ec(n,i,o,c){let p=wn(o),x=j(n),m=x.molecules.get(p);if(!m){let J=n.disposalTraces.buffer.find((S)=>S?.key===p);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${p} in store "${n.config.name}".`,J?`
56
56
  ${p} was most recently disposed
57
- ${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let f=wn(i),a=x.molecules.get(f);if(!a){let J=n.disposalTraces.buffer.find((X)=>X?.key===f);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${f} in store "${n.config.name}".`,J?`
58
- ${f} was most recently disposed
59
- ${J.trace}`:`No previous disposal trace for ${f} was found.`),o}let v=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>mi(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:a.stringKey,downstreamMoleculeKey:m.stringKey},{source:a.stringKey});let $={type:"molecule_transfer",key:m.key,from:v,to:[a.key]};if(Gn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push($);return o}function Ta(n,i,o){switch(i){case"newValue":{y$(n,o);break}case"oldValue":{Xc(o,n.token);break}}}function Fa(n,i,o){switch(i){case"newValue":{Xc(o,n.token);break}case"oldValue":{if(y$(n,o),n.subType==="atom")o.valueMap.set(n.token.key,n.value);break}}}function y$(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)r(i,c,mi(o.subKey))}}function k$(n,i,o){switch(i){case"newValue":Fc(o,n.provenance,n.key);break;case"oldValue":Rc(o,n.key);break}}function Z$(n,i,o){switch(i){case"newValue":Rc(o,n.key);break;case"oldValue":{let c=n.provenance.map(mi);Fc(o,c,n.key);for(let[p,x]of n.values){let m=o.families.get(p);if(m){r(o,m,n.key);let f=`${p}(${wn(n.key)})`;o.valueMap.set(f,x)}}}break}}function q$(n,i,o){switch(i){case"newValue":{let c=n.to.length===1?n.to[0]:n.to;ec(o,c,n.key,"exclusive")}break;case"oldValue":{let c=n.from.length===1?n.from[0]:n.from;ec(o,c,n.key,"exclusive")}break}}function wm(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":$m(n,p,o);break;case"state_creation":Ta(p,n,o);break;case"state_disposal":Fa(p,n,o);break;case"molecule_creation":k$(p,n,o);break;case"molecule_disposal":Z$(p,n,o);break;case"molecule_transfer":q$(p,n,o);break;case"transaction_update":wm(n,p,o);break}}function P$(n,i,o){if(oi(n)&&i)n.transactionMeta.epoch.set(i,o)}function s$(n,i,o){if(!oi(n))return;let p=n.transactionMeta.actionContinuities.getRelatedKey(i);if(p!==void 0)n.transactionMeta.epoch.set(p,o)}var r$=(n,i)=>{let o=B(i),{parent:c}=o;if(c===null||!Gn(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),wm("newValue",o.transactionMeta.update,c),oi(c))s$(c,o.transactionMeta.update.key,o.transactionMeta.update.epoch),Fn(i,{key:o.transactionMeta.update.key,type:"transaction"})?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(Gn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function t$(n,i,o){if(!oi(n))return;let{epoch:p,actionContinuities:x}=n.transactionMeta;if(x.set(i,o),!p.has(i))p.set(i,-1)}function g$(n){return{store:n}}function ln(n,...i){let o,c,p;if(i.length===1)o=i[0];else c=i[0],p=i[1],o=r(n,c,p);if("counterfeit"in o&&"family"in o){c=n.families.get(o.family.key);let x=o.family.subKey,m=n.disposalTraces.buffer.find((f)=>f?.key===x);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,m?`This state was previously disposed:
60
- ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let f=Fn(n,c).default(x);return n.defaults.set(c.key,f),f}}}return yo(n,Fn(n,o))}class Zi extends Map{deleted=new Set;source;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var d$=(n,i,o,c)=>{let p=B(n),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new Zi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new Zi(p.families),joins:new Zi(p.joins),operation:{open:!1},readonlySelectors:new Zi(p.readonlySelectors),timelines:new Zi(p.timelines),timelineTopics:new ii(p.timelineTopics.toJSON()),trackers:new Map,transactions:new Zi(p.transactions),selectorAtoms:new ii(p.selectorAtoms.toJSON()),selectorGraph:new ii(p.selectorGraph.toJSON(),{makeContentKey:(...v)=>v.sort().join(":")}),selectors:new Zi(p.selectors),valueMap:new Zi(p.valueMap),defaults:p.defaults,disposalTraces:n.disposalTraces.copy(),molecules:new Zi(p.molecules),moleculeGraph:new ii(p.moleculeGraph.toJSON(),{makeContentKey:p.moleculeGraph.makeContentKey}),moleculeData:new ii(p.moleculeData.toJSON(),{makeContentKey:p.moleculeData.makeContentKey}),moleculeJoins:new ii(p.moleculeJoins.toJSON(),{makeContentKey:p.moleculeJoins.makeContentKey}),miscResources:new Zi(p.miscResources)},m=e$(n,i),f={phase:"building",update:{type:"transaction_update",key:i,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:o,output:void 0},toolkit:{get:(...v)=>ln(a,...v),set:(...v)=>{On(a,...v)},run:(v,$=mm())=>gc(a,v,$),find:(v,$)=>r(a,v,$),json:(v)=>ni(a,v),dispose:(...v)=>{Xc(a,...v)},env:()=>g$(a)}},a=Object.assign(x,{transactionMeta:f});return p.child=a,n.logger.info("\uD83D\uDEEB","transaction",i,"Building transaction with params:",o),a};function Ra(n,i){let o={key:i.key,type:"transaction",run:(x,m)=>{let f=d$(n,i.key,x,m);try{let a=B(n),{toolkit:v}=f.transactionMeta,$=i.do(v,...x);return r$($,a),$}catch(a){throw Q$(c),n.logger.warn("\uD83D\uDCA5","transaction",i.key,"caught:",a),a}},install:(x)=>Ra(x,i),subject:new $n},c=B(n);c.transactions.set(o.key,o);let p=So(o);return n.on.transactionCreation.next(p),p}function e$(n,i){let o=oi(n),c=o?n.transactionMeta.actionContinuities.getRelatedKey(i):void 0;return o&&c!==void 0?n.transactionMeta.epoch.get(c):void 0}class n1{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new ii({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new ii({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new ii({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new ii({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new fm(100);molecules=new Map;moleculeJoins=new ii({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeGraph=new ii({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeData=new ii({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});miscResources=new Map;on={atomCreation:new $n,atomDisposal:new $n,selectorCreation:new $n,selectorDisposal:new $n,timelineCreation:new $n,transactionCreation:new $n,transactionApplying:new Ja(null),operationClose:new $n,moleculeCreation:new $n,moleculeDisposal:new $n};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Wc("warn",(n,i,o)=>!o.includes("\uD83D\uDD0D"))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},oi(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new ii(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=ni(i,c),x=Uo(c);o.add(p.key),o.add(x.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var d={get STORE(){if(!globalThis.ATOM_IO_IMPLICIT_STORE)globalThis.ATOM_IO_IMPLICIT_STORE=new n1({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function Fn(n,i){let o,c=n;while(c!==null){switch(i.type){case"atom":case"mutable_atom":o=c.atoms.get(i.key);break;case"selector":o=c.selectors.get(i.key);break;case"readonly_selector":o=c.readonlySelectors.get(i.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(i.key);break;case"timeline":o=c.timelines.get(i.key);break;case"transaction":o=c.transactions.get(i.key);break}if(o)return o;c=c.child}throw new Tc(i,n)}function i1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Tc(i,n);let p=c(o),x=B(n);if(p.family){if(oi(x))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(Gn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function o1(n,i,o){let c=wn(o),p=`${i.key}(${c})`,x=B(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=x.atoms.get(p);break;case"selector_family":m=x.selectors.get(p);break;case"readonly_selector_family":m=x.readonlySelectors.get(p);break}if(m)return So(m);return m}function r(n,i,o){let c=o1(n,i,o);if(c)return c;let p=wn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=z$(i,o);return n.logger.error("\u274C",m.type,m.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),m}if(c=i1(n,i,o),x)B(n).moleculeData.set(p,i.key);return c}function Xc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=r(n,c,p)}try{Fn(n,o)}catch(c){n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`);return}switch(o.type){case"atom":case"mutable_atom":Xa(n,o);break;case"selector":case"readonly_selector":c1(n,o);break}}var Jm=(n,i)=>B(n).atoms.has(i),n7=(n,i)=>B(n).selectors.has(i),i7=(n,i)=>B(n).readonlySelectors.has(i),p1=(n,i)=>Jm(n,i)||n7(n,i)||i7(n,i);var Am=(n,i)=>{return B(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>p1(i,c))};var Wa=(n,i,o)=>{let c=[],p=Am(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Jm(o,x))p.push(...Am(x,o));else if(!c.includes(x))c.push(x)}return c},x1=(n,i)=>{let o=n.key,c=Am(o,i),p=new Set;return c.flatMap((x)=>Jm(i,x)?x:Wa(x,p,i))};var m1=(n,i,o,c)=>{let p=B(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let x=Wa(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Tm=(n,i,o)=>({get:(...c)=>{let p=B(o),x;if(c.length===2){let[a,v]=c;x=r(o,a,v)}else[x]=c;let m=Fn(o,x),f=yo(o,m);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,f,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),m1(n,x,i,o),f},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let a=c[0],v=c[1];x=c[2],p=r(o,a,v)}let m=B(o),f=Fn(m,p);vm(m,f,x)},find:(c,p)=>r(o,c,p),json:(c)=>ni(o,c)});var xx=(n,i,o)=>{let c=B(n),p=new $n,x=new Set,{get:m,find:f,json:a}=Tm(i.key,x,c),v=()=>{let X=i.get({get:m,find:f,json:a});return ki(B(n),i.key,X,p),x.clear(),X},$={...i,subject:p,install:(X)=>xx(X,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,$);let w=v();n.logger.info("\u2728",$.type,$.key,"=",w);let J={key:i.key,type:"readonly_selector"};if(o)J.family=o;return J};var ax=(n,i,o)=>{let c=B(n),p=new $n,x=new Set,m=Tm(i.key,x,c),{find:f,get:a,json:v}=m,$={find:f,get:a,json:v},w=(S=i.get,l=B(n))=>{let H=S($);return ki(l,i.key,H,p),x.clear(),H},X={...i,subject:p,install:(S)=>ax(S,i,o),get:w,set:(S)=>{let l=B(n),H=w(i.get,l),I=am(S)(H);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",H,"->",I,")"),ki(l,i.key,I,p),dc(l,i.key),oi(l))p.next({newValue:I,oldValue:H});i.set(m,I)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,X);let W=w();n.logger.info("\u2728",X.type,X.key,"=",W);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function wa(n,i){if("set"in i){let p=ax(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=xx(n,i,void 0);return n.on.selectorCreation.next(c),c}function c1(n,i){let o=B(n),{key:c}=i,p=Fn(o,i);if(!p.family)n.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{if(o.molecules.get(p.family.subKey))o.moleculeData.delete(p.family.subKey,p.family.key);let m;switch(i.type){case"selector":o.selectors.delete(c),m={key:p.family.key,type:"selector_family"},Fn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break;case"readonly_selector":o.readonlySelectors.delete(c),m={key:p.family.key,type:"readonly_selector_family"},Fn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),n.logger.info("\uD83D\uDD25",i.type,c,"deleted"),Gn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:i});else n.on.selectorDisposal.next(i)}}function mx(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=ax(J,{key:w,get:i.get(a),set:i.set(a)},$);return x.next({type:"state_creation",token:X}),X},c,{internalRoles:o,subject:x,install:(a)=>mx(a,i),default:(a)=>{return i.get(a)({get:(...$)=>ln(n,...$),find:($,w)=>r(n,$,w),json:($)=>ni(n,$)})}});return n.families.set(i.key,f),c}function f1(n,i,o){return mx(n,{key:`${i.key}:JSON`,get:(p)=>({get:x})=>{let m=x(i,p);return o.toJson(m)},set:(p)=>({set:x},m)=>{x(i,p,o.fromJson(m))}},["mutable","json"])}var mi=(n)=>JSON.parse(n),wn=(n)=>JSON.stringify(n),_Q=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var a1=(n,i)=>{let o=B(n);if(o.operation.open)return o.operation.prev.get(i.key);return o.valueMap.get(i.key)};var Ga=(n,i)=>{let o=B(n);return x1(i,n).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${i.key}", not found in store "${n.config.name}".`);return x.subject.subscribe(`${i.type}:${i.key}`,(m)=>{n.logger.info("\uD83D\uDCE2",i.type,i.key,"root",p,"went",m.oldValue,"->",m.newValue);let f=a1(o,i),a=yo(o,i);n.logger.info("\u2728",i.type,i.key,"went",f,"->",a),i.subject.next({newValue:a,oldValue:f})})})};function Wi(n,i,o,c){function p(w){if(n.operation.open){let J=n.on.operationClose.subscribe(`state subscription ${o}`,()=>{J(),c(w)})}else c(w)}let x=Fn(n,i);n.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",f=null,a=p;if(m)f=Ga(n,x),a=(w)=>{if(f)f.length=0,f.push(...Ga(n,x));p(w)};let v=x.subject.subscribe(o,a);return()=>{if(n.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),v(),f)for(let w of f)w()}}var Ka=(n,i,o,c)=>{let p=Fn(n,i);n.logger.info("\uD83D\uDC40","timeline",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","timeline",i.key,`Removing subscription "${o}" from timeline`),x()}};var Sa=(n,i,o,c)=>{let p=Fn(n,i);n.logger.info("\uD83D\uDC40","transaction",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","transaction",i.key,`Removing subscription "${o}"`),x()}};class Kc{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=Ac(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=ln(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Wi(o,n,c,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{On(o,i,m)})})}updateCore(n,i,o){let c=`tracker:${o.config.name}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Wi(o,i,c,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let v=Ka(o,{key:m,type:"timeline"},c,($)=>{v(),On(o,n,(w)=>{if($==="redo"&&p)w.do(p);else if($==="undo"&&x)w.undo(x);return w})});return}}let f=o.on.operationClose.subscribe(c,()=>{f();let a=ln(o,n),v=p===null?-1:a.getUpdateNumber(p),$=v-a.cacheUpdateNumber;if(p&&$===1)On(o,n,(w)=>(w.do(p),w));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${a.cacheUpdateNumber+1}, but got ${v}`)})})}mutableState;latestUpdateState;[Symbol.dispose];constructor(n,i){this.mutableState=n;let o=B(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function vx(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=B(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),So(p);let x=new $n,m={...i,type:"mutable_atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),vx(v,i,o)},subject:x};if(o)m.family=o;let f=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,f,x);let a=So(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(X)=>{On(n,a,X)},onSet:(X)=>Wi(n,a,`effect[${v}]`,X)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}if(new Kc(a,n),!o)l$(a,i,n);return a}class Ya{trackers=new Map;Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Jc(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=Fn(i,o),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{let{type:p,token:x}=c;if(x.family){let m=mi(x.family.subKey);switch(p){case"state_creation":this.trackers.set(m,new Kc(x,i));break;case"state_disposal":{let f=this.trackers.get(m);if(f)f[Symbol.dispose](),this.trackers.delete(m)}break}}})}}function px(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X={key:w,default:()=>i.default(a),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)X.effects=i.effects(a);let W=vx(J,X,$);return x.next({type:"state_creation",token:W}),W},c,{subject:x,install:(a)=>px(a,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,f),f1(n,f,i),new Ya(f,n),c}var la=(n,i)=>{let o=B(i),c=`${n.key}:JSON`;return o.families.get(c)};var ni=(n,i)=>{if(i.family){let c=B(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=Fn(c,x),f=JSON.parse(i.family.subKey);return r(n,m,f)}return{type:"selector",key:`${i.key}:JSON`}};var Uo=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function j$(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function fx(n,i,o){let c=o.valueMap.get(i.key),p=n.valueMap.get(i.key);if(c===p){if(c===void 0)return typeof i.default==="function"?i.default():i.default;o.logger.info("\uD83D\uDCC3","atom",i.key,"copying");let x=i.toJson(c),m=i.fromJson(x);return n.valueMap.set(i.key,m),new Kc(i,o),m}return p}function ki(n,i,o,c){let p=n.valueMap.get(i);if(p instanceof cx)p.use(o);if(o instanceof Promise){let x=new cx(o);return n.valueMap.set(i,x),x.then((m)=>{ki(n,i,m,c),c.next({newValue:m,oldValue:x})}).catch((m)=>{n.logger.error("\uD83D\uDCA5","state",i,"rejected:",m)}),x}return n.valueMap.set(i,o),o}var E$=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Gn(i)){let{parent:c}=i;o=fx(i,n,c)}return o},B$=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof cx){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var D$=(n,i)=>{return B(n).atomsThatAreDefault.has(i)},Fm=(n,i)=>{let o=B(n);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(i)},N$=(n,i)=>{let o=B(n);o.atomsThatAreDefault=new Set(B(n).atomsThatAreDefault),o.atomsThatAreDefault.delete(i)};function Ac(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=B(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),So(p);let x=new $n,m={...i,type:"atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),Ac(v,i,o)},subject:x};if(o)m.family=o;let f=i.default;if(i.default instanceof Function)f=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,f,x);let a=So(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(X)=>{On(n,a,X)},onSet:(X)=>Wi(n,a,`effect[${v}]`,X)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}return a}function v1(n,i){if("mutable"in i){let p=vx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Ac(n,i,void 0);return n.on.atomCreation.next(c),c}function Xa(n,i){let o=B(n),{key:c,family:p}=i,x=Fn(o,i);if(!p)n.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{x.cleanup?.();let m=n.valueMap.get(x.key),f=Fn(n,{key:p.key,type:"atom_family"}),a={type:"state_disposal",subType:"atom",token:i,value:m};f.subject.next(a);let v=Gn(o);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),n.timelineTopics.delete(c),i.type==="mutable_atom"){let $=Uo(i);Xa(n,$),n.trackers.delete(c)}if(n.logger.info("\uD83D\uDD25","atom",c,"deleted"),v&&o.transactionMeta.phase==="building"){let $=o.transactionMeta.update.updates.at(-1);if(!($?.type==="molecule_disposal"&&$.values.some(([X])=>X===x.family?.key)))o.transactionMeta.update.updates.push(a)}else n.on.atomDisposal.next(i)}}class ci extends Set{mode="record";subject=new $n;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof ci)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new ci(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${wn(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${wn(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new ci(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let f=!1;while(!f){this.cacheIdx%=this.cacheLimit;let v=this.cache[this.cacheIdx];if(this.cacheIdx--,!v)return"OUT_OF_RANGE";this.undo(v),f=this.cacheIdx===x-1}let a=n.substring(i+1);return this.doStep(a),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class $x{toolkit;options;defaultContent;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;realm;[Symbol.dispose](){}constructor(n,i,o=d.STORE){this.store=o,this.realm=new Ha(o),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...Y)=>ln(o,...Y),set:(...Y)=>{On(o,...Y)},find:(...Y)=>r(o,...Y),json:(Y)=>ni(o,Y)};let c=n.between[0],p=n.between[1],x=px(o,{key:`${n.key}/relatedKeys`,default:()=>new ci,mutable:!0,fromJson:(Y)=>ci.fromJSON(Y),toJson:(Y)=>Y.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:Y},z)=>Y(x,z),f=({set:Y},z,E)=>{if(!this.store.molecules.has(wn(z)))this.realm.allocate(n.key,z);Y(x,z,(Q)=>Q.add(E)),Y(x,E,(Q)=>Q.add(z))},a=({set:Y},z,E)=>{Y(x,z,(Q)=>{return Q.delete(E),Q}),Y(x,E,(Q)=>{return Q.delete(z),Q})},v=(Y,z,E)=>{let{find:Q,get:b,set:y}=Y,M=Q(x,z),fn=b(M);for(let Z of fn){if(E.includes(Z))continue;y(x,Z,(En)=>{return En.delete(z),En})}y(M,(Z)=>{return Z.transaction((an)=>{an.clear();for(let En of E){let gn=m(Y,En),_i=gn.has(z);if(this.relations.cardinality==="1:n"){let Oo=[];for(let O of gn){if(O===z)continue;let q=m(Y,O);if(q.delete(En),q.size===0)Oo.push(O)}if(!_i&&gn.size>0)gn.clear();for(let O of Oo){let q=[En,O].sort(),Rn=`"${q[0]}:${q[1]}"`;this.molecules.delete(Rn)}}if(!_i)gn.add(z);an.add(En)}return!0}),Z})},$=(Y,z,E)=>{let{set:Q}=Y;Q(x,z,(b)=>{return b.transaction((y)=>{for(let M of E)y.add(M);return!0}),b});for(let b of E)Q(x,b,(y)=>{return y.add(z),y});return!0},w=(Y,z,E)=>{let Q=m(Y,z);return E?Q.has(E):Q.size>0},J={getRelatedKeys:(Y)=>m(this.toolkit,Y),addRelation:(Y,z)=>{this.store.moleculeJoins.set(Y,n.key),this.store.moleculeJoins.set(z,n.key),f(this.toolkit,Y,z)},deleteRelation:(Y,z)=>{a(this.toolkit,Y,z)},replaceRelationsSafely:(Y,z)=>{v(this.toolkit,Y,z)},replaceRelationsUnsafely:(Y,z)=>{$(this.toolkit,Y,z)},has:(Y,z)=>w(this.toolkit,Y,z)},X,W;if(i){W=Jc(o,{key:`${n.key}/content`,default:i},["join","content"]);let Y=({get:Q},b)=>Q(W,b),z=({set:Q},b,y)=>{Q(W,b,y)};X=Object.assign(J,{getContent:(Q)=>{return Y(this.toolkit,Q)},setContent:(Q,b)=>{z(this.toolkit,Q,b)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else X=J;let R=new ii(n,{externalStore:X,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...Y)=>{let[z,E]=Y,Q=Y.sort(),b=`${Q[0]}:${Q[1]}`,y=o.molecules.get(wn(z)),M=o.molecules.get(wn(E));if(!y)this.realm.allocate(n.key,z);if(!M)this.realm.allocate(n.key,E);return this.realm.allocate(z,b,"all"),this.realm.claim(E,b),this.store.moleculeJoins.set(b,n.key),b}}),S=()=>Io(o,{key:`${n.key}/singleRelatedKey`,get:(Y)=>({get:z})=>{let E=z(x,Y);for(let Q of E)return Q;return null}},["join","keys"]),l=()=>{return Io(o,{key:`${n.key}/multipleRelatedKeys`,get:(Y)=>({get:z})=>{let E=la(x,o);return z(E,Y).members}},["join","keys"])},H=()=>Io(o,{key:`${n.key}/singleRelatedEntry`,get:(Y)=>({get:z})=>{let E=z(x,Y);for(let Q of E){let b=R.isAType?.(Y)?Y:void 0,y=b===void 0?Y:void 0;b??=Q,y??=Q;let M=R.makeContentKey(b,y),fn=z(W,M);return[Q,fn]}return null}},["join","entries"]),I=()=>Io(o,{key:`${n.key}/multipleRelatedEntries`,get:(Y)=>({get:z})=>{let E=la(x,o);return z(E,Y).members.map((b)=>{let y=R.isAType?.(Y)?Y:void 0,M=y===void 0?Y:void 0;y??=b,M??=b;let fn=R.makeContentKey(y,M),Z=z(W,fn);return[b,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let Y=S(),z=`${c}KeyOf${Hn(p)}`,E=`${p}KeyOf${Hn(c)}`,Q={[z]:Y,[E]:Y},b;if(i){let y=H(),M=`${c}EntryOf${Hn(p)}`,fn=`${p}EntryOf${Hn(c)}`,Z={[M]:y,[fn]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b;break}case"1:n":{let Y=S(),z=l(),E=`${c}KeyOf${Hn(p)}`,Q=`${p}KeysOf${Hn(c)}`,b={[E]:Y,[Q]:z},y;if(i){let M=H(),fn=I(),Z=`${c}EntryOf${Hn(p)}`,an=`${p}EntriesOf${Hn(c)}`,En={[Z]:M,[an]:fn};y=Object.assign(b,En)}else y=b;this.relations=R,this.states=y;break}case"n:n":{let Y=l(),z=`${c}KeysOf${Hn(p)}`,E=`${p}KeysOf${Hn(c)}`,Q={[z]:Y,[E]:Y},b;if(i){let y=I(),M=`${c}EntriesOf${Hn(p)}`,fn=`${p}EntriesOf${Hn(c)}`,Z={[M]:y,[fn]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b}}}}function np(n,i){let o=i.joins.get(n.key);if(o===void 0){let p=d.STORE.joins.get(n.key);if(p===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o=new $x(p.options,p.defaultContent,i),i.joins.set(n.key,o)}return o}function ko(n,i,o){let c=np(n,o),p=B(o);if(Gn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function ip(n,i,o){let c=np(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Hn(n.b)}`,m=`${n.b}KeyOf${Hn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Hn(n.b)}`;if(f in c.states){let a=`${n.b}EntryOf${Hn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(o,v,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Hn(n.b)}`,m=`${n.b}KeysOf${Hn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Hn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Hn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(o,v,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Hn(n.b)}`,m=`${n.b}KeysOf${Hn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntriesOf${Hn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Hn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(o,v,i)}})}}}return p}function $1(n,i){return np(n,i).core.relatedKeysAtoms}function Zo(n){return v1(d.STORE,n)}function Sc(n){return H$(d.STORE,n)}function Rm(n,i,o=d.STORE){return o.joins.set(n.key,new $x(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function w1(n){return $1(n,d.STORE)}var Ma=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},o7={error:Ma("error"),info:Ma("info"),warn:Ma("warn")};class Wc{logLevel;filter;logger;constructor(n,i,o=o7){this.logLevel=n,this.filter=i,this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}var dU=Symbol("claim");class J1{store;constructor(n=d.STORE){this.store=n,u$("root",n)}allocate(n,i,o){return Fc(this.store,n,i,o)}fuse(n,i,o){return I$(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){return ec(this.store,n,i,o)}}class Ha{store;realm;constructor(n=d.STORE){this.store=n,this.realm=new J1(n)}allocate(n,i,o){Fc(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){ec(this.store,n,i,o)}}function Xm(n){return M$(d.STORE,n)}function Gc(n){return Ra(d.STORE,n)}class A1 extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Wm{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(n){this.key=n}static existing=new A1;static create(n,i){let o=new Wm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),f={type:c,key:n,globals:p,actions:x,perspectives:m};return Wm.existing.set(n,f),f}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function T1(n){let{key:i,config:o}=n,c=Wm.create(i,o),{actions:p}=c;for(let x of p)t$(d.STORE,i,x.key);return P$(d.STORE,i,-1),c}var aV=Zo({key:"usersInRoomIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),za=Zo({key:"roomIndex",default:()=>new ci,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),c7={enteredAtEpoch:0},wx=Rm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},c7),vV=Xm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=w1(wx);return[i(o,n)]}});import{spawn as p7}from"child_process";class op{listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";emit;constructor(n){this.emit=n,this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class Jx extends op{incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";process;key;logger;handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(...o);break;case"w":this.logger.warn(...o);break;case"e":this.logger.error(...o);break;default:return}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(f)=>{if(f.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",m)};return this.process.stdin.once("error",m),this.process.stdin.write(x),this});if(this.process=n,this.key=i,this.logger=o??{info:(...c)=>{console.info(this.id,this.key,...c)},warn:(...c)=>{console.warn(this.id,this.key,...c)},error:(...c)=>{console.error(this.id,this.key,...c)}},this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=mi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let f=this.unprocessedEvents.shift();if(f){if(this.unprocessedEvents.length===0)this.incompleteData=f;m=mi(f),this.handleEvent(...m)}}this.incompleteData=""}catch(m){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(m)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let m=mi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=mi(this.incompleteLog),this.handleLog(m)}catch(m){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(m),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class F1 extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new $n,this.out=new $n,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Qa extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(wn(n.map((i)=>i instanceof ci?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=mi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let x=mi(p);this.handleEvent(...x)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new F1(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Ea=Sc({key:"roomArguments",default:["echo",["Hello World!"]]}),R1=Xm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Ea,n),p=i(c),[x,m]=p,f=await new Promise((a)=>{let v=p7(x,m,{env:process.env}),$=(w)=>{if(w.toString()==="ALIVE")v.stdout.off("data",$),a(v)};v.stdout.on("data",$)});return new Jx(f,n)}});var LV=Gc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],f=o(Ea,c);i(f,m),i(za,($)=>$.add(c));let a=o(R1,c);return n(a)}}),DV=Gc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return ko(wx,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),NV=Gc({key:"leaveRoom",do:(n,i,o)=>{ko(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),hV=Gc({key:"destroyRoom",do:(n,i)=>{ko(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(za,(o)=>(o.delete(i),o))}});function Oa(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Oa(n,o.updates);return{...o,updates:c}}case"atom_update":case"selector_update":case"molecule_creation":case"molecule_disposal":case"molecule_transfer":case"state_creation":case"state_disposal":return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":case"state_disposal":return n.includes(o.token.key);case"molecule_creation":case"transaction_update":case"molecule_disposal":case"molecule_transfer":return!0}})}var IV=Sc({key:"redactor",default:{occlude:(n)=>n}}),cp=Sc({key:"unacknowledgedUpdates",default:()=>[]});var Km=Sc({key:"sockets",default:null}),Ua=Zo({key:"socketsIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Va=Zo({key:"usersIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Yc=Rm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function X1(n,i,o,c){let p=i.key;return function x(){let m=[];for(let a of i.globals){let v=a.type==="mutable_atom"?ni(n,a):a,$=ln(n,v);m.push(v,$)}for(let a of i.perspectives){let{viewAtoms:v,resourceAtoms:$}=a,w=r(n,v,o),J=ln(n,w);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:v,resourceAtoms:$,userView:J});for(let X of J){let W=X.type==="mutable_atom"?ni(n,X):X,R=ln(n,W);m.push(W,R)}}let f=oi(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,f,m)}}function W1(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:m,id:f}=x,a=`tx-run:${m}:${f}`,v=`${a}:start`,$=`${a}:end`;performance.mark(v);try{gc(n,{type:"transaction",key:m},f)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${f}`,J.message)}performance.mark($);let w=performance.measure(a,v,$);n?.logger.info("\uD83D\uDE80","transaction",m,f,o,w.duration)}}function K1(n,i,o,c){let p=i.key;return function x(m){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${m}`),c[0]?.epoch===m)On(n,cp,o,(a)=>{return a.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,a.length,"items"),a})}}function S1(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let f=Sa(n,m,`sync-continuity:${p}:${o}`,(a)=>{try{let v=i.globals.map((J)=>{if(J.type==="atom")return J.key;return Uo(J).key}).concat(i.perspectives.flatMap((J)=>{let{viewAtoms:X}=J,W=r(n,X,o);return ln(n,W).map((S)=>{return S.type==="mutable_atom"?"*"+S.key:S.key})})),$=Oa(v,a.updates),w={...a,updates:$};On(n,cp,o,(J)=>{if(w)J.push(w),J.sort((X,W)=>X.epoch-W.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,J.length,"items");return J}),c?.emit(`tx-new:${p}`,w)}catch(v){if(v instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,v.message)}});x.push(f)}return x}function G1(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:f}=m,a=r(n,f,o),v=Wi(n,a,`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,({oldValue:$,newValue:w})=>{let J=$.map((S)=>S.key),X=w.map((S)=>S.key),W=$.filter((S)=>!X.includes(S.key)),R=w.filter((S)=>!J.includes(S.key)).flatMap((S)=>{let l=S.type==="mutable_atom"?ni(n,S):S,H=ln(n,l);return[l,H]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:X,revealed:R,concealed:W}),R.length>0)c?.emit(`reveal:${p}`,R);if(W.length>0)c?.emit(`conceal:${p}`,W)});x.push(v)}return x}function Y1({socket:n,store:i=d.STORE}){return function o(c){let p=n,x=c.key,m=ip(Yc,`socket::${p.id}`,i).userKeyOfSocket,f=ln(i,m);if(!f)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let a=ip(Yc,f,i).socketKeyOfUser,v=Wi(i,a,`sync-continuity:${x}:${f}`,({newValue:l})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${f} on new socket ${l}`),l===null){i.logger.warn("\u274C","continuity",x,`User (${f}) is not connected to a socket, waiting for them to reappear.`);return}let H=r(i,Km,l);p=ln(i,H);for(let Y of $)p?.emit(`tx-new:${x}`,Y)}),$=ln(i,cp,f),w=[],J=G1(i,c,f,p),X=S1(i,c,f,p);w.push(...J,...X);let W=X1(i,c,f,n);p.off(`get:${x}`,W),p.on(`get:${x}`,W);let R=W1(i,c,f);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let S=K1(i,c,f,$);return p?.on(`ack:${x}`,S),()=>{for(let l of w)l();p?.off(`ack:${x}`,S),p?.off(`get:${x}`,W),p?.off(`tx-run:${x}`,R)}}}var eR=$a(av(),1);var T=Symbol.for("drizzle:entityKind"),e_=Symbol.for("drizzle:hasOwnEntityKind");function G(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,T))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(T in o&&o[T]===i[T])return!0;o=Object.getPrototypeOf(o)}return!1}class Un{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[T]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class vv{static[T]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var fo=Symbol.for("drizzle:Name");class $v{static[T]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new WJ(n,this)}}class WJ{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[T]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((m)=>m.name),p=o.map((m)=>m.name),x=[this.table[fo],...c,o[0].table[fo],...p];return n??`${x.join("_")}_fk`}}function um(n,...i){return n(...i)}function KJ(n,i){return`${n[fo]}_${i.join("_")}_unique`}function SJ(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function GJ(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[a,v]=SJ(n,c+1,!0);o.push(a),c=v;continue}if(x==="}")return[o,c+1];if(x==="{"){let[a,v]=GJ(n,c+1);o.push(a),c=v;continue}let[m,f]=SJ(n,c,!1);o.push(m),c=f}return[o,c]}function YJ(n){let[i]=GJ(n,1);return i}function wv(n){return`{${n.map((i)=>{if(Array.isArray(i))return wv(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class u extends vv{foreignKeyConfigs=[];static[T]="PgColumnBuilder";array(n){return new HJ(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return um((p,x)=>{let m=new $v(()=>{let f=p();return{columns:[n],foreignColumns:[f]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new lJ(n,this.config)}}class V extends Un{constructor(n,i){if(!i.uniqueName)i.uniqueName=KJ(n,[i.name]);super(n,i);this.table=n}static[T]="PgColumn"}class lJ extends V{static[T]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class lx{static[T]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class HJ extends u{static[T]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new Jv(n,this.config,i)}}class Jv extends V{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[T]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=YJ(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:G(this.baseColumn,Jv)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return wv(o)}}var Av=Symbol.for("drizzle:isPgEnum");function MJ(n){return!!n&&typeof n==="function"&&Av in n&&n[Av]===!0}class zJ extends u{static[T]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new QJ(n,this.config)}}class QJ extends V{static[T]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function Im(n,i){return HW(n,i,void 0)}function HW(n,i,o){let c=Object.assign((p)=>new zJ(p??"",c),{enumName:n,enumValues:i,schema:o,[Av]:!0});return c}class pi{static[T]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Hx extends pi{static[T]="WithSubquery"}var EJ="0.40.0";var Tv,Fv,Vn={startActiveSpan(n,i){if(!Tv)return i();if(!Fv)Fv=Tv.trace.getTracer("drizzle-orm",EJ);return um((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Tv,Fv)}};var bn=Symbol.for("drizzle:ViewBaseConfig");var ym=Symbol.for("drizzle:Schema"),km=Symbol.for("drizzle:Columns"),OJ=Symbol.for("drizzle:ExtraConfigColumns"),Rv=Symbol.for("drizzle:OriginalName"),Xv=Symbol.for("drizzle:BaseName"),Mx=Symbol.for("drizzle:IsAlias"),UJ=Symbol.for("drizzle:ExtraConfigBuilder"),MW=Symbol.for("drizzle:IsDrizzleTable");class D{static[T]="Table";static Symbol={Name:fo,Schema:ym,OriginalName:Rv,Columns:km,ExtraConfigColumns:OJ,BaseName:Xv,IsAlias:Mx,ExtraConfigBuilder:UJ};[fo];[Rv];[ym];[km];[OJ];[Xv];[Mx]=!1;[MW]=!0;[UJ]=void 0;constructor(n,i,o){this[fo]=this[Rv]=n,this[ym]=i,this[Xv]=o}}function fi(n){return n[fo]}function Ec(n){return`${n[ym]??"public"}.${n[fo]}`}function Wv(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function zW(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class xi{static[T]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new N([this])}}class N{constructor(n){this.queryChunks=n}static[T]="SQL";decoder=_J;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Vn.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:x,prepareTyping:m,inlineParams:f,paramStartIndex:a}=o;return zW(n.map((v)=>{if(G(v,xi))return{sql:v.value.join(""),params:[]};if(G(v,Zm))return{sql:p(v.value),params:[]};if(v===void 0)return{sql:"",params:[]};if(Array.isArray(v)){let $=[new xi("(")];for(let[w,J]of v.entries())if($.push(J),w<v.length-1)$.push(new xi(", "));return $.push(new xi(")")),this.buildQueryFromSourceParams($,o)}if(G(v,N))return this.buildQueryFromSourceParams(v.queryChunks,{...o,inlineParams:f||v.shouldInlineParams});if(G(v,D)){let $=v[D.Symbol.Schema],w=v[D.Symbol.Name];return{sql:$===void 0||v[Mx]?p(w):p($)+"."+p(w),params:[]}}if(G(v,Un)){let $=c.getColumnCasing(v);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let w=v.table[D.Symbol.Schema];return{sql:v.table[Mx]||w===void 0?p(v.table[D.Symbol.Name])+"."+p($):p(w)+"."+p(v.table[D.Symbol.Name])+"."+p($),params:[]}}if(G(v,Bi)){let $=v[bn].schema,w=v[bn].name;return{sql:$===void 0||v[bn].isAlias?p(w):p($)+"."+p(w),params:[]}}if(G(v,Di)){if(G(v.value,go))return{sql:x(a.value++,v),params:[v],typings:["none"]};let $=v.value===null?null:v.encoder.mapToDriverValue(v.value);if(G($,N))return this.buildQueryFromSourceParams([$],o);if(f)return{sql:this.mapInlineParam($,o),params:[]};let w=["none"];if(m)w=[m(v.encoder)];return{sql:x(a.value++,$),params:[$],typings:w}}if(G(v,go))return{sql:x(a.value++,v),params:[v],typings:["none"]};if(G(v,N.Aliased)&&v.fieldAlias!==void 0)return{sql:p(v.fieldAlias),params:[]};if(G(v,pi)){if(v._.isWith)return{sql:p(v._.alias),params:[]};return this.buildQueryFromSourceParams([new xi("("),v._.sql,new xi(") "),new Zm(v._.alias)],o)}if(MJ(v)){if(v.schema)return{sql:p(v.schema)+"."+p(v.enumName),params:[]};return{sql:p(v.enumName),params:[]}}if(Wv(v)){if(v.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([v.getSQL()],o);return this.buildQueryFromSourceParams([new xi("("),v.getSQL(),new xi(")")],o)}if(f)return{sql:this.mapInlineParam(v,o),params:[]};return{sql:x(a.value++,v),params:[v],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new N.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class Zm{constructor(n){this.value=n}static[T]="Name";brand;getSQL(){return new N([this])}}function VJ(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var _J={mapFromDriverValue:(n)=>n},BJ={mapToDriverValue:(n)=>n},uB={..._J,...BJ};class Di{constructor(n,i=BJ){this.value=n,this.encoder=i}static[T]="Param";brand;getSQL(){return new N([this])}}function F(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new xi(n[0]));for(let[c,p]of i.entries())o.push(p,new xi(n[c+1]));return new N(o)}((n)=>{function i(){return new N([])}n.empty=i;function o(a){return new N(a)}n.fromList=o;function c(a){return new N([new xi(a)])}n.raw=c;function p(a,v){let $=[];for(let[w,J]of a.entries()){if(w>0&&v!==void 0)$.push(v);$.push(J)}return new N($)}n.join=p;function x(a){return new Zm(a)}n.identifier=x;function m(a){return new go(a)}n.placeholder=m;function f(a,v){return new Di(a,v)}n.param=f})(F||(F={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[T]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(N||(N={}));class go{constructor(n){this.name=n}static[T]="Placeholder";getSQL(){return new N([this])}}function Kv(n,i){return n.map((o)=>{if(G(o,go)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(G(o,Di)&&G(o.value,go)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}var QW=Symbol.for("drizzle:IsDrizzleView");class Bi{static[T]="View";[bn];[QW]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[bn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new N([this])}}Un.prototype.getSQL=function(){return new N([this])};D.prototype.getSQL=function(){return new N([this])};pi.prototype.getSQL=function(){return new N([this])};class Xp{constructor(n){this.table=n}static[T]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class zx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[T]="TableAliasProxyHandler";get(n,i){if(i===D.Symbol.IsAlias)return!0;if(i===D.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===D.Symbol.OriginalName)return this.alias;if(i===bn)return{...n[bn],name:this.alias,isAlias:!0};if(i===D.Symbol.Columns){let c=n[D.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((x)=>{p[x]=new Proxy(c[x],new Xp(new Proxy(n,this)))}),p}let o=n[i];if(G(o,Un))return new Proxy(o,new Xp(new Proxy(n,this)));return o}}function qm(n,i){return new Proxy(n,new zx(i,!1))}function lo(n,i){return new Proxy(n,new Xp(new Proxy(n.table,new zx(i,!1))))}function Sv(n,i){return new N.Aliased(Qx(n.sql,i),n.fieldAlias)}function Qx(n,i){return F.join(n.queryChunks.map((o)=>{if(G(o,Un))return lo(o,i);if(G(o,N))return Qx(o,i);if(G(o,N.Aliased))return Sv(o,i);return o}))}class Pm extends Error{static[T]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Gv extends Pm{static[T]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function bi(n,i){if(VJ(i)&&!Wv(n)&&!G(n,Di)&&!G(n,go)&&!G(n,Un)&&!G(n,D)&&!G(n,Bi))return new Di(n,i);return n}var Ho=(n,i)=>{return F`${n} = ${bi(i,n)}`},bJ=(n,i)=>{return F`${n} <> ${bi(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new xi("("),F.join(i,new xi(" and ")),new xi(")")])}function jJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new xi("("),F.join(i,new xi(" or ")),new xi(")")])}function LJ(n){return F`not ${n}`}var sm=(n,i)=>{return F`${n} > ${bi(i,n)}`},DJ=(n,i)=>{return F`${n} >= ${bi(i,n)}`},NJ=(n,i)=>{return F`${n} < ${bi(i,n)}`},hJ=(n,i)=>{return F`${n} <= ${bi(i,n)}`};function CJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`false`;return F`${n} in ${i.map((o)=>bi(o,n))}`}return F`${n} in ${bi(i,n)}`}function uJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`true`;return F`${n} not in ${i.map((o)=>bi(o,n))}`}return F`${n} not in ${bi(i,n)}`}function IJ(n){return F`${n} is null`}function yJ(n){return F`${n} is not null`}function kJ(n){return F`exists ${n}`}function ZJ(n){return F`not exists ${n}`}function qJ(n,i,o){return F`${n} between ${bi(i,n)} and ${bi(o,n)}`}function PJ(n,i,o){return F`${n} not between ${bi(i,n)} and ${bi(o,n)}`}function sJ(n,i){return F`${n} like ${i}`}function rJ(n,i){return F`${n} not like ${i}`}function tJ(n,i){return F`${n} ilike ${i}`}function gJ(n,i){return F`${n} not ilike ${i}`}function dJ(n){return F`${n} asc`}function eJ(n){return F`${n} desc`}class nA{static[T]="ConsoleLogWriter";write(n){console.log(n)}}class Yv{static[T]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new nA}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class lv{static[T]="NoopLogger";logQuery(){}}class Ei{static[T]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function iA(n,i,o){let c={},p=n.reduce((x,{path:m,field:f},a)=>{let v;if(G(f,Un))v=f;else if(G(f,N))v=f.decoder;else v=f.sql.decoder;let $=x;for(let[w,J]of m.entries())if(w<m.length-1){if(!(J in $))$[J]={};$=$[J]}else{let X=i[a],W=$[J]=X===null?null:v.mapFromDriverValue(X);if(o&&G(f,Un)&&m.length===2){let R=m[0];if(!(R in c))c[R]=W===null?fi(f.table):!1;else if(typeof c[R]==="string"&&c[R]!==fi(f.table))c[R]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[x]=null}return p}function ti(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(G(p,Un)||G(p,N)||G(p,N.Aliased))o.push({path:x,field:p});else if(G(p,D))o.push(...ti(p[D.Symbol.Columns],x));else o.push(...ti(p,x));return o},[])}function Ex(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function rm(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(G(p,N)||G(p,Un))return[c,p];else return[c,new Di(p,n[D.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function oA(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function cA(n){return n[D.Symbol.Columns]}function _o(n){return G(n,pi)?n._.alias:G(n,Bi)?n[bn].name:G(n,N)?void 0:n[D.Symbol.IsAlias]?n[D.Symbol.Name]:n[D.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function pA(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.logger;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.logger;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="function"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class eo extends u{static[T]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class xA extends eo{static[T]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new mA(n,this.config)}}class mA extends V{static[T]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class fA extends eo{static[T]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new aA(n,this.config)}}class aA extends V{static[T]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function vA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new xA(o);return new fA(o)}class $A extends u{static[T]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new wA(n,this.config)}}class wA extends V{static[T]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class JA extends u{static[T]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new AA(n,this.config)}}class AA extends V{static[T]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function TA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new $A(o);return new JA(o)}class FA extends u{static[T]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new RA(n,this.config)}}class RA extends V{static[T]="PgBoolean";getSQLType(){return"boolean"}}function Ox(n){return new FA(n??"")}class XA extends u{static[T]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new WA(n,this.config)}}class WA extends V{static[T]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function KA(n,i={}){let{name:o,config:c}=Jn(n,i);return new XA(o,c)}class SA extends u{static[T]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new GA(n,this.config)}}class GA extends V{static[T]="PgCidr";getSQLType(){return"cidr"}}function YA(n){return new SA(n??"")}class lA extends u{static[T]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new HA(n,this.config)}}class HA extends V{static[T]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function MA(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new lA(c,p,n)}}class Bo extends u{static[T]="PgDateColumnBaseBuilder";defaultNow(){return this.default(F`now()`)}}class zA extends Bo{static[T]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new tm(n,this.config)}}class tm extends V{static[T]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class QA extends Bo{static[T]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new gm(n,this.config)}}class gm extends V{static[T]="PgDateString";getSQLType(){return"date"}}function EA(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new zA(o);return new QA(o)}class OA extends u{static[T]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new UA(n,this.config)}}class UA extends V{static[T]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function VA(n){return new OA(n??"")}class _A extends u{static[T]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new BA(n,this.config)}}class BA extends V{static[T]="PgInet";getSQLType(){return"inet"}}function bA(n){return new _A(n??"")}class jA extends eo{static[T]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new LA(n,this.config)}}class LA extends V{static[T]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function dm(n){return new jA(n??"")}class DA extends u{static[T]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new NA(n,this.config)}}class NA extends V{static[T]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function hA(n,i={}){let{name:o,config:c}=Jn(n,i);return new DA(o,c)}class CA extends u{static[T]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new em(n,this.config)}}class em extends V{static[T]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function uA(n){return new CA(n??"")}class IA extends u{static[T]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new nf(n,this.config)}}class nf extends V{static[T]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function yA(n){return new IA(n??"")}class kA extends u{static[T]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new ZA(n,this.config)}}class ZA extends V{static[T]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class qA extends u{static[T]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new PA(n,this.config)}}class PA extends V{static[T]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function sA(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new kA(o);return new qA(o)}class rA extends u{static[T]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new tA(n,this.config)}}class tA extends V{static[T]="PgMacaddr";getSQLType(){return"macaddr"}}function gA(n){return new rA(n??"")}class dA extends u{static[T]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new eA(n,this.config)}}class eA extends V{static[T]="PgMacaddr8";getSQLType(){return"macaddr8"}}function nT(n){return new dA(n??"")}class iT extends u{static[T]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new of(n,this.config)}}class of extends V{static[T]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function oT(n,i){let{name:o,config:c}=Jn(n,i);return new iT(o,c?.precision,c?.scale)}class cT extends u{static[T]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new pT(n,this.config)}}class pT extends V{static[T]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class xT extends u{static[T]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new mT(n,this.config)}}class mT extends V{static[T]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function fT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new cT(o);return new xT(o)}function EW(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function aT(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function Hv(n){let i=EW(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let m;if(x&536870912)m=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let f=aT(i,o);o+=8;let a=aT(i,o);return o+=8,[f,a]}throw new Error("Unsupported geometry type")}class vT extends u{static[T]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new $T(n,this.config)}}class $T extends V{static[T]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Hv(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class wT extends u{static[T]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new JT(n,this.config)}}class JT extends V{static[T]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Hv(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function AT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new vT(o);return new wT(o)}class TT extends u{static[T]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new FT(n,this.config)}}class FT extends V{static[T]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function RT(n){return new TT(n??"")}class XT extends u{static[T]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new WT(n,this.config)}}class WT extends V{static[T]="PgSerial";getSQLType(){return"serial"}}function KT(n){return new XT(n??"")}class ST extends eo{static[T]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new GT(n,this.config)}}class GT extends V{static[T]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function YT(n){return new ST(n??"")}class lT extends u{static[T]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new HT(n,this.config)}}class HT extends V{static[T]="PgSmallSerial";getSQLType(){return"smallserial"}}function MT(n){return new lT(n??"")}class zT extends u{static[T]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new QT(n,this.config)}}class QT extends V{static[T]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function ET(n,i={}){let{name:o,config:c}=Jn(n,i);return new zT(o,c)}class OT extends Bo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[T]="PgTimeBuilder";build(n){return new cf(n,this.config)}}class cf extends V{static[T]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function UT(n,i={}){let{name:o,config:c}=Jn(n,i);return new OT(o,c.withTimezone??!1,c.precision)}class VT extends Bo{static[T]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new pf(n,this.config)}}class pf extends V{static[T]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class _T extends Bo{static[T]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new xf(n,this.config)}}class xf extends V{static[T]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function ao(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new _T(o,c.withTimezone??!1,c.precision);return new VT(o,c?.withTimezone??!1,c?.precision)}class BT extends u{static[T]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(F`gen_random_uuid()`)}build(n){return new mf(n,this.config)}}class mf extends V{static[T]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new BT(n??"")}class bT extends u{static[T]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new jT(n,this.config)}}class jT extends V{static[T]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function Ji(n,i={}){let{name:o,config:c}=Jn(n,i);return new bT(o,c)}class LT extends u{static[T]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new DT(n,this.config)}}class DT extends V{static[T]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function NT(n,i){let{name:o,config:c}=Jn(n,i);return new LT(o,c)}class hT extends u{static[T]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new CT(n,this.config)}}class CT extends V{static[T]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function uT(n,i){let{name:o,config:c}=Jn(n,i);return new hT(o,c)}class IT extends u{static[T]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new yT(n,this.config)}}class yT extends V{static[T]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function kT(n,i){let{name:o,config:c}=Jn(n,i);return new IT(o,c)}class ZT extends u{static[T]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new qT(n,this.config)}}class qT extends V{static[T]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function PT(n,i){let{name:o,config:c}=Jn(n,i);return new ZT(o,c)}function sT(){return{bigint:vA,bigserial:TA,boolean:Ox,char:KA,cidr:YA,customType:MA,date:EA,doublePrecision:VA,inet:bA,integer:dm,interval:hA,json:uA,jsonb:yA,line:sA,macaddr:gA,macaddr8:nT,numeric:oT,point:fT,geometry:AT,real:RT,serial:KT,smallint:YT,smallserial:MT,text:ET,time:UT,timestamp:ao,uuid:Ni,varchar:Ji,bit:NT,halfvec:uT,sparsevec:kT,vector:PT}}var Mv=Symbol.for("drizzle:PgInlineForeignKeys"),rT=Symbol.for("drizzle:EnableRLS");class Ai extends D{static[T]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:Mv,EnableRLS:rT});[Mv]=[];[rT]=!1;[D.Symbol.ExtraConfigBuilder]=void 0;[D.Symbol.ExtraConfigColumns]={}}function OW(n,i,o,c,p=n){let x=new Ai(n,c,p),m=typeof i==="function"?i(sT()):i,f=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let X=J.build(x);return x[Mv].push(...J.buildForeignKeys(X,x)),[$,X]})),a=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let X=J.buildExtraConfigColumn(x);return[$,X]})),v=Object.assign(x,f);if(v[D.Symbol.Columns]=f,v[D.Symbol.ExtraConfigColumns]=a,o)v[Ai.Symbol.ExtraConfigBuilder]=o;return Object.assign(v,{enableRLS:()=>{return v[Ai.Symbol.EnableRLS]=!0,v}})}var nc=(n,i,o)=>{return OW(n,i,o,void 0)};function tT(...n){if(n[0].columns)return new Ux(n[0].columns,n[0].name);return new Ux(n)}class Ux{static[T]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new gT(n,this.columns,this.name)}}class gT{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[T]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[Ai.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class zv{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[D.Symbol.Name]}static[T]="Relation";referencedTableName;fieldName}class dT{constructor(n,i){this.table=n,this.config=i}static[T]="Relations"}class ic extends zv{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[T]="One";withFieldName(n){let i=new ic(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class Vx extends zv{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[T]="Many";withFieldName(n){let i=new Vx(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function eT(){return{and:Oc,between:qJ,eq:Ho,exists:kJ,gt:sm,gte:DJ,ilike:tJ,inArray:CJ,isNull:IJ,isNotNull:yJ,like:sJ,lt:NJ,lte:hJ,ne:bJ,not:LJ,notBetween:PJ,notExists:ZJ,notLike:rJ,notIlike:gJ,notInArray:uJ,or:jJ,sql:F}}function nF(){return{sql:F,asc:dJ,desc:eJ}}function iF(n,i){if(Object.keys(n).length===1&&"default"in n&&!G(n.default,D))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(G(m,D)){let f=Ec(m),a=c[f];o[f]=x,p[x]={tsName:x,dbName:m[D.Symbol.Name],schema:m[D.Symbol.Schema],columns:m[D.Symbol.Columns],relations:a?.relations??{},primaryKey:a?.primaryKey??[]};for(let $ of Object.values(m[D.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let v=m[D.Symbol.ExtraConfigBuilder]?.(m[D.Symbol.ExtraConfigColumns]);if(v){for(let $ of Object.values(v))if(G($,Ux))p[x].primaryKey.push(...$.columns)}}else if(G(m,dT)){let f=Ec(m.table),a=o[f],v=m.config(i(m.table)),$;for(let[w,J]of Object.entries(v))if(a){let X=p[a];if(X.relations[w]=J,$)X.primaryKey.push(...$)}else{if(!(f in c))c[f]={relations:{},primaryKey:$};c[f].relations[w]=J}}return{tables:p,tableNamesMap:o}}function UW(n){return function i(o,c){return new ic(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function VW(n){return function i(o,c){return new Vx(n,o,c)}}function oF(n,i,o){if(G(o,ic)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Ec(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[D.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let x=o.sourceTable,m=i[Ec(x)];if(!m)throw new Error(`Table "${x[D.Symbol.Name]}" not found in schema`);let f=[];for(let a of Object.values(p.relations))if(o.relationName&&o!==a&&a.relationName===o.relationName||!o.relationName&&a.referencedTable===o.sourceTable)f.push(a);if(f.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[D.Symbol.Name]}". Please specify relation name`);if(f[0]&&G(f[0],ic)&&f[0].config)return{fields:f[0].config.references,references:f[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function cF(n){return{one:UW(n),many:VW(n)}}function ff(n,i,o,c,p=(x)=>x){let x={};for(let[m,f]of c.entries())if(f.isJson){let a=i.relations[f.tsKey],v=o[m],$=typeof v==="string"?JSON.parse(v):v;x[f.tsKey]=G(a,ic)?$&&ff(n,n[f.relationTableTsKey],$,f.selection,p):$.map((w)=>ff(n,n[f.relationTableTsKey],w,f.selection,p))}else{let a=p(o[m]),v=f.field,$;if(G(v,Un))$=v;else if(G(v,N))$=v.decoder;else $=v.sql.decoder;x[f.tsKey]=a===null?null:$.mapFromDriverValue(a)}return x}var Z6=$a(k6(),1),{Server:q6,Namespace:IN,Socket:yN}=Z6.default;import{readFileSync as fR}from"fs";import{resolve as z0}from"path";function QG(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],f=x["~standard"].validate(m);if(f instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(f.issues){c.push(...f.issues.map((a)=>({...a,path:[p,...a.path??[]]})));continue}o[p]=f.value}if(c.length)return{issues:c};return{value:o}}function P6(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[H,I]of Object.entries(i))if(I==="")delete i[H]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},f=n.isServer??(typeof window==="undefined"||("Deno"in window)),a=f?{...x,...m,...p}:{...p,...m},v=QG(a,i),$=n.onValidationError??((H)=>{throw console.error("\u274C Invalid environment variables:",H),new Error("Invalid environment variables")}),w=n.onInvalidAccess??(()=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(v.issues)return $(v.issues);let J=(H)=>{if(!n.clientPrefix)return!0;return!H.startsWith(n.clientPrefix)&&!(H in m)},X=(H)=>{return f||!J(H)},W=(H)=>{return H==="__esModule"||H==="$$typeof"},R=(n.extends??[]).reduce((H,I)=>{return Object.assign(H,I)},{}),S=Object.assign(v.value,R);return new Proxy(S,{get(H,I){if(typeof I!=="string")return;if(W(I))return;if(!X(I))return w(I);return Reflect.get(H,I)}})}var Tn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let x={};for(let m of p)x[m]=m;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((f)=>typeof p[p[f]]!=="number"),m={};for(let f of x)m[f]=p[f];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))x.push(m);return x},n.find=(p,x)=>{for(let m of p)if(x(m))return m;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,x=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Tn||(Tn={}));var Y0;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Y0||(Y0={}));var h=Tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),No=(n)=>{switch(typeof n){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(n)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":if(Array.isArray(n))return h.array;if(n===null)return h.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return h.promise;if(typeof Map!=="undefined"&&n instanceof Map)return h.map;if(typeof Set!=="undefined"&&n instanceof Set)return h.set;if(typeof Date!=="undefined"&&n instanceof Date)return h.date;return h.object;default:return h.unknown}},U=Tn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),EG=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class Ii extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let m=o,f=0;while(f<x.path.length){let a=x.path[f];if(f!==x.path.length-1)m[a]=m[a]||{_errors:[]};else m[a]=m[a]||{_errors:[]},m[a]._errors.push(i(x));m=m[a],f++}}};return c(this),o}static assert(n){if(!(n instanceof Ii))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}Ii.create=(n)=>{return new Ii(n)};var jp=(n,i)=>{let o;switch(n.code){case U.invalid_type:if(n.received===h.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Tn.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:o=`Unrecognized key(s) in object: ${Tn.joinValues(n.keys,", ")}`;break;case U.invalid_union:o="Invalid input";break;case U.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Tn.joinValues(n.options)}`;break;case U.invalid_enum_value:o=`Invalid enum value. Expected ${Tn.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:o="Invalid function arguments";break;case U.invalid_return_type:o="Invalid function return type";break;case U.invalid_date:o="Invalid date";break;case U.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Tn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case U.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case U.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case U.custom:o="Invalid input";break;case U.invalid_intersection_types:o="Intersection results could not be merged";break;case U.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:o="Number must be finite";break;default:o=i.defaultError,Tn.assertNever(n)}return{message:o}},g6=jp;function OG(n){g6=n}function bf(){return g6}var jf=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],m={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let f="",a=c.filter((v)=>!!v).slice().reverse();for(let v of a)f=v(m,{data:i,defaultError:f}).message;return{...p,path:x,message:f}},UG=[];function L(n,i){let o=bf(),c=jf({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===jp?void 0:jp].filter((p)=>!!p)});n.common.issues.push(c)}class Mi{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return g;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,x=await c.value;o.push({key:p,value:x})}return Mi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return g;if(x.status==="aborted")return g;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var g=Object.freeze({status:"aborted"}),Bp=(n)=>({status:"dirty",value:n}),Ui=(n)=>({status:"valid",value:n}),l0=(n)=>n.status==="aborted",H0=(n)=>n.status==="dirty",Nc=(n)=>n.status==="valid",ux=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function Lf(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function d6(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var k;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(k||(k={}));var hx,Cx;class Fo{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var s6=(n,i)=>{if(Nc(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new Ii(n.common.issues);return this._error=o,this._error}}}};function cn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(m,f)=>{var a,v;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:f.defaultError};if(typeof f.data==="undefined")return{message:(a=$!==null&&$!==void 0?$:c)!==null&&a!==void 0?a:f.defaultError};if(m.code!=="invalid_type")return{message:f.defaultError};return{message:(v=$!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:f.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return No(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:No(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Mi,ctx:{common:n.parent.common,data:n.data,parsedType:No(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(ux(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:No(n)},p=this._parseSync({data:n,path:c.path,parent:c});return s6(c,p)}"~validate"(n){var i,o;let c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:No(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Nc(p)?{value:p.value}:{issues:c.common.issues}}catch(p){if((o=(i=p===null||p===void 0?void 0:p.message)===null||i===void 0?void 0:i.toLowerCase())===null||o===void 0?void 0:o.includes("encountered"))this["~standard"].async=!0;c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then((p)=>Nc(p)?{value:p.value}:{issues:c.common.issues})}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:No(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(ux(c)?c:Promise.resolve(c));return s6(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let x=n(c),m=()=>p.addIssue({code:U.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((f)=>{if(!f)return m(),!1;else return!0});if(!x)return m(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new no({schema:this,typeName:t.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return To.create(this,this._def)}nullable(){return ho.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ao.create(this)}promise(){return Ic.create(this,this._def)}or(n){return hp.create([this,n],this._def)}and(n){return Cp.create(this,n,this._def)}transform(n){return new no({...cn(this._def),schema:this,typeName:t.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new kp({...cn(this._def),innerType:this,defaultValue:i,typeName:t.ZodDefault})}brand(){return new Nf({typeName:t.ZodBranded,type:this,...cn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Zp({...cn(this._def),innerType:this,catchValue:i,typeName:t.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return Px.create(this,n)}readonly(){return qp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var VG=/^c[^\s-]{8,}$/i,_G=/^[0-9a-z]+$/,BG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jG=/^[a-z0-9_-]{21}$/i,LG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",G0,CG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,IG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qG=new RegExp(`^${e6}$`);function nR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function PG(n){return new RegExp(`^${nR(n)}$`)}function iR(n){let i=`${e6}T${nR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}$`)}function sG(n,i){if((i==="v4"||!i)&&CG.test(n))return!0;if((i==="v6"||!i)&&IG.test(n))return!0;return!1}function rG(n,i){if(!LG.test(n))return!1;try{let[o]=n.split("."),c=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),p=JSON.parse(atob(c));if(typeof p!=="object"||p===null)return!1;if(!p.typ||!p.alg)return!1;if(i&&p.alg!==i)return!1;return!0}catch(o){return!1}}function tG(n,i){if((i==="v4"||!i)&&uG.test(n))return!0;if((i==="v6"||!i)&&yG.test(n))return!0;return!1}class Jo extends pn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==h.string){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:h.string,received:p.parsedType}),g}let o=new Mi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),L(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),L(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,m=n.data.length<p.value;if(x||m){if(c=this._getOrReturnCtx(n,c),x)L(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)L(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!NG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!G0)G0=new RegExp(hG,"u");if(!G0.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!bG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!jG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!VG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!_G.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!BG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"ulid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),L(c,{validation:"url",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"regex",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!iR(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!qG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!PG(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!DG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!sG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!rG(n.data,p.alg))c=this._getOrReturnCtx(n,c),L(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!tG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!kG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!ZG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"base64url",code:U.invalid_string,message:p.message}),o.dirty()}else Tn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:U.invalid_string,...k.errToObj(o)})}_addCheck(n){return new Jo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...k.errToObj(n)})}url(n){return this._addCheck({kind:"url",...k.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...k.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...k.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...k.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...k.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...k.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...k.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...k.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...k.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...k.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...k.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...k.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...k.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...k.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...k.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...k.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...k.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...k.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...k.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...k.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...k.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...k.errToObj(i)})}nonempty(n){return this.min(1,k.errToObj(n))}trim(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Jo.create=(n)=>{var i;return new Jo({checks:[],typeName:t.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function gG(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return x%m/Math.pow(10,p)}class fc extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==h.number){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:h.number,received:p.parsedType}),g}let o=void 0,c=new Mi;for(let p of this._def.checks)if(p.kind==="int"){if(!Tn.isInteger(n.data))o=this._getOrReturnCtx(n,o),L(o,{code:U.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),L(o,{code:U.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),L(o,{code:U.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(gG(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),L(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),L(o,{code:U.not_finite,message:p.message}),c.dirty()}else Tn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new fc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new fc({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:k.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:k.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Tn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}fc.create=(n)=>{return new fc({checks:[],typeName:t.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class ac extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(p){return this._getInvalidInput(n)}if(this._getType(n)!==h.bigint)return this._getInvalidInput(n);let o=void 0,c=new Mi;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),L(o,{code:U.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),L(o,{code:U.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),L(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Tn.assertNever(p);return{status:c.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return L(i,{code:U.invalid_type,expected:h.bigint,received:i.parsedType}),g}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new ac({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}ac.create=(n)=>{var i;return new ac({checks:[],typeName:t.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};class Lp extends pn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==h.boolean){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.boolean,received:o.parsedType}),g}return Ui(n.data)}}Lp.create=(n)=>{return new Lp({typeName:t.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class hc extends pn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==h.date){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:h.date,received:p.parsedType}),g}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_date}),g}let o=new Mi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),L(c,{code:U.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),L(c,{code:U.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Tn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new hc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:k.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:k.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}hc.create=(n)=>{return new hc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:t.ZodDate,...cn(n)})};class Ix extends pn{_parse(n){if(this._getType(n)!==h.symbol){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.symbol,received:o.parsedType}),g}return Ui(n.data)}}Ix.create=(n)=>{return new Ix({typeName:t.ZodSymbol,...cn(n)})};class Dp extends pn{_parse(n){if(this._getType(n)!==h.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.undefined,received:o.parsedType}),g}return Ui(n.data)}}Dp.create=(n)=>{return new Dp({typeName:t.ZodUndefined,...cn(n)})};class Np extends pn{_parse(n){if(this._getType(n)!==h.null){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.null,received:o.parsedType}),g}return Ui(n.data)}}Np.create=(n)=>{return new Np({typeName:t.ZodNull,...cn(n)})};class Cc extends pn{constructor(){super(...arguments);this._any=!0}_parse(n){return Ui(n.data)}}Cc.create=(n)=>{return new Cc({typeName:t.ZodAny,...cn(n)})};class mc extends pn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Ui(n.data)}}mc.create=(n)=>{return new mc({typeName:t.ZodUnknown,...cn(n)})};class zo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return L(i,{code:U.invalid_type,expected:h.never,received:i.parsedType}),g}}zo.create=(n)=>{return new zo({typeName:t.ZodNever,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==h.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.void,received:o.parsedType}),g}return Ui(n.data)}}yx.create=(n)=>{return new yx({typeName:t.ZodVoid,...cn(n)})};class Ao extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==h.array)return L(i,{code:U.invalid_type,expected:h.array,received:i.parsedType}),g;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(x||m)L(i,{code:x?U.too_big:U.too_small,minimum:m?c.exactLength.value:void 0,maximum:x?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)L(i,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)L(i,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((x,m)=>{return c.type._parseAsync(new Fo(i,x,i.path,m))})).then((x)=>{return Mi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Fo(i,x,i.path,m))});return Mi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Ao({...this._def,minLength:{value:n,message:k.toString(i)}})}max(n,i){return new Ao({...this._def,maxLength:{value:n,message:k.toString(i)}})}length(n,i){return new Ao({...this._def,exactLength:{value:n,message:k.toString(i)}})}nonempty(n){return this.min(1,n)}}Ao.create=(n,i)=>{return new Ao({type:n,minLength:null,maxLength:null,exactLength:null,typeName:t.ZodArray,...cn(i)})};function _p(n){if(n instanceof un){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=To.create(_p(c))}return new un({...n._def,shape:()=>i})}else if(n instanceof Ao)return new Ao({...n._def,type:_p(n.element)});else if(n instanceof To)return To.create(_p(n.unwrap()));else if(n instanceof ho)return ho.create(_p(n.unwrap()));else if(n instanceof Qo)return Qo.create(n.items.map((i)=>_p(i)));else return n}class un extends pn{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Tn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==h.object){let a=this._getOrReturnCtx(n);return L(a,{code:U.invalid_type,expected:h.object,received:a.parsedType}),g}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof zo&&this._def.unknownKeys==="strip")){for(let a in c.data)if(!x.includes(a))m.push(a)}let f=[];for(let a of x){let v=p[a],$=c.data[a];f.push({key:{status:"valid",value:a},value:v._parse(new Fo(c,$,c.path,a)),alwaysSet:a in c.data})}if(this._def.catchall instanceof zo){let a=this._def.unknownKeys;if(a==="passthrough")for(let v of m)f.push({key:{status:"valid",value:v},value:{status:"valid",value:c.data[v]}});else if(a==="strict"){if(m.length>0)L(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(a==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let a=this._def.catchall;for(let v of m){let $=c.data[v];f.push({key:{status:"valid",value:v},value:a._parse(new Fo(c,$,c.path,v)),alwaysSet:v in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let a=[];for(let v of f){let $=await v.key,w=await v.value;a.push({key:$,value:w,alwaysSet:v.alwaysSet})}return a}).then((a)=>{return Mi.mergeObjectSync(o,a)});else return Mi.mergeObjectSync(o,f)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new un({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let f=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=k.errToObj(n).message)!==null&&m!==void 0?m:f};return{message:f}}}:{}})}strip(){return new un({...this._def,unknownKeys:"strip"})}passthrough(){return new un({...this._def,unknownKeys:"passthrough"})}extend(n){return new un({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new un({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:t.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new un({...this._def,catchall:n})}pick(n){let i={};return Tn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new un({...this._def,shape:()=>i})}omit(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new un({...this._def,shape:()=>i})}deepPartial(){return _p(this)}partial(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new un({...this._def,shape:()=>i})}required(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof To)p=p._def.innerType;i[o]=p}}),new un({...this._def,shape:()=>i})}keyof(){return oR(Tn.objectKeys(this.shape))}}un.create=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strip",catchall:zo.create(),typeName:t.ZodObject,...cn(i)})};un.strictCreate=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strict",catchall:zo.create(),typeName:t.ZodObject,...cn(i)})};un.lazycreate=(n,i)=>{return new un({shape:n,unknownKeys:"strip",catchall:zo.create(),typeName:t.ZodObject,...cn(i)})};class hp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let m of p)if(m.result.status==="valid")return m.result;for(let m of p)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;let x=p.map((m)=>new Ii(m.ctx.common.issues));return L(i,{code:U.invalid_union,unionErrors:x}),g}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let f of o){let a={...i,common:{...i.common,issues:[]},parent:null},v=f._parseSync({data:i.data,path:i.path,parent:a});if(v.status==="valid")return v;else if(v.status==="dirty"&&!p)p={result:v,ctx:a};if(a.common.issues.length)x.push(a.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((f)=>new Ii(f));return L(i,{code:U.invalid_union,unionErrors:m}),g}}get options(){return this._def.options}}hp.create=(n,i)=>{return new hp({options:n,typeName:t.ZodUnion,...cn(i)})};var Do=(n)=>{if(n instanceof up)return Do(n.schema);else if(n instanceof no)return Do(n.innerType());else if(n instanceof Ip)return[n.value];else if(n instanceof vc)return n.options;else if(n instanceof yp)return Tn.objectValues(n.enum);else if(n instanceof kp)return Do(n._def.innerType);else if(n instanceof Dp)return[void 0];else if(n instanceof Np)return[null];else if(n instanceof To)return[void 0,...Do(n.unwrap())];else if(n instanceof ho)return[null,...Do(n.unwrap())];else if(n instanceof Nf)return Do(n.unwrap());else if(n instanceof qp)return Do(n.unwrap());else if(n instanceof Zp)return Do(n._def.innerType);else return[]};class Df extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==h.object)return L(i,{code:U.invalid_type,expected:h.object,received:i.parsedType}),g;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return L(i,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),g;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let x=Do(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of x){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new Df({typeName:t.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function M0(n,i){let o=No(n),c=No(i);if(n===i)return{valid:!0,data:n};else if(o===h.object&&c===h.object){let p=Tn.objectKeys(i),x=Tn.objectKeys(n).filter((f)=>p.indexOf(f)!==-1),m={...n,...i};for(let f of x){let a=M0(n[f],i[f]);if(!a.valid)return{valid:!1};m[f]=a.data}return{valid:!0,data:m}}else if(o===h.array&&c===h.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],f=i[x],a=M0(m,f);if(!a.valid)return{valid:!1};p.push(a.data)}return{valid:!0,data:p}}else if(o===h.date&&c===h.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class Cp extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(l0(p)||l0(x))return g;let m=M0(p.value,x.value);if(!m.valid)return L(o,{code:U.invalid_intersection_types}),g;if(H0(p)||H0(x))i.dirty();return{status:i.value,value:m.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,x])=>c(p,x));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Cp.create=(n,i,o)=>{return new Cp({left:n,right:i,typeName:t.ZodIntersection,...cn(o)})};class Qo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==h.array)return L(o,{code:U.invalid_type,expected:h.array,received:o.parsedType}),g;if(o.data.length<this._def.items.length)return L(o,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;if(!this._def.rest&&o.data.length>this._def.items.length)L(o,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,m)=>{let f=this._def.items[m]||this._def.rest;if(!f)return null;return f._parse(new Fo(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Mi.mergeArray(i,x)});else return Mi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Qo({...this._def,rest:n})}}Qo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:n,typeName:t.ZodTuple,rest:null,...cn(i)})};class kx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==h.object)return L(o,{code:U.invalid_type,expected:h.object,received:o.parsedType}),g;let c=[],p=this._def.keyType,x=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Fo(o,m,o.path,m)),value:x._parse(new Fo(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Mi.mergeObjectAsync(i,c);else return Mi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof pn)return new kx({keyType:n,valueType:i,typeName:t.ZodRecord,...cn(o)});return new kx({keyType:Jo.create(),valueType:n,typeName:t.ZodRecord,...cn(i)})}}class Zx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==h.map)return L(o,{code:U.invalid_type,expected:h.map,received:o.parsedType}),g;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,f],a)=>{return{key:c._parse(new Fo(o,m,o.path,[a,"key"])),value:p._parse(new Fo(o,f,o.path,[a,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let f of x){let a=await f.key,v=await f.value;if(a.status==="aborted"||v.status==="aborted")return g;if(a.status==="dirty"||v.status==="dirty")i.dirty();m.set(a.value,v.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let f of x){let{key:a,value:v}=f;if(a.status==="aborted"||v.status==="aborted")return g;if(a.status==="dirty"||v.status==="dirty")i.dirty();m.set(a.value,v.value)}return{status:i.value,value:m}}}}Zx.create=(n,i,o)=>{return new Zx({valueType:i,keyType:n,typeName:t.ZodMap,...cn(o)})};class uc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==h.set)return L(o,{code:U.invalid_type,expected:h.set,received:o.parsedType}),g;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)L(o,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)L(o,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(f){let a=new Set;for(let v of f){if(v.status==="aborted")return g;if(v.status==="dirty")i.dirty();a.add(v.value)}return{status:i.value,value:a}}let m=[...o.data.values()].map((f,a)=>p._parse(new Fo(o,f,o.path,a)));if(o.common.async)return Promise.all(m).then((f)=>x(f));else return x(m)}min(n,i){return new uc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new uc({...this._def,maxSize:{value:n,message:k.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}uc.create=(n,i)=>{return new uc({valueType:n,minSize:null,maxSize:null,typeName:t.ZodSet,...cn(i)})};class bp extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==h.function)return L(i,{code:U.invalid_type,expected:h.function,received:i.parsedType}),g;function o(m,f){return jf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,bf(),jp].filter((a)=>!!a),issueData:{code:U.invalid_arguments,argumentsError:f}})}function c(m,f){return jf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,bf(),jp].filter((a)=>!!a),issueData:{code:U.invalid_return_type,returnTypeError:f}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let m=this;return Ui(async function(...f){let a=new Ii([]),v=await m._def.args.parseAsync(f,p).catch((J)=>{throw a.addIssue(o(f,J)),a}),$=await Reflect.apply(x,this,v);return await m._def.returns._def.type.parseAsync($,p).catch((J)=>{throw a.addIssue(c($,J)),a})})}else{let m=this;return Ui(function(...f){let a=m._def.args.safeParse(f,p);if(!a.success)throw new Ii([o(f,a.error)]);let v=Reflect.apply(x,this,a.data),$=m._def.returns.safeParse(v,p);if(!$.success)throw new Ii([c(v,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new bp({...this._def,args:Qo.create(n).rest(mc.create())})}returns(n){return new bp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new bp({args:n?n:Qo.create([]).rest(mc.create()),returns:i||mc.create(),typeName:t.ZodFunction,...cn(o)})}}class up extends pn{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}up.create=(n,i)=>{return new up({getter:n,typeName:t.ZodLazy,...cn(i)})};class Ip extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return L(i,{received:i.data,code:U.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ip.create=(n,i)=>{return new Ip({value:n,typeName:t.ZodLiteral,...cn(i)})};function oR(n,i){return new vc({values:n,typeName:t.ZodEnum,...cn(i)})}class vc extends pn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{expected:Tn.joinValues(o),received:i.parsedType,code:U.invalid_type}),g}if(!Lf(this,hx,"f"))d6(this,hx,new Set(this._def.values),"f");if(!Lf(this,hx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{received:i.data,code:U.invalid_enum_value,options:o}),g}return Ui(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return vc.create(n,{...this._def,...i})}exclude(n,i=this._def){return vc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}hx=new WeakMap;vc.create=oR;class yp extends pn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){let i=Tn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==h.string&&o.parsedType!==h.number){let c=Tn.objectValues(i);return L(o,{expected:Tn.joinValues(c),received:o.parsedType,code:U.invalid_type}),g}if(!Lf(this,Cx,"f"))d6(this,Cx,new Set(Tn.getValidEnumValues(this._def.values)),"f");if(!Lf(this,Cx,"f").has(n.data)){let c=Tn.objectValues(i);return L(o,{received:o.data,code:U.invalid_enum_value,options:c}),g}return Ui(n.data)}get enum(){return this._def.values}}Cx=new WeakMap;yp.create=(n,i)=>{return new yp({values:n,typeName:t.ZodNativeEnum,...cn(i)})};class Ic extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==h.promise&&i.common.async===!1)return L(i,{code:U.invalid_type,expected:h.promise,received:i.parsedType}),g;let o=i.parsedType===h.promise?i.data:Promise.resolve(i.data);return Ui(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}Ic.create=(n,i)=>{return new Ic({type:n,typeName:t.ZodPromise,...cn(i)})};class no extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===t.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(x)=>{if(L(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(m)=>{if(i.value==="aborted")return g;let f=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(f.status==="aborted")return g;if(f.status==="dirty")return Bp(f.value);if(i.value==="dirty")return Bp(f.value);return f});else{if(i.value==="aborted")return g;let m=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(m.status==="aborted")return g;if(m.status==="dirty")return Bp(m.value);if(i.value==="dirty")return Bp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let f=c.refinement(m,p);if(o.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){let m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(m.status==="aborted")return g;if(m.status==="dirty")i.dirty();return x(m.value),{status:i.value,value:m.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((m)=>{if(m.status==="aborted")return g;if(m.status==="dirty")i.dirty();return x(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Nc(x))return x;let m=c.transform(x.value,p);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(!Nc(x))return x;return Promise.resolve(c.transform(x.value,p)).then((m)=>({status:i.value,value:m}))});Tn.assertNever(c)}}no.create=(n,i,o)=>{return new no({schema:n,typeName:t.ZodEffects,effect:i,...cn(o)})};no.createWithPreprocess=(n,i,o)=>{return new no({schema:i,effect:{type:"preprocess",transform:n},typeName:t.ZodEffects,...cn(o)})};class To extends pn{_parse(n){if(this._getType(n)===h.undefined)return Ui(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}To.create=(n,i)=>{return new To({innerType:n,typeName:t.ZodOptional,...cn(i)})};class ho extends pn{_parse(n){if(this._getType(n)===h.null)return Ui(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ho.create=(n,i)=>{return new ho({innerType:n,typeName:t.ZodNullable,...cn(i)})};class kp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===h.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:t.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...cn(i)})};class Zp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(ux(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:t.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class qx extends pn{_parse(n){if(this._getType(n)!==h.nan){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:h.nan,received:o.parsedType}),g}return{status:"valid",value:n.data}}}qx.create=(n)=>{return new qx({typeName:t.ZodNaN,...cn(n)})};var dG=Symbol("zod_brand");class Nf extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class Px extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return g;if(p.status==="dirty")return i.dirty(),Bp(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return g;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new Px({in:n,out:i,typeName:t.ZodPipeline})}}class qp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Nc(c))c.value=Object.freeze(c.value);return c};return ux(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:t.ZodReadonly,...cn(i)})};function r6(n,i){let o=typeof n==="function"?n(i):typeof n==="string"?{message:n}:n;return typeof o==="string"?{message:o}:o}function cR(n,i={},o){if(n)return Cc.create().superRefine((c,p)=>{var x,m;let f=n(c);if(f instanceof Promise)return f.then((a)=>{var v,$;if(!a){let w=r6(i,c),J=($=(v=w.fatal)!==null&&v!==void 0?v:o)!==null&&$!==void 0?$:!0;p.addIssue({code:"custom",...w,fatal:J})}});if(!f){let a=r6(i,c),v=(m=(x=a.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...a,fatal:v})}return});return Cc.create()}var eG={object:un.lazycreate},t;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(t||(t={}));var nY=(n,i={message:`Input not instance of ${n.name}`})=>cR((o)=>o instanceof n,i),pR=Jo.create,xR=fc.create,iY=qx.create,oY=ac.create,mR=Lp.create,cY=hc.create,pY=Ix.create,xY=Dp.create,mY=Np.create,fY=Cc.create,aY=mc.create,vY=zo.create,$Y=yx.create,wY=Ao.create,JY=un.create,AY=un.strictCreate,TY=hp.create,FY=Df.create,RY=Cp.create,XY=Qo.create,WY=kx.create,KY=Zx.create,SY=uc.create,GY=bp.create,YY=up.create,lY=Ip.create,HY=vc.create,MY=yp.create,zY=Ic.create,t6=no.create,QY=To.create,EY=ho.create,OY=no.createWithPreprocess,UY=Px.create,VY=()=>pR().optional(),_Y=()=>xR().optional(),BY=()=>mR().optional(),bY={string:(n)=>Jo.create({...n,coerce:!0}),number:(n)=>fc.create({...n,coerce:!0}),boolean:(n)=>Lp.create({...n,coerce:!0}),bigint:(n)=>ac.create({...n,coerce:!0}),date:(n)=>hc.create({...n,coerce:!0})},jY=g,Kn=Object.freeze({__proto__:null,defaultErrorMap:jp,setErrorMap:OG,getErrorMap:bf,makeIssue:jf,EMPTY_PATH:UG,addIssueToContext:L,ParseStatus:Mi,INVALID:g,DIRTY:Bp,OK:Ui,isAborted:l0,isDirty:H0,isValid:Nc,isAsync:ux,get util(){return Tn},get objectUtil(){return Y0},ZodParsedType:h,getParsedType:No,ZodType:pn,datetimeRegex:iR,ZodString:Jo,ZodNumber:fc,ZodBigInt:ac,ZodBoolean:Lp,ZodDate:hc,ZodSymbol:Ix,ZodUndefined:Dp,ZodNull:Np,ZodAny:Cc,ZodUnknown:mc,ZodNever:zo,ZodVoid:yx,ZodArray:Ao,ZodObject:un,ZodUnion:hp,ZodDiscriminatedUnion:Df,ZodIntersection:Cp,ZodTuple:Qo,ZodRecord:kx,ZodMap:Zx,ZodSet:uc,ZodFunction:bp,ZodLazy:up,ZodLiteral:Ip,ZodEnum:vc,ZodNativeEnum:yp,ZodPromise:Ic,ZodEffects:no,ZodTransformer:no,ZodOptional:To,ZodNullable:ho,ZodDefault:kp,ZodCatch:Zp,ZodNaN:qx,BRAND:dG,ZodBranded:Nf,ZodPipeline:Px,ZodReadonly:qp,custom:cR,Schema:pn,ZodSchema:pn,late:eG,get ZodFirstPartyTypeKind(){return t},coerce:bY,any:fY,array:wY,bigint:oY,boolean:mR,date:cY,discriminatedUnion:FY,effect:t6,enum:HY,function:GY,instanceof:nY,intersection:RY,lazy:YY,literal:lY,map:KY,nan:iY,nativeEnum:MY,never:vY,null:mY,nullable:EY,number:xR,object:JY,oboolean:BY,onumber:_Y,optional:QY,ostring:VY,pipeline:UY,preprocess:OY,promise:zY,record:WY,set:SY,strictObject:AY,string:pR,symbol:pY,transformer:t6,tuple:XY,undefined:xY,union:TY,unknown:aY,void:$Y,NEVER:jY,ZodIssueCode:U,quotelessJson:EG,ZodError:Ii});var LY="__vite_start_time"in globalThis,DY=typeof window!=="undefined",rN="vitest"in globalThis,Pn=P6({isServer:!LY&&!DY,server:{CI:Kn.string().transform((n)=>!0).optional(),POSTGRES_USER:Kn.string(),POSTGRES_PASSWORD:Kn.string(),POSTGRES_DATABASE:Kn.string(),POSTGRES_HOST:Kn.string(),POSTGRES_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Kn.string().transform((n)=>JSON.parse(n)).pipe(Kn.array(Kn.string())),OPENAI_API_KEY:Kn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Kn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var aR=z0(import.meta.dirname,"../dev"),Q0=Pn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:fR(z0(aR,"./cert.pem"),"utf-8"),key:fR(z0(aR,"./key.pem"),"utf-8")}:void 0;var $c=new Qa,mn=Pn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:$c.logger;d.STORE.loggers[0]=new Wc("warn",void 0,mn);if(mn!==console)Object.assign(console,mn,{log:mn.info});import{spawn as NY}from"child_process";import{resolve as hY}from"path";function E0(n,i,o=n.logger){let c=Pn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[hY(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let f=NY(p,m);return new Jx(f,i,o)}var vR=$a(av(),1);var CY=604800000,hf=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new vR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,m]of c.entries())if(p-m>CY)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),mn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import _2 from"path";import $2 from"os";import w2 from"fs";var Cf=new Map,O0=new Map,U0=Symbol("OriginError"),Pp={};class io extends Promise{constructor(n,i,o,c,p={}){let x,m;super((f,a)=>{x=f,m=a});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(f)=>(this.active=!1,x(f)),this.reject=(f)=>(this.active=!1,m(f)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[U0]=this.handler.debug?new Error:this.tagged&&uY(this.strings)}get origin(){return(this.handler.debug?this[U0].stack:this.tagged&&O0.has(this.strings)?O0.get(this.strings):O0.set(this.strings,this[U0].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,x)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((f)=>o=f)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(Pp),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function uY(n){if(Cf.has(n))return Cf.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,Cf.set(n,new Error),Error.stackTraceLimit=i,Cf.get(n)}class sp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var tn={connection:$R,postgres:wR,generic:JR,notSupported:AR};function $R(n,i,o){let{host:c,port:p}=o||i,x=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(x,$R),x}function wR(n){let i=new sp(n);return Error.captureStackTrace(i,wR),i}function JR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,JR),o}function AR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,AR),i}var IY={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class yf{then(){V0()}catch(){V0()}finally(){V0()}}class gx extends yf{constructor(n){super();this.value=qf(n)}}class Eo extends yf{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class kf extends yf{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=yY.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?L0(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function Zf(n,i,o,c){let p=n instanceof Eo?n.value:n;if(p===void 0){if(n instanceof Eo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw tn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||If(n.value)]||n.type||XR(n.value):n.type):(i.push(n),If(n)))}var FR=KR(IY);function b0(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=j0(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function j0(n,i,o,c,p){return i instanceof kf?i.build(n,o,c,p):i instanceof io?B0(i,o,c,p):i instanceof gx?i.value:i&&i[0]instanceof io?i.reduce((x,m)=>x+" "+B0(m,o,c,p),""):Zf(i,o,c,p)}function B0(n,i,o,c){return n.fragment=!0,b0(n,n.strings[0],n.args[0],i,o,c)}function RR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>j0("values",x[m],i,o,p)).join(",")+")").join(",")}function TR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return RR(x?n:[n],o,c,m,p)}function uf(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return L0(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((f)=>{return x=n[f],(x instanceof io?B0(x,o,c,p):x instanceof gx?x.value:Zf(x,o,c,p))+" as "+qf(p.transform.column.to?p.transform.column.to(f):f)}).join(",")}var yY=Object.entries({values:TR,in:(...n)=>{let i=TR(...n);return i==="()"?"(null)":i},select:uf,as:uf,returning:uf,"\\(":uf,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>qf(p.transform.column.to?p.transform.column.to(x):x)+"="+j0("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+L0(x,p)+")values"+RR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function V0(){throw tn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:kY,parsers:ZY}=FR;function XR(n){if(Array.isArray(n))return XR(n[0]);return typeof n==="string"?1009:0}var WR=function(n){let i=KR(n||{});return{serializers:Object.assign({},kY,i.serializers),parsers:Object.assign({},ZY,i.parsers)}};function KR(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function L0(n,{transform:{column:i}}){return n.map((o)=>qf(i.to?i.to(o):o)).join(",")}var qf=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},If=function n(i){return i instanceof Eo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},qY=/\\/g,PY=/"/g;function sY(n){return n.replace(qY,"\\\\").replace(PY,"\\\"")}var SR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],m=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((f)=>n(f,o,c,p)).join(m)+"}";return"{"+i.map((f)=>{if(f===void 0){if(f=c.transform.undefined,f===void 0)throw tn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return f===null?"null":'"'+sY(o?o(f.type?f.value:f):""+f)+'"'}).join(m)+"}"},_0={i:0,char:null,str:"",quoted:!1,last:0},GR=function n(i,o,c){return _0.i=_0.last=0,YR(_0,i,o,c)};function YR(n,i,o,c){let p=[],x=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(YR(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===x&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var yc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>n.replace(/_/g,"-"),sx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),rx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),tx=(n)=>n.replace(/-/g,"_");function D0(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[x,m])=>Object.assign(p,{[n(x)]:i(m,c)}),{}):o}}yc.column={from:yc};yc.value={from:D0(yc)};sx.column={to:sx};var N0={...yc};N0.column.to=sx;kc.column={from:kc};kc.value={from:D0(kc)};rx.column={to:rx};var h0={...kc};h0.column.to=rx;Zc.column={from:Zc};Zc.value={from:D0(Zc)};tx.column={to:tx};var C0={...Zc};C0.column.to=tx;import lR from"net";import dY from"tls";import dx from"crypto";import u0 from"stream";import{performance as HR}from"perf_hooks";class qc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var yi=rY;function rY(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var zi=Buffer.allocUnsafe(256),tY="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return zi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(gY,tY,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return Pf(i),Qn.i+=zi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return Pf(2),zi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return zi.writeUInt32BE(n,i),Qn;return Pf(4),zi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return Pf(n),zi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return zi=Buffer.concat([zi.subarray(0,Qn.i),n]),Qn.i=zi.length,Qn},end(n=1){zi.writeUInt32BE(Qn.i-n,n);let i=zi.subarray(0,Qn.i);return Qn.i=0,zi=Buffer.allocUnsafe(256),i}}),P=Qn;function Pf(n){if(zi.length-Qn.i<n){let i=zi,o=i.length;zi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(zi)}}function gY(){return Qn.i=0,Qn}var k0=QR,eY=1,wc=P().S().end(),MR=P().H().end(),n2=P().i32(8).i32(80877103).end(8),i2=Buffer.concat([P().E().str(P.N).i32(0).end(),wc]),o2=P().D().str("S").str(P.N).end(),rp=()=>{},c2=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),p2={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function QR(n,i={},{onopen:o=rp,onend:c=rp,onclose:p=rp}={}){let{ssl:x,max:m,user:f,host:a,port:v,database:$,parsers:w,transform:J,onnotice:X,onnotify:W,onparameter:R,max_pipeline:S,keep_alive:l,backoff:H,target_session_attrs:I}=n,Y=yi(),z=eY++,E={pid:null,secret:null},Q=y0(fa,n.idle_timeout),b=y0(fa,n.max_lifetime),y=y0(m3,n.connect_timeout),M=null,fn,Z=new qc,an=Buffer.alloc(0),En=n.fetch_types,gn={},_i={},Oo=Math.random().toString(36).slice(2),O=1,q=0,Rn=0,Dn=0,dn=0,vn=0,_n=0,sn=0,hn=null,jn=null,Ti=!1,Bn=null,oo=null,Fi=null,Co=null,en=null,Ln=null,co=null,Xo=null,_=null,nx=null,Ri={queue:i.closed,idleTimer:Q,connect(A){Fi=A||!0,X$()},terminate:ox,execute:ix,cancel:o3,end:fa,count:0,id:z};return i.closed&&i.closed.push(Ri),Ri;async function i3(){let A;try{A=n.socket?await Promise.resolve(n.socket(n)):new lR.Socket}catch(K){tc(K);return}return A.on("error",tc),A.on("close",W$),A.on("drain",F$),A}async function o3({pid:A,secret:K},s,Xn){try{fn=P().i32(16).i32(80877102).i32(A).i32(K).end(16),await R$(),M.once("error",Xn),M.once("close",s)}catch(In){Xn(In)}}function ix(A){if(Ti)return xm(A,tn.connection("CONNECTION_DESTROYED",n));if(A.cancelled)return;try{return A.state=E,_?Y.push(A):(_=A,_.active=!0),x3(A),$i(c3(A))&&!A.describeFirst&&!A.cursorFn&&Y.length<S&&(!A.options.onexecute||A.options.onexecute(Ri))}catch(K){return Y.length===0&&$i(wc),Wo(K),!0}}function c3(A){if(A.parameters.length>=65534)throw tn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return A.options.simple?P().Q().str(A.statement.string+P.N).end():A.describeFirst?Buffer.concat([J$(A),MR]):A.prepare?A.prepared?pm(A):Buffer.concat([J$(A),pm(A)]):p3(A)}function J$(A){return Buffer.concat([S$(A.statement.string,A.parameters,A.statement.types,A.statement.name),k3("S",A.statement.name)])}function pm(A){return Buffer.concat([y3(A.parameters,A.statement.types,A.statement.name,A.cursorName),A.cursorFn?G$("",A.cursorRows):i2])}function p3(A){return Buffer.concat([S$(A.statement.string,A.parameters,A.statement.types),o2,pm(A)])}function x3(A){let K=[],s=[],Xn=b0(A,A.strings[0],A.args[0],K,s,n);!A.tagged&&A.args.forEach((In)=>Zf(In,K,s,n)),A.prepare=n.prepare&&("prepare"in A.options?A.options.prepare:!0),A.string=Xn,A.signature=A.prepare&&s+Xn,A.onlyDescribe&&delete _i[A.signature],A.parameters=A.parameters||K,A.prepared=A.prepare&&A.signature in _i,A.describeFirst=A.onlyDescribe||K.length&&!A.prepared,A.statement=A.prepared?_i[A.signature]:{string:Xn,types:s,name:A.prepare?Oo+O++:""},typeof n.debug==="function"&&n.debug(z,Xn,K,s)}function $i(A,K){if(Ln=Ln?Buffer.concat([Ln,A]):Buffer.from(A),K||Ln.length>=1024)return A$(K);return jn===null&&(jn=setImmediate(A$)),!0}function A$(A){let K=M.write(Ln,A);return jn!==null&&clearImmediate(jn),Ln=jn=null,K}function m3(){Wo(tn.connection("CONNECT_TIMEOUT",n,M)),M.destroy()}async function T$(){if($i(n2),!await new Promise((K)=>M.once("data",(s)=>K(s[0]===83)))&&x==="prefer")return rc();M.removeAllListeners(),M=dY.connect({socket:M,servername:lR.isIP(M.host)?void 0:M.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),M.on("secureConnect",rc),M.on("error",tc),M.on("close",W$),M.on("drain",F$)}function F$(){!_&&o(Ri)}function ma(A){if(Bn){if(Bn.push(A),Rn-=A.length,Rn>=0)return}an=Bn?Buffer.concat(Bn,vn-Rn):an.length===0?A:Buffer.concat([an,A],an.length+A.length);while(an.length>4){if(vn=an.readUInt32BE(1),vn>=an.length){Rn=vn-an.length,Bn=[an];break}try{f3(an.subarray(0,vn+1))}catch(K){_&&(_.cursorFn||_.describeFirst)&&$i(wc),Wo(K)}an=an.subarray(vn+1),Rn=0,Bn=null}}async function R$(){if(Ti=!1,gn={},M||(M=await i3()),!M)return;if(y.start(),n.socket)return x?T$():rc();if(M.on("connect",x?T$:rc),n.path)return M.connect(n.path);M.ssl=x,M.connect(v[Dn],a[Dn]),M.host=a[Dn],M.port=v[Dn],Dn=(Dn+1)%v.length}function X$(){setTimeout(R$,q?q+_n-HR.now():0)}function rc(){try{_i={},En=n.fetch_types,Oo=Math.random().toString(36).slice(2),O=1,b.start(),M.on("data",ma),l&&M.setKeepAlive&&M.setKeepAlive(!0,1000*l);let A=q3();$i(A)}catch(A){tc(A)}}function tc(A){if(Ri.queue===i.connecting&&n.host[dn+1])return;Wo(A);while(Y.length)xm(Y.shift(),A)}function Wo(A){en&&(en.destroy(A),en=null),_&&xm(_,A),Fi&&(xm(Fi,A),Fi=null)}function xm(A,K){"query"in K||"parameters"in K||Object.defineProperties(K,{stack:{value:K.stack+A.origin.replace(/.*\n/,`
61
- `),enumerable:n.debug},query:{value:A.string,enumerable:n.debug},parameters:{value:A.parameters,enumerable:n.debug},args:{value:A.args,enumerable:n.debug},types:{value:A.statement&&A.statement.types,enumerable:n.debug}}),A.reject(K)}function fa(){return Co||(!Ri.reserved&&c(Ri),!Ri.reserved&&!Fi&&!_&&Y.length===0?(ox(),new Promise((A)=>M&&M.readyState!=="closed"?M.once("close",A):A())):Co=new Promise((A)=>co=A))}function ox(){if(Ti=!0,en||_||Fi||Y.length)tc(tn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(jn),M)M.removeListener("data",ma),M.removeListener("connect",rc),M.readyState==="open"&&M.end(P().X().end());co&&(co(),Co=co=null)}async function W$(A){if(an=Buffer.alloc(0),Rn=0,Bn=null,clearImmediate(jn),M.removeListener("data",ma),M.removeListener("connect",rc),Q.cancel(),b.cancel(),y.cancel(),M.removeAllListeners(),M=null,Fi)return X$();!A&&(_||Y.length)&&tc(tn.connection("CONNECTION_CLOSED",n,M)),q=HR.now(),A&&n.shared.retries++,_n=(typeof H==="function"?H(n.shared.retries):H)*1000,p(Ri,tn.connection("CONNECTION_CLOSED",n,M))}function f3(A,K=A[0]){(K===68?a3:K===100?j3:K===65?O3:K===83?v3:K===90?$3:K===67?w3:K===50?K$:K===49?J3:K===116?A3:K===84?T3:K===82?F3:K===110?G3:K===75?Y3:K===69?Q3:K===115?U3:K===51?V3:K===71?_3:K===78?D3:K===72?B3:K===99?L3:K===73?N3:K===86?h3:K===118?C3:K===87?b3:u3)(A)}function a3(A){let K=7,s,Xn,In,Xi=_.isRaw?new Array(_.statement.columns.length):{};for(let Qi=0;Qi<_.statement.columns.length;Qi++)Xn=_.statement.columns[Qi],s=A.readInt32BE(K),K+=4,In=s===-1?null:_.isRaw===!0?A.subarray(K,K+=s):Xn.parser===void 0?A.toString("utf8",K,K+=s):Xn.parser.array===!0?Xn.parser(A.toString("utf8",K+1,K+=s)):Xn.parser(A.toString("utf8",K,K+=s)),_.isRaw?Xi[Qi]=_.isRaw===!0?In:J.value.from?J.value.from(In,Xn):In:Xi[Xn.name]=J.value.from?J.value.from(In,Xn):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(Xi):Xi,Z):Z[sn++]=J.row.from?J.row.from(Xi):Xi}function v3(A){let[K,s]=A.toString("utf8",5,A.length-1).split(P.N);if(gn[K]=s,n.parameters[K]!==s)n.parameters[K]=s,R&&R(K,s)}function $3(A){if(_&&_.options.simple&&_.resolve(oo||Z),_=oo=null,Z=new qc,y.cancel(),Fi){if(I){if(!gn.in_hot_standby||!gn.default_transaction_read_only)return z3();else if(M3(I,gn))return ox()}if(En)return Fi===!0&&(Fi=null),l3();Fi!==!0&&ix(Fi),n.shared.retries=dn=0,Fi=null;return}while(Y.length&&(_=Y.shift())&&(_.active=!0,_.cancelled))QR(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;Ri.reserved?!Ri.reserved.release&&A[5]===73?Co?ox():(Ri.reserved=null,o(Ri)):Ri.reserved():Co?ox():o(Ri)}function w3(A){sn=0;for(let K=A.length-1;K>0;K--){if(A[K]===32&&A[K+1]<58&&Z.count===null)Z.count=+A.toString("utf8",K+1,A.length-1);if(A[K-1]>=65){Z.command=A.toString("utf8",5,K),Z.state=E;break}}if(nx&&(nx(),nx=null),Z.command==="BEGIN"&&m!==1&&!Ri.reserved)return Wo(tn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return K$();if(_.cursorFn)Z.count&&_.cursorFn(Z),$i(wc);_.resolve(Z)}function J3(){_.parsing=!1}function K$(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function A3(A){let K=A.readUInt16BE(5);for(let s=0;s<K;++s)!_.statement.types[s]&&(_.statement.types[s]=A.readUInt32BE(7+s*4));_.prepare&&(_i[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&($i(pm(_)),_.describeFirst=!1)}function T3(A){if(Z.command)oo=oo||[Z],oo.push(Z=new qc),Z.count=null,_.statement.columns=null;let K=A.readUInt16BE(5),s=7,Xn;_.statement.columns=Array(K);for(let In=0;In<K;++In){Xn=s;while(A[s++]!==0);let Xi=A.readUInt32BE(s),Qi=A.readUInt16BE(s+4),uo=A.readUInt32BE(s+6);_.statement.columns[In]={name:J.column.from?J.column.from(A.toString("utf8",Xn,s-1)):A.toString("utf8",Xn,s-1),parser:w[uo],table:Xi,number:Qi,type:uo},s+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),$i(wc)}async function F3(A,K=A.readUInt32BE(5)){(K===3?R3:K===5?X3:K===10?W3:K===11?K3:K===12?S3:K!==0?I3:rp)(A,K)}async function R3(){let A=await aa();$i(P().p().str(A).z(1).end())}async function X3(A){let K="md5"+await zR(Buffer.concat([Buffer.from(await zR(await aa()+f)),A.subarray(9)]));$i(P().p().str(K).z(1).end())}async function W3(){Xo=(await dx.randomBytes(18)).toString("base64"),P().p().str("SCRAM-SHA-256"+P.N);let A=P.i;$i(P.inc(4).str("n,,n=*,r="+Xo).i32(P.i-A-4,A).end())}async function K3(A){let K=A.toString("utf8",9).split(",").reduce((Qi,uo)=>(Qi[uo[0]]=uo.slice(2),Qi),{}),s=await dx.pbkdf2Sync(await aa(),Buffer.from(K.s,"base64"),parseInt(K.i),32,"sha256"),Xn=await sf(s,"Client Key"),In="n=*,r="+Xo+",r="+K.r+",s="+K.s+",i="+K.i+",c=biws,r="+K.r;hn=(await sf(await sf(s,"Server Key"),In)).toString("base64");let Xi="c=biws,r="+K.r+",p="+m2(Xn,Buffer.from(await sf(await x2(Xn),In))).toString("base64");$i(P().p().str(Xi).end())}function S3(A){if(A.toString("utf8",9).split(P.N,1)[0].slice(2)===hn)return;Wo(tn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),M.destroy()}function aa(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function G3(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),$i(wc)}function Y3(A){E.pid=A.readUInt32BE(5),E.secret=A.readUInt32BE(9)}async function l3(){En=!1,(await new io([`
57
+ ${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let a=wn(i),f=x.molecules.get(a);if(!f){let J=n.disposalTraces.buffer.find((S)=>S?.key===a);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${a} in store "${n.config.name}".`,J?`
58
+ ${a} was most recently disposed
59
+ ${J.trace}`:`No previous disposal trace for ${a} was found.`),o}let v=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>xi(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:f.stringKey,downstreamMoleculeKey:m.stringKey},{source:f.stringKey});let $={type:"molecule_transfer",key:m.key,from:v,to:[f.key]};if(Mn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push($);return o}function Tf(n,i,o){switch(i){case"newValue":{k0(n,o);break}case"oldValue":{Sc(o,n.token);break}}}function Rf(n,i,o){switch(i){case"newValue":{Sc(o,n.token);break}case"oldValue":{if(k0(n,o),n.subType==="atom")o.valueMap.set(n.token.key,n.value);break}}}function k0(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)t(i,c,xi(o.subKey))}}function Z0(n,i,o){switch(i){case"newValue":Tc(o,n.provenance,n.key);break;case"oldValue":Rc(o,n.key);break}}function q0(n,i,o){switch(i){case"newValue":Rc(o,n.key);break;case"oldValue":{let c=n.provenance.map(xi);Tc(o,c,n.key);for(let[p,x]of n.values){let m=o.families.get(p);if(m){t(o,m,n.key);let a=`${p}(${wn(n.key)})`;o.valueMap.set(a,x)}}}break}}function s0(n,i,o){switch(i){case"newValue":{let c=n.to.length===1?n.to[0]:n.to;ec(o,c,n.key,"exclusive")}break;case"oldValue":{let c=n.from.length===1?n.from[0]:n.from;ec(o,c,n.key,"exclusive")}break}}function Jm(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":wm(n,p,o);break;case"state_creation":Tf(p,n,o);break;case"state_disposal":Rf(p,n,o);break;case"molecule_creation":Z0(p,n,o);break;case"molecule_disposal":q0(p,n,o);break;case"molecule_transfer":s0(p,n,o);break;case"transaction_update":Jm(n,p,o);break}}function Sf(n,i){return n.transactionMeta.actionContinuities.getRelatedKey(i)}function m3(n,i){return n.transactionMeta.epoch.get(i)}function P0(n,i){if(!$i(n))return;let c=Sf(n,i);if(c===void 0)return;return m3(n,c)}function t0(n,i,o){if($i(n)&&i)n.transactionMeta.epoch.set(i,o)}function r0(n,i,o){if(!$i(n))return;let p=Sf(n,i);if(p!==void 0)n.transactionMeta.epoch.set(p,o)}var d0=(n,i)=>{let o=j(i),{parent:c}=o;if(c===null||!Mn(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),Jm("newValue",o.transactionMeta.update,c),$i(c))r0(c,o.transactionMeta.update.key,o.transactionMeta.update.epoch),Tn(i,{key:o.transactionMeta.update.key,type:"transaction"})?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(Mn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function g0(n,i,o){if(!$i(n))return;let{epoch:p,actionContinuities:x}=n.transactionMeta;if(x.set(i,o),!p.has(i))p.set(i,-1)}function e0(n){return{store:n}}function Gn(n,...i){let o,c,p;if(i.length===1)o=i[0];else c=i[0],p=i[1],o=t(n,c,p);if("counterfeit"in o&&"family"in o){c=n.families.get(o.family.key);let x=o.family.subKey,m=n.disposalTraces.buffer.find((a)=>a?.key===x);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,m?`This state was previously disposed:
60
+ ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let a=Tn(n,c).default(x);return n.defaults.set(c.key,a),a}}}return yo(n,Tn(n,o))}class qi extends Map{deleted=new Set;source;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var n1=(n,i,o,c)=>{let p=j(n),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new qi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new qi(p.families),joins:new qi(p.joins),operation:{open:!1},readonlySelectors:new qi(p.readonlySelectors),timelines:new qi(p.timelines),timelineTopics:new ii(p.timelineTopics.toJSON()),trackers:new Map,transactions:new qi(p.transactions),selectorAtoms:new ii(p.selectorAtoms.toJSON()),selectorGraph:new ii(p.selectorGraph.toJSON(),{makeContentKey:(...v)=>v.sort().join(":")}),selectors:new qi(p.selectors),valueMap:new qi(p.valueMap),defaults:p.defaults,disposalTraces:n.disposalTraces.copy(),molecules:new qi(p.molecules),moleculeGraph:new ii(p.moleculeGraph.toJSON(),{makeContentKey:p.moleculeGraph.makeContentKey}),moleculeData:new ii(p.moleculeData.toJSON(),{makeContentKey:p.moleculeData.makeContentKey}),moleculeJoins:new ii(p.moleculeJoins.toJSON(),{makeContentKey:p.moleculeJoins.makeContentKey}),miscResources:new qi(p.miscResources)},m=P0(n,i),a={phase:"building",update:{type:"transaction_update",key:i,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:o,output:void 0},toolkit:{get:(...v)=>Gn(f,...v),set:(...v)=>{On(f,...v)},run:(v,$=am())=>dc(f,v,$),find:(v,$)=>t(f,v,$),json:(v)=>ni(f,v),dispose:(...v)=>{Sc(f,...v)},env:()=>e0(f)}},f=Object.assign(x,{transactionMeta:a});return p.child=f,n.logger.info("\uD83D\uDEEB","transaction",i,"Building transaction with params:",o),f};function Xf(n,i){let o={key:i.key,type:"transaction",run:(x,m)=>{let a=n1(n,i.key,x,m);try{let f=j(n),{toolkit:v}=a.transactionMeta,$=i.do(v,...x);return d0($,f),$}catch(f){throw O0(c),n.logger.warn("\uD83D\uDCA5","transaction",i.key,"caught:",f),f}},install:(x)=>Xf(x,i),subject:new $n},c=j(n);c.transactions.set(o.key,o);let p=lo(o);return n.on.transactionCreation.next(p),p}class i1{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new ii({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new ii({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new ii({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new ii({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new fm(100);molecules=new Map;moleculeJoins=new ii({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeGraph=new ii({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeData=new ii({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});miscResources=new Map;on={atomCreation:new $n,atomDisposal:new $n,selectorCreation:new $n,selectorDisposal:new $n,timelineCreation:new $n,transactionCreation:new $n,transactionApplying:new Af(null),operationClose:new $n,moleculeCreation:new $n,moleculeDisposal:new $n};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Xc("warn",(n,i,o)=>!o1(o))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},$i(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new ii(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=ni(i,c),x=Uo(c);o.add(p.key),o.add(x.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var g={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new i1({name:"IMPLICIT_STORE",lifespan:"ephemeral"}),globalThis.ATOM_IO_IMPLICIT_STORE}};function Tn(n,i){let o,c=n;while(c!==null){switch(i.type){case"atom":case"mutable_atom":o=c.atoms.get(i.key);break;case"selector":o=c.selectors.get(i.key);break;case"readonly_selector":o=c.readonlySelectors.get(i.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(i.key);break;case"timeline":o=c.timelines.get(i.key);break;case"transaction":o=c.transactions.get(i.key);break}if(o)return o;c=c.child}throw new Fc(i,n)}function c1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Fc(i,n);let p=c(o),x=j(n);if(p.family){if($i(x))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(Mn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function p1(n,i,o){let c=wn(o),p=`${i.key}(${c})`,x=j(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=x.atoms.get(p);break;case"selector_family":m=x.selectors.get(p);break;case"readonly_selector_family":m=x.readonlySelectors.get(p);break}if(m)return lo(m);return m}function t(n,i,o){let c=p1(n,i,o);if(c)return c;let p=wn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=E0(i,o);return n.logger.error("\u274C",m.type,m.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),m}if(c=c1(n,i,o),x)j(n).moleculeData.set(p,i.key);return c}function Sc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=t(n,c,p)}try{Tn(n,o)}catch(c){n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`);return}switch(o.type){case"atom":case"mutable_atom":Wf(n,o);break;case"selector":case"readonly_selector":x1(n,o);break}}var Am=(n,i)=>j(n).atoms.has(i),a3=(n,i)=>j(n).selectors.has(i),f3=(n,i)=>j(n).readonlySelectors.has(i),m1=(n,i)=>Am(n,i)||a3(n,i)||f3(n,i);var Fm=(n,i)=>{return j(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>m1(i,c))};var Kf=(n,i,o)=>{let c=[],p=Fm(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Am(o,x))p.push(...Fm(x,o));else if(!c.includes(x))c.push(x)}return c},a1=(n,i)=>{let o=n.key,c=Fm(o,i),p=new Set;return c.flatMap((x)=>Am(i,x)?x:Kf(x,p,i))};var f1=(n,i,o,c)=>{let p=j(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let x=Kf(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Tm=(n,i,o)=>({get:(...c)=>{let p=j(o),x;if(c.length===2){let[f,v]=c;x=t(o,f,v)}else[x]=c;let m=Tn(o,x),a=yo(o,m);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,a,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),f1(n,x,i,o),a},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let f=c[0],v=c[1];x=c[2],p=t(o,f,v)}let m=j(o),a=Tn(m,p);$m(m,a,x)},find:(c,p)=>t(o,c,p),json:(c)=>ni(o,c)});var xx=(n,i,o)=>{let c=j(n),p=new $n,x=new Set,{get:m,find:a,json:f}=Tm(i.key,x,c),v=()=>{let S=i.get({get:m,find:a,json:f});return Zi(j(n),i.key,S,p),x.clear(),S},$={...i,subject:p,install:(S)=>xx(S,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,$);let w=v();n.logger.info("\u2728",$.type,$.key,"=",w);let J={key:i.key,type:"readonly_selector"};if(o)J.family=o;return J};var fx=(n,i,o)=>{let c=j(n),p=new $n,x=new Set,m=Tm(i.key,x,c),{find:a,get:f,json:v}=m,$={find:a,get:f,json:v},w=(K=i.get,M=j(n))=>{let Y=K($);return Zi(M,i.key,Y,p),x.clear(),Y},S={...i,subject:p,install:(K)=>fx(K,i,o),get:w,set:(K)=>{let M=j(n),Y=w(i.get,M),I=vm(K)(Y);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",Y,"->",I,")"),Zi(M,i.key,I,p),gc(M,i.key),$i(M))p.next({newValue:I,oldValue:Y});i.set(m,I)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,S);let X=w();n.logger.info("\u2728",S.type,S.key,"=",X);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function Jf(n,i){if("set"in i){let p=fx(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=xx(n,i,void 0);return n.on.selectorCreation.next(c),c}function x1(n,i){let o=j(n),{key:c}=i,p=Tn(o,i);if(!p.family)n.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{if(o.molecules.get(p.family.subKey))o.moleculeData.delete(p.family.subKey,p.family.key);let m;switch(i.type){case"selector":o.selectors.delete(c),m={key:p.family.key,type:"selector_family"},Tn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break;case"readonly_selector":o.readonlySelectors.delete(c),m={key:p.family.key,type:"readonly_selector_family"},Tn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),n.logger.info("\uD83D\uDD25",i.type,c,"deleted"),Mn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:i});else n.on.selectorDisposal.next(i)}}function mx(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=fx(J,{key:w,get:i.get(f),set:i.set(f)},$);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(f)=>mx(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:($,w)=>t(n,$,w),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function v1(n,i,o){return mx(n,{key:`${i.key}:JSON`,get:(p)=>({get:x})=>{let m=x(i,p);return o.toJson(m)},set:(p)=>({set:x},m)=>{x(i,p,o.fromJson(m))}},["mutable","json"])}var xi=(n)=>JSON.parse(n),wn=(n)=>JSON.stringify(n),DQ=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var $1=(n,i)=>{let o=j(n);if(o.operation.open)return o.operation.prev.get(i.key);return o.valueMap.get(i.key)};var Mf=(n,i)=>{let o=j(n);return a1(i,n).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${i.key}", not found in store "${n.config.name}".`);return x.subject.subscribe(`${i.type}:${i.key}`,(m)=>{n.logger.info("\uD83D\uDCE2",i.type,i.key,"root",p,"went",m.oldValue,"->",m.newValue);let a=$1(o,i),f=yo(o,i);n.logger.info("\u2728",i.type,i.key,"went",a,"->",f),i.subject.next({newValue:f,oldValue:a})})})};function Xi(n,i,o,c){function p(w){if(n.operation.open){let J=n.on.operationClose.subscribe(`state subscription ${o}`,()=>{J(),c(w)})}else c(w)}let x=Tn(n,i);n.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",a=null,f=p;if(m)a=Mf(n,x),f=(w)=>{if(a)a.length=0,a.push(...Mf(n,x));p(w)};let v=x.subject.subscribe(o,f);return()=>{if(n.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),v(),a)for(let w of a)w()}}var lf=(n,i,o,c)=>{let p=Tn(n,i);n.logger.info("\uD83D\uDC40","timeline",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","timeline",i.key,`Removing subscription "${o}" from timeline`),x()}};var Gf=(n,i,o,c)=>{let p=Tn(n,i);n.logger.info("\uD83D\uDC40","transaction",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","transaction",i.key,`Removing subscription "${o}"`),x()}};class Wc{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=Ac(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${Mn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Gn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Xi(o,n,c,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{On(o,i,m)})})}updateCore(n,i,o){let c=`tracker:${o.config.name}:${Mn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Xi(o,i,c,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let v=lf(o,{key:m,type:"timeline"},c,($)=>{v(),On(o,n,(w)=>{if($==="redo"&&p)w.do(p);else if($==="undo"&&x)w.undo(x);return w})});return}}let a=o.on.operationClose.subscribe(c,()=>{a();let f=Gn(o,n),v=p===null?-1:f.getUpdateNumber(p),$=v-f.cacheUpdateNumber;if(p&&$===1)On(o,n,(w)=>(w.do(p),w));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${f.cacheUpdateNumber+1}, but got ${v}`)})})}mutableState;latestUpdateState;[Symbol.dispose];constructor(n,i){this.mutableState=n;let o=j(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function vx(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=j(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),lo(p);let x=new $n,m={...i,type:"mutable_atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),vx(v,i,o)},subject:x};if(o)m.family=o;let a=i.default();c.atoms.set(m.key,m),Rm(n,i.key),Zi(c,i.key,a,x);let f=lo(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(S)=>{On(n,f,S)},onSet:(S)=>Xi(n,f,`effect[${v}]`,S)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}if(new Wc(f,n),!o)H0(f,i,n);return f}class Yf{trackers=new Map;Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Jc(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=Tn(i,o),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{let{type:p,token:x}=c;if(x.family){let m=xi(x.family.subKey);switch(p){case"state_creation":this.trackers.set(m,new Wc(x,i));break;case"state_disposal":{let a=this.trackers.get(m);if(a)a[Symbol.dispose](),this.trackers.delete(m)}break}}})}}function px(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S={key:w,default:()=>i.default(f),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)S.effects=i.effects(f);let X=vx(J,S,$);return x.next({type:"state_creation",token:X}),X},c,{subject:x,install:(f)=>px(f,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,a),v1(n,a,i),new Yf(a,n),c}var Hf=(n,i)=>{let o=j(i),c=`${n.key}:JSON`;return o.families.get(c)};var ni=(n,i)=>{if(i.family){let c=j(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=Tn(c,x),a=JSON.parse(i.family.subKey);return t(n,m,a)}return{type:"selector",key:`${i.key}:JSON`}};var Uo=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function D0(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function ax(n,i,o){let c=o.valueMap.get(i.key),p=n.valueMap.get(i.key);if(c!==p)return p;if(c===void 0)return i.default();o.logger.info("\uD83D\uDCC3","atom",i.key,"copying");let x=i.toJson(c),m=i.fromJson(x);return n.valueMap.set(i.key,m),new Wc(i,o),m}function Zi(n,i,o,c){let p=n.valueMap.get(i);if(p instanceof cx)p.use(o);if(o instanceof Promise){let x=new cx(o);return n.valueMap.set(i,x),x.then((m)=>{Zi(n,i,m,c),c.next({newValue:m,oldValue:x})}).catch((m)=>{n.logger.error("\uD83D\uDCA5","state",i,"rejected:",m)}),x}return n.valueMap.set(i,o),o}var U0=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Mn(i)){let{parent:c}=i;o=ax(i,n,c)}return o},B0=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof cx){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var L0=(n,i)=>{return j(n).atomsThatAreDefault.has(i)},Rm=(n,i)=>{let o=j(n);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(i)},N0=(n,i)=>{let o=j(n);o.atomsThatAreDefault=new Set(j(n).atomsThatAreDefault),o.atomsThatAreDefault.delete(i)};function Ac(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=j(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),lo(p);let x=new $n,m={...i,type:"atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),Ac(v,i,o)},subject:x};if(o)m.family=o;let a=i.default;if(i.default instanceof Function)a=i.default();c.atoms.set(m.key,m),Rm(n,i.key),Zi(c,i.key,a,x);let f=lo(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(S)=>{On(n,f,S)},onSet:(S)=>Xi(n,f,`effect[${v}]`,S)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}return f}function w1(n,i){if("mutable"in i){let p=vx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Ac(n,i,void 0);return n.on.atomCreation.next(c),c}function Wf(n,i){let o=j(n),{key:c,family:p}=i,x=Tn(o,i);if(!p)n.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{x.cleanup?.();let m=n.valueMap.get(x.key),a=Tn(n,{key:p.key,type:"atom_family"}),f={type:"state_disposal",subType:"atom",token:i,value:m};a.subject.next(f);let v=Mn(o);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),n.timelineTopics.delete(c),i.type==="mutable_atom"){let $=Uo(i);Wf(n,$),n.trackers.delete(c)}if(n.logger.info("\uD83D\uDD25","atom",c,"deleted"),v&&o.transactionMeta.phase==="building"){let $=o.transactionMeta.update.updates.at(-1);if(!($?.type==="molecule_disposal"&&$.values.some(([S])=>S===x.family?.key)))o.transactionMeta.update.updates.push(f)}else n.on.atomDisposal.next(i)}}class oi extends Set{mode="record";subject=new $n;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof oi)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new oi(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${wn(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${wn(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new oi(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let a=!1;while(!a){this.cacheIdx%=this.cacheLimit;let v=this.cache[this.cacheIdx];if(this.cacheIdx--,!v)return"OUT_OF_RANGE";this.undo(v),a=this.cacheIdx===x-1}let f=n.substring(i+1);return this.doStep(f),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class $x{toolkit;options;defaultContent;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;realm;[Symbol.dispose](){}constructor(n,i,o=g.STORE){this.store=o,this.realm=new zf(o),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...G)=>Gn(o,...G),set:(...G)=>{On(o,...G)},find:(...G)=>t(o,...G),json:(G)=>ni(o,G)};let c=n.between[0],p=n.between[1],x=px(o,{key:`${n.key}/relatedKeys`,default:()=>new oi,mutable:!0,fromJson:(G)=>oi.fromJSON(G),toJson:(G)=>G.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:G},z)=>G(x,z),a=({set:G},z,E)=>{if(!this.store.molecules.has(wn(z)))this.realm.allocate(n.key,z);G(x,z,(Q)=>Q.add(E)),G(x,E,(Q)=>Q.add(z))},f=({set:G},z,E)=>{G(x,z,(Q)=>{return Q.delete(E),Q}),G(x,E,(Q)=>{return Q.delete(z),Q})},v=(G,z,E)=>{let{find:Q,get:b,set:y}=G,H=Q(x,z),an=b(H);for(let Z of an){if(E.includes(Z))continue;y(x,Z,(En)=>{return En.delete(z),En})}y(H,(Z)=>{return Z.transaction((fn)=>{fn.clear();for(let En of E){let dn=m(G,En),Vi=dn.has(z);if(this.relations.cardinality==="1:n"){let Oo=[];for(let O of dn){if(O===z)continue;let q=m(G,O);if(q.delete(En),q.size===0)Oo.push(O)}if(!Vi&&dn.size>0)dn.clear();for(let O of Oo){let q=[En,O].sort(),Rn=`"${q[0]}:${q[1]}"`;this.molecules.delete(Rn)}}if(!Vi)dn.add(z);fn.add(En)}return!0}),Z})},$=(G,z,E)=>{let{set:Q}=G;Q(x,z,(b)=>{return b.transaction((y)=>{for(let H of E)y.add(H);return!0}),b});for(let b of E)Q(x,b,(y)=>{return y.add(z),y});return!0},w=(G,z,E)=>{let Q=m(G,z);return E?Q.has(E):Q.size>0},J={getRelatedKeys:(G)=>m(this.toolkit,G),addRelation:(G,z)=>{this.store.moleculeJoins.set(G,n.key),this.store.moleculeJoins.set(z,n.key),a(this.toolkit,G,z)},deleteRelation:(G,z)=>{f(this.toolkit,G,z)},replaceRelationsSafely:(G,z)=>{v(this.toolkit,G,z)},replaceRelationsUnsafely:(G,z)=>{$(this.toolkit,G,z)},has:(G,z)=>w(this.toolkit,G,z)},S,X;if(i){X=Jc(o,{key:`${n.key}/content`,default:i},["join","content"]);let G=({get:Q},b)=>Q(X,b),z=({set:Q},b,y)=>{Q(X,b,y)};S=Object.assign(J,{getContent:(Q)=>{return G(this.toolkit,Q)},setContent:(Q,b)=>{z(this.toolkit,Q,b)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else S=J;let R=new ii(n,{externalStore:S,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...G)=>{let[z,E]=G,Q=G.sort(),b=`${Q[0]}:${Q[1]}`,y=o.molecules.get(wn(z)),H=o.molecules.get(wn(E));if(!y)this.realm.allocate(n.key,z);if(!H)this.realm.allocate(n.key,E);return this.realm.allocate(z,b,"all"),this.realm.claim(E,b),this.store.moleculeJoins.set(b,n.key),b}}),K=()=>Io(o,{key:`${n.key}/singleRelatedKey`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E)return Q;return null}},["join","keys"]),M=()=>{return Io(o,{key:`${n.key}/multipleRelatedKeys`,get:(G)=>({get:z})=>{let E=Hf(x,o);return z(E,G).members}},["join","keys"])},Y=()=>Io(o,{key:`${n.key}/singleRelatedEntry`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E){let b=R.isAType?.(G)?G:void 0,y=b===void 0?G:void 0;b??=Q,y??=Q;let H=R.makeContentKey(b,y),an=z(X,H);return[Q,an]}return null}},["join","entries"]),I=()=>Io(o,{key:`${n.key}/multipleRelatedEntries`,get:(G)=>({get:z})=>{let E=Hf(x,o);return z(E,G).members.map((b)=>{let y=R.isAType?.(G)?G:void 0,H=y===void 0?G:void 0;y??=b,H??=b;let an=R.makeContentKey(y,H),Z=z(X,an);return[b,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let G=K(),z=`${c}KeyOf${Yn(p)}`,E=`${p}KeyOf${Yn(c)}`,Q={[z]:G,[E]:G},b;if(i){let y=Y(),H=`${c}EntryOf${Yn(p)}`,an=`${p}EntryOf${Yn(c)}`,Z={[H]:y,[an]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b;break}case"1:n":{let G=K(),z=M(),E=`${c}KeyOf${Yn(p)}`,Q=`${p}KeysOf${Yn(c)}`,b={[E]:G,[Q]:z},y;if(i){let H=Y(),an=I(),Z=`${c}EntryOf${Yn(p)}`,fn=`${p}EntriesOf${Yn(c)}`,En={[Z]:H,[fn]:an};y=Object.assign(b,En)}else y=b;this.relations=R,this.states=y;break}case"n:n":{let G=M(),z=`${c}KeysOf${Yn(p)}`,E=`${p}KeysOf${Yn(c)}`,Q={[z]:G,[E]:G},b;if(i){let y=I(),H=`${c}EntriesOf${Yn(p)}`,an=`${p}EntriesOf${Yn(c)}`,Z={[H]:y,[an]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b}}}}function np(n,i){let o=i.joins.get(n.key);if(o===void 0){let p=g.STORE.joins.get(n.key);if(p===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o=new $x(p.options,p.defaultContent,i),i.joins.set(n.key,o)}return o}function ko(n,i,o){let c=np(n,o),p=j(o);if(Mn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function ip(n,i,o){let c=np(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Yn(n.b)}`,m=`${n.b}KeyOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntryOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Yn(n.b)}`,m=`${n.b}KeysOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Yn(n.b)}`,m=`${n.b}KeysOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntriesOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}}}return p}function J1(n,i){return np(n,i).core.relatedKeysAtoms}function o1(n){return n.startsWith("\uD83D\uDD0D ")}function Zo(n){return w1(g.STORE,n)}function Kc(n){return z0(g.STORE,n)}function Sm(n,i,o=g.STORE){return o.joins.set(n.key,new $x(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function A1(n){return J1(n,g.STORE)}var Qf=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},v3={error:Qf("error"),info:Qf("info"),warn:Qf("warn")};class Xc{logLevel;filter;logger;constructor(n,i,o=v3){this.logLevel=n,this.filter=i,this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}var xV=Symbol("claim");class F1{store;constructor(n=g.STORE){this.store=n,I0("root",n)}allocate(n,i,o){return Tc(this.store,n,i,o)}fuse(n,i,o){return y0(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){return ec(this.store,n,i,o)}}class zf{store;realm;constructor(n=g.STORE){this.store=n,this.realm=new F1(n)}allocate(n,i,o){Tc(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){ec(this.store,n,i,o)}}function Xm(n){return Q0(g.STORE,n)}function lc(n){return Xf(g.STORE,n)}class T1 extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Wm{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(n){this.key=n}static existing=new T1;static create(n,i){let o=new Wm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),a={type:c,key:n,globals:p,actions:x,perspectives:m};return Wm.existing.set(n,a),a}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function R1(n){let{key:i,config:o}=n,c=Wm.create(i,o),{actions:p}=c;for(let x of p)g0(g.STORE,i,x.key);return t0(g.STORE,i,-1),c}var TV=Zo({key:"usersInRoomIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Ef=Zo({key:"roomIndex",default:()=>new oi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),$3={enteredAtEpoch:0},wx=Sm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},$3),RV=Xm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=A1(wx);return[i(o,n)]}});import{spawn as w3}from"node:child_process";class op{listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";emit;constructor(n){this.emit=n,this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class Jx extends op{incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";process;key;logger;handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(...o);break;case"w":this.logger.warn(...o);break;case"e":this.logger.error(...o);break;default:return}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(a)=>{if(a.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",m)};return this.process.stdin.once("error",m),this.process.stdin.write(x),this});if(this.process=n,this.key=i,this.logger=o??{info:(...c)=>{console.info(this.id,this.key,...c)},warn:(...c)=>{console.warn(this.id,this.key,...c)},error:(...c)=>{console.error(this.id,this.key,...c)}},this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=xi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let a=this.unprocessedEvents.shift();if(a){if(this.unprocessedEvents.length===0)this.incompleteData=a;m=xi(a),this.handleEvent(...m)}}this.incompleteData=""}catch(m){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(m)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let m=xi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=xi(this.incompleteLog),this.handleLog(m)}catch(m){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(m),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class S1 extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new $n,this.out=new $n,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Of extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(wn(n.map((i)=>i instanceof oi?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=xi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let x=xi(p);this.handleEvent(...x)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new S1(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Uf=Kc({key:"roomArguments",default:["echo",["Hello World!"]]}),X1=Xm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Uf,n),p=i(c),[x,m]=p,a=await new Promise((f)=>{let v=w3(x,m,{env:process.env}),$=(w)=>{if(w.toString()==="ALIVE")v.stdout.off("data",$),f(v)};v.stdout.on("data",$)});return new Jx(a,n)}});var yV=lc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],a=o(Uf,c);i(a,m),i(Ef,($)=>$.add(c));let f=o(X1,c);return n(f)}}),kV=lc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return ko(wx,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),ZV=lc({key:"leaveRoom",do:(n,i,o)=>{ko(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),qV=lc({key:"destroyRoom",do:(n,i)=>{ko(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(Ef,(o)=>(o.delete(i),o))}});function Vf(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Vf(n,o.updates);return{...o,updates:c}}case"atom_update":case"selector_update":case"molecule_creation":case"molecule_disposal":case"molecule_transfer":case"state_creation":case"state_disposal":return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":case"state_disposal":return n.includes(o.token.key);case"molecule_creation":case"transaction_update":case"molecule_disposal":case"molecule_transfer":return!0}})}var tV=Kc({key:"redactor",default:{occlude:(n)=>n}}),cp=Kc({key:"unacknowledgedUpdates",default:()=>[]});var Km=Kc({key:"sockets",default:null}),_f=Zo({key:"socketsIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),bf=Zo({key:"usersIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Gc=Sm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function W1(n,i,o,c){let p=i.key;return function x(){let m=[];for(let f of i.globals){let v=f.type==="mutable_atom"?ni(n,f):f,$=Gn(n,v);m.push(v,$)}for(let f of i.perspectives){let{viewAtoms:v,resourceAtoms:$}=f,w=t(n,v,o),J=Gn(n,w);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:v,resourceAtoms:$,userView:J});for(let S of J){let X=S.type==="mutable_atom"?ni(n,S):S,R=Gn(n,X);m.push(X,R)}}let a=$i(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,a,m)}}function K1(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:m,id:a}=x,f=`tx-run:${m}:${a}`,v=`${f}:start`,$=`${f}:end`;performance.mark(v);try{dc(n,{type:"transaction",key:m},a)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${a}`,J.message)}performance.mark($);let w=performance.measure(f,v,$);n?.logger.info("\uD83D\uDE80","transaction",m,a,o,w.duration)}}function l1(n,i,o,c){let p=i.key;return function x(m){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${m}`),c[0]?.epoch===m)On(n,cp,o,(f)=>{return f.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,f.length,"items"),f})}}function G1(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let a=Gf(n,m,`sync-continuity:${p}:${o}`,(f)=>{try{let v=i.globals.map((J)=>{if(J.type==="atom")return J.key;return Uo(J).key}).concat(i.perspectives.flatMap((J)=>{let{viewAtoms:S}=J,X=t(n,S,o);return Gn(n,X).map((K)=>{return K.type==="mutable_atom"?"*"+K.key:K.key})})),$=Vf(v,f.updates),w={...f,updates:$};On(n,cp,o,(J)=>{if(w)J.push(w),J.sort((S,X)=>S.epoch-X.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,J.length,"items");return J}),c?.emit(`tx-new:${p}`,w)}catch(v){if(v instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,v.message)}});x.push(a)}return x}function M1(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:a}=m,f=t(n,a,o),v=Xi(n,f,`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,({oldValue:$,newValue:w})=>{let J=$.map((K)=>K.key),S=w.map((K)=>K.key),X=$.filter((K)=>!S.includes(K.key)),R=w.filter((K)=>!J.includes(K.key)).flatMap((K)=>{let M=K.type==="mutable_atom"?ni(n,K):K,Y=Gn(n,M);return[M,Y]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:S,revealed:R,concealed:X}),R.length>0)c?.emit(`reveal:${p}`,R);if(X.length>0)c?.emit(`conceal:${p}`,X)});x.push(v)}return x}function Y1({socket:n,store:i=g.STORE}){return function o(c){let p=n,x=c.key,m=ip(Gc,`socket::${p.id}`,i).userKeyOfSocket,a=Gn(i,m);if(!a)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let f=ip(Gc,a,i).socketKeyOfUser,v=Xi(i,f,`sync-continuity:${x}:${a}`,({newValue:M})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${a} on new socket ${M}`),M===null){i.logger.warn("\u274C","continuity",x,`User (${a}) is not connected to a socket, waiting for them to reappear.`);return}let Y=t(i,Km,M);p=Gn(i,Y);for(let G of $)p?.emit(`tx-new:${x}`,G)}),$=Gn(i,cp,a),w=[],J=M1(i,c,a,p),S=G1(i,c,a,p);w.push(...J,...S);let X=W1(i,c,a,n);p.off(`get:${x}`,X),p.on(`get:${x}`,X);let R=K1(i,c,a);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let K=l1(i,c,a,$);return p?.on(`ack:${x}`,K),()=>{for(let M of w)M();p?.off(`ack:${x}`,K),p?.off(`get:${x}`,X),p?.off(`tx-run:${x}`,R)}}}var mS=wf($v(),1);var F=Symbol.for("drizzle:entityKind"),mb=Symbol.for("drizzle:hasOwnEntityKind");function l(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,F))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(F in o&&o[F]===i[F])return!0;o=Object.getPrototypeOf(o)}return!1}class Un{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[F]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class wv{static[F]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var fo=Symbol.for("drizzle:Name");class Jv{static[F]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new lJ(n,this)}}class lJ{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[F]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((m)=>m.name),p=o.map((m)=>m.name),x=[this.table[fo],...c,o[0].table[fo],...p];return n??`${x.join("_")}_fk`}}function Im(n,...i){return n(...i)}function GJ(n,i){return`${n[fo]}_${i.join("_")}_unique`}function MJ(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function YJ(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[f,v]=MJ(n,c+1,!0);o.push(f),c=v;continue}if(x==="}")return[o,c+1];if(x==="{"){let[f,v]=YJ(n,c+1);o.push(f),c=v;continue}let[m,a]=MJ(n,c,!1);o.push(m),c=a}return[o,c]}function HJ(n){let[i]=YJ(n,1);return i}function Av(n){return`{${n.map((i)=>{if(Array.isArray(i))return Av(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class h extends wv{foreignKeyConfigs=[];static[F]="PgColumnBuilder";array(n){return new QJ(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return Im((p,x)=>{let m=new Jv(()=>{let a=p();return{columns:[n],foreignColumns:[a]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new zJ(n,this.config)}}class V extends Un{constructor(n,i){if(!i.uniqueName)i.uniqueName=GJ(n,[i.name]);super(n,i);this.table=n}static[F]="PgColumn"}class zJ extends V{static[F]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class Yx{static[F]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class QJ extends h{static[F]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new Fv(n,this.config,i)}}class Fv extends V{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[F]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=HJ(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:l(this.baseColumn,Fv)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return Av(o)}}var Tv=Symbol.for("drizzle:isPgEnum");function EJ(n){return!!n&&typeof n==="function"&&Tv in n&&n[Tv]===!0}class OJ extends h{static[F]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new UJ(n,this.config)}}class UJ extends V{static[F]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function ym(n,i){return VX(n,i,void 0)}function VX(n,i,o){let c=Object.assign((p)=>new OJ(p??"",c),{enumName:n,enumValues:i,schema:o,[Tv]:!0});return c}class ci{static[F]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Hx extends ci{static[F]="WithSubquery"}var VJ="0.41.0";var Rv,Sv,Vn={startActiveSpan(n,i){if(!Rv)return i();if(!Sv)Sv=Rv.trace.getTracer("drizzle-orm",VJ);return Im((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Rv,Sv)}};var un=Symbol.for("drizzle:ViewBaseConfig");var km=Symbol.for("drizzle:Schema"),Zm=Symbol.for("drizzle:Columns"),_J=Symbol.for("drizzle:ExtraConfigColumns"),Xv=Symbol.for("drizzle:OriginalName"),Wv=Symbol.for("drizzle:BaseName"),zx=Symbol.for("drizzle:IsAlias"),bJ=Symbol.for("drizzle:ExtraConfigBuilder"),_X=Symbol.for("drizzle:IsDrizzleTable");class D{static[F]="Table";static Symbol={Name:fo,Schema:km,OriginalName:Xv,Columns:Zm,ExtraConfigColumns:_J,BaseName:Wv,IsAlias:zx,ExtraConfigBuilder:bJ};[fo];[Xv];[km];[Zm];[_J];[Wv];[zx]=!1;[_X]=!0;[bJ]=void 0;constructor(n,i,o){this[fo]=this[Xv]=n,this[km]=i,this[Wv]=o}}function mi(n){return n[fo]}function Ec(n){return`${n[km]??"public"}.${n[fo]}`}function Kv(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function bX(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class pi{static[F]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new L([this])}}class L{constructor(n){this.queryChunks=n}static[F]="SQL";decoder=BJ;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Vn.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:x,prepareTyping:m,inlineParams:a,paramStartIndex:f}=o;return bX(n.map((v)=>{if(l(v,pi))return{sql:v.value.join(""),params:[]};if(l(v,qm))return{sql:p(v.value),params:[]};if(v===void 0)return{sql:"",params:[]};if(Array.isArray(v)){let $=[new pi("(")];for(let[w,J]of v.entries())if($.push(J),w<v.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(l(v,L))return this.buildQueryFromSourceParams(v.queryChunks,{...o,inlineParams:a||v.shouldInlineParams});if(l(v,D)){let $=v[D.Symbol.Schema],w=v[D.Symbol.Name];return{sql:$===void 0||v[zx]?p(w):p($)+"."+p(w),params:[]}}if(l(v,Un)){let $=c.getColumnCasing(v);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let w=v.table[D.Symbol.Schema];return{sql:v.table[zx]||w===void 0?p(v.table[D.Symbol.Name])+"."+p($):p(w)+"."+p(v.table[D.Symbol.Name])+"."+p($),params:[]}}if(l(v,bi)){let $=v[un].schema,w=v[un].name;return{sql:$===void 0||v[un].isAlias?p(w):p($)+"."+p(w),params:[]}}if(l(v,Li)){if(l(v.value,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};let $=v.value===null?null:v.encoder.mapToDriverValue(v.value);if(l($,L))return this.buildQueryFromSourceParams([$],o);if(a)return{sql:this.mapInlineParam($,o),params:[]};let w=["none"];if(m)w=[m(v.encoder)];return{sql:x(f.value++,$),params:[$],typings:w}}if(l(v,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};if(l(v,L.Aliased)&&v.fieldAlias!==void 0)return{sql:p(v.fieldAlias),params:[]};if(l(v,ci)){if(v._.isWith)return{sql:p(v._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),v._.sql,new pi(") "),new qm(v._.alias)],o)}if(EJ(v)){if(v.schema)return{sql:p(v.schema)+"."+p(v.enumName),params:[]};return{sql:p(v.enumName),params:[]}}if(Kv(v)){if(v.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([v.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),v.getSQL(),new pi(")")],o)}if(a)return{sql:this.mapInlineParam(v,o),params:[]};return{sql:x(f.value++,v),params:[v],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new L.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class qm{constructor(n){this.value=n}static[F]="Name";brand;getSQL(){return new L([this])}}function uJ(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var BJ={mapFromDriverValue:(n)=>n},jJ={mapToDriverValue:(n)=>n},Pb={...BJ,...jJ};class Li{constructor(n,i=jJ){this.value=n,this.encoder=i}static[F]="Param";brand;getSQL(){return new L([this])}}function T(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new pi(n[0]));for(let[c,p]of i.entries())o.push(p,new pi(n[c+1]));return new L(o)}((n)=>{function i(){return new L([])}n.empty=i;function o(f){return new L(f)}n.fromList=o;function c(f){return new L([new pi(f)])}n.raw=c;function p(f,v){let $=[];for(let[w,J]of f.entries()){if(w>0&&v!==void 0)$.push(v);$.push(J)}return new L($)}n.join=p;function x(f){return new qm(f)}n.identifier=x;function m(f){return new go(f)}n.placeholder=m;function a(f,v){return new Li(f,v)}n.param=a})(T||(T={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[F]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(L||(L={}));class go{constructor(n){this.name=n}static[F]="Placeholder";getSQL(){return new L([this])}}function lv(n,i){return n.map((o)=>{if(l(o,go)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(l(o,Li)&&l(o.value,go)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}var uX=Symbol.for("drizzle:IsDrizzleView");class bi{static[F]="View";[un];[uX]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[un]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new L([this])}}Un.prototype.getSQL=function(){return new L([this])};D.prototype.getSQL=function(){return new L([this])};ci.prototype.getSQL=function(){return new L([this])};class Sp{constructor(n){this.table=n}static[F]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Qx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[F]="TableAliasProxyHandler";get(n,i){if(i===D.Symbol.IsAlias)return!0;if(i===D.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===D.Symbol.OriginalName)return this.alias;if(i===un)return{...n[un],name:this.alias,isAlias:!0};if(i===D.Symbol.Columns){let c=n[D.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((x)=>{p[x]=new Proxy(c[x],new Sp(new Proxy(n,this)))}),p}let o=n[i];if(l(o,Un))return new Proxy(o,new Sp(new Proxy(n,this)));return o}}function sm(n,i){return new Proxy(n,new Qx(i,!1))}function Mo(n,i){return new Proxy(n,new Sp(new Proxy(n.table,new Qx(i,!1))))}function Gv(n,i){return new L.Aliased(Ex(n.sql,i),n.fieldAlias)}function Ex(n,i){return T.join(n.queryChunks.map((o)=>{if(l(o,Un))return Mo(o,i);if(l(o,L))return Ex(o,i);if(l(o,L.Aliased))return Gv(o,i);return o}))}class Pm extends Error{static[F]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Mv extends Pm{static[F]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function ui(n,i){if(uJ(i)&&!Kv(n)&&!l(n,Li)&&!l(n,go)&&!l(n,Un)&&!l(n,D)&&!l(n,bi))return new Li(n,i);return n}var Yo=(n,i)=>{return T`${n} = ${ui(i,n)}`},DJ=(n,i)=>{return T`${n} <> ${ui(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new L(i);return new L([new pi("("),T.join(i,new pi(" and ")),new pi(")")])}function LJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new L(i);return new L([new pi("("),T.join(i,new pi(" or ")),new pi(")")])}function NJ(n){return T`not ${n}`}var tm=(n,i)=>{return T`${n} > ${ui(i,n)}`},hJ=(n,i)=>{return T`${n} >= ${ui(i,n)}`},CJ=(n,i)=>{return T`${n} < ${ui(i,n)}`},IJ=(n,i)=>{return T`${n} <= ${ui(i,n)}`};function yJ(n,i){if(Array.isArray(i)){if(i.length===0)return T`false`;return T`${n} in ${i.map((o)=>ui(o,n))}`}return T`${n} in ${ui(i,n)}`}function kJ(n,i){if(Array.isArray(i)){if(i.length===0)return T`true`;return T`${n} not in ${i.map((o)=>ui(o,n))}`}return T`${n} not in ${ui(i,n)}`}function ZJ(n){return T`${n} is null`}function qJ(n){return T`${n} is not null`}function sJ(n){return T`exists ${n}`}function PJ(n){return T`not exists ${n}`}function tJ(n,i,o){return T`${n} between ${ui(i,n)} and ${ui(o,n)}`}function rJ(n,i,o){return T`${n} not between ${ui(i,n)} and ${ui(o,n)}`}function dJ(n,i){return T`${n} like ${i}`}function gJ(n,i){return T`${n} not like ${i}`}function eJ(n,i){return T`${n} ilike ${i}`}function nA(n,i){return T`${n} not ilike ${i}`}function iA(n){return T`${n} asc`}function oA(n){return T`${n} desc`}class cA{static[F]="ConsoleLogWriter";write(n){console.log(n)}}class Yv{static[F]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new cA}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class Hv{static[F]="NoopLogger";logQuery(){}}class Qi{static[F]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function pA(n,i,o){let c={},p=n.reduce((x,{path:m,field:a},f)=>{let v;if(l(a,Un))v=a;else if(l(a,L))v=a.decoder;else v=a.sql.decoder;let $=x;for(let[w,J]of m.entries())if(w<m.length-1){if(!(J in $))$[J]={};$=$[J]}else{let S=i[f],X=$[J]=S===null?null:v.mapFromDriverValue(S);if(o&&l(a,Un)&&m.length===2){let R=m[0];if(!(R in c))c[R]=X===null?mi(a.table):!1;else if(typeof c[R]==="string"&&c[R]!==mi(a.table))c[R]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[x]=null}return p}function di(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(l(p,Un)||l(p,L)||l(p,L.Aliased))o.push({path:x,field:p});else if(l(p,D))o.push(...di(p[D.Symbol.Columns],x));else o.push(...di(p,x));return o},[])}function Ox(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function rm(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(l(p,L)||l(p,Un))return[c,p];else return[c,new Li(p,n[D.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function xA(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function mA(n){return n[D.Symbol.Columns]}function _o(n){return l(n,ci)?n._.alias:l(n,bi)?n[un].name:l(n,L)?void 0:n[D.Symbol.IsAlias]?n[D.Symbol.Name]:n[D.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function aA(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.schema;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.casing;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="function"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class eo extends h{static[F]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class fA extends eo{static[F]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new vA(n,this.config)}}class vA extends V{static[F]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class $A extends eo{static[F]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new wA(n,this.config)}}class wA extends V{static[F]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function JA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new fA(o);return new $A(o)}class AA extends h{static[F]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new FA(n,this.config)}}class FA extends V{static[F]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class TA extends h{static[F]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new RA(n,this.config)}}class RA extends V{static[F]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function SA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new AA(o);return new TA(o)}class XA extends h{static[F]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new WA(n,this.config)}}class WA extends V{static[F]="PgBoolean";getSQLType(){return"boolean"}}function Ux(n){return new XA(n??"")}class KA extends h{static[F]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new lA(n,this.config)}}class lA extends V{static[F]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function GA(n,i={}){let{name:o,config:c}=Jn(n,i);return new KA(o,c)}class MA extends h{static[F]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new YA(n,this.config)}}class YA extends V{static[F]="PgCidr";getSQLType(){return"cidr"}}function HA(n){return new MA(n??"")}class zA extends h{static[F]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new QA(n,this.config)}}class QA extends V{static[F]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function EA(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new zA(c,p,n)}}class bo extends h{static[F]="PgDateColumnBaseBuilder";defaultNow(){return this.default(T`now()`)}}class OA extends bo{static[F]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new dm(n,this.config)}}class dm extends V{static[F]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class UA extends bo{static[F]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new gm(n,this.config)}}class gm extends V{static[F]="PgDateString";getSQLType(){return"date"}}function VA(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new OA(o);return new UA(o)}class _A extends h{static[F]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new bA(n,this.config)}}class bA extends V{static[F]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function uA(n){return new _A(n??"")}class BA extends h{static[F]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new jA(n,this.config)}}class jA extends V{static[F]="PgInet";getSQLType(){return"inet"}}function DA(n){return new BA(n??"")}class LA extends eo{static[F]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new NA(n,this.config)}}class NA extends V{static[F]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function em(n){return new LA(n??"")}class hA extends h{static[F]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new CA(n,this.config)}}class CA extends V{static[F]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function IA(n,i={}){let{name:o,config:c}=Jn(n,i);return new hA(o,c)}class yA extends h{static[F]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new na(n,this.config)}}class na extends V{static[F]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function kA(n){return new yA(n??"")}class ZA extends h{static[F]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new ia(n,this.config)}}class ia extends V{static[F]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function qA(n){return new ZA(n??"")}class sA extends h{static[F]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new PA(n,this.config)}}class PA extends V{static[F]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class tA extends h{static[F]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new rA(n,this.config)}}class rA extends V{static[F]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function dA(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new sA(o);return new tA(o)}class gA extends h{static[F]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new eA(n,this.config)}}class eA extends V{static[F]="PgMacaddr";getSQLType(){return"macaddr"}}function nF(n){return new gA(n??"")}class iF extends h{static[F]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new oF(n,this.config)}}class oF extends V{static[F]="PgMacaddr8";getSQLType(){return"macaddr8"}}function cF(n){return new iF(n??"")}class pF extends h{static[F]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new oa(n,this.config)}}class oa extends V{static[F]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue(n){if(typeof n==="string")return n;return String(n)}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}class xF extends h{static[F]="PgNumericNumberBuilder";constructor(n,i,o){super(n,"number","PgNumericNumber");this.config.precision=i,this.config.scale=o}build(n){return new mF(n,this.config)}}class mF extends V{static[F]="PgNumericNumber";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}mapToDriverValue=String;getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}class aF extends h{static[F]="PgNumericBigIntBuilder";constructor(n,i,o){super(n,"bigint","PgNumericBigInt");this.config.precision=i,this.config.scale=o}build(n){return new fF(n,this.config)}}class fF extends V{static[F]="PgNumericBigInt";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function vF(n,i){let{name:o,config:c}=Jn(n,i),p=c?.mode;return p==="number"?new xF(o,c?.precision,c?.scale):p==="bigint"?new aF(o,c?.precision,c?.scale):new pF(o,c?.precision,c?.scale)}class $F extends h{static[F]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new wF(n,this.config)}}class wF extends V{static[F]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class JF extends h{static[F]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new AF(n,this.config)}}class AF extends V{static[F]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function FF(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new $F(o);return new JF(o)}function BX(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function TF(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function zv(n){let i=BX(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let m;if(x&536870912)m=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let a=TF(i,o);o+=8;let f=TF(i,o);return o+=8,[a,f]}throw new Error("Unsupported geometry type")}class RF extends h{static[F]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new SF(n,this.config)}}class SF extends V{static[F]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return zv(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class XF extends h{static[F]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new WF(n,this.config)}}class WF extends V{static[F]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=zv(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function KF(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new RF(o);return new XF(o)}class lF extends h{static[F]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new GF(n,this.config)}}class GF extends V{static[F]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function MF(n){return new lF(n??"")}class YF extends h{static[F]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new HF(n,this.config)}}class HF extends V{static[F]="PgSerial";getSQLType(){return"serial"}}function zF(n){return new YF(n??"")}class QF extends eo{static[F]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new EF(n,this.config)}}class EF extends V{static[F]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function OF(n){return new QF(n??"")}class UF extends h{static[F]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new VF(n,this.config)}}class VF extends V{static[F]="PgSmallSerial";getSQLType(){return"smallserial"}}function _F(n){return new UF(n??"")}class bF extends h{static[F]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new uF(n,this.config)}}class uF extends V{static[F]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function BF(n,i={}){let{name:o,config:c}=Jn(n,i);return new bF(o,c)}class jF extends bo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[F]="PgTimeBuilder";build(n){return new ca(n,this.config)}}class ca extends V{static[F]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function DF(n,i={}){let{name:o,config:c}=Jn(n,i);return new jF(o,c.withTimezone??!1,c.precision)}class LF extends bo{static[F]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new pa(n,this.config)}}class pa extends V{static[F]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class NF extends bo{static[F]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new xa(n,this.config)}}class xa extends V{static[F]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function vo(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new NF(o,c.withTimezone??!1,c.precision);return new LF(o,c?.withTimezone??!1,c?.precision)}class hF extends h{static[F]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(T`gen_random_uuid()`)}build(n){return new ma(n,this.config)}}class ma extends V{static[F]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new hF(n??"")}class CF extends h{static[F]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new IF(n,this.config)}}class IF extends V{static[F]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function Ji(n,i={}){let{name:o,config:c}=Jn(n,i);return new CF(o,c)}class yF extends h{static[F]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new kF(n,this.config)}}class kF extends V{static[F]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function ZF(n,i){let{name:o,config:c}=Jn(n,i);return new yF(o,c)}class qF extends h{static[F]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new sF(n,this.config)}}class sF extends V{static[F]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function PF(n,i){let{name:o,config:c}=Jn(n,i);return new qF(o,c)}class tF extends h{static[F]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new rF(n,this.config)}}class rF extends V{static[F]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function dF(n,i){let{name:o,config:c}=Jn(n,i);return new tF(o,c)}class gF extends h{static[F]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new eF(n,this.config)}}class eF extends V{static[F]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function nT(n,i){let{name:o,config:c}=Jn(n,i);return new gF(o,c)}function iT(){return{bigint:JA,bigserial:SA,boolean:Ux,char:GA,cidr:HA,customType:EA,date:VA,doublePrecision:uA,inet:DA,integer:em,interval:IA,json:kA,jsonb:qA,line:dA,macaddr:nF,macaddr8:cF,numeric:vF,point:FF,geometry:KF,real:MF,serial:zF,smallint:OF,smallserial:_F,text:BF,time:DF,timestamp:vo,uuid:Ni,varchar:Ji,bit:ZF,halfvec:PF,sparsevec:dF,vector:nT}}var Qv=Symbol.for("drizzle:PgInlineForeignKeys"),oT=Symbol.for("drizzle:EnableRLS");class Ai extends D{static[F]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:Qv,EnableRLS:oT});[Qv]=[];[oT]=!1;[D.Symbol.ExtraConfigBuilder]=void 0;[D.Symbol.ExtraConfigColumns]={}}function jX(n,i,o,c,p=n){let x=new Ai(n,c,p),m=typeof i==="function"?i(iT()):i,a=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let S=J.build(x);return x[Qv].push(...J.buildForeignKeys(S,x)),[$,S]})),f=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let S=J.buildExtraConfigColumn(x);return[$,S]})),v=Object.assign(x,a);if(v[D.Symbol.Columns]=a,v[D.Symbol.ExtraConfigColumns]=f,o)v[Ai.Symbol.ExtraConfigBuilder]=o;return Object.assign(v,{enableRLS:()=>{return v[Ai.Symbol.EnableRLS]=!0,v}})}var nc=(n,i,o)=>{return jX(n,i,o,void 0)};function cT(...n){if(n[0].columns)return new Vx(n[0].columns,n[0].name);return new Vx(n)}class Vx{static[F]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new pT(n,this.columns,this.name)}}class pT{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[F]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[Ai.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class Ev{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[D.Symbol.Name]}static[F]="Relation";referencedTableName;fieldName}class xT{constructor(n,i){this.table=n,this.config=i}static[F]="Relations"}class ic extends Ev{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[F]="One";withFieldName(n){let i=new ic(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class _x extends Ev{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[F]="Many";withFieldName(n){let i=new _x(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function mT(){return{and:Oc,between:tJ,eq:Yo,exists:sJ,gt:tm,gte:hJ,ilike:eJ,inArray:yJ,isNull:ZJ,isNotNull:qJ,like:dJ,lt:CJ,lte:IJ,ne:DJ,not:NJ,notBetween:rJ,notExists:PJ,notLike:gJ,notIlike:nA,notInArray:kJ,or:LJ,sql:T}}function aT(){return{sql:T,asc:iA,desc:oA}}function fT(n,i){if(Object.keys(n).length===1&&"default"in n&&!l(n.default,D))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(l(m,D)){let a=Ec(m),f=c[a];o[a]=x,p[x]={tsName:x,dbName:m[D.Symbol.Name],schema:m[D.Symbol.Schema],columns:m[D.Symbol.Columns],relations:f?.relations??{},primaryKey:f?.primaryKey??[]};for(let $ of Object.values(m[D.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let v=m[D.Symbol.ExtraConfigBuilder]?.(m[D.Symbol.ExtraConfigColumns]);if(v){for(let $ of Object.values(v))if(l($,Vx))p[x].primaryKey.push(...$.columns)}}else if(l(m,xT)){let a=Ec(m.table),f=o[a],v=m.config(i(m.table)),$;for(let[w,J]of Object.entries(v))if(f){let S=p[f];if(S.relations[w]=J,$)S.primaryKey.push(...$)}else{if(!(a in c))c[a]={relations:{},primaryKey:$};c[a].relations[w]=J}}return{tables:p,tableNamesMap:o}}function DX(n){return function i(o,c){return new ic(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function LX(n){return function i(o,c){return new _x(n,o,c)}}function vT(n,i,o){if(l(o,ic)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Ec(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[D.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let x=o.sourceTable,m=i[Ec(x)];if(!m)throw new Error(`Table "${x[D.Symbol.Name]}" not found in schema`);let a=[];for(let f of Object.values(p.relations))if(o.relationName&&o!==f&&f.relationName===o.relationName||!o.relationName&&f.referencedTable===o.sourceTable)a.push(f);if(a.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[D.Symbol.Name]}". Please specify relation name`);if(a[0]&&l(a[0],ic)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function $T(n){return{one:DX(n),many:LX(n)}}function aa(n,i,o,c,p=(x)=>x){let x={};for(let[m,a]of c.entries())if(a.isJson){let f=i.relations[a.tsKey],v=o[m],$=typeof v==="string"?JSON.parse(v):v;x[a.tsKey]=l(f,ic)?$&&aa(n,n[a.relationTableTsKey],$,a.selection,p):$.map((w)=>aa(n,n[a.relationTableTsKey],w,a.selection,p))}else{let f=p(o[m]),v=a.field,$;if(l(v,Un))$=v;else if(l(v,L))$=v.decoder;else $=v.sql.decoder;x[a.tsKey]=f===null?null:$.mapFromDriverValue(f)}return x}var g6=wf(d6(),1),{Server:e6,Namespace:tL,Socket:rL}=g6.default;import{readFileSync as FR}from"node:fs";import{resolve as E$}from"node:path";function u9(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],a=x["~standard"].validate(m);if(a instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(a.issues){c.push(...a.issues.map((f)=>({...f,path:[p,...f.path??[]]})));continue}o[p]=a.value}if(c.length)return{issues:c};return{value:o}}function nR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[Y,I]of Object.entries(i))if(I==="")delete i[Y]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},a=n.isServer??(typeof window==="undefined"||("Deno"in window)),f=a?{...x,...m,...p}:{...p,...m},v=u9(f,i),$=n.onValidationError??((Y)=>{throw console.error("\u274C Invalid environment variables:",Y),new Error("Invalid environment variables")}),w=n.onInvalidAccess??(()=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(v.issues)return $(v.issues);let J=(Y)=>{if(!n.clientPrefix)return!0;return!Y.startsWith(n.clientPrefix)&&!(Y in m)},S=(Y)=>{return a||!J(Y)},X=(Y)=>{return Y==="__esModule"||Y==="$$typeof"},R=(n.extends??[]).reduce((Y,I)=>{return Object.assign(Y,I)},{}),K=Object.assign(v.value,R);return new Proxy(K,{get(Y,I){if(typeof I!=="string")return;if(X(I))return;if(!S(I))return w(I);return Reflect.get(Y,I)}})}var Fn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let x={};for(let m of p)x[m]=m;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((a)=>typeof p[p[a]]!=="number"),m={};for(let a of x)m[a]=p[a];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))x.push(m);return x},n.find=(p,x)=>{for(let m of p)if(x(m))return m;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,x=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Fn||(Fn={}));var Y$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Y$||(Y$={}));var N=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Lo=(n)=>{switch(typeof n){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(n)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(n))return N.array;if(n===null)return N.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return N.promise;if(typeof Map!=="undefined"&&n instanceof Map)return N.map;if(typeof Set!=="undefined"&&n instanceof Set)return N.set;if(typeof Date!=="undefined"&&n instanceof Date)return N.date;return N.object;default:return N.unknown}},U=Fn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),B9=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class yi extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let m=o,a=0;while(a<x.path.length){let f=x.path[a];if(a!==x.path.length-1)m[f]=m[f]||{_errors:[]};else m[f]=m[f]||{_errors:[]},m[f]._errors.push(i(x));m=m[f],a++}}};return c(this),o}static assert(n){if(!(n instanceof yi))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}yi.create=(n)=>{return new yi(n)};var Bp=(n,i)=>{let o;switch(n.code){case U.invalid_type:if(n.received===N.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Fn.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:o=`Unrecognized key(s) in object: ${Fn.joinValues(n.keys,", ")}`;break;case U.invalid_union:o="Invalid input";break;case U.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Fn.joinValues(n.options)}`;break;case U.invalid_enum_value:o=`Invalid enum value. Expected ${Fn.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:o="Invalid function arguments";break;case U.invalid_return_type:o="Invalid function return type";break;case U.invalid_date:o="Invalid date";break;case U.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Fn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case U.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case U.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case U.custom:o="Invalid input";break;case U.invalid_intersection_types:o="Intersection results could not be merged";break;case U.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:o="Number must be finite";break;default:o=i.defaultError,Fn.assertNever(n)}return{message:o}},pR=Bp;function j9(n){pR=n}function ua(){return pR}var Ba=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],m={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let a="",f=c.filter((v)=>!!v).slice().reverse();for(let v of f)a=v(m,{data:i,defaultError:a}).message;return{...p,path:x,message:a}},D9=[];function B(n,i){let o=ua(),c=Ba({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===Bp?void 0:Bp].filter((p)=>!!p)});n.common.issues.push(c)}class Yi{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return d;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,x=await c.value;o.push({key:p,value:x})}return Yi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return d;if(x.status==="aborted")return d;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var d=Object.freeze({status:"aborted"}),bp=(n)=>({status:"dirty",value:n}),Oi=(n)=>({status:"valid",value:n}),H$=(n)=>n.status==="aborted",z$=(n)=>n.status==="dirty",Lc=(n)=>n.status==="valid",Ix=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function ja(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function xR(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var k;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(k||(k={}));var hx,Cx;class Ro{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var iR=(n,i)=>{if(Lc(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new yi(n.common.issues);return this._error=o,this._error}}}};function cn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(m,a)=>{var f,v;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:a.defaultError};if(typeof a.data==="undefined")return{message:(f=$!==null&&$!==void 0?$:c)!==null&&f!==void 0?f:a.defaultError};if(m.code!=="invalid_type")return{message:a.defaultError};return{message:(v=$!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:a.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return Lo(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Lo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Yi,ctx:{common:n.parent.common,data:n.data,parsedType:Lo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(Ix(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)},p=this._parseSync({data:n,path:c.path,parent:c});return iR(c,p)}"~validate"(n){var i,o;let c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Lc(p)?{value:p.value}:{issues:c.common.issues}}catch(p){if((o=(i=p===null||p===void 0?void 0:p.message)===null||i===void 0?void 0:i.toLowerCase())===null||o===void 0?void 0:o.includes("encountered"))this["~standard"].async=!0;c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then((p)=>Lc(p)?{value:p.value}:{issues:c.common.issues})}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(Ix(c)?c:Promise.resolve(c));return iR(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let x=n(c),m=()=>p.addIssue({code:U.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((a)=>{if(!a)return m(),!1;else return!0});if(!x)return m(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new io({schema:this,typeName:r.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return To.create(this,this._def)}nullable(){return No.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fo.create(this)}promise(){return Ic.create(this,this._def)}or(n){return Np.create([this,n],this._def)}and(n){return hp.create(this,n,this._def)}transform(n){return new io({...cn(this._def),schema:this,typeName:r.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new kp({...cn(this._def),innerType:this,defaultValue:i,typeName:r.ZodDefault})}brand(){return new La({typeName:r.ZodBranded,type:this,...cn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Zp({...cn(this._def),innerType:this,catchValue:i,typeName:r.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return Px.create(this,n)}readonly(){return qp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var L9=/^c[^\s-]{8,}$/i,N9=/^[0-9a-z]+$/,h9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,I9=/^[a-z0-9_-]{21}$/i,y9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,k9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,q9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",M$,s9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,P9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,t9=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r9=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,d9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,g9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",e9=new RegExp(`^${mR}$`);function aR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function nG(n){return new RegExp(`^${aR(n)}$`)}function fR(n){let i=`${mR}T${aR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}$`)}function iG(n,i){if((i==="v4"||!i)&&s9.test(n))return!0;if((i==="v6"||!i)&&t9.test(n))return!0;return!1}function oG(n,i){if(!y9.test(n))return!1;try{let[o]=n.split("."),c=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),p=JSON.parse(atob(c));if(typeof p!=="object"||p===null)return!1;if(!p.typ||!p.alg)return!1;if(i&&p.alg!==i)return!1;return!0}catch(o){return!1}}function cG(n,i){if((i==="v4"||!i)&&P9.test(n))return!0;if((i==="v6"||!i)&&r9.test(n))return!0;return!1}class Ao extends pn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==N.string){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.string,received:p.parsedType}),d}let o=new Yi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,m=n.data.length<p.value;if(x||m){if(c=this._getOrReturnCtx(n,c),x)B(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)B(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!Z9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!M$)M$=new RegExp(q9,"u");if(!M$.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!C9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!I9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!L9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!N9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!h9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"ulid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),B(c,{validation:"url",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"regex",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!fR(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!e9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!nG(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!k9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!iG(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!oG(n.data,p.alg))c=this._getOrReturnCtx(n,c),B(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!cG(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!d9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!g9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64url",code:U.invalid_string,message:p.message}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:U.invalid_string,...k.errToObj(o)})}_addCheck(n){return new Ao({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...k.errToObj(n)})}url(n){return this._addCheck({kind:"url",...k.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...k.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...k.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...k.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...k.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...k.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...k.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...k.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...k.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...k.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...k.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...k.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...k.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...k.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...k.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...k.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...k.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...k.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...k.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...k.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...k.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...k.errToObj(i)})}nonempty(n){return this.min(1,k.errToObj(n))}trim(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Ao.create=(n)=>{var i;return new Ao({checks:[],typeName:r.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function pG(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return x%m/Math.pow(10,p)}class ac extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==N.number){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.number,received:p.parsedType}),d}let o=void 0,c=new Yi;for(let p of this._def.checks)if(p.kind==="int"){if(!Fn.isInteger(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:U.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(pG(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),B(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:U.not_finite,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new ac({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:k.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:k.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Fn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}ac.create=(n)=>{return new ac({checks:[],typeName:r.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class fc extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(p){return this._getInvalidInput(n)}if(this._getType(n)!==N.bigint)return this._getInvalidInput(n);let o=void 0,c=new Yi;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),B(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return B(i,{code:U.invalid_type,expected:N.bigint,received:i.parsedType}),d}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new fc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new fc({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}fc.create=(n)=>{var i;return new fc({checks:[],typeName:r.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};class jp extends pn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==N.boolean){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.boolean,received:o.parsedType}),d}return Oi(n.data)}}jp.create=(n)=>{return new jp({typeName:r.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class Nc extends pn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==N.date){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.date,received:p.parsedType}),d}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_date}),d}let o=new Yi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Nc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:k.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:k.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}Nc.create=(n)=>{return new Nc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:r.ZodDate,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==N.symbol){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.symbol,received:o.parsedType}),d}return Oi(n.data)}}yx.create=(n)=>{return new yx({typeName:r.ZodSymbol,...cn(n)})};class Dp extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.undefined,received:o.parsedType}),d}return Oi(n.data)}}Dp.create=(n)=>{return new Dp({typeName:r.ZodUndefined,...cn(n)})};class Lp extends pn{_parse(n){if(this._getType(n)!==N.null){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.null,received:o.parsedType}),d}return Oi(n.data)}}Lp.create=(n)=>{return new Lp({typeName:r.ZodNull,...cn(n)})};class hc extends pn{constructor(){super(...arguments);this._any=!0}_parse(n){return Oi(n.data)}}hc.create=(n)=>{return new hc({typeName:r.ZodAny,...cn(n)})};class mc extends pn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Oi(n.data)}}mc.create=(n)=>{return new mc({typeName:r.ZodUnknown,...cn(n)})};class zo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return B(i,{code:U.invalid_type,expected:N.never,received:i.parsedType}),d}}zo.create=(n)=>{return new zo({typeName:r.ZodNever,...cn(n)})};class kx extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.void,received:o.parsedType}),d}return Oi(n.data)}}kx.create=(n)=>{return new kx({typeName:r.ZodVoid,...cn(n)})};class Fo extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==N.array)return B(i,{code:U.invalid_type,expected:N.array,received:i.parsedType}),d;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(x||m)B(i,{code:x?U.too_big:U.too_small,minimum:m?c.exactLength.value:void 0,maximum:x?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)B(i,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)B(i,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((x,m)=>{return c.type._parseAsync(new Ro(i,x,i.path,m))})).then((x)=>{return Yi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Ro(i,x,i.path,m))});return Yi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Fo({...this._def,minLength:{value:n,message:k.toString(i)}})}max(n,i){return new Fo({...this._def,maxLength:{value:n,message:k.toString(i)}})}length(n,i){return new Fo({...this._def,exactLength:{value:n,message:k.toString(i)}})}nonempty(n){return this.min(1,n)}}Fo.create=(n,i)=>{return new Fo({type:n,minLength:null,maxLength:null,exactLength:null,typeName:r.ZodArray,...cn(i)})};function _p(n){if(n instanceof Cn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=To.create(_p(c))}return new Cn({...n._def,shape:()=>i})}else if(n instanceof Fo)return new Fo({...n._def,type:_p(n.element)});else if(n instanceof To)return To.create(_p(n.unwrap()));else if(n instanceof No)return No.create(_p(n.unwrap()));else if(n instanceof Qo)return Qo.create(n.items.map((i)=>_p(i)));else return n}class Cn extends pn{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Fn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==N.object){let f=this._getOrReturnCtx(n);return B(f,{code:U.invalid_type,expected:N.object,received:f.parsedType}),d}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof zo&&this._def.unknownKeys==="strip")){for(let f in c.data)if(!x.includes(f))m.push(f)}let a=[];for(let f of x){let v=p[f],$=c.data[f];a.push({key:{status:"valid",value:f},value:v._parse(new Ro(c,$,c.path,f)),alwaysSet:f in c.data})}if(this._def.catchall instanceof zo){let f=this._def.unknownKeys;if(f==="passthrough")for(let v of m)a.push({key:{status:"valid",value:v},value:{status:"valid",value:c.data[v]}});else if(f==="strict"){if(m.length>0)B(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(f==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let v of m){let $=c.data[v];a.push({key:{status:"valid",value:v},value:f._parse(new Ro(c,$,c.path,v)),alwaysSet:v in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let f=[];for(let v of a){let $=await v.key,w=await v.value;f.push({key:$,value:w,alwaysSet:v.alwaysSet})}return f}).then((f)=>{return Yi.mergeObjectSync(o,f)});else return Yi.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new Cn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let a=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=k.errToObj(n).message)!==null&&m!==void 0?m:a};return{message:a}}}:{}})}strip(){return new Cn({...this._def,unknownKeys:"strip"})}passthrough(){return new Cn({...this._def,unknownKeys:"passthrough"})}extend(n){return new Cn({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Cn({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:r.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Cn({...this._def,catchall:n})}pick(n){let i={};return Fn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}omit(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}deepPartial(){return _p(this)}partial(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new Cn({...this._def,shape:()=>i})}required(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof To)p=p._def.innerType;i[o]=p}}),new Cn({...this._def,shape:()=>i})}keyof(){return vR(Fn.objectKeys(this.shape))}}Cn.create=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.strictCreate=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strict",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.lazycreate=(n,i)=>{return new Cn({shape:n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};class Np extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let m of p)if(m.result.status==="valid")return m.result;for(let m of p)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;let x=p.map((m)=>new yi(m.ctx.common.issues));return B(i,{code:U.invalid_union,unionErrors:x}),d}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let a of o){let f={...i,common:{...i.common,issues:[]},parent:null},v=a._parseSync({data:i.data,path:i.path,parent:f});if(v.status==="valid")return v;else if(v.status==="dirty"&&!p)p={result:v,ctx:f};if(f.common.issues.length)x.push(f.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((a)=>new yi(a));return B(i,{code:U.invalid_union,unionErrors:m}),d}}get options(){return this._def.options}}Np.create=(n,i)=>{return new Np({options:n,typeName:r.ZodUnion,...cn(i)})};var Do=(n)=>{if(n instanceof Cp)return Do(n.schema);else if(n instanceof io)return Do(n.innerType());else if(n instanceof Ip)return[n.value];else if(n instanceof vc)return n.options;else if(n instanceof yp)return Fn.objectValues(n.enum);else if(n instanceof kp)return Do(n._def.innerType);else if(n instanceof Dp)return[void 0];else if(n instanceof Lp)return[null];else if(n instanceof To)return[void 0,...Do(n.unwrap())];else if(n instanceof No)return[null,...Do(n.unwrap())];else if(n instanceof La)return Do(n.unwrap());else if(n instanceof qp)return Do(n.unwrap());else if(n instanceof Zp)return Do(n._def.innerType);else return[]};class Da extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.object)return B(i,{code:U.invalid_type,expected:N.object,received:i.parsedType}),d;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return B(i,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),d;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let x=Do(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of x){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new Da({typeName:r.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function Q$(n,i){let o=Lo(n),c=Lo(i);if(n===i)return{valid:!0,data:n};else if(o===N.object&&c===N.object){let p=Fn.objectKeys(i),x=Fn.objectKeys(n).filter((a)=>p.indexOf(a)!==-1),m={...n,...i};for(let a of x){let f=Q$(n[a],i[a]);if(!f.valid)return{valid:!1};m[a]=f.data}return{valid:!0,data:m}}else if(o===N.array&&c===N.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],a=i[x],f=Q$(m,a);if(!f.valid)return{valid:!1};p.push(f.data)}return{valid:!0,data:p}}else if(o===N.date&&c===N.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class hp extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(H$(p)||H$(x))return d;let m=Q$(p.value,x.value);if(!m.valid)return B(o,{code:U.invalid_intersection_types}),d;if(z$(p)||z$(x))i.dirty();return{status:i.value,value:m.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,x])=>c(p,x));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}hp.create=(n,i,o)=>{return new hp({left:n,right:i,typeName:r.ZodIntersection,...cn(o)})};class Qo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.array)return B(o,{code:U.invalid_type,expected:N.array,received:o.parsedType}),d;if(o.data.length<this._def.items.length)return B(o,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),d;if(!this._def.rest&&o.data.length>this._def.items.length)B(o,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,m)=>{let a=this._def.items[m]||this._def.rest;if(!a)return null;return a._parse(new Ro(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Yi.mergeArray(i,x)});else return Yi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Qo({...this._def,rest:n})}}Qo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:n,typeName:r.ZodTuple,rest:null,...cn(i)})};class Zx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.object)return B(o,{code:U.invalid_type,expected:N.object,received:o.parsedType}),d;let c=[],p=this._def.keyType,x=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Ro(o,m,o.path,m)),value:x._parse(new Ro(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Yi.mergeObjectAsync(i,c);else return Yi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof pn)return new Zx({keyType:n,valueType:i,typeName:r.ZodRecord,...cn(o)});return new Zx({keyType:Ao.create(),valueType:n,typeName:r.ZodRecord,...cn(i)})}}class qx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.map)return B(o,{code:U.invalid_type,expected:N.map,received:o.parsedType}),d;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,a],f)=>{return{key:c._parse(new Ro(o,m,o.path,[f,"key"])),value:p._parse(new Ro(o,a,o.path,[f,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let a of x){let f=await a.key,v=await a.value;if(f.status==="aborted"||v.status==="aborted")return d;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let a of x){let{key:f,value:v}=a;if(f.status==="aborted"||v.status==="aborted")return d;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}}}}qx.create=(n,i,o)=>{return new qx({valueType:i,keyType:n,typeName:r.ZodMap,...cn(o)})};class Cc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.set)return B(o,{code:U.invalid_type,expected:N.set,received:o.parsedType}),d;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)B(o,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)B(o,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(a){let f=new Set;for(let v of a){if(v.status==="aborted")return d;if(v.status==="dirty")i.dirty();f.add(v.value)}return{status:i.value,value:f}}let m=[...o.data.values()].map((a,f)=>p._parse(new Ro(o,a,o.path,f)));if(o.common.async)return Promise.all(m).then((a)=>x(a));else return x(m)}min(n,i){return new Cc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new Cc({...this._def,maxSize:{value:n,message:k.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Cc.create=(n,i)=>{return new Cc({valueType:n,minSize:null,maxSize:null,typeName:r.ZodSet,...cn(i)})};class up extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.function)return B(i,{code:U.invalid_type,expected:N.function,received:i.parsedType}),d;function o(m,a){return Ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,ua(),Bp].filter((f)=>!!f),issueData:{code:U.invalid_arguments,argumentsError:a}})}function c(m,a){return Ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,ua(),Bp].filter((f)=>!!f),issueData:{code:U.invalid_return_type,returnTypeError:a}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let m=this;return Oi(async function(...a){let f=new yi([]),v=await m._def.args.parseAsync(a,p).catch((J)=>{throw f.addIssue(o(a,J)),f}),$=await Reflect.apply(x,this,v);return await m._def.returns._def.type.parseAsync($,p).catch((J)=>{throw f.addIssue(c($,J)),f})})}else{let m=this;return Oi(function(...a){let f=m._def.args.safeParse(a,p);if(!f.success)throw new yi([o(a,f.error)]);let v=Reflect.apply(x,this,f.data),$=m._def.returns.safeParse(v,p);if(!$.success)throw new yi([c(v,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new up({...this._def,args:Qo.create(n).rest(mc.create())})}returns(n){return new up({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new up({args:n?n:Qo.create([]).rest(mc.create()),returns:i||mc.create(),typeName:r.ZodFunction,...cn(o)})}}class Cp extends pn{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Cp.create=(n,i)=>{return new Cp({getter:n,typeName:r.ZodLazy,...cn(i)})};class Ip extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return B(i,{received:i.data,code:U.invalid_literal,expected:this._def.value}),d}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ip.create=(n,i)=>{return new Ip({value:n,typeName:r.ZodLiteral,...cn(i)})};function vR(n,i){return new vc({values:n,typeName:r.ZodEnum,...cn(i)})}class vc extends pn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{expected:Fn.joinValues(o),received:i.parsedType,code:U.invalid_type}),d}if(!ja(this,hx,"f"))xR(this,hx,new Set(this._def.values),"f");if(!ja(this,hx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{received:i.data,code:U.invalid_enum_value,options:o}),d}return Oi(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return vc.create(n,{...this._def,...i})}exclude(n,i=this._def){return vc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}hx=new WeakMap;vc.create=vR;class yp extends pn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){let i=Fn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==N.string&&o.parsedType!==N.number){let c=Fn.objectValues(i);return B(o,{expected:Fn.joinValues(c),received:o.parsedType,code:U.invalid_type}),d}if(!ja(this,Cx,"f"))xR(this,Cx,new Set(Fn.getValidEnumValues(this._def.values)),"f");if(!ja(this,Cx,"f").has(n.data)){let c=Fn.objectValues(i);return B(o,{received:o.data,code:U.invalid_enum_value,options:c}),d}return Oi(n.data)}get enum(){return this._def.values}}Cx=new WeakMap;yp.create=(n,i)=>{return new yp({values:n,typeName:r.ZodNativeEnum,...cn(i)})};class Ic extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.promise&&i.common.async===!1)return B(i,{code:U.invalid_type,expected:N.promise,received:i.parsedType}),d;let o=i.parsedType===N.promise?i.data:Promise.resolve(i.data);return Oi(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}Ic.create=(n,i)=>{return new Ic({type:n,typeName:r.ZodPromise,...cn(i)})};class io extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===r.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(x)=>{if(B(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(m)=>{if(i.value==="aborted")return d;let a=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(a.status==="aborted")return d;if(a.status==="dirty")return bp(a.value);if(i.value==="dirty")return bp(a.value);return a});else{if(i.value==="aborted")return d;let m=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(m.status==="aborted")return d;if(m.status==="dirty")return bp(m.value);if(i.value==="dirty")return bp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let a=c.refinement(m,p);if(o.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){let m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(m.status==="aborted")return d;if(m.status==="dirty")i.dirty();return x(m.value),{status:i.value,value:m.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((m)=>{if(m.status==="aborted")return d;if(m.status==="dirty")i.dirty();return x(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Lc(x))return x;let m=c.transform(x.value,p);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(!Lc(x))return x;return Promise.resolve(c.transform(x.value,p)).then((m)=>({status:i.value,value:m}))});Fn.assertNever(c)}}io.create=(n,i,o)=>{return new io({schema:n,typeName:r.ZodEffects,effect:i,...cn(o)})};io.createWithPreprocess=(n,i,o)=>{return new io({schema:i,effect:{type:"preprocess",transform:n},typeName:r.ZodEffects,...cn(o)})};class To extends pn{_parse(n){if(this._getType(n)===N.undefined)return Oi(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}To.create=(n,i)=>{return new To({innerType:n,typeName:r.ZodOptional,...cn(i)})};class No extends pn{_parse(n){if(this._getType(n)===N.null)return Oi(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}No.create=(n,i)=>{return new No({innerType:n,typeName:r.ZodNullable,...cn(i)})};class kp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===N.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:r.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...cn(i)})};class Zp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(Ix(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new yi(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new yi(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:r.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class sx extends pn{_parse(n){if(this._getType(n)!==N.nan){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.nan,received:o.parsedType}),d}return{status:"valid",value:n.data}}}sx.create=(n)=>{return new sx({typeName:r.ZodNaN,...cn(n)})};var xG=Symbol("zod_brand");class La extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class Px extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return d;if(p.status==="dirty")return i.dirty(),bp(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return d;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new Px({in:n,out:i,typeName:r.ZodPipeline})}}class qp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Lc(c))c.value=Object.freeze(c.value);return c};return Ix(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:r.ZodReadonly,...cn(i)})};function oR(n,i){let o=typeof n==="function"?n(i):typeof n==="string"?{message:n}:n;return typeof o==="string"?{message:o}:o}function $R(n,i={},o){if(n)return hc.create().superRefine((c,p)=>{var x,m;let a=n(c);if(a instanceof Promise)return a.then((f)=>{var v,$;if(!f){let w=oR(i,c),J=($=(v=w.fatal)!==null&&v!==void 0?v:o)!==null&&$!==void 0?$:!0;p.addIssue({code:"custom",...w,fatal:J})}});if(!a){let f=oR(i,c),v=(m=(x=f.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...f,fatal:v})}return});return hc.create()}var mG={object:Cn.lazycreate},r;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(r||(r={}));var aG=(n,i={message:`Input not instance of ${n.name}`})=>$R((o)=>o instanceof n,i),wR=Ao.create,JR=ac.create,fG=sx.create,vG=fc.create,AR=jp.create,$G=Nc.create,wG=yx.create,JG=Dp.create,AG=Lp.create,FG=hc.create,TG=mc.create,RG=zo.create,SG=kx.create,XG=Fo.create,WG=Cn.create,KG=Cn.strictCreate,lG=Np.create,GG=Da.create,MG=hp.create,YG=Qo.create,HG=Zx.create,zG=qx.create,QG=Cc.create,EG=up.create,OG=Cp.create,UG=Ip.create,VG=vc.create,_G=yp.create,bG=Ic.create,cR=io.create,uG=To.create,BG=No.create,jG=io.createWithPreprocess,DG=Px.create,LG=()=>wR().optional(),NG=()=>JR().optional(),hG=()=>AR().optional(),CG={string:(n)=>Ao.create({...n,coerce:!0}),number:(n)=>ac.create({...n,coerce:!0}),boolean:(n)=>jp.create({...n,coerce:!0}),bigint:(n)=>fc.create({...n,coerce:!0}),date:(n)=>Nc.create({...n,coerce:!0})},IG=d,Wn=Object.freeze({__proto__:null,defaultErrorMap:Bp,setErrorMap:j9,getErrorMap:ua,makeIssue:Ba,EMPTY_PATH:D9,addIssueToContext:B,ParseStatus:Yi,INVALID:d,DIRTY:bp,OK:Oi,isAborted:H$,isDirty:z$,isValid:Lc,isAsync:Ix,get util(){return Fn},get objectUtil(){return Y$},ZodParsedType:N,getParsedType:Lo,ZodType:pn,datetimeRegex:fR,ZodString:Ao,ZodNumber:ac,ZodBigInt:fc,ZodBoolean:jp,ZodDate:Nc,ZodSymbol:yx,ZodUndefined:Dp,ZodNull:Lp,ZodAny:hc,ZodUnknown:mc,ZodNever:zo,ZodVoid:kx,ZodArray:Fo,ZodObject:Cn,ZodUnion:Np,ZodDiscriminatedUnion:Da,ZodIntersection:hp,ZodTuple:Qo,ZodRecord:Zx,ZodMap:qx,ZodSet:Cc,ZodFunction:up,ZodLazy:Cp,ZodLiteral:Ip,ZodEnum:vc,ZodNativeEnum:yp,ZodPromise:Ic,ZodEffects:io,ZodTransformer:io,ZodOptional:To,ZodNullable:No,ZodDefault:kp,ZodCatch:Zp,ZodNaN:sx,BRAND:xG,ZodBranded:La,ZodPipeline:Px,ZodReadonly:qp,custom:$R,Schema:pn,ZodSchema:pn,late:mG,get ZodFirstPartyTypeKind(){return r},coerce:CG,any:FG,array:XG,bigint:vG,boolean:AR,date:$G,discriminatedUnion:GG,effect:cR,enum:VG,function:EG,instanceof:aG,intersection:MG,lazy:OG,literal:UG,map:zG,nan:fG,nativeEnum:_G,never:RG,null:AG,nullable:BG,number:JR,object:WG,oboolean:hG,onumber:NG,optional:uG,ostring:LG,pipeline:DG,preprocess:jG,promise:bG,record:HG,set:QG,strictObject:KG,string:wR,symbol:wG,transformer:cR,tuple:YG,undefined:JG,union:lG,unknown:TG,void:SG,NEVER:IG,ZodIssueCode:U,quotelessJson:B9,ZodError:yi});var yG="__vite_start_time"in globalThis,kG=typeof window!=="undefined",oN="vitest"in globalThis,sn=nR({isServer:!yG&&!kG,server:{CI:Wn.string().transform((n)=>!0).optional(),POSTGRES_USER:Wn.string(),POSTGRES_PASSWORD:Wn.string(),POSTGRES_DATABASE:Wn.string(),POSTGRES_HOST:Wn.string(),POSTGRES_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Wn.union([Wn.literal("true"),Wn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Wn.string().transform((n)=>JSON.parse(n)).pipe(Wn.array(Wn.string())),OPENAI_API_KEY:Wn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Wn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Wn.union([Wn.literal("true"),Wn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var TR=E$(import.meta.dirname,"../dev"),O$=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:FR(E$(TR,"./cert.pem"),"utf-8"),key:FR(E$(TR,"./key.pem"),"utf-8")}:void 0;var $c=new Of,mn=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:$c.logger;g.STORE.loggers[0]=new Xc("warn",void 0,mn);if(mn!==console)Object.assign(console,mn,{log:mn.info});import{spawn as ZG}from"node:child_process";import{resolve as qG}from"node:path";function U$(n,i,o=n.logger){let c=sn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[qG(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let a=ZG(p,m);return new Jx(a,i,o)}var RR=wf($v(),1);var sG=604800000,Na=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new RR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,m]of c.entries())if(p-m>sG)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),mn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import NM from"node:path";import SM from"node:os";import XM from"node:fs";var ha=new Map,V$=new Map,_$=Symbol("OriginError"),sp={};class oo extends Promise{constructor(n,i,o,c,p={}){let x,m;super((a,f)=>{x=a,m=f});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(a)=>(this.active=!1,x(a)),this.reject=(a)=>(this.active=!1,m(a)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[_$]=this.handler.debug?new Error:this.tagged&&PG(this.strings)}get origin(){return(this.handler.debug?this[_$].stack:this.tagged&&V$.has(this.strings)?V$.get(this.strings):V$.set(this.strings,this[_$].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,x)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((a)=>o=a)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(sp),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function PG(n){if(ha.has(n))return ha.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,ha.set(n,new Error),Error.stackTraceLimit=i,ha.get(n)}class Pp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var rn={connection:SR,postgres:XR,generic:WR,notSupported:KR};function SR(n,i,o){let{host:c,port:p}=o||i,x=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(x,SR),x}function XR(n){let i=new Pp(n);return Error.captureStackTrace(i,XR),i}function WR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,WR),o}function KR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,KR),i}var tG={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class ya{then(){b$()}catch(){b$()}finally(){b$()}}class gx extends ya{constructor(n){super();this.value=qa(n)}}class Eo extends ya{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class ka extends ya{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=rG.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?L$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function Za(n,i,o,c){let p=n instanceof Eo?n.value:n;if(p===void 0){if(n instanceof Eo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||Ia(n.value)]||n.type||YR(n.value):n.type):(i.push(n),Ia(n)))}var GR=zR(tG);function j$(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=D$(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function D$(n,i,o,c,p){return i instanceof ka?i.build(n,o,c,p):i instanceof oo?B$(i,o,c,p):i instanceof gx?i.value:i&&i[0]instanceof oo?i.reduce((x,m)=>x+" "+B$(m,o,c,p),""):Za(i,o,c,p)}function B$(n,i,o,c){return n.fragment=!0,j$(n,n.strings[0],n.args[0],i,o,c)}function MR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>D$("values",x[m],i,o,p)).join(",")+")").join(",")}function lR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return MR(x?n:[n],o,c,m,p)}function Ca(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return L$(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((a)=>{return x=n[a],(x instanceof oo?B$(x,o,c,p):x instanceof gx?x.value:Za(x,o,c,p))+" as "+qa(p.transform.column.to?p.transform.column.to(a):a)}).join(",")}var rG=Object.entries({values:lR,in:(...n)=>{let i=lR(...n);return i==="()"?"(null)":i},select:Ca,as:Ca,returning:Ca,"\\(":Ca,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>qa(p.transform.column.to?p.transform.column.to(x):x)+"="+D$("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+L$(x,p)+")values"+MR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function b$(){throw rn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:dG,parsers:gG}=GR;function YR(n){if(Array.isArray(n))return YR(n[0]);return typeof n==="string"?1009:0}var HR=function(n){let i=zR(n||{});return{serializers:Object.assign({},dG,i.serializers),parsers:Object.assign({},gG,i.parsers)}};function zR(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function L$(n,{transform:{column:i}}){return n.map((o)=>qa(i.to?i.to(o):o)).join(",")}var qa=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Ia=function n(i){return i instanceof Eo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},eG=/\\/g,nM=/"/g;function iM(n){return n.replace(eG,"\\\\").replace(nM,"\\\"")}var QR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],m=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((a)=>n(a,o,c,p)).join(m)+"}";return"{"+i.map((a)=>{if(a===void 0){if(a=c.transform.undefined,a===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return a===null?"null":'"'+iM(o?o(a.type?a.value:a):""+a)+'"'}).join(m)+"}"},u$={i:0,char:null,str:"",quoted:!1,last:0},ER=function n(i,o,c){return u$.i=u$.last=0,OR(u$,i,o,c)};function OR(n,i,o,c){let p=[],x=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(OR(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===x&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var yc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>n.replace(/_/g,"-"),tx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),rx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),dx=(n)=>n.replace(/-/g,"_");function N$(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[x,m])=>Object.assign(p,{[n(x)]:i(m,c)}),{}):o}}yc.column={from:yc};yc.value={from:N$(yc)};tx.column={to:tx};var h$={...yc};h$.column.to=tx;kc.column={from:kc};kc.value={from:N$(kc)};rx.column={to:rx};var C$={...kc};C$.column.to=rx;Zc.column={from:Zc};Zc.value={from:N$(Zc)};dx.column={to:dx};var I$={...Zc};I$.column.to=dx;import UR from"node:net";import xM from"node:tls";import ex from"node:crypto";import y$ from"node:stream";import{performance as VR}from"node:perf_hooks";class qc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var ki=oM;function oM(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var Hi=Buffer.allocUnsafe(256),cM="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Hi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(pM,cM,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return sa(i),Qn.i+=Hi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return sa(2),Hi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return Hi.writeUInt32BE(n,i),Qn;return sa(4),Hi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return sa(n),Hi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return Hi=Buffer.concat([Hi.subarray(0,Qn.i),n]),Qn.i=Hi.length,Qn},end(n=1){Hi.writeUInt32BE(Qn.i-n,n);let i=Hi.subarray(0,Qn.i);return Qn.i=0,Hi=Buffer.allocUnsafe(256),i}}),s=Qn;function sa(n){if(Hi.length-Qn.i<n){let i=Hi,o=i.length;Hi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Hi)}}function pM(){return Qn.i=0,Qn}var q$=uR,mM=1,wc=s().S().end(),_R=s().H().end(),aM=s().i32(8).i32(80877103).end(8),fM=Buffer.concat([s().E().str(s.N).i32(0).end(),wc]),vM=s().D().str("S").str(s.N).end(),tp=()=>{},$M=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),wM={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function uR(n,i={},{onopen:o=tp,onend:c=tp,onclose:p=tp}={}){let{ssl:x,max:m,user:a,host:f,port:v,database:$,parsers:w,transform:J,onnotice:S,onnotify:X,onparameter:R,max_pipeline:K,keep_alive:M,backoff:Y,target_session_attrs:I}=n,G=ki(),z=mM++,E={pid:null,secret:null},Q=Z$(ff,n.idle_timeout),b=Z$(ff,n.max_lifetime),y=Z$(AS,n.connect_timeout),H=null,an,Z=new qc,fn=Buffer.alloc(0),En=n.fetch_types,dn={},Vi={},Oo=Math.random().toString(36).slice(2),O=1,q=0,Rn=0,Dn=0,gn=0,vn=0,_n=0,Pn=0,Nn=null,Bn=null,Fi=!1,bn=null,co=null,Ti=null,ho=null,en=null,jn=null,po=null,Xo=null,_=null,nx=null,Ri={queue:i.closed,idleTimer:Q,connect(A){Ti=A||!0,W0()},terminate:ox,execute:ix,cancel:vS,end:ff,count:0,id:z};return i.closed&&i.closed.push(Ri),Ri;async function fS(){let A;try{A=n.socket?await Promise.resolve(n.socket(n)):new UR.Socket}catch(W){rc(W);return}return A.on("error",rc),A.on("close",K0),A.on("drain",S0),A}async function vS({pid:A,secret:W},P,Sn){try{an=s().i32(16).i32(80877102).i32(A).i32(W).end(16),await X0(),H.once("error",Sn),H.once("close",P)}catch(In){Sn(In)}}function ix(A){if(Fi)return mm(A,rn.connection("CONNECTION_DESTROYED",n));if(A.cancelled)return;try{return A.state=E,_?G.push(A):(_=A,_.active=!0),JS(A),vi($S(A))&&!A.describeFirst&&!A.cursorFn&&G.length<K&&(!A.options.onexecute||A.options.onexecute(Ri))}catch(W){return G.length===0&&vi(wc),Wo(W),!0}}function $S(A){if(A.parameters.length>=65534)throw rn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return A.options.simple?s().Q().str(A.statement.string+s.N).end():A.describeFirst?Buffer.concat([F0(A),_R]):A.prepare?A.prepared?xm(A):Buffer.concat([F0(A),xm(A)]):wS(A)}function F0(A){return Buffer.concat([G0(A.statement.string,A.parameters,A.statement.types,A.statement.name),dS("S",A.statement.name)])}function xm(A){return Buffer.concat([rS(A.parameters,A.statement.types,A.statement.name,A.cursorName),A.cursorFn?M0("",A.cursorRows):fM])}function wS(A){return Buffer.concat([G0(A.statement.string,A.parameters,A.statement.types),vM,xm(A)])}function JS(A){let W=[],P=[],Sn=j$(A,A.strings[0],A.args[0],W,P,n);!A.tagged&&A.args.forEach((In)=>Za(In,W,P,n)),A.prepare=n.prepare&&("prepare"in A.options?A.options.prepare:!0),A.string=Sn,A.signature=A.prepare&&P+Sn,A.onlyDescribe&&delete Vi[A.signature],A.parameters=A.parameters||W,A.prepared=A.prepare&&A.signature in Vi,A.describeFirst=A.onlyDescribe||W.length&&!A.prepared,A.statement=A.prepared?Vi[A.signature]:{string:Sn,types:P,name:A.prepare?Oo+O++:""},typeof n.debug==="function"&&n.debug(z,Sn,W,P)}function vi(A,W){if(jn=jn?Buffer.concat([jn,A]):Buffer.from(A),W||jn.length>=1024)return T0(W);return Bn===null&&(Bn=setImmediate(T0)),!0}function T0(A){let W=H.write(jn,A);return Bn!==null&&clearImmediate(Bn),jn=Bn=null,W}function AS(){Wo(rn.connection("CONNECT_TIMEOUT",n,H)),H.destroy()}async function R0(){if(vi(aM),!await new Promise((W)=>H.once("data",(P)=>W(P[0]===83)))&&x==="prefer")return tc();H.removeAllListeners(),H=xM.connect({socket:H,servername:UR.isIP(H.host)?void 0:H.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),H.on("secureConnect",tc),H.on("error",rc),H.on("close",K0),H.on("drain",S0)}function S0(){!_&&o(Ri)}function af(A){if(bn){if(bn.push(A),Rn-=A.length,Rn>=0)return}fn=bn?Buffer.concat(bn,vn-Rn):fn.length===0?A:Buffer.concat([fn,A],fn.length+A.length);while(fn.length>4){if(vn=fn.readUInt32BE(1),vn>=fn.length){Rn=vn-fn.length,bn=[fn];break}try{FS(fn.subarray(0,vn+1))}catch(W){_&&(_.cursorFn||_.describeFirst)&&vi(wc),Wo(W)}fn=fn.subarray(vn+1),Rn=0,bn=null}}async function X0(){if(Fi=!1,dn={},H||(H=await fS()),!H)return;if(y.start(),n.socket)return x?R0():tc();if(H.on("connect",x?R0:tc),n.path)return H.connect(n.path);H.ssl=x,H.connect(v[Dn],f[Dn]),H.host=f[Dn],H.port=v[Dn],Dn=(Dn+1)%v.length}function W0(){setTimeout(X0,q?q+_n-VR.now():0)}function tc(){try{Vi={},En=n.fetch_types,Oo=Math.random().toString(36).slice(2),O=1,b.start(),H.on("data",af),M&&H.setKeepAlive&&H.setKeepAlive(!0,1000*M);let A=eS();vi(A)}catch(A){rc(A)}}function rc(A){if(Ri.queue===i.connecting&&n.host[gn+1])return;Wo(A);while(G.length)mm(G.shift(),A)}function Wo(A){en&&(en.destroy(A),en=null),_&&mm(_,A),Ti&&(mm(Ti,A),Ti=null)}function mm(A,W){"query"in W||"parameters"in W||Object.defineProperties(W,{stack:{value:W.stack+A.origin.replace(/.*\n/,`
61
+ `),enumerable:n.debug},query:{value:A.string,enumerable:n.debug},parameters:{value:A.parameters,enumerable:n.debug},args:{value:A.args,enumerable:n.debug},types:{value:A.statement&&A.statement.types,enumerable:n.debug}}),A.reject(W)}function ff(){return ho||(!Ri.reserved&&c(Ri),!Ri.reserved&&!Ti&&!_&&G.length===0?(ox(),new Promise((A)=>H&&H.readyState!=="closed"?H.once("close",A):A())):ho=new Promise((A)=>po=A))}function ox(){if(Fi=!0,en||_||Ti||G.length)rc(rn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(Bn),H)H.removeListener("data",af),H.removeListener("connect",tc),H.readyState==="open"&&H.end(s().X().end());po&&(po(),ho=po=null)}async function K0(A){if(fn=Buffer.alloc(0),Rn=0,bn=null,clearImmediate(Bn),H.removeListener("data",af),H.removeListener("connect",tc),Q.cancel(),b.cancel(),y.cancel(),H.removeAllListeners(),H=null,Ti)return W0();!A&&(_||G.length)&&rc(rn.connection("CONNECTION_CLOSED",n,H)),q=VR.now(),A&&n.shared.retries++,_n=(typeof Y==="function"?Y(n.shared.retries):Y)*1000,p(Ri,rn.connection("CONNECTION_CLOSED",n,H))}function FS(A,W=A[0]){(W===68?TS:W===100?IS:W===65?jS:W===83?RS:W===90?SS:W===67?XS:W===50?l0:W===49?WS:W===116?KS:W===84?lS:W===82?GS:W===110?ES:W===75?OS:W===69?uS:W===115?DS:W===51?LS:W===71?NS:W===78?kS:W===72?hS:W===99?yS:W===73?ZS:W===86?qS:W===118?sS:W===87?CS:PS)(A)}function TS(A){let W=7,P,Sn,In,Si=_.isRaw?new Array(_.statement.columns.length):{};for(let zi=0;zi<_.statement.columns.length;zi++)Sn=_.statement.columns[zi],P=A.readInt32BE(W),W+=4,In=P===-1?null:_.isRaw===!0?A.subarray(W,W+=P):Sn.parser===void 0?A.toString("utf8",W,W+=P):Sn.parser.array===!0?Sn.parser(A.toString("utf8",W+1,W+=P)):Sn.parser(A.toString("utf8",W,W+=P)),_.isRaw?Si[zi]=_.isRaw===!0?In:J.value.from?J.value.from(In,Sn):In:Si[Sn.name]=J.value.from?J.value.from(In,Sn):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(Si):Si,Z):Z[Pn++]=J.row.from?J.row.from(Si):Si}function RS(A){let[W,P]=A.toString("utf8",5,A.length-1).split(s.N);if(dn[W]=P,n.parameters[W]!==P)n.parameters[W]=P,R&&R(W,P)}function SS(A){if(_&&_.options.simple&&_.resolve(co||Z),_=co=null,Z=new qc,y.cancel(),Ti){if(I){if(!dn.in_hot_standby||!dn.default_transaction_read_only)return bS();else if(_S(I,dn))return ox()}if(En)return Ti===!0&&(Ti=null),US();Ti!==!0&&ix(Ti),n.shared.retries=gn=0,Ti=null;return}while(G.length&&(_=G.shift())&&(_.active=!0,_.cancelled))uR(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;Ri.reserved?!Ri.reserved.release&&A[5]===73?ho?ox():(Ri.reserved=null,o(Ri)):Ri.reserved():ho?ox():o(Ri)}function XS(A){Pn=0;for(let W=A.length-1;W>0;W--){if(A[W]===32&&A[W+1]<58&&Z.count===null)Z.count=+A.toString("utf8",W+1,A.length-1);if(A[W-1]>=65){Z.command=A.toString("utf8",5,W),Z.state=E;break}}if(nx&&(nx(),nx=null),Z.command==="BEGIN"&&m!==1&&!Ri.reserved)return Wo(rn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return l0();if(_.cursorFn)Z.count&&_.cursorFn(Z),vi(wc);_.resolve(Z)}function WS(){_.parsing=!1}function l0(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function KS(A){let W=A.readUInt16BE(5);for(let P=0;P<W;++P)!_.statement.types[P]&&(_.statement.types[P]=A.readUInt32BE(7+P*4));_.prepare&&(Vi[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&(vi(xm(_)),_.describeFirst=!1)}function lS(A){if(Z.command)co=co||[Z],co.push(Z=new qc),Z.count=null,_.statement.columns=null;let W=A.readUInt16BE(5),P=7,Sn;_.statement.columns=Array(W);for(let In=0;In<W;++In){Sn=P;while(A[P++]!==0);let Si=A.readUInt32BE(P),zi=A.readUInt16BE(P+4),Co=A.readUInt32BE(P+6);_.statement.columns[In]={name:J.column.from?J.column.from(A.toString("utf8",Sn,P-1)):A.toString("utf8",Sn,P-1),parser:w[Co],table:Si,number:zi,type:Co},P+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),vi(wc)}async function GS(A,W=A.readUInt32BE(5)){(W===3?MS:W===5?YS:W===10?HS:W===11?zS:W===12?QS:W!==0?tS:tp)(A,W)}async function MS(){let A=await vf();vi(s().p().str(A).z(1).end())}async function YS(A){let W="md5"+await bR(Buffer.concat([Buffer.from(await bR(await vf()+a)),A.subarray(9)]));vi(s().p().str(W).z(1).end())}async function HS(){Xo=(await ex.randomBytes(18)).toString("base64"),s().p().str("SCRAM-SHA-256"+s.N);let A=s.i;vi(s.inc(4).str("n,,n=*,r="+Xo).i32(s.i-A-4,A).end())}async function zS(A){let W=A.toString("utf8",9).split(",").reduce((zi,Co)=>(zi[Co[0]]=Co.slice(2),zi),{}),P=await ex.pbkdf2Sync(await vf(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Sn=await Pa(P,"Client Key"),In="n=*,r="+Xo+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Nn=(await Pa(await Pa(P,"Server Key"),In)).toString("base64");let Si="c=biws,r="+W.r+",p="+AM(Sn,Buffer.from(await Pa(await JM(Sn),In))).toString("base64");vi(s().p().str(Si).end())}function QS(A){if(A.toString("utf8",9).split(s.N,1)[0].slice(2)===Nn)return;Wo(rn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),H.destroy()}function vf(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function ES(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),vi(wc)}function OS(A){E.pid=A.readUInt32BE(5),E.secret=A.readUInt32BE(9)}async function US(){En=!1,(await new oo([`
62
62
  select b.oid, b.typarray
63
63
  from pg_catalog.pg_type a
64
64
  left join pg_catalog.pg_type b on b.oid = a.typelem
65
65
  where a.typcategory = 'A'
66
66
  group by b.oid, b.typarray
67
67
  order by b.oid
68
- `],[],ix)).forEach(({oid:K,typarray:s})=>H3(K,s))}function H3(A,K){if(!!n.parsers[K]&&!!n.serializers[K])return;let s=n.parsers[A];n.shared.typeArrayMap[A]=K,n.parsers[K]=(Xn)=>GR(Xn,s,K),n.parsers[K].array=!0,n.serializers[K]=(Xn)=>SR(Xn,n.serializers[A],n,K)}function M3(A,K){return A==="read-write"&&K.default_transaction_read_only==="on"||A==="read-only"&&K.default_transaction_read_only==="off"||A==="primary"&&K.in_hot_standby==="on"||A==="standby"&&K.in_hot_standby==="off"||A==="prefer-standby"&&K.in_hot_standby==="off"&&n.host[dn]}function z3(){let A=new io([`
68
+ `],[],ix)).forEach(({oid:W,typarray:P})=>VS(W,P))}function VS(A,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let P=n.parsers[A];n.shared.typeArrayMap[A]=W,n.parsers[W]=(Sn)=>ER(Sn,P,W),n.parsers[W].array=!0,n.serializers[W]=(Sn)=>QR(Sn,n.serializers[A],n,W)}function _S(A,W){return A==="read-write"&&W.default_transaction_read_only==="on"||A==="read-only"&&W.default_transaction_read_only==="off"||A==="primary"&&W.in_hot_standby==="on"||A==="standby"&&W.in_hot_standby==="off"||A==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[gn]}function bS(){let A=new oo([`
69
69
  show transaction_read_only;
70
70
  select pg_catalog.pg_is_in_recovery()
71
- `],[],ix,null,{simple:!0});A.resolve=([[K],[s]])=>{gn.default_transaction_read_only=K.transaction_read_only,gn.in_hot_standby=s.pg_is_in_recovery?"on":"off"},A.execute()}function Q3(A){_&&(_.cursorFn||_.describeFirst)&&$i(wc);let K=tn.postgres(I0(A));_&&_.retried?Wo(_.retried):_&&_.prepared&&c2.has(K.routine)?E3(_,K):Wo(K)}function E3(A,K){delete _i[A.signature],A.retried=K,ix(A)}function O3(A){if(!W)return;let K=9;while(A[K++]!==0);W(A.toString("utf8",9,K-1),A.toString("utf8",K,A.length-1))}async function U3(){try{let A=await Promise.resolve(_.cursorFn(Z));sn=0,A===Pp?$i(Z3(_.portal)):(Z=new qc,$i(G$("",_.cursorRows)))}catch(A){$i(wc),_.reject(A)}}function V3(){Z.count&&_.cursorFn(Z),_.resolve(Z)}function _3(){en=new u0.Writable({autoDestroy:!0,write(A,K,s){M.write(P().d().raw(A).end(),s)},destroy(A,K){K(A),M.write(P().f().str(A+P.N).end()),en=null},final(A){M.write(P().c().end()),nx=A}}),_.resolve(en)}function B3(){en=new u0.Readable({read(){M.resume()}}),_.resolve(en)}function b3(){en=new u0.Duplex({autoDestroy:!0,read(){M.resume()},write(A,K,s){M.write(P().d().raw(A).end(),s)},destroy(A,K){K(A),M.write(P().f().str(A+P.N).end()),en=null},final(A){M.write(P().c().end()),nx=A}}),_.resolve(en)}function j3(A){en&&(en.push(A.subarray(5))||M.pause())}function L3(){en&&en.push(null),en=null}function D3(A){X?X(I0(A)):console.log(I0(A))}function N3(){}function h3(){Wo(tn.notSupported("FunctionCallResponse"))}function C3(){Wo(tn.notSupported("NegotiateProtocolVersion"))}function u3(A){console.error("Postgres.js : Unknown Message:",A[0])}function I3(A,K){console.error("Postgres.js : Unknown Auth:",K)}function y3(A,K,s="",Xn=""){let In,Xi;return P().B().str(Xn+P.N).str(s+P.N).i16(0).i16(A.length),A.forEach((Qi,uo)=>{if(Qi===null)return P.i32(4294967295);Xi=K[uo],A[uo]=Qi=Xi in n.serializers?n.serializers[Xi](Qi):""+Qi,In=P.i,P.inc(4).str(Qi).i32(P.i-In-4,In)}),P.i16(0),P.end()}function S$(A,K,s,Xn=""){return P().P().str(Xn+P.N).str(A+P.N).i16(K.length),K.forEach((In,Xi)=>P.i32(s[Xi]||0)),P.end()}function k3(A,K=""){return P().D().str(A).str(K+P.N).end()}function G$(A="",K=0){return Buffer.concat([P().E().str(A+P.N).i32(K).end(),MR])}function Z3(A=""){return Buffer.concat([P().C().str("P").str(A+P.N).end(),P().S().end()])}function q3(){return fn||P().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:f,database:$,client_encoding:"UTF8"},n.connection)).filter(([,A])=>A).map(([A,K])=>A+P.N+K).join(P.N)).z(2).end(0)}}function I0(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[p2[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function zR(n){return dx.createHash("md5").update(n).digest("hex")}function sf(n,i){return dx.createHmac("sha256",n).update(i).digest()}function x2(n){return dx.createHash("sha256").update(n).digest()}function m2(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function y0(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:rp,start:rp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var ER=()=>{};function Z0(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,f=!1,a=w.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(f)return;m=null,p.pid=p.secret=void 0,J(await X(a,c,i.publications)),o.forEach((R)=>R.forEach(({onsubscribe:S})=>S()))},no_subscribe:!0}),v=a.end,$=a.close;return a.end=async()=>{return f=!0,m&&await new Promise((R)=>(m.once("close",R),m.end())),v()},a.close=async()=>{return m&&await new Promise((R)=>(m.once("close",R),m.end())),$()},w;async function w(R,S,l=ER,H=ER){if(R=v2(R),!x)x=X(a,c,i.publications);let I={fn:S,onsubscribe:l},Y=o.has(R)?o.get(R).add(I):o.set(R,new Set([I])).get(R),z=()=>{Y.delete(I),Y.size===0&&o.delete(R)};return x.then((E)=>{return J(E),l(),m&&m.on("error",H),{unsubscribe:z,state:p,sql:a}})}function J(R){m=R.stream,p.pid=R.state.pid,p.secret=R.state.secret}async function X(R,S,l){if(!l)throw new Error("Missing publication names");let H=await R.unsafe(`CREATE_REPLICATION_SLOT ${S} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[I]=H,Y=await R.unsafe(`START_REPLICATION SLOT ${S} LOGICAL ${I.consistent_point} (proto_version '1', publication_names '${l}')`).writable(),z={lsn:Buffer.concat(I.consistent_point.split("/").map((M)=>Buffer.from(("00000000"+M).slice(-8),"hex")))};return Y.on("data",Q),Y.on("error",E),Y.on("close",R.close),{stream:Y,state:H.state};function E(M){console.error("Unexpected error during logical streaming - reconnecting",M)}function Q(M){if(M[0]===119)a2(M.subarray(25),z,R.options.parsers,b,i.transform);else if(M[0]===107&&M[17])z.lsn=M.subarray(1,9),y()}function b(M,fn){let Z=fn.relation.schema+"."+fn.relation.table;W("*",M,fn),W("*:"+Z,M,fn),fn.relation.keys.length&&W("*:"+Z+"="+fn.relation.keys.map((an)=>M[an.name]),M,fn),W(fn.command,M,fn),W(fn.command+":"+Z,M,fn),fn.relation.keys.length&&W(fn.command+":"+Z+"="+fn.relation.keys.map((an)=>M[an.name]),M,fn)}function y(){let M=Buffer.alloc(34);M[0]=114,M.fill(z.lsn,1),M.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),Y.write(M)}}function W(R,S,l){o.has(R)&&o.get(R).forEach(({fn:H})=>H(S,l,R))}}function f2(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function a2(n,i,o,c,p){let x=(m,[f,a])=>(m[f.charCodeAt(0)]=a,m);Object.entries({R:(m)=>{let f=1,a=i[m.readUInt32BE(f)]={schema:m.toString("utf8",f+=4,f=m.indexOf(0,f))||"pg_catalog",table:m.toString("utf8",f+1,f=m.indexOf(0,f+1)),columns:Array(m.readUInt16BE(f+=2)),keys:[]};f+=2;let v=0,$;while(f<m.length)$=a.columns[v++]={key:m[f++],name:p.column.from?p.column.from(m.toString("utf8",f,f=m.indexOf(0,f))):m.toString("utf8",f,f=m.indexOf(0,f)),type:m.readUInt32BE(f+=1),parser:o[m.readUInt32BE(f)],atttypmod:m.readUInt32BE(f+=4)},$.key&&a.keys.push($),f+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=f2(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let f=1,a=i[m.readUInt32BE(f)],{row:v}=rf(m,a.columns,f+=7,p);c(v,{command:"insert",relation:a})},D:(m)=>{let f=1,a=i[m.readUInt32BE(f)];f+=4;let v=m[f]===75;c(v||m[f]===79?rf(m,a.columns,f+=3,p).row:null,{command:"delete",relation:a,key:v})},U:(m)=>{let f=1,a=i[m.readUInt32BE(f)];f+=4;let v=m[f]===75,$=v||m[f]===79?rf(m,a.columns,f+=3,p):null;$&&(f=$.i);let{row:w}=rf(m,a.columns,f+3,p);c(w,{command:"update",relation:a,key:v,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function rf(n,i,o,c){let p,x,m,f=c.raw?new Array(i.length):{};for(let a=0;a<i.length;a++)p=n[o++],x=i[a],m=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?f[a]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:f[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(f):f}}function v2(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import OR from"stream";function q0(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let m;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:f}]=await x`select lo_open(${i}, ${o}) as fd`,a={writable:$,readable:v,close:()=>x`select lo_close(${f})`.then(m),tell:()=>x`select lo_tell64(${f})`,read:(w)=>x`select loread(${f}, ${w}) as data`,write:(w)=>x`select lowrite(${f}, ${w})`,truncate:(w)=>x`select lo_truncate64(${f}, ${w})`,seek:(w,J=0)=>x`select lo_lseek64(${f}, ${w}, ${J})`,size:()=>x`
71
+ `],[],ix,null,{simple:!0});A.resolve=([[W],[P]])=>{dn.default_transaction_read_only=W.transaction_read_only,dn.in_hot_standby=P.pg_is_in_recovery?"on":"off"},A.execute()}function uS(A){_&&(_.cursorFn||_.describeFirst)&&vi(wc);let W=rn.postgres(k$(A));_&&_.retried?Wo(_.retried):_&&_.prepared&&$M.has(W.routine)?BS(_,W):Wo(W)}function BS(A,W){delete Vi[A.signature],A.retried=W,ix(A)}function jS(A){if(!X)return;let W=9;while(A[W++]!==0);X(A.toString("utf8",9,W-1),A.toString("utf8",W,A.length-1))}async function DS(){try{let A=await Promise.resolve(_.cursorFn(Z));Pn=0,A===sp?vi(gS(_.portal)):(Z=new qc,vi(M0("",_.cursorRows)))}catch(A){vi(wc),_.reject(A)}}function LS(){Z.count&&_.cursorFn(Z),_.resolve(Z)}function NS(){en=new y$.Writable({autoDestroy:!0,write(A,W,P){H.write(s().d().raw(A).end(),P)},destroy(A,W){W(A),H.write(s().f().str(A+s.N).end()),en=null},final(A){H.write(s().c().end()),nx=A}}),_.resolve(en)}function hS(){en=new y$.Readable({read(){H.resume()}}),_.resolve(en)}function CS(){en=new y$.Duplex({autoDestroy:!0,read(){H.resume()},write(A,W,P){H.write(s().d().raw(A).end(),P)},destroy(A,W){W(A),H.write(s().f().str(A+s.N).end()),en=null},final(A){H.write(s().c().end()),nx=A}}),_.resolve(en)}function IS(A){en&&(en.push(A.subarray(5))||H.pause())}function yS(){en&&en.push(null),en=null}function kS(A){S?S(k$(A)):console.log(k$(A))}function ZS(){}function qS(){Wo(rn.notSupported("FunctionCallResponse"))}function sS(){Wo(rn.notSupported("NegotiateProtocolVersion"))}function PS(A){console.error("Postgres.js : Unknown Message:",A[0])}function tS(A,W){console.error("Postgres.js : Unknown Auth:",W)}function rS(A,W,P="",Sn=""){let In,Si;return s().B().str(Sn+s.N).str(P+s.N).i16(0).i16(A.length),A.forEach((zi,Co)=>{if(zi===null)return s.i32(4294967295);Si=W[Co],A[Co]=zi=Si in n.serializers?n.serializers[Si](zi):""+zi,In=s.i,s.inc(4).str(zi).i32(s.i-In-4,In)}),s.i16(0),s.end()}function G0(A,W,P,Sn=""){return s().P().str(Sn+s.N).str(A+s.N).i16(W.length),W.forEach((In,Si)=>s.i32(P[Si]||0)),s.end()}function dS(A,W=""){return s().D().str(A).str(W+s.N).end()}function M0(A="",W=0){return Buffer.concat([s().E().str(A+s.N).i32(W).end(),_R])}function gS(A=""){return Buffer.concat([s().C().str("P").str(A+s.N).end(),s().S().end()])}function eS(){return an||s().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:a,database:$,client_encoding:"UTF8"},n.connection)).filter(([,A])=>A).map(([A,W])=>A+s.N+W).join(s.N)).z(2).end(0)}}function k$(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[wM[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function bR(n){return ex.createHash("md5").update(n).digest("hex")}function Pa(n,i){return ex.createHmac("sha256",n).update(i).digest()}function JM(n){return ex.createHash("sha256").update(n).digest()}function AM(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function Z$(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:tp,start:tp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var BR=()=>{};function s$(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,a=!1,f=w.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(a)return;m=null,p.pid=p.secret=void 0,J(await S(f,c,i.publications)),o.forEach((R)=>R.forEach(({onsubscribe:K})=>K()))},no_subscribe:!0}),v=f.end,$=f.close;return f.end=async()=>{return a=!0,m&&await new Promise((R)=>(m.once("close",R),m.end())),v()},f.close=async()=>{return m&&await new Promise((R)=>(m.once("close",R),m.end())),$()},w;async function w(R,K,M=BR,Y=BR){if(R=RM(R),!x)x=S(f,c,i.publications);let I={fn:K,onsubscribe:M},G=o.has(R)?o.get(R).add(I):o.set(R,new Set([I])).get(R),z=()=>{G.delete(I),G.size===0&&o.delete(R)};return x.then((E)=>{return J(E),M(),m&&m.on("error",Y),{unsubscribe:z,state:p,sql:f}})}function J(R){m=R.stream,p.pid=R.state.pid,p.secret=R.state.secret}async function S(R,K,M){if(!M)throw new Error("Missing publication names");let Y=await R.unsafe(`CREATE_REPLICATION_SLOT ${K} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[I]=Y,G=await R.unsafe(`START_REPLICATION SLOT ${K} LOGICAL ${I.consistent_point} (proto_version '1', publication_names '${M}')`).writable(),z={lsn:Buffer.concat(I.consistent_point.split("/").map((H)=>Buffer.from(("00000000"+H).slice(-8),"hex")))};return G.on("data",Q),G.on("error",E),G.on("close",R.close),{stream:G,state:Y.state};function E(H){console.error("Unexpected error during logical streaming - reconnecting",H)}function Q(H){if(H[0]===119)TM(H.subarray(25),z,R.options.parsers,b,i.transform);else if(H[0]===107&&H[17])z.lsn=H.subarray(1,9),y()}function b(H,an){let Z=an.relation.schema+"."+an.relation.table;X("*",H,an),X("*:"+Z,H,an),an.relation.keys.length&&X("*:"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an),X(an.command,H,an),X(an.command+":"+Z,H,an),an.relation.keys.length&&X(an.command+":"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an)}function y(){let H=Buffer.alloc(34);H[0]=114,H.fill(z.lsn,1),H.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),G.write(H)}}function X(R,K,M){o.has(R)&&o.get(R).forEach(({fn:Y})=>Y(K,M,R))}}function FM(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function TM(n,i,o,c,p){let x=(m,[a,f])=>(m[a.charCodeAt(0)]=f,m);Object.entries({R:(m)=>{let a=1,f=i[m.readUInt32BE(a)]={schema:m.toString("utf8",a+=4,a=m.indexOf(0,a))||"pg_catalog",table:m.toString("utf8",a+1,a=m.indexOf(0,a+1)),columns:Array(m.readUInt16BE(a+=2)),keys:[]};a+=2;let v=0,$;while(a<m.length)$=f.columns[v++]={key:m[a++],name:p.column.from?p.column.from(m.toString("utf8",a,a=m.indexOf(0,a))):m.toString("utf8",a,a=m.indexOf(0,a)),type:m.readUInt32BE(a+=1),parser:o[m.readUInt32BE(a)],atttypmod:m.readUInt32BE(a+=4)},$.key&&f.keys.push($),a+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=FM(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let a=1,f=i[m.readUInt32BE(a)],{row:v}=ta(m,f.columns,a+=7,p);c(v,{command:"insert",relation:f})},D:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75;c(v||m[a]===79?ta(m,f.columns,a+=3,p).row:null,{command:"delete",relation:f,key:v})},U:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75,$=v||m[a]===79?ta(m,f.columns,a+=3,p):null;$&&(a=$.i);let{row:w}=ta(m,f.columns,a+3,p);c(w,{command:"update",relation:f,key:v,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function ta(n,i,o,c){let p,x,m,a=c.raw?new Array(i.length):{};for(let f=0;f<i.length;f++)p=n[o++],x=i[f],m=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?a[f]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:a[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(a):a}}function RM(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import jR from"node:stream";function P$(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let m;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:a}]=await x`select lo_open(${i}, ${o}) as fd`,f={writable:$,readable:v,close:()=>x`select lo_close(${a})`.then(m),tell:()=>x`select lo_tell64(${a})`,read:(w)=>x`select loread(${a}, ${w}) as data`,write:(w)=>x`select lowrite(${a}, ${w})`,truncate:(w)=>x`select lo_truncate64(${a}, ${w})`,seek:(w,J=0)=>x`select lo_lseek64(${a}, ${w}, ${J})`,size:()=>x`
72
72
  select
73
- lo_lseek64(${f}, location, 0) as position,
73
+ lo_lseek64(${a}, location, 0) as position,
74
74
  seek.size
75
75
  from (
76
76
  select
@@ -78,10 +78,10 @@ ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":c
78
78
  tell.location
79
79
  from (select lo_tell64($1) as location) tell
80
80
  ) seek
81
- `};return c(a),new Promise(async(w)=>m=w);async function v({highWaterMark:w=16384,start:J=0,end:X=1/0}={}){let W=X-J;return J&&await a.seek(J),new OR.Readable({highWaterMark:w,async read(R){let S=R>W?R-W:R;W-=R;let[{data:l}]=await a.read(S);if(this.push(l),l.length<R)this.push(null)}})}async function $({highWaterMark:w=16384,start:J=0}={}){return J&&await a.seek(J),new OR.Writable({highWaterMark:w,write(X,W,R){a.write(X).then(()=>R(),R)}})}}).catch(p)})}Object.assign(tf,{PostgresError:sp,toPascal:kc,pascal:h0,toCamel:yc,camel:N0,toKebab:Zc,kebab:C0,fromPascal:rx,fromCamel:sx,fromKebab:tx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var tp=tf;function tf(n,i){let o=J2(n,i),c=o.no_subscribe||Z0(tf,{...o}),p=!1,x=yi(),m=yi(),f=yi(),a=yi(),v=yi(),$=yi(),w=yi(),J=yi(),X={connecting:m,reserved:f,closed:a,ended:v,open:$,busy:w,full:J},W=[...Array(o.max)].map(()=>k0(o,X,{onopen:_i,onend:gn,onclose:Oo})),R=S(b);return Object.assign(R,{get parameters(){return o.parameters},largeObject:q0.bind(null,R),subscribe:c,CLOSE:Pp,END:Pp,PostgresError:sp,options:o,reserve:I,listen:l,begin:Y,close:Z,end:fn}),R;function S(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[_n,sn])=>{return vn[_n]=(hn)=>new Eo(hn,sn.to),vn},q),Object.assign(Rn,{types:q,typed:q,unsafe:Dn,notify:H,array:Q,json:E,file:dn}),Rn;function q(vn,_n){return new Eo(vn,_n)}function Rn(vn,..._n){return vn&&Array.isArray(vn.raw)?new io(vn,_n,O,M):typeof vn==="string"&&!_n.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new kf(vn,_n)}function Dn(vn,_n=[],sn={}){return arguments.length===2&&!Array.isArray(_n)&&(sn=_n,_n=[]),new io([vn],_n,O,M,{prepare:!1,...sn,simple:"simple"in sn?sn.simple:_n.length===0})}function dn(vn,_n=[],sn={}){return arguments.length===2&&!Array.isArray(_n)&&(sn=_n,_n=[]),new io([],_n,(jn)=>{w2.readFile(vn,"utf8",(Ti,Bn)=>{if(Ti)return jn.reject(Ti);jn.strings=[Bn],O(jn)})},M,{...sn,simple:"simple"in sn?sn.simple:_n.length===0})}}async function l(O,q,Rn){let Dn={fn:q,onlisten:Rn},dn=l.sql||(l.sql=tf({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(l.channels).forEach(([jn,{listeners:Ti}])=>{delete l.channels[jn],Promise.all(Ti.map((Bn)=>l(jn,Bn.fn,Bn.onlisten).catch(()=>{})))})},onnotify(jn,Ti){jn in l.channels&&l.channels[jn].listeners.forEach((Bn)=>Bn.fn(Ti))}})),vn=l.channels||(l.channels={});if(O in vn){vn[O].listeners.push(Dn);let jn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:jn.state,unlisten:hn}}vn[O]={result:dn`listen ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[Dn]};let sn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:sn.state,unlisten:hn};async function hn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((jn)=>jn!==Dn),vn[O].listeners.length)return;return delete vn[O],dn`unlisten ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function H(O,q){return await R`select pg_notify(${O}, ${""+q})`}async function I(){let O=yi(),q=$.length?$.shift():await new Promise((dn)=>{x.push({reserve:dn}),a.length&&En(a.shift())});z(q,f),q.reserved=()=>O.length?q.execute(O.shift()):z(q,f),q.reserved.release=!0;let Rn=S(Dn);return Rn.release=()=>{q.reserved=null,_i(q)},Rn;function Dn(dn){q.queue===J?O.push(dn):q.execute(dn)||z(q,J)}}async function Y(O,q){!q&&(q=O,O="");let Rn=yi(),Dn=0,dn,vn=null;try{return await R.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:sn}).execute(),await Promise.race([_n(dn,q),new Promise((hn,jn)=>dn.onclose=jn)])}catch(hn){throw hn}async function _n(hn,jn,Ti){let Bn=S(en);Bn.savepoint=Co,Bn.prepare=(Ln)=>vn=Ln.replace(/[^a-z0-9$-_. ]/gi);let oo,Fi;Ti&&await Bn`savepoint ${Bn(Ti)}`;try{if(Fi=await new Promise((Ln,co)=>{let Xo=jn(Bn);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(Ln,co)}),oo)throw oo}catch(Ln){throw await(Ti?Bn`rollback to ${Bn(Ti)}`:Bn`rollback`),Ln instanceof sp&&Ln.code==="25P02"&&oo||Ln}if(!Ti)vn?await Bn`prepare transaction '${Bn.unsafe(vn)}'`:await Bn`commit`;return Fi;function Co(Ln,co){if(Ln&&Array.isArray(Ln.raw))return Co((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(co=Ln,Ln=null),_n(hn,co,"s"+Dn+++(Ln?"_"+Ln:""))}function en(Ln){Ln.catch((co)=>oo||(oo=co)),hn.queue===J?Rn.push(Ln):hn.execute(Ln)||z(hn,J)}}function sn(hn){dn=hn,z(hn,f),hn.reserved=()=>Rn.length?hn.execute(Rn.shift()):z(hn,f)}}function z(O,q){return O.queue.remove(O),q.push(O),O.queue=q,q===$?O.idleTimer.start():O.idleTimer.cancel(),O}function E(O){return new Eo(O,3802)}function Q(O,q){if(!Array.isArray(O))return Q(Array.from(arguments));return new Eo(O,q||(O.length?If(O)||25:0),o.shared.typeArrayMap)}function b(O){if(p)return O.reject(tn.connection("CONNECTION_ENDED",o,o));if($.length)return y($.shift(),O);if(a.length)return En(a.shift(),O);w.length?y(w.shift(),O):x.push(O)}function y(O,q){return O.execute(q)?z(O,w):z(O,J)}function M(O){return new Promise((q,Rn)=>{O.state?O.active?k0(o).cancel(O.state,q,Rn):O.cancelled={resolve:q,reject:Rn}:(x.remove(O),O.cancelled=!0,O.reject(tn.generic("57014","canceling statement due to user request")),q())})}async function fn({timeout:O=null}={}){if(p)return p;await 1;let q;return p=Promise.race([new Promise((Rn)=>O!==null&&(q=setTimeout(an,O*1000,Rn))),Promise.all(W.map((Rn)=>Rn.end()).concat(l.sql?l.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(q))}async function Z(){await Promise.all(W.map((O)=>O.end()))}async function an(O){await Promise.all(W.map((q)=>q.terminate()));while(x.length)x.shift().reject(tn.connection("CONNECTION_DESTROYED",o));O()}function En(O,q){return z(O,m),O.connect(q),O}function gn(O){z(O,v)}function _i(O){if(x.length===0)return z(O,$);let q=Math.ceil(x.length/(m.length+1)),Rn=!0;while(Rn&&x.length&&q-- >0){let Dn=x.shift();if(Dn.reserve)return Dn.reserve(O);Rn=O.execute(Dn)}Rn?z(O,w):z(O,J)}function Oo(O,q){z(O,a),O.reserved=null,O.onclose&&(O.onclose(q),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&En(O,x.shift())}}function J2(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=X2(n),m=[...p.searchParams].reduce((J,[X,W])=>(J[X]=W,J),{}),f=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",a=c.port||p.port||o.PGPORT||5432,v=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||W2();c.no_prepare&&(c.prepare=!1),m.sslmode&&(m.ssl=m.sslmode,delete m.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),m.sslrootcert==="system"&&(m.ssl="verify-full");let $=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],w={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:F2,max_pipeline:100,backoff:T2,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(f)?f:f.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(a)?a:f.split(",").map((J)=>parseInt(J.split(":")[1]||a)),path:c.path||f.indexOf("/")>-1&&f+"/.s.PGSQL."+a,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||v,user:v,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(w).reduce((J,[X,W])=>{let R=X in c?c[X]:(X in m)?m[X]==="disable"||m[X]==="false"?!1:m[X]:o["PG"+X.toUpperCase()]||W;return J[X]=typeof R==="string"&&$.includes(X)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[X,W])=>((X in w)||(J[X]=W),J),{})},types:c.types||{},target_session_attrs:A2(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:R2(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...WR(c.types)}}function A2(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function T2(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function F2(){return 60*(30+Math.random()*30)}function R2(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function X2(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function W2(){try{return $2.userInfo().username}catch(n){return process.env.USERNAME||process.env.USER||process.env.LOGNAME}}class kn{static[T]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===bn)return{...n[bn],selectedFields:new Proxy(n[bn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(G(n,pi)?n._.selectedFields:G(n,Bi)?n[bn].selectedFields:n)[i];if(G(c,N.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(G(c,N)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(G(c,Un)){if(this.config.alias)return new Proxy(c,new Xp(new Proxy(c.table,new zx(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new kn(this.config))}}class gf extends Ei{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[T]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ti(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function K2(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function S2(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function G2(n){return n}class P0{static[T]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?K2:n==="camelCase"?S2:G2}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[D.Symbol.Schema]??"public",o=n.table[D.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[D.Symbol.Schema]??"public",o=n[D.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[D.Symbol.Columns])){let x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class ex extends Bi{static[T]="PgViewBase"}class Pc{static[T]="PgDialect";casing;constructor(n){this.casing=new P0(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",x=F`
82
- CREATE TABLE IF NOT EXISTS ${F.identifier(p)}.${F.identifier(c)} (
81
+ `};return c(f),new Promise(async(w)=>m=w);async function v({highWaterMark:w=16384,start:J=0,end:S=1/0}={}){let X=S-J;return J&&await f.seek(J),new jR.Readable({highWaterMark:w,async read(R){let K=R>X?R-X:R;X-=R;let[{data:M}]=await f.read(K);if(this.push(M),M.length<R)this.push(null)}})}async function $({highWaterMark:w=16384,start:J=0}={}){return J&&await f.seek(J),new jR.Writable({highWaterMark:w,write(S,X,R){f.write(S).then(()=>R(),R)}})}}).catch(p)})}Object.assign(ra,{PostgresError:Pp,toPascal:kc,pascal:C$,toCamel:yc,camel:h$,toKebab:Zc,kebab:I$,fromPascal:rx,fromCamel:tx,fromKebab:dx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var rp=ra;function ra(n,i){let o=WM(n,i),c=o.no_subscribe||s$(ra,{...o}),p=!1,x=ki(),m=ki(),a=ki(),f=ki(),v=ki(),$=ki(),w=ki(),J=ki(),S={connecting:m,reserved:a,closed:f,ended:v,open:$,busy:w,full:J},X=[...Array(o.max)].map(()=>q$(o,S,{onopen:Vi,onend:dn,onclose:Oo})),R=K(b);return Object.assign(R,{get parameters(){return o.parameters},largeObject:P$.bind(null,R),subscribe:c,CLOSE:sp,END:sp,PostgresError:Pp,options:o,reserve:I,listen:M,begin:G,close:Z,end:an}),R;function K(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[_n,Pn])=>{return vn[_n]=(Nn)=>new Eo(Nn,Pn.to),vn},q),Object.assign(Rn,{types:q,typed:q,unsafe:Dn,notify:Y,array:Q,json:E,file:gn}),Rn;function q(vn,_n){return new Eo(vn,_n)}function Rn(vn,..._n){return vn&&Array.isArray(vn.raw)?new oo(vn,_n,O,H):typeof vn==="string"&&!_n.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new ka(vn,_n)}function Dn(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new oo([vn],_n,O,H,{prepare:!1,...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}function gn(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new oo([],_n,(Bn)=>{XM.readFile(vn,"utf8",(Fi,bn)=>{if(Fi)return Bn.reject(Fi);Bn.strings=[bn],O(Bn)})},H,{...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}}async function M(O,q,Rn){let Dn={fn:q,onlisten:Rn},gn=M.sql||(M.sql=ra({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(M.channels).forEach(([Bn,{listeners:Fi}])=>{delete M.channels[Bn],Promise.all(Fi.map((bn)=>M(Bn,bn.fn,bn.onlisten).catch(()=>{})))})},onnotify(Bn,Fi){Bn in M.channels&&M.channels[Bn].listeners.forEach((bn)=>bn.fn(Fi))}})),vn=M.channels||(M.channels={});if(O in vn){vn[O].listeners.push(Dn);let Bn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:Bn.state,unlisten:Nn}}vn[O]={result:gn`listen ${gn.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[Dn]};let Pn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:Pn.state,unlisten:Nn};async function Nn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((Bn)=>Bn!==Dn),vn[O].listeners.length)return;return delete vn[O],gn`unlisten ${gn.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function Y(O,q){return await R`select pg_notify(${O}, ${""+q})`}async function I(){let O=ki(),q=$.length?$.shift():await new Promise((gn)=>{x.push({reserve:gn}),f.length&&En(f.shift())});z(q,a),q.reserved=()=>O.length?q.execute(O.shift()):z(q,a),q.reserved.release=!0;let Rn=K(Dn);return Rn.release=()=>{q.reserved=null,Vi(q)},Rn;function Dn(gn){q.queue===J?O.push(gn):q.execute(gn)||z(q,J)}}async function G(O,q){!q&&(q=O,O="");let Rn=ki(),Dn=0,gn,vn=null;try{return await R.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:Pn}).execute(),await Promise.race([_n(gn,q),new Promise((Nn,Bn)=>gn.onclose=Bn)])}catch(Nn){throw Nn}async function _n(Nn,Bn,Fi){let bn=K(en);bn.savepoint=ho,bn.prepare=(jn)=>vn=jn.replace(/[^a-z0-9$-_. ]/gi);let co,Ti;Fi&&await bn`savepoint ${bn(Fi)}`;try{if(Ti=await new Promise((jn,po)=>{let Xo=Bn(bn);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(jn,po)}),co)throw co}catch(jn){throw await(Fi?bn`rollback to ${bn(Fi)}`:bn`rollback`),jn instanceof Pp&&jn.code==="25P02"&&co||jn}if(!Fi)vn?await bn`prepare transaction '${bn.unsafe(vn)}'`:await bn`commit`;return Ti;function ho(jn,po){if(jn&&Array.isArray(jn.raw))return ho((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(po=jn,jn=null),_n(Nn,po,"s"+Dn+++(jn?"_"+jn:""))}function en(jn){jn.catch((po)=>co||(co=po)),Nn.queue===J?Rn.push(jn):Nn.execute(jn)||z(Nn,J)}}function Pn(Nn){gn=Nn,z(Nn,a),Nn.reserved=()=>Rn.length?Nn.execute(Rn.shift()):z(Nn,a)}}function z(O,q){return O.queue.remove(O),q.push(O),O.queue=q,q===$?O.idleTimer.start():O.idleTimer.cancel(),O}function E(O){return new Eo(O,3802)}function Q(O,q){if(!Array.isArray(O))return Q(Array.from(arguments));return new Eo(O,q||(O.length?Ia(O)||25:0),o.shared.typeArrayMap)}function b(O){if(p)return O.reject(rn.connection("CONNECTION_ENDED",o,o));if($.length)return y($.shift(),O);if(f.length)return En(f.shift(),O);w.length?y(w.shift(),O):x.push(O)}function y(O,q){return O.execute(q)?z(O,w):z(O,J)}function H(O){return new Promise((q,Rn)=>{O.state?O.active?q$(o).cancel(O.state,q,Rn):O.cancelled={resolve:q,reject:Rn}:(x.remove(O),O.cancelled=!0,O.reject(rn.generic("57014","canceling statement due to user request")),q())})}async function an({timeout:O=null}={}){if(p)return p;await 1;let q;return p=Promise.race([new Promise((Rn)=>O!==null&&(q=setTimeout(fn,O*1000,Rn))),Promise.all(X.map((Rn)=>Rn.end()).concat(M.sql?M.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(q))}async function Z(){await Promise.all(X.map((O)=>O.end()))}async function fn(O){await Promise.all(X.map((q)=>q.terminate()));while(x.length)x.shift().reject(rn.connection("CONNECTION_DESTROYED",o));O()}function En(O,q){return z(O,m),O.connect(q),O}function dn(O){z(O,v)}function Vi(O){if(x.length===0)return z(O,$);let q=Math.ceil(x.length/(m.length+1)),Rn=!0;while(Rn&&x.length&&q-- >0){let Dn=x.shift();if(Dn.reserve)return Dn.reserve(O);Rn=O.execute(Dn)}Rn?z(O,w):z(O,J)}function Oo(O,q){z(O,f),O.reserved=null,O.onclose&&(O.onclose(q),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&En(O,x.shift())}}function WM(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=YM(n),m=[...p.searchParams].reduce((J,[S,X])=>(J[S]=X,J),{}),a=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",f=c.port||p.port||o.PGPORT||5432,v=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||HM();c.no_prepare&&(c.prepare=!1),m.sslmode&&(m.ssl=m.sslmode,delete m.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),m.sslrootcert==="system"&&(m.ssl="verify-full");let $=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],w={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:GM,max_pipeline:100,backoff:lM,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(a)?a:a.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(f)?f:a.split(",").map((J)=>parseInt(J.split(":")[1]||f)),path:c.path||a.indexOf("/")>-1&&a+"/.s.PGSQL."+f,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||v,user:v,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(w).reduce((J,[S,X])=>{let R=S in c?c[S]:(S in m)?m[S]==="disable"||m[S]==="false"?!1:m[S]:o["PG"+S.toUpperCase()]||X;return J[S]=typeof R==="string"&&$.includes(S)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[S,X])=>((S in w)||(J[S]=X),J),{})},types:c.types||{},target_session_attrs:KM(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:MM(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...HR(c.types)}}function KM(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function lM(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function GM(){return 60*(30+Math.random()*30)}function MM(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function YM(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function HM(){try{return SM.userInfo().username}catch(n){return process.env.USERNAME||process.env.USER||process.env.LOGNAME}}class kn{static[F]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===un)return{...n[un],selectedFields:new Proxy(n[un].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(l(n,ci)?n._.selectedFields:l(n,bi)?n[un].selectedFields:n)[i];if(l(c,L.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(l(c,L)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(l(c,Un)){if(this.config.alias)return new Proxy(c,new Sp(new Proxy(c.table,new Qx(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new kn(this.config))}}class da extends Qi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[F]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=di(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function zM(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function QM(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function EM(n){return n}class t${static[F]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?zM:n==="camelCase"?QM:EM}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[D.Symbol.Schema]??"public",o=n.table[D.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[D.Symbol.Schema]??"public",o=n[D.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[D.Symbol.Columns])){let x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class nm extends bi{static[F]="PgViewBase"}class sc{static[F]="PgDialect";casing;constructor(n){this.casing=new t$(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",x=T`
82
+ CREATE TABLE IF NOT EXISTS ${T.identifier(p)}.${T.identifier(c)} (
83
83
  id SERIAL PRIMARY KEY,
84
84
  hash text NOT NULL,
85
85
  created_at bigint
86
86
  )
87
- `;await i.execute(F`CREATE SCHEMA IF NOT EXISTS ${F.identifier(p)}`),await i.execute(x);let f=(await i.all(F`select id, hash, created_at from ${F.identifier(p)}.${F.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(a)=>{for await(let v of n)if(!f||Number(f.created_at)<v.folderMillis){for(let $ of v.sql)await a.execute(F.raw($));await a.execute(F`insert into ${F.identifier(p)}.${F.identifier(c)} ("hash", "created_at") values(${v.hash}, ${v.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[F`with `];for(let[o,c]of n.entries())if(i.push(F`${F.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(F`, `);return i.push(F` `),F.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),x=o?F` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?F` where ${i}`:void 0;return F`${p}delete from ${n}${m}${x}`}buildUpdateSet(n,i){let o=n[D.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return F.join(c.flatMap((x,m)=>{let f=o[x],a=i[x]??F.param(f.onUpdateFn(),f),v=F`${F.identifier(this.casing.getColumnCasing(f))} = ${a}`;if(m<p-1)return[v,F.raw(", ")];return[v]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let f=this.buildWithCTE(p),a=n[Ai.Symbol.Name],v=n[Ai.Symbol.Schema],$=n[Ai.Symbol.OriginalName],w=a===$?void 0:a,J=F`${v?F`${F.identifier(v)}.`:void 0}${F.identifier($)}${w&&F` ${F.identifier(w)}`}`,X=this.buildUpdateSet(n,i),W=x&&F.join([F.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),S=c?F` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,l=o?F` where ${o}`:void 0;return F`${f}update ${J} set ${X}${W}${R}${l}${S}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(G(p,N.Aliased)&&p.isSelectionField)m.push(F.identifier(p.fieldAlias));else if(G(p,N.Aliased)||G(p,N)){let f=G(p,N.Aliased)?p.sql:p;if(i)m.push(new N(f.queryChunks.map((a)=>{if(G(a,V))return F.identifier(this.casing.getColumnCasing(a));return a})));else m.push(f);if(G(p,N.Aliased))m.push(F` as ${F.identifier(p.fieldAlias)}`)}else if(G(p,Un))if(i)m.push(F.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(x<o-1)m.push(F`, `);return m});return F.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(F` `);let p=c.table,x=c.lateral?F` lateral`:void 0;if(G(p,Ai)){let m=p[Ai.Symbol.Name],f=p[Ai.Symbol.Schema],a=p[Ai.Symbol.OriginalName],v=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${v&&F` ${F.identifier(v)}`} on ${c.on}`)}else if(G(p,Bi)){let m=p[bn].name,f=p[bn].schema,a=p[bn].originalName,v=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${v&&F` ${F.identifier(v)}`} on ${c.on}`)}else i.push(F`${F.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(F` `)}return F.join(i)}buildFromTable(n){if(G(n,D)&&n[D.Symbol.OriginalName]!==n[D.Symbol.Name]){let i=F`${F.identifier(n[D.Symbol.OriginalName])}`;if(n[D.Symbol.Schema])i=F`${F.identifier(n[D.Symbol.Schema])}.${i}`;return F`${i} ${F.identifier(n[D.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:f,groupBy:a,limit:v,offset:$,lockingClause:w,distinct:J,setOperators:X}){let W=o??ti(i);for(let an of W)if(G(an.field,Un)&&fi(an.field.table)!==(G(x,pi)?x._.alias:G(x,ex)?x[bn].name:G(x,N)?void 0:fi(x))&&!((En)=>m?.some(({alias:gn})=>gn===(En[D.Symbol.IsAlias]?fi(En):En[D.Symbol.BaseName])))(an.field.table)){let En=fi(an.field.table);throw new Error(`Your "${an.path.join("->")}" field references a column "${En}"."${an.field.name}", but the table "${En}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,S=this.buildWithCTE(n),l;if(J)l=J===!0?F` distinct`:F` distinct on (${F.join(J.on,F`, `)})`;let H=this.buildSelection(W,{isSingleTable:R}),I=this.buildFromTable(x),Y=this.buildJoins(m),z=c?F` where ${c}`:void 0,E=p?F` having ${p}`:void 0,Q;if(f&&f.length>0)Q=F` order by ${F.join(f,F`, `)}`;let b;if(a&&a.length>0)b=F` group by ${F.join(a,F`, `)}`;let y=typeof v==="object"||typeof v==="number"&&v>=0?F` limit ${v}`:void 0,M=$?F` offset ${$}`:void 0,fn=F.empty();if(w){let an=F` for ${F.raw(w.strength)}`;if(w.config.of)an.append(F` of ${F.join(Array.isArray(w.config.of)?w.config.of:[w.config.of],F`, `)}`);if(w.config.noWait)an.append(F` no wait`);else if(w.config.skipLocked)an.append(F` skip locked`);fn.append(an)}let Z=F`${S}select${l} ${H} from ${I}${Y}${z}${b}${E}${Q}${y}${M}${fn}`;if(X.length>0)return this.buildSetOperations(Z,X);return Z}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:x,offset:m}}){let f=F`(${n.getSQL()}) `,a=F`(${c.getSQL()})`,v;if(x&&x.length>0){let X=[];for(let W of x)if(G(W,V))X.push(F.identifier(W.name));else if(G(W,N)){for(let R=0;R<W.queryChunks.length;R++){let S=W.queryChunks[R];if(G(S,V))W.queryChunks[R]=F.identifier(S.name)}X.push(F`${W}`)}else X.push(F`${W}`);v=F` order by ${F.join(X,F`, `)} `}let $=typeof p==="object"||typeof p==="number"&&p>=0?F` limit ${p}`:void 0,w=F.raw(`${i} ${o?"all ":""}`),J=m?F` offset ${m}`:void 0;return F`${f}${w}${a}${v}${$}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let f=[],a=n[D.Symbol.Columns],v=Object.entries(a).filter(([S,l])=>!l.shouldDisableInsert()),$=v.map(([,S])=>F.identifier(this.casing.getColumnCasing(S)));if(x){let S=i;if(G(S,N))f.push(S);else f.push(S.getSQL())}else{let S=i;f.push(F.raw("values "));for(let[l,H]of S.entries()){let I=[];for(let[Y,z]of v){let E=H[Y];if(E===void 0||G(E,Di)&&E.value===void 0)if(z.defaultFn!==void 0){let Q=z.defaultFn(),b=G(Q,N)?Q:F.param(Q,z);I.push(b)}else if(!z.default&&z.onUpdateFn!==void 0){let Q=z.onUpdateFn(),b=G(Q,N)?Q:F.param(Q,z);I.push(b)}else I.push(F`default`);else I.push(E)}if(f.push(I),l<S.length-1)f.push(F`, `)}}let w=this.buildWithCTE(p),J=F.join(f),X=c?F` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,W=o?F` on conflict ${o}`:void 0,R=m===!0?F`overriding system value `:void 0;return F`${w}insert into ${n} ${$} ${R}${J}${W}${X}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?F` concurrently`:void 0,p=o?F` with no data`:void 0;return F`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(G(n,nf)||G(n,em))return"json";else if(G(n,of))return"decimal";else if(G(n,cf))return"time";else if(G(n,pf)||G(n,xf))return"timestamp";else if(G(n,tm)||G(n,gm))return"date";else if(G(n,mf))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:x,tableAlias:m,nestedQueryRelation:f,joinOn:a}){let v=[],$,w,J=[],X,W=[];if(x===!0)v=Object.entries(p.columns).map(([l,H])=>({dbKey:H.name,tsKey:l,field:lo(H,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let S=Object.fromEntries(Object.entries(p.columns).map(([E,Q])=>[E,lo(Q,m)]));if(x.where){let E=typeof x.where==="function"?x.where(S,eT()):x.where;X=E&&Qx(E,m)}let l=[],H=[];if(x.columns){let E=!1;for(let[Q,b]of Object.entries(x.columns)){if(b===void 0)continue;if(Q in p.columns){if(!E&&b===!0)E=!0;H.push(Q)}}if(H.length>0)H=E?H.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!H.includes(Q))}else H=Object.keys(p.columns);for(let E of H){let Q=p.columns[E];l.push({tsKey:E,value:Q})}let I=[];if(x.with)I=Object.entries(x.with).filter((E)=>!!E[1]).map(([E,Q])=>({tsKey:E,queryConfig:Q,relation:p.relations[E]}));let Y;if(x.extras){Y=typeof x.extras==="function"?x.extras(S,{sql:F}):x.extras;for(let[E,Q]of Object.entries(Y))l.push({tsKey:E,value:Sv(Q,m)})}for(let{tsKey:E,value:Q}of l)v.push({dbKey:G(Q,N.Aliased)?Q.fieldAlias:p.columns[E].name,tsKey:E,field:G(Q,Un)?lo(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let z=typeof x.orderBy==="function"?x.orderBy(S,nF()):x.orderBy??[];if(!Array.isArray(z))z=[z];J=z.map((E)=>{if(G(E,Un))return lo(E,m);return Qx(E,m)}),$=x.limit,w=x.offset;for(let{tsKey:E,queryConfig:Q,relation:b}of I){let y=oF(i,o,b),M=Ec(b.referencedTable),fn=o[M],Z=`${m}_${E}`,an=Oc(...y.fields.map((_i,Oo)=>Ho(lo(y.references[Oo],Z),lo(_i,m)))),En=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[fn],tableConfig:i[fn],queryConfig:G(b,ic)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:an,nestedQueryRelation:b}),gn=F`${F.identifier(Z)}.${F.identifier("data")}`.as(E);W.push({on:F`true`,table:new pi(En.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),v.push({dbKey:E,tsKey:E,field:gn,relationTableTsKey:fn,isJson:!0,selection:En.selection})}}if(v.length===0)throw new Pm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(X=Oc(a,X),f){let S=F`json_build_array(${F.join(v.map(({field:I,tsKey:Y,isJson:z})=>z?F`${F.identifier(`${m}_${Y}`)}.${F.identifier("data")}`:G(I,N.Aliased)?I.sql:I),F`, `)})`;if(G(f,Vx))S=F`coalesce(json_agg(${S}${J.length>0?F` order by ${F.join(J,F`, `)}`:void 0}), '[]'::json)`;let l=[{dbKey:"data",tsKey:"data",field:S.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:v}];if($!==void 0||w!==void 0||J.length>0)R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:[{path:[],field:F.raw("*")}],where:X,limit:$,offset:w,orderBy:J,setOperators:[]}),X=void 0,$=void 0,w=void 0,J=[];else R=qm(c,m);R=this.buildSelectQuery({table:G(R,Ai)?R:new pi(R,{},m),fields:{},fieldsFlat:l.map(({field:I})=>({path:[],field:G(I,Un)?lo(I,m):I})),joins:W,where:X,limit:$,offset:w,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:v.map(({field:S})=>({path:[],field:G(S,Un)?lo(S,m):S})),joins:W,where:X,limit:$,offset:w,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:v}}}class s0{static[T]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Vi{static[T]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o=n,c;if(this.fields)c=this.fields;else if(G(o,pi))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(G(o,ex))c=o[bn].selectedFields;else if(G(o,N))c={};else c=cA(o);return new r0({table:o,fields:c,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class UR extends s0{static[T]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:m}){super();this.config={withList:x,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=_o(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!G(i,N)){let x=G(i,pi)?i._.selectedFields:G(i,Bi)?i[bn].selectedFields:i[D.Symbol.Columns];this.config.fields[p]=x}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o(Y2()):o;if(!Ex(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new pi(this.getSQL(),this.config.fields,n),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new kn({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class r0 extends UR{static[T]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let m=ti(o.fields),f=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return f.joinsNotNullableMap=p,f.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}oA(r0,[Ei]);function gp(n,i){return(o,c,...p)=>{let x=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of x)if(!Ex(o.getSelectedFields(),m.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(x)}}var Y2=()=>({union:l2,unionAll:H2,intersect:M2,intersectAll:z2,except:Q2,exceptAll:E2}),l2=gp("union",!1),H2=gp("union",!0),M2=gp("intersect",!1),z2=gp("intersect",!0),Q2=gp("except",!1),E2=gp("except",!0);class nm{static[T]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=G(n,Pc)?n:void 0,this.dialectConfig=G(n,Pc)?void 0:n}$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(o);return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...n){let i=this;function o(x){return new Vi({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Vi({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new Vi({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Vi({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Vi({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Vi({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new Pc(this.dialectConfig);return this.dialect}}class df{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[T]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[D.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=G(m,N)?m:new Di(m,p[x])}return c});return new t0(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new nm):n;if(!G(i,N)&&!Ex(this.table[km],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new t0(this.table,i,this.session,this.dialect,this.withList,!0)}}class t0 extends Ei{constructor(n,i,o,c,p,x,m){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:m}}static[T]="PgInsert";config;returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ti(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=F`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?F` where ${n.where}`:void 0;this.config.onConflict=F`(${F.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?F` where ${n.where}`:void 0,o=n.targetWhere?F` where ${n.targetWhere}`:void 0,c=n.setWhere?F` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,rm(this.config.table,n.set)),x="";return x=Array.isArray(n.target)?n.target.map((m)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(m))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=F`(${F.raw(x)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class g0 extends Ei{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[T]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class ef{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[T]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new VR(this.table,rm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class VR extends Ei{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[T]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=n,o=_o(i);if(typeof o==="string")this.joinsNotNullableMap[o]=!0;return this.config.from=i,this}getTableLikeFields(n){if(G(n,Ai))return n[D.Symbol.Columns];else if(G(n,pi))return n._.selectedFields;return n[bn].selectedFields}createJoin(n){return(i,o)=>{let c=_o(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!G(this.config.from,N)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[D.Symbol.Columns],new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[D.Symbol.Columns]),this.config.from){let i=_o(this.config.from);if(typeof i==="string"&&this.config.from&&!G(this.config.from,N)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=_o(o.table);if(typeof c==="string"&&!G(o.table,N)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=ti(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class im extends N{constructor(n){super(im.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=im.buildCount(n.source,n.filters)}sql;token;static[T]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return F`(select count(*) from ${n}${F.raw(" where ").if(i)}${i})`}static buildCount(n,i){return F`select count(*) as count from ${n}${F.raw(" where ").if(i)}${i};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class e0{constructor(n,i,o,c,p,x,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m}static[T]="PgRelationalQueryBuilder";findMany(n){return new d0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new d0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class d0 extends Ei{constructor(n,i,o,c,p,x,m,f,a){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=f,this.mode=a}static[T]="PgRelationalQuery";_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((m)=>ff(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return x[0];return x})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(n){return this.authToken=n,this}execute(){return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class n$ extends Ei{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[T]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class om{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new e0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[T]="PgDatabase";query;$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(new nm(o.dialect));return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(n,i){return new im({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(a){return new Vi({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(a){return new Vi({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(a,v){return new Vi({fields:v??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:a}})}function x(a){return new ef(a,i.session,i.dialect,n)}function m(a){return new df(a,i.session,i.dialect,n)}function f(a){return new gf(a,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:f}}select(n){return new Vi({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Vi({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Vi({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new ef(n,this.session,this.dialect)}insert(n){return new df(n,this.session,this.dialect)}delete(n){return new gf(n,this.session,this.dialect)}refreshMaterializedView(n){return new g0(n,this.session,this.dialect)}authToken;execute(n){let i=typeof n==="string"?F.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new n$(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class _R{constructor(n,i){this.unique=n,this.name=i}static[T]="PgIndexBuilderOn";on(...n){return new na(n.map((i)=>{if(G(i,N))return i;i=i;let o=new lx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new na(n.map((i)=>{if(G(i,N))return i;i=i;let o=new lx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new na(i.map((o)=>{if(G(o,N))return o;o=o;let c=new lx(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class na{static[T]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new BR(this.config,n)}}class BR{static[T]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function i$(n){return new _R(!0,n)}class o${constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[T]="PgPreparedQuery";joinsNotNullableMap}class c${constructor(n){this.dialect=n}static[T]="PgSession";execute(n,i){return Vn.startActiveSpan("drizzle.operation",()=>{return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class p$ extends om{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[T]="PgTransaction";rollback(){throw new Gv}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return F.raw(i.join(" "))}setTransaction(n){return this.session.execute(F`set transaction ${this.getTransactionConfigSQL(n)}`)}}class bR extends o${constructor(n,i,o,c,p,x,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=m}static[T]="PostgresJsPreparedQuery";async execute(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=Kv(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:x,joinsNotNullableMap:m,customResultMapper:f}=this;if(!c&&!f)return Vn.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let a=await Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return Vn.startActiveSpan("drizzle.mapResponse",()=>{return f?f(a):a.map((v)=>iA(c,v,m))})})}all(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=Kv(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class cm extends c${constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new lv}static[T]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new bR(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new cm(o,this.dialect,this.schema,this.options),p=new x$(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class x$ extends p${constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[T]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new cm(i,this.dialect,this.schema,this.session.options),c=new x$(this.dialect,o,this.schema);return n(c)})}}class jR extends om{static[T]="PostgresJsDatabase"}function dp(n,i={}){let o=(a)=>a;for(let a of["1184","1082","1083","1114"])n.options.parsers[a]=o,n.options.serializers[a]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new Pc({casing:i.casing}),p;if(i.logger===!0)p=new Yv;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let a=iF(i.schema,cF);x={fullSchema:i.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}let m=new cm(n,c,x,{logger:p}),f=new jR(c,m,x);return f.$client=n,f}function ia(...n){if(typeof n[0]==="string"){let i=tp(n[0]);return dp(i,n[1])}if(pA(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return dp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,f=tp(x,m);return dp(f,c)}let p=tp(i);return dp(p,c)}return dp(n[0],n[1])}((n)=>{function i(o){return dp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(ia||(ia={}));var f$={};g3(f$,{users:()=>Ro,userChanges:()=>U2,untrackedUserColumnNames:()=>O2,twoFactorMethod:()=>CR,trackedUserColumnName:()=>hR,trackableUserColumnNames:()=>NR,role:()=>DR,players:()=>m$,passwordResetAttempts:()=>V2,loginHistory:()=>ep,games:()=>oa,banishedIps:()=>ca});function LR(n){return F`lower(${n})`}var DR=Im("role",["admin","user"]),Ro=nc("users",{id:Ni().primaryKey().defaultRandom(),username:Ji({length:16}).notNull(),email:Ji({length:254}).notNull(),hash:Ji({length:64}).notNull(),salt:Ji({length:36}).notNull(),createdAt:ao({withTimezone:!0}).notNull().defaultNow(),createdIp:Ji({length:45}).notNull(),isActive:Ox().notNull().default(!1),verifiedAt:ao({withTimezone:!0}),userRole:DR().default("user")},(n)=>[i$("usernameUniqueIndex").on(LR(n.username)),i$("emailUniqueIndex").on(LR(n.email))]),O2=["id","createdAt","createdIp","isActive","salt","verifiedAt"],NR=["username","email","hash","userRole"],hR=Im("trackedUserColumnName",NR),U2=nc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ro.id),changedAt:ao({withTimezone:!0}).notNull().defaultNow(),changedIp:Ji({length:45}).notNull(),changedColumn:hR().notNull(),oldValue:Ji({length:255}),newValue:Ji({length:255})}),oa=nc("games",{id:Ni().primaryKey().defaultRandom()}),m$=nc("players",{userId:Ni().notNull().references(()=>Ro.id),gameId:Ni().notNull().references(()=>oa.id),score:dm().notNull()},(n)=>[tT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ep=nc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Ro.id),loginTime:ao({withTimezone:!0}).notNull().defaultNow(),ipAddress:Ji({length:45}).notNull(),userAgent:Ji({length:1024}),successful:Ox().notNull().default(!1)}),CR=Im("twoFactorMethod",["email","phone"]),V2=nc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ro.id),requestedIp:Ji({length:45}).notNull(),requestedAt:ao({withTimezone:!0}).notNull().defaultNow(),succeededIp:Ji({length:45}),succeededAt:ao({withTimezone:!0}),verificationMethod:CR().notNull()}),ca=nc("banishedIps",{ip:Ji({length:45}).primaryKey(),reason:Ji({length:2048}).notNull(),banishedAt:ao({withTimezone:!0}).notNull().defaultNow(),banishedUntil:ao({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class a${options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(_2.resolve(__dirname,"notify_update.sql"));let n=[fi(Ro),fi(oa),fi(m$)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:Pn.POSTGRES_HOST,port:Pn.POSTGRES_PORT,user:Pn.POSTGRES_USER,password:Pn.POSTGRES_PASSWORD,database:Pn.POSTGRES_DATABASE}){this.options=i,this.sql=tp(i),this.drizzle=ia(this.sql,{schema:f$,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new $n);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as B2}from"crypto";function v$(n){let i=B2("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var uR=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var b2=3,j2=15,L2=/^[a-zA-Z0-9_-]+$/,kR=Kn.string().min(b2).max(j2).regex(L2),IR=20,yR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function D2(n){let i="";for(let o of n)if(o in yR)i+=yR[o];else i+=o;return i}function N2(n){let i=n.toLocaleLowerCase(),o=D2(i);for(let c of uR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function h2(n){let i=new Set(n).size;return n.length*Math.log2(i)}function C2(n){let i=0,o=100;if(N2(n))i-=o;return i+=h2(n)*0.5,Math.max(i,0)}var ZR=Kn.string().refine((n)=>{return C2(n)>=IR},{message:`Password does not meet the minimum complexity of ${IR}.`}).brand("password"),qR=Kn.object({username:kR,password:ZR}).strict(),u2=Kn.string().email().brand("email"),PR=Kn.object({username:kR,password:ZR,email:u2}).strict();var pa={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},$$=Y$(pa).map(([n])=>Kn.literal(Number(n))),I2=Kn.union([$$[0],$$[1],...$$]),sR=Kn.tuple([I2,Kn.string()]);var rR=Zo({key:"count",default:0}),y2=Gc({key:"incrementTX",do:({set:n})=>{n(rR,(i)=>i+1)}}),tR=T1({key:"countContinuity",config:(n)=>n.add(rR).add(y2)});var dR=E0($c,"backend.worker.game.bun",mn),sc=new a$({logQuery(n,i){mn.info("\uD83D\uDCDD query",n,i)}});d.STORE.loggers[0]=new Wc("info",void 0,mn);var eI=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new eR.CronJob("00 15 * * * *",()=>{E0($c,"backend.worker.tribunal.bun",mn)}),n.start(),process.on("exit",()=>{n.stop(),mn.info("\u231B tribunal daily cronjob stopped")}),mn.info("\u23F3 tribunal daily cronjob started");return n})();function q2(n){if(Q0)return Z2(Q0,n);return k2({},n)}var n3=q2((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let x=new Date,m=new URL(n.url,Pn.VITE_BACKEND_ORIGIN);mn.info(x,p,n.method,m.pathname);let f=await sc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Ho(ca.ip,p)}),a=f?.banishedUntil===null,v=f?.banishedUntil&&f.banishedUntil>x;if(a||v){mn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(m.pathname){case`/sign-up-${v$("sign-up")}`:{let $=Buffer.concat(o).toString(),w=JSON.parse($),J=PR.safeParse(w);if(!J.success){mn.warn("signup parsed",J.error.issues);return}let{username:X,password:W,email:R}=J.data;if(mn.info(`\uD83D\uDD11 attempting to sign up: ${X}`),await sc.drizzle.query.users.findFirst({columns:{id:!0},where:Ho(Ro.email,R)}))throw[400,"User already exists"];let l=crypto.randomUUID(),H=gR("sha256").update(W+l).digest("hex");await sc.drizzle.insert(Ro).values({username:X,email:R,hash:H,salt:l,createdIp:p}),mn.info(`\uD83D\uDD11 user created: ${X}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(pa[201])}break;case`/login-${v$("login")}`:{let $=!1,w=null;try{let J=new Date(+x-600000);mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:J,now:x});let X=await sc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Ho(ep.ipAddress,p),Ho(ep.successful,!1),sm(ep.loginTime,J)),limit:10});mn.info(`\uD83D\uDD11 ${X.length}/10 recent failed logins from ${p}`);let W=10-X.length;if(W<1)throw mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await sc.drizzle.insert(ca).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let R=Buffer.concat(o).toString(),S=JSON.parse(R),l=qR.safeParse(S);if(!l.success)throw mn.warn("login parsed",l.error.issues),[400,`${W} attempts remaining.`];let{username:H,password:I}=l.data,Y=await sc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Ho(Ro.username,H)});if(mn.info("\uD83D\uDD11 login attempt as user",H),!Y)throw mn.info(`\uD83D\uDD11 user ${H} does not exist`),[400,`${W} attempts remaining.`];let{hash:z,salt:E}=Y;if(w=Y.id,gR("sha256").update(I+E).digest("hex")===z){let b=crypto.randomUUID(),y=hf.get(H);if(!y)y=new Map,hf.set(H,y);y.set(b,Number(x)),$=!0,mn.info("\uD83D\uDD11 login successful as",H),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(`${H} ${b}`)}}finally{await sc.drizzle.insert(ep).values({userId:w,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}break;default:throw[404,"Not found"]}break;case void 0:throw[400,"No Method"];default:throw[405,"Method not allowed"]}}catch(p){let x=sR.safeParse(p);if(x.success){let[m,f]=x.data,v=`${pa[m]}. ${f}`;mn.info(`\u274C ${m}: ${v}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(v)}else mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),w$=n3.listen(Pn.BACKEND_PORT).address(),P2=typeof w$==="string"?null:w$===null?null:w$.port;if(P2===null)throw new Error("Could not determine port for test server");new q6(n3,{cors:{origin:Pn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,x=`socket::${n.id}`;if(hf.get(o)?.has(c)){let f=r(d.STORE,Km,x);On(d.STORE,f,n),ko(Yc,(a)=>{a.set(p,x)},d.STORE),On(d.STORE,Va,(a)=>a.add(p)),On(d.STORE,Ua,(a)=>a.add(x)),mn.info(`${o} connected on ${n.id}`),i()}else mn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Y1({socket:n,store:d.STORE})(tR);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Yc,c,d.STORE).userKeyOfSocket,x=ln(d.STORE,p);if(ko(Yc,(m)=>{m.delete(c)},d.STORE),x)On(d.STORE,Va,(m)=>(m.delete(x),m));On(d.STORE,Ua,(m)=>(m.delete(c),m)),mn.info(`${n.id} disconnected`),o()})});async function xa(){mn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>dR.process.once("close",i));dR.emit("timeToStop"),await n,mn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{mn.info("\u2757 received SIGINT; exiting gracefully"),await xa()});process.on("SIGTERM",async()=>{mn.info("\u2757 received SIGTERM; exiting gracefully"),await xa()});process.on("exit",async()=>{mn.info("\u2757 received exit; exiting gracefully"),await xa()});$c.on("updatesReady",()=>{mn.info('\u2757 backend server received signal "updatesReady"'),$c.emit("readyToUpdate"),mn.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),$c.on("timeToStop",async()=>{mn.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await xa()})});mn.info(`\uD83D\uDEEB backend server ready on port ${Pn.BACKEND_PORT}`);$c.emit("alive");export{eI as tribunalDaily};
87
+ `;await i.execute(T`CREATE SCHEMA IF NOT EXISTS ${T.identifier(p)}`),await i.execute(x);let a=(await i.all(T`select id, hash, created_at from ${T.identifier(p)}.${T.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(f)=>{for await(let v of n)if(!a||Number(a.created_at)<v.folderMillis){for(let $ of v.sql)await f.execute(T.raw($));await f.execute(T`insert into ${T.identifier(p)}.${T.identifier(c)} ("hash", "created_at") values(${v.hash}, ${v.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[T`with `];for(let[o,c]of n.entries())if(i.push(T`${T.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(T`, `);return i.push(T` `),T.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),x=o?T` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?T` where ${i}`:void 0;return T`${p}delete from ${n}${m}${x}`}buildUpdateSet(n,i){let o=n[D.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return T.join(c.flatMap((x,m)=>{let a=o[x],f=i[x]??T.param(a.onUpdateFn(),a),v=T`${T.identifier(this.casing.getColumnCasing(a))} = ${f}`;if(m<p-1)return[v,T.raw(", ")];return[v]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let a=this.buildWithCTE(p),f=n[Ai.Symbol.Name],v=n[Ai.Symbol.Schema],$=n[Ai.Symbol.OriginalName],w=f===$?void 0:f,J=T`${v?T`${T.identifier(v)}.`:void 0}${T.identifier($)}${w&&T` ${T.identifier(w)}`}`,S=this.buildUpdateSet(n,i),X=x&&T.join([T.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),K=c?T` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,M=o?T` where ${o}`:void 0;return T`${a}update ${J} set ${S}${X}${R}${M}${K}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(l(p,L.Aliased)&&p.isSelectionField)m.push(T.identifier(p.fieldAlias));else if(l(p,L.Aliased)||l(p,L)){let a=l(p,L.Aliased)?p.sql:p;if(i)m.push(new L(a.queryChunks.map((f)=>{if(l(f,V))return T.identifier(this.casing.getColumnCasing(f));return f})));else m.push(a);if(l(p,L.Aliased))m.push(T` as ${T.identifier(p.fieldAlias)}`)}else if(l(p,Un))if(i)m.push(T.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(x<o-1)m.push(T`, `);return m});return T.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(T` `);let p=c.table,x=c.lateral?T` lateral`:void 0;if(l(p,Ai)){let m=p[Ai.Symbol.Name],a=p[Ai.Symbol.Schema],f=p[Ai.Symbol.OriginalName],v=m===f?void 0:c.alias;i.push(T`${T.raw(c.joinType)} join${x} ${a?T`${T.identifier(a)}.`:void 0}${T.identifier(f)}${v&&T` ${T.identifier(v)}`} on ${c.on}`)}else if(l(p,bi)){let m=p[un].name,a=p[un].schema,f=p[un].originalName,v=m===f?void 0:c.alias;i.push(T`${T.raw(c.joinType)} join${x} ${a?T`${T.identifier(a)}.`:void 0}${T.identifier(f)}${v&&T` ${T.identifier(v)}`} on ${c.on}`)}else i.push(T`${T.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(T` `)}return T.join(i)}buildFromTable(n){if(l(n,D)&&n[D.Symbol.IsAlias]){let i=T`${T.identifier(n[D.Symbol.OriginalName])}`;if(n[D.Symbol.Schema])i=T`${T.identifier(n[D.Symbol.Schema])}.${i}`;return T`${i} ${T.identifier(n[D.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:a,groupBy:f,limit:v,offset:$,lockingClause:w,distinct:J,setOperators:S}){let X=o??di(i);for(let fn of X)if(l(fn.field,Un)&&mi(fn.field.table)!==(l(x,ci)?x._.alias:l(x,nm)?x[un].name:l(x,L)?void 0:mi(x))&&!((En)=>m?.some(({alias:dn})=>dn===(En[D.Symbol.IsAlias]?mi(En):En[D.Symbol.BaseName])))(fn.field.table)){let En=mi(fn.field.table);throw new Error(`Your "${fn.path.join("->")}" field references a column "${En}"."${fn.field.name}", but the table "${En}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,K=this.buildWithCTE(n),M;if(J)M=J===!0?T` distinct`:T` distinct on (${T.join(J.on,T`, `)})`;let Y=this.buildSelection(X,{isSingleTable:R}),I=this.buildFromTable(x),G=this.buildJoins(m),z=c?T` where ${c}`:void 0,E=p?T` having ${p}`:void 0,Q;if(a&&a.length>0)Q=T` order by ${T.join(a,T`, `)}`;let b;if(f&&f.length>0)b=T` group by ${T.join(f,T`, `)}`;let y=typeof v==="object"||typeof v==="number"&&v>=0?T` limit ${v}`:void 0,H=$?T` offset ${$}`:void 0,an=T.empty();if(w){let fn=T` for ${T.raw(w.strength)}`;if(w.config.of)fn.append(T` of ${T.join(Array.isArray(w.config.of)?w.config.of:[w.config.of],T`, `)}`);if(w.config.noWait)fn.append(T` no wait`);else if(w.config.skipLocked)fn.append(T` skip locked`);an.append(fn)}let Z=T`${K}select${M} ${Y} from ${I}${G}${z}${b}${E}${Q}${y}${H}${an}`;if(S.length>0)return this.buildSetOperations(Z,S);return Z}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:x,offset:m}}){let a=T`(${n.getSQL()}) `,f=T`(${c.getSQL()})`,v;if(x&&x.length>0){let S=[];for(let X of x)if(l(X,V))S.push(T.identifier(X.name));else if(l(X,L)){for(let R=0;R<X.queryChunks.length;R++){let K=X.queryChunks[R];if(l(K,V))X.queryChunks[R]=T.identifier(K.name)}S.push(T`${X}`)}else S.push(T`${X}`);v=T` order by ${T.join(S,T`, `)} `}let $=typeof p==="object"||typeof p==="number"&&p>=0?T` limit ${p}`:void 0,w=T.raw(`${i} ${o?"all ":""}`),J=m?T` offset ${m}`:void 0;return T`${a}${w}${f}${v}${$}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let a=[],f=n[D.Symbol.Columns],v=Object.entries(f).filter(([K,M])=>!M.shouldDisableInsert()),$=v.map(([,K])=>T.identifier(this.casing.getColumnCasing(K)));if(x){let K=i;if(l(K,L))a.push(K);else a.push(K.getSQL())}else{let K=i;a.push(T.raw("values "));for(let[M,Y]of K.entries()){let I=[];for(let[G,z]of v){let E=Y[G];if(E===void 0||l(E,Li)&&E.value===void 0)if(z.defaultFn!==void 0){let Q=z.defaultFn(),b=l(Q,L)?Q:T.param(Q,z);I.push(b)}else if(!z.default&&z.onUpdateFn!==void 0){let Q=z.onUpdateFn(),b=l(Q,L)?Q:T.param(Q,z);I.push(b)}else I.push(T`default`);else I.push(E)}if(a.push(I),M<K.length-1)a.push(T`, `)}}let w=this.buildWithCTE(p),J=T.join(a),S=c?T` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,X=o?T` on conflict ${o}`:void 0,R=m===!0?T`overriding system value `:void 0;return T`${w}insert into ${n} ${$} ${R}${J}${X}${S}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?T` concurrently`:void 0,p=o?T` with no data`:void 0;return T`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(l(n,ia)||l(n,na))return"json";else if(l(n,oa))return"decimal";else if(l(n,ca))return"time";else if(l(n,pa)||l(n,xa))return"timestamp";else if(l(n,dm)||l(n,gm))return"date";else if(l(n,ma))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:x,tableAlias:m,nestedQueryRelation:a,joinOn:f}){let v=[],$,w,J=[],S,X=[];if(x===!0)v=Object.entries(p.columns).map(([M,Y])=>({dbKey:Y.name,tsKey:M,field:Mo(Y,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let K=Object.fromEntries(Object.entries(p.columns).map(([E,Q])=>[E,Mo(Q,m)]));if(x.where){let E=typeof x.where==="function"?x.where(K,mT()):x.where;S=E&&Ex(E,m)}let M=[],Y=[];if(x.columns){let E=!1;for(let[Q,b]of Object.entries(x.columns)){if(b===void 0)continue;if(Q in p.columns){if(!E&&b===!0)E=!0;Y.push(Q)}}if(Y.length>0)Y=E?Y.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!Y.includes(Q))}else Y=Object.keys(p.columns);for(let E of Y){let Q=p.columns[E];M.push({tsKey:E,value:Q})}let I=[];if(x.with)I=Object.entries(x.with).filter((E)=>!!E[1]).map(([E,Q])=>({tsKey:E,queryConfig:Q,relation:p.relations[E]}));let G;if(x.extras){G=typeof x.extras==="function"?x.extras(K,{sql:T}):x.extras;for(let[E,Q]of Object.entries(G))M.push({tsKey:E,value:Gv(Q,m)})}for(let{tsKey:E,value:Q}of M)v.push({dbKey:l(Q,L.Aliased)?Q.fieldAlias:p.columns[E].name,tsKey:E,field:l(Q,Un)?Mo(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let z=typeof x.orderBy==="function"?x.orderBy(K,aT()):x.orderBy??[];if(!Array.isArray(z))z=[z];J=z.map((E)=>{if(l(E,Un))return Mo(E,m);return Ex(E,m)}),$=x.limit,w=x.offset;for(let{tsKey:E,queryConfig:Q,relation:b}of I){let y=vT(i,o,b),H=Ec(b.referencedTable),an=o[H],Z=`${m}_${E}`,fn=Oc(...y.fields.map((Vi,Oo)=>Yo(Mo(y.references[Oo],Z),Mo(Vi,m)))),En=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[an],tableConfig:i[an],queryConfig:l(b,ic)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:fn,nestedQueryRelation:b}),dn=T`${T.identifier(Z)}.${T.identifier("data")}`.as(E);X.push({on:T`true`,table:new ci(En.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),v.push({dbKey:E,tsKey:E,field:dn,relationTableTsKey:an,isJson:!0,selection:En.selection})}}if(v.length===0)throw new Pm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(S=Oc(f,S),a){let K=T`json_build_array(${T.join(v.map(({field:I,tsKey:G,isJson:z})=>z?T`${T.identifier(`${m}_${G}`)}.${T.identifier("data")}`:l(I,L.Aliased)?I.sql:I),T`, `)})`;if(l(a,_x))K=T`coalesce(json_agg(${K}${J.length>0?T` order by ${T.join(J,T`, `)}`:void 0}), '[]'::json)`;let M=[{dbKey:"data",tsKey:"data",field:K.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:v}];if($!==void 0||w!==void 0||J.length>0)R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:[{path:[],field:T.raw("*")}],where:S,limit:$,offset:w,orderBy:J,setOperators:[]}),S=void 0,$=void 0,w=void 0,J=[];else R=sm(c,m);R=this.buildSelectQuery({table:l(R,Ai)?R:new ci(R,{},m),fields:{},fieldsFlat:M.map(({field:I})=>({path:[],field:l(I,Un)?Mo(I,m):I})),joins:X,where:S,limit:$,offset:w,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:v.map(({field:K})=>({path:[],field:l(K,Un)?Mo(K,m):K})),joins:X,where:S,limit:$,offset:w,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:v}}}class r${static[F]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Ui{static[F]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o=n,c;if(this.fields)c=this.fields;else if(l(o,ci))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(l(o,nm))c=o[un].selectedFields;else if(l(o,L))c={};else c=mA(o);return new d$({table:o,fields:c,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class DR extends r${static[F]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:m}){super();this.config={withList:x,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=_o(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!l(i,L)){let x=l(i,ci)?i._.selectedFields:l(i,bi)?i[un].selectedFields:i[D.Symbol.Columns];this.config.fields[p]=x}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o(OM()):o;if(!Ox(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new ci(this.getSQL(),this.config.fields,n),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new kn({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class d$ extends DR{static[F]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let m=di(o.fields),a=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return a.joinsNotNullableMap=p,a.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}xA(d$,[Qi]);function dp(n,i){return(o,c,...p)=>{let x=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of x)if(!Ox(o.getSelectedFields(),m.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(x)}}var OM=()=>({union:UM,unionAll:VM,intersect:_M,intersectAll:bM,except:uM,exceptAll:BM}),UM=dp("union",!1),VM=dp("union",!0),_M=dp("intersect",!1),bM=dp("intersect",!0),uM=dp("except",!1),BM=dp("except",!0);class im{static[F]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=l(n,sc)?n:void 0,this.dialectConfig=l(n,sc)?void 0:n}$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(o);return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...n){let i=this;function o(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new Ui({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new sc(this.dialectConfig);return this.dialect}}class ga{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[F]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[D.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=l(m,L)?m:new Li(m,p[x])}return c});return new g$(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new im):n;if(!l(i,L)&&!Ox(this.table[Zm],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new g$(this.table,i,this.session,this.dialect,this.withList,!0)}}class g$ extends Qi{constructor(n,i,o,c,p,x,m){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:m}}static[F]="PgInsert";config;returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=di(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=T`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?T` where ${n.where}`:void 0;this.config.onConflict=T`(${T.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?T` where ${n.where}`:void 0,o=n.targetWhere?T` where ${n.targetWhere}`:void 0,c=n.setWhere?T` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,rm(this.config.table,n.set)),x="";return x=Array.isArray(n.target)?n.target.map((m)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(m))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=T`(${T.raw(x)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class e$ extends Qi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[F]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class ea{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[F]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new LR(this.table,rm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class LR extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[F]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=n,o=_o(i);if(typeof o==="string")this.joinsNotNullableMap[o]=!0;return this.config.from=i,this}getTableLikeFields(n){if(l(n,Ai))return n[D.Symbol.Columns];else if(l(n,ci))return n._.selectedFields;return n[un].selectedFields}createJoin(n){return(i,o)=>{let c=_o(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!l(this.config.from,L)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[D.Symbol.Columns],new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[D.Symbol.Columns]),this.config.from){let i=_o(this.config.from);if(typeof i==="string"&&this.config.from&&!l(this.config.from,L)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=_o(o.table);if(typeof c==="string"&&!l(o.table,L)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=di(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class om extends L{constructor(n){super(om.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=om.buildCount(n.source,n.filters)}sql;token;static[F]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return T`(select count(*) from ${n}${T.raw(" where ").if(i)}${i})`}static buildCount(n,i){return T`select count(*) as count from ${n}${T.raw(" where ").if(i)}${i};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class i0{constructor(n,i,o,c,p,x,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m}static[F]="PgRelationalQueryBuilder";findMany(n){return new n0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new n0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class n0 extends Qi{constructor(n,i,o,c,p,x,m,a,f){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=a,this.mode=f}static[F]="PgRelationalQuery";_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((m)=>aa(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return x[0];return x})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(n){return this.authToken=n,this}execute(){return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class o0 extends Qi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[F]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class cm{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new i0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[F]="PgDatabase";query;$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(new im(o.dialect));return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(n,i){return new om({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(f,v){return new Ui({fields:v??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:f}})}function x(f){return new ea(f,i.session,i.dialect,n)}function m(f){return new ga(f,i.session,i.dialect,n)}function a(f){return new da(f,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:a}}select(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new ea(n,this.session,this.dialect)}insert(n){return new ga(n,this.session,this.dialect)}delete(n){return new da(n,this.session,this.dialect)}refreshMaterializedView(n){return new e$(n,this.session,this.dialect)}authToken;execute(n){let i=typeof n==="string"?T.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new o0(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class NR{constructor(n,i){this.unique=n,this.name=i}static[F]="PgIndexBuilderOn";on(...n){return new nf(n.map((i)=>{if(l(i,L))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new nf(n.map((i)=>{if(l(i,L))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new nf(i.map((o)=>{if(l(o,L))return o;o=o;let c=new Yx(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class nf{static[F]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new hR(this.config,n)}}class hR{static[F]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function c0(n){return new NR(!0,n)}class p0{constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[F]="PgPreparedQuery";joinsNotNullableMap}class x0{constructor(n){this.dialect=n}static[F]="PgSession";execute(n,i){return Vn.startActiveSpan("drizzle.operation",()=>{return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class m0 extends cm{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[F]="PgTransaction";rollback(){throw new Mv}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return T.raw(i.join(" "))}setTransaction(n){return this.session.execute(T`set transaction ${this.getTransactionConfigSQL(n)}`)}}class CR extends p0{constructor(n,i,o,c,p,x,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=m}static[F]="PostgresJsPreparedQuery";async execute(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=lv(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:x,joinsNotNullableMap:m,customResultMapper:a}=this;if(!c&&!a)return Vn.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let f=await Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return Vn.startActiveSpan("drizzle.mapResponse",()=>{return a?a(f):f.map((v)=>pA(c,v,m))})})}all(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=lv(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class pm extends x0{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Hv}static[F]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new CR(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new pm(o,this.dialect,this.schema,this.options),p=new a0(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class a0 extends m0{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[F]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new pm(i,this.dialect,this.schema,this.session.options),c=new a0(this.dialect,o,this.schema);return n(c)})}}class IR extends cm{static[F]="PostgresJsDatabase"}function gp(n,i={}){let o=(f)=>f;for(let f of["1184","1082","1083","1114","1182","1185","1115","1231"])n.options.parsers[f]=o,n.options.serializers[f]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new sc({casing:i.casing}),p;if(i.logger===!0)p=new Yv;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let f=fT(i.schema,$T);x={fullSchema:i.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}let m=new pm(n,c,x,{logger:p}),a=new IR(c,m,x);return a.$client=n,a}function of(...n){if(typeof n[0]==="string"){let i=rp(n[0]);return gp(i,n[1])}if(aA(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return gp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,a=rp(x,m);return gp(a,c)}let p=rp(i);return gp(p,c)}return gp(n[0],n[1])}((n)=>{function i(o){return gp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(of||(of={}));var v0={};p3(v0,{users:()=>So,userChanges:()=>DM,untrackedUserColumnNames:()=>jM,twoFactorMethod:()=>sR,trackedUserColumnName:()=>qR,trackableUserColumnNames:()=>ZR,role:()=>kR,players:()=>f0,passwordResetAttempts:()=>LM,loginHistory:()=>ep,games:()=>cf,banishedIps:()=>pf});function yR(n){return T`lower(${n})`}var kR=ym("role",["admin","user"]),So=nc("users",{id:Ni().primaryKey().defaultRandom(),username:Ji({length:16}).notNull(),email:Ji({length:254}).notNull(),hash:Ji({length:64}).notNull(),salt:Ji({length:36}).notNull(),createdAt:vo({withTimezone:!0}).notNull().defaultNow(),createdIp:Ji({length:45}).notNull(),isActive:Ux().notNull().default(!1),verifiedAt:vo({withTimezone:!0}),userRole:kR().default("user")},(n)=>[c0("usernameUniqueIndex").on(yR(n.username)),c0("emailUniqueIndex").on(yR(n.email))]),jM=["id","createdAt","createdIp","isActive","salt","verifiedAt"],ZR=["username","email","hash","userRole"],qR=ym("trackedUserColumnName",ZR),DM=nc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>So.id),changedAt:vo({withTimezone:!0}).notNull().defaultNow(),changedIp:Ji({length:45}).notNull(),changedColumn:qR().notNull(),oldValue:Ji({length:255}),newValue:Ji({length:255})}),cf=nc("games",{id:Ni().primaryKey().defaultRandom()}),f0=nc("players",{userId:Ni().notNull().references(()=>So.id),gameId:Ni().notNull().references(()=>cf.id),score:em().notNull()},(n)=>[cT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ep=nc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>So.id),loginTime:vo({withTimezone:!0}).notNull().defaultNow(),ipAddress:Ji({length:45}).notNull(),userAgent:Ji({length:1024}),successful:Ux().notNull().default(!1)}),sR=ym("twoFactorMethod",["email","phone"]),LM=nc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>So.id),requestedIp:Ji({length:45}).notNull(),requestedAt:vo({withTimezone:!0}).notNull().defaultNow(),succeededIp:Ji({length:45}),succeededAt:vo({withTimezone:!0}),verificationMethod:sR().notNull()}),pf=nc("banishedIps",{ip:Ji({length:45}).primaryKey(),reason:Ji({length:2048}).notNull(),banishedAt:vo({withTimezone:!0}).notNull().defaultNow(),banishedUntil:vo({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class $0{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(NM.resolve(__dirname,"notify_update.sql"));let n=[mi(So),mi(cf),mi(f0)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:sn.POSTGRES_HOST,port:sn.POSTGRES_PORT,user:sn.POSTGRES_USER,password:sn.POSTGRES_PASSWORD,database:sn.POSTGRES_DATABASE}){this.options=i,this.sql=rp(i),this.drizzle=of(this.sql,{schema:v0,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new $n);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as hM}from"node:crypto";function w0(n){let i=hM("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var PR=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var CM=3,IM=15,yM=/^[a-zA-Z0-9_-]+$/,dR=Wn.string().min(CM).max(IM).regex(yM),tR=20,rR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function kM(n){let i="";for(let o of n)if(o in rR)i+=rR[o];else i+=o;return i}function ZM(n){let i=n.toLocaleLowerCase(),o=kM(i);for(let c of PR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function qM(n){let i=new Set(n).size;return n.length*Math.log2(i)}function sM(n){let i=0,o=100;if(ZM(n))i-=o;return i+=qM(n)*0.5,Math.max(i,0)}var gR=Wn.string().refine((n)=>{return sM(n)>=tR},{message:`Password does not meet the minimum complexity of ${tR}.`}).brand("password"),eR=Wn.object({username:dR,password:gR}).strict(),PM=Wn.string().email().brand("email"),nS=Wn.object({username:dR,password:gR,email:PM}).strict();var xf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},J0=Y0(xf).map(([n])=>Wn.literal(Number(n))),tM=Wn.union([J0[0],J0[1],...J0]),iS=Wn.tuple([tM,Wn.string()]);var oS=Zo({key:"count",default:0}),rM=lc({key:"incrementTX",do:({set:n})=>{n(oS,(i)=>i+1)}}),cS=R1({key:"countContinuity",config:(n)=>n.add(oS).add(rM)});var xS=U$($c,"backend.worker.game.bun",mn),Pc=new $0({logQuery(n,i){mn.info("\uD83D\uDCDD query",n,i)}});g.STORE.loggers[0]=new Xc("info",void 0,mn);var my=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new mS.CronJob("00 15 * * * *",()=>{U$($c,"backend.worker.tribunal.bun",mn)}),n.start(),process.on("exit",()=>{n.stop(),mn.info("\u231B tribunal daily cronjob stopped")}),mn.info("\u23F3 tribunal daily cronjob started");return n})();function eM(n){if(O$)return gM(O$,n);return dM({},n)}var aS=eM((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let x=new Date,m=new URL(n.url,sn.VITE_BACKEND_ORIGIN);mn.info(x,p,n.method,m.pathname);let a=await Pc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Yo(pf.ip,p)}),f=a?.banishedUntil===null,v=a?.banishedUntil&&a.banishedUntil>x;if(f||v){mn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(m.pathname){case`/sign-up-${w0("sign-up")}`:{let $=Buffer.concat(o).toString(),w=JSON.parse($),J=nS.safeParse(w);if(!J.success){mn.warn("signup parsed",J.error.issues);return}let{username:S,password:X,email:R}=J.data;if(mn.info(`\uD83D\uDD11 attempting to sign up: ${S}`),await Pc.drizzle.query.users.findFirst({columns:{id:!0},where:Yo(So.email,R)}))throw[400,"User already exists"];let M=crypto.randomUUID(),Y=pS("sha256").update(X+M).digest("hex");await Pc.drizzle.insert(So).values({username:S,email:R,hash:Y,salt:M,createdIp:p}),mn.info(`\uD83D\uDD11 user created: ${S}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(xf[201])}break;case`/login-${w0("login")}`:{let $=!1,w=null;try{let J=new Date(+x-600000);mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:J,now:x});let S=await Pc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Yo(ep.ipAddress,p),Yo(ep.successful,!1),tm(ep.loginTime,J)),limit:10});mn.info(`\uD83D\uDD11 ${S.length}/10 recent failed logins from ${p}`);let X=10-S.length;if(X<1)throw mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await Pc.drizzle.insert(pf).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let R=Buffer.concat(o).toString(),K=JSON.parse(R),M=eR.safeParse(K);if(!M.success)throw mn.warn("login parsed",M.error.issues),[400,`${X} attempts remaining.`];let{username:Y,password:I}=M.data,G=await Pc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Yo(So.username,Y)});if(mn.info("\uD83D\uDD11 login attempt as user",Y),!G)throw mn.info(`\uD83D\uDD11 user ${Y} does not exist`),[400,`${X} attempts remaining.`];let{hash:z,salt:E}=G;if(w=G.id,pS("sha256").update(I+E).digest("hex")===z){let b=crypto.randomUUID(),y=Na.get(Y);if(!y)y=new Map,Na.set(Y,y);y.set(b,Number(x)),$=!0,mn.info("\uD83D\uDD11 login successful as",Y),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(`${Y} ${b}`)}}finally{await Pc.drizzle.insert(ep).values({userId:w,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}break;default:throw[404,"Not found"]}break;case void 0:throw[400,"No Method"];default:throw[405,"Method not allowed"]}}catch(p){let x=iS.safeParse(p);if(x.success){let[m,a]=x.data,v=`${xf[m]}. ${a}`;mn.info(`\u274C ${m}: ${v}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(v)}else mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),A0=aS.listen(sn.BACKEND_PORT).address(),nY=typeof A0==="string"?null:A0===null?null:A0.port;if(nY===null)throw new Error("Could not determine port for test server");new e6(aS,{cors:{origin:sn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,x=`socket::${n.id}`;if(Na.get(o)?.has(c)){let a=t(g.STORE,Km,x);On(g.STORE,a,n),ko(Gc,(f)=>{f.set(p,x)},g.STORE),On(g.STORE,bf,(f)=>f.add(p)),On(g.STORE,_f,(f)=>f.add(x)),mn.info(`${o} connected on ${n.id}`),i()}else mn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Y1({socket:n,store:g.STORE})(cS);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Gc,c,g.STORE).userKeyOfSocket,x=Gn(g.STORE,p);if(ko(Gc,(m)=>{m.delete(c)},g.STORE),x)On(g.STORE,bf,(m)=>(m.delete(x),m));On(g.STORE,_f,(m)=>(m.delete(c),m)),mn.info(`${n.id} disconnected`),o()})});async function mf(){mn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>xS.process.once("close",i));xS.emit("timeToStop"),await n,mn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{mn.info("\u2757 received SIGINT; exiting gracefully"),await mf()});process.on("SIGTERM",async()=>{mn.info("\u2757 received SIGTERM; exiting gracefully"),await mf()});process.on("exit",async()=>{mn.info("\u2757 received exit; exiting gracefully"),await mf()});$c.on("updatesReady",()=>{mn.info('\u2757 backend server received signal "updatesReady"'),$c.emit("readyToUpdate"),mn.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),$c.on("timeToStop",async()=>{mn.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await mf()})});mn.info(`\uD83D\uDEEB backend server ready on port ${sn.BACKEND_PORT}`);$c.emit("alive");export{my as tribunalDaily};