@botpress/webchat 1.0.12 → 1.0.13

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.
@@ -37,6 +37,7 @@ type ContextVaue = {
37
37
  theme: Theme;
38
38
  renderers: Renderers;
39
39
  messages: MessageObject[];
40
+ setMessages: React.Dispatch<React.SetStateAction<MessageObject[]>>;
40
41
  eventEmitter: EventEmitter<Events>;
41
42
  configuration: Configuration;
42
43
  setConfiguration: React.Dispatch<React.SetStateAction<Configuration>>;
package/dist/index.js CHANGED
@@ -42045,6 +42045,7 @@ const GZ = ({ styles: e = {}, renderers: n, client: r, children: a, configuratio
42045
42045
  theme: C,
42046
42046
  renderers: { ...rD, ...n },
42047
42047
  messages: f,
42048
+ setMessages: h,
42048
42049
  eventEmitter: _V,
42049
42050
  configuration: s,
42050
42051
  setConfiguration: x,
@@ -659,7 +659,7 @@ to {
659
659
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660
660
  * See the License for the specific language governing permissions and
661
661
  * limitations under the License.
662
- */function hd(e){return e.variant===Kh.FIDELITY||e.variant===Kh.CONTENT}function Sr(e){return e.variant===Kh.MONOCHROME}function BF(e,n,r,a){let s=r,c=Mc.from(e,n,r);if(c.chroma<n){let f=c.chroma;for(;c.chroma<n;){s+=a?-1:1;const h=Mc.from(e,n,s);if(f>h.chroma||Math.abs(h.chroma-n)<.4)break;const v=Math.abs(h.chroma-n),y=Math.abs(c.chroma-n);v<y&&(c=h),f=Math.max(f,h.chroma)}}return s}function VF(e){return bo.make(void 0,void 0,e.isDark?30:80,void 0,void 0)}function KE(e,n){const r=e.inViewingConditions(VF(n));return Qe.tonePrefersLightForeground(e.tone)&&!Qe.toneAllowsLightForeground(r.tone)?Qe.enableLightForeground(e.tone):Qe.enableLightForeground(r.tone)}class ge{static highestSurface(n){return n.isDark?ge.surfaceBright:ge.surfaceDim}}ge.contentAccentToneDelta=15,ge.primaryPaletteKeyColor=Qe.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone}),ge.secondaryPaletteKeyColor=Qe.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone}),ge.tertiaryPaletteKeyColor=Qe.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone}),ge.neutralPaletteKeyColor=Qe.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone}),ge.neutralVariantPaletteKeyColor=Qe.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone}),ge.background=Qe.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),ge.onBackground=Qe.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>ge.background,contrastCurve:new on(3,3,4.5,7)}),ge.surface=Qe.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),ge.surfaceDim=Qe.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:87,isBackground:!0}),ge.surfaceBright=Qe.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?24:98,isBackground:!0}),ge.surfaceContainerLowest=Qe.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?4:100,isBackground:!0}),ge.surfaceContainerLow=Qe.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?10:96,isBackground:!0}),ge.surfaceContainer=Qe.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?12:94,isBackground:!0}),ge.surfaceContainerHigh=Qe.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?17:92,isBackground:!0}),ge.surfaceContainerHighest=Qe.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?22:90,isBackground:!0}),ge.onSurface=Qe.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>ge.highestSurface(e),contrastCurve:new on(4.5,7,11,21)}),ge.surfaceVariant=Qe.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0}),ge.onSurfaceVariant=Qe.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11)}),ge.inverseSurface=Qe.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20}),ge.inverseOnSurface=Qe.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>ge.inverseSurface,contrastCurve:new on(4.5,7,11,21)}),ge.outline=Qe.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>ge.highestSurface(e),contrastCurve:new on(1.5,3,4.5,7)}),ge.outlineVariant=Qe.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7)}),ge.shadow=Qe.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0}),ge.scrim=Qe.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0}),ge.surfaceTint=Qe.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0}),ge.primary=Qe.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>Sr(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.primaryContainer,ge.primary,15,"nearer",!1)}),ge.onPrimary=Qe.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>Sr(e)?e.isDark?10:90:e.isDark?20:100,background:e=>ge.primary,contrastCurve:new on(4.5,7,11,21)}),ge.primaryContainer=Qe.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>hd(e)?KE(e.sourceColorHct,e):Sr(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryContainer,ge.primary,15,"nearer",!1)}),ge.onPrimaryContainer=Qe.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>hd(e)?Qe.foregroundTone(ge.primaryContainer.tone(e),4.5):Sr(e)?e.isDark?0:100:e.isDark?90:10,background:e=>ge.primaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.inversePrimary=Qe.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>ge.inverseSurface,contrastCurve:new on(3,4.5,7,11)}),ge.secondary=Qe.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.secondaryContainer,ge.secondary,15,"nearer",!1)}),ge.onSecondary=Qe.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?e.isDark?10:100:e.isDark?20:100,background:e=>ge.secondary,contrastCurve:new on(4.5,7,11,21)}),ge.secondaryContainer=Qe.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const n=e.isDark?30:90;if(Sr(e))return e.isDark?30:85;if(!hd(e))return n;let r=BF(e.secondaryPalette.hue,e.secondaryPalette.chroma,n,!e.isDark);return r=KE(e.secondaryPalette.getHct(r),e),r},isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryContainer,ge.secondary,15,"nearer",!1)}),ge.onSecondaryContainer=Qe.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>hd(e)?Qe.foregroundTone(ge.secondaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>ge.secondaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.tertiary=Qe.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.tertiaryContainer,ge.tertiary,15,"nearer",!1)}),ge.onTertiary=Qe.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?10:90:e.isDark?20:100,background:e=>ge.tertiary,contrastCurve:new on(4.5,7,11,21)}),ge.tertiaryContainer=Qe.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(Sr(e))return e.isDark?60:49;if(!hd(e))return e.isDark?30:90;const n=KE(e.tertiaryPalette.getHct(e.sourceColorHct.tone),e),r=e.tertiaryPalette.getHct(n);return ZE.fixIfDisliked(r).tone},isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryContainer,ge.tertiary,15,"nearer",!1)}),ge.onTertiaryContainer=Qe.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?0:100:hd(e)?Qe.foregroundTone(ge.tertiaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>ge.tertiaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.error=Qe.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.errorContainer,ge.error,15,"nearer",!1)}),ge.onError=Qe.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>ge.error,contrastCurve:new on(4.5,7,11,21)}),ge.errorContainer=Qe.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.errorContainer,ge.error,15,"nearer",!1)}),ge.onErrorContainer=Qe.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?90:10,background:e=>ge.errorContainer,contrastCurve:new on(4.5,7,11,21)}),ge.primaryFixed=Qe.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>Sr(e)?40:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryFixed,ge.primaryFixedDim,10,"lighter",!0)}),ge.primaryFixedDim=Qe.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>Sr(e)?30:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryFixed,ge.primaryFixedDim,10,"lighter",!0)}),ge.onPrimaryFixed=Qe.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>Sr(e)?100:10,background:e=>ge.primaryFixedDim,secondBackground:e=>ge.primaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onPrimaryFixedVariant=Qe.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>Sr(e)?90:30,background:e=>ge.primaryFixedDim,secondBackground:e=>ge.primaryFixed,contrastCurve:new on(3,4.5,7,11)}),ge.secondaryFixed=Qe.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?80:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryFixed,ge.secondaryFixedDim,10,"lighter",!0)}),ge.secondaryFixedDim=Qe.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?70:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryFixed,ge.secondaryFixedDim,10,"lighter",!0)}),ge.onSecondaryFixed=Qe.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>ge.secondaryFixedDim,secondBackground:e=>ge.secondaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onSecondaryFixedVariant=Qe.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?25:30,background:e=>ge.secondaryFixedDim,secondBackground:e=>ge.secondaryFixed,contrastCurve:new on(3,4.5,7,11)}),ge.tertiaryFixed=Qe.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?40:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryFixed,ge.tertiaryFixedDim,10,"lighter",!0)}),ge.tertiaryFixedDim=Qe.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?30:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryFixed,ge.tertiaryFixedDim,10,"lighter",!0)}),ge.onTertiaryFixed=Qe.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?100:10,background:e=>ge.tertiaryFixedDim,secondBackground:e=>ge.tertiaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onTertiaryFixedVariant=Qe.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?90:30,background:e=>ge.tertiaryFixedDim,secondBackground:e=>ge.tertiaryFixed,contrastCurve:new on(3,4.5,7,11)});var HF={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Gh=HF,B5={};for(const e of Object.keys(Gh))B5[Gh[e]]=e;const pt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var V5=pt;for(const e of Object.keys(pt)){if(!("channels"in pt[e]))throw new Error("missing channels property: "+e);if(!("labels"in pt[e]))throw new Error("missing channel labels property: "+e);if(pt[e].labels.length!==pt[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:r}=pt[e];delete pt[e].channels,delete pt[e].labels,Object.defineProperty(pt[e],"channels",{value:n}),Object.defineProperty(pt[e],"labels",{value:r})}pt.rgb.hsl=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(n,r,a),c=Math.max(n,r,a),f=c-s;let h,v;c===s?h=0:n===c?h=(r-a)/f:r===c?h=2+(a-n)/f:a===c&&(h=4+(n-r)/f),h=Math.min(h*60,360),h<0&&(h+=360);const y=(s+c)/2;return c===s?v=0:y<=.5?v=f/(c+s):v=f/(2-c-s),[h,v*100,y*100]},pt.rgb.hsv=function(e){let n,r,a,s,c;const f=e[0]/255,h=e[1]/255,v=e[2]/255,y=Math.max(f,h,v),S=y-Math.min(f,h,v),E=function(C){return(y-C)/6/S+1/2};return S===0?(s=0,c=0):(c=S/y,n=E(f),r=E(h),a=E(v),f===y?s=a-r:h===y?s=1/3+n-a:v===y&&(s=2/3+r-n),s<0?s+=1:s>1&&(s-=1)),[s*360,c*100,y*100]},pt.rgb.hwb=function(e){const n=e[0],r=e[1];let a=e[2];const s=pt.rgb.hsl(e)[0],c=1/255*Math.min(n,Math.min(r,a));return a=1-1/255*Math.max(n,Math.max(r,a)),[s,c*100,a*100]},pt.rgb.cmyk=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(1-n,1-r,1-a),c=(1-n-s)/(1-s)||0,f=(1-r-s)/(1-s)||0,h=(1-a-s)/(1-s)||0;return[c*100,f*100,h*100,s*100]};function qF(e,n){return(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2}pt.rgb.keyword=function(e){const n=B5[e];if(n)return n;let r=1/0,a;for(const s of Object.keys(Gh)){const c=Gh[s],f=qF(e,c);f<r&&(r=f,a=s)}return a},pt.keyword.rgb=function(e){return Gh[e]},pt.rgb.xyz=function(e){let n=e[0]/255,r=e[1]/255,a=e[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const s=n*.4124+r*.3576+a*.1805,c=n*.2126+r*.7152+a*.0722,f=n*.0193+r*.1192+a*.9505;return[s*100,c*100,f*100]},pt.rgb.lab=function(e){const n=pt.rgb.xyz(e);let r=n[0],a=n[1],s=n[2];r/=95.047,a/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;const c=116*a-16,f=500*(r-a),h=200*(a-s);return[c,f,h]},pt.hsl.rgb=function(e){const n=e[0]/360,r=e[1]/100,a=e[2]/100;let s,c,f;if(r===0)return f=a*255,[f,f,f];a<.5?s=a*(1+r):s=a+r-a*r;const h=2*a-s,v=[0,0,0];for(let y=0;y<3;y++)c=n+1/3*-(y-1),c<0&&c++,c>1&&c--,6*c<1?f=h+(s-h)*6*c:2*c<1?f=s:3*c<2?f=h+(s-h)*(2/3-c)*6:f=h,v[y]=f*255;return v},pt.hsl.hsv=function(e){const n=e[0];let r=e[1]/100,a=e[2]/100,s=r;const c=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,s*=c<=1?c:2-c;const f=(a+r)/2,h=a===0?2*s/(c+s):2*r/(a+r);return[n,h*100,f*100]},pt.hsv.rgb=function(e){const n=e[0]/60,r=e[1]/100;let a=e[2]/100;const s=Math.floor(n)%6,c=n-Math.floor(n),f=255*a*(1-r),h=255*a*(1-r*c),v=255*a*(1-r*(1-c));switch(a*=255,s){case 0:return[a,v,f];case 1:return[h,a,f];case 2:return[f,a,v];case 3:return[f,h,a];case 4:return[v,f,a];case 5:return[a,f,h]}},pt.hsv.hsl=function(e){const n=e[0],r=e[1]/100,a=e[2]/100,s=Math.max(a,.01);let c,f;f=(2-r)*a;const h=(2-r)*s;return c=r*s,c/=h<=1?h:2-h,c=c||0,f/=2,[n,c*100,f*100]},pt.hwb.rgb=function(e){const n=e[0]/360;let r=e[1]/100,a=e[2]/100;const s=r+a;let c;s>1&&(r/=s,a/=s);const f=Math.floor(6*n),h=1-a;c=6*n-f,f&1&&(c=1-c);const v=r+c*(h-r);let y,S,E;switch(f){default:case 6:case 0:y=h,S=v,E=r;break;case 1:y=v,S=h,E=r;break;case 2:y=r,S=h,E=v;break;case 3:y=r,S=v,E=h;break;case 4:y=v,S=r,E=h;break;case 5:y=h,S=r,E=v;break}return[y*255,S*255,E*255]},pt.cmyk.rgb=function(e){const n=e[0]/100,r=e[1]/100,a=e[2]/100,s=e[3]/100,c=1-Math.min(1,n*(1-s)+s),f=1-Math.min(1,r*(1-s)+s),h=1-Math.min(1,a*(1-s)+s);return[c*255,f*255,h*255]},pt.xyz.rgb=function(e){const n=e[0]/100,r=e[1]/100,a=e[2]/100;let s,c,f;return s=n*3.2406+r*-1.5372+a*-.4986,c=n*-.9689+r*1.8758+a*.0415,f=n*.0557+r*-.204+a*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,s=Math.min(Math.max(0,s),1),c=Math.min(Math.max(0,c),1),f=Math.min(Math.max(0,f),1),[s*255,c*255,f*255]},pt.xyz.lab=function(e){let n=e[0],r=e[1],a=e[2];n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const s=116*r-16,c=500*(n-r),f=200*(r-a);return[s,c,f]},pt.lab.xyz=function(e){const n=e[0],r=e[1],a=e[2];let s,c,f;c=(n+16)/116,s=r/500+c,f=c-a/200;const h=c**3,v=s**3,y=f**3;return c=h>.008856?h:(c-16/116)/7.787,s=v>.008856?v:(s-16/116)/7.787,f=y>.008856?y:(f-16/116)/7.787,s*=95.047,c*=100,f*=108.883,[s,c,f]},pt.lab.lch=function(e){const n=e[0],r=e[1],a=e[2];let s;s=Math.atan2(a,r)*360/2/Math.PI,s<0&&(s+=360);const f=Math.sqrt(r*r+a*a);return[n,f,s]},pt.lch.lab=function(e){const n=e[0],r=e[1],s=e[2]/360*2*Math.PI,c=r*Math.cos(s),f=r*Math.sin(s);return[n,c,f]},pt.rgb.ansi16=function(e,n=null){const[r,a,s]=e;let c=n===null?pt.rgb.hsv(e)[2]:n;if(c=Math.round(c/50),c===0)return 30;let f=30+(Math.round(s/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return c===2&&(f+=60),f},pt.hsv.ansi16=function(e){return pt.rgb.ansi16(pt.hsv.rgb(e),e[2])},pt.rgb.ansi256=function(e){const n=e[0],r=e[1],a=e[2];return n===r&&r===a?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},pt.ansi16.rgb=function(e){let n=e%10;if(n===0||n===7)return e>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const r=(~~(e>50)+1)*.5,a=(n&1)*r*255,s=(n>>1&1)*r*255,c=(n>>2&1)*r*255;return[a,s,c]},pt.ansi256.rgb=function(e){if(e>=232){const c=(e-232)*10+8;return[c,c,c]}e-=16;let n;const r=Math.floor(e/36)/5*255,a=Math.floor((n=e%36)/6)/5*255,s=n%6/5*255;return[r,a,s]},pt.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r},pt.hex.rgb=function(e){const n=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let r=n[0];n[0].length===3&&(r=r.split("").map(h=>h+h).join(""));const a=parseInt(r,16),s=a>>16&255,c=a>>8&255,f=a&255;return[s,c,f]},pt.rgb.hcg=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.max(Math.max(n,r),a),c=Math.min(Math.min(n,r),a),f=s-c;let h,v;return f<1?h=c/(1-f):h=0,f<=0?v=0:s===n?v=(r-a)/f%6:s===r?v=2+(a-n)/f:v=4+(n-r)/f,v/=6,v%=1,[v*360,f*100,h*100]},pt.hsl.hcg=function(e){const n=e[1]/100,r=e[2]/100,a=r<.5?2*n*r:2*n*(1-r);let s=0;return a<1&&(s=(r-.5*a)/(1-a)),[e[0],a*100,s*100]},pt.hsv.hcg=function(e){const n=e[1]/100,r=e[2]/100,a=n*r;let s=0;return a<1&&(s=(r-a)/(1-a)),[e[0],a*100,s*100]},pt.hcg.rgb=function(e){const n=e[0]/360,r=e[1]/100,a=e[2]/100;if(r===0)return[a*255,a*255,a*255];const s=[0,0,0],c=n%1*6,f=c%1,h=1-f;let v=0;switch(Math.floor(c)){case 0:s[0]=1,s[1]=f,s[2]=0;break;case 1:s[0]=h,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=f;break;case 3:s[0]=0,s[1]=h,s[2]=1;break;case 4:s[0]=f,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=h}return v=(1-r)*a,[(r*s[0]+v)*255,(r*s[1]+v)*255,(r*s[2]+v)*255]},pt.hcg.hsv=function(e){const n=e[1]/100,r=e[2]/100,a=n+r*(1-n);let s=0;return a>0&&(s=n/a),[e[0],s*100,a*100]},pt.hcg.hsl=function(e){const n=e[1]/100,a=e[2]/100*(1-n)+.5*n;let s=0;return a>0&&a<.5?s=n/(2*a):a>=.5&&a<1&&(s=n/(2*(1-a))),[e[0],s*100,a*100]},pt.hcg.hwb=function(e){const n=e[1]/100,r=e[2]/100,a=n+r*(1-n);return[e[0],(a-n)*100,(1-a)*100]},pt.hwb.hcg=function(e){const n=e[1]/100,a=1-e[2]/100,s=a-n;let c=0;return s<1&&(c=(a-s)/(1-s)),[e[0],s*100,c*100]},pt.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},pt.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},pt.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},pt.gray.hsl=function(e){return[0,0,e[0]]},pt.gray.hsv=pt.gray.hsl,pt.gray.hwb=function(e){return[0,100,e[0]]},pt.gray.cmyk=function(e){return[0,0,0,e[0]]},pt.gray.lab=function(e){return[e[0],0,0]},pt.gray.hex=function(e){const n=Math.round(e[0]/100*255)&255,a=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(a.length)+a},pt.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const Og=V5;function WF(){const e={},n=Object.keys(Og);for(let r=n.length,a=0;a<r;a++)e[n[a]]={distance:-1,parent:null};return e}function YF(e){const n=WF(),r=[e];for(n[e].distance=0;r.length;){const a=r.pop(),s=Object.keys(Og[a]);for(let c=s.length,f=0;f<c;f++){const h=s[f],v=n[h];v.distance===-1&&(v.distance=n[a].distance+1,v.parent=a,r.unshift(h))}}return n}function ZF(e,n){return function(r){return n(e(r))}}function KF(e,n){const r=[n[e].parent,e];let a=Og[n[e].parent][e],s=n[e].parent;for(;n[s].parent;)r.unshift(n[s].parent),a=ZF(Og[n[s].parent][s],a),s=n[s].parent;return a.conversion=r,a}var GF=function(e){const n=YF(e),r={},a=Object.keys(n);for(let s=a.length,c=0;c<s;c++){const f=a[c];n[f].parent!==null&&(r[f]=KF(f,n))}return r};const GE=V5,QF=GF,Qh={},XF=Object.keys(GE);function JF(e){const n=function(...r){const a=r[0];return a==null?a:(a.length>1&&(r=a),e(r))};return"conversion"in e&&(n.conversion=e.conversion),n}function eI(e){const n=function(...r){const a=r[0];if(a==null)return a;a.length>1&&(r=a);const s=e(r);if(typeof s=="object")for(let c=s.length,f=0;f<c;f++)s[f]=Math.round(s[f]);return s};return"conversion"in e&&(n.conversion=e.conversion),n}XF.forEach(e=>{Qh[e]={},Object.defineProperty(Qh[e],"channels",{value:GE[e].channels}),Object.defineProperty(Qh[e],"labels",{value:GE[e].labels});const n=QF(e);Object.keys(n).forEach(a=>{const s=n[a];Qh[e][a]=eI(s),Qh[e][a].raw=JF(s)})});var H5={},q5={},QE={exports:{}},Wn=String,W5=function(){return{isColorSupported:!1,reset:Wn,bold:Wn,dim:Wn,italic:Wn,underline:Wn,inverse:Wn,hidden:Wn,strikethrough:Wn,black:Wn,red:Wn,green:Wn,yellow:Wn,blue:Wn,magenta:Wn,cyan:Wn,white:Wn,gray:Wn,bgBlack:Wn,bgRed:Wn,bgGreen:Wn,bgYellow:Wn,bgBlue:Wn,bgMagenta:Wn,bgCyan:Wn,bgWhite:Wn}};QE.exports=W5(),QE.exports.createColors=W5;var tI=QE.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function n(v,y){for(var S in y)Object.defineProperty(v,S,{enumerable:!0,get:y[S]})}n(e,{dim:function(){return f},default:function(){return h}});const r=a(tI);function a(v){return v&&v.__esModule?v:{default:v}}let s=new Set;function c(v,y,S){typeof process<"u"&&process.env.JEST_WORKER_ID||S&&s.has(S)||(S&&s.add(S),console.warn(""),y.forEach(E=>console.warn(v,"-",E)))}function f(v){return r.default.dim(v)}const h={info(v,y){c(r.default.bold(r.default.cyan("info")),...Array.isArray(v)?[v]:[y,v])},warn(v,y){c(r.default.bold(r.default.yellow("warn")),...Array.isArray(v)?[v]:[y,v])},risk(v,y){c(r.default.bold(r.default.magenta("risk")),...Array.isArray(v)?[v]:[y,v])}}})(q5),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});const n=r(q5);function r(c){return c&&c.__esModule?c:{default:c}}function a({version:c,from:f,to:h}){n.default.warn(`${f}-color-renamed`,[`As of Tailwind CSS ${c}, \`${f}\` has been renamed to \`${h}\`.`,"Update your configuration file to silence this warning."])}const s={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(H5);let XE=H5;(XE.__esModule?XE:{default:XE}).default;class Y5{constructor(){Wl(this,"eventMap");this.eventMap={}}on(n,r){var a;return this.eventMap[n]||(this.eventMap[n]=new Set),(a=this.eventMap[n])==null||a.add(r),()=>{var s;(s=this.eventMap[n])==null||s.delete(r)}}emit(n,r){var a;(a=this.eventMap[n])==null||a.forEach(s=>{s(r)})}}const nI=new Y5;function Z5(e,n){let r=0;if(e.length==0)return r;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a);r=(r<<5)-r+s,r=r&r}return Math.abs(r)%n}var hn;(function(e){e.assertEqual=s=>s;function n(s){}e.assertIs=n;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const c={};for(const f of s)c[f]=f;return c},e.getValidEnumValues=s=>{const c=e.objectKeys(s).filter(h=>typeof s[s[h]]!="number"),f={};for(const h of c)f[h]=s[h];return e.objectValues(f)},e.objectValues=s=>e.objectKeys(s).map(function(c){return s[c]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const c=[];for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&c.push(f);return c},e.find=(s,c)=>{for(const f of s)if(c(f))return f},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,c=" | "){return s.map(f=>typeof f=="string"?`'${f}'`:f).join(c)}e.joinValues=a,e.jsonStringifyReplacer=(s,c)=>typeof c=="bigint"?c.toString():c})(hn||(hn={}));var JE;(function(e){e.mergeShapes=(n,r)=>({...n,...r})})(JE||(JE={}));const rt=hn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cu=e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},qe=hn.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"]),rI=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class So extends Error{constructor(n){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=n}get errors(){return this.issues}format(n){const r=n||function(c){return c.message},a={_errors:[]},s=c=>{for(const f of c.issues)if(f.code==="invalid_union")f.unionErrors.map(s);else if(f.code==="invalid_return_type")s(f.returnTypeError);else if(f.code==="invalid_arguments")s(f.argumentsError);else if(f.path.length===0)a._errors.push(r(f));else{let h=a,v=0;for(;v<f.path.length;){const y=f.path[v];v===f.path.length-1?(h[y]=h[y]||{_errors:[]},h[y]._errors.push(r(f))):h[y]=h[y]||{_errors:[]},h=h[y],v++}}};return s(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,hn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=r=>r.message){const r={},a=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(n(s))):a.push(n(s));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}So.create=e=>new So(e);const Xh=(e,n)=>{let r;switch(e.code){case qe.invalid_type:e.received===rt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case qe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,hn.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:r=`Unrecognized key(s) in object: ${hn.joinValues(e.keys,", ")}`;break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hn.joinValues(e.options)}`;break;case qe.invalid_enum_value:r=`Invalid enum value. Expected ${hn.joinValues(e.options)}, received '${e.received}'`;break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:hn.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case qe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case qe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case qe.not_finite:r="Number must be finite";break;default:r=n.defaultError,hn.assertNever(e)}return{message:r}};let K5=Xh;function iI(e){K5=e}function Dg(){return K5}const Ag=e=>{const{data:n,path:r,errorMaps:a,issueData:s}=e,c=[...r,...s.path||[]],f={...s,path:c};let h="";const v=a.filter(y=>!!y).slice().reverse();for(const y of v)h=y(f,{data:n,defaultError:h}).message;return{...s,path:c,message:s.message||h}},aI=[];function ot(e,n){const r=Ag({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dg(),Xh].filter(a=>!!a)});e.common.issues.push(r)}class wi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,r){const a=[];for(const s of r){if(s.status==="aborted")return Ut;s.status==="dirty"&&n.dirty(),a.push(s.value)}return{status:n.value,value:a}}static async mergeObjectAsync(n,r){const a=[];for(const s of r)a.push({key:await s.key,value:await s.value});return wi.mergeObjectSync(n,a)}static mergeObjectSync(n,r){const a={};for(const s of r){const{key:c,value:f}=s;if(c.status==="aborted"||f.status==="aborted")return Ut;c.status==="dirty"&&n.dirty(),f.status==="dirty"&&n.dirty(),(typeof f.value<"u"||s.alwaysSet)&&(a[c.value]=f.value)}return{status:n.value,value:a}}}const Ut=Object.freeze({status:"aborted"}),G5=e=>({status:"dirty",value:e}),zi=e=>({status:"valid",value:e}),ex=e=>e.status==="aborted",tx=e=>e.status==="dirty",Mg=e=>e.status==="valid",Lg=e=>typeof Promise<"u"&&e instanceof Promise;var Ct;(function(e){e.errToObj=n=>typeof n=="string"?{message:n}:n||{},e.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(Ct||(Ct={}));class il{constructor(n,r,a,s){this._cachedPath=[],this.parent=n,this.data=r,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Q5=(e,n)=>{if(Mg(n))return{success:!0,data:n.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new So(e.common.issues);return this._error=r,this._error}}};function Wt(e){if(!e)return{};const{errorMap:n,invalid_type_error:r,required_error:a,description:s}=e;if(n&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:s}:{errorMap:(f,h)=>f.code!=="invalid_type"?{message:h.defaultError}:typeof h.data>"u"?{message:a??h.defaultError}:{message:r??h.defaultError},description:s}}class Qt{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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(n){return cu(n.data)}_getOrReturnCtx(n,r){return r||{common:n.parent.common,data:n.data,parsedType:cu(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new wi,ctx:{common:n.parent.common,data:n.data,parsedType:cu(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const r=this._parse(n);if(Lg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(n){const r=this._parse(n);return Promise.resolve(r)}parse(n,r){const a=this.safeParse(n,r);if(a.success)return a.data;throw a.error}safeParse(n,r){var a;const s={common:{issues:[],async:(a=r==null?void 0:r.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:cu(n)},c=this._parseSync({data:n,path:s.path,parent:s});return Q5(s,c)}async parseAsync(n,r){const a=await this.safeParseAsync(n,r);if(a.success)return a.data;throw a.error}async safeParseAsync(n,r){const a={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:cu(n)},s=this._parse({data:n,path:a.path,parent:a}),c=await(Lg(s)?s:Promise.resolve(s));return Q5(a,c)}refine(n,r){const a=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,c)=>{const f=n(s),h=()=>c.addIssue({code:qe.custom,...a(s)});return typeof Promise<"u"&&f instanceof Promise?f.then(v=>v?!0:(h(),!1)):f?!0:(h(),!1)})}refinement(n,r){return this._refinement((a,s)=>n(a)?!0:(s.addIssue(typeof r=="function"?r(a,s):r),!1))}_refinement(n){return new wo({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}optional(){return ts.create(this,this._def)}nullable(){return Fc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xo.create(this,this._def)}promise(){return yd.create(this,this._def)}or(n){return nm.create([this,n],this._def)}and(n){return rm.create(this,n,this._def)}transform(n){return new wo({...Wt(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const r=typeof n=="function"?n:()=>n;return new sm({...Wt(this._def),innerType:this,defaultValue:r,typeName:Mt.ZodDefault})}brand(){return new J5({typeName:Mt.ZodBranded,type:this,...Wt(this._def)})}catch(n){const r=typeof n=="function"?n:()=>n;return new jg({...Wt(this._def),innerType:this,catchValue:r,typeName:Mt.ZodCatch})}describe(n){const r=this.constructor;return new r({...this._def,description:n})}pipe(n){return um.create(this,n)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const oI=/^c[^\s-]{8,}$/i,lI=/^[a-z][a-z0-9]*$/,sI=/[0-9A-HJKMNP-TV-Z]{26}/,uI=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,cI=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,fI=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,dI=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,pI=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,hI=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function mI(e,n){return!!((n==="v4"||!n)&&dI.test(e)||(n==="v6"||!n)&&pI.test(e))}class Eo extends Qt{constructor(){super(...arguments),this._regex=(n,r,a)=>this.refinement(s=>n.test(s),{validation:r,code:qe.invalid_string,...Ct.errToObj(a)}),this.nonempty=n=>this.min(1,Ct.errToObj(n)),this.trim=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==rt.string){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.string,received:c.parsedType}),Ut}const a=new wi;let s;for(const c of this._def.checks)if(c.kind==="min")n.data.length<c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")n.data.length>c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){const f=n.data.length>c.value,h=n.data.length<c.value;(f||h)&&(s=this._getOrReturnCtx(n,s),f?ot(s,{code:qe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):h&&ot(s,{code:qe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")cI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"email",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")fI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"emoji",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")uI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"uuid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")oI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"cuid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")lI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"cuid2",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")sI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"ulid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(n.data)}catch{s=this._getOrReturnCtx(n,s),ot(s,{validation:"url",code:qe.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"regex",code:qe.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?n.data=n.data.trim():c.kind==="includes"?n.data.includes(c.value,c.position)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?n.data=n.data.toLowerCase():c.kind==="toUpperCase"?n.data=n.data.toUpperCase():c.kind==="startsWith"?n.data.startsWith(c.value)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?n.data.endsWith(c.value)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?hI(c).test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="ip"?mI(n.data,c.version)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"ip",code:qe.invalid_string,message:c.message}),a.dirty()):hn.assertNever(c);return{status:a.value,value:n.data}}_addCheck(n){return new Eo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Ct.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Ct.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Ct.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Ct.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Ct.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Ct.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Ct.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Ct.errToObj(n)})}datetime(n){var r;return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(r=n==null?void 0:n.offset)!==null&&r!==void 0?r:!1,...Ct.errToObj(n==null?void 0:n.message)})}regex(n,r){return this._addCheck({kind:"regex",regex:n,...Ct.errToObj(r)})}includes(n,r){return this._addCheck({kind:"includes",value:n,position:r==null?void 0:r.position,...Ct.errToObj(r==null?void 0:r.message)})}startsWith(n,r){return this._addCheck({kind:"startsWith",value:n,...Ct.errToObj(r)})}endsWith(n,r){return this._addCheck({kind:"endsWith",value:n,...Ct.errToObj(r)})}min(n,r){return this._addCheck({kind:"min",value:n,...Ct.errToObj(r)})}max(n,r){return this._addCheck({kind:"max",value:n,...Ct.errToObj(r)})}length(n,r){return this._addCheck({kind:"length",value:n,...Ct.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}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 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 minLength(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxLength(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}Eo.create=e=>{var n;return new Eo({checks:[],typeName:Mt.ZodString,coerce:(n=e==null?void 0:e.coerce)!==null&&n!==void 0?n:!1,...Wt(e)})};function vI(e,n){const r=(e.toString().split(".")[1]||"").length,a=(n.toString().split(".")[1]||"").length,s=r>a?r:a,c=parseInt(e.toFixed(s).replace(".","")),f=parseInt(n.toFixed(s).replace(".",""));return c%f/Math.pow(10,s)}class fu extends Qt{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)),this._getType(n)!==rt.number){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.number,received:c.parsedType}),Ut}let a;const s=new wi;for(const c of this._def.checks)c.kind==="int"?hn.isInteger(n.data)||(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.invalid_type,expected:"integer",received:"float",message:c.message}),s.dirty()):c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="multipleOf"?vI(n.data,c.value)!==0&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):c.kind==="finite"?Number.isFinite(n.data)||(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_finite,message:c.message}),s.dirty()):hn.assertNever(c);return{status:s.value,value:n.data}}gte(n,r){return this.setLimit("min",n,!0,Ct.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Ct.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Ct.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Ct.toString(r))}setLimit(n,r,a,s){return new fu({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:a,message:Ct.toString(s)}]})}_addCheck(n){return new fu({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Ct.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ct.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ct.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ct.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ct.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Ct.toString(r)})}finite(n){return this._addCheck({kind:"finite",message:Ct.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ct.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ct.toString(n)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&hn.isInteger(n.value))}get isFinite(){let n=null,r=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(n===null||a.value<n)&&(n=a.value)}return Number.isFinite(r)&&Number.isFinite(n)}}fu.create=e=>new fu({checks:[],typeName:Mt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Wt(e)});class du extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce&&(n.data=BigInt(n.data)),this._getType(n)!==rt.bigint){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.bigint,received:c.parsedType}),Ut}let a;const s=new wi;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="multipleOf"?n.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):hn.assertNever(c);return{status:s.value,value:n.data}}gte(n,r){return this.setLimit("min",n,!0,Ct.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Ct.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Ct.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Ct.toString(r))}setLimit(n,r,a,s){return new du({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:a,message:Ct.toString(s)}]})}_addCheck(n){return new du({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ct.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ct.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ct.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ct.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Ct.toString(r)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}du.create=e=>{var n;return new du({checks:[],typeName:Mt.ZodBigInt,coerce:(n=e==null?void 0:e.coerce)!==null&&n!==void 0?n:!1,...Wt(e)})};class Jh extends Qt{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==rt.boolean){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.boolean,received:a.parsedType}),Ut}return zi(n.data)}}Jh.create=e=>new Jh({typeName:Mt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Wt(e)});class Lc extends Qt{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==rt.date){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.date,received:c.parsedType}),Ut}if(isNaN(n.data.getTime())){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_date}),Ut}const a=new wi;let s;for(const c of this._def.checks)c.kind==="min"?n.data.getTime()<c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?n.data.getTime()>c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):hn.assertNever(c);return{status:a.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Lc({...this._def,checks:[...this._def.checks,n]})}min(n,r){return this._addCheck({kind:"min",value:n.getTime(),message:Ct.toString(r)})}max(n,r){return this._addCheck({kind:"max",value:n.getTime(),message:Ct.toString(r)})}get minDate(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n!=null?new Date(n):null}}Lc.create=e=>new Lc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Mt.ZodDate,...Wt(e)});class Pg extends Qt{_parse(n){if(this._getType(n)!==rt.symbol){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.symbol,received:a.parsedType}),Ut}return zi(n.data)}}Pg.create=e=>new Pg({typeName:Mt.ZodSymbol,...Wt(e)});class em extends Qt{_parse(n){if(this._getType(n)!==rt.undefined){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.undefined,received:a.parsedType}),Ut}return zi(n.data)}}em.create=e=>new em({typeName:Mt.ZodUndefined,...Wt(e)});class tm extends Qt{_parse(n){if(this._getType(n)!==rt.null){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.null,received:a.parsedType}),Ut}return zi(n.data)}}tm.create=e=>new tm({typeName:Mt.ZodNull,...Wt(e)});class md extends Qt{constructor(){super(...arguments),this._any=!0}_parse(n){return zi(n.data)}}md.create=e=>new md({typeName:Mt.ZodAny,...Wt(e)});class Pc extends Qt{constructor(){super(...arguments),this._unknown=!0}_parse(n){return zi(n.data)}}Pc.create=e=>new Pc({typeName:Mt.ZodUnknown,...Wt(e)});class es extends Qt{_parse(n){const r=this._getOrReturnCtx(n);return ot(r,{code:qe.invalid_type,expected:rt.never,received:r.parsedType}),Ut}}es.create=e=>new es({typeName:Mt.ZodNever,...Wt(e)});class Ng extends Qt{_parse(n){if(this._getType(n)!==rt.undefined){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.void,received:a.parsedType}),Ut}return zi(n.data)}}Ng.create=e=>new Ng({typeName:Mt.ZodVoid,...Wt(e)});class xo extends Qt{_parse(n){const{ctx:r,status:a}=this._processInputParams(n),s=this._def;if(r.parsedType!==rt.array)return ot(r,{code:qe.invalid_type,expected:rt.array,received:r.parsedType}),Ut;if(s.exactLength!==null){const f=r.data.length>s.exactLength.value,h=r.data.length<s.exactLength.value;(f||h)&&(ot(r,{code:f?qe.too_big:qe.too_small,minimum:h?s.exactLength.value:void 0,maximum:f?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(ot(r,{code:qe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(ot(r,{code:qe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((f,h)=>s.type._parseAsync(new il(r,f,r.path,h)))).then(f=>wi.mergeArray(a,f));const c=[...r.data].map((f,h)=>s.type._parseSync(new il(r,f,r.path,h)));return wi.mergeArray(a,c)}get element(){return this._def.type}min(n,r){return new xo({...this._def,minLength:{value:n,message:Ct.toString(r)}})}max(n,r){return new xo({...this._def,maxLength:{value:n,message:Ct.toString(r)}})}length(n,r){return new xo({...this._def,exactLength:{value:n,message:Ct.toString(r)}})}nonempty(n){return this.min(1,n)}}xo.create=(e,n)=>new xo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Wt(n)});function vd(e){if(e instanceof rr){const n={};for(const r in e.shape){const a=e.shape[r];n[r]=ts.create(vd(a))}return new rr({...e._def,shape:()=>n})}else return e instanceof xo?new xo({...e._def,type:vd(e.element)}):e instanceof ts?ts.create(vd(e.unwrap())):e instanceof Fc?Fc.create(vd(e.unwrap())):e instanceof al?al.create(e.items.map(n=>vd(n))):e}class rr extends Qt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),r=hn.objectKeys(n);return this._cached={shape:n,keys:r}}_parse(n){if(this._getType(n)!==rt.object){const y=this._getOrReturnCtx(n);return ot(y,{code:qe.invalid_type,expected:rt.object,received:y.parsedType}),Ut}const{status:a,ctx:s}=this._processInputParams(n),{shape:c,keys:f}=this._getCached(),h=[];if(!(this._def.catchall instanceof es&&this._def.unknownKeys==="strip"))for(const y in s.data)f.includes(y)||h.push(y);const v=[];for(const y of f){const S=c[y],E=s.data[y];v.push({key:{status:"valid",value:y},value:S._parse(new il(s,E,s.path,y)),alwaysSet:y in s.data})}if(this._def.catchall instanceof es){const y=this._def.unknownKeys;if(y==="passthrough")for(const S of h)v.push({key:{status:"valid",value:S},value:{status:"valid",value:s.data[S]}});else if(y==="strict")h.length>0&&(ot(s,{code:qe.unrecognized_keys,keys:h}),a.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const S of h){const E=s.data[S];v.push({key:{status:"valid",value:S},value:y._parse(new il(s,E,s.path,S)),alwaysSet:S in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const y=[];for(const S of v){const E=await S.key;y.push({key:E,value:await S.value,alwaysSet:S.alwaysSet})}return y}).then(y=>wi.mergeObjectSync(a,y)):wi.mergeObjectSync(a,v)}get shape(){return this._def.shape()}strict(n){return Ct.errToObj,new rr({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(r,a)=>{var s,c,f,h;const v=(f=(c=(s=this._def).errorMap)===null||c===void 0?void 0:c.call(s,r,a).message)!==null&&f!==void 0?f:a.defaultError;return r.code==="unrecognized_keys"?{message:(h=Ct.errToObj(n).message)!==null&&h!==void 0?h:v}:{message:v}}}:{}})}strip(){return new rr({...this._def,unknownKeys:"strip"})}passthrough(){return new rr({...this._def,unknownKeys:"passthrough"})}extend(n){return new rr({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new rr({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Mt.ZodObject})}setKey(n,r){return this.augment({[n]:r})}catchall(n){return new rr({...this._def,catchall:n})}pick(n){const r={};return hn.objectKeys(n).forEach(a=>{n[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new rr({...this._def,shape:()=>r})}omit(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{n[a]||(r[a]=this.shape[a])}),new rr({...this._def,shape:()=>r})}deepPartial(){return vd(this)}partial(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];n&&!n[a]?r[a]=s:r[a]=s.optional()}),new rr({...this._def,shape:()=>r})}required(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{if(n&&!n[a])r[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof ts;)c=c._def.innerType;r[a]=c}}),new rr({...this._def,shape:()=>r})}keyof(){return X5(hn.objectKeys(this.shape))}}rr.create=(e,n)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)}),rr.strictCreate=(e,n)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)}),rr.lazycreate=(e,n)=>new rr({shape:e,unknownKeys:"strip",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)});class nm extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a=this._def.options;function s(c){for(const h of c)if(h.result.status==="valid")return h.result;for(const h of c)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;const f=c.map(h=>new So(h.ctx.common.issues));return ot(r,{code:qe.invalid_union,unionErrors:f}),Ut}if(r.common.async)return Promise.all(a.map(async c=>{const f={...r,common:{...r.common,issues:[]},parent:null};return{result:await c._parseAsync({data:r.data,path:r.path,parent:f}),ctx:f}})).then(s);{let c;const f=[];for(const v of a){const y={...r,common:{...r.common,issues:[]},parent:null},S=v._parseSync({data:r.data,path:r.path,parent:y});if(S.status==="valid")return S;S.status==="dirty"&&!c&&(c={result:S,ctx:y}),y.common.issues.length&&f.push(y.common.issues)}if(c)return r.common.issues.push(...c.ctx.common.issues),c.result;const h=f.map(v=>new So(v));return ot(r,{code:qe.invalid_union,unionErrors:h}),Ut}}get options(){return this._def.options}}nm.create=(e,n)=>new nm({options:e,typeName:Mt.ZodUnion,...Wt(n)});const Fg=e=>e instanceof am?Fg(e.schema):e instanceof wo?Fg(e.innerType()):e instanceof om?[e.value]:e instanceof pu?e.options:e instanceof lm?Object.keys(e.enum):e instanceof sm?Fg(e._def.innerType):e instanceof em?[void 0]:e instanceof tm?[null]:null;class Ig extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.object)return ot(r,{code:qe.invalid_type,expected:rt.object,received:r.parsedType}),Ut;const a=this.discriminator,s=r.data[a],c=this.optionsMap.get(s);return c?r.common.async?c._parseAsync({data:r.data,path:r.path,parent:r}):c._parseSync({data:r.data,path:r.path,parent:r}):(ot(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,r,a){const s=new Map;for(const c of r){const f=Fg(c.shape[n]);if(!f)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const h of f){if(s.has(h))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(h)}`);s.set(h,c)}}return new Ig({typeName:Mt.ZodDiscriminatedUnion,discriminator:n,options:r,optionsMap:s,...Wt(a)})}}function nx(e,n){const r=cu(e),a=cu(n);if(e===n)return{valid:!0,data:e};if(r===rt.object&&a===rt.object){const s=hn.objectKeys(n),c=hn.objectKeys(e).filter(h=>s.indexOf(h)!==-1),f={...e,...n};for(const h of c){const v=nx(e[h],n[h]);if(!v.valid)return{valid:!1};f[h]=v.data}return{valid:!0,data:f}}else if(r===rt.array&&a===rt.array){if(e.length!==n.length)return{valid:!1};const s=[];for(let c=0;c<e.length;c++){const f=e[c],h=n[c],v=nx(f,h);if(!v.valid)return{valid:!1};s.push(v.data)}return{valid:!0,data:s}}else return r===rt.date&&a===rt.date&&+e==+n?{valid:!0,data:e}:{valid:!1}}class rm extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n),s=(c,f)=>{if(ex(c)||ex(f))return Ut;const h=nx(c.value,f.value);return h.valid?((tx(c)||tx(f))&&r.dirty(),{status:r.value,value:h.data}):(ot(a,{code:qe.invalid_intersection_types}),Ut)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,f])=>s(c,f)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}rm.create=(e,n,r)=>new rm({left:e,right:n,typeName:Mt.ZodIntersection,...Wt(r)});class al extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.array)return ot(a,{code:qe.invalid_type,expected:rt.array,received:a.parsedType}),Ut;if(a.data.length<this._def.items.length)return ot(a,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ut;!this._def.rest&&a.data.length>this._def.items.length&&(ot(a,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const c=[...a.data].map((f,h)=>{const v=this._def.items[h]||this._def.rest;return v?v._parse(new il(a,f,a.path,h)):null}).filter(f=>!!f);return a.common.async?Promise.all(c).then(f=>wi.mergeArray(r,f)):wi.mergeArray(r,c)}get items(){return this._def.items}rest(n){return new al({...this._def,rest:n})}}al.create=(e,n)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new al({items:e,typeName:Mt.ZodTuple,rest:null,...Wt(n)})};class im extends Qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.object)return ot(a,{code:qe.invalid_type,expected:rt.object,received:a.parsedType}),Ut;const s=[],c=this._def.keyType,f=this._def.valueType;for(const h in a.data)s.push({key:c._parse(new il(a,h,a.path,h)),value:f._parse(new il(a,a.data[h],a.path,h))});return a.common.async?wi.mergeObjectAsync(r,s):wi.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(n,r,a){return r instanceof Qt?new im({keyType:n,valueType:r,typeName:Mt.ZodRecord,...Wt(a)}):new im({keyType:Eo.create(),valueType:n,typeName:Mt.ZodRecord,...Wt(r)})}}class zg extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.map)return ot(a,{code:qe.invalid_type,expected:rt.map,received:a.parsedType}),Ut;const s=this._def.keyType,c=this._def.valueType,f=[...a.data.entries()].map(([h,v],y)=>({key:s._parse(new il(a,h,a.path,[y,"key"])),value:c._parse(new il(a,v,a.path,[y,"value"]))}));if(a.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const v of f){const y=await v.key,S=await v.value;if(y.status==="aborted"||S.status==="aborted")return Ut;(y.status==="dirty"||S.status==="dirty")&&r.dirty(),h.set(y.value,S.value)}return{status:r.value,value:h}})}else{const h=new Map;for(const v of f){const y=v.key,S=v.value;if(y.status==="aborted"||S.status==="aborted")return Ut;(y.status==="dirty"||S.status==="dirty")&&r.dirty(),h.set(y.value,S.value)}return{status:r.value,value:h}}}}zg.create=(e,n,r)=>new zg({valueType:n,keyType:e,typeName:Mt.ZodMap,...Wt(r)});class Nc extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.set)return ot(a,{code:qe.invalid_type,expected:rt.set,received:a.parsedType}),Ut;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(ot(a,{code:qe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(ot(a,{code:qe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const c=this._def.valueType;function f(v){const y=new Set;for(const S of v){if(S.status==="aborted")return Ut;S.status==="dirty"&&r.dirty(),y.add(S.value)}return{status:r.value,value:y}}const h=[...a.data.values()].map((v,y)=>c._parse(new il(a,v,a.path,y)));return a.common.async?Promise.all(h).then(v=>f(v)):f(h)}min(n,r){return new Nc({...this._def,minSize:{value:n,message:Ct.toString(r)}})}max(n,r){return new Nc({...this._def,maxSize:{value:n,message:Ct.toString(r)}})}size(n,r){return this.min(n,r).max(n,r)}nonempty(n){return this.min(1,n)}}Nc.create=(e,n)=>new Nc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Wt(n)});class gd extends Qt{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.function)return ot(r,{code:qe.invalid_type,expected:rt.function,received:r.parsedType}),Ut;function a(h,v){return Ag({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dg(),Xh].filter(y=>!!y),issueData:{code:qe.invalid_arguments,argumentsError:v}})}function s(h,v){return Ag({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dg(),Xh].filter(y=>!!y),issueData:{code:qe.invalid_return_type,returnTypeError:v}})}const c={errorMap:r.common.contextualErrorMap},f=r.data;return this._def.returns instanceof yd?zi(async(...h)=>{const v=new So([]),y=await this._def.args.parseAsync(h,c).catch(C=>{throw v.addIssue(a(h,C)),v}),S=await f(...y);return await this._def.returns._def.type.parseAsync(S,c).catch(C=>{throw v.addIssue(s(S,C)),v})}):zi((...h)=>{const v=this._def.args.safeParse(h,c);if(!v.success)throw new So([a(h,v.error)]);const y=f(...v.data),S=this._def.returns.safeParse(y,c);if(!S.success)throw new So([s(y,S.error)]);return S.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new gd({...this._def,args:al.create(n).rest(Pc.create())})}returns(n){return new gd({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,r,a){return new gd({args:n||al.create([]).rest(Pc.create()),returns:r||Pc.create(),typeName:Mt.ZodFunction,...Wt(a)})}}class am extends Qt{get schema(){return this._def.getter()}_parse(n){const{ctx:r}=this._processInputParams(n);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}am.create=(e,n)=>new am({getter:e,typeName:Mt.ZodLazy,...Wt(n)});class om extends Qt{_parse(n){if(n.data!==this._def.value){const r=this._getOrReturnCtx(n);return ot(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),Ut}return{status:"valid",value:n.data}}get value(){return this._def.value}}om.create=(e,n)=>new om({value:e,typeName:Mt.ZodLiteral,...Wt(n)});function X5(e,n){return new pu({values:e,typeName:Mt.ZodEnum,...Wt(n)})}class pu extends Qt{_parse(n){if(typeof n.data!="string"){const r=this._getOrReturnCtx(n),a=this._def.values;return ot(r,{expected:hn.joinValues(a),received:r.parsedType,code:qe.invalid_type}),Ut}if(this._def.values.indexOf(n.data)===-1){const r=this._getOrReturnCtx(n),a=this._def.values;return ot(r,{received:r.data,code:qe.invalid_enum_value,options:a}),Ut}return zi(n.data)}get options(){return this._def.values}get enum(){const n={};for(const r of this._def.values)n[r]=r;return n}get Values(){const n={};for(const r of this._def.values)n[r]=r;return n}get Enum(){const n={};for(const r of this._def.values)n[r]=r;return n}extract(n){return pu.create(n)}exclude(n){return pu.create(this.options.filter(r=>!n.includes(r)))}}pu.create=X5;class lm extends Qt{_parse(n){const r=hn.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(n);if(a.parsedType!==rt.string&&a.parsedType!==rt.number){const s=hn.objectValues(r);return ot(a,{expected:hn.joinValues(s),received:a.parsedType,code:qe.invalid_type}),Ut}if(r.indexOf(n.data)===-1){const s=hn.objectValues(r);return ot(a,{received:a.data,code:qe.invalid_enum_value,options:s}),Ut}return zi(n.data)}get enum(){return this._def.values}}lm.create=(e,n)=>new lm({values:e,typeName:Mt.ZodNativeEnum,...Wt(n)});class yd extends Qt{unwrap(){return this._def.type}_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.promise&&r.common.async===!1)return ot(r,{code:qe.invalid_type,expected:rt.promise,received:r.parsedType}),Ut;const a=r.parsedType===rt.promise?r.data:Promise.resolve(r.data);return zi(a.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}yd.create=(e,n)=>new yd({type:e,typeName:Mt.ZodPromise,...Wt(n)});class wo extends Qt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:r,ctx:a}=this._processInputParams(n),s=this._def.effect||null;if(s.type==="preprocess"){const f=s.transform(a.data);return a.common.async?Promise.resolve(f).then(h=>this._def.schema._parseAsync({data:h,path:a.path,parent:a})):this._def.schema._parseSync({data:f,path:a.path,parent:a})}const c={addIssue:f=>{ot(a,f),f.fatal?r.abort():r.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),s.type==="refinement"){const f=h=>{const v=s.refinement(h,c);if(a.common.async)return Promise.resolve(v);if(v instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(a.common.async===!1){const h=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?Ut:(h.status==="dirty"&&r.dirty(),f(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(h=>h.status==="aborted"?Ut:(h.status==="dirty"&&r.dirty(),f(h.value).then(()=>({status:r.value,value:h.value}))))}if(s.type==="transform")if(a.common.async===!1){const f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Mg(f))return f;const h=s.transform(f.value,c);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>Mg(f)?Promise.resolve(s.transform(f.value,c)).then(h=>({status:r.value,value:h})):f);hn.assertNever(s)}}wo.create=(e,n,r)=>new wo({schema:e,typeName:Mt.ZodEffects,effect:n,...Wt(r)}),wo.createWithPreprocess=(e,n,r)=>new wo({schema:n,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Wt(r)});class ts extends Qt{_parse(n){return this._getType(n)===rt.undefined?zi(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ts.create=(e,n)=>new ts({innerType:e,typeName:Mt.ZodOptional,...Wt(n)});class Fc extends Qt{_parse(n){return this._getType(n)===rt.null?zi(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Fc.create=(e,n)=>new Fc({innerType:e,typeName:Mt.ZodNullable,...Wt(n)});class sm extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n);let a=r.data;return r.parsedType===rt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}sm.create=(e,n)=>new sm({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Wt(n)});class jg extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Lg(s)?s.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new So(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new So(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}jg.create=(e,n)=>new jg({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Wt(n)});class $g extends Qt{_parse(n){if(this._getType(n)!==rt.nan){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.nan,received:a.parsedType}),Ut}return{status:"valid",value:n.data}}}$g.create=e=>new $g({typeName:Mt.ZodNaN,...Wt(e)});const gI=Symbol("zod_brand");class J5 extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}}class um extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?Ut:c.status==="dirty"?(r.dirty(),G5(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?Ut:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(n,r){return new um({in:n,out:r,typeName:Mt.ZodPipeline})}}const e3=(e,n={},r)=>e?md.create().superRefine((a,s)=>{var c,f;if(!e(a)){const h=typeof n=="function"?n(a):typeof n=="string"?{message:n}:n,v=(f=(c=h.fatal)!==null&&c!==void 0?c:r)!==null&&f!==void 0?f:!0,y=typeof h=="string"?{message:h}:h;s.addIssue({code:"custom",...y,fatal:v})}}):md.create(),yI={object:rr.lazycreate};var Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(Mt||(Mt={}));const bI=(e,n={message:`Input not instance of ${e.name}`})=>e3(r=>r instanceof e,n),t3=Eo.create,n3=fu.create,SI=$g.create,EI=du.create,r3=Jh.create,xI=Lc.create,wI=Pg.create,CI=em.create,kI=tm.create,_I=md.create,TI=Pc.create,RI=es.create,OI=Ng.create,DI=xo.create,AI=rr.create,MI=rr.strictCreate,LI=nm.create,PI=Ig.create,NI=rm.create,FI=al.create,II=im.create,zI=zg.create,jI=Nc.create,$I=gd.create,UI=am.create,BI=om.create,VI=pu.create,HI=lm.create,qI=yd.create,i3=wo.create,WI=ts.create,YI=Fc.create,ZI=wo.createWithPreprocess,KI=um.create;var lt=Object.freeze({__proto__:null,defaultErrorMap:Xh,setErrorMap:iI,getErrorMap:Dg,makeIssue:Ag,EMPTY_PATH:aI,addIssueToContext:ot,ParseStatus:wi,INVALID:Ut,DIRTY:G5,OK:zi,isAborted:ex,isDirty:tx,isValid:Mg,isAsync:Lg,get util(){return hn},get objectUtil(){return JE},ZodParsedType:rt,getParsedType:cu,ZodType:Qt,ZodString:Eo,ZodNumber:fu,ZodBigInt:du,ZodBoolean:Jh,ZodDate:Lc,ZodSymbol:Pg,ZodUndefined:em,ZodNull:tm,ZodAny:md,ZodUnknown:Pc,ZodNever:es,ZodVoid:Ng,ZodArray:xo,ZodObject:rr,ZodUnion:nm,ZodDiscriminatedUnion:Ig,ZodIntersection:rm,ZodTuple:al,ZodRecord:im,ZodMap:zg,ZodSet:Nc,ZodFunction:gd,ZodLazy:am,ZodLiteral:om,ZodEnum:pu,ZodNativeEnum:lm,ZodPromise:yd,ZodEffects:wo,ZodTransformer:wo,ZodOptional:ts,ZodNullable:Fc,ZodDefault:sm,ZodCatch:jg,ZodNaN:$g,BRAND:gI,ZodBranded:J5,ZodPipeline:um,custom:e3,Schema:Qt,ZodSchema:Qt,late:yI,get ZodFirstPartyTypeKind(){return Mt},coerce:{string:e=>Eo.create({...e,coerce:!0}),number:e=>fu.create({...e,coerce:!0}),boolean:e=>Jh.create({...e,coerce:!0}),bigint:e=>du.create({...e,coerce:!0}),date:e=>Lc.create({...e,coerce:!0})},any:_I,array:DI,bigint:EI,boolean:r3,date:xI,discriminatedUnion:PI,effect:i3,enum:VI,function:$I,instanceof:bI,intersection:NI,lazy:UI,literal:BI,map:zI,nan:SI,nativeEnum:HI,never:RI,null:kI,nullable:YI,number:n3,object:AI,oboolean:()=>r3().optional(),onumber:()=>n3().optional(),optional:WI,ostring:()=>t3().optional(),pipeline:KI,preprocess:ZI,promise:qI,record:II,set:jI,strictObject:MI,string:t3,symbol:wI,transformer:i3,tuple:FI,undefined:CI,union:LI,unknown:TI,void:OI,NEVER:Ut,ZodIssueCode:qe,quotelessJson:rI,ZodError:So});const GI=lt.object({type:lt.literal("audio"),audio:lt.string(),title:lt.string().optional()}).transform(({type:e,audio:n})=>({type:e,url:n}));function Ug(e){return{block:e,type:"bubble"}}const QI=lt.object({title:lt.string(),action:lt.literal("Say something"),text:lt.string()}).transform(({title:e,text:n})=>({type:"button",variant:"action",text:e,buttonValue:n,reusable:!0})),XI=lt.object({title:lt.string(),action:lt.literal("Open URL"),url:lt.string()}).transform(({title:e,url:n})=>({type:"button",variant:"link",text:e,buttonValue:n,reusable:!0})),JI=lt.object({title:lt.string(),action:lt.literal("Postback"),payload:lt.string()}).transform(({title:e,payload:n})=>({type:"button",variant:"action",text:e,buttonValue:n,reusable:!0})),ez=lt.union([QI,XI,JI]),a3=lt.object({type:lt.literal("card"),title:lt.string().optional(),subtitle:lt.string().optional(),image:lt.string().optional(),actions:lt.array(ez)}),o3=({title:e,image:n,actions:r,subtitle:a})=>{const s=[];return n&&s.push({type:"image",url:n}),e&&s.push({type:"text",text:`## ${e}`}),a&&s.push({type:"text",text:a}),r.length>0&&s.push({type:"row",blocks:r}),{type:"column",horizontalAlignment:"center",blocks:[...s]}},tz=a3.transform(e=>Ug(o3(e))),nz=lt.object({type:lt.literal("carousel"),items:lt.array(a3.omit({type:!0}).transform(o3))}).transform(({items:e})=>({type:"carousel",blocks:e}));let Bg;const rz=new Uint8Array(16);function iz(){if(!Bg&&(Bg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bg(rz)}const si=[];for(let e=0;e<256;++e)si.push((e+256).toString(16).slice(1));function az(e,n=0){return(si[e[n+0]]+si[e[n+1]]+si[e[n+2]]+si[e[n+3]]+"-"+si[e[n+4]]+si[e[n+5]]+"-"+si[e[n+6]]+si[e[n+7]]+"-"+si[e[n+8]]+si[e[n+9]]+"-"+si[e[n+10]]+si[e[n+11]]+si[e[n+12]]+si[e[n+13]]+si[e[n+14]]+si[e[n+15]]).toLowerCase()}const l3={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oz(e,n,r){if(l3.randomUUID&&!n&&!e)return l3.randomUUID();e=e||{};const a=e.random||(e.rng||iz)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){r=r||0;for(let s=0;s<16;++s)n[r+s]=a[s];return n}return az(a)}const lz=lt.object({type:lt.literal("single-choice"),text:lt.string(),choices:lt.array(lt.object({title:lt.string(),value:lt.string()}))}).transform(({choices:e,text:n})=>{const r=oz(),a=[{type:"row",blocks:e.map(({title:s,value:c})=>({type:"button",variant:"action",text:s,buttonValue:c,groupId:r}))}];return n&&a.unshift({type:"text",text:n}),Ug({type:"column",blocks:a})}),sz=lt.object({type:lt.literal("file"),file:lt.string(),title:lt.string().optional()}).transform(({file:e,...n})=>({url:e,...n})),uz=lt.object({type:lt.literal("image"),image:lt.string(),title:lt.string().optional()}).transform(({type:e,image:n})=>({type:e,url:n})),cz=lt.object({type:lt.literal("location"),latitude:lt.number(),longitude:lt.number(),address:lt.string().optional(),title:lt.string().optional()}).transform(({type:e,latitude:n,longitude:r,title:a,address:s})=>({type:e,latitude:n,longitude:r,title:a??s??"View on map"})),fz=lt.object({type:lt.literal("text"),text:lt.string(),markdown:lt.boolean().optional()}).transform(({type:e,text:n})=>Ug({type:e,text:n})),dz=lt.object({type:lt.literal("video"),video:lt.string(),title:lt.string().optional()}).transform(({type:e,video:n})=>({type:e,url:n})),pz=lt.object({type:lt.literal("voice"),audio:lt.string()}).transform(({audio:e})=>({type:"audio",url:e})),hz=lt.object({type:lt.literal("dropdown"),text:lt.string().optional(),message:lt.string().optional(),options:lt.array(lt.object({label:lt.string(),value:lt.string()}))}).transform(({options:e,text:n})=>{const r=[{type:"dropdown",label:n??"Select an option",options:e}];return n&&r.unshift({type:"text",text:n}),Ug({type:"column",blocks:r})}),s3=lt.union([fz,uz,GI,dz,nz,tz,cz,sz,pz,lz,hz]);var u3={},rx={},c3={};Object.defineProperty(c3,"__esModule",{value:!0});var Vg={},mz=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.Emitter=void 0;let vz=class{constructor(){this.listeners={}}on(n,r,a=!1){const s=this.listeners[n];s?a?s.unshift(r):s.push(r):this.listeners[n]=[r]}emit(n,r){return mz(this,void 0,void 0,function*(){const a=this.listeners[n];if(a!=null&&a.length){for(const s of a)yield s(r);return!0}else return!1})}};Vg.Emitter=vz;var f3={};Object.defineProperty(f3,"__esModule",{value:!0});var d3={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(n){n.Create="create",n.Configure="configure",n.Start="start",n.StartFailure="start-failure",n.Initialize="initialize",n.InitializeFailure="initialize-failure",n.Sleep="sleep",n.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(d3);var p3={};Object.defineProperty(p3,"__esModule",{value:!0});var h3={};Object.defineProperty(h3,"__esModule",{value:!0});var m3={};Object.defineProperty(m3,"__esModule",{value:!0});var v3={};Object.defineProperty(v3,"__esModule",{value:!0}),function(e){var n=Ht&&Ht.__createBinding||(Object.create?function(a,s,c,f){f===void 0&&(f=c),Object.defineProperty(a,f,{enumerable:!0,get:function(){return s[c]}})}:function(a,s,c,f){f===void 0&&(f=c),a[f]=s[c]}),r=Ht&&Ht.__exportStar||function(a,s){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(s,c)&&n(s,a,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(c3,e),r(Vg,e),r(f3,e),r(d3,e),r(p3,e),r(h3,e),r(m3,e),r(v3,e)}(rx);var Hg={},g3={},ix={exports:{}},qg={},ax={},Wg={},cm={},bd={},Ic={},Sd={},Ed={},ol={};Object.defineProperty(ol,"__esModule",{value:!0}),ol.ERROR_PACKET=ol.PACKET_TYPES_REVERSE=ol.PACKET_TYPES=void 0;const ll=Object.create(null);ol.PACKET_TYPES=ll,ll.open="0",ll.close="1",ll.ping="2",ll.pong="3",ll.message="4",ll.upgrade="5",ll.noop="6";const y3=Object.create(null);ol.PACKET_TYPES_REVERSE=y3,Object.keys(ll).forEach(e=>{y3[ll[e]]=e});const gz={type:"error",data:"parser error"};ol.ERROR_PACKET=gz,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.encodePacket=Ed.encodePacketToBinary=void 0;const yz=ol,b3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",S3=typeof ArrayBuffer=="function",E3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,x3=({type:e,data:n},r,a)=>b3&&n instanceof Blob?r?a(n):w3(n,a):S3&&(n instanceof ArrayBuffer||E3(n))?r?a(n):w3(new Blob([n]),a):a(yz.PACKET_TYPES[e]+(n||""));Ed.encodePacket=x3;const w3=(e,n)=>{const r=new FileReader;return r.onload=function(){const a=r.result.split(",")[1];n("b"+(a||""))},r.readAsDataURL(e)};function C3(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ox;function bz(e,n){if(b3&&e.data instanceof Blob)return e.data.arrayBuffer().then(C3).then(n);if(S3&&(e.data instanceof ArrayBuffer||E3(e.data)))return n(C3(e.data));x3(e,!1,r=>{ox||(ox=new TextEncoder),n(ox.encode(r))})}Ed.encodePacketToBinary=bz;var Yg={},xd={};Object.defineProperty(xd,"__esModule",{value:!0}),xd.decode=xd.encode=void 0;const wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wd.length;e++)fm[wd.charCodeAt(e)]=e;const Sz=e=>{let n=new Uint8Array(e),r,a=n.length,s="";for(r=0;r<a;r+=3)s+=wd[n[r]>>2],s+=wd[(n[r]&3)<<4|n[r+1]>>4],s+=wd[(n[r+1]&15)<<2|n[r+2]>>6],s+=wd[n[r+2]&63];return a%3===2?s=s.substring(0,s.length-1)+"=":a%3===1&&(s=s.substring(0,s.length-2)+"=="),s};xd.encode=Sz;const Ez=e=>{let n=e.length*.75,r=e.length,a,s=0,c,f,h,v;e[e.length-1]==="="&&(n--,e[e.length-2]==="="&&n--);const y=new ArrayBuffer(n),S=new Uint8Array(y);for(a=0;a<r;a+=4)c=fm[e.charCodeAt(a)],f=fm[e.charCodeAt(a+1)],h=fm[e.charCodeAt(a+2)],v=fm[e.charCodeAt(a+3)],S[s++]=c<<2|f>>4,S[s++]=(f&15)<<4|h>>2,S[s++]=(h&3)<<6|v&63;return y};xd.decode=Ez,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.decodePacket=void 0;const Zg=ol,xz=xd,wz=typeof ArrayBuffer=="function",Cz=(e,n)=>{if(typeof e!="string")return{type:"message",data:k3(e,n)};const r=e.charAt(0);return r==="b"?{type:"message",data:kz(e.substring(1),n)}:Zg.PACKET_TYPES_REVERSE[r]?e.length>1?{type:Zg.PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:Zg.PACKET_TYPES_REVERSE[r]}:Zg.ERROR_PACKET};Yg.decodePacket=Cz;const kz=(e,n)=>{if(wz){const r=(0,xz.decode)(e);return k3(r,n)}else return{base64:!0,data:e}},k3=(e,n)=>{switch(n){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const n=Ed;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return n.encodePacket}});const r=Yg;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return r.decodePacket}});const a=ol,s=String.fromCharCode(30),c=(C,x)=>{const R=C.length,T=new Array(R);let D=0;C.forEach((M,I)=>{(0,n.encodePacket)(M,!1,N=>{T[I]=N,++D===R&&x(T.join(s))})})};e.encodePayload=c;const f=(C,x)=>{const R=C.split(s),T=[];for(let D=0;D<R.length;D++){const M=(0,r.decodePacket)(R[D],x);if(T.push(M),M.type==="error")break}return T};e.decodePayload=f;function h(){return new TransformStream({transform(C,x){(0,n.encodePacketToBinary)(C,R=>{const T=R.length;let D;if(T<126)D=new Uint8Array(1),new DataView(D.buffer).setUint8(0,T);else if(T<65536){D=new Uint8Array(3);const M=new DataView(D.buffer);M.setUint8(0,126),M.setUint16(1,T)}else{D=new Uint8Array(9);const M=new DataView(D.buffer);M.setUint8(0,127),M.setBigUint64(1,BigInt(T))}C.data&&typeof C.data!="string"&&(D[0]|=128),x.enqueue(D),x.enqueue(R)})}})}e.createPacketEncoderStream=h;let v;function y(C){return C.reduce((x,R)=>x+R.length,0)}function S(C,x){if(C[0].length===x)return C.shift();const R=new Uint8Array(x);let T=0;for(let D=0;D<x;D++)R[D]=C[0][T++],T===C[0].length&&(C.shift(),T=0);return C.length&&T<C[0].length&&(C[0]=C[0].slice(T)),R}function E(C,x){v||(v=new TextDecoder);const R=[];let T=0,D=-1,M=!1;return new TransformStream({transform(I,N){for(R.push(I);;){if(T===0){if(y(R)<1)break;const B=S(R,1);M=(B[0]&128)===128,D=B[0]&127,D<126?T=3:D===126?T=1:T=2}else if(T===1){if(y(R)<2)break;const B=S(R,2);D=new DataView(B.buffer,B.byteOffset,B.length).getUint16(0),T=3}else if(T===2){if(y(R)<8)break;const B=S(R,8),F=new DataView(B.buffer,B.byteOffset,B.length),$=F.getUint32(0);if($>Math.pow(2,53-32)-1){N.enqueue(a.ERROR_PACKET);break}D=$*Math.pow(2,32)+F.getUint32(4),T=3}else{if(y(R)<D)break;const B=S(R,D);N.enqueue((0,r.decodePacket)(M?B:v.decode(B),x)),T=0}if(D===0||D>C){N.enqueue(a.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=E,e.protocol=4})(Sd);function ji(e){if(e)return _z(e)}function _z(e){for(var n in ji.prototype)e[n]=ji.prototype[n];return e}ji.prototype.on=ji.prototype.addEventListener=function(e,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(n),this},ji.prototype.once=function(e,n){function r(){this.off(e,r),n.apply(this,arguments)}return r.fn=n,this.on(e,r),this},ji.prototype.off=ji.prototype.removeListener=ji.prototype.removeAllListeners=ji.prototype.removeEventListener=function(e,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var a,s=0;s<r.length;s++)if(a=r[s],a===n||a.fn===n){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+e],this},ji.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),r=this._callbacks["$"+e],a=1;a<arguments.length;a++)n[a-1]=arguments[a];if(r){r=r.slice(0);for(var a=0,s=r.length;a<s;++a)r[a].apply(this,n)}return this},ji.prototype.emitReserved=ji.prototype.emit,ji.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ji.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Cd=o6(Object.freeze(Object.defineProperty({__proto__:null,Emitter:ji},Symbol.toStringTag,{value:"Module"})));var to={},zc={};Object.defineProperty(zc,"__esModule",{value:!0}),zc.globalThisShim=void 0,zc.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(to,"__esModule",{value:!0}),to.byteLength=to.installTimerFunctions=to.pick=void 0;const hu=zc;function Tz(e,...n){return n.reduce((r,a)=>(e.hasOwnProperty(a)&&(r[a]=e[a]),r),{})}to.pick=Tz;const Rz=hu.globalThisShim.setTimeout,Oz=hu.globalThisShim.clearTimeout;function Dz(e,n){n.useNativeTimers?(e.setTimeoutFn=Rz.bind(hu.globalThisShim),e.clearTimeoutFn=Oz.bind(hu.globalThisShim)):(e.setTimeoutFn=hu.globalThisShim.setTimeout.bind(hu.globalThisShim),e.clearTimeoutFn=hu.globalThisShim.clearTimeout.bind(hu.globalThisShim))}to.installTimerFunctions=Dz;const Az=1.33;function Mz(e){return typeof e=="string"?Lz(e):Math.ceil((e.byteLength||e.size)*Az)}to.byteLength=Mz;function Lz(e){let n=0,r=0;for(let a=0,s=e.length;a<s;a++)n=e.charCodeAt(a),n<128?r+=1:n<2048?r+=2:n<55296||n>=57344?r+=3:(a++,r+=4);return r}var lx={exports:{}},sx,_3;function Pz(){if(_3)return sx;_3=1;var e=1e3,n=e*60,r=n*60,a=r*24,s=a*7,c=a*365.25;sx=function(S,E){E=E||{};var C=typeof S;if(C==="string"&&S.length>0)return f(S);if(C==="number"&&isFinite(S))return E.long?v(S):h(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function f(S){if(S=String(S),!(S.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(S);if(E){var C=parseFloat(E[1]),x=(E[2]||"ms").toLowerCase();switch(x){case"years":case"year":case"yrs":case"yr":case"y":return C*c;case"weeks":case"week":case"w":return C*s;case"days":case"day":case"d":return C*a;case"hours":case"hour":case"hrs":case"hr":case"h":return C*r;case"minutes":case"minute":case"mins":case"min":case"m":return C*n;case"seconds":case"second":case"secs":case"sec":case"s":return C*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return C;default:return}}}}function h(S){var E=Math.abs(S);return E>=a?Math.round(S/a)+"d":E>=r?Math.round(S/r)+"h":E>=n?Math.round(S/n)+"m":E>=e?Math.round(S/e)+"s":S+"ms"}function v(S){var E=Math.abs(S);return E>=a?y(S,E,a,"day"):E>=r?y(S,E,r,"hour"):E>=n?y(S,E,n,"minute"):E>=e?y(S,E,e,"second"):S+" ms"}function y(S,E,C,x){var R=E>=C*1.5;return Math.round(S/C)+" "+x+(R?"s":"")}return sx}function Nz(e){r.debug=r,r.default=r,r.coerce=v,r.disable=c,r.enable=s,r.enabled=f,r.humanize=Pz(),r.destroy=y,Object.keys(e).forEach(S=>{r[S]=e[S]}),r.names=[],r.skips=[],r.formatters={};function n(S){let E=0;for(let C=0;C<S.length;C++)E=(E<<5)-E+S.charCodeAt(C),E|=0;return r.colors[Math.abs(E)%r.colors.length]}r.selectColor=n;function r(S){let E,C=null,x,R;function T(...D){if(!T.enabled)return;const M=T,I=Number(new Date),N=I-(E||I);M.diff=N,M.prev=E,M.curr=I,E=I,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let B=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,($,H)=>{if($==="%%")return"%";B++;const Y=r.formatters[H];if(typeof Y=="function"){const ne=D[B];$=Y.call(M,ne),D.splice(B,1),B--}return $}),r.formatArgs.call(M,D),(M.log||r.log).apply(M,D)}return T.namespace=S,T.useColors=r.useColors(),T.color=r.selectColor(S),T.extend=a,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(x!==r.namespaces&&(x=r.namespaces,R=r.enabled(S)),R),set:D=>{C=D}}),typeof r.init=="function"&&r.init(T),T}function a(S,E){const C=r(this.namespace+(typeof E>"u"?":":E)+S);return C.log=this.log,C}function s(S){r.save(S),r.namespaces=S,r.names=[],r.skips=[];let E;const C=(typeof S=="string"?S:"").split(/[\s,]+/),x=C.length;for(E=0;E<x;E++)C[E]&&(S=C[E].replace(/\*/g,".*?"),S[0]==="-"?r.skips.push(new RegExp("^"+S.slice(1)+"$")):r.names.push(new RegExp("^"+S+"$")))}function c(){const S=[...r.names.map(h),...r.skips.map(h).map(E=>"-"+E)].join(",");return r.enable(""),S}function f(S){if(S[S.length-1]==="*")return!0;let E,C;for(E=0,C=r.skips.length;E<C;E++)if(r.skips[E].test(S))return!1;for(E=0,C=r.names.length;E<C;E++)if(r.names[E].test(S))return!0;return!1}function h(S){return S.toString().substring(2,S.toString().length-2).replace(/\.\*\?$/,"*")}function v(S){return S instanceof Error?S.stack||S.message:S}function y(){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 r.enable(r.load()),r}var Fz=Nz;(function(e,n){n.formatArgs=a,n.save=s,n.load=c,n.useColors=r,n.storage=f(),n.destroy=(()=>{let v=!1;return()=>{v||(v=!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`."))}})(),n.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 r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(v){if(v[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+v[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const y="color: "+this.color;v.splice(1,0,y,"color: inherit");let S=0,E=0;v[0].replace(/%[a-zA-Z%]/g,C=>{C!=="%%"&&(S++,C==="%c"&&(E=S))}),v.splice(E,0,y)}n.log=console.debug||console.log||(()=>{});function s(v){try{v?n.storage.setItem("debug",v):n.storage.removeItem("debug")}catch{}}function c(){let v;try{v=n.storage.getItem("debug")}catch{}return!v&&typeof process<"u"&&"env"in process&&(v=process.env.DEBUG),v}function f(){try{return localStorage}catch{}}e.exports=Fz(n);const{formatters:h}=e.exports;h.j=function(v){try{return JSON.stringify(v)}catch(y){return"[UnexpectedJSONParseError]: "+y.message}}})(lx,lx.exports);var sl=lx.exports,jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.decode=jc.encode=void 0;function Iz(e){let n="";for(let r in e)e.hasOwnProperty(r)&&(n.length&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return n}jc.encode=Iz;function zz(e){let n={},r=e.split("&");for(let a=0,s=r.length;a<s;a++){let c=r[a].split("=");n[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return n}jc.decode=zz;var jz=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.Transport=void 0;const $z=Sd,Uz=Cd,Bz=to,Vz=jz(sl),Hz=jc,qz=(0,Vz.default)("engine.io-client:transport");class Wz extends Error{constructor(n,r,a){super(n),this.description=r,this.context=a,this.type="TransportError"}}class Yz extends Uz.Emitter{constructor(n){super(),this.writable=!1,(0,Bz.installTimerFunctions)(this,n),this.opts=n,this.query=n.query,this.socket=n.socket}onError(n,r,a){return super.emitReserved("error",new Wz(n,r,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"?this.write(n):qz("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const r=(0,$z.decodePacket)(n,this.socket.binaryType);this.onPacket(r)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,r={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const r=(0,Hz.encode)(n);return r.length?"?"+r:""}}Ic.Transport=Yz;var ns={};Object.defineProperty(ns,"__esModule",{value:!0}),ns.yeast=ns.decode=ns.encode=void 0;const T3="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Kg=64,R3={};let O3=0,mu=0,D3;function ux(e){let n="";do n=T3[e%Kg]+n,e=Math.floor(e/Kg);while(e>0);return n}ns.encode=ux;function Zz(e){let n=0;for(mu=0;mu<e.length;mu++)n=n*Kg+R3[e.charAt(mu)];return n}ns.decode=Zz;function Kz(){const e=ux(+new Date);return e!==D3?(O3=0,D3=e):e+"."+ux(O3++)}for(ns.yeast=Kz;mu<Kg;mu++)R3[T3[mu]]=mu;var kd={},Gg={};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.hasCORS=void 0;let A3=!1;try{A3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Gg.hasCORS=A3,Object.defineProperty(kd,"__esModule",{value:!0}),kd.createCookieJar=kd.XHR=void 0;const Gz=Gg,Qz=zc;function Xz(e){const n=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||Gz.hasCORS))return new XMLHttpRequest}catch{}if(!n)try{return new Qz.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}kd.XHR=Xz;function Jz(){}kd.createCookieJar=Jz;var ej=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bd,"__esModule",{value:!0}),bd.Request=bd.Polling=void 0;const tj=Ic,nj=ej(sl),rj=ns,M3=Sd,cx=kd,ij=Cd,L3=to,aj=zc,sa=(0,nj.default)("engine.io-client:polling");function oj(){}const lj=function(){return new cx.XHR({xdomain:!1}).responseType!=null}();class sj extends tj.Transport{constructor(n){if(super(n),this.polling=!1,typeof location<"u"){const a=location.protocol==="https:";let s=location.port;s||(s=a?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||s!==n.port}const r=n&&n.forceBase64;this.supportsBinary=lj&&!r,this.opts.withCredentials&&(this.cookieJar=(0,cx.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(n){this.readyState="pausing";const r=()=>{sa("paused"),this.readyState="paused",n()};if(this.polling||!this.writable){let a=0;this.polling&&(sa("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){sa("pre-pause polling complete"),--a||r()})),this.writable||(sa("we are currently writing - waiting to pause"),a++,this.once("drain",function(){sa("pre-pause writing complete"),--a||r()}))}else r()}poll(){sa("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){sa("polling got data %s",n);const r=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};(0,M3.decodePayload)(n,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():sa('ignoring poll - transport state "%s"',this.readyState))}doClose(){const n=()=>{sa("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(sa("transport open - closing"),n()):(sa("transport not open - deferring close"),this.once("open",n))}write(n){this.writable=!1,(0,M3.encodePayload)(n,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=(0,rj.yeast)()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(n,r)}request(n={}){return Object.assign(n,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Co(this.uri(),n)}doWrite(n,r){const a=this.request({method:"POST",data:n});a.on("success",r),a.on("error",(s,c)=>{this.onError("xhr post error",s,c)})}doPoll(){sa("xhr poll");const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(r,a)=>{this.onError("xhr poll error",r,a)}),this.pollXhr=n}}bd.Polling=sj;class Co extends ij.Emitter{constructor(n,r){super(),(0,L3.installTimerFunctions)(this,r),this.opts=r,this.method=r.method||"GET",this.uri=n,this.data=r.data!==void 0?r.data:null,this.create()}create(){var n;const r=(0,L3.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.opts.xd;const a=this.xhr=new cx.XHR(r);try{sa("xhr open %s: %s",this.method,this.uri),a.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(n=this.opts.cookieJar)===null||n===void 0||n.addCookies(a),"withCredentials"in a&&(a.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(a.timeout=this.opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(a)),a.readyState===4&&(a.status===200||a.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof a.status=="number"?a.status:0)},0))},sa("xhr data %s",this.data),a.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=Co.requestsCount++,Co.requests[this.index]=this)}onError(n){this.emitReserved("error",n,this.xhr),this.cleanup(!0)}cleanup(n){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=oj,n)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Co.requests[this.index],this.xhr=null}}onLoad(){const n=this.xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(bd.Request=Co,Co.requestsCount=0,Co.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",P3);else if(typeof addEventListener=="function"){const e="onpagehide"in aj.globalThisShim?"pagehide":"unload";addEventListener(e,P3,!1)}}function P3(){for(let e in Co.requests)Co.requests.hasOwnProperty(e)&&Co.requests[e].abort()}var Qg={},Na={};Object.defineProperty(Na,"__esModule",{value:!0}),Na.defaultBinaryType=Na.usingBrowserWebSocket=Na.WebSocket=Na.nextTick=void 0;const N3=zc;Na.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0))(),Na.WebSocket=N3.globalThisShim.WebSocket||N3.globalThisShim.MozWebSocket,Na.usingBrowserWebSocket=!0,Na.defaultBinaryType="arraybuffer";var uj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.WS=void 0;const cj=Ic,fj=ns,dj=to,vu=Na,pj=uj(sl),hj=Sd,mj=(0,pj.default)("engine.io-client:websocket"),F3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vj extends cj.Transport{constructor(n){super(n),this.supportsBinary=!n.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const n=this.uri(),r=this.opts.protocols,a=F3?{}:(0,dj.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=vu.usingBrowserWebSocket&&!F3?r?new vu.WebSocket(n,r):new vu.WebSocket(n):new vu.WebSocket(n,r,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const a=n[r],s=r===n.length-1;(0,hj.encodePacket)(a,this.supportsBinary,c=>{const f={};vu.usingBrowserWebSocket||(a.options&&(f.compress=a.options.compress),this.opts.perMessageDeflate&&(typeof c=="string"?Buffer.byteLength(c):c.length)<this.opts.perMessageDeflate.threshold&&(f.compress=!1));try{vu.usingBrowserWebSocket?this.ws.send(c):this.ws.send(c,f)}catch{mj("websocket closed before onclose event")}s&&(0,vu.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=(0,fj.yeast)()),this.supportsBinary||(r.b64=1),this.createUri(n,r)}check(){return!!vu.WebSocket}}Qg.WS=vj;var Xg={},gj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.WT=void 0;const yj=Ic,bj=Na,I3=Sd,dm=(0,gj(sl).default)("engine.io-client:webtransport");class Sj extends yj.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{dm("transport closed gracefully"),this.onClose()}).catch(n=>{dm("transport closed due to %s",n),this.onError("webtransport error",n)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(n=>{const r=(0,I3.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=n.readable.pipeThrough(r).getReader(),s=(0,I3.createPacketEncoderStream)();s.readable.pipeTo(n.writable),this.writer=s.writable.getWriter();const c=()=>{a.read().then(({done:h,value:v})=>{if(h){dm("session is closed");return}dm("received chunk: %o",v),this.onPacket(v),c()}).catch(h=>{dm("an error occurred while reading: %s",h)})};c();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this.writer.write(f).then(()=>this.onOpen())})}))}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const a=n[r],s=r===n.length-1;this.writer.write(a).then(()=>{s&&(0,bj.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this.transport)===null||n===void 0||n.close()}}Xg.WT=Sj,Object.defineProperty(cm,"__esModule",{value:!0}),cm.transports=void 0;const Ej=bd,xj=Qg,wj=Xg;cm.transports={websocket:xj.WS,webtransport:wj.WT,polling:Ej.Polling};var pm={};Object.defineProperty(pm,"__esModule",{value:!0}),pm.parse=void 0;const Cj=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _j(e){const n=e,r=e.indexOf("["),a=e.indexOf("]");r!=-1&&a!=-1&&(e=e.substring(0,r)+e.substring(r,a).replace(/:/g,";")+e.substring(a,e.length));let s=Cj.exec(e||""),c={},f=14;for(;f--;)c[kj[f]]=s[f]||"";return r!=-1&&a!=-1&&(c.source=n,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Tj(c,c.path),c.queryKey=Rj(c,c.query),c}pm.parse=_j;function Tj(e,n){const r=/\/{2,9}/g,a=n.replace(r,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&a.splice(0,1),n.slice(-1)=="/"&&a.splice(a.length-1,1),a}function Rj(e,n){const r={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,c){s&&(r[s]=c)}),r}var Oj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Socket=void 0;const Dj=cm,z3=to,Aj=jc,j3=pm,Mj=Oj(sl),Lj=Cd,$3=Sd,Pj=Na,ir=(0,Mj.default)("engine.io-client:socket");let U3=class kh extends Lj.Emitter{constructor(n,r={}){super(),this.binaryType=Pj.defaultBinaryType,this.writeBuffer=[],n&&typeof n=="object"&&(r=n,n=null),n?(n=(0,j3.parse)(n),r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)):r.host&&(r.hostname=(0,j3.parse)(r.host).host),(0,z3.installTimerFunctions)(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,Aj.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(n){ir('creating transport "%s"',n);const r=Object.assign({},this.opts.query);r.EIO=$3.protocol,r.transport=n,this.id&&(r.sid=this.id);const a=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return ir("options: %j",a),new Dj.transports[n](a)}open(){let n;if(this.opts.rememberUpgrade&&kh.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)n="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else n=this.transports[0];this.readyState="opening";try{n=this.createTransport(n)}catch(r){ir("error while creating transport: %s",r),this.transports.shift(),this.open();return}n.open(),this.setTransport(n)}setTransport(n){ir("setting transport %s",n.name),this.transport&&(ir("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=n,n.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",r=>this.onClose("transport close",r))}probe(n){ir('probing transport "%s"',n);let r=this.createTransport(n),a=!1;kh.priorWebsocketSuccess=!1;const s=()=>{a||(ir('probe transport "%s" opened',n),r.send([{type:"ping",data:"probe"}]),r.once("packet",E=>{if(!a)if(E.type==="pong"&&E.data==="probe"){if(ir('probe transport "%s" pong',n),this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;kh.priorWebsocketSuccess=r.name==="websocket",ir('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{a||this.readyState!=="closed"&&(ir("changing transport and sending upgrade packet"),S(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{ir('probe transport "%s" failed',n);const C=new Error("probe error");C.transport=r.name,this.emitReserved("upgradeError",C)}}))};function c(){a||(a=!0,S(),r.close(),r=null)}const f=E=>{const C=new Error("probe error: "+E);C.transport=r.name,c(),ir('probe transport "%s" failed because of error: %s',n,E),this.emitReserved("upgradeError",C)};function h(){f("transport closed")}function v(){f("socket closed")}function y(E){r&&E.name!==r.name&&(ir('"%s" works - aborting "%s"',E.name,r.name),c())}const S=()=>{r.removeListener("open",s),r.removeListener("error",f),r.removeListener("close",h),this.off("close",v),this.off("upgrading",y)};r.once("open",s),r.once("error",f),r.once("close",h),this.once("close",v),this.once("upgrading",y),this.upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{a||r.open()},200):r.open()}onOpen(){if(ir("socket open"),this.readyState="open",kh.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){ir("starting upgrade probes");let n=0;const r=this.upgrades.length;for(;n<r;n++)this.probe(this.upgrades[n])}}onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(ir('socket receive: type "%s", data "%s"',n.type,n.data),this.emitReserved("packet",n),this.emitReserved("heartbeat"),this.resetPingTimeout(),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const r=new Error("server error");r.code=n.data,this.onError(r);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}else ir('packet received with socket readyState "%s"',this.readyState)}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this.upgrades=this.filterUpgrades(n.upgrades),this.pingInterval=n.pingInterval,this.pingTimeout=n.pingTimeout,this.maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this.getWritablePackets();ir("flushing %d packets in socket",n.length),this.transport.send(n),this.prevBufferLen=n.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(r+=(0,z3.byteLength)(s)),a>0&&r>this.maxPayload)return ir("only send %d out of %d packets",a,this.writeBuffer.length),this.writeBuffer.slice(0,a);r+=2}return ir("payload size is %d (max: %d)",r,this.maxPayload),this.writeBuffer}write(n,r,a){return this.sendPacket("message",n,r,a),this}send(n,r,a){return this.sendPacket("message",n,r,a),this}sendPacket(n,r,a,s){if(typeof r=="function"&&(s=r,r=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const c={type:n,data:r,options:a};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),s&&this.once("flush",s),this.flush()}close(){const n=()=>{this.onClose("forced close"),ir("socket closing - telling transport to close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),n()},a=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():n()}):this.upgrading?a():n()),this}onError(n){ir("socket error %j",n),kh.priorWebsocketSuccess=!1,this.emitReserved("error",n),this.onClose("transport error",n)}onClose(n,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(ir('socket close with reason: "%s"',n),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",n,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(n){const r=[];let a=0;const s=n.length;for(;a<s;a++)~this.transports.indexOf(n[a])&&r.push(n[a]);return r}};Wg.Socket=U3,U3.protocol=$3.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const n=Wg;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return n.Socket}}),e.protocol=n.Socket.protocol;var r=Ic;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return r.Transport}});var a=cm;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return a.transports}});var s=to;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var c=pm;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return c.parse}});var f=Na;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return f.nextTick}})}(ax);var Nj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qg,"__esModule",{value:!0}),qg.url=void 0;const Fj=ax,B3=Nj(sl).default("socket.io-client:url");function Ij(e,n="",r){let a=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(B3("protocol-less url %s",e),typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),B3("parse %s",e),a=Fj.parse(e)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const c=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+c+":"+a.port+n,a.href=a.protocol+"://"+c+(r&&r.port===a.port?"":":"+a.port),a}qg.url=Ij;var Jg={},hm={},ey={},_d={},$c={};Object.defineProperty($c,"__esModule",{value:!0}),$c.hasBinary=$c.isBinary=void 0;const zj=typeof ArrayBuffer=="function",jj=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,V3=Object.prototype.toString,$j=typeof Blob=="function"||typeof Blob<"u"&&V3.call(Blob)==="[object BlobConstructor]",Uj=typeof File=="function"||typeof File<"u"&&V3.call(File)==="[object FileConstructor]";function H3(e){return zj&&(e instanceof ArrayBuffer||jj(e))||$j&&e instanceof Blob||Uj&&e instanceof File}$c.isBinary=H3;function ty(e,n){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,a=e.length;r<a;r++)if(ty(e[r]))return!0;return!1}if(H3(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ty(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&ty(e[r]))return!0;return!1}$c.hasBinary=ty,Object.defineProperty(_d,"__esModule",{value:!0}),_d.reconstructPacket=_d.deconstructPacket=void 0;const Bj=$c;function Vj(e){const n=[],r=e.data,a=e;return a.data=fx(r,n),a.attachments=n.length,{packet:a,buffers:n}}_d.deconstructPacket=Vj;function fx(e,n){if(!e)return e;if((0,Bj.isBinary)(e)){const r={_placeholder:!0,num:n.length};return n.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let a=0;a<e.length;a++)r[a]=fx(e[a],n);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=fx(e[a],n));return r}return e}function Hj(e,n){return e.data=dx(e.data,n),delete e.attachments,e}_d.reconstructPacket=Hj;function dx(e,n){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<n.length)return n[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=dx(e[r],n);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=dx(e[r],n));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const n=Cd,r=_d,a=$c,c=(0,sl.default)("socket.io-parser"),f=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var h;(function(C){C[C.CONNECT=0]="CONNECT",C[C.DISCONNECT=1]="DISCONNECT",C[C.EVENT=2]="EVENT",C[C.ACK=3]="ACK",C[C.CONNECT_ERROR=4]="CONNECT_ERROR",C[C.BINARY_EVENT=5]="BINARY_EVENT",C[C.BINARY_ACK=6]="BINARY_ACK"})(h=e.PacketType||(e.PacketType={}));class v{constructor(x){this.replacer=x}encode(x){return c("encoding packet %j",x),(x.type===h.EVENT||x.type===h.ACK)&&(0,a.hasBinary)(x)?this.encodeAsBinary({type:x.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:x.nsp,data:x.data,id:x.id}):[this.encodeAsString(x)]}encodeAsString(x){let R=""+x.type;return(x.type===h.BINARY_EVENT||x.type===h.BINARY_ACK)&&(R+=x.attachments+"-"),x.nsp&&x.nsp!=="/"&&(R+=x.nsp+","),x.id!=null&&(R+=x.id),x.data!=null&&(R+=JSON.stringify(x.data,this.replacer)),c("encoded %j as %s",x,R),R}encodeAsBinary(x){const R=(0,r.deconstructPacket)(x),T=this.encodeAsString(R.packet),D=R.buffers;return D.unshift(T),D}}e.Encoder=v;function y(C){return Object.prototype.toString.call(C)==="[object Object]"}class S extends n.Emitter{constructor(x){super(),this.reviver=x}add(x){let R;if(typeof x=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");R=this.decodeString(x);const T=R.type===h.BINARY_EVENT;T||R.type===h.BINARY_ACK?(R.type=T?h.EVENT:h.ACK,this.reconstructor=new E(R),R.attachments===0&&super.emitReserved("decoded",R)):super.emitReserved("decoded",R)}else if((0,a.isBinary)(x)||x.base64)if(this.reconstructor)R=this.reconstructor.takeBinaryData(x),R&&(this.reconstructor=null,super.emitReserved("decoded",R));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+x)}decodeString(x){let R=0;const T={type:Number(x.charAt(0))};if(h[T.type]===void 0)throw new Error("unknown packet type "+T.type);if(T.type===h.BINARY_EVENT||T.type===h.BINARY_ACK){const M=R+1;for(;x.charAt(++R)!=="-"&&R!=x.length;);const I=x.substring(M,R);if(I!=Number(I)||x.charAt(R)!=="-")throw new Error("Illegal attachments");T.attachments=Number(I)}if(x.charAt(R+1)==="/"){const M=R+1;for(;++R&&!(x.charAt(R)===","||R===x.length););T.nsp=x.substring(M,R)}else T.nsp="/";const D=x.charAt(R+1);if(D!==""&&Number(D)==D){const M=R+1;for(;++R;){const I=x.charAt(R);if(I==null||Number(I)!=I){--R;break}if(R===x.length)break}T.id=Number(x.substring(M,R+1))}if(x.charAt(++R)){const M=this.tryParse(x.substr(R));if(S.isPayloadValid(T.type,M))T.data=M;else throw new Error("invalid payload")}return c("decoded %s as %j",x,T),T}tryParse(x){try{return JSON.parse(x,this.reviver)}catch{return!1}}static isPayloadValid(x,R){switch(x){case h.CONNECT:return y(R);case h.DISCONNECT:return R===void 0;case h.CONNECT_ERROR:return typeof R=="string"||y(R);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(R)&&(typeof R[0]=="number"||typeof R[0]=="string"&&f.indexOf(R[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(R)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=S;class E{constructor(x){this.packet=x,this.buffers=[],this.reconPack=x}takeBinaryData(x){if(this.buffers.push(x),this.buffers.length===this.reconPack.attachments){const R=(0,r.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),R}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(ey);var mm={};Object.defineProperty(mm,"__esModule",{value:!0}),mm.on=void 0;function qj(e,n,r){return e.on(n,r),function(){e.off(n,r)}}mm.on=qj;var Wj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hm,"__esModule",{value:!0}),hm.Socket=void 0;const ko=ey,ny=mm,Yj=Cd,$r=Wj(sl).default("socket.io-client:socket"),Zj=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Kj extends Yj.Emitter{constructor(n,r,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=r,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[ny.on(n,"open",this.onopen.bind(this)),ny.on(n,"packet",this.onpacket.bind(this)),ny.on(n,"error",this.onerror.bind(this)),ny.on(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...r){if(Zj.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(r.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:ko.PacketType.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const f=this.ids++;$r("emitting packet with ack id %d",f);const h=r.pop();this._registerAckCallback(f,h),a.id=f}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)?$r("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a),this.flags={},this}_registerAckCallback(n,r){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[n]=r;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===n&&($r("removing packet with ack id %d from the buffer",n),this.sendBuffer.splice(f,1));$r("event with ack id %d has timed out after %d ms",n,s),r.call(this,new Error("operation has timed out"))},s);this.acks[n]=(...f)=>{this.io.clearTimeoutFn(c),r.apply(this,[null,...f])}}emitWithAck(n,...r){const a=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,c)=>{r.push((f,h)=>a?f?c(f):s(h):s(f)),this.emit(n,...r)})}_addToQueue(n){let r;typeof n[n.length-1]=="function"&&(r=n.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((s,...c)=>a!==this._queue[0]?void 0:(s!==null?a.tryCount>this._opts.retries&&($r("packet [%d] is discarded after %d tries",a.id,a.tryCount),this._queue.shift(),r&&r(s)):($r("packet [%d] was successfully sent",a.id),this._queue.shift(),r&&r(null,...c)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(n=!1){if($r("draining queue"),!this.connected||this._queue.length===0)return;const r=this._queue[0];if(r.pending&&!n){$r("packet [%d] has already been sent and is waiting for an ack",r.id);return}r.pending=!0,r.tryCount++,$r("sending packet [%d] (try n°%d)",r.id,r.tryCount),this.flags=r.flags,this.emit.apply(this,r.args)}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){$r("transport is open - connecting"),typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:ko.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,r){$r("close (%s)",n),this.connected=!1,delete this.id,this.emitReserved("disconnect",n,r)}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case ko.PacketType.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ko.PacketType.EVENT:case ko.PacketType.BINARY_EVENT:this.onevent(n);break;case ko.PacketType.ACK:case ko.PacketType.BINARY_ACK:this.onack(n);break;case ko.PacketType.DISCONNECT:this.ondisconnect();break;case ko.PacketType.CONNECT_ERROR:this.destroy();const a=new Error(n.data.message);a.data=n.data.data,this.emitReserved("connect_error",a);break}}onevent(n){const r=n.data||[];$r("emitting event %j",r),n.id!=null&&($r("attaching ack callback to event"),r.push(this.ack(n.id))),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const a of r)a.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const r=this;let a=!1;return function(...s){a||(a=!0,$r("sending ack %j",s),r.packet({type:ko.PacketType.ACK,id:n,data:s}))}}onack(n){const r=this.acks[n.id];typeof r=="function"?($r("calling ack %s with %j",n.id,n.data),r.apply(this,n.data),delete this.acks[n.id]):$r("bad ack %s",n.id)}onconnect(n,r){$r("socket connected with id %s",n),this.id=n,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){$r("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&($r("performing disconnect (%s)",this.nsp),this.packet({type:ko.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}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){const r=this._anyListeners;for(let a=0;a<r.length;a++)if(n===r[a])return r.splice(a,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){const r=this._anyOutgoingListeners;for(let a=0;a<r.length;a++)if(n===r[a])return r.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const a of r)a.apply(this,n.data)}}}hm.Socket=Kj;var ry={};Object.defineProperty(ry,"__esModule",{value:!0}),ry.Backoff=void 0;function Td(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ry.Backoff=Td,Td.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*e);e=Math.floor(n*10)&1?e+r:e-r}return Math.min(e,this.max)|0},Td.prototype.reset=function(){this.attempts=0},Td.prototype.setMin=function(e){this.ms=e},Td.prototype.setMax=function(e){this.max=e},Td.prototype.setJitter=function(e){this.jitter=e};var Gj=Ht&&Ht.__createBinding||(Object.create?function(e,n,r,a){a===void 0&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,a){a===void 0&&(a=r),e[a]=n[r]}),Qj=Ht&&Ht.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Xj=Ht&&Ht.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Gj(n,e,r);return Qj(n,e),n},Jj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.Manager=void 0;const px=ax,e$=hm,t$=Xj(ey),Uc=mm,n$=ry,r$=Cd,ui=Jj(sl).default("socket.io-client:manager");class i$ extends r$.Emitter{constructor(n,r){var a;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(r=n,n=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,px.installTimerFunctions(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((a=r.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new n$.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=n;const s=r.parser||t$;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var r;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(r=this.backoff)===null||r===void 0||r.setMin(n),this)}randomizationFactor(n){var r;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(r=this.backoff)===null||r===void 0||r.setJitter(n),this)}reconnectionDelayMax(n){var r;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(r=this.backoff)===null||r===void 0||r.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(ui("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;ui("opening %s",this.uri),this.engine=new px.Socket(this.uri,this.opts);const r=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=Uc.on(r,"open",function(){a.onopen(),n&&n()}),c=h=>{ui("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",h),n?n(h):this.maybeReconnectOnOpen()},f=Uc.on(r,"error",c);if(this._timeout!==!1){const h=this._timeout;ui("connect attempt will timeout after %d",h);const v=this.setTimeoutFn(()=>{ui("connect attempt timed out after %d",h),s(),c(new Error("timeout")),r.close()},h);this.opts.autoUnref&&v.unref(),this.subs.push(()=>{this.clearTimeoutFn(v)})}return this.subs.push(s),this.subs.push(f),this}connect(n){return this.open(n)}onopen(){ui("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Uc.on(n,"ping",this.onping.bind(this)),Uc.on(n,"data",this.ondata.bind(this)),Uc.on(n,"error",this.onerror.bind(this)),Uc.on(n,"close",this.onclose.bind(this)),Uc.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(r){this.onclose("parse error",r)}}ondecoded(n){px.nextTick(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){ui("error",n),this.emitReserved("error",n)}socket(n,r){let a=this.nsps[n];return a?this._autoConnect&&!a.active&&a.connect():(a=new e$.Socket(this,n,r),this.nsps[n]=a),a}_destroy(n){const r=Object.keys(this.nsps);for(const a of r)if(this.nsps[a].active){ui("socket %s is still active, skipping close",a);return}this._close()}_packet(n){ui("writing packet %j",n);const r=this.encoder.encode(n);for(let a=0;a<r.length;a++)this.engine.write(r[a],n.options)}cleanup(){ui("cleanup"),this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){ui("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(n,r){ui("closed due to %s",n),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)ui("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();ui("will wait %dms before reconnect attempt",r),this._reconnecting=!0;const a=this.setTimeoutFn(()=>{n.skipReconnect||(ui("attempting reconnect"),this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(s=>{s?(ui("reconnect attempt error"),n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",s)):(ui("reconnect success"),n.onreconnect())}))},r);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}Jg.Manager=i$,function(e,n){var r=Ht&&Ht.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.connect=n.io=n.Socket=n.Manager=n.protocol=void 0;const a=qg,s=Jg;Object.defineProperty(n,"Manager",{enumerable:!0,get:function(){return s.Manager}});const c=hm;Object.defineProperty(n,"Socket",{enumerable:!0,get:function(){return c.Socket}});const h=r(sl).default("socket.io-client"),v={};function y(E,C){typeof E=="object"&&(C=E,E=void 0),C=C||{};const x=a.url(E,C.path||"/socket.io"),R=x.source,T=x.id,D=x.path,M=v[T]&&D in v[T].nsps,I=C.forceNew||C["force new connection"]||C.multiplex===!1||M;let N;return I?(h("ignoring socket cache for %s",R),N=new s.Manager(R,C)):(v[T]||(h("new io instance for %s",R),v[T]=new s.Manager(R,C)),N=v[T]),x.query&&!C.query&&(C.query=x.queryKey),N.socket(x.path,C)}n.io=y,n.connect=y,n.default=y,Object.assign(y,{Manager:s.Manager,Socket:c.Socket,io:y,connect:y});var S=ey;Object.defineProperty(n,"protocol",{enumerable:!0,get:function(){return S.protocol}}),e.exports=y}(ix,ix.exports);var a$=ix.exports;(function(e){var n=Ht&&Ht.__awaiter||function(v,y,S,E){function C(x){return x instanceof S?x:new S(function(R){R(x)})}return new(S||(S=Promise))(function(x,R){function T(I){try{M(E.next(I))}catch(N){R(N)}}function D(I){try{M(E.throw(I))}catch(N){R(N)}}function M(I){I.done?x(I.value):C(I.value).then(T,D)}M((E=E.apply(v,y||[])).next())})},r=Ht&&Ht.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const a=rx,s=r(a$);class c{constructor(y){this.url=y,this.pending={},this.emitter=new h,this.events=this.emitter}connect(y){return n(this,void 0,void 0,function*(){return new Promise((S,E)=>{this.disconnect(),this.socket=(0,s.default)(this.url,{transports:["websocket"],auth:y,autoConnect:!1});const C=setTimeout(()=>{E("connection timed out")},5e3);this.socket.on("login",x=>n(this,void 0,void 0,function*(){clearTimeout(C),S(x)})),this.socket.on("connect_error",x=>{var R;(R=this.socket)===null||R===void 0||R.close(),clearTimeout(C),E(x.message)}),this.socket.on("message",x=>n(this,void 0,void 0,function*(){var R;this.pending[x.request]&&(!((R=x.data)===null||R===void 0)&&R.error?this.pending[x.request].reject(new Error(x.data.message)):this.pending[x.request].resolve(x.data),delete this.pending[x.request]),yield this.emitter.emit(f.Message,x)})),this.socket.connect()})})}disconnect(){var y;this.socket&&!(!((y=this.socket)===null||y===void 0)&&y.disconnected)&&this.socket.disconnect()}request(y,S){var E;return n(this,void 0,void 0,function*(){if(!(!((E=this.socket)===null||E===void 0)&&E.connected))throw new Error("Client is disconnected");const C=this.random(32),x=new Promise((R,T)=>{this.pending[C]={resolve:R,reject:T}});return this.socket.send({request:C,type:y,data:S}),x})}random(y){const S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let E="";for(let C=0;C<y;C++)E+=S.charAt(Math.floor(Math.random()*S.length));return E}}e.SocketCom=c;var f;(function(v){v.Message="message"})(f=e.SocketComEvents||(e.SocketComEvents={}));class h extends a.Emitter{}e.SocketComEmitter=h})(g3);var iy={},o$=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(iy,"__esModule",{value:!0}),iy.SocketEmitter=void 0;class l${constructor(){this.listeners={}}on(n,r){const a=this.listeners[n];a?a.push(r):this.listeners[n]=[r]}removeListeners(n){this.listeners[n]=[]}emit(n,r){return o$(this,void 0,void 0,function*(){const a=this.listeners[n];if(a!=null&&a.length){for(const s of a)yield s(r);return!0}else return!1})}}iy.SocketEmitter=l$;var ua=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.MessagingSocket=void 0;const q3=g3,s$=iy;class u$ extends s$.SocketEmitter{constructor(n){super(),this.clientId=n.clientId,this.com=new q3.SocketCom(n.url),this.com.events.on(q3.SocketComEvents.Message,r=>ua(this,void 0,void 0,function*(){r.type==="message.new"&&(yield this.emit("message",r.data.message))}))}get creds(){return this._creds}get userId(){var n;return(n=this._creds)===null||n===void 0?void 0:n.userId}get conversationId(){return this._conversationId}connect(n){return ua(this,void 0,void 0,function*(){const r=yield this.com.connect({clientId:this.clientId,creds:n});return r.userId===(n==null?void 0:n.userId)&&!r.userToken&&(r.userToken=n.userToken),this._creds=r,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),r})}disconnect(){return ua(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return ua(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(n){return ua(this,void 0,void 0,function*(){this._conversationId=n,yield this.emit("conversation",this._conversationId)})}createConversation(n){return ua(this,void 0,void 0,function*(){const r=yield this.request("conversations.create",{});return(n==null?void 0:n.switch)!==!1&&(yield this.switchConversation(r.id)),r})}startConversation(n){return ua(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:n||this._conversationId})})}getConversation(n){return ua(this,void 0,void 0,function*(){return this.request("conversations.get",{id:n||this._conversationId})})}deleteConversation(n){return ua(this,void 0,void 0,function*(){const r=yield this.request("conversations.delete",{id:n||this._conversationId});return r&&(yield this.switchConversation(void 0)),r})}listConversations(n){return ua(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:n||20})})}sendText(n){return ua(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:n}})})}sendPayload(n){return ua(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:n})})}listMessages(n){return ua(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:n||20})})}sendFeedback(n,r){return ua(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:n,feedback:r})})}request(n,r){return this.com.request(n,r)}}Hg.MessagingSocket=u$,function(e){var n=Ht&&Ht.__createBinding||(Object.create?function(a,s,c,f){f===void 0&&(f=c),Object.defineProperty(a,f,{enumerable:!0,get:function(){return s[c]}})}:function(a,s,c,f){f===void 0&&(f=c),a[f]=s[c]}),r=Ht&&Ht.__exportStar||function(a,s){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(s,c)&&n(s,a,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(rx,e),r(Hg,e)}(u3);class c${constructor(n){Wl(this,"socket");Wl(this,"clientId");Wl(this,"userId");Wl(this,"conversationId");Wl(this,"userToken");Wl(this,"connected",!1);Wl(this,"emitter");Wl(this,"on");this.socket=new u3.MessagingSocket(n),this.emitter=new Y5,this.clientId=n.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("connect",r=>{this.emitter.emit("connect",r)}),this.socket.on("disconnect",r=>{this.emitter.emit("disconnect",r)}),this.socket.on("message",r=>{this.emitter.emit("message",r)}),this.socket.on("conversation",r=>{this.emitter.emit("conversation",r)}),this.socket.on("user",r=>{this.emitter.emit("user",r)})}async connect(n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(n).catch(a=>{throw this.connected=!1,a});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(n){this.conversationId||await this.newConversation(),await this.socket.sendText(n),this.emitter.emit("messageSent",n)}async switchConversation(n){await this.socket.switchConversation(n),this.conversationId=n}async listConversations(){return this.socket.listConversations()}async newConversation(){const{id:n}=await this.socket.createConversation();this.conversationId=n}listMessages(n){return this.socket.listMessages(n)}}const f$=({styles:e={},renderers:n,client:r,children:a,configuration:s,...c})=>{const[f,h]=j.useState([]),[v,y]=j.useState({disableComposer:!1}),[S,E]=j.useState(s),[C,x]=j.useState(e),R=Dc(B=>B.addMessageToHistory),T=Dc(B=>B.setConversationId),D=Dc(B=>B.user),M=Dc(B=>B.conversationId),I=Dc(B=>B.setUser),N={...c,value:{theme:C,renderers:{...IE,...n},messages:f,eventEmitter:nI,configuration:s,setConfiguration:E,state:v,setState:B=>y({...v,...B}),setTheme:x,client:{...r,sendMessage:async B=>{await r.sendMessage(B),h(F=>[...F,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:B}}}]),r.userId&&R({message:B,userId:r.userId})},on:r.on,restartConversation:async()=>{await r.newConversation(),h([])}}}};return dd(()=>r.on("message",B=>{try{const F=s3.parse(B.payload);h($=>[...$,{direction:"incoming",sender:{name:S.botName??"Bot",avatar:S.botAvatar},timestamp:B.sentOn,block:F}])}catch{console.error("Invalid message payload")}})),dd(()=>r.on("conversation",B=>{T(B)})),P5(async()=>{I(await r.connect(D));const B=(await r.listConversations()).map($=>$.id);M&&B.includes(M)&&await r.switchConversation(M);const F=[];for(const $ of await r.listMessages())try{const H=s3.parse($.payload),Y=$.authorId===r.userId?"outgoing":"incoming";F.push({direction:Y,sender:Y==="outgoing"?{name:"You"}:{name:S.botName??"Bot",avatar:S.botAvatar},timestamp:$.sentOn,block:H})}catch{console.error("Invalid message payload")}return h(F.reverse()),()=>{r.disconnect()}},[]),he.jsx(aT.Provider,{...N,children:typeof a=="function"?a(S):a})},W3=j.forwardRef(({children:e,...n},r)=>{const{theme:{container:a}}=cr();return he.jsxs("div",{...n,...a,ref:r,children:[he.jsx(ML,{}),he.jsx(z5,{children:e})]})});function rs(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function Y3({prop:e,defaultProp:n,onChange:r=()=>{}}){const[a,s]=d$({defaultProp:n,onChange:r}),c=e!==void 0,f=c?e:a,h=Qs(r),v=j.useCallback(y=>{if(c){const E=typeof y=="function"?y(e):y;E!==e&&h(E)}else s(y)},[c,e,s,h]);return[f,v]}function d$({defaultProp:e,onChange:n}){const r=j.useState(e),[a]=r,s=j.useRef(a),c=Qs(n);return j.useEffect(()=>{s.current!==a&&(c(a),s.current=a)},[a,s,c]),r}function p$(e,n){return j.useReducer((r,a)=>{const s=n[r][a];return s??r},e)}const ay=e=>{const{present:n,children:r}=e,a=h$(n),s=typeof r=="function"?r({present:a.isPresent}):j.Children.only(r),c=Ec(a.ref,s.ref);return typeof r=="function"||a.isPresent?j.cloneElement(s,{ref:c}):null};ay.displayName="Presence";function h$(e){const[n,r]=j.useState(),a=j.useRef({}),s=j.useRef(e),c=j.useRef("none"),f=e?"mounted":"unmounted",[h,v]=p$(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const y=oy(a.current);c.current=h==="mounted"?y:"none"},[h]),Rh(()=>{const y=a.current,S=s.current;if(S!==e){const C=c.current,x=oy(y);e?v("MOUNT"):x==="none"||(y==null?void 0:y.display)==="none"?v("UNMOUNT"):v(S&&C!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,v]),Rh(()=>{if(n){const y=E=>{const x=oy(a.current).includes(E.animationName);E.target===n&&x&&P0.flushSync(()=>v("ANIMATION_END"))},S=E=>{E.target===n&&(c.current=oy(a.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else v("ANIMATION_END")},[n,v]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:j.useCallback(y=>{y&&(a.current=getComputedStyle(y)),r(y)},[])}}function oy(e){return(e==null?void 0:e.animationName)||"none"}const m$=Z["useId".toString()]||(()=>{});let v$=0;function ly(e){const[n,r]=Z.useState(m$());return Rh(()=>{e||r(a=>a??String(v$++))},[e]),e||(n?`radix-${n}`:"")}const Z3="Collapsible",[g$,AZ]=mS(Z3),[y$,hx]=g$(Z3),b$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,open:a,defaultOpen:s,disabled:c,onOpenChange:f,...h}=e,[v=!1,y]=Y3({prop:a,defaultProp:s,onChange:f});return j.createElement(y$,{scope:r,disabled:c,contentId:ly(),open:v,onOpenToggle:j.useCallback(()=>y(S=>!S),[y])},j.createElement(Ka.div,Xn({"data-state":mx(v),"data-disabled":c?"":void 0},h,{ref:n})))}),S$="CollapsibleTrigger",E$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,...a}=e,s=hx(S$,r);return j.createElement(Ka.button,Xn({type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":mx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled},a,{ref:n,onClick:rs(e.onClick,s.onOpenToggle)}))}),K3="CollapsibleContent",x$=j.forwardRef((e,n)=>{const{forceMount:r,...a}=e,s=hx(K3,e.__scopeCollapsible);return j.createElement(ay,{present:r||s.open},({present:c})=>j.createElement(w$,Xn({},a,{ref:n,present:c})))}),w$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,present:a,children:s,...c}=e,f=hx(K3,r),[h,v]=j.useState(a),y=j.useRef(null),S=Ec(n,y),E=j.useRef(0),C=E.current,x=j.useRef(0),R=x.current,T=f.open||h,D=j.useRef(T),M=j.useRef();return j.useEffect(()=>{const I=requestAnimationFrame(()=>D.current=!1);return()=>cancelAnimationFrame(I)},[]),Rh(()=>{const I=y.current;if(I){M.current=M.current||{transitionDuration:I.style.transitionDuration,animationName:I.style.animationName},I.style.transitionDuration="0s",I.style.animationName="none";const N=I.getBoundingClientRect();E.current=N.height,x.current=N.width,D.current||(I.style.transitionDuration=M.current.transitionDuration,I.style.animationName=M.current.animationName),v(a)}},[f.open,a]),j.createElement(Ka.div,Xn({"data-state":mx(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!T},c,{ref:S,style:{["--radix-collapsible-content-height"]:C?`${C}px`:void 0,["--radix-collapsible-content-width"]:R?`${R}px`:void 0,...e.style}}),T&&s)});function mx(e){return e?"open":"closed"}const C$=b$,k$=E$,_$=x$,T$=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),R$=j.memo(j.forwardRef((e,n)=>{const{theme:{header:r}}=cr(),[a,s]=j.useState(!1);return he.jsx(C$,{...e,...r==null?void 0:r.container,open:a,onOpenChange:s,ref:n})})),O$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx(k$,{...e,...(a=r==null?void 0:r.content)==null?void 0:a.container,ref:n})}),D$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx(_$,{...e,...(a=r==null?void 0:r.expandedContent)==null?void 0:a.container,ref:n})}),A$=j.forwardRef(({src:e,children:n},r)=>{var f,h,v,y,S,E;const{theme:{header:a},client:{clientId:s}}=cr(),c=Z5(s??"",15);return he.jsxs(N0,{ref:r,"data-color":c,...(h=(f=a==null?void 0:a.content)==null?void 0:f.avatar)==null?void 0:h.container,children:[he.jsx(F0,{...(y=(v=a==null?void 0:a.content)==null?void 0:v.avatar)==null?void 0:y.image,src:e}),he.jsx(I0,{...(E=(S=a==null?void 0:a.content)==null?void 0:S.avatar)==null?void 0:E.fallback,children:n})]})}),M$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx("h2",{...e,...(a=r==null?void 0:r.content)==null?void 0:a.title,ref:n})}),L$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx("p",{...e,...(a=r==null?void 0:r.content)==null?void 0:a.description,ref:n})}),P$=j.forwardRef((e,n)=>{var a,s;const{theme:{header:r}}=cr();return he.jsx("div",{...e,...(s=(a=r==null?void 0:r.content)==null?void 0:a.actions)==null?void 0:s.container,ref:n})}),Fa=Object.assign(R$,{Content:O$,ExpandedContent:D$,Avatar:A$,Description:L$,Title:M$,Actions:P$,DescriptionItem:({icon:e,title:n,link:r,...a})=>{var h,v,y,S,E,C,x,R,T,D,M,I;const{theme:{header:s}}=cr(),c=e??T$,f=N=>{N&&U7(N)};return!r&&!n?null:r?he.jsxs("a",{...a,...(v=(h=s==null?void 0:s.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:v.container,href:r,target:"_blank",rel:"noopener",children:[he.jsx(c,{...(S=(y=s==null?void 0:s.expandedContent)==null?void 0:y.descriptionItems)==null?void 0:S.icon}),he.jsx("p",{...(C=(E=s==null?void 0:s.expandedContent)==null?void 0:E.descriptionItems)==null?void 0:C.link,children:n})]}):he.jsxs("div",{...a,...(R=(x=s==null?void 0:s.expandedContent)==null?void 0:x.descriptionItems)==null?void 0:R.container,onClick:N=>{f(N.currentTarget.textContent)},children:[he.jsx(c,{...(D=(T=s==null?void 0:s.expandedContent)==null?void 0:T.descriptionItems)==null?void 0:D.icon}),he.jsx("p",{...(I=(M=s==null?void 0:s.expandedContent)==null?void 0:M.descriptionItems)==null?void 0:I.text,children:n})]})}}),G3=j.memo(({...e})=>{const{theme:{loadingIndicator:n}}=cr();return he.jsx("div",{...e,...n==null?void 0:n.container,children:he.jsx("div",{...n==null?void 0:n.loader})})}),vx=j.forwardRef(({direction:e,block:n,scroll:r,disableInput:a,children:s,sender:c,...f},h)=>{var T,D,M;const[v,y]=j.useState([]),{theme:{message:S},configuration:{botAvatar:E,botName:C},client:{clientId:x}}=cr();SF(()=>{r()}),j.useEffect(()=>{v.length===0&&r()},[v.length]);const R=Z5(x??"",15);return he.jsx(rT.Provider,{value:{isLoading:v,setIsLoading:y},children:he.jsxs("div",{...f,...S==null?void 0:S.container,"data-loaded":v.length===0,"data-disable-input":!!a,"data-direction":e,ref:h,children:[he.jsxs(N0,{"data-color":R,...(T=S==null?void 0:S.avatar)==null?void 0:T.container,children:[he.jsx(F0,{...(D=S==null?void 0:S.avatar)==null?void 0:D.image,src:(c==null?void 0:c.avatar)??E}),he.jsx(I0,{...(M=S==null?void 0:S.avatar)==null?void 0:M.fallback,children:(c==null?void 0:c.name[0])??(C==null?void 0:C[0])})]}),n&&he.jsx(fd,{block:n,styles:S==null?void 0:S.blocks}),s]})})}),Q3=1e4,X3=j.memo(({...e})=>{const{theme:{messageList:n}}=cr(),{messages:r,setState:a,client:s}=cr(),[c,f]=j.useState(!0),h=j.useRef(null),{y:v}=_F(h),[y,S]=j.useState(!1),[E,C]=RF(),x=()=>{if(!h.current)return;const{scrollHeight:R}=h.current;c&&h.current.scrollTo({top:R})};return j.useEffect(()=>{const R=new Date(Date.now()-Q3+2e3);r.length>0&&r[r.length-1].timestamp<R&&S(!1)},[E]),dd(()=>s.on("messageSent",()=>{S(!0),C(new Date(Date.now()+Q3))})),dd(()=>s.on("message",()=>{S(!1)})),j.useEffect(()=>{const R=r[r.length-1];a({disableComposer:!!(R!=null&&R.disableInput)})},[r.length]),j.useEffect(()=>{if(!h.current)return;const{offsetHeight:R,scrollHeight:T,scrollTop:D}=h.current;f(T<=D+R+100)},[v]),he.jsxs("ul",{...e,...n,ref:h,children:[r.map((R,T)=>he.jsx(vx,{scroll:x,...R},T)),y&&he.jsx(vx,{scroll:x,direction:"incoming",children:he.jsx(G3,{})})]})});function N$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e);j.useEffect(()=>{const a=s=>{s.key==="Escape"&&r(s)};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[r,n])}const gx="dismissableLayer.update",F$="dismissableLayer.pointerDownOutside",I$="dismissableLayer.focusOutside";let J3;const z$=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j$=j.forwardRef((e,n)=>{var r;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:v,...y}=e,S=j.useContext(z$),[E,C]=j.useState(null),x=(r=E==null?void 0:E.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,R]=j.useState({}),T=Ec(n,Y=>C(Y)),D=Array.from(S.layers),[M]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),I=D.indexOf(M),N=E?D.indexOf(E):-1,B=S.layersWithOutsidePointerEventsDisabled.size>0,F=N>=I,$=$$(Y=>{const ne=Y.target,ve=[...S.branches].some(ee=>ee.contains(ne));!F||ve||(c==null||c(Y),h==null||h(Y),Y.defaultPrevented||v==null||v())},x),H=U$(Y=>{const ne=Y.target;[...S.branches].some(ee=>ee.contains(ne))||(f==null||f(Y),h==null||h(Y),Y.defaultPrevented||v==null||v())},x);return N$(Y=>{N===S.layers.size-1&&(s==null||s(Y),!Y.defaultPrevented&&v&&(Y.preventDefault(),v()))},x),j.useEffect(()=>{if(E)return a&&(S.layersWithOutsidePointerEventsDisabled.size===0&&(J3=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(E)),S.layers.add(E),eR(),()=>{a&&S.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=J3)}},[E,x,a,S]),j.useEffect(()=>()=>{E&&(S.layers.delete(E),S.layersWithOutsidePointerEventsDisabled.delete(E),eR())},[E,S]),j.useEffect(()=>{const Y=()=>R({});return document.addEventListener(gx,Y),()=>document.removeEventListener(gx,Y)},[]),j.createElement(Ka.div,Xn({},y,{ref:T,style:{pointerEvents:B?F?"auto":"none":void 0,...e.style},onFocusCapture:rs(e.onFocusCapture,H.onFocusCapture),onBlurCapture:rs(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:rs(e.onPointerDownCapture,$.onPointerDownCapture)}))});function $$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e),a=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const c=h=>{if(h.target&&!a.current){let y=function(){tR(F$,r,v,{discrete:!0})};const v={originalEvent:h};h.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=y,n.addEventListener("click",s.current,{once:!0})):y()}a.current=!1},f=window.setTimeout(()=>{n.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",c),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>a.current=!0}}function U$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e),a=j.useRef(!1);return j.useEffect(()=>{const s=c=>{c.target&&!a.current&&tR(I$,r,{originalEvent:c},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function eR(){const e=new CustomEvent(gx);document.dispatchEvent(e)}function tR(e,n,r,{discrete:a}){const s=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),a?y6(s,c):s.dispatchEvent(c)}const yx="focusScope.autoFocusOnMount",bx="focusScope.autoFocusOnUnmount",nR={bubbles:!1,cancelable:!0},B$=j.forwardRef((e,n)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...f}=e,[h,v]=j.useState(null),y=Qs(s),S=Qs(c),E=j.useRef(null),C=Ec(n,T=>v(T)),x=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(a){let T=function(N){if(x.paused||!h)return;const B=N.target;h.contains(B)?E.current=B:gu(E.current,{select:!0})},D=function(N){if(x.paused||!h)return;const B=N.relatedTarget;B!==null&&(h.contains(B)||gu(E.current,{select:!0}))},M=function(N){const B=document.activeElement;for(const F of N)F.removedNodes.length>0&&(h!=null&&h.contains(B)||gu(h))};document.addEventListener("focusin",T),document.addEventListener("focusout",D);const I=new MutationObserver(M);return h&&I.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",D),I.disconnect()}}},[a,h,x.paused]),j.useEffect(()=>{if(h){aR.add(x);const T=document.activeElement;if(!h.contains(T)){const M=new CustomEvent(yx,nR);h.addEventListener(yx,y),h.dispatchEvent(M),M.defaultPrevented||(V$(Z$(rR(h)),{select:!0}),document.activeElement===T&&gu(h))}return()=>{h.removeEventListener(yx,y),setTimeout(()=>{const M=new CustomEvent(bx,nR);h.addEventListener(bx,S),h.dispatchEvent(M),M.defaultPrevented||gu(T??document.body,{select:!0}),h.removeEventListener(bx,S),aR.remove(x)},0)}}},[h,y,S,x]);const R=j.useCallback(T=>{if(!r&&!a||x.paused)return;const D=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,M=document.activeElement;if(D&&M){const I=T.currentTarget,[N,B]=H$(I);N&&B?!T.shiftKey&&M===B?(T.preventDefault(),r&&gu(N,{select:!0})):T.shiftKey&&M===N&&(T.preventDefault(),r&&gu(B,{select:!0})):M===I&&T.preventDefault()}},[r,a,x.paused]);return j.createElement(Ka.div,Xn({tabIndex:-1},f,{ref:C,onKeyDown:R}))});function V$(e,{select:n=!1}={}){const r=document.activeElement;for(const a of e)if(gu(a,{select:n}),document.activeElement!==r)return}function H$(e){const n=rR(e),r=iR(n,e),a=iR(n.reverse(),e);return[r,a]}function rR(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function iR(e,n){for(const r of e)if(!q$(r,{upTo:n}))return r}function q$(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function W$(e){return e instanceof HTMLInputElement&&"select"in e}function gu(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&W$(e)&&n&&e.select()}}const aR=Y$();function Y$(){let e=[];return{add(n){const r=e[0];n!==r&&(r==null||r.pause()),e=oR(e,n),e.unshift(n)},remove(n){var r;e=oR(e,n),(r=e[0])===null||r===void 0||r.resume()}}}function oR(e,n){const r=[...e],a=r.indexOf(n);return a!==-1&&r.splice(a,1),r}function Z$(e){return e.filter(n=>n.tagName!=="A")}let Sx=0;function K$(){j.useEffect(()=>{var e,n;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:lR()),document.body.insertAdjacentElement("beforeend",(n=r[1])!==null&&n!==void 0?n:lR()),Sx++,()=>{Sx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Sx--}},[])}function lR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var sy="right-scroll-bar-position",uy="width-before-scroll-bar",G$="with-scroll-bars-hidden",Q$="--removed-body-scroll-bar-size";function X$(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function J$(e,n){var r=j.useState(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(a){var s=r.value;s!==a&&(r.value=a,r.callback(a,s))}}}})[0];return r.callback=n,r.facade}function eU(e,n){return J$(n||null,function(r){return e.forEach(function(a){return X$(a,r)})})}function tU(e){return e}function nU(e,n){n===void 0&&(n=tU);var r=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var f=n(c,a);return r.push(f),function(){r=r.filter(function(h){return h!==f})}},assignSyncMedium:function(c){for(a=!0;r.length;){var f=r;r=[],f.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){a=!0;var f=[];if(r.length){var h=r;r=[],h.forEach(c),f=r}var v=function(){var S=f;f=[],S.forEach(c)},y=function(){return Promise.resolve().then(v)};y(),r={push:function(S){f.push(S),y()},filter:function(S){return f=f.filter(S),r}}}};return s}function rU(e){e===void 0&&(e={});var n=nU(null);return n.options=eo({async:!0,ssr:!1},e),n}var sR=function(e){var n=e.sideCar,r=L5(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return Z.createElement(a,eo({},r))};sR.isSideCarExport=!0;function iU(e,n){return e.useMedium(n),sR}var uR=rU(),Ex=function(){},cy=Z.forwardRef(function(e,n){var r=Z.useRef(null),a=Z.useState({onScrollCapture:Ex,onWheelCapture:Ex,onTouchMoveCapture:Ex}),s=a[0],c=a[1],f=e.forwardProps,h=e.children,v=e.className,y=e.removeScrollBar,S=e.enabled,E=e.shards,C=e.sideCar,x=e.noIsolation,R=e.inert,T=e.allowPinchZoom,D=e.as,M=D===void 0?"div":D,I=L5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),N=C,B=eU([r,n]),F=eo(eo({},I),s);return Z.createElement(Z.Fragment,null,S&&Z.createElement(N,{sideCar:uR,removeScrollBar:y,shards:E,noIsolation:x,inert:R,setCallbacks:c,allowPinchZoom:!!T,lockRef:r}),f?Z.cloneElement(Z.Children.only(h),eo(eo({},F),{ref:B})):Z.createElement(M,eo({},F,{className:v,ref:B}),h))});cy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cy.classNames={fullWidth:uy,zeroRight:sy};var cR,aU=function(){if(cR)return cR;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=aU();return n&&e.setAttribute("nonce",n),e}function lU(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function sU(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var uU=function(){var e=0,n=null;return{add:function(r){e==0&&(n=oU())&&(lU(n,r),sU(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},cU=function(){var e=uU();return function(n,r){Z.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},fR=function(){var e=cU(),n=function(r){var a=r.styles,s=r.dynamic;return e(a,s),null};return n},fU={left:0,top:0,right:0,gap:0},xx=function(e){return parseInt(e||"",10)||0},dU=function(e){var n=window.getComputedStyle(document.body),r=n[e==="padding"?"paddingLeft":"marginLeft"],a=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[xx(r),xx(a),xx(s)]},pU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fU;var n=dU(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-r+n[2]-n[0])}},hU=fR(),mU=function(e,n,r,a){var s=e.left,c=e.top,f=e.right,h=e.gap;return r===void 0&&(r="margin"),`
662
+ */function hd(e){return e.variant===Kh.FIDELITY||e.variant===Kh.CONTENT}function Sr(e){return e.variant===Kh.MONOCHROME}function BF(e,n,r,a){let s=r,c=Mc.from(e,n,r);if(c.chroma<n){let f=c.chroma;for(;c.chroma<n;){s+=a?-1:1;const h=Mc.from(e,n,s);if(f>h.chroma||Math.abs(h.chroma-n)<.4)break;const v=Math.abs(h.chroma-n),y=Math.abs(c.chroma-n);v<y&&(c=h),f=Math.max(f,h.chroma)}}return s}function VF(e){return bo.make(void 0,void 0,e.isDark?30:80,void 0,void 0)}function KE(e,n){const r=e.inViewingConditions(VF(n));return Qe.tonePrefersLightForeground(e.tone)&&!Qe.toneAllowsLightForeground(r.tone)?Qe.enableLightForeground(e.tone):Qe.enableLightForeground(r.tone)}class ge{static highestSurface(n){return n.isDark?ge.surfaceBright:ge.surfaceDim}}ge.contentAccentToneDelta=15,ge.primaryPaletteKeyColor=Qe.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone}),ge.secondaryPaletteKeyColor=Qe.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone}),ge.tertiaryPaletteKeyColor=Qe.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone}),ge.neutralPaletteKeyColor=Qe.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone}),ge.neutralVariantPaletteKeyColor=Qe.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone}),ge.background=Qe.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),ge.onBackground=Qe.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>ge.background,contrastCurve:new on(3,3,4.5,7)}),ge.surface=Qe.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),ge.surfaceDim=Qe.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:87,isBackground:!0}),ge.surfaceBright=Qe.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?24:98,isBackground:!0}),ge.surfaceContainerLowest=Qe.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?4:100,isBackground:!0}),ge.surfaceContainerLow=Qe.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?10:96,isBackground:!0}),ge.surfaceContainer=Qe.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?12:94,isBackground:!0}),ge.surfaceContainerHigh=Qe.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?17:92,isBackground:!0}),ge.surfaceContainerHighest=Qe.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?22:90,isBackground:!0}),ge.onSurface=Qe.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>ge.highestSurface(e),contrastCurve:new on(4.5,7,11,21)}),ge.surfaceVariant=Qe.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0}),ge.onSurfaceVariant=Qe.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11)}),ge.inverseSurface=Qe.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20}),ge.inverseOnSurface=Qe.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>ge.inverseSurface,contrastCurve:new on(4.5,7,11,21)}),ge.outline=Qe.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>ge.highestSurface(e),contrastCurve:new on(1.5,3,4.5,7)}),ge.outlineVariant=Qe.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7)}),ge.shadow=Qe.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0}),ge.scrim=Qe.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0}),ge.surfaceTint=Qe.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0}),ge.primary=Qe.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>Sr(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.primaryContainer,ge.primary,15,"nearer",!1)}),ge.onPrimary=Qe.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>Sr(e)?e.isDark?10:90:e.isDark?20:100,background:e=>ge.primary,contrastCurve:new on(4.5,7,11,21)}),ge.primaryContainer=Qe.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>hd(e)?KE(e.sourceColorHct,e):Sr(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryContainer,ge.primary,15,"nearer",!1)}),ge.onPrimaryContainer=Qe.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>hd(e)?Qe.foregroundTone(ge.primaryContainer.tone(e),4.5):Sr(e)?e.isDark?0:100:e.isDark?90:10,background:e=>ge.primaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.inversePrimary=Qe.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>ge.inverseSurface,contrastCurve:new on(3,4.5,7,11)}),ge.secondary=Qe.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.secondaryContainer,ge.secondary,15,"nearer",!1)}),ge.onSecondary=Qe.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?e.isDark?10:100:e.isDark?20:100,background:e=>ge.secondary,contrastCurve:new on(4.5,7,11,21)}),ge.secondaryContainer=Qe.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const n=e.isDark?30:90;if(Sr(e))return e.isDark?30:85;if(!hd(e))return n;let r=BF(e.secondaryPalette.hue,e.secondaryPalette.chroma,n,!e.isDark);return r=KE(e.secondaryPalette.getHct(r),e),r},isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryContainer,ge.secondary,15,"nearer",!1)}),ge.onSecondaryContainer=Qe.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>hd(e)?Qe.foregroundTone(ge.secondaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>ge.secondaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.tertiary=Qe.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.tertiaryContainer,ge.tertiary,15,"nearer",!1)}),ge.onTertiary=Qe.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?10:90:e.isDark?20:100,background:e=>ge.tertiary,contrastCurve:new on(4.5,7,11,21)}),ge.tertiaryContainer=Qe.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(Sr(e))return e.isDark?60:49;if(!hd(e))return e.isDark?30:90;const n=KE(e.tertiaryPalette.getHct(e.sourceColorHct.tone),e),r=e.tertiaryPalette.getHct(n);return ZE.fixIfDisliked(r).tone},isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryContainer,ge.tertiary,15,"nearer",!1)}),ge.onTertiaryContainer=Qe.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?e.isDark?0:100:hd(e)?Qe.foregroundTone(ge.tertiaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>ge.tertiaryContainer,contrastCurve:new on(4.5,7,11,21)}),ge.error=Qe.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(3,4.5,7,11),toneDeltaPair:e=>new la(ge.errorContainer,ge.error,15,"nearer",!1)}),ge.onError=Qe.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>ge.error,contrastCurve:new on(4.5,7,11,21)}),ge.errorContainer=Qe.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.errorContainer,ge.error,15,"nearer",!1)}),ge.onErrorContainer=Qe.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?90:10,background:e=>ge.errorContainer,contrastCurve:new on(4.5,7,11,21)}),ge.primaryFixed=Qe.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>Sr(e)?40:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryFixed,ge.primaryFixedDim,10,"lighter",!0)}),ge.primaryFixedDim=Qe.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>Sr(e)?30:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.primaryFixed,ge.primaryFixedDim,10,"lighter",!0)}),ge.onPrimaryFixed=Qe.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>Sr(e)?100:10,background:e=>ge.primaryFixedDim,secondBackground:e=>ge.primaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onPrimaryFixedVariant=Qe.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>Sr(e)?90:30,background:e=>ge.primaryFixedDim,secondBackground:e=>ge.primaryFixed,contrastCurve:new on(3,4.5,7,11)}),ge.secondaryFixed=Qe.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?80:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryFixed,ge.secondaryFixedDim,10,"lighter",!0)}),ge.secondaryFixedDim=Qe.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?70:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.secondaryFixed,ge.secondaryFixedDim,10,"lighter",!0)}),ge.onSecondaryFixed=Qe.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>ge.secondaryFixedDim,secondBackground:e=>ge.secondaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onSecondaryFixedVariant=Qe.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>Sr(e)?25:30,background:e=>ge.secondaryFixedDim,secondBackground:e=>ge.secondaryFixed,contrastCurve:new on(3,4.5,7,11)}),ge.tertiaryFixed=Qe.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?40:90,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryFixed,ge.tertiaryFixedDim,10,"lighter",!0)}),ge.tertiaryFixedDim=Qe.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?30:80,isBackground:!0,background:e=>ge.highestSurface(e),contrastCurve:new on(1,1,3,7),toneDeltaPair:e=>new la(ge.tertiaryFixed,ge.tertiaryFixedDim,10,"lighter",!0)}),ge.onTertiaryFixed=Qe.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?100:10,background:e=>ge.tertiaryFixedDim,secondBackground:e=>ge.tertiaryFixed,contrastCurve:new on(4.5,7,11,21)}),ge.onTertiaryFixedVariant=Qe.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>Sr(e)?90:30,background:e=>ge.tertiaryFixedDim,secondBackground:e=>ge.tertiaryFixed,contrastCurve:new on(3,4.5,7,11)});var HF={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Gh=HF,B5={};for(const e of Object.keys(Gh))B5[Gh[e]]=e;const pt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var V5=pt;for(const e of Object.keys(pt)){if(!("channels"in pt[e]))throw new Error("missing channels property: "+e);if(!("labels"in pt[e]))throw new Error("missing channel labels property: "+e);if(pt[e].labels.length!==pt[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:r}=pt[e];delete pt[e].channels,delete pt[e].labels,Object.defineProperty(pt[e],"channels",{value:n}),Object.defineProperty(pt[e],"labels",{value:r})}pt.rgb.hsl=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(n,r,a),c=Math.max(n,r,a),f=c-s;let h,v;c===s?h=0:n===c?h=(r-a)/f:r===c?h=2+(a-n)/f:a===c&&(h=4+(n-r)/f),h=Math.min(h*60,360),h<0&&(h+=360);const y=(s+c)/2;return c===s?v=0:y<=.5?v=f/(c+s):v=f/(2-c-s),[h,v*100,y*100]},pt.rgb.hsv=function(e){let n,r,a,s,c;const f=e[0]/255,h=e[1]/255,v=e[2]/255,y=Math.max(f,h,v),S=y-Math.min(f,h,v),E=function(C){return(y-C)/6/S+1/2};return S===0?(s=0,c=0):(c=S/y,n=E(f),r=E(h),a=E(v),f===y?s=a-r:h===y?s=1/3+n-a:v===y&&(s=2/3+r-n),s<0?s+=1:s>1&&(s-=1)),[s*360,c*100,y*100]},pt.rgb.hwb=function(e){const n=e[0],r=e[1];let a=e[2];const s=pt.rgb.hsl(e)[0],c=1/255*Math.min(n,Math.min(r,a));return a=1-1/255*Math.max(n,Math.max(r,a)),[s,c*100,a*100]},pt.rgb.cmyk=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(1-n,1-r,1-a),c=(1-n-s)/(1-s)||0,f=(1-r-s)/(1-s)||0,h=(1-a-s)/(1-s)||0;return[c*100,f*100,h*100,s*100]};function qF(e,n){return(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2}pt.rgb.keyword=function(e){const n=B5[e];if(n)return n;let r=1/0,a;for(const s of Object.keys(Gh)){const c=Gh[s],f=qF(e,c);f<r&&(r=f,a=s)}return a},pt.keyword.rgb=function(e){return Gh[e]},pt.rgb.xyz=function(e){let n=e[0]/255,r=e[1]/255,a=e[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const s=n*.4124+r*.3576+a*.1805,c=n*.2126+r*.7152+a*.0722,f=n*.0193+r*.1192+a*.9505;return[s*100,c*100,f*100]},pt.rgb.lab=function(e){const n=pt.rgb.xyz(e);let r=n[0],a=n[1],s=n[2];r/=95.047,a/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;const c=116*a-16,f=500*(r-a),h=200*(a-s);return[c,f,h]},pt.hsl.rgb=function(e){const n=e[0]/360,r=e[1]/100,a=e[2]/100;let s,c,f;if(r===0)return f=a*255,[f,f,f];a<.5?s=a*(1+r):s=a+r-a*r;const h=2*a-s,v=[0,0,0];for(let y=0;y<3;y++)c=n+1/3*-(y-1),c<0&&c++,c>1&&c--,6*c<1?f=h+(s-h)*6*c:2*c<1?f=s:3*c<2?f=h+(s-h)*(2/3-c)*6:f=h,v[y]=f*255;return v},pt.hsl.hsv=function(e){const n=e[0];let r=e[1]/100,a=e[2]/100,s=r;const c=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,s*=c<=1?c:2-c;const f=(a+r)/2,h=a===0?2*s/(c+s):2*r/(a+r);return[n,h*100,f*100]},pt.hsv.rgb=function(e){const n=e[0]/60,r=e[1]/100;let a=e[2]/100;const s=Math.floor(n)%6,c=n-Math.floor(n),f=255*a*(1-r),h=255*a*(1-r*c),v=255*a*(1-r*(1-c));switch(a*=255,s){case 0:return[a,v,f];case 1:return[h,a,f];case 2:return[f,a,v];case 3:return[f,h,a];case 4:return[v,f,a];case 5:return[a,f,h]}},pt.hsv.hsl=function(e){const n=e[0],r=e[1]/100,a=e[2]/100,s=Math.max(a,.01);let c,f;f=(2-r)*a;const h=(2-r)*s;return c=r*s,c/=h<=1?h:2-h,c=c||0,f/=2,[n,c*100,f*100]},pt.hwb.rgb=function(e){const n=e[0]/360;let r=e[1]/100,a=e[2]/100;const s=r+a;let c;s>1&&(r/=s,a/=s);const f=Math.floor(6*n),h=1-a;c=6*n-f,f&1&&(c=1-c);const v=r+c*(h-r);let y,S,E;switch(f){default:case 6:case 0:y=h,S=v,E=r;break;case 1:y=v,S=h,E=r;break;case 2:y=r,S=h,E=v;break;case 3:y=r,S=v,E=h;break;case 4:y=v,S=r,E=h;break;case 5:y=h,S=r,E=v;break}return[y*255,S*255,E*255]},pt.cmyk.rgb=function(e){const n=e[0]/100,r=e[1]/100,a=e[2]/100,s=e[3]/100,c=1-Math.min(1,n*(1-s)+s),f=1-Math.min(1,r*(1-s)+s),h=1-Math.min(1,a*(1-s)+s);return[c*255,f*255,h*255]},pt.xyz.rgb=function(e){const n=e[0]/100,r=e[1]/100,a=e[2]/100;let s,c,f;return s=n*3.2406+r*-1.5372+a*-.4986,c=n*-.9689+r*1.8758+a*.0415,f=n*.0557+r*-.204+a*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,s=Math.min(Math.max(0,s),1),c=Math.min(Math.max(0,c),1),f=Math.min(Math.max(0,f),1),[s*255,c*255,f*255]},pt.xyz.lab=function(e){let n=e[0],r=e[1],a=e[2];n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const s=116*r-16,c=500*(n-r),f=200*(r-a);return[s,c,f]},pt.lab.xyz=function(e){const n=e[0],r=e[1],a=e[2];let s,c,f;c=(n+16)/116,s=r/500+c,f=c-a/200;const h=c**3,v=s**3,y=f**3;return c=h>.008856?h:(c-16/116)/7.787,s=v>.008856?v:(s-16/116)/7.787,f=y>.008856?y:(f-16/116)/7.787,s*=95.047,c*=100,f*=108.883,[s,c,f]},pt.lab.lch=function(e){const n=e[0],r=e[1],a=e[2];let s;s=Math.atan2(a,r)*360/2/Math.PI,s<0&&(s+=360);const f=Math.sqrt(r*r+a*a);return[n,f,s]},pt.lch.lab=function(e){const n=e[0],r=e[1],s=e[2]/360*2*Math.PI,c=r*Math.cos(s),f=r*Math.sin(s);return[n,c,f]},pt.rgb.ansi16=function(e,n=null){const[r,a,s]=e;let c=n===null?pt.rgb.hsv(e)[2]:n;if(c=Math.round(c/50),c===0)return 30;let f=30+(Math.round(s/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return c===2&&(f+=60),f},pt.hsv.ansi16=function(e){return pt.rgb.ansi16(pt.hsv.rgb(e),e[2])},pt.rgb.ansi256=function(e){const n=e[0],r=e[1],a=e[2];return n===r&&r===a?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},pt.ansi16.rgb=function(e){let n=e%10;if(n===0||n===7)return e>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const r=(~~(e>50)+1)*.5,a=(n&1)*r*255,s=(n>>1&1)*r*255,c=(n>>2&1)*r*255;return[a,s,c]},pt.ansi256.rgb=function(e){if(e>=232){const c=(e-232)*10+8;return[c,c,c]}e-=16;let n;const r=Math.floor(e/36)/5*255,a=Math.floor((n=e%36)/6)/5*255,s=n%6/5*255;return[r,a,s]},pt.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r},pt.hex.rgb=function(e){const n=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let r=n[0];n[0].length===3&&(r=r.split("").map(h=>h+h).join(""));const a=parseInt(r,16),s=a>>16&255,c=a>>8&255,f=a&255;return[s,c,f]},pt.rgb.hcg=function(e){const n=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.max(Math.max(n,r),a),c=Math.min(Math.min(n,r),a),f=s-c;let h,v;return f<1?h=c/(1-f):h=0,f<=0?v=0:s===n?v=(r-a)/f%6:s===r?v=2+(a-n)/f:v=4+(n-r)/f,v/=6,v%=1,[v*360,f*100,h*100]},pt.hsl.hcg=function(e){const n=e[1]/100,r=e[2]/100,a=r<.5?2*n*r:2*n*(1-r);let s=0;return a<1&&(s=(r-.5*a)/(1-a)),[e[0],a*100,s*100]},pt.hsv.hcg=function(e){const n=e[1]/100,r=e[2]/100,a=n*r;let s=0;return a<1&&(s=(r-a)/(1-a)),[e[0],a*100,s*100]},pt.hcg.rgb=function(e){const n=e[0]/360,r=e[1]/100,a=e[2]/100;if(r===0)return[a*255,a*255,a*255];const s=[0,0,0],c=n%1*6,f=c%1,h=1-f;let v=0;switch(Math.floor(c)){case 0:s[0]=1,s[1]=f,s[2]=0;break;case 1:s[0]=h,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=f;break;case 3:s[0]=0,s[1]=h,s[2]=1;break;case 4:s[0]=f,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=h}return v=(1-r)*a,[(r*s[0]+v)*255,(r*s[1]+v)*255,(r*s[2]+v)*255]},pt.hcg.hsv=function(e){const n=e[1]/100,r=e[2]/100,a=n+r*(1-n);let s=0;return a>0&&(s=n/a),[e[0],s*100,a*100]},pt.hcg.hsl=function(e){const n=e[1]/100,a=e[2]/100*(1-n)+.5*n;let s=0;return a>0&&a<.5?s=n/(2*a):a>=.5&&a<1&&(s=n/(2*(1-a))),[e[0],s*100,a*100]},pt.hcg.hwb=function(e){const n=e[1]/100,r=e[2]/100,a=n+r*(1-n);return[e[0],(a-n)*100,(1-a)*100]},pt.hwb.hcg=function(e){const n=e[1]/100,a=1-e[2]/100,s=a-n;let c=0;return s<1&&(c=(a-s)/(1-s)),[e[0],s*100,c*100]},pt.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},pt.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},pt.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},pt.gray.hsl=function(e){return[0,0,e[0]]},pt.gray.hsv=pt.gray.hsl,pt.gray.hwb=function(e){return[0,100,e[0]]},pt.gray.cmyk=function(e){return[0,0,0,e[0]]},pt.gray.lab=function(e){return[e[0],0,0]},pt.gray.hex=function(e){const n=Math.round(e[0]/100*255)&255,a=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(a.length)+a},pt.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const Og=V5;function WF(){const e={},n=Object.keys(Og);for(let r=n.length,a=0;a<r;a++)e[n[a]]={distance:-1,parent:null};return e}function YF(e){const n=WF(),r=[e];for(n[e].distance=0;r.length;){const a=r.pop(),s=Object.keys(Og[a]);for(let c=s.length,f=0;f<c;f++){const h=s[f],v=n[h];v.distance===-1&&(v.distance=n[a].distance+1,v.parent=a,r.unshift(h))}}return n}function ZF(e,n){return function(r){return n(e(r))}}function KF(e,n){const r=[n[e].parent,e];let a=Og[n[e].parent][e],s=n[e].parent;for(;n[s].parent;)r.unshift(n[s].parent),a=ZF(Og[n[s].parent][s],a),s=n[s].parent;return a.conversion=r,a}var GF=function(e){const n=YF(e),r={},a=Object.keys(n);for(let s=a.length,c=0;c<s;c++){const f=a[c];n[f].parent!==null&&(r[f]=KF(f,n))}return r};const GE=V5,QF=GF,Qh={},XF=Object.keys(GE);function JF(e){const n=function(...r){const a=r[0];return a==null?a:(a.length>1&&(r=a),e(r))};return"conversion"in e&&(n.conversion=e.conversion),n}function eI(e){const n=function(...r){const a=r[0];if(a==null)return a;a.length>1&&(r=a);const s=e(r);if(typeof s=="object")for(let c=s.length,f=0;f<c;f++)s[f]=Math.round(s[f]);return s};return"conversion"in e&&(n.conversion=e.conversion),n}XF.forEach(e=>{Qh[e]={},Object.defineProperty(Qh[e],"channels",{value:GE[e].channels}),Object.defineProperty(Qh[e],"labels",{value:GE[e].labels});const n=QF(e);Object.keys(n).forEach(a=>{const s=n[a];Qh[e][a]=eI(s),Qh[e][a].raw=JF(s)})});var H5={},q5={},QE={exports:{}},Wn=String,W5=function(){return{isColorSupported:!1,reset:Wn,bold:Wn,dim:Wn,italic:Wn,underline:Wn,inverse:Wn,hidden:Wn,strikethrough:Wn,black:Wn,red:Wn,green:Wn,yellow:Wn,blue:Wn,magenta:Wn,cyan:Wn,white:Wn,gray:Wn,bgBlack:Wn,bgRed:Wn,bgGreen:Wn,bgYellow:Wn,bgBlue:Wn,bgMagenta:Wn,bgCyan:Wn,bgWhite:Wn}};QE.exports=W5(),QE.exports.createColors=W5;var tI=QE.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function n(v,y){for(var S in y)Object.defineProperty(v,S,{enumerable:!0,get:y[S]})}n(e,{dim:function(){return f},default:function(){return h}});const r=a(tI);function a(v){return v&&v.__esModule?v:{default:v}}let s=new Set;function c(v,y,S){typeof process<"u"&&process.env.JEST_WORKER_ID||S&&s.has(S)||(S&&s.add(S),console.warn(""),y.forEach(E=>console.warn(v,"-",E)))}function f(v){return r.default.dim(v)}const h={info(v,y){c(r.default.bold(r.default.cyan("info")),...Array.isArray(v)?[v]:[y,v])},warn(v,y){c(r.default.bold(r.default.yellow("warn")),...Array.isArray(v)?[v]:[y,v])},risk(v,y){c(r.default.bold(r.default.magenta("risk")),...Array.isArray(v)?[v]:[y,v])}}})(q5),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});const n=r(q5);function r(c){return c&&c.__esModule?c:{default:c}}function a({version:c,from:f,to:h}){n.default.warn(`${f}-color-renamed`,[`As of Tailwind CSS ${c}, \`${f}\` has been renamed to \`${h}\`.`,"Update your configuration file to silence this warning."])}const s={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(H5);let XE=H5;(XE.__esModule?XE:{default:XE}).default;class Y5{constructor(){Wl(this,"eventMap");this.eventMap={}}on(n,r){var a;return this.eventMap[n]||(this.eventMap[n]=new Set),(a=this.eventMap[n])==null||a.add(r),()=>{var s;(s=this.eventMap[n])==null||s.delete(r)}}emit(n,r){var a;(a=this.eventMap[n])==null||a.forEach(s=>{s(r)})}}const nI=new Y5;function Z5(e,n){let r=0;if(e.length==0)return r;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a);r=(r<<5)-r+s,r=r&r}return Math.abs(r)%n}var hn;(function(e){e.assertEqual=s=>s;function n(s){}e.assertIs=n;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const c={};for(const f of s)c[f]=f;return c},e.getValidEnumValues=s=>{const c=e.objectKeys(s).filter(h=>typeof s[s[h]]!="number"),f={};for(const h of c)f[h]=s[h];return e.objectValues(f)},e.objectValues=s=>e.objectKeys(s).map(function(c){return s[c]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const c=[];for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&c.push(f);return c},e.find=(s,c)=>{for(const f of s)if(c(f))return f},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function a(s,c=" | "){return s.map(f=>typeof f=="string"?`'${f}'`:f).join(c)}e.joinValues=a,e.jsonStringifyReplacer=(s,c)=>typeof c=="bigint"?c.toString():c})(hn||(hn={}));var JE;(function(e){e.mergeShapes=(n,r)=>({...n,...r})})(JE||(JE={}));const rt=hn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cu=e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},qe=hn.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"]),rI=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class So extends Error{constructor(n){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=n}get errors(){return this.issues}format(n){const r=n||function(c){return c.message},a={_errors:[]},s=c=>{for(const f of c.issues)if(f.code==="invalid_union")f.unionErrors.map(s);else if(f.code==="invalid_return_type")s(f.returnTypeError);else if(f.code==="invalid_arguments")s(f.argumentsError);else if(f.path.length===0)a._errors.push(r(f));else{let h=a,v=0;for(;v<f.path.length;){const y=f.path[v];v===f.path.length-1?(h[y]=h[y]||{_errors:[]},h[y]._errors.push(r(f))):h[y]=h[y]||{_errors:[]},h=h[y],v++}}};return s(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,hn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=r=>r.message){const r={},a=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(n(s))):a.push(n(s));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}So.create=e=>new So(e);const Xh=(e,n)=>{let r;switch(e.code){case qe.invalid_type:e.received===rt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case qe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,hn.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:r=`Unrecognized key(s) in object: ${hn.joinValues(e.keys,", ")}`;break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hn.joinValues(e.options)}`;break;case qe.invalid_enum_value:r=`Invalid enum value. Expected ${hn.joinValues(e.options)}, received '${e.received}'`;break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:hn.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case qe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case qe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case qe.not_finite:r="Number must be finite";break;default:r=n.defaultError,hn.assertNever(e)}return{message:r}};let K5=Xh;function iI(e){K5=e}function Dg(){return K5}const Ag=e=>{const{data:n,path:r,errorMaps:a,issueData:s}=e,c=[...r,...s.path||[]],f={...s,path:c};let h="";const v=a.filter(y=>!!y).slice().reverse();for(const y of v)h=y(f,{data:n,defaultError:h}).message;return{...s,path:c,message:s.message||h}},aI=[];function ot(e,n){const r=Ag({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dg(),Xh].filter(a=>!!a)});e.common.issues.push(r)}class wi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,r){const a=[];for(const s of r){if(s.status==="aborted")return Ut;s.status==="dirty"&&n.dirty(),a.push(s.value)}return{status:n.value,value:a}}static async mergeObjectAsync(n,r){const a=[];for(const s of r)a.push({key:await s.key,value:await s.value});return wi.mergeObjectSync(n,a)}static mergeObjectSync(n,r){const a={};for(const s of r){const{key:c,value:f}=s;if(c.status==="aborted"||f.status==="aborted")return Ut;c.status==="dirty"&&n.dirty(),f.status==="dirty"&&n.dirty(),(typeof f.value<"u"||s.alwaysSet)&&(a[c.value]=f.value)}return{status:n.value,value:a}}}const Ut=Object.freeze({status:"aborted"}),G5=e=>({status:"dirty",value:e}),zi=e=>({status:"valid",value:e}),ex=e=>e.status==="aborted",tx=e=>e.status==="dirty",Mg=e=>e.status==="valid",Lg=e=>typeof Promise<"u"&&e instanceof Promise;var Ct;(function(e){e.errToObj=n=>typeof n=="string"?{message:n}:n||{},e.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(Ct||(Ct={}));class il{constructor(n,r,a,s){this._cachedPath=[],this.parent=n,this.data=r,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Q5=(e,n)=>{if(Mg(n))return{success:!0,data:n.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new So(e.common.issues);return this._error=r,this._error}}};function Wt(e){if(!e)return{};const{errorMap:n,invalid_type_error:r,required_error:a,description:s}=e;if(n&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:s}:{errorMap:(f,h)=>f.code!=="invalid_type"?{message:h.defaultError}:typeof h.data>"u"?{message:a??h.defaultError}:{message:r??h.defaultError},description:s}}class Qt{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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(n){return cu(n.data)}_getOrReturnCtx(n,r){return r||{common:n.parent.common,data:n.data,parsedType:cu(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new wi,ctx:{common:n.parent.common,data:n.data,parsedType:cu(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const r=this._parse(n);if(Lg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(n){const r=this._parse(n);return Promise.resolve(r)}parse(n,r){const a=this.safeParse(n,r);if(a.success)return a.data;throw a.error}safeParse(n,r){var a;const s={common:{issues:[],async:(a=r==null?void 0:r.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:cu(n)},c=this._parseSync({data:n,path:s.path,parent:s});return Q5(s,c)}async parseAsync(n,r){const a=await this.safeParseAsync(n,r);if(a.success)return a.data;throw a.error}async safeParseAsync(n,r){const a={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:cu(n)},s=this._parse({data:n,path:a.path,parent:a}),c=await(Lg(s)?s:Promise.resolve(s));return Q5(a,c)}refine(n,r){const a=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,c)=>{const f=n(s),h=()=>c.addIssue({code:qe.custom,...a(s)});return typeof Promise<"u"&&f instanceof Promise?f.then(v=>v?!0:(h(),!1)):f?!0:(h(),!1)})}refinement(n,r){return this._refinement((a,s)=>n(a)?!0:(s.addIssue(typeof r=="function"?r(a,s):r),!1))}_refinement(n){return new wo({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}optional(){return ts.create(this,this._def)}nullable(){return Fc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xo.create(this,this._def)}promise(){return yd.create(this,this._def)}or(n){return nm.create([this,n],this._def)}and(n){return rm.create(this,n,this._def)}transform(n){return new wo({...Wt(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const r=typeof n=="function"?n:()=>n;return new sm({...Wt(this._def),innerType:this,defaultValue:r,typeName:Mt.ZodDefault})}brand(){return new J5({typeName:Mt.ZodBranded,type:this,...Wt(this._def)})}catch(n){const r=typeof n=="function"?n:()=>n;return new jg({...Wt(this._def),innerType:this,catchValue:r,typeName:Mt.ZodCatch})}describe(n){const r=this.constructor;return new r({...this._def,description:n})}pipe(n){return um.create(this,n)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const oI=/^c[^\s-]{8,}$/i,lI=/^[a-z][a-z0-9]*$/,sI=/[0-9A-HJKMNP-TV-Z]{26}/,uI=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,cI=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,fI=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,dI=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,pI=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,hI=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function mI(e,n){return!!((n==="v4"||!n)&&dI.test(e)||(n==="v6"||!n)&&pI.test(e))}class Eo extends Qt{constructor(){super(...arguments),this._regex=(n,r,a)=>this.refinement(s=>n.test(s),{validation:r,code:qe.invalid_string,...Ct.errToObj(a)}),this.nonempty=n=>this.min(1,Ct.errToObj(n)),this.trim=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Eo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==rt.string){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.string,received:c.parsedType}),Ut}const a=new wi;let s;for(const c of this._def.checks)if(c.kind==="min")n.data.length<c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")n.data.length>c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){const f=n.data.length>c.value,h=n.data.length<c.value;(f||h)&&(s=this._getOrReturnCtx(n,s),f?ot(s,{code:qe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):h&&ot(s,{code:qe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")cI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"email",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")fI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"emoji",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")uI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"uuid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")oI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"cuid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")lI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"cuid2",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")sI.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"ulid",code:qe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(n.data)}catch{s=this._getOrReturnCtx(n,s),ot(s,{validation:"url",code:qe.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"regex",code:qe.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?n.data=n.data.trim():c.kind==="includes"?n.data.includes(c.value,c.position)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?n.data=n.data.toLowerCase():c.kind==="toUpperCase"?n.data=n.data.toUpperCase():c.kind==="startsWith"?n.data.startsWith(c.value)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?n.data.endsWith(c.value)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?hI(c).test(n.data)||(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="ip"?mI(n.data,c.version)||(s=this._getOrReturnCtx(n,s),ot(s,{validation:"ip",code:qe.invalid_string,message:c.message}),a.dirty()):hn.assertNever(c);return{status:a.value,value:n.data}}_addCheck(n){return new Eo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Ct.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Ct.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Ct.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Ct.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Ct.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Ct.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Ct.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Ct.errToObj(n)})}datetime(n){var r;return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(r=n==null?void 0:n.offset)!==null&&r!==void 0?r:!1,...Ct.errToObj(n==null?void 0:n.message)})}regex(n,r){return this._addCheck({kind:"regex",regex:n,...Ct.errToObj(r)})}includes(n,r){return this._addCheck({kind:"includes",value:n,position:r==null?void 0:r.position,...Ct.errToObj(r==null?void 0:r.message)})}startsWith(n,r){return this._addCheck({kind:"startsWith",value:n,...Ct.errToObj(r)})}endsWith(n,r){return this._addCheck({kind:"endsWith",value:n,...Ct.errToObj(r)})}min(n,r){return this._addCheck({kind:"min",value:n,...Ct.errToObj(r)})}max(n,r){return this._addCheck({kind:"max",value:n,...Ct.errToObj(r)})}length(n,r){return this._addCheck({kind:"length",value:n,...Ct.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}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 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 minLength(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxLength(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}Eo.create=e=>{var n;return new Eo({checks:[],typeName:Mt.ZodString,coerce:(n=e==null?void 0:e.coerce)!==null&&n!==void 0?n:!1,...Wt(e)})};function vI(e,n){const r=(e.toString().split(".")[1]||"").length,a=(n.toString().split(".")[1]||"").length,s=r>a?r:a,c=parseInt(e.toFixed(s).replace(".","")),f=parseInt(n.toFixed(s).replace(".",""));return c%f/Math.pow(10,s)}class fu extends Qt{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)),this._getType(n)!==rt.number){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.number,received:c.parsedType}),Ut}let a;const s=new wi;for(const c of this._def.checks)c.kind==="int"?hn.isInteger(n.data)||(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.invalid_type,expected:"integer",received:"float",message:c.message}),s.dirty()):c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),s.dirty()):c.kind==="multipleOf"?vI(n.data,c.value)!==0&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):c.kind==="finite"?Number.isFinite(n.data)||(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_finite,message:c.message}),s.dirty()):hn.assertNever(c);return{status:s.value,value:n.data}}gte(n,r){return this.setLimit("min",n,!0,Ct.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Ct.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Ct.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Ct.toString(r))}setLimit(n,r,a,s){return new fu({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:a,message:Ct.toString(s)}]})}_addCheck(n){return new fu({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Ct.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ct.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ct.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ct.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ct.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Ct.toString(r)})}finite(n){return this._addCheck({kind:"finite",message:Ct.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ct.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ct.toString(n)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&hn.isInteger(n.value))}get isFinite(){let n=null,r=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(n===null||a.value<n)&&(n=a.value)}return Number.isFinite(r)&&Number.isFinite(n)}}fu.create=e=>new fu({checks:[],typeName:Mt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Wt(e)});class du extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce&&(n.data=BigInt(n.data)),this._getType(n)!==rt.bigint){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.bigint,received:c.parsedType}),Ut}let a;const s=new wi;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),s.dirty()):c.kind==="multipleOf"?n.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(n,a),ot(a,{code:qe.not_multiple_of,multipleOf:c.value,message:c.message}),s.dirty()):hn.assertNever(c);return{status:s.value,value:n.data}}gte(n,r){return this.setLimit("min",n,!0,Ct.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Ct.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Ct.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Ct.toString(r))}setLimit(n,r,a,s){return new du({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:a,message:Ct.toString(s)}]})}_addCheck(n){return new du({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ct.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ct.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ct.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ct.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Ct.toString(r)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}du.create=e=>{var n;return new du({checks:[],typeName:Mt.ZodBigInt,coerce:(n=e==null?void 0:e.coerce)!==null&&n!==void 0?n:!1,...Wt(e)})};class Jh extends Qt{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==rt.boolean){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.boolean,received:a.parsedType}),Ut}return zi(n.data)}}Jh.create=e=>new Jh({typeName:Mt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Wt(e)});class Lc extends Qt{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==rt.date){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_type,expected:rt.date,received:c.parsedType}),Ut}if(isNaN(n.data.getTime())){const c=this._getOrReturnCtx(n);return ot(c,{code:qe.invalid_date}),Ut}const a=new wi;let s;for(const c of this._def.checks)c.kind==="min"?n.data.getTime()<c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?n.data.getTime()>c.value&&(s=this._getOrReturnCtx(n,s),ot(s,{code:qe.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):hn.assertNever(c);return{status:a.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Lc({...this._def,checks:[...this._def.checks,n]})}min(n,r){return this._addCheck({kind:"min",value:n.getTime(),message:Ct.toString(r)})}max(n,r){return this._addCheck({kind:"max",value:n.getTime(),message:Ct.toString(r)})}get minDate(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n!=null?new Date(n):null}}Lc.create=e=>new Lc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Mt.ZodDate,...Wt(e)});class Pg extends Qt{_parse(n){if(this._getType(n)!==rt.symbol){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.symbol,received:a.parsedType}),Ut}return zi(n.data)}}Pg.create=e=>new Pg({typeName:Mt.ZodSymbol,...Wt(e)});class em extends Qt{_parse(n){if(this._getType(n)!==rt.undefined){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.undefined,received:a.parsedType}),Ut}return zi(n.data)}}em.create=e=>new em({typeName:Mt.ZodUndefined,...Wt(e)});class tm extends Qt{_parse(n){if(this._getType(n)!==rt.null){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.null,received:a.parsedType}),Ut}return zi(n.data)}}tm.create=e=>new tm({typeName:Mt.ZodNull,...Wt(e)});class md extends Qt{constructor(){super(...arguments),this._any=!0}_parse(n){return zi(n.data)}}md.create=e=>new md({typeName:Mt.ZodAny,...Wt(e)});class Pc extends Qt{constructor(){super(...arguments),this._unknown=!0}_parse(n){return zi(n.data)}}Pc.create=e=>new Pc({typeName:Mt.ZodUnknown,...Wt(e)});class es extends Qt{_parse(n){const r=this._getOrReturnCtx(n);return ot(r,{code:qe.invalid_type,expected:rt.never,received:r.parsedType}),Ut}}es.create=e=>new es({typeName:Mt.ZodNever,...Wt(e)});class Ng extends Qt{_parse(n){if(this._getType(n)!==rt.undefined){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.void,received:a.parsedType}),Ut}return zi(n.data)}}Ng.create=e=>new Ng({typeName:Mt.ZodVoid,...Wt(e)});class xo extends Qt{_parse(n){const{ctx:r,status:a}=this._processInputParams(n),s=this._def;if(r.parsedType!==rt.array)return ot(r,{code:qe.invalid_type,expected:rt.array,received:r.parsedType}),Ut;if(s.exactLength!==null){const f=r.data.length>s.exactLength.value,h=r.data.length<s.exactLength.value;(f||h)&&(ot(r,{code:f?qe.too_big:qe.too_small,minimum:h?s.exactLength.value:void 0,maximum:f?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(ot(r,{code:qe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(ot(r,{code:qe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((f,h)=>s.type._parseAsync(new il(r,f,r.path,h)))).then(f=>wi.mergeArray(a,f));const c=[...r.data].map((f,h)=>s.type._parseSync(new il(r,f,r.path,h)));return wi.mergeArray(a,c)}get element(){return this._def.type}min(n,r){return new xo({...this._def,minLength:{value:n,message:Ct.toString(r)}})}max(n,r){return new xo({...this._def,maxLength:{value:n,message:Ct.toString(r)}})}length(n,r){return new xo({...this._def,exactLength:{value:n,message:Ct.toString(r)}})}nonempty(n){return this.min(1,n)}}xo.create=(e,n)=>new xo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Wt(n)});function vd(e){if(e instanceof rr){const n={};for(const r in e.shape){const a=e.shape[r];n[r]=ts.create(vd(a))}return new rr({...e._def,shape:()=>n})}else return e instanceof xo?new xo({...e._def,type:vd(e.element)}):e instanceof ts?ts.create(vd(e.unwrap())):e instanceof Fc?Fc.create(vd(e.unwrap())):e instanceof al?al.create(e.items.map(n=>vd(n))):e}class rr extends Qt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),r=hn.objectKeys(n);return this._cached={shape:n,keys:r}}_parse(n){if(this._getType(n)!==rt.object){const y=this._getOrReturnCtx(n);return ot(y,{code:qe.invalid_type,expected:rt.object,received:y.parsedType}),Ut}const{status:a,ctx:s}=this._processInputParams(n),{shape:c,keys:f}=this._getCached(),h=[];if(!(this._def.catchall instanceof es&&this._def.unknownKeys==="strip"))for(const y in s.data)f.includes(y)||h.push(y);const v=[];for(const y of f){const S=c[y],E=s.data[y];v.push({key:{status:"valid",value:y},value:S._parse(new il(s,E,s.path,y)),alwaysSet:y in s.data})}if(this._def.catchall instanceof es){const y=this._def.unknownKeys;if(y==="passthrough")for(const S of h)v.push({key:{status:"valid",value:S},value:{status:"valid",value:s.data[S]}});else if(y==="strict")h.length>0&&(ot(s,{code:qe.unrecognized_keys,keys:h}),a.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const S of h){const E=s.data[S];v.push({key:{status:"valid",value:S},value:y._parse(new il(s,E,s.path,S)),alwaysSet:S in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const y=[];for(const S of v){const E=await S.key;y.push({key:E,value:await S.value,alwaysSet:S.alwaysSet})}return y}).then(y=>wi.mergeObjectSync(a,y)):wi.mergeObjectSync(a,v)}get shape(){return this._def.shape()}strict(n){return Ct.errToObj,new rr({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(r,a)=>{var s,c,f,h;const v=(f=(c=(s=this._def).errorMap)===null||c===void 0?void 0:c.call(s,r,a).message)!==null&&f!==void 0?f:a.defaultError;return r.code==="unrecognized_keys"?{message:(h=Ct.errToObj(n).message)!==null&&h!==void 0?h:v}:{message:v}}}:{}})}strip(){return new rr({...this._def,unknownKeys:"strip"})}passthrough(){return new rr({...this._def,unknownKeys:"passthrough"})}extend(n){return new rr({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new rr({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Mt.ZodObject})}setKey(n,r){return this.augment({[n]:r})}catchall(n){return new rr({...this._def,catchall:n})}pick(n){const r={};return hn.objectKeys(n).forEach(a=>{n[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new rr({...this._def,shape:()=>r})}omit(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{n[a]||(r[a]=this.shape[a])}),new rr({...this._def,shape:()=>r})}deepPartial(){return vd(this)}partial(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{const s=this.shape[a];n&&!n[a]?r[a]=s:r[a]=s.optional()}),new rr({...this._def,shape:()=>r})}required(n){const r={};return hn.objectKeys(this.shape).forEach(a=>{if(n&&!n[a])r[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof ts;)c=c._def.innerType;r[a]=c}}),new rr({...this._def,shape:()=>r})}keyof(){return X5(hn.objectKeys(this.shape))}}rr.create=(e,n)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)}),rr.strictCreate=(e,n)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)}),rr.lazycreate=(e,n)=>new rr({shape:e,unknownKeys:"strip",catchall:es.create(),typeName:Mt.ZodObject,...Wt(n)});class nm extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a=this._def.options;function s(c){for(const h of c)if(h.result.status==="valid")return h.result;for(const h of c)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;const f=c.map(h=>new So(h.ctx.common.issues));return ot(r,{code:qe.invalid_union,unionErrors:f}),Ut}if(r.common.async)return Promise.all(a.map(async c=>{const f={...r,common:{...r.common,issues:[]},parent:null};return{result:await c._parseAsync({data:r.data,path:r.path,parent:f}),ctx:f}})).then(s);{let c;const f=[];for(const v of a){const y={...r,common:{...r.common,issues:[]},parent:null},S=v._parseSync({data:r.data,path:r.path,parent:y});if(S.status==="valid")return S;S.status==="dirty"&&!c&&(c={result:S,ctx:y}),y.common.issues.length&&f.push(y.common.issues)}if(c)return r.common.issues.push(...c.ctx.common.issues),c.result;const h=f.map(v=>new So(v));return ot(r,{code:qe.invalid_union,unionErrors:h}),Ut}}get options(){return this._def.options}}nm.create=(e,n)=>new nm({options:e,typeName:Mt.ZodUnion,...Wt(n)});const Fg=e=>e instanceof am?Fg(e.schema):e instanceof wo?Fg(e.innerType()):e instanceof om?[e.value]:e instanceof pu?e.options:e instanceof lm?Object.keys(e.enum):e instanceof sm?Fg(e._def.innerType):e instanceof em?[void 0]:e instanceof tm?[null]:null;class Ig extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.object)return ot(r,{code:qe.invalid_type,expected:rt.object,received:r.parsedType}),Ut;const a=this.discriminator,s=r.data[a],c=this.optionsMap.get(s);return c?r.common.async?c._parseAsync({data:r.data,path:r.path,parent:r}):c._parseSync({data:r.data,path:r.path,parent:r}):(ot(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,r,a){const s=new Map;for(const c of r){const f=Fg(c.shape[n]);if(!f)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const h of f){if(s.has(h))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(h)}`);s.set(h,c)}}return new Ig({typeName:Mt.ZodDiscriminatedUnion,discriminator:n,options:r,optionsMap:s,...Wt(a)})}}function nx(e,n){const r=cu(e),a=cu(n);if(e===n)return{valid:!0,data:e};if(r===rt.object&&a===rt.object){const s=hn.objectKeys(n),c=hn.objectKeys(e).filter(h=>s.indexOf(h)!==-1),f={...e,...n};for(const h of c){const v=nx(e[h],n[h]);if(!v.valid)return{valid:!1};f[h]=v.data}return{valid:!0,data:f}}else if(r===rt.array&&a===rt.array){if(e.length!==n.length)return{valid:!1};const s=[];for(let c=0;c<e.length;c++){const f=e[c],h=n[c],v=nx(f,h);if(!v.valid)return{valid:!1};s.push(v.data)}return{valid:!0,data:s}}else return r===rt.date&&a===rt.date&&+e==+n?{valid:!0,data:e}:{valid:!1}}class rm extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n),s=(c,f)=>{if(ex(c)||ex(f))return Ut;const h=nx(c.value,f.value);return h.valid?((tx(c)||tx(f))&&r.dirty(),{status:r.value,value:h.data}):(ot(a,{code:qe.invalid_intersection_types}),Ut)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,f])=>s(c,f)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}rm.create=(e,n,r)=>new rm({left:e,right:n,typeName:Mt.ZodIntersection,...Wt(r)});class al extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.array)return ot(a,{code:qe.invalid_type,expected:rt.array,received:a.parsedType}),Ut;if(a.data.length<this._def.items.length)return ot(a,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ut;!this._def.rest&&a.data.length>this._def.items.length&&(ot(a,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const c=[...a.data].map((f,h)=>{const v=this._def.items[h]||this._def.rest;return v?v._parse(new il(a,f,a.path,h)):null}).filter(f=>!!f);return a.common.async?Promise.all(c).then(f=>wi.mergeArray(r,f)):wi.mergeArray(r,c)}get items(){return this._def.items}rest(n){return new al({...this._def,rest:n})}}al.create=(e,n)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new al({items:e,typeName:Mt.ZodTuple,rest:null,...Wt(n)})};class im extends Qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.object)return ot(a,{code:qe.invalid_type,expected:rt.object,received:a.parsedType}),Ut;const s=[],c=this._def.keyType,f=this._def.valueType;for(const h in a.data)s.push({key:c._parse(new il(a,h,a.path,h)),value:f._parse(new il(a,a.data[h],a.path,h))});return a.common.async?wi.mergeObjectAsync(r,s):wi.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(n,r,a){return r instanceof Qt?new im({keyType:n,valueType:r,typeName:Mt.ZodRecord,...Wt(a)}):new im({keyType:Eo.create(),valueType:n,typeName:Mt.ZodRecord,...Wt(r)})}}class zg extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.map)return ot(a,{code:qe.invalid_type,expected:rt.map,received:a.parsedType}),Ut;const s=this._def.keyType,c=this._def.valueType,f=[...a.data.entries()].map(([h,v],y)=>({key:s._parse(new il(a,h,a.path,[y,"key"])),value:c._parse(new il(a,v,a.path,[y,"value"]))}));if(a.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const v of f){const y=await v.key,S=await v.value;if(y.status==="aborted"||S.status==="aborted")return Ut;(y.status==="dirty"||S.status==="dirty")&&r.dirty(),h.set(y.value,S.value)}return{status:r.value,value:h}})}else{const h=new Map;for(const v of f){const y=v.key,S=v.value;if(y.status==="aborted"||S.status==="aborted")return Ut;(y.status==="dirty"||S.status==="dirty")&&r.dirty(),h.set(y.value,S.value)}return{status:r.value,value:h}}}}zg.create=(e,n,r)=>new zg({valueType:n,keyType:e,typeName:Mt.ZodMap,...Wt(r)});class Nc extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.parsedType!==rt.set)return ot(a,{code:qe.invalid_type,expected:rt.set,received:a.parsedType}),Ut;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(ot(a,{code:qe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(ot(a,{code:qe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const c=this._def.valueType;function f(v){const y=new Set;for(const S of v){if(S.status==="aborted")return Ut;S.status==="dirty"&&r.dirty(),y.add(S.value)}return{status:r.value,value:y}}const h=[...a.data.values()].map((v,y)=>c._parse(new il(a,v,a.path,y)));return a.common.async?Promise.all(h).then(v=>f(v)):f(h)}min(n,r){return new Nc({...this._def,minSize:{value:n,message:Ct.toString(r)}})}max(n,r){return new Nc({...this._def,maxSize:{value:n,message:Ct.toString(r)}})}size(n,r){return this.min(n,r).max(n,r)}nonempty(n){return this.min(1,n)}}Nc.create=(e,n)=>new Nc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Wt(n)});class gd extends Qt{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.function)return ot(r,{code:qe.invalid_type,expected:rt.function,received:r.parsedType}),Ut;function a(h,v){return Ag({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dg(),Xh].filter(y=>!!y),issueData:{code:qe.invalid_arguments,argumentsError:v}})}function s(h,v){return Ag({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dg(),Xh].filter(y=>!!y),issueData:{code:qe.invalid_return_type,returnTypeError:v}})}const c={errorMap:r.common.contextualErrorMap},f=r.data;return this._def.returns instanceof yd?zi(async(...h)=>{const v=new So([]),y=await this._def.args.parseAsync(h,c).catch(C=>{throw v.addIssue(a(h,C)),v}),S=await f(...y);return await this._def.returns._def.type.parseAsync(S,c).catch(C=>{throw v.addIssue(s(S,C)),v})}):zi((...h)=>{const v=this._def.args.safeParse(h,c);if(!v.success)throw new So([a(h,v.error)]);const y=f(...v.data),S=this._def.returns.safeParse(y,c);if(!S.success)throw new So([s(y,S.error)]);return S.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new gd({...this._def,args:al.create(n).rest(Pc.create())})}returns(n){return new gd({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,r,a){return new gd({args:n||al.create([]).rest(Pc.create()),returns:r||Pc.create(),typeName:Mt.ZodFunction,...Wt(a)})}}class am extends Qt{get schema(){return this._def.getter()}_parse(n){const{ctx:r}=this._processInputParams(n);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}am.create=(e,n)=>new am({getter:e,typeName:Mt.ZodLazy,...Wt(n)});class om extends Qt{_parse(n){if(n.data!==this._def.value){const r=this._getOrReturnCtx(n);return ot(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),Ut}return{status:"valid",value:n.data}}get value(){return this._def.value}}om.create=(e,n)=>new om({value:e,typeName:Mt.ZodLiteral,...Wt(n)});function X5(e,n){return new pu({values:e,typeName:Mt.ZodEnum,...Wt(n)})}class pu extends Qt{_parse(n){if(typeof n.data!="string"){const r=this._getOrReturnCtx(n),a=this._def.values;return ot(r,{expected:hn.joinValues(a),received:r.parsedType,code:qe.invalid_type}),Ut}if(this._def.values.indexOf(n.data)===-1){const r=this._getOrReturnCtx(n),a=this._def.values;return ot(r,{received:r.data,code:qe.invalid_enum_value,options:a}),Ut}return zi(n.data)}get options(){return this._def.values}get enum(){const n={};for(const r of this._def.values)n[r]=r;return n}get Values(){const n={};for(const r of this._def.values)n[r]=r;return n}get Enum(){const n={};for(const r of this._def.values)n[r]=r;return n}extract(n){return pu.create(n)}exclude(n){return pu.create(this.options.filter(r=>!n.includes(r)))}}pu.create=X5;class lm extends Qt{_parse(n){const r=hn.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(n);if(a.parsedType!==rt.string&&a.parsedType!==rt.number){const s=hn.objectValues(r);return ot(a,{expected:hn.joinValues(s),received:a.parsedType,code:qe.invalid_type}),Ut}if(r.indexOf(n.data)===-1){const s=hn.objectValues(r);return ot(a,{received:a.data,code:qe.invalid_enum_value,options:s}),Ut}return zi(n.data)}get enum(){return this._def.values}}lm.create=(e,n)=>new lm({values:e,typeName:Mt.ZodNativeEnum,...Wt(n)});class yd extends Qt{unwrap(){return this._def.type}_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==rt.promise&&r.common.async===!1)return ot(r,{code:qe.invalid_type,expected:rt.promise,received:r.parsedType}),Ut;const a=r.parsedType===rt.promise?r.data:Promise.resolve(r.data);return zi(a.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}yd.create=(e,n)=>new yd({type:e,typeName:Mt.ZodPromise,...Wt(n)});class wo extends Qt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:r,ctx:a}=this._processInputParams(n),s=this._def.effect||null;if(s.type==="preprocess"){const f=s.transform(a.data);return a.common.async?Promise.resolve(f).then(h=>this._def.schema._parseAsync({data:h,path:a.path,parent:a})):this._def.schema._parseSync({data:f,path:a.path,parent:a})}const c={addIssue:f=>{ot(a,f),f.fatal?r.abort():r.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),s.type==="refinement"){const f=h=>{const v=s.refinement(h,c);if(a.common.async)return Promise.resolve(v);if(v instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(a.common.async===!1){const h=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?Ut:(h.status==="dirty"&&r.dirty(),f(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(h=>h.status==="aborted"?Ut:(h.status==="dirty"&&r.dirty(),f(h.value).then(()=>({status:r.value,value:h.value}))))}if(s.type==="transform")if(a.common.async===!1){const f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Mg(f))return f;const h=s.transform(f.value,c);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>Mg(f)?Promise.resolve(s.transform(f.value,c)).then(h=>({status:r.value,value:h})):f);hn.assertNever(s)}}wo.create=(e,n,r)=>new wo({schema:e,typeName:Mt.ZodEffects,effect:n,...Wt(r)}),wo.createWithPreprocess=(e,n,r)=>new wo({schema:n,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Wt(r)});class ts extends Qt{_parse(n){return this._getType(n)===rt.undefined?zi(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ts.create=(e,n)=>new ts({innerType:e,typeName:Mt.ZodOptional,...Wt(n)});class Fc extends Qt{_parse(n){return this._getType(n)===rt.null?zi(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Fc.create=(e,n)=>new Fc({innerType:e,typeName:Mt.ZodNullable,...Wt(n)});class sm extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n);let a=r.data;return r.parsedType===rt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}sm.create=(e,n)=>new sm({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Wt(n)});class jg extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Lg(s)?s.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new So(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new So(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}jg.create=(e,n)=>new jg({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Wt(n)});class $g extends Qt{_parse(n){if(this._getType(n)!==rt.nan){const a=this._getOrReturnCtx(n);return ot(a,{code:qe.invalid_type,expected:rt.nan,received:a.parsedType}),Ut}return{status:"valid",value:n.data}}}$g.create=e=>new $g({typeName:Mt.ZodNaN,...Wt(e)});const gI=Symbol("zod_brand");class J5 extends Qt{_parse(n){const{ctx:r}=this._processInputParams(n),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}}class um extends Qt{_parse(n){const{status:r,ctx:a}=this._processInputParams(n);if(a.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?Ut:c.status==="dirty"?(r.dirty(),G5(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?Ut:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(n,r){return new um({in:n,out:r,typeName:Mt.ZodPipeline})}}const e3=(e,n={},r)=>e?md.create().superRefine((a,s)=>{var c,f;if(!e(a)){const h=typeof n=="function"?n(a):typeof n=="string"?{message:n}:n,v=(f=(c=h.fatal)!==null&&c!==void 0?c:r)!==null&&f!==void 0?f:!0,y=typeof h=="string"?{message:h}:h;s.addIssue({code:"custom",...y,fatal:v})}}):md.create(),yI={object:rr.lazycreate};var Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(Mt||(Mt={}));const bI=(e,n={message:`Input not instance of ${e.name}`})=>e3(r=>r instanceof e,n),t3=Eo.create,n3=fu.create,SI=$g.create,EI=du.create,r3=Jh.create,xI=Lc.create,wI=Pg.create,CI=em.create,kI=tm.create,_I=md.create,TI=Pc.create,RI=es.create,OI=Ng.create,DI=xo.create,AI=rr.create,MI=rr.strictCreate,LI=nm.create,PI=Ig.create,NI=rm.create,FI=al.create,II=im.create,zI=zg.create,jI=Nc.create,$I=gd.create,UI=am.create,BI=om.create,VI=pu.create,HI=lm.create,qI=yd.create,i3=wo.create,WI=ts.create,YI=Fc.create,ZI=wo.createWithPreprocess,KI=um.create;var lt=Object.freeze({__proto__:null,defaultErrorMap:Xh,setErrorMap:iI,getErrorMap:Dg,makeIssue:Ag,EMPTY_PATH:aI,addIssueToContext:ot,ParseStatus:wi,INVALID:Ut,DIRTY:G5,OK:zi,isAborted:ex,isDirty:tx,isValid:Mg,isAsync:Lg,get util(){return hn},get objectUtil(){return JE},ZodParsedType:rt,getParsedType:cu,ZodType:Qt,ZodString:Eo,ZodNumber:fu,ZodBigInt:du,ZodBoolean:Jh,ZodDate:Lc,ZodSymbol:Pg,ZodUndefined:em,ZodNull:tm,ZodAny:md,ZodUnknown:Pc,ZodNever:es,ZodVoid:Ng,ZodArray:xo,ZodObject:rr,ZodUnion:nm,ZodDiscriminatedUnion:Ig,ZodIntersection:rm,ZodTuple:al,ZodRecord:im,ZodMap:zg,ZodSet:Nc,ZodFunction:gd,ZodLazy:am,ZodLiteral:om,ZodEnum:pu,ZodNativeEnum:lm,ZodPromise:yd,ZodEffects:wo,ZodTransformer:wo,ZodOptional:ts,ZodNullable:Fc,ZodDefault:sm,ZodCatch:jg,ZodNaN:$g,BRAND:gI,ZodBranded:J5,ZodPipeline:um,custom:e3,Schema:Qt,ZodSchema:Qt,late:yI,get ZodFirstPartyTypeKind(){return Mt},coerce:{string:e=>Eo.create({...e,coerce:!0}),number:e=>fu.create({...e,coerce:!0}),boolean:e=>Jh.create({...e,coerce:!0}),bigint:e=>du.create({...e,coerce:!0}),date:e=>Lc.create({...e,coerce:!0})},any:_I,array:DI,bigint:EI,boolean:r3,date:xI,discriminatedUnion:PI,effect:i3,enum:VI,function:$I,instanceof:bI,intersection:NI,lazy:UI,literal:BI,map:zI,nan:SI,nativeEnum:HI,never:RI,null:kI,nullable:YI,number:n3,object:AI,oboolean:()=>r3().optional(),onumber:()=>n3().optional(),optional:WI,ostring:()=>t3().optional(),pipeline:KI,preprocess:ZI,promise:qI,record:II,set:jI,strictObject:MI,string:t3,symbol:wI,transformer:i3,tuple:FI,undefined:CI,union:LI,unknown:TI,void:OI,NEVER:Ut,ZodIssueCode:qe,quotelessJson:rI,ZodError:So});const GI=lt.object({type:lt.literal("audio"),audio:lt.string(),title:lt.string().optional()}).transform(({type:e,audio:n})=>({type:e,url:n}));function Ug(e){return{block:e,type:"bubble"}}const QI=lt.object({title:lt.string(),action:lt.literal("Say something"),text:lt.string()}).transform(({title:e,text:n})=>({type:"button",variant:"action",text:e,buttonValue:n,reusable:!0})),XI=lt.object({title:lt.string(),action:lt.literal("Open URL"),url:lt.string()}).transform(({title:e,url:n})=>({type:"button",variant:"link",text:e,buttonValue:n,reusable:!0})),JI=lt.object({title:lt.string(),action:lt.literal("Postback"),payload:lt.string()}).transform(({title:e,payload:n})=>({type:"button",variant:"action",text:e,buttonValue:n,reusable:!0})),ez=lt.union([QI,XI,JI]),a3=lt.object({type:lt.literal("card"),title:lt.string().optional(),subtitle:lt.string().optional(),image:lt.string().optional(),actions:lt.array(ez)}),o3=({title:e,image:n,actions:r,subtitle:a})=>{const s=[];return n&&s.push({type:"image",url:n}),e&&s.push({type:"text",text:`## ${e}`}),a&&s.push({type:"text",text:a}),r.length>0&&s.push({type:"row",blocks:r}),{type:"column",horizontalAlignment:"center",blocks:[...s]}},tz=a3.transform(e=>Ug(o3(e))),nz=lt.object({type:lt.literal("carousel"),items:lt.array(a3.omit({type:!0}).transform(o3))}).transform(({items:e})=>({type:"carousel",blocks:e}));let Bg;const rz=new Uint8Array(16);function iz(){if(!Bg&&(Bg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bg(rz)}const si=[];for(let e=0;e<256;++e)si.push((e+256).toString(16).slice(1));function az(e,n=0){return(si[e[n+0]]+si[e[n+1]]+si[e[n+2]]+si[e[n+3]]+"-"+si[e[n+4]]+si[e[n+5]]+"-"+si[e[n+6]]+si[e[n+7]]+"-"+si[e[n+8]]+si[e[n+9]]+"-"+si[e[n+10]]+si[e[n+11]]+si[e[n+12]]+si[e[n+13]]+si[e[n+14]]+si[e[n+15]]).toLowerCase()}const l3={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oz(e,n,r){if(l3.randomUUID&&!n&&!e)return l3.randomUUID();e=e||{};const a=e.random||(e.rng||iz)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){r=r||0;for(let s=0;s<16;++s)n[r+s]=a[s];return n}return az(a)}const lz=lt.object({type:lt.literal("single-choice"),text:lt.string(),choices:lt.array(lt.object({title:lt.string(),value:lt.string()}))}).transform(({choices:e,text:n})=>{const r=oz(),a=[{type:"row",blocks:e.map(({title:s,value:c})=>({type:"button",variant:"action",text:s,buttonValue:c,groupId:r}))}];return n&&a.unshift({type:"text",text:n}),Ug({type:"column",blocks:a})}),sz=lt.object({type:lt.literal("file"),file:lt.string(),title:lt.string().optional()}).transform(({file:e,...n})=>({url:e,...n})),uz=lt.object({type:lt.literal("image"),image:lt.string(),title:lt.string().optional()}).transform(({type:e,image:n})=>({type:e,url:n})),cz=lt.object({type:lt.literal("location"),latitude:lt.number(),longitude:lt.number(),address:lt.string().optional(),title:lt.string().optional()}).transform(({type:e,latitude:n,longitude:r,title:a,address:s})=>({type:e,latitude:n,longitude:r,title:a??s??"View on map"})),fz=lt.object({type:lt.literal("text"),text:lt.string(),markdown:lt.boolean().optional()}).transform(({type:e,text:n})=>Ug({type:e,text:n})),dz=lt.object({type:lt.literal("video"),video:lt.string(),title:lt.string().optional()}).transform(({type:e,video:n})=>({type:e,url:n})),pz=lt.object({type:lt.literal("voice"),audio:lt.string()}).transform(({audio:e})=>({type:"audio",url:e})),hz=lt.object({type:lt.literal("dropdown"),text:lt.string().optional(),message:lt.string().optional(),options:lt.array(lt.object({label:lt.string(),value:lt.string()}))}).transform(({options:e,text:n})=>{const r=[{type:"dropdown",label:n??"Select an option",options:e}];return n&&r.unshift({type:"text",text:n}),Ug({type:"column",blocks:r})}),s3=lt.union([fz,uz,GI,dz,nz,tz,cz,sz,pz,lz,hz]);var u3={},rx={},c3={};Object.defineProperty(c3,"__esModule",{value:!0});var Vg={},mz=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.Emitter=void 0;let vz=class{constructor(){this.listeners={}}on(n,r,a=!1){const s=this.listeners[n];s?a?s.unshift(r):s.push(r):this.listeners[n]=[r]}emit(n,r){return mz(this,void 0,void 0,function*(){const a=this.listeners[n];if(a!=null&&a.length){for(const s of a)yield s(r);return!0}else return!1})}};Vg.Emitter=vz;var f3={};Object.defineProperty(f3,"__esModule",{value:!0});var d3={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(n){n.Create="create",n.Configure="configure",n.Start="start",n.StartFailure="start-failure",n.Initialize="initialize",n.InitializeFailure="initialize-failure",n.Sleep="sleep",n.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(d3);var p3={};Object.defineProperty(p3,"__esModule",{value:!0});var h3={};Object.defineProperty(h3,"__esModule",{value:!0});var m3={};Object.defineProperty(m3,"__esModule",{value:!0});var v3={};Object.defineProperty(v3,"__esModule",{value:!0}),function(e){var n=Ht&&Ht.__createBinding||(Object.create?function(a,s,c,f){f===void 0&&(f=c),Object.defineProperty(a,f,{enumerable:!0,get:function(){return s[c]}})}:function(a,s,c,f){f===void 0&&(f=c),a[f]=s[c]}),r=Ht&&Ht.__exportStar||function(a,s){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(s,c)&&n(s,a,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(c3,e),r(Vg,e),r(f3,e),r(d3,e),r(p3,e),r(h3,e),r(m3,e),r(v3,e)}(rx);var Hg={},g3={},ix={exports:{}},qg={},ax={},Wg={},cm={},bd={},Ic={},Sd={},Ed={},ol={};Object.defineProperty(ol,"__esModule",{value:!0}),ol.ERROR_PACKET=ol.PACKET_TYPES_REVERSE=ol.PACKET_TYPES=void 0;const ll=Object.create(null);ol.PACKET_TYPES=ll,ll.open="0",ll.close="1",ll.ping="2",ll.pong="3",ll.message="4",ll.upgrade="5",ll.noop="6";const y3=Object.create(null);ol.PACKET_TYPES_REVERSE=y3,Object.keys(ll).forEach(e=>{y3[ll[e]]=e});const gz={type:"error",data:"parser error"};ol.ERROR_PACKET=gz,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.encodePacket=Ed.encodePacketToBinary=void 0;const yz=ol,b3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",S3=typeof ArrayBuffer=="function",E3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,x3=({type:e,data:n},r,a)=>b3&&n instanceof Blob?r?a(n):w3(n,a):S3&&(n instanceof ArrayBuffer||E3(n))?r?a(n):w3(new Blob([n]),a):a(yz.PACKET_TYPES[e]+(n||""));Ed.encodePacket=x3;const w3=(e,n)=>{const r=new FileReader;return r.onload=function(){const a=r.result.split(",")[1];n("b"+(a||""))},r.readAsDataURL(e)};function C3(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ox;function bz(e,n){if(b3&&e.data instanceof Blob)return e.data.arrayBuffer().then(C3).then(n);if(S3&&(e.data instanceof ArrayBuffer||E3(e.data)))return n(C3(e.data));x3(e,!1,r=>{ox||(ox=new TextEncoder),n(ox.encode(r))})}Ed.encodePacketToBinary=bz;var Yg={},xd={};Object.defineProperty(xd,"__esModule",{value:!0}),xd.decode=xd.encode=void 0;const wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wd.length;e++)fm[wd.charCodeAt(e)]=e;const Sz=e=>{let n=new Uint8Array(e),r,a=n.length,s="";for(r=0;r<a;r+=3)s+=wd[n[r]>>2],s+=wd[(n[r]&3)<<4|n[r+1]>>4],s+=wd[(n[r+1]&15)<<2|n[r+2]>>6],s+=wd[n[r+2]&63];return a%3===2?s=s.substring(0,s.length-1)+"=":a%3===1&&(s=s.substring(0,s.length-2)+"=="),s};xd.encode=Sz;const Ez=e=>{let n=e.length*.75,r=e.length,a,s=0,c,f,h,v;e[e.length-1]==="="&&(n--,e[e.length-2]==="="&&n--);const y=new ArrayBuffer(n),S=new Uint8Array(y);for(a=0;a<r;a+=4)c=fm[e.charCodeAt(a)],f=fm[e.charCodeAt(a+1)],h=fm[e.charCodeAt(a+2)],v=fm[e.charCodeAt(a+3)],S[s++]=c<<2|f>>4,S[s++]=(f&15)<<4|h>>2,S[s++]=(h&3)<<6|v&63;return y};xd.decode=Ez,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.decodePacket=void 0;const Zg=ol,xz=xd,wz=typeof ArrayBuffer=="function",Cz=(e,n)=>{if(typeof e!="string")return{type:"message",data:k3(e,n)};const r=e.charAt(0);return r==="b"?{type:"message",data:kz(e.substring(1),n)}:Zg.PACKET_TYPES_REVERSE[r]?e.length>1?{type:Zg.PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:Zg.PACKET_TYPES_REVERSE[r]}:Zg.ERROR_PACKET};Yg.decodePacket=Cz;const kz=(e,n)=>{if(wz){const r=(0,xz.decode)(e);return k3(r,n)}else return{base64:!0,data:e}},k3=(e,n)=>{switch(n){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const n=Ed;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return n.encodePacket}});const r=Yg;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return r.decodePacket}});const a=ol,s=String.fromCharCode(30),c=(C,x)=>{const R=C.length,T=new Array(R);let D=0;C.forEach((M,I)=>{(0,n.encodePacket)(M,!1,N=>{T[I]=N,++D===R&&x(T.join(s))})})};e.encodePayload=c;const f=(C,x)=>{const R=C.split(s),T=[];for(let D=0;D<R.length;D++){const M=(0,r.decodePacket)(R[D],x);if(T.push(M),M.type==="error")break}return T};e.decodePayload=f;function h(){return new TransformStream({transform(C,x){(0,n.encodePacketToBinary)(C,R=>{const T=R.length;let D;if(T<126)D=new Uint8Array(1),new DataView(D.buffer).setUint8(0,T);else if(T<65536){D=new Uint8Array(3);const M=new DataView(D.buffer);M.setUint8(0,126),M.setUint16(1,T)}else{D=new Uint8Array(9);const M=new DataView(D.buffer);M.setUint8(0,127),M.setBigUint64(1,BigInt(T))}C.data&&typeof C.data!="string"&&(D[0]|=128),x.enqueue(D),x.enqueue(R)})}})}e.createPacketEncoderStream=h;let v;function y(C){return C.reduce((x,R)=>x+R.length,0)}function S(C,x){if(C[0].length===x)return C.shift();const R=new Uint8Array(x);let T=0;for(let D=0;D<x;D++)R[D]=C[0][T++],T===C[0].length&&(C.shift(),T=0);return C.length&&T<C[0].length&&(C[0]=C[0].slice(T)),R}function E(C,x){v||(v=new TextDecoder);const R=[];let T=0,D=-1,M=!1;return new TransformStream({transform(I,N){for(R.push(I);;){if(T===0){if(y(R)<1)break;const B=S(R,1);M=(B[0]&128)===128,D=B[0]&127,D<126?T=3:D===126?T=1:T=2}else if(T===1){if(y(R)<2)break;const B=S(R,2);D=new DataView(B.buffer,B.byteOffset,B.length).getUint16(0),T=3}else if(T===2){if(y(R)<8)break;const B=S(R,8),F=new DataView(B.buffer,B.byteOffset,B.length),$=F.getUint32(0);if($>Math.pow(2,53-32)-1){N.enqueue(a.ERROR_PACKET);break}D=$*Math.pow(2,32)+F.getUint32(4),T=3}else{if(y(R)<D)break;const B=S(R,D);N.enqueue((0,r.decodePacket)(M?B:v.decode(B),x)),T=0}if(D===0||D>C){N.enqueue(a.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=E,e.protocol=4})(Sd);function ji(e){if(e)return _z(e)}function _z(e){for(var n in ji.prototype)e[n]=ji.prototype[n];return e}ji.prototype.on=ji.prototype.addEventListener=function(e,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(n),this},ji.prototype.once=function(e,n){function r(){this.off(e,r),n.apply(this,arguments)}return r.fn=n,this.on(e,r),this},ji.prototype.off=ji.prototype.removeListener=ji.prototype.removeAllListeners=ji.prototype.removeEventListener=function(e,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var a,s=0;s<r.length;s++)if(a=r[s],a===n||a.fn===n){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+e],this},ji.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),r=this._callbacks["$"+e],a=1;a<arguments.length;a++)n[a-1]=arguments[a];if(r){r=r.slice(0);for(var a=0,s=r.length;a<s;++a)r[a].apply(this,n)}return this},ji.prototype.emitReserved=ji.prototype.emit,ji.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ji.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Cd=o6(Object.freeze(Object.defineProperty({__proto__:null,Emitter:ji},Symbol.toStringTag,{value:"Module"})));var to={},zc={};Object.defineProperty(zc,"__esModule",{value:!0}),zc.globalThisShim=void 0,zc.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(to,"__esModule",{value:!0}),to.byteLength=to.installTimerFunctions=to.pick=void 0;const hu=zc;function Tz(e,...n){return n.reduce((r,a)=>(e.hasOwnProperty(a)&&(r[a]=e[a]),r),{})}to.pick=Tz;const Rz=hu.globalThisShim.setTimeout,Oz=hu.globalThisShim.clearTimeout;function Dz(e,n){n.useNativeTimers?(e.setTimeoutFn=Rz.bind(hu.globalThisShim),e.clearTimeoutFn=Oz.bind(hu.globalThisShim)):(e.setTimeoutFn=hu.globalThisShim.setTimeout.bind(hu.globalThisShim),e.clearTimeoutFn=hu.globalThisShim.clearTimeout.bind(hu.globalThisShim))}to.installTimerFunctions=Dz;const Az=1.33;function Mz(e){return typeof e=="string"?Lz(e):Math.ceil((e.byteLength||e.size)*Az)}to.byteLength=Mz;function Lz(e){let n=0,r=0;for(let a=0,s=e.length;a<s;a++)n=e.charCodeAt(a),n<128?r+=1:n<2048?r+=2:n<55296||n>=57344?r+=3:(a++,r+=4);return r}var lx={exports:{}},sx,_3;function Pz(){if(_3)return sx;_3=1;var e=1e3,n=e*60,r=n*60,a=r*24,s=a*7,c=a*365.25;sx=function(S,E){E=E||{};var C=typeof S;if(C==="string"&&S.length>0)return f(S);if(C==="number"&&isFinite(S))return E.long?v(S):h(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function f(S){if(S=String(S),!(S.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(S);if(E){var C=parseFloat(E[1]),x=(E[2]||"ms").toLowerCase();switch(x){case"years":case"year":case"yrs":case"yr":case"y":return C*c;case"weeks":case"week":case"w":return C*s;case"days":case"day":case"d":return C*a;case"hours":case"hour":case"hrs":case"hr":case"h":return C*r;case"minutes":case"minute":case"mins":case"min":case"m":return C*n;case"seconds":case"second":case"secs":case"sec":case"s":return C*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return C;default:return}}}}function h(S){var E=Math.abs(S);return E>=a?Math.round(S/a)+"d":E>=r?Math.round(S/r)+"h":E>=n?Math.round(S/n)+"m":E>=e?Math.round(S/e)+"s":S+"ms"}function v(S){var E=Math.abs(S);return E>=a?y(S,E,a,"day"):E>=r?y(S,E,r,"hour"):E>=n?y(S,E,n,"minute"):E>=e?y(S,E,e,"second"):S+" ms"}function y(S,E,C,x){var R=E>=C*1.5;return Math.round(S/C)+" "+x+(R?"s":"")}return sx}function Nz(e){r.debug=r,r.default=r,r.coerce=v,r.disable=c,r.enable=s,r.enabled=f,r.humanize=Pz(),r.destroy=y,Object.keys(e).forEach(S=>{r[S]=e[S]}),r.names=[],r.skips=[],r.formatters={};function n(S){let E=0;for(let C=0;C<S.length;C++)E=(E<<5)-E+S.charCodeAt(C),E|=0;return r.colors[Math.abs(E)%r.colors.length]}r.selectColor=n;function r(S){let E,C=null,x,R;function T(...D){if(!T.enabled)return;const M=T,I=Number(new Date),N=I-(E||I);M.diff=N,M.prev=E,M.curr=I,E=I,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let B=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,($,H)=>{if($==="%%")return"%";B++;const Y=r.formatters[H];if(typeof Y=="function"){const ne=D[B];$=Y.call(M,ne),D.splice(B,1),B--}return $}),r.formatArgs.call(M,D),(M.log||r.log).apply(M,D)}return T.namespace=S,T.useColors=r.useColors(),T.color=r.selectColor(S),T.extend=a,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(x!==r.namespaces&&(x=r.namespaces,R=r.enabled(S)),R),set:D=>{C=D}}),typeof r.init=="function"&&r.init(T),T}function a(S,E){const C=r(this.namespace+(typeof E>"u"?":":E)+S);return C.log=this.log,C}function s(S){r.save(S),r.namespaces=S,r.names=[],r.skips=[];let E;const C=(typeof S=="string"?S:"").split(/[\s,]+/),x=C.length;for(E=0;E<x;E++)C[E]&&(S=C[E].replace(/\*/g,".*?"),S[0]==="-"?r.skips.push(new RegExp("^"+S.slice(1)+"$")):r.names.push(new RegExp("^"+S+"$")))}function c(){const S=[...r.names.map(h),...r.skips.map(h).map(E=>"-"+E)].join(",");return r.enable(""),S}function f(S){if(S[S.length-1]==="*")return!0;let E,C;for(E=0,C=r.skips.length;E<C;E++)if(r.skips[E].test(S))return!1;for(E=0,C=r.names.length;E<C;E++)if(r.names[E].test(S))return!0;return!1}function h(S){return S.toString().substring(2,S.toString().length-2).replace(/\.\*\?$/,"*")}function v(S){return S instanceof Error?S.stack||S.message:S}function y(){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 r.enable(r.load()),r}var Fz=Nz;(function(e,n){n.formatArgs=a,n.save=s,n.load=c,n.useColors=r,n.storage=f(),n.destroy=(()=>{let v=!1;return()=>{v||(v=!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`."))}})(),n.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 r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(v){if(v[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+v[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const y="color: "+this.color;v.splice(1,0,y,"color: inherit");let S=0,E=0;v[0].replace(/%[a-zA-Z%]/g,C=>{C!=="%%"&&(S++,C==="%c"&&(E=S))}),v.splice(E,0,y)}n.log=console.debug||console.log||(()=>{});function s(v){try{v?n.storage.setItem("debug",v):n.storage.removeItem("debug")}catch{}}function c(){let v;try{v=n.storage.getItem("debug")}catch{}return!v&&typeof process<"u"&&"env"in process&&(v=process.env.DEBUG),v}function f(){try{return localStorage}catch{}}e.exports=Fz(n);const{formatters:h}=e.exports;h.j=function(v){try{return JSON.stringify(v)}catch(y){return"[UnexpectedJSONParseError]: "+y.message}}})(lx,lx.exports);var sl=lx.exports,jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.decode=jc.encode=void 0;function Iz(e){let n="";for(let r in e)e.hasOwnProperty(r)&&(n.length&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return n}jc.encode=Iz;function zz(e){let n={},r=e.split("&");for(let a=0,s=r.length;a<s;a++){let c=r[a].split("=");n[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return n}jc.decode=zz;var jz=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.Transport=void 0;const $z=Sd,Uz=Cd,Bz=to,Vz=jz(sl),Hz=jc,qz=(0,Vz.default)("engine.io-client:transport");class Wz extends Error{constructor(n,r,a){super(n),this.description=r,this.context=a,this.type="TransportError"}}class Yz extends Uz.Emitter{constructor(n){super(),this.writable=!1,(0,Bz.installTimerFunctions)(this,n),this.opts=n,this.query=n.query,this.socket=n.socket}onError(n,r,a){return super.emitReserved("error",new Wz(n,r,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"?this.write(n):qz("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const r=(0,$z.decodePacket)(n,this.socket.binaryType);this.onPacket(r)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,r={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const r=(0,Hz.encode)(n);return r.length?"?"+r:""}}Ic.Transport=Yz;var ns={};Object.defineProperty(ns,"__esModule",{value:!0}),ns.yeast=ns.decode=ns.encode=void 0;const T3="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Kg=64,R3={};let O3=0,mu=0,D3;function ux(e){let n="";do n=T3[e%Kg]+n,e=Math.floor(e/Kg);while(e>0);return n}ns.encode=ux;function Zz(e){let n=0;for(mu=0;mu<e.length;mu++)n=n*Kg+R3[e.charAt(mu)];return n}ns.decode=Zz;function Kz(){const e=ux(+new Date);return e!==D3?(O3=0,D3=e):e+"."+ux(O3++)}for(ns.yeast=Kz;mu<Kg;mu++)R3[T3[mu]]=mu;var kd={},Gg={};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.hasCORS=void 0;let A3=!1;try{A3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Gg.hasCORS=A3,Object.defineProperty(kd,"__esModule",{value:!0}),kd.createCookieJar=kd.XHR=void 0;const Gz=Gg,Qz=zc;function Xz(e){const n=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||Gz.hasCORS))return new XMLHttpRequest}catch{}if(!n)try{return new Qz.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}kd.XHR=Xz;function Jz(){}kd.createCookieJar=Jz;var ej=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bd,"__esModule",{value:!0}),bd.Request=bd.Polling=void 0;const tj=Ic,nj=ej(sl),rj=ns,M3=Sd,cx=kd,ij=Cd,L3=to,aj=zc,sa=(0,nj.default)("engine.io-client:polling");function oj(){}const lj=function(){return new cx.XHR({xdomain:!1}).responseType!=null}();class sj extends tj.Transport{constructor(n){if(super(n),this.polling=!1,typeof location<"u"){const a=location.protocol==="https:";let s=location.port;s||(s=a?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||s!==n.port}const r=n&&n.forceBase64;this.supportsBinary=lj&&!r,this.opts.withCredentials&&(this.cookieJar=(0,cx.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(n){this.readyState="pausing";const r=()=>{sa("paused"),this.readyState="paused",n()};if(this.polling||!this.writable){let a=0;this.polling&&(sa("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){sa("pre-pause polling complete"),--a||r()})),this.writable||(sa("we are currently writing - waiting to pause"),a++,this.once("drain",function(){sa("pre-pause writing complete"),--a||r()}))}else r()}poll(){sa("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){sa("polling got data %s",n);const r=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};(0,M3.decodePayload)(n,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():sa('ignoring poll - transport state "%s"',this.readyState))}doClose(){const n=()=>{sa("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(sa("transport open - closing"),n()):(sa("transport not open - deferring close"),this.once("open",n))}write(n){this.writable=!1,(0,M3.encodePayload)(n,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=(0,rj.yeast)()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(n,r)}request(n={}){return Object.assign(n,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Co(this.uri(),n)}doWrite(n,r){const a=this.request({method:"POST",data:n});a.on("success",r),a.on("error",(s,c)=>{this.onError("xhr post error",s,c)})}doPoll(){sa("xhr poll");const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(r,a)=>{this.onError("xhr poll error",r,a)}),this.pollXhr=n}}bd.Polling=sj;class Co extends ij.Emitter{constructor(n,r){super(),(0,L3.installTimerFunctions)(this,r),this.opts=r,this.method=r.method||"GET",this.uri=n,this.data=r.data!==void 0?r.data:null,this.create()}create(){var n;const r=(0,L3.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.opts.xd;const a=this.xhr=new cx.XHR(r);try{sa("xhr open %s: %s",this.method,this.uri),a.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(n=this.opts.cookieJar)===null||n===void 0||n.addCookies(a),"withCredentials"in a&&(a.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(a.timeout=this.opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(a)),a.readyState===4&&(a.status===200||a.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof a.status=="number"?a.status:0)},0))},sa("xhr data %s",this.data),a.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=Co.requestsCount++,Co.requests[this.index]=this)}onError(n){this.emitReserved("error",n,this.xhr),this.cleanup(!0)}cleanup(n){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=oj,n)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Co.requests[this.index],this.xhr=null}}onLoad(){const n=this.xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(bd.Request=Co,Co.requestsCount=0,Co.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",P3);else if(typeof addEventListener=="function"){const e="onpagehide"in aj.globalThisShim?"pagehide":"unload";addEventListener(e,P3,!1)}}function P3(){for(let e in Co.requests)Co.requests.hasOwnProperty(e)&&Co.requests[e].abort()}var Qg={},Na={};Object.defineProperty(Na,"__esModule",{value:!0}),Na.defaultBinaryType=Na.usingBrowserWebSocket=Na.WebSocket=Na.nextTick=void 0;const N3=zc;Na.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0))(),Na.WebSocket=N3.globalThisShim.WebSocket||N3.globalThisShim.MozWebSocket,Na.usingBrowserWebSocket=!0,Na.defaultBinaryType="arraybuffer";var uj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.WS=void 0;const cj=Ic,fj=ns,dj=to,vu=Na,pj=uj(sl),hj=Sd,mj=(0,pj.default)("engine.io-client:websocket"),F3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vj extends cj.Transport{constructor(n){super(n),this.supportsBinary=!n.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const n=this.uri(),r=this.opts.protocols,a=F3?{}:(0,dj.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=vu.usingBrowserWebSocket&&!F3?r?new vu.WebSocket(n,r):new vu.WebSocket(n):new vu.WebSocket(n,r,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const a=n[r],s=r===n.length-1;(0,hj.encodePacket)(a,this.supportsBinary,c=>{const f={};vu.usingBrowserWebSocket||(a.options&&(f.compress=a.options.compress),this.opts.perMessageDeflate&&(typeof c=="string"?Buffer.byteLength(c):c.length)<this.opts.perMessageDeflate.threshold&&(f.compress=!1));try{vu.usingBrowserWebSocket?this.ws.send(c):this.ws.send(c,f)}catch{mj("websocket closed before onclose event")}s&&(0,vu.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=(0,fj.yeast)()),this.supportsBinary||(r.b64=1),this.createUri(n,r)}check(){return!!vu.WebSocket}}Qg.WS=vj;var Xg={},gj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.WT=void 0;const yj=Ic,bj=Na,I3=Sd,dm=(0,gj(sl).default)("engine.io-client:webtransport");class Sj extends yj.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{dm("transport closed gracefully"),this.onClose()}).catch(n=>{dm("transport closed due to %s",n),this.onError("webtransport error",n)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(n=>{const r=(0,I3.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=n.readable.pipeThrough(r).getReader(),s=(0,I3.createPacketEncoderStream)();s.readable.pipeTo(n.writable),this.writer=s.writable.getWriter();const c=()=>{a.read().then(({done:h,value:v})=>{if(h){dm("session is closed");return}dm("received chunk: %o",v),this.onPacket(v),c()}).catch(h=>{dm("an error occurred while reading: %s",h)})};c();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this.writer.write(f).then(()=>this.onOpen())})}))}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const a=n[r],s=r===n.length-1;this.writer.write(a).then(()=>{s&&(0,bj.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this.transport)===null||n===void 0||n.close()}}Xg.WT=Sj,Object.defineProperty(cm,"__esModule",{value:!0}),cm.transports=void 0;const Ej=bd,xj=Qg,wj=Xg;cm.transports={websocket:xj.WS,webtransport:wj.WT,polling:Ej.Polling};var pm={};Object.defineProperty(pm,"__esModule",{value:!0}),pm.parse=void 0;const Cj=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _j(e){const n=e,r=e.indexOf("["),a=e.indexOf("]");r!=-1&&a!=-1&&(e=e.substring(0,r)+e.substring(r,a).replace(/:/g,";")+e.substring(a,e.length));let s=Cj.exec(e||""),c={},f=14;for(;f--;)c[kj[f]]=s[f]||"";return r!=-1&&a!=-1&&(c.source=n,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Tj(c,c.path),c.queryKey=Rj(c,c.query),c}pm.parse=_j;function Tj(e,n){const r=/\/{2,9}/g,a=n.replace(r,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&a.splice(0,1),n.slice(-1)=="/"&&a.splice(a.length-1,1),a}function Rj(e,n){const r={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,c){s&&(r[s]=c)}),r}var Oj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Socket=void 0;const Dj=cm,z3=to,Aj=jc,j3=pm,Mj=Oj(sl),Lj=Cd,$3=Sd,Pj=Na,ir=(0,Mj.default)("engine.io-client:socket");let U3=class kh extends Lj.Emitter{constructor(n,r={}){super(),this.binaryType=Pj.defaultBinaryType,this.writeBuffer=[],n&&typeof n=="object"&&(r=n,n=null),n?(n=(0,j3.parse)(n),r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)):r.host&&(r.hostname=(0,j3.parse)(r.host).host),(0,z3.installTimerFunctions)(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,Aj.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(n){ir('creating transport "%s"',n);const r=Object.assign({},this.opts.query);r.EIO=$3.protocol,r.transport=n,this.id&&(r.sid=this.id);const a=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return ir("options: %j",a),new Dj.transports[n](a)}open(){let n;if(this.opts.rememberUpgrade&&kh.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)n="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else n=this.transports[0];this.readyState="opening";try{n=this.createTransport(n)}catch(r){ir("error while creating transport: %s",r),this.transports.shift(),this.open();return}n.open(),this.setTransport(n)}setTransport(n){ir("setting transport %s",n.name),this.transport&&(ir("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=n,n.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",r=>this.onClose("transport close",r))}probe(n){ir('probing transport "%s"',n);let r=this.createTransport(n),a=!1;kh.priorWebsocketSuccess=!1;const s=()=>{a||(ir('probe transport "%s" opened',n),r.send([{type:"ping",data:"probe"}]),r.once("packet",E=>{if(!a)if(E.type==="pong"&&E.data==="probe"){if(ir('probe transport "%s" pong',n),this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;kh.priorWebsocketSuccess=r.name==="websocket",ir('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{a||this.readyState!=="closed"&&(ir("changing transport and sending upgrade packet"),S(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{ir('probe transport "%s" failed',n);const C=new Error("probe error");C.transport=r.name,this.emitReserved("upgradeError",C)}}))};function c(){a||(a=!0,S(),r.close(),r=null)}const f=E=>{const C=new Error("probe error: "+E);C.transport=r.name,c(),ir('probe transport "%s" failed because of error: %s',n,E),this.emitReserved("upgradeError",C)};function h(){f("transport closed")}function v(){f("socket closed")}function y(E){r&&E.name!==r.name&&(ir('"%s" works - aborting "%s"',E.name,r.name),c())}const S=()=>{r.removeListener("open",s),r.removeListener("error",f),r.removeListener("close",h),this.off("close",v),this.off("upgrading",y)};r.once("open",s),r.once("error",f),r.once("close",h),this.once("close",v),this.once("upgrading",y),this.upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{a||r.open()},200):r.open()}onOpen(){if(ir("socket open"),this.readyState="open",kh.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){ir("starting upgrade probes");let n=0;const r=this.upgrades.length;for(;n<r;n++)this.probe(this.upgrades[n])}}onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(ir('socket receive: type "%s", data "%s"',n.type,n.data),this.emitReserved("packet",n),this.emitReserved("heartbeat"),this.resetPingTimeout(),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const r=new Error("server error");r.code=n.data,this.onError(r);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}else ir('packet received with socket readyState "%s"',this.readyState)}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this.upgrades=this.filterUpgrades(n.upgrades),this.pingInterval=n.pingInterval,this.pingTimeout=n.pingTimeout,this.maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this.getWritablePackets();ir("flushing %d packets in socket",n.length),this.transport.send(n),this.prevBufferLen=n.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(r+=(0,z3.byteLength)(s)),a>0&&r>this.maxPayload)return ir("only send %d out of %d packets",a,this.writeBuffer.length),this.writeBuffer.slice(0,a);r+=2}return ir("payload size is %d (max: %d)",r,this.maxPayload),this.writeBuffer}write(n,r,a){return this.sendPacket("message",n,r,a),this}send(n,r,a){return this.sendPacket("message",n,r,a),this}sendPacket(n,r,a,s){if(typeof r=="function"&&(s=r,r=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const c={type:n,data:r,options:a};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),s&&this.once("flush",s),this.flush()}close(){const n=()=>{this.onClose("forced close"),ir("socket closing - telling transport to close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),n()},a=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():n()}):this.upgrading?a():n()),this}onError(n){ir("socket error %j",n),kh.priorWebsocketSuccess=!1,this.emitReserved("error",n),this.onClose("transport error",n)}onClose(n,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(ir('socket close with reason: "%s"',n),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",n,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(n){const r=[];let a=0;const s=n.length;for(;a<s;a++)~this.transports.indexOf(n[a])&&r.push(n[a]);return r}};Wg.Socket=U3,U3.protocol=$3.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const n=Wg;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return n.Socket}}),e.protocol=n.Socket.protocol;var r=Ic;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return r.Transport}});var a=cm;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return a.transports}});var s=to;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var c=pm;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return c.parse}});var f=Na;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return f.nextTick}})}(ax);var Nj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qg,"__esModule",{value:!0}),qg.url=void 0;const Fj=ax,B3=Nj(sl).default("socket.io-client:url");function Ij(e,n="",r){let a=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(B3("protocol-less url %s",e),typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),B3("parse %s",e),a=Fj.parse(e)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const c=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+c+":"+a.port+n,a.href=a.protocol+"://"+c+(r&&r.port===a.port?"":":"+a.port),a}qg.url=Ij;var Jg={},hm={},ey={},_d={},$c={};Object.defineProperty($c,"__esModule",{value:!0}),$c.hasBinary=$c.isBinary=void 0;const zj=typeof ArrayBuffer=="function",jj=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,V3=Object.prototype.toString,$j=typeof Blob=="function"||typeof Blob<"u"&&V3.call(Blob)==="[object BlobConstructor]",Uj=typeof File=="function"||typeof File<"u"&&V3.call(File)==="[object FileConstructor]";function H3(e){return zj&&(e instanceof ArrayBuffer||jj(e))||$j&&e instanceof Blob||Uj&&e instanceof File}$c.isBinary=H3;function ty(e,n){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,a=e.length;r<a;r++)if(ty(e[r]))return!0;return!1}if(H3(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ty(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&ty(e[r]))return!0;return!1}$c.hasBinary=ty,Object.defineProperty(_d,"__esModule",{value:!0}),_d.reconstructPacket=_d.deconstructPacket=void 0;const Bj=$c;function Vj(e){const n=[],r=e.data,a=e;return a.data=fx(r,n),a.attachments=n.length,{packet:a,buffers:n}}_d.deconstructPacket=Vj;function fx(e,n){if(!e)return e;if((0,Bj.isBinary)(e)){const r={_placeholder:!0,num:n.length};return n.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let a=0;a<e.length;a++)r[a]=fx(e[a],n);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=fx(e[a],n));return r}return e}function Hj(e,n){return e.data=dx(e.data,n),delete e.attachments,e}_d.reconstructPacket=Hj;function dx(e,n){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<n.length)return n[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=dx(e[r],n);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=dx(e[r],n));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const n=Cd,r=_d,a=$c,c=(0,sl.default)("socket.io-parser"),f=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var h;(function(C){C[C.CONNECT=0]="CONNECT",C[C.DISCONNECT=1]="DISCONNECT",C[C.EVENT=2]="EVENT",C[C.ACK=3]="ACK",C[C.CONNECT_ERROR=4]="CONNECT_ERROR",C[C.BINARY_EVENT=5]="BINARY_EVENT",C[C.BINARY_ACK=6]="BINARY_ACK"})(h=e.PacketType||(e.PacketType={}));class v{constructor(x){this.replacer=x}encode(x){return c("encoding packet %j",x),(x.type===h.EVENT||x.type===h.ACK)&&(0,a.hasBinary)(x)?this.encodeAsBinary({type:x.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:x.nsp,data:x.data,id:x.id}):[this.encodeAsString(x)]}encodeAsString(x){let R=""+x.type;return(x.type===h.BINARY_EVENT||x.type===h.BINARY_ACK)&&(R+=x.attachments+"-"),x.nsp&&x.nsp!=="/"&&(R+=x.nsp+","),x.id!=null&&(R+=x.id),x.data!=null&&(R+=JSON.stringify(x.data,this.replacer)),c("encoded %j as %s",x,R),R}encodeAsBinary(x){const R=(0,r.deconstructPacket)(x),T=this.encodeAsString(R.packet),D=R.buffers;return D.unshift(T),D}}e.Encoder=v;function y(C){return Object.prototype.toString.call(C)==="[object Object]"}class S extends n.Emitter{constructor(x){super(),this.reviver=x}add(x){let R;if(typeof x=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");R=this.decodeString(x);const T=R.type===h.BINARY_EVENT;T||R.type===h.BINARY_ACK?(R.type=T?h.EVENT:h.ACK,this.reconstructor=new E(R),R.attachments===0&&super.emitReserved("decoded",R)):super.emitReserved("decoded",R)}else if((0,a.isBinary)(x)||x.base64)if(this.reconstructor)R=this.reconstructor.takeBinaryData(x),R&&(this.reconstructor=null,super.emitReserved("decoded",R));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+x)}decodeString(x){let R=0;const T={type:Number(x.charAt(0))};if(h[T.type]===void 0)throw new Error("unknown packet type "+T.type);if(T.type===h.BINARY_EVENT||T.type===h.BINARY_ACK){const M=R+1;for(;x.charAt(++R)!=="-"&&R!=x.length;);const I=x.substring(M,R);if(I!=Number(I)||x.charAt(R)!=="-")throw new Error("Illegal attachments");T.attachments=Number(I)}if(x.charAt(R+1)==="/"){const M=R+1;for(;++R&&!(x.charAt(R)===","||R===x.length););T.nsp=x.substring(M,R)}else T.nsp="/";const D=x.charAt(R+1);if(D!==""&&Number(D)==D){const M=R+1;for(;++R;){const I=x.charAt(R);if(I==null||Number(I)!=I){--R;break}if(R===x.length)break}T.id=Number(x.substring(M,R+1))}if(x.charAt(++R)){const M=this.tryParse(x.substr(R));if(S.isPayloadValid(T.type,M))T.data=M;else throw new Error("invalid payload")}return c("decoded %s as %j",x,T),T}tryParse(x){try{return JSON.parse(x,this.reviver)}catch{return!1}}static isPayloadValid(x,R){switch(x){case h.CONNECT:return y(R);case h.DISCONNECT:return R===void 0;case h.CONNECT_ERROR:return typeof R=="string"||y(R);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(R)&&(typeof R[0]=="number"||typeof R[0]=="string"&&f.indexOf(R[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(R)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=S;class E{constructor(x){this.packet=x,this.buffers=[],this.reconPack=x}takeBinaryData(x){if(this.buffers.push(x),this.buffers.length===this.reconPack.attachments){const R=(0,r.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),R}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(ey);var mm={};Object.defineProperty(mm,"__esModule",{value:!0}),mm.on=void 0;function qj(e,n,r){return e.on(n,r),function(){e.off(n,r)}}mm.on=qj;var Wj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hm,"__esModule",{value:!0}),hm.Socket=void 0;const ko=ey,ny=mm,Yj=Cd,$r=Wj(sl).default("socket.io-client:socket"),Zj=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Kj extends Yj.Emitter{constructor(n,r,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=r,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[ny.on(n,"open",this.onopen.bind(this)),ny.on(n,"packet",this.onpacket.bind(this)),ny.on(n,"error",this.onerror.bind(this)),ny.on(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...r){if(Zj.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(r.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:ko.PacketType.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const f=this.ids++;$r("emitting packet with ack id %d",f);const h=r.pop();this._registerAckCallback(f,h),a.id=f}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)?$r("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a),this.flags={},this}_registerAckCallback(n,r){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[n]=r;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===n&&($r("removing packet with ack id %d from the buffer",n),this.sendBuffer.splice(f,1));$r("event with ack id %d has timed out after %d ms",n,s),r.call(this,new Error("operation has timed out"))},s);this.acks[n]=(...f)=>{this.io.clearTimeoutFn(c),r.apply(this,[null,...f])}}emitWithAck(n,...r){const a=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,c)=>{r.push((f,h)=>a?f?c(f):s(h):s(f)),this.emit(n,...r)})}_addToQueue(n){let r;typeof n[n.length-1]=="function"&&(r=n.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((s,...c)=>a!==this._queue[0]?void 0:(s!==null?a.tryCount>this._opts.retries&&($r("packet [%d] is discarded after %d tries",a.id,a.tryCount),this._queue.shift(),r&&r(s)):($r("packet [%d] was successfully sent",a.id),this._queue.shift(),r&&r(null,...c)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(n=!1){if($r("draining queue"),!this.connected||this._queue.length===0)return;const r=this._queue[0];if(r.pending&&!n){$r("packet [%d] has already been sent and is waiting for an ack",r.id);return}r.pending=!0,r.tryCount++,$r("sending packet [%d] (try n°%d)",r.id,r.tryCount),this.flags=r.flags,this.emit.apply(this,r.args)}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){$r("transport is open - connecting"),typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:ko.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,r){$r("close (%s)",n),this.connected=!1,delete this.id,this.emitReserved("disconnect",n,r)}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case ko.PacketType.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ko.PacketType.EVENT:case ko.PacketType.BINARY_EVENT:this.onevent(n);break;case ko.PacketType.ACK:case ko.PacketType.BINARY_ACK:this.onack(n);break;case ko.PacketType.DISCONNECT:this.ondisconnect();break;case ko.PacketType.CONNECT_ERROR:this.destroy();const a=new Error(n.data.message);a.data=n.data.data,this.emitReserved("connect_error",a);break}}onevent(n){const r=n.data||[];$r("emitting event %j",r),n.id!=null&&($r("attaching ack callback to event"),r.push(this.ack(n.id))),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const a of r)a.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const r=this;let a=!1;return function(...s){a||(a=!0,$r("sending ack %j",s),r.packet({type:ko.PacketType.ACK,id:n,data:s}))}}onack(n){const r=this.acks[n.id];typeof r=="function"?($r("calling ack %s with %j",n.id,n.data),r.apply(this,n.data),delete this.acks[n.id]):$r("bad ack %s",n.id)}onconnect(n,r){$r("socket connected with id %s",n),this.id=n,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){$r("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&($r("performing disconnect (%s)",this.nsp),this.packet({type:ko.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}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){const r=this._anyListeners;for(let a=0;a<r.length;a++)if(n===r[a])return r.splice(a,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){const r=this._anyOutgoingListeners;for(let a=0;a<r.length;a++)if(n===r[a])return r.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const a of r)a.apply(this,n.data)}}}hm.Socket=Kj;var ry={};Object.defineProperty(ry,"__esModule",{value:!0}),ry.Backoff=void 0;function Td(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ry.Backoff=Td,Td.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*e);e=Math.floor(n*10)&1?e+r:e-r}return Math.min(e,this.max)|0},Td.prototype.reset=function(){this.attempts=0},Td.prototype.setMin=function(e){this.ms=e},Td.prototype.setMax=function(e){this.max=e},Td.prototype.setJitter=function(e){this.jitter=e};var Gj=Ht&&Ht.__createBinding||(Object.create?function(e,n,r,a){a===void 0&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,a){a===void 0&&(a=r),e[a]=n[r]}),Qj=Ht&&Ht.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Xj=Ht&&Ht.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Gj(n,e,r);return Qj(n,e),n},Jj=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.Manager=void 0;const px=ax,e$=hm,t$=Xj(ey),Uc=mm,n$=ry,r$=Cd,ui=Jj(sl).default("socket.io-client:manager");class i$ extends r$.Emitter{constructor(n,r){var a;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(r=n,n=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,px.installTimerFunctions(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((a=r.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new n$.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=n;const s=r.parser||t$;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var r;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(r=this.backoff)===null||r===void 0||r.setMin(n),this)}randomizationFactor(n){var r;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(r=this.backoff)===null||r===void 0||r.setJitter(n),this)}reconnectionDelayMax(n){var r;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(r=this.backoff)===null||r===void 0||r.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(ui("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;ui("opening %s",this.uri),this.engine=new px.Socket(this.uri,this.opts);const r=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=Uc.on(r,"open",function(){a.onopen(),n&&n()}),c=h=>{ui("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",h),n?n(h):this.maybeReconnectOnOpen()},f=Uc.on(r,"error",c);if(this._timeout!==!1){const h=this._timeout;ui("connect attempt will timeout after %d",h);const v=this.setTimeoutFn(()=>{ui("connect attempt timed out after %d",h),s(),c(new Error("timeout")),r.close()},h);this.opts.autoUnref&&v.unref(),this.subs.push(()=>{this.clearTimeoutFn(v)})}return this.subs.push(s),this.subs.push(f),this}connect(n){return this.open(n)}onopen(){ui("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Uc.on(n,"ping",this.onping.bind(this)),Uc.on(n,"data",this.ondata.bind(this)),Uc.on(n,"error",this.onerror.bind(this)),Uc.on(n,"close",this.onclose.bind(this)),Uc.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(r){this.onclose("parse error",r)}}ondecoded(n){px.nextTick(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){ui("error",n),this.emitReserved("error",n)}socket(n,r){let a=this.nsps[n];return a?this._autoConnect&&!a.active&&a.connect():(a=new e$.Socket(this,n,r),this.nsps[n]=a),a}_destroy(n){const r=Object.keys(this.nsps);for(const a of r)if(this.nsps[a].active){ui("socket %s is still active, skipping close",a);return}this._close()}_packet(n){ui("writing packet %j",n);const r=this.encoder.encode(n);for(let a=0;a<r.length;a++)this.engine.write(r[a],n.options)}cleanup(){ui("cleanup"),this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){ui("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(n,r){ui("closed due to %s",n),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)ui("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();ui("will wait %dms before reconnect attempt",r),this._reconnecting=!0;const a=this.setTimeoutFn(()=>{n.skipReconnect||(ui("attempting reconnect"),this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(s=>{s?(ui("reconnect attempt error"),n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",s)):(ui("reconnect success"),n.onreconnect())}))},r);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}Jg.Manager=i$,function(e,n){var r=Ht&&Ht.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.connect=n.io=n.Socket=n.Manager=n.protocol=void 0;const a=qg,s=Jg;Object.defineProperty(n,"Manager",{enumerable:!0,get:function(){return s.Manager}});const c=hm;Object.defineProperty(n,"Socket",{enumerable:!0,get:function(){return c.Socket}});const h=r(sl).default("socket.io-client"),v={};function y(E,C){typeof E=="object"&&(C=E,E=void 0),C=C||{};const x=a.url(E,C.path||"/socket.io"),R=x.source,T=x.id,D=x.path,M=v[T]&&D in v[T].nsps,I=C.forceNew||C["force new connection"]||C.multiplex===!1||M;let N;return I?(h("ignoring socket cache for %s",R),N=new s.Manager(R,C)):(v[T]||(h("new io instance for %s",R),v[T]=new s.Manager(R,C)),N=v[T]),x.query&&!C.query&&(C.query=x.queryKey),N.socket(x.path,C)}n.io=y,n.connect=y,n.default=y,Object.assign(y,{Manager:s.Manager,Socket:c.Socket,io:y,connect:y});var S=ey;Object.defineProperty(n,"protocol",{enumerable:!0,get:function(){return S.protocol}}),e.exports=y}(ix,ix.exports);var a$=ix.exports;(function(e){var n=Ht&&Ht.__awaiter||function(v,y,S,E){function C(x){return x instanceof S?x:new S(function(R){R(x)})}return new(S||(S=Promise))(function(x,R){function T(I){try{M(E.next(I))}catch(N){R(N)}}function D(I){try{M(E.throw(I))}catch(N){R(N)}}function M(I){I.done?x(I.value):C(I.value).then(T,D)}M((E=E.apply(v,y||[])).next())})},r=Ht&&Ht.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const a=rx,s=r(a$);class c{constructor(y){this.url=y,this.pending={},this.emitter=new h,this.events=this.emitter}connect(y){return n(this,void 0,void 0,function*(){return new Promise((S,E)=>{this.disconnect(),this.socket=(0,s.default)(this.url,{transports:["websocket"],auth:y,autoConnect:!1});const C=setTimeout(()=>{E("connection timed out")},5e3);this.socket.on("login",x=>n(this,void 0,void 0,function*(){clearTimeout(C),S(x)})),this.socket.on("connect_error",x=>{var R;(R=this.socket)===null||R===void 0||R.close(),clearTimeout(C),E(x.message)}),this.socket.on("message",x=>n(this,void 0,void 0,function*(){var R;this.pending[x.request]&&(!((R=x.data)===null||R===void 0)&&R.error?this.pending[x.request].reject(new Error(x.data.message)):this.pending[x.request].resolve(x.data),delete this.pending[x.request]),yield this.emitter.emit(f.Message,x)})),this.socket.connect()})})}disconnect(){var y;this.socket&&!(!((y=this.socket)===null||y===void 0)&&y.disconnected)&&this.socket.disconnect()}request(y,S){var E;return n(this,void 0,void 0,function*(){if(!(!((E=this.socket)===null||E===void 0)&&E.connected))throw new Error("Client is disconnected");const C=this.random(32),x=new Promise((R,T)=>{this.pending[C]={resolve:R,reject:T}});return this.socket.send({request:C,type:y,data:S}),x})}random(y){const S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let E="";for(let C=0;C<y;C++)E+=S.charAt(Math.floor(Math.random()*S.length));return E}}e.SocketCom=c;var f;(function(v){v.Message="message"})(f=e.SocketComEvents||(e.SocketComEvents={}));class h extends a.Emitter{}e.SocketComEmitter=h})(g3);var iy={},o$=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(iy,"__esModule",{value:!0}),iy.SocketEmitter=void 0;class l${constructor(){this.listeners={}}on(n,r){const a=this.listeners[n];a?a.push(r):this.listeners[n]=[r]}removeListeners(n){this.listeners[n]=[]}emit(n,r){return o$(this,void 0,void 0,function*(){const a=this.listeners[n];if(a!=null&&a.length){for(const s of a)yield s(r);return!0}else return!1})}}iy.SocketEmitter=l$;var ua=Ht&&Ht.__awaiter||function(e,n,r,a){function s(c){return c instanceof r?c:new r(function(f){f(c)})}return new(r||(r=Promise))(function(c,f){function h(S){try{y(a.next(S))}catch(E){f(E)}}function v(S){try{y(a.throw(S))}catch(E){f(E)}}function y(S){S.done?c(S.value):s(S.value).then(h,v)}y((a=a.apply(e,n||[])).next())})};Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.MessagingSocket=void 0;const q3=g3,s$=iy;class u$ extends s$.SocketEmitter{constructor(n){super(),this.clientId=n.clientId,this.com=new q3.SocketCom(n.url),this.com.events.on(q3.SocketComEvents.Message,r=>ua(this,void 0,void 0,function*(){r.type==="message.new"&&(yield this.emit("message",r.data.message))}))}get creds(){return this._creds}get userId(){var n;return(n=this._creds)===null||n===void 0?void 0:n.userId}get conversationId(){return this._conversationId}connect(n){return ua(this,void 0,void 0,function*(){const r=yield this.com.connect({clientId:this.clientId,creds:n});return r.userId===(n==null?void 0:n.userId)&&!r.userToken&&(r.userToken=n.userToken),this._creds=r,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),r})}disconnect(){return ua(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return ua(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(n){return ua(this,void 0,void 0,function*(){this._conversationId=n,yield this.emit("conversation",this._conversationId)})}createConversation(n){return ua(this,void 0,void 0,function*(){const r=yield this.request("conversations.create",{});return(n==null?void 0:n.switch)!==!1&&(yield this.switchConversation(r.id)),r})}startConversation(n){return ua(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:n||this._conversationId})})}getConversation(n){return ua(this,void 0,void 0,function*(){return this.request("conversations.get",{id:n||this._conversationId})})}deleteConversation(n){return ua(this,void 0,void 0,function*(){const r=yield this.request("conversations.delete",{id:n||this._conversationId});return r&&(yield this.switchConversation(void 0)),r})}listConversations(n){return ua(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:n||20})})}sendText(n){return ua(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:n}})})}sendPayload(n){return ua(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:n})})}listMessages(n){return ua(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:n||20})})}sendFeedback(n,r){return ua(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:n,feedback:r})})}request(n,r){return this.com.request(n,r)}}Hg.MessagingSocket=u$,function(e){var n=Ht&&Ht.__createBinding||(Object.create?function(a,s,c,f){f===void 0&&(f=c),Object.defineProperty(a,f,{enumerable:!0,get:function(){return s[c]}})}:function(a,s,c,f){f===void 0&&(f=c),a[f]=s[c]}),r=Ht&&Ht.__exportStar||function(a,s){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(s,c)&&n(s,a,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(rx,e),r(Hg,e)}(u3);class c${constructor(n){Wl(this,"socket");Wl(this,"clientId");Wl(this,"userId");Wl(this,"conversationId");Wl(this,"userToken");Wl(this,"connected",!1);Wl(this,"emitter");Wl(this,"on");this.socket=new u3.MessagingSocket(n),this.emitter=new Y5,this.clientId=n.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("connect",r=>{this.emitter.emit("connect",r)}),this.socket.on("disconnect",r=>{this.emitter.emit("disconnect",r)}),this.socket.on("message",r=>{this.emitter.emit("message",r)}),this.socket.on("conversation",r=>{this.emitter.emit("conversation",r)}),this.socket.on("user",r=>{this.emitter.emit("user",r)})}async connect(n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(n).catch(a=>{throw this.connected=!1,a});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(n){this.conversationId||await this.newConversation(),await this.socket.sendText(n),this.emitter.emit("messageSent",n)}async switchConversation(n){await this.socket.switchConversation(n),this.conversationId=n}async listConversations(){return this.socket.listConversations()}async newConversation(){const{id:n}=await this.socket.createConversation();this.conversationId=n}listMessages(n){return this.socket.listMessages(n)}}const f$=({styles:e={},renderers:n,client:r,children:a,configuration:s,...c})=>{const[f,h]=j.useState([]),[v,y]=j.useState({disableComposer:!1}),[S,E]=j.useState(s),[C,x]=j.useState(e),R=Dc(B=>B.addMessageToHistory),T=Dc(B=>B.setConversationId),D=Dc(B=>B.user),M=Dc(B=>B.conversationId),I=Dc(B=>B.setUser),N={...c,value:{theme:C,renderers:{...IE,...n},messages:f,setMessages:h,eventEmitter:nI,configuration:s,setConfiguration:E,state:v,setState:B=>y({...v,...B}),setTheme:x,client:{...r,sendMessage:async B=>{await r.sendMessage(B),h(F=>[...F,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:B}}}]),r.userId&&R({message:B,userId:r.userId})},on:r.on,restartConversation:async()=>{await r.newConversation(),h([])}}}};return dd(()=>r.on("message",B=>{try{const F=s3.parse(B.payload);h($=>[...$,{direction:"incoming",sender:{name:S.botName??"Bot",avatar:S.botAvatar},timestamp:B.sentOn,block:F}])}catch{console.error("Invalid message payload")}})),dd(()=>r.on("conversation",B=>{T(B)})),P5(async()=>{I(await r.connect(D));const B=(await r.listConversations()).map($=>$.id);M&&B.includes(M)&&await r.switchConversation(M);const F=[];for(const $ of await r.listMessages())try{const H=s3.parse($.payload),Y=$.authorId===r.userId?"outgoing":"incoming";F.push({direction:Y,sender:Y==="outgoing"?{name:"You"}:{name:S.botName??"Bot",avatar:S.botAvatar},timestamp:$.sentOn,block:H})}catch{console.error("Invalid message payload")}return h(F.reverse()),()=>{r.disconnect()}},[]),he.jsx(aT.Provider,{...N,children:typeof a=="function"?a(S):a})},W3=j.forwardRef(({children:e,...n},r)=>{const{theme:{container:a}}=cr();return he.jsxs("div",{...n,...a,ref:r,children:[he.jsx(ML,{}),he.jsx(z5,{children:e})]})});function rs(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function Y3({prop:e,defaultProp:n,onChange:r=()=>{}}){const[a,s]=d$({defaultProp:n,onChange:r}),c=e!==void 0,f=c?e:a,h=Qs(r),v=j.useCallback(y=>{if(c){const E=typeof y=="function"?y(e):y;E!==e&&h(E)}else s(y)},[c,e,s,h]);return[f,v]}function d$({defaultProp:e,onChange:n}){const r=j.useState(e),[a]=r,s=j.useRef(a),c=Qs(n);return j.useEffect(()=>{s.current!==a&&(c(a),s.current=a)},[a,s,c]),r}function p$(e,n){return j.useReducer((r,a)=>{const s=n[r][a];return s??r},e)}const ay=e=>{const{present:n,children:r}=e,a=h$(n),s=typeof r=="function"?r({present:a.isPresent}):j.Children.only(r),c=Ec(a.ref,s.ref);return typeof r=="function"||a.isPresent?j.cloneElement(s,{ref:c}):null};ay.displayName="Presence";function h$(e){const[n,r]=j.useState(),a=j.useRef({}),s=j.useRef(e),c=j.useRef("none"),f=e?"mounted":"unmounted",[h,v]=p$(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const y=oy(a.current);c.current=h==="mounted"?y:"none"},[h]),Rh(()=>{const y=a.current,S=s.current;if(S!==e){const C=c.current,x=oy(y);e?v("MOUNT"):x==="none"||(y==null?void 0:y.display)==="none"?v("UNMOUNT"):v(S&&C!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,v]),Rh(()=>{if(n){const y=E=>{const x=oy(a.current).includes(E.animationName);E.target===n&&x&&P0.flushSync(()=>v("ANIMATION_END"))},S=E=>{E.target===n&&(c.current=oy(a.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else v("ANIMATION_END")},[n,v]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:j.useCallback(y=>{y&&(a.current=getComputedStyle(y)),r(y)},[])}}function oy(e){return(e==null?void 0:e.animationName)||"none"}const m$=Z["useId".toString()]||(()=>{});let v$=0;function ly(e){const[n,r]=Z.useState(m$());return Rh(()=>{e||r(a=>a??String(v$++))},[e]),e||(n?`radix-${n}`:"")}const Z3="Collapsible",[g$,AZ]=mS(Z3),[y$,hx]=g$(Z3),b$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,open:a,defaultOpen:s,disabled:c,onOpenChange:f,...h}=e,[v=!1,y]=Y3({prop:a,defaultProp:s,onChange:f});return j.createElement(y$,{scope:r,disabled:c,contentId:ly(),open:v,onOpenToggle:j.useCallback(()=>y(S=>!S),[y])},j.createElement(Ka.div,Xn({"data-state":mx(v),"data-disabled":c?"":void 0},h,{ref:n})))}),S$="CollapsibleTrigger",E$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,...a}=e,s=hx(S$,r);return j.createElement(Ka.button,Xn({type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":mx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled},a,{ref:n,onClick:rs(e.onClick,s.onOpenToggle)}))}),K3="CollapsibleContent",x$=j.forwardRef((e,n)=>{const{forceMount:r,...a}=e,s=hx(K3,e.__scopeCollapsible);return j.createElement(ay,{present:r||s.open},({present:c})=>j.createElement(w$,Xn({},a,{ref:n,present:c})))}),w$=j.forwardRef((e,n)=>{const{__scopeCollapsible:r,present:a,children:s,...c}=e,f=hx(K3,r),[h,v]=j.useState(a),y=j.useRef(null),S=Ec(n,y),E=j.useRef(0),C=E.current,x=j.useRef(0),R=x.current,T=f.open||h,D=j.useRef(T),M=j.useRef();return j.useEffect(()=>{const I=requestAnimationFrame(()=>D.current=!1);return()=>cancelAnimationFrame(I)},[]),Rh(()=>{const I=y.current;if(I){M.current=M.current||{transitionDuration:I.style.transitionDuration,animationName:I.style.animationName},I.style.transitionDuration="0s",I.style.animationName="none";const N=I.getBoundingClientRect();E.current=N.height,x.current=N.width,D.current||(I.style.transitionDuration=M.current.transitionDuration,I.style.animationName=M.current.animationName),v(a)}},[f.open,a]),j.createElement(Ka.div,Xn({"data-state":mx(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!T},c,{ref:S,style:{["--radix-collapsible-content-height"]:C?`${C}px`:void 0,["--radix-collapsible-content-width"]:R?`${R}px`:void 0,...e.style}}),T&&s)});function mx(e){return e?"open":"closed"}const C$=b$,k$=E$,_$=x$,T$=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),R$=j.memo(j.forwardRef((e,n)=>{const{theme:{header:r}}=cr(),[a,s]=j.useState(!1);return he.jsx(C$,{...e,...r==null?void 0:r.container,open:a,onOpenChange:s,ref:n})})),O$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx(k$,{...e,...(a=r==null?void 0:r.content)==null?void 0:a.container,ref:n})}),D$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx(_$,{...e,...(a=r==null?void 0:r.expandedContent)==null?void 0:a.container,ref:n})}),A$=j.forwardRef(({src:e,children:n},r)=>{var f,h,v,y,S,E;const{theme:{header:a},client:{clientId:s}}=cr(),c=Z5(s??"",15);return he.jsxs(N0,{ref:r,"data-color":c,...(h=(f=a==null?void 0:a.content)==null?void 0:f.avatar)==null?void 0:h.container,children:[he.jsx(F0,{...(y=(v=a==null?void 0:a.content)==null?void 0:v.avatar)==null?void 0:y.image,src:e}),he.jsx(I0,{...(E=(S=a==null?void 0:a.content)==null?void 0:S.avatar)==null?void 0:E.fallback,children:n})]})}),M$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx("h2",{...e,...(a=r==null?void 0:r.content)==null?void 0:a.title,ref:n})}),L$=j.forwardRef((e,n)=>{var a;const{theme:{header:r}}=cr();return he.jsx("p",{...e,...(a=r==null?void 0:r.content)==null?void 0:a.description,ref:n})}),P$=j.forwardRef((e,n)=>{var a,s;const{theme:{header:r}}=cr();return he.jsx("div",{...e,...(s=(a=r==null?void 0:r.content)==null?void 0:a.actions)==null?void 0:s.container,ref:n})}),Fa=Object.assign(R$,{Content:O$,ExpandedContent:D$,Avatar:A$,Description:L$,Title:M$,Actions:P$,DescriptionItem:({icon:e,title:n,link:r,...a})=>{var h,v,y,S,E,C,x,R,T,D,M,I;const{theme:{header:s}}=cr(),c=e??T$,f=N=>{N&&U7(N)};return!r&&!n?null:r?he.jsxs("a",{...a,...(v=(h=s==null?void 0:s.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:v.container,href:r,target:"_blank",rel:"noopener",children:[he.jsx(c,{...(S=(y=s==null?void 0:s.expandedContent)==null?void 0:y.descriptionItems)==null?void 0:S.icon}),he.jsx("p",{...(C=(E=s==null?void 0:s.expandedContent)==null?void 0:E.descriptionItems)==null?void 0:C.link,children:n})]}):he.jsxs("div",{...a,...(R=(x=s==null?void 0:s.expandedContent)==null?void 0:x.descriptionItems)==null?void 0:R.container,onClick:N=>{f(N.currentTarget.textContent)},children:[he.jsx(c,{...(D=(T=s==null?void 0:s.expandedContent)==null?void 0:T.descriptionItems)==null?void 0:D.icon}),he.jsx("p",{...(I=(M=s==null?void 0:s.expandedContent)==null?void 0:M.descriptionItems)==null?void 0:I.text,children:n})]})}}),G3=j.memo(({...e})=>{const{theme:{loadingIndicator:n}}=cr();return he.jsx("div",{...e,...n==null?void 0:n.container,children:he.jsx("div",{...n==null?void 0:n.loader})})}),vx=j.forwardRef(({direction:e,block:n,scroll:r,disableInput:a,children:s,sender:c,...f},h)=>{var T,D,M;const[v,y]=j.useState([]),{theme:{message:S},configuration:{botAvatar:E,botName:C},client:{clientId:x}}=cr();SF(()=>{r()}),j.useEffect(()=>{v.length===0&&r()},[v.length]);const R=Z5(x??"",15);return he.jsx(rT.Provider,{value:{isLoading:v,setIsLoading:y},children:he.jsxs("div",{...f,...S==null?void 0:S.container,"data-loaded":v.length===0,"data-disable-input":!!a,"data-direction":e,ref:h,children:[he.jsxs(N0,{"data-color":R,...(T=S==null?void 0:S.avatar)==null?void 0:T.container,children:[he.jsx(F0,{...(D=S==null?void 0:S.avatar)==null?void 0:D.image,src:(c==null?void 0:c.avatar)??E}),he.jsx(I0,{...(M=S==null?void 0:S.avatar)==null?void 0:M.fallback,children:(c==null?void 0:c.name[0])??(C==null?void 0:C[0])})]}),n&&he.jsx(fd,{block:n,styles:S==null?void 0:S.blocks}),s]})})}),Q3=1e4,X3=j.memo(({...e})=>{const{theme:{messageList:n}}=cr(),{messages:r,setState:a,client:s}=cr(),[c,f]=j.useState(!0),h=j.useRef(null),{y:v}=_F(h),[y,S]=j.useState(!1),[E,C]=RF(),x=()=>{if(!h.current)return;const{scrollHeight:R}=h.current;c&&h.current.scrollTo({top:R})};return j.useEffect(()=>{const R=new Date(Date.now()-Q3+2e3);r.length>0&&r[r.length-1].timestamp<R&&S(!1)},[E]),dd(()=>s.on("messageSent",()=>{S(!0),C(new Date(Date.now()+Q3))})),dd(()=>s.on("message",()=>{S(!1)})),j.useEffect(()=>{const R=r[r.length-1];a({disableComposer:!!(R!=null&&R.disableInput)})},[r.length]),j.useEffect(()=>{if(!h.current)return;const{offsetHeight:R,scrollHeight:T,scrollTop:D}=h.current;f(T<=D+R+100)},[v]),he.jsxs("ul",{...e,...n,ref:h,children:[r.map((R,T)=>he.jsx(vx,{scroll:x,...R},T)),y&&he.jsx(vx,{scroll:x,direction:"incoming",children:he.jsx(G3,{})})]})});function N$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e);j.useEffect(()=>{const a=s=>{s.key==="Escape"&&r(s)};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[r,n])}const gx="dismissableLayer.update",F$="dismissableLayer.pointerDownOutside",I$="dismissableLayer.focusOutside";let J3;const z$=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j$=j.forwardRef((e,n)=>{var r;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,onDismiss:v,...y}=e,S=j.useContext(z$),[E,C]=j.useState(null),x=(r=E==null?void 0:E.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,R]=j.useState({}),T=Ec(n,Y=>C(Y)),D=Array.from(S.layers),[M]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),I=D.indexOf(M),N=E?D.indexOf(E):-1,B=S.layersWithOutsidePointerEventsDisabled.size>0,F=N>=I,$=$$(Y=>{const ne=Y.target,ve=[...S.branches].some(ee=>ee.contains(ne));!F||ve||(c==null||c(Y),h==null||h(Y),Y.defaultPrevented||v==null||v())},x),H=U$(Y=>{const ne=Y.target;[...S.branches].some(ee=>ee.contains(ne))||(f==null||f(Y),h==null||h(Y),Y.defaultPrevented||v==null||v())},x);return N$(Y=>{N===S.layers.size-1&&(s==null||s(Y),!Y.defaultPrevented&&v&&(Y.preventDefault(),v()))},x),j.useEffect(()=>{if(E)return a&&(S.layersWithOutsidePointerEventsDisabled.size===0&&(J3=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(E)),S.layers.add(E),eR(),()=>{a&&S.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=J3)}},[E,x,a,S]),j.useEffect(()=>()=>{E&&(S.layers.delete(E),S.layersWithOutsidePointerEventsDisabled.delete(E),eR())},[E,S]),j.useEffect(()=>{const Y=()=>R({});return document.addEventListener(gx,Y),()=>document.removeEventListener(gx,Y)},[]),j.createElement(Ka.div,Xn({},y,{ref:T,style:{pointerEvents:B?F?"auto":"none":void 0,...e.style},onFocusCapture:rs(e.onFocusCapture,H.onFocusCapture),onBlurCapture:rs(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:rs(e.onPointerDownCapture,$.onPointerDownCapture)}))});function $$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e),a=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const c=h=>{if(h.target&&!a.current){let y=function(){tR(F$,r,v,{discrete:!0})};const v={originalEvent:h};h.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=y,n.addEventListener("click",s.current,{once:!0})):y()}a.current=!1},f=window.setTimeout(()=>{n.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",c),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>a.current=!0}}function U$(e,n=globalThis==null?void 0:globalThis.document){const r=Qs(e),a=j.useRef(!1);return j.useEffect(()=>{const s=c=>{c.target&&!a.current&&tR(I$,r,{originalEvent:c},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function eR(){const e=new CustomEvent(gx);document.dispatchEvent(e)}function tR(e,n,r,{discrete:a}){const s=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),a?y6(s,c):s.dispatchEvent(c)}const yx="focusScope.autoFocusOnMount",bx="focusScope.autoFocusOnUnmount",nR={bubbles:!1,cancelable:!0},B$=j.forwardRef((e,n)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...f}=e,[h,v]=j.useState(null),y=Qs(s),S=Qs(c),E=j.useRef(null),C=Ec(n,T=>v(T)),x=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(a){let T=function(N){if(x.paused||!h)return;const B=N.target;h.contains(B)?E.current=B:gu(E.current,{select:!0})},D=function(N){if(x.paused||!h)return;const B=N.relatedTarget;B!==null&&(h.contains(B)||gu(E.current,{select:!0}))},M=function(N){const B=document.activeElement;for(const F of N)F.removedNodes.length>0&&(h!=null&&h.contains(B)||gu(h))};document.addEventListener("focusin",T),document.addEventListener("focusout",D);const I=new MutationObserver(M);return h&&I.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",D),I.disconnect()}}},[a,h,x.paused]),j.useEffect(()=>{if(h){aR.add(x);const T=document.activeElement;if(!h.contains(T)){const M=new CustomEvent(yx,nR);h.addEventListener(yx,y),h.dispatchEvent(M),M.defaultPrevented||(V$(Z$(rR(h)),{select:!0}),document.activeElement===T&&gu(h))}return()=>{h.removeEventListener(yx,y),setTimeout(()=>{const M=new CustomEvent(bx,nR);h.addEventListener(bx,S),h.dispatchEvent(M),M.defaultPrevented||gu(T??document.body,{select:!0}),h.removeEventListener(bx,S),aR.remove(x)},0)}}},[h,y,S,x]);const R=j.useCallback(T=>{if(!r&&!a||x.paused)return;const D=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,M=document.activeElement;if(D&&M){const I=T.currentTarget,[N,B]=H$(I);N&&B?!T.shiftKey&&M===B?(T.preventDefault(),r&&gu(N,{select:!0})):T.shiftKey&&M===N&&(T.preventDefault(),r&&gu(B,{select:!0})):M===I&&T.preventDefault()}},[r,a,x.paused]);return j.createElement(Ka.div,Xn({tabIndex:-1},f,{ref:C,onKeyDown:R}))});function V$(e,{select:n=!1}={}){const r=document.activeElement;for(const a of e)if(gu(a,{select:n}),document.activeElement!==r)return}function H$(e){const n=rR(e),r=iR(n,e),a=iR(n.reverse(),e);return[r,a]}function rR(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function iR(e,n){for(const r of e)if(!q$(r,{upTo:n}))return r}function q$(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function W$(e){return e instanceof HTMLInputElement&&"select"in e}function gu(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&W$(e)&&n&&e.select()}}const aR=Y$();function Y$(){let e=[];return{add(n){const r=e[0];n!==r&&(r==null||r.pause()),e=oR(e,n),e.unshift(n)},remove(n){var r;e=oR(e,n),(r=e[0])===null||r===void 0||r.resume()}}}function oR(e,n){const r=[...e],a=r.indexOf(n);return a!==-1&&r.splice(a,1),r}function Z$(e){return e.filter(n=>n.tagName!=="A")}let Sx=0;function K$(){j.useEffect(()=>{var e,n;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:lR()),document.body.insertAdjacentElement("beforeend",(n=r[1])!==null&&n!==void 0?n:lR()),Sx++,()=>{Sx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Sx--}},[])}function lR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var sy="right-scroll-bar-position",uy="width-before-scroll-bar",G$="with-scroll-bars-hidden",Q$="--removed-body-scroll-bar-size";function X$(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function J$(e,n){var r=j.useState(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(a){var s=r.value;s!==a&&(r.value=a,r.callback(a,s))}}}})[0];return r.callback=n,r.facade}function eU(e,n){return J$(n||null,function(r){return e.forEach(function(a){return X$(a,r)})})}function tU(e){return e}function nU(e,n){n===void 0&&(n=tU);var r=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var f=n(c,a);return r.push(f),function(){r=r.filter(function(h){return h!==f})}},assignSyncMedium:function(c){for(a=!0;r.length;){var f=r;r=[],f.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){a=!0;var f=[];if(r.length){var h=r;r=[],h.forEach(c),f=r}var v=function(){var S=f;f=[],S.forEach(c)},y=function(){return Promise.resolve().then(v)};y(),r={push:function(S){f.push(S),y()},filter:function(S){return f=f.filter(S),r}}}};return s}function rU(e){e===void 0&&(e={});var n=nU(null);return n.options=eo({async:!0,ssr:!1},e),n}var sR=function(e){var n=e.sideCar,r=L5(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return Z.createElement(a,eo({},r))};sR.isSideCarExport=!0;function iU(e,n){return e.useMedium(n),sR}var uR=rU(),Ex=function(){},cy=Z.forwardRef(function(e,n){var r=Z.useRef(null),a=Z.useState({onScrollCapture:Ex,onWheelCapture:Ex,onTouchMoveCapture:Ex}),s=a[0],c=a[1],f=e.forwardProps,h=e.children,v=e.className,y=e.removeScrollBar,S=e.enabled,E=e.shards,C=e.sideCar,x=e.noIsolation,R=e.inert,T=e.allowPinchZoom,D=e.as,M=D===void 0?"div":D,I=L5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),N=C,B=eU([r,n]),F=eo(eo({},I),s);return Z.createElement(Z.Fragment,null,S&&Z.createElement(N,{sideCar:uR,removeScrollBar:y,shards:E,noIsolation:x,inert:R,setCallbacks:c,allowPinchZoom:!!T,lockRef:r}),f?Z.cloneElement(Z.Children.only(h),eo(eo({},F),{ref:B})):Z.createElement(M,eo({},F,{className:v,ref:B}),h))});cy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cy.classNames={fullWidth:uy,zeroRight:sy};var cR,aU=function(){if(cR)return cR;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=aU();return n&&e.setAttribute("nonce",n),e}function lU(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function sU(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var uU=function(){var e=0,n=null;return{add:function(r){e==0&&(n=oU())&&(lU(n,r),sU(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},cU=function(){var e=uU();return function(n,r){Z.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},fR=function(){var e=cU(),n=function(r){var a=r.styles,s=r.dynamic;return e(a,s),null};return n},fU={left:0,top:0,right:0,gap:0},xx=function(e){return parseInt(e||"",10)||0},dU=function(e){var n=window.getComputedStyle(document.body),r=n[e==="padding"?"paddingLeft":"marginLeft"],a=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[xx(r),xx(a),xx(s)]},pU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fU;var n=dU(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-r+n[2]-n[0])}},hU=fR(),mU=function(e,n,r,a){var s=e.left,c=e.top,f=e.right,h=e.gap;return r===void 0&&(r="margin"),`
663
663
  .`.concat(G$,` {
664
664
  overflow: hidden `).concat(a,`;
665
665
  padding-right: `).concat(h,"px ").concat(a,`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/webchat",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.cjs",