@botuyo/chat-widget-standalone 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,35 @@
1
- import{r as e,j as t,c as n,R as r}from"./vendor-react-CtfcjTlq.js";import{u as o,g as s,e as i,f as a,D as c,c as u,X as d,M as l,l as p,m as f,t as h,h as m,i as g,j as y,k as v,n as b}from"./chunk-chat-ui-C_pd6dbW.js";import{o as w}from"./chunk-chat-ui-C_pd6dbW.js";import{l as _}from"./vendor-socket-DMqyM-90.js";function k({isOpen:n,onClick:r,unreadCount:f=0,primaryColor:h,logoUrl:m,starterPrompt:g,position:y="bottom-right",emotion:v="default",avatars:b={},styles:w,promptPersistence:_="session",avatarScale:k=1}){const{t:z}=o("extracted"),x=s({primaryColor:h}),E=w?.launcher?.bg,S=i(),{triggerHaptic:O,getGlowClass:C}=a(),I=S.launcherPulse&&!1!==w?.launcher?.pulse,[$,N]=e.useState(!1),[T,j]=e.useState(!1),[A,M]=e.useState(!1),[P,Z]=e.useState(!1),F="bottom-right"===y,D="chat_launcher_prompt_state",R=e.useMemo(()=>b[v]||b.default||m||c,[v,b,m]);e.useEffect(()=>{Z(!1)},[R]),e.useEffect(()=>{const e=Object.values(b).filter(e=>!!e);m&&e.push(m),e.forEach(e=>{(new Image).src=e})},[b,m]),e.useEffect(()=>{"forever"===_&&"dismissed"===localStorage.getItem(D)&&M(!0)},[_]);const L=e.useCallback(()=>{j(!0),setTimeout(()=>N(!1),500),"always"!==_&&(M(!0),"forever"===_&&localStorage.setItem(D,"dismissed"))},[_]);return e.useEffect(()=>{if("always"!==_&&A||!g||n)return void N(!1);const e=setTimeout(()=>{N(!0),j(!1)},2e3),t=setTimeout(()=>L(),12e3);return()=>{clearTimeout(e),clearTimeout(t)}},[g,n,A,_,L]),/* @__PURE__ */t.jsxs("div",{className:u("flex items-center w-fit transition-all duration-500",F?"flex-row ml-auto":"flex-row-reverse mr-auto"),children:[
2
- /* @__PURE__ */t.jsx("div",{className:u("transition-all duration-700 ease-in-out flex items-center",$?u("opacity-100 translate-x-0 w-auto max-w-[350px]",F?"mr-4":"ml-4"):"opacity-0 translate-x-8 w-0 max-w-0 overflow-hidden"),children:/* @__PURE__ */t.jsxs("div",{className:u("relative px-5 py-3.5 shadow-soft-xl border flex items-center gap-3",w?.radius?.card||"rounded-[20px]",T&&"opacity-0 scale-95 transition-all duration-300",!$&&"hidden"),style:{width:"max-content",maxWidth:"280px",backgroundColor:"hsl(var(--background))",color:"hsl(var(--foreground))",borderColor:"hsl(var(--border))"},children:[
3
- /* @__PURE__ */t.jsx("span",{className:"text-sm font-semibold leading-tight tracking-tight whitespace-nowrap",children:g}),
4
- /* @__PURE__ */t.jsx("button",{onClick:e=>{e.stopPropagation(),L()},className:"text-muted-foreground hover:text-foreground transition-colors p-1 rounded-full hover:bg-muted shrink-0",children:/* @__PURE__ */t.jsx(d,{className:"h-3.5 w-3.5 stroke-[2.5]"})}),
5
- /* @__PURE__ */t.jsx("div",{className:u("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent",F?"right-[-14px] border-l-background":"left-[-14px] border-r-background")}),
6
- /* @__PURE__ */t.jsx("div",{className:u("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent -z-10",F?"right-[-15px] border-l-border":"left-[-15px] border-r-border")})]})}),
7
- /* @__PURE__ */t.jsxs("div",{className:"relative flex items-center justify-center shrink-0",children:[!n&&I&&/* @__PURE__ */t.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:/* @__PURE__ */t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-20",style:{backgroundColor:x}})}),
8
- /* @__PURE__ */t.jsxs("button",{type:"button",onClick:()=>{p.debug("Launcher handleMainAction called, isOpen:",n),O(),M(!0),"forever"===_&&localStorage.setItem(D,"dismissed"),r()},className:u("relative z-10 h-14 w-14 sm:h-16 sm:w-16","flex items-center justify-center text-white transition-all duration-500","hover:scale-110 active:scale-95 shadow-soft-xl cursor-pointer",!n&&"hover:rotate-6",!n&&S.enabled&&"animate-glow-pulse",w?.radius?.button||"rounded-full",E,C()),style:{backgroundColor:x||"hsl(160, 84%, 39%)","--primary-glow":`${x}66`},"aria-label":n?"Cerrar chat":"Abrir chat",children:[
9
- /* @__PURE__ */t.jsxs("div",{className:"relative h-full w-full flex items-center justify-center overflow-hidden rounded-inherit",children:[
10
- /* @__PURE__ */t.jsx("div",{className:u("absolute inset-0 transition-all duration-500 flex items-center justify-center",n?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:R&&!P?/* @__PURE__ */t.jsx("img",{src:R,alt:z("assistant"),className:"w-full h-full object-cover",style:{transform:`scale(${k})`},onError:()=>Z(!0)},R):/* @__PURE__ */t.jsx(l,{className:"h-7 w-7 sm:h-8 sm:w-8 fill-current"})}),
11
- /* @__PURE__ */t.jsx("div",{className:u("absolute inset-0 transition-all duration-500 flex items-center justify-center bg-black/5 dark:bg-white/10",n?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 -rotate-90"),children:/* @__PURE__ */t.jsx(d,{className:"h-7 w-7 sm:h-8 sm:w-8 stroke-[2.5]"})})]}),!n&&f>0&&/* @__PURE__ */t.jsx("div",{className:"absolute -top-1 -right-1 z-20 flex h-6 w-6 items-center justify-center bg-destructive text-destructive-foreground rounded-full border-2 border-background text-[10px] font-black shadow-soft-md tabular-nums",children:f>9?"9+":f})]})]})]})}class z extends e.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){p.error("ErrorBoundary caught error:",e,t),this.props.onError?.(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:/* @__PURE__ */t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 bg-background text-center",children:[
12
- /* @__PURE__ */t.jsx("div",{className:"text-6xl mb-4",children:"⚠️"}),
13
- /* @__PURE__ */t.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Algo salió mal"}),
14
- /* @__PURE__ */t.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-md",children:this.state.error?.message||"Ocurrió un error inesperado"}),
15
- /* @__PURE__ */t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const x={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},E={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},S={text:"text-primary-foreground"};const O=(e,t)=>t.some(t=>e instanceof t);let C,I;const $=/* @__PURE__ */new WeakMap,N=/* @__PURE__ */new WeakMap,T=/* @__PURE__ */new WeakMap;let j={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return $.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return P(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function A(e){j=e(j)}function M(e){return"function"==typeof e?(t=e,(I||(I=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(Z(this),e),P(this.request)}:function(...e){return P(t.apply(Z(this),e))}):(e instanceof IDBTransaction&&function(e){if($.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});$.set(e,t)}(e),O(e,C||(C=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,j):e);var t}function P(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(P(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return T.set(t,e),t}(e);if(N.has(e))return N.get(e);const t=M(e);return t!==e&&(N.set(e,t),T.set(t,e)),t}const Z=e=>T.get(e),F=["get","getKey","getAll","getAllKeys","count"],D=["put","add","delete","clear"],R=/* @__PURE__ */new Map;function L(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(R.get(t))return R.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=D.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!F.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return R.set(t,s),s}A(e=>({...e,get:(t,n,r)=>L(t,n)||e.get(t,n,r),has:(t,n)=>!!L(t,n)||e.has(t,n)}));const U=["continue","continuePrimaryKey","advance"],W={},B=/* @__PURE__ */new WeakMap,J=/* @__PURE__ */new WeakMap,V={get(e,t){if(!U.includes(t))return e[t];let n=W[t];return n||(n=W[t]=function(...e){B.set(this,J.get(this)[t](...e))}),n}};async function*q(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,V);for(J.set(n,t),T.set(n,Z(t));t;)yield n,t=await(B.get(n)||t.continue()),B.delete(n)}function G(e,t){return t===Symbol.asyncIterator&&O(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&O(e,[IDBIndex,IDBObjectStore])}A(e=>({...e,get:(t,n,r)=>G(t,n)?q:e.get(t,n,r),has:(t,n)=>G(t,n)||e.has(t,n)}));const K=new class{db=null;DB_NAME="botuyo-chat";DB_VERSION=1;async init(){try{this.db=await function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=P(i);return r&&i.addEventListener("upgradeneeded",e=>{r(P(i.result),e.oldVersion,e.newVersion,P(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}(this.DB_NAME,this.DB_VERSION,{upgrade(e){e.objectStoreNames.contains("messages")||e.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp"),e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata")}}),p.info("IndexedDB initialized")}catch(e){throw p.error("Failed to initialize IndexedDB:",e),e}}async saveMessage(e){this.db||await this.init();try{await this.db.put("messages",e)}catch(t){p.error("Failed to save message:",t)}}async saveMessages(e){this.db||await this.init();try{const t=this.db.transaction("messages","readwrite");await Promise.all([...e.map(e=>t.store.put(e)),t.done])}catch(t){p.error("Failed to save messages:",t)}}async getMessages(e=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-e)}catch(t){return p.error("Failed to get messages:",t),[]}}async getMessage(e){this.db||await this.init();try{return await this.db.get("messages",e)}catch(t){return void p.error("Failed to get message:",t)}}async deleteMessage(e){this.db||await this.init();try{await this.db.delete("messages",e)}catch(t){p.error("Failed to delete message:",t)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),p.info("Messages cleared from IndexedDB")}catch(e){p.error("Failed to clear messages:",e)}}async setMetadata(e){this.db||await this.init();try{await this.db.put("metadata",e,"chat-metadata")}catch(t){p.error("Failed to set metadata:",t)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(e){return p.error("Failed to get metadata:",e),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),p.info("All data cleared from IndexedDB")}catch(e){p.error("Failed to clear all data:",e)}}async migrateFromLocalStorage(){try{const e="botuyo_chat_v1",t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(n.messages&&Array.isArray(n.messages)){const e=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}));await this.saveMessages(e),p.info(`Migrated ${e.length} messages from localStorage`)}n.sessionId&&await this.setMetadata({sessionId:n.sessionId}),localStorage.removeItem(e),p.info("Migration from localStorage completed")}catch(e){p.error("Failed to migrate from localStorage:",e)}}},H="botuyo_chat_v1",Y={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function X(e,t){switch(t.type){case"TOGGLE_WINDOW":return{...e,isOpen:!e.isOpen};case"OPEN_WINDOW":return{...e,isOpen:!0};case"CLOSE_WINDOW":return{...e,isOpen:!1};case"SET_CONNECTED":return{...e,isConnected:t.payload};case"SET_TYPING":return{...e,isTyping:t.payload};case"ADD_MESSAGE":{if(e.messages.some(e=>e.id===t.payload.id))return e;const n=[...e.messages,t.payload],r="bot"===t.payload.sender;return{...e,messages:n,isTyping:!r&&e.isTyping}}case"SET_MESSAGES":return{...e,messages:[...t.payload]};case"SET_ERROR":return{...e,error:t.payload};case"SET_SESSION_ID":return{...e,sessionId:t.payload};case"CLEAR_CHAT":return{...Y,isOpen:e.isOpen};case"RESTORE_SESSION":return{...e,...t.payload,isConnected:!1,isTyping:!1,error:null};default:return e}}function Q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:i,traits:/* @__PURE__ */new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=i.prototype,s=Object.keys(o);for(let e=0;e<s.length;e++){const t=s[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class s extends o{}function i(e){var t;const o=n?.Parent?new s:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ee extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class te extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ne={};function re(e){return ne}function oe(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function se(e,t){return"bigint"==typeof t?t.toString():t}function ie(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ae(e){return null==e}function ce(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ue=/* @__PURE__ */Symbol("evaluating");function de(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ue)return void 0===r&&(r=ue,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function le(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pe(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function fe(e){return JSON.stringify(e)}const he="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function me(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ge=ie(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ye(e){if(!1===me(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==me(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ve(e){return ye(e)?{...e}:Array.isArray(e)?[...e]:e}const be=/* @__PURE__ */new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _e(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function ke(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const ze={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function xe(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ee(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Se(e){return"string"==typeof e?e:e?.message}function Oe(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Se(e.inst?._zod.def?.error?.(e))??Se(t?.error?.(e))??Se(n.customError?.(e))??Se(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ce(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ie(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const $e=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,se,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ne=Q("$ZodError",$e),Te=Q("$ZodError",$e,{Parent:Error}),je=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ee;if(i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Oe(e,s,re())));throw he(t,o?.callee),t}return i.value},Ae=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Oe(e,s,re())));throw he(t,o?.callee),t}return i.value},Me=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new ee;return s.issues.length?{success:!1,error:new(e??Ne)(s.issues.map(e=>Oe(e,o,re())))}:{success:!0,data:s.value}},Pe=/* @__PURE__ */Me(Te),Ze=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>Oe(e,o,re())))}:{success:!0,data:s.value}},Fe=/* @__PURE__ */Ze(Te),De=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return je(e)(t,n,o)},Re=e=>(t,n,r)=>je(e)(t,n,r),Le=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ae(e)(t,n,o)},Ue=e=>async(t,n,r)=>Ae(e)(t,n,r),We=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Me(e)(t,n,o)},Be=e=>(t,n,r)=>Me(e)(t,n,r),Je=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ze(e)(t,n,o)},Ve=e=>async(t,n,r)=>Ze(e)(t,n,r),qe=/^[cC][^\s-]{8,}$/,Ge=/^[0-9a-z]+$/,Ke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,He=/^[0-9a-vA-V]{20}$/,Ye=/^[A-Za-z0-9]{27}$/,Xe=/^[a-zA-Z0-9_-]{21}$/,Qe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,et=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,nt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ot=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,st=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,it=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,at=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ct=/^[A-Za-z0-9_-]*$/,ut=/^\+[1-9]\d{6,14}$/,dt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",lt=/* @__PURE__ */new RegExp(`^${dt}$`);function pt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ft=/^-?\d+$/,ht=/^-?\d+(?:\.\d+)?$/,mt=/^[^A-Z]*$/,gt=/^[^a-z]*$/,yt=/* @__PURE__ */Q("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vt={number:"number",bigint:"bigint",object:"date"},bt=/* @__PURE__ */Q("$ZodCheckLessThan",(e,t)=>{yt.init(e,t);const n=vt[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wt=/* @__PURE__ */Q("$ZodCheckGreaterThan",(e,t)=>{yt.init(e,t);const n=vt[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_t=/* @__PURE__ */Q("$ZodCheckMultipleOf",(e,t)=>{yt.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const s=n>o?n:o;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),kt=/* @__PURE__ */Q("$ZodCheckNumberFormat",(e,t)=>{yt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=ze[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=s,n&&(r.pattern=ft)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a))return void i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),zt=/* @__PURE__ */Q("$ZodCheckMaxLength",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ae(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=Ce(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xt=/* @__PURE__ */Q("$ZodCheckMinLength",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ae(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=Ce(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Et=/* @__PURE__ */Q("$ZodCheckLengthEquals",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ae(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const s=Ce(r),i=o>t.length;n.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),St=/* @__PURE__ */Q("$ZodCheckStringFormat",(e,t)=>{var n,r;yt.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=/* @__PURE__ */new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ot=/* @__PURE__ */Q("$ZodCheckRegex",(e,t)=>{St.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ct=/* @__PURE__ */Q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mt),St.init(e,t)}),It=/* @__PURE__ */Q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gt),St.init(e,t)}),$t=/* @__PURE__ */Q("$ZodCheckIncludes",(e,t)=>{yt.init(e,t);const n=we(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Nt=/* @__PURE__ */Q("$ZodCheckStartsWith",(e,t)=>{yt.init(e,t);const n=new RegExp(`^${we(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Tt=/* @__PURE__ */Q("$ZodCheckEndsWith",(e,t)=>{yt.init(e,t);const n=new RegExp(`.*${we(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),jt=/* @__PURE__ */Q("$ZodCheckOverwrite",(e,t)=>{yt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class At{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Mt={major:4,minor:3,patch:6},Pt=/* @__PURE__ */Q("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mt;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=xe(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===n?.async)throw new ee;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(o||(o=xe(e,t)))});else{if(e.issues.length===t)continue;o||(o=xe(e,t))}}return r?r.then(()=>e):e},n=(n,o,s)=>{if(xe(n))return n.aborted=!0,n;const i=t(o,r,s);if(i instanceof Promise){if(!1===s.async)throw new ee;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if("backward"===s.direction){const t=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,s)):n(t,o,s)}const i=e._zod.parse(o,s);if(i instanceof Promise){if(!1===s.async)throw new ee;return i.then(e=>t(e,r,s))}return t(i,r,s)}}de(e,"~standard",()=>({validate:t=>{try{const n=Pe(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Fe(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Zt=/* @__PURE__ */Q("$ZodString",(e,t)=>{var n;Pt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ft=/* @__PURE__ */Q("$ZodStringFormat",(e,t)=>{St.init(e,t),Zt.init(e,t)}),Dt=/* @__PURE__ */Q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=et),Ft.init(e,t)}),Rt=/* @__PURE__ */Q("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tt(e))}else t.pattern??(t.pattern=tt());Ft.init(e,t)}),Lt=/* @__PURE__ */Q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nt),Ft.init(e,t)}),Ut=/* @__PURE__ */Q("$ZodURL",(e,t)=>{Ft.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Wt=/* @__PURE__ */Q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ft.init(e,t)}),Bt=/* @__PURE__ */Q("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xe),Ft.init(e,t)}),Jt=/* @__PURE__ */Q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=qe),Ft.init(e,t)}),Vt=/* @__PURE__ */Q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ge),Ft.init(e,t)}),qt=/* @__PURE__ */Q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ke),Ft.init(e,t)}),Gt=/* @__PURE__ */Q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=He),Ft.init(e,t)}),Kt=/* @__PURE__ */Q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ye),Ft.init(e,t)}),Ht=/* @__PURE__ */Q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=pt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${dt}T(?:${r})$`)}(t)),Ft.init(e,t)}),Yt=/* @__PURE__ */Q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lt),Ft.init(e,t)}),Xt=/* @__PURE__ */Q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${pt(t)}$`)),Ft.init(e,t)}),Qt=/* @__PURE__ */Q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Qe),Ft.init(e,t)}),en=/* @__PURE__ */Q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rt),Ft.init(e,t),e._zod.bag.format="ipv4"}),tn=/* @__PURE__ */Q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ot),Ft.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),nn=/* @__PURE__ */Q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=st),Ft.init(e,t)}),rn=/* @__PURE__ */Q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=it),Ft.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function on(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const sn=/* @__PURE__ */Q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=at),Ft.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{on(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),an=/* @__PURE__ */Q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ct),Ft.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ct.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return on(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),cn=/* @__PURE__ */Q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ut),Ft.init(e,t)}),un=/* @__PURE__ */Q("$ZodJWT",(e,t)=>{Ft.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),dn=/* @__PURE__ */Q("$ZodNumber",(e,t)=>{Pt.init(e,t),e._zod.pattern=e._zod.bag.pattern??ht,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(i){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),ln=/* @__PURE__ */Q("$ZodNumberFormat",(e,t)=>{kt.init(e,t),dn.init(e,t)}),pn=/* @__PURE__ */Q("$ZodAny",(e,t)=>{Pt.init(e,t),e._zod.parse=e=>e}),fn=/* @__PURE__ */Q("$ZodUnknown",(e,t)=>{Pt.init(e,t),e._zod.parse=e=>e}),hn=/* @__PURE__ */Q("$ZodNever",(e,t)=>{Pt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function mn(e,t,n){e.issues.length&&t.issues.push(...Ee(n,e.issues)),t.value[n]=e.value}const gn=/* @__PURE__ */Q("$ZodArray",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let e=0;e<o.length;e++){const i=o[e],a=t.element._zod.run({value:i,issues:[]},r);a instanceof Promise?s.push(a.then(t=>mn(t,n,e))):mn(a,n,e)}return s.length?Promise.all(s).then(()=>n):n}});function yn(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Ee(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function vn(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bn(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const l in t){if(a.has(l))continue;if("never"===u){i.push(l);continue}const o=c.run({value:t[l],issues:[]},r);o instanceof Promise?e.push(o.then(e=>yn(e,n,l,t,d))):yn(o,n,l,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const wn=/* @__PURE__ */Q("$ZodObject",(e,t)=>{Pt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=ie(()=>vn(t));de(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */new Set);for(const e of r.values)n[t].add(e)}}return n});const o=me,s=t.catchall;let i;e._zod.parse=(t,n)=>{i??(i=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=i.shape;for(const e of i.keys){const r=u[e],o="optional"===r._zod.optout,s=r._zod.run({value:a[e],issues:[]},n);s instanceof Promise?c.push(s.then(n=>yn(n,t,e,a,o))):yn(s,t,e,a,o)}return s?bn(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),_n=/* @__PURE__ */Q("$ZodObjectJIT",(e,t)=>{wn.init(e,t);const n=e._zod.parse,r=ie(()=>vn(t));let o;const s=me,i=!ne.jitless,a=i&&ge.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=r.value);const p=d.value;return s(p)?i&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new At(["shape","payload","ctx"]),n=r.value,o=e=>{const t=fe(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=/* @__PURE__ */Object.create(null);let i=0;for(const r of n.keys)s[r]="key_"+i++;t.write("const newResult = {};");for(const r of n.keys){const n=s[r],i=fe(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),c?t.write(`\n if (${n}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,l),c?bn([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function kn(e,t,n,r){for(const s of e)if(0===s.issues.length)return t.value=s.value,t;const o=e.filter(e=>!xe(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Oe(e,r,re())))}),t)}const zn=/* @__PURE__ */Q("$ZodUnion",(e,t)=>{Pt.init(e,t),de(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),de(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>ce(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},s);if(t instanceof Promise)a.push(t),i=!0;else{if(0===t.issues.length)return t;a.push(t)}}return i?Promise.all(a).then(t=>kn(t,o,e,s)):kn(a,o,e,s)}}),xn=/* @__PURE__ */Q("$ZodIntersection",(e,t)=>{Pt.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([t,n])=>Sn(e,t,n)):Sn(e,o,s)}});function En(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ye(e)&&ye(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const s of r){const n=En(e[s],t[s]);if(!n.valid)return{valid:!1,mergeErrorPath:[s,...n.mergeErrorPath]};o[s]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=En(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Sn(e,t,n){const r=/* @__PURE__ */new Map;let o;for(const a of t.issues)if("unrecognized_keys"===a.code){o??(o=a);for(const e of a.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(a);for(const a of n.issues)if("unrecognized_keys"===a.code)for(const e of a.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(a);const s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&o&&e.issues.push({...o,keys:s}),xe(e))return e;const i=En(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const On=/* @__PURE__ */Q("$ZodEnum",(e,t)=>{Pt.init(e,t);const n=oe(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>be.has(typeof e)).map(e=>"string"==typeof e?we(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),Cn=/* @__PURE__ */Q("$ZodTransform",(e,t)=>{Pt.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new te(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new ee;return n.value=o,n}});function In(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const $n=/* @__PURE__ */Q("$ZodOptional",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>In(t,e.value)):In(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Nn=/* @__PURE__ */Q("$ZodExactOptional",(e,t)=>{$n.init(e,t),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Tn=/* @__PURE__ */Q("$ZodNullable",(e,t)=>{Pt.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)}|null)$`):void 0}),de(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),jn=/* @__PURE__ */Q("$ZodDefault",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>An(e,t)):An(r,t)}});function An(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Mn=/* @__PURE__ */Q("$ZodPrefault",(e,t)=>{Pt.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Pn=/* @__PURE__ */Q("$ZodNonOptional",(e,t)=>{Pt.init(e,t),de(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Zn(t,e)):Zn(o,e)}});function Zn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Fn=/* @__PURE__ */Q("$ZodCatch",(e,t)=>{Pt.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Oe(e,n,re()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Oe(e,n,re()))},input:e.value}),e.issues=[]),e)}}),Dn=/* @__PURE__ */Q("$ZodPipe",(e,t)=>{Pt.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Rn(e,t.in,n)):Rn(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Rn(e,t.out,n)):Rn(r,t.out,n)}});function Rn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ln=/* @__PURE__ */Q("$ZodReadonly",(e,t)=>{Pt.init(e,t),de(e._zod,"propValues",()=>t.innerType._zod.propValues),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"optin",()=>t.innerType?._zod?.optin),de(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Un):Un(r)}});function Un(e){return e.value=Object.freeze(e.value),e}const Wn=/* @__PURE__ */Q("$ZodCustom",(e,t)=>{yt.init(e,t),Pt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Bn(t,n,r,e));Bn(o,n,r,e)}});function Bn(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ie(e))}}var Jn;(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=new class{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Vn=globalThis.__zod_globalRegistry;function qn(e,t){return new e({type:"string",...ke(t)})}function Gn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Kn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function Hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function Yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function Xn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function Qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function er(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function tr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function nr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function rr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function or(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function sr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function ir(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function ar(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function cr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function ur(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function dr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function lr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function pr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function fr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function hr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function mr(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function gr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function yr(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function vr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function br(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function wr(e,t){return new e({type:"number",checks:[],...ke(t)})}function _r(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}function kr(e){return new e({type:"any"})}function zr(e){return new e({type:"unknown"})}function xr(e,t){return new e({type:"never",...ke(t)})}function Er(e,t){return new bt({check:"less_than",...ke(t),value:e,inclusive:!1})}function Sr(e,t){return new bt({check:"less_than",...ke(t),value:e,inclusive:!0})}function Or(e,t){return new wt({check:"greater_than",...ke(t),value:e,inclusive:!1})}function Cr(e,t){return new wt({check:"greater_than",...ke(t),value:e,inclusive:!0})}function Ir(e,t){return new _t({check:"multiple_of",...ke(t),value:e})}function $r(e,t){return new zt({check:"max_length",...ke(t),maximum:e})}function Nr(e,t){return new xt({check:"min_length",...ke(t),minimum:e})}function Tr(e,t){return new Et({check:"length_equals",...ke(t),length:e})}function jr(e,t){return new Ot({check:"string_format",format:"regex",...ke(t),pattern:e})}function Ar(e){return new Ct({check:"string_format",format:"lowercase",...ke(e)})}function Mr(e){return new It({check:"string_format",format:"uppercase",...ke(e)})}function Pr(e,t){return new $t({check:"string_format",format:"includes",...ke(t),includes:e})}function Zr(e,t){return new Nt({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function Fr(e,t){return new Tt({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function Dr(e){return new jt({check:"overwrite",tx:e})}function Rr(e){/* @__PURE__ */
16
- return Dr(t=>t.normalize(e))}function Lr(){/* @__PURE__ */
17
- return Dr(e=>e.trim())}function Ur(){/* @__PURE__ */
18
- return Dr(e=>e.toLowerCase())}function Wr(){/* @__PURE__ */
19
- return Dr(e=>e.toUpperCase())}function Br(){/* @__PURE__ */
20
- return Dr(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Jr(e,t,n){return new e({type:"array",element:t,...ke(n)})}function Vr(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function qr(e){const t=/* @__PURE__ */Gr(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Ie(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Ie(r))}},e(n.value,n)));return t}function Gr(e,t){const n=new yt({check:"custom",...ke(t)});return n._zod.check=e,n}function Kr(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:/* @__PURE__ */new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Hr(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{const n=i.schema,s=t.processors[o.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);s(e,t,n,r)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),Hr(s,t,r),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),"input"===t.io&&Qr(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Yr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=/* @__PURE__ */new Map;for(const s of e.seen.entries()){const t=e.metadataRegistry.get(s[0])?.id;if(t){const e=r.get(t);if(e&&e!==s[0])throw new Error(`Duplicate schema id "${t}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(t,s[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:s}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${o("__shared")}#/${r}/${s}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:o+s}})(t);r.def={...r.schema},s&&(r.defId=s);const i=r.schema;for(const e in i)delete i[e];i.$ref=o};if("throw"===e.cycles)for(const s of e.seen.entries()){const e=s[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const n=s[1];if(t===s[0]){o(s);continue}if(e.external){const n=e.external.registry.get(s[0])?.id;if(t!==s[0]&&n){o(s);continue}}const r=e.metadataRegistry.get(s[0])?.id;(r||n.cycle||n.count>1&&"ref"===e.reused)&&o(s)}}function Xr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,s={...o},i=n.ref;if(n.ref=null,i){r(i);const n=e.seen.get(i),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,s),t._zod.parent===i)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in s||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==i){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const a of e.seen.entries()){const e=a[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?o.$defs=s:o.definitions=s);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:eo(t,"input",e.processors),output:eo(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(i){throw new Error("Error converting schema to JSON.")}}function Qr(e,t){const n=t??{seen:/* @__PURE__ */new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Qr(r.element,n);if("set"===r.type)return Qr(r.valueType,n);if("lazy"===r.type)return Qr(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Qr(r.innerType,n);if("intersection"===r.type)return Qr(r.left,n)||Qr(r.right,n);if("record"===r.type||"map"===r.type)return Qr(r.keyType,n)||Qr(r.valueType,n);if("pipe"===r.type)return Qr(r.in,n)||Qr(r.out,n);if("object"===r.type){for(const e in r.shape)if(Qr(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Qr(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Qr(e,n))return!0;return!(!r.rest||!Qr(r.rest,n))}return!1}const eo=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=Kr({...o??{},target:s,io:t,processors:n});return Hr(e,i),Yr(i,e),Xr(i,e)},to={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},no=(e,t,n,r)=>{const o=e._zod.def;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType},ro=/* @__PURE__ */Q("ZodISODateTime",(e,t)=>{Ht.init(e,t),Eo.init(e,t)}),oo=/* @__PURE__ */Q("ZodISODate",(e,t)=>{Yt.init(e,t),Eo.init(e,t)}),so=/* @__PURE__ */Q("ZodISOTime",(e,t)=>{Xt.init(e,t),Eo.init(e,t)}),io=/* @__PURE__ */Q("ZodISODuration",(e,t)=>{Qt.init(e,t),Eo.init(e,t)}),ao=Q("ZodError",(e,t)=>{Ne.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,se,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,se,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),co=/* @__PURE__ */je(ao),uo=/* @__PURE__ */Ae(ao),lo=/* @__PURE__ */Me(ao),po=/* @__PURE__ */Ze(ao),fo=/* @__PURE__ */De(ao),ho=/* @__PURE__ */Re(ao),mo=/* @__PURE__ */Le(ao),go=/* @__PURE__ */Ue(ao),yo=/* @__PURE__ */We(ao),vo=/* @__PURE__ */Be(ao),bo=/* @__PURE__ */Je(ao),wo=/* @__PURE__ */Ve(ao),_o=/* @__PURE__ */Q("ZodType",(e,t)=>(Pt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:eo(e,"input"),output:eo(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Kr({...n,processors:t});return Hr(e,r),Yr(r,e),Xr(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(pe(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>_e(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>co(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lo(e,t,n),e.parseAsync=async(t,n)=>uo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>po(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>fo(e,t,n),e.decode=(t,n)=>ho(e,t,n),e.encodeAsync=async(t,n)=>mo(e,t,n),e.decodeAsync=async(t,n)=>go(e,t,n),e.safeEncode=(t,n)=>yo(e,t,n),e.safeDecode=(t,n)=>vo(e,t,n),e.safeEncodeAsync=async(t,n)=>bo(e,t,n),e.safeDecodeAsync=async(t,n)=>wo(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){/* @__PURE__ */
21
- return Vr(vs,e,t)}(t,n)),e.superRefine=t=>e.check(/* @__PURE__ */qr(t)),e.overwrite=t=>e.check(/* @__PURE__ */Dr(t)),e.optional=()=>as(e),e.exactOptional=()=>new cs({type:"optional",innerType:e}),e.nullable=()=>ds(e),e.nullish=()=>as(ds(e)),e.nonoptional=t=>function(e,t){return new fs({type:"nonoptional",innerType:e,...ke(t)})}(e,t),e.array=()=>/* @__PURE__ */Jr(Qo,e,void 0),e.or=t=>new ts({type:"union",options:[e,t],...ke(void 0)}),e.and=t=>new ns({type:"intersection",left:e,right:t}),e.transform=t=>gs(e,new ss({type:"transform",transform:t})),e.default=t=>{return n=t,new ls({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ve(n)}});var n},e.prefault=t=>{return n=t,new ps({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ve(n)}});var n},e.catch=t=>{return new hs({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>gs(e,t),e.readonly=()=>new ys({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Vn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Vn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Vn.get(e);const n=e.clone();return Vn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),ko=/* @__PURE__ */Q("_ZodString",(e,t)=>{Zt.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:s,format:i,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof s&&(r.maxLength=s),i&&(r.format=to[i]??i,""===r.format&&delete r.format,"time"===i&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(/* @__PURE__ */jr(...t)),e.includes=(...t)=>e.check(/* @__PURE__ */Pr(...t)),e.startsWith=(...t)=>e.check(/* @__PURE__ */Zr(...t)),e.endsWith=(...t)=>e.check(/* @__PURE__ */Fr(...t)),e.min=(...t)=>e.check(/* @__PURE__ */Nr(...t)),e.max=(...t)=>e.check(/* @__PURE__ */$r(...t)),e.length=(...t)=>e.check(/* @__PURE__ */Tr(...t)),e.nonempty=(...t)=>e.check(/* @__PURE__ */Nr(1,...t)),e.lowercase=t=>e.check(/* @__PURE__ */Ar(t)),e.uppercase=t=>e.check(/* @__PURE__ */Mr(t)),e.trim=()=>e.check(/* @__PURE__ */Lr()),e.normalize=(...t)=>e.check(/* @__PURE__ */Rr(...t)),e.toLowerCase=()=>e.check(/* @__PURE__ */Ur()),e.toUpperCase=()=>e.check(/* @__PURE__ */Wr()),e.slugify=()=>e.check(/* @__PURE__ */Br())}),zo=/* @__PURE__ */Q("ZodString",(e,t)=>{Zt.init(e,t),ko.init(e,t),e.email=t=>e.check(/* @__PURE__ */Gn(So,t)),e.url=t=>e.check(/* @__PURE__ */er(Io,t)),e.jwt=t=>e.check(/* @__PURE__ */mr(Bo,t)),e.emoji=t=>e.check(/* @__PURE__ */tr($o,t)),e.guid=t=>e.check(/* @__PURE__ */Kn(Oo,t)),e.uuid=t=>e.check(/* @__PURE__ */Hn(Co,t)),e.uuidv4=t=>e.check(/* @__PURE__ */Yn(Co,t)),e.uuidv6=t=>e.check(/* @__PURE__ */Xn(Co,t)),e.uuidv7=t=>e.check(/* @__PURE__ */Qn(Co,t)),e.nanoid=t=>e.check(/* @__PURE__ */nr(No,t)),e.guid=t=>e.check(/* @__PURE__ */Kn(Oo,t)),e.cuid=t=>e.check(/* @__PURE__ */rr(To,t)),e.cuid2=t=>e.check(/* @__PURE__ */or(jo,t)),e.ulid=t=>e.check(/* @__PURE__ */sr(Ao,t)),e.base64=t=>e.check(/* @__PURE__ */pr(Lo,t)),e.base64url=t=>e.check(/* @__PURE__ */fr(Uo,t)),e.xid=t=>e.check(/* @__PURE__ */ir(Mo,t)),e.ksuid=t=>e.check(/* @__PURE__ */ar(Po,t)),e.ipv4=t=>e.check(/* @__PURE__ */cr(Zo,t)),e.ipv6=t=>e.check(/* @__PURE__ */ur(Fo,t)),e.cidrv4=t=>e.check(/* @__PURE__ */dr(Do,t)),e.cidrv6=t=>e.check(/* @__PURE__ */lr(Ro,t)),e.e164=t=>e.check(/* @__PURE__ */hr(Wo,t)),e.datetime=t=>e.check(function(e){/* @__PURE__ */
22
- return gr(ro,e)}(t)),e.date=t=>e.check(function(e){/* @__PURE__ */
23
- return yr(oo,e)}(t)),e.time=t=>e.check(function(e){/* @__PURE__ */
24
- return vr(so,e)}(t)),e.duration=t=>e.check(function(e){/* @__PURE__ */
25
- return br(io,e)}(t))});function xo(e){/* @__PURE__ */
26
- return qn(zo,e)}const Eo=/* @__PURE__ */Q("ZodStringFormat",(e,t)=>{Ft.init(e,t),ko.init(e,t)}),So=/* @__PURE__ */Q("ZodEmail",(e,t)=>{Lt.init(e,t),Eo.init(e,t)}),Oo=/* @__PURE__ */Q("ZodGUID",(e,t)=>{Dt.init(e,t),Eo.init(e,t)}),Co=/* @__PURE__ */Q("ZodUUID",(e,t)=>{Rt.init(e,t),Eo.init(e,t)}),Io=/* @__PURE__ */Q("ZodURL",(e,t)=>{Ut.init(e,t),Eo.init(e,t)}),$o=/* @__PURE__ */Q("ZodEmoji",(e,t)=>{Wt.init(e,t),Eo.init(e,t)}),No=/* @__PURE__ */Q("ZodNanoID",(e,t)=>{Bt.init(e,t),Eo.init(e,t)}),To=/* @__PURE__ */Q("ZodCUID",(e,t)=>{Jt.init(e,t),Eo.init(e,t)}),jo=/* @__PURE__ */Q("ZodCUID2",(e,t)=>{Vt.init(e,t),Eo.init(e,t)}),Ao=/* @__PURE__ */Q("ZodULID",(e,t)=>{qt.init(e,t),Eo.init(e,t)}),Mo=/* @__PURE__ */Q("ZodXID",(e,t)=>{Gt.init(e,t),Eo.init(e,t)}),Po=/* @__PURE__ */Q("ZodKSUID",(e,t)=>{Kt.init(e,t),Eo.init(e,t)}),Zo=/* @__PURE__ */Q("ZodIPv4",(e,t)=>{en.init(e,t),Eo.init(e,t)}),Fo=/* @__PURE__ */Q("ZodIPv6",(e,t)=>{tn.init(e,t),Eo.init(e,t)}),Do=/* @__PURE__ */Q("ZodCIDRv4",(e,t)=>{nn.init(e,t),Eo.init(e,t)}),Ro=/* @__PURE__ */Q("ZodCIDRv6",(e,t)=>{rn.init(e,t),Eo.init(e,t)}),Lo=/* @__PURE__ */Q("ZodBase64",(e,t)=>{sn.init(e,t),Eo.init(e,t)}),Uo=/* @__PURE__ */Q("ZodBase64URL",(e,t)=>{an.init(e,t),Eo.init(e,t)}),Wo=/* @__PURE__ */Q("ZodE164",(e,t)=>{cn.init(e,t),Eo.init(e,t)}),Bo=/* @__PURE__ */Q("ZodJWT",(e,t)=>{un.init(e,t),Eo.init(e,t)}),Jo=/* @__PURE__ */Q("ZodNumber",(e,t)=>{dn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:s,format:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof i&&i.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof o&&(r.minimum=o,"number"==typeof u&&"draft-04"!==t.target&&(u>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof s&&(r.maximum=s,"number"==typeof c&&"draft-04"!==t.target&&(c<=s?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(/* @__PURE__ */Or(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */Cr(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */Cr(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */Er(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */Sr(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */Sr(t,n)),e.int=t=>e.check(Go(t)),e.safe=t=>e.check(Go(t)),e.positive=t=>e.check(/* @__PURE__ */Or(0,t)),e.nonnegative=t=>e.check(/* @__PURE__ */Cr(0,t)),e.negative=t=>e.check(/* @__PURE__ */Er(0,t)),e.nonpositive=t=>e.check(/* @__PURE__ */Sr(0,t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */Ir(t,n)),e.step=(t,n)=>e.check(/* @__PURE__ */Ir(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Vo(e){/* @__PURE__ */
27
- return wr(Jo,e)}const qo=/* @__PURE__ */Q("ZodNumberFormat",(e,t)=>{ln.init(e,t),Jo.init(e,t)});function Go(e){/* @__PURE__ */
28
- return _r(qo,e)}const Ko=/* @__PURE__ */Q("ZodAny",(e,t)=>{pn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}),Ho=/* @__PURE__ */Q("ZodUnknown",(e,t)=>{fn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Yo(){/* @__PURE__ */
29
- return zr(Ho)}const Xo=/* @__PURE__ */Q("ZodNever",(e,t)=>{hn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}),Qo=/* @__PURE__ */Q("ZodArray",(e,t)=>{gn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;"number"==typeof i&&(o.minItems=i),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=Hr(s.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(/* @__PURE__ */Nr(t,n)),e.nonempty=t=>e.check(/* @__PURE__ */Nr(1,t)),e.max=(t,n)=>e.check(/* @__PURE__ */$r(t,n)),e.length=(t,n)=>e.check(/* @__PURE__ */Tr(t,n)),e.unwrap=()=>e.element}),es=/* @__PURE__ */Q("ZodObject",(e,t)=>{_n.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=Hr(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(e=>{const n=s.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(o.required=Array.from(c)),"never"===s.catchall?._zod.def.type?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Hr(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),de(e,"shape",()=>t.shape),e.keyof=()=>os(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yo()}),e.strict=()=>e.clone({...e._zod.def,catchall:/* @__PURE__ */xr(Xo,void 0)}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ye(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=pe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return le(this,"shape",n),n}});return _e(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!ye(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=pe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return le(this,"shape",n),n}});return _e(e,n)}(e,t),e.merge=t=>function(e,t){const n=pe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return le(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return _e(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return _e(e,pe(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return le(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=pe(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return le(this,"shape",r),r},checks:[]});return _e(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=pe(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return le(this,"shape",o),o},checks:[]});return _e(t,o)}(is,e,t[0]),e.required=(...t)=>function(e,t,n){const r=pe(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return le(this,"shape",o),o}});return _e(t,r)}(fs,e,t[0])}),ts=/* @__PURE__ */Q("ZodUnion",(e,t)=>{zn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=!1===o.inclusive,i=o.options.map((e,n)=>Hr(e,t,{...r,path:[...r.path,s?"oneOf":"anyOf",n]}));s?n.oneOf=i:n.anyOf=i})(e,t,n,r),e.options=t.options}),ns=/* @__PURE__ */Q("ZodIntersection",(e,t)=>{xn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=Hr(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Hr(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c})(e,t,n,r)}),rs=/* @__PURE__ */Q("ZodEnum",(e,t)=>{On.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=oe(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const s of e){if(!n.has(s))throw new Error(`Key ${s} not found in enum`);o[s]=t.entries[s]}return new rs({...t,checks:[],...ke(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new rs({...t,checks:[],...ke(r),entries:o})}});function os(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new rs({type:"enum",entries:n,...ke(t)})}const ss=/* @__PURE__ */Q("ZodTransform",(e,t)=>{Cn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new te(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Ie(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Ie(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}}),is=/* @__PURE__ */Q("ZodOptional",(e,t)=>{$n.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function as(e){return new is({type:"optional",innerType:e})}const cs=/* @__PURE__ */Q("ZodExactOptional",(e,t)=>{Nn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),us=/* @__PURE__ */Q("ZodNullable",(e,t)=>{Tn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=Hr(o.innerType,t,r),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ds(e){return new us({type:"nullable",innerType:e})}const ls=/* @__PURE__ */Q("ZodDefault",(e,t)=>{jn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ps=/* @__PURE__ */Q("ZodPrefault",(e,t)=>{Mn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),fs=/* @__PURE__ */Q("ZodNonOptional",(e,t)=>{Pn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),hs=/* @__PURE__ */Q("ZodCatch",(e,t)=>{Fn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let s;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ms=/* @__PURE__ */Q("ZodPipe",(e,t)=>{Dn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;Hr(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function gs(e,t){return new ms({type:"pipe",in:e,out:t})}const ys=/* @__PURE__ */Q("ZodReadonly",(e,t)=>{Ln.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Hr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),vs=/* @__PURE__ */Q("ZodCustom",(e,t)=>{Wn.init(e,t),_o.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}),bs="chat_device_id";function ws(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const _s=function(){const e={type:"object",shape:{id:xo().optional(),type:os(["text","image","audio","location","system"]).default("text"),content:xo().optional(),imageUrl:xo().url().optional(),audioUrl:xo().url().optional(),latitude:Vo().optional(),longitude:Vo().optional(),timestamp:xo().optional(),sender:os(["bot","user","system"]).optional(),emotion:/* @__PURE__ */kr(Ko).optional()}??{},...ke(void 0)};return new es(e)}();class ks{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(e,t){this.endpoint=e,this.apiKey=t,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(e){this.track("message_sent",{type:e})}trackMessageReceived(e,t){this.track("message_received",{type:e,latency:t})}trackError(e,t){this.track("error",{error:e,context:t})}trackConnectionStatus(e){this.track("connection_status",{isConnected:e})}trackFeatureUsed(e){this.track("feature_used",{feature:e})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(e,t){this.track("attachment_sent",{type:e,size:t})}track(e,t){this.isDisabled||(this.queue.push({event:e,properties:{...t,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),p.warn("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const e=[...this.queue];this.queue=[];try{const t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:e}),keepalive:!0});t.ok?p.debug(`Analytics: Flushed ${e.length} events`):(this.isDisabled=!0,this.queue=[],p.debug(`Analytics disabled: endpoint returned ${t.status}`))}catch(t){this.isDisabled=!0,this.queue=[],p.debug("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let zs=null,xs=null;function Es(e){zs=e}function Ss(e){xs=e}const Os=e.createContext(null);function Cs({children:n,defaultLocale:r,initialState:o,onStateChange:s,...i}){const[a,c]=e.useState(o?.isOpen??!1),[u,d]=e.useState(0),l=e.useCallback(()=>{c(!0),d(0),s?.(!0)},[s]),f=e.useCallback(()=>{c(!1),s?.(!1)},[s]),h=e.useCallback(()=>{c(e=>{const t=!e;return t&&d(0),s?.(t),t})},[s]),m=e.useCallback(e=>{zs?(zs(e),p.debug("ChatWidgetProvider sendMessage:",e)):p.warn("sendMessage called but no handler registered")},[]),y=e.useCallback(()=>{xs?(xs(),p.debug("ChatWidgetProvider clearMessages called")):p.warn("clearMessages called but no handler registered")},[]),v={isOpen:a,open:l,close:f,toggle:h,sendMessage:m,clearMessages:y,unreadCount:u},b=e.useCallback((e,t)=>{"message:received"!==e||a||d(e=>e+1),i.onEvent?.(e,t)},[a,i]);/* @__PURE__ */
30
- return t.jsx(g,{defaultLocale:r,children:/* @__PURE__ */t.jsxs(Os.Provider,{value:v,children:[n,
31
- /* @__PURE__ */t.jsx(Ts,{...i,onStateChange:e=>{c(e),e&&d(0),s?.(e)},onEvent:b})]})})}function Is(){const t=e.useContext(Os);if(!t)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return t}const $s=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)});function Ns(t){const{apiKey:n,apiBaseUrl:r,pageContext:s,includeSEOMetadata:i=!1,theme:a,userContext:u,onLogin:d,onNavigate:l,onEvent:f,onStateChange:g,onThemeUpdate:y}=t,[v,b]=e.useState(0),w=e.useRef(0),{t:k}=o(),z=function(t,n,r=!0){const o=e.useRef(null);return e.useEffect(()=>{if(!r||!t||!n)return;const e=`${t}/analytics`;o.current=new ks(e,n);const s=()=>o.current?.flush(),i=()=>{"hidden"===document.visibilityState&&o.current?.flush()};return window.addEventListener("beforeunload",s),window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("beforeunload",s),window.removeEventListener("visibilitychange",i),o.current?.destroy()}},[t,n,r]),{trackOpen:e.useCallback(()=>{o.current?.trackOpen()},[]),trackClose:e.useCallback(()=>{o.current?.trackClose()},[]),trackMessageSent:e.useCallback(e=>{o.current?.trackMessageSent(e)},[]),trackMessageReceived:e.useCallback((e,t)=>{o.current?.trackMessageReceived(e,t)},[]),trackError:e.useCallback((e,t)=>{o.current?.trackError(e,t)},[]),trackConnectionStatus:e.useCallback(e=>{o.current?.trackConnectionStatus(e)},[]),trackFeatureUsed:e.useCallback(e=>{o.current?.trackFeatureUsed(e)},[])}}(r,n,!0),x=function({enabled:t=!0,soundEnabled:n=!0,desktopEnabled:r=!0,botName:o="Asistente",logoUrl:s,notificationSoundUrl:i}={}){const[a,u]=e.useState("default"),d=e.useRef(null),l=s||c,f=i||m;e.useEffect(()=>{n&&"undefined"!=typeof window&&(d.current=new Audio(f),d.current.volume=.3)},[n,f]),e.useEffect(()=>{"undefined"!=typeof window&&"Notification"in window&&u(Notification.permission)},[]);const h=e.useCallback(async()=>{if("undefined"==typeof window||!("Notification"in window))return p.warn("Notifications API not available"),!1;try{const e=await Notification.requestPermission();return u(e),p.info("Notification permission:",e),"granted"===e}catch(e){return p.error("Error requesting notification permission:",e),!1}},[]),g=e.useCallback(e=>{if(t&&r&&"granted"===a&&("undefined"==typeof document||!document.hasFocus()))try{const t=`Nuevo mensaje de ${o}`;let n="Mensaje recibido";"text"===e.type&&"content"in e?n=e.content?.slice(0,100)||"Mensaje recibido":"image"===e.type?n="📷 Imagen":"audio"===e.type?n="🎵 Audio":"location"===e.type&&(n="📍 Ubicación");const r=new Notification(t,{body:n,icon:l,tag:"chat-message",requireInteraction:!1,silent:!1});r.onclick=()=>{window.focus(),r.close()},setTimeout(()=>r.close(),5e3)}catch(n){p.error("Error showing notification:",n)}},[t,r,a,o,l]),y=e.useCallback(()=>{if(t&&n&&("undefined"==typeof document||!document.hasFocus()))try{d.current?.play().catch(e=>{p.debug("Audio playback blocked:",e)})}catch(e){p.error("Error playing sound:",e)}},[t,n]),v=e.useCallback(e=>{g(e),y()},[g,y]);return{permission:a,requestPermission:h,notify:g,playSound:y,notifyWithSound:v}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:a?.botName||"Asistente",logoUrl:a?.logoUrl}),E=function(t=10,n=6e4){const r=e.useRef([]);return{isAllowed:e.useCallback(()=>{const e=Date.now();return r.current=r.current.filter(t=>e-t<n),!(r.current.length>=t||(r.current.push(e),0))},[t,n]),getRemainingAttempts:e.useCallback(()=>{const e=Date.now();return r.current=r.current.filter(t=>e-t<n),Math.max(0,t-r.current.length)},[t,n]),getTimeUntilReset:e.useCallback(()=>{if(0===r.current.length)return 0;const e=Date.now(),t=r.current[0],o=n-(e-t);return Math.max(0,o)},[n]),reset:e.useCallback(()=>{r.current=[]},[])}}(10,6e4),{state:S,actions:O}=function(){const[t,n]=e.useReducer(X,Y),[r,o]=e.useState(!1);e.useEffect(()=>{"undefined"==typeof window||r||(async()=>{try{await K.migrateFromLocalStorage();const e=await K.getMessages(100),t=await K.getMetadata();if(e.length>0||t){const r={messages:e.map(e=>({...e,timestamp:new Date(e.timestamp)})),sessionId:t?.sessionId||null,isOpen:t?.isOpen||!1};n({type:"RESTORE_SESSION",payload:r})}}catch(e){p.warn("Chat: Error rehydrating from IndexedDB",e);try{const e=localStorage.getItem(H);if(e){const t=JSON.parse(e);t.messages&&(t.messages=t.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))),n({type:"RESTORE_SESSION",payload:t})}}catch(t){p.error("Chat: Fallback rehydration failed",t)}}finally{o(!0)}})()},[r]),e.useEffect(()=>{if(!r)return;const e=setTimeout(async()=>{try{await K.saveMessages(t.messages),await K.setMetadata({isOpen:t.isOpen,sessionId:t.sessionId})}catch(e){p.error("Chat Persistence Error:",e);try{const e={isOpen:t.isOpen,messages:t.messages,sessionId:t.sessionId};localStorage.setItem(H,JSON.stringify(e))}catch(n){p.error("Chat: Fallback persistence failed",n)}}},500);return()=>clearTimeout(e)},[t.isOpen,t.messages,t.sessionId,r]);const s=e.useCallback(e=>{n({type:"ADD_MESSAGE",payload:e})},[]),i=e.useCallback(()=>n({type:"TOGGLE_WINDOW"}),[]),a=e.useCallback(()=>n({type:"OPEN_WINDOW"}),[]),c=e.useCallback(()=>n({type:"CLOSE_WINDOW"}),[]),u=e.useCallback(e=>n({type:"SET_CONNECTED",payload:e}),[]),d=e.useCallback(e=>n({type:"SET_TYPING",payload:e}),[]),l=e.useCallback(e=>n({type:"SET_MESSAGES",payload:e}),[]),f=e.useCallback(e=>n({type:"SET_ERROR",payload:e}),[]),h=e.useCallback(e=>n({type:"SET_SESSION_ID",payload:e}),[]),m=e.useCallback(()=>{localStorage.removeItem(H),n({type:"CLEAR_CHAT"})},[]),g=e.useCallback(()=>{n({type:"SET_MESSAGES",payload:[]})},[]);return{state:t,isHydrated:r,actions:{toggleWindow:i,openWindow:a,closeWindow:c,setConnected:u,setTyping:d,addMessage:s,setMessages:l,setError:f,setSessionId:h,clearChat:m,clearMessages:g}}}(),C=function(t=!1){const n="undefined"!=typeof window?window.location.pathname:"",r=e.useMemo(()=>n,[n]),[o,s]=e.useState({});return e.useEffect(()=>{if(!t)return void s({});const e=setTimeout(()=>{const e=function(){if("undefined"==typeof window)return{};const e={};e.title=document.title,document.querySelectorAll("meta").forEach(t=>{const n=t.getAttribute("name"),r=t.getAttribute("property"),o=t.getAttribute("content");if(o){if(n)switch(n){case"description":e.description=o;break;case"keywords":e.keywords=o.split(",").map(e=>e.trim());break;case"author":e.author=o}if(r){if(r.startsWith("og:")){const t=r.replace("og:","og_");e[t]=o}if(r.startsWith("twitter:")){const t=r.replace("twitter:","twitter_");e[t]=o}}}});try{const t=document.querySelectorAll('script[type="application/ld+json"]');if(t.length>0){const n=[];t.forEach(e=>{try{const t=JSON.parse(e.textContent||"");n.push(t)}catch{}}),n.length>0&&(e.structuredData=n)}}catch{}return e}();s(e)},100);return()=>clearTimeout(e)},[r,t]),t&&Object.keys(o).length>0?o:void 0}(i),I=function(t){const{apiKey:n,apiBaseUrl:r,pageContext:o,userContext:s}=t,i=e.useRef(t);e.useEffect(()=>{i.current=t},[t]);const a=e.useRef(null),[c,u]=e.useState(!1),[d,l]=e.useState(!1),f=e.useRef(function(){try{const e=localStorage.getItem(bs);if(e)return e;const t=ws();return localStorage.setItem(bs,t),t}catch{return p.warn("localStorage not available, using session-only device ID"),ws()}}()),m=e.useRef(o);e.useEffect(()=>{m.current=o},[o]);const g=e.useCallback(e=>{const t=_s.safeParse(e),n=t.success&&t.data.id?t.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,r=t.success&&t.data.sender?t.data.sender:"bot",o=t.success&&t.data.timestamp?new Date(t.data.timestamp):/* @__PURE__ */new Date,s=t.success?t.data:{type:"text"};switch(s.type){case"image":return{id:n,type:"image",sender:r,timestamp:o,imageUrl:s.imageUrl||s.content||"",altText:"Imagen enviada"};case"audio":return{id:n,type:"audio",sender:r,timestamp:o,content:s.audioUrl||s.content||""};case"location":return{id:n,type:"location",sender:r,timestamp:o,latitude:Number(s.latitude||0),longitude:Number(s.longitude||0),name:s.content||"Ubicación compartida"};case"system":return{id:n,type:"system",sender:"system",timestamp:o,content:String(s.content||"")};default:return{id:n,type:"text",sender:r,timestamp:o,content:String(s.content||"Sin contenido"),emotion:s.emotion}}},[]),y=e.useCallback(()=>{if(!n||!r)return;if(a.current?.connected)return;u(!0);const e=_(`${r}/webchat`,{auth:{apiKey:n,deviceId:f.current,token:s?.token,metadata:s?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});e.on("connect",()=>{u(!1),l(!0),i.current.onConnected(`temp-${Date.now()}`,void 0)}),e.on("disconnect",e=>{u(!1),l(!1),i.current.onDisconnected()}),e.on("connect_error",e=>{u(!1),i.current.onError(`Error de conexión: ${e.message}`)}),e.on("connection_ack",e=>{i.current.onConnected(e.sessionId,e.config)}),e.on("bot_message",e=>{try{i.current.onMessage(g(e))}catch(t){p.error("ChatSocket Error processing bot_message:",t)}}),e.on("chat_history",e=>{e.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{try{i.current.onMessage(g(e))}catch(t){p.debug("Error processing history message:",t)}}),i.current.onEvent&&i.current.onEvent("history_loaded",e)}),e.on("bot_typing",e=>i.current.onTyping(e)),e.on("auth_success",e=>{i.current.onLogin&&i.current.onLogin(e),e.theme&&i.current.onThemeUpdate&&i.current.onThemeUpdate(e.theme)}),a.current=e},[n,r]),v=e.useCallback(()=>{a.current&&(a.current.disconnect(),a.current=null,l(!1))},[]),b=e.useRef(y);b.current=y,e.useEffect(()=>(b.current(),()=>{a.current&&(a.current.disconnect(),a.current=null)}),[]);const w=e.useRef([]),k=e.useRef([]),z=e.useCallback(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),x=e.useCallback(()=>{if(a.current?.connected)for(;w.current.length>0;){const e=w.current.shift();a.current.emit("user_message",e)}},[]);e.useEffect(()=>{d&&x()},[d,x]),e.useEffect(()=>{if(!d)return;const e=setInterval(()=>{const e=Date.now();k.current=k.current.filter(t=>e<t.nextRetryAt||(t.attempts>=t.maxAttempts?(i.current.onEvent?.("message_failed",{id:t.id,payload:t.payload}),p.error("Message failed after max retries:",t.id),!1):!a.current?.connected||(a.current.emit("user_message",t.payload,e=>{e?.success&&i.current.onEvent?.("message_sent",{id:t.id})}),t.attempts++,t.nextRetryAt=e+1e3*Math.pow(2,t.attempts),t.attempts<t.maxAttempts)))},500);return()=>clearInterval(e)},[d]);const E=e.useCallback((e,t="text")=>{const n=z(),r={...m.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:/* @__PURE__ */(new Date).toISOString(),deviceId:f.current},o={id:n,content:e.trim(),type:t,metadata:r};return a.current?.connected?(a.current.emit("user_message",o,e=>{!1!==e?.success&&e?i.current.onEvent?.("message_sent",{id:n}):(k.current.push({id:n,payload:o,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),i.current.onEvent?.("message_retry_queued",{id:n}))}),n):(w.current.push(o),i.current.onEvent?.("queued_message",{id:n,payload:o}),n)},[z]),S=e.useMemo(()=>h(e=>{a.current?.emit("typing",e)},250),[]);return{isConnected:d,isConnecting:c,sendMessage:E,sendTyping:S,requestHistory:e.useCallback(()=>{a.current?.emit("request_history")},[]),reconnect:y,disconnect:v}}({apiKey:n,apiBaseUrl:r,pageContext:e.useMemo(()=>C?{...s||{},seo:{...C||{}}}:s,[s,C]),userContext:u,onMessage:e.useCallback(e=>{const t=Date.now(),n=w.current>0?t-w.current:void 0;w.current=t,O.addMessage(e),z.trackMessageReceived(e.type,n),S.isOpen||"bot"!==e.sender||(b(e=>e+1),x.notifyWithSound(e))},[O,S.isOpen,z,x]),onConnected:e.useCallback((e,t)=>{O.setConnected(!0),O.setSessionId(e),z.trackConnectionStatus(!0),t&&f&&f("backend_config",t)},[O,f,z]),onDisconnected:e.useCallback(()=>{O.setConnected(!1),z.trackConnectionStatus(!1)},[O,z]),onTyping:e.useCallback(e=>O.setTyping(e),[O]),onError:e.useCallback(e=>{O.setError(e),z.trackError(e)},[O,z]),onLogin:d,onNavigate:l,onEvent:f,onThemeUpdate:y}),$=e.useCallback(()=>{p.debug("ChatWidget handleToggle called, current isOpen:",S.isOpen),S.isOpen?(O.closeWindow(),z.trackClose(),g?.(!1),p.debug("ChatWidget Closing window")):(O.openWindow(),b(0),z.trackOpen(),g?.(!0),p.debug("ChatWidget Opening window"))},[S.isOpen,O,g,z]),N=e.useCallback(e=>{if(!E.isAllowed()){const e=E.getTimeUntilReset(),t=Math.ceil(e/1e3);return void O.setError(k("rate_limit_exceeded")+` Espera ${t}s.`)}const t={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:e};O.addMessage(t),z.trackMessageSent("text"),I.sendMessage(e,"text")},[O,I,E,z,k]),T=e.useCallback(async(e,t)=>{let n;n="audio"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:/* @__PURE__ */new Date,content:URL.createObjectURL(e)}:"image"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:/* @__PURE__ */new Date,imageUrl:URL.createObjectURL(e)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:`📎 ${e.name}`},O.addMessage(n);const r=await $s(e);I.sendMessage(r,t)},[O,I]),j=e.useCallback(e=>{const t={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:/* @__PURE__ */new Date,latitude:e.latitude,longitude:e.longitude,name:"Mi ubicación"};O.addMessage(t),I.sendMessage(JSON.stringify(e),"location")},[O,I]);e.useEffect(()=>{const e=()=>{S.isOpen||O.openWindow()},t=()=>{S.isOpen&&O.closeWindow()},n=()=>{S.isOpen?O.closeWindow():O.openWindow()},r=e=>{e.detail?.message&&N(e.detail.message)};return window.addEventListener("botuyo-chat:open",e),window.addEventListener("botuyo-chat:close",t),window.addEventListener("botuyo-chat:toggle",n),window.addEventListener("botuyo-chat:send-message",r),()=>{window.removeEventListener("botuyo-chat:open",e),window.removeEventListener("botuyo-chat:close",t),window.removeEventListener("botuyo-chat:toggle",n),window.removeEventListener("botuyo-chat:send-message",r)}},[S.isOpen,O,N]),e.useEffect(()=>(Es(N),()=>Es(null)),[N]);const A=e.useCallback(()=>{O.clearMessages(),p.info("Chat history cleared")},[O]);e.useEffect(()=>(Ss(A),()=>Ss(null)),[A]);const M=e.useMemo(()=>{if(S.isTyping)return"thinking";const e=[...S.messages].reverse().find(e=>"bot"===e.sender&&"text"===e.type);return"text"===e?.type&&e.emotion?e.emotion:"default"},[S.isTyping,S.messages]);return{state:S,actions:O,unreadCount:v,currentBotEmotion:M,isConnected:I.isConnected,handleToggle:$,handleSendText:N,handleSendAttachment:T,handleSendLocation:j}}function Ts(n){const{apiKey:r,apiBaseUrl:o,pageContext:s,includeSEOMetadata:i=!1,theme:a,mediaConfig:c,userContext:d,onLogin:l,onNavigate:p,onEvent:h,onStateChange:m,onVoiceCall:g}=n,w=e.useRef(null),_=y();!function(t){const[n,r]=e.useState(!1);e.useEffect(()=>{let e=null;const n=()=>{if(!t.current)return;const e=!!t.current.parentElement?.closest(".dark"),n=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),o=document.getElementById("botuyo-chat-widget-root"),s=!!o?.parentElement?.closest(".dark"),i=document.documentElement.classList.contains("dark"),a=document.body.classList.contains("dark"),c=window.matchMedia("(prefers-color-scheme: dark)").matches,u=e||n||s||i||a||c;t.current&&(u?t.current.classList.add("dark"):t.current.classList.remove("dark")),r(u)};n();const o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>n();o.addEventListener("change",s);const i=new MutationObserver(()=>{n()}),a=document.getElementById("botuyo-chat-widget-root");a&&(i.observe(a,{attributes:!0,attributeFilter:["class"]}),a.parentElement&&(i.observe(a.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=a.parentElement)),i.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class"]});let c=t.current?.parentElement;for(;c;)i.observe(c,{attributes:!0,attributeFilter:["class"]}),c=c.parentElement;const u=setInterval(()=>{const t=document.getElementById("botuyo-chat-widget-root");t&&t.parentElement!==e&&(e&&t.parentElement&&(i.observe(t.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),e=t.parentElement),n())},100);return()=>{i.disconnect(),o.removeEventListener("change",s),clearInterval(u)}},[t])}(w);const[O,C]=e.useState(),{mergedTheme:I,mergedStyles:$,getContainerStyle:N}=function(t,n){const r=function(){const[t,n]=e.useState(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return e.useEffect(()=>{const e=window.matchMedia("(prefers-contrast: high)"),t=window.matchMedia("(prefers-contrast: more)"),r=e=>{n(e.matches)};return e.addEventListener("change",r),t.addEventListener("change",r),()=>{e.removeEventListener("change",r),t.removeEventListener("change",r)}},[]),t}(),o=e.useMemo(()=>{const e=f(t,n);return r?{...e,primaryColor:"#000000",cssVariables:{...e.cssVariables,background:"#FFFFFF",foreground:"#000000",card:"#FFFFFF",cardForeground:"#000000",primary:"#000000",primaryForeground:"#FFFFFF",muted:"#F5F5F5",mutedForeground:"#000000",border:"#000000"}}:e},[t,n,r]),s=e.useMemo(()=>({radius:{...x,...t?.bubbleStyles?.radius},bot:{...E,...t?.bubbleStyles?.bot},user:{...S,...t?.bubbleStyles?.user},launcher:{...t?.bubbleStyles?.launcher},mapCard:{...t?.bubbleStyles?.mapCard}}),[t?.bubbleStyles]);return{mergedTheme:o,mergedStyles:s,getContainerStyle:(e,t,n)=>({"--chat-primary":o.primaryColor,zIndex:e?2147483647:9999,position:"fixed",top:t&&e?0:"auto",left:t&&e?0:"bottom-left"===n?"24px":"auto",right:t&&e?0:"bottom-right"!==n&&n?"auto":"24px",bottom:t&&e?0:"100px",width:t&&e?"100%":"auto",height:t&&e?"100%":"auto"})}}(a,O),{state:T,actions:j,unreadCount:A,currentBotEmotion:M,isConnected:P,handleToggle:Z,handleSendText:F,handleSendAttachment:D,handleSendLocation:R}=Ns({apiKey:r,apiBaseUrl:o,pageContext:s,includeSEOMetadata:i,theme:a,userContext:d,onLogin:l,onNavigate:p,onEvent:h,onStateChange:m,onThemeUpdate:C}),L=e.useCallback(e=>{e.stopPropagation()},[]),U=N(T.isOpen,_,a?.position),W=e.useMemo(()=>{if(!I.cssVariables)return{};const e={},t=I.cssVariables;return t.background&&(e["--background"]=t.background),t.foreground&&(e["--foreground"]=t.foreground),t.card&&(e["--card"]=t.card),t.cardForeground&&(e["--card-foreground"]=t.cardForeground),t.primary&&(e["--primary"]=t.primary),t.primaryForeground&&(e["--primary-foreground"]=t.primaryForeground),t.muted&&(e["--muted"]=t.muted),t.mutedForeground&&(e["--muted-foreground"]=t.mutedForeground),t.border&&(e["--border"]=t.border),t.destructive&&(e["--destructive"]=t.destructive),t.radius&&(e["--radius"]=t.radius),t.spacing1&&(e["--spacing-1"]=t.spacing1),t.spacing2&&(e["--spacing-2"]=t.spacing2),t.spacing3&&(e["--spacing-3"]=t.spacing3),t.spacing4&&(e["--spacing-4"]=t.spacing4),t.spacing5&&(e["--spacing-5"]=t.spacing5),t.spacing6&&(e["--spacing-6"]=t.spacing6),t.spacing8&&(e["--spacing-8"]=t.spacing8),e},[I.cssVariables]);/* @__PURE__ */
32
- return t.jsx(v,{animations:a?.animations,effects:a?.effects,children:/* @__PURE__ */t.jsxs("div",{ref:w,id:"botuyo-chat-widget",className:u("botuyo-chat-widget flex flex-col",!_&&("bottom-left"===a?.position?"items-start":"items-end")),style:{...U,...W,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===a?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===a?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===a?.effects?.softShadows?"false":void 0,children:[
33
- /* @__PURE__ */t.jsx("div",{className:u("transition-all duration-400 ease-[cubic-bezier(0.34,1.56,0.64,1)]",_?"bottom-left"===a?.position?"origin-bottom-left":"origin-bottom-right":"origin-bottom",T.isOpen?"opacity-100 scale-100 h-full w-full translate-y-0 pointer-events-auto":"opacity-0 scale-[0.85] pointer-events-none translate-y-8 h-0 w-0"),style:{pointerEvents:T.isOpen?"auto":"none"},onMouseDown:L,onTouchStart:L,children:/* @__PURE__ */t.jsx(z,{children:/* @__PURE__ */t.jsx(b,{isOpen:T.isOpen,isConnected:P,isTyping:T.isTyping,messages:T.messages,onClose:()=>j.closeWindow(),onSendMessage:F,onSendAttachment:D,onSendLocation:R,botName:a?.botName,logoUrl:a?.logoUrl,welcomeMessage:a?.welcomeMessage,inputPlaceholder:a?.inputPlaceholder,primaryColor:a?.primaryColor,position:a?.position,bubbleStyles:$,avatars:a?.avatars,mediaConfig:c,theme:I,onVoiceCall:g})})}),
34
- /* @__PURE__ */t.jsx("div",{className:u(T.isOpen?"hidden":"block",!_&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:L,onTouchStart:L,children:/* @__PURE__ */t.jsx(k,{isOpen:T.isOpen,onClick:Z,unreadCount:A,position:a?.position||"bottom-right",primaryColor:a?.primaryColor,logoUrl:a?.logoUrl,starterPrompt:a?.starterPrompt,avatars:a?.avatars,emotion:M,styles:$,promptPersistence:a?.promptPersistence,avatarScale:a?.avatarScale})})]})})}const js=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,ChatWidget:Ts},Symbol.toStringTag,{value:"Module"})),As=e.lazy(()=>Promise.resolve().then(()=>js).then(e=>({default:e.ChatWidget})));class Ms{root=null;container=null;config=null;init(e){return this.config=e,this.render(),this}render(){if(!this.config)return void console.error("[BotUyoChat] No configuration provided");if(this.container||(this.container=document.createElement("div"),this.container.id="botuyo-chat-widget-root",this.container.style.position="fixed",this.container.style.zIndex="999999",document.body.appendChild(this.container)),this.config.theme?.cssVariables){const e=this.config.theme.cssVariables,t={background:e.background,foreground:e.foreground,card:e.card,cardForeground:e.cardForeground,primary:e.primary,primaryForeground:e.primaryForeground,muted:e.muted,mutedForeground:e.mutedForeground,border:e.border,destructive:e.destructive,radius:e.radius,spacing1:e.spacing1,spacing2:e.spacing2,spacing3:e.spacing3,spacing4:e.spacing4,spacing5:e.spacing5,spacing6:e.spacing6,spacing8:e.spacing8};Object.entries(t).forEach(([e,t])=>{void 0!==t&&this.container.style.setProperty(`--${e}`,t)})}this.root||(this.root=n.createRoot(this.container));const t={apiKey:this.config.apiKey,apiBaseUrl:this.config.apiBaseUrl,theme:{primaryColor:"#10b981",botName:"Asistente Virtual",position:"bottom-right",welcomeMessage:"¡Hola! 👋 ¿En qué puedo ayudarte?",inputPlaceholder:"Escribe tu mensaje...",borderRadius:"0.75rem",launcherBorderRadius:"50%",...this.config.theme},userContext:this.config.userContext,pageContext:this.config.pageContext,includeSEOMetadata:this.config.includeSEOMetadata??!1,mediaConfig:this.config.mediaConfig,onNavigate:this.config.onNavigate,onLogin:this.config.onLogin,onEvent:this.config.onEvent,onStateChange:this.config.onStateChange,onVoiceCall:this.config.onVoiceCall},o=r.createElement(e.Suspense,{fallback:r.createElement("div",{style:{position:"fixed",bottom:"24px",right:"24px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t.theme?.primaryColor||"#10b981",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",cursor:"wait"}},r.createElement("div",{style:{width:"24px",height:"24px",border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},r.createElement(As,t));this.root.render(r.createElement(g,{defaultLocale:this.config.theme?.defaultLocale,children:o})),console.log("[BotUyoChat] Widget initialized",t)}update(e){this.config?(this.config={...this.config,...e,theme:{...this.config.theme,...e.theme}},this.render()):console.error("[BotUyoChat] Widget not initialized")}destroy(){this.root&&(this.root.unmount(),this.root=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null),this.config=null,console.log("[BotUyoChat] Widget destroyed")}open(){window.dispatchEvent(new CustomEvent("botuyo-chat:open"))}close(){window.dispatchEvent(new CustomEvent("botuyo-chat:close"))}sendMessage(e){window.dispatchEvent(new CustomEvent("botuyo-chat:send-message",{detail:{message:e}}))}getState(){return null}}const Ps=new Ms;window.BotUyoChat=Ps;export{Ms as BotUyoChatWidget,Ts as ChatWidget,Cs as ChatWidgetProvider,g as LanguageProvider,Ps as default,Is as useChatWidget,w as useLanguage};
1
+ import e,{useState as t,useMemo as n,useEffect as r,useCallback as a,Component as o,useReducer as i,useRef as l,createContext as s,useContext as u,lazy as c,Suspense as d}from"react";import f from"react-dom";import{u as p,g as m,e as h,f as g,D as y,c as v,X as b,M as w,l as k,m as S,t as _,h as E,i as z,j as x,k as C,n as N}from"./chunk-chat-ui-DRDmUvk-.js";import{o as T}from"./chunk-chat-ui-DRDmUvk-.js";import{jsxs as P,jsx as O}from"react/jsx-runtime";import{l as I}from"./vendor-socket-DMqyM-90.js";var L,A,F,M,D={exports:{}},$={},R={exports:{}},j={};var U=(M||(M=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),D.exports=function(){if(F)return $;F=1;var t=(A||(A=1,R.exports=(L||(L=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var l=2*(r+1)-1,s=e[l],u=l+1,c=e[u];if(0>a(s,n))u<o&&0>a(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[l]=n,r=l);else{if(!(u<o&&0>a(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var s=[],u=[],c=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var a=n(u);null!==a;){if(null===a.callback)r(u);else{if(!(a.startTime<=e))break;r(u),a.sortIndex=a.expirationTime,t(s,a)}a=n(u)}}function k(e){if(h=!1,w(e),!m)if(null!==n(s))m=!0,_||(_=!0,S());else{var t=n(u);null!==t&&O(k,t.startTime-e)}}var S,_=!1,E=-1,z=5,x=-1;function C(){return!(!g&&e.unstable_now()-x<z)}function N(){if(g=!1,_){var t=e.unstable_now();x=t;var a=!0;try{e:{m=!1,h&&(h=!1,v(E),E=-1),p=!0;var o=f;try{t:{for(w(t),d=n(s);null!==d&&!(d.expirationTime>t&&C());){var i=d.callback;if("function"==typeof i){d.callback=null,f=d.priorityLevel;var l=i(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){d.callback=l,w(t),a=!0;break t}d===n(s)&&r(s),w(t)}else r(s);d=n(s)}if(null!==d)a=!0;else{var c=n(u);null!==c&&O(k,c.startTime-t),a=!1}}break e}finally{d=null,f=o,p=!1}a=void 0}}finally{a?S():_=!1}}}if("function"==typeof b)S=function(){b(N)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,P=T.port2;T.port1.onmessage=N,S=function(){P.postMessage(null)}}else S=function(){y(N,0)};function O(t,n){E=y(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,a,o){var i=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?i+o:i,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:c++,callback:a,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>i?(r.sortIndex=o,t(u,r),null===n(s)&&r===n(u)&&(h?(v(E),E=-1):h=!0,O(k,o-i))):(r.sortIndex=l,t(s,r),m||p||(m=!0,_||(_=!0,S()))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(j)),j)),R.exports),n=e,r=f;function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function i(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function l(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function s(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function u(e){if(i(e)!==e)throw Error(a(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var d=Object.assign,p=/* @__PURE__ */Symbol.for("react.element"),m=/* @__PURE__ */Symbol.for("react.transitional.element"),h=/* @__PURE__ */Symbol.for("react.portal"),g=/* @__PURE__ */Symbol.for("react.fragment"),y=/* @__PURE__ */Symbol.for("react.strict_mode"),v=/* @__PURE__ */Symbol.for("react.profiler"),b=/* @__PURE__ */Symbol.for("react.consumer"),w=/* @__PURE__ */Symbol.for("react.context"),k=/* @__PURE__ */Symbol.for("react.forward_ref"),S=/* @__PURE__ */Symbol.for("react.suspense"),_=/* @__PURE__ */Symbol.for("react.suspense_list"),E=/* @__PURE__ */Symbol.for("react.memo"),z=/* @__PURE__ */Symbol.for("react.lazy"),x=/* @__PURE__ */Symbol.for("react.activity"),C=/* @__PURE__ */Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=N&&e[N]||e["@@iterator"])?e:null}var P=/* @__PURE__ */Symbol.for("react.client.reference");function O(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===P?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case g:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case S:return"Suspense";case _:return"SuspenseList";case x:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case h:return"Portal";case w:return e.displayName||"Context";case b:return(e._context.displayName||"Context")+".Consumer";case k:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case E:return null!==(t=e.displayName||null)?t:O(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return O(e(t))}catch(n){}}return null}var I=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},Z=[],B=-1;function V(e){return{current:e}}function W(e){0>B||(e.current=Z[B],Z[B]=null,B--)}function q(e,t){B++,Z[B]=e.current,e.current=t}var H,Q,J=V(null),K=V(null),G=V(null),Y=V(null);function X(e,t){switch(q(G,t),q(K,e),q(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=_d(t=Sd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(J),q(J,e)}function ee(){W(J),W(K),W(G)}function te(e){null!==e.memoizedState&&q(Y,e);var t=J.current,n=_d(t,e.type);t!==n&&(q(K,e),q(J,n))}function ne(e){K.current===e&&(W(J),W(K)),Y.current===e&&(W(Y),gf._currentValue=U)}function re(e){if(void 0===H)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||"",Q=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+H+e+Q}var ae=!1;function oe(e,t){if(!e||ae)return"";ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(a){var r=a}Reflect.construct(e,[],n)}else{try{n.call()}catch(o){r=o}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(l){if(l&&r&&"string"==typeof l.stack)return[l.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],l=o[1];if(i&&l){var s=i.split("\n"),u=l.split("\n");for(a=r=0;r<s.length&&!s[r].includes("DetermineComponentFrameRoot");)r++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(r===s.length||a===u.length)for(r=s.length-1,a=u.length-1;1<=r&&0<=a&&s[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(s[r]!==u[a]){if(1!==r||1!==a)do{if(r--,0>--a||s[r]!==u[a]){var c="\n"+s[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=r&&0<=a);break}}}finally{ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?re(n):""}function ie(e,t){switch(e.tag){case 26:case 27:case 5:return re(e.type);case 16:return re("Lazy");case 13:return e.child!==t&&null!==t?re("Suspense Fallback"):re("Suspense");case 19:return re("SuspenseList");case 0:case 15:return oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return re("Activity");default:return""}}function le(e){try{var t="",n=null;do{t+=ie(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var se=Object.prototype.hasOwnProperty,ue=t.unstable_scheduleCallback,ce=t.unstable_cancelCallback,de=t.unstable_shouldYield,fe=t.unstable_requestPaint,pe=t.unstable_now,me=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,ye=t.unstable_NormalPriority,ve=t.unstable_LowPriority,be=t.unstable_IdlePriority,we=t.log,ke=t.unstable_setDisableYieldValue,Se=null,_e=null;function Ee(e){if("function"==typeof we&&ke(e),_e&&"function"==typeof _e.setStrictMode)try{_e.setStrictMode(Se,e)}catch(t){}}var ze=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(xe(e)/Ce|0)|0},xe=Math.log,Ce=Math.LN2,Ne=256,Te=262144,Pe=4194304;function Oe(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ie(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var a=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=134217727&r;return 0!==l?0!==(r=l&~o)?a=Oe(r):0!==(i&=l)?a=Oe(i):n||0!==(n=l&~e)&&(a=Oe(n)):0!==(l=r&~o)?a=Oe(l):0!==i?a=Oe(i):n||0!==(n=r&~e)&&(a=Oe(n)),0===a?0:0!==t&&t!==a&&0===(t&o)&&((o=a&-a)>=(n=t&-t)||32===o&&4194048&n)?t:a}function Le(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ae(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Fe(){var e=Pe;return!(62914560&(Pe<<=1))&&(Pe=4194304),e}function Me(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function De(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Re(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function je(e,t){var n=t&-t;return 0!==((n=42&n?1:Ue(n))&(e.suspendedLanes|t))?0:n}function Ue(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ze(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Be(){var e=D.p;return 0!==e?e:void 0===(e=window.event)?32:If(e.type)}function Ve(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var We=Math.random().toString(36).slice(2),qe="__reactFiber$"+We,He="__reactProps$"+We,Qe="__reactContainer$"+We,Je="__reactEvents$"+We,Ke="__reactListeners$"+We,Ge="__reactHandles$"+We,Ye="__reactResources$"+We,Xe="__reactMarker$"+We;function et(e){delete e[qe],delete e[He],delete e[Je],delete e[Ke],delete e[Ge]}function tt(e){var t=e[qe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qe]||n[qe]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Ud(e);null!==e;){if(n=e[qe])return n;e=Ud(e)}return t}n=(e=n).parentNode}return null}function nt(e){if(e=e[qe]||e[Qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function rt(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(a(33))}function at(e){var t=e[Ye];return t||(t=e[Ye]={hoistableStyles:/* @__PURE__ */new Map,hoistableScripts:/* @__PURE__ */new Map}),t}function ot(e){e[Xe]=!0}var it=/* @__PURE__ */new Set,lt={};function st(e,t){ut(e,t),ut(e+"Capture",t)}function ut(e,t){for(lt[e]=t,e=0;e<t.length;e++)it.add(t[e])}var ct=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),dt={},ft={};function pt(e,t,n){if(a=t,se.call(ft,a)||!se.call(dt,a)&&(ct.test(a)?ft[a]=!0:(dt[a]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var a}function mt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function ht(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function yt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function vt(e){if(!e._valueTracker){var t=yt(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var a=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=yt(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function wt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var kt=/[\n"\\]/g;function St(e){return e.replace(kt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function _t(e,t,n,r,a,o,i,l){e.name="",null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+gt(t)):e.value!==""+gt(t)&&(e.value=""+gt(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?zt(e,i,gt(t)):null!=n?zt(e,i,gt(n)):null!=r&&e.removeAttribute("value"),null==a&&null!=o&&(e.defaultChecked=!!o),null!=a&&(e.checked=a&&"function"!=typeof a&&"symbol"!=typeof a),null!=l&&"function"!=typeof l&&"symbol"!=typeof l&&"boolean"!=typeof l?e.name=""+gt(l):e.removeAttribute("name")}function Et(e,t,n,r,a,o,i,l){if(null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.type=o),null!=t||null!=n){if(("submit"===o||"reset"===o)&&null==t)return void vt(e);n=null!=n?""+gt(n):"",t=null!=t?""+gt(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:a)&&"symbol"!=typeof r&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.name=i),vt(e)}function zt(e,t,n){"number"===t&&wt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function xt(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function Ct(e,t,n){null==t||((t=""+gt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+gt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Nt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(a(92));if(I(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=gt(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r),vt(e)}function Tt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Pt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ot(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Pt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function It(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(a(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&Ot(e,o,r)}else for(var i in t)t.hasOwnProperty(i)&&Ot(e,i,t[i])}function Lt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var At=/* @__PURE__ */new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ft=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Mt(e){return Ft.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dt(){}var $t=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var jt=null,Ut=null;function Zt(e){var t=nt(e);if(t&&(e=t.stateNode)){var n=e[He]||null;e:switch(e=t.stateNode,t.type){case"input":if(_t(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+St(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[He]||null;if(!o)throw Error(a(90));_t(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&bt(r)}break e;case"textarea":Ct(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&xt(e,!!n.multiple,t,!1)}}}var Bt=!1;function Vt(e,t,n){if(Bt)return e(t,n);Bt=!0;try{return e(t)}finally{if(Bt=!1,(null!==jt||null!==Ut)&&(ac(),jt&&(t=jt,e=Ut,Ut=jt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function Wt(e,t){var n=e.stateNode;if(null===n)return null;var r=n[He]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var qt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ht=!1;if(qt)try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){Ht=!0}}),window.addEventListener("test",Qt,Qt),window.removeEventListener("test",Qt,Qt)}catch(rp){Ht=!1}var Jt=null,Kt=null,Gt=null;function Yt(){if(Gt)return Gt;var e,t,n=Kt,r=n.length,a="value"in Jt?Jt.value:Jt.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return Gt=a.slice(e,1<t?1-t:void 0)}function Xt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function en(){return!0}function tn(){return!1}function nn(e){function t(t,n,r,a,o){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?en:tn,this.isPropagationStopped=tn,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=en)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=en)},persist:function(){},isPersistent:en}),t}var rn,an,on,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sn=nn(ln),un=d({},ln,{view:0,detail:0}),cn=nn(un),dn=d({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==on&&(on&&"mousemove"===e.type?(rn=e.screenX-on.screenX,an=e.screenY-on.screenY):an=rn=0,on=e),rn)},movementY:function(e){return"movementY"in e?e.movementY:an}}),fn=nn(dn),pn=nn(d({},dn,{dataTransfer:0})),mn=nn(d({},un,{relatedTarget:0})),hn=nn(d({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),gn=nn(d({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),yn=nn(d({},ln,{data:0})),vn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=wn[e])&&!!t[e]}function Sn(){return kn}var _n=nn(d({},un,{key:function(e){if(e.key){var t=vn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Xt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?bn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(e){return"keypress"===e.type?Xt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Xt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),En=nn(d({},dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=nn(d({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn})),xn=nn(d({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Cn=nn(d({},dn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Nn=nn(d({},ln,{newState:0,oldState:0})),Tn=[9,13,27,32],Pn=qt&&"CompositionEvent"in window,On=null;qt&&"documentMode"in document&&(On=document.documentMode);var In=qt&&"TextEvent"in window&&!On,Ln=qt&&(!Pn||On&&8<On&&11>=On),An=String.fromCharCode(32),Fn=!1;function Mn(e,t){switch(e){case"keyup":return-1!==Tn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var $n=!1,Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function Un(e,t,n,r){jt?Ut?Ut.push(r):Ut=[r]:jt=r,0<(t=sd(t,"onChange")).length&&(n=new sn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Zn=null,Bn=null;function Vn(e){ed(e,0)}function Wn(e){if(bt(rt(e)))return e}function qn(e,t){if("change"===e)return t}var Hn=!1;if(qt){var Qn;if(qt){var Jn="oninput"in document;if(!Jn){var Kn=document.createElement("div");Kn.setAttribute("oninput","return;"),Jn="function"==typeof Kn.oninput}Qn=Jn}else Qn=!1;Hn=Qn&&(!document.documentMode||9<document.documentMode)}function Gn(){Zn&&(Zn.detachEvent("onpropertychange",Yn),Bn=Zn=null)}function Yn(e){if("value"===e.propertyName&&Wn(Bn)){var t=[];Un(t,Bn,e,Rt(e)),Vt(Vn,t)}}function Xn(e,t,n){"focusin"===e?(Gn(),Bn=n,(Zn=t).attachEvent("onpropertychange",Yn)):"focusout"===e&&Gn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Wn(Bn)}function tr(e,t){if("click"===e)return Wn(t)}function nr(e,t){if("input"===e||"change"===e)return Wn(t)}var rr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ar(e,t){if(rr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!se.call(t,a)||!rr(e[a],t[a]))return!1}return!0}function or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ir(e,t){var n,r=or(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=or(r)}}function lr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?lr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function sr(e){for(var t=wt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=wt((e=t.contentWindow).document)}return t}function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var cr=qt&&"documentMode"in document&&11>=document.documentMode,dr=null,fr=null,pr=null,mr=!1;function hr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==dr||dr!==wt(r)||(r="selectionStart"in(r=dr)&&ur(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&ar(pr,r)||(pr=r,0<(r=sd(fr,"onSelect")).length&&(t=new sn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=dr)))}function gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yr={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionrun:gr("Transition","TransitionRun"),transitionstart:gr("Transition","TransitionStart"),transitioncancel:gr("Transition","TransitionCancel"),transitionend:gr("Transition","TransitionEnd")},vr={},br={};function wr(e){if(vr[e])return vr[e];if(!yr[e])return e;var t,n=yr[e];for(t in n)if(n.hasOwnProperty(t)&&t in br)return vr[e]=n[t];return e}qt&&(br=document.createElement("div").style,"AnimationEvent"in window||(delete yr.animationend.animation,delete yr.animationiteration.animation,delete yr.animationstart.animation),"TransitionEvent"in window||delete yr.transitionend.transition);var kr=wr("animationend"),Sr=wr("animationiteration"),_r=wr("animationstart"),Er=wr("transitionrun"),zr=wr("transitionstart"),xr=wr("transitioncancel"),Cr=wr("transitionend"),Nr=/* @__PURE__ */new Map,Tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pr(e,t){Nr.set(e,t),st(t,[e])}Tr.push("scrollEnd");var Or="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Ir=[],Lr=0,Ar=0;function Fr(){for(var e=Lr,t=Ar=Lr=0;t<e;){var n=Ir[t];Ir[t++]=null;var r=Ir[t];Ir[t++]=null;var a=Ir[t];Ir[t++]=null;var o=Ir[t];if(Ir[t++]=null,null!==r&&null!==a){var i=r.pending;null===i?a.next=a:(a.next=i.next,i.next=a),r.pending=a}0!==o&&Rr(n,a,o)}}function Mr(e,t,n,r){Ir[Lr++]=e,Ir[Lr++]=t,Ir[Lr++]=n,Ir[Lr++]=r,Ar|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Dr(e,t,n,r){return Mr(e,t,n,r),jr(e)}function $r(e,t){return Mr(e,null,null,t),jr(e)}function Rr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var a=!1,o=e.return;null!==o;)o.childLanes|=n,null!==(r=o.alternate)&&(r.childLanes|=n),22===o.tag&&(null===(e=o.stateNode)||1&e._visibility||(a=!0)),e=o,o=o.return;return 3===e.tag?(o=e.stateNode,a&&null!==t&&(a=31-ze(n),null===(r=(e=o.hiddenUpdates)[a])?e[a]=[t]:r.push(t),t.lane=536870912|n),o):null}function jr(e){if(50<Ju)throw Ju=0,Ku=null,Error(a(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Ur={};function Zr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(e,t,n,r){return new Zr(e,t,n,r)}function Vr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wr(e,t){var n=e.alternate;return null===n?((n=Br(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function qr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hr(e,t,n,r,o,i){var l=0;if(r=e,"function"==typeof e)Vr(e)&&(l=1);else if("string"==typeof e)l=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,J.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case x:return(e=Br(31,n,t,o)).elementType=x,e.lanes=i,e;case g:return Qr(n.children,o,i,t);case y:l=8,o|=24;break;case v:return(e=Br(12,n,t,2|o)).elementType=v,e.lanes=i,e;case S:return(e=Br(13,n,t,o)).elementType=S,e.lanes=i,e;case _:return(e=Br(19,n,t,o)).elementType=_,e.lanes=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case w:l=10;break e;case b:l=9;break e;case k:l=11;break e;case E:l=14;break e;case z:l=16,r=null;break e}l=29,n=Error(a(130,null===e?"null":typeof e,"")),r=null}return(t=Br(l,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Qr(e,t,n,r){return(e=Br(7,e,r,t)).lanes=n,e}function Jr(e,t,n){return(e=Br(6,e,null,t)).lanes=n,e}function Kr(e){var t=Br(18,null,null,0);return t.stateNode=e,t}function Gr(e,t,n){return(t=Br(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yr=/* @__PURE__ */new WeakMap;function Xr(e,t){if("object"==typeof e&&null!==e){var n=Yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:le(t)},Yr.set(e,t),t)}return{value:e,source:t,stack:le(t)}}var ea=[],ta=0,na=null,ra=0,aa=[],oa=0,ia=null,la=1,sa="";function ua(e,t){ea[ta++]=ra,ea[ta++]=na,na=e,ra=t}function ca(e,t,n){aa[oa++]=la,aa[oa++]=sa,aa[oa++]=ia,ia=e;var r=la;e=sa;var a=32-ze(r)-1;r&=~(1<<a),n+=1;var o=32-ze(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,la=1<<32-ze(t)+a|n<<a|r,sa=o+e}else la=1<<o|n<<a|r,sa=e}function da(e){null!==e.return&&(ua(e,1),ca(e,1,0))}function fa(e){for(;e===na;)na=ea[--ta],ea[ta]=null,ra=ea[--ta],ea[ta]=null;for(;e===ia;)ia=aa[--oa],aa[oa]=null,sa=aa[--oa],aa[oa]=null,la=aa[--oa],aa[oa]=null}function pa(e,t){aa[oa++]=la,aa[oa++]=sa,aa[oa++]=ia,la=t.id,sa=t.overflow,ia=e}var ma=null,ha=null,ga=!1,ya=null,va=!1,ba=Error(a(519));function wa(e){throw xa(Xr(Error(a(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),ba}function ka(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[qe]=e,t[He]=r,n){case"dialog":td("cancel",t),td("close",t);break;case"iframe":case"object":case"embed":td("load",t);break;case"video":case"audio":for(n=0;n<Yc.length;n++)td(Yc[n],t);break;case"source":td("error",t);break;case"img":case"image":case"link":td("error",t),td("load",t);break;case"details":td("toggle",t);break;case"input":td("invalid",t),Et(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":td("invalid",t);break;case"textarea":td("invalid",t),Nt(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||md(t.textContent,n)?(null!=r.popover&&(td("beforetoggle",t),td("toggle",t)),null!=r.onScroll&&td("scroll",t),null!=r.onScrollEnd&&td("scrollend",t),null!=r.onClick&&(t.onclick=Dt),t=!0):t=!1,t||wa(e,!0)}function Sa(e){for(ma=e.return;ma;)switch(ma.tag){case 5:case 31:case 13:return void(va=!1);case 27:case 3:return void(va=!0);default:ma=ma.return}}function _a(e){if(e!==ma)return!1;if(!ga)return Sa(e),ga=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Ed(e.type,e.memoizedProps)),t=!t),t&&ha&&wa(e),Sa(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));ha=jd(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));ha=jd(e)}else 27===n?(n=ha,Od(e.type)?(e=Rd,Rd=null,ha=e):ha=n):ha=ma?$d(e.stateNode.nextSibling):null;return!0}function Ea(){ha=ma=null,ga=!1}function za(){var e=ya;return null!==e&&(null===Fu?Fu=e:Fu.push.apply(Fu,e),ya=null),e}function xa(e){null===ya?ya=[e]:ya.push(e)}var Ca=V(null),Na=null,Ta=null;function Pa(e,t,n){q(Ca,t._currentValue),t._currentValue=n}function Oa(e){e._currentValue=Ca.current,W(Ca)}function Ia(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function La(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){var i=o.dependencies;if(null!==i){var l=o.child;i=i.firstContext;e:for(;null!==i;){var s=i;i=o;for(var u=0;u<t.length;u++)if(s.context===t[u]){i.lanes|=n,null!==(s=i.alternate)&&(s.lanes|=n),Ia(i.return,n,e),r||(l=null);break e}i=s.next}}else if(18===o.tag){if(null===(l=o.return))throw Error(a(341));l.lanes|=n,null!==(i=l.alternate)&&(i.lanes|=n),Ia(l,n,e),l=null}else l=o.child;if(null!==l)l.return=o;else for(l=o;null!==l;){if(l===e){l=null;break}if(null!==(o=l.sibling)){o.return=l.return,l=o;break}l=l.return}o=l}}function Aa(e,t,n,r){e=null;for(var o=t,i=!1;null!==o;){if(!i)if(524288&o.flags)i=!0;else if(262144&o.flags)break;if(10===o.tag){var l=o.alternate;if(null===l)throw Error(a(387));if(null!==(l=l.memoizedProps)){var s=o.type;rr(o.pendingProps.value,l.value)||(null!==e?e.push(s):e=[s])}}else if(o===Y.current){if(null===(l=o.alternate))throw Error(a(387));l.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(null!==e?e.push(gf):e=[gf])}o=o.return}null!==e&&La(t,e,n,r),t.flags|=262144}function Fa(e){for(e=e.firstContext;null!==e;){if(!rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ma(e){Na=e,Ta=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Da(e){return Ra(Na,e)}function $a(e,t){return null===Na&&Ma(e),Ra(e,t)}function Ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Ta){if(null===e)throw Error(a(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return n}var ja="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ua=t.unstable_scheduleCallback,Za=t.unstable_NormalPriority,Ba={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Va(){return{controller:new ja,data:/* @__PURE__ */new Map,refCount:0}}function Wa(e){e.refCount--,0===e.refCount&&Ua(Za,function(){e.controller.abort()})}var qa=null,Ha=0,Qa=0,Ja=null;function Ka(){if(0===--Ha&&null!==qa){null!==Ja&&(Ja.status="fulfilled");var e=qa;qa=null,Qa=0,Ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Ga=M.S;M.S=function(e,t){$u=pe(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===qa){var n=qa=[];Ha=0,Qa=Hc(),Ja={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ha++,t.then(Ka,Ka)}(0,t),null!==Ga&&Ga(e,t)};var Ya=V(null);function Xa(){var e=Ya.current;return null!==e?e:bu.pooledCache}function eo(e,t){q(Ya,null===t?Ya.current:t.pool)}function to(){var e=Xa();return null===e?null:{parent:Ba._currentValue,pool:e}}var no=Error(a(460)),ro=Error(a(474)),ao=Error(a(542)),oo={then:function(){}};function io(e){return"fulfilled"===(e=e.status)||"rejected"===e}function lo(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Dt,Dt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw fo(e=t.reason),e;default:if("string"==typeof t.status)t.then(Dt,Dt);else{if(null!==(e=bu)&&100<e.shellSuspendCounter)throw Error(a(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw fo(e=t.reason),e}throw uo=t,no}}function so(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw uo=t,no;throw t}}var uo=null;function co(){if(null===uo)throw Error(a(459));var e=uo;return uo=null,e}function fo(e){if(e===no||e===ao)throw Error(a(483))}var po=null,mo=0;function ho(e){var t=mo;return mo+=1,null===po&&(po=[]),lo(po,e,t)}function go(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function yo(e,t){if(t.$$typeof===p)throw Error(a(525));throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=/* @__PURE__ */new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function o(e,t){return(e=Wr(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function l(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Jr(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function u(e,t,n,r){var a=n.type;return a===g?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===z&&so(a)===t.type)?(go(t=o(t,n.props),n),t.return=e,t):(go(t=Hr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Gr(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Qr(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Jr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case m:return go(n=Hr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case h:return(t=Gr(t,e.mode,n)).return=e,t;case z:return f(e,t=so(t),n)}if(I(t)||T(t))return(t=Qr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return f(e,ho(t),n);if(t.$$typeof===w)return f(e,$a(e,t),n);yo(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==a?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case m:return n.key===a?u(e,t,n,r):null;case h:return n.key===a?c(e,t,n,r):null;case z:return p(e,t,n=so(n),r)}if(I(n)||T(n))return null!==a?null:d(e,t,n,r,null);if("function"==typeof n.then)return p(e,t,ho(n),r);if(n.$$typeof===w)return p(e,t,$a(e,n),r);yo(e,n)}return null}function y(e,t,n,r,a){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return s(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case m:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a);case h:return c(t,e=e.get(null===r.key?n:r.key)||null,r,a);case z:return y(e,t,n,r=so(r),a)}if(I(r)||T(r))return d(t,e=e.get(n)||null,r,a,null);if("function"==typeof r.then)return y(e,t,n,ho(r),a);if(r.$$typeof===w)return y(e,t,n,$a(t,r),a);yo(t,r)}return null}function v(s,u,c,d){if("object"==typeof c&&null!==c&&c.type===g&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case m:e:{for(var b=c.key;null!==u;){if(u.key===b){if((b=c.type)===g){if(7===u.tag){n(s,u.sibling),(d=o(u,c.props.children)).return=s,s=d;break e}}else if(u.elementType===b||"object"==typeof b&&null!==b&&b.$$typeof===z&&so(b)===u.type){n(s,u.sibling),go(d=o(u,c.props),c),d.return=s,s=d;break e}n(s,u);break}t(s,u),u=u.sibling}c.type===g?((d=Qr(c.props.children,s.mode,d,c.key)).return=s,s=d):(go(d=Hr(c.type,c.key,c.props,null,s.mode,d),c),d.return=s,s=d)}return l(s);case h:e:{for(b=c.key;null!==u;){if(u.key===b){if(4===u.tag&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){n(s,u.sibling),(d=o(u,c.children||[])).return=s,s=d;break e}n(s,u);break}t(s,u),u=u.sibling}(d=Gr(c,s.mode,d)).return=s,s=d}return l(s);case z:return v(s,u,c=so(c),d)}if(I(c))return function(a,o,l,s){for(var u=null,c=null,d=o,m=o=0,h=null;null!==d&&m<l.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(a,d,l[m],s);if(null===g){null===d&&(d=h);break}e&&d&&null===g.alternate&&t(a,d),o=i(g,o,m),null===c?u=g:c.sibling=g,c=g,d=h}if(m===l.length)return n(a,d),ga&&ua(a,m),u;if(null===d){for(;m<l.length;m++)null!==(d=f(a,l[m],s))&&(o=i(d,o,m),null===c?u=d:c.sibling=d,c=d);return ga&&ua(a,m),u}for(d=r(d);m<l.length;m++)null!==(h=y(d,a,m,l[m],s))&&(e&&null!==h.alternate&&d.delete(null===h.key?m:h.key),o=i(h,o,m),null===c?u=h:c.sibling=h,c=h);return e&&d.forEach(function(e){return t(a,e)}),ga&&ua(a,m),u}(s,u,c,d);if(T(c)){if("function"!=typeof(b=T(c)))throw Error(a(150));return function(o,l,s,u){if(null==s)throw Error(a(151));for(var c=null,d=null,m=l,h=l=0,g=null,v=s.next();null!==m&&!v.done;h++,v=s.next()){m.index>h?(g=m,m=null):g=m.sibling;var b=p(o,m,v.value,u);if(null===b){null===m&&(m=g);break}e&&m&&null===b.alternate&&t(o,m),l=i(b,l,h),null===d?c=b:d.sibling=b,d=b,m=g}if(v.done)return n(o,m),ga&&ua(o,h),c;if(null===m){for(;!v.done;h++,v=s.next())null!==(v=f(o,v.value,u))&&(l=i(v,l,h),null===d?c=v:d.sibling=v,d=v);return ga&&ua(o,h),c}for(m=r(m);!v.done;h++,v=s.next())null!==(v=y(m,o,h,v.value,u))&&(e&&null!==v.alternate&&m.delete(null===v.key?h:v.key),l=i(v,l,h),null===d?c=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(o,e)}),ga&&ua(o,h),c}(s,u,c=b.call(c),d)}if("function"==typeof c.then)return v(s,u,ho(c),d);if(c.$$typeof===w)return v(s,u,$a(s,c),d);yo(s,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(s,u.sibling),(d=o(u,c)).return=s,s=d):(n(s,u),(d=Jr(c,s.mode,d)).return=s,s=d),l(s)):n(s,u)}return function(e,t,n,r){try{mo=0;var a=v(e,t,n,r);return po=null,a}catch(i){if(i===no||i===ao)throw i;var o=Br(29,i,null,e.mode);return o.lanes=r,o.return=e,o}}}var bo=vo(!0),wo=vo(!1),ko=!1;function So(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Eo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&vu){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=jr(e),Rr(e,null,n),t}return Mr(e,r,t,n),jr(e)}function xo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===o?a=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?a=o=t:o=o.next=t}else a=o=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var No=!1;function To(){if(No&&null!==Ja)throw Ja}function Po(e,t,n,r){No=!1;var a=e.updateQueue;ko=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var s=l,u=s.next;s.next=null,null===i?o=u:i.next=u,i=s;var c=e.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==i&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s)}if(null!==o){var f=a.baseState;for(i=0,c=u=s=null,l=o;;){var p=-536870913&l.lane,m=p!==l.lane;if(m?(ku&p)===p:(r&p)===p){0!==p&&p===Qa&&(No=!0),null!==c&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var h=e,g=l;p=t;var y=n;switch(g.tag){case 1:if("function"==typeof(h=g.payload)){f=h.call(y,f,p);break e}f=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(p="function"==typeof(h=g.payload)?h.call(y,f,p):h))break e;f=d({},f,p);break e;case 2:ko=!0}}null!==(p=l.callback)&&(e.flags|=64,m&&(e.flags|=8192),null===(m=a.callbacks)?a.callbacks=[p]:m.push(p))}else m={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=m,s=f):c=c.next=m,i|=p;if(null===(l=l.next)){if(null===(l=a.shared.pending))break;l=(m=l).next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}null===c&&(s=f),a.baseState=s,a.firstBaseUpdate=u,a.lastBaseUpdate=c,null===o&&(a.shared.lanes=0),Tu|=i,e.lanes=i,e.memoizedState=f}}function Oo(e,t){if("function"!=typeof e)throw Error(a(191,e));e.call(t)}function Io(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Oo(n[e],t)}var Lo=V(null),Ao=V(0);function Fo(e,t){q(Ao,e=Cu),q(Lo,t),Cu=e|t.baseLanes}function Mo(){q(Ao,Cu),q(Lo,Lo.current)}function Do(){Cu=Ao.current,W(Lo),W(Ao)}var $o=V(null),Ro=null;function jo(e){var t=e.alternate;q(Wo,1&Wo.current),q($o,e),null===Ro&&(null===t||null!==Lo.current||null!==t.memoizedState)&&(Ro=e)}function Uo(e){q(Wo,Wo.current),q($o,e),null===Ro&&(Ro=e)}function Zo(e){22===e.tag?(q(Wo,Wo.current),q($o,e),null===Ro&&(Ro=e)):Bo()}function Bo(){q(Wo,Wo.current),q($o,$o.current)}function Vo(e){W($o),Ro===e&&(Ro=null),W(Wo)}var Wo=V(0);function qo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Md(n)||Dd(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ho=0,Qo=null,Jo=null,Ko=null,Go=!1,Yo=!1,Xo=!1,ei=0,ti=0,ni=null,ri=0;function ai(){throw Error(a(321))}function oi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function ii(e,t,n,r,a,o){return Ho=o,Qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=null===e||null===e.memoizedState?kl:Sl,Xo=!1,o=n(r,a),Xo=!1,Yo&&(o=si(t,n,r,a)),li(e),o}function li(e){M.H=wl;var t=null!==Jo&&null!==Jo.next;if(Ho=0,Ko=Jo=Qo=null,Go=!1,ti=0,ni=null,t)throw Error(a(300));null===e||$l||null!==(e=e.dependencies)&&Fa(e)&&($l=!0)}function si(e,t,n,r){Qo=e;var o=0;do{if(Yo&&(ni=null),ti=0,Yo=!1,25<=o)throw Error(a(301));if(o+=1,Ko=Jo=null,null!=e.updateQueue){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,null!=i.memoCache&&(i.memoCache.index=0)}M.H=_l,i=t(n,r)}while(Yo);return i}function ui(){var e=M.H,t=e.useState()[0];return t="function"==typeof t.then?hi(t):t,e=e.useState()[0],(null!==Jo?Jo.memoizedState:null)!==e&&(Qo.flags|=1024),t}function ci(){var e=0!==ei;return ei=0,e}function di(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function fi(e){if(Go){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Go=!1}Ho=0,Ko=Jo=Qo=null,Yo=!1,ti=ei=0,ni=null}function pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ko?Qo.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function mi(){if(null===Jo){var e=Qo.alternate;e=null!==e?e.memoizedState:null}else e=Jo.next;var t=null===Ko?Qo.memoizedState:Ko.next;if(null!==t)Ko=t,Jo=e;else{if(null===e){if(null===Qo.alternate)throw Error(a(467));throw Error(a(310))}e={memoizedState:(Jo=e).memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},null===Ko?Qo.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function hi(e){var t=ti;return ti+=1,null===ni&&(ni=[]),e=lo(ni,e,t),t=Qo,null===(null===Ko?t.memoizedState:Ko.next)&&(t=t.alternate,M.H=null===t||null===t.memoizedState?kl:Sl),e}function gi(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return hi(e);if(e.$$typeof===w)return Da(e)}throw Error(a(438,String(e)))}function yi(e){var t=null,n=Qo.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=Qo.alternate;null!==r&&null!==(r=r.updateQueue)&&null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Qo.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=C;return t.index++,n}function vi(e,t){return"function"==typeof t?t(e):t}function bi(e){return wi(mi(),Jo,e)}function wi(e,t,n){var r=e.queue;if(null===r)throw Error(a(311));r.lastRenderedReducer=n;var o=e.baseQueue,i=r.pending;if(null!==i){if(null!==o){var l=o.next;o.next=i.next,i.next=l}t.baseQueue=o=i,r.pending=null}if(i=e.baseState,null===o)e.memoizedState=i;else{var s=l=null,u=null,c=t=o.next,d=!1;do{var f=-536870913&c.lane;if(f!==c.lane?(ku&f)===f:(Ho&f)===f){var p=c.revertLane;if(0===p)null!==u&&(u=u.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===Qa&&(d=!0);else{if((Ho&p)===p){c=c.next,p===Qa&&(d=!0);continue}f={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(s=u=f,l=i):u=u.next=f,Qo.lanes|=p,Tu|=p}f=c.action,Xo&&n(i,f),i=c.hasEagerState?c.eagerState:n(i,f)}else p={lane:f,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(s=u=p,l=i):u=u.next=p,Qo.lanes|=f,Tu|=f;c=c.next}while(null!==c&&c!==t);if(null===u?l=i:u.next=s,!rr(i,e.memoizedState)&&($l=!0,d&&null!==(n=Ja)))throw n;e.memoizedState=i,e.baseState=l,e.baseQueue=u,r.lastRenderedState=i}return null===o&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ki(e){var t=mi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{i=e(i,l.action),l=l.next}while(l!==o);rr(i,t.memoizedState)||($l=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Si(e,t,n){var r=Qo,o=mi(),i=ga;if(i){if(void 0===n)throw Error(a(407));n=n()}else n=t();var l=!rr((Jo||o).memoizedState,n);if(l&&(o.memoizedState=n,$l=!0),o=o.queue,Hi(zi.bind(null,r,o,e),[e]),o.getSnapshot!==t||l||null!==Ko&&1&Ko.memoizedState.tag){if(r.flags|=2048,Zi(9,{destroy:void 0},Ei.bind(null,r,o,n,t),null),null===bu)throw Error(a(349));i||127&Ho||_i(r,t,n)}return n}function _i(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Qo.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Qo.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ei(e,t,n,r){t.value=n,t.getSnapshot=r,xi(t)&&Ci(e)}function zi(e,t,n){return n(function(){xi(t)&&Ci(e)})}function xi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(r){return!0}}function Ci(e){var t=$r(e,2);null!==t&&Xu(t,0,2)}function Ni(e){var t=pi();if("function"==typeof e){var n=e;if(e=n(),Xo){Ee(!0);try{n()}finally{Ee(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:e},t}function Ti(e,t,n,r){return e.baseState=n,wi(e,Jo,"function"==typeof r?r:vi)}function Pi(e,t,n,r,o){if(yl(e))throw Error(a(485));if(null!==(e=t.action)){var i={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){i.listeners.push(e)}};null!==M.T?n(!0):i.isTransition=!1,r(i),null===(n=t.pending)?(i.next=t.pending=i,Oi(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Oi(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var o=M.T,i={};M.T=i;try{var l=n(a,r),s=M.S;null!==s&&s(i,l),Ii(e,t,l)}catch(u){Ai(e,t,u)}finally{null!==o&&null!==i.types&&(o.types=i.types),M.T=o}}else try{Ii(e,t,o=n(a,r))}catch(c){Ai(e,t,c)}}function Ii(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Li(e,t,n)},function(n){return Ai(e,t,n)}):Li(e,t,n)}function Li(e,t,n){t.status="fulfilled",t.value=n,Fi(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Oi(e,n)))}function Ai(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Fi(t),t=t.next}while(t!==r)}e.action=null}function Fi(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mi(e,t){return t}function Di(e,t){if(ga){var n=bu.formState;if(null!==n){e:{var r=Qo;if(ga){if(ha){t:{for(var a=ha,o=va;8!==a.nodeType;){if(!o){a=null;break t}if(null===(a=$d(a.nextSibling))){a=null;break t}}a="F!"===(o=a.data)||"F"===o?a:null}if(a){ha=$d(a.nextSibling),r="F!"===a.data;break e}}wa(r)}r=!1}r&&(t=n[0])}}return(n=pi()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:t},n.queue=r,n=ml.bind(null,Qo,r),r.dispatch=n,r=Ni(!1),o=gl.bind(null,Qo,!1,r.queue),a={state:t,dispatch:null,action:e,pending:null},(r=pi()).queue=a,n=Pi.bind(null,Qo,a,o,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function $i(e){return Ri(mi(),Jo,e)}function Ri(e,t,n){if(t=wi(e,t,Mi)[0],e=bi(vi)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=hi(t)}catch(i){if(i===no)throw ao;throw i}else r=t;var a=(t=mi()).queue,o=a.dispatch;return n!==t.memoizedState&&(Qo.flags|=2048,Zi(9,{destroy:void 0},ji.bind(null,a,n),null)),[r,o,e]}function ji(e,t){e.action=t}function Ui(e){var t=mi(),n=Jo;if(null!==n)return Ri(t,n,e);mi(),t=t.memoizedState;var r=(n=mi()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Zi(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=Qo.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Qo.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Bi(){return mi().memoizedState}function Vi(e,t,n,r){var a=pi();Qo.flags|=e,a.memoizedState=Zi(1|t,{destroy:void 0},n,void 0===r?null:r)}function Wi(e,t,n,r){var a=mi();r=void 0===r?null:r;var o=a.memoizedState.inst;null!==Jo&&null!==r&&oi(r,Jo.memoizedState.deps)?a.memoizedState=Zi(t,o,n,r):(Qo.flags|=e,a.memoizedState=Zi(1|t,o,n,r))}function qi(e,t){Vi(8390656,8,e,t)}function Hi(e,t){Wi(2048,8,e,t)}function Qi(e){var t=mi().memoizedState;return function(e){Qo.flags|=4;var t=Qo.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},Qo.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&vu)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ji(e,t){return Wi(4,2,e,t)}function Ki(e,t){return Wi(4,4,e,t)}function Gi(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Yi(e,t,n){n=null!=n?n.concat([e]):null,Wi(4,4,Gi.bind(null,t,e),n)}function Xi(){}function el(e,t){var n=mi();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&oi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tl(e,t){var n=mi();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&oi(t,r[1]))return r[0];if(r=e(),Xo){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r}function nl(e,t,n){return void 0===n||1073741824&Ho&&!(261930&ku)?e.memoizedState=t:(e.memoizedState=n,e=Yu(),Qo.lanes|=e,Tu|=e,n)}function rl(e,t,n,r){return rr(n,t)?n:null!==Lo.current?(e=nl(e,n,r),rr(e,t)||($l=!0),e):42&Ho&&(!(1073741824&Ho)||261930&ku)?(e=Yu(),Qo.lanes|=e,Tu|=e,t):($l=!0,e.memoizedState=n)}function al(e,t,n,r,a){var o=D.p;D.p=0!==o&&8>o?o:8;var i,l,s,u=M.T,c={};M.T=c,gl(e,!1,t,n);try{var d=a(),f=M.S;null!==f&&f(c,d),null!==d&&"object"==typeof d&&"function"==typeof d.then?hl(e,t,(i=r,l=[],s={status:"pending",value:null,reason:null,then:function(e){l.push(e)}},d.then(function(){s.status="fulfilled",s.value=i;for(var e=0;e<l.length;e++)(0,l[e])(i)},function(e){for(s.status="rejected",s.reason=e,e=0;e<l.length;e++)(0,l[e])(void 0)}),s),Gu()):hl(e,t,r,Gu())}catch(p){hl(e,t,{then:function(){},status:"rejected",reason:p},Gu())}finally{D.p=o,null!==u&&null!==c.types&&(u.types=c.types),M.T=u}}function ol(){}function il(e,t,n,r){if(5!==e.tag)throw Error(a(476));var o=ll(e).queue;al(e,o,t,U,null===n?ol:function(){return sl(e),n(r)})}function ll(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:U},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function sl(e){var t=ll(e);null===t.next&&(t=e.alternate.memoizedState),hl(e,t.next.queue,{},Gu())}function ul(){return Da(gf)}function cl(){return mi().memoizedState}function dl(){return mi().memoizedState}function fl(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Gu(),r=zo(t,e=Eo(n),n);return null!==r&&(Xu(r,0,n),xo(r,t,n)),t={cache:Va()},void(e.payload=t)}t=t.return}}function pl(e,t,n){var r=Gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},yl(e)?vl(t,n):null!==(n=Dr(e,t,n,r))&&(Xu(n,0,r),bl(n,t,r))}function ml(e,t,n){hl(e,t,n,Gu())}function hl(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(yl(e))vl(t,a);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=o(i,n);if(a.hasEagerState=!0,a.eagerState=l,rr(l,i))return Mr(e,t,a,0),null===bu&&Fr(),!1}catch(s){}if(null!==(n=Dr(e,t,a,r)))return Xu(n,0,r),bl(n,t,r),!0}return!1}function gl(e,t,n,r){if(r={lane:2,revertLane:Hc(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},yl(e)){if(t)throw Error(a(479))}else null!==(t=Dr(e,n,r,2))&&Xu(t,0,2)}function yl(e){var t=e.alternate;return e===Qo||null!==t&&t===Qo}function vl(e,t){Yo=Go=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bl(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}var wl={readContext:Da,use:gi,useCallback:ai,useContext:ai,useEffect:ai,useImperativeHandle:ai,useLayoutEffect:ai,useInsertionEffect:ai,useMemo:ai,useReducer:ai,useRef:ai,useState:ai,useDebugValue:ai,useDeferredValue:ai,useTransition:ai,useSyncExternalStore:ai,useId:ai,useHostTransitionStatus:ai,useFormState:ai,useActionState:ai,useOptimistic:ai,useMemoCache:ai,useCacheRefresh:ai};wl.useEffectEvent=ai;var kl={readContext:Da,use:gi,useCallback:function(e,t){return pi().memoizedState=[e,void 0===t?null:t],e},useContext:Da,useEffect:qi,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Vi(4194308,4,Gi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vi(4194308,4,e,t)},useInsertionEffect:function(e,t){Vi(4,2,e,t)},useMemo:function(e,t){var n=pi();t=void 0===t?null:t;var r=e();if(Xo){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=pi();if(void 0!==n){var a=n(t);if(Xo){Ee(!0);try{n(t)}finally{Ee(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=pl.bind(null,Qo,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},pi().memoizedState=e},useState:function(e){var t=(e=Ni(e)).queue,n=ml.bind(null,Qo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xi,useDeferredValue:function(e,t){return nl(pi(),e,t)},useTransition:function(){var e=Ni(!1);return e=al.bind(null,Qo,e.queue,!0,!1),pi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Qo,o=pi();if(ga){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===bu)throw Error(a(349));127&ku||_i(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qi(zi.bind(null,r,i,e),[e]),r.flags|=2048,Zi(9,{destroy:void 0},Ei.bind(null,r,i,n,t),null),n},useId:function(){var e=pi(),t=bu.identifierPrefix;if(ga){var n=sa;t="_"+t+"R_"+(n=(la&~(1<<32-ze(la)-1)).toString(32)+n),0<(n=ei++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=ri++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ul,useFormState:Di,useActionState:Di,useOptimistic:function(e){var t=pi();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gl.bind(null,Qo,!0,n),n.dispatch=t,[e,t]},useMemoCache:yi,useCacheRefresh:function(){return pi().memoizedState=fl.bind(null,Qo)},useEffectEvent:function(e){var t=pi(),n={impl:e};return t.memoizedState=n,function(){if(2&vu)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Sl={readContext:Da,use:gi,useCallback:el,useContext:Da,useEffect:Hi,useImperativeHandle:Yi,useInsertionEffect:Ji,useLayoutEffect:Ki,useMemo:tl,useReducer:bi,useRef:Bi,useState:function(){return bi(vi)},useDebugValue:Xi,useDeferredValue:function(e,t){return rl(mi(),Jo.memoizedState,e,t)},useTransition:function(){var e=bi(vi)[0],t=mi().memoizedState;return["boolean"==typeof e?e:hi(e),t]},useSyncExternalStore:Si,useId:cl,useHostTransitionStatus:ul,useFormState:$i,useActionState:$i,useOptimistic:function(e,t){return Ti(mi(),0,e,t)},useMemoCache:yi,useCacheRefresh:dl};Sl.useEffectEvent=Qi;var _l={readContext:Da,use:gi,useCallback:el,useContext:Da,useEffect:Hi,useImperativeHandle:Yi,useInsertionEffect:Ji,useLayoutEffect:Ki,useMemo:tl,useReducer:ki,useRef:Bi,useState:function(){return ki(vi)},useDebugValue:Xi,useDeferredValue:function(e,t){var n=mi();return null===Jo?nl(n,e,t):rl(n,Jo.memoizedState,e,t)},useTransition:function(){var e=ki(vi)[0],t=mi().memoizedState;return["boolean"==typeof e?e:hi(e),t]},useSyncExternalStore:Si,useId:cl,useHostTransitionStatus:ul,useFormState:Ui,useActionState:Ui,useOptimistic:function(e,t){var n=mi();return null!==Jo?Ti(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:yi,useCacheRefresh:dl};function El(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:d({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}_l.useEffectEvent=Qi;var zl={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Gu(),a=Eo(r);a.payload=t,null!=n&&(a.callback=n),null!==(t=zo(e,a,r))&&(Xu(t,0,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Gu(),a=Eo(r);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=zo(e,a,r))&&(Xu(t,0,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Gu(),r=Eo(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=zo(e,r,n))&&(Xu(t,0,n),xo(t,e,n))}};function xl(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!(t.prototype&&t.prototype.isPureReactComponent&&ar(n,r)&&ar(a,o))}function Cl(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zl.enqueueReplaceState(t,t.state,null)}function Nl(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var a in n===t&&(n=d({},n)),e)void 0===n[a]&&(n[a]=e[a]);return n}function Tl(e){Or(e)}function Pl(e){console.error(e)}function Ol(e){Or(e)}function Il(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ll(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Al(e,t,n){return(n=Eo(n)).tag=3,n.payload={element:null},n.callback=function(){Il(e,t)},n}function Fl(e){return(e=Eo(e)).tag=3,e}function Ml(e,t,n,r){var a=n.type.getDerivedStateFromError;if("function"==typeof a){var o=r.value;e.payload=function(){return a(o)},e.callback=function(){Ll(t,n,r)}}var i=n.stateNode;null!==i&&"function"==typeof i.componentDidCatch&&(e.callback=function(){Ll(t,n,r),"function"!=typeof a&&(null===Uu?Uu=/* @__PURE__ */new Set([this]):Uu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Dl=Error(a(461)),$l=!1;function Rl(e,t,n,r){t.child=null===e?wo(t,null,n,r):bo(t,e.child,n,r)}function jl(e,t,n,r,a){n=n.render;var o=t.ref;if("ref"in r){var i={};for(var l in r)"ref"!==l&&(i[l]=r[l])}else i=r;return Ma(t),r=ii(e,t,n,i,o,a),l=ci(),null===e||$l?(ga&&l&&da(t),t.flags|=1,Rl(e,t,r,a),t.child):(di(e,t,a),us(e,t,a))}function Ul(e,t,n,r,a){if(null===e){var o=n.type;return"function"!=typeof o||Vr(o)||void 0!==o.defaultProps||null!==n.compare?((e=Hr(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Zl(e,t,o,r,a))}if(o=e.child,!cs(e,a)){var i=o.memoizedProps;if((n=null!==(n=n.compare)?n:ar)(i,r)&&e.ref===t.ref)return us(e,t,a)}return t.flags|=1,(e=Wr(o,r)).ref=t.ref,e.return=t,t.child=e}function Zl(e,t,n,r,a){if(null!==e){var o=e.memoizedProps;if(ar(o,r)&&e.ref===t.ref){if($l=!1,t.pendingProps=r=o,!cs(e,a))return t.lanes=e.lanes,us(e,t,a);131072&e.flags&&($l=!0)}}return Jl(e,t,n,r,a)}function Bl(e,t,n,r){var a=r.children,o=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(o=null!==o?o.baseLanes|n:n,null!==e){for(r=t.child=e.child,a=0;null!==r;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~o}else r=0,t.child=null;return Wl(e,t,o,n,r)}if(!(536870912&n))return r=t.lanes=536870912,Wl(e,t,null!==o?o.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&eo(0,null!==o?o.cachePool:null),null!==o?Fo(t,o):Mo(),Zo(t)}else null!==o?(eo(0,o.cachePool),Fo(t,o),Bo(),t.memoizedState=null):(null!==e&&eo(0,null),Mo(),Bo());return Rl(e,t,a,n),t.child}function Vl(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wl(e,t,n,r,a){var o=Xa();return o=null===o?null:{parent:Ba._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},null!==e&&eo(0,null),Mo(),Zo(t),null!==e&&Aa(e,t,r,!0),t.childLanes=a,null}function ql(e,t){return(t=as({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function Hl(e,t,n){return bo(t,e.child,null,n),(e=ql(t,t.pendingProps)).flags|=2,Vo(t),t.memoizedState=null,e}function Ql(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(a(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Jl(e,t,n,r,a){return Ma(t),n=ii(e,t,n,r,void 0,a),r=ci(),null===e||$l?(ga&&r&&da(t),t.flags|=1,Rl(e,t,n,a),t.child):(di(e,t,a),us(e,t,a))}function Kl(e,t,n,r,a,o){return Ma(t),t.updateQueue=null,n=si(t,r,n,a),li(e),r=ci(),null===e||$l?(ga&&r&&da(t),t.flags|=1,Rl(e,t,n,o),t.child):(di(e,t,o),us(e,t,o))}function Gl(e,t,n,r,a){if(Ma(t),null===t.stateNode){var o=Ur,i=n.contextType;"object"==typeof i&&null!==i&&(o=Da(i)),o=new n(r,o),t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,o.updater=zl,t.stateNode=o,o._reactInternals=t,(o=t.stateNode).props=r,o.state=t.memoizedState,o.refs={},So(t),i=n.contextType,o.context="object"==typeof i&&null!==i?Da(i):Ur,o.state=t.memoizedState,"function"==typeof(i=n.getDerivedStateFromProps)&&(El(t,n,i,r),o.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(i=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),i!==o.state&&zl.enqueueReplaceState(o,o.state,null),Po(t,r,o,a),To(),o.state=t.memoizedState),"function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){o=t.stateNode;var l=t.memoizedProps,s=Nl(n,l);o.props=s;var u=o.context,c=n.contextType;i=Ur,"object"==typeof c&&null!==c&&(i=Da(c));var d=n.getDerivedStateFromProps;c="function"==typeof d||"function"==typeof o.getSnapshotBeforeUpdate,l=t.pendingProps!==l,c||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(l||u!==i)&&Cl(t,o,r,i),ko=!1;var f=t.memoizedState;o.state=f,Po(t,r,o,a),To(),u=t.memoizedState,l||f!==u||ko?("function"==typeof d&&(El(t,n,d,r),u=t.memoizedState),(s=ko||xl(t,n,s,r,f,u,i))?(c||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=i,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,_o(e,t),c=Nl(n,i=t.memoizedProps),o.props=c,d=t.pendingProps,f=o.context,u=n.contextType,s=Ur,"object"==typeof u&&null!==u&&(s=Da(u)),(u="function"==typeof(l=n.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==d||f!==s)&&Cl(t,o,r,s),ko=!1,f=t.memoizedState,o.state=f,Po(t,r,o,a),To();var p=t.memoizedState;i!==d||f!==p||ko||null!==e&&null!==e.dependencies&&Fa(e.dependencies)?("function"==typeof l&&(El(t,n,l,r),p=t.memoizedState),(c=ko||xl(t,n,c,r,f,p,s)||null!==e&&null!==e.dependencies&&Fa(e.dependencies))?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,s),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=s,r=c):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,Ql(e,t),r=!!(128&t.flags),o||r?(o=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:o.render(),t.flags|=1,null!==e&&r?(t.child=bo(t,e.child,null,a),t.child=bo(t,null,n,a)):Rl(e,t,n,a),t.memoizedState=o.state,e=t.child):e=us(e,t,a),e}function Yl(e,t,n,r){return Ea(),t.flags|=256,Rl(e,t,n,r),t.child}var Xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function es(e){return{baseLanes:e,cachePool:to()}}function ts(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Iu),e}function ns(e,t,n){var r,o=t.pendingProps,i=!1,l=!!(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&!!(2&Wo.current)),r&&(i=!0,t.flags&=-129),r=!!(32&t.flags),t.flags&=-33,null===e){if(ga){if(i?jo(t):Bo(),(e=ha)?null!==(e=null!==(e=Fd(e,va))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ia?{id:la,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},(n=Kr(e)).return=t,t.child=n,ma=t,ha=null):e=null,null===e)throw wa(t);return Dd(e)?t.lanes=32:t.lanes=536870912,null}var s=o.children;return o=o.fallback,i?(Bo(),s=as({mode:"hidden",children:s},i=t.mode),o=Qr(o,i,n,null),s.return=t,o.return=t,s.sibling=o,t.child=s,(o=t.child).memoizedState=es(n),o.childLanes=ts(e,r,n),t.memoizedState=Xl,Vl(null,o)):(jo(t),rs(t,s))}var u=e.memoizedState;if(null!==u&&null!==(s=u.dehydrated)){if(l)256&t.flags?(jo(t),t.flags&=-257,t=os(e,t,n)):null!==t.memoizedState?(Bo(),t.child=e.child,t.flags|=128,t=null):(Bo(),s=o.fallback,i=t.mode,o=as({mode:"visible",children:o.children},i),(s=Qr(s,i,n,null)).flags|=2,o.return=t,s.return=t,o.sibling=s,t.child=o,bo(t,e.child,null,n),(o=t.child).memoizedState=es(n),o.childLanes=ts(e,r,n),t.memoizedState=Xl,t=Vl(null,o));else if(jo(t),Dd(s)){if(r=s.nextSibling&&s.nextSibling.dataset)var c=r.dgst;r=c,(o=Error(a(419))).stack="",o.digest=r,xa({value:o,source:null,stack:null}),t=os(e,t,n)}else if($l||Aa(e,t,n,!1),r=0!==(n&e.childLanes),$l||r){if(null!==(r=bu)&&0!==(o=je(r,n))&&o!==u.retryLane)throw u.retryLane=o,$r(e,o),Xu(r,0,o),Dl;Md(s)||dc(),t=os(e,t,n)}else Md(s)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,ha=$d(s.nextSibling),ma=t,ga=!0,ya=null,va=!1,null!==e&&pa(t,e),(t=rs(t,o.children)).flags|=4096);return t}return i?(Bo(),s=o.fallback,i=t.mode,c=(u=e.child).sibling,(o=Wr(u,{mode:"hidden",children:o.children})).subtreeFlags=65011712&u.subtreeFlags,null!==c?s=Wr(c,s):(s=Qr(s,i,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,Vl(null,o),o=t.child,null===(s=e.child.memoizedState)?s=es(n):(null!==(i=s.cachePool)?(u=Ba._currentValue,i=i.parent!==u?{parent:u,pool:u}:i):i=to(),s={baseLanes:s.baseLanes|n,cachePool:i}),o.memoizedState=s,o.childLanes=ts(e,r,n),t.memoizedState=Xl,Vl(e.child,o)):(jo(t),e=(n=e.child).sibling,(n=Wr(n,{mode:"visible",children:o.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function rs(e,t){return(t=as({mode:"visible",children:t},e.mode)).return=e,e.child=t}function as(e,t){return(e=Br(22,e,null,t)).lanes=0,e}function os(e,t,n){return bo(t,e.child,null,n),(e=rs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function is(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ia(e.return,t,n)}function ls(e,t,n,r,a,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a,i.treeForkCount=o)}function ss(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;r=r.children;var i=Wo.current,l=!!(2&i);if(l?(i=1&i|2,t.flags|=128):i&=1,q(Wo,i),Rl(e,t,r,n),r=ga?ra:0,!l&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&is(e,n,t);else if(19===e.tag)is(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===qo(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ls(t,!1,a,n,o,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===qo(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ls(t,!0,n,null,o,r);break;case"together":ls(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function us(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Tu|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Aa(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Wr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function cs(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Fa(e))}function ds(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)$l=!0;else{if(!(cs(e,n)||128&t.flags))return $l=!1,function(e,t,n){switch(t.tag){case 3:X(t,t.stateNode.containerInfo),Pa(0,Ba,e.memoizedState.cache),Ea();break;case 27:case 5:te(t);break;case 4:X(t,t.stateNode.containerInfo);break;case 10:Pa(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Uo(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(jo(t),t.flags|=128,null):0!==(n&t.child.childLanes)?ns(e,t,n):(jo(t),null!==(e=us(e,t,n))?e.sibling:null);jo(t);break;case 19:var a=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Aa(e,t,n,!1),r=0!==(n&t.childLanes)),a){if(r)return ss(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),q(Wo,Wo.current),r)break;return null;case 22:return t.lanes=0,Bl(e,t,n,t.pendingProps);case 24:Pa(0,Ba,e.memoizedState.cache)}return us(e,t,n)}(e,t,n);$l=!!(131072&e.flags)}else $l=!1,ga&&1048576&t.flags&&ca(t,ra,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=so(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var o=e.$$typeof;if(o===k){t.tag=11,t=jl(null,t,e,r,n);break e}if(o===E){t.tag=14,t=Ul(null,t,e,r,n);break e}}throw t=O(e)||e,Error(a(306,t,""))}Vr(e)?(r=Nl(e,r),t.tag=1,t=Gl(null,t,e,r,n)):(t.tag=0,t=Jl(null,t,e,r,n))}return t;case 0:return Jl(e,t,t.type,t.pendingProps,n);case 1:return Gl(e,t,r=t.type,o=Nl(r,t.pendingProps),n);case 3:e:{if(X(t,t.stateNode.containerInfo),null===e)throw Error(a(387));r=t.pendingProps;var i=t.memoizedState;o=i.element,_o(e,t),Po(t,r,null,n);var l=t.memoizedState;if(r=l.cache,Pa(0,Ba,r),r!==i.cache&&La(t,[Ba],n,!0),To(),r=l.element,i.isDehydrated){if(i={element:r,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Yl(e,t,r,n);break e}if(r!==o){xa(o=Xr(Error(a(424)),t)),t=Yl(e,t,r,n);break e}for(e=9===(e=t.stateNode.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,ha=$d(e.firstChild),ma=t,ga=!0,ya=null,va=!0,n=wo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Ea(),r===o){t=us(e,t,n);break e}Rl(e,t,r,n)}t=t.child}return t;case 26:return Ql(e,t),null===e?(n=Kd(t.type,null,t.pendingProps,null))?t.memoizedState=n:ga||(n=t.type,e=t.pendingProps,(r=kd(G.current).createElement(n))[qe]=t,r[He]=e,yd(r,n,e),ot(r),t.stateNode=r):t.memoizedState=Kd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),null===e&&ga&&(r=t.stateNode=Zd(t.type,t.pendingProps,G.current),ma=t,va=!0,o=ha,Od(t.type)?(Rd=o,ha=$d(r.firstChild)):ha=o),Rl(e,t,t.pendingProps.children,n),Ql(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&ga&&((o=r=ha)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Xe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(o!==a.rel||e.getAttribute("href")!==(null==a.href||""===a.href?null:a.href)||e.getAttribute("crossorigin")!==(null==a.crossOrigin?null:a.crossOrigin)||e.getAttribute("title")!==(null==a.title?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==a.src?null:a.src)||e.getAttribute("type")!==(null==a.type?null:a.type)||e.getAttribute("crossorigin")!==(null==a.crossOrigin?null:a.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==a.name?null:""+a.name;if("hidden"===a.type&&e.getAttribute("name")===o)return e}if(null===(e=$d(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,va))?(t.stateNode=r,ma=t,ha=$d(r.firstChild),va=!1,o=!0):o=!1),o||wa(t)),te(t),o=t.type,i=t.pendingProps,l=null!==e?e.memoizedProps:null,r=i.children,Ed(o,i)?r=null:null!==l&&Ed(o,l)&&(t.flags|=32),null!==t.memoizedState&&(o=ii(e,t,ui,null,null,n),gf._currentValue=o),Ql(e,t),Rl(e,t,r,n),t.child;case 6:return null===e&&ga&&((e=n=ha)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=$d(e.nextSibling)))return null}return e}(n,t.pendingProps,va))?(t.stateNode=n,ma=t,ha=null,e=!0):e=!1),e||wa(t)),null;case 13:return ns(e,t,n);case 4:return X(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=bo(t,null,r,n):Rl(e,t,r,n),t.child;case 11:return jl(e,t,t.type,t.pendingProps,n);case 7:return Rl(e,t,t.pendingProps,n),t.child;case 8:case 12:return Rl(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Pa(0,t.type,r.value),Rl(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Ma(t),r=r(o=Da(o)),t.flags|=1,Rl(e,t,r,n),t.child;case 14:return Ul(e,t,t.type,t.pendingProps,n);case 15:return Zl(e,t,t.type,t.pendingProps,n);case 19:return ss(e,t,n);case 31:return function(e,t,n){var r=t.pendingProps,o=!!(128&t.flags);if(t.flags&=-129,null===e){if(ga){if("hidden"===r.mode)return e=ql(t,r),t.lanes=536870912,Vl(null,e);if(Uo(t),(e=ha)?null!==(e=null!==(e=Fd(e,va))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ia?{id:la,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},(n=Kr(e)).return=t,t.child=n,ma=t,ha=null):e=null,null===e)throw wa(t);return t.lanes=536870912,null}return ql(t,r)}var i=e.memoizedState;if(null!==i){var l=i.dehydrated;if(Uo(t),o)if(256&t.flags)t.flags&=-257,t=Hl(e,t,n);else{if(null===t.memoizedState)throw Error(a(558));t.child=e.child,t.flags|=128,t=null}else if($l||Aa(e,t,n,!1),o=0!==(n&e.childLanes),$l||o){if(null!==(r=bu)&&0!==(l=je(r,n))&&l!==i.retryLane)throw i.retryLane=l,$r(e,l),Xu(r,0,l),Dl;dc(),t=Hl(e,t,n)}else e=i.treeContext,ha=$d(l.nextSibling),ma=t,ga=!0,ya=null,va=!1,null!==e&&pa(t,e),(t=ql(t,r)).flags|=4096;return t}return(e=Wr(e.child,{mode:r.mode,children:r.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Bl(e,t,n,t.pendingProps);case 24:return Ma(t),r=Da(Ba),null===e?(null===(o=Xa())&&(o=bu,i=Va(),o.pooledCache=i,i.refCount++,null!==i&&(o.pooledCacheLanes|=n),o=i),t.memoizedState={parent:r,cache:o},So(t),Pa(0,Ba,o)):(0!==(e.lanes&n)&&(_o(e,t),Po(t,null,null,n),To()),o=e.memoizedState,i=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=o),Pa(0,Ba,r)):(r=i.cache,Pa(0,Ba,r),r!==o.cache&&La(t,[Ba],n,!0))),Rl(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function fs(e){e.flags|=4}function ps(e,t,n,r,a){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&a)===a)if(e.stateNode.complete)e.flags|=8192;else{if(!sc())throw uo=oo,ro;e.flags|=8192}}else e.flags&=-16777217}function ms(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!cf(t)){if(!sc())throw uo=oo,ro;e.flags|=8192}}function hs(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Fe():536870912,e.lanes|=t,Lu|=t)}function gs(e,t){if(!ga)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ys(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=65011712&a.subtreeFlags,r|=65011712&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vs(e,t,n){var r=t.pendingProps;switch(fa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return ys(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Oa(Ba),ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_a(t)?fs(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,za())),ys(t),null;case 26:var o=t.type,i=t.memoizedState;return null===e?(fs(t),null!==i?(ys(t),ms(t,i)):(ys(t),ps(t,o,0,0,n))):i?i!==e.memoizedState?(fs(t),ys(t),ms(t,i)):(ys(t),t.flags&=-16777217):((e=e.memoizedProps)!==r&&fs(t),ys(t),ps(t,o,0,0,n)),null;case 27:if(ne(t),n=G.current,o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&fs(t);else{if(!r){if(null===t.stateNode)throw Error(a(166));return ys(t),null}e=J.current,_a(t)?ka(t):(e=Zd(o,r,n),t.stateNode=e,fs(t))}return ys(t),null;case 5:if(ne(t),o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&fs(t);else{if(!r){if(null===t.stateNode)throw Error(a(166));return ys(t),null}if(i=J.current,_a(t))ka(t);else{var l=kd(G.current);switch(i){case 1:i=l.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=l.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=l.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=l.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":(i=l.createElement("div")).innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i="string"==typeof r.is?l.createElement(o,{is:r.is}):l.createElement(o)}}i[qe]=t,i[He]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)i.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=i;e:switch(yd(i,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&fs(t)}}return ys(t),ps(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&fs(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));if(e=G.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(o=ma))switch(o.tag){case 27:case 5:r=o.memoizedProps}e[qe]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||md(e.nodeValue,n)))||wa(t,!0)}else(e=kd(e).createTextNode(r))[qe]=t,t.stateNode=e}return ys(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=_a(t),null!==n){if(null===e){if(!r)throw Error(a(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(a(557));e[qe]=t}else Ea(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ys(t),e=!1}else n=za(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Vo(t),t):(Vo(t),null);if(128&t.flags)throw Error(a(558))}return ys(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(o=_a(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(a(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(a(317));o[qe]=t}else Ea(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ys(t),o=!1}else o=za(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return 256&t.flags?(Vo(t),t):(Vo(t),null)}return Vo(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(o=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(o=r.alternate.memoizedState.cachePool.pool),i=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(i=r.memoizedState.cachePool.pool),i!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hs(t,t.updateQueue),ys(t),null);case 4:return ee(),null===e&&ad(t.stateNode.containerInfo),ys(t),null;case 10:return Oa(t.type),ys(t),null;case 19:if(W(Wo),null===(r=t.memoizedState))return ys(t),null;if(o=!!(128&t.flags),null===(i=r.rendering))if(o)gs(r,!1);else{if(0!==Nu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(i=qo(e))){for(t.flags|=128,gs(r,!1),e=i.updateQueue,t.updateQueue=e,hs(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)qr(n,e),n=n.sibling;return q(Wo,1&Wo.current|2),ga&&ua(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&pe()>Ru&&(t.flags|=128,o=!0,gs(r,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=qo(i))){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,hs(t,e),gs(r,!0),null===r.tail&&"hidden"===r.tailMode&&!i.alternate&&!ga)return ys(t),null}else 2*pe()-r.renderingStartTime>Ru&&536870912!==n&&(t.flags|=128,o=!0,gs(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(null!==(e=r.last)?e.sibling=i:t.child=i,r.last=i)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=pe(),e.sibling=null,n=Wo.current,q(Wo,o?1&n|2:1&n),ga&&ua(t,r.treeForkCount),e):(ys(t),null);case 22:case 23:return Vo(t),Do(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(ys(t),6&t.subtreeFlags&&(t.flags|=8192)):ys(t),null!==(n=t.updateQueue)&&hs(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&W(Ya),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Ba),ys(t),null;case 25:case 30:return null}throw Error(a(156,t.tag))}function bs(e,t){switch(fa(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Oa(Ba),ee(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return ne(t),null;case 31:if(null!==t.memoizedState){if(Vo(t),null===t.alternate)throw Error(a(340));Ea()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Vo(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Ea()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return W(Wo),null;case 4:return ee(),null;case 10:return Oa(t.type),null;case 22:case 23:return Vo(t),Do(),null!==e&&W(Ya),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Oa(Ba),null;default:return null}}function ws(e,t){switch(fa(t),t.tag){case 3:Oa(Ba),ee();break;case 26:case 27:case 5:ne(t);break;case 4:ee();break;case 31:null!==t.memoizedState&&Vo(t);break;case 13:Vo(t);break;case 19:W(Wo);break;case 10:Oa(t.type);break;case 22:case 23:Vo(t),Do(),null!==e&&W(Ya);break;case 24:Oa(Ba)}}function ks(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var o=n.create,i=n.inst;r=o(),i.destroy=r}n=n.next}while(n!==a)}}catch(l){Nc(t,t.return,l)}}function Ss(e,t,n){try{var r=t.updateQueue,a=null!==r?r.lastEffect:null;if(null!==a){var o=a.next;r=o;do{if((r.tag&e)===e){var i=r.inst,l=i.destroy;if(void 0!==l){i.destroy=void 0,a=t;var s=n,u=l;try{u()}catch(c){Nc(a,s,c)}}}r=r.next}while(r!==o)}}catch(c){Nc(t,t.return,c)}}function _s(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Io(t,n)}catch(r){Nc(e,e.return,r)}}}function Es(e,t,n){n.props=Nl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Nc(e,t,r)}}function zs(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(a){Nc(e,t,a)}}function xs(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(a){Nc(e,t,a)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(o){Nc(e,t,o)}else n.current=null}function Cs(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){Nc(e,e.return,a)}}function Ns(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,i=null,l=null,s=null,u=null,c=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&null!=f)switch(m){case"checked":case"value":break;case"defaultValue":u=f;default:r.hasOwnProperty(m)||hd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(null!=m||null!=f))switch(p){case"type":i=m;break;case"name":o=m;break;case"checked":c=m;break;case"defaultChecked":d=m;break;case"value":l=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(a(137,t));break;default:m!==f&&hd(e,t,p,m,r,f)}}return void _t(e,l,s,u,c,d,i,o);case"select":for(i in m=l=s=p=null,n)if(u=n[i],n.hasOwnProperty(i)&&null!=u)switch(i){case"value":break;case"multiple":m=u;default:r.hasOwnProperty(i)||hd(e,t,i,null,r,u)}for(o in r)if(i=r[o],u=n[o],r.hasOwnProperty(o)&&(null!=i||null!=u))switch(o){case"value":p=i;break;case"defaultValue":s=i;break;case"multiple":l=i;default:i!==u&&hd(e,t,o,i,r,u)}return t=s,n=l,r=m,void(null!=p?xt(e,!!n,p,!1):!!r!=!!n&&(null!=t?xt(e,!!n,t,!0):xt(e,!!n,n?[]:"",!1)));case"textarea":for(s in m=p=null,n)if(o=n[s],n.hasOwnProperty(s)&&null!=o&&!r.hasOwnProperty(s))switch(s){case"value":case"children":break;default:hd(e,t,s,null,r,o)}for(l in r)if(o=r[l],i=n[l],r.hasOwnProperty(l)&&(null!=o||null!=i))switch(l){case"value":p=o;break;case"defaultValue":m=o;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=o)throw Error(a(91));break;default:o!==i&&hd(e,t,l,o,r,i)}return void Ct(e,p,m);case"option":for(var h in n)p=n[h],n.hasOwnProperty(h)&&null!=p&&!r.hasOwnProperty(h)&&("selected"===h?e.selected=!1:hd(e,t,h,null,r,p));for(u in r)p=r[u],m=n[u],!r.hasOwnProperty(u)||p===m||null==p&&null==m||("selected"===u?e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p:hd(e,t,u,p,r,m));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!r.hasOwnProperty(g)&&hd(e,t,g,null,r,p);for(c in r)if(p=r[c],m=n[c],r.hasOwnProperty(c)&&p!==m&&(null!=p||null!=m))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(a(137,t));break;default:hd(e,t,c,p,r,m)}return;default:if(Lt(t)){for(var y in n)p=n[y],n.hasOwnProperty(y)&&void 0!==p&&!r.hasOwnProperty(y)&&gd(e,t,y,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||void 0===p&&void 0===m||gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&null!=p&&!r.hasOwnProperty(v)&&hd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||null==p&&null==m||hd(e,t,f,p,r,m)}(r,e.type,n,t),r[He]=t}catch(o){Nc(e,e.return,o)}}function Ts(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Od(e.type)||4===e.tag}function Ps(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ts(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Od(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Os(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Dt));else if(4!==r&&(27===r&&Od(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Os(e,t,n),e=e.sibling;null!==e;)Os(e,t,n),e=e.sibling}function Is(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Od(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Is(e,t,n),e=e.sibling;null!==e;)Is(e,t,n),e=e.sibling}function Ls(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);yd(t,r,n),t[qe]=e,t[He]=n}catch(o){Nc(e,e.return,o)}}var As=!1,Fs=!1,Ms=!1,Ds="function"==typeof WeakSet?WeakSet:Set,$s=null;function Rs(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xs(e,n),4&r&&ks(5,n);break;case 1:if(Xs(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(i){Nc(n,n.return,i)}else{var a=Nl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){Nc(n,n.return,l)}}64&r&&_s(n),512&r&&zs(n,n.return);break;case 3:if(Xs(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Io(e,t)}catch(i){Nc(n,n.return,i)}}break;case 27:null===t&&4&r&&Ls(n);case 26:case 5:Xs(e,n),null===t&&4&r&&Cs(n),512&r&&zs(n,n.return);break;case 12:Xs(e,n);break;case 31:Xs(e,n),4&r&&Ws(e,n);break;case 13:Xs(e,n),4&r&&qs(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Ic.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||As)){t=null!==t&&null!==t.memoizedState||Fs,a=As;var o=Fs;As=r,(Fs=t)&&!o?tu(e,n,!!(8772&n.subtreeFlags)):Xs(e,n),As=a,Fs=o}break;case 30:break;default:Xs(e,n)}}function js(e){var t=e.alternate;null!==t&&(e.alternate=null,js(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&et(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Us=null,Zs=!1;function Bs(e,t,n){for(n=n.child;null!==n;)Vs(e,t,n),n=n.sibling}function Vs(e,t,n){if(_e&&"function"==typeof _e.onCommitFiberUnmount)try{_e.onCommitFiberUnmount(Se,n)}catch(o){}switch(n.tag){case 26:Fs||xs(n,t),Bs(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Fs||xs(n,t);var r=Us,a=Zs;Od(n.type)&&(Us=n.stateNode,Zs=!1),Bs(e,t,n),Bd(n.stateNode),Us=r,Zs=a;break;case 5:Fs||xs(n,t);case 6:if(r=Us,a=Zs,Us=null,Bs(e,t,n),Zs=a,null!==(Us=r))if(Zs)try{(9===Us.nodeType?Us.body:"HTML"===Us.nodeName?Us.ownerDocument.body:Us).removeChild(n.stateNode)}catch(i){Nc(n,t,i)}else try{Us.removeChild(n.stateNode)}catch(i){Nc(n,t,i)}break;case 18:null!==Us&&(Zs?(Id(9===(e=Us).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Kf(e)):Id(Us,n.stateNode));break;case 4:r=Us,a=Zs,Us=n.stateNode.containerInfo,Zs=!0,Bs(e,t,n),Us=r,Zs=a;break;case 0:case 11:case 14:case 15:Ss(2,n,t),Fs||Ss(4,n,t),Bs(e,t,n);break;case 1:Fs||(xs(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&Es(n,t,r)),Bs(e,t,n);break;case 21:Bs(e,t,n);break;case 22:Fs=(r=Fs)||null!==n.memoizedState,Bs(e,t,n),Fs=r;break;default:Bs(e,t,n)}}function Ws(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Kf(e)}catch(n){Nc(t,t.return,n)}}}function qs(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Kf(e)}catch(n){Nc(t,t.return,n)}}function Hs(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Ds),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Ds),t;default:throw Error(a(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Lc.bind(null,e,t);t.then(r,r)}})}function Qs(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r],i=e,l=t,s=l;e:for(;null!==s;){switch(s.tag){case 27:if(Od(s.type)){Us=s.stateNode,Zs=!1;break e}break;case 5:Us=s.stateNode,Zs=!1;break e;case 3:case 4:Us=s.stateNode.containerInfo,Zs=!0;break e}s=s.return}if(null===Us)throw Error(a(160));Vs(i,l,o),Us=null,Zs=!1,null!==(i=o.alternate)&&(i.return=null),o.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Ks(t,e),t=t.sibling}var Js=null;function Ks(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qs(t,e),Gs(e),4&r&&(Ss(3,e,e.return),ks(3,e),Ss(5,e,e.return));break;case 1:Qs(t,e),Gs(e),512&r&&(Fs||null===n||xs(n,n.return)),64&r&&As&&null!==(e=e.updateQueue)&&null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r));break;case 26:var o=Js;if(Qs(t,e),Gs(e),512&r&&(Fs||null===n||xs(n,n.return)),4&r){var i=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":(!(i=o.getElementsByTagName("title")[0])||i[Xe]||i[qe]||"http://www.w3.org/2000/svg"===i.namespaceURI||i.hasAttribute("itemprop"))&&(i=o.createElement(r),o.head.insertBefore(i,o.querySelector("head > title"))),yd(i,r,n),i[qe]=e,ot(i),r=i;break e;case"link":var l=sf("link","href",o).get(r+(n.href||""));if(l)for(var s=0;s<l.length;s++)if((i=l[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&i.getAttribute("rel")===(null==n.rel?null:n.rel)&&i.getAttribute("title")===(null==n.title?null:n.title)&&i.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){l.splice(s,1);break t}yd(i=o.createElement(r),r,n),o.head.appendChild(i);break;case"meta":if(l=sf("meta","content",o).get(r+(n.content||"")))for(s=0;s<l.length;s++)if((i=l[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&i.getAttribute("name")===(null==n.name?null:n.name)&&i.getAttribute("property")===(null==n.property?null:n.property)&&i.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&i.getAttribute("charset")===(null==n.charSet?null:n.charSet)){l.splice(s,1);break t}yd(i=o.createElement(r),r,n),o.head.appendChild(i);break;default:throw Error(a(468,r))}i[qe]=e,ot(i),r=i}e.stateNode=r}else uf(o,e.type,e.stateNode);else e.stateNode=nf(o,r,e.memoizedProps);else i!==r?(null===i?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):i.count--,null===r?uf(o,e.type,e.stateNode):nf(o,r,e.memoizedProps)):null===r&&null!==e.stateNode&&Ns(e,e.memoizedProps,n.memoizedProps)}break;case 27:Qs(t,e),Gs(e),512&r&&(Fs||null===n||xs(n,n.return)),null!==n&&4&r&&Ns(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Qs(t,e),Gs(e),512&r&&(Fs||null===n||xs(n,n.return)),32&e.flags){o=e.stateNode;try{Tt(o,"")}catch(h){Nc(e,e.return,h)}}4&r&&null!=e.stateNode&&Ns(e,o=e.memoizedProps,null!==n?n.memoizedProps:o),1024&r&&(Ms=!0);break;case 6:if(Qs(t,e),Gs(e),4&r){if(null===e.stateNode)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(h){Nc(e,e.return,h)}}break;case 3:if(lf=null,o=Js,Js=qd(t.containerInfo),Qs(t,e),Js=o,Gs(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Kf(t.containerInfo)}catch(h){Nc(e,e.return,h)}Ms&&(Ms=!1,Ys(e));break;case 4:r=Js,Js=qd(e.stateNode.containerInfo),Qs(t,e),Gs(e),Js=r;break;case 12:default:Qs(t,e),Gs(e);break;case 31:case 19:Qs(t,e),Gs(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,Hs(e,r));break;case 13:Qs(t,e),Gs(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Du=pe()),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,Hs(e,r));break;case 22:o=null!==e.memoizedState;var u=null!==n&&null!==n.memoizedState,c=As,d=Fs;if(As=c||o,Fs=d||u,Qs(t,e),Fs=d,As=c,Gs(e),8192&r)e:for(t=e.stateNode,t._visibility=o?-2&t._visibility:1|t._visibility,o&&(null===n||u||As||Fs||eu(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){u=n=t;try{if(i=u.stateNode,o)"function"==typeof(l=i.style).setProperty?l.setProperty("display","none","important"):l.display="none";else{s=u.stateNode;var f=u.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;s.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(h){Nc(u,u.return,h)}}}else if(6===t.tag){if(null===n){u=t;try{u.stateNode.nodeValue=o?"":u.memoizedProps}catch(h){Nc(u,u.return,h)}}}else if(18===t.tag){if(null===n){u=t;try{var m=u.stateNode;o?Ld(m,!0):Ld(u.stateNode,!1)}catch(h){Nc(u,u.return,h)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&null!==(r=e.updateQueue)&&null!==(n=r.retryQueue)&&(r.retryQueue=null,Hs(e,n));case 30:case 21:}}function Gs(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(Ts(r)){n=r;break}r=r.return}if(null==n)throw Error(a(160));switch(n.tag){case 27:var o=n.stateNode;Is(e,Ps(e),o);break;case 5:var i=n.stateNode;32&n.flags&&(Tt(i,""),n.flags&=-33),Is(e,Ps(e),i);break;case 3:case 4:var l=n.stateNode.containerInfo;Os(e,Ps(e),l);break;default:throw Error(a(161))}}catch(s){Nc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Ys(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Ys(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Xs(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Rs(e,t.alternate,t),t=t.sibling}function eu(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ss(4,t,t.return),eu(t);break;case 1:xs(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&Es(t,t.return,n),eu(t);break;case 27:Bd(t.stateNode);case 26:case 5:xs(t,t.return),eu(t);break;case 22:null===t.memoizedState&&eu(t);break;default:eu(t)}e=e.sibling}}function tu(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,a=e,o=t,i=o.flags;switch(o.tag){case 0:case 11:case 15:tu(a,o,n),ks(4,o);break;case 1:if(tu(a,o,n),"function"==typeof(a=(r=o).stateNode).componentDidMount)try{a.componentDidMount()}catch(u){Nc(r,r.return,u)}if(null!==(a=(r=o).updateQueue)){var l=r.stateNode;try{var s=a.shared.hiddenCallbacks;if(null!==s)for(a.shared.hiddenCallbacks=null,a=0;a<s.length;a++)Oo(s[a],l)}catch(u){Nc(r,r.return,u)}}n&&64&i&&_s(o),zs(o,o.return);break;case 27:Ls(o);case 26:case 5:tu(a,o,n),n&&null===r&&4&i&&Cs(o),zs(o,o.return);break;case 12:tu(a,o,n);break;case 31:tu(a,o,n),n&&4&i&&Ws(a,o);break;case 13:tu(a,o,n),n&&4&i&&qs(a,o);break;case 22:null===o.memoizedState&&tu(a,o,n),zs(o,o.return);break;case 30:break;default:tu(a,o,n)}t=t.sibling}}function nu(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Wa(n))}function ru(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Wa(e))}function au(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)ou(e,t,n,r),t=t.sibling}function ou(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:au(e,t,n,r),2048&a&&ks(9,t);break;case 1:case 31:case 13:default:au(e,t,n,r);break;case 3:au(e,t,n,r),2048&a&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Wa(e)));break;case 12:if(2048&a){au(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,l=o.onPostCommit;"function"==typeof l&&l(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(s){Nc(t,t.return,s)}}else au(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,null!==t.memoizedState?2&o._visibility?au(e,t,n,r):lu(e,t):2&o._visibility?au(e,t,n,r):(o._visibility|=2,iu(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&a&&nu(i,t);break;case 24:au(e,t,n,r),2048&a&&ru(t.alternate,t)}}function iu(e,t,n,r,a){for(a=a&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var o=e,i=t,l=n,s=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:iu(o,i,l,s,a),ks(8,i);break;case 23:break;case 22:var c=i.stateNode;null!==i.memoizedState?2&c._visibility?iu(o,i,l,s,a):lu(o,i):(c._visibility|=2,iu(o,i,l,s,a)),a&&2048&u&&nu(i.alternate,i);break;case 24:iu(o,i,l,s,a),a&&2048&u&&ru(i.alternate,i);break;default:iu(o,i,l,s,a)}t=t.sibling}}function lu(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:lu(n,r),2048&a&&nu(r.alternate,r);break;case 24:lu(n,r),2048&a&&ru(r.alternate,r);break;default:lu(n,r)}t=t.sibling}}var su=8192;function uu(e,t,n){if(e.subtreeFlags&su)for(e=e.child;null!==e;)cu(e,t,n),e=e.sibling}function cu(e,t,n){switch(e.tag){case 26:uu(e,t,n),e.flags&su&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var a=Gd(r.href),o=t.querySelector(Yd(a));if(o)return null!==(t=o._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=ff.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,void ot(o);o=t.ownerDocument||t,r=Xd(r),(a=Vd.get(a))&&af(r,a),ot(o=o.createElement("link"));var i=o;i._p=new Promise(function(e,t){i.onload=e,i.onerror=t}),yd(o,"link",r),n.instance=o}null===e.stylesheets&&(e.stylesheets=/* @__PURE__ */new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=ff.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Js,e.memoizedState,e.memoizedProps);break;case 5:default:uu(e,t,n);break;case 3:case 4:var r=Js;Js=qd(e.stateNode.containerInfo),uu(e,t,n),Js=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=su,su=16777216,uu(e,t,n),su=r):uu(e,t,n))}}function du(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function fu(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];$s=r,hu(r,e)}du(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)pu(e),e=e.sibling}function pu(e){switch(e.tag){case 0:case 11:case 15:fu(e),2048&e.flags&&Ss(9,e,e.return);break;case 3:case 12:default:fu(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,mu(e)):fu(e)}}function mu(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];$s=r,hu(r,e)}du(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:Ss(8,t,t.return),mu(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,mu(t));break;default:mu(t)}e=e.sibling}}function hu(e,t){for(;null!==$s;){var n=$s;switch(n.tag){case 0:case 11:case 15:Ss(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Wa(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,$s=r;else e:for(n=e;null!==$s;){var a=(r=$s).sibling,o=r.return;if(js(r),r===n){$s=null;break e}if(null!==a){a.return=o,$s=a;break e}$s=o}}}var gu={getCacheForType:function(e){var t=Da(Ba),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Ba).controller.signal}},yu="function"==typeof WeakMap?WeakMap:Map,vu=0,bu=null,wu=null,ku=0,Su=0,_u=null,Eu=!1,zu=!1,xu=!1,Cu=0,Nu=0,Tu=0,Pu=0,Ou=0,Iu=0,Lu=0,Au=null,Fu=null,Mu=!1,Du=0,$u=0,Ru=1/0,ju=null,Uu=null,Zu=0,Bu=null,Vu=null,Wu=0,qu=0,Hu=null,Qu=null,Ju=0,Ku=null;function Gu(){return 2&vu&&0!==ku?ku&-ku:null!==M.T?Hc():Be()}function Yu(){if(0===Iu)if(536870912&ku&&!ga)Iu=536870912;else{var e=Te;!(3932160&(Te<<=1))&&(Te=262144),Iu=e}return null!==(e=$o.current)&&(e.flags|=32),Iu}function Xu(e,t,n){(e!==bu||2!==Su&&9!==Su)&&null===e.cancelPendingCommit||(ic(e,0),rc(e,ku,Iu,!1)),De(e,n),2&vu&&e===bu||(e===bu&&(!(2&vu)&&(Pu|=n),4===Nu&&rc(e,ku,Iu,!1)),jc(e))}function ec(e,t,n){if(6&vu)throw Error(a(327));for(var r=!n&&!(127&t)&&0===(t&e.expiredLanes)||Le(e,t),o=r?function(e,t){var n=vu;vu|=2;var r=uc(),o=cc();bu!==e||ku!==t?(ju=null,Ru=pe()+500,ic(e,t)):zu=Le(e,t);e:for(;;)try{if(0!==Su&&null!==wu){t=wu;var i=_u;t:switch(Su){case 1:Su=0,_u=null,yc(e,t,i,1);break;case 2:case 9:if(io(i)){Su=0,_u=null,gc(t);break}t=function(){2!==Su&&9!==Su||bu!==e||(Su=7),jc(e)},i.then(t,t);break e;case 3:Su=7;break e;case 4:Su=5;break e;case 7:io(i)?(Su=0,_u=null,gc(t)):(Su=0,_u=null,yc(e,t,i,7));break;case 5:var l=null;switch(wu.tag){case 26:l=wu.memoizedState;case 5:case 27:var s=wu;if(l?cf(l):s.stateNode.complete){Su=0,_u=null;var u=s.sibling;if(null!==u)wu=u;else{var c=s.return;null!==c?(wu=c,vc(c)):wu=null}break t}}Su=0,_u=null,yc(e,t,i,5);break;case 6:Su=0,_u=null,yc(e,t,i,6);break;case 8:oc(),Nu=6;break e;default:throw Error(a(462))}}mc();break}catch(d){lc(e,d)}return Ta=Na=null,M.H=r,M.A=o,vu=n,null!==wu?0:(bu=null,ku=0,Fr(),Nu)}(e,t):fc(e,t,!0),i=r;;){if(0===o){zu&&!r&&rc(e,t,0,!1);break}if(n=e.current.alternate,!i||nc(n)){if(2===o){if(i=t,e.errorRecoveryDisabledLanes&i)var l=0;else l=0!=(l=-536870913&e.pendingLanes)?l:536870912&l?536870912:0;if(0!==l){t=l;e:{var s=e;o=Au;var u=s.current.memoizedState.isDehydrated;if(u&&(ic(s,l).flags|=256),2!==(l=fc(s,l,!1))){if(xu&&!u){s.errorRecoveryDisabledLanes|=i,Pu|=i,o=4;break e}i=Fu,Fu=o,null!==i&&(null===Fu?Fu=i:Fu.push.apply(Fu,i))}o=l}if(i=!1,2!==o)continue}}if(1===o){ic(e,0),rc(e,t,0,!0);break}e:{switch(r=e,i=o){case 0:case 1:throw Error(a(345));case 4:if((4194048&t)!==t)break;case 6:rc(r,t,Iu,!Eu);break e;case 2:Fu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((62914560&t)===t&&10<(o=Du+300-pe())){if(rc(r,t,Iu,!Eu),0!==Ie(r,0,!0))break e;Wu=t,r.timeoutHandle=xd(tc.bind(null,r,n,Fu,ju,Mu,t,Iu,Pu,Lu,Eu,i,"Throttled",-0,0),o)}else tc(r,n,Fu,ju,Mu,t,Iu,Pu,Lu,Eu,i,null,-0,0)}break}o=fc(e,t,!1),i=!1}jc(e)}function tc(e,t,n,r,a,o,i,l,s,u,c,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){cu(t,o,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dt});var m=(62914560&o)===o?Du-pe():(4194048&o)===o?$u-pe():0;if(null!==(m=function(e,t){return e.stylesheets&&0===e.count&&mf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===df&&(df=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var a=n[r],o=a.transferSize,i=a.initiatorType,l=a.duration;if(o&&l&&vd(i)){for(i=0,l=a.responseEnd,r+=1;r<n.length;r++){var s=n[r],u=s.startTime;if(u>l)break;var c=s.transferSize,d=s.initiatorType;c&&vd(d)&&(i+=c*((s=s.responseEnd)<l?1:(l-u)/(s-u)))}if(--r,t+=8*(o+i)/(a.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var a=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&mf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>df?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}(d,m)))return Wu=o,e.cancelPendingCommit=m(wc.bind(null,e,t,o,n,r,a,i,l,s,c,d,null,f,p)),void rc(e,o,i,!u)}wc(e,t,o,n,r,a,i,l,s)}function nc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!rr(o(),a))return!1}catch(i){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rc(e,t,n,r){t&=~Ou,t&=~Pu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var o=31-ze(a),i=1<<o;r[o]=-1,a&=~i}0!==n&&$e(e,n,t)}function ac(){return!!(6&vu)||(Uc(0),!1)}function oc(){if(null!==wu){if(0===Su)var e=wu.return;else Ta=Na=null,fi(e=wu),po=null,mo=0,e=wu;for(;null!==e;)ws(e.alternate,e),e=e.return;wu=null}}function ic(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,Cd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Wu=0,oc(),bu=e,wu=n=Wr(e.current,null),ku=t,Su=0,_u=null,Eu=!1,zu=Le(e,t),xu=!1,Lu=Iu=Ou=Pu=Tu=Nu=0,Fu=Au=null,Mu=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var a=31-ze(r),o=1<<a;t|=e[a],r&=~o}return Cu=t,Fr(),n}function lc(e,t){Qo=null,M.H=wl,t===no||t===ao?(t=co(),Su=3):t===ro?(t=co(),Su=4):Su=t===Dl?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,_u=t,null===wu&&(Nu=1,Il(e,Xr(t,e.current)))}function sc(){var e=$o.current;return null===e||((4194048&ku)===ku?null===Ro:!!((62914560&ku)===ku||536870912&ku)&&e===Ro)}function uc(){var e=M.H;return M.H=wl,null===e?wl:e}function cc(){var e=M.A;return M.A=gu,e}function dc(){Nu=4,Eu||(4194048&ku)!==ku&&null!==$o.current||(zu=!0),!(134217727&Tu)&&!(134217727&Pu)||null===bu||rc(bu,ku,Iu,!1)}function fc(e,t,n){var r=vu;vu|=2;var a=uc(),o=cc();bu===e&&ku===t||(ju=null,ic(e,t)),t=!1;var i=Nu;e:for(;;)try{if(0!==Su&&null!==wu){var l=wu,s=_u;switch(Su){case 8:oc(),i=6;break e;case 3:case 2:case 9:case 6:null===$o.current&&(t=!0);var u=Su;if(Su=0,_u=null,yc(e,l,s,u),n&&zu){i=0;break e}break;default:u=Su,Su=0,_u=null,yc(e,l,s,u)}}pc(),i=Nu;break}catch(c){lc(e,c)}return t&&e.shellSuspendCounter++,Ta=Na=null,vu=r,M.H=a,M.A=o,null===wu&&(bu=null,ku=0,Fr()),i}function pc(){for(;null!==wu;)hc(wu)}function mc(){for(;null!==wu&&!de();)hc(wu)}function hc(e){var t=ds(e.alternate,e,Cu);e.memoizedProps=e.pendingProps,null===t?vc(e):wu=t}function gc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kl(n,t,t.pendingProps,t.type,void 0,ku);break;case 11:t=Kl(n,t,t.pendingProps,t.type.render,t.ref,ku);break;case 5:fi(t);default:ws(n,t),t=ds(n,t=wu=qr(t,Cu),Cu)}e.memoizedProps=e.pendingProps,null===t?vc(e):wu=t}function yc(e,t,n,r){Ta=Na=null,fi(t),po=null,mo=0;var o=t.return;try{if(function(e,t,n,r,o){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&Aa(t,n,o,!0),null!==(n=$o.current)){switch(n.tag){case 31:case 13:return null===Ro?dc():null===n.alternate&&0===Nu&&(Nu=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===oo?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=/* @__PURE__ */new Set([r]):t.add(r),Tc(e,r,o)),!1;case 22:return n.flags|=65536,r===oo?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=/* @__PURE__ */new Set([r]):n.add(r),Tc(e,r,o)),!1}throw Error(a(435,n.tag))}return Tc(e,r,o),dc(),!1}if(ga)return null!==(t=$o.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==ba&&xa(Xr(e=Error(a(422),{cause:r}),n))):(r!==ba&&xa(Xr(t=Error(a(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,o&=-o,e.lanes|=o,r=Xr(r,n),Co(e,o=Al(e.stateNode,r,o)),4!==Nu&&(Nu=2)),!1;var i=Error(a(520),{cause:r});if(i=Xr(i,n),null===Au?Au=[i]:Au.push(i),4!==Nu&&(Nu=2),null===t)return!0;r=Xr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,Co(n,e=Al(n.stateNode,r,e)),!1;case 1:if(t=n.type,i=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===i||"function"!=typeof i.componentDidCatch||null!==Uu&&Uu.has(i))))return n.flags|=65536,o&=-o,n.lanes|=o,Ml(o=Fl(o),e,n,r),Co(n,o),!1}n=n.return}while(null!==n);return!1}(e,o,t,n,ku))return Nu=1,Il(e,Xr(n,e.current)),void(wu=null)}catch(i){if(null!==o)throw wu=o,i;return Nu=1,Il(e,Xr(n,e.current)),void(wu=null)}32768&t.flags?(ga||1===r?e=!0:zu||536870912&ku?e=!1:(Eu=e=!0,(2===r||9===r||3===r||6===r)&&null!==(r=$o.current)&&13===r.tag&&(r.flags|=16384)),bc(t,e)):vc(t)}function vc(e){var t=e;do{if(32768&t.flags)return void bc(t,Eu);e=t.return;var n=vs(t.alternate,t,Cu);if(null!==n)return void(wu=n);if(null!==(t=t.sibling))return void(wu=t);wu=t=e}while(null!==t);0===Nu&&(Nu=5)}function bc(e,t){do{var n=bs(e.alternate,e);if(null!==n)return n.flags&=32767,void(wu=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(wu=e);wu=e=n}while(null!==e);Nu=6,wu=null}function wc(e,t,n,r,o,i,l,s,u){e.cancelPendingCommit=null;do{zc()}while(0!==Zu);if(6&vu)throw Error(a(327));if(null!==t){if(t===e.current)throw Error(a(177));if(i=t.lanes|t.childLanes,function(e,t,n,r,a,o){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(n=i&~n;0<n;){var c=31-ze(n),d=1<<c;l[c]=0,s[c]=-1;var f=u[c];if(null!==f)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&$e(e,r,0),0!==o&&0===a&&0!==e.tag&&(e.suspendedLanes|=o&~(i&~t))}(e,n,i|=Ar,l,s,u),e===bu&&(wu=bu=null,ku=0),Vu=t,Bu=e,Wu=n,qu=i,Hu=o,Qu=r,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,ue(ye,function(){return xc(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(13878&t.flags),13878&t.subtreeFlags||r){r=M.T,M.T=null,o=D.p,D.p=2,l=vu,vu|=4;try{!function(e,t){if(e=e.containerInfo,bd=zf,ur(e=sr(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(g){n=null;break e}var l=0,s=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==n||0!==o&&3!==f.nodeType||(s=l+o),f!==i||0!==r&&3!==f.nodeType||(u=l+r),3===f.nodeType&&(l+=f.nodeValue.length),null!==(m=f.firstChild);)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++c===o&&(s=l),p===i&&++d===r&&(u=l),null!==(m=f.nextSibling))break;p=(f=p).parentNode}f=m}n=-1===s||-1===u?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(wd={focusedElem:e,selectionRange:n},zf=!1,$s=t;null!==$s;)if(e=(t=$s).child,1028&t.subtreeFlags&&null!==e)e.return=t,$s=e;else for(;null!==$s;){switch(i=(t=$s).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(o=e[n]).ref.impl=o.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==i){e=void 0,n=t,o=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var h=Nl(n.type,o);e=r.getSnapshotBeforeUpdate(h,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(y){Nc(n,n.return,y)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Ad(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ad(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(a(163))}if(null!==(e=t.sibling)){e.return=t.return,$s=e;break}$s=t.return}}(e,t)}finally{vu=l,D.p=o,M.T=r}}Zu=1,kc(),Sc(),_c()}}function kc(){if(1===Zu){Zu=0;var e=Bu,t=Vu,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=M.T,M.T=null;var r=D.p;D.p=2;var a=vu;vu|=4;try{Ks(t,e);var o=wd,i=sr(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&lr(l.ownerDocument.documentElement,l)){if(null!==s&&ur(l)){var u=s.start,c=s.end;if(void 0===c&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=l.textContent.length,h=Math.min(s.start,m),g=void 0===s.end?h:Math.min(s.end,m);!p.extend&&h>g&&(i=g,g=h,h=i);var y=ir(l,h),v=ir(l,g);if(y&&v&&(1!==p.rangeCount||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var b=d.createRange();b.setStart(y.node,y.offset),p.removeAllRanges(),h>g?(p.addRange(b),p.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),p.addRange(b))}}}}for(d=[],p=l;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof l.focus&&l.focus(),l=0;l<d.length;l++){var w=d[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}zf=!!bd,wd=bd=null}finally{vu=a,D.p=r,M.T=n}}e.current=t,Zu=2}}function Sc(){if(2===Zu){Zu=0;var e=Bu,t=Vu,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=M.T,M.T=null;var r=D.p;D.p=2;var a=vu;vu|=4;try{Rs(e,t.alternate,t)}finally{vu=a,D.p=r,M.T=n}}Zu=3}}function _c(){if(4===Zu||3===Zu){Zu=0,fe();var e=Bu,t=Vu,n=Wu,r=Qu;10256&t.subtreeFlags||10256&t.flags?Zu=5:(Zu=0,Vu=Bu=null,Ec(e,e.pendingLanes));var a=e.pendingLanes;if(0===a&&(Uu=null),Ze(n),t=t.stateNode,_e&&"function"==typeof _e.onCommitFiberRoot)try{_e.onCommitFiberRoot(Se,t,void 0,!(128&~t.current.flags))}catch(s){}if(null!==r){t=M.T,a=D.p,D.p=2,M.T=null;try{for(var o=e.onRecoverableError,i=0;i<r.length;i++){var l=r[i];o(l.value,{componentStack:l.stack})}}finally{M.T=t,D.p=a}}3&Wu&&zc(),jc(e),a=e.pendingLanes,261930&n&&42&a?e===Ku?Ju++:(Ju=0,Ku=e):Ju=0,Uc(0)}}function Ec(e,t){0===(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,Wa(t))}function zc(){return kc(),Sc(),_c(),xc()}function xc(){if(5!==Zu)return!1;var e=Bu,t=qu;qu=0;var n=Ze(Wu),r=M.T,o=D.p;try{D.p=32>n?32:n,M.T=null,n=Hu,Hu=null;var i=Bu,l=Wu;if(Zu=0,Vu=Bu=null,Wu=0,6&vu)throw Error(a(331));var s=vu;if(vu|=4,pu(i.current),ou(i,i.current,l,n),vu=s,Uc(0),_e&&"function"==typeof _e.onPostCommitFiberRoot)try{_e.onPostCommitFiberRoot(Se,i)}catch(u){}return!0}finally{D.p=o,M.T=r,Ec(e,t)}}function Cc(e,t,n){t=Xr(n,t),null!==(e=zo(e,t=Al(e.stateNode,t,2),2))&&(De(e,2),jc(e))}function Nc(e,t,n){if(3===e.tag)Cc(e,e,n);else for(;null!==t;){if(3===t.tag){Cc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Uu||!Uu.has(r))){e=Xr(n,e),null!==(r=zo(t,n=Fl(2),2))&&(Ml(n,r,t,e),De(r,2),jc(r));break}}t=t.return}}function Tc(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new yu;var a=/* @__PURE__ */new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=/* @__PURE__ */new Set,r.set(t,a));a.has(n)||(xu=!0,a.add(n),e=Pc.bind(null,e,t,n),t.then(e,e))}function Pc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,bu===e&&(ku&n)===n&&(4===Nu||3===Nu&&(62914560&ku)===ku&&300>pe()-Du?!(2&vu)&&ic(e,0):Ou|=n,Lu===ku&&(Lu=0)),jc(e)}function Oc(e,t){0===t&&(t=Fe()),null!==(e=$r(e,t))&&(De(e,t),jc(e))}function Ic(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Oc(e,n)}function Lc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==r&&r.delete(t),Oc(e,n)}var Ac=null,Fc=null,Mc=!1,Dc=!1,$c=!1,Rc=0;function jc(e){e!==Fc&&null===e.next&&(null===Fc?Ac=Fc=e:Fc=Fc.next=e),Dc=!0,Mc||(Mc=!0,Td(function(){6&vu?ue(he,Zc):Bc()}))}function Uc(e,t){if(!$c&&Dc){$c=!0;do{for(var n=!1,r=Ac;null!==r;){if(0!==e){var a=r.pendingLanes;if(0===a)var o=0;else{var i=r.suspendedLanes,l=r.pingedLanes;o=(1<<31-ze(42|e)+1)-1,o=201326741&(o&=a&~(i&~l))?201326741&o|1:o?2|o:0}0!==o&&(n=!0,qc(r,o))}else o=ku,!(3&(o=Ie(r,r===bu?o:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Le(r,o)||(n=!0,qc(r,o));r=r.next}}while(n);$c=!1}}function Zc(){Bc()}function Bc(){Dc=Mc=!1;var e,t=0;0!==Rc&&((e=window.event)&&"popstate"===e.type?e!==zd&&(zd=e,1):(zd=null,0))&&(t=Rc);for(var n=pe(),r=null,a=Ac;null!==a;){var o=a.next,i=Vc(a,n);0===i?(a.next=null,null===r?Ac=o:r.next=o,null===o&&(Fc=r)):(r=a,(0!==t||3&i)&&(Dc=!0)),a=o}0!==Zu&&5!==Zu||Uc(t),0!==Rc&&(Rc=0)}function Vc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=-62914561&e.pendingLanes;0<o;){var i=31-ze(o),l=1<<i,s=a[i];-1===s?0!==(l&n)&&0===(l&r)||(a[i]=Ae(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(n=ku,n=Ie(e,e===(t=bu)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===Su||9===Su)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Le(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&ce(r),Ze(n)){case 2:case 8:n=ge;break;case 32:default:n=ye;break;case 268435456:n=be}return r=Wc.bind(null,e),n=ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&ce(r),e.callbackPriority=2,e.callbackNode=null,2}function Wc(e,t){if(0!==Zu&&5!==Zu)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zc()&&e.callbackNode!==n)return null;var r=ku;return 0===(r=Ie(e,e===bu?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(ec(e,r,t),Vc(e,pe()),null!=e.callbackNode&&e.callbackNode===n?Wc.bind(null,e):null)}function qc(e,t){if(zc())return null;ec(e,t,!0)}function Hc(){if(0===Rc){var e=Qa;0===e&&(e=Ne,!(261888&(Ne<<=1))&&(Ne=256)),Rc=e}return Rc}function Qc(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Mt(""+e)}function Jc(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Kc=0;Kc<Tr.length;Kc++){var Gc=Tr[Kc];Pr(Gc.toLowerCase(),"on"+(Gc[0].toUpperCase()+Gc.slice(1)))}Pr(kr,"onAnimationEnd"),Pr(Sr,"onAnimationIteration"),Pr(_r,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Er,"onTransitionRun"),Pr(zr,"onTransitionStart"),Pr(xr,"onTransitionCancel"),Pr(Cr,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("onPointerLeave",["pointerout","pointerover"]),st("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),st("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),st("onBeforeInput",["compositionend","keypress","textInput","paste"]),st("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xc=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yc));function ed(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&a.isPropagationStopped())break e;o=l,a.currentTarget=u;try{o(a)}catch(c){Or(c)}a.currentTarget=null,o=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,u=l.currentTarget,l=l.listener,s!==o&&a.isPropagationStopped())break e;o=l,a.currentTarget=u;try{o(a)}catch(c){Or(c)}a.currentTarget=null,o=s}}}}function td(e,t){var n=t[Je];void 0===n&&(n=t[Je]=/* @__PURE__ */new Set);var r=e+"__bubble";n.has(r)||(od(t,e,2,!1),n.add(r))}function nd(e,t,n){var r=0;t&&(r|=4),od(n,e,r,t)}var rd="_reactListening"+Math.random().toString(36).slice(2);function ad(e){if(!e[rd]){e[rd]=!0,it.forEach(function(t){"selectionchange"!==t&&(Xc.has(t)||nd(t,!1,e),nd(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[rd]||(t[rd]=!0,nd("selectionchange",!1,t))}}function od(e,t,n,r){switch(If(t)){case 2:var a=xf;break;case 8:a=Cf;break;default:a=Nf}n=a.bind(null,t,n,e),a=void 0,!Ht||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function id(e,t,n,r,a){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var l=r.tag;if(3===l||4===l){var s=r.stateNode.containerInfo;if(s===a)break;if(4===l)for(l=r.return;null!==l;){var u=l.tag;if((3===u||4===u)&&l.stateNode.containerInfo===a)return;l=l.return}for(;null!==s;){if(null===(l=tt(s)))return;if(5===(u=l.tag)||6===u||26===u||27===u){r=o=l;continue e}s=s.parentNode}}r=r.return}Vt(function(){var r=o,a=Rt(n),l=[];e:{var s=Nr.get(e);if(void 0!==s){var u=sn,c=e;switch(e){case"keypress":if(0===Xt(n))break e;case"keydown":case"keyup":u=_n;break;case"focusin":c="focus",u=mn;break;case"focusout":c="blur",u=mn;break;case"beforeblur":case"afterblur":u=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=pn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=zn;break;case kr:case Sr:case _r:u=hn;break;case Cr:u=xn;break;case"scroll":case"scrollend":u=cn;break;case"wheel":u=Cn;break;case"copy":case"cut":case"paste":u=gn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=En;break;case"toggle":case"beforetoggle":u=Nn}var d=!!(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==s?s+"Capture":null:s;d=[];for(var m,h=r;null!==h;){var g=h;if(m=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===m||null===p||null!=(g=Wt(h,p))&&d.push(ld(h,g,m)),f)break;h=h.return}0<d.length&&(s=new u(s,c,null,n,a),l.push({event:s,listeners:d}))}}if(!(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===$t||!(c=n.relatedTarget||n.fromElement)||!tt(c)&&!c[Qe])&&(u||s)&&(s=a.window===a?a:(s=a.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(c=(c=n.relatedTarget||n.toElement)?tt(c):null)&&(f=i(c),d=c.tag,c!==f||5!==d&&27!==d&&6!==d)&&(c=null)):(u=null,c=r),u!==c)){if(d=fn,g="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(d=En,g="onPointerLeave",p="onPointerEnter",h="pointer"),f=null==u?s:rt(u),m=null==c?s:rt(c),(s=new d(g,h+"leave",u,n,a)).target=f,s.relatedTarget=m,g=null,tt(a)===r&&((d=new d(p,h+"enter",c,n,a)).target=m,d.relatedTarget=f,g=d),f=g,u&&c)e:{for(d=ud,h=c,m=0,g=p=u;g;g=d(g))m++;g=0;for(var y=h;y;y=d(y))g++;for(;0<m-g;)p=d(p),m--;for(;0<g-m;)h=d(h),g--;for(;m--;){if(p===h||null!==h&&p===h.alternate){d=p;break e}p=d(p),h=d(h)}d=null}else d=null;null!==u&&cd(l,s,u,d,!1),null!==c&&null!==f&&cd(l,f,c,d,!0)}if("select"===(u=(s=r?rt(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var v=qn;else if(jn(s))if(Hn)v=nr;else{v=er;var b=Xn}else!(u=s.nodeName)||"input"!==u.toLowerCase()||"checkbox"!==s.type&&"radio"!==s.type?r&&Lt(r.elementType)&&(v=qn):v=tr;switch(v&&(v=v(e,r))?Un(l,v,n,a):(b&&b(e,s,r),"focusout"===e&&r&&"number"===s.type&&null!=r.memoizedProps.value&&zt(s,"number",s.value)),b=r?rt(r):window,e){case"focusin":(jn(b)||"true"===b.contentEditable)&&(dr=b,fr=r,pr=null);break;case"focusout":pr=fr=dr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,hr(l,n,a);break;case"selectionchange":if(cr)break;case"keydown":case"keyup":hr(l,n,a)}var w;if(Pn)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else $n?Mn(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(Ln&&"ko"!==n.locale&&($n||"onCompositionStart"!==k?"onCompositionEnd"===k&&$n&&(w=Yt()):(Kt="value"in(Jt=a)?Jt.value:Jt.textContent,$n=!0)),0<(b=sd(r,k)).length&&(k=new yn(k,e,null,n,a),l.push({event:k,listeners:b}),(w||null!==(w=Dn(n)))&&(k.data=w))),(w=In?function(e,t){switch(e){case"compositionend":return Dn(t);case"keypress":return 32!==t.which?null:(Fn=!0,An);case"textInput":return(e=t.data)===An&&Fn?null:e;default:return null}}(e,n):function(e,t){if($n)return"compositionend"===e||!Pn&&Mn(e,t)?(e=Yt(),Gt=Kt=Jt=null,$n=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ln&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(k=sd(r,"onBeforeInput")).length&&(b=new yn("onBeforeInput","beforeinput",null,n,a),l.push({event:b,listeners:k}),b.data=w),function(e,t,n,r,a){if("submit"===t&&n&&n.stateNode===a){var o=Qc((a[He]||null).action),i=r.submitter;i&&null!==(t=(t=i[He]||null)?Qc(t.formAction):i.getAttribute("formAction"))&&(o=t,i=null);var l=new sn("action","action",null,r,a);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Rc){var e=i?Jc(a,i):new FormData(a);il(n,{pending:!0,data:e,method:a.method,action:o},null,e)}}else"function"==typeof o&&(l.preventDefault(),e=i?Jc(a,i):new FormData(a),il(n,{pending:!0,data:e,method:a.method,action:o},o,e))},currentTarget:a}]})}}(l,e,r,n,a)}ed(l,t)})}function ld(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sd(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,o=a.stateNode;if(5!==(a=a.tag)&&26!==a&&27!==a||null===o||(null!=(a=Wt(e,n))&&r.unshift(ld(e,a,o)),null!=(a=Wt(e,t))&&r.push(ld(e,a,o))),3===e.tag)return r;e=e.return}return[]}function ud(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function cd(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,u=l.stateNode;if(l=l.tag,null!==s&&s===r)break;5!==l&&26!==l&&27!==l||null===u||(s=u,a?null!=(u=Wt(n,o))&&i.unshift(ld(n,u,s)):a||null!=(u=Wt(n,o))&&i.push(ld(n,u,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var dd=/\r\n?/g,fd=/\u0000|\uFFFD/g;function pd(e){return("string"==typeof e?e:""+e).replace(dd,"\n").replace(fd,"")}function md(e,t){return t=pd(t),pd(e)===t}function hd(e,t,n,r,o,i){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||Tt(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&Tt(e,""+r);break;case"className":mt(e,"class",r);break;case"tabIndex":mt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":mt(e,n,r);break;case"style":It(e,r,i);break;case"data":if("object"!==t){mt(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=Mt(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof i&&("formAction"===n?("input"!==t&&hd(e,t,"name",o.name,o,null),hd(e,t,"formEncType",o.formEncType,o,null),hd(e,t,"formMethod",o.formMethod,o,null),hd(e,t,"formTarget",o.formTarget,o,null)):(hd(e,t,"encType",o.encType,o,null),hd(e,t,"method",o.method,o,null),hd(e,t,"target",o.target,o,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=Mt(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Dt);break;case"onScroll":null!=r&&td("scroll",e);break;case"onScrollEnd":null!=r&&td("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(a(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(a(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=Mt(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":td("beforetoggle",e),td("toggle",e),pt(e,"popover",r);break;case"xlinkActuate":ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ht(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ht(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ht(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ht(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":pt(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&pt(e,n=At.get(n)||n,r)}}function gd(e,t,n,r,o,i){switch(n){case"style":It(e,r,i);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(a(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(a(60));e.innerHTML=n}}break;case"children":"string"==typeof r?Tt(e,r):("number"==typeof r||"bigint"==typeof r)&&Tt(e,""+r);break;case"onScroll":null!=r&&td("scroll",e);break;case"onScrollEnd":null!=r&&td("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Dt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:lt.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),"function"==typeof(i=null!=(i=e[He]||null)?i[n]:null)&&e.removeEventListener(t,i,o),"function"!=typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):pt(e,n,r):("function"!=typeof i&&null!==i&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o)))}}function yd(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":td("error",e),td("load",e);var r,o=!1,i=!1;for(r in n)if(n.hasOwnProperty(r)){var l=n[r];if(null!=l)switch(r){case"src":o=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:hd(e,t,r,l,n,null)}}return i&&hd(e,t,"srcSet",n.srcSet,n,null),void(o&&hd(e,t,"src",n.src,n,null));case"input":td("invalid",e);var s=r=l=i=null,u=null,c=null;for(o in n)if(n.hasOwnProperty(o)){var d=n[o];if(null!=d)switch(o){case"name":i=d;break;case"type":l=d;break;case"checked":u=d;break;case"defaultChecked":c=d;break;case"value":r=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(a(137,t));break;default:hd(e,t,o,d,n,null)}}return void Et(e,r,s,u,c,l,i,!1);case"select":for(i in td("invalid",e),o=l=r=null,n)if(n.hasOwnProperty(i)&&null!=(s=n[i]))switch(i){case"value":r=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:hd(e,t,i,s,n,null)}return t=r,n=l,e.multiple=!!o,void(null!=t?xt(e,!!o,t,!1):null!=n&&xt(e,!!o,n,!0));case"textarea":for(l in td("invalid",e),r=i=o=null,n)if(n.hasOwnProperty(l)&&null!=(s=n[l]))switch(l){case"value":o=s;break;case"defaultValue":i=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(a(91));break;default:hd(e,t,l,s,n,null)}return void Nt(e,o,i,r);case"option":for(u in n)n.hasOwnProperty(u)&&null!=(o=n[u])&&("selected"===u?e.selected=o&&"function"!=typeof o&&"symbol"!=typeof o:hd(e,t,u,o,n,null));return;case"dialog":td("beforetoggle",e),td("toggle",e),td("cancel",e),td("close",e);break;case"iframe":case"object":td("load",e);break;case"video":case"audio":for(o=0;o<Yc.length;o++)td(Yc[o],e);break;case"image":td("error",e),td("load",e);break;case"details":td("toggle",e);break;case"embed":case"source":case"link":td("error",e),td("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&null!=(o=n[c]))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:hd(e,t,c,o,n,null)}return;default:if(Lt(t)){for(d in n)n.hasOwnProperty(d)&&void 0!==(o=n[d])&&gd(e,t,d,o,n,void 0);return}}for(s in n)n.hasOwnProperty(s)&&null!=(o=n[s])&&hd(e,t,s,o,n,null)}function vd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var bd=null,wd=null;function kd(e){return 9===e.nodeType?e:e.ownerDocument}function Sd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _d(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Ed(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var zd=null,xd="function"==typeof setTimeout?setTimeout:void 0,Cd="function"==typeof clearTimeout?clearTimeout:void 0,Nd="function"==typeof Promise?Promise:void 0,Td="function"==typeof queueMicrotask?queueMicrotask:void 0!==Nd?function(e){return Nd.resolve(null).then(e).catch(Pd)}:xd;function Pd(e){setTimeout(function(){throw e})}function Od(e){return"head"===e}function Id(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)||"/&"===n){if(0===r)return e.removeChild(a),void Kf(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)Bd(e.ownerDocument.documentElement);else if("head"===n){Bd(n=e.ownerDocument.head);for(var o=n.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[Xe]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===o.rel.toLowerCase()||n.removeChild(o),o=i}}else"body"===n&&Bd(e.ownerDocument.body);n=a}while(n);Kf(t)}function Ld(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Ad(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ad(n),et(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Fd(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=$d(e.nextSibling)))return null}return e}function Md(e){return"$?"===e.data||"$~"===e.data}function Dd(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function $d(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Rd=null;function jd(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return $d(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Ud(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function Zd(e,t,n){switch(t=kd(n),e){case"html":if(!(e=t.documentElement))throw Error(a(452));return e;case"head":if(!(e=t.head))throw Error(a(453));return e;case"body":if(!(e=t.body))throw Error(a(454));return e;default:throw Error(a(451))}}function Bd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);et(e)}var Vd=/* @__PURE__ */new Map,Wd=/* @__PURE__ */new Set;function qd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Hd=D.d;D.d={f:function(){var e=Hd.f(),t=ac();return e||t},r:function(e){var t=nt(e);null!==t&&5===t.tag&&"form"===t.type?sl(t):Hd.r(e)},D:function(e){Hd.D(e),Jd("dns-prefetch",e,null)},C:function(e,t){Hd.C(e,t),Jd("preconnect",e,t)},L:function(e,t,n){Hd.L(e,t,n);var r=Qd;if(r&&e&&t){var a='link[rel="preload"][as="'+St(t)+'"]';"image"===t&&n&&n.imageSrcSet?(a+='[imagesrcset="'+St(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(a+='[imagesizes="'+St(n.imageSizes)+'"]')):a+='[href="'+St(e)+'"]';var o=a;switch(t){case"style":o=Gd(e);break;case"script":o=ef(e)}Vd.has(o)||(e=d({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Vd.set(o,e),null!==r.querySelector(a)||"style"===t&&r.querySelector(Yd(o))||"script"===t&&r.querySelector(tf(o))||(yd(t=r.createElement("link"),"link",e),ot(t),r.head.appendChild(t)))}},m:function(e,t){Hd.m(e,t);var n=Qd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",a='link[rel="modulepreload"][as="'+St(r)+'"][href="'+St(e)+'"]',o=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ef(e)}if(!Vd.has(o)&&(e=d({rel:"modulepreload",href:e},t),Vd.set(o,e),null===n.querySelector(a))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tf(o)))return}yd(r=n.createElement("link"),"link",e),ot(r),n.head.appendChild(r)}}},X:function(e,t){Hd.X(e,t);var n=Qd;if(n&&e){var r=at(n).hoistableScripts,a=ef(e),o=r.get(a);o||((o=n.querySelector(tf(a)))||(e=d({src:e,async:!0},t),(t=Vd.get(a))&&of(e,t),ot(o=n.createElement("script")),yd(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(a,o))}},S:function(e,t,n){Hd.S(e,t,n);var r=Qd;if(r&&e){var a=at(r).hoistableStyles,o=Gd(e);t=t||"default";var i=a.get(o);if(!i){var l={loading:0,preload:null};if(i=r.querySelector(Yd(o)))l.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vd.get(o))&&af(e,n);var s=i=r.createElement("link");ot(s),yd(s,"link",e),s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,rf(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:l},a.set(o,i)}}},M:function(e,t){Hd.M(e,t);var n=Qd;if(n&&e){var r=at(n).hoistableScripts,a=ef(e),o=r.get(a);o||((o=n.querySelector(tf(a)))||(e=d({src:e,async:!0,type:"module"},t),(t=Vd.get(a))&&of(e,t),ot(o=n.createElement("script")),yd(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(a,o))}}};var Qd="undefined"==typeof document?null:document;function Jd(e,t,n){var r=Qd;if(r&&"string"==typeof t&&t){var a=St(t);a='link[rel="'+e+'"][href="'+a+'"]',"string"==typeof n&&(a+='[crossorigin="'+n+'"]'),Wd.has(a)||(Wd.add(a),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(a)&&(yd(t=r.createElement("link"),"link",e),ot(t),r.head.appendChild(t)))}}function Kd(e,t,n,r){var o,i,l,s,u=(u=G.current)?qd(u):null;if(!u)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Gd(n.href),(r=(n=at(u).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Gd(n.href);var c=at(u).hoistableStyles,d=c.get(e);if(d||(u=u.ownerDocument||u,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=u.querySelector(Yd(e)))&&!c._p&&(d.instance=c,d.state.loading=5),Vd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Vd.set(e,n),c||(o=u,i=e,l=n,s=d.state,o.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=o.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),yd(i,"link",l),ot(i),o.head.appendChild(i))))),t&&null===r)throw Error(a(528,""));return d}if(t&&null!==r)throw Error(a(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=ef(n),(r=(n=at(u).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Gd(e){return'href="'+St(e)+'"'}function Yd(e){return'link[rel="stylesheet"]['+e+"]"}function Xd(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function ef(e){return'[src="'+St(e)+'"]'}function tf(e){return"script[async]"+e}function nf(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+St(n.href)+'"]');if(r)return t.instance=r,ot(r),r;var o=d({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return ot(r=(e.ownerDocument||e).createElement("style")),yd(r,"style",o),rf(r,n.precedence,e),t.instance=r;case"stylesheet":o=Gd(n.href);var i=e.querySelector(Yd(o));if(i)return t.state.loading|=4,t.instance=i,ot(i),i;r=Xd(n),(o=Vd.get(o))&&af(r,o),ot(i=(e.ownerDocument||e).createElement("link"));var l=i;return l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),yd(i,"link",r),t.state.loading|=4,rf(i,n.precedence,e),t.instance=i;case"script":return i=ef(n.src),(o=e.querySelector(tf(i)))?(t.instance=o,ot(o),o):(r=n,(o=Vd.get(i))&&of(r=d({},n),o),ot(o=(e=e.ownerDocument||e).createElement("script")),yd(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(a(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,rf(r,n.precedence,e));return t.instance}function rf(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,o=a,i=0;i<r.length;i++){var l=r[i];if(l.dataset.precedence===t)o=l;else if(o!==a)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function af(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function of(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var lf=null;function sf(e,t,n){if(null===lf){var r=/* @__PURE__ */new Map,a=lf=/* @__PURE__ */new Map;a.set(n,r)}else(r=(a=lf).get(n))||(r=/* @__PURE__ */new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var o=n[a];if(!(o[Xe]||o[qe]||"link"===e&&"stylesheet"===o.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==o.namespaceURI){var i=o.getAttribute(t)||"";i=e+i;var l=r.get(i);l?l.push(o):r.set(i,[o])}}return r}function uf(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function cf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var df=0;function ff(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)mf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var pf=null;function mf(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,pf=/* @__PURE__ */new Map,t.forEach(hf,e),pf=null,ff.call(e))}function hf(e,t){if(!(4&t.state.loading)){var n=pf.get(e);if(n)var r=n.get(null);else{n=/* @__PURE__ */new Map,pf.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<a.length;o++){var i=a[o];"LINK"!==i.nodeName&&"not all"===i.getAttribute("media")||(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}i=(a=t.instance).getAttribute("data-precedence"),(o=n.get(i)||r)===r&&n.set(null,a),n.set(i,a),this.count++,r=ff.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),o?o.parentNode.insertBefore(a,o.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(a,e.firstChild),t.state.loading|=4}}var gf={$$typeof:w,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function yf(e,t,n,r,a,o,i,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Me(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Me(0),this.hiddenUpdates=Me(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=/* @__PURE__ */new Map}function vf(e,t,n,r,a,o,i,l,s,u,c,d){return e=new yf(e,t,n,i,s,u,c,d,l),t=1,!0===o&&(t|=24),o=Br(3,null,null,t),e.current=o,o.stateNode=e,(t=Va()).refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},So(o),e}function bf(e){return e?e=Ur:Ur}function wf(e,t,n,r,a,o){a=bf(a),null===r.context?r.context=a:r.pendingContext=a,(r=Eo(t)).payload={element:n},null!==(o=void 0===o?null:o)&&(r.callback=o),null!==(n=zo(e,r,t))&&(Xu(n,0,t),xo(n,e,t))}function kf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Sf(e,t){kf(e,t),(e=e.alternate)&&kf(e,t)}function _f(e){if(13===e.tag||31===e.tag){var t=$r(e,67108864);null!==t&&Xu(t,0,67108864),Sf(e,67108864)}}function Ef(e){if(13===e.tag||31===e.tag){var t=Gu(),n=$r(e,t=Ue(t));null!==n&&Xu(n,0,t),Sf(e,t)}}var zf=!0;function xf(e,t,n,r){var a=M.T;M.T=null;var o=D.p;try{D.p=2,Nf(e,t,n,r)}finally{D.p=o,M.T=a}}function Cf(e,t,n,r){var a=M.T;M.T=null;var o=D.p;try{D.p=8,Nf(e,t,n,r)}finally{D.p=o,M.T=a}}function Nf(e,t,n,r){if(zf){var a=Tf(r);if(null===a)id(e,t,r,Pf,n),Uf(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return Af=Zf(Af,e,t,n,r,a),!0;case"dragenter":return Ff=Zf(Ff,e,t,n,r,a),!0;case"mouseover":return Mf=Zf(Mf,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return Df.set(o,Zf(Df.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,$f.set(o,Zf($f.get(o)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(Uf(e,r),4&t&&-1<jf.indexOf(e)){for(;null!==a;){var o=nt(a);if(null!==o)switch(o.tag){case 3:if((o=o.stateNode).current.memoizedState.isDehydrated){var i=Oe(o.pendingLanes);if(0!==i){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-ze(i);l.entanglements[1]|=s,i&=~s}jc(o),!(6&vu)&&(Ru=pe()+500,Uc(0))}}break;case 31:case 13:null!==(l=$r(o,2))&&Xu(l,0,2),ac(),Sf(o,2)}if(null===(o=Tf(r))&&id(e,t,r,Pf,n),o===a)break;a=o}null!==a&&r.stopPropagation()}else id(e,t,r,null,n)}}function Tf(e){return Of(e=Rt(e))}var Pf=null;function Of(e){if(Pf=null,null!==(e=tt(e))){var t=i(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=l(t)))return e;e=null}else if(31===n){if(null!==(e=s(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pf=e,null}function If(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(me()){case he:return 2;case ge:return 8;case ye:case ve:return 32;case be:return 268435456;default:return 32}default:return 32}}var Lf=!1,Af=null,Ff=null,Mf=null,Df=/* @__PURE__ */new Map,$f=/* @__PURE__ */new Map,Rf=[],jf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Uf(e,t){switch(e){case"focusin":case"focusout":Af=null;break;case"dragenter":case"dragleave":Ff=null;break;case"mouseover":case"mouseout":Mf=null;break;case"pointerover":case"pointerout":Df.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$f.delete(t.pointerId)}}function Zf(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},null!==t&&null!==(t=nt(t))&&_f(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function Bf(e){var t=tt(e.target);if(null!==t){var n=i(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=l(n)))return e.blockedOn=t,void Ve(e.priority,function(){Ef(n)})}else if(31===t){if(null!==(t=s(n)))return e.blockedOn=t,void Ve(e.priority,function(){Ef(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Vf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.nativeEvent);if(null!==n)return null!==(t=nt(n))&&_f(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null,t.shift()}return!0}function Wf(e,t,n){Vf(e)&&n.delete(t)}function qf(){Lf=!1,null!==Af&&Vf(Af)&&(Af=null),null!==Ff&&Vf(Ff)&&(Ff=null),null!==Mf&&Vf(Mf)&&(Mf=null),Df.forEach(Wf),$f.forEach(Wf)}function Hf(e,n){e.blockedOn===n&&(e.blockedOn=null,Lf||(Lf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qf)))}var Qf=null;function Jf(e){Qf!==e&&(Qf=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qf===e&&(Qf=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if("function"!=typeof r){if(null===Of(r||n))continue;break}var o=nt(n);null!==o&&(e.splice(t,3),t-=3,il(o,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Kf(e){function t(t){return Hf(t,e)}null!==Af&&Hf(Af,e),null!==Ff&&Hf(Ff,e),null!==Mf&&Hf(Mf,e),Df.forEach(t),$f.forEach(t);for(var n=0;n<Rf.length;n++){var r=Rf[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rf.length&&null===(n=Rf[0]).blockedOn;)Bf(n),null===n.blockedOn&&Rf.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var a=n[r],o=n[r+1],i=a[He]||null;if("function"==typeof o)i||Jf(n);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(a=o,i=o[He]||null)l=i.formAction;else if(null!==Of(a))continue}else l=i.action;"function"==typeof l?n[r+1]=l:(n.splice(r,3),r-=3),Jf(n)}}}function Gf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return a=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==a&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==a&&(a(),a=null)}}}function Yf(e){this._internalRoot=e}function Xf(e){this._internalRoot=e}Xf.prototype.render=Yf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));wf(t.current,Gu(),e,t,null,null)},Xf.prototype.unmount=Yf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;wf(e.current,2,null,e,null,null),ac(),t[Qe]=null}},Xf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Be();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rf.length&&0!==t&&t<Rf[n].priority;n++);Rf.splice(n,0,e),0===n&&Bf(e)}};var ep=n.version;if("19.2.3"!==ep)throw Error(a(527,ep,"19.2.3"));D.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=i(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var l=o.alternate;if(null===l){if(null!==(r=o.return)){n=r;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return u(o),e;if(l===r)return u(o),t;l=l.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=l;else{for(var s=!1,c=o.child;c;){if(c===n){s=!0,n=o,r=l;break}if(c===r){s=!0,r=o,n=l;break}c=c.sibling}if(!s){for(c=l.child;c;){if(c===n){s=!0,n=l,r=o;break}if(c===r){s=!0,r=l,n=o;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(t),null===(e=null!==e?c(e):null)?null:e.stateNode};var tp={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var np=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!np.isDisabled&&np.supportsFiber)try{Se=np.inject(tp),_e=np}catch(ap){}}return $.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r="",i=Tl,l=Pl,s=Ol;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(i=t.onUncaughtError),void 0!==t.onCaughtError&&(l=t.onCaughtError),void 0!==t.onRecoverableError&&(s=t.onRecoverableError)),t=vf(e,1,!1,null,0,n,r,null,i,l,s,Gf),e[Qe]=t.current,ad(e),new Yf(t)},$.hydrateRoot=function(e,t,n){if(!o(e))throw Error(a(299));var r=!1,i="",l=Tl,s=Pl,u=Ol,c=null;return null!=n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onUncaughtError&&(l=n.onUncaughtError),void 0!==n.onCaughtError&&(s=n.onCaughtError),void 0!==n.onRecoverableError&&(u=n.onRecoverableError),void 0!==n.formState&&(c=n.formState)),(t=vf(e,1,!0,t,0,r,i,c,l,s,u,Gf)).context=bf(null),n=t.current,(i=Eo(r=Ue(r=Gu()))).callback=null,zo(n,i,r),n=r,t.current.lanes=n,De(t,n),jc(t),e[Qe]=t.current,ad(e),new Xf(t)},$.version="19.2.3",$}()),D.exports);function Z({isOpen:e,onClick:o,unreadCount:i=0,primaryColor:l,logoUrl:s,starterPrompt:u,position:c="bottom-right",emotion:d="default",avatars:f={},styles:S,promptPersistence:_="session",avatarScale:E=1}){const{t:z}=p("extracted"),x=m({primaryColor:l}),C=S?.launcher?.bg,N=h(),{triggerHaptic:T,getGlowClass:I}=g(),L=N.launcherPulse&&!1!==S?.launcher?.pulse,[A,F]=t(!1),[M,D]=t(!1),[$,R]=t(!1),[j,U]=t(!1),Z="bottom-right"===c,B="chat_launcher_prompt_state",V=n(()=>f[d]||f.default||s||y,[d,f,s]);r(()=>{U(!1)},[V]),r(()=>{const e=Object.values(f).filter(e=>!!e);s&&e.push(s),e.forEach(e=>{(new Image).src=e})},[f,s]),r(()=>{"forever"===_&&"dismissed"===localStorage.getItem(B)&&R(!0)},[_]);const W=a(()=>{D(!0),setTimeout(()=>F(!1),500),"always"!==_&&(R(!0),"forever"===_&&localStorage.setItem(B,"dismissed"))},[_]);return r(()=>{if("always"!==_&&$||!u||e)return void F(!1);const t=setTimeout(()=>{F(!0),D(!1)},2e3),n=setTimeout(()=>W(),12e3);return()=>{clearTimeout(t),clearTimeout(n)}},[u,e,$,_,W]),/* @__PURE__ */P("div",{className:v("flex items-center w-fit transition-all duration-500",Z?"flex-row ml-auto":"flex-row-reverse mr-auto"),children:[
2
+ /* @__PURE__ */O("div",{className:v("transition-all duration-700 ease-in-out flex items-center",A?v("opacity-100 translate-x-0 w-auto max-w-[350px]",Z?"mr-4":"ml-4"):"opacity-0 translate-x-8 w-0 max-w-0 overflow-hidden"),children:/* @__PURE__ */P("div",{className:v("relative px-5 py-3.5 shadow-soft-xl border flex items-center gap-3",S?.radius?.card||"rounded-[20px]",M&&"opacity-0 scale-95 transition-all duration-300",!A&&"hidden"),style:{width:"max-content",maxWidth:"280px",backgroundColor:"hsl(var(--background))",color:"hsl(var(--foreground))",borderColor:"hsl(var(--border))"},children:[
3
+ /* @__PURE__ */O("span",{className:"text-sm font-semibold leading-tight tracking-tight whitespace-nowrap",children:u}),
4
+ /* @__PURE__ */O("button",{onClick:e=>{e.stopPropagation(),W()},className:"text-muted-foreground hover:text-foreground transition-colors p-1 rounded-full hover:bg-muted shrink-0",children:/* @__PURE__ */O(b,{className:"h-3.5 w-3.5 stroke-[2.5]"})}),
5
+ /* @__PURE__ */O("div",{className:v("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent",Z?"right-[-14px] border-l-background":"left-[-14px] border-r-background")}),
6
+ /* @__PURE__ */O("div",{className:v("absolute top-1/2 -translate-y-1/2 w-0 h-0 border-[7px] border-transparent -z-10",Z?"right-[-15px] border-l-border":"left-[-15px] border-r-border")})]})}),
7
+ /* @__PURE__ */P("div",{className:"relative flex items-center justify-center shrink-0",children:[!e&&L&&/* @__PURE__ */O("span",{className:"absolute inset-0 flex items-center justify-center",children:/* @__PURE__ */O("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-20",style:{backgroundColor:x}})}),
8
+ /* @__PURE__ */P("button",{type:"button",onClick:()=>{k.debug("Launcher handleMainAction called, isOpen:",e),T(),R(!0),"forever"===_&&localStorage.setItem(B,"dismissed"),o()},className:v("relative z-10 h-14 w-14 sm:h-16 sm:w-16","flex items-center justify-center text-white transition-all duration-500","hover:scale-110 active:scale-95 shadow-soft-xl cursor-pointer",!e&&"hover:rotate-6",!e&&N.enabled&&"animate-glow-pulse",S?.radius?.button||"rounded-full",C,I()),style:{backgroundColor:x||"hsl(160, 84%, 39%)","--primary-glow":`${x}66`},"aria-label":e?"Cerrar chat":"Abrir chat",children:[
9
+ /* @__PURE__ */P("div",{className:"relative h-full w-full flex items-center justify-center overflow-hidden rounded-inherit",children:[
10
+ /* @__PURE__ */O("div",{className:v("absolute inset-0 transition-all duration-500 flex items-center justify-center",e?"opacity-0 scale-50 rotate-90":"opacity-100 scale-100 rotate-0"),children:V&&!j?/* @__PURE__ */O("img",{src:V,alt:z("assistant"),className:"w-full h-full object-cover",style:{transform:`scale(${E})`},onError:()=>U(!0)},V):/* @__PURE__ */O(w,{className:"h-7 w-7 sm:h-8 sm:w-8 fill-current"})}),
11
+ /* @__PURE__ */O("div",{className:v("absolute inset-0 transition-all duration-500 flex items-center justify-center bg-black/5 dark:bg-white/10",e?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 -rotate-90"),children:/* @__PURE__ */O(b,{className:"h-7 w-7 sm:h-8 sm:w-8 stroke-[2.5]"})})]}),!e&&i>0&&/* @__PURE__ */O("div",{className:"absolute -top-1 -right-1 z-20 flex h-6 w-6 items-center justify-center bg-destructive text-destructive-foreground rounded-full border-2 border-background text-[10px] font-black shadow-soft-md tabular-nums",children:i>9?"9+":i})]})]})]})}class B extends o{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){k.error("ErrorBoundary caught error:",e,t),this.props.onError?.(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:/* @__PURE__ */P("div",{className:"flex flex-col items-center justify-center p-8 bg-background text-center",children:[
12
+ /* @__PURE__ */O("div",{className:"text-6xl mb-4",children:"⚠️"}),
13
+ /* @__PURE__ */O("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Algo salió mal"}),
14
+ /* @__PURE__ */O("p",{className:"text-sm text-muted-foreground mb-6 max-w-md",children:this.state.error?.message||"Ocurrió un error inesperado"}),
15
+ /* @__PURE__ */O("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity",children:"Intentar de nuevo"})]}):this.props.children}}const V={bubble:"rounded-2xl",image:"rounded-xl",button:"rounded-xl",card:"rounded-2xl"},W={bg:"bg-muted/50 dark:bg-muted/20",text:"text-foreground",border:"border-border/50"},q={text:"text-primary-foreground"};const H=(e,t)=>t.some(t=>e instanceof t);let Q,J;const K=/* @__PURE__ */new WeakMap,G=/* @__PURE__ */new WeakMap,Y=/* @__PURE__ */new WeakMap;let X={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return K.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ne(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ee(e){X=e(X)}function te(e){return"function"==typeof e?(t=e,(J||(J=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(re(this),e),ne(this.request)}:function(...e){return ne(t.apply(re(this),e))}):(e instanceof IDBTransaction&&function(e){if(K.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});K.set(e,t)}(e),H(e,Q||(Q=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,X):e);var t}function ne(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{t(ne(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",a),e.addEventListener("error",o)});return Y.set(t,e),t}(e);if(G.has(e))return G.get(e);const t=te(e);return t!==e&&(G.set(e,t),Y.set(t,e)),t}const re=e=>Y.get(e),ae=["get","getKey","getAll","getAllKeys","count"],oe=["put","add","delete","clear"],ie=/* @__PURE__ */new Map;function le(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ie.get(t))return ie.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=oe.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!a&&!ae.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,a?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),a&&o.done]))[0]};return ie.set(t,o),o}ee(e=>({...e,get:(t,n,r)=>le(t,n)||e.get(t,n,r),has:(t,n)=>!!le(t,n)||e.has(t,n)}));const se=["continue","continuePrimaryKey","advance"],ue={},ce=/* @__PURE__ */new WeakMap,de=/* @__PURE__ */new WeakMap,fe={get(e,t){if(!se.includes(t))return e[t];let n=ue[t];return n||(n=ue[t]=function(...e){ce.set(this,de.get(this)[t](...e))}),n}};async function*pe(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,fe);for(de.set(n,t),Y.set(n,re(t));t;)yield n,t=await(ce.get(n)||t.continue()),ce.delete(n)}function me(e,t){return t===Symbol.asyncIterator&&H(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&H(e,[IDBIndex,IDBObjectStore])}ee(e=>({...e,get:(t,n,r)=>me(t,n)?pe:e.get(t,n,r),has:(t,n)=>me(t,n)||e.has(t,n)}));const he=new class{db=null;DB_NAME="botuyo-chat";DB_VERSION=1;async init(){try{this.db=await function(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const i=indexedDB.open(e,t),l=ne(i);return r&&i.addEventListener("upgradeneeded",e=>{r(ne(i.result),e.oldVersion,e.newVersion,ne(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),l.then(e=>{o&&e.addEventListener("close",()=>o()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),l}(this.DB_NAME,this.DB_VERSION,{upgrade(e){e.objectStoreNames.contains("messages")||e.createObjectStore("messages",{keyPath:"id"}).createIndex("by-timestamp","timestamp"),e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata")}}),k.info("IndexedDB initialized")}catch(e){throw k.error("Failed to initialize IndexedDB:",e),e}}async saveMessage(e){this.db||await this.init();try{await this.db.put("messages",e)}catch(t){k.error("Failed to save message:",t)}}async saveMessages(e){this.db||await this.init();try{const t=this.db.transaction("messages","readwrite");await Promise.all([...e.map(e=>t.store.put(e)),t.done])}catch(t){k.error("Failed to save messages:",t)}}async getMessages(e=100){this.db||await this.init();try{return(await this.db.getAllFromIndex("messages","by-timestamp")).slice(-e)}catch(t){return k.error("Failed to get messages:",t),[]}}async getMessage(e){this.db||await this.init();try{return await this.db.get("messages",e)}catch(t){return void k.error("Failed to get message:",t)}}async deleteMessage(e){this.db||await this.init();try{await this.db.delete("messages",e)}catch(t){k.error("Failed to delete message:",t)}}async clearMessages(){this.db||await this.init();try{await this.db.clear("messages"),k.info("Messages cleared from IndexedDB")}catch(e){k.error("Failed to clear messages:",e)}}async setMetadata(e){this.db||await this.init();try{await this.db.put("metadata",e,"chat-metadata")}catch(t){k.error("Failed to set metadata:",t)}}async getMetadata(){this.db||await this.init();try{return await this.db.get("metadata","chat-metadata")}catch(e){return k.error("Failed to get metadata:",e),null}}async clearAll(){this.db||await this.init();try{await Promise.all([this.db.clear("messages"),this.db.clear("metadata")]),k.info("All data cleared from IndexedDB")}catch(e){k.error("Failed to clear all data:",e)}}async migrateFromLocalStorage(){try{const e="botuyo_chat_v1",t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(n.messages&&Array.isArray(n.messages)){const e=n.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}));await this.saveMessages(e),k.info(`Migrated ${e.length} messages from localStorage`)}n.sessionId&&await this.setMetadata({sessionId:n.sessionId}),localStorage.removeItem(e),k.info("Migration from localStorage completed")}catch(e){k.error("Failed to migrate from localStorage:",e)}}},ge="botuyo_chat_v1",ye={isOpen:!1,isConnected:!1,isTyping:!1,messages:[],error:null,sessionId:null};function ve(e,t){switch(t.type){case"TOGGLE_WINDOW":return{...e,isOpen:!e.isOpen};case"OPEN_WINDOW":return{...e,isOpen:!0};case"CLOSE_WINDOW":return{...e,isOpen:!1};case"SET_CONNECTED":return{...e,isConnected:t.payload};case"SET_TYPING":return{...e,isTyping:t.payload};case"ADD_MESSAGE":{if(e.messages.some(e=>e.id===t.payload.id))return e;const n=[...e.messages,t.payload],r="bot"===t.payload.sender;return{...e,messages:n,isTyping:!r&&e.isTyping}}case"SET_MESSAGES":return{...e,messages:[...t.payload]};case"SET_ERROR":return{...e,error:t.payload};case"SET_SESSION_ID":return{...e,sessionId:t.payload};case"CLEAR_CHAT":return{...ye,isOpen:e.isOpen};case"RESTORE_SESSION":return{...e,...t.payload,isConnected:!1,isTyping:!1,error:null};default:return e}}function be(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:i,traits:/* @__PURE__ */new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const a=i.prototype,o=Object.keys(a);for(let e=0;e<o.length;e++){const t=o[e];t in n||(n[t]=a[t].bind(n))}}const a=n?.Parent??Object;class o extends a{}function i(e){var t;const a=n?.Parent?new o:this;r(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const n of a._zod.deferred)n();return a}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class we extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ke extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Se={};function _e(e){return Se}function Ee(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function ze(e,t){return"bigint"==typeof t?t.toString():t}function xe(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ce(e){return null==e}function Ne(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Te=/* @__PURE__ */Symbol("evaluating");function Pe(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Te)return void 0===r&&(r=Te,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Oe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ie(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Le(e){return JSON.stringify(e)}const Ae="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Me=xe(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function De(e){if(!1===Fe(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Fe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function $e(e){return De(e)?{...e}:Array.isArray(e)?[...e]:e}const Re=/* @__PURE__ */new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Ze(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Be={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ve(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function We(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function qe(e){return"string"==typeof e?e:e?.message}function He(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const a=qe(e.inst?._zod.def?.error?.(e))??qe(t?.error?.(e))??qe(n.customError?.(e))??qe(n.localeError?.(e))??"Invalid input";r.message=a}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Qe(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Je(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ke=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ze,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ge=be("$ZodError",Ke),Ye=be("$ZodError",Ke,{Parent:Error}),Xe=e=>(t,n,r,a)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new we;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>He(e,o,_e())));throw Ae(t,a?.callee),t}return i.value},et=e=>async(t,n,r,a)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>He(e,o,_e())));throw Ae(t,a?.callee),t}return i.value},tt=e=>(t,n,r)=>{const a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new we;return o.issues.length?{success:!1,error:new(e??Ge)(o.issues.map(e=>He(e,a,_e())))}:{success:!0,data:o.value}},nt=/* @__PURE__ */tt(Ye),rt=e=>async(t,n,r)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>He(e,a,_e())))}:{success:!0,data:o.value}},at=/* @__PURE__ */rt(Ye),ot=e=>(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,n,a)},it=e=>(t,n,r)=>Xe(e)(t,n,r),lt=e=>async(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,a)},st=e=>async(t,n,r)=>et(e)(t,n,r),ut=e=>(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,a)},ct=e=>(t,n,r)=>tt(e)(t,n,r),dt=e=>async(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rt(e)(t,n,a)},ft=e=>async(t,n,r)=>rt(e)(t,n,r),pt=/^[cC][^\s-]{8,}$/,mt=/^[0-9a-z]+$/,ht=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gt=/^[0-9a-vA-V]{20}$/,yt=/^[A-Za-z0-9]{27}$/,vt=/^[a-zA-Z0-9_-]{21}$/,bt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,St=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Et=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ct=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nt=/^[A-Za-z0-9_-]*$/,Tt=/^\+[1-9]\d{6,14}$/,Pt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ot=/* @__PURE__ */new RegExp(`^${Pt}$`);function It(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Lt=/^-?\d+$/,At=/^-?\d+(?:\.\d+)?$/,Ft=/^[^A-Z]*$/,Mt=/^[^a-z]*$/,Dt=/* @__PURE__ */be("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$t={number:"number",bigint:"bigint",object:"date"},Rt=/* @__PURE__ */be("$ZodCheckLessThan",(e,t)=>{Dt.init(e,t);const n=$t[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jt=/* @__PURE__ */be("$ZodCheckGreaterThan",(e,t)=>{Dt.init(e,t);const n=$t[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ut=/* @__PURE__ */be("$ZodCheckMultipleOf",(e,t)=>{Dt.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let a=(r.split(".")[1]||"").length;if(0===a&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(a=Number.parseInt(e[1]))}const o=n>a?n:a;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zt=/* @__PURE__ */be("$ZodCheckNumberFormat",(e,t)=>{Dt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[a,o]=Be[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=o,n&&(r.pattern=Lt)}),e._zod.check=i=>{const l=i.value;if(n){if(!Number.isInteger(l))return void i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});if(!Number.isSafeInteger(l))return void(l>0?i.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}l<a&&i.issues.push({origin:"number",input:l,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),l>o&&i.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Bt=/* @__PURE__ */be("$ZodCheckMaxLength",(e,t)=>{var n;Dt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ce(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const a=Qe(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vt=/* @__PURE__ */be("$ZodCheckMinLength",(e,t)=>{var n;Dt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ce(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const a=Qe(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wt=/* @__PURE__ */be("$ZodCheckLengthEquals",(e,t)=>{var n;Dt.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ce(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,a=r.length;if(a===t.length)return;const o=Qe(r),i=a>t.length;n.issues.push({origin:o,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),qt=/* @__PURE__ */be("$ZodCheckStringFormat",(e,t)=>{var n,r;Dt.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=/* @__PURE__ */new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ht=/* @__PURE__ */be("$ZodCheckRegex",(e,t)=>{qt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qt=/* @__PURE__ */be("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ft),qt.init(e,t)}),Jt=/* @__PURE__ */be("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mt),qt.init(e,t)}),Kt=/* @__PURE__ */be("$ZodCheckIncludes",(e,t)=>{Dt.init(e,t);const n=je(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gt=/* @__PURE__ */be("$ZodCheckStartsWith",(e,t)=>{Dt.init(e,t);const n=new RegExp(`^${je(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yt=/* @__PURE__ */be("$ZodCheckEndsWith",(e,t)=>{Dt.init(e,t);const n=new RegExp(`.*${je(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Xt=/* @__PURE__ */be("$ZodCheckOverwrite",(e,t)=>{Dt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class en{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const a of r)this.content.push(a)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const tn={major:4,minor:3,patch:6},nn=/* @__PURE__ */be("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tn;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const a of r)for(const t of a._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,a=Ve(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=o._zod.check(e);if(i instanceof Promise&&!1===n?.async)throw new we;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(a||(a=Ve(e,t)))});else{if(e.issues.length===t)continue;a||(a=Ve(e,t))}}return r?r.then(()=>e):e},n=(n,a,o)=>{if(Ve(n))return n.aborted=!0,n;const i=t(a,r,o);if(i instanceof Promise){if(!1===o.async)throw new we;return i.then(t=>e._zod.parse(t,o))}return e._zod.parse(i,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if("backward"===o.direction){const t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,a,o)):n(t,a,o)}const i=e._zod.parse(a,o);if(i instanceof Promise){if(!1===o.async)throw new we;return i.then(e=>t(e,r,o))}return t(i,r,o)}}Pe(e,"~standard",()=>({validate:t=>{try{const n=nt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return at(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),rn=/* @__PURE__ */be("$ZodString",(e,t)=>{var n;nn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(a){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),an=/* @__PURE__ */be("$ZodStringFormat",(e,t)=>{qt.init(e,t),rn.init(e,t)}),on=/* @__PURE__ */be("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wt),an.init(e,t)}),ln=/* @__PURE__ */be("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=kt(e))}else t.pattern??(t.pattern=kt());an.init(e,t)}),sn=/* @__PURE__ */be("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=St),an.init(e,t)}),un=/* @__PURE__ */be("$ZodURL",(e,t)=>{an.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),a=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=a.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),cn=/* @__PURE__ */be("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),an.init(e,t)}),dn=/* @__PURE__ */be("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vt),an.init(e,t)}),fn=/* @__PURE__ */be("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pt),an.init(e,t)}),pn=/* @__PURE__ */be("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mt),an.init(e,t)}),mn=/* @__PURE__ */be("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ht),an.init(e,t)}),hn=/* @__PURE__ */be("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gt),an.init(e,t)}),gn=/* @__PURE__ */be("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yt),an.init(e,t)}),yn=/* @__PURE__ */be("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=It({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Pt}T(?:${r})$`)}(t)),an.init(e,t)}),vn=/* @__PURE__ */be("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ot),an.init(e,t)}),bn=/* @__PURE__ */be("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${It(t)}$`)),an.init(e,t)}),wn=/* @__PURE__ */be("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bt),an.init(e,t)}),kn=/* @__PURE__ */be("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_t),an.init(e,t),e._zod.bag.format="ipv4"}),Sn=/* @__PURE__ */be("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Et),an.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),_n=/* @__PURE__ */be("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zt),an.init(e,t)}),En=/* @__PURE__ */be("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xt),an.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function zn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const xn=/* @__PURE__ */be("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ct),an.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{zn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Cn=/* @__PURE__ */be("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Nt),an.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Nt.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return zn(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Nn=/* @__PURE__ */be("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Tt),an.init(e,t)}),Tn=/* @__PURE__ */be("$ZodJWT",(e,t)=>{an.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const a=JSON.parse(atob(r));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Pn=/* @__PURE__ */be("$ZodNumber",(e,t)=>{nn.init(e,t),e._zod.pattern=e._zod.bag.pattern??At,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(i){}const a=n.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return n;const o="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...o?{received:o}:{}}),n}}),On=/* @__PURE__ */be("$ZodNumberFormat",(e,t)=>{Zt.init(e,t),Pn.init(e,t)}),In=/* @__PURE__ */be("$ZodAny",(e,t)=>{nn.init(e,t),e._zod.parse=e=>e}),Ln=/* @__PURE__ */be("$ZodUnknown",(e,t)=>{nn.init(e,t),e._zod.parse=e=>e}),An=/* @__PURE__ */be("$ZodNever",(e,t)=>{nn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Fn(e,t,n){e.issues.length&&t.issues.push(...We(n,e.issues)),t.value[n]=e.value}const Mn=/* @__PURE__ */be("$ZodArray",(e,t)=>{nn.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);const o=[];for(let e=0;e<a.length;e++){const i=a[e],l=t.element._zod.run({value:i,issues:[]},r);l instanceof Promise?o.push(l.then(t=>Fn(t,n,e))):Fn(l,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function Dn(e,t,n,r,a){if(e.issues.length){if(a&&!(n in r))return;t.issues.push(...We(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function $n(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Rn(e,t,n,r,a,o){const i=[],l=a.keySet,s=a.catchall._zod,u=s.def.type,c="optional"===s.optout;for(const d in t){if(l.has(d))continue;if("never"===u){i.push(d);continue}const a=s.run({value:t[d],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Dn(e,n,d,t,c))):Dn(a,n,d,t,c)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const jn=/* @__PURE__ */be("$ZodObject",(e,t)=>{nn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=xe(()=>$n(t));Pe(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */new Set);for(const e of r.values)n[t].add(e)}}return n});const a=Fe,o=t.catchall;let i;e._zod.parse=(t,n)=>{i??(i=r.value);const l=t.value;if(!a(l))return t.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),t;t.value={};const s=[],u=i.shape;for(const e of i.keys){const r=u[e],a="optional"===r._zod.optout,o=r._zod.run({value:l[e],issues:[]},n);o instanceof Promise?s.push(o.then(n=>Dn(n,t,e,l,a))):Dn(o,t,e,l,a)}return o?Rn(s,l,t,n,r.value,e):s.length?Promise.all(s).then(()=>t):t}}),Un=/* @__PURE__ */be("$ZodObjectJIT",(e,t)=>{jn.init(e,t);const n=e._zod.parse,r=xe(()=>$n(t));let a;const o=Fe,i=!Se.jitless,l=i&&Me.value,s=t.catchall;let u;e._zod.parse=(c,d)=>{u??(u=r.value);const f=c.value;return o(f)?i&&l&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new en(["shape","payload","ctx"]),n=r.value,a=e=>{const t=Le(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=/* @__PURE__ */Object.create(null);let i=0;for(const r of n.keys)o[r]="key_"+i++;t.write("const newResult = {};");for(const r of n.keys){const n=o[r],i=Le(r),l=e[r],s="optional"===l?._zod?.optout;t.write(`const ${n} = ${a(r)};`),s?t.write(`\n if (${n}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const l=t.compile();return(t,n)=>l(e,t,n)})(t.shape)),c=a(c,d),s?Rn([],f,c,d,u,e):c):n(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c)}});function Zn(e,t,n,r){for(const o of e)if(0===o.issues.length)return t.value=o.value,t;const a=e.filter(e=>!Ve(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>He(e,r,_e())))}),t)}const Bn=/* @__PURE__ */be("$ZodUnion",(e,t)=>{nn.init(e,t),Pe(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Pe(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Pe(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Pe(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ne(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(a,o)=>{if(n)return r(a,o);let i=!1;const l=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)l.push(t),i=!0;else{if(0===t.issues.length)return t;l.push(t)}}return i?Promise.all(l).then(t=>Zn(t,a,e,o)):Zn(l,a,e,o)}}),Vn=/* @__PURE__ */be("$ZodIntersection",(e,t)=>{nn.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,a=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,n])=>qn(e,t,n)):qn(e,a,o)}});function Wn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(De(e)&&De(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),a={...e,...t};for(const o of r){const n=Wn(e[o],t[o]);if(!n.valid)return{valid:!1,mergeErrorPath:[o,...n.mergeErrorPath]};a[o]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const a=Wn(e[r],t[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qn(e,t,n){const r=/* @__PURE__ */new Map;let a;for(const l of t.issues)if("unrecognized_keys"===l.code){a??(a=l);for(const e of l.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(l);for(const l of n.issues)if("unrecognized_keys"===l.code)for(const e of l.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(l);const o=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&a&&e.issues.push({...a,keys:o}),Ve(e))return e;const i=Wn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Hn=/* @__PURE__ */be("$ZodEnum",(e,t)=>{nn.init(e,t);const n=Ee(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Re.has(typeof e)).map(e=>"string"==typeof e?je(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),Qn=/* @__PURE__ */be("$ZodTransform",(e,t)=>{nn.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ke(e.constructor.name);const a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(n.value=e,n));if(a instanceof Promise)throw new we;return n.value=a,n}});function Jn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Kn=/* @__PURE__ */be("$ZodOptional",(e,t)=>{nn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ne(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Jn(t,e.value)):Jn(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Gn=/* @__PURE__ */be("$ZodExactOptional",(e,t)=>{Kn.init(e,t),Pe(e._zod,"values",()=>t.innerType._zod.values),Pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Yn=/* @__PURE__ */be("$ZodNullable",(e,t)=>{nn.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ne(e.source)}|null)$`):void 0}),Pe(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Xn=/* @__PURE__ */be("$ZodDefault",(e,t)=>{nn.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>er(e,t)):er(r,t)}});function er(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const tr=/* @__PURE__ */be("$ZodPrefault",(e,t)=>{nn.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),nr=/* @__PURE__ */be("$ZodNonOptional",(e,t)=>{nn.init(e,t),Pe(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>rr(t,e)):rr(a,e)}});function rr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ar=/* @__PURE__ */be("$ZodCatch",(e,t)=>{nn.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>He(e,n,_e()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>He(e,n,_e()))},input:e.value}),e.issues=[]),e)}}),or=/* @__PURE__ */be("$ZodPipe",(e,t)=>{nn.init(e,t),Pe(e._zod,"values",()=>t.in._zod.values),Pe(e._zod,"optin",()=>t.in._zod.optin),Pe(e._zod,"optout",()=>t.out._zod.optout),Pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ir(e,t.in,n)):ir(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ir(e,t.out,n)):ir(r,t.out,n)}});function ir(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const lr=/* @__PURE__ */be("$ZodReadonly",(e,t)=>{nn.init(e,t),Pe(e._zod,"propValues",()=>t.innerType._zod.propValues),Pe(e._zod,"values",()=>t.innerType._zod.values),Pe(e._zod,"optin",()=>t.innerType?._zod?.optin),Pe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(sr):sr(r)}});function sr(e){return e.value=Object.freeze(e.value),e}const ur=/* @__PURE__ */be("$ZodCustom",(e,t)=>{Dt.init(e,t),nn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>cr(t,n,r,e));cr(a,n,r,e)}});function cr(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Je(e))}}var dr;(dr=globalThis).__zod_globalRegistry??(dr.__zod_globalRegistry=new class{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const fr=globalThis.__zod_globalRegistry;function pr(e,t){return new e({type:"string",...Ze(t)})}function mr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ze(t)})}function hr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ze(t)})}function gr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ze(t)})}function yr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ze(t)})}function vr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ze(t)})}function br(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ze(t)})}function wr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ze(t)})}function kr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ze(t)})}function Sr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ze(t)})}function _r(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ze(t)})}function Er(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ze(t)})}function zr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ze(t)})}function xr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ze(t)})}function Cr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ze(t)})}function Nr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ze(t)})}function Tr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ze(t)})}function Pr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ze(t)})}function Or(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ze(t)})}function Ir(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ze(t)})}function Lr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ze(t)})}function Ar(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ze(t)})}function Fr(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ze(t)})}function Mr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ze(t)})}function Dr(e,t){return new e({type:"string",format:"date",check:"string_format",...Ze(t)})}function $r(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ze(t)})}function Rr(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ze(t)})}function jr(e,t){return new e({type:"number",checks:[],...Ze(t)})}function Ur(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ze(t)})}function Zr(e){return new e({type:"any"})}function Br(e){return new e({type:"unknown"})}function Vr(e,t){return new e({type:"never",...Ze(t)})}function Wr(e,t){return new Rt({check:"less_than",...Ze(t),value:e,inclusive:!1})}function qr(e,t){return new Rt({check:"less_than",...Ze(t),value:e,inclusive:!0})}function Hr(e,t){return new jt({check:"greater_than",...Ze(t),value:e,inclusive:!1})}function Qr(e,t){return new jt({check:"greater_than",...Ze(t),value:e,inclusive:!0})}function Jr(e,t){return new Ut({check:"multiple_of",...Ze(t),value:e})}function Kr(e,t){return new Bt({check:"max_length",...Ze(t),maximum:e})}function Gr(e,t){return new Vt({check:"min_length",...Ze(t),minimum:e})}function Yr(e,t){return new Wt({check:"length_equals",...Ze(t),length:e})}function Xr(e,t){return new Ht({check:"string_format",format:"regex",...Ze(t),pattern:e})}function ea(e){return new Qt({check:"string_format",format:"lowercase",...Ze(e)})}function ta(e){return new Jt({check:"string_format",format:"uppercase",...Ze(e)})}function na(e,t){return new Kt({check:"string_format",format:"includes",...Ze(t),includes:e})}function ra(e,t){return new Gt({check:"string_format",format:"starts_with",...Ze(t),prefix:e})}function aa(e,t){return new Yt({check:"string_format",format:"ends_with",...Ze(t),suffix:e})}function oa(e){return new Xt({check:"overwrite",tx:e})}function ia(e){/* @__PURE__ */
16
+ return oa(t=>t.normalize(e))}function la(){/* @__PURE__ */
17
+ return oa(e=>e.trim())}function sa(){/* @__PURE__ */
18
+ return oa(e=>e.toLowerCase())}function ua(){/* @__PURE__ */
19
+ return oa(e=>e.toUpperCase())}function ca(){/* @__PURE__ */
20
+ return oa(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function da(e,t,n){return new e({type:"array",element:t,...Ze(n)})}function fa(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ze(n)})}function pa(e){const t=/* @__PURE__ */ma(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Je(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Je(r))}},e(n.value,n)));return t}function ma(e,t){const n=new Dt({check:"custom",...Ze(t)});return n._zod.check=e,n}function ha(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??fr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:/* @__PURE__ */new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ga(e,t,n={path:[],schemaPath:[]}){var r;const a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const l=e._zod.toJSONSchema?.();if(l)i.schema=l;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{const n=i.schema,o=t.processors[a.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);o(e,t,n,r)}const o=e._zod.parent;o&&(i.ref||(i.ref=o),ga(o,t,r),t.seen.get(o).isParent=!0)}const s=t.metadataRegistry.get(e);return s&&Object.assign(i.schema,s),"input"===t.io&&ba(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function ya(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=/* @__PURE__ */new Map;for(const o of e.seen.entries()){const t=e.metadataRegistry.get(o[0])?.id;if(t){const e=r.get(t);if(e&&e!==o[0])throw new Error(`Duplicate schema id "${t}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(t,o[0])}}const a=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:a,defId:o}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};const o=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=o,{defId:o,ref:`${a("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};const a=`#/${r}/`,o=t[1].schema.id??"__schema"+e.counter++;return{defId:o,ref:a+o}})(t);r.def={...r.schema},o&&(r.defId=o);const i=r.schema;for(const e in i)delete i[e];i.$ref=a};if("throw"===e.cycles)for(const o of e.seen.entries()){const e=o[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const n=o[1];if(t===o[0]){a(o);continue}if(e.external){const n=e.external.registry.get(o[0])?.id;if(t!==o[0]&&n){a(o);continue}}const r=e.metadataRegistry.get(o[0])?.id;(r||n.cycle||n.count>1&&"ref"===e.reused)&&a(o)}}function va(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const a=n.def??n.schema,o={...a},i=n.ref;if(n.ref=null,i){r(i);const n=e.seen.get(i),l=n.schema;if(!l.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(a,l):(a.allOf=a.allOf??[],a.allOf.push(l)),Object.assign(a,o),t._zod.parent===i)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in o||delete a[e]);if(l.$ref&&n.def)for(const e in a)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}const l=t._zod.parent;if(l&&l!==i){r(l);const t=e.seen.get(l);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(const e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:n.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(n)}Object.assign(a,n.def??n.schema);const o=e.external?.defs??{};for(const l of e.seen.entries()){const e=l[1];e.def&&e.defId&&(o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?a.$defs=o:a.definitions=o);try{const n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:wa(t,"input",e.processors),output:wa(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(i){throw new Error("Error converting schema to JSON.")}}function ba(e,t){const n=t??{seen:/* @__PURE__ */new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return ba(r.element,n);if("set"===r.type)return ba(r.valueType,n);if("lazy"===r.type)return ba(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return ba(r.innerType,n);if("intersection"===r.type)return ba(r.left,n)||ba(r.right,n);if("record"===r.type||"map"===r.type)return ba(r.keyType,n)||ba(r.valueType,n);if("pipe"===r.type)return ba(r.in,n)||ba(r.out,n);if("object"===r.type){for(const e in r.shape)if(ba(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(ba(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(ba(e,n))return!0;return!(!r.rest||!ba(r.rest,n))}return!1}const wa=(e,t,n={})=>r=>{const{libraryOptions:a,target:o}=r??{},i=ha({...a??{},target:o,io:t,processors:n});return ga(e,i),ya(i,e),va(i,e)},ka={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sa=(e,t,n,r)=>{const a=e._zod.def;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType},_a=/* @__PURE__ */be("ZodISODateTime",(e,t)=>{yn.init(e,t),Va.init(e,t)}),Ea=/* @__PURE__ */be("ZodISODate",(e,t)=>{vn.init(e,t),Va.init(e,t)}),za=/* @__PURE__ */be("ZodISOTime",(e,t)=>{bn.init(e,t),Va.init(e,t)}),xa=/* @__PURE__ */be("ZodISODuration",(e,t)=>{wn.init(e,t),Va.init(e,t)}),Ca=be("ZodError",(e,t)=>{Ge.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>r({issues:e}));else if("invalid_key"===a.code)r({issues:a.issues});else if("invalid_element"===a.code)r({issues:a.issues});else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ze,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ze,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Na=/* @__PURE__ */Xe(Ca),Ta=/* @__PURE__ */et(Ca),Pa=/* @__PURE__ */tt(Ca),Oa=/* @__PURE__ */rt(Ca),Ia=/* @__PURE__ */ot(Ca),La=/* @__PURE__ */it(Ca),Aa=/* @__PURE__ */lt(Ca),Fa=/* @__PURE__ */st(Ca),Ma=/* @__PURE__ */ut(Ca),Da=/* @__PURE__ */ct(Ca),$a=/* @__PURE__ */dt(Ca),Ra=/* @__PURE__ */ft(Ca),ja=/* @__PURE__ */be("ZodType",(e,t)=>(nn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wa(e,"input"),output:wa(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=ha({...n,processors:t});return ga(e,r),ya(r,e),va(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ie(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Ue(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Na(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pa(e,t,n),e.parseAsync=async(t,n)=>Ta(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ia(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Aa(e,t,n),e.decodeAsync=async(t,n)=>Fa(e,t,n),e.safeEncode=(t,n)=>Ma(e,t,n),e.safeDecode=(t,n)=>Da(e,t,n),e.safeEncodeAsync=async(t,n)=>$a(e,t,n),e.safeDecodeAsync=async(t,n)=>Ra(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){/* @__PURE__ */
21
+ return fa($o,e,t)}(t,n)),e.superRefine=t=>e.check(/* @__PURE__ */pa(t)),e.overwrite=t=>e.check(/* @__PURE__ */oa(t)),e.optional=()=>Co(e),e.exactOptional=()=>new No({type:"optional",innerType:e}),e.nullable=()=>Po(e),e.nullish=()=>Co(Po(e)),e.nonoptional=t=>function(e,t){return new Lo({type:"nonoptional",innerType:e,...Ze(t)})}(e,t),e.array=()=>/* @__PURE__ */da(bo,e,void 0),e.or=t=>new ko({type:"union",options:[e,t],...Ze(void 0)}),e.and=t=>new So({type:"intersection",left:e,right:t}),e.transform=t=>Mo(e,new zo({type:"transform",transform:t})),e.default=t=>{return n=t,new Oo({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.prefault=t=>{return n=t,new Io({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():$e(n)}});var n},e.catch=t=>{return new Ao({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Mo(e,t),e.readonly=()=>new Do({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return fr.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>fr.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return fr.get(e);const n=e.clone();return fr.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Ua=/* @__PURE__ */be("_ZodString",(e,t)=>{rn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:a,maximum:o,format:i,patterns:l,contentEncoding:s}=e._zod.bag;if("number"==typeof a&&(r.minLength=a),"number"==typeof o&&(r.maxLength=o),i&&(r.format=ka[i]??i,""===r.format&&delete r.format,"time"===i&&delete r.format),s&&(r.contentEncoding=s),l&&l.size>0){const e=[...l];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(/* @__PURE__ */Xr(...t)),e.includes=(...t)=>e.check(/* @__PURE__ */na(...t)),e.startsWith=(...t)=>e.check(/* @__PURE__ */ra(...t)),e.endsWith=(...t)=>e.check(/* @__PURE__ */aa(...t)),e.min=(...t)=>e.check(/* @__PURE__ */Gr(...t)),e.max=(...t)=>e.check(/* @__PURE__ */Kr(...t)),e.length=(...t)=>e.check(/* @__PURE__ */Yr(...t)),e.nonempty=(...t)=>e.check(/* @__PURE__ */Gr(1,...t)),e.lowercase=t=>e.check(/* @__PURE__ */ea(t)),e.uppercase=t=>e.check(/* @__PURE__ */ta(t)),e.trim=()=>e.check(/* @__PURE__ */la()),e.normalize=(...t)=>e.check(/* @__PURE__ */ia(...t)),e.toLowerCase=()=>e.check(/* @__PURE__ */sa()),e.toUpperCase=()=>e.check(/* @__PURE__ */ua()),e.slugify=()=>e.check(/* @__PURE__ */ca())}),Za=/* @__PURE__ */be("ZodString",(e,t)=>{rn.init(e,t),Ua.init(e,t),e.email=t=>e.check(/* @__PURE__ */mr(Wa,t)),e.url=t=>e.check(/* @__PURE__ */wr(Qa,t)),e.jwt=t=>e.check(/* @__PURE__ */Fr(uo,t)),e.emoji=t=>e.check(/* @__PURE__ */kr(Ja,t)),e.guid=t=>e.check(/* @__PURE__ */hr(qa,t)),e.uuid=t=>e.check(/* @__PURE__ */gr(Ha,t)),e.uuidv4=t=>e.check(/* @__PURE__ */yr(Ha,t)),e.uuidv6=t=>e.check(/* @__PURE__ */vr(Ha,t)),e.uuidv7=t=>e.check(/* @__PURE__ */br(Ha,t)),e.nanoid=t=>e.check(/* @__PURE__ */Sr(Ka,t)),e.guid=t=>e.check(/* @__PURE__ */hr(qa,t)),e.cuid=t=>e.check(/* @__PURE__ */_r(Ga,t)),e.cuid2=t=>e.check(/* @__PURE__ */Er(Ya,t)),e.ulid=t=>e.check(/* @__PURE__ */zr(Xa,t)),e.base64=t=>e.check(/* @__PURE__ */Ir(io,t)),e.base64url=t=>e.check(/* @__PURE__ */Lr(lo,t)),e.xid=t=>e.check(/* @__PURE__ */xr(eo,t)),e.ksuid=t=>e.check(/* @__PURE__ */Cr(to,t)),e.ipv4=t=>e.check(/* @__PURE__ */Nr(no,t)),e.ipv6=t=>e.check(/* @__PURE__ */Tr(ro,t)),e.cidrv4=t=>e.check(/* @__PURE__ */Pr(ao,t)),e.cidrv6=t=>e.check(/* @__PURE__ */Or(oo,t)),e.e164=t=>e.check(/* @__PURE__ */Ar(so,t)),e.datetime=t=>e.check(function(e){/* @__PURE__ */
22
+ return Mr(_a,e)}(t)),e.date=t=>e.check(function(e){/* @__PURE__ */
23
+ return Dr(Ea,e)}(t)),e.time=t=>e.check(function(e){/* @__PURE__ */
24
+ return $r(za,e)}(t)),e.duration=t=>e.check(function(e){/* @__PURE__ */
25
+ return Rr(xa,e)}(t))});function Ba(e){/* @__PURE__ */
26
+ return pr(Za,e)}const Va=/* @__PURE__ */be("ZodStringFormat",(e,t)=>{an.init(e,t),Ua.init(e,t)}),Wa=/* @__PURE__ */be("ZodEmail",(e,t)=>{sn.init(e,t),Va.init(e,t)}),qa=/* @__PURE__ */be("ZodGUID",(e,t)=>{on.init(e,t),Va.init(e,t)}),Ha=/* @__PURE__ */be("ZodUUID",(e,t)=>{ln.init(e,t),Va.init(e,t)}),Qa=/* @__PURE__ */be("ZodURL",(e,t)=>{un.init(e,t),Va.init(e,t)}),Ja=/* @__PURE__ */be("ZodEmoji",(e,t)=>{cn.init(e,t),Va.init(e,t)}),Ka=/* @__PURE__ */be("ZodNanoID",(e,t)=>{dn.init(e,t),Va.init(e,t)}),Ga=/* @__PURE__ */be("ZodCUID",(e,t)=>{fn.init(e,t),Va.init(e,t)}),Ya=/* @__PURE__ */be("ZodCUID2",(e,t)=>{pn.init(e,t),Va.init(e,t)}),Xa=/* @__PURE__ */be("ZodULID",(e,t)=>{mn.init(e,t),Va.init(e,t)}),eo=/* @__PURE__ */be("ZodXID",(e,t)=>{hn.init(e,t),Va.init(e,t)}),to=/* @__PURE__ */be("ZodKSUID",(e,t)=>{gn.init(e,t),Va.init(e,t)}),no=/* @__PURE__ */be("ZodIPv4",(e,t)=>{kn.init(e,t),Va.init(e,t)}),ro=/* @__PURE__ */be("ZodIPv6",(e,t)=>{Sn.init(e,t),Va.init(e,t)}),ao=/* @__PURE__ */be("ZodCIDRv4",(e,t)=>{_n.init(e,t),Va.init(e,t)}),oo=/* @__PURE__ */be("ZodCIDRv6",(e,t)=>{En.init(e,t),Va.init(e,t)}),io=/* @__PURE__ */be("ZodBase64",(e,t)=>{xn.init(e,t),Va.init(e,t)}),lo=/* @__PURE__ */be("ZodBase64URL",(e,t)=>{Cn.init(e,t),Va.init(e,t)}),so=/* @__PURE__ */be("ZodE164",(e,t)=>{Nn.init(e,t),Va.init(e,t)}),uo=/* @__PURE__ */be("ZodJWT",(e,t)=>{Tn.init(e,t),Va.init(e,t)}),co=/* @__PURE__ */be("ZodNumber",(e,t)=>{Pn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:a,maximum:o,format:i,multipleOf:l,exclusiveMaximum:s,exclusiveMinimum:u}=e._zod.bag;"string"==typeof i&&i.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof a&&(r.minimum=a,"number"==typeof u&&"draft-04"!==t.target&&(u>=a?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof s&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=s,r.exclusiveMaximum=!0):r.exclusiveMaximum=s),"number"==typeof o&&(r.maximum=o,"number"==typeof s&&"draft-04"!==t.target&&(s<=o?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof l&&(r.multipleOf=l)})(e,t,n),e.gt=(t,n)=>e.check(/* @__PURE__ */Hr(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */Qr(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */Qr(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */Wr(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */qr(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */qr(t,n)),e.int=t=>e.check(mo(t)),e.safe=t=>e.check(mo(t)),e.positive=t=>e.check(/* @__PURE__ */Hr(0,t)),e.nonnegative=t=>e.check(/* @__PURE__ */Qr(0,t)),e.negative=t=>e.check(/* @__PURE__ */Wr(0,t)),e.nonpositive=t=>e.check(/* @__PURE__ */qr(0,t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */Jr(t,n)),e.step=(t,n)=>e.check(/* @__PURE__ */Jr(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function fo(e){/* @__PURE__ */
27
+ return jr(co,e)}const po=/* @__PURE__ */be("ZodNumberFormat",(e,t)=>{On.init(e,t),co.init(e,t)});function mo(e){/* @__PURE__ */
28
+ return Ur(po,e)}const ho=/* @__PURE__ */be("ZodAny",(e,t)=>{In.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}),go=/* @__PURE__ */be("ZodUnknown",(e,t)=>{Ln.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function yo(){/* @__PURE__ */
29
+ return Br(go)}const vo=/* @__PURE__ */be("ZodNever",(e,t)=>{An.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}),bo=/* @__PURE__ */be("ZodArray",(e,t)=>{Mn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=n,o=e._zod.def,{minimum:i,maximum:l}=e._zod.bag;"number"==typeof i&&(a.minItems=i),"number"==typeof l&&(a.maxItems=l),a.type="array",a.items=ga(o.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(/* @__PURE__ */Gr(t,n)),e.nonempty=t=>e.check(/* @__PURE__ */Gr(1,t)),e.max=(t,n)=>e.check(/* @__PURE__ */Kr(t,n)),e.length=(t,n)=>e.check(/* @__PURE__ */Yr(t,n)),e.unwrap=()=>e.element}),wo=/* @__PURE__ */be("ZodObject",(e,t)=>{Un.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=n,o=e._zod.def;a.type="object",a.properties={};const i=o.shape;for(const u in i)a.properties[u]=ga(i[u],t,{...r,path:[...r.path,"properties",u]});const l=new Set(Object.keys(i)),s=new Set([...l].filter(e=>{const n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));s.size>0&&(a.required=Array.from(s)),"never"===o.catchall?._zod.def.type?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ga(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,n,r),Pe(e,"shape",()=>t.shape),e.keyof=()=>Eo(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:yo()}),e.loose=()=>e.clone({...e._zod.def,catchall:yo()}),e.strict=()=>e.clone({...e._zod.def,catchall:/* @__PURE__ */Vr(vo,void 0)}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!De(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Oe(this,"shape",n),n}});return Ue(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!De(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Oe(this,"shape",n),n}});return Ue(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ie(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Oe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ue(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Ue(e,Ie(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Oe(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Ie(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Oe(this,"shape",r),r},checks:[]});return Ue(e,a)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Ie(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Oe(this,"shape",a),a},checks:[]});return Ue(t,a)}(xo,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ie(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)a[t]=new e({type:"nonoptional",innerType:r[t]});return Oe(this,"shape",a),a}});return Ue(t,r)}(Lo,e,t[0])}),ko=/* @__PURE__ */be("ZodUnion",(e,t)=>{Bn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def,o=!1===a.inclusive,i=a.options.map((e,n)=>ga(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=i:n.anyOf=i})(e,t,n,r),e.options=t.options}),So=/* @__PURE__ */be("ZodIntersection",(e,t)=>{Vn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def,o=ga(a.left,t,{...r,path:[...r.path,"allOf",0]}),i=ga(a.right,t,{...r,path:[...r.path,"allOf",1]}),l=e=>"allOf"in e&&1===Object.keys(e).length,s=[...l(o)?o.allOf:[o],...l(i)?i.allOf:[i]];n.allOf=s})(e,t,n,r)}),_o=/* @__PURE__ */be("ZodEnum",(e,t)=>{Hn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ee(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const a={};for(const o of e){if(!n.has(o))throw new Error(`Key ${o} not found in enum`);a[o]=t.entries[o]}return new _o({...t,checks:[],...Ze(r),entries:a})},e.exclude=(e,r)=>{const a={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new _o({...t,checks:[],...Ze(r),entries:a})}});function Eo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new _o({type:"enum",entries:n,...Ze(t)})}const zo=/* @__PURE__ */be("ZodTransform",(e,t)=>{Qn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ke(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Je(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Je(t))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}}),xo=/* @__PURE__ */be("ZodOptional",(e,t)=>{Kn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new xo({type:"optional",innerType:e})}const No=/* @__PURE__ */be("ZodExactOptional",(e,t)=>{Gn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),To=/* @__PURE__ */be("ZodNullable",(e,t)=>{Yn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def,o=ga(a.innerType,t,r),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Po(e){return new To({type:"nullable",innerType:e})}const Oo=/* @__PURE__ */be("ZodDefault",(e,t)=>{Xn.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Io=/* @__PURE__ */be("ZodPrefault",(e,t)=>{tr.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Lo=/* @__PURE__ */be("ZodNonOptional",(e,t)=>{nr.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),Ao=/* @__PURE__ */be("ZodCatch",(e,t)=>{ar.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def;let o;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType;try{o=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Fo=/* @__PURE__ */be("ZodPipe",(e,t)=>{or.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def,o="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;ga(o,t,r),t.seen.get(e).ref=o})(e,t,0,r),e.in=t.in,e.out=t.out});function Mo(e,t){return new Fo({type:"pipe",in:e,out:t})}const Do=/* @__PURE__ */be("ZodReadonly",(e,t)=>{lr.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const a=e._zod.def;ga(a.innerType,t,r),t.seen.get(e).ref=a.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),$o=/* @__PURE__ */be("ZodCustom",(e,t)=>{ur.init(e,t),ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}),Ro="chat_device_id";function jo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const Uo=function(){const e={type:"object",shape:{id:Ba().optional(),type:Eo(["text","image","audio","location","system"]).default("text"),content:Ba().optional(),imageUrl:Ba().url().optional(),audioUrl:Ba().url().optional(),latitude:fo().optional(),longitude:fo().optional(),timestamp:Ba().optional(),sender:Eo(["bot","user","system"]).optional(),emotion:/* @__PURE__ */Zr(ho).optional()}??{},...Ze(void 0)};return new wo(e)}();class Zo{queue=[];endpoint;apiKey;flushInterval=null;isFlushing=!1;isDisabled=!1;MAX_QUEUE_SIZE=100;FLUSH_INTERVAL_MS=3e4;BATCH_SIZE=10;constructor(e,t){this.endpoint=e,this.apiKey=t,this.startAutoFlush()}startAutoFlush(){this.flushInterval=setInterval(()=>{!this.isDisabled&&this.queue.length>0&&this.flush()},this.FLUSH_INTERVAL_MS)}trackOpen(){this.track("chat_opened")}trackClose(){this.track("chat_closed")}trackMessageSent(e){this.track("message_sent",{type:e})}trackMessageReceived(e,t){this.track("message_received",{type:e,latency:t})}trackError(e,t){this.track("error",{error:e,context:t})}trackConnectionStatus(e){this.track("connection_status",{isConnected:e})}trackFeatureUsed(e){this.track("feature_used",{feature:e})}trackTypingStarted(){this.track("typing_started")}trackAttachmentSent(e,t){this.track("attachment_sent",{type:e,size:t})}track(e,t){this.isDisabled||(this.queue.push({event:e,properties:{...t,userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,url:"undefined"!=typeof window?window.location.href:void 0},timestamp:Date.now()}),this.queue.length>=this.BATCH_SIZE&&this.flush(),this.queue.length>this.MAX_QUEUE_SIZE&&(this.queue=this.queue.slice(-this.MAX_QUEUE_SIZE),k.warn("Analytics queue overflow, dropping old events")))}async flush(){if(this.isDisabled||0===this.queue.length||this.isFlushing)return;this.isFlushing=!0;const e=[...this.queue];this.queue=[];try{const t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({events:e}),keepalive:!0});t.ok?k.debug(`Analytics: Flushed ${e.length} events`):(this.isDisabled=!0,this.queue=[],k.debug(`Analytics disabled: endpoint returned ${t.status}`))}catch(t){this.isDisabled=!0,this.queue=[],k.debug("Analytics disabled due to network error")}finally{this.isFlushing=!1}}destroy(){this.flushInterval&&clearInterval(this.flushInterval),this.flush()}}let Bo=null,Vo=null;function Wo(e){Bo=e}function qo(e){Vo=e}const Ho=s(null);function Qo({children:e,defaultLocale:n,initialState:r,onStateChange:o,...i}){const[l,s]=t(r?.isOpen??!1),[u,c]=t(0),d=a(()=>{s(!0),c(0),o?.(!0)},[o]),f=a(()=>{s(!1),o?.(!1)},[o]),p=a(()=>{s(e=>{const t=!e;return t&&c(0),o?.(t),t})},[o]),m=a(e=>{Bo?(Bo(e),k.debug("ChatWidgetProvider sendMessage:",e)):k.warn("sendMessage called but no handler registered")},[]),h=a(()=>{Vo?(Vo(),k.debug("ChatWidgetProvider clearMessages called")):k.warn("clearMessages called but no handler registered")},[]),g={isOpen:l,open:d,close:f,toggle:p,sendMessage:m,clearMessages:h,unreadCount:u},y=a((e,t)=>{"message:received"!==e||l||c(e=>e+1),i.onEvent?.(e,t)},[l,i]);/* @__PURE__ */
30
+ return O(z,{defaultLocale:n,children:/* @__PURE__ */P(Ho.Provider,{value:g,children:[e,
31
+ /* @__PURE__ */O(Yo,{...i,onStateChange:e=>{s(e),e&&c(0),o?.(e)},onEvent:y})]})})}function Jo(){const e=u(Ho);if(!e)throw new Error("useChatWidget must be used within a ChatWidgetProvider. Wrap your app with <ChatWidgetProvider>...</ChatWidgetProvider>");return e}const Ko=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)});function Go(e){const{apiKey:o,apiBaseUrl:s,pageContext:u,includeSEOMetadata:c=!1,theme:d,userContext:f,onLogin:m,onNavigate:h,onEvent:g,onStateChange:v,onThemeUpdate:b}=e,[w,S]=t(0),z=l(0),{t:x}=p(),C=function(e,t,n=!0){const o=l(null);return r(()=>{if(!n||!e||!t)return;const r=`${e}/analytics`;o.current=new Zo(r,t);const a=()=>o.current?.flush(),i=()=>{"hidden"===document.visibilityState&&o.current?.flush()};return window.addEventListener("beforeunload",a),window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("beforeunload",a),window.removeEventListener("visibilitychange",i),o.current?.destroy()}},[e,t,n]),{trackOpen:a(()=>{o.current?.trackOpen()},[]),trackClose:a(()=>{o.current?.trackClose()},[]),trackMessageSent:a(e=>{o.current?.trackMessageSent(e)},[]),trackMessageReceived:a((e,t)=>{o.current?.trackMessageReceived(e,t)},[]),trackError:a((e,t)=>{o.current?.trackError(e,t)},[]),trackConnectionStatus:a(e=>{o.current?.trackConnectionStatus(e)},[]),trackFeatureUsed:a(e=>{o.current?.trackFeatureUsed(e)},[])}}(s,o,!0),N=function({enabled:e=!0,soundEnabled:n=!0,desktopEnabled:o=!0,botName:i="Asistente",logoUrl:s,notificationSoundUrl:u}={}){const[c,d]=t("default"),f=l(null),p=s||y,m=u||E;r(()=>{n&&"undefined"!=typeof window&&(f.current=new Audio(m),f.current.volume=.3)},[n,m]),r(()=>{"undefined"!=typeof window&&"Notification"in window&&d(Notification.permission)},[]);const h=a(async()=>{if("undefined"==typeof window||!("Notification"in window))return k.warn("Notifications API not available"),!1;try{const e=await Notification.requestPermission();return d(e),k.info("Notification permission:",e),"granted"===e}catch(e){return k.error("Error requesting notification permission:",e),!1}},[]),g=a(t=>{if(e&&o&&"granted"===c&&("undefined"==typeof document||!document.hasFocus()))try{const e=`Nuevo mensaje de ${i}`;let n="Mensaje recibido";"text"===t.type&&"content"in t?n=t.content?.slice(0,100)||"Mensaje recibido":"image"===t.type?n="📷 Imagen":"audio"===t.type?n="🎵 Audio":"location"===t.type&&(n="📍 Ubicación");const r=new Notification(e,{body:n,icon:p,tag:"chat-message",requireInteraction:!1,silent:!1});r.onclick=()=>{window.focus(),r.close()},setTimeout(()=>r.close(),5e3)}catch(n){k.error("Error showing notification:",n)}},[e,o,c,i,p]),v=a(()=>{if(e&&n&&("undefined"==typeof document||!document.hasFocus()))try{f.current?.play().catch(e=>{k.debug("Audio playback blocked:",e)})}catch(t){k.error("Error playing sound:",t)}},[e,n]),b=a(e=>{g(e),v()},[g,v]);return{permission:c,requestPermission:h,notify:g,playSound:v,notifyWithSound:b}}({enabled:!0,soundEnabled:!0,desktopEnabled:!0,botName:d?.botName||"Asistente",logoUrl:d?.logoUrl}),T=function(e=10,t=6e4){const n=l([]);return{isAllowed:a(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),!(n.current.length>=e||(n.current.push(r),0))},[e,t]),getRemainingAttempts:a(()=>{const r=Date.now();return n.current=n.current.filter(e=>r-e<t),Math.max(0,e-n.current.length)},[e,t]),getTimeUntilReset:a(()=>{if(0===n.current.length)return 0;const e=Date.now(),r=n.current[0],a=t-(e-r);return Math.max(0,a)},[t]),reset:a(()=>{n.current=[]},[])}}(10,6e4),{state:P,actions:O}=function(){const[e,n]=i(ve,ye),[o,l]=t(!1);r(()=>{"undefined"==typeof window||o||(async()=>{try{await he.migrateFromLocalStorage();const e=await he.getMessages(100),t=await he.getMetadata();if(e.length>0||t){const r={messages:e.map(e=>({...e,timestamp:new Date(e.timestamp)})),sessionId:t?.sessionId||null,isOpen:t?.isOpen||!1};n({type:"RESTORE_SESSION",payload:r})}}catch(e){k.warn("Chat: Error rehydrating from IndexedDB",e);try{const e=localStorage.getItem(ge);if(e){const t=JSON.parse(e);t.messages&&(t.messages=t.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))),n({type:"RESTORE_SESSION",payload:t})}}catch(t){k.error("Chat: Fallback rehydration failed",t)}}finally{l(!0)}})()},[o]),r(()=>{if(!o)return;const t=setTimeout(async()=>{try{await he.saveMessages(e.messages),await he.setMetadata({isOpen:e.isOpen,sessionId:e.sessionId})}catch(t){k.error("Chat Persistence Error:",t);try{const t={isOpen:e.isOpen,messages:e.messages,sessionId:e.sessionId};localStorage.setItem(ge,JSON.stringify(t))}catch(n){k.error("Chat: Fallback persistence failed",n)}}},500);return()=>clearTimeout(t)},[e.isOpen,e.messages,e.sessionId,o]);const s=a(e=>{n({type:"ADD_MESSAGE",payload:e})},[]),u=a(()=>n({type:"TOGGLE_WINDOW"}),[]),c=a(()=>n({type:"OPEN_WINDOW"}),[]),d=a(()=>n({type:"CLOSE_WINDOW"}),[]),f=a(e=>n({type:"SET_CONNECTED",payload:e}),[]),p=a(e=>n({type:"SET_TYPING",payload:e}),[]),m=a(e=>n({type:"SET_MESSAGES",payload:e}),[]),h=a(e=>n({type:"SET_ERROR",payload:e}),[]),g=a(e=>n({type:"SET_SESSION_ID",payload:e}),[]),y=a(()=>{localStorage.removeItem(ge),n({type:"CLEAR_CHAT"})},[]),v=a(()=>{n({type:"SET_MESSAGES",payload:[]})},[]);return{state:e,isHydrated:o,actions:{toggleWindow:u,openWindow:c,closeWindow:d,setConnected:f,setTyping:p,addMessage:s,setMessages:m,setError:h,setSessionId:g,clearChat:y,clearMessages:v}}}(),L=function(e=!1){const a="undefined"!=typeof window?window.location.pathname:"",o=n(()=>a,[a]),[i,l]=t({});return r(()=>{if(!e)return void l({});const t=setTimeout(()=>{const e=function(){if("undefined"==typeof window)return{};const e={};e.title=document.title,document.querySelectorAll("meta").forEach(t=>{const n=t.getAttribute("name"),r=t.getAttribute("property"),a=t.getAttribute("content");if(a){if(n)switch(n){case"description":e.description=a;break;case"keywords":e.keywords=a.split(",").map(e=>e.trim());break;case"author":e.author=a}if(r){if(r.startsWith("og:")){const t=r.replace("og:","og_");e[t]=a}if(r.startsWith("twitter:")){const t=r.replace("twitter:","twitter_");e[t]=a}}}});try{const t=document.querySelectorAll('script[type="application/ld+json"]');if(t.length>0){const n=[];t.forEach(e=>{try{const t=JSON.parse(e.textContent||"");n.push(t)}catch{}}),n.length>0&&(e.structuredData=n)}}catch{}return e}();l(e)},100);return()=>clearTimeout(t)},[o,e]),e&&Object.keys(i).length>0?i:void 0}(c),A=function(e){const{apiKey:o,apiBaseUrl:i,pageContext:s,userContext:u}=e,c=l(e);r(()=>{c.current=e},[e]);const d=l(null),[f,p]=t(!1),[m,h]=t(!1),g=l(function(){try{const e=localStorage.getItem(Ro);if(e)return e;const t=jo();return localStorage.setItem(Ro,t),t}catch{return k.warn("localStorage not available, using session-only device ID"),jo()}}()),y=l(s);r(()=>{y.current=s},[s]);const v=a(e=>{const t=Uo.safeParse(e),n=t.success&&t.data.id?t.data.id:`msg-${Math.random().toString(36).slice(2,11)}`,r=t.success&&t.data.sender?t.data.sender:"bot",a=t.success&&t.data.timestamp?new Date(t.data.timestamp):/* @__PURE__ */new Date,o=t.success?t.data:{type:"text"};switch(o.type){case"image":return{id:n,type:"image",sender:r,timestamp:a,imageUrl:o.imageUrl||o.content||"",altText:"Imagen enviada"};case"audio":return{id:n,type:"audio",sender:r,timestamp:a,content:o.audioUrl||o.content||""};case"location":return{id:n,type:"location",sender:r,timestamp:a,latitude:Number(o.latitude||0),longitude:Number(o.longitude||0),name:o.content||"Ubicación compartida"};case"system":return{id:n,type:"system",sender:"system",timestamp:a,content:String(o.content||"")};default:return{id:n,type:"text",sender:r,timestamp:a,content:String(o.content||"Sin contenido"),emotion:o.emotion}}},[]),b=a(()=>{if(!o||!i)return;if(d.current?.connected)return;p(!0);const e=I(`${i}/webchat`,{auth:{apiKey:o,deviceId:g.current,token:u?.token,metadata:u?.metadata},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,extraHeaders:{"bypass-tunnel-reminder":"true","X-Tunnel-Skip-Anti-Phishing-Page":"true"}});e.on("connect",()=>{p(!1),h(!0),c.current.onConnected(`temp-${Date.now()}`,void 0)}),e.on("disconnect",e=>{p(!1),h(!1),c.current.onDisconnected()}),e.on("connect_error",e=>{p(!1),c.current.onError(`Error de conexión: ${e.message}`)}),e.on("connection_ack",e=>{c.current.onConnected(e.sessionId,e.config)}),e.on("bot_message",e=>{try{c.current.onMessage(v(e))}catch(t){k.error("ChatSocket Error processing bot_message:",t)}}),e.on("chat_history",e=>{e.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{try{c.current.onMessage(v(e))}catch(t){k.debug("Error processing history message:",t)}}),c.current.onEvent&&c.current.onEvent("history_loaded",e)}),e.on("bot_typing",e=>c.current.onTyping(e)),e.on("auth_success",e=>{c.current.onLogin&&c.current.onLogin(e),e.theme&&c.current.onThemeUpdate&&c.current.onThemeUpdate(e.theme)}),d.current=e},[o,i]),w=a(()=>{d.current&&(d.current.disconnect(),d.current=null,h(!1))},[]),S=l(b);S.current=b,r(()=>(S.current(),()=>{d.current&&(d.current.disconnect(),d.current=null)}),[]);const E=l([]),z=l([]),x=a(()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,[]),C=a(()=>{if(d.current?.connected)for(;E.current.length>0;){const e=E.current.shift();d.current.emit("user_message",e)}},[]);r(()=>{m&&C()},[m,C]),r(()=>{if(!m)return;const e=setInterval(()=>{const e=Date.now();z.current=z.current.filter(t=>e<t.nextRetryAt||(t.attempts>=t.maxAttempts?(c.current.onEvent?.("message_failed",{id:t.id,payload:t.payload}),k.error("Message failed after max retries:",t.id),!1):!d.current?.connected||(d.current.emit("user_message",t.payload,e=>{e?.success&&c.current.onEvent?.("message_sent",{id:t.id})}),t.attempts++,t.nextRetryAt=e+1e3*Math.pow(2,t.attempts),t.attempts<t.maxAttempts)))},500);return()=>clearInterval(e)},[m]);const N=a((e,t="text")=>{const n=x(),r={...y.current,currentUrl:"undefined"!=typeof window?window.location.href:void 0,sentAt:/* @__PURE__ */(new Date).toISOString(),deviceId:g.current},a={id:n,content:e.trim(),type:t,metadata:r};return d.current?.connected?(d.current.emit("user_message",a,e=>{!1!==e?.success&&e?c.current.onEvent?.("message_sent",{id:n}):(z.current.push({id:n,payload:a,attempts:0,maxAttempts:3,nextRetryAt:Date.now()+1e3}),c.current.onEvent?.("message_retry_queued",{id:n}))}),n):(E.current.push(a),c.current.onEvent?.("queued_message",{id:n,payload:a}),n)},[x]),T=n(()=>_(e=>{d.current?.emit("typing",e)},250),[]);return{isConnected:m,isConnecting:f,sendMessage:N,sendTyping:T,requestHistory:a(()=>{d.current?.emit("request_history")},[]),reconnect:b,disconnect:w}}({apiKey:o,apiBaseUrl:s,pageContext:n(()=>L?{...u||{},seo:{...L||{}}}:u,[u,L]),userContext:f,onMessage:a(e=>{const t=Date.now(),n=z.current>0?t-z.current:void 0;z.current=t,O.addMessage(e),C.trackMessageReceived(e.type,n),P.isOpen||"bot"!==e.sender||(S(e=>e+1),N.notifyWithSound(e))},[O,P.isOpen,C,N]),onConnected:a((e,t)=>{O.setConnected(!0),O.setSessionId(e),C.trackConnectionStatus(!0),t&&g&&g("backend_config",t)},[O,g,C]),onDisconnected:a(()=>{O.setConnected(!1),C.trackConnectionStatus(!1)},[O,C]),onTyping:a(e=>O.setTyping(e),[O]),onError:a(e=>{O.setError(e),C.trackError(e)},[O,C]),onLogin:m,onNavigate:h,onEvent:g,onThemeUpdate:b}),F=a(()=>{k.debug("ChatWidget handleToggle called, current isOpen:",P.isOpen),P.isOpen?(O.closeWindow(),C.trackClose(),v?.(!1),k.debug("ChatWidget Closing window")):(O.openWindow(),S(0),C.trackOpen(),v?.(!0),k.debug("ChatWidget Opening window"))},[P.isOpen,O,v,C]),M=a(e=>{if(!T.isAllowed()){const e=T.getTimeUntilReset(),t=Math.ceil(e/1e3);return void O.setError(x("rate_limit_exceeded")+` Espera ${t}s.`)}const t={id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:e};O.addMessage(t),C.trackMessageSent("text"),A.sendMessage(e,"text")},[O,A,T,C,x]),D=a(async(e,t)=>{let n;n="audio"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"audio",sender:"user",timestamp:/* @__PURE__ */new Date,content:URL.createObjectURL(e)}:"image"===t?{id:`temp-${Date.now()}-${Math.random()}`,type:"image",sender:"user",timestamp:/* @__PURE__ */new Date,imageUrl:URL.createObjectURL(e)}:{id:`temp-${Date.now()}-${Math.random()}`,type:"text",sender:"user",timestamp:/* @__PURE__ */new Date,content:`📎 ${e.name}`},O.addMessage(n);const r=await Ko(e);A.sendMessage(r,t)},[O,A]),$=a(e=>{const t={id:`temp-${Date.now()}-${Math.random()}`,type:"location",sender:"user",timestamp:/* @__PURE__ */new Date,latitude:e.latitude,longitude:e.longitude,name:"Mi ubicación"};O.addMessage(t),A.sendMessage(JSON.stringify(e),"location")},[O,A]);r(()=>{const e=()=>{P.isOpen||O.openWindow()},t=()=>{P.isOpen&&O.closeWindow()},n=()=>{P.isOpen?O.closeWindow():O.openWindow()},r=e=>{e.detail?.message&&M(e.detail.message)};return window.addEventListener("botuyo-chat:open",e),window.addEventListener("botuyo-chat:close",t),window.addEventListener("botuyo-chat:toggle",n),window.addEventListener("botuyo-chat:send-message",r),()=>{window.removeEventListener("botuyo-chat:open",e),window.removeEventListener("botuyo-chat:close",t),window.removeEventListener("botuyo-chat:toggle",n),window.removeEventListener("botuyo-chat:send-message",r)}},[P.isOpen,O,M]),r(()=>(Wo(M),()=>Wo(null)),[M]);const R=a(()=>{O.clearMessages(),k.info("Chat history cleared")},[O]);r(()=>(qo(R),()=>qo(null)),[R]);const j=n(()=>{if(P.isTyping)return"thinking";const e=[...P.messages].reverse().find(e=>"bot"===e.sender&&"text"===e.type);return"text"===e?.type&&e.emotion?e.emotion:"default"},[P.isTyping,P.messages]);return{state:P,actions:O,unreadCount:w,currentBotEmotion:j,isConnected:A.isConnected,handleToggle:F,handleSendText:M,handleSendAttachment:D,handleSendLocation:$}}function Yo(e){const{apiKey:o,apiBaseUrl:i,pageContext:s,includeSEOMetadata:u=!1,theme:c,mediaConfig:d,userContext:f,onLogin:p,onNavigate:m,onEvent:h,onStateChange:g,onVoiceCall:y}=e,b=l(null),w=x();!function(e){const[n,a]=t(!1);r(()=>{let t=null;const n=()=>{if(!e.current)return;const t=!!e.current.parentElement?.closest(".dark"),n=!!document.getElementById("botuyo-chat-widget-root")?.classList.contains("dark"),r=document.getElementById("botuyo-chat-widget-root"),o=!!r?.parentElement?.closest(".dark"),i=document.documentElement.classList.contains("dark"),l=document.body.classList.contains("dark"),s=window.matchMedia("(prefers-color-scheme: dark)").matches,u=t||n||o||i||l||s;e.current&&(u?e.current.classList.add("dark"):e.current.classList.remove("dark")),a(u)};n();const r=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>n();r.addEventListener("change",o);const i=new MutationObserver(()=>{n()}),l=document.getElementById("botuyo-chat-widget-root");l&&(i.observe(l,{attributes:!0,attributeFilter:["class"]}),l.parentElement&&(i.observe(l.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=l.parentElement)),i.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class"]});let s=e.current?.parentElement;for(;s;)i.observe(s,{attributes:!0,attributeFilter:["class"]}),s=s.parentElement;const u=setInterval(()=>{const e=document.getElementById("botuyo-chat-widget-root");e&&e.parentElement!==t&&(t&&e.parentElement&&(i.observe(e.parentElement,{attributes:!0,attributeFilter:["class"],childList:!0}),t=e.parentElement),n())},100);return()=>{i.disconnect(),r.removeEventListener("change",o),clearInterval(u)}},[e])}(b);const[k,_]=t(),{mergedTheme:E,mergedStyles:z,getContainerStyle:T}=function(e,a){const o=function(){const[e,n]=t(()=>"undefined"!=typeof window&&(window.matchMedia("(prefers-contrast: high)").matches||window.matchMedia("(prefers-contrast: more)").matches));return r(()=>{const e=window.matchMedia("(prefers-contrast: high)"),t=window.matchMedia("(prefers-contrast: more)"),r=e=>{n(e.matches)};return e.addEventListener("change",r),t.addEventListener("change",r),()=>{e.removeEventListener("change",r),t.removeEventListener("change",r)}},[]),e}(),i=n(()=>{const t=S(e,a);return o?{...t,primaryColor:"#000000",cssVariables:{...t.cssVariables,background:"#FFFFFF",foreground:"#000000",card:"#FFFFFF",cardForeground:"#000000",primary:"#000000",primaryForeground:"#FFFFFF",muted:"#F5F5F5",mutedForeground:"#000000",border:"#000000"}}:t},[e,a,o]),l=n(()=>({radius:{...V,...e?.bubbleStyles?.radius},bot:{...W,...e?.bubbleStyles?.bot},user:{...q,...e?.bubbleStyles?.user},launcher:{...e?.bubbleStyles?.launcher},mapCard:{...e?.bubbleStyles?.mapCard}}),[e?.bubbleStyles]);return{mergedTheme:i,mergedStyles:l,getContainerStyle:(e,t,n)=>({"--chat-primary":i.primaryColor,zIndex:e?2147483647:9999,position:"fixed",top:t&&e?0:"auto",left:t&&e?0:"bottom-left"===n?"24px":"auto",right:t&&e?0:"bottom-right"!==n&&n?"auto":"24px",bottom:t&&e?0:"100px",width:t&&e?"100%":"auto",height:t&&e?"100%":"auto"})}}(c,k),{state:I,actions:L,unreadCount:A,currentBotEmotion:F,isConnected:M,handleToggle:D,handleSendText:$,handleSendAttachment:R,handleSendLocation:j}=Go({apiKey:o,apiBaseUrl:i,pageContext:s,includeSEOMetadata:u,theme:c,userContext:f,onLogin:p,onNavigate:m,onEvent:h,onStateChange:g,onThemeUpdate:_}),U=a(e=>{e.stopPropagation()},[]),H=T(I.isOpen,w,c?.position),Q=n(()=>{if(!E.cssVariables)return{};const e={},t=E.cssVariables;return t.background&&(e["--background"]=t.background),t.foreground&&(e["--foreground"]=t.foreground),t.card&&(e["--card"]=t.card),t.cardForeground&&(e["--card-foreground"]=t.cardForeground),t.primary&&(e["--primary"]=t.primary),t.primaryForeground&&(e["--primary-foreground"]=t.primaryForeground),t.muted&&(e["--muted"]=t.muted),t.mutedForeground&&(e["--muted-foreground"]=t.mutedForeground),t.border&&(e["--border"]=t.border),t.destructive&&(e["--destructive"]=t.destructive),t.radius&&(e["--radius"]=t.radius),t.spacing1&&(e["--spacing-1"]=t.spacing1),t.spacing2&&(e["--spacing-2"]=t.spacing2),t.spacing3&&(e["--spacing-3"]=t.spacing3),t.spacing4&&(e["--spacing-4"]=t.spacing4),t.spacing5&&(e["--spacing-5"]=t.spacing5),t.spacing6&&(e["--spacing-6"]=t.spacing6),t.spacing8&&(e["--spacing-8"]=t.spacing8),e},[E.cssVariables]);/* @__PURE__ */
32
+ return O(C,{animations:c?.animations,effects:c?.effects,children:/* @__PURE__ */P("div",{ref:b,id:"botuyo-chat-widget",className:v("botuyo-chat-widget flex flex-col",!w&&("bottom-left"===c?.position?"items-start":"items-end")),style:{...H,...Q,pointerEvents:"auto",backgroundColor:"transparent"},"data-animations-disabled":!1===c?.animations?.enabled?"true":void 0,"data-effects-glassmorphism":!1===c?.effects?.glassmorphism?"false":void 0,"data-effects-shadows":!1===c?.effects?.softShadows?"false":void 0,children:[
33
+ /* @__PURE__ */O("div",{className:v("transition-all duration-400 ease-[cubic-bezier(0.34,1.56,0.64,1)]",w?"bottom-left"===c?.position?"origin-bottom-left":"origin-bottom-right":"origin-bottom",I.isOpen?"opacity-100 scale-100 h-full w-full translate-y-0 pointer-events-auto":"opacity-0 scale-[0.85] pointer-events-none translate-y-8 h-0 w-0"),style:{pointerEvents:I.isOpen?"auto":"none"},onMouseDown:U,onTouchStart:U,children:/* @__PURE__ */O(B,{children:/* @__PURE__ */O(N,{isOpen:I.isOpen,isConnected:M,isTyping:I.isTyping,messages:I.messages,onClose:()=>L.closeWindow(),onSendMessage:$,onSendAttachment:R,onSendLocation:j,botName:c?.botName,logoUrl:c?.logoUrl,welcomeMessage:c?.welcomeMessage,inputPlaceholder:c?.inputPlaceholder,primaryColor:c?.primaryColor,position:c?.position,bubbleStyles:z,avatars:c?.avatars,mediaConfig:d,theme:E,onVoiceCall:y})})}),
34
+ /* @__PURE__ */O("div",{className:v(I.isOpen?"hidden":"block",!w&&"mt-4"),style:{pointerEvents:"auto"},onMouseDown:U,onTouchStart:U,children:/* @__PURE__ */O(Z,{isOpen:I.isOpen,onClick:D,unreadCount:A,position:c?.position||"bottom-right",primaryColor:c?.primaryColor,logoUrl:c?.logoUrl,starterPrompt:c?.starterPrompt,avatars:c?.avatars,emotion:F,styles:z,promptPersistence:c?.promptPersistence,avatarScale:c?.avatarScale})})]})})}const Xo=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,ChatWidget:Yo},Symbol.toStringTag,{value:"Module"})),ei=c(()=>Promise.resolve().then(()=>Xo).then(e=>({default:e.ChatWidget})));class ti{root=null;container=null;config=null;init(e){return this.config=e,this.render(),this}render(){if(!this.config)return void console.error("[BotUyoChat] No configuration provided");if(this.container||(this.container=document.createElement("div"),this.container.id="botuyo-chat-widget-root",this.container.style.position="fixed",this.container.style.zIndex="999999",document.body.appendChild(this.container)),this.config.theme?.cssVariables){const e=this.config.theme.cssVariables,t={background:e.background,foreground:e.foreground,card:e.card,cardForeground:e.cardForeground,primary:e.primary,primaryForeground:e.primaryForeground,muted:e.muted,mutedForeground:e.mutedForeground,border:e.border,destructive:e.destructive,radius:e.radius,spacing1:e.spacing1,spacing2:e.spacing2,spacing3:e.spacing3,spacing4:e.spacing4,spacing5:e.spacing5,spacing6:e.spacing6,spacing8:e.spacing8};Object.entries(t).forEach(([e,t])=>{void 0!==t&&this.container.style.setProperty(`--${e}`,t)})}this.root||(this.root=U.createRoot(this.container));const t={apiKey:this.config.apiKey,apiBaseUrl:this.config.apiBaseUrl,theme:{primaryColor:"#10b981",botName:"Asistente Virtual",position:"bottom-right",welcomeMessage:"¡Hola! 👋 ¿En qué puedo ayudarte?",inputPlaceholder:"Escribe tu mensaje...",borderRadius:"0.75rem",launcherBorderRadius:"50%",...this.config.theme},userContext:this.config.userContext,pageContext:this.config.pageContext,includeSEOMetadata:this.config.includeSEOMetadata??!1,mediaConfig:this.config.mediaConfig,onNavigate:this.config.onNavigate,onLogin:this.config.onLogin,onEvent:this.config.onEvent,onStateChange:this.config.onStateChange,onVoiceCall:this.config.onVoiceCall},n=e.createElement(d,{fallback:e.createElement("div",{style:{position:"fixed",bottom:"24px",right:"24px",width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t.theme?.primaryColor||"#10b981",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",cursor:"wait"}},e.createElement("div",{style:{width:"24px",height:"24px",border:"3px solid rgba(255, 255, 255, 0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},e.createElement(ei,t));this.root.render(e.createElement(z,{defaultLocale:this.config.theme?.defaultLocale,children:n})),console.log("[BotUyoChat] Widget initialized",t)}update(e){this.config?(this.config={...this.config,...e,theme:{...this.config.theme,...e.theme}},this.render()):console.error("[BotUyoChat] Widget not initialized")}destroy(){this.root&&(this.root.unmount(),this.root=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null),this.config=null,console.log("[BotUyoChat] Widget destroyed")}open(){window.dispatchEvent(new CustomEvent("botuyo-chat:open"))}close(){window.dispatchEvent(new CustomEvent("botuyo-chat:close"))}sendMessage(e){window.dispatchEvent(new CustomEvent("botuyo-chat:send-message",{detail:{message:e}}))}getState(){return null}}const ni=new ti;window.BotUyoChat=ni;export{ti as BotUyoChatWidget,Yo as ChatWidget,Qo as ChatWidgetProvider,z as LanguageProvider,ni as default,Jo as useChatWidget,T as useLanguage};
35
35
  //# sourceMappingURL=botuyo-chat.es.js.map