@syncular/console 0.0.4-26 → 0.0.6-100
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.
- package/dist/App.d.ts +3 -7
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +3 -3
- package/dist/App.js.map +1 -1
- package/dist/hooks/ConnectionContext.d.ts +4 -1
- package/dist/hooks/ConnectionContext.d.ts.map +1 -1
- package/dist/hooks/ConnectionContext.js +116 -28
- package/dist/hooks/ConnectionContext.js.map +1 -1
- package/dist/hooks/useConsoleApi.d.ts +11 -1
- package/dist/hooks/useConsoleApi.d.ts.map +1 -1
- package/dist/hooks/useConsoleApi.js +78 -0
- package/dist/hooks/useConsoleApi.js.map +1 -1
- package/dist/hooks/useLiveEvents.d.ts.map +1 -1
- package/dist/hooks/useLiveEvents.js +116 -3
- package/dist/hooks/useLiveEvents.js.map +1 -1
- package/dist/layout.d.ts +4 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +8 -7
- package/dist/layout.js.map +1 -1
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +36 -4
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/types.d.ts +13 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/mount.d.ts +1 -0
- package/dist/mount.d.ts.map +1 -1
- package/dist/mount.js +1 -1
- package/dist/mount.js.map +1 -1
- package/dist/pages/Config.d.ts +3 -1
- package/dist/pages/Config.d.ts.map +1 -1
- package/dist/pages/Config.js +24 -17
- package/dist/pages/Config.js.map +1 -1
- package/dist/pages/Fleet.d.ts +3 -1
- package/dist/pages/Fleet.d.ts.map +1 -1
- package/dist/pages/Fleet.js +6 -3
- package/dist/pages/Fleet.js.map +1 -1
- package/dist/pages/Ops.js.map +1 -1
- package/dist/pages/Storage.d.ts +2 -0
- package/dist/pages/Storage.d.ts.map +1 -0
- package/dist/pages/Storage.js +103 -0
- package/dist/pages/Storage.js.map +1 -0
- package/dist/pages/Stream.d.ts.map +1 -1
- package/dist/pages/Stream.js +2 -3
- package/dist/pages/Stream.js.map +1 -1
- package/dist/pages/index.d.ts +1 -0
- package/dist/pages/index.d.ts.map +1 -1
- package/dist/pages/index.js +1 -0
- package/dist/pages/index.js.map +1 -1
- package/dist/routeTree.d.ts +1 -1
- package/dist/routeTree.d.ts.map +1 -1
- package/dist/routeTree.js +2 -0
- package/dist/routeTree.js.map +1 -1
- package/dist/routes/__root.d.ts +1 -1
- package/dist/routes/__root.d.ts.map +1 -1
- package/dist/routes/config.d.ts +1 -1
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/fleet.d.ts +1 -1
- package/dist/routes/fleet.d.ts.map +1 -1
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/investigate-commit.d.ts +1 -1
- package/dist/routes/investigate-commit.d.ts.map +1 -1
- package/dist/routes/investigate-event.d.ts +1 -1
- package/dist/routes/investigate-event.d.ts.map +1 -1
- package/dist/routes/ops.d.ts +1 -1
- package/dist/routes/ops.d.ts.map +1 -1
- package/dist/routes/storage.d.ts +2 -0
- package/dist/routes/storage.d.ts.map +1 -0
- package/dist/routes/storage.js +9 -0
- package/dist/routes/storage.js.map +1 -0
- package/dist/routes/stream.d.ts +1 -1
- package/dist/routes/stream.d.ts.map +1 -1
- package/dist/static-server.d.ts.map +1 -1
- package/dist/static-server.js +6 -1
- package/dist/static-server.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +9 -9
- package/src/App.tsx +12 -10
- package/src/__tests__/static-server.test.ts +193 -0
- package/src/hooks/ConnectionContext.tsx +135 -29
- package/src/hooks/useConsoleApi.ts +103 -0
- package/src/hooks/useLiveEvents.ts +142 -4
- package/src/layout.tsx +35 -5
- package/src/lib/api.ts +38 -5
- package/src/lib/types.ts +17 -0
- package/src/mount.tsx +6 -1
- package/src/pages/Config.tsx +57 -49
- package/src/pages/Fleet.tsx +19 -17
- package/src/pages/Storage.tsx +277 -0
- package/src/pages/Stream.tsx +6 -3
- package/src/pages/index.ts +1 -0
- package/src/routeTree.ts +2 -0
- package/src/routes/storage.tsx +9 -0
- package/src/static-server.ts +12 -1
- package/src/styles/globals.css +4 -1
- package/web-dist/assets/index-D8JLMM1I.js +86 -0
- package/web-dist/assets/index-D_fQabjS.css +1 -0
- package/web-dist/console.css +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/site.webmanifest +2 -2
- package/web-dist/assets/index-CTkQp6YC.js +0 -86
- package/web-dist/assets/index-j_U2SoXa.css +0 -1
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
function gM(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,at=globalThis,Vi="10.38.0";function oa(){return qh(at),at}function qh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Vi,t[Vi]=t[Vi]||{}}function Ic(e,t,n=at){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Vi]=s[Vi]||{};return i[e]||(i[e]=t())}const yM=["debug","info","warn","error","log","assert","trace"],vM="Sentry Logger ",oh={};function ia(e){if(!("console"in at))return e();const t=at.console,n={},s=Object.keys(oh);s.forEach(i=>{const a=oh[i];n[i]=t[i],t[i]=a});try{return e()}finally{s.forEach(i=>{t[i]=n[i]})}}function bM(){Pv().enabled=!0}function xM(){Pv().enabled=!1}function $R(){return Pv().enabled}function SM(...e){Iv("log",...e)}function _M(...e){Iv("warn",...e)}function wM(...e){Iv("error",...e)}function Iv(e,...t){Ce&&$R()&&ia(()=>{at.console[e](`${vM}[${e}]:`,...t)})}function Pv(){return Ce?Ic("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:bM,disable:xM,isEnabled:$R,log:SM,warn:_M,error:wM},BR=50,Qi="?",ew=/\(error: (.*)\)/,tw=/captureMessage|captureException/;function FR(...e){const t=e.sort((n,s)=>n[0]-s[0]).map(n=>n[1]);return(n,s=0,i=0)=>{const a=[],l=n.split(`
|
|
2
|
-
`);for(let f=s;f<l.length;f++){let d=l[f];d.length>1024&&(d=d.slice(0,1024));const h=ew.test(d)?d.replace(ew,"$1"):d;if(!h.match(/\S*Error: /)){for(const g of t){const v=g(h);if(v){a.push(v);break}}if(a.length>=BR+i)break}}return TM(a.slice(i))}}function EM(e){return Array.isArray(e)?FR(...e):e}function TM(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(pd(t).function||"")&&t.pop(),t.reverse(),tw.test(pd(t).function||"")&&(t.pop(),tw.test(pd(t).function||"")&&t.pop()),t.slice(0,BR).map(n=>({...n,filename:n.filename||pd(t).filename,function:n.function||Qi}))}function pd(e){return e[e.length-1]||{}}const Og="<anonymous>";function Ks(e){try{return!e||typeof e!="function"?Og:e.name||Og}catch{return Og}}function nw(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(s=>{s.stacktrace.frames&&n.push(...s.stacktrace.frames)}),n}catch{return}}}function HR(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Bd={},rw={};function ti(e,t){Bd[e]=Bd[e]||[],Bd[e].push(t)}function ni(e,t){if(!rw[e]){rw[e]=!0;try{t()}catch(n){Ce&&be.error(`Error while instrumenting ${e}`,n)}}}function Ur(e,t){const n=e&&Bd[e];if(n)for(const s of n)try{s(t)}catch(i){Ce&&be.error(`Error while triggering instrumentation handler.
|
|
3
|
-
Type: ${e}
|
|
4
|
-
Name: ${Ks(s)}
|
|
5
|
-
Error:`,i)}}let Ag=null;function qR(e){const t="error";ti(t,e),ni(t,RM)}function RM(){Ag=at.onerror,at.onerror=function(e,t,n,s,i){return Ur("error",{column:s,error:i,line:n,msg:e,url:t}),Ag?Ag.apply(this,arguments):!1},at.onerror.__SENTRY_INSTRUMENTED__=!0}let kg=null;function VR(e){const t="unhandledrejection";ti(t,e),ni(t,CM)}function CM(){kg=at.onunhandledrejection,at.onunhandledrejection=function(e){return Ur("unhandledrejection",e),kg?kg.apply(this,arguments):!0},at.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const GR=Object.prototype.toString;function Vh(e){switch(GR.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Zs(e,Error)}}function Pc(e,t){return GR.call(e)===`[object ${t}]`}function KR(e){return Pc(e,"ErrorEvent")}function sw(e){return Pc(e,"DOMError")}function NM(e){return Pc(e,"DOMException")}function qs(e){return Pc(e,"String")}function Gh(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function vc(e){return e===null||Gh(e)||typeof e!="object"&&typeof e!="function"}function uu(e){return Pc(e,"Object")}function Kh(e){return typeof Event<"u"&&Zs(e,Event)}function jM(e){return typeof Element<"u"&&Zs(e,Element)}function OM(e){return Pc(e,"RegExp")}function zc(e){return!!(e?.then&&typeof e.then=="function")}function AM(e){return uu(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Zs(e,t){try{return e instanceof t}catch{return!1}}function ZR(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function zv(e){return typeof Request<"u"&&Zs(e,Request)}const Dv=at,kM=80;function Br(e,t={}){if(!e)return"<unknown>";try{let n=e;const s=5,i=[];let a=0,l=0;const f=" > ",d=f.length;let h;const g=Array.isArray(t)?t:t.keyAttrs,v=!Array.isArray(t)&&t.maxStringLength||kM;for(;n&&a++<s&&(h=MM(n,g),!(h==="html"||a>1&&l+i.length*d+h.length>=v));)i.push(h),l+=h.length,n=n.parentNode;return i.reverse().join(f)}catch{return"<unknown>"}}function MM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(Dv.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}s.push(n.tagName.toLowerCase());const i=t?.length?t.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(i?.length)i.forEach(l=>{s.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&s.push(`#${n.id}`);const l=n.className;if(l&&qs(l)){const f=l.split(/\s+/);for(const d of f)s.push(`.${d}`)}}const a=["aria-label","type","name","title","alt"];for(const l of a){const f=n.getAttribute(l);f&&s.push(`[${l}="${f}"]`)}return s.join("")}function Tu(){try{return Dv.document.location.href}catch{return""}}function YR(e){if(!Dv.HTMLElement)return null;let t=e;const n=5;for(let s=0;s<n;s++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function lr(e,t,n){if(!(t in e))return;const s=e[t];if(typeof s!="function")return;const i=n(s);typeof i=="function"&&XR(i,s);try{e[t]=i}catch{Ce&&be.log(`Failed to replace method "${t}" in object`,e)}}function Gn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ce&&be.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function XR(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Gn(e,"__sentry_original__",t)}catch{}}function Lv(e){return e.__sentry_original__}function QR(e){if(Vh(e))return{message:e.message,name:e.name,stack:e.stack,...iw(e)};if(Kh(e)){const t={type:e.type,target:ow(e.target),currentTarget:ow(e.currentTarget),...iw(e)};return typeof CustomEvent<"u"&&Zs(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function ow(e){try{return jM(e)?Br(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function iw(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function IM(e){const t=Object.keys(QR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Ja;function Ru(e){if(Ja!==void 0)return Ja?Ja(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=at;return t in n&&typeof n[t]=="function"?(Ja=n[t],Ja(e)):(Ja=null,e())}function Uo(){return Ru(()=>Math.random())}function Cu(){return Ru(()=>Date.now())}function Ly(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function aw(e,t){if(!Array.isArray(e))return"";const n=[];for(let s=0;s<e.length;s++){const i=e[s];try{ZR(i)?n.push(HR(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Fd(e,t,n=!1){return qs(e)?OM(t)?t.test(e):qs(t)?n?e===t:e.includes(t):!1:!1}function $o(e,t=[],n=!1){return t.some(s=>Fd(e,s,n))}function PM(){const e=at;return e.crypto||e.msCrypto}let Mg;function zM(){return Uo()*16}function $r(e=PM()){try{if(e?.randomUUID)return Ru(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Mg||(Mg="10000000100040008000"+1e11),Mg.replace(/[018]/g,t=>(t^(zM()&15)>>t/4).toString(16))}function WR(e){return e.exception?.values?.[0]}function Ui(e){const{message:t,event_id:n}=e;if(t)return t;const s=WR(e);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||n||"<unknown>":n||"<unknown>"}function Uy(e,t,n){const s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function bc(e,t){const n=WR(e);if(!n)return;const s={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...s,...i,...t},t&&"data"in t){const a={...i?.data,...t.data};n.mechanism.data=a}}function cw(e){if(DM(e))return!0;try{Gn(e,"__sentry_captured__",!0)}catch{}return!1}function DM(e){try{return e.__sentry_captured__}catch{}}const JR=1e3;function aa(){return Cu()/JR}function LM(){const{performance:e}=at;if(!e?.now||!e.timeOrigin)return aa;const t=e.timeOrigin;return()=>(t+Ru(()=>e.now()))/JR}let lw;function sn(){return(lw??(lw=LM()))()}let Ig=null;function UM(){const{performance:e}=at;if(!e?.now)return;const t=3e5,n=Ru(()=>e.now()),s=Cu(),i=e.timeOrigin;if(typeof i=="number"&&Math.abs(i+n-s)<t)return i;const a=e.timing?.navigationStart;return typeof a=="number"&&Math.abs(a+n-s)<t?a:s-n}function pr(){return Ig===null&&(Ig=UM()),Ig}function $M(e){const t=sn(),n={sid:$r(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>FM(n)};return e&&xc(n,e),n}function xc(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||sn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:$r()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function BM(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),xc(e,n)}function FM(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Nu(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const s={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=Nu(s[i],t[i],n-1));return s}function Ys(){return $r()}function Vs(){return $r().substring(16)}const $y="_sentrySpan";function Sc(e,t){t?Gn(e,$y,t):delete e[$y]}function _c(e){return e[$y]}const HM=100;class Xs{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ys(),sampleRand:Uo()}}clone(){const t=new Xs;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Sc(t,_c(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&xc(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,s=n instanceof Xs?n.getScopeData():uu(n)?t:void 0,{tags:i,attributes:a,extra:l,user:f,contexts:d,level:h,fingerprint:g=[],propagationContext:v,conversationId:b}=s||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...a},this._extra={...this._extra,...l},this._contexts={...this._contexts,...d},f&&Object.keys(f).length&&(this._user=f),h&&(this._level=h),g.length&&(this._fingerprint=g),v&&(this._propagationContext=v),b&&(this._conversationId=b),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Sc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ys(),sampleRand:Uo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:HM;if(s<=0)return this;const i={timestamp:aa(),...t,message:t.message?Ly(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>s&&(this._breadcrumbs=this._breadcrumbs.slice(-s),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_c(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Nu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const s=n?.event_id||$r();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture exception!"),s;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...n,event_id:s},this),s}captureMessage(t,n,s){const i=s?.event_id||$r();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture message!"),i;const a=s?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:a,...s,event_id:i},this),i}captureEvent(t,n){const s=n?.event_id||$r();return this._client?(this._client.captureEvent(t,{...n,event_id:s},this),s):(Ce&&be.warn("No client configured on scope - will not capture event!"),s)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function qM(){return Ic("defaultCurrentScope",()=>new Xs)}function VM(){return Ic("defaultIsolationScope",()=>new Xs)}class GM{constructor(t,n){let s;t?s=t:s=new Xs;let i;n?i=n:i=new Xs,this._stack=[{scope:s}],this._isolationScope=i}withScope(t){const n=this._pushScope();let s;try{s=t(n)}catch(i){throw this._popScope(),i}return zc(s)?s.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),s)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function wc(){const e=oa(),t=qh(e);return t.stack=t.stack||new GM(qM(),VM())}function KM(e){return wc().withScope(e)}function ZM(e,t){const n=wc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function uw(e){return wc().withScope(()=>e(wc().getIsolationScope()))}function YM(){return{withIsolationScope:uw,withScope:KM,withSetScope:ZM,withSetIsolationScope:(e,t)=>uw(t),getCurrentScope:()=>wc().getScope(),getIsolationScope:()=>wc().getIsolationScope()}}function Dc(e){const t=qh(e);return t.acs?t.acs:YM()}function yt(){const e=oa();return Dc(e).getCurrentScope()}function rs(){const e=oa();return Dc(e).getIsolationScope()}function XM(){return Ic("globalScope",()=>new Xs)}function ju(...e){const t=oa(),n=Dc(t);if(e.length===2){const[s,i]=e;return s?n.withSetScope(s,i):n.withScope(i)}return n.withScope(e[0])}function gt(){return yt().getClient()}function eC(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:s,propagationSpanId:i}=t,a={trace_id:n,span_id:i||Vs()};return s&&(a.parent_span_id=s),a}const ps="sentry.source",Uv="sentry.sample_rate",tC="sentry.previous_trace_sample_rate",Qs="sentry.op",dn="sentry.origin",fu="sentry.idle_span_finish_reason",Ou="sentry.measurement_unit",Au="sentry.measurement_value",fw="sentry.custom_span_name",$v="sentry.profile_id",Lc="sentry.exclusive_time",QM="sentry.link.type",WM="gen_ai.conversation.id",JM=0,Bv=1,un=2;function eI(e){if(e<400&&e>=100)return{code:Bv};if(e>=400&&e<500)switch(e){case 401:return{code:un,message:"unauthenticated"};case 403:return{code:un,message:"permission_denied"};case 404:return{code:un,message:"not_found"};case 409:return{code:un,message:"already_exists"};case 413:return{code:un,message:"failed_precondition"};case 429:return{code:un,message:"resource_exhausted"};case 499:return{code:un,message:"cancelled"};default:return{code:un,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:un,message:"unimplemented"};case 503:return{code:un,message:"unavailable"};case 504:return{code:un,message:"deadline_exceeded"};default:return{code:un,message:"internal_error"}}return{code:un,message:"internal_error"}}function nC(e,t){e.setAttribute("http.response.status_code",t);const n=eI(t);n.message!=="unknown_error"&&e.setStatus(n)}const rC="_sentryScope",sC="_sentryIsolationScope";function tI(e){try{const t=at.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function nI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function rI(e,t,n){e&&(Gn(e,sC,tI(n)),Gn(e,rC,t))}function ih(e){const t=e;return{scope:t[rC],isolationScope:nI(t[sC])}}const Fv="sentry-",sI=/^sentry-/,oI=8192;function oC(e){const t=aI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(sI)){const l=i.slice(Fv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function iI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Fv}${s}`]=i),n),{});return cI(t)}function aI(e){if(!(!e||!qs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const s=dw(n);return Object.entries(s).forEach(([i,a])=>{t[i]=a}),t},{}):dw(e)}function dw(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const s=t.slice(0,n),i=t.slice(n+1);return[s,i].map(a=>{try{return decodeURIComponent(a.trim())}catch{return}})}).reduce((t,[n,s])=>(n&&s&&(t[n]=s),t),{})}function cI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,s],i)=>{const a=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`,l=i===0?a:`${t},${a}`;return l.length>oI?(Ce&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const lI=/^o(\d+)\./,uI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function fI(e){return e==="http"||e==="https"}function Uc(e,t=!1){const{host:n,path:s,pass:i,port:a,projectId:l,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${s&&`${s}/`}${l}`}function dI(e){const t=uI.exec(e);if(!t){ia(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,s,i="",a="",l="",f=""]=t.slice(1);let d="",h=f;const g=h.split("/");if(g.length>1&&(d=g.slice(0,-1).join("/"),h=g.pop()),h){const v=h.match(/^\d+/);v&&(h=v[0])}return iC({host:a,pass:i,path:d,projectId:h,port:l,protocol:n,publicKey:s})}function iC(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function hI(e){if(!Ce)return!0;const{port:t,projectId:n,protocol:s}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(be.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?fI(s)?t&&isNaN(parseInt(t,10))?(be.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(be.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),!1):(be.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function pI(e){return e.match(lI)?.[1]}function mI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=pI(n)),s}function gI(e){const t=typeof e=="string"?dI(e):iC(e);if(!(!t||!hI(t)))return t}function du(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const aC=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function yI(e){if(!e)return;const t=e.match(aC);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function vI(e,t){const n=yI(e),s=oC(t);if(!n?.traceId)return{traceId:Ys(),sampleRand:Uo()};const i=bI(n,s);s&&(s.sample_rand=i.toString());const{traceId:a,parentSpanId:l,parentSampled:f}=n;return{traceId:a,parentSpanId:l,sampled:f,dsc:s||{},sampleRand:i}}function cC(e=Ys(),t=Vs(),n){let s="";return n!==void 0&&(s=n?"-1":"-0"),`${e}-${t}${s}`}function lC(e=Ys(),t=Vs(),n){return`00-${e}-${t}-${n?"01":"00"}`}function bI(e,t){const n=du(t?.sample_rand);if(n!==void 0)return n;const s=du(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Uo()*s:s+Uo()*(1-s):Uo()}const uC=0,Hv=1;let hw=!1;function xI(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=mt(e);return{parent_span_id:a,span_id:t,trace_id:n,data:s,op:i,status:l,origin:f,links:d}}function fC(e){const{spanId:t,traceId:n,isRemote:s}=e.spanContext(),i=s?t:mt(e).parent_span_id,a=ih(e).scope,l=s?a?.getPropagationContext().propagationSpanId||Vs():t;return{parent_span_id:i,span_id:l,trace_id:n}}function SI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ri(e);return cC(t,n,s)}function _I(e){const{traceId:t,spanId:n}=e.spanContext(),s=ri(e);return lC(t,n,s)}function dC(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:s,...i},attributes:a})=>({span_id:t,trace_id:n,sampled:s===Hv,attributes:a,...i}))}function Gi(e){return typeof e=="number"?pw(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?pw(e.getTime()):sn()}function pw(e){return e>9999999999?e/1e3:e}function mt(e){if(EI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(wI(e)){const{attributes:s,startTime:i,name:a,endTime:l,status:f,links:d}=e,h="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:a,parent_span_id:h,start_timestamp:Gi(i),timestamp:Gi(l)||void 0,status:hC(f),op:s[Qs],origin:s[dn],links:dC(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function wI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function EI(e){return typeof e.getSpanJSON=="function"}function ri(e){const{traceFlags:t}=e.spanContext();return t===Hv}function hC(e){if(!(!e||e.code===JM))return e.code===Bv?"ok":e.message||"internal_error"}const Ki="_sentryChildSpans",By="_sentryRootSpan";function pC(e,t){const n=e[By]||e;Gn(t,By,n),e[Ki]?e[Ki].add(t):Gn(e,Ki,new Set([t]))}function TI(e,t){e[Ki]&&e[Ki].delete(t)}function Hd(e){const t=new Set;function n(s){if(!t.has(s)&&ri(s)){t.add(s);const i=s[Ki]?Array.from(s[Ki]):[];for(const a of i)n(a)}}return n(e),Array.from(t)}function In(e){return e[By]||e}function Kn(){const e=oa(),t=Dc(e);return t.getActiveSpan?t.getActiveSpan():_c(yt())}function Fy(){hw||(ia(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),hw=!0)}let mw=!1;function RI(){if(mw)return;function e(){const t=Kn(),n=t&&In(t);if(n){const s="internal_error";Ce&&be.log(`[Tracing] Root span: ${s} -> Global error occurred`),n.setStatus({code:un,message:s})}}e.tag="sentry_tracingErrorCallback",mw=!0,qR(e),VR(e)}function ns(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||gt()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function gw(e){be.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function ah(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(NI(n)){if(Fd(e.description,n))return Ce&&gw(e),!0;continue}if(!n.name&&!n.op)continue;const s=n.name?Fd(e.description,n.name):!0,i=n.op?e.op&&Fd(e.op,n.op):!0;if(s&&i)return Ce&&gw(e),!0}return!1}function CI(e,t){const n=t.parent_span_id,s=t.span_id;if(n)for(const i of e)i.parent_span_id===s&&(i.parent_span_id=n)}function NI(e){return typeof e=="string"||e instanceof RegExp}const qv="production",mC="_frozenDsc";function qd(e,t){Gn(e,mC,t)}function gC(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||qv,release:n.release,public_key:s,trace_id:e,org_id:mI(t)};return t.emit("createDsc",i),i}function Vv(e,t){const n=t.getPropagationContext();return n.dsc||gC(n.traceId,e)}function Ws(e){const t=gt();if(!t)return{};const n=In(e),s=mt(n),i=s.data,a=n.spanContext().traceState,l=a?.get("sentry.sample_rate")??i[Uv]??i[tC];function f(S){return(typeof l=="number"||typeof l=="string")&&(S.sample_rate=`${l}`),S}const d=n[mC];if(d)return f(d);const h=a?.get("sentry.dsc"),g=h&&oC(h);if(g)return f(g);const v=gC(e.spanContext().traceId,t),b=i[ps],x=s.description;return b!=="url"&&x&&(v.transaction=x),ns()&&(v.sampled=String(ri(n)),v.sample_rand=a?.get("sentry.sample_rand")??ih(n).scope?.getPropagationContext().sampleRand.toString()),f(v),t.emit("createDsc",v,n),v}class Ko{constructor(t={}){this._traceId=t.traceId||Ys(),this._spanId=t.spanId||Vs()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:uC}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,s){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Fs(e,t=100,n=1/0){try{return Hy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function yC(e,t=3,n=100*1024){const s=Fs(e,t);return kI(s)>n?yC(e,t-1,n):s}function Hy(e,t,n=1/0,s=1/0,i=MI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=jI(e,t);if(!f.startsWith("[object "))return f;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return f.replace("object ","");if(a(t))return"[Circular ~]";const h=t;if(h&&typeof h.toJSON=="function")try{const x=h.toJSON();return Hy("",x,d-1,s,i)}catch{}const g=Array.isArray(t)?[]:{};let v=0;const b=QR(t);for(const x in b){if(!Object.prototype.hasOwnProperty.call(b,x))continue;if(v>=s){g[x]="[MaxProperties ~]";break}const S=b[x];g[x]=Hy(x,S,d-1,s,i),v++}return l(t),g}function jI(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ZR(t))return HR(t);if(AM(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ks(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=OI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function OI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function AI(e){return~-encodeURI(e).split(/%..|./).length}function kI(e){return AI(JSON.stringify(e))}function MI(){const e=new WeakSet;function t(s){return e.has(s)?!0:(e.add(s),!1)}function n(s){e.delete(s)}return[t,n]}function ca(e,t=[]){return[e,t]}function II(e,t){const[n,s]=e;return[n,[...s,t]]}function qy(e,t){const n=e[1];for(const s of n){const i=s[0].type;if(t(s,i))return!0}return!1}function PI(e,t){return qy(e,(n,s)=>t.includes(s))}function Vy(e){const t=qh(at);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function zI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Vy(s),a]:s.push(typeof a=="string"?Vy(a):a)}for(const a of n){const[l,f]=a;if(i(`
|
|
6
|
-
${JSON.stringify(l)}
|
|
7
|
-
`),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Fs(f))}i(d)}}return typeof s=="string"?s:DI(s)}function DI(e){const t=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(t);let s=0;for(const i of e)n.set(i,s),s+=i.length;return n}function LI(e){return[{type:"span"},e]}function UI(e){const t=typeof e.data=="string"?Vy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const $I={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function yw(e){return $I[e]}function vC(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function BI(e,t,n,s){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&s&&{dsn:Uc(s)},...i&&{trace:i}}}function FI(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function HI(e,t,n,s){const i=vC(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Uc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ca(a,[l])}function qI(e,t,n,s){const i=vC(n),a=e.type&&e.type!=="replay_event"?e.type:"event";FI(e,n?.sdk);const l=BI(e,i,s,t);return delete e.sdkProcessingMetadata,ca(l,[[{type:a},e]])}function VI(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=Ws(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:Uc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},h=d?.length?e.filter(x=>!ah(mt(x),d)):e,g=e.length-h.length;g&&t?.recordDroppedEvent("before_send","span",g);const v=f?x=>{const S=mt(x),w=f(S);return w||(Fy(),S)}:mt,b=[];for(const x of h){const S=v(x);S&&b.push(LI(S))}return ca(l,b)}function GI(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=mt(e),{spanId:i}=e.spanContext(),a=ri(e),l=In(e),f=l===e,d=`[Tracing] Starting ${a?"sampled":"unsampled"} ${f?"root ":""}span`,h=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(s&&h.push(`parent ID: ${s}`),!f){const{op:g,description:v}=mt(l);h.push(`root ID: ${l.spanContext().spanId}`),g&&h.push(`root op: ${g}`),v&&h.push(`root description: ${v}`)}be.log(`${d}
|
|
8
|
-
${h.join(`
|
|
9
|
-
`)}`)}function KI(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=mt(e),{spanId:s}=e.spanContext(),a=In(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function ZI(e,t,n,s=Kn()){const i=s&&In(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Au]:t,[Ou]:n}))}function vw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Ou],a=s[Au];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const bw=1e3;class Zh{constructor(t={}){this._traceId=t.traceId||Ys(),this._spanId=t.spanId||Vs(),this._startTime=t.startTimestamp||sn(),this._links=t.links,this._attributes={},this.setAttributes({[dn]:"manual",[Qs]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:s}=this;return{spanId:t,traceId:n,traceFlags:s?Hv:uC}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Gi(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(ps,"custom"),this}end(t){this._endTime||(this._endTime=Gi(t),KI(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Qs],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:hC(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[dn],profile_id:this._attributes[$v],exclusive_time:this._attributes[Lc],measurements:vw(this._events),is_segment:this._isStandaloneSpan&&In(this)===this||void 0,segment_id:this._isStandaloneSpan?In(this).spanContext().spanId:void 0,links:dC(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=xw(n)?n:s||sn(),a=xw(n)?{}:n||{},l={name:t,time:Gi(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=gt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===In(this)))return;if(this._isStandaloneSpan){this._sampled?XI(VI([this],t)):(Ce&&be.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const s=this._convertSpanToTransaction();s&&(ih(this).scope||yt()).captureEvent(s)}_convertSpanToTransaction(){if(!Sw(mt(this)))return;this._name||(Ce&&be.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ih(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Hd(this).filter(g=>g!==this&&!YI(g)).map(g=>mt(g)).filter(Sw),l=this._attributes[ps];delete this._attributes[fw],a.forEach(g=>{delete g.data[fw]});const f={contexts:{trace:xI(this)},spans:a.length>bw?a.sort((g,v)=>g.start_timestamp-v.start_timestamp).slice(0,bw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Ws(this)},request:s,...l&&{transaction_info:{source:l}}},d=vw(this._events);return d&&Object.keys(d).length&&(Ce&&be.log("[Measurements] Adding measurements to transaction event",JSON.stringify(d,void 0,2)),f.measurements=d),f}}function xw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Sw(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function YI(e){return e instanceof Zh&&e.isStandaloneSpan()}function XI(e){const t=gt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function QI(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return WI(i,t,n,s)}function WI(e,t,n,s){return zc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function JI(e,t,n){if(!ns(e))return[!1];let s,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),s=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,s=!0);const a=du(i);if(a===void 0)return Ce&&be.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return Ce&&be.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,a,s];const l=n<a;return l||Ce&&be.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[l,a,s]}const bC="__SENTRY_SUPPRESS_TRACING__";function xC(e,t){const n=Kv();if(n.startSpan)return n.startSpan(e,t);const s=_C(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return ju(f,()=>tP(a)(()=>{const h=yt(),g=wC(h,a),b=e.onlyIfParent&&!g?new Ko:SC({parentSpan:g,spanArguments:s,forceTransaction:i,scope:h});return Sc(h,b),QI(()=>t(b),()=>{const{status:x}=mt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:un,message:"internal_error"})},()=>{b.end()})}))}function $c(e){const t=Kv();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=_C(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>ju(e.scope,l):i!==void 0?l=>Gv(i,l):l=>l())(()=>{const l=yt(),f=wC(l,i);return e.onlyIfParent&&!f?new Ko:SC({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function Gv(e,t){const n=Kv();return n.withActiveSpan?n.withActiveSpan(e,t):ju(s=>(Sc(s,e||void 0),t(s)))}function SC({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!ns()){const l=new Ko;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...Ws(l)};qd(l,f)}return l}const i=rs();let a;if(e&&!n)a=eP(e,s,t),pC(e,a);else if(e){const l=Ws(e),{traceId:f,spanId:d}=e.spanContext(),h=ri(e);a=_w({traceId:f,parentSpanId:d,...t},s,h),qd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:h}={...i.getPropagationContext(),...s.getPropagationContext()};a=_w({traceId:l,parentSpanId:d,...t},s,h),f&&qd(a,f)}return GI(a),rI(a,s,i),a}function _C(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=Gi(e.startTime),delete s.startTime,s}return n}function Kv(){const e=oa();return Dc(e)}function _w(e,t,n){const s=gt(),i=s?.getOptions()||{},{name:a=""}=e,l={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};s?.emit("beforeSampling",l,{decision:!1});const f=l.parentSampled??n,d=l.spanAttributes,h=t.getPropagationContext(),[g,v,b]=t.getScopeData().sdkProcessingMetadata[bC]?[!1]:JI(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:du(h.dsc?.sample_rate)},h.sampleRand),x=new Zh({...e,attributes:{[ps]:"custom",[Uv]:v!==void 0&&b?v:void 0,...d},sampled:g});return!g&&s&&(Ce&&be.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),s.recordDroppedEvent("sample_rate","transaction")),s&&s.emit("spanStart",x),x}function eP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[bC]?!1:ri(e),l=a?new Zh({...n,parentSpanId:s,traceId:i,sampled:a}):new Ko({traceId:i});pC(e,l);const f=gt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function wC(e,t){if(t)return t;if(t===null)return;const n=_c(e);if(!n)return;const s=gt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?In(n):n}function tP(e){return e!==void 0?t=>Gv(e,t):t=>t()}const Vd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},nP="heartbeatFailed",rP="idleTimeout",sP="finalTimeout",oP="externalFinish";function EC(e,t={}){const n=new Map;let s=!1,i,a=oP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Vd.idleTimeout,finalTimeout:h=Vd.finalTimeout,childSpanTimeout:g=Vd.childSpanTimeout,beforeSpanEnd:v,trimIdleSpanEndTimestamp:b=!0}=t,x=gt();if(!x||!ns()){const N=new Ko,A={sample_rate:"0",sampled:"false",...Ws(N)};return qd(N,A),N}const S=yt(),w=Kn(),T=iP(e);T.end=new Proxy(T.end,{apply(N,A,z){if(v&&v(T),A instanceof Ko)return;const[X,...q]=z,L=X||sn(),Z=Gi(L),G=Hd(T).filter(H=>H!==T),te=mt(T);if(!G.length||!b)return D(Z),Reflect.apply(N,A,[Z,...q]);const P=x.getOptions().ignoreSpans,V=G?.reduce((H,M)=>{const K=mt(M);return!K.timestamp||P&&ah(K,P)?H:H?Math.max(H,K.timestamp):K.timestamp},void 0),U=te.start_timestamp,F=Math.min(U?U+h/1e3:1/0,Math.max(U||-1/0,Math.min(Z,V||1/0)));return D(F),Reflect.apply(N,A,[F,...q])}});function R(){i&&(clearTimeout(i),i=void 0)}function k(N){R(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=rP,T.end(N))},d)}function j(N){i=setTimeout(()=>{!s&&l&&(a=nP,T.end(N))},g)}function C(N){R(),n.set(N,!0);const A=sn();j(A+g/1e3)}function I(N){if(n.has(N)&&n.delete(N),n.size===0){const A=sn();k(A+d/1e3)}}function D(N){s=!0,n.clear(),f.forEach(G=>G()),Sc(S,w);const A=mt(T),{start_timestamp:z}=A;if(!z)return;A.data[fu]||T.setAttribute(fu,a);const q=A.status;(!q||q==="unknown")&&T.setStatus({code:Bv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const L=Hd(T).filter(G=>G!==T);let Z=0;L.forEach(G=>{G.isRecording()&&(G.setStatus({code:un,message:"cancelled"}),G.end(N),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(G,void 0,2)));const te=mt(G),{timestamp:P=0,start_timestamp:V=0}=te,U=V<=N,F=(h+d)/1e3,H=P-V<=F;if(Ce){const M=JSON.stringify(G,void 0,2);U?H||be.log("[Tracing] Discarding span since it finished after idle span final timeout",M):be.log("[Tracing] Discarding span since it happened after idle span was finished",M)}(!H||!U)&&(TI(T,G),Z++)}),Z>0&&T.setAttribute("sentry.idle_span_discarded_spans",Z)}return f.push(x.on("spanStart",N=>{if(s||N===T||mt(N).timestamp||N instanceof Zh&&N.isStandaloneSpan())return;Hd(T).includes(N)&&C(N.spanContext().spanId)})),f.push(x.on("spanEnd",N=>{s||I(N.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",N=>{N===T&&(l=!0,k(),n.size&&j())})),t.disableAutoFinish||k(),setTimeout(()=>{s||(T.setStatus({code:un,message:"deadline_exceeded"}),a=sP,T.end())},h),T}function iP(e){const t=$c(e);return Sc(yt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Pg=0,ww=1,Ew=2;function Yh(e){return new hu(t=>{t(e)})}function Zv(e){return new hu((t,n)=>{n(e)})}class hu{constructor(t){this._state=Pg,this._handlers=[],this._runExecutor(t)}then(t,n){return new hu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(l){i(l)}},a=>{if(!n)i(a);else try{s(n(a))}catch(l){i(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new hu((n,s)=>{let i,a;return this.then(l=>{a=!1,i=l,t&&t()},l=>{a=!0,i=l,t&&t()}).then(()=>{if(a){s(i);return}n(i)})})}_executeHandlers(){if(this._state===Pg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===ww&&n[1](this._value),this._state===Ew&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Pg){if(zc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(ww,a)},i=a=>{n(Ew,a)};try{t(s,i)}catch(a){i(a)}}}function aP(e,t,n,s=0){try{const i=Gy(t,n,e,s);return zc(i)?i:Yh(i)}catch(i){return Zv(i)}}function Gy(e,t,n,s){const i=n[s];if(!e||!i)return e;const a=i({...e},t);return Ce&&a===null&&be.log(`Event processor "${i.id||"?"}" dropped event`),zc(a)?a.then(l=>Gy(l,t,n,s+1)):Gy(a,t,n,s+1)}let Pi,Tw,Rw,ko;function cP(e){const t=at._sentryDebugIds,n=at._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(ko&&s.length===Tw&&i.length===Rw)return ko;Tw=s.length,Rw=i.length,ko={},Pi||(Pi={});const a=(l,f)=>{for(const d of l){const h=f[d],g=Pi?.[d];if(g&&ko&&h)ko[g[0]]=h,Pi&&(Pi[d]=[g[0],h]);else if(h){const v=e(d);for(let b=v.length-1;b>=0;b--){const S=v[b]?.filename;if(S&&ko&&Pi){ko[S]=h,Pi[d]=[S,h];break}}}}};return t&&a(s,t),n&&a(i,n),ko}function lP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;uP(e,t),s&&hP(e,s),pP(e,n),fP(e,i),dP(e,a)}function Cw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:h,fingerprint:g,eventProcessors:v,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Hl(e,"extra",n),Hl(e,"tags",s),Hl(e,"attributes",i),Hl(e,"user",a),Hl(e,"contexts",l),e.sdkProcessingMetadata=Nu(e.sdkProcessingMetadata,d,2),f&&(e.level=f),S&&(e.transactionName=S),w&&(e.span=w),h.length&&(e.breadcrumbs=[...e.breadcrumbs,...h]),g.length&&(e.fingerprint=[...e.fingerprint,...g]),v.length&&(e.eventProcessors=[...e.eventProcessors,...v]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function Hl(e,t,n){e[t]=Nu(e[t],n,1)}function Yv(e,t){const n=XM().getScopeData();return e&&Cw(n,e.getScopeData()),t&&Cw(n,t.getScopeData()),n}function uP(e,t){const{extra:n,tags:s,user:i,contexts:a,level:l,transactionName:f}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(s).length&&(e.tags={...s,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),l&&(e.level=l),f&&e.type!=="transaction"&&(e.transaction=f)}function fP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function dP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function hP(e,t){e.contexts={trace:fC(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ws(t),...e.sdkProcessingMetadata};const n=In(t),s=mt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function pP(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function mP(e,t,n,s,i,a){const{normalizeDepth:l=3,normalizeMaxBreadth:f=1e3}=e,d={...t,event_id:t.event_id||n.event_id||$r(),timestamp:t.timestamp||aa()},h=n.integrations||e.integrations.map(T=>T.name);gP(d,e),bP(d,h),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&yP(d,e.stackParser);const g=SP(s,n.captureContext);n.mechanism&&bc(d,n.mechanism);const v=i?i.getEventProcessors():[],b=Yv(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),lP(d,b);const S=[...v,...b.eventProcessors];return aP(S,d,n).then(T=>(T&&vP(T),typeof l=="number"&&l>0?xP(T,l,f):T))}function gP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||qv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=Ly(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Ly(f.value,a))})}function yP(e,t){const n=cP(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function vP(e){const t={};if(e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function bP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function xP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Fs(i.data,t,n)}}))},...e.user&&{user:Fs(e.user,t,n)},...e.contexts&&{contexts:Fs(e.contexts,t,n)},...e.extra&&{extra:Fs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Fs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Fs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Fs(e.contexts.flags,3,n)),s}function SP(e,t){if(!t)return e;const n=e?e.clone():new Xs;return n.update(t),n}function TC(e,t){return yt().captureException(e,void 0)}function RC(e,t){return yt().captureEvent(e,t)}function _P(e,t){rs().setContext(e,t)}function wP(){const e=gt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Nw(e){const t=rs(),n=yt(),{userAgent:s}=at.navigator||{},i=$M({user:n.getUser()||t.getUser(),...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&xc(a,{status:"exited"}),CC(),t.setSession(i),i}function CC(){const e=rs(),n=yt().getSession()||e.getSession();n&&BM(n),NC(),e.setSession()}function NC(){const e=rs(),t=gt(),n=e.getSession();n&&t&&t.captureSession(n)}function jw(e=!1){if(e){CC();return}NC()}const EP="7";function TP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function RP(e){return`${TP(e)}${e.projectId}/envelope/`}function CP(e,t){const n={sentry_version:EP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function NP(e,t,n){return t||`${RP(e)}?${CP(e,n)}`}const Ow=[];function jP(e){const t={};return e.forEach(n=>{const{name:s}=n,i=t[s];i&&!i.isDefaultInstance&&n.isDefaultInstance||(t[s]=n)}),Object.values(t)}function OP(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let s;if(Array.isArray(n))s=[...t,...n];else if(typeof n=="function"){const i=n(t);s=Array.isArray(i)?i:[i]}else s=t;return jP(s)}function AP(e,t){const n={};return t.forEach(s=>{s&&jC(e,s,n)}),n}function Aw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function jC(e,t,n){if(n[t.name]){Ce&&be.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Ow.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Ow.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const s=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,a)=>s(i,a,e))}if(typeof t.processEvent=="function"){const s=t.processEvent.bind(t),i=Object.assign((a,l)=>s(a,l,e),{id:t.name});e.addEventProcessor(i)}Ce&&be.log(`Integration installed: ${t.name}`)}function kP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function MP(e,t){const{value:n,unit:s}=kP(e)?e:{value:e,unit:void 0},i=IP(n),a=s&&typeof s=="string"?{unit:s}:{};if(i)return{...i,...a};if(!t||t==="skip-undefined"&&n===void 0)return;let l="";try{l=JSON.stringify(n)??""}catch{}return{value:l,type:"string",...a}}function ch(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=MP(i,t);a&&(n[s]=a)}return n}function IP(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function OC(e,t){return t?ju(t,()=>{const n=Kn(),s=n?fC(n):eC(t);return[n?Ws(n):Vv(e,t),s]}):[void 0,void 0]}const PP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function zP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function DP(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Uc(s)),ca(i,[zP(e)])}const LP=100;function fs(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function UP(e,t){const n=Qv(),s=AC(e);s===void 0?n.set(e,[t]):s.length>=LP?(Xv(e,s),n.set(e,[t])):n.set(e,[...s,t])}function $P(e,t=yt(),n=UP){const s=t?.getClient()??gt();if(!s){Ce&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){Ce&&be.warn("logging option not enabled, log will not be captured.");return}const[,d]=OC(s,t),h={...e.attributes},{user:{id:g,email:v,username:b},attributes:x={}}=Yv(rs(),t);fs(h,"user.id",g,!1),fs(h,"user.email",v,!1),fs(h,"user.name",b,!1),fs(h,"sentry.release",i),fs(h,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};fs(h,"sentry.sdk.name",S),fs(h,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),R=T?.getReplayId(!0);fs(h,"sentry.replay_id",R),R&&T?.getRecordingMode()==="buffer"&&fs(h,"sentry._internal.replay_is_buffering",!0);const k=e.message;if(Gh(k)){const{__sentry_template_string__:q,__sentry_template_values__:L=[]}=k;L?.length&&(h["sentry.message.template"]=q),L.forEach((Z,G)=>{h[`sentry.message.parameter.${G}`]=Z})}const j=_c(t);fs(h,"sentry.trace.parent_span_id",j?.spanContext().spanId);const C={...e,attributes:h};s.emit("beforeCaptureLog",C);const I=f?ia(()=>f(C)):C;if(!I){s.recordDroppedEvent("before_send","log_item",1),Ce&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:D,message:N,attributes:A={},severityNumber:z}=I,X={timestamp:sn(),level:D,body:N,trace_id:d?.trace_id,severity_number:z??PP[D],attributes:{...ch(x),...ch(A,!0)}};n(s,X),s.emit("afterCaptureLog",I)}function Xv(e,t){const n=t??AC(e)??[];if(n.length===0)return;const s=e.getOptions(),i=DP(n,s._metadata,s.tunnel,e.getDsn());Qv().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function AC(e){return Qv().get(e)}function Qv(){return Ic("clientToLogBufferMap",()=>new WeakMap)}function BP(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function FP(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Uc(s)),ca(i,[BP(e)])}const HP=1e3;function Us(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function qP(e,t){const n=Jv(),s=kC(e);s===void 0?n.set(e,[t]):s.length>=HP?(Wv(e,s),n.set(e,[t])):n.set(e,[...s,t])}function VP(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Us(a,"user.id",n.id,!1),Us(a,"user.email",n.email,!1),Us(a,"user.name",n.username,!1),Us(a,"sentry.release",s),Us(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Us(a,"sentry.sdk.name",l),Us(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),h=d?.getReplayId(!0);return Us(a,"sentry.replay_id",h),h&&d?.getRecordingMode()==="buffer"&&Us(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function GP(e,t,n,s){const[,i]=OC(t,n),a=_c(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:sn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...ch(s),...ch(e.attributes,"skip-undefined")}}}function KP(e,t){const n=t?.scope??yt(),s=t?.captureSerializedMetric??qP,i=n?.getClient()??gt();if(!i){Ce&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Ce&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:h,attributes:g}=Yv(rs(),n),v=VP(e,i,h);i.emit("processMetric",v);const b=f||a?.beforeSendMetric,x=b?b(v):v;if(!x){Ce&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=GP(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function Wv(e,t){const n=t??kC(e)??[];if(n.length===0)return;const s=e.getOptions(),i=FP(n,s._metadata,s.tunnel,e.getDsn());Jv().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function kC(e){return Jv().get(e)}function Jv(){return Ic("clientToMetricBufferMap",()=>new WeakMap)}const eb=Symbol.for("SentryBufferFullError");function tb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return Zv(eb);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Yh(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(h=>setTimeout(()=>h(!1),l))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const ZP=60*1e3;function YP(e,t=Cu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?ZP:s-t}function XP(e,t){return e[t]||e.all||0}function QP(e,t,n=Cu()){return XP(e,t)>n}function WP(e,{statusCode:t,headers:n},s=Cu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(a)for(const f of a.trim().split(",")){const[d,h,,,g]=f.split(":",5),v=parseInt(d,10),b=(isNaN(v)?60:v)*1e3;if(!h)i.all=s+b;else for(const x of h.split(";"))x==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[x]=s+b):i[x]=s+b}else l?i.all=s+YP(l,s):t===429&&(i.all=s+60*1e3);return i}const MC=64;function JP(e,t,n=tb(e.bufferSize||MC)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(qy(l,(v,b)=>{const x=yw(b);QP(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(v)}),f.length===0)return Promise.resolve({});const d=ca(l[0],f),h=v=>{if(PI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${v}).`);return}qy(d,(b,x)=>{e.recordDroppedEvent(v,yw(x))})},g=()=>t({body:zI(d)}).then(v=>(v.statusCode!==void 0&&(v.statusCode<200||v.statusCode>=300)&&Ce&&be.warn(`Sentry responded with status code ${v.statusCode} to sent event.`),s=WP(s,v),v),v=>{throw h("network_error"),Ce&&be.error("Encountered error running transport request:",v),v});return n.add(g).then(v=>v,v=>{if(v===eb)return Ce&&be.error("Skipped sending event because buffer is full."),h("queue_overflow"),Promise.resolve({});throw v})}return{send:a,flush:i}}function e2(e,t,n){const s=[{type:"client_report"},{timestamp:aa(),discarded_events:e}];return ca(t?{dsn:t}:{},[s])}function IC(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function t2(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:l,op:f}=e.contexts?.trace??{};return{data:l??{},description:e.transaction,op:f,parent_span_id:n,span_id:s??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:l?.[$v],exclusive_time:l?.[Lc],measurements:e.measurements,is_segment:!0}}function n2(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[$v]:e.profile_id},...e.exclusive_time&&{[Lc]:e.exclusive_time}}}},measurements:e.measurements}}const kw="Not capturing exception because it's already been captured.",Mw="Discarded session because of missing or non-string release",PC=Symbol.for("SentryInternalError"),zC=Symbol.for("SentryDoNotSendEventError"),r2=5e3;function Gd(e){return{message:e,[PC]:!0}}function zg(e){return{message:e,[zC]:!0}}function Iw(e){return!!e&&typeof e=="object"&&PC in e}function Pw(e){return!!e&&typeof e=="object"&&zC in e}function zw(e,t,n,s,i){let a=0,l,f=!1;e.on(n,()=>{a=0,clearTimeout(l),f=!1}),e.on(t,d=>{a+=s(d),a>=8e5?i(e):f||(f=!0,l=setTimeout(()=>{i(e)},r2))}),e.on("flush",()=>{i(e)})}class s2{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=tb(t.transportOptions?.bufferSize??MC),t.dsn?this._dsn=gI(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=NP(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:s})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&zw(this,"afterCaptureLog","flushLogs",c2,Xv),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&zw(this,"afterCaptureMetric","flushMetrics",a2,Wv)}captureException(t,n,s){const i=$r();if(cw(t))return Ce&&be.log(kw),i;const a={event_id:i,...n};return this._process(()=>this.eventFromException(t,a).then(l=>this._captureEvent(l,a,s)).then(l=>l),"error"),a.event_id}captureMessage(t,n,s,i){const a={event_id:$r(),...s},l=Gh(t)?t:String(t),f=vc(t),d=f?this.eventFromMessage(l,n,a):this.eventFromException(t,a);return this._process(()=>d.then(h=>this._captureEvent(h,a,i)),f?"unknown":"error"),a.event_id}captureEvent(t,n,s){const i=$r();if(n?.originalException&&cw(n.originalException))return Ce&&be.log(kw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,h=Dw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),h),a.event_id}captureSession(t){this.sendSession(t),xc(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const s=await this._isClientDoneProcessing(t),i=await n.flush(t);return s&&i}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];jC(this,t,this._integrations),n||Aw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=qI(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=II(s,UI(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=qv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn(Mw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn(Mw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=HI(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,n,s=1){if(this._options.sendClientReports){const i=`${t}:${n}`;Ce&&be.log(`Recording outcome: "${i}"${s>1?` (${s} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+s}}on(t,n){const s=this._hooks[t]=this._hooks[t]||new Set,i=(...a)=>n(...a);return s.add(i),()=>{s.delete(i)}}emit(t,...n){const s=this._hooks[t];s&&s.forEach(i=>i(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Ce&&be.error("Error while sending envelope:",n),{}}return Ce&&be.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=AP(this,t),Aw(this,t)}_updateSessionFromEvent(t,n){let s=n.level==="fatal",i=!1;const a=n.exception?.values;if(a){i=!0,s=!1;for(const d of a)if(d.mechanism?.handled===!1){s=!0;break}}const l=t.status==="ok";(l&&t.errors===0||l&&s)&&(xc(t,{...s&&{status:"crashed"},errors:t.errors||Number(i||s)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(s=>setTimeout(s,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,s,i){const a=this.getOptions(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),mP(a,t,n,s,this,i).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts={trace:eC(s),...f.contexts};const d=Vv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=yt(),i=rs()){return Ce&&Ky(t)&&be.log(`Captured error event \`${IC(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(Pw(a)?be.log(a.message):Iw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=DC(t),d=Ky(t),g=`before send for type \`${t.type||"error"}\``,v=typeof l>"u"?void 0:du(l);if(d&&typeof v=="number"&&Uo()>v)return this.recordDroppedEvent("sample_rate","error"),Zv(zg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Dw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),zg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=i2(this,a,x,n);return o2(w,g)}).then(x=>{if(x===null){if(this.recordDroppedEvent("before_send",b),f){const R=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",R)}throw zg(`${g} returned \`null\`, will not send event.`)}const S=s.getSession()||i.getSession();if(d&&S&&this._updateSessionFromEvent(S,x),f){const T=x.sdkProcessingMetadata?.spanCountBeforeProcessing||0,R=x.spans?x.spans.length:0,k=T-R;k>0&&this.recordDroppedEvent("before_send","span",k)}const w=x.transaction_info;if(f&&w&&x.transaction!==t.transaction){const T="custom";x.transaction_info={...w,source:T}}return this.sendEvent(x,n),x}).then(null,x=>{throw Pw(x)||Iw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),Gd(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
-
Reason: ${x}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(s=>(this._numProcessing--,s),s=>(this._numProcessing--,s===eb&&this.recordDroppedEvent("queue_overflow",n),s))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,s])=>{const[i,a]=n.split(":");return{reason:i,category:a,quantity:s}})}_flushOutcomes(){Ce&&be.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ce&&be.log("No outcomes to send");return}if(!this._dsn){Ce&&be.log("No dsn provided, will not send outcomes");return}Ce&&be.log("Sending outcomes:",t);const n=e2(t,this._options.tunnel&&Uc(this._dsn));this.sendEnvelope(n)}}function Dw(e){return e==="replay_event"?"replay":e||"error"}function o2(e,t){const n=`${t} must return \`null\` or a valid event.`;if(zc(e))return e.then(s=>{if(!uu(s)&&s!==null)throw Gd(n);return s},s=>{throw Gd(`${t} rejected with ${s}`)});if(!uu(e)&&e!==null)throw Gd(n);return e}function i2(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(Ky(d)&&i)return i(d,s);if(DC(d)){if(l||f){const h=t2(d);if(f?.length&&ah(h,f))return null;if(l){const g=l(h);g?d=Nu(n,n2(g)):Fy()}if(d.spans){const g=[],v=d.spans;for(const x of v){if(f?.length&&ah(x,f)){CI(v,x);continue}if(l){const S=l(x);S?g.push(S):(Fy(),g.push(x))}else g.push(x)}const b=d.spans.length-g.length;b&&e.recordDroppedEvent("before_send","span",b),d.spans=g}}if(a){if(d.spans){const h=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:h}}return a(d,s)}}return d}function Ky(e){return e.type===void 0}function DC(e){return e.type==="transaction"}function a2(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+LC(e.attributes)}function c2(e){let t=0;return e.message&&(t+=e.message.length*2),t+LC(e.attributes)}function LC(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Lw(n[0]):vc(n)?t+=Lw(n):t+=100}),t}function Lw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function l2(e){return Vh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Uw(e){return l2(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function u2(e,t){t.debug===!0&&(Ce?be.enable():ia(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),yt().update(t.initialScope);const s=new e(t);return f2(s),s.init(),s}function f2(e){yt().setClient(e)}const d2="thismessage:/";function UC(e){return"isRelative"in e}function $C(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?d2:void 0;try{if("canParse"in URL&&!URL.canParse(e,s))return;const i=new URL(e,s);return n?{isRelative:n,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function h2(e){if(UC(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Zi(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",s=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:s,relative:t[5]+n+s}}function p2(e){return e.split(/[?#]/,1)[0]}function Bo(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),s=n?n[1]:"text/plain",i=e.includes(";base64,"),a=e.indexOf(",");let l="";if(t&&a!==-1){const f=e.slice(a+1);l=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${s}${i?",base64":""}${l?`,${l}`:""}`}return e}function m2(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const g2=m2;function y2(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function BC(e,t,n=[t],s="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(a=>({name:`${s}:@sentry/${a}`,version:Vi})),version:Vi}),e._metadata=i}function FC(e={}){const t=e.client||gt();if(!wP()||!t)return{};const n=oa(),s=Dc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||yt(),a=e.span||Kn(),l=a?SI(a):v2(i),f=a?Ws(a):Vv(t,i),d=iI(f);if(!aC.test(l))return be.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":l,baggage:d};return e.propagateTraceparent&&(g.traceparent=a?_I(a):b2(i)),g}function v2(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return cC(t,s,n)}function b2(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return lC(t,s,n)}const x2=100;function Wi(e,t){const n=gt(),s=rs();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=x2}=n.getOptions();if(a<=0)return;const f={timestamp:aa(),...e},d=i?ia(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let $w;const S2="FunctionToString",Bw=new WeakMap,_2=(()=>({name:S2,setupOnce(){$w=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Lv(this),n=Bw.has(gt())&&t!==void 0?t:this;return $w.apply(n,e)}}catch{}},setup(e){Bw.set(e,!0)}})),w2=_2,E2=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],T2="EventFilters",R2=(e={})=>{let t;return{name:T2,setup(n){const s=n.getOptions();t=Fw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Fw(e,a)}return N2(n,t)?null:n}}},C2=((e={})=>({...R2(e),name:"InboundFilters"}));function Fw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:E2],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function N2(e,t){if(e.type){if(e.type==="transaction"&&O2(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
-
Event: ${Ui(e)}`),!0}else{if(j2(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
-
Event: ${Ui(e)}`),!0;if(I2(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
-
Event: ${Ui(e)}`),!0;if(A2(e,t.denyUrls))return Ce&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
-
Event: ${Ui(e)}.
|
|
15
|
-
Url: ${lh(e)}`),!0;if(!k2(e,t.allowUrls))return Ce&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
-
Event: ${Ui(e)}.
|
|
17
|
-
Url: ${lh(e)}`),!0}return!1}function j2(e,t){return t?.length?IC(e).some(n=>$o(n,t)):!1}function O2(e,t){if(!t?.length)return!1;const n=e.transaction;return n?$o(n,t):!1}function A2(e,t){if(!t?.length)return!1;const n=lh(e);return n?$o(n,t):!1}function k2(e,t){if(!t?.length)return!0;const n=lh(e);return n?$o(n,t):!0}function M2(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function lh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?M2(n):null}catch{return Ce&&be.error(`Cannot extract url for event ${Ui(e)}`),null}}function I2(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function P2(e,t,n,s,i,a){if(!i.exception?.values||!a||!Zs(a.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=Zy(e,t,s,a.originalException,n,i.exception.values,l,0))}function Zy(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Zs(s[i],Error)){Hw(l,f,s);const h=e(t,s[i]),g=d.length;qw(h,i,g,f),d=Zy(e,t,n,s[i],i,[h,...d],h,g)}return HC(s)&&s.errors.forEach((h,g)=>{if(Zs(h,Error)){Hw(l,f,s);const v=e(t,h),b=d.length;qw(v,`errors[${g}]`,b,f),d=Zy(e,t,n,h,i,[v,...d],v,b)}}),d}function HC(e){return Array.isArray(e.errors)}function Hw(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...HC(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function qw(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function z2(e){const t="console";ti(t,e),ni(t,D2)}function D2(){"console"in at&&yM.forEach(function(e){e in at.console&&lr(at.console,e,function(t){return oh[e]=t,function(...n){Ur("console",{args:n,level:e}),oh[e]?.apply(at.console,n)}})})}function L2(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const U2="Dedupe",$2=(()=>{let e;return{name:U2,processEvent(t){if(t.type)return t;try{if(F2(t,e))return Ce&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),B2=$2;function F2(e,t){return t?!!(H2(e,t)||q2(e,t)):!1}function H2(e,t){const n=e.message,s=t.message;return!(!n&&!s||n&&!s||!n&&s||n!==s||!VC(e,t)||!qC(e,t))}function q2(e,t){const n=Vw(t),s=Vw(e);return!(!n||!s||n.type!==s.type||n.value!==s.value||!VC(e,t)||!qC(e,t))}function qC(e,t){let n=nw(e),s=nw(t);if(!n&&!s)return!0;if(n&&!s||!n&&s||(n=n,s=s,s.length!==n.length))return!1;for(let i=0;i<s.length;i++){const a=s[i],l=n[i];if(a.filename!==l.filename||a.lineno!==l.lineno||a.colno!==l.colno||a.function!==l.function)return!1}return!0}function VC(e,t){let n=e.fingerprint,s=t.fingerprint;if(!n&&!s)return!0;if(n&&!s||!n&&s)return!1;n=n,s=s;try{return n.join("")===s.join("")}catch{return!1}}function Vw(e){return e.exception?.values?.[0]}const V2="ConversationId",G2=(()=>({name:V2,setup(e){e.on("spanStart",t=>{const n=yt().getScopeData(),s=rs().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(WM,i)})}})),K2=G2;function Z2(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=ns()&&t(l);if(e.endTimestamp&&f){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(Q2(S,e),Y2(S,e,i),delete s[x]);return}const{spanOrigin:d="auto.http.browser",propagateTraceparent:h=!1}=typeof i=="object"?i:{spanOrigin:i},g=!!Kn(),v=f&&g?$c(J2(l,a,d)):new Ko;if(e.fetchData.__span=v.spanContext().spanId,s[v.spanContext().spanId]=v,n(e.fetchData.url)){const x=e.args[0],S={...e.args[1]||{}},w=X2(x,S,ns()&&g?v:void 0,h);w&&(e.args[1]=S,S.headers=w)}const b=gt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",v,x)}return v}function Y2(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function X2(e,t,n,s){const i=FC({span:n,propagateTraceparent:s}),a=i["sentry-trace"],l=i.baggage,f=i.traceparent;if(!a)return;const d=t.headers||(zv(e)?e.headers:void 0);if(d)if(W2(d)){const h=new Headers(d);if(h.get("sentry-trace")||h.set("sentry-trace",a),s&&f&&!h.get("traceparent")&&h.set("traceparent",f),l){const g=h.get("baggage");g?md(g)||h.set("baggage",`${g},${l}`):h.set("baggage",l)}return h}else if(Array.isArray(d)){const h=[...d];d.find(v=>v[0]==="sentry-trace")||h.push(["sentry-trace",a]),s&&f&&!d.find(v=>v[0]==="traceparent")&&h.push(["traceparent",f]);const g=d.find(v=>v[0]==="baggage"&&md(v[1]));return l&&!g&&h.push(["baggage",l]),h}else{const h="sentry-trace"in d?d["sentry-trace"]:void 0,g="traceparent"in d?d.traceparent:void 0,v="baggage"in d?d.baggage:void 0,b=v?Array.isArray(v)?[...v]:[v]:[],x=v&&(Array.isArray(v)?v.find(w=>md(w)):md(v));l&&!x&&b.push(l);const S={...d,"sentry-trace":h??a,baggage:b.length>0?b.join(","):void 0};return s&&f&&!g&&(S.traceparent=f),S}else return{...i}}function Q2(e,t){if(t.response){nC(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const s=parseInt(n);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:un,message:"internal_error"});e.end()}function md(e){return e.split(",").some(t=>t.trim().startsWith(Fv))}function W2(e){return typeof Headers<"u"&&Zs(e,Headers)}function J2(e,t,n){if(e.startsWith("data:")){const a=Bo(e);return{name:`${t} ${a}`,attributes:Gw(e,void 0,t,n)}}const s=$C(e),i=s?h2(s):e;return{name:`${t} ${i}`,attributes:Gw(e,s,t,n)}}function Gw(e,t,n,s){const i={url:Bo(e),type:"fetch","http.method":n,[dn]:s,[Qs]:"http.client"};return t&&(UC(t)||(i["http.url"]=Bo(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Bc(e,t,n,s,i){$P({level:e,message:t,attributes:n,severityNumber:i},s)}function ez(e,t,{scope:n}={}){Bc("trace",e,t,n)}function tz(e,t,{scope:n}={}){Bc("debug",e,t,n)}function nz(e,t,{scope:n}={}){Bc("info",e,t,n)}function rz(e,t,{scope:n}={}){Bc("warn",e,t,n)}function sz(e,t,{scope:n}={}){Bc("error",e,t,n)}function oz(e,t,{scope:n}={}){Bc("fatal",e,t,n)}const iz=Object.freeze(Object.defineProperty({__proto__:null,debug:tz,error:sz,fatal:oz,fmt:g2,info:nz,trace:ez,warn:rz},Symbol.toStringTag,{value:"Module"}));function nb(e,t,n,s){KP({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function Kw(e,t=1,n){nb("counter",e,t,n)}function Zw(e,t,n){nb("gauge",e,t,n)}function Yw(e,t,n){nb("distribution",e,t,n)}function GC(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const pu=at;function az(){return"history"in pu&&!!pu.history}function cz(){if(!("fetch"in pu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Yy(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function lz(){if(typeof EdgeRuntime=="string")return!0;if(!cz())return!1;if(Yy(pu.fetch))return!0;let e=!1;const t=pu.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Yy(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Ce&&be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function KC(e,t){const n="fetch";ti(n,e),ni(n,()=>ZC(void 0,t))}function uz(e){const t="fetch-body-resolved";ti(t,e),ni(t,()=>ZC(dz))}function ZC(e,t=!1){t&&!lz()||lr(at,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=hz(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:sn()*1e3,virtualError:i,headers:pz(s)};return e||Ur("fetch",{...f}),n.apply(at,s).then(async d=>(e?e(d):Ur("fetch",{...f,endTimestamp:sn()*1e3,response:d}),d),d=>{Ur("fetch",{...f,endTimestamp:sn()*1e3,error:d}),Vh(d)&&d.stack===void 0&&(d.stack=i.stack,Gn(d,"framesToPop",1));const g=gt()?.getOptions().enhanceFetchErrorMessages??"always";if(g!==!1&&d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{const x=new URL(f.fetchData.url).host;g==="always"?d.message=`${d.message} (${x})`:Gn(d,"__sentry_fetch_url_host__",x)}catch{}throw d})}})}async function fz(e,t){if(e?.body){const n=e.body,s=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let a=!0;for(;a;){let l;try{l=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await s.read();clearTimeout(l),f&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(l)}}clearTimeout(i),s.releaseLock(),n.cancel().then(null,()=>{})}}function dz(e){let t;try{t=e.clone()}catch{return}fz(t,()=>{Ur("fetch-body-resolved",{endTimestamp:sn()*1e3,response:e})})}function Kd(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Xw(e){return typeof e=="string"?e:e?Kd(e,"url")?e.url:e.toString?e.toString():"":""}function hz(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:Xw(n),method:Kd(s,"method")?String(s.method).toUpperCase():zv(n)&&Kd(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Xw(t),method:Kd(t,"method")?String(t.method).toUpperCase():"GET"}}function pz(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(zv(t))return new Headers(t.headers)}catch{}}function mz(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function gz(){return"npm"}function yz(){return!mz()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function vz(){return typeof window<"u"&&(!yz()||bz())}function bz(){return at.process?.type==="renderer"}const ct=at;let Xy=0;function YC(){return Xy>0}function xz(){Xy++,setTimeout(()=>{Xy--})}function Ec(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Lv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>Ec(l,t));return e.apply(this,a)}catch(a){throw xz(),ju(l=>{l.addEventProcessor(f=>(t.mechanism&&(Uy(f,void 0),bc(f,t.mechanism)),f.extra={...f.extra,arguments:i},f)),TC(a)}),a}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=e[i])}catch{}XR(s,e),Gn(e,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get(){return e.name}})}catch{}return s}function rb(){const e=Tu(),{referrer:t}=ct.document||{},{userAgent:n}=ct.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function sb(e,t){const n=ob(e,t),s={type:Tz(t),value:Rz(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function Sz(e,t,n,s){const a=gt()?.getOptions().normalizeDepth,l=Az(t),f={__serialized__:yC(t,a)};if(l)return{exception:{values:[sb(e,l)]},extra:f};const d={exception:{values:[{type:Kh(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:jz(t,{isUnhandledRejection:s})}]},extra:f};if(n){const h=ob(e,n);h.length&&(d.exception.values[0].stacktrace={frames:h})}return d}function Dg(e,t){return{exception:{values:[sb(e,t)]}}}function ob(e,t){const n=t.stacktrace||t.stack||"",s=wz(t),i=Ez(t);try{return e(n,s,i)}catch{}return[]}const _z=/Minified React error #\d+;/i;function wz(e){return e&&_z.test(e.message)?1:0}function Ez(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function XC(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Tz(e){const t=e?.name;return!t&&XC(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Rz(e){const t=e?.message;return XC(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Uw(t.error):Uw(e):"No error message"}function Cz(e,t,n,s){const i=n?.syntheticException||void 0,a=ib(e,t,i,s);return bc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Yh(a)}function Nz(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=Qy(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Yh(l)}function ib(e,t,n,s,i){let a;if(KR(t)&&t.error)return Dg(e,t.error);if(sw(t)||NM(t)){const l=t;if("stack"in t)a=Dg(e,t);else{const f=l.name||(sw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=Qy(e,d,n,s),Uy(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return Vh(t)?Dg(e,t):uu(t)||Kh(t)?(a=Sz(e,t,n,i),bc(a,{synthetic:!0}),a):(a=Qy(e,t,n,s),Uy(a,`${t}`),bc(a,{synthetic:!0}),a)}function Qy(e,t,n,s){const i={};if(s&&n){const a=ob(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),bc(i,{synthetic:!0})}if(Gh(t)){const{__sentry_template_string__:a,__sentry_template_values__:l}=t;return i.logentry={message:a,params:l},i}return i.message=t,i}function jz(e,{isUnhandledRejection:t}){const n=IM(e),s=t?"promise rejection":"exception";return KR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:Kh(e)?`Event \`${Oz(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function Oz(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Az(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class kz extends s2{constructor(t){const n=Mz(t),s=ct.SENTRY_SDK_SOURCE||gz();BC(n,"browser",["browser"],s),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:a,enableLogs:l,_experiments:f,enableMetrics:d}=this._options,h=d??f?.enableMetrics??!0;ct.document&&(a||l||h)&&ct.document.addEventListener("visibilitychange",()=>{ct.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),l&&Xv(this),h&&Wv(this))}),i&&this.on("beforeSendSession",y2)}eventFromException(t,n){return Cz(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return Nz(this._options.stackParser,t,n,s,this._options.attachStacktrace)}_prepareEvent(t,n,s,i){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,s,i)}}function Mz(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ct.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const ku=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke=at,Iz=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Mu=(e,t,n,s)=>{let i,a;return l=>{t.value>=0&&(l||s)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Iz(t.value,n),e(t)))}},Iu=(e=!0)=>{const t=Ke.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Fc=()=>Iu()?.activationStart??0;function Fo(e,t,n){Ke.document&&Ke.addEventListener(e,t,n)}function uh(e,t,n){Ke.document&&Ke.removeEventListener(e,t,n)}let cc=-1;const QC=new Set,Pz=()=>Ke.document?.visibilityState==="hidden"&&!Ke.document?.prerendering?0:1/0,Zd=e=>{if(zz(e)&&cc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of QC)t();isFinite(cc)||(cc=e.type==="visibilitychange"?e.timeStamp:0,uh("prerenderingchange",Zd,!0))}},Pu=()=>{if(Ke.document&&cc<0){const e=Fc();cc=(Ke.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??Pz(),Fo("visibilitychange",Zd,!0),Fo("pagehide",Zd,!0),Fo("prerenderingchange",Zd,!0)}return{get firstHiddenTime(){return cc},onHidden(e){QC.add(e)}}};function zz(e){return e.type==="pagehide"||Ke.document?.visibilityState==="hidden"}const Dz=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,zu=(e,t=-1)=>{const n=Iu();let s="navigate";return n&&(Ke.document?.prerendering||Fc()>0?s="prerender":Ke.document?.wasDiscarded?s="restore":n.type&&(s=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Dz(),navigationType:s}},Lg=new WeakMap;function ab(e,t){try{return Lg.get(e)||Lg.set(e,new t),Lg.get(e)}catch{return new t}}class fh{constructor(){fh.prototype.__init.call(this),fh.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],s=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&s&&t.startTime-s.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}}const Hc=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const s=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return s.observe({type:e,buffered:!0,...n}),s}}catch{}},cb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Xh=e=>{Ke.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Lz=[1800,3e3],Uz=(e,t={})=>{Xh(()=>{const n=Pu(),s=zu("FCP");let i;const l=Hc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Fc(),0),s.entries.push(d),i(!0)))});l&&(i=Mu(e,s,Lz,t.reportAllChanges))})},$z=[.1,.25],Bz=(e,t={})=>{Uz(cb(()=>{const n=zu("CLS",0);let s;const i=Pu(),a=ab(t,fh),l=d=>{for(const h of d)a._processEntry(h);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Hc("layout-shift",l);f&&(s=Mu(e,n,$z,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ke?.setTimeout?.(s))}))};let WC=0,Ug=1/0,gd=0;const Fz=e=>{e.forEach(t=>{t.interactionId&&(Ug=Math.min(Ug,t.interactionId),gd=Math.max(gd,t.interactionId),WC=gd?(gd-Ug)/7+1:0)})};let Wy;const JC=()=>Wy?WC:performance.interactionCount||0,Hz=()=>{"interactionCount"in performance||Wy||(Wy=Hc("event",Fz,{type:"event",buffered:!0,durationThreshold:0}))},$g=10;let e1=0;const qz=()=>JC()-e1;class dh{constructor(){dh.prototype.__init.call(this),dh.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){e1=JC(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(qz()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let s=this._longestInteractionMap.get(t.interactionId);if(s||this._longestInteractionList.length<$g||t.duration>n._latency){if(s?t.duration>s._latency?(s.entries=[t],s._latency=t.duration):t.duration===s._latency&&t.startTime===s.entries[0].startTime&&s.entries.push(t):(s={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(s.id,s),this._longestInteractionList.push(s)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>$g){const i=this._longestInteractionList.splice($g);for(const a of i)this._longestInteractionMap.delete(a.id)}this._onAfterProcessingINPCandidate?.(s)}}}const t1=e=>{const t=Ke.requestIdleCallback||Ke.setTimeout;Ke.document?.visibilityState==="hidden"?e():(e=cb(e),Fo("visibilitychange",e,{once:!0,capture:!0}),Fo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),uh("visibilitychange",e,{capture:!0}),uh("pagehide",e,{capture:!0})}))},Vz=[200,500],Gz=40,Kz=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Pu();Xh(()=>{Hz();const s=zu("INP");let i;const a=ab(t,dh),l=d=>{t1(()=>{for(const g of d)a._processEntry(g);const h=a._estimateP98LongestInteraction();h&&h._latency!==s.value&&(s.value=h._latency,s.entries=h.entries,i())})},f=Hc("event",l,{durationThreshold:t.durationThreshold??Gz});i=Mu(e,s,Vz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class Zz{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const Yz=[2500,4e3],Xz=(e,t={})=>{Xh(()=>{const n=Pu(),s=zu("LCP");let i;const a=ab(t,Zz),l=d=>{t.reportAllChanges||(d=d.slice(-1));for(const h of d)a._processEntry(h),h.startTime<n.firstHiddenTime&&(s.value=Math.max(h.startTime-Fc(),0),s.entries=[h],i())},f=Hc("largest-contentful-paint",l);if(f){i=Mu(e,s,Yz,t.reportAllChanges);const d=cb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),h=g=>{g.isTrusted&&(t1(d),uh(g.type,h,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Fo(g,h,{capture:!0})}})},Qz=[800,1800],Jy=e=>{Ke.document?.prerendering?Xh(()=>Jy(e)):Ke.document?.readyState!=="complete"?addEventListener("load",()=>Jy(e),!0):setTimeout(e)},Wz=(e,t={})=>{const n=zu("TTFB"),s=Mu(e,n,Qz,t.reportAllChanges);Jy(()=>{const i=Iu();i&&(n.value=Math.max(i.responseStart-Fc(),0),n.entries=[i],s(!0))})},ru={},hh={};let n1,r1,s1,o1;function i1(e,t=!1){return Qh("cls",e,tD,n1,t)}function a1(e,t=!1){return Qh("lcp",e,nD,r1,t)}function Jz(e){return Qh("ttfb",e,rD,s1)}function eD(e){return Qh("inp",e,sD,o1)}function Tc(e,t){return c1(e,t),hh[e]||(oD(e),hh[e]=!0),l1(e,t)}function Du(e,t){const n=ru[e];if(n?.length)for(const s of n)try{s(t)}catch(i){ku&&be.error(`Error while triggering instrumentation handler.
|
|
18
|
-
Type: ${e}
|
|
19
|
-
Name: ${Ks(s)}
|
|
20
|
-
Error:`,i)}}function tD(){return Bz(e=>{Du("cls",{metric:e}),n1=e},{reportAllChanges:!0})}function nD(){return Xz(e=>{Du("lcp",{metric:e}),r1=e},{reportAllChanges:!0})}function rD(){return Wz(e=>{Du("ttfb",{metric:e}),s1=e})}function sD(){return Kz(e=>{Du("inp",{metric:e}),o1=e})}function Qh(e,t,n,s,i=!1){c1(e,t);let a;return hh[e]||(a=n(),hh[e]=!0),s&&t({metric:s}),l1(e,t,i?a:void 0)}function oD(e){const t={};e==="event"&&(t.durationThreshold=0),Hc(e,n=>{Du(e,{entries:n})},t)}function c1(e,t){ru[e]=ru[e]||[],ru[e].push(t)}function l1(e,t,n){return()=>{n&&n();const s=ru[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function iD(e){return"duration"in e}const aD=e=>{const t=n=>{(n.type==="pagehide"||Ke.document?.visibilityState==="hidden")&&e(n)};Fo("visibilitychange",t,{capture:!0,once:!0}),Fo("pagehide",t,{capture:!0,once:!0})};function Bg(e){return typeof e=="number"&&isFinite(e)}function Zo(e,t,n,{...s}){const i=mt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Gv(e,()=>{const a=$c({startTime:t,...s});return a&&a.end(n),a})}function lb(e){const t=gt();if(!t)return;const{name:n,transaction:s,attributes:i,startTime:a}=e,{release:l,environment:f,sendDefaultPii:d}=t.getOptions(),g=t.getIntegrationByName("Replay")?.getReplayId(),v=yt(),b=v.getUser(),x=b!==void 0?b.email||b.id||b.ip_address:void 0;let S;try{S=v.getScopeData().contexts.profile.profile_id}catch{}const w={release:l,environment:f,user:x||void 0,profile_id:S||void 0,replay_id:g||void 0,transaction:s,"user_agent.original":Ke.navigator?.userAgent,"client.address":d?"{{auto}}":void 0,...i};return $c({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Lu(){return Ke.addEventListener&&Ke.performance}function Gt(e){return e/1e3}function cD(e){let t="unknown",n="unknown",s="";for(const i of e){if(i==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t=s==="h"?"http":s,n=e.split(s)[1];break}s+=i}return s===e&&(t=s),{name:t,version:n}}function u1(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function f1(e,t){let n,s=!1;function i(f){!s&&n&&t(f,n),s=!0}aD(()=>{i("pagehide")});const a=e.on("beforeStartNavigationSpan",(f,d)=>{d?.isRedirect||(i("navigation"),a(),l())}),l=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,l()})}function lD(e){let t=0,n;if(!u1("layout-shift"))return;const s=i1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);f1(e,(i,a)=>{uD(t,n,a,i),s()})}function uD(e,t,n,s){ku&&be.log(`Sending CLS span (${e})`);const i=t?Gt((pr()||0)+t.startTime):sn(),a=yt().getScopeData().transactionName,l=t?Br(t.sources[0]?.node):"Layout shift",f={[dn]:"auto.http.browser.cls",[Qs]:"ui.webvital.cls",[Lc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((h,g)=>{f[`cls.source.${g+1}`]=Br(h.node)});const d=lb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Ou]:"",[Au]:e}),d.end(i))}function fD(e){let t=0,n;if(!u1("largest-contentful-paint"))return;const s=a1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);f1(e,(i,a)=>{dD(t,n,a,i),s()})}function dD(e,t,n,s){ku&&be.log(`Sending LCP span (${e})`);const i=Gt((pr()||0)+(t?.startTime||0)),a=yt().getScopeData().transactionName,l=t?Br(t.element):"Largest contentful paint",f={[dn]:"auto.http.browser.lcp",[Qs]:"ui.webvital.lcp",[Lc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=Br(t.element)),t.id&&(f["lcp.id"]=t.id),t.url&&(f["lcp.url"]=t.url),t.loadTime!=null&&(f["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(f["lcp.renderTime"]=t.renderTime),t.size!=null&&(f["lcp.size"]=t.size));const d=lb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Ou]:"millisecond",[Au]:e}),d.end(i))}function jr(e){return e&&((pr()||performance.timeOrigin)+e)/1e3}function d1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=cD(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return pr()||Lu()?.timeOrigin?hD({...t,"http.request.redirect_start":jr(e.redirectStart),"http.request.redirect_end":jr(e.redirectEnd),"http.request.worker_start":jr(e.workerStart),"http.request.fetch_start":jr(e.fetchStart),"http.request.domain_lookup_start":jr(e.domainLookupStart),"http.request.domain_lookup_end":jr(e.domainLookupEnd),"http.request.connect_start":jr(e.connectStart),"http.request.secure_connection_start":jr(e.secureConnectionStart),"http.request.connection_end":jr(e.connectEnd),"http.request.request_start":jr(e.requestStart),"http.request.response_start":jr(e.responseStart),"http.request.response_end":jr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function hD(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const pD=2147483647;let Qw=0,Jr={},qn,ph;function mD({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Lu();if(s&&pr()){s.mark&&Ke.performance.mark("sentry-tracing-init");const i=t?fD(n):xD(),a=SD(),l=e?lD(n):bD();return()=>{i?.(),a(),l?.()}}return()=>{}}function gD(){Tc("longtask",({entries:e})=>{const t=Kn();if(!t)return;const{op:n,start_timestamp:s}=mt(t);for(const i of e){const a=Gt(pr()+i.startTime),l=Gt(i.duration);n==="navigation"&&s&&a<s||Zo(t,a,a+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[dn]:"auto.ui.browser.metrics"}})}})}function yD(){new PerformanceObserver(t=>{const n=Kn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Gt(pr()+s.startTime),{start_timestamp:a,op:l}=mt(n);if(l==="navigation"&&a&&i<a)continue;const f=Gt(s.duration),d={[dn]:"auto.ui.browser.metrics"},h=s.scripts[0],{invoker:g,invokerType:v,sourceURL:b,sourceFunctionName:x,sourceCharPosition:S}=h;d["browser.script.invoker"]=g,d["browser.script.invoker_type"]=v,b&&(d["code.filepath"]=b),x&&(d["code.function"]=x),S!==-1&&(d["browser.script.source_char_position"]=S),Zo(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function vD(){Tc("event",({entries:e})=>{const t=Kn();if(t){for(const n of e)if(n.name==="click"){const s=Gt(pr()+n.startTime),i=Gt(n.duration),a={name:Br(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[dn]:"auto.ui.browser.metrics"}},l=YR(n.target);l&&(a.attributes["ui.component_name"]=l),Zo(t,s,s+i,a)}}})}function bD(){return i1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Jr.cls={value:e.value,unit:""},ph=t)},!0)}function xD(){return a1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Jr.lcp={value:e.value,unit:"millisecond"},qn=t)},!0)}function SD(){return Jz(({metric:e})=>{e.entries[e.entries.length-1]&&(Jr.ttfb={value:e.value,unit:"millisecond"})})}function _D(e,t){const n=Lu(),s=pr();if(!n?.getEntries||!s)return;const i=Gt(s),a=n.getEntries(),{op:l,start_timestamp:f}=mt(e);a.slice(Qw).forEach(d=>{const h=Gt(d.startTime),g=Gt(Math.max(0,d.duration));if(!(l==="navigation"&&f&&i+h<f))switch(d.entryType){case"navigation":{RD(e,d,i);break}case"mark":case"paint":case"measure":{ED(e,d,h,g,i,t.ignorePerformanceApiSpans);const v=Pu(),b=d.startTime<v.firstHiddenTime;d.name==="first-paint"&&b&&(Jr.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(Jr.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{jD(e,d,d.name,h,g,i,t.ignoreResourceSpans);break}}}),Qw=Math.max(a.length-1,0),OD(e),l==="pageload"&&(MD(Jr),t.recordClsOnPageloadSpan||delete Jr.cls,t.recordLcpOnPageloadSpan||delete Jr.lcp,Object.entries(Jr).forEach(([d,h])=>{ZI(d,h.value,h.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Fc()),AD(e,t)),qn=void 0,ph=void 0,Jr={}}function wD(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function ED(e,t,n,s,i,a){if(wD(t)||["mark","measure"].includes(t.entryType)&&$o(t.name,a))return;const l=Iu(!1),f=Gt(l?l.requestStart:0),d=i+Math.max(n,f),h=i+n,g=h+s,v={[dn]:"auto.resource.browser.metrics"};d!==h&&(v["sentry.browser.measure_happened_before_request"]=!0,v["sentry.browser.measure_start_time"]=d),TD(v,t),d<=g&&Zo(e,d,g,{name:t.name,op:t.entryType,attributes:v})}function TD(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&vc(i))e[`sentry.browser.measure.detail.${s}`]=i;else if(i!==void 0)try{e[`sentry.browser.measure.detail.${s}`]=JSON.stringify(i)}catch{}return}if(vc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function RD(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{yd(e,t,s,n)}),yd(e,t,"secureConnection",n,"TLS/SSL"),yd(e,t,"fetch",n,"cache"),yd(e,t,"domainLookup",n,"DNS"),ND(e,t,n)}function yd(e,t,n,s,i=n){const a=CD(n),l=t[a],f=t[`${n}Start`];!f||!l||Zo(e,s+Gt(f),s+Gt(l),{op:`browser.${i}`,name:t.name,attributes:{[dn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function CD(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function ND(e,t,n){const s=n+Gt(t.requestStart),i=n+Gt(t.responseEnd),a=n+Gt(t.responseStart);t.responseEnd&&(Zo(e,s,i,{op:"browser.request",name:t.name,attributes:{[dn]:"auto.ui.browser.metrics"}}),Zo(e,a,i,{op:"browser.response",name:t.name,attributes:{[dn]:"auto.ui.browser.metrics"}}))}function jD(e,t,n,s,i,a,l){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(l?.includes(f))return;const d={[dn]:"auto.resource.browser.metrics"},h=Zi(n);h.protocol&&(d["url.scheme"]=h.protocol.split(":").pop()),h.host&&(d["server.address"]=h.host),d["url.same_origin"]=n.includes(Ke.location.origin),kD(t,d,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const g={...d,...d1(t)},v=a+s,b=v+i;Zo(e,v,b,{name:n.replace(Ke.location.origin,""),op:f,attributes:g})}function OD(e){const t=Ke.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Bg(n.rtt)&&(Jr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Bg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Bg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function AD(e,t){qn&&t.recordLcpOnPageloadSpan&&(qn.element&&e.setAttribute("lcp.element",Br(qn.element)),qn.id&&e.setAttribute("lcp.id",qn.id),qn.url&&e.setAttribute("lcp.url",qn.url.trim().slice(0,200)),qn.loadTime!=null&&e.setAttribute("lcp.loadTime",qn.loadTime),qn.renderTime!=null&&e.setAttribute("lcp.renderTime",qn.renderTime),e.setAttribute("lcp.size",qn.size)),ph?.sources&&t.recordClsOnPageloadSpan&&ph.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Br(n.node)))}function kD(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<pD||typeof a=="string")&&(t[i]=a)})}function MD(e){const t=Iu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function ID(){return Lu()&&pr()?Tc("element",PD):()=>{}}const PD=({entries:e})=>{const t=Kn(),n=t?In(t):void 0,s=n?mt(n).description:yt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const l=a.name,f=a.renderTime,d=a.loadTime,[h,g]=d?[Gt(d),"load-time"]:f?[Gt(f),"render-time"]:[sn(),"entry-emission"],v=l==="image-paint"?Gt(Math.max(0,(f??0)-(d??0))):0,b={[dn]:"auto.ui.browser.elementtiming",[Qs]:"ui.elementtiming",[ps]:"component","sentry.span_start_time_source":g,"sentry.transaction_name":s,"element.id":a.id,"element.type":a.element?.tagName?.toLowerCase()||"unknown","element.size":a.naturalWidth&&a.naturalHeight?`${a.naturalWidth}x${a.naturalHeight}`:void 0,"element.render_time":f,"element.load_time":d,"element.url":a.url||void 0,"element.identifier":a.identifier,"element.paint_type":l};xC({name:`element[${a.identifier}]`,attributes:b,startTime:h,onlyIfParent:!0},x=>{x.end(h+v)})})},zD=1e3;let Ww,ev,tv;function DD(e){ti("dom",e),ni("dom",LD)}function LD(){if(!Ke.document)return;const e=Ur.bind(null,"dom"),t=Jw(e,!0);Ke.document.addEventListener("click",t,!1),Ke.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Ke[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(lr(i,"addEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const h=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=h[l]=h[l]||{refCount:0};if(!g.handler){const v=Jw(e);g.handler=v,a.call(this,l,v,d)}g.refCount++}catch{}return a.call(this,l,f,d)}}),lr(i,"removeEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const h=this.__sentry_instrumentation_handlers__||{},g=h[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete h[l]),Object.keys(h).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,f,d)}}))})}function UD(e){if(e.type!==ev)return!1;try{if(!e.target||e.target._sentryId!==tv)return!1}catch{}return!0}function $D(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Jw(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=BD(n);if($D(n.type,s))return;Gn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Gn(s,"_sentryId",$r());const i=n.type==="keypress"?"input":n.type;UD(n)||(e({event:n,name:i,global:t}),ev=n.type,tv=s?s._sentryId:void 0),clearTimeout(Ww),Ww=Ke.setTimeout(()=>{tv=void 0,ev=void 0},zD)}}function BD(e){try{return e.target}catch{return null}}let vd;function ub(e){const t="history";ti(t,e),ni(t,FD)}function FD(){if(Ke.addEventListener("popstate",()=>{const t=Ke.location.href,n=vd;if(vd=t,n===t)return;Ur("history",{from:n,to:t})}),!az())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=vd,a=HD(String(s));if(vd=a,i===a)return t.apply(this,n);Ur("history",{from:i,to:a})}return t.apply(this,n)}}lr(Ke.history,"pushState",e),lr(Ke.history,"replaceState",e)}function HD(e){try{return new URL(e,Ke.location.origin).toString()}catch{return e}}const Yd={};function qD(e){const t=Yd[e];if(t)return t;let n=Ke[e];if(Yy(n))return Yd[e]=n.bind(Ke);const s=Ke.document;if(s&&typeof s.createElement=="function")try{const i=s.createElement("iframe");i.hidden=!0,s.head.appendChild(i);const a=i.contentWindow;a?.[e]&&(n=a[e]),s.head.removeChild(i)}catch(i){ku&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(Yd[e]=n.bind(Ke))}function VD(e){Yd[e]=void 0}const rc="__sentry_xhr_v3__";function h1(e){ti("xhr",e),ni("xhr",GD)}function GD(){if(!Ke.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=sn()*1e3,l=qs(s[0])?s[0].toUpperCase():void 0,f=KD(s[1]);if(!l||!f)return t.apply(n,s);n[rc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const h=n[rc];if(h&&n.readyState===4){try{h.status_code=n.status}catch{}const g={endTimestamp:sn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Ur("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(h,g,v){return d(),h.apply(g,v)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(h,g,v){const[b,x]=v,S=g[rc];return S&&qs(b)&&qs(x)&&(S.request_headers[b.toLowerCase()]=x),h.apply(g,v)}}),t.apply(n,s)}}),e.send=new Proxy(e.send,{apply(t,n,s){const i=n[rc];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:sn()*1e3,xhr:n};return Ur("xhr",a),t.apply(n,s)}})}function KD(e){if(qs(e))return e;try{return e.toString()}catch{}}function ZD(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return ku&&be.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
21
|
-
`).reduce((n,s)=>{const[i,a]=s.split(": ");return a&&(n[i.toLowerCase()]=a),n},{}):{}}const Fg=[],Xd=new Map,ec=new Map,YD=60;function XD(){if(Lu()&&pr()){const t=QD();return()=>{t()}}return()=>{}}const nv={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function QD(){return eD(WD)}const WD=({metric:e})=>{if(e.value==null)return;const t=Gt(e.value);if(t>YD)return;const n=e.entries.find(S=>S.duration===e.value&&nv[S.name]);if(!n)return;const{interactionId:s}=n,i=nv[n.name],a=Gt(pr()+n.startTime),l=Kn(),f=l?In(l):void 0,d=s!=null?Xd.get(s):void 0,h=d?.span||f,g=h?mt(h).description:yt().getScopeData().transactionName,v=d?.elementName||Br(n.target),b={[dn]:"auto.http.browser.inp",[Qs]:`ui.interaction.${i}`,[Lc]:n.duration},x=lb({name:v,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Ou]:"millisecond",[Au]:e.value}),x.end(a+t))};function JD(){const e=Object.keys(nv);vz()&&e.forEach(i=>{Ke.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Br(a),f=Math.round(i.timeStamp);if(ec.set(f,l),ec.size>50){const d=ec.keys().next().value;d!==void 0&&ec.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=ec.get(a);if(!l)for(let f=-5;f<=5;f++){const d=ec.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Kn(),l=a&&In(a);i.forEach(f=>{if(!iD(f))return;const d=f.interactionId;if(d==null||Xd.has(d))return;const h=f.target?Br(f.target):n(f);if(Fg.length>10){const g=Fg.shift();Xd.delete(g)}Fg.push(d),Xd.set(d,{span:l,elementName:h})})};Tc("event",s),Tc("first-input",s)}const eL=40;function tL(e,t=qD("fetch")){let n=0,s=0;async function i(a){const l=a.body.length;n+=l,s++;const f={body:a.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&s<15,...e.fetchOptions};try{const d=await t(e.url,f);return{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}}catch(d){throw VD("fetch"),d}finally{n-=l,s--}}return JP(e,i,tb(e.bufferSize||eL))}const Fr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,nL=30,rL=50;function rv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?Qi:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const sL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,oL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,iL=/\((\S*)(?::(\d+))(?::(\d+))\)/,aL=/at (.+?) ?\(data:(.+?),/,cL=e=>{const t=e.match(aL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=sL.exec(e);if(n){const[,i,a,l]=n;return rv(i,Qi,+a,+l)}const s=oL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=iL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=p1(s[1]||Qi,s[2]);return rv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},lL=[nL,cL],uL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,fL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,dL=e=>{const t=uL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=fL.exec(t[3]);a&&(t[1]=t[1]||"eval",t[3]=a[1],t[4]=a[2],t[5]="")}let s=t[3],i=t[1]||Qi;return[i,s]=p1(i,s),rv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},hL=[rL,dL],pL=[lL,hL],mL=FR(...pL),p1=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return n||s?[e.indexOf("@")!==-1?e.split("@")[0]:Qi,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},bd=1024,gL="Breadcrumbs",yL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:gL,setup(n){t.console&&z2(SL(n)),t.dom&&DD(xL(n,t.dom)),t.xhr&&h1(_L(n)),t.fetch&&KC(wL(n)),t.history&&ub(EL(n)),t.sentry&&n.on("beforeSendEvent",bL(n))}}}),vL=yL;function bL(e){return function(n){gt()===e&&Wi({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ui(n)},{event:n})}}function xL(e,t){return function(s){if(gt()!==e)return;let i,a,l=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>bd&&(Fr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${bd}, but a value of ${f} was configured. Sentry will use ${bd} instead.`),f=bd),typeof l=="string"&&(l=[l]);try{const h=s.event,g=TL(h)?h.target:h;i=Br(g,{keyAttrs:l,maxStringLength:f}),a=YR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),Wi(d,{event:s.event,name:s.name,global:s.global})}}function SL(e){return function(n){if(gt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:L2(n.level),message:aw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${aw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;Wi(s,{input:n.args,level:n.level})}}function _L(e){return function(n){if(gt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[rc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:h}=a,g={method:l,url:f,status_code:d},v={xhr:n.xhr,input:h,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:GC(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,v),Wi(b,v)}}function wL(e){return function(n){if(gt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const a=n.fetchData,l={data:n.error,input:n.args,startTimestamp:s,endTimestamp:i},f={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,l),Wi(f,l)}else{const a=n.response,l={...n.fetchData,status_code:a?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,a?.status;const f={input:n.args,response:a,startTimestamp:s,endTimestamp:i},d={category:"fetch",data:l,type:"http",level:GC(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),Wi(d,f)}}}function EL(e){return function(n){if(gt()!==e)return;let s=n.from,i=n.to;const a=Zi(ct.location.href);let l=s?Zi(s):void 0;const f=Zi(i);l?.path||(l=a),a.protocol===f.protocol&&a.host===f.host&&(i=f.relative),a.protocol===l.protocol&&a.host===l.host&&(s=l.relative),Wi({category:"navigation",data:{from:s,to:i}})}}function TL(e){return!!e&&!!e.target}const RL=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],CL="BrowserApiErrors",NL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:CL,setupOnce(){t.setTimeout&&lr(ct,"setTimeout",eE),t.setInterval&&lr(ct,"setInterval",eE),t.requestAnimationFrame&&lr(ct,"requestAnimationFrame",OL),t.XMLHttpRequest&&"XMLHttpRequest"in ct&&lr(XMLHttpRequest.prototype,"send",AL);const n=t.eventTarget;n&&(Array.isArray(n)?n:RL).forEach(i=>kL(i,t))}}}),jL=NL;function eE(e){return function(...t){const n=t[0];return t[0]=Ec(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Ks(e)}`}}),e.apply(this,t)}}function OL(e){return function(t){return e.apply(this,[Ec(t,{mechanism:{data:{handler:Ks(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function AL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&lr(n,i,function(a){const l={mechanism:{data:{handler:Ks(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Lv(a);return f&&(l.mechanism.data.handler=Ks(f)),Ec(a,l)})}),e.apply(this,t)}}function kL(e,t){const s=ct[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(lr(s,"addEventListener",function(i){return function(a,l,f){try{ML(l)&&(l.handleEvent=Ec(l.handleEvent,{mechanism:{data:{handler:Ks(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&IL(this,a,l),i.apply(this,[a,Ec(l,{mechanism:{data:{handler:Ks(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),lr(s,"removeEventListener",function(i){return function(a,l,f){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,f)}catch{}return i.call(this,a,l,f)}}))}function ML(e){return typeof e.handleEvent=="function"}function IL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const PL=()=>({name:"BrowserSession",setupOnce(){if(typeof ct.document>"u"){Fr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Nw({ignoreDuration:!0}),jw(),ub(({from:e,to:t})=>{e!==void 0&&e!==t&&(Nw({ignoreDuration:!0}),jw())})}}),zL="GlobalHandlers",DL=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:zL,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(UL(n),tE("onerror")),t.onunhandledrejection&&($L(n),tE("onunhandledrejection"))}}}),LL=DL;function UL(e){qR(t=>{const{stackParser:n,attachStacktrace:s}=m1();if(gt()!==e||YC())return;const{msg:i,url:a,line:l,column:f,error:d}=t,h=HL(ib(n,d||i,void 0,s,!1),a,l,f);h.level="error",RC(h,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function $L(e){VR(t=>{const{stackParser:n,attachStacktrace:s}=m1();if(gt()!==e||YC())return;const i=BL(t),a=vc(i)?FL(i):ib(n,i,void 0,s,!0);a.level="error",RC(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function BL(e){if(vc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function FL(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function HL(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],l=a[0]=a[0]||{},f=l.stacktrace=l.stacktrace||{},d=f.frames=f.frames||[],h=s,g=n,v=qL(t)??Tu();return d.length===0&&d.push({colno:h,filename:v,function:Qi,in_app:!0,lineno:g}),e}function tE(e){Fr&&be.log(`Global Handler attached: ${e}`)}function m1(){return gt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function qL(e){if(!(!qs(e)||e.length===0))return e.startsWith("data:")?`<${Bo(e,!1)}>`:e}const VL=()=>({name:"HttpContext",preprocessEvent(e){if(!ct.navigator&&!ct.location&&!ct.document)return;const t=rb(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),GL="cause",KL=5,ZL="LinkedErrors",YL=((e={})=>{const t=e.limit||KL,n=e.key||GL;return{name:ZL,preprocessEvent(s,i,a){const l=a.getOptions();P2(sb,l.stackParser,n,t,s,i)}}}),XL=YL;function QL(){return WL()?(Fr&&ia(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function WL(){if(typeof ct.window>"u")return!1;const e=ct;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Tu(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(ct===ct.top&&s.some(a=>n.startsWith(`${a}://`)))}function JL(e){return[C2(),w2(),K2(),jL(),vL(),LL(),XL(),B2(),VL(),PL()]}function e4(e={}){const t=!e.skipBrowserExtensionCheck&&QL();let n=e.defaultIntegrations==null?JL():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:EM(e.stackParser||mL),integrations:OP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||tL};return u2(kz,s)}function t4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function g1(e){try{return new URL(e,ct.location.origin).href}catch{return}}function n4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function y1(e){try{return new Headers(e)}catch{return}}const nE=new WeakMap,Hg=new Map,v1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function r4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:h}={...v1,...t},g=typeof a=="function"?a:S=>!0,v=S=>s4(S,f),b={},x=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(S=>(S.type==="transaction"&&S.spans&&S.spans.forEach(w=>{if(w.op==="http.client"){const T=Hg.get(w.span_id);T&&(w.timestamp=T/1e3,Hg.delete(w.span_id))}}),S)),i&&uz(S=>{if(S.response){const w=nE.get(S.response);w&&S.endTimestamp&&Hg.set(w,S.endTimestamp)}}),KC(S=>{const w=Z2(S,g,v,b,{propagateTraceparent:x,onRequestSpanEnd:h});if(S.response&&S.fetchData.__span&&nE.set(S.response,S.fetchData.__span),w){const T=g1(S.fetchData.url),R=T?Zi(T).host:void 0;w.setAttributes({"http.url":T?Bo(T):void 0,"server.address":R}),l&&rE(w),d?.(w,{headers:S.headers})}})),s&&h1(S=>{const w=o4(S,g,v,b,x,h);w&&(l&&rE(w),d?.(w,{headers:y1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function rE(e){const{url:t}=mt(e).data;if(!t||typeof t!="string")return;const n=Tc("resource",({entries:s})=>{s.forEach(i=>{n4(i)&&i.name.endsWith(t)&&(e.setAttributes(d1(i)),setTimeout(n))})})}function s4(e,t){const n=Tu();if(n){let s,i;try{s=new URL(e,n),i=new URL(n).origin}catch{return!1}const a=s.origin===i;return t?$o(s.toString(),t)||a&&$o(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?$o(e,t):s}}function o4(e,t,n,s,i,a){const l=e.xhr,f=l?.[rc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:h}=f,g=ns()&&t(d);if(e.endTimestamp&&g){const R=l.__sentry_xhr_span_id__;if(!R)return;const k=s[R];k&&f.status_code!==void 0&&(nC(k,f.status_code),k.end(),a?.(k,{headers:y1(ZD(l)),error:e.error}),delete s[R]);return}const v=g1(d),b=Zi(v||d),x=Bo(p2(d)),S=!!Kn(),w=g&&S?$c({name:`${h} ${x}`,attributes:{url:Bo(d),type:"xhr","http.method":h,"http.url":v?Bo(v):void 0,"server.address":b?.host,[dn]:"auto.http.browser",[Qs]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new Ko;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&i4(l,ns()&&S?w:void 0,i);const T=gt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function i4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=FC({span:t,propagateTraceparent:n});s&&a4(e,s,i,a)}function a4(e,t,n,s){const i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),s&&!i?.traceparent&&e.setRequestHeader("traceparent",s),n){const a=i?.baggage;(!a||!t4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function c4(){ct.document?ct.document.addEventListener("visibilitychange",()=>{const e=Kn();if(!e)return;const t=In(e);if(ct.document.hidden&&t){const n="cancelled",{op:s,status:i}=mt(t);Fr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:un,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Fr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const l4=3600,b1="sentry_previous_trace",u4="sentry.previous_trace";function f4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?p4():void 0;e.on("spanStart",l=>{if(In(l)!==l)return;const f=yt().getPropagationContext();i=d4(i,l,f),s&&h4(i)});let a=!0;n&&e.on("beforeSampling",l=>{if(!i)return;const f=yt(),d=f.getPropagationContext();if(a&&d.parentSpanId){a=!1;return}f.setPropagationContext({...d,dsc:{...d.dsc,sample_rate:String(i.sampleRate),sampled:String(sv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=sv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[tC]:i.sampleRate}})}function d4(e,t,n){const s=mt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Uv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=l4&&(Fr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[QM]:"previous_trace"}}),t.setAttribute(u4,`${l.traceId}-${l.spanId}-${sv(l)?1:0}`)),a)}function h4(e){try{ct.sessionStorage.setItem(b1,JSON.stringify(e))}catch(t){Fr&&be.warn("Could not store previous trace in sessionStorage",t)}}function p4(){try{const e=ct.sessionStorage?.getItem(b1);return JSON.parse(e)}catch{return}}function sv(e){return e.traceFlags===1}const m4="BrowserTracing",g4={...Vd,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...v1},y4=((e={})=>{const t={name:void 0,source:void 0},n=ct.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:h},beforeStartSpan:g,idleTimeout:v,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:R,shouldCreateSpanForRequest:k,enableHTTPTimings:j,ignoreResourceSpans:C,ignorePerformanceApiSpans:I,instrumentPageLoad:D,instrumentNavigation:N,detectRedirects:A,linkPreviousTrace:z,consistentTraceSampling:X,enableReportPageLoaded:q,onRequestSpanStart:L,onRequestSpanEnd:Z}={...g4,...e};let G,te,P;function V(U,F,H=!0){const M=F.op==="pageload",K=F.name,W=g?g(F):F,Y=W.attributes||{};if(K!==W.name&&(Y[ps]="custom",W.attributes=Y),!H){const ce=aa();$c({...W,startTime:ce}).end(ce);return}t.name=W.name,t.source=Y[ps];const le=EC(W,{idleTimeout:v,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:M,beforeSpanEnd:ce=>{G?.(),_D(ce,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!h,ignoreResourceSpans:C,ignorePerformanceApiSpans:I}),oE(U,void 0);const Se=yt(),ge=Se.getPropagationContext();Se.setPropagationContext({...ge,traceId:le.spanContext().traceId,sampled:ri(le),dsc:Ws(ce)}),M&&(P=void 0)},trimIdleSpanEndTimestamp:!q});M&&q&&(P=le),oE(U,le);function ie(){n&&["interactive","complete"].includes(n.readyState)&&U.emit("idleSpanEnableAutoFinish",le)}M&&!q&&n&&(n.addEventListener("readystatechange",()=>{ie()}),ie())}return{name:m4,setup(U){if(RI(),G=mD({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:h||!1,client:U}),s&&XD(),i&&ID(),l&&at.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?yD():a&&gD(),f&&vD(),A&&n){const H=()=>{te=sn()};addEventListener("click",H,{capture:!0}),addEventListener("keydown",H,{capture:!0,passive:!0})}function F(){const H=mu(U);H&&!mt(H).timestamp&&(Fr&&be.log(`[Tracing] Finishing current active span with op: ${mt(H).op}`),H.setAttribute(fu,"cancelled"),H.end())}U.on("startNavigationSpan",(H,M)=>{if(gt()!==U)return;if(M?.isRedirect){Fr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),V(U,{op:"navigation.redirect",...H},!1);return}te=void 0,F(),rs().setPropagationContext({traceId:Ys(),sampleRand:Math.random(),propagationSpanId:ns()?void 0:Vs()});const K=yt();K.setPropagationContext({traceId:Ys(),sampleRand:Math.random(),propagationSpanId:ns()?void 0:Vs()}),K.setSDKProcessingMetadata({normalizedRequest:void 0}),V(U,{op:"navigation",...H,parentSpan:null,forceTransaction:!0})}),U.on("startPageLoadSpan",(H,M={})=>{if(gt()!==U)return;F();const K=M.sentryTrace||sE("sentry-trace"),W=M.baggage||sE("baggage"),Y=vI(K,W),le=yt();le.setPropagationContext(Y),ns()||(le.getPropagationContext().propagationSpanId=Vs()),le.setSDKProcessingMetadata({normalizedRequest:rb()}),V(U,{op:"pageload",...H})}),U.on("endPageloadSpan",()=>{q&&P&&(P.setAttribute(fu,"reportPageLoaded"),P.end())})},afterAllSetup(U){let F=Tu();if(z!=="off"&&f4(U,{linkPreviousTrace:z,consistentTraceSampling:X}),ct.location){if(D){const H=pr();v4(U,{name:ct.location.pathname,startTime:H?H/1e3:void 0,attributes:{[ps]:"url",[dn]:"auto.pageload.browser"}})}N&&ub(({to:H,from:M})=>{if(M===void 0&&F?.indexOf(H)!==-1){F=void 0;return}F=void 0;const K=$C(H),W=mu(U),Y=W&&A&&S4(W,te);b4(U,{name:K?.pathname||ct.location.pathname,attributes:{[ps]:"url",[dn]:"auto.navigation.browser"}},{url:H,isRedirect:Y})})}S&&c4(),f&&x4(U,v,b,x,t),s&&JD(),r4(U,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:R,tracePropagationTargets:U.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:k,enableHTTPTimings:j,onRequestSpanStart:L,onRequestSpanEnd:Z})}}});function v4(e,t,n){e.emit("startPageLoadSpan",t,n),yt().setTransactionName(t.name);const s=mu(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function b4(e,t,n){const{url:s,isRedirect:i}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const a=yt();return a.setTransactionName(t.name),s&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...rb(),url:s}}),mu(e)}function sE(e){return ct.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function x4(e,t,n,s,i){const a=ct.document;let l;const f=()=>{const d="ui.action.click",h=mu(e);if(h){const g=mt(h).op;if(["navigation","pageload"].includes(g)){Fr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(fu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Fr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=EC({name:i.name,op:d,attributes:{[ps]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const x1="_sentry_idleSpan";function mu(e){return e[x1]}function oE(e,t){Gn(e,x1,t)}const iE=1.5;function S4(e,t){const n=mt(e),s=aa(),i=n.start_timestamp;return!(s-i>iE||t&&s-t<=iE)}function S1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qg={exports:{}},Ge={};var aE;function _4(){if(aE)return Ge;aE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function R(M,K,W){this.props=M,this.context=K,this.refs=T,this.updater=W||S}R.prototype.isReactComponent={},R.prototype.setState=function(M,K){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,K,"setState")},R.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=R.prototype;function j(M,K,W){this.props=M,this.context=K,this.refs=T,this.updater=W||S}var C=j.prototype=new k;C.constructor=j,w(C,R.prototype),C.isPureReactComponent=!0;var I=Array.isArray;function D(){}var N={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function z(M,K,W){var Y=W.ref;return{$$typeof:e,type:M,key:K,ref:Y!==void 0?Y:null,props:W}}function X(M,K){return z(M.type,K,M.props)}function q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function L(M){var K={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(W){return K[W]})}var Z=/\/+/g;function G(M,K){return typeof M=="object"&&M!==null&&M.key!=null?L(""+M.key):K.toString(36)}function te(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(D,D):(M.status="pending",M.then(function(K){M.status==="pending"&&(M.status="fulfilled",M.value=K)},function(K){M.status==="pending"&&(M.status="rejected",M.reason=K)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function P(M,K,W,Y,le){var ie=typeof M;(ie==="undefined"||ie==="boolean")&&(M=null);var ce=!1;if(M===null)ce=!0;else switch(ie){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(M.$$typeof){case e:case t:ce=!0;break;case g:return ce=M._init,P(ce(M._payload),K,W,Y,le)}}if(ce)return le=le(M),ce=Y===""?"."+G(M,0):Y,I(le)?(W="",ce!=null&&(W=ce.replace(Z,"$&/")+"/"),P(le,K,W,"",function($e){return $e})):le!=null&&(q(le)&&(le=X(le,W+(le.key==null||M&&M.key===le.key?"":(""+le.key).replace(Z,"$&/")+"/")+ce)),K.push(le)),1;ce=0;var Se=Y===""?".":Y+":";if(I(M))for(var ge=0;ge<M.length;ge++)Y=M[ge],ie=Se+G(Y,ge),ce+=P(Y,K,W,ie,le);else if(ge=x(M),typeof ge=="function")for(M=ge.call(M),ge=0;!(Y=M.next()).done;)Y=Y.value,ie=Se+G(Y,ge++),ce+=P(Y,K,W,ie,le);else if(ie==="object"){if(typeof M.then=="function")return P(te(M),K,W,Y,le);throw K=String(M),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ce}function V(M,K,W){if(M==null)return M;var Y=[],le=0;return P(M,Y,"","",function(ie){return K.call(W,ie,le++)}),Y}function U(M){if(M._status===-1){var K=M._result;K=K(),K.then(function(W){(M._status===0||M._status===-1)&&(M._status=1,M._result=W)},function(W){(M._status===0||M._status===-1)&&(M._status=2,M._result=W)}),M._status===-1&&(M._status=0,M._result=K)}if(M._status===1)return M._result.default;throw M._result}var F=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},H={map:V,forEach:function(M,K,W){V(M,function(){K.apply(this,arguments)},W)},count:function(M){var K=0;return V(M,function(){K++}),K},toArray:function(M){return V(M,function(K){return K})||[]},only:function(M){if(!q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Ge.Activity=v,Ge.Children=H,Ge.Component=R,Ge.Fragment=n,Ge.Profiler=i,Ge.PureComponent=j,Ge.StrictMode=s,Ge.Suspense=d,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},Ge.cache=function(M){return function(){return M.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(M,K,W){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var Y=w({},M.props),le=M.key;if(K!=null)for(ie in K.key!==void 0&&(le=""+K.key),K)!A.call(K,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&K.ref===void 0||(Y[ie]=K[ie]);var ie=arguments.length-2;if(ie===1)Y.children=W;else if(1<ie){for(var ce=Array(ie),Se=0;Se<ie;Se++)ce[Se]=arguments[Se+2];Y.children=ce}return z(M.type,le,Y)},Ge.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:a,_context:M},M},Ge.createElement=function(M,K,W){var Y,le={},ie=null;if(K!=null)for(Y in K.key!==void 0&&(ie=""+K.key),K)A.call(K,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(le[Y]=K[Y]);var ce=arguments.length-2;if(ce===1)le.children=W;else if(1<ce){for(var Se=Array(ce),ge=0;ge<ce;ge++)Se[ge]=arguments[ge+2];le.children=Se}if(M&&M.defaultProps)for(Y in ce=M.defaultProps,ce)le[Y]===void 0&&(le[Y]=ce[Y]);return z(M,ie,le)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(M){return{$$typeof:f,render:M}},Ge.isValidElement=q,Ge.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:U}},Ge.memo=function(M,K){return{$$typeof:h,type:M,compare:K===void 0?null:K}},Ge.startTransition=function(M){var K=N.T,W={};N.T=W;try{var Y=M(),le=N.S;le!==null&&le(W,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(D,F)}catch(ie){F(ie)}finally{K!==null&&W.types!==null&&(K.types=W.types),N.T=K}},Ge.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Ge.use=function(M){return N.H.use(M)},Ge.useActionState=function(M,K,W){return N.H.useActionState(M,K,W)},Ge.useCallback=function(M,K){return N.H.useCallback(M,K)},Ge.useContext=function(M){return N.H.useContext(M)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(M,K){return N.H.useDeferredValue(M,K)},Ge.useEffect=function(M,K){return N.H.useEffect(M,K)},Ge.useEffectEvent=function(M){return N.H.useEffectEvent(M)},Ge.useId=function(){return N.H.useId()},Ge.useImperativeHandle=function(M,K,W){return N.H.useImperativeHandle(M,K,W)},Ge.useInsertionEffect=function(M,K){return N.H.useInsertionEffect(M,K)},Ge.useLayoutEffect=function(M,K){return N.H.useLayoutEffect(M,K)},Ge.useMemo=function(M,K){return N.H.useMemo(M,K)},Ge.useOptimistic=function(M,K){return N.H.useOptimistic(M,K)},Ge.useReducer=function(M,K,W){return N.H.useReducer(M,K,W)},Ge.useRef=function(M){return N.H.useRef(M)},Ge.useState=function(M){return N.H.useState(M)},Ge.useSyncExternalStore=function(M,K,W){return N.H.useSyncExternalStore(M,K,W)},Ge.useTransition=function(){return N.H.useTransition()},Ge.version="19.2.4",Ge}var cE;function Uu(){return cE||(cE=1,qg.exports=_4()),qg.exports}var _=Uu();const Rc=S1(_),_1=gM({__proto__:null,default:Rc},[_]);function w4(e){const t={...e};return BC(t,"react"),_P("react",{version:_.version}),e4(t)}function fe(e,t,n){function s(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const h=l.prototype,g=Object.keys(h);for(let v=0;v<g.length;v++){const b=g[v];b in f||(f[b]=h[b].bind(f))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(f){var d;const h=n?.Parent?new a:this;s(h,f),(d=h._zod).deferred??(d.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(l,"init",{value:s}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class lc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const E1={};function Yo(e){return E1}function T1(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function ov(e,t){return typeof t=="bigint"?t.toString():t}function fb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function db(e){return e==null}function hb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function E4(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const d=s.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,l=Number.parseInt(e.toFixed(a).replace(".","")),f=Number.parseInt(t.toFixed(a).replace(".",""));return l%f/10**a}const lE=Symbol("evaluating");function St(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==lE)return s===void 0&&(s=lE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function la(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function si(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function uE(e){return JSON.stringify(e)}function T4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const R1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const R4=fb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Cc(e){if(mh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(mh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function C1(e){return Cc(e)?{...e}:Array.isArray(e)?[...e]:e}const C4=new Set(["string","number","symbol"]);function Nc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oi(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function Pe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function N4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const j4={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 O4(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=si(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return la(this,"shape",l),l},checks:[]});return oi(e,a)}function A4(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=si(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return la(this,"shape",l),l},checks:[]});return oi(e,a)}function k4(e,t){if(!Cc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=si(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return la(this,"shape",a),a}});return oi(e,i)}function M4(e,t){if(!Cc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=si(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return la(this,"shape",s),s}});return oi(e,n)}function I4(e,t){const n=si(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return la(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return oi(e,n)}function P4(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=si(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)d[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return la(this,"shape",d),d},checks:[]});return oi(t,l)}function z4(e,t,n){const s=si(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return la(this,"shape",a),a}});return oi(t,s)}function sc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function oc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function xd(e){return typeof e=="string"?e:e?.message}function Xo(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=xd(e.inst?._zod.def?.error?.(e))??xd(t?.error?.(e))??xd(n.customError?.(e))??xd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function pb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const N1=(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,ov,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},j1=fe("$ZodError",N1),O1=fe("$ZodError",N1,{Parent:Error});function D4(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function L4(e,t=n=>n.message){const n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>s({issues:l}));else if(a.code==="invalid_key")s({issues:a.issues});else if(a.code==="invalid_element")s({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let l=n,f=0;for(;f<a.path.length;){const d=a.path[f];f===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return s(e),n}const mb=e=>(t,n,s,i)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new lc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>Xo(d,a,Yo())));throw R1(f,i?.callee),f}return l.value},gb=e=>async(t,n,s,i)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>Xo(d,a,Yo())));throw R1(f,i?.callee),f}return l.value},Wh=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new lc;return a.issues.length?{success:!1,error:new(e??j1)(a.issues.map(l=>Xo(l,i,Yo())))}:{success:!0,data:a.value}},U4=Wh(O1),Jh=e=>async(t,n,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(l=>Xo(l,i,Yo())))}:{success:!0,data:a.value}},$4=Jh(O1),B4=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return mb(e)(t,n,i)},F4=e=>(t,n,s)=>mb(e)(t,n,s),H4=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return gb(e)(t,n,i)},q4=e=>async(t,n,s)=>gb(e)(t,n,s),V4=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Wh(e)(t,n,i)},G4=e=>(t,n,s)=>Wh(e)(t,n,s),K4=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Jh(e)(t,n,i)},Z4=e=>async(t,n,s)=>Jh(e)(t,n,s),Y4=/^[cC][^\s-]{8,}$/,X4=/^[0-9a-z]+$/,Q4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,W4=/^[0-9a-vA-V]{20}$/,J4=/^[A-Za-z0-9]{27}$/,e5=/^[a-zA-Z0-9_-]{21}$/,t5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,n5=/^([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})$/,fE=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)$/,r5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o5(){return new RegExp(s5,"u")}const i5=/^(?:(?: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])$/,a5=/^(([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}|:))$/,c5=/^((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])$/,l5=/^(([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])$/,u5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,A1=/^[A-Za-z0-9_-]*$/,f5=/^\+[1-9]\d{6,14}$/,k1="(?:(?:\\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])))",d5=new RegExp(`^${k1}$`);function M1(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function h5(e){return new RegExp(`^${M1(e)}$`)}function p5(e){const t=M1({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${k1}T(?:${s})$`)}const m5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},g5=/^-?\d+$/,I1=/^-?\d+(?:\.\d+)?$/,y5=/^(?:true|false)$/i,v5=/^[^A-Z]*$/,b5=/^[^a-z]*$/,Zn=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),P1={number:"number",bigint:"bigint",object:"date"},z1=fe("$ZodCheckLessThan",(e,t)=>{Zn.init(e,t);const n=P1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),D1=fe("$ZodCheckGreaterThan",(e,t)=>{Zn.init(e,t);const n=P1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),x5=fe("$ZodCheckMultipleOf",(e,t)=>{Zn.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.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.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):E4(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),S5=fe("$ZodCheckNumberFormat",(e,t)=>{Zn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=j4[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=g5)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):l.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}f<i&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),_5=fe("$ZodCheckMaxLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!db(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const l=pb(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),w5=fe("$ZodCheckMinLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!db(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const l=pb(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),E5=fe("$ZodCheckLengthEquals",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!db(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,a=i.length;if(a===t.length)return;const l=pb(i),f=a>t.length;s.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),ep=fe("$ZodCheckStringFormat",(e,t)=>{var n,s;Zn.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),T5=fe("$ZodCheckRegex",(e,t)=>{ep.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})}}),R5=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=v5),ep.init(e,t)}),C5=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=b5),ep.init(e,t)}),N5=fe("$ZodCheckIncludes",(e,t)=>{Zn.init(e,t);const n=Nc(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),j5=fe("$ZodCheckStartsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`^${Nc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),O5=fe("$ZodCheckEndsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`.*${Nc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),A5=fe("$ZodCheckOverwrite",(e,t)=>{Zn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class k5{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
|
|
22
|
-
`).filter(l=>l),i=Math.min(...s.map(l=>l.length-l.trimStart().length)),a=s.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
23
|
-
`))}}const M5={major:4,minor:3,patch:6},Lt=fe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=M5;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const i of s)for(const a of i._zod.onattach)a(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,f,d)=>{let h=sc(l),g;for(const v of f){if(v._zod.def.when){if(!v._zod.def.when(l))continue}else if(h)continue;const b=l.issues.length,x=v._zod.check(l);if(x instanceof Promise&&d?.async===!1)throw new lc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(h||(h=sc(l,b)))});else{if(l.issues.length===b)continue;h||(h=sc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(sc(l))return l.aborted=!0,l;const h=i(f,s,d);if(h instanceof Promise){if(d.async===!1)throw new lc;return h.then(g=>e._zod.parse(g,d))}return e._zod.parse(h,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return h instanceof Promise?h.then(g=>a(g,l,f)):a(h,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new lc;return d.then(h=>i(h,s,f))}return i(d,s,f)}}St(e,"~standard",()=>({validate:i=>{try{const a=U4(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return $4(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),yb=fe("$ZodString",(e,t)=>{Lt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??m5(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),zt=fe("$ZodStringFormat",(e,t)=>{ep.init(e,t),yb.init(e,t)}),I5=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=n5),zt.init(e,t)}),P5=fe("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fE(s))}else t.pattern??(t.pattern=fE());zt.init(e,t)}),z5=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=r5),zt.init(e,t)}),D5=fe("$ZodURL",(e,t)=>{zt.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),L5=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o5()),zt.init(e,t)}),U5=fe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=e5),zt.init(e,t)}),$5=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Y4),zt.init(e,t)}),B5=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=X4),zt.init(e,t)}),F5=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Q4),zt.init(e,t)}),H5=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=W4),zt.init(e,t)}),q5=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=J4),zt.init(e,t)}),V5=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=p5(t)),zt.init(e,t)}),G5=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=d5),zt.init(e,t)}),K5=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=h5(t)),zt.init(e,t)}),Z5=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=t5),zt.init(e,t)}),Y5=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=i5),zt.init(e,t),e._zod.bag.format="ipv4"}),X5=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=a5),zt.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})}}}),Q5=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=c5),zt.init(e,t)}),W5=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=l5),zt.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[i,a]=s;if(!a)throw new Error;const l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function L1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const J5=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=u5),zt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{L1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function eU(e){if(!A1.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return L1(n)}const tU=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=A1),zt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{eU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),nU=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=f5),zt.init(e,t)});function rU(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const sU=fe("$ZodJWT",(e,t)=>{zt.init(e,t),e._zod.check=n=>{rU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),U1=fe("$ZodNumber",(e,t)=>{Lt.init(e,t),e._zod.pattern=e._zod.bag.pattern??I1,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),oU=fe("$ZodNumberFormat",(e,t)=>{S5.init(e,t),U1.init(e,t)}),iU=fe("$ZodBoolean",(e,t)=>{Lt.init(e,t),e._zod.pattern=y5,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),aU=fe("$ZodUnknown",(e,t)=>{Lt.init(e,t),e._zod.parse=n=>n}),cU=fe("$ZodNever",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dE(e,t,n){e.issues.length&&t.issues.push(...oc(n,e.issues)),t.value[n]=e.value}const lU=fe("$ZodArray",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let l=0;l<i.length;l++){const f=i[l],d=t.element._zod.run({value:f,issues:[]},s);d instanceof Promise?a.push(d.then(h=>dE(h,n,l))):dE(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function gh(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...oc(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function $1(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const n=N4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function B1(e,t,n,s,i,a){const l=[],f=i.keySet,d=i.catchall._zod,h=d.def.type,g=d.optout==="optional";for(const v in t){if(f.has(v))continue;if(h==="never"){l.push(v);continue}const b=d.run({value:t[v],issues:[]},s);b instanceof Promise?e.push(b.then(x=>gh(x,n,v,t,g))):gh(b,n,v,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const uU=fe("$ZodObject",(e,t)=>{if(Lt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...f};return Object.defineProperty(t,"shape",{value:d}),d}})}const s=fb(()=>$1(t));St(e._zod,"propValues",()=>{const f=t.shape,d={};for(const h in f){const g=f[h]._zod;if(g.values){d[h]??(d[h]=new Set);for(const v of g.values)d[h].add(v)}}return d});const i=mh,a=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=s.value);const h=f.value;if(!i(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const g=[],v=l.shape;for(const b of l.keys){const x=v[b],S=x._zod.optout==="optional",w=x._zod.run({value:h[b],issues:[]},d);w instanceof Promise?g.push(w.then(T=>gh(T,f,b,h,S))):gh(w,f,b,h,S)}return a?B1(g,h,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),fU=fe("$ZodObjectJIT",(e,t)=>{uU.init(e,t);const n=e._zod.parse,s=fb(()=>$1(t)),i=b=>{const x=new k5(["shape","payload","ctx"]),S=s.value,w=j=>{const C=uE(j);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};x.write("const input = payload.value;");const T=Object.create(null);let R=0;for(const j of S.keys)T[j]=`key_${R++}`;x.write("const newResult = {};");for(const j of S.keys){const C=T[j],I=uE(j),N=b[j]?._zod?.optout==="optional";x.write(`const ${C} = ${w(j)};`),N?x.write(`
|
|
24
|
-
if (${C}.issues.length) {
|
|
25
|
-
if (${I} in input) {
|
|
26
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
27
|
-
...iss,
|
|
28
|
-
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
29
|
-
})));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (${C}.value === undefined) {
|
|
34
|
-
if (${I} in input) {
|
|
35
|
-
newResult[${I}] = undefined;
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
newResult[${I}] = ${C}.value;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
`):x.write(`
|
|
42
|
-
if (${C}.issues.length) {
|
|
43
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
44
|
-
...iss,
|
|
45
|
-
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
46
|
-
})));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (${C}.value === undefined) {
|
|
50
|
-
if (${I} in input) {
|
|
51
|
-
newResult[${I}] = undefined;
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
newResult[${I}] = ${C}.value;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");const k=x.compile();return(j,C)=>k(b,j,C)};let a;const l=mh,f=!E1.jitless,h=f&&R4.value,g=t.catchall;let v;e._zod.parse=(b,x)=>{v??(v=s.value);const S=b.value;return l(S)?f&&h&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?B1([],S,b,x,v,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function hE(e,t,n,s){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!sc(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(l=>Xo(l,s,Yo())))}),t)}const dU=fe("$ZodUnion",(e,t)=>{Lt.init(e,t),St(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),St(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),St(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),St(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>hb(a.source)).join("|")})$`)}});const n=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return s(i,a);let l=!1;const f=[];for(const d of t.options){const h=d._zod.run({value:i.value,issues:[]},a);if(h instanceof Promise)f.push(h),l=!0;else{if(h.issues.length===0)return h;f.push(h)}}return l?Promise.all(f).then(d=>hE(d,i,e,a)):hE(f,i,e,a)}}),hU=fe("$ZodIntersection",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},s),l=t.right._zod.run({value:i,issues:[]},s);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,h])=>pE(n,d,h)):pE(n,a,l)}});function iv(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(Cc(e)&&Cc(t)){const n=Object.keys(t),s=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=iv(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=iv(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pE(e,t,n){const s=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).r=!0;else e.issues.push(f);const a=[...s].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(a.length&&i&&e.issues.push({...i,keys:a}),sc(e))return e;const l=iv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const pU=fe("$ZodRecord",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Cc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const g=t.valueType._zod.run({value:i[h],issues:[]},s);g instanceof Promise?a.push(g.then(v=>{v.issues.length&&n.issues.push(...oc(h,v.issues)),n.value[h]=v.value})):(g.issues.length&&n.issues.push(...oc(h,g.issues)),n.value[h]=g.value)}let d;for(const h in i)f.has(h)||(d=d??[],d.push(h));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const f of Reflect.ownKeys(i)){if(f==="__proto__")continue;let d=t.keyType._zod.run({value:f,issues:[]},s);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&I1.test(f)&&d.issues.length){const v=t.keyType._zod.run({value:Number(f),issues:[]},s);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(d=v)}if(d.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(v=>Xo(v,s,Yo())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:i[f],issues:[]},s);g instanceof Promise?a.push(g.then(v=>{v.issues.length&&n.issues.push(...oc(f,v.issues)),n.value[d.value]=v.value})):(g.issues.length&&n.issues.push(...oc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),mU=fe("$ZodEnum",(e,t)=>{Lt.init(e,t);const n=T1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>C4.has(typeof i)).map(i=>typeof i=="string"?Nc(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return s.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),gU=fe("$ZodLiteral",(e,t)=>{if(Lt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(s=>typeof s=="string"?Nc(s):s?Nc(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,i)=>{const a=s.value;return n.has(a)||s.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),s}}),yU=fe("$ZodTransform",(e,t)=>{Lt.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new w1(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new lc;return n.value=i,n}});function mE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const F1=fe("$ZodOptional",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",St(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hb(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>mE(a,n.value)):mE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),vU=fe("$ZodExactOptional",(e,t)=>{F1.init(e,t),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),bU=fe("$ZodNullable",(e,t)=>{Lt.init(e,t),St(e._zod,"optin",()=>t.innerType._zod.optin),St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hb(n.source)}|null)$`):void 0}),St(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),xU=fe("$ZodDefault",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>gE(a,t)):gE(i,t)}});function gE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const SU=fe("$ZodPrefault",(e,t)=>{Lt.init(e,t),e._zod.optin="optional",St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),_U=fe("$ZodNonOptional",(e,t)=>{Lt.init(e,t),St(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>yE(a,e)):yE(i,e)}});function yE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const wU=fe("$ZodCatch",(e,t)=>{Lt.init(e,t),St(e._zod,"optin",()=>t.innerType._zod.optin),St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(l=>Xo(l,s,Yo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Xo(a,s,Yo()))},input:n.value}),n.issues=[]),n)}}),EU=fe("$ZodPipe",(e,t)=>{Lt.init(e,t),St(e._zod,"values",()=>t.in._zod.values),St(e._zod,"optin",()=>t.in._zod.optin),St(e._zod,"optout",()=>t.out._zod.optout),St(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const a=t.out._zod.run(n,s);return a instanceof Promise?a.then(l=>Sd(l,t.in,s)):Sd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>Sd(a,t.out,s)):Sd(i,t.out,s)}});function Sd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const TU=fe("$ZodReadonly",(e,t)=>{Lt.init(e,t),St(e._zod,"propValues",()=>t.innerType._zod.propValues),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"optin",()=>t.innerType?._zod?.optin),St(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(vE):vE(i)}});function vE(e){return e.value=Object.freeze(e.value),e}const RU=fe("$ZodCustom",(e,t)=>{Zn.init(e,t),Lt.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(a=>bE(a,n,s,e));bE(i,n,s,e)}});function bE(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(gu(i))}}var xE;class CU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function NU(){return new CU}(xE=globalThis).__zod_globalRegistry??(xE.__zod_globalRegistry=NU());const eu=globalThis.__zod_globalRegistry;function jU(e,t){return new e({type:"string",...Pe(t)})}function OU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Pe(t)})}function SE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Pe(t)})}function AU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Pe(t)})}function kU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pe(t)})}function MU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pe(t)})}function IU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pe(t)})}function PU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Pe(t)})}function zU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Pe(t)})}function DU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pe(t)})}function LU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Pe(t)})}function UU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pe(t)})}function $U(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Pe(t)})}function BU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Pe(t)})}function FU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pe(t)})}function HU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pe(t)})}function qU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pe(t)})}function VU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pe(t)})}function GU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pe(t)})}function KU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Pe(t)})}function ZU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Pe(t)})}function YU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Pe(t)})}function XU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Pe(t)})}function QU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pe(t)})}function WU(e,t){return new e({type:"string",format:"date",check:"string_format",...Pe(t)})}function JU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Pe(t)})}function e3(e,t){return new e({type:"string",format:"duration",check:"string_format",...Pe(t)})}function t3(e,t){return new e({type:"number",checks:[],...Pe(t)})}function n3(e,t){return new e({type:"number",coerce:!0,checks:[],...Pe(t)})}function r3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Pe(t)})}function s3(e,t){return new e({type:"boolean",...Pe(t)})}function o3(e){return new e({type:"unknown"})}function i3(e,t){return new e({type:"never",...Pe(t)})}function _E(e,t){return new z1({check:"less_than",...Pe(t),value:e,inclusive:!1})}function Vg(e,t){return new z1({check:"less_than",...Pe(t),value:e,inclusive:!0})}function wE(e,t){return new D1({check:"greater_than",...Pe(t),value:e,inclusive:!1})}function Gg(e,t){return new D1({check:"greater_than",...Pe(t),value:e,inclusive:!0})}function EE(e,t){return new x5({check:"multiple_of",...Pe(t),value:e})}function H1(e,t){return new _5({check:"max_length",...Pe(t),maximum:e})}function yh(e,t){return new w5({check:"min_length",...Pe(t),minimum:e})}function q1(e,t){return new E5({check:"length_equals",...Pe(t),length:e})}function a3(e,t){return new T5({check:"string_format",format:"regex",...Pe(t),pattern:e})}function c3(e){return new R5({check:"string_format",format:"lowercase",...Pe(e)})}function l3(e){return new C5({check:"string_format",format:"uppercase",...Pe(e)})}function u3(e,t){return new N5({check:"string_format",format:"includes",...Pe(t),includes:e})}function f3(e,t){return new j5({check:"string_format",format:"starts_with",...Pe(t),prefix:e})}function d3(e,t){return new O5({check:"string_format",format:"ends_with",...Pe(t),suffix:e})}function qc(e){return new A5({check:"overwrite",tx:e})}function h3(e){return qc(t=>t.normalize(e))}function p3(){return qc(e=>e.trim())}function m3(){return qc(e=>e.toLowerCase())}function g3(){return qc(e=>e.toUpperCase())}function y3(){return qc(e=>T4(e))}function v3(e,t,n){return new e({type:"array",element:t,...Pe(n)})}function b3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Pe(n)})}function x3(e){const t=S3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(gu(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(gu(i))}},e(n.value,n)));return t}function S3(e,t){const n=new Zn({check:"custom",...Pe(t)});return n._zod.check=e,n}function V1(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??eu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function on(e,t,n={path:[],schemaPath:[]}){var s;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,x=t.processors[i.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);x(e,t,b,g)}const v=e._zod.parent;v&&(l.ref||(l.ref=v),on(v,t,g),t.seen.get(v).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&jn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((s=l.schema).default??(s.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function G1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=s.get(f);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(f,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(v)return{ref:b(v)};const x=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(l[1]===n)return{ref:"#"};const h=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:h+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:h}=i(l);f.def={...f.schema},h&&(f.defId=h);const g=f.schema;for(const v in g)delete g[v];g.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
58
|
-
|
|
59
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){a(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(f.cycle){a(l);continue}if(f.count>1&&e.reused==="ref"){a(l);continue}}}function K1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=l=>{const f=e.seen.get(l);if(f.ref===null)return;const d=f.def??f.schema,h={...d},g=f.ref;if(f.ref=null,g){s(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(x)):Object.assign(d,x),Object.assign(d,h),l._zod.parent===g)for(const w in d)w==="$ref"||w==="allOf"||w in h||delete d[w];if(x.$ref&&b.def)for(const w in d)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(d[w])===JSON.stringify(b.def[w])&&delete d[w]}const v=l._zod.parent;if(v&&v!==g){s(v);const b=e.seen.get(v);if(b?.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(const x in d)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(d[x])===JSON.stringify(b.def[x])&&delete d[x]}e.override({zodSchema:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())s(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(a[f.defId]=f.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:vh(t,"input",e.processors),output:vh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return jn(s.element,n);if(s.type==="set")return jn(s.valueType,n);if(s.type==="lazy")return jn(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return jn(s.innerType,n);if(s.type==="intersection")return jn(s.left,n)||jn(s.right,n);if(s.type==="record"||s.type==="map")return jn(s.keyType,n)||jn(s.valueType,n);if(s.type==="pipe")return jn(s.in,n)||jn(s.out,n);if(s.type==="object"){for(const i in s.shape)if(jn(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(jn(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(jn(i,n))return!0;return!!(s.rest&&jn(s.rest,n))}return!1}const _3=(e,t={})=>n=>{const s=V1({...n,processors:t});return on(e,s),G1(s,e),K1(s,e)},vh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=V1({...i??{},target:a,io:t,processors:n});return on(e,l),G1(l,e),K1(l,e)},w3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},E3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:h}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=w3[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),h&&(i.contentEncoding=h),d&&d.size>0){const g=[...d];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},T3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,format:f,multipleOf:d,exclusiveMaximum:h,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=g,i.exclusiveMinimum=!0):i.exclusiveMinimum=g),typeof a=="number"&&(i.minimum=a,typeof g=="number"&&t.target!=="draft-04"&&(g>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},R3=(e,t,n,s)=>{n.type="boolean"},C3=(e,t,n,s)=>{n.not={}},N3=(e,t,n,s)=>{},j3=(e,t,n,s)=>{const i=e._zod.def,a=T1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},O3=(e,t,n,s)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},A3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},M3=(e,t,n,s)=>{const i=n,a=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=on(a.element,t,{...s,path:[...s.path,"items"]})},I3=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const h in l)i.properties[h]=on(l[h],t,{...s,path:[...s.path,"properties",h]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(h=>{const g=a.shape[h]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=on(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},P3=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>on(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},z3=(e,t,n,s)=>{const i=e._zod.def,a=on(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=on(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,d=[...f(a)?a.allOf:[a],...f(l)?l.allOf:[l]];n.allOf=d},D3=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const g=on(a.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const v of d)i.patternProperties[v.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=on(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=on(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const h=l._zod.values;if(h){const g=[...h].filter(v=>typeof v=="string"||typeof v=="number");g.length>0&&(i.required=g)}},L3=(e,t,n,s)=>{const i=e._zod.def,a=on(i.innerType,t,s),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},U3=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},$3=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},B3=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},F3=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},H3=(e,t,n,s)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;on(a,t,s);const l=t.seen.get(e);l.ref=a},q3=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Z1=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},V3=fe("ZodISODateTime",(e,t)=>{V5.init(e,t),$t.init(e,t)});function G3(e){return QU(V3,e)}const K3=fe("ZodISODate",(e,t)=>{G5.init(e,t),$t.init(e,t)});function Z3(e){return WU(K3,e)}const Y3=fe("ZodISOTime",(e,t)=>{K5.init(e,t),$t.init(e,t)});function X3(e){return JU(Y3,e)}const Q3=fe("ZodISODuration",(e,t)=>{Z5.init(e,t),$t.init(e,t)});function W3(e){return e3(Q3,e)}const J3=(e,t)=>{j1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>L4(e,n)},flatten:{value:n=>D4(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ov,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ov,2)}},isEmpty:{get(){return e.issues.length===0}}})},qr=fe("ZodError",J3,{Parent:Error}),e$=mb(qr),t$=gb(qr),n$=Wh(qr),r$=Jh(qr),s$=B4(qr),o$=F4(qr),i$=H4(qr),a$=q4(qr),c$=V4(qr),l$=G4(qr),u$=K4(qr),f$=Z4(qr),Ut=fe("ZodType",(e,t)=>(Lt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:vh(e,"input"),output:vh(e,"output")}}),e.toJSONSchema=_3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(si(t,{checks:[...t.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(n,s)=>oi(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>e$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>n$(e,n,s),e.parseAsync=async(n,s)=>t$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>r$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>s$(e,n,s),e.decode=(n,s)=>o$(e,n,s),e.encodeAsync=async(n,s)=>i$(e,n,s),e.decodeAsync=async(n,s)=>a$(e,n,s),e.safeEncode=(n,s)=>c$(e,n,s),e.safeDecode=(n,s)=>l$(e,n,s),e.safeEncodeAsync=async(n,s)=>u$(e,n,s),e.safeDecodeAsync=async(n,s)=>f$(e,n,s),e.refine=(n,s)=>e.check(sB(n,s)),e.superRefine=n=>e.check(oB(n)),e.overwrite=n=>e.check(qc(n)),e.optional=()=>CE(e),e.exactOptional=()=>V$(e),e.nullable=()=>NE(e),e.nullish=()=>CE(NE(e)),e.nonoptional=n=>Q$(e,n),e.array=()=>Hr(e),e.or=n=>bb([e,n]),e.and=n=>U$(e,n),e.transform=n=>jE(e,H$(n)),e.default=n=>Z$(e,n),e.prefault=n=>X$(e,n),e.catch=n=>J$(e,n),e.pipe=n=>jE(e,n),e.readonly=()=>nB(e),e.describe=n=>{const s=e.clone();return eu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return eu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return eu.get(e);const s=e.clone();return eu.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Y1=fe("_ZodString",(e,t)=>{yb.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(s,i,a)=>E3(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...s)=>e.check(a3(...s)),e.includes=(...s)=>e.check(u3(...s)),e.startsWith=(...s)=>e.check(f3(...s)),e.endsWith=(...s)=>e.check(d3(...s)),e.min=(...s)=>e.check(yh(...s)),e.max=(...s)=>e.check(H1(...s)),e.length=(...s)=>e.check(q1(...s)),e.nonempty=(...s)=>e.check(yh(1,...s)),e.lowercase=s=>e.check(c3(s)),e.uppercase=s=>e.check(l3(s)),e.trim=()=>e.check(p3()),e.normalize=(...s)=>e.check(h3(...s)),e.toLowerCase=()=>e.check(m3()),e.toUpperCase=()=>e.check(g3()),e.slugify=()=>e.check(y3())}),d$=fe("ZodString",(e,t)=>{yb.init(e,t),Y1.init(e,t),e.email=n=>e.check(OU(h$,n)),e.url=n=>e.check(PU(p$,n)),e.jwt=n=>e.check(XU(j$,n)),e.emoji=n=>e.check(zU(m$,n)),e.guid=n=>e.check(SE(TE,n)),e.uuid=n=>e.check(AU(_d,n)),e.uuidv4=n=>e.check(kU(_d,n)),e.uuidv6=n=>e.check(MU(_d,n)),e.uuidv7=n=>e.check(IU(_d,n)),e.nanoid=n=>e.check(DU(g$,n)),e.guid=n=>e.check(SE(TE,n)),e.cuid=n=>e.check(LU(y$,n)),e.cuid2=n=>e.check(UU(v$,n)),e.ulid=n=>e.check($U(b$,n)),e.base64=n=>e.check(KU(R$,n)),e.base64url=n=>e.check(ZU(C$,n)),e.xid=n=>e.check(BU(x$,n)),e.ksuid=n=>e.check(FU(S$,n)),e.ipv4=n=>e.check(HU(_$,n)),e.ipv6=n=>e.check(qU(w$,n)),e.cidrv4=n=>e.check(VU(E$,n)),e.cidrv6=n=>e.check(GU(T$,n)),e.e164=n=>e.check(YU(N$,n)),e.datetime=n=>e.check(G3(n)),e.date=n=>e.check(Z3(n)),e.time=n=>e.check(X3(n)),e.duration=n=>e.check(W3(n))});function Fe(e){return jU(d$,e)}const $t=fe("ZodStringFormat",(e,t)=>{zt.init(e,t),Y1.init(e,t)}),h$=fe("ZodEmail",(e,t)=>{z5.init(e,t),$t.init(e,t)}),TE=fe("ZodGUID",(e,t)=>{I5.init(e,t),$t.init(e,t)}),_d=fe("ZodUUID",(e,t)=>{P5.init(e,t),$t.init(e,t)}),p$=fe("ZodURL",(e,t)=>{D5.init(e,t),$t.init(e,t)}),m$=fe("ZodEmoji",(e,t)=>{L5.init(e,t),$t.init(e,t)}),g$=fe("ZodNanoID",(e,t)=>{U5.init(e,t),$t.init(e,t)}),y$=fe("ZodCUID",(e,t)=>{$5.init(e,t),$t.init(e,t)}),v$=fe("ZodCUID2",(e,t)=>{B5.init(e,t),$t.init(e,t)}),b$=fe("ZodULID",(e,t)=>{F5.init(e,t),$t.init(e,t)}),x$=fe("ZodXID",(e,t)=>{H5.init(e,t),$t.init(e,t)}),S$=fe("ZodKSUID",(e,t)=>{q5.init(e,t),$t.init(e,t)}),_$=fe("ZodIPv4",(e,t)=>{Y5.init(e,t),$t.init(e,t)}),w$=fe("ZodIPv6",(e,t)=>{X5.init(e,t),$t.init(e,t)}),E$=fe("ZodCIDRv4",(e,t)=>{Q5.init(e,t),$t.init(e,t)}),T$=fe("ZodCIDRv6",(e,t)=>{W5.init(e,t),$t.init(e,t)}),R$=fe("ZodBase64",(e,t)=>{J5.init(e,t),$t.init(e,t)}),C$=fe("ZodBase64URL",(e,t)=>{tU.init(e,t),$t.init(e,t)}),N$=fe("ZodE164",(e,t)=>{nU.init(e,t),$t.init(e,t)}),j$=fe("ZodJWT",(e,t)=>{sU.init(e,t),$t.init(e,t)}),vb=fe("ZodNumber",(e,t)=>{U1.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(s,i,a)=>T3(e,s,i),e.gt=(s,i)=>e.check(wE(s,i)),e.gte=(s,i)=>e.check(Gg(s,i)),e.min=(s,i)=>e.check(Gg(s,i)),e.lt=(s,i)=>e.check(_E(s,i)),e.lte=(s,i)=>e.check(Vg(s,i)),e.max=(s,i)=>e.check(Vg(s,i)),e.int=s=>e.check(RE(s)),e.safe=s=>e.check(RE(s)),e.positive=s=>e.check(wE(0,s)),e.nonnegative=s=>e.check(Gg(0,s)),e.negative=s=>e.check(_E(0,s)),e.nonpositive=s=>e.check(Vg(0,s)),e.multipleOf=(s,i)=>e.check(EE(s,i)),e.step=(s,i)=>e.check(EE(s,i)),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 Wt(e){return t3(vb,e)}const O$=fe("ZodNumberFormat",(e,t)=>{oU.init(e,t),vb.init(e,t)});function RE(e){return r3(O$,e)}const A$=fe("ZodBoolean",(e,t)=>{iU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>R3(e,n,s)});function Js(e){return s3(A$,e)}const k$=fe("ZodUnknown",(e,t)=>{aU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>N3()});function Ji(){return o3(k$)}const M$=fe("ZodNever",(e,t)=>{cU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>C3(e,n,s)});function I$(e){return i3(M$,e)}const P$=fe("ZodArray",(e,t)=>{lU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>M3(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(yh(n,s)),e.nonempty=n=>e.check(yh(1,n)),e.max=(n,s)=>e.check(H1(n,s)),e.length=(n,s)=>e.check(q1(n,s)),e.unwrap=()=>e.element});function Hr(e,t){return v3(P$,e,t)}const z$=fe("ZodObject",(e,t)=>{fU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>I3(e,n,s,i),St(e,"shape",()=>t.shape),e.keyof=()=>Bu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ji()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ji()}),e.strict=()=>e.clone({...e._zod.def,catchall:I$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>k4(e,n),e.safeExtend=n=>M4(e,n),e.merge=n=>I4(e,n),e.pick=n=>O4(e,n),e.omit=n=>A4(e,n),e.partial=(...n)=>P4(X1,e,n[0]),e.required=(...n)=>z4(Q1,e,n[0])});function Nt(e,t){const n={type:"object",shape:e??{},...Pe(t)};return new z$(n)}const D$=fe("ZodUnion",(e,t)=>{dU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>P3(e,n,s,i),e.options=t.options});function bb(e,t){return new D$({type:"union",options:e,...Pe(t)})}const L$=fe("ZodIntersection",(e,t)=>{hU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>z3(e,n,s,i)});function U$(e,t){return new L$({type:"intersection",left:e,right:t})}const $$=fe("ZodRecord",(e,t)=>{pU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>D3(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function $u(e,t,n){return new $$({type:"record",keyType:e,valueType:t,...Pe(n)})}const av=fe("ZodEnum",(e,t)=>{mU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(s,i,a)=>j3(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const a={};for(const l of s)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new av({...t,checks:[],...Pe(i),entries:a})},e.exclude=(s,i)=>{const a={...t.entries};for(const l of s)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new av({...t,checks:[],...Pe(i),entries:a})}});function Bu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new av({type:"enum",entries:n,...Pe(t)})}const B$=fe("ZodLiteral",(e,t)=>{gU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>O3(e,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qo(e,t){return new B$({type:"literal",values:Array.isArray(e)?e:[e],...Pe(t)})}const F$=fe("ZodTransform",(e,t)=>{yU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>k3(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new w1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(gu(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(gu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function H$(e){return new F$({type:"transform",transform:e})}const X1=fe("ZodOptional",(e,t)=>{F1.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z1(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function CE(e){return new X1({type:"optional",innerType:e})}const q$=fe("ZodExactOptional",(e,t)=>{vU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z1(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function V$(e){return new q$({type:"optional",innerType:e})}const G$=fe("ZodNullable",(e,t)=>{bU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>L3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function NE(e){return new G$({type:"nullable",innerType:e})}const K$=fe("ZodDefault",(e,t)=>{xU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>$3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Z$(e,t){return new K$({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():C1(t)}})}const Y$=fe("ZodPrefault",(e,t)=>{SU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>B3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function X$(e,t){return new Y$({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():C1(t)}})}const Q1=fe("ZodNonOptional",(e,t)=>{_U.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>U3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function Q$(e,t){return new Q1({type:"nonoptional",innerType:e,...Pe(t)})}const W$=fe("ZodCatch",(e,t)=>{wU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>F3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function J$(e,t){return new W$({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const eB=fe("ZodPipe",(e,t)=>{EU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>H3(e,n,s,i),e.in=t.in,e.out=t.out});function jE(e,t){return new eB({type:"pipe",in:e,out:t})}const tB=fe("ZodReadonly",(e,t)=>{TU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>q3(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function nB(e){return new tB({type:"readonly",innerType:e})}const rB=fe("ZodCustom",(e,t)=>{RU.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,s,i)=>A3(e,n)});function sB(e,t={}){return b3(rB,e,t)}function oB(e){return x3(e)}function OE(e){return n3(vb,e)}Nt({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:Wt().int().min(0),mimeType:Fe().min(1),encrypted:Js().optional(),keyId:Fe().optional()});const W1=Nt({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:Wt().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:Js()});Nt({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:Wt().int().min(0),mimeType:Fe().min(1)});Nt({exists:Js(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Bu(["PUT","POST"]).optional(),uploadHeaders:$u(Fe(),Fe()).optional(),chunkSize:Wt().int().optional()});Nt({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});Nt({ok:Js(),metadata:W1.optional(),error:Fe().optional()});Nt({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});Nt({url:Fe().url(),expiresAt:Fe(),metadata:W1});Nt({error:Fe(),message:Fe().optional(),code:Fe().optional()});Nt({limit:OE().int().min(1).max(100).default(50),offset:OE().int().min(0).default(0)});const iB="json-row-frame-v1",aB="gzip",J1=Bu(["upsert","delete"]),cB=$u(Fe(),Fe()),eN=$u(Fe(),bb([Fe(),Hr(Fe())])),lB=Nt({table:Fe(),row_id:Fe(),op:J1,payload:$u(Fe(),Ji()).nullable(),base_version:Wt().int().nullable().optional()}),uB=Nt({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Hr(lB).min(1),schemaVersion:Wt().int().min(1)}),fB=Nt({opIndex:Wt().int(),status:Qo("applied")}),dB=Nt({opIndex:Wt().int(),status:Qo("conflict"),message:Fe(),server_version:Wt().int(),server_row:Ji()}),hB=Nt({opIndex:Wt().int(),status:Qo("error"),error:Fe(),code:Fe().optional(),retriable:Js().optional()}),pB=bb([fB,dB,hB]),mB=Nt({ok:Qo(!0),status:Bu(["applied","cached","rejected"]),commitSeq:Wt().int().optional(),results:Hr(pB)}),tN=Nt({asOfCommitSeq:Wt().int(),tables:Hr(Fe()),tableIndex:Wt().int(),rowCursor:Fe().nullable()}),gB=Nt({id:Fe().min(1),table:Fe().min(1),scopes:eN,params:$u(Fe(),Ji()).optional(),cursor:Wt().int(),bootstrapState:tN.nullable().optional()}),yB=Nt({clientId:Fe().min(1),limitCommits:Wt().int().min(1),limitSnapshotRows:Wt().int().min(1).optional(),maxSnapshotPages:Wt().int().min(1).optional(),dedupeRows:Js().optional(),subscriptions:Hr(gB)}),vB=Nt({table:Fe(),row_id:Fe(),op:J1,row_json:Ji().nullable(),row_version:Wt().int().nullable(),scopes:cB}),bB=Nt({commitSeq:Wt().int(),createdAt:Fe(),actorId:Fe(),changes:Hr(vB)}),xB=Nt({id:Fe(),byteLength:Wt().int(),sha256:Fe(),encoding:Qo(iB),compression:Qo(aB)}),SB=Nt({table:Fe(),rows:Hr(Ji()),chunks:Hr(xB).optional(),isFirstPage:Js(),isLastPage:Js()}),_B=Nt({id:Fe(),status:Bu(["active","revoked"]),scopes:eN,bootstrap:Js(),bootstrapState:tN.nullable().optional(),nextCursor:Wt().int(),commits:Hr(bB),snapshots:Hr(SB).optional()}),wB=Nt({ok:Qo(!0),subscriptions:Hr(_B)});Nt({clientId:Fe().min(1),push:uB.omit({clientId:!0}).optional(),pull:yB.omit({clientId:!0}).optional()});Nt({ok:Qo(!0),push:mB.optional(),pull:wB.optional()});const EB={setAttribute(){},setAttributes(){},setStatus(){}};function TB(e){return e.level?e.level:e.error?"error":"info"}function Kg(e,t){if(!e)return null;switch(t){case"trace":return e.trace??e.debug??e.info??null;case"debug":return e.debug??e.info??null;case"info":return e.info??null;case"warn":return e.warn??e.info??null;case"error":return e.error??e.warn??e.info??null;case"fatal":return e.fatal??e.error??e.warn??e.info??null;default:return e.info??null}}function RB(e){return{setAttribute(t,n){e.setAttribute?.(t,n)},setAttributes(t){if(e.setAttributes){e.setAttributes(t);return}for(const[n,s]of Object.entries(t))e.setAttribute?.(n,s)},setStatus(t){e.setStatus?.(t)}}}function CB(e){if(typeof e=="string")return e;if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e=="boolean")return e;if(typeof e=="bigint"){const t=Number(e);return Number.isFinite(t)?t:e.toString()}if(e instanceof Date)return e.toISOString();if(e!=null){if(Array.isArray(e)||typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function AE(e){const t={};for(const[n,s]of Object.entries(e)){const i=CB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function NB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(RB(s))):n(EB)}}}function jB(e){return{count(t,n,s){e.metrics?.count?.(t,n??1,s)},gauge(t,n,s){e.metrics?.gauge?.(t,n,s)},distribution(t,n,s){e.metrics?.distribution?.(t,n,s)}}}function OB(e){return{log(t){const n=TB(t),{event:s,...i}=t,a=Kg(e.logger,n);if(!a)return;const l=AE(i);if(!l){a(s);return}a(s,l)},tracer:NB(e),metrics:jB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=Kg(e.logger,"error")??Kg(e.logger,"info");if(!s)return;const i=AE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function AB(e){if(e?.attributes)return{attributes:e.attributes}}function kE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function kB(){return OB({logger:iz,startSpan(e,t){return xC(e,n=>t({setAttribute(s,i){n.setAttribute(s,i)},setAttributes(s){n.setAttributes(s)},setStatus(s){n.setStatus({code:s==="ok"?1:2})}}))},metrics:{count(e,t,n){const s=AB(n);if(s){Kw(e,t,s);return}Kw(e,t)},gauge(e,t,n){const s=kE(n);if(s){Zw(e,t,s);return}Zw(e,t)},distribution(e,t,n){const s=kE(n);if(s){Yw(e,t,s);return}Yw(e,t)}},captureException(e){TC(e)}})}function MB(){return kB()}function IB(e){const t=PB(e);return w4(t),MB()}function PB(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[y4(),...n]}}var Zg={exports:{}},ql={};var ME;function zB(){if(ME)return ql;ME=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var f in i)f!=="key"&&(a[f]=i[f])}else a=i;return i=a.ref,{$$typeof:e,type:s,key:l,ref:i!==void 0?i:null,props:a}}return ql.Fragment=t,ql.jsx=n,ql.jsxs=n,ql}var IE;function DB(){return IE||(IE=1,Zg.exports=zB()),Zg.exports}var p=DB(),Yg={exports:{}},Vl={},Xg={exports:{}},Qg={};var PE;function LB(){return PE||(PE=1,(function(e){function t(P,V){var U=P.length;P.push(V);e:for(;0<U;){var F=U-1>>>1,H=P[F];if(0<i(H,V))P[F]=V,P[U]=H,U=F;else break e}}function n(P){return P.length===0?null:P[0]}function s(P){if(P.length===0)return null;var V=P[0],U=P.pop();if(U!==V){P[0]=U;e:for(var F=0,H=P.length,M=H>>>1;F<M;){var K=2*(F+1)-1,W=P[K],Y=K+1,le=P[Y];if(0>i(W,U))Y<H&&0>i(le,W)?(P[F]=le,P[Y]=U,F=Y):(P[F]=W,P[K]=U,F=K);else if(Y<H&&0>i(le,U))P[F]=le,P[Y]=U,F=Y;else break e}}return V}function i(P,V){var U=P.sortIndex-V.sortIndex;return U!==0?U:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var d=[],h=[],g=1,v=null,b=3,x=!1,S=!1,w=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function C(P){for(var V=n(h);V!==null;){if(V.callback===null)s(h);else if(V.startTime<=P)s(h),V.sortIndex=V.expirationTime,t(d,V);else break;V=n(h)}}function I(P){if(w=!1,C(P),!S)if(n(d)!==null)S=!0,D||(D=!0,L());else{var V=n(h);V!==null&&te(I,V.startTime-P)}}var D=!1,N=-1,A=5,z=-1;function X(){return T?!0:!(e.unstable_now()-z<A)}function q(){if(T=!1,D){var P=e.unstable_now();z=P;var V=!0;try{e:{S=!1,w&&(w=!1,k(N),N=-1),x=!0;var U=b;try{t:{for(C(P),v=n(d);v!==null&&!(v.expirationTime>P&&X());){var F=v.callback;if(typeof F=="function"){v.callback=null,b=v.priorityLevel;var H=F(v.expirationTime<=P);if(P=e.unstable_now(),typeof H=="function"){v.callback=H,C(P),V=!0;break t}v===n(d)&&s(d),C(P)}else s(d);v=n(d)}if(v!==null)V=!0;else{var M=n(h);M!==null&&te(I,M.startTime-P),V=!1}}break e}finally{v=null,b=U,x=!1}V=void 0}}finally{V?L():D=!1}}}var L;if(typeof j=="function")L=function(){j(q)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,G=Z.port2;Z.port1.onmessage=q,L=function(){G.postMessage(null)}}else L=function(){R(q,0)};function te(P,V){N=R(function(){P(e.unstable_now())},V)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(P){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var U=b;b=V;try{return P()}finally{b=U}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=b;b=P;try{return V()}finally{b=U}},e.unstable_scheduleCallback=function(P,V,U){var F=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?F+U:F):U=F,P){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=U+H,P={id:g++,callback:V,priorityLevel:P,startTime:U,expirationTime:H,sortIndex:-1},U>F?(P.sortIndex=U,t(h,P),n(d)===null&&P===n(h)&&(w?(k(N),N=-1):w=!0,te(I,U-F))):(P.sortIndex=H,t(d,P),S||x||(S=!0,D||(D=!0,L()))),P},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(P){var V=b;return function(){var U=b;b=V;try{return P.apply(this,arguments)}finally{b=U}}}})(Qg)),Qg}var zE;function UB(){return zE||(zE=1,Xg.exports=LB()),Xg.exports}var Wg={exports:{}},Tn={};var DE;function $B(){if(DE)return Tn;DE=1;var e=Uu();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,h,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:d,containerInfo:h,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Tn.createPortal=function(d,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,g)},Tn.flushSync=function(d){var h=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=h,s.p=g,s.d.f()}},Tn.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(d,h))},Tn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Tn.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?s.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:x}):g==="script"&&s.d.X(d,{crossOrigin:v,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Tn.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);s.d.M(d,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(d)},Tn.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin);s.d.L(d,g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Tn.preloadModule=function(d,h){if(typeof d=="string")if(h){var g=f(h.as,h.crossOrigin);s.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(d)},Tn.requestFormReset=function(d){s.d.r(d)},Tn.unstable_batchedUpdates=function(d,h){return d(h)},Tn.useFormState=function(d,h,g){return l.H.useFormState(d,h,g)},Tn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Tn.version="19.2.4",Tn}var LE;function nN(){if(LE)return Wg.exports;LE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wg.exports=$B(),Wg.exports}var UE;function BB(){if(UE)return Vl;UE=1;var e=UB(),t=Uu(),n=nN();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function f(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(a(r)!==r)throw Error(s(188))}function h(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(s(188));return o!==r?null:r}for(var c=r,u=o;;){var m=c.return;if(m===null)break;var y=m.alternate;if(y===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===c)return d(m),r;if(y===u)return d(m),o;y=y.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=y;else{for(var E=!1,O=m.child;O;){if(O===c){E=!0,c=m,u=y;break}if(O===u){E=!0,u=m,c=y;break}O=O.sibling}if(!E){for(O=y.child;O;){if(O===c){E=!0,c=y,u=m;break}if(O===u){E=!0,u=y,c=m;break}O=O.sibling}if(!E)throw Error(s(189))}}if(c.alternate!==u)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:o}function g(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=g(r),o!==null)return o;r=r.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function L(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function G(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case j:return r.displayName||"Context";case k:return(r._context.displayName||"Context")+".Consumer";case C:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return o=r.displayName||null,o!==null?o:G(r.type)||"Memo";case A:o=r._payload,r=r._init;try{return G(r(o))}catch{}}return null}var te=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},F=[],H=-1;function M(r){return{current:r}}function K(r){0>H||(r.current=F[H],F[H]=null,H--)}function W(r,o){H++,F[H]=r.current,r.current=o}var Y=M(null),le=M(null),ie=M(null),ce=M(null);function Se(r,o){switch(W(ie,o),W(le,r),W(Y,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?w_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=w_(o),r=E_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}K(Y),W(Y,r)}function ge(){K(Y),K(le),K(ie)}function $e(r){r.memoizedState!==null&&W(ce,r);var o=Y.current,c=E_(o,r.type);o!==c&&(W(le,r),W(Y,c))}function Ee(r){le.current===r&&(K(Y),K(le)),ce.current===r&&(K(ce),Ul._currentValue=U)}var re,he;function oe(r){if(re===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||"",he=-1<c.stack.indexOf(`
|
|
60
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
61
|
-
`+re+r+he}var _e=!1;function ye(r,o){if(!r||_e)return"";_e=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(se){var ne=se}Reflect.construct(r,[],de)}else{try{de.call()}catch(se){ne=se}r.call(de.prototype)}}else{try{throw Error()}catch(se){ne=se}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),E=y[0],O=y[1];if(E&&O){var $=E.split(`
|
|
62
|
-
`),ee=O.split(`
|
|
63
|
-
`);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===ee.length)for(u=$.length-1,m=ee.length-1;1<=u&&0<=m&&$[u]!==ee[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==ee[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==ee[m]){var ae=`
|
|
64
|
-
`+$[u].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=u&&0<=m);break}}}finally{_e=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?oe(c):""}function xe(r,o){switch(r.tag){case 26:case 27:case 5:return oe(r.type);case 16:return oe("Lazy");case 13:return r.child!==o&&o!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return ye(r.type,!1);case 11:return ye(r.type.render,!1);case 1:return ye(r.type,!0);case 31:return oe("Activity");default:return""}}function ve(r){try{var o="",c=null;do o+=xe(r,c),c=r,r=r.return;while(r);return o}catch(u){return`
|
|
65
|
-
Error generating stack: `+u.message+`
|
|
66
|
-
`+u.stack}}var ke=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,qe=e.unstable_shouldYield,Qe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,Ve=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,He=e.unstable_LowPriority,ht=e.unstable_IdlePriority,lt=e.log,yr=e.unstable_setDisableYieldValue,vr=null,Zt=null;function ut(r){if(typeof lt=="function"&&yr(r),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(vr,r)}catch{}}var vt=Math.clz32?Math.clz32:pn,st=Math.log,Yt=Math.LN2;function pn(r){return r>>>=0,r===0?32:31-(st(r)/Yt|0)|0}var jt=256,En=262144,Yn=4194304;function Cn(r){var o=r&42;if(o!==0)return o;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ss(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,y=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var O=u&134217727;return O!==0?(u=O&~y,u!==0?m=Cn(u):(E&=O,E!==0?m=Cn(E):c||(c=O&~r,c!==0&&(m=Cn(c))))):(O=u&~y,O!==0?m=Cn(O):E!==0?m=Cn(E):c||(c=u&~r,c!==0&&(m=Cn(c)))),m===0?0:o!==0&&o!==m&&(o&y)===0&&(y=m&-m,c=o&-o,y>=c||y===32&&(c&4194048)!==0)?o:m}function os(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function pa(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gi(){var r=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),r}function yi(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function xs(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Xn(r,o,c,u,m,y){var E=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var O=r.entanglements,$=r.expirationTimes,ee=r.hiddenUpdates;for(c=E&~c;0<c;){var ae=31-vt(c),de=1<<ae;O[ae]=0,$[ae]=-1;var ne=ee[ae];if(ne!==null)for(ee[ae]=null,ae=0;ae<ne.length;ae++){var se=ne[ae];se!==null&&(se.lane&=-536870913)}c&=~de}u!==0&&is(r,u,0),y!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=y&~(E&~o))}function is(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-vt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function oo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-vt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function io(r,o){var c=o&-o;return c=(c&42)!==0?1:Qn(c),(c&(r.suspendedLanes|o))!==0?0:c}function Qn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Jc(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Ju(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:K_(r.type))}function ef(r,o){var c=V.p;try{return V.p=r,o()}finally{V.p=c}}var ao=Math.random().toString(36).slice(2),yn="__reactFiber$"+ao,Dn="__reactProps$"+ao,ma="__reactContainer$"+ao,Sp="__reactEvents$"+ao,oA="__reactListeners$"+ao,iA="__reactHandles$"+ao,ux="__reactResources$"+ao,el="__reactMarker$"+ao;function _p(r){delete r[yn],delete r[Dn],delete r[Sp],delete r[oA],delete r[iA]}function ga(r){var o=r[yn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[ma]||c[yn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=A_(r);r!==null;){if(c=r[yn])return c;r=A_(r)}return o}r=c,c=r.parentNode}return null}function ya(r){if(r=r[yn]||r[ma]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function tl(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function va(r){var o=r[ux];return o||(o=r[ux]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function mn(r){r[el]=!0}var fx=new Set,dx={};function vi(r,o){ba(r,o),ba(r+"Capture",o)}function ba(r,o){for(dx[r]=o,r=0;r<o.length;r++)fx.add(o[r])}var aA=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]*$"),hx={},px={};function cA(r){return ke.call(px,r)?!0:ke.call(hx,r)?!1:aA.test(r)?px[r]=!0:(hx[r]=!0,!1)}function tf(r,o,c){if(cA(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+c)}}function nf(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function Ss(r,o,c,u){if(u===null)r.removeAttribute(c);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+u)}}function br(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function mx(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function lA(r,o,c){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,y=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return m.call(this)},set:function(E){c=""+E,y.call(this,E)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function wp(r){if(!r._valueTracker){var o=mx(r)?"checked":"value";r._valueTracker=lA(r,o,""+r[o])}}function gx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=mx(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function rf(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var uA=/[\n"\\]/g;function xr(r){return r.replace(uA,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ep(r,o,c,u,m,y,E,O){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),o!=null?E==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+br(o)):r.value!==""+br(o)&&(r.value=""+br(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Tp(r,E,br(o)):c!=null?Tp(r,E,br(c)):u!=null&&r.removeAttribute("value"),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+br(O):r.removeAttribute("name")}function yx(r,o,c,u,m,y,E,O){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null)){wp(r);return}c=c!=null?""+br(c):"",o=o!=null?""+br(o):c,O||o===r.value||(r.value=o),r.defaultValue=o}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=O?r.checked:!!u,r.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),wp(r)}function Tp(r,o,c){o==="number"&&rf(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function xa(r,o,c,u){if(r=r.options,o){o={};for(var m=0;m<c.length;m++)o["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=o.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&u&&(r[c].defaultSelected=!0)}else{for(c=""+br(c),o=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,u&&(r[m].defaultSelected=!0);return}o!==null||r[m].disabled||(o=r[m])}o!==null&&(o.selected=!0)}}function vx(r,o,c){if(o!=null&&(o=""+br(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+br(c):""}function bx(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(te(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=br(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),wp(r)}function Sa(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var fA=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 xx(r,o,c){var u=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,c):typeof c!="number"||c===0||fA.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function Sx(r,o,c){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,c!=null){for(var u in c)!c.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var m in o)u=o[m],o.hasOwnProperty(m)&&c[m]!==u&&xx(r,m,u)}else for(var y in o)o.hasOwnProperty(y)&&xx(r,y,o[y])}function Rp(r){if(r.indexOf("-")===-1)return!1;switch(r){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 dA=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"]]),hA=/^[\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 sf(r){return hA.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function _s(){}var Cp=null;function Np(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var _a=null,wa=null;function _x(r){var o=ya(r);if(o&&(r=o.stateNode)){var c=r[Dn]||null;e:switch(r=o.stateNode,o.type){case"input":if(Ep(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+xr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Dn]||null;if(!m)throw Error(s(90));Ep(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(o=0;o<c.length;o++)u=c[o],u.form===r.form&&gx(u)}break e;case"textarea":vx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&xa(r,!!c.multiple,o,!1)}}}var jp=!1;function wx(r,o,c){if(jp)return r(o,c);jp=!0;try{var u=r(o);return u}finally{if(jp=!1,(_a!==null||wa!==null)&&(Gf(),_a&&(o=_a,r=wa,wa=_a=null,_x(o),r)))for(o=0;o<r.length;o++)_x(r[o])}}function nl(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Dn]||null;if(u===null)return null;c=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,o,typeof c));return c}var ws=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Op=!1;if(ws)try{var rl={};Object.defineProperty(rl,"passive",{get:function(){Op=!0}}),window.addEventListener("test",rl,rl),window.removeEventListener("test",rl,rl)}catch{Op=!1}var co=null,Ap=null,of=null;function Ex(){if(of)return of;var r,o=Ap,c=o.length,u,m="value"in co?co.value:co.textContent,y=m.length;for(r=0;r<c&&o[r]===m[r];r++);var E=c-r;for(u=1;u<=E&&o[c-u]===m[y-u];u++);return of=m.slice(r,1<u?1-u:void 0)}function af(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function cf(){return!0}function Tx(){return!1}function Ln(r){function o(c,u,m,y,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var O in r)r.hasOwnProperty(O)&&(c=r[O],this[O]=c?c(y):y[O]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?cf:Tx,this.isPropagationStopped=Tx,this}return v(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=cf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=cf)},persist:function(){},isPersistent:cf}),o}var bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=Ln(bi),sl=v({},bi,{view:0,detail:0}),pA=Ln(sl),kp,Mp,ol,uf=v({},sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ol&&(ol&&r.type==="mousemove"?(kp=r.screenX-ol.screenX,Mp=r.screenY-ol.screenY):Mp=kp=0,ol=r),kp)},movementY:function(r){return"movementY"in r?r.movementY:Mp}}),Rx=Ln(uf),mA=v({},uf,{dataTransfer:0}),gA=Ln(mA),yA=v({},sl,{relatedTarget:0}),Ip=Ln(yA),vA=v({},bi,{animationName:0,elapsedTime:0,pseudoElement:0}),bA=Ln(vA),xA=v({},bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),SA=Ln(xA),_A=v({},bi,{data:0}),Cx=Ln(_A),wA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EA={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"},TA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RA(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=TA[r])?!!o[r]:!1}function Pp(){return RA}var CA=v({},sl,{key:function(r){if(r.key){var o=wA[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=af(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?EA[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pp,charCode:function(r){return r.type==="keypress"?af(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?af(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),NA=Ln(CA),jA=v({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nx=Ln(jA),OA=v({},sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pp}),AA=Ln(OA),kA=v({},bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),MA=Ln(kA),IA=v({},uf,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),PA=Ln(IA),zA=v({},bi,{newState:0,oldState:0}),DA=Ln(zA),LA=[9,13,27,32],zp=ws&&"CompositionEvent"in window,il=null;ws&&"documentMode"in document&&(il=document.documentMode);var UA=ws&&"TextEvent"in window&&!il,jx=ws&&(!zp||il&&8<il&&11>=il),Ox=" ",Ax=!1;function kx(r,o){switch(r){case"keyup":return LA.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ea=!1;function $A(r,o){switch(r){case"compositionend":return Mx(o);case"keypress":return o.which!==32?null:(Ax=!0,Ox);case"textInput":return r=o.data,r===Ox&&Ax?null:r;default:return null}}function BA(r,o){if(Ea)return r==="compositionend"||!zp&&kx(r,o)?(r=Ex(),of=Ap=co=null,Ea=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return jx&&o.locale!=="ko"?null:o.data;default:return null}}var FA={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 Ix(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!FA[r.type]:o==="textarea"}function Px(r,o,c,u){_a?wa?wa.push(u):wa=[u]:_a=u,o=Jf(o,"onChange"),0<o.length&&(c=new lf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var al=null,cl=null;function HA(r){y_(r,0)}function ff(r){var o=tl(r);if(gx(o))return r}function zx(r,o){if(r==="change")return o}var Dx=!1;if(ws){var Dp;if(ws){var Lp="oninput"in document;if(!Lp){var Lx=document.createElement("div");Lx.setAttribute("oninput","return;"),Lp=typeof Lx.oninput=="function"}Dp=Lp}else Dp=!1;Dx=Dp&&(!document.documentMode||9<document.documentMode)}function Ux(){al&&(al.detachEvent("onpropertychange",$x),cl=al=null)}function $x(r){if(r.propertyName==="value"&&ff(cl)){var o=[];Px(o,cl,r,Np(r)),wx(HA,o)}}function qA(r,o,c){r==="focusin"?(Ux(),al=o,cl=c,al.attachEvent("onpropertychange",$x)):r==="focusout"&&Ux()}function VA(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ff(cl)}function GA(r,o){if(r==="click")return ff(o)}function KA(r,o){if(r==="input"||r==="change")return ff(o)}function ZA(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Wn=typeof Object.is=="function"?Object.is:ZA;function ll(r,o){if(Wn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(u=0;u<c.length;u++){var m=c[u];if(!ke.call(o,m)||!Wn(r[m],o[m]))return!1}return!0}function Bx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Fx(r,o){var c=Bx(r);r=0;for(var u;c;){if(c.nodeType===3){if(u=r+c.textContent.length,r<=o&&u>=o)return{node:c,offset:o-r};r=u}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Bx(c)}}function Hx(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Hx(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function qx(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=rf(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=rf(r.document)}return o}function Up(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var YA=ws&&"documentMode"in document&&11>=document.documentMode,Ta=null,$p=null,ul=null,Bp=!1;function Vx(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Bp||Ta==null||Ta!==rf(u)||(u=Ta,"selectionStart"in u&&Up(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ul&&ll(ul,u)||(ul=u,u=Jf($p,"onSelect"),0<u.length&&(o=new lf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ta)))}function xi(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ra={animationend:xi("Animation","AnimationEnd"),animationiteration:xi("Animation","AnimationIteration"),animationstart:xi("Animation","AnimationStart"),transitionrun:xi("Transition","TransitionRun"),transitionstart:xi("Transition","TransitionStart"),transitioncancel:xi("Transition","TransitionCancel"),transitionend:xi("Transition","TransitionEnd")},Fp={},Gx={};ws&&(Gx=document.createElement("div").style,"AnimationEvent"in window||(delete Ra.animationend.animation,delete Ra.animationiteration.animation,delete Ra.animationstart.animation),"TransitionEvent"in window||delete Ra.transitionend.transition);function Si(r){if(Fp[r])return Fp[r];if(!Ra[r])return r;var o=Ra[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in Gx)return Fp[r]=o[c];return r}var Kx=Si("animationend"),Zx=Si("animationiteration"),Yx=Si("animationstart"),XA=Si("transitionrun"),QA=Si("transitionstart"),WA=Si("transitioncancel"),Xx=Si("transitionend"),Qx=new Map,Hp="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(" ");Hp.push("scrollEnd");function Zr(r,o){Qx.set(r,o),vi(o,[r])}var df=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Sr=[],Ca=0,qp=0;function hf(){for(var r=Ca,o=qp=Ca=0;o<r;){var c=Sr[o];Sr[o++]=null;var u=Sr[o];Sr[o++]=null;var m=Sr[o];Sr[o++]=null;var y=Sr[o];if(Sr[o++]=null,u!==null&&m!==null){var E=u.pending;E===null?m.next=m:(m.next=E.next,E.next=m),u.pending=m}y!==0&&Wx(c,m,y)}}function pf(r,o,c,u){Sr[Ca++]=r,Sr[Ca++]=o,Sr[Ca++]=c,Sr[Ca++]=u,qp|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Vp(r,o,c,u){return pf(r,o,c,u),mf(r)}function _i(r,o){return pf(r,null,null,o),mf(r)}function Wx(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,y=r.return;y!==null;)y.childLanes|=c,u=y.alternate,u!==null&&(u.childLanes|=c),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(m=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,m&&o!==null&&(m=31-vt(c),r=y.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),y):null}function mf(r){if(50<kl)throw kl=0,eg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Na={};function JA(r,o,c,u){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(r,o,c,u){return new JA(r,o,c,u)}function Gp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Es(r,o){var c=r.alternate;return c===null?(c=Jn(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function Jx(r,o){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function gf(r,o,c,u,m,y){var E=0;if(u=r,typeof r=="function")Gp(r)&&(E=1);else if(typeof r=="string")E=sM(r,c,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case z:return r=Jn(31,c,o,m),r.elementType=z,r.lanes=y,r;case w:return wi(c.children,m,y,o);case T:E=8,m|=24;break;case R:return r=Jn(12,c,o,m|2),r.elementType=R,r.lanes=y,r;case I:return r=Jn(13,c,o,m),r.elementType=I,r.lanes=y,r;case D:return r=Jn(19,c,o,m),r.elementType=D,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case j:E=10;break e;case k:E=9;break e;case C:E=11;break e;case N:E=14;break e;case A:E=16,u=null;break e}E=29,c=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=Jn(E,c,o,m),o.elementType=r,o.type=u,o.lanes=y,o}function wi(r,o,c,u){return r=Jn(7,r,u,o),r.lanes=c,r}function Kp(r,o,c){return r=Jn(6,r,null,o),r.lanes=c,r}function e0(r){var o=Jn(18,null,null,0);return o.stateNode=r,o}function Zp(r,o,c){return o=Jn(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var t0=new WeakMap;function _r(r,o){if(typeof r=="object"&&r!==null){var c=t0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ve(o)},t0.set(r,o),o)}return{value:r,source:o,stack:ve(o)}}var ja=[],Oa=0,yf=null,fl=0,wr=[],Er=0,lo=null,as=1,cs="";function Ts(r,o){ja[Oa++]=fl,ja[Oa++]=yf,yf=r,fl=o}function n0(r,o,c){wr[Er++]=as,wr[Er++]=cs,wr[Er++]=lo,lo=r;var u=as;r=cs;var m=32-vt(u)-1;u&=~(1<<m),c+=1;var y=32-vt(o)+m;if(30<y){var E=m-m%5;y=(u&(1<<E)-1).toString(32),u>>=E,m-=E,as=1<<32-vt(o)+m|c<<m|u,cs=y+r}else as=1<<y|c<<m|u,cs=r}function Yp(r){r.return!==null&&(Ts(r,1),n0(r,1,0))}function Xp(r){for(;r===yf;)yf=ja[--Oa],ja[Oa]=null,fl=ja[--Oa],ja[Oa]=null;for(;r===lo;)lo=wr[--Er],wr[Er]=null,cs=wr[--Er],wr[Er]=null,as=wr[--Er],wr[Er]=null}function r0(r,o){wr[Er++]=as,wr[Er++]=cs,wr[Er++]=lo,as=o.id,cs=o.overflow,lo=r}var vn=null,At=null,rt=!1,uo=null,Tr=!1,Qp=Error(s(519));function fo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dl(_r(o,r)),Qp}function s0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[yn]=r,o[Dn]=u,c){case"dialog":et("cancel",o),et("close",o);break;case"iframe":case"object":case"embed":et("load",o);break;case"video":case"audio":for(c=0;c<Il.length;c++)et(Il[c],o);break;case"source":et("error",o);break;case"img":case"image":case"link":et("error",o),et("load",o);break;case"details":et("toggle",o);break;case"input":et("invalid",o),yx(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":et("invalid",o);break;case"textarea":et("invalid",o),bx(o,u.value,u.defaultValue,u.children)}c=u.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||u.suppressHydrationWarning===!0||S_(o.textContent,c)?(u.popover!=null&&(et("beforetoggle",o),et("toggle",o)),u.onScroll!=null&&et("scroll",o),u.onScrollEnd!=null&&et("scrollend",o),u.onClick!=null&&(o.onclick=_s),o=!0):o=!1,o||fo(r,!0)}function o0(r){for(vn=r.return;vn;)switch(vn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:vn=vn.return}}function Aa(r){if(r!==vn)return!1;if(!rt)return o0(r),rt=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||mg(r.type,r.memoizedProps)),c=!c),c&&At&&fo(r),o0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));At=O_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));At=O_(r)}else o===27?(o=At,Ro(r.type)?(r=xg,xg=null,At=r):At=o):At=vn?Cr(r.stateNode.nextSibling):null;return!0}function Ei(){At=vn=null,rt=!1}function Wp(){var r=uo;return r!==null&&(Fn===null?Fn=r:Fn.push.apply(Fn,r),uo=null),r}function dl(r){uo===null?uo=[r]:uo.push(r)}var Jp=M(null),Ti=null,Rs=null;function ho(r,o,c){W(Jp,o._currentValue),o._currentValue=c}function Cs(r){r._currentValue=Jp.current,K(Jp)}function em(r,o,c){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===c)break;r=r.return}}function tm(r,o,c,u){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var y=m.dependencies;if(y!==null){var E=m.child;y=y.firstContext;e:for(;y!==null;){var O=y;y=m;for(var $=0;$<o.length;$++)if(O.context===o[$]){y.lanes|=c,O=y.alternate,O!==null&&(O.lanes|=c),em(y.return,c,r),u||(E=null);break e}y=O.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,y=E.alternate,y!==null&&(y.lanes|=c),em(E,c,r),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===r){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function ka(r,o,c,u){r=null;for(var m=o,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(s(387));if(E=E.memoizedProps,E!==null){var O=m.type;Wn(m.pendingProps.value,E.value)||(r!==null?r.push(O):r=[O])}}else if(m===ce.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Ul):r=[Ul])}m=m.return}r!==null&&tm(o,r,c,u),o.flags|=262144}function vf(r){for(r=r.firstContext;r!==null;){if(!Wn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ri(r){Ti=r,Rs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function bn(r){return i0(Ti,r)}function bf(r,o){return Ti===null&&Ri(r),i0(r,o)}function i0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Rs===null){if(r===null)throw Error(s(308));Rs=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Rs=Rs.next=o;return c}var ek=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},tk=e.unstable_scheduleCallback,nk=e.unstable_NormalPriority,Jt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nm(){return{controller:new ek,data:new Map,refCount:0}}function hl(r){r.refCount--,r.refCount===0&&tk(nk,function(){r.controller.abort()})}var pl=null,rm=0,Ma=0,Ia=null;function rk(r,o){if(pl===null){var c=pl=[];rm=0,Ma=ig(),Ia={status:"pending",value:void 0,then:function(u){c.push(u)}}}return rm++,o.then(a0,a0),o}function a0(){if(--rm===0&&pl!==null){Ia!==null&&(Ia.status="fulfilled");var r=pl;pl=null,Ma=0,Ia=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function sk(r,o){var c=[],u={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var m=0;m<c.length;m++)(0,c[m])(o)},function(m){for(u.status="rejected",u.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),u}var c0=P.S;P.S=function(r,o){VS=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&rk(r,o),c0!==null&&c0(r,o)};var Ci=M(null);function sm(){var r=Ci.current;return r!==null?r:Rt.pooledCache}function xf(r,o){o===null?W(Ci,Ci.current):W(Ci,o.pool)}function l0(){var r=sm();return r===null?null:{parent:Jt._currentValue,pool:r}}var Pa=Error(s(460)),om=Error(s(474)),Sf=Error(s(542)),_f={then:function(){}};function u0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function f0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(_s,_s),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,h0(r),r;default:if(typeof o.status=="string")o.then(_s,_s);else{if(r=Rt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var m=o;m.status="fulfilled",m.value=u}},function(u){if(o.status==="pending"){var m=o;m.status="rejected",m.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,h0(r),r}throw ji=o,Pa}}function Ni(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ji=c,Pa):c}}var ji=null;function d0(){if(ji===null)throw Error(s(459));var r=ji;return ji=null,r}function h0(r){if(r===Pa||r===Sf)throw Error(s(483))}var za=null,ml=0;function wf(r){var o=ml;return ml+=1,za===null&&(za=[]),f0(za,r,o)}function gl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Ef(r,o){throw o.$$typeof===b?Error(s(525)):(r=Object.prototype.toString.call(o),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function p0(r){function o(Q,B){if(r){var J=Q.deletions;J===null?(Q.deletions=[B],Q.flags|=16):J.push(B)}}function c(Q,B){if(!r)return null;for(;B!==null;)o(Q,B),B=B.sibling;return null}function u(Q){for(var B=new Map;Q!==null;)Q.key!==null?B.set(Q.key,Q):B.set(Q.index,Q),Q=Q.sibling;return B}function m(Q,B){return Q=Es(Q,B),Q.index=0,Q.sibling=null,Q}function y(Q,B,J){return Q.index=J,r?(J=Q.alternate,J!==null?(J=J.index,J<B?(Q.flags|=67108866,B):J):(Q.flags|=67108866,B)):(Q.flags|=1048576,B)}function E(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function O(Q,B,J,ue){return B===null||B.tag!==6?(B=Kp(J,Q.mode,ue),B.return=Q,B):(B=m(B,J),B.return=Q,B)}function $(Q,B,J,ue){var ze=J.type;return ze===w?ae(Q,B,J.props.children,ue,J.key):B!==null&&(B.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ni(ze)===B.type)?(B=m(B,J.props),gl(B,J),B.return=Q,B):(B=gf(J.type,J.key,J.props,null,Q.mode,ue),gl(B,J),B.return=Q,B)}function ee(Q,B,J,ue){return B===null||B.tag!==4||B.stateNode.containerInfo!==J.containerInfo||B.stateNode.implementation!==J.implementation?(B=Zp(J,Q.mode,ue),B.return=Q,B):(B=m(B,J.children||[]),B.return=Q,B)}function ae(Q,B,J,ue,ze){return B===null||B.tag!==7?(B=wi(J,Q.mode,ue,ze),B.return=Q,B):(B=m(B,J),B.return=Q,B)}function de(Q,B,J){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Kp(""+B,Q.mode,J),B.return=Q,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return J=gf(B.type,B.key,B.props,null,Q.mode,J),gl(J,B),J.return=Q,J;case S:return B=Zp(B,Q.mode,J),B.return=Q,B;case A:return B=Ni(B),de(Q,B,J)}if(te(B)||L(B))return B=wi(B,Q.mode,J,null),B.return=Q,B;if(typeof B.then=="function")return de(Q,wf(B),J);if(B.$$typeof===j)return de(Q,bf(Q,B),J);Ef(Q,B)}return null}function ne(Q,B,J,ue){var ze=B!==null?B.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:O(Q,B,""+J,ue);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(Q,B,J,ue):null;case S:return J.key===ze?ee(Q,B,J,ue):null;case A:return J=Ni(J),ne(Q,B,J,ue)}if(te(J)||L(J))return ze!==null?null:ae(Q,B,J,ue,null);if(typeof J.then=="function")return ne(Q,B,wf(J),ue);if(J.$$typeof===j)return ne(Q,B,bf(Q,J),ue);Ef(Q,J)}return null}function se(Q,B,J,ue,ze){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Q=Q.get(J)||null,O(B,Q,""+ue,ze);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return Q=Q.get(ue.key===null?J:ue.key)||null,$(B,Q,ue,ze);case S:return Q=Q.get(ue.key===null?J:ue.key)||null,ee(B,Q,ue,ze);case A:return ue=Ni(ue),se(Q,B,J,ue,ze)}if(te(ue)||L(ue))return Q=Q.get(J)||null,ae(B,Q,ue,ze,null);if(typeof ue.then=="function")return se(Q,B,J,wf(ue),ze);if(ue.$$typeof===j)return se(Q,B,J,bf(B,ue),ze);Ef(B,ue)}return null}function Re(Q,B,J,ue){for(var ze=null,ft=null,Ae=B,Ye=B=0,nt=null;Ae!==null&&Ye<J.length;Ye++){Ae.index>Ye?(nt=Ae,Ae=null):nt=Ae.sibling;var dt=ne(Q,Ae,J[Ye],ue);if(dt===null){Ae===null&&(Ae=nt);break}r&&Ae&&dt.alternate===null&&o(Q,Ae),B=y(dt,B,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,Ae=nt}if(Ye===J.length)return c(Q,Ae),rt&&Ts(Q,Ye),ze;if(Ae===null){for(;Ye<J.length;Ye++)Ae=de(Q,J[Ye],ue),Ae!==null&&(B=y(Ae,B,Ye),ft===null?ze=Ae:ft.sibling=Ae,ft=Ae);return rt&&Ts(Q,Ye),ze}for(Ae=u(Ae);Ye<J.length;Ye++)nt=se(Ae,Q,Ye,J[Ye],ue),nt!==null&&(r&&nt.alternate!==null&&Ae.delete(nt.key===null?Ye:nt.key),B=y(nt,B,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&Ae.forEach(function(Ao){return o(Q,Ao)}),rt&&Ts(Q,Ye),ze}function Ue(Q,B,J,ue){if(J==null)throw Error(s(151));for(var ze=null,ft=null,Ae=B,Ye=B=0,nt=null,dt=J.next();Ae!==null&&!dt.done;Ye++,dt=J.next()){Ae.index>Ye?(nt=Ae,Ae=null):nt=Ae.sibling;var Ao=ne(Q,Ae,dt.value,ue);if(Ao===null){Ae===null&&(Ae=nt);break}r&&Ae&&Ao.alternate===null&&o(Q,Ae),B=y(Ao,B,Ye),ft===null?ze=Ao:ft.sibling=Ao,ft=Ao,Ae=nt}if(dt.done)return c(Q,Ae),rt&&Ts(Q,Ye),ze;if(Ae===null){for(;!dt.done;Ye++,dt=J.next())dt=de(Q,dt.value,ue),dt!==null&&(B=y(dt,B,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ts(Q,Ye),ze}for(Ae=u(Ae);!dt.done;Ye++,dt=J.next())dt=se(Ae,Q,Ye,dt.value,ue),dt!==null&&(r&&dt.alternate!==null&&Ae.delete(dt.key===null?Ye:dt.key),B=y(dt,B,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&Ae.forEach(function(mM){return o(Q,mM)}),rt&&Ts(Q,Ye),ze}function Et(Q,B,J,ue){if(typeof J=="object"&&J!==null&&J.type===w&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var ze=J.key;B!==null;){if(B.key===ze){if(ze=J.type,ze===w){if(B.tag===7){c(Q,B.sibling),ue=m(B,J.props.children),ue.return=Q,Q=ue;break e}}else if(B.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ni(ze)===B.type){c(Q,B.sibling),ue=m(B,J.props),gl(ue,J),ue.return=Q,Q=ue;break e}c(Q,B);break}else o(Q,B);B=B.sibling}J.type===w?(ue=wi(J.props.children,Q.mode,ue,J.key),ue.return=Q,Q=ue):(ue=gf(J.type,J.key,J.props,null,Q.mode,ue),gl(ue,J),ue.return=Q,Q=ue)}return E(Q);case S:e:{for(ze=J.key;B!==null;){if(B.key===ze)if(B.tag===4&&B.stateNode.containerInfo===J.containerInfo&&B.stateNode.implementation===J.implementation){c(Q,B.sibling),ue=m(B,J.children||[]),ue.return=Q,Q=ue;break e}else{c(Q,B);break}else o(Q,B);B=B.sibling}ue=Zp(J,Q.mode,ue),ue.return=Q,Q=ue}return E(Q);case A:return J=Ni(J),Et(Q,B,J,ue)}if(te(J))return Re(Q,B,J,ue);if(L(J)){if(ze=L(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),Ue(Q,B,J,ue)}if(typeof J.then=="function")return Et(Q,B,wf(J),ue);if(J.$$typeof===j)return Et(Q,B,bf(Q,J),ue);Ef(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,B!==null&&B.tag===6?(c(Q,B.sibling),ue=m(B,J),ue.return=Q,Q=ue):(c(Q,B),ue=Kp(J,Q.mode,ue),ue.return=Q,Q=ue),E(Q)):c(Q,B)}return function(Q,B,J,ue){try{ml=0;var ze=Et(Q,B,J,ue);return za=null,ze}catch(Ae){if(Ae===Pa||Ae===Sf)throw Ae;var ft=Jn(29,Ae,null,Q.mode);return ft.lanes=ue,ft.return=Q,ft}}}var Oi=p0(!0),m0=p0(!1),po=!1;function im(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function am(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function mo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function go(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(pt&2)!==0){var m=u.pending;return m===null?o.next=o:(o.next=m.next,m.next=o),u.pending=o,o=mf(r),Wx(r,null,c),o}return pf(r,u,o,c),mf(r)}function yl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,oo(r,c)}}function cm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?m=y=E:y=y.next=E,c=c.next}while(c!==null);y===null?m=y=o:y=y.next=o}else m=y=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var lm=!1;function vl(){if(lm){var r=Ia;if(r!==null)throw r}}function bl(r,o,c,u){lm=!1;var m=r.updateQueue;po=!1;var y=m.firstBaseUpdate,E=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var $=O,ee=$.next;$.next=null,E===null?y=ee:E.next=ee,E=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,O=ae.lastBaseUpdate,O!==E&&(O===null?ae.firstBaseUpdate=ee:O.next=ee,ae.lastBaseUpdate=$))}if(y!==null){var de=m.baseState;E=0,ae=ee=$=null,O=y;do{var ne=O.lane&-536870913,se=ne!==O.lane;if(se?(tt&ne)===ne:(u&ne)===ne){ne!==0&&ne===Ma&&(lm=!0),ae!==null&&(ae=ae.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Re=r,Ue=O;ne=o;var Et=c;switch(Ue.tag){case 1:if(Re=Ue.payload,typeof Re=="function"){de=Re.call(Et,de,ne);break e}de=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ue.payload,ne=typeof Re=="function"?Re.call(Et,de,ne):Re,ne==null)break e;de=v({},de,ne);break e;case 2:po=!0}}ne=O.callback,ne!==null&&(r.flags|=64,se&&(r.flags|=8192),se=m.callbacks,se===null?m.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ae===null?(ee=ae=se,$=de):ae=ae.next=se,E|=ne;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;se=O,O=se.next,se.next=null,m.lastBaseUpdate=se,m.shared.pending=null}}while(!0);ae===null&&($=de),m.baseState=$,m.firstBaseUpdate=ee,m.lastBaseUpdate=ae,y===null&&(m.shared.lanes=0),So|=E,r.lanes=E,r.memoizedState=de}}function g0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function y0(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)g0(c[r],o)}var Da=M(null),Tf=M(0);function v0(r,o){r=zs,W(Tf,r),W(Da,o),zs=r|o.baseLanes}function um(){W(Tf,zs),W(Da,Da.current)}function fm(){zs=Tf.current,K(Da),K(Tf)}var er=M(null),Rr=null;function yo(r){var o=r.alternate;W(Xt,Xt.current&1),W(er,r),Rr===null&&(o===null||Da.current!==null||o.memoizedState!==null)&&(Rr=r)}function dm(r){W(Xt,Xt.current),W(er,r),Rr===null&&(Rr=r)}function b0(r){r.tag===22?(W(Xt,Xt.current),W(er,r),Rr===null&&(Rr=r)):vo()}function vo(){W(Xt,Xt.current),W(er,er.current)}function tr(r){K(er),Rr===r&&(Rr=null),K(Xt)}var Xt=M(0);function Rf(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||vg(c)||bg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ns=0,Ze=null,_t=null,en=null,Cf=!1,La=!1,Ai=!1,Nf=0,xl=0,Ua=null,ok=0;function Ft(){throw Error(s(321))}function hm(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!Wn(r[c],o[c]))return!1;return!0}function pm(r,o,c,u,m,y){return Ns=y,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,P.H=r===null||r.memoizedState===null?nS:jm,Ai=!1,y=c(u,m),Ai=!1,La&&(y=S0(o,c,u,m)),x0(r),y}function x0(r){P.H=wl;var o=_t!==null&&_t.next!==null;if(Ns=0,en=_t=Ze=null,Cf=!1,xl=0,Ua=null,o)throw Error(s(300));r===null||tn||(r=r.dependencies,r!==null&&vf(r)&&(tn=!0))}function S0(r,o,c,u){Ze=r;var m=0;do{if(La&&(Ua=null),xl=0,La=!1,25<=m)throw Error(s(301));if(m+=1,en=_t=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}P.H=rS,y=o(c,u)}while(La);return y}function ik(){var r=P.H,o=r.useState()[0];return o=typeof o.then=="function"?Sl(o):o,r=r.useState()[0],(_t!==null?_t.memoizedState:null)!==r&&(Ze.flags|=1024),o}function mm(){var r=Nf!==0;return Nf=0,r}function gm(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function ym(r){if(Cf){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Cf=!1}Ns=0,en=_t=Ze=null,La=!1,xl=Nf=0,Ua=null}function Nn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Ze.memoizedState=en=r:en=en.next=r,en}function Qt(){if(_t===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=_t.next;var o=en===null?Ze.memoizedState:en.next;if(o!==null)en=o,_t=r;else{if(r===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));_t=r,r={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},en===null?Ze.memoizedState=en=r:en=en.next=r}return en}function jf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sl(r){var o=xl;return xl+=1,Ua===null&&(Ua=[]),r=f0(Ua,r,o),o=Ze,(en===null?o.memoizedState:en.next)===null&&(o=o.alternate,P.H=o===null||o.memoizedState===null?nS:jm),r}function Of(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Sl(r);if(r.$$typeof===j)return bn(r)}throw Error(s(438,String(r)))}function vm(r){var o=null,c=Ze.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var u=Ze.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(m){return m.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=jf(),Ze.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),u=0;u<r;u++)c[u]=X;return o.index++,c}function js(r,o){return typeof o=="function"?o(r):o}function Af(r){var o=Qt();return bm(o,_t,r)}function bm(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;var m=r.baseQueue,y=u.pending;if(y!==null){if(m!==null){var E=m.next;m.next=y.next,y.next=E}o.baseQueue=m=y,u.pending=null}if(y=r.baseState,m===null)r.memoizedState=y;else{o=m.next;var O=E=null,$=null,ee=o,ae=!1;do{var de=ee.lane&-536870913;if(de!==ee.lane?(tt&de)===de:(Ns&de)===de){var ne=ee.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),de===Ma&&(ae=!0);else if((Ns&ne)===ne){ee=ee.next,ne===Ma&&(ae=!0);continue}else de={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(O=$=de,E=y):$=$.next=de,Ze.lanes|=ne,So|=ne;de=ee.action,Ai&&c(y,de),y=ee.hasEagerState?ee.eagerState:c(y,de)}else ne={lane:de,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(O=$=ne,E=y):$=$.next=ne,Ze.lanes|=de,So|=de;ee=ee.next}while(ee!==null&&ee!==o);if($===null?E=y:$.next=O,!Wn(y,r.memoizedState)&&(tn=!0,ae&&(c=Ia,c!==null)))throw c;r.memoizedState=y,r.baseState=E,r.baseQueue=$,u.lastRenderedState=y}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function xm(r){var o=Qt(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,y=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do y=r(y,E.action),E=E.next;while(E!==m);Wn(y,o.memoizedState)||(tn=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),c.lastRenderedState=y}return[y,u]}function _0(r,o,c){var u=Ze,m=Qt(),y=rt;if(y){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!Wn((_t||m).memoizedState,c);if(E&&(m.memoizedState=c,tn=!0),m=m.queue,wm(T0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||en!==null&&en.memoizedState.tag&1){if(u.flags|=2048,$a(9,{destroy:void 0},E0.bind(null,u,m,c,o),null),Rt===null)throw Error(s(349));y||(Ns&127)!==0||w0(u,o,c)}return c}function w0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=jf(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function E0(r,o,c,u){o.value=c,o.getSnapshot=u,R0(o)&&C0(r)}function T0(r,o,c){return c(function(){R0(o)&&C0(r)})}function R0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!Wn(r,c)}catch{return!0}}function C0(r){var o=_i(r,2);o!==null&&Hn(o,r,2)}function Sm(r){var o=Nn();if(typeof r=="function"){var c=r;if(r=c(),Ai){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:r},o}function N0(r,o,c,u){return r.baseState=c,bm(r,_t,typeof u=="function"?u:js)}function ak(r,o,c,u,m){if(If(r))throw Error(s(485));if(r=o.action,r!==null){var y={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};P.T!==null?c(!0):y.isTransition=!1,u(y),c=o.pending,c===null?(y.next=o.pending=y,j0(o,y)):(y.next=c.next,o.pending=c.next=y)}}function j0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var y=P.T,E={};P.T=E;try{var O=c(m,u),$=P.S;$!==null&&$(E,O),O0(r,o,O)}catch(ee){_m(r,o,ee)}finally{y!==null&&E.types!==null&&(y.types=E.types),P.T=y}}else try{y=c(m,u),O0(r,o,y)}catch(ee){_m(r,o,ee)}}function O0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){A0(r,o,u)},function(u){return _m(r,o,u)}):A0(r,o,c)}function A0(r,o,c){o.status="fulfilled",o.value=c,k0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,j0(r,c)))}function _m(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,k0(o),o=o.next;while(o!==u)}r.action=null}function k0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function M0(r,o){return o}function I0(r,o){if(rt){var c=Rt.formState;if(c!==null){e:{var u=Ze;if(rt){if(At){t:{for(var m=At,y=Tr;m.nodeType!==8;){if(!y){m=null;break t}if(m=Cr(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){At=Cr(m.nextSibling),u=m.data==="F!";break e}}fo(u)}u=!1}u&&(o=c[0])}}return c=Nn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:M0,lastRenderedState:o},c.queue=u,c=J0.bind(null,Ze,u),u.dispatch=c,u=Sm(!1),y=Nm.bind(null,Ze,!1,u.queue),u=Nn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=ak.bind(null,Ze,m,y,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function P0(r){var o=Qt();return z0(o,_t,r)}function z0(r,o,c){if(o=bm(r,o,M0)[0],r=Af(js)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Sl(o)}catch(E){throw E===Pa?Sf:E}else u=o;o=Qt();var m=o.queue,y=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,$a(9,{destroy:void 0},ck.bind(null,m,c),null)),[u,y,r]}function ck(r,o){r.action=o}function D0(r){var o=Qt(),c=_t;if(c!==null)return z0(o,c,r);Qt(),o=o.memoizedState,c=Qt();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function $a(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=jf(),Ze.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(u=c.next,c.next=r,r.next=u,o.lastEffect=r),r}function L0(){return Qt().memoizedState}function kf(r,o,c,u){var m=Nn();Ze.flags|=r,m.memoizedState=$a(1|o,{destroy:void 0},c,u===void 0?null:u)}function Mf(r,o,c,u){var m=Qt();u=u===void 0?null:u;var y=m.memoizedState.inst;_t!==null&&u!==null&&hm(u,_t.memoizedState.deps)?m.memoizedState=$a(o,y,c,u):(Ze.flags|=r,m.memoizedState=$a(1|o,y,c,u))}function U0(r,o){kf(8390656,8,r,o)}function wm(r,o){Mf(2048,8,r,o)}function lk(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=jf(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function $0(r){var o=Qt().memoizedState;return lk({ref:o,nextImpl:r}),function(){if((pt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function B0(r,o){return Mf(4,2,r,o)}function F0(r,o){return Mf(4,4,r,o)}function H0(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function q0(r,o,c){c=c!=null?c.concat([r]):null,Mf(4,4,H0.bind(null,o,r),c)}function Em(){}function V0(r,o){var c=Qt();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&hm(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function G0(r,o){var c=Qt();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&hm(o,u[1]))return u[0];if(u=r(),Ai){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Tm(r,o,c){return c===void 0||(Ns&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=KS(),Ze.lanes|=r,So|=r,c)}function K0(r,o,c,u){return Wn(c,o)?c:Da.current!==null?(r=Tm(r,c,u),Wn(r,o)||(tn=!0),r):(Ns&42)===0||(Ns&1073741824)!==0&&(tt&261930)===0?(tn=!0,r.memoizedState=c):(r=KS(),Ze.lanes|=r,So|=r,o)}function Z0(r,o,c,u,m){var y=V.p;V.p=y!==0&&8>y?y:8;var E=P.T,O={};P.T=O,Nm(r,!1,o,c);try{var $=m(),ee=P.S;if(ee!==null&&ee(O,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=sk($,u);_l(r,o,ae,sr(r))}else _l(r,o,u,sr(r))}catch(de){_l(r,o,{then:function(){},status:"rejected",reason:de},sr())}finally{V.p=y,E!==null&&O.types!==null&&(E.types=O.types),P.T=E}}function uk(){}function Rm(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=Y0(r).queue;Z0(r,m,o,U,c===null?uk:function(){return X0(r),c(u)})}function Y0(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:U},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function X0(r){var o=Y0(r);o.next===null&&(o=r.alternate.memoizedState),_l(r,o.next.queue,{},sr())}function Cm(){return bn(Ul)}function Q0(){return Qt().memoizedState}function W0(){return Qt().memoizedState}function fk(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=sr();r=mo(c);var u=go(o,r,c);u!==null&&(Hn(u,o,c),yl(u,o,c)),o={cache:nm()},r.payload=o;return}o=o.return}}function dk(r,o,c){var u=sr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},If(r)?eS(o,c):(c=Vp(r,o,c,u),c!==null&&(Hn(c,r,u),tS(c,o,u)))}function J0(r,o,c){var u=sr();_l(r,o,c,u)}function _l(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(If(r))eS(o,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var E=o.lastRenderedState,O=y(E,c);if(m.hasEagerState=!0,m.eagerState=O,Wn(O,E))return pf(r,o,m,0),Rt===null&&hf(),!1}catch{}if(c=Vp(r,o,m,u),c!==null)return Hn(c,r,u),tS(c,o,u),!0}return!1}function Nm(r,o,c,u){if(u={lane:2,revertLane:ig(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},If(r)){if(o)throw Error(s(479))}else o=Vp(r,c,u,2),o!==null&&Hn(o,r,2)}function If(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function eS(r,o){La=Cf=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function tS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,oo(r,c)}}var wl={readContext:bn,use:Of,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};wl.useEffectEvent=Ft;var nS={readContext:bn,use:Of,useCallback:function(r,o){return Nn().memoizedState=[r,o===void 0?null:o],r},useContext:bn,useEffect:U0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,kf(4194308,4,H0.bind(null,o,r),c)},useLayoutEffect:function(r,o){return kf(4194308,4,r,o)},useInsertionEffect:function(r,o){kf(4,2,r,o)},useMemo:function(r,o){var c=Nn();o=o===void 0?null:o;var u=r();if(Ai){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=Nn();if(c!==void 0){var m=c(o);if(Ai){ut(!0);try{c(o)}finally{ut(!1)}}}else m=o;return u.memoizedState=u.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},u.queue=r,r=r.dispatch=dk.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=Nn();return r={current:r},o.memoizedState=r},useState:function(r){r=Sm(r);var o=r.queue,c=J0.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Em,useDeferredValue:function(r,o){var c=Nn();return Tm(c,r,o)},useTransition:function(){var r=Sm(!1);return r=Z0.bind(null,Ze,r.queue,!0,!1),Nn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=Nn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Rt===null)throw Error(s(349));(tt&127)!==0||w0(u,o,c)}m.memoizedState=c;var y={value:c,getSnapshot:o};return m.queue=y,U0(T0.bind(null,u,y,r),[r]),u.flags|=2048,$a(9,{destroy:void 0},E0.bind(null,u,y,c,o),null),c},useId:function(){var r=Nn(),o=Rt.identifierPrefix;if(rt){var c=cs,u=as;c=(u&~(1<<32-vt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Nf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=ok++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Cm,useFormState:I0,useActionState:I0,useOptimistic:function(r){var o=Nn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Nm.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:vm,useCacheRefresh:function(){return Nn().memoizedState=fk.bind(null,Ze)},useEffectEvent:function(r){var o=Nn(),c={impl:r};return o.memoizedState=c,function(){if((pt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},jm={readContext:bn,use:Of,useCallback:V0,useContext:bn,useEffect:wm,useImperativeHandle:q0,useInsertionEffect:B0,useLayoutEffect:F0,useMemo:G0,useReducer:Af,useRef:L0,useState:function(){return Af(js)},useDebugValue:Em,useDeferredValue:function(r,o){var c=Qt();return K0(c,_t.memoizedState,r,o)},useTransition:function(){var r=Af(js)[0],o=Qt().memoizedState;return[typeof r=="boolean"?r:Sl(r),o]},useSyncExternalStore:_0,useId:Q0,useHostTransitionStatus:Cm,useFormState:P0,useActionState:P0,useOptimistic:function(r,o){var c=Qt();return N0(c,_t,r,o)},useMemoCache:vm,useCacheRefresh:W0};jm.useEffectEvent=$0;var rS={readContext:bn,use:Of,useCallback:V0,useContext:bn,useEffect:wm,useImperativeHandle:q0,useInsertionEffect:B0,useLayoutEffect:F0,useMemo:G0,useReducer:xm,useRef:L0,useState:function(){return xm(js)},useDebugValue:Em,useDeferredValue:function(r,o){var c=Qt();return _t===null?Tm(c,r,o):K0(c,_t.memoizedState,r,o)},useTransition:function(){var r=xm(js)[0],o=Qt().memoizedState;return[typeof r=="boolean"?r:Sl(r),o]},useSyncExternalStore:_0,useId:Q0,useHostTransitionStatus:Cm,useFormState:D0,useActionState:D0,useOptimistic:function(r,o){var c=Qt();return _t!==null?N0(c,_t,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:vm,useCacheRefresh:W0};rS.useEffectEvent=$0;function Om(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:v({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Am={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=sr(),m=mo(u);m.payload=o,c!=null&&(m.callback=c),o=go(r,m,u),o!==null&&(Hn(o,r,u),yl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=sr(),m=mo(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=go(r,m,u),o!==null&&(Hn(o,r,u),yl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=sr(),u=mo(c);u.tag=2,o!=null&&(u.callback=o),o=go(r,u,c),o!==null&&(Hn(o,r,c),yl(o,r,c))}};function sS(r,o,c,u,m,y,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,y,E):o.prototype&&o.prototype.isPureReactComponent?!ll(c,u)||!ll(m,y):!0}function oS(r,o,c,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,u),o.state!==r&&Am.enqueueReplaceState(o,o.state,null)}function ki(r,o){var c=o;if("ref"in o){c={};for(var u in o)u!=="ref"&&(c[u]=o[u])}if(r=r.defaultProps){c===o&&(c=v({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function iS(r){df(r)}function aS(r){console.error(r)}function cS(r){df(r)}function Pf(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function lS(r,o,c){try{var u=r.onCaughtError;u(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function km(r,o,c){return c=mo(c),c.tag=3,c.payload={element:null},c.callback=function(){Pf(r,o)},c}function uS(r){return r=mo(r),r.tag=3,r}function fS(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var y=u.value;r.payload=function(){return m(y)},r.callback=function(){lS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){lS(o,c,u),typeof m!="function"&&(_o===null?_o=new Set([this]):_o.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function hk(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&ka(o,c,m,!0),c=er.current,c!==null){switch(c.tag){case 31:case 13:return Rr===null?Kf():c.alternate===null&&Ht===0&&(Ht=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===_f?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),rg(r,u,m)),!1;case 22:return c.flags|=65536,u===_f?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([u]):c.add(u)),rg(r,u,m)),!1}throw Error(s(435,c.tag))}return rg(r,u,m),Kf(),!1}if(rt)return o=er.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==Qp&&(r=Error(s(422),{cause:u}),dl(_r(r,c)))):(u!==Qp&&(o=Error(s(423),{cause:u}),dl(_r(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=_r(u,c),m=km(r.stateNode,u,m),cm(r,m),Ht!==4&&(Ht=2)),!1;var y=Error(s(520),{cause:u});if(y=_r(y,c),Al===null?Al=[y]:Al.push(y),Ht!==4&&(Ht=2),o===null)return!0;u=_r(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=km(c.stateNode,u,r),cm(c,r),!1;case 1:if(o=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(_o===null||!_o.has(y))))return c.flags|=65536,m&=-m,c.lanes|=m,m=uS(m),fS(m,r,c,u),cm(c,m),!1}c=c.return}while(c!==null);return!1}var Mm=Error(s(461)),tn=!1;function xn(r,o,c,u){o.child=r===null?m0(o,null,c,u):Oi(o,r.child,c,u)}function dS(r,o,c,u,m){c=c.render;var y=o.ref;if("ref"in u){var E={};for(var O in u)O!=="ref"&&(E[O]=u[O])}else E=u;return Ri(o),u=pm(r,o,c,E,y,m),O=mm(),r!==null&&!tn?(gm(r,o,m),Os(r,o,m)):(rt&&O&&Yp(o),o.flags|=1,xn(r,o,u,m),o.child)}function hS(r,o,c,u,m){if(r===null){var y=c.type;return typeof y=="function"&&!Gp(y)&&y.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=y,pS(r,o,y,u,m)):(r=gf(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(y=r.child,!Bm(r,m)){var E=y.memoizedProps;if(c=c.compare,c=c!==null?c:ll,c(E,u)&&r.ref===o.ref)return Os(r,o,m)}return o.flags|=1,r=Es(y,u),r.ref=o.ref,r.return=o,o.child=r}function pS(r,o,c,u,m){if(r!==null){var y=r.memoizedProps;if(ll(y,u)&&r.ref===o.ref)if(tn=!1,o.pendingProps=u=y,Bm(r,m))(r.flags&131072)!==0&&(tn=!0);else return o.lanes=r.lanes,Os(r,o,m)}return Im(r,o,c,u,m)}function mS(r,o,c,u){var m=u.children,y=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,r!==null){for(u=o.child=r.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~y}else u=0,o.child=null;return gS(r,o,y,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&xf(o,y!==null?y.cachePool:null),y!==null?v0(o,y):um(),b0(o);else return u=o.lanes=536870912,gS(r,o,y!==null?y.baseLanes|c:c,c,u)}else y!==null?(xf(o,y.cachePool),v0(o,y),vo(),o.memoizedState=null):(r!==null&&xf(o,null),um(),vo());return xn(r,o,m,c),o.child}function El(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function gS(r,o,c,u,m){var y=sm();return y=y===null?null:{parent:Jt._currentValue,pool:y},o.memoizedState={baseLanes:c,cachePool:y},r!==null&&xf(o,null),um(),b0(o),r!==null&&ka(r,o,u,!0),o.childLanes=m,null}function zf(r,o){return o=Lf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function yS(r,o,c){return Oi(o,r.child,null,c),r=zf(o,o.pendingProps),r.flags|=2,tr(o),o.memoizedState=null,r}function pk(r,o,c){var u=o.pendingProps,m=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(rt){if(u.mode==="hidden")return r=zf(o,u),o.lanes=536870912,El(null,r);if(dm(o),(r=At)?(r=j_(r,Tr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:lo!==null?{id:as,overflow:cs}:null,retryLane:536870912,hydrationErrors:null},c=e0(r),c.return=o,o.child=c,vn=o,At=null)):r=null,r===null)throw fo(o);return o.lanes=536870912,null}return zf(o,u)}var y=r.memoizedState;if(y!==null){var E=y.dehydrated;if(dm(o),m)if(o.flags&256)o.flags&=-257,o=yS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(tn||ka(r,o,c,!1),m=(c&r.childLanes)!==0,tn||m){if(u=Rt,u!==null&&(E=io(u,c),E!==0&&E!==y.retryLane))throw y.retryLane=E,_i(r,E),Hn(u,r,E),Mm;Kf(),o=yS(r,o,c)}else r=y.treeContext,At=Cr(E.nextSibling),vn=o,rt=!0,uo=null,Tr=!1,r!==null&&r0(o,r),o=zf(o,u),o.flags|=4096;return o}return r=Es(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function Df(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function Im(r,o,c,u,m){return Ri(o),c=pm(r,o,c,u,void 0,m),u=mm(),r!==null&&!tn?(gm(r,o,m),Os(r,o,m)):(rt&&u&&Yp(o),o.flags|=1,xn(r,o,c,m),o.child)}function vS(r,o,c,u,m,y){return Ri(o),o.updateQueue=null,c=S0(o,u,c,m),x0(r),u=mm(),r!==null&&!tn?(gm(r,o,y),Os(r,o,y)):(rt&&u&&Yp(o),o.flags|=1,xn(r,o,c,y),o.child)}function bS(r,o,c,u,m){if(Ri(o),o.stateNode===null){var y=Na,E=c.contextType;typeof E=="object"&&E!==null&&(y=bn(E)),y=new c(u,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Am,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=u,y.state=o.memoizedState,y.refs={},im(o),E=c.contextType,y.context=typeof E=="object"&&E!==null?bn(E):Na,y.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Om(o,c,E,u),y.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&Am.enqueueReplaceState(y,y.state,null),bl(o,u,y,m),vl(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){y=o.stateNode;var O=o.memoizedProps,$=ki(c,O);y.props=$;var ee=y.context,ae=c.contextType;E=Na,typeof ae=="object"&&ae!==null&&(E=bn(ae));var de=c.getDerivedStateFromProps;ae=typeof de=="function"||typeof y.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,ae||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(O||ee!==E)&&oS(o,y,u,E),po=!1;var ne=o.memoizedState;y.state=ne,bl(o,u,y,m),vl(),ee=o.memoizedState,O||ne!==ee||po?(typeof de=="function"&&(Om(o,c,de,u),ee=o.memoizedState),($=po||sS(o,c,$,u,ne,ee,E))?(ae||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=ee),y.props=u,y.state=ee,y.context=E,u=$):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{y=o.stateNode,am(r,o),E=o.memoizedProps,ae=ki(c,E),y.props=ae,de=o.pendingProps,ne=y.context,ee=c.contextType,$=Na,typeof ee=="object"&&ee!==null&&($=bn(ee)),O=c.getDerivedStateFromProps,(ee=typeof O=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==de||ne!==$)&&oS(o,y,u,$),po=!1,ne=o.memoizedState,y.state=ne,bl(o,u,y,m),vl();var se=o.memoizedState;E!==de||ne!==se||po||r!==null&&r.dependencies!==null&&vf(r.dependencies)?(typeof O=="function"&&(Om(o,c,O,u),se=o.memoizedState),(ae=po||sS(o,c,ae,u,ne,se,$)||r!==null&&r.dependencies!==null&&vf(r.dependencies))?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,se,$),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,se,$)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=se),y.props=u,y.state=se,y.context=$,u=ae):(typeof y.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),u=!1)}return y=u,Df(r,o),u=(o.flags&128)!==0,y||u?(y=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,r!==null&&u?(o.child=Oi(o,r.child,null,m),o.child=Oi(o,null,c,m)):xn(r,o,c,m),o.memoizedState=y.state,r=o.child):r=Os(r,o,m),r}function xS(r,o,c,u){return Ei(),o.flags|=256,xn(r,o,c,u),o.child}var Pm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zm(r){return{baseLanes:r,cachePool:l0()}}function Dm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=rr),r}function SS(r,o,c){var u=o.pendingProps,m=!1,y=(o.flags&128)!==0,E;if((E=y)||(E=r!==null&&r.memoizedState===null?!1:(Xt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?yo(o):vo(),(r=At)?(r=j_(r,Tr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:lo!==null?{id:as,overflow:cs}:null,retryLane:536870912,hydrationErrors:null},c=e0(r),c.return=o,o.child=c,vn=o,At=null)):r=null,r===null)throw fo(o);return bg(r)?o.lanes=32:o.lanes=536870912,null}var O=u.children;return u=u.fallback,m?(vo(),m=o.mode,O=Lf({mode:"hidden",children:O},m),u=wi(u,m,c,null),O.return=o,u.return=o,O.sibling=u,o.child=O,u=o.child,u.memoizedState=zm(c),u.childLanes=Dm(r,E,c),o.memoizedState=Pm,El(null,u)):(yo(o),Lm(o,O))}var $=r.memoizedState;if($!==null&&(O=$.dehydrated,O!==null)){if(y)o.flags&256?(yo(o),o.flags&=-257,o=Um(r,o,c)):o.memoizedState!==null?(vo(),o.child=r.child,o.flags|=128,o=null):(vo(),O=u.fallback,m=o.mode,u=Lf({mode:"visible",children:u.children},m),O=wi(O,m,c,null),O.flags|=2,u.return=o,O.return=o,u.sibling=O,o.child=u,Oi(o,r.child,null,c),u=o.child,u.memoizedState=zm(c),u.childLanes=Dm(r,E,c),o.memoizedState=Pm,o=El(null,u));else if(yo(o),bg(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var ee=E.dgst;E=ee,u=Error(s(419)),u.stack="",u.digest=E,dl({value:u,source:null,stack:null}),o=Um(r,o,c)}else if(tn||ka(r,o,c,!1),E=(c&r.childLanes)!==0,tn||E){if(E=Rt,E!==null&&(u=io(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,_i(r,u),Hn(E,r,u),Mm;vg(O)||Kf(),o=Um(r,o,c)}else vg(O)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,At=Cr(O.nextSibling),vn=o,rt=!0,uo=null,Tr=!1,r!==null&&r0(o,r),o=Lm(o,u.children),o.flags|=4096);return o}return m?(vo(),O=u.fallback,m=o.mode,$=r.child,ee=$.sibling,u=Es($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,ee!==null?O=Es(ee,O):(O=wi(O,m,c,null),O.flags|=2),O.return=o,u.return=o,u.sibling=O,o.child=u,El(null,u),u=o.child,O=r.child.memoizedState,O===null?O=zm(c):(m=O.cachePool,m!==null?($=Jt._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=l0(),O={baseLanes:O.baseLanes|c,cachePool:m}),u.memoizedState=O,u.childLanes=Dm(r,E,c),o.memoizedState=Pm,El(r.child,u)):(yo(o),c=r.child,r=c.sibling,c=Es(c,{mode:"visible",children:u.children}),c.return=o,c.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=c,o.memoizedState=null,c)}function Lm(r,o){return o=Lf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Lf(r,o){return r=Jn(22,r,null,o),r.lanes=0,r}function Um(r,o,c){return Oi(o,r.child,null,c),r=Lm(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function _S(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),em(r.return,o,c)}function $m(r,o,c,u,m,y){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:y}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=y)}function wS(r,o,c){var u=o.pendingProps,m=u.revealOrder,y=u.tail;u=u.children;var E=Xt.current,O=(E&2)!==0;if(O?(E=E&1|2,o.flags|=128):E&=1,W(Xt,E),xn(r,o,u,c),u=rt?fl:0,!O&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&_S(r,c,o);else if(r.tag===19)_S(r,c,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(c=o.child,m=null;c!==null;)r=c.alternate,r!==null&&Rf(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),$m(o,!1,m,c,y,u);break;case"backwards":case"unstable_legacy-backwards":for(c=null,m=o.child,o.child=null;m!==null;){if(r=m.alternate,r!==null&&Rf(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}$m(o,!0,c,null,y,u);break;case"together":$m(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Os(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),So|=o.lanes,(c&o.childLanes)===0)if(r!==null){if(ka(r,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(s(153));if(o.child!==null){for(r=o.child,c=Es(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Es(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Bm(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&vf(r)))}function mk(r,o,c){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),ho(o,Jt,r.memoizedState.cache),Ei();break;case 27:case 5:$e(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:ho(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,dm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(yo(o),o.flags|=128,null):(c&o.child.childLanes)!==0?SS(r,o,c):(yo(o),r=Os(r,o,c),r!==null?r.sibling:null);yo(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||(ka(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return wS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Xt,Xt.current),u)break;return null;case 22:return o.lanes=0,mS(r,o,c,o.pendingProps);case 24:ho(o,Jt,r.memoizedState.cache)}return Os(r,o,c)}function ES(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)tn=!0;else{if(!Bm(r,c)&&(o.flags&128)===0)return tn=!1,mk(r,o,c);tn=(r.flags&131072)!==0}else tn=!1,rt&&(o.flags&1048576)!==0&&n0(o,fl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Ni(o.elementType),o.type=r,typeof r=="function")Gp(r)?(u=ki(r,u),o.tag=1,o=bS(null,o,r,u,c)):(o.tag=0,o=Im(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===C){o.tag=11,o=dS(null,o,r,u,c);break e}else if(m===N){o.tag=14,o=hS(null,o,r,u,c);break e}}throw o=G(r)||r,Error(s(306,o,""))}}return o;case 0:return Im(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=ki(u,o.pendingProps),bS(r,o,u,m,c);case 3:e:{if(Se(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var y=o.memoizedState;m=y.element,am(r,o),bl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,ho(o,Jt,u),u!==y.cache&&tm(o,[Jt],c,!0),vl(),u=E.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=y,o.memoizedState=y,o.flags&256){o=xS(r,o,u,c);break e}else if(u!==m){m=_r(Error(s(424)),o),dl(m),o=xS(r,o,u,c);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,At=Cr(r.firstChild),vn=o,rt=!0,uo=null,Tr=!0,c=m0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ei(),u===m){o=Os(r,o,c);break e}xn(r,o,u,c)}o=o.child}return o;case 26:return Df(r,o),r===null?(c=P_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=ed(ie.current).createElement(c),u[yn]=o,u[Dn]=r,Sn(u,c,r),mn(u),o.stateNode=u):o.memoizedState=P_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return $e(o),r===null&&rt&&(u=o.stateNode=k_(o.type,o.pendingProps,ie.current),vn=o,Tr=!0,m=At,Ro(o.type)?(xg=m,At=Cr(u.firstChild)):At=m),xn(r,o,o.pendingProps.children,c),Df(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=At)&&(u=Vk(u,o.type,o.pendingProps,Tr),u!==null?(o.stateNode=u,vn=o,At=Cr(u.firstChild),Tr=!1,m=!0):m=!1),m||fo(o)),$e(o),m=o.type,y=o.pendingProps,E=r!==null?r.memoizedProps:null,u=y.children,mg(m,y)?u=null:E!==null&&mg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=pm(r,o,ik,null,null,c),Ul._currentValue=m),Df(r,o),xn(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=At)&&(c=Gk(c,o.pendingProps,Tr),c!==null?(o.stateNode=c,vn=o,At=null,r=!0):r=!1),r||fo(o)),null;case 13:return SS(r,o,c);case 4:return Se(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=Oi(o,null,u,c):xn(r,o,u,c),o.child;case 11:return dS(r,o,o.type,o.pendingProps,c);case 7:return xn(r,o,o.pendingProps,c),o.child;case 8:return xn(r,o,o.pendingProps.children,c),o.child;case 12:return xn(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,ho(o,o.type,u.value),xn(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Ri(o),m=bn(m),u=u(m),o.flags|=1,xn(r,o,u,c),o.child;case 14:return hS(r,o,o.type,o.pendingProps,c);case 15:return pS(r,o,o.type,o.pendingProps,c);case 19:return wS(r,o,c);case 31:return pk(r,o,c);case 22:return mS(r,o,c,o.pendingProps);case 24:return Ri(o),u=bn(Jt),r===null?(m=sm(),m===null&&(m=Rt,y=nm(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=c),m=y),o.memoizedState={parent:u,cache:m},im(o),ho(o,Jt,m)):((r.lanes&c)!==0&&(am(r,o),bl(o,null,null,c),vl()),m=r.memoizedState,y=o.memoizedState,m.parent!==u?(m={parent:u,cache:u},o.memoizedState=m,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=m),ho(o,Jt,u)):(u=y.cache,ho(o,Jt,u),u!==m.cache&&tm(o,[Jt],c,!0))),xn(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function As(r){r.flags|=4}function Fm(r,o,c,u,m){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(QS())r.flags|=8192;else throw ji=_f,om}else r.flags&=-16777217}function TS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!$_(o))if(QS())r.flags|=8192;else throw ji=_f,om}function Uf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?gi():536870912,r.lanes|=o,qa|=o)}function Tl(r,o){if(!rt)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var u=null;c!==null;)c.alternate!==null&&(u=c),c=c.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function kt(r){var o=r.alternate!==null&&r.alternate.child===r.child,c=0,u=0;if(o)for(var m=r.child;m!==null;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=u,r.childLanes=c,o}function gk(r,o,c){var u=o.pendingProps;switch(Xp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(o),null;case 1:return kt(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Cs(Jt),ge(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Aa(o)?As(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Wp())),kt(o),null;case 26:var m=o.type,y=o.memoizedState;return r===null?(As(o),y!==null?(kt(o),TS(o,y)):(kt(o),Fm(o,m,null,u,c))):y?y!==r.memoizedState?(As(o),kt(o),TS(o,y)):(kt(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&As(o),kt(o),Fm(o,m,r,u,c)),null;case 27:if(Ee(o),c=ie.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&As(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return kt(o),null}r=Y.current,Aa(o)?s0(o):(r=k_(m,u,c),o.stateNode=r,As(o))}return kt(o),null;case 5:if(Ee(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&As(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return kt(o),null}if(y=Y.current,Aa(o))s0(o);else{var E=ed(ie.current);switch(y){case 1:y=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=E.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?E.createElement(m,{is:u.is}):E.createElement(m)}}y[yn]=o,y[Dn]=u;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)y.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=y;e:switch(Sn(y,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&As(o)}}return kt(o),Fm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&As(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=ie.current,Aa(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=vn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[yn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||S_(r.nodeValue,c)),r||fo(o,!0)}else r=ed(r).createTextNode(u),r[yn]=o,o.stateNode=r}return kt(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Aa(o),c!==null){if(r===null){if(!u)throw Error(s(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[yn]=o}else Ei(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;kt(o),r=!1}else c=Wp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(tr(o),o):(tr(o),null);if((o.flags&128)!==0)throw Error(s(558))}return kt(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Aa(o),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(s(318));if(m=o.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(s(317));m[yn]=o}else Ei(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;kt(o),m=!1}else m=Wp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(tr(o),o):(tr(o),null)}return tr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=u!==null,r=r!==null&&r.memoizedState!==null,c&&(u=o.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==m&&(u.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),Uf(o,o.updateQueue),kt(o),null);case 4:return ge(),r===null&&ug(o.stateNode.containerInfo),kt(o),null;case 10:return Cs(o.type),kt(o),null;case 19:if(K(Xt),u=o.memoizedState,u===null)return kt(o),null;if(m=(o.flags&128)!==0,y=u.rendering,y===null)if(m)Tl(u,!1);else{if(Ht!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(y=Rf(r),y!==null){for(o.flags|=128,Tl(u,!1),r=y.updateQueue,o.updateQueue=r,Uf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)Jx(c,r),c=c.sibling;return W(Xt,Xt.current&1|2),rt&&Ts(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>qf&&(o.flags|=128,m=!0,Tl(u,!1),o.lanes=4194304)}else{if(!m)if(r=Rf(y),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Uf(o,r),Tl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!rt)return kt(o),null}else 2*Be()-u.renderingStartTime>qf&&c!==536870912&&(o.flags|=128,m=!0,Tl(u,!1),o.lanes=4194304);u.isBackwards?(y.sibling=o.child,o.child=y):(r=u.last,r!==null?r.sibling=y:o.child=y,u.last=y)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Be(),r.sibling=null,c=Xt.current,W(Xt,m?c&1|2:c&1),rt&&Ts(o,u.treeForkCount),r):(kt(o),null);case 22:case 23:return tr(o),fm(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(c&536870912)!==0&&(o.flags&128)===0&&(kt(o),o.subtreeFlags&6&&(o.flags|=8192)):kt(o),c=o.updateQueue,c!==null&&Uf(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==c&&(o.flags|=2048),r!==null&&K(Ci),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Cs(Jt),kt(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function yk(r,o){switch(Xp(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Cs(Jt),ge(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(tr(o),o.alternate===null)throw Error(s(340));Ei()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(tr(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Ei()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return K(Xt),null;case 4:return ge(),null;case 10:return Cs(o.type),null;case 22:case 23:return tr(o),fm(),r!==null&&K(Ci),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return Cs(Jt),null;case 25:return null;default:return null}}function RS(r,o){switch(Xp(o),o.tag){case 3:Cs(Jt),ge();break;case 26:case 27:case 5:Ee(o);break;case 4:ge();break;case 31:o.memoizedState!==null&&tr(o);break;case 13:tr(o);break;case 19:K(Xt);break;case 10:Cs(o.type);break;case 22:case 23:tr(o),fm(),r!==null&&K(Ci);break;case 24:Cs(Jt)}}function Rl(r,o){try{var c=o.updateQueue,u=c!==null?c.lastEffect:null;if(u!==null){var m=u.next;c=m;do{if((c.tag&r)===r){u=void 0;var y=c.create,E=c.inst;u=y(),E.destroy=u}c=c.next}while(c!==m)}}catch(O){xt(o,o.return,O)}}function bo(r,o,c){try{var u=o.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&r)===r){var E=u.inst,O=E.destroy;if(O!==void 0){E.destroy=void 0,m=o;var $=c,ee=O;try{ee()}catch(ae){xt(m,$,ae)}}}u=u.next}while(u!==y)}}catch(ae){xt(o,o.return,ae)}}function CS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{y0(o,c)}catch(u){xt(r,r.return,u)}}}function NS(r,o,c){c.props=ki(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){xt(r,o,u)}}function Cl(r,o){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof c=="function"?r.refCleanup=c(u):c.current=u}}catch(m){xt(r,o,m)}}function ls(r,o){var c=r.ref,u=r.refCleanup;if(c!==null)if(typeof u=="function")try{u()}catch(m){xt(r,o,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(m){xt(r,o,m)}else c.current=null}function jS(r){var o=r.type,c=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&u.focus();break e;case"img":c.src?u.src=c.src:c.srcSet&&(u.srcset=c.srcSet)}}catch(m){xt(r,r.return,m)}}function Hm(r,o,c){try{var u=r.stateNode;Uk(u,r.type,c,o),u[Dn]=o}catch(m){xt(r,r.return,m)}}function OS(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ro(r.type)||r.tag===4}function qm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||OS(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ro(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Vm(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=_s));else if(u!==4&&(u===27&&Ro(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Vm(r,o,c),r=r.sibling;r!==null;)Vm(r,o,c),r=r.sibling}function $f(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(u!==4&&(u===27&&Ro(r.type)&&(c=r.stateNode),r=r.child,r!==null))for($f(r,o,c),r=r.sibling;r!==null;)$f(r,o,c),r=r.sibling}function AS(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Sn(o,u,c),o[yn]=r,o[Dn]=c}catch(y){xt(r,r.return,y)}}var ks=!1,nn=!1,Gm=!1,kS=typeof WeakSet=="function"?WeakSet:Set,gn=null;function vk(r,o){if(r=r.containerInfo,hg=ad,r=qx(r),Up(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var u=c.getSelection&&c.getSelection();if(u&&u.rangeCount!==0){c=u.anchorNode;var m=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var E=0,O=-1,$=-1,ee=0,ae=0,de=r,ne=null;t:for(;;){for(var se;de!==c||m!==0&&de.nodeType!==3||(O=E+m),de!==y||u!==0&&de.nodeType!==3||($=E+u),de.nodeType===3&&(E+=de.nodeValue.length),(se=de.firstChild)!==null;)ne=de,de=se;for(;;){if(de===r)break t;if(ne===c&&++ee===m&&(O=E),ne===y&&++ae===u&&($=E),(se=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=se}c=O===-1||$===-1?null:{start:O,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(pg={focusedElem:r,selectionRange:c},ad=!1,gn=o;gn!==null;)if(o=gn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,gn=r;else for(;gn!==null;){switch(o=gn,y=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)m=r[c],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,c=o,m=y.memoizedProps,y=y.memoizedState,u=c.stateNode;try{var Re=ki(c.type,m);r=u.getSnapshotBeforeUpdate(Re,y),u.__reactInternalSnapshotBeforeUpdate=r}catch(Ue){xt(c,c.return,Ue)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)yg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":yg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=o.sibling,r!==null){r.return=o.return,gn=r;break}gn=o.return}}function MS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:Is(r,c),u&4&&Rl(5,c);break;case 1:if(Is(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){xt(c,c.return,E)}else{var m=ki(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){xt(c,c.return,E)}}u&64&&CS(c),u&512&&Cl(c,c.return);break;case 3:if(Is(r,c),u&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{y0(r,o)}catch(E){xt(c,c.return,E)}}break;case 27:o===null&&u&4&&AS(c);case 26:case 5:Is(r,c),o===null&&u&4&&jS(c),u&512&&Cl(c,c.return);break;case 12:Is(r,c);break;case 31:Is(r,c),u&4&&zS(r,c);break;case 13:Is(r,c),u&4&&DS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=Ck.bind(null,c),Kk(r,c))));break;case 22:if(u=c.memoizedState!==null||ks,!u){o=o!==null&&o.memoizedState!==null||nn,m=ks;var y=nn;ks=u,(nn=o)&&!y?Ps(r,c,(c.subtreeFlags&8772)!==0):Is(r,c),ks=m,nn=y}break;case 30:break;default:Is(r,c)}}function IS(r){var o=r.alternate;o!==null&&(r.alternate=null,IS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&_p(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Pt=null,Un=!1;function Ms(r,o,c){for(c=c.child;c!==null;)PS(r,o,c),c=c.sibling}function PS(r,o,c){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(vr,c)}catch{}switch(c.tag){case 26:nn||ls(c,o),Ms(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:nn||ls(c,o);var u=Pt,m=Un;Ro(c.type)&&(Pt=c.stateNode,Un=!1),Ms(r,o,c),zl(c.stateNode),Pt=u,Un=m;break;case 5:nn||ls(c,o);case 6:if(u=Pt,m=Un,Pt=null,Ms(r,o,c),Pt=u,Un=m,Pt!==null)if(Un)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(c.stateNode)}catch(y){xt(c,o,y)}else try{Pt.removeChild(c.stateNode)}catch(y){xt(c,o,y)}break;case 18:Pt!==null&&(Un?(r=Pt,C_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Wa(r)):C_(Pt,c.stateNode));break;case 4:u=Pt,m=Un,Pt=c.stateNode.containerInfo,Un=!0,Ms(r,o,c),Pt=u,Un=m;break;case 0:case 11:case 14:case 15:bo(2,c,o),nn||bo(4,c,o),Ms(r,o,c);break;case 1:nn||(ls(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&NS(c,o,u)),Ms(r,o,c);break;case 21:Ms(r,o,c);break;case 22:nn=(u=nn)||c.memoizedState!==null,Ms(r,o,c),nn=u;break;default:Ms(r,o,c)}}function zS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Wa(r)}catch(c){xt(o,o.return,c)}}}function DS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Wa(r)}catch(c){xt(o,o.return,c)}}function bk(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new kS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new kS),o;default:throw Error(s(435,r.tag))}}function Bf(r,o){var c=bk(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=Nk.bind(null,r,u);u.then(m,m)}})}function $n(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],y=r,E=o,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(Ro(O.type)){Pt=O.stateNode,Un=!1;break e}break;case 5:Pt=O.stateNode,Un=!1;break e;case 3:case 4:Pt=O.stateNode.containerInfo,Un=!0;break e}O=O.return}if(Pt===null)throw Error(s(160));PS(y,E,m),Pt=null,Un=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)LS(o,r),o=o.sibling}var Yr=null;function LS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:$n(o,r),Bn(r),u&4&&(bo(3,r,r.return),Rl(3,r),bo(5,r,r.return));break;case 1:$n(o,r),Bn(r),u&512&&(nn||c===null||ls(c,c.return)),u&64&&ks&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?u:c.concat(u))));break;case 26:var m=Yr;if($n(o,r),Bn(r),u&512&&(nn||c===null||ls(c,c.return)),u&4){var y=c!==null?c.memoizedState:null;if(u=r.memoizedState,c===null)if(u===null)if(r.stateNode===null){e:{u=r.type,c=r.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":y=m.getElementsByTagName("title")[0],(!y||y[el]||y[yn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(u),m.head.insertBefore(y,m.querySelector("head > title"))),Sn(y,u,c),y[yn]=r,mn(y),u=y;break e;case"link":var E=L_("link","href",m).get(u+(c.href||""));if(E){for(var O=0;O<E.length;O++)if(y=E[O],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(O,1);break t}}y=m.createElement(u),Sn(y,u,c),m.head.appendChild(y);break;case"meta":if(E=L_("meta","content",m).get(u+(c.content||""))){for(O=0;O<E.length;O++)if(y=E[O],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(O,1);break t}}y=m.createElement(u),Sn(y,u,c),m.head.appendChild(y);break;default:throw Error(s(468,u))}y[yn]=r,mn(y),u=y}r.stateNode=u}else U_(m,r.type,r.stateNode);else r.stateNode=D_(m,u,r.memoizedProps);else y!==u?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,u===null?U_(m,r.type,r.stateNode):D_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Hm(r,r.memoizedProps,c.memoizedProps)}break;case 27:$n(o,r),Bn(r),u&512&&(nn||c===null||ls(c,c.return)),c!==null&&u&4&&Hm(r,r.memoizedProps,c.memoizedProps);break;case 5:if($n(o,r),Bn(r),u&512&&(nn||c===null||ls(c,c.return)),r.flags&32){m=r.stateNode;try{Sa(m,"")}catch(Re){xt(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Hm(r,m,c!==null?c.memoizedProps:m)),u&1024&&(Gm=!0);break;case 6:if($n(o,r),Bn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){xt(r,r.return,Re)}}break;case 3:if(rd=null,m=Yr,Yr=td(o.containerInfo),$n(o,r),Yr=m,Bn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{Wa(o.containerInfo)}catch(Re){xt(r,r.return,Re)}Gm&&(Gm=!1,US(r));break;case 4:u=Yr,Yr=td(r.stateNode.containerInfo),$n(o,r),Bn(r),Yr=u;break;case 12:$n(o,r),Bn(r);break;case 31:$n(o,r),Bn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Bf(r,u)));break;case 13:$n(o,r),Bn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Hf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Bf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,ee=ks,ae=nn;if(ks=ee||m,nn=ae||$,$n(o,r),nn=ae,ks=ee,Bn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||ks||nn||Mi(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(y=$.stateNode,m)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=$.stateNode;var de=$.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Re){xt($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){xt($,$.return,Re)}}}else if(o.tag===18){if(c===null){$=o;try{var se=$.stateNode;m?N_(se,!0):N_($.stateNode,!1)}catch(Re){xt($,$.return,Re)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(c=u.retryQueue,c!==null&&(u.retryQueue=null,Bf(r,c))));break;case 19:$n(o,r),Bn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Bf(r,u)));break;case 30:break;case 21:break;default:$n(o,r),Bn(r)}}function Bn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if(OS(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,y=qm(r);$f(r,y,m);break;case 5:var E=c.stateNode;c.flags&32&&(Sa(E,""),c.flags&=-33);var O=qm(r);$f(r,O,E);break;case 3:case 4:var $=c.stateNode.containerInfo,ee=qm(r);Vm(r,ee,$);break;default:throw Error(s(161))}}catch(ae){xt(r,r.return,ae)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function US(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;US(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function Is(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)MS(r,o.alternate,o),o=o.sibling}function Mi(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:bo(4,o,o.return),Mi(o);break;case 1:ls(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&NS(o,o.return,c),Mi(o);break;case 27:zl(o.stateNode);case 26:case 5:ls(o,o.return),Mi(o);break;case 22:o.memoizedState===null&&Mi(o);break;case 30:Mi(o);break;default:Mi(o)}r=r.sibling}}function Ps(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,m=r,y=o,E=y.flags;switch(y.tag){case 0:case 11:case 15:Ps(m,y,c),Rl(4,y);break;case 1:if(Ps(m,y,c),u=y,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ee){xt(u,u.return,ee)}if(u=y,m=u.updateQueue,m!==null){var O=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)g0($[m],O)}catch(ee){xt(u,u.return,ee)}}c&&E&64&&CS(y),Cl(y,y.return);break;case 27:AS(y);case 26:case 5:Ps(m,y,c),c&&u===null&&E&4&&jS(y),Cl(y,y.return);break;case 12:Ps(m,y,c);break;case 31:Ps(m,y,c),c&&E&4&&zS(m,y);break;case 13:Ps(m,y,c),c&&E&4&&DS(m,y);break;case 22:y.memoizedState===null&&Ps(m,y,c),Cl(y,y.return);break;case 30:break;default:Ps(m,y,c)}o=o.sibling}}function Km(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&hl(c))}function Zm(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&hl(r))}function Xr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)$S(r,o,c,u),o=o.sibling}function $S(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Xr(r,o,c,u),m&2048&&Rl(9,o);break;case 1:Xr(r,o,c,u);break;case 3:Xr(r,o,c,u),m&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&hl(r)));break;case 12:if(m&2048){Xr(r,o,c,u),r=o.stateNode;try{var y=o.memoizedProps,E=y.id,O=y.onPostCommit;typeof O=="function"&&O(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){xt(o,o.return,$)}}else Xr(r,o,c,u);break;case 31:Xr(r,o,c,u);break;case 13:Xr(r,o,c,u);break;case 23:break;case 22:y=o.stateNode,E=o.alternate,o.memoizedState!==null?y._visibility&2?Xr(r,o,c,u):Nl(r,o):y._visibility&2?Xr(r,o,c,u):(y._visibility|=2,Ba(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&Km(E,o);break;case 24:Xr(r,o,c,u),m&2048&&Zm(o.alternate,o);break;default:Xr(r,o,c,u)}}function Ba(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var y=r,E=o,O=c,$=u,ee=E.flags;switch(E.tag){case 0:case 11:case 15:Ba(y,E,O,$,m),Rl(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?Ba(y,E,O,$,m):Nl(y,E):(ae._visibility|=2,Ba(y,E,O,$,m)),m&&ee&2048&&Km(E.alternate,E);break;case 24:Ba(y,E,O,$,m),m&&ee&2048&&Zm(E.alternate,E);break;default:Ba(y,E,O,$,m)}o=o.sibling}}function Nl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,u=o,m=u.flags;switch(u.tag){case 22:Nl(c,u),m&2048&&Km(u.alternate,u);break;case 24:Nl(c,u),m&2048&&Zm(u.alternate,u);break;default:Nl(c,u)}o=o.sibling}}var jl=8192;function Fa(r,o,c){if(r.subtreeFlags&jl)for(r=r.child;r!==null;)BS(r,o,c),r=r.sibling}function BS(r,o,c){switch(r.tag){case 26:Fa(r,o,c),r.flags&jl&&r.memoizedState!==null&&oM(c,Yr,r.memoizedState,r.memoizedProps);break;case 5:Fa(r,o,c);break;case 3:case 4:var u=Yr;Yr=td(r.stateNode.containerInfo),Fa(r,o,c),Yr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=jl,jl=16777216,Fa(r,o,c),jl=u):Fa(r,o,c));break;default:Fa(r,o,c)}}function FS(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Ol(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];gn=u,qS(u,r)}FS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)HS(r),r=r.sibling}function HS(r){switch(r.tag){case 0:case 11:case 15:Ol(r),r.flags&2048&&bo(9,r,r.return);break;case 3:Ol(r);break;case 12:Ol(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Ff(r)):Ol(r);break;default:Ol(r)}}function Ff(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];gn=u,qS(u,r)}FS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:bo(8,o,o.return),Ff(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Ff(o));break;default:Ff(o)}r=r.sibling}}function qS(r,o){for(;gn!==null;){var c=gn;switch(c.tag){case 0:case 11:case 15:bo(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var u=c.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:hl(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,gn=u;else e:for(c=r;gn!==null;){u=gn;var m=u.sibling,y=u.return;if(IS(u),u===c){gn=null;break e}if(m!==null){m.return=y,gn=m;break e}gn=y}}}var xk={getCacheForType:function(r){var o=bn(Jt),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return bn(Jt).controller.signal}},Sk=typeof WeakMap=="function"?WeakMap:Map,pt=0,Rt=null,Je=null,tt=0,bt=0,nr=null,xo=!1,Ha=!1,Ym=!1,zs=0,Ht=0,So=0,Ii=0,Xm=0,rr=0,qa=0,Al=null,Fn=null,Qm=!1,Hf=0,VS=0,qf=1/0,Vf=null,_o=null,cn=0,wo=null,Va=null,Ds=0,Wm=0,Jm=null,GS=null,kl=0,eg=null;function sr(){return(pt&2)!==0&&tt!==0?tt&-tt:P.T!==null?ig():Ju()}function KS(){if(rr===0)if((tt&536870912)===0||rt){var r=En;En<<=1,(En&3932160)===0&&(En=262144),rr=r}else rr=536870912;return r=er.current,r!==null&&(r.flags|=32),rr}function Hn(r,o,c){(r===Rt&&(bt===2||bt===9)||r.cancelPendingCommit!==null)&&(Ga(r,0),Eo(r,tt,rr,!1)),xs(r,c),((pt&2)===0||r!==Rt)&&(r===Rt&&((pt&2)===0&&(Ii|=c),Ht===4&&Eo(r,tt,rr,!1)),us(r))}function ZS(r,o,c){if((pt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||os(r,o),m=u?Ek(r,o):ng(r,o,!0),y=u;do{if(m===0){Ha&&!u&&Eo(r,o,0,!1);break}else{if(c=r.current.alternate,y&&!_k(c)){m=ng(r,o,!1),y=!1;continue}if(m===2){if(y=o,r.errorRecoveryDisabledLanes&y)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var O=r;m=Al;var $=O.current.memoizedState.isDehydrated;if($&&(Ga(O,E).flags|=256),E=ng(O,E,!1),E!==2){if(Ym&&!$){O.errorRecoveryDisabledLanes|=y,Ii|=y,m=4;break e}y=Fn,Fn=m,y!==null&&(Fn===null?Fn=y:Fn.push.apply(Fn,y))}m=E}if(y=!1,m!==2)continue}}if(m===1){Ga(r,0),Eo(r,o,0,!0);break}e:{switch(u=r,y=m,y){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:Eo(u,o,rr,!xo);break e;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Hf+300-Be(),10<m)){if(Eo(u,o,rr,!xo),ss(u,0,!0)!==0)break e;Ds=o,u.timeoutHandle=T_(YS.bind(null,u,c,Fn,Vf,Qm,o,rr,Ii,qa,xo,y,"Throttled",-0,0),m);break e}YS(u,c,Fn,Vf,Qm,o,rr,Ii,qa,xo,y,null,-0,0)}}break}while(!0);us(r)}function YS(r,o,c,u,m,y,E,O,$,ee,ae,de,ne,se){if(r.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_s},BS(o,y,de);var Re=(y&62914560)===y?Hf-Be():(y&4194048)===y?VS-Be():0;if(Re=iM(de,Re),Re!==null){Ds=y,r.cancelPendingCommit=Re(r_.bind(null,r,o,y,c,u,m,E,O,$,ae,de,null,ne,se)),Eo(r,y,E,!ee);return}}r_(r,o,y,c,u,m,E,O,$)}function _k(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var u=0;u<c.length;u++){var m=c[u],y=m.getSnapshot;m=m.value;try{if(!Wn(y(),m))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Eo(r,o,c,u){o&=~Xm,o&=~Ii,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var m=o;0<m;){var y=31-vt(m),E=1<<y;u[y]=-1,m&=~E}c!==0&&is(r,c,o)}function Gf(){return(pt&6)===0?(Ml(0),!1):!0}function tg(){if(Je!==null){if(bt===0)var r=Je.return;else r=Je,Rs=Ti=null,ym(r),za=null,ml=0,r=Je;for(;r!==null;)RS(r.alternate,r),r=r.return;Je=null}}function Ga(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,Fk(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Ds=0,tg(),Rt=r,Je=c=Es(r.current,null),tt=o,bt=0,nr=null,xo=!1,Ha=os(r,o),Ym=!1,qa=rr=Xm=Ii=So=Ht=0,Fn=Al=null,Qm=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var m=31-vt(u),y=1<<m;o|=r[m],u&=~y}return zs=o,hf(),c}function XS(r,o){Ze=null,P.H=wl,o===Pa||o===Sf?(o=d0(),bt=3):o===om?(o=d0(),bt=4):bt=o===Mm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,nr=o,Je===null&&(Ht=1,Pf(r,_r(o,r.current)))}function QS(){var r=er.current;return r===null?!0:(tt&4194048)===tt?Rr===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Rr:!1}function WS(){var r=P.H;return P.H=wl,r===null?wl:r}function JS(){var r=P.A;return P.A=xk,r}function Kf(){Ht=4,xo||(tt&4194048)!==tt&&er.current!==null||(Ha=!0),(So&134217727)===0&&(Ii&134217727)===0||Rt===null||Eo(Rt,tt,rr,!1)}function ng(r,o,c){var u=pt;pt|=2;var m=WS(),y=JS();(Rt!==r||tt!==o)&&(Vf=null,Ga(r,o)),o=!1;var E=Ht;e:do try{if(bt!==0&&Je!==null){var O=Je,$=nr;switch(bt){case 8:tg(),E=6;break e;case 3:case 2:case 9:case 6:er.current===null&&(o=!0);var ee=bt;if(bt=0,nr=null,Ka(r,O,$,ee),c&&Ha){E=0;break e}break;default:ee=bt,bt=0,nr=null,Ka(r,O,$,ee)}}wk(),E=Ht;break}catch(ae){XS(r,ae)}while(!0);return o&&r.shellSuspendCounter++,Rs=Ti=null,pt=u,P.H=m,P.A=y,Je===null&&(Rt=null,tt=0,hf()),E}function wk(){for(;Je!==null;)e_(Je)}function Ek(r,o){var c=pt;pt|=2;var u=WS(),m=JS();Rt!==r||tt!==o?(Vf=null,qf=Be()+500,Ga(r,o)):Ha=os(r,o);e:do try{if(bt!==0&&Je!==null){o=Je;var y=nr;t:switch(bt){case 1:bt=0,nr=null,Ka(r,o,y,1);break;case 2:case 9:if(u0(y)){bt=0,nr=null,t_(o);break}o=function(){bt!==2&&bt!==9||Rt!==r||(bt=7),us(r)},y.then(o,o);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:u0(y)?(bt=0,nr=null,t_(o)):(bt=0,nr=null,Ka(r,o,y,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var O=Je;if(E?$_(E):O.stateNode.complete){bt=0,nr=null;var $=O.sibling;if($!==null)Je=$;else{var ee=O.return;ee!==null?(Je=ee,Zf(ee)):Je=null}break t}}bt=0,nr=null,Ka(r,o,y,5);break;case 6:bt=0,nr=null,Ka(r,o,y,6);break;case 8:tg(),Ht=6;break e;default:throw Error(s(462))}}Tk();break}catch(ae){XS(r,ae)}while(!0);return Rs=Ti=null,P.H=u,P.A=m,pt=c,Je!==null?0:(Rt=null,tt=0,hf(),Ht)}function Tk(){for(;Je!==null&&!qe();)e_(Je)}function e_(r){var o=ES(r.alternate,r,zs);r.memoizedProps=r.pendingProps,o===null?Zf(r):Je=o}function t_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=vS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=vS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:ym(o);default:RS(c,o),o=Je=Jx(o,zs),o=ES(c,o,zs)}r.memoizedProps=r.pendingProps,o===null?Zf(r):Je=o}function Ka(r,o,c,u){Rs=Ti=null,ym(o),za=null,ml=0;var m=o.return;try{if(hk(r,m,o,c,tt)){Ht=1,Pf(r,_r(c,r.current)),Je=null;return}}catch(y){if(m!==null)throw Je=m,y;Ht=1,Pf(r,_r(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Ha||(tt&536870912)!==0?r=!1:(xo=r=!0,(u===2||u===9||u===3||u===6)&&(u=er.current,u!==null&&u.tag===13&&(u.flags|=16384))),n_(o,r)):Zf(o)}function Zf(r){var o=r;do{if((o.flags&32768)!==0){n_(o,xo);return}r=o.return;var c=gk(o.alternate,o,zs);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Ht===0&&(Ht=5)}function n_(r,o){do{var c=yk(r.alternate,r);if(c!==null){c.flags&=32767,Je=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(r=r.sibling,r!==null)){Je=r;return}Je=r=c}while(r!==null);Ht=6,Je=null}function r_(r,o,c,u,m,y,E,O,$){r.cancelPendingCommit=null;do Yf();while(cn!==0);if((pt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(y=o.lanes|o.childLanes,y|=qp,Xn(r,c,y,E,O,$),r===Rt&&(Je=Rt=null,tt=0),Va=o,wo=r,Ds=c,Wm=y,Jm=m,GS=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,jk(Te,function(){return c_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=P.T,P.T=null,m=V.p,V.p=2,E=pt,pt|=4;try{vk(r,o,c)}finally{pt=E,V.p=m,P.T=u}}cn=1,s_(),o_(),i_()}}function s_(){if(cn===1){cn=0;var r=wo,o=Va,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=P.T,P.T=null;var u=V.p;V.p=2;var m=pt;pt|=4;try{LS(o,r);var y=pg,E=qx(r.containerInfo),O=y.focusedElem,$=y.selectionRange;if(E!==O&&O&&O.ownerDocument&&Hx(O.ownerDocument.documentElement,O)){if($!==null&&Up(O)){var ee=$.start,ae=$.end;if(ae===void 0&&(ae=ee),"selectionStart"in O)O.selectionStart=ee,O.selectionEnd=Math.min(ae,O.value.length);else{var de=O.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Re=O.textContent.length,Ue=Math.min($.start,Re),Et=$.end===void 0?Ue:Math.min($.end,Re);!se.extend&&Ue>Et&&(E=Et,Et=Ue,Ue=E);var Q=Fx(O,Ue),B=Fx(O,Et);if(Q&&B&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==B.node||se.focusOffset!==B.offset)){var J=de.createRange();J.setStart(Q.node,Q.offset),se.removeAllRanges(),Ue>Et?(se.addRange(J),se.extend(B.node,B.offset)):(J.setEnd(B.node,B.offset),se.addRange(J))}}}}for(de=[],se=O;se=se.parentNode;)se.nodeType===1&&de.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<de.length;O++){var ue=de[O];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}ad=!!hg,pg=hg=null}finally{pt=m,V.p=u,P.T=c}}r.current=o,cn=2}}function o_(){if(cn===2){cn=0;var r=wo,o=Va,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=P.T,P.T=null;var u=V.p;V.p=2;var m=pt;pt|=4;try{MS(r,o.alternate,o)}finally{pt=m,V.p=u,P.T=c}}cn=3}}function i_(){if(cn===4||cn===3){cn=0,Qe();var r=wo,o=Va,c=Ds,u=GS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?cn=5:(cn=0,Va=wo=null,a_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(_o=null),Jc(c),o=o.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(vr,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=P.T,m=V.p,V.p=2,P.T=null;try{for(var y=r.onRecoverableError,E=0;E<u.length;E++){var O=u[E];y(O.value,{componentStack:O.stack})}}finally{P.T=o,V.p=m}}(Ds&3)!==0&&Yf(),us(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===eg?kl++:(kl=0,eg=r):kl=0,Ml(0)}}function a_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,hl(o)))}function Yf(){return s_(),o_(),i_(),c_()}function c_(){if(cn!==5)return!1;var r=wo,o=Wm;Wm=0;var c=Jc(Ds),u=P.T,m=V.p;try{V.p=32>c?32:c,P.T=null,c=Jm,Jm=null;var y=wo,E=Ds;if(cn=0,Va=wo=null,Ds=0,(pt&6)!==0)throw Error(s(331));var O=pt;if(pt|=4,HS(y.current),$S(y,y.current,E,c),pt=O,Ml(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(vr,y)}catch{}return!0}finally{V.p=m,P.T=u,a_(r,o)}}function l_(r,o,c){o=_r(c,o),o=km(r.stateNode,o,2),r=go(r,o,2),r!==null&&(xs(r,2),us(r))}function xt(r,o,c){if(r.tag===3)l_(r,r,c);else for(;o!==null;){if(o.tag===3){l_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(_o===null||!_o.has(u))){r=_r(c,r),c=uS(2),u=go(o,c,2),u!==null&&(fS(c,u,o,r),xs(u,2),us(u));break}}o=o.return}}function rg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new Sk;var m=new Set;u.set(o,m)}else m=u.get(o),m===void 0&&(m=new Set,u.set(o,m));m.has(c)||(Ym=!0,m.add(c),r=Rk.bind(null,r,o,c),o.then(r,r))}function Rk(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Rt===r&&(tt&c)===c&&(Ht===4||Ht===3&&(tt&62914560)===tt&&300>Be()-Hf?(pt&2)===0&&Ga(r,0):Xm|=c,qa===tt&&(qa=0)),us(r)}function u_(r,o){o===0&&(o=gi()),r=_i(r,o),r!==null&&(xs(r,o),us(r))}function Ck(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),u_(r,c)}function Nk(r,o){var c=0;switch(r.tag){case 31:case 13:var u=r.stateNode,m=r.memoizedState;m!==null&&(c=m.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(o),u_(r,c)}function jk(r,o){return Le(r,o)}var Xf=null,Za=null,sg=!1,Qf=!1,og=!1,To=0;function us(r){r!==Za&&r.next===null&&(Za===null?Xf=Za=r:Za=Za.next=r),Qf=!0,sg||(sg=!0,Ak())}function Ml(r,o){if(!og&&Qf){og=!0;do for(var c=!1,u=Xf;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var y=0;else{var E=u.suspendedLanes,O=u.pingedLanes;y=(1<<31-vt(42|r)+1)-1,y&=m&~(E&~O),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,p_(u,y))}else y=tt,y=ss(u,u===Rt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||os(u,y)||(c=!0,p_(u,y));u=u.next}while(c);og=!1}}function Ok(){f_()}function f_(){Qf=sg=!1;var r=0;To!==0&&Bk()&&(r=To);for(var o=Be(),c=null,u=Xf;u!==null;){var m=u.next,y=d_(u,o);y===0?(u.next=null,c===null?Xf=m:c.next=m,m===null&&(Za=c)):(c=u,(r!==0||(y&3)!==0)&&(Qf=!0)),u=m}cn!==0&&cn!==5||Ml(r),To!==0&&(To=0)}function d_(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var E=31-vt(y),O=1<<E,$=m[E];$===-1?((O&c)===0||(O&u)!==0)&&(m[E]=pa(O,o)):$<=o&&(r.expiredLanes|=O),y&=~O}if(o=Rt,c=tt,c=ss(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(bt===2||bt===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&we(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||os(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&we(u),Jc(c)){case 2:case 8:c=pe;break;case 32:c=Te;break;case 268435456:c=ht;break;default:c=Te}return u=h_.bind(null,r),c=Le(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&we(u),r.callbackPriority=2,r.callbackNode=null,2}function h_(r,o){if(cn!==0&&cn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(Yf()&&r.callbackNode!==c)return null;var u=tt;return u=ss(r,r===Rt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(ZS(r,u,o),d_(r,Be()),r.callbackNode!=null&&r.callbackNode===c?h_.bind(null,r):null)}function p_(r,o){if(Yf())return null;ZS(r,o,!0)}function Ak(){Hk(function(){(pt&6)!==0?Le(Ve,Ok):f_()})}function ig(){if(To===0){var r=Ma;r===0&&(r=jt,jt<<=1,(jt&261888)===0&&(jt=256)),To=r}return To}function m_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:sf(""+r)}function g_(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function kk(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var y=m_((m[Dn]||null).action),E=u.submitter;E&&(o=(o=E[Dn]||null)?m_(o.formAction):E.getAttribute("formAction"),o!==null&&(y=o,E=null));var O=new lf("action","action",null,u,m);r.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(To!==0){var $=E?g_(m,E):new FormData(m);Rm(c,{pending:!0,data:$,method:m.method,action:y},null,$)}}else typeof y=="function"&&(O.preventDefault(),$=E?g_(m,E):new FormData(m),Rm(c,{pending:!0,data:$,method:m.method,action:y},y,$))},currentTarget:m}]})}}for(var ag=0;ag<Hp.length;ag++){var cg=Hp[ag],Mk=cg.toLowerCase(),Ik=cg[0].toUpperCase()+cg.slice(1);Zr(Mk,"on"+Ik)}Zr(Kx,"onAnimationEnd"),Zr(Zx,"onAnimationIteration"),Zr(Yx,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(XA,"onTransitionRun"),Zr(QA,"onTransitionStart"),Zr(WA,"onTransitionCancel"),Zr(Xx,"onTransitionEnd"),ba("onMouseEnter",["mouseout","mouseover"]),ba("onMouseLeave",["mouseout","mouseover"]),ba("onPointerEnter",["pointerout","pointerover"]),ba("onPointerLeave",["pointerout","pointerover"]),vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Il="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(" "),Pk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Il));function y_(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var u=r[c],m=u.event;u=u.listeners;e:{var y=void 0;if(o)for(var E=u.length-1;0<=E;E--){var O=u[E],$=O.instance,ee=O.currentTarget;if(O=O.listener,$!==y&&m.isPropagationStopped())break e;y=O,m.currentTarget=ee;try{y(m)}catch(ae){df(ae)}m.currentTarget=null,y=$}else for(E=0;E<u.length;E++){if(O=u[E],$=O.instance,ee=O.currentTarget,O=O.listener,$!==y&&m.isPropagationStopped())break e;y=O,m.currentTarget=ee;try{y(m)}catch(ae){df(ae)}m.currentTarget=null,y=$}}}}function et(r,o){var c=o[Sp];c===void 0&&(c=o[Sp]=new Set);var u=r+"__bubble";c.has(u)||(v_(o,r,2,!1),c.add(u))}function lg(r,o,c){var u=0;o&&(u|=4),v_(c,r,u,o)}var Wf="_reactListening"+Math.random().toString(36).slice(2);function ug(r){if(!r[Wf]){r[Wf]=!0,fx.forEach(function(c){c!=="selectionchange"&&(Pk.has(c)||lg(c,!1,r),lg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Wf]||(o[Wf]=!0,lg("selectionchange",!1,o))}}function v_(r,o,c,u){switch(K_(o)){case 2:var m=lM;break;case 8:m=uM;break;default:m=Tg}c=m.bind(null,o,c,r),m=void 0,!Op||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(m=!0),u?m!==void 0?r.addEventListener(o,c,{capture:!0,passive:m}):r.addEventListener(o,c,!0):m!==void 0?r.addEventListener(o,c,{passive:m}):r.addEventListener(o,c,!1)}function fg(r,o,c,u,m){var y=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var O=u.stateNode.containerInfo;if(O===m)break;if(E===4)for(E=u.return;E!==null;){var $=E.tag;if(($===3||$===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;O!==null;){if(E=ga(O),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=y=E;continue e}O=O.parentNode}}u=u.return}wx(function(){var ee=y,ae=Np(c),de=[];e:{var ne=Qx.get(r);if(ne!==void 0){var se=lf,Re=r;switch(r){case"keypress":if(af(c)===0)break e;case"keydown":case"keyup":se=NA;break;case"focusin":Re="focus",se=Ip;break;case"focusout":Re="blur",se=Ip;break;case"beforeblur":case"afterblur":se=Ip;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=gA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=AA;break;case Kx:case Zx:case Yx:se=bA;break;case Xx:se=MA;break;case"scroll":case"scrollend":se=pA;break;case"wheel":se=PA;break;case"copy":case"cut":case"paste":se=SA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Nx;break;case"toggle":case"beforetoggle":se=DA}var Ue=(o&4)!==0,Et=!Ue&&(r==="scroll"||r==="scrollend"),Q=Ue?ne!==null?ne+"Capture":null:ne;Ue=[];for(var B=ee,J;B!==null;){var ue=B;if(J=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||J===null||Q===null||(ue=nl(B,Q),ue!=null&&Ue.push(Pl(B,ue,J))),Et)break;B=B.return}0<Ue.length&&(ne=new se(ne,Re,null,c,ae),de.push({event:ne,listeners:Ue}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",se=r==="mouseout"||r==="pointerout",ne&&c!==Cp&&(Re=c.relatedTarget||c.fromElement)&&(ga(Re)||Re[ma]))break e;if((se||ne)&&(ne=ae.window===ae?ae:(ne=ae.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Re=c.relatedTarget||c.toElement,se=ee,Re=Re?ga(Re):null,Re!==null&&(Et=a(Re),Ue=Re.tag,Re!==Et||Ue!==5&&Ue!==27&&Ue!==6)&&(Re=null)):(se=null,Re=ee),se!==Re)){if(Ue=Rx,ue="onMouseLeave",Q="onMouseEnter",B="mouse",(r==="pointerout"||r==="pointerover")&&(Ue=Nx,ue="onPointerLeave",Q="onPointerEnter",B="pointer"),Et=se==null?ne:tl(se),J=Re==null?ne:tl(Re),ne=new Ue(ue,B+"leave",se,c,ae),ne.target=Et,ne.relatedTarget=J,ue=null,ga(ae)===ee&&(Ue=new Ue(Q,B+"enter",Re,c,ae),Ue.target=J,Ue.relatedTarget=Et,ue=Ue),Et=ue,se&&Re)t:{for(Ue=zk,Q=se,B=Re,J=0,ue=Q;ue;ue=Ue(ue))J++;ue=0;for(var ze=B;ze;ze=Ue(ze))ue++;for(;0<J-ue;)Q=Ue(Q),J--;for(;0<ue-J;)B=Ue(B),ue--;for(;J--;){if(Q===B||B!==null&&Q===B.alternate){Ue=Q;break t}Q=Ue(Q),B=Ue(B)}Ue=null}else Ue=null;se!==null&&b_(de,ne,se,Ue,!1),Re!==null&&Et!==null&&b_(de,Et,Re,Ue,!0)}}e:{if(ne=ee?tl(ee):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var ft=zx;else if(Ix(ne))if(Dx)ft=KA;else{ft=VA;var Ae=qA}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Rp(ee.elementType)&&(ft=zx):ft=GA;if(ft&&(ft=ft(r,ee))){Px(de,ft,c,ae);break e}Ae&&Ae(r,ne,ee),r==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Tp(ne,"number",ne.value)}switch(Ae=ee?tl(ee):window,r){case"focusin":(Ix(Ae)||Ae.contentEditable==="true")&&(Ta=Ae,$p=ee,ul=null);break;case"focusout":ul=$p=Ta=null;break;case"mousedown":Bp=!0;break;case"contextmenu":case"mouseup":case"dragend":Bp=!1,Vx(de,c,ae);break;case"selectionchange":if(YA)break;case"keydown":case"keyup":Vx(de,c,ae)}var Ye;if(zp)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Ea?kx(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(jx&&c.locale!=="ko"&&(Ea||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Ea&&(Ye=Ex()):(co=ae,Ap="value"in co?co.value:co.textContent,Ea=!0)),Ae=Jf(ee,nt),0<Ae.length&&(nt=new Cx(nt,r,null,c,ae),de.push({event:nt,listeners:Ae}),Ye?nt.data=Ye:(Ye=Mx(c),Ye!==null&&(nt.data=Ye)))),(Ye=UA?$A(r,c):BA(r,c))&&(nt=Jf(ee,"onBeforeInput"),0<nt.length&&(Ae=new Cx("onBeforeInput","beforeinput",null,c,ae),de.push({event:Ae,listeners:nt}),Ae.data=Ye)),kk(de,r,ee,c,ae)}y_(de,o)})}function Pl(r,o,c){return{instance:r,listener:o,currentTarget:c}}function Jf(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=nl(r,c),m!=null&&u.unshift(Pl(r,m,y)),m=nl(r,o),m!=null&&u.push(Pl(r,m,y))),r.tag===3)return u;r=r.return}return[]}function zk(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function b_(r,o,c,u,m){for(var y=o._reactName,E=[];c!==null&&c!==u;){var O=c,$=O.alternate,ee=O.stateNode;if(O=O.tag,$!==null&&$===u)break;O!==5&&O!==26&&O!==27||ee===null||($=ee,m?(ee=nl(c,y),ee!=null&&E.unshift(Pl(c,ee,$))):m||(ee=nl(c,y),ee!=null&&E.push(Pl(c,ee,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var Dk=/\r\n?/g,Lk=/\u0000|\uFFFD/g;function x_(r){return(typeof r=="string"?r:""+r).replace(Dk,`
|
|
67
|
-
`).replace(Lk,"")}function S_(r,o){return o=x_(o),x_(r)===o}function wt(r,o,c,u,m,y){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||Sa(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&Sa(r,""+u);break;case"className":nf(r,"class",u);break;case"tabIndex":nf(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":nf(r,c,u);break;case"style":Sx(r,u,y);break;case"data":if(o!=="object"){nf(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=sf(""+u),r.setAttribute(c,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(c,"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}else typeof y=="function"&&(c==="formAction"?(o!=="input"&&wt(r,o,"name",m.name,m,null),wt(r,o,"formEncType",m.formEncType,m,null),wt(r,o,"formMethod",m.formMethod,m,null),wt(r,o,"formTarget",m.formTarget,m,null)):(wt(r,o,"encType",m.encType,m,null),wt(r,o,"method",m.method,m,null),wt(r,o,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=sf(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=_s);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}c=sf(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,""+u):r.removeAttribute(c);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":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":u===!0?r.setAttribute(c,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,u):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(c,u):r.removeAttribute(c);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(c):r.setAttribute(c,u);break;case"popover":et("beforetoggle",r),et("toggle",r),tf(r,"popover",u);break;case"xlinkActuate":Ss(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ss(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ss(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ss(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ss(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ss(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":tf(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=dA.get(c)||c,tf(r,c,u))}}function dg(r,o,c,u,m,y){switch(c){case"style":Sx(r,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof u=="string"?Sa(r,u):(typeof u=="number"||typeof u=="bigint")&&Sa(r,""+u);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"onClick":u!=null&&(r.onclick=_s);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dx.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),y=r[Dn]||null,y=y!=null?y[c]:null,typeof y=="function"&&r.removeEventListener(o,y,m),typeof u=="function")){typeof y!="function"&&y!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,u,m);break e}c in r?r[c]=u:u===!0?r.setAttribute(c,""):tf(r,c,u)}}}function Sn(r,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",r),et("load",r);var u=!1,m=!1,y;for(y in c)if(c.hasOwnProperty(y)){var E=c[y];if(E!=null)switch(y){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:wt(r,o,y,E,c,null)}}m&&wt(r,o,"srcSet",c.srcSet,c,null),u&&wt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var O=y=E=m=null,$=null,ee=null;for(u in c)if(c.hasOwnProperty(u)){var ae=c[u];if(ae!=null)switch(u){case"name":m=ae;break;case"type":E=ae;break;case"checked":$=ae;break;case"defaultChecked":ee=ae;break;case"value":y=ae;break;case"defaultValue":O=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,o));break;default:wt(r,o,u,ae,c,null)}}yx(r,y,O,$,ee,E,m,!1);return;case"select":et("invalid",r),u=E=y=null;for(m in c)if(c.hasOwnProperty(m)&&(O=c[m],O!=null))switch(m){case"value":y=O;break;case"defaultValue":E=O;break;case"multiple":u=O;default:wt(r,o,m,O,c,null)}o=y,c=E,r.multiple=!!u,o!=null?xa(r,!!u,o,!1):c!=null&&xa(r,!!u,c,!0);return;case"textarea":et("invalid",r),y=m=u=null;for(E in c)if(c.hasOwnProperty(E)&&(O=c[E],O!=null))switch(E){case"value":u=O;break;case"defaultValue":m=O;break;case"children":y=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:wt(r,o,E,O,c,null)}bx(r,u,m,y);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":wt(r,o,$,u,c,null));return;case"dialog":et("beforetoggle",r),et("toggle",r),et("cancel",r),et("close",r);break;case"iframe":case"object":et("load",r);break;case"video":case"audio":for(u=0;u<Il.length;u++)et(Il[u],r);break;case"image":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"embed":case"source":case"link":et("error",r),et("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in c)if(c.hasOwnProperty(ee)&&(u=c[ee],u!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:wt(r,o,ee,u,c,null)}return;default:if(Rp(o)){for(ae in c)c.hasOwnProperty(ae)&&(u=c[ae],u!==void 0&&dg(r,o,ae,u,c,void 0));return}}for(O in c)c.hasOwnProperty(O)&&(u=c[O],u!=null&&wt(r,o,O,u,c,null))}function Uk(r,o,c,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,E=null,O=null,$=null,ee=null,ae=null;for(se in c){var de=c[se];if(c.hasOwnProperty(se)&&de!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":$=de;default:u.hasOwnProperty(se)||wt(r,o,se,null,u,de)}}for(var ne in u){var se=u[ne];if(de=c[ne],u.hasOwnProperty(ne)&&(se!=null||de!=null))switch(ne){case"type":y=se;break;case"name":m=se;break;case"checked":ee=se;break;case"defaultChecked":ae=se;break;case"value":E=se;break;case"defaultValue":O=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(s(137,o));break;default:se!==de&&wt(r,o,ne,se,u,de)}}Ep(r,E,O,$,ee,ae,y,m);return;case"select":se=E=O=ne=null;for(y in c)if($=c[y],c.hasOwnProperty(y)&&$!=null)switch(y){case"value":break;case"multiple":se=$;default:u.hasOwnProperty(y)||wt(r,o,y,null,u,$)}for(m in u)if(y=u[m],$=c[m],u.hasOwnProperty(m)&&(y!=null||$!=null))switch(m){case"value":ne=y;break;case"defaultValue":O=y;break;case"multiple":E=y;default:y!==$&&wt(r,o,m,y,u,$)}o=O,c=E,u=se,ne!=null?xa(r,!!c,ne,!1):!!u!=!!c&&(o!=null?xa(r,!!c,o,!0):xa(r,!!c,c?[]:"",!1));return;case"textarea":se=ne=null;for(O in c)if(m=c[O],c.hasOwnProperty(O)&&m!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:wt(r,o,O,null,u,m)}for(E in u)if(m=u[E],y=c[E],u.hasOwnProperty(E)&&(m!=null||y!=null))switch(E){case"value":ne=m;break;case"defaultValue":se=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==y&&wt(r,o,E,m,u,y)}vx(r,ne,se);return;case"option":for(var Re in c)ne=c[Re],c.hasOwnProperty(Re)&&ne!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:wt(r,o,Re,null,u,ne));for($ in u)ne=u[$],se=c[$],u.hasOwnProperty($)&&ne!==se&&(ne!=null||se!=null)&&($==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":wt(r,o,$,ne,u,se));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 Ue in c)ne=c[Ue],c.hasOwnProperty(Ue)&&ne!=null&&!u.hasOwnProperty(Ue)&&wt(r,o,Ue,null,u,ne);for(ee in u)if(ne=u[ee],se=c[ee],u.hasOwnProperty(ee)&&ne!==se&&(ne!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,o));break;default:wt(r,o,ee,ne,u,se)}return;default:if(Rp(o)){for(var Et in c)ne=c[Et],c.hasOwnProperty(Et)&&ne!==void 0&&!u.hasOwnProperty(Et)&&dg(r,o,Et,void 0,u,ne);for(ae in u)ne=u[ae],se=c[ae],!u.hasOwnProperty(ae)||ne===se||ne===void 0&&se===void 0||dg(r,o,ae,ne,u,se);return}}for(var Q in c)ne=c[Q],c.hasOwnProperty(Q)&&ne!=null&&!u.hasOwnProperty(Q)&&wt(r,o,Q,null,u,ne);for(de in u)ne=u[de],se=c[de],!u.hasOwnProperty(de)||ne===se||ne==null&&se==null||wt(r,o,de,ne,u,se)}function __(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $k(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),u=0;u<c.length;u++){var m=c[u],y=m.transferSize,E=m.initiatorType,O=m.duration;if(y&&O&&__(E)){for(E=0,O=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],ee=$.startTime;if(ee>O)break;var ae=$.transferSize,de=$.initiatorType;ae&&__(de)&&($=$.responseEnd,E+=ae*($<O?1:(O-ee)/($-ee)))}if(--u,o+=8*(y+E)/(m.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var hg=null,pg=null;function ed(r){return r.nodeType===9?r:r.ownerDocument}function w_(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function E_(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function mg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var gg=null;function Bk(){var r=window.event;return r&&r.type==="popstate"?r===gg?!1:(gg=r,!0):(gg=null,!1)}var T_=typeof setTimeout=="function"?setTimeout:void 0,Fk=typeof clearTimeout=="function"?clearTimeout:void 0,R_=typeof Promise=="function"?Promise:void 0,Hk=typeof queueMicrotask=="function"?queueMicrotask:typeof R_<"u"?function(r){return R_.resolve(null).then(r).catch(qk)}:T_;function qk(r){setTimeout(function(){throw r})}function Ro(r){return r==="head"}function C_(r,o){var c=o,u=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(u===0){r.removeChild(m),Wa(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")zl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,zl(c);for(var y=c.firstChild;y;){var E=y.nextSibling,O=y.nodeName;y[el]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=E}}else c==="body"&&zl(r.ownerDocument.body);c=m}while(c);Wa(o)}function N_(r,o){var c=r;r=0;do{var u=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),u&&u.nodeType===8)if(c=u.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=u}while(c)}function yg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":yg(c),_p(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function Vk(r,o,c,u){for(;r.nodeType===1;){var m=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[el])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=Cr(r.nextSibling),r===null)break}return null}function Gk(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Cr(r.nextSibling),r===null))return null;return r}function j_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Cr(r.nextSibling),r===null))return null;return r}function vg(r){return r.data==="$?"||r.data==="$~"}function bg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Kk(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var u=function(){o(),c.removeEventListener("DOMContentLoaded",u)};c.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Cr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var xg=null;function O_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Cr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function A_(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function k_(r,o,c){switch(o=ed(c),r){case"html":if(r=o.documentElement,!r)throw Error(s(452));return r;case"head":if(r=o.head,!r)throw Error(s(453));return r;case"body":if(r=o.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function zl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);_p(r)}var Nr=new Map,M_=new Set;function td(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Ls=V.d;V.d={f:Zk,r:Yk,D:Xk,C:Qk,L:Wk,m:Jk,X:tM,S:eM,M:nM};function Zk(){var r=Ls.f(),o=Gf();return r||o}function Yk(r){var o=ya(r);o!==null&&o.tag===5&&o.type==="form"?X0(o):Ls.r(r)}var Ya=typeof document>"u"?null:document;function I_(r,o,c){var u=Ya;if(u&&typeof o=="string"&&o){var m=xr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),M_.has(m)||(M_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Sn(o,"link",r),mn(o),u.head.appendChild(o)))}}function Xk(r){Ls.D(r),I_("dns-prefetch",r,null)}function Qk(r,o){Ls.C(r,o),I_("preconnect",r,o)}function Wk(r,o,c){Ls.L(r,o,c);var u=Ya;if(u&&r&&o){var m='link[rel="preload"][as="'+xr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+xr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+xr(c.imageSizes)+'"]')):m+='[href="'+xr(r)+'"]';var y=m;switch(o){case"style":y=Xa(r);break;case"script":y=Qa(r)}Nr.has(y)||(r=v({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Nr.set(y,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Dl(y))||o==="script"&&u.querySelector(Ll(y))||(o=u.createElement("link"),Sn(o,"link",r),mn(o),u.head.appendChild(o)))}}function Jk(r,o){Ls.m(r,o);var c=Ya;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+xr(u)+'"][href="'+xr(r)+'"]',y=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Qa(r)}if(!Nr.has(y)&&(r=v({rel:"modulepreload",href:r},o),Nr.set(y,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Ll(y)))return}u=c.createElement("link"),Sn(u,"link",r),mn(u),c.head.appendChild(u)}}}function eM(r,o,c){Ls.S(r,o,c);var u=Ya;if(u&&r){var m=va(u).hoistableStyles,y=Xa(r);o=o||"default";var E=m.get(y);if(!E){var O={loading:0,preload:null};if(E=u.querySelector(Dl(y)))O.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Nr.get(y))&&Sg(r,c);var $=E=u.createElement("link");mn($),Sn($,"link",r),$._p=new Promise(function(ee,ae){$.onload=ee,$.onerror=ae}),$.addEventListener("load",function(){O.loading|=1}),$.addEventListener("error",function(){O.loading|=2}),O.loading|=4,nd(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:O},m.set(y,E)}}}function tM(r,o){Ls.X(r,o);var c=Ya;if(c&&r){var u=va(c).hoistableScripts,m=Qa(r),y=u.get(m);y||(y=c.querySelector(Ll(m)),y||(r=v({src:r,async:!0},o),(o=Nr.get(m))&&_g(r,o),y=c.createElement("script"),mn(y),Sn(y,"link",r),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function nM(r,o){Ls.M(r,o);var c=Ya;if(c&&r){var u=va(c).hoistableScripts,m=Qa(r),y=u.get(m);y||(y=c.querySelector(Ll(m)),y||(r=v({src:r,async:!0,type:"module"},o),(o=Nr.get(m))&&_g(r,o),y=c.createElement("script"),mn(y),Sn(y,"link",r),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function P_(r,o,c,u){var m=(m=ie.current)?td(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Xa(c.href),c=va(m).hoistableStyles,u=c.get(o),u||(u={type:"style",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=Xa(c.href);var y=va(m).hoistableStyles,E=y.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,E),(y=m.querySelector(Dl(r)))&&!y._p&&(E.instance=y,E.state.loading=5),Nr.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Nr.set(r,c),y||rM(m,r,c,E.state))),o&&u===null)throw Error(s(528,""));return E}if(o&&u!==null)throw Error(s(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Qa(c),c=va(m).hoistableScripts,u=c.get(o),u||(u={type:"script",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function Xa(r){return'href="'+xr(r)+'"'}function Dl(r){return'link[rel="stylesheet"]['+r+"]"}function z_(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function rM(r,o,c,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Sn(o,"link",c),mn(o),r.head.appendChild(o))}function Qa(r){return'[src="'+xr(r)+'"]'}function Ll(r){return"script[async]"+r}function D_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+xr(c.href)+'"]');if(u)return o.instance=u,mn(u),u;var m=v({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),mn(u),Sn(u,"style",m),nd(u,c.precedence,r),o.instance=u;case"stylesheet":m=Xa(c.href);var y=r.querySelector(Dl(m));if(y)return o.state.loading|=4,o.instance=y,mn(y),y;u=z_(c),(m=Nr.get(m))&&Sg(u,m),y=(r.ownerDocument||r).createElement("link"),mn(y);var E=y;return E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Sn(y,"link",u),o.state.loading|=4,nd(y,c.precedence,r),o.instance=y;case"script":return y=Qa(c.src),(m=r.querySelector(Ll(y)))?(o.instance=m,mn(m),m):(u=c,(m=Nr.get(y))&&(u=v({},c),_g(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),mn(m),Sn(m,"link",u),r.head.appendChild(m),o.instance=m);case"void":return null;default:throw Error(s(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,nd(u,c.precedence,r));return o.instance}function nd(r,o,c){for(var u=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,y=m,E=0;E<u.length;E++){var O=u[E];if(O.dataset.precedence===o)y=O;else if(y!==m)break}y?y.parentNode.insertBefore(r,y.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function Sg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function _g(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var rd=null;function L_(r,o,c){if(rd===null){var u=new Map,m=rd=new Map;m.set(c,u)}else m=rd,u=m.get(c),u||(u=new Map,m.set(c,u));if(u.has(r))return u;for(u.set(r,null),c=c.getElementsByTagName(r),m=0;m<c.length;m++){var y=c[m];if(!(y[el]||y[yn]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(o)||"";E=r+E;var O=u.get(E);O?O.push(y):u.set(E,[y])}}return u}function U_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function sM(r,o,c){if(c===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(r=o.disabled,typeof o.precedence=="string"&&r==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function $_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function oM(r,o,c,u){if(c.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=Xa(u.href),y=o.querySelector(Dl(m));if(y){o=y._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=sd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=y,mn(y);return}y=o.ownerDocument||o,u=z_(u),(m=Nr.get(m))&&Sg(u,m),y=y.createElement("link"),mn(y);var E=y;E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Sn(y,"link",u),c.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=sd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var wg=0;function iM(r,o){return r.stylesheets&&r.count===0&&id(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&id(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+o);0<r.imgBytes&&wg===0&&(wg=62500*$k());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&id(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>wg?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)id(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var od=null;function id(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,od=new Map,o.forEach(aM,r),od=null,sd.call(r))}function aM(r,o){if(!(o.state.loading&4)){var c=od.get(r);if(c)var u=c.get(null);else{c=new Map,od.set(r,c);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var E=m[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),u=E)}u&&c.set(null,u)}m=o.instance,E=m.getAttribute("data-precedence"),y=c.get(E)||u,y===u&&c.set(null,m),c.set(E,m),this.count++,u=sd.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),y?y.parentNode.insertBefore(m,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),o.state.loading|=4}}var Ul={$$typeof:j,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function cM(r,o,c,u,m,y,E,O,$){this.tag=1,this.containerInfo=r,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=yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.hiddenUpdates=yi(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function B_(r,o,c,u,m,y,E,O,$,ee,ae,de){return r=new cM(r,o,c,E,$,ee,ae,de,O),o=1,y===!0&&(o|=24),y=Jn(3,null,null,o),r.current=y,y.stateNode=r,o=nm(),o.refCount++,r.pooledCache=o,o.refCount++,y.memoizedState={element:u,isDehydrated:c,cache:o},im(y),r}function F_(r){return r?(r=Na,r):Na}function H_(r,o,c,u,m,y){m=F_(m),u.context===null?u.context=m:u.pendingContext=m,u=mo(o),u.payload={element:c},y=y===void 0?null:y,y!==null&&(u.callback=y),c=go(r,u,o),c!==null&&(Hn(c,r,o),yl(c,r,o))}function q_(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Eg(r,o){q_(r,o),(r=r.alternate)&&q_(r,o)}function V_(r){if(r.tag===13||r.tag===31){var o=_i(r,67108864);o!==null&&Hn(o,r,67108864),Eg(r,67108864)}}function G_(r){if(r.tag===13||r.tag===31){var o=sr();o=Qn(o);var c=_i(r,o);c!==null&&Hn(c,r,o),Eg(r,o)}}var ad=!0;function lM(r,o,c,u){var m=P.T;P.T=null;var y=V.p;try{V.p=2,Tg(r,o,c,u)}finally{V.p=y,P.T=m}}function uM(r,o,c,u){var m=P.T;P.T=null;var y=V.p;try{V.p=8,Tg(r,o,c,u)}finally{V.p=y,P.T=m}}function Tg(r,o,c,u){if(ad){var m=Rg(u);if(m===null)fg(r,o,u,cd,c),Z_(r,u);else if(dM(m,r,o,c,u))u.stopPropagation();else if(Z_(r,u),o&4&&-1<fM.indexOf(r)){for(;m!==null;){var y=ya(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=Cn(y.pendingLanes);if(E!==0){var O=y;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var $=1<<31-vt(E);O.entanglements[1]|=$,E&=~$}us(y),(pt&6)===0&&(qf=Be()+500,Ml(0))}}break;case 31:case 13:O=_i(y,2),O!==null&&Hn(O,y,2),Gf(),Eg(y,2)}if(y=Rg(u),y===null&&fg(r,o,u,cd,c),y===m)break;m=y}m!==null&&u.stopPropagation()}else fg(r,o,u,null,c)}}function Rg(r){return r=Np(r),Cg(r)}var cd=null;function Cg(r){if(cd=null,r=ga(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=f(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return cd=r,null}function K_(r){switch(r){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(We()){case Ve:return 2;case pe:return 8;case Te:case He:return 32;case ht:return 268435456;default:return 32}default:return 32}}var Ng=!1,Co=null,No=null,jo=null,$l=new Map,Bl=new Map,Oo=[],fM="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 Z_(r,o){switch(r){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":No=null;break;case"mouseover":case"mouseout":jo=null;break;case"pointerover":case"pointerout":$l.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(o.pointerId)}}function Fl(r,o,c,u,m,y){return r===null||r.nativeEvent!==y?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:y,targetContainers:[m]},o!==null&&(o=ya(o),o!==null&&V_(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function dM(r,o,c,u,m){switch(o){case"focusin":return Co=Fl(Co,r,o,c,u,m),!0;case"dragenter":return No=Fl(No,r,o,c,u,m),!0;case"mouseover":return jo=Fl(jo,r,o,c,u,m),!0;case"pointerover":var y=m.pointerId;return $l.set(y,Fl($l.get(y)||null,r,o,c,u,m)),!0;case"gotpointercapture":return y=m.pointerId,Bl.set(y,Fl(Bl.get(y)||null,r,o,c,u,m)),!0}return!1}function Y_(r){var o=ga(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,ef(r.priority,function(){G_(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,ef(r.priority,function(){G_(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ld(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=Rg(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Cp=u,c.target.dispatchEvent(u),Cp=null}else return o=ya(c),o!==null&&V_(o),r.blockedOn=c,!1;o.shift()}return!0}function X_(r,o,c){ld(r)&&c.delete(o)}function hM(){Ng=!1,Co!==null&&ld(Co)&&(Co=null),No!==null&&ld(No)&&(No=null),jo!==null&&ld(jo)&&(jo=null),$l.forEach(X_),Bl.forEach(X_)}function ud(r,o){r.blockedOn===o&&(r.blockedOn=null,Ng||(Ng=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hM)))}var fd=null;function Q_(r){fd!==r&&(fd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fd===r&&(fd=null);for(var o=0;o<r.length;o+=3){var c=r[o],u=r[o+1],m=r[o+2];if(typeof u!="function"){if(Cg(u||c)===null)continue;break}var y=ya(c);y!==null&&(r.splice(o,3),o-=3,Rm(y,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function Wa(r){function o($){return ud($,r)}Co!==null&&ud(Co,r),No!==null&&ud(No,r),jo!==null&&ud(jo,r),$l.forEach(o),Bl.forEach(o);for(var c=0;c<Oo.length;c++){var u=Oo[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Oo.length&&(c=Oo[0],c.blockedOn===null);)Y_(c),c.blockedOn===null&&Oo.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],y=c[u+1],E=m[Dn]||null;if(typeof y=="function")E||Q_(c);else if(E){var O=null;if(y&&y.hasAttribute("formAction")){if(m=y,E=y[Dn]||null)O=E.formAction;else if(Cg(m)!==null)continue}else O=E.action;typeof O=="function"?c[u+1]=O:(c.splice(u,3),u-=3),Q_(c)}}}function W_(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function o(){m!==null&&(m(),m=null),u||setTimeout(c,20)}function c(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),m!==null&&(m(),m=null)}}}function jg(r){this._internalRoot=r}dd.prototype.render=jg.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=sr();H_(c,u,r,o,null,null)},dd.prototype.unmount=jg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;H_(r.current,2,null,r,null,null),Gf(),o[ma]=null}};function dd(r){this._internalRoot=r}dd.prototype.unstable_scheduleHydration=function(r){if(r){var o=Ju();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Oo.length&&o!==0&&o<Oo[c].priority;c++);Oo.splice(c,0,r),c===0&&Y_(r)}};var J_=t.version;if(J_!=="19.2.4")throw Error(s(527,J_,"19.2.4"));V.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=h(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var pM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hd.isDisabled&&hd.supportsFiber)try{vr=hd.inject(pM),Zt=hd}catch{}}return Vl.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=iS,y=aS,E=cS;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=B_(r,1,!1,null,null,c,u,null,m,y,E,W_),r[ma]=o.current,ug(r),new jg(o)},Vl.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",y=iS,E=aS,O=cS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(O=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=B_(r,1,!0,o,c??null,u,m,$,y,E,O,W_),o.context=F_(null),c=o.current,u=sr(),u=Qn(u),m=mo(u),m.callback=null,go(c,m,u),c=u,o.current.lanes=c,xs(o,c),us(o),r[ma]=o.current,ug(r),new dd(o)},Vl.version="19.2.4",Vl}var $E;function FB(){if($E)return Yg.exports;$E=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Yg.exports=BB(),Yg.exports}var HB=FB(),Vc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qB={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},VB=class{#e=qB;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},$i=new VB;function GB(e){setTimeout(e,0)}var ea=typeof window>"u"||"Deno"in globalThis;function On(){}function KB(e,t){return typeof e=="function"?e(t):e}function cv(e){return typeof e=="number"&&e>=0&&e!==1/0}function rN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ho(e,t){return typeof e=="function"?e(t):e}function Ar(e,t){return typeof e=="function"?e(t):e}function BE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==xb(l,t.options))return!1}else if(!yu(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||a&&!a(t))}function FE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ta(t.options.mutationKey)!==ta(a))return!1}else if(!yu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function xb(e,t){return(t?.queryKeyHashFn||ta)(e)}function ta(e){return JSON.stringify(e,(t,n)=>lv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function yu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>yu(e[n],t[n])):!1}var ZB=Object.prototype.hasOwnProperty;function sN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=HE(e)&&HE(t);if(!s&&!(lv(e)&&lv(t)))return t;const a=(s?e:Object.keys(e)).length,l=s?t:Object.keys(t),f=l.length,d=s?new Array(f):{};let h=0;for(let g=0;g<f;g++){const v=s?g:l[g],b=e[v],x=t[v];if(b===x){d[v]=b,(s?g<a:ZB.call(e,v))&&h++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[v]=x;continue}const S=sN(b,x,n+1);d[v]=S,S===b&&h++}return a===f&&h===a?e:d}function bh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function HE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lv(e){if(!qE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!qE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function qE(e){return Object.prototype.toString.call(e)==="[object Object]"}function YB(e){return new Promise(t=>{$i.setTimeout(t,e)})}function uv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?sN(e,t):t}function XB(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function QB(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Sb=Symbol();function oN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Sb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _b(e,t){return typeof e=="function"?e(...t):!!e}function WB(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var JB=class extends Vc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ea&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},wb=new JB;function fv(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var eF=GB;function tF(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=eF;const a=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{const f=e;e=[],f.length&&i(()=>{s(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||l()}return d},batchCalls:f=>(...d)=>{a(()=>{f(...d)})},schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var fn=tF(),nF=class extends Vc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ea&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},xh=new nF;function rF(e){return Math.min(1e3*2**e,3e4)}function iN(e){return(e??"online")==="online"?xh.isOnline():!0}var dv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function aN(e){let t=!1,n=0,s;const i=fv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new dv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},h=()=>wb.isFocused()&&(e.networkMode==="always"||xh.isOnline())&&e.canRun(),g=()=>iN(e.networkMode)&&e.canRun(),v=w=>{a()||(s?.(),i.resolve(w))},b=w=>{a()||(s?.(),i.reject(w))},x=()=>new Promise(w=>{s=T=>{(a()||h())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let w;const T=n===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(R){w=Promise.reject(R)}Promise.resolve(w).then(v).catch(R=>{if(a())return;const k=e.retry??(ea?0:3),j=e.retryDelay??rF,C=typeof j=="function"?j(n,R):j,I=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,R);if(t||!I){b(R);return}n++,e.onFail?.(n,R),YB(C).then(()=>h()?void 0:x()).then(()=>{t?b(R):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(s?.(),i),cancelRetry:f,continueRetry:d,canStart:g,start:()=>(g()?S():x().then(S),i)}}var cN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cv(this.gcTime)&&(this.#e=$i.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ea?1/0:300*1e3))}clearGcTimeout(){this.#e&&($i.clearTimeout(this.#e),this.#e=void 0)}},sF=class extends cN{#e;#t;#n;#s;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=GE(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=GE(this.options);t.data!==void 0&&(this.setState(VE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=uv(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(On).catch(On):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Ar(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ho(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!rN(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const f=oN(this.options,t),h=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#a=!1,this.options.persister?this.options.persister(f,h,this):f(h)},l=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:i};return s(f),f})();this.options.behavior?.onFetch(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=aN({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof dv&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof dv){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...lN(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...VE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),fn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function lN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function VE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function GE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oF=class extends Vc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=fv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#d;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),KE(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ar(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),t._defaulted&&!bh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&ZE(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||Ar(this.options.enabled,this.#t)!==Ar(t.enabled,this.#t)||Ho(this.options.staleTime,this.#t)!==Ho(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||Ar(this.options.enabled,this.#t)!==Ar(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return aF(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(On)),t}#g(){this.#x();const e=Ho(this.options.staleTime,this.#t);if(ea||this.#s.isStale||!cv(e))return;const n=rN(this.#s.dataUpdatedAt,e)+1;this.#l=$i.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#c=e,!(ea||Ar(this.options.enabled,this.#t)===!1||!cv(this.#c)||this.#c===0)&&(this.#u=$i.setInterval(()=>{(this.options.refetchIntervalInBackground||wb.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&($i.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&($i.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#s,a=this.#r,l=this.#i,d=e!==n?e.state:this.#n,{state:h}=e;let g={...h},v=!1,b;if(t._optimisticResults){const A=this.hasListeners(),z=!A&&KE(e,t),X=A&&ZE(e,n,t,s);(z||X)&&(g={...g,...lN(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;b=g.data;let T=!1;if(t.placeholderData!==void 0&&b===void 0&&w==="pending"){let A;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(A=i.data,T=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(w="success",b=uv(i?.data,A,t),v=!0)}if(t.select&&b!==void 0&&!T)if(i&&b===a?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=uv(i?.data,b,t),this.#d=b,this.#o=null}catch(A){this.#o=A}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const R=g.fetchStatus==="fetching",k=w==="pending",j=w==="error",C=k&&R,I=b!==void 0,N={status:w,fetchStatus:g.fetchStatus,isPending:k,isSuccess:w==="success",isError:j,isInitialLoading:C,isLoading:C,data:b,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:j&&!I,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:j&&I,isStale:Eb(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Ar(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=N.data!==void 0,z=N.status==="error"&&!A,X=Z=>{z?Z.reject(N.error):A&&Z.resolve(N.data)},q=()=>{const Z=this.#a=N.promise=fv();X(Z)},L=this.#a;switch(L.status){case"pending":e.queryHash===n.queryHash&&X(L);break;case"fulfilled":(z||N.data!==L.value)&&q();break;case"rejected":(!z||N.error!==L.reason)&&q();break}}return N}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),bh(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const a=new Set(i??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(l=>{const f=l;return this.#s[f]!==e[f]&&a.has(f)})};this.#w({listeners:n()})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){fn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function iF(e,t){return Ar(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function KE(e,t){return iF(e,t)||e.state.data!==void 0&&hv(e,t,t.refetchOnMount)}function hv(e,t,n){if(Ar(t.enabled,e)!==!1&&Ho(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Eb(e,t)}return!1}function ZE(e,t,n,s){return(e!==t||Ar(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Eb(e,n)}function Eb(e,t){return Ar(t.enabled,e)!==!1&&e.isStaleByTime(Ho(t.staleTime,e))}function aF(e,t){return!bh(e.getCurrentResult(),t)}function YE(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let g=!1;const v=S=>{WB(S,()=>t.signal,()=>g=!0)},b=oN(t.options,t.fetchOptions),x=async(S,w,T)=>{if(g)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const k=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return v(D),D})(),j=await b(k),{maxPages:C}=t.options,I=T?QB:XB;return{pages:I(S.pages,j,C),pageParams:I(S.pageParams,w,C)}};if(i&&a.length){const S=i==="backward",w=S?cF:XE,T={pages:a,pageParams:l},R=w(s,T);f=await x(T,R,S)}else{const S=e??a.length;do{const w=d===0?l[0]??s.initialPageParam:XE(s,f);if(d>0&&w==null)break;f=await x(f,w),d++}while(d<S)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function XE(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function cF(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var lF=class extends cN{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||uN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=aN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),fn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function uN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uF=class extends Vc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new lF({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=wd(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=wd(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=wd(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=wd(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){fn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>FE(t,n))}findAll(e={}){return this.getAll().filter(t=>FE(e,t))}notify(e){fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return fn.batch(()=>Promise.all(e.map(t=>t.continue().catch(On))))}};function wd(e){return e.options.scope?.id}var fF=class extends Vc{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),bh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ta(n.mutationKey)!==ta(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??uN();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){fn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,s,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,s,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}},dF=class extends Vc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??xb(s,t);let a=this.get(i);return a||(a=new sF({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){fn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>BE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>BE(e,n)):t}notify(e){fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){fn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hF=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new dF,this.#t=e.mutationCache||new uF,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=wb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=xh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ho(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(s.queryHash)?.state.data,l=KB(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return fn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;fn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return fn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=fn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(On).catch(On)}invalidateQueries(e,t={}){return fn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=fn.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(On)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(On)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ho(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(On).catch(On)}fetchInfiniteQuery(e){return e.behavior=YE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(On).catch(On)}ensureInfiniteQueryData(e){return e.behavior=YE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(ta(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{yu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ta(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{yu(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Sb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},fN=_.createContext(void 0),Vr=e=>{const t=_.useContext(fN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pF=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(fN.Provider,{value:e,children:t})),dN=_.createContext(!1),mF=()=>_.useContext(dN);dN.Provider;function gF(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yF=_.createContext(gF()),vF=()=>_.useContext(yF),bF=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?_b(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},xF=e=>{_.useEffect(()=>{e.clearReset()},[e])},SF=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||_b(n,[e.error,s])),_F=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wF=(e,t)=>e.isLoading&&e.isFetching&&!t,EF=(e,t)=>e?.suspense&&t.isPending,QE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function TF(e,t,n){const s=mF(),i=vF(),a=Vr(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",_F(l),bF(l,i,f),xF(i);const d=!a.getQueryCache().get(l.queryHash),[h]=_.useState(()=>new t(a,l)),g=h.getOptimisticResult(l),v=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=v?h.subscribe(fn.batchCalls(b)):On;return h.updateResult(),x},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),_.useEffect(()=>{h.setOptions(l)},[l,h]),EF(l,g))throw QE(l,h,i);if(SF({result:g,errorResetBoundary:i,throwOnError:l.throwOnError,query:f,suspense:l.suspense}))throw g.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,g),l.experimental_prefetchInRender&&!ea&&wF(g,s)&&(d?QE(l,h,i):f?.promise)?.catch(On).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?g:h.trackResult(g)}function mr(e,t){return TF(e,oF)}function vs(e,t){const n=Vr(),[s]=_.useState(()=>new fF(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(fn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(On)},[s]);if(i.error&&_b(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}const pv=new WeakMap,RF=new WeakMap,Sh={current:[]};let Jg=!1,su=0;const tu=new Set,Ed=new Map;function hN(e){for(const t of e){if(Sh.current.includes(t))continue;Sh.current.push(t),t.recompute();const n=RF.get(t);if(n)for(const s of n){const i=pv.get(s);i?.length&&hN(i)}}}function CF(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function NF(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function pN(e){if(su>0&&!Ed.has(e)&&Ed.set(e,e.prevState),tu.add(e),!(su>0)&&!Jg)try{for(Jg=!0;tu.size>0;){const t=Array.from(tu);tu.clear();for(const n of t){const s=Ed.get(n)??n.prevState;n.prevState=s,CF(n)}for(const n of t){const s=pv.get(n);s&&(Sh.current.push(n),hN(s))}for(const n of t){const s=pv.get(n);if(s)for(const i of s)NF(i)}}}finally{Jg=!1,Sh.current=[],Ed.clear()}}function jF(e){su++;try{e()}finally{if(su--,su===0){const t=tu.values().next().value;t&&pN(t)}}}function OF(e){return typeof e=="function"}let AF=class{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var i,a;this.listeners.add(s);const l=(a=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:a.call(i,s,this);return()=>{this.listeners.delete(s),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):OF(t)?this.state=t(this.prevState):this.state=t,(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),pN(this)}};const qo="__TSR_index",WE="popstate",JE="beforeunload";function kF(e){let t=e.getLocation();const n=new Set,s=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?s(l):t=e.getLocation()},a=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();return}const g=e.getBlockers?.()??[],v=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&g.length&&v)for(const b of g){const x=_h(d.path,d.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const h=t.state[qo];f=eT(h+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const h=t.state[qo];f=eT(h,f),a({task:()=>{e.replaceState(l,f),s({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[qo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function eT(e,t){t||(t={});const n=Tb();return{...t,key:n,__TSR_key:n,[qo]:e}}function MF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,l=A=>i=A,f=(A=>A),d=(()=>_h(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Tb();t.history.replaceState({[qo]:0,key:A,__TSR_key:A},"")}let h=d(),g,v=!1,b=!1,x=!1,S=!1;const w=()=>h;let T,R;const k=()=>{T&&(N._ignoreSubscribers=!0,(T.isPush?t.history.pushState:t.history.replaceState)(T.state,"",T.href),N._ignoreSubscribers=!1,T=void 0,R=void 0,g=void 0)},j=(A,z,X)=>{const q=f(z);R||(g=h),h=_h(z,X),T={href:q,state:X,isPush:T?.isPush||A==="push"},R||(R=Promise.resolve().then(()=>k()))},C=A=>{h=d(),N.notify({type:A})},I=async()=>{if(b){b=!1;return}const A=d(),z=A.state[qo]-h.state[qo],X=z===1,q=z===-1,L=!X&&!q||v;v=!1;const Z=L?"GO":q?"BACK":"FORWARD",G=L?{type:"GO",index:z}:{type:q?"BACK":"FORWARD"};if(x)x=!1;else{const te=a();if(typeof document<"u"&&te.length){for(const P of te)if(await P.blockerFn({currentLocation:h,nextLocation:A,action:Z})){b=!0,t.history.go(1),N.notify(G);return}}}h=d(),N.notify(G)},D=A=>{if(S){S=!1;return}let z=!1;const X=a();if(typeof document<"u"&&X.length)for(const q of X){const L=q.enableBeforeUnload??!0;if(L===!0){z=!0;break}if(typeof L=="function"&&L()===!0){z=!0;break}}if(z)return A.preventDefault(),A.returnValue=""},N=kF({getLocation:w,getLength:()=>t.history.length,pushState:(A,z)=>j("push",A,z),replaceState:(A,z)=>j("replace",A,z),back:A=>(A&&(x=!0),S=!0,t.history.back()),forward:A=>{A&&(x=!0),S=!0,t.history.forward()},go:A=>{v=!0,t.history.go(A)},createHref:A=>f(A),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(JE,D,{capture:!0}),t.removeEventListener(WE,I)},onBlocked:()=>{g&&h!==g&&(h=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(JE,D,{capture:!0}),t.addEventListener(WE,I),t.history.pushState=function(...A){const z=n.apply(t.history,A);return N._ignoreSubscribers||C("PUSH"),z},t.history.replaceState=function(...A){const z=s.apply(t.history,A);return N._ignoreSubscribers||C("REPLACE"),z},N}function IF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function _h(e,t){const n=IF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Tb();return{href:n,pathname:n.substring(0,s>0?i>0?Math.min(s,i):s:i>0?i:n.length),hash:s>-1?n.substring(s):"",search:i>-1?n.slice(i,s===-1?void 0:s):"",state:t||{[qo]:0,key:a,__TSR_key:a}}}function Tb(){return(Math.random()+1).toString(36).substring(7)}const PF=!1;function ou(e){let t;return jF(()=>{t=e()}),t}function vu(e){return e[e.length-1]}function zF(e){return typeof e=="function"}function zo(e,t){return zF(e)?e(t):e}const DF=Object.prototype.hasOwnProperty,tT=Object.prototype.propertyIsEnumerable;function or(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=sT(e)&&sT(s);if(!i&&!(wh(e)&&wh(s)))return s;const a=i?e:nT(e);if(!a)return s;const l=i?s:nT(s);if(!l)return s;const f=a.length,d=l.length,h=i?new Array(d):{};let g=0;for(let v=0;v<d;v++){const b=i?v:l[v],x=e[b],S=s[b];if(x===S){h[b]=x,(i?v<f:DF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){h[b]=S;continue}const w=or(x,S,n+1);h[b]=w,w===x&&g++}return f===d&&g===f?e:h}function nT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!tT.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const s=t;for(const i of n){if(!tT.call(e,i))return!1;s.push(i)}return s}function wh(e){if(!rT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!rT(n)||!n.hasOwnProperty("isPrototypeOf"))}function rT(e){return Object.prototype.toString.call(e)==="[object Object]"}function sT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yi(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(!Yi(e[s],t[s],n))return!1;return!0}if(wh(e)&&wh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!Yi(e[l],t[l],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!s||t[l]!==void 0)&&(a++,a>i||!Yi(e[l],t[l],n)))return!1;return i===a}return!1}function jc(e){let t,n;const s=new Promise((i,a)=>{t=i,n=a});return s.status="pending",s.resolve=i=>{s.status="resolved",s.value=i,t(i),e?.(i)},s.reject=i=>{s.status="rejected",n(i)},s}function uc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function LF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function oT(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return LF(t)}const mN=["http:","https:","mailto:","tel:"];function Eh(e){if(!e)return!1;try{const t=new URL(e);return!mN.includes(t.protocol)}catch{return!1}}function Gl(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,s="",i;for(;(i=t.exec(e))!==null;)s+=oT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+oT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function UF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var $F="Invariant failed";function eo(e,t){if(!e)throw new Error($F)}function Th(e){const t=new Map;let n,s;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,s&&(s.next=a,a.prev=s)):(a.next.prev=void 0,n=a.next,a.next=void 0,s&&(a.prev=s,s.next=a)),s=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===s&&(s=void 0)}const f=t.get(a);if(f)f.value=l,i(f);else{const d={key:a,value:l,prev:s};s&&(s.next=d),s=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,s=void 0}}}const Oc=0,na=1,ra=2,bu=3,Bi=4,gN=5;function BF(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Rb(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=Oc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const f=e.length;return n[0]=ra,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=na,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=BF(a);if(l){const[f,d]=l,h=a.charCodeAt(f+1);if(h===45){if(f+2<a.length&&a.charCodeAt(f+2)===36){const g=f+3,v=d;if(g<v)return n[0]=bu,n[1]=t+f,n[2]=t+g,n[3]=t+v,n[4]=t+d+1,n[5]=i,n}}else if(h===36){const g=f+1,v=f+2;return v===d?(n[0]=ra,n[1]=t+f,n[2]=t+g,n[3]=t+v,n[4]=t+d+1,n[5]=e.length,n):(n[0]=na,n[1]=t+f,n[2]=t+v,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Oc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function tp(e,t,n,s,i,a,l){l?.(n);let f=s;{const d=n.fullPath??n.from,h=d.length,g=n.options?.caseSensitive??e,v=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<h;){const x=Rb(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Oc:{const k=d.substring(x[2],x[3]);if(g){const j=i.static?.get(k);if(j)S=j;else{i.static??=new Map;const C=Fi(n.fullPath??n.from);C.parent=i,C.depth=a,S=C,i.static.set(k,C)}}else{const j=k.toLowerCase(),C=i.staticInsensitive?.get(j);if(C)S=C;else{i.staticInsensitive??=new Map;const I=Fi(n.fullPath??n.from);I.parent=i,I.depth=a,S=I,i.staticInsensitive.set(j,I)}}break}case na:{const k=d.substring(w,x[1]),j=d.substring(x[4],T),C=g&&!!(k||j),I=k?C?k:k.toLowerCase():void 0,D=j?C?j:j.toLowerCase():void 0,N=!v&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===C&&A.prefix===I&&A.suffix===D);if(N)S=N;else{const A=ty(na,n.fullPath??n.from,C,I,D);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case bu:{const k=d.substring(w,x[1]),j=d.substring(x[4],T),C=g&&!!(k||j),I=k?C?k:k.toLowerCase():void 0,D=j?C?j:j.toLowerCase():void 0,N=!v&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===C&&A.prefix===I&&A.suffix===D);if(N)S=N;else{const A=ty(bu,n.fullPath??n.from,C,I,D);S=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case ra:{const k=d.substring(w,x[1]),j=d.substring(x[4],T),C=g&&!!(k||j),I=k?C?k:k.toLowerCase():void 0,D=j?C?j:j.toLowerCase():void 0,N=ty(ra,n.fullPath??n.from,C,I,D);S=N,N.parent=i,N.depth=a,i.wildcard??=[],i.wildcard.push(N)}}i=S}if(v&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Fi(n.fullPath??n.from);x.kind=gN,x.parent=i,a++,x.depth=a,i.pathless??=[],i.pathless.push(x),i=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=Fi(n.fullPath??n.from);x.kind=Bi,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=n.options?.params?.parse??null,i.skipOnParamError=v,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)tp(e,t,d,f,i,a,l)}function ey(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Io(e){if(e.pathless)for(const t of e.pathless)Io(t);if(e.static)for(const t of e.static.values())Io(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Io(t);if(e.dynamic?.length){e.dynamic.sort(ey);for(const t of e.dynamic)Io(t)}if(e.optional?.length){e.optional.sort(ey);for(const t of e.optional)Io(t)}if(e.wildcard?.length){e.wildcard.sort(ey);for(const t of e.wildcard)Io(t)}}function Fi(e){return{kind:Oc,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function ty(e,t,n,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:i}}function FF(e,t){const n=Fi("/"),s=new Uint16Array(6);for(const i of e)tp(!1,s,i,1,n,0);Io(n),t.masksTree=n,t.flatCache=Th(1e3)}function HF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Cb(e,t.masksTree);return t.flatCache.set(e,s),s}function qF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Fi("/");const f=new Uint16Array(6);tp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Cb(s,l,n)}function VF(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,i=t.matchCache.get(s);if(i!==void 0)return i;e||="/";let a;try{a=Cb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=ZF(a.route)),t.matchCache.set(s,a),a}function GF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function KF(e,t=!1,n){const s=Fi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return tp(t,i,e,1,s,0,h=>{if(n?.(h,f),eo(!(h.id in a),`Duplicate routes found with id: ${String(h.id)}`),a[h.id]=h,f!==0&&h.path){const g=GF(h.fullPath);(!l[g]||h.fullPath.endsWith("/"))&&(l[g]=h)}f++}),Io(s),{processedTree:{segmentTree:s,singleCache:Th(1e3),matchCache:Th(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Cb(e,t,n=!1){const s=e.split("/"),i=XF(e,s,t,n);if(!i)return null;const[a]=yN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function yN(e,t,n){const s=YF(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,h=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,h++){const g=s[f];if(g.kind===Bi)break;if(g.kind===gN){h--,l--,d--;continue}const v=t[l],b=d;if(v&&(d+=v.length),g.kind===na){i??=n.node.fullPath.split("/");const x=i[h],S=g.prefix?.length??0;if(x.charCodeAt(S)===123){const T=g.suffix?.length??0,R=x.substring(S+2,x.length-T-1),k=v.substring(S,v.length-T);a[R]=decodeURIComponent(k)}else{const T=x.substring(1);a[T]=decodeURIComponent(v)}}else if(g.kind===bu){if(n.skipped&1<<f){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[h],S=g.prefix?.length??0,w=g.suffix?.length??0,T=x.substring(S+3,x.length-w-1),R=g.suffix||g.prefix?v.substring(S,v.length-w):v;R&&(a[T]=decodeURIComponent(R))}else if(g.kind===ra){const x=g,S=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),w=decodeURIComponent(S);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:f,path:d,segment:h}]}function ZF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function YF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function XF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!vu(t),a=i&&e!=="/",l=t.length-(i?1:0),f=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,h=null,g=null;for(;f.length;){const v=f.pop(),{node:b,index:x,skipped:S,depth:w,statics:T,dynamics:R,optionals:k}=v;let{extract:j,rawParams:C,parsedParams:I}=v;if(b.skipOnParamError){if(!ny(e,t,v))continue;C=v.rawParams,j=v.extract,I=v.parsedParams}s&&b.route&&b.kind!==Bi&&Kl(h,v)&&(h=v);const D=x===l;if(D&&(b.route&&!a&&Kl(g,v)&&(g=v),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const N=D?void 0:t[x];let A;if(D&&b.index){const z={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I};let X=!0;if(b.index.skipOnParamError&&(ny(e,t,z)||(X=!1)),X){if(T===l&&!R&&!k&&!S)return z;Kl(g,z)&&(g=z)}}if(b.wildcard&&Kl(d,v))for(const z of b.wildcard){const{prefix:X,suffix:q}=z;if(X&&(D||!(z.caseSensitive?N:A??=N.toLowerCase()).startsWith(X)))continue;if(q){if(D)continue;const Z=t.slice(x).join("/").slice(-q.length);if((z.caseSensitive?Z:Z.toLowerCase())!==q)continue}const L={node:z,index:l,skipped:S,depth:w,statics:T,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I};if(!(z.skipOnParamError&&!ny(e,t,L))){d=L;break}}if(b.optional){const z=S|1<<w,X=w+1;for(let q=b.optional.length-1;q>=0;q--){const L=b.optional[q];f.push({node:L,index:x,skipped:z,depth:X,statics:T,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I})}if(!D)for(let q=b.optional.length-1;q>=0;q--){const L=b.optional[q],{prefix:Z,suffix:G}=L;if(Z||G){const te=L.caseSensitive?N:A??=N.toLowerCase();if(Z&&!te.startsWith(Z)||G&&!te.endsWith(G))continue}f.push({node:L,index:x+1,skipped:S,depth:X,statics:T,dynamics:R,optionals:k+1,extract:j,rawParams:C,parsedParams:I})}}if(!D&&b.dynamic&&N)for(let z=b.dynamic.length-1;z>=0;z--){const X=b.dynamic[z],{prefix:q,suffix:L}=X;if(q||L){const Z=X.caseSensitive?N:A??=N.toLowerCase();if(q&&!Z.startsWith(q)||L&&!Z.endsWith(L))continue}f.push({node:X,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:R+1,optionals:k,extract:j,rawParams:C,parsedParams:I})}if(!D&&b.staticInsensitive){const z=b.staticInsensitive.get(A??=N.toLowerCase());z&&f.push({node:z,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I})}if(!D&&b.static){const z=b.static.get(N);z&&f.push({node:z,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I})}if(b.pathless){const z=w+1;for(let X=b.pathless.length-1;X>=0;X--){const q=b.pathless[X];f.push({node:q,index:x,skipped:S,depth:z,statics:T,dynamics:R,optionals:k,extract:j,rawParams:C,parsedParams:I})}}}if(g&&d)return Kl(d,g)?g:d;if(g)return g;if(d)return d;if(s&&h){let v=h.index;for(let x=0;x<h.index;x++)v+=t[x].length;const b=v===e.length?"/":e.slice(v);return h.rawParams??={},h.rawParams["**"]=decodeURIComponent(b),h}return null}function ny(e,t,n){try{const[s,i]=yN(e,t,n);n.rawParams=s,n.extract=i;const a=n.node.parse(s);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function Kl(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Bi)>(e.node.kind===Bi)||t.node.kind===Bi==(e.node.kind===Bi)&&t.depth>e.depth))):!0}function Qd(e){return Nb(e.filter(t=>t!==void 0).join("/"))}function Nb(e){return e.replace(/\/{2,}/g,"/")}function vN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Hs(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bN(e){return Hs(vN(e))}function Rh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function QF(e,t,n){return Rh(e,n)===Rh(t,n)}function WF({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(s){l=i?t:a?e:e+"\0"+t;const v=s.get(l);if(v)return v}let f;if(a)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&vu(f)==="";)f.pop();const v=t.split("/");for(let b=0,x=v.length;b<x;b++){const S=v[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(vu(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,h="";for(let v=0;v<f.length;v++){v>0&&(h+="/");const b=f[v];if(!b)continue;d=Rb(b,0,d);const x=d[0];if(x===Oc){h+=b;continue}const S=d[5],w=b.substring(0,d[1]),T=b.substring(d[4],S),R=b.substring(d[2],d[3]);x===na?h+=w||T?`${w}{$${R}}${T}`:`$${R}`:x===ra?h+=w||T?`${w}{$}${T}`:"$":h+=`${w}{-$${R}}${T}`}h=Nb(h);const g=h||"/";return l&&s&&s.set(l,g),g}function JF(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(n,"g");return i=>i.replace(s,a=>t.get(a)??a)}function ry(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(i=>iT(i,n)).join("/"):iT(s,n)}function sy({path:e,params:t,decoder:n,...s}){let i=!1;const a={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let f=0,d,h="";for(;f<l;){const v=f;d=Rb(e,v,d);const b=d[5];if(f=b+1,v===b)continue;const x=d[0];if(x===Oc){h+="/"+e.substring(v,b);continue}if(x===ra){const S=t._splat;a._splat=S,a["*"]=S;const w=e.substring(v,d[1]),T=e.substring(d[4],b);if(!S){i=!0,(w||T)&&(h+="/"+w+T);continue}const R=ry("_splat",t,n);h+="/"+w+R+T;continue}if(x===na){const S=e.substring(d[2],d[3]);!i&&!(S in t)&&(i=!0),a[S]=t[S];const w=e.substring(v,d[1]),T=e.substring(d[4],b),R=ry(S,t,n)??"undefined";h+="/"+w+R+T;continue}if(x===bu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(v,d[1]),R=e.substring(d[4],b),k=ry(S,t,n)??"";h+="/"+T+k+R;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:a,interpolatedPath:h||"/",isMissingParams:i}}function iT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ur(e){return!!e?.isNotFound}function e6(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const mv="tsr-scroll-restoration-v1_3",t6=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function n6(){const e=e6();if(!e)return null;const t=e.getItem(mv);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=zo(s,n)||n;try{e.setItem(mv,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Td=n6(),r6=e=>e.state.__TSR_key||e.href;function s6(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ch=!1;function o6({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const f=t||window.history.state?.__TSR_key,d=l[f];Ch=!0;e:{if(s&&d&&Object.keys(d).length>0){for(const v in d){const b=d[v];if(v==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(v){const x=document.querySelector(v);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const h=(a??window.location).hash.split("#",2)[1];if(h){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const b=document.getElementById(h);b&&b.scrollIntoView(v)}break e}const g={top:0,left:0,behavior:n};if(window.scrollTo(g),i)for(const v of i){if(v==="window")continue;const b=typeof v=="function"?v():document.querySelector(v);b&&b.scrollTo(g)}}Ch=!1}function i6(e,t){if(!Td||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Td))return;e.isScrollRestorationSetup=!0,Ch=!1;const s=e.options.getScrollRestorationKey||r6;window.history.scrollRestoration="manual";const i=a=>{if(Ch||!e.isScrollRestoring)return;let l="";if(a.target===document||a.target===window)l="window";else{const d=a.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=s6(a.target)}const f=s(e.state.location);Td.set(d=>{const h=d[f]||={},g=h[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const v=document.querySelector(l);v&&(g.scrollX=v.scrollLeft||0,g.scrollY=v.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",t6(i,100),!0),e.subscribe("onRendered",a=>{const l=s(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(o6({storageKey:mv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Td.set(f=>(f[l]||={},f)))})}function a6(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function c6(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function oy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function l6(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=oy(i):Array.isArray(a)?a.push(oy(i)):n[s]=[a,oy(i)]}return n}const u6=d6(JSON.parse),f6=h6(JSON.stringify,JSON.parse);function d6(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=l6(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function h6(e,t){const n=typeof t=="function";function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=c6(i,s);return a?`?${a}`:""}}const kr="__root__";function p6(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Eh(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${mN.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Dr(e){return e instanceof Response&&!!e.options}const Wd=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},np=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),fc=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},xN=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),eo(n.options.notFoundComponent);const s=e.matches.find(i=>i.routeId===n.id);eo(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,xN(e,t))},Do=(e,t,n)=>{if(!(!Dr(n)&&!ur(n))){if(Dr(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=Dr(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:s,context:fc(e,t.index),isFetching:!1,error:n})),ur(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Dr(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(xN(e,n),n)}},SN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Zl=(e,t,n,s)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,Do(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(f){n=f,Do(e,e.router.getMatch(i),n)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},_N=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!np(e,t)&&(n.options.loader||n.options.beforeLoad||TN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Wd(e)},i);s._nonReactive.pendingTimeout=l}},m6=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;_N(e,t,n,s);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Do(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},g6=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=jc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&Zl(e,n,l,"PARSE_PARAMS"),f&&Zl(e,n,f,"VALIDATE_SEARCH"),_N(e,t,s,i);const d=new AbortController;let h=!1;const g=()=>{h||(h=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},v=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!s.options.beforeLoad){ou(()=>{g(),v()});return}i._nonReactive.beforeLoadPromise=jc();const b={...fc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=np(e,t),R={search:x,abortController:d,params:S,preload:T,context:b,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":w,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},k=C=>{if(C===void 0){ou(()=>{g(),v()});return}(Dr(C)||ur(C))&&(g(),Zl(e,n,C,"BEFORE_LOAD")),ou(()=>{g(),e.updateMatch(t,I=>({...I,__beforeLoadContext:C})),v()})};let j;try{if(j=s.options.beforeLoad(R),uc(j))return g(),j.catch(C=>{Zl(e,n,C,"BEFORE_LOAD")}).then(k)}catch(C){g(),Zl(e,n,C,"BEFORE_LOAD")}k(j)},y6=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>g6(e,n,t,i),f=()=>{if(SN(e,n))return;const d=m6(e,n,i);return uc(d)?d.then(l):l()};return a()},v6=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,f])=>{const d=a?.meta,h=a?.links,g=a?.scripts,v=a?.styles;return{meta:d,links:h,headScripts:g,headers:f,scripts:l,styles:v}})},wN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),h=fc(e,n),g=np(e,t);return{params:a,deps:l,preload:!!g,parentMatchPromise:i,abortController:f,context:h,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},aT=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(PF??e.router.isServer)||i.ssr===!0)&&EN(s);const a=s.options.loader?.(wN(e,t,n,s)),l=s.options.loader&&uc(a);if((l||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),s.options.loader){const h=l?await a:a;Do(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,g=>({...g,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,context:fc(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let l=a;if(l?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:fc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,ur(a)&&await s.options.notFoundComponent?.preload?.(),Do(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,Do(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:fc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),Do(e,a,i)}},b6=async(e,t)=>{async function n(g,v,b,x){const S=Date.now()-v.updatedAt,w=g?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,T=x.options.shouldReload,R=typeof T=="function"?T(wN(e,s,t,x)):T,{status:k,invalid:j}=b;a=k==="success"&&(j||(R??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!0,(async()=>{try{await aT(e,s,t,x);const C=e.router.getMatch(s);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){Dr(C)&&await e.router.navigate(C.options)}})()):(k!=="success"||a&&e.sync)&&await aT(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!SN(e,s)){const g=e.router.getMatch(s),v=np(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload)return g;await g._nonReactive.loaderPromise;const b=e.router.getMatch(s),x=b._nonReactive.error||b.error;x&&Do(e,b,x),b.status==="pending"&&await n(v,g,b,f)}else{const b=v&&!e.router.state.matches.some(S=>S.id===s),x=e.router.getMatch(s);x._nonReactive.loaderPromise=jc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(v,g,x,f)}}const d=e.router.getMatch(s);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function cT(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&Wd(t);try{for(let f=0;f<t.matches.length;f++){const d=y6(t,f);uc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(b6(t,f));const i=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let a;for(const f of i){if(Dr(f))throw f;!a&&ur(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:h}=f,g=t.router.looseRoutesById[h];try{const v=v6(t,d,g);if(v){const b=await v;t.updateMatch(d,x=>({...x,...b}))}}catch(v){console.error(`Error executing head for route ${h}:`,v)}}if(a)throw a;const l=Wd(t);uc(l)&&await l}catch(n){if(ur(n)&&!t.preload){const s=Wd(t);throw uc(s)&&await s,n}if(Dr(n))throw n}return t.matches}async function EN(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of RN){const i=e.options[s]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function TN(e){for(const t of RN)if(e.options[t]?.preload)return!0;return!1}const RN=["component","errorComponent","pendingComponent","notFoundComponent"];function x6(e){return{input:({url:t})=>{for(const n of e)t=gv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=CN(e[n],t);return t}}}function S6(e){const t=bN(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?s:s.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Qd(["/",t,l.pathname]),l)}}function gv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function CN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Xi(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,i=t?.href!==n.href,a=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:i,hashChanged:a}}class _6{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,i=this.basepath??s?.basepath??"/",a=this.basepath===void 0,l=s?.rewrite;if(this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=JF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=MF()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let b;this.resolvePathCache=Th(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new AF(E6(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(b=>!["redirected"].includes(b.status))}}}),i6(this));let f=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(a||i!==d||l!==h){this.basepath=d;const b=[],x=bN(d);x&&x!=="/"&&b.push(S6({basepath:d})),h&&b.push(h),this.rewrite=b.length===0?void 0:b.length===1?b[0]:x6(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=KF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&FF(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,s)=>{const i={eventType:n,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const i=({pathname:d,search:h,hash:g,href:v,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const k=this.options.parseSearch(h),j=this.options.stringifySearch(k);return{href:d+j+g,publicHref:v,pathname:Gl(d).path,external:!1,searchStr:j,search:or(s?.search,k),hash:Gl(g.slice(1)).path,state:or(s?.state,b)}}const x=new URL(v,this.origin),S=gv(this.rewrite,x),w=this.options.parseSearch(S.search),T=this.options.stringifySearch(w);return S.search=T,{href:S.href.replace(S.origin,""),publicHref:v,pathname:Gl(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:or(s?.search,w),hash:Gl(S.hash.slice(1)).path,state:or(s?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:f}=a.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,s)=>WF({base:n,to:Nb(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},i):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>T6({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=n=>{const s=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??f.fullPath,h=this.resolvePathWithBase(d,"."),g=f.search,v={...f.params},b=a.to?this.resolvePathWithBase(h,`${a.to}`):this.resolvePathWithBase(h,"."),x=a.params===!1||a.params===null?{}:(a.params??!0)===!0?v:Object.assign(v,zo(a.params,v)),S=sy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(S);let T=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Hs(S))&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]);let k=!1;if(Object.keys(x).length>0)for(const Z of T){const G=Z.options.params?.stringify??Z.options.stringifyParams;G&&(k=!0,Object.assign(x,G(x)))}const j=n.leaveParams?b:Gl(k?sy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S).path;let C=g;if(n._includeValidateSearch&&this.options.search?.strict){const Z={};T.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Z,Jd(G.options.validateSearch,{...Z,...C}))}catch{}}),C=Z}C=R6({search:C,dest:a,destRoutes:T,_includeValidateSearch:n._includeValidateSearch}),C=or(g,C);const I=this.options.stringifySearch(C),D=a.hash===!0?l.hash:a.hash?zo(a.hash,l.hash):void 0,N=D?`#${D}`:"";let A=a.state===!0?l.state:a.state?zo(a.state,l.state):{};A=or(l.state,A);const z=`${j}${I}${N}`;let X,q,L=!1;if(this.rewrite){const Z=new URL(z,this.origin),G=CN(this.rewrite,Z);X=Z.href.replace(Z.origin,""),G.origin!==this.origin?(q=G.href,L=!0):q=G.pathname+G.search+G.hash}else X=UF(z),q=X;return{publicHref:q,href:X,pathname:j,search:C,searchStr:I,state:A,hash:D??"",external:L,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const h={};if(this.options.routeMasks){const g=HF(f.pathname,this.processedTree);if(g){Object.assign(h,g.rawParams);const{from:v,params:b,...x}=g.route,S=b===!1||b===null?{}:(b??!0)===!0?h:Object.assign(h,zo(b,h));l={from:n.from,...x,params:S},d=s(l)}}}return d&&(f.maskedLocation=d),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:s,...i})=>{const a=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const h=Yi(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),h},l=Hs(this.latestLocation.href)===Hs(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=jc(()=>{f?.resolve()}),l&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,...g}=i;d&&(g={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:s})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:l,href:f,...d}={})=>{if(f){const v=this.history.location.state.__TSR_index,b=_h(f,{__TSR_index:n?v:v+1}),x=new URL(b.pathname,this.origin),S=gv(this.rewrite,x);d.to=S.pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const g=this.commitLocation({...h,viewTransition:a,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:a,...l})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!s&&(s=!0),s){if(n!==void 0||!i){const h=this.buildLocation({to:n,...l});i=i??h.publicHref,a=a??h.publicHref}const d=!f&&a?a:i;if(Eh(d))return Promise.resolve();if(!l.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const v of g)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(i=>!n.some(a=>a.id===i.id))}))},this.load=async n=>{let s,i,a;for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xi({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...Xi({resolvedLocation:h,location:d})}),await cT({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],v=[],b=[];ou(()=>{this.__store.setState(x=>{const S=x.matches,w=x.pendingMatches||x.matches;return g=S.filter(T=>!w.some(R=>R.id===T.id)),v=w.filter(T=>!S.some(R=>R.id===T.id)),b=w.filter(T=>S.some(R=>R.id===T.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...g.filter(T=>T.status!=="error"&&T.status!=="notFound")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[b,"onStay"]].forEach(([x,S])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[S]?.(w)})})})})}})}catch(d){Dr(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):ur(d)&&(i=d),this.__store.setState(h=>({...h,statusCode:s?s.status:i?404:h.matches.some(g=>g.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(Xi({resolvedLocation:l,location:a})):s.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(a=>a.id===n)?"pendingMatches":this.state.matches.some(a=>a.id===n)?"matches":this.state.cachedMatches.some(a=>a.id===n)?"cachedMatches":"";i&&this.__store.setState(a=>({...a,[i]:a[i]?.map(l=>l.id===n?s(l):l)}))})},this.getMatch=n=>{const s=i=>i.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(s),cachedMatches:i.cachedMatches.map(s),pendingMatches:i.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const s=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(i);n.options.href=a,n.headers.set("Location",a)}else if(s)try{const i=new URL(s);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(a=>!s(a))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const a=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=a};this.clearCache({filter:n})},this.loadRouteChunk=EN,this.preloadRoute=async n=>{const s=this.buildLocation(n);let i=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),l=new Set([...a,...this.state.cachedMatches.map(f=>f.id)]);ou(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await cT({router:this,matches:i,location:s,preload:!0,updateMatch:(f,d)=>{a.has(f)?i=i.map(h=>h.id===f?d(h):h):this.updateMatch(f,d)}}),i}catch(f){if(Dr(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});ur(f)||console.error(f);return}},this.matchRoute=(n,s)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(i);if(s?.pending&&this.state.status!=="pending")return!1;const f=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=qF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!Yi(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?Yi(f.search,a.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??f6,parseSearch:t.parseSearch??u6}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:s}){this.routesById=t,this.routesByPath=n,this.processedTree=s;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:a,parsedParams:l}=s;let{matchedRoutes:f}=s,d=!1;(i?i.path!=="/"&&a["**"]:Hs(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const h=d?N6(this.options.notFoundMode,f):void 0,g=new Array(f.length),v=new Map(this.state.matches.map(b=>[b.routeId,b]));for(let b=0;b<f.length;b++){const x=f[b],S=g[b-1];let w,T,R;{const G=S?.search??t.search,te=S?._strictSearch??void 0;try{const P=Jd(x.options.validateSearch,{...G})??void 0;w={...G,...P},T={...te,...P},R=void 0}catch(P){let V=P;if(P instanceof Nh||(V=new Nh(P.message,{cause:P})),n?.throwOnError)throw V;w=G,T={},R=V}}const k=x.options.loaderDeps?.({search:w})??"",j=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:I}=sy({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),D=x.id+C+j,N=this.getMatch(D),A=v.get(x.id),z=N?._strictParams??I;let X;if(!N)try{lT(x,I,l,z)}catch(G){if(ur(G)||Dr(G)?X=G:X=new w6(G.message,{cause:G}),n?.throwOnError)throw X}Object.assign(a,z);const q=A?"stay":"enter";let L;if(N)L={...N,cause:q,params:A?.params??a,_strictParams:z,search:or(A?A.search:N.search,w),_strictSearch:T};else{const G=x.options.loader||x.options.beforeLoad||x.lazyFn||TN(x)?"pending":"success";L={id:D,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??a,_strictParams:z,pathname:C,updatedAt:Date.now(),search:A?or(A.search,w):w,_strictSearch:T,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:X,__routeContext:void 0,_nonReactive:{loadPromise:jc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:A?or(A.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}n?.preload||(L.globalNotFound=h===x.id),L.searchError=R;const Z=this.getParentContext(S);L.context={...Z,...L.__routeContext,...L.__beforeLoadContext},g[b]=L}for(let b=0;b<g.length;b++){const x=g[b],S=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),T=v.get(x.routeId);if(x.params=T?or(T.params,a):a,!w){const R=g[b-1],k=this.getParentContext(R);if(S.options.context){const j={deps:x.loaderDeps,params:x.params,context:k??{},location:t,navigate:C=>this.navigate({...C,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:g,routeId:S.id};x.__routeContext=S.options.context(j)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=vu(n),l={...t.search};for(const g of n)try{Object.assign(l,Jd(g.options.validateSearch,l))}catch{}const f=vu(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let h;if(d)h=f.params;else{const g={...s};for(const v of n)try{lT(v,s,i??{},g)}catch{}h=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:h}}}class Nh extends Error{}class w6 extends Error{}function E6(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Jd(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Nh("Async validation not supported");if(n.issues)throw new Nh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function T6({pathname:e,routesById:t,processedTree:n}){const s={},i=Hs(e);let a,l;const f=VF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[kr]],routeParams:s,foundRoute:a,parsedParams:l}}function R6({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return C6(n)(e,t,s??!1)}function C6(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((g,v)=>v(g),l));const h=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,v)=>v(g),h):h};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...Jd(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:zo(a.search,i):{}};t.middlewares.push(n);const s=(i,a,l)=>{if(i>=l.length)return a;const f=l[i];return f({search:a,next:h=>s(i+1,h,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function N6(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const s=t[n];if(s.children)return s.id}return kr}function lT(e,t,n,s){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(s[a]=n[a]);else{const a=i(s);Object.assign(s,a)}}const j6="Error preloading route! ☝️";class NN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=kr:this.parentRoute||eo(!1);let a=i?kr:s?.path;a&&a!=="/"&&(a=vN(a));const l=s?.id||a;let f=i?kr:Qd([this.parentRoute.id===kr?"":this.parentRoute.id,l]);a===kr&&(a="/"),f!==kr&&(f=Qd(["/",f]));const d=f===kr?"/":Qd([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Hs(d)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>p6({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class O6 extends NN{constructor(t){super(t)}}const Rd=typeof window<"u"?_.useLayoutEffect:_.useEffect;function iy(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function A6(e,t,n={},s={}){_.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,s.disabled,e])}function k6(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function jb(e){const t=e.errorComponent??Ob;return p.jsx(M6,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class M6 extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Ob({error:e}){const[t,n]=_.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function I6({children:e,fallback:t=null}){return jN()?p.jsx(Rc.Fragment,{children:e}):p.jsx(Rc.Fragment,{children:t})}function jN(){return Rc.useSyncExternalStore(P6,()=>!0,()=>!1)}function P6(){return()=>{}}var ay={exports:{}},cy={},ly={exports:{}},uy={};var uT;function z6(){if(uT)return uy;uT=1;var e=Uu();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function f(v,b){var x=b(),S=s({inst:{value:x,getSnapshot:b}}),w=S[0].inst,T=S[1];return a(function(){w.value=x,w.getSnapshot=b,d(w)&&T({inst:w})},[v,x,b]),i(function(){return d(w)&&T({inst:w}),v(function(){d(w)&&T({inst:w})})},[v]),l(x),x}function d(v){var b=v.getSnapshot;v=v.value;try{var x=b();return!n(v,x)}catch{return!0}}function h(v,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return uy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,uy}var fT;function ON(){return fT||(fT=1,ly.exports=z6()),ly.exports}var dT;function D6(){if(dT)return cy;dT=1;var e=Uu(),t=ON();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var s=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return cy.useSyncExternalStoreWithSelector=function(h,g,v,b,x){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function R(D){if(!k){if(k=!0,j=D,D=b(D),x!==void 0&&w.hasValue){var N=w.value;if(x(N,D))return C=N}return C=D}if(N=C,s(j,D))return N;var A=b(D);return x!==void 0&&x(N,A)?(j=D,N):(j=D,C=A)}var k=!1,j,C,I=v===void 0?null:v;return[function(){return R(g())},I===null?void 0:function(){return R(I())}]},[g,v,b,x]);var T=i(h,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},cy}var hT;function L6(){return hT||(hT=1,ay.exports=D6()),ay.exports}var AN=L6();function U6(e,t=s=>s,n={}){const s=n.equal??$6;return AN.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function $6(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!t.has(s)||!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=pT(e);if(n.length!==pT(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function pT(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const fy=_.createContext(null);function kN(){return typeof document>"u"?fy:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=fy,fy)}function Gr(e){const t=_.useContext(kN());return e?.warn,t}function fr(e){const t=Gr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return U6(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=or(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const rp=_.createContext(void 0),B6=_.createContext(void 0);function ys(e){const t=_.useContext(e.from?B6:rp);return fr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(eo(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Ab(e){return ys({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function kb(e){const{select:t,...n}=e;return ys({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Mb(e){return ys({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ib(e){return ys({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function sp(e){const t=Gr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var ii=nN();function F6(e,t){const n=Gr(),s=k6(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:h,hashScrollIntoView:g,replace:v,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:R,style:k,className:j,onClick:C,onFocus:I,onMouseEnter:D,onMouseLeave:N,onTouchStart:A,ignoreBlocker:z,params:X,search:q,hash:L,state:Z,mask:G,reloadDocument:te,unsafeRelative:P,from:V,_fromLocation:U,...F}=e,H=jN(),M=fr({select:Ve=>Ve.location.search,structuralSharing:!0}),K=e.from,W=_.useMemo(()=>({...e,from:K}),[n,M,K,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Y=_.useMemo(()=>n.buildLocation({...W}),[n,W]),le=Y.maskedLocation?Y.maskedLocation.publicHref:Y.publicHref,ie=Y.maskedLocation?Y.maskedLocation.external:Y.external,ce=_.useMemo(()=>Z6(le,ie,n.history,R),[R,ie,le,n.history]),Se=_.useMemo(()=>{if(ce?.external)return Eh(ce.href)?void 0:ce.href;if(!Y6(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Eh(f)?void 0:f}catch{}},[f,ce]),ge=fr({select:Ve=>{if(Se)return!1;if(l?.exact){if(!QF(Ve.location.pathname,Y.pathname,n.basepath))return!1}else{const pe=Rh(Ve.location.pathname,n.basepath),Te=Rh(Y.pathname,n.basepath);if(!(pe.startsWith(Te)&&(pe.length===Te.length||pe[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Yi(Ve.location.search,Y.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?H&&Ve.location.hash===Y.hash:!0}}),$e=ge?zo(i,{})??H6:dy,Ee=ge?dy:zo(a,{})??dy,re=[j,$e.className,Ee.className].filter(Boolean).join(" "),he=(k||$e.style||Ee.style)&&{...k,...$e.style,...Ee.style},[oe,_e]=_.useState(!1),ye=_.useRef(!1),xe=e.reloadDocument||Se?!1:d??n.options.defaultPreload,ve=h??n.options.defaultPreloadDelay??0,ke=_.useCallback(()=>{n.preloadRoute({...W}).catch(Ve=>{console.warn(Ve),console.warn(j6)})},[n,W]),Le=_.useCallback(Ve=>{Ve?.isIntersecting&&ke()},[ke]);A6(s,Le,K6,{disabled:!!R||xe!=="viewport"}),_.useEffect(()=>{ye.current||!R&&xe==="render"&&(ke(),ye.current=!0)},[R,ke,xe]);const we=Ve=>{const pe=Ve.currentTarget.getAttribute("target"),Te=T!==void 0?T:pe;if(!R&&!X6(Ve)&&!Ve.defaultPrevented&&(!Te||Te==="_self")&&Ve.button===0){Ve.preventDefault(),ii.flushSync(()=>{_e(!0)});const He=n.subscribe("onResolved",()=>{He(),_e(!1)});n.navigate({...W,replace:v,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:z})}};if(Se)return{...F,ref:s,href:Se,...w&&{children:w},...T&&{target:T},...R&&{disabled:R},...k&&{style:k},...j&&{className:j},...C&&{onClick:C},...I&&{onFocus:I},...D&&{onMouseEnter:D},...N&&{onMouseLeave:N},...A&&{onTouchStart:A}};const qe=Ve=>{R||xe&&ke()},Qe=qe,Be=Ve=>{if(!(R||!xe))if(!ve)ke();else{const pe=Ve.target;if(Yl.has(pe))return;const Te=setTimeout(()=>{Yl.delete(pe),ke()},ve);Yl.set(pe,Te)}},We=Ve=>{if(R||!xe||!ve)return;const pe=Ve.target,Te=Yl.get(pe);Te&&(clearTimeout(Te),Yl.delete(pe))};return{...F,...$e,...Ee,href:ce?.href,ref:s,onClick:Xl([C,we]),onFocus:Xl([I,qe]),onMouseEnter:Xl([D,Be]),onMouseLeave:Xl([N,We]),onTouchStart:Xl([A,Qe]),disabled:!!R,target:T,...he&&{style:he},...re&&{className:re},...R&&q6,...ge&&V6,...H&&oe&&G6}}const dy={},H6={className:"active"},q6={role:"link","aria-disabled":!0},V6={"data-status":"active","aria-current":"page"},G6={"data-transitioning":"transitioning"},Yl=new WeakMap,K6={rootMargin:"100px"},Xl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Z6(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Y6(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const dc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=F6(s,t),l=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!n){const{disabled:f,...d}=a;return _.createElement("a",d,l)}return _.createElement(n,a,l)});function X6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let Q6=class extends NN{constructor(t){super(t),this.useMatch=n=>ys({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ys({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Ib({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Mb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>kb({...n,from:this.id}),this.useLoaderData=n=>Ab({...n,from:this.id}),this.useNavigate=()=>sp({from:this.fullPath}),this.Link=Rc.forwardRef((n,s)=>p.jsx(dc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ai(e){return new Q6(e)}class W6 extends O6{constructor(t){super(t),this.useMatch=n=>ys({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ys({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Ib({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Mb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>kb({...n,from:this.id}),this.useLoaderData=n=>Ab({...n,from:this.id}),this.useNavigate=()=>sp({from:this.fullPath}),this.Link=Rc.forwardRef((n,s)=>p.jsx(dc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function J6(e){return new W6(e)}function mT(e){return typeof e=="object"?new gT(e,{silent:!0}).createRoute(e):new gT(e,{silent:!0}).createRoute}class gT{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const i=ai(s);return i.isRoot=!1,i},this.silent=n?.silent}}class yT{constructor(t){this.useMatch=n=>ys({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>ys({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Ib({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Mb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>kb({...n,from:this.options.id}),this.useLoaderData=n=>Ab({...n,from:this.options.id}),this.useNavigate=()=>{const n=Gr();return sp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function vT(e){return typeof e=="object"?new yT(e):t=>new yT({id:e,...t})}function eH(){const e=Gr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=fr({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=iy(a),f=a||n||i,d=iy(f),h=a||i,g=iy(h);return e.startTransition=v=>{s(!0),_.startTransition(()=>{v(),s(!1)})},_.useEffect(()=>{const v=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Hs(e.latestLocation.publicHref)!==Hs(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{v()}},[e,e.history]),Rd(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Rd(()=>{l&&!a&&e.emit({type:"onLoad",...Xi(e.state)})},[l,e,a]),Rd(()=>{g&&!h&&e.emit({type:"onBeforeRouteMount",...Xi(e.state)})},[h,g,e]),Rd(()=>{if(d&&!f){const v=Xi(e.state);e.emit({type:"onResolved",...v}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),v.hrefChanged&&a6(e)}},[f,d,e]),null}function tH(e){const t=fr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(jb,{getResetKey:()=>t,onCatch:(n,s)=>{if(ur(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(ur(n))return e.fallback?.(n);throw n},children:e.children})}function nH(){return p.jsx("p",{children:"Not Found"})}function nc(e){return p.jsx(p.Fragment,{children:e.children})}function MN(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(nH,{})}function rH(){return Gr().isScrollRestoring,null}const IN=_.memo(function({matchId:t}){const n=Gr(),s=fr({select:w=>{const T=w.matches.findIndex(k=>k.id===t),R=w.matches[T];return eo(R),{routeId:R.routeId,ssr:R.ssr,_displayPending:R._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[T-1]?.routeId}},structuralSharing:!0}),i=n.routesById[s.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?p.jsx(a,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",v=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?_.Suspense:nc,b=f?jb:nc,x=h?tH:nc,S=i.isRoot?i.options.shellComponent??nc:nc;return p.jsxs(S,{children:[p.jsx(rp.Provider,{value:t,children:p.jsx(v,{fallback:l,children:p.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Ob,onCatch:(w,T)=>{if(ur(w))throw w;d?.(w,T)},children:p.jsx(x,{fallback:w=>{if(!h||w.routeId&&w.routeId!==s.routeId||!w.routeId&&!i.isRoot)throw w;return _.createElement(h,w)},children:g||s._displayPending?p.jsx(I6,{fallback:l,children:p.jsx(bT,{matchId:t})}):p.jsx(bT,{matchId:t})})})})}),s.parentRouteId===kr&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(sH,{}),p.jsx(rH,{})]}):null]})});function sH(){const e=Gr(),t=_.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xi(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const bT=_.memo(function({matchId:t}){const n=Gr(),{match:s,key:i,routeId:a}=fr({select:d=>{const h=d.matches.find(S=>S.id===t),g=h.routeId,b=(n.routesById[g].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:g,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:g,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?p.jsx(d,{},i):p.jsx(PN,{})},[i,l.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const h=n.getMatch(s.id);if(h&&!h._nonReactive.minPendingPromise){const g=jc();h._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return eo(ur(s.error)),MN(n,l,s.error);if(s.status==="redirected")throw eo(Dr(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),PN=_.memo(function(){const t=Gr(),n=_.useContext(rp),s=fr({select:h=>h.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=fr({select:h=>{const v=h.matches.find(b=>b.id===n);return eo(v),v.globalNotFound}}),l=fr({select:h=>{const g=h.matches,v=g.findIndex(b=>b.id===n);return g[v+1]?.id}}),f=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(a)return MN(t,i,void 0);if(!l)return null;const d=p.jsx(IN,{matchId:l});return s===kr?p.jsx(_.Suspense,{fallback:f,children:d}):d});function oH(){const e=Gr(),n=e.routesById[kr].options.pendingComponent??e.options.defaultPendingComponent,s=n?p.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?nc:_.Suspense,a=p.jsxs(i,{fallback:s,children:[p.jsx(eH,{}),p.jsx(iH,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:a}):a}function iH(){const e=Gr(),t=fr({select:i=>i.matches[0]?.id}),n=fr({select:i=>i.loadedAt}),s=t?p.jsx(IN,{matchId:t}):null;return p.jsx(rp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:p.jsx(jb,{getResetKey:()=>n,errorComponent:Ob,onCatch:i=>{i.message||i.toString()},children:s})})}const zN=e=>new aH(e);class aH extends _6{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=mT,globalThis.createLazyFileRoute=vT):typeof window<"u"&&(window.createFileRoute=mT,window.createLazyFileRoute=vT);function cH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=kN(),i=p.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:i}):i}function lH({router:e,...t}){return p.jsx(cH,{router:e,...t,children:p.jsx(oH,{})})}const uH=/\{[^{}]+\}/g,fH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function dH(){return Math.random().toString(36).slice(2,11)}function hH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...h}={...e};d=fH()?d:void 0,t=_T(t);const g=[];async function v(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:R,params:k={},parseAs:j="json",querySerializer:C,bodySerializer:I=a??mH,pathSerializer:D,body:N,middleware:A=[],...z}=x||{};let X=t;S&&(X=_T(S)??t);let q=typeof i=="function"?i:xT(i);C&&(q=typeof C=="function"?C:xT({...typeof i=="object"?i:{},...C}));const L=D||l||pH,Z=N===void 0?void 0:I(N,ST(f,R,k.header)),G=ST(Z===void 0||Z instanceof FormData?{}:{"Content-Type":"application/json"},f,R,k.header),te=[...g,...A],P={redirect:"follow",...h,...z,body:Z,headers:G};let V,U,F=new T(gH(b,{baseUrl:X,params:k,querySerializer:q,pathSerializer:L}),P),H;for(const W in z)W in F||(F[W]=z[W]);if(te.length){V=dH(),U=Object.freeze({baseUrl:X,fetch:w,parseAs:j,querySerializer:q,bodySerializer:I,pathSerializer:L});for(const W of te)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const Y=await W.onRequest({request:F,schemaPath:b,params:k,options:U,id:V});if(Y)if(Y instanceof T)F=Y;else if(Y instanceof Response){H=Y;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!H){try{H=await w(F,d)}catch(W){let Y=W;if(te.length)for(let le=te.length-1;le>=0;le--){const ie=te[le];if(ie&&typeof ie=="object"&&typeof ie.onError=="function"){const ce=await ie.onError({request:F,error:Y,schemaPath:b,params:k,options:U,id:V});if(ce){if(ce instanceof Response){Y=void 0,H=ce;break}if(ce instanceof Error){Y=ce;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Y)throw Y}if(te.length)for(let W=te.length-1;W>=0;W--){const Y=te[W];if(Y&&typeof Y=="object"&&typeof Y.onResponse=="function"){const le=await Y.onResponse({request:F,response:H,schemaPath:b,params:k,options:U,id:V});if(le){if(!(le instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");H=le}}}}const M=H.headers.get("Content-Length");if(H.status===204||F.method==="HEAD"||M==="0"&&!H.headers.get("Transfer-Encoding")?.includes("chunked"))return H.ok?{data:void 0,response:H}:{error:void 0,response:H};if(H.ok)return{data:await(async()=>{if(j==="stream")return H.body;if(j==="json"&&!M){const Y=await H.text();return Y?JSON.parse(Y):void 0}return await H[j]()})(),response:H};let K=await H.text();try{K=JSON.parse(K)}catch{}return{error:K,response:H}}return{request(b,x,S){return v(x,{...S,method:b.toUpperCase()})},GET(b,x){return v(b,{...x,method:"GET"})},PUT(b,x){return v(b,{...x,method:"PUT"})},POST(b,x){return v(b,{...x,method:"POST"})},DELETE(b,x){return v(b,{...x,method:"DELETE"})},OPTIONS(b,x){return v(b,{...x,method:"OPTIONS"})},HEAD(b,x){return v(b,{...x,method:"HEAD"})},PATCH(b,x){return v(b,{...x,method:"PATCH"})},TRACE(b,x){return v(b,{...x,method:"TRACE"})},use(...b){for(const x of b)if(x){if(typeof x!="object"||!("onRequest"in x||"onResponse"in x||"onError"in x))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");g.push(x)}},eject(...b){for(const x of b){const S=g.indexOf(x);S!==-1&&g.splice(S,1)}}}}function op(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function DN(e,t,n){if(!t||typeof t!="object")return"";const s=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const f in t)s.push(f,n.allowReserved===!0?t[f]:encodeURIComponent(t[f]));const l=s.join(",");switch(n.style){case"form":return`${e}=${l}`;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return l}}for(const l in t){const f=n.style==="deepObject"?`${e}[${l}]`:l;s.push(op(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function LN(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",l=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(a);switch(n.style){case"simple":return l;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return`${e}=${l}`}}const s={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(op(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function xT(e){return function(n){const s=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;s.push(LN(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(DN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(op(i,a,e))}}return s.join("&")}}function pH(e,t){let n=e;for(const s of e.match(uH)??[]){let i=s.substring(1,s.length-1),a=!1,l="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(l="label",i=i.substring(1)):i.startsWith(";")&&(l="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const f=t[i];if(Array.isArray(f)){n=n.replace(s,LN(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,DN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${op(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function mH(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function gH(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let s=t.querySerializer(t.params.query??{});return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n}function ST(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const s=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of s)if(a===null)t.delete(i);else if(Array.isArray(a))for(const l of a)t.append(i,l);else a!==void 0&&t.set(i,a)}return t}function _T(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class yH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function vH(e){if(e&&typeof e=="object"&&"error"in e){const t=e.error;if(typeof t=="string")return t}if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return"Request failed"}async function Fu(e){const{data:t,error:n}=await e;if(n||!t)throw new yH(vH(n),n);return t}function bH(e){const t=hH({baseUrl:e.baseUrl,...e.fetch&&{fetch:e.fetch}}),n=e.getHeaders,s=e.transportPath??"direct";return t.use({async onRequest({request:i}){if(n){const a=await n();for(const[l,f]of Object.entries(a))i.headers.set(l,f)}return i.headers.has("x-syncular-transport-path")||i.headers.set("x-syncular-transport-path",s),i}}),t}function xH(e){return bH({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function SH(e){try{const{error:t}=await e.GET("/console/stats");return!t}catch{return!1}}function ci(e,t){const[n,s]=_.useState(()=>{if(typeof window>"u")return t;try{const a=window.localStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});_.useEffect(()=>{try{n==null?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]);const i=_.useCallback(a=>{s(l=>typeof a=="function"?a(l):a)},[]);return[n,i]}const UN=_.createContext(null);function _H({children:e,defaultConfig:t=null}){const[n,s]=ci("sync-console-connection",null),[i,a]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null});_.useEffect(()=>{if(!(n?.serverUrl?.trim()&&n.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){s({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[s,n,t]);const l=_.useCallback(async(v,b)=>{const x=v??n;if(!x)return a(w=>({...w,error:"No connection configured"})),!1;const S={serverUrl:x.serverUrl?.trim()??"",token:x.token?.trim()??""};if(!S.serverUrl)return a(w=>({...w,error:"Server URL is required"})),!1;if(!S.token)return a(w=>({...w,error:"Token is required"})),!1;v&&(b?.persistOverride??!0)&&s(S),a(w=>({...w,isConnecting:!0,error:null}));try{const w=xH(S);return await SH(w)?(a({isConnected:!0,isConnecting:!1,client:w,error:null}),!0):(a({isConnected:!1,isConnecting:!1,client:null,error:"Failed to connect"}),!1)}catch(w){return a({isConnected:!1,isConnecting:!1,client:null,error:w instanceof Error?w.message:"Connection failed"}),!1}},[n,s]),f=_.useCallback(v=>{v?.clearSavedConfig&&s(null),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),d=_.useCallback(()=>{a(v=>({...v,error:null}))},[]),h=_.useCallback(v=>{s(v),a({isConnected:!1,isConnecting:!1,client:null,error:null})},[s]),g=_.useMemo(()=>({config:n,setConfig:h,isConnected:i.isConnected,isConnecting:i.isConnecting,error:i.error,client:i.client,connect:l,disconnect:f,clearError:d}),[n,h,i,l,f,d]);return p.jsx(UN.Provider,{value:g,children:e})}function Kt(){const e=_.useContext(UN);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Bt(){const{client:e}=Kt();return e}function $N(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=$N(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Pb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=$N(e))&&(s&&(s+=" "),s+=t);return s}var wH=e=>typeof e=="number"&&e!=+e,jh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,wT=e=>(typeof e=="number"||e instanceof Number)&&!wH(e);function EH(){}var Oh=Symbol("NOT_FOUND");function TH(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function RH(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function CH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var ET=e=>Array.isArray(e)?e:[e];function NH(e){const t=Array.isArray(e[0])?e[0]:e;return CH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jH(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function OH(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Oh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function AH(e,t){let n=[];function s(f){const d=n.findIndex(h=>t(f,h.key));if(d>-1){const h=n[d];return d>0&&(n.splice(d,1),n.unshift(h)),h.value}return Oh}function i(f,d){s(f)===Oh&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:s,put:i,getEntries:a,clear:l}}var kH=(e,t)=>e===t;function MH(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:i}=n;for(let a=0;a<i;a++)if(!e(n[a],s[a]))return!1;return!0}}function IH(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=kH,maxSize:i=1,resultEqualityCheck:a}=n,l=MH(s);let f=0;const d=i<=1?OH(l):AH(i,l);function h(){let g=d.get(arguments);if(g===Oh){if(g=e.apply(null,arguments),f++,a){const b=d.getEntries().find(x=>a(x.value,g));b&&(g=b.value,f!==0&&f--)}d.put(arguments,g)}return g}return h.clearCache=()=>{d.clear(),h.resetResultsCount()},h.resultsCount=()=>f,h.resetResultsCount=()=>{f=0},h}var PH=class{constructor(e){this.value=e}deref(){return this.value}},zH=typeof WeakRef<"u"?WeakRef:PH,DH=0,TT=1;function Cd(){return{s:DH,v:void 0,o:null,p:null}}function BN(e,t={}){let n=Cd();const{resultEqualityCheck:s}=t;let i,a=0;function l(){let f=n;const{length:d}=arguments;for(let v=0,b=d;v<b;v++){const x=arguments[v];if(typeof x=="function"||typeof x=="object"&&x!==null){let S=f.o;S===null&&(f.o=S=new WeakMap);const w=S.get(x);w===void 0?(f=Cd(),S.set(x,f)):f=w}else{let S=f.p;S===null&&(f.p=S=new Map);const w=S.get(x);w===void 0?(f=Cd(),S.set(x,f)):f=w}}const h=f;let g;if(f.s===TT)g=f.v;else if(g=e.apply(null,arguments),a++,s){const v=i?.deref?.()??i;v!=null&&s(v,g)&&(g=v,a!==0&&a--),i=typeof g=="object"&&g!==null||typeof g=="function"?new zH(g):g}return h.s=TT,h.v=g,g}return l.clearCache=()=>{n=Cd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function FN(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},h=i.pop();typeof h=="object"&&(d=h,h=i.pop()),TH(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const g={...n,...d},{memoize:v,memoizeOptions:b=[],argsMemoize:x=BN,argsMemoizeOptions:S=[]}=g,w=ET(b),T=ET(S),R=NH(i),k=v(function(){return a++,h.apply(null,arguments)},...w),j=x(function(){l++;const I=jH(R,arguments);return f=k.apply(null,I),f},...T);return Object.assign(j,{resultFunc:h,memoizedResultFunc:k,dependencies:R,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var LH=FN(BN),UH=Object.assign((e,t=LH)=>{RH(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(a=>e[a]);return t(s,(...a)=>a.reduce((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>UH});function Ah(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var hy={},py={},my={},RT;function $H(){return RT||(RT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,s,{signal:i,edges:a}={}){let l,f=null;const d=a!=null&&a.includes("leading"),h=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=void 0,f=null)},v=()=>{h&&g(),w()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,v()},s)},S=()=>{b!==null&&(clearTimeout(b),b=null)},w=()=>{S(),l=void 0,f=null},T=()=>{g()},R=function(...k){if(i?.aborted)return;l=this,f=k;const j=b==null;x(),d&&j&&g()};return R.schedule=x,R.cancel=w,R.flush=T,i?.addEventListener("abort",w,{once:!0}),R}e.debounce=t})(my)),my}var CT;function BH(){return CT||(CT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$H();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,h=Array(2);l&&(h[0]="leading"),f&&(h[1]="trailing");let g,v=null;const b=t.debounce(function(...w){g=s.apply(this,w),v=null},i,{edges:h}),x=function(...w){return d!=null&&(v===null&&(v=Date.now()),Date.now()-v>=d)?(g=s.apply(this,w),v=Date.now(),b.cancel(),b.schedule(),g):(b.apply(this,w),g)},S=()=>(b.flush(),g);return x.cancel=b.cancel,x.flush=S,x}e.debounce=n})(py)),py}var NT;function FH(){return NT||(NT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BH();function n(s,i=0,a={}){const{leading:l=!0,trailing:f=!0}=a;return t.debounce(s,i,{leading:l,maxWait:i,trailing:f})}e.throttle=n})(hy)),hy}var gy,jT;function HH(){return jT||(jT=1,gy=FH().throttle),gy}var qH=HH();const VH=S1(qH);var OT=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},ms={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},HN=(e,t,n)=>{var{width:s=ms.width,height:i=ms.height,aspect:a,maxHeight:l}=n,f=jh(s)?e:Number(s),d=jh(i)?t:Number(i);return a&&a>0&&(f?d=f/a:d&&(f=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:f,calculatedHeight:d}},GH={width:0,height:0,overflow:"visible"},KH={width:0,overflowX:"visible"},ZH={height:0,overflowY:"visible"},YH={},XH=e=>{var{width:t,height:n}=e,s=jh(t),i=jh(n);return s&&i?GH:s?KH:i?ZH:YH};function QH(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=ms.width,a=ms.height):i===void 0?i=s&&s>0?void 0:ms.width:a===void 0&&(a=s&&s>0?void 0:ms.height),{width:i,height:a}}function yv(){return yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},yv.apply(null,arguments)}function AT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function kT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AT(Object(n),!0).forEach(function(s){WH(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function WH(e,t,n){return(t=JH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JH(e){var t=eq(e,"string");return typeof t=="symbol"?t:t+""}function eq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qN=_.createContext(ms.initialDimension);function tq(e){return Ah(e.width)&&Ah(e.height)}function VN(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return tq(i)?_.createElement(qN.Provider,{value:i},t):null}var nq=()=>_.useContext(qN),rq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=ms.initialDimension,width:i,height:a,minWidth:l=ms.minWidth,minHeight:f,maxHeight:d,children:h,debounce:g=ms.debounce,id:v,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[R,k]=_.useState({containerWidth:s.width,containerHeight:s.height}),j=_.useCallback((A,z)=>{k(X=>{var q=Math.round(A),L=Math.round(z);return X.containerWidth===q&&X.containerHeight===L?X:{containerWidth:q,containerHeight:L}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return EH;var A=L=>{var Z,G=L[0];if(G!=null){var{width:te,height:P}=G.contentRect;j(te,P),(Z=T.current)===null||Z===void 0||Z.call(T,te,P)}};g>0&&(A=VH(A,g,{trailing:!0,leading:!1}));var z=new ResizeObserver(A),{width:X,height:q}=w.current.getBoundingClientRect();return j(X,q),z.observe(w.current),()=>{z.disconnect()}},[j,g]);var{containerWidth:C,containerHeight:I}=R;OT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:D,calculatedHeight:N}=HN(C,I,{width:i,height:a,aspect:n,maxHeight:d});return OT(D!=null&&D>0||N!=null&&N>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
68
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
69
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
70
|
-
height and width.`,D,N,i,a,l,f,n),_.createElement("div",{id:v?"".concat(v):void 0,className:Pb("recharts-responsive-container",b),style:kT(kT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:XH({width:i,height:a})},_.createElement(VN,{width:D,height:N},h)))}),sq=_.forwardRef((e,t)=>{var n=nq();if(Ah(n.width)&&Ah(n.height))return e.children;var{width:s,height:i}=QH({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=HN(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return wT(a)&&wT(l)?_.createElement(VN,{width:a,height:l},e.children):_.createElement(rq,yv({},e,{width:s,height:i,ref:t}))});const oq=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},iq=(e,t)=>({classGroupId:e,validator:t}),GN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kh="-",MT=[],aq="arbitrary..",cq=e=>{const t=uq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return lq(l);const f=l.split(kh),d=f[0]===""&&f.length>1?1:0;return KN(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],h=n[l];return d?h?oq(h,d):d:h||MT}return n[l]||MT}}},KN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const h=KN(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const f=t===0?e.join(kh):e.slice(t).join(kh),d=l.length;for(let h=0;h<d;h++){const g=l[h];if(g.validator(f))return g.classGroupId}},lq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?aq+s:void 0})(),uq=e=>{const{theme:t,classGroups:n}=e;return fq(n,t)},fq=(e,t)=>{const n=GN();for(const s in e){const i=e[s];zb(i,n,s,t)}return n},zb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];dq(l,t,n,s)}},dq=(e,t,n,s)=>{if(typeof e=="string"){hq(e,t,n);return}if(typeof e=="function"){pq(e,t,n,s);return}mq(e,t,n,s)},hq=(e,t,n)=>{const s=e===""?t:ZN(t,e);s.classGroupId=n},pq=(e,t,n,s)=>{if(gq(e)){zb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(iq(n,e))},mq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];zb(d,ZN(t,f),n,s)}},ZN=(e,t)=>{let n=e;const s=t.split(kh),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=GN(),n.nextPart.set(l,f)),n=f}return n},gq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=s[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},vv="!",IT=":",vq=[],PT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),bq=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,h;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===IT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){h=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const v=a.length===0?i:i.slice(d);let b=v,x=!1;v.endsWith(vv)?(b=v.slice(0,-1),x=!0):v.startsWith(vv)&&(b=v.slice(1),x=!0);const S=h&&h>d?h-d:void 0;return PT(a,x,b,S)};if(t){const i=t+IT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):PT(vq,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},xq=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],f=l[0]==="[",d=t.has(l);f||d?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(l)):i.push(l)}return i.length>0&&(i.sort(),s.push(...i)),s}},Sq=e=>({cache:yq(e.cacheSize),parseClassName:bq(e),sortModifiers:xq(e),...cq(e)}),_q=/\s+/,wq=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(_q);let d="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:v,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(g);if(v){d=g+(d.length>0?" "+d:d);continue}let T=!!w,R=s(T?S.substring(0,w):S);if(!R){if(!T){d=g+(d.length>0?" "+d:d);continue}if(R=s(S),!R){d=g+(d.length>0?" "+d:d);continue}T=!1}const k=b.length===0?"":b.length===1?b[0]:a(b).join(":"),j=x?k+vv:k,C=j+R;if(l.indexOf(C)>-1)continue;l.push(C);const I=i(R,T);for(let D=0;D<I.length;++D){const N=I[D];l.push(j+N)}d=g+(d.length>0?" "+d:d)}return d},Eq=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=YN(n))&&(i&&(i+=" "),i+=s);return i},YN=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=YN(e[s]))&&(n&&(n+=" "),n+=t);return n},Tq=(e,...t)=>{let n,s,i,a;const l=d=>{const h=t.reduce((g,v)=>v(g),e());return n=Sq(h),s=n.cache.get,i=n.cache.set,a=f,f(d)},f=d=>{const h=s(d);if(h)return h;const g=wq(d,n);return i(d,g),g};return a=l,(...d)=>a(Eq(...d))},Rq=[],ln=e=>{const t=n=>n[e]||Rq;return t.isThemeGetter=!0,t},XN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cq=/^\d+\/\d+$/,Nq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jq=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Oq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Aq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tc=e=>Cq.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),yy=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),$s=e=>Nq.test(e),Mq=()=>!0,Iq=e=>jq.test(e)&&!Oq.test(e),WN=()=>!1,Pq=e=>Aq.test(e),zq=e=>kq.test(e),Dq=e=>!Ne(e)&&!je(e),Lq=e=>Gc(e,tj,WN),Ne=e=>XN.test(e),zi=e=>Gc(e,nj,Iq),vy=e=>Gc(e,Hq,Xe),zT=e=>Gc(e,JN,WN),Uq=e=>Gc(e,ej,zq),Nd=e=>Gc(e,rj,Pq),je=e=>QN.test(e),Ql=e=>Kc(e,nj),$q=e=>Kc(e,qq),DT=e=>Kc(e,JN),Bq=e=>Kc(e,tj),Fq=e=>Kc(e,ej),jd=e=>Kc(e,rj,!0),Gc=(e,t,n)=>{const s=XN.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Kc=(e,t,n=!1)=>{const s=QN.exec(e);return s?s[1]?t(s[1]):n:!1},JN=e=>e==="position"||e==="percentage",ej=e=>e==="image"||e==="url",tj=e=>e==="length"||e==="size"||e==="bg-size",nj=e=>e==="length",Hq=e=>e==="number",qq=e=>e==="family-name",rj=e=>e==="shadow",Vq=()=>{const e=ln("color"),t=ln("font"),n=ln("text"),s=ln("font-weight"),i=ln("tracking"),a=ln("leading"),l=ln("breakpoint"),f=ln("container"),d=ln("spacing"),h=ln("radius"),g=ln("shadow"),v=ln("inset-shadow"),b=ln("text-shadow"),x=ln("drop-shadow"),S=ln("blur"),w=ln("perspective"),T=ln("aspect"),R=ln("ease"),k=ln("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...C(),je,Ne],D=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],A=()=>[je,Ne,d],z=()=>[tc,"full","auto",...A()],X=()=>[Mo,"none","subgrid",je,Ne],q=()=>["auto",{span:["full",Mo,je,Ne]},Mo,je,Ne],L=()=>[Mo,"auto",je,Ne],Z=()=>["auto","min","max","fr",je,Ne],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...A()],V=()=>[tc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],U=()=>[e,je,Ne],F=()=>[...C(),DT,zT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",Bq,Lq,{size:[je,Ne]}],K=()=>[yy,Ql,zi],W=()=>["","none","full",h,je,Ne],Y=()=>["",Xe,Ql,zi],le=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[Xe,yy,DT,zT],Se=()=>["","none",S,je,Ne],ge=()=>["none",Xe,je,Ne],$e=()=>["none",Xe,je,Ne],Ee=()=>[Xe,je,Ne],re=()=>[tc,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$s],breakpoint:[$s],color:[Mq],container:[$s],"drop-shadow":[$s],ease:["in","out","in-out"],font:[Dq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$s],shadow:[$s],spacing:["px",Xe],text:[$s],"text-shadow":[$s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",tc,Ne,je,T]}],container:["container"],columns:[{columns:[Xe,Ne,je,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Mo,"auto",je,Ne]}],basis:[{basis:[tc,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,tc,"auto","initial","none",Ne]}],grow:[{grow:["",Xe,je,Ne]}],shrink:[{shrink:["",Xe,je,Ne]}],order:[{order:[Mo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Ql,zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,je,vy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yy,Ne]}],"font-family":[{font:[$q,Ne,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,je,Ne]}],"line-clamp":[{"line-clamp":[Xe,"none",je,vy]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",je,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",je,zi]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Xe,"auto",je,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mo,je,Ne],radial:["",je,Ne],conic:[Mo,je,Ne]},Fq,Uq]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,je,Ne]}],"outline-w":[{outline:["",Xe,Ql,zi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,jd,Nd]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",v,jd,Nd]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Xe,zi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,jd,Nd]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Xe,je,Ne]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[je,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Se()}],brightness:[{brightness:[Xe,je,Ne]}],contrast:[{contrast:[Xe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,jd,Nd]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Xe,je,Ne]}],"hue-rotate":[{"hue-rotate":[Xe,je,Ne]}],invert:[{invert:["",Xe,je,Ne]}],saturate:[{saturate:[Xe,je,Ne]}],sepia:[{sepia:["",Xe,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Xe,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,je,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",je,Ne]}],ease:[{ease:["linear","initial",R,je,Ne]}],delay:[{delay:[Xe,je,Ne]}],animate:[{animate:["none",k,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Xe,Ql,zi,vy]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Gq=Tq(Vq);function me(...e){return Gq(Pb(e))}const Kq={light:"",dark:".dark"},sj=_.createContext(null);function Zq(){const e=_.useContext(sj);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const Yq=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return p.jsx(sj.Provider,{value:{config:s},children:p.jsxs("div",{className:me("flex justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-neutral-500 [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-panel [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-panel [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),"data-chart":f,ref:a,...i,children:[p.jsx(Xq,{config:s,id:f}),p.jsx(sq,{initialDimension:{width:1,height:1},children:n})]})})});Yq.displayName="ChartContainer";function Xq({config:e,id:t}){const n=Object.entries(e).filter(([,s])=>s.theme||s.color);return n.length<1?null:p.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Kq).map(([s,i])=>{const a=n.map(([l,f])=>{const d=f.theme?.[s]??f.color;return d?` --color-${l}: ${d};`:null}).filter(Boolean).join(`
|
|
71
|
-
`);return`${i} [data-chart='${t}'] {
|
|
72
|
-
${a}
|
|
73
|
-
}`}).join(`
|
|
74
|
-
`)}})}const Qq=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:h,labelKey:g,nameKey:v,payload:b},x)=>{const{config:S}=Zq(),w=_.useMemo(()=>{if(a||!b?.length)return null;const R=b[0];if(!R)return null;const k=`${g||R.dataKey||R.name||"value"}`,j=LT(S,R,k),C=!g&&typeof f=="string"?S[f]?.label??f:j?.label;return h?p.jsx("div",{className:me("font-medium",d),children:h(C??"",b)}):C?p.jsx("div",{className:me("font-medium",d),children:C}):null},[S,a,f,d,h,g,b]);if(!e||!b?.length)return null;const T=b.length===1&&l!=="dot";return p.jsxs("div",{className:me("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-surface px-2.5 py-1.5 text-xs shadow-xl",t),ref:x,children:[T?null:w,p.jsx("div",{className:"grid gap-1.5",children:b.map((R,k)=>{const j=`${v||R.name||R.dataKey||"value"}`,C=LT(S,R,j),I=n||R.payload?.fill||R.color;return p.jsx("div",{className:me("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500",l==="dot"?"items-center":null),children:s&&R.value!==void 0&&R.name?s(R.value,R.name,R,k,R.payload??{}):p.jsxs(p.Fragment,{children:[C?.icon?p.jsx(C.icon,{}):i?null:p.jsx("div",{className:me("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",l==="dot"?"h-2.5 w-2.5":null,l==="line"?"w-1":null,l==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&l==="dashed"?"my-0.5":null),style:{"--color-bg":I,"--color-border":I}}),p.jsxs("div",{className:me("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[p.jsxs("div",{className:"grid gap-1.5",children:[T?w:null,p.jsx("span",{className:"text-neutral-500",children:C?.label||R.name})]}),R.value!==void 0?p.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof R.value=="number"?R.value.toLocaleString():R.value}):null]})]})},j)})})]})});Qq.displayName="ChartTooltipContent";function LT(e,t,n){const s=t.payload?.[n],i=typeof s=="string"?s:null,a=typeof t.dataKey=="string"?t.dataKey:null,l=typeof t.name=="string"?t.name:null;return e[i??a??l??n]}const Wq=["1h","6h","24h","7d"],oj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="now",...f},d)=>p.jsxs("div",{ref:d,className:me("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),p.jsx("div",{className:"flex gap-0.5 ml-2",children:Wq.map(h=>p.jsx("button",{type:"button",onClick:()=>s?.(h),className:me("font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all",h===n?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:h},h))})]})]}),p.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((h,g)=>p.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[p.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${h.pullPercent}%`}}),p.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${h.pushPercent}%`}})]},g))}),p.jsxs("div",{className:"flex justify-between mt-1.5",children:[p.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:i}),p.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:a}),p.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:l})]})]}));oj.displayName="ActivityBars";const UT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$T=Pb,li=(e,t)=>n=>{var s;if(t?.variants==null)return $T(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(h=>{const g=n?.[h],v=a?.[h];if(g===null)return null;const b=UT(g)||UT(v);return i[h][b]}),f=n&&Object.entries(n).reduce((h,g)=>{let[v,b]=g;return b===void 0||(h[v]=b),h},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((h,g)=>{let{class:v,className:b,...x}=g;return Object.entries(x).every(S=>{let[w,T]=S;return Array.isArray(T)?T.includes({...a,...f}[w]):{...a,...f}[w]===T})?[...h,v,b]:h},[]);return $T(e,l,d,n?.class,n?.className)},Jq=li("bg-surface border border-border rounded-md px-3 py-1.5 text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600",{variants:{variant:{default:"font-sans text-[13px]",mono:"font-mono text-[12px]"}},defaultVariants:{variant:"default"}}),cr=_.forwardRef(({className:e,variant:t,...n},s)=>p.jsx("input",{ref:s,className:me(Jq({variant:t,className:e})),...n}));cr.displayName="Input";function ip({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=_.useRef(e!==void 0),[a,l]=_.useState(t),f=i?e:a,d=_.useCallback(h=>{i||l(h)},[]);return[f,d]}const BT={};function zn(e,t){const n=_.useRef(BT);return n.current===BT&&(n.current=e(t)),n}const by=_1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],e9=by&&by!==_.useLayoutEffect?by:e=>e();function Oe(e){const t=zn(t9).current;return t.next=e,e9(t.effect),t.trampoline}function t9(){const e={next:void 0,callback:n9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function n9(){}function to(e,t,n,s){const i=zn(ij).current;return s9(i,e,t,n,s)&&aj(i,[e,t,n,s]),i.callback}function r9(e){const t=zn(ij).current;return o9(t,e)&&aj(t,e),t.callback}function ij(){return{callback:null,cleanup:null,refs:[]}}function s9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function o9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function aj(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(s[i]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=s[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const i9=()=>{},De=typeof document<"u"?_.useLayoutEffect:i9,cj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ap={...cj,position:"fixed",top:0,left:0},lj={...cj,position:"absolute"};function Rn(){}const xu=Object.freeze([]),rn=Object.freeze({});function hn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const a9=parseInt(_.version,10);function Db(e){return a9>=e}function FT(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Db(19)?n?.ref:t.ref)??null}function bv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function c9(e,t){const n={};for(const s in e){const i=e[s];if(t?.hasOwnProperty(s)){const a=t[s](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${s.toLowerCase()}`]="":i&&(n[`data-${s.toLowerCase()}`]=i.toString())}return n}function l9(e,t){return typeof e=="function"?e(t):e}function u9(e,t){return typeof e=="function"?e(t):e}const iu={};function Wo(e,t,n,s,i){let a={...xv(e,iu)};return t&&(a=nu(a,t)),n&&(a=nu(a,n)),s&&(a=nu(a,s)),i&&(a=nu(a,i)),a}function f9(e){if(e.length===0)return iu;if(e.length===1)return xv(e[0],iu);let t={...xv(e[0],iu)};for(let n=1;n<e.length;n+=1)t=nu(t,e[n]);return t}function nu(e,t){return uj(t)?t(e):d9(e,t)}function d9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=bv(e.style,s);break}case"className":{e[n]=fj(e.className,s);break}default:h9(n,s)?e[n]=p9(e[n],s):e[n]=s}}return e}function h9(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&s===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function uj(e){return typeof e=="function"}function xv(e,t){return uj(e)?e(t):e??iu}function p9(e,t){return t?e?n=>{if(m9(n)){const i=n;Sv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function Sv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fj(e,t){return t?e?t+" "+e:t:e}function m9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const g9={style:{transition:"none"}},y9="data-base-ui-click-trigger",v9={fallbackAxisSide:"none"},b9={fallbackAxisSide:"end"},x9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Mt(e,t,n={}){const s=t.render,i=S9(t,n);if(n.enabled===!1)return null;const a=n.state??rn;return w9(e,s,i,a)}function S9(e,t={}){const{className:n,style:s,render:i}=e,{state:a=rn,ref:l,props:f,stateAttributesMapping:d,enabled:h=!0}=t,g=h?l9(n,a):void 0,v=h?u9(s,a):void 0,b=h?c9(a,d):rn,x=h?bv(b,Array.isArray(f)?f9(f):f)??rn:rn;return typeof document<"u"&&(h?Array.isArray(l)?x.ref=r9([x.ref,FT(i),...l]):x.ref=to(x.ref,FT(i),l):to(null,null)),h?(g!==void 0&&(x.className=fj(x.className,g)),v!==void 0&&(x.style=bv(x.style,v)),x):rn}const _9=Symbol.for("react.lazy");function w9(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=Wo(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===_9&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return E9(e,n);throw new Error(hn(8))}function E9(e,t){return e==="button"?_.createElement("button",{type:"button",...t,key:t.key}):e==="img"?_.createElement("img",{alt:"",...t,key:t.key}):_.createElement(e,t)}const T9={..._1};let HT=0;function R9(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(HT+=1,s(`${t}-${HT}`))},[n,t]),i}const qT=T9.useId;function Hu(e,t){if(qT!==void 0){const n=qT();return e??(t?`${t}-${n}`:n)}return R9(e,t)}function dr(e){return Hu(e,"base-ui")}function cp(){return typeof window<"u"}function ui(e){return Lb(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bs(e){var t;return(t=(Lb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lb(e){return cp()?e instanceof Node||e instanceof an(e).Node:!1}function Ct(e){return cp()?e instanceof Element||e instanceof an(e).Element:!1}function qt(e){return cp()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function _v(e){return!cp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const C9=new Set(["inline","contents"]);function fi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=hr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!C9.has(i)}const N9=new Set(["table","td","th"]);function j9(e){return N9.has(ui(e))}const O9=[":popover-open",":modal"];function lp(e){return O9.some(t=>{try{return e.matches(t)}catch{return!1}})}const A9=["transform","translate","scale","rotate","perspective"],k9=["transform","translate","scale","rotate","perspective","filter"],M9=["paint","layout","strict","content"];function Ub(e){const t=up(),n=Ct(e)?hr(e):e;return A9.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||k9.some(s=>(n.willChange||"").includes(s))||M9.some(s=>(n.contain||"").includes(s))}function I9(e){let t=no(e);for(;qt(t)&&!Gs(t);){if(Ub(t))return t;if(lp(t))return null;t=no(t)}return null}function up(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P9=new Set(["html","body","#document"]);function Gs(e){return P9.has(ui(e))}function hr(e){return an(e).getComputedStyle(e)}function fp(e){return Ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_v(e)&&e.host||bs(e);return _v(t)?t.host:t}function dj(e){const t=no(e);return Gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:qt(t)&&fi(t)?t:dj(t)}function Vo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=dj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=an(i);if(a){const f=wv(l);return t.concat(l,l.visualViewport||[],fi(i)?i:[],f&&n?Vo(f):[])}return t.concat(i,Vo(i,[],n))}function wv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const hj=_.createContext(void 0);function pj(e=!1){const t=_.useContext(hj);if(t===void 0&&!e)throw new Error(hn(16));return t}function z9(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:a}=e,l=s&&t!==!1,f=s&&t===!1;return{props:_.useMemo(()=>{const h={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return s||(h.tabIndex=i,!a&&n&&(h.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(h["aria-disabled"]=n),a&&(!t||f)&&(h.disabled=n),h},[s,n,t,l,f,a,i])}}function Zc(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=pj(!0)!==void 0,f=Oe(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=z9({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),h=_.useCallback(()=>{const b=a.current;D9(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);De(h,[h]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:R,...k}=b;return Wo({type:i?"button":void 0,onClick(C){if(t){C.preventDefault();return}x?.(C)},onMouseDown(C){t||S?.(C)},onKeyDown(C){if(t||(Sv(C),T?.(C)),C.baseUIHandlerPrevented)return;const I=C.target===C.currentTarget&&!i&&!f()&&!t,D=C.key==="Enter",N=C.key===" ";I&&((N||D)&&C.preventDefault(),D&&x?.(C))},onKeyUp(C){t||(Sv(C),w?.(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!i&&!t&&C.key===" "&&x?.(C)},onPointerDown(C){if(t){C.preventDefault();return}R?.(C)}},i?void 0:{role:"button"},d,k)},[t,d,i,f]),v=Oe(b=>{a.current=b,h()});return{getButtonProps:g,buttonRef:v}}function D9(e){return qt(e)&&e.tagName==="BUTTON"}const mj=_.createContext(void 0);function L9(){const e=_.useContext(mj);if(e===void 0)throw new Error(hn(63));return e}let VT=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const dp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},di={valid(e){return e===null?null:e?{[VT.valid]:""}:{[VT.invalid]:""}}};let GT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const gj={...di,checked(e){return e?{[GT.checked]:""}:{[GT.unchecked]:""}}};function Ev(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const U9=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Rn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Yc(){return _.useContext(U9)}const yj=_.createContext({invalid:void 0,name:void 0,validityData:{state:dp,errors:[],error:"",value:"",initialValue:null},setValidityData:Rn,disabled:void 0,touched:!1,setTouched:Rn,dirty:!1,setDirty:Rn,filled:!1,setFilled:Rn,focused:!1,setFocused:Rn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=rn)=>e,getInputValidationProps:(e=rn)=>e,inputRef:{current:null},commit:async()=>{}}});function hi(e=!0){const t=_.useContext(yj);if(t.setValidityData===Rn&&!e)throw new Error(hn(28));return t}function vj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=Yc(),{invalid:d,markedDirtyRef:h,validityData:g,setValidityData:v}=hi(),b=Oe(e.getValue);De(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&v(S=>({...S,initialValue:x}))},[t,v,n,g.initialValue,b]),De(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:Ev(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),h.current=!0,x?ii.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,h,i,g,n]),De(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const bj=_.createContext({controlId:void 0,registerControlId:Rn,labelId:void 0,setLabelId:Rn,messageIds:[],setMessageIds:Rn,getDescriptionProps:e=>e});function so(){return _.useContext(bj)}function xj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=so(),l=dr(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),h=_.useRef(!1),g=_.useRef(t!=null),v=Oe(()=>{!h.current||a===Rn||(h.current=!1,a(d.current,void 0))});return De(()=>{if(a===Rn)return;let b;if(n){const x=s?.current;Ct(x)&&x.closest("label")!=null?b=t??null:b=f??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{v();return}if(b===void 0){v();return}h.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,v]),_.useEffect(()=>v,[v]),i??l}const Jo="none",KT="trigger-press",Tv="trigger-hover",Sj="outside-press",xy="item-press",_j="focus-out",$9="escape-key",B9="cancel-open",F9="imperative-action",H9="window-resize";function Vt(e,t,n,s){let i=!1,a=!1;const l=s??rn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...l}}function wj(e,t){const n=_.useRef(e),s=Oe(t);De(()=>{n.current!==e&&s(n.current)},[e,s]),De(()=>{n.current=e},[e])}const q9=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,inputRef:f,name:d,nativeButton:h=!1,onCheckedChange:g,readOnly:v=!1,required:b=!1,disabled:x=!1,render:S,uncheckedValue:w,value:T,...R}=t,{clearErrors:k}=Yc(),{state:j,setTouched:C,setDirty:I,validityData:D,setFilled:N,setFocused:A,shouldValidateOnChange:z,validationMode:X,disabled:q,name:L,validation:Z}=hi(),{labelId:G}=so(),te=q||x,P=L??d,V=Oe(g),U=_.useRef(null),F=to(U,f,Z.inputRef),H=_.useRef(null),M=dr(),K=xj({id:l,implicit:!1,controlRef:H}),W=h?void 0:K,[Y,le]=ip({controlled:s,default:!!a,name:"Switch",state:"checked"});vj({id:M,commit:Z.commit,value:Y,controlRef:H,name:P,getValue:()=>Y}),De(()=>{U.current&&N(U.current.checked)},[U,N]),wj(Y,()=>{k(P),I(Y!==D.initialValue),N(Y),z()?Z.commit(Y):Z.commit(Y,!0)});const{getButtonProps:ie,buttonRef:ce}=Zc({disabled:te,native:h}),Se={id:h?K:M,role:"switch","aria-checked":Y,"aria-readonly":v||void 0,"aria-required":b||void 0,"aria-labelledby":G,onFocus(){te||A(!0)},onBlur(){const re=U.current;!re||te||(C(!0),A(!1),X==="onBlur"&&Z.commit(re.checked))},onClick(re){v||te||(re.preventDefault(),U.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},ge=_.useMemo(()=>Wo({checked:Y,disabled:te,id:W,name:P,required:b,style:P?lj:ap,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:F,onChange(re){if(re.nativeEvent.defaultPrevented)return;const he=re.target.checked,oe=Vt(Jo,re.nativeEvent);V?.(he,oe),!oe.isCanceled&&le(he)},onFocus(){H.current?.focus()}},Z.getInputValidationProps,T!==void 0?{value:T}:rn),[Y,te,F,W,P,V,b,le,Z,T]),$e=_.useMemo(()=>({...j,checked:Y,disabled:te,readOnly:v,required:b}),[j,Y,te,v,b]),Ee=Mt("span",t,{state:$e,ref:[n,H,ce],props:[Se,Z.getValidationProps,R,ie],stateAttributesMapping:gj});return p.jsxs(mj.Provider,{value:$e,children:[Ee,!Y&&P&&w!==void 0&&p.jsx("input",{type:"hidden",name:P,value:w}),p.jsx("input",{...ge})]})}),V9=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=hi(),f=L9(),d={...l,...f};return Mt("span",t,{state:d,ref:n,stateAttributesMapping:gj,props:a})}),hp=_.forwardRef(({className:e,...t},n)=>p.jsx(q9,{ref:n,className:me("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:p.jsx(V9,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));hp.displayName="Switch";const Ej=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,h){const g=Number(h);Number.isFinite(g)&&i?.({...s,[d]:g})}return p.jsxs("div",{ref:l,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),p.jsx(hp,{checked:t,onCheckedChange:d=>n?.(d)})]}),p.jsxs("div",{className:"p-4 space-y-3",children:[p.jsx(Sy,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),p.jsx(Sy,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),p.jsx(Sy,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});Ej.displayName="AlertsConfig";function Sy({label:e,value:t,onChange:n}){return p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),p.jsx(cr,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const G9=li("inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] uppercase tracking-wider",{variants:{variant:{default:"bg-white/[0.05] text-neutral-300 border border-border-bright",destructive:"bg-offline/10 text-offline border border-offline/20",ghost:"bg-transparent text-neutral-500 border border-border-bright",outline:"bg-transparent text-neutral-400 border border-border-bright",secondary:"bg-panel text-neutral-400 border border-border",healthy:"bg-healthy/10 text-healthy border border-healthy/20",syncing:"bg-syncing/10 text-syncing border border-syncing/20",offline:"bg-offline/10 text-offline border border-offline/20",flow:"bg-flow/10 text-flow border border-flow/20",relay:"bg-relay/10 text-relay border border-relay/20"}},defaultVariants:{variant:"default"}}),Pn=_.forwardRef(({className:e,variant:t,...n},s)=>p.jsx("span",{ref:s,className:me(G9({variant:t,className:e})),...n}));Pn.displayName="Badge";const K9=li("inline-flex items-center justify-center gap-1.5 rounded-md font-mono transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]",primary:"border border-flow bg-flow/10 text-flow hover:bg-flow/20",destructive:"border border-offline bg-offline/10 text-offline hover:bg-offline/20",ghost:"border border-transparent bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]",link:"border border-transparent bg-transparent text-neutral-400 underline underline-offset-4 hover:text-white",secondary:"border border-border bg-panel text-neutral-400 hover:text-white hover:bg-white/[0.03]"},size:{sm:"text-[10px] px-2.5 py-1",md:"text-[11px] px-3.5 py-1.5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"md"}}),Ie=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>p.jsx("button",{ref:i,className:me(K9({variant:t,size:n,className:e})),...s}));Ie.displayName="Button";const Z9={relay:"relay",admin:"flow",proxy:"ghost"},Y9=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>p.jsxs("div",{ref:l,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"API Keys"}),n&&p.jsx(Ie,{variant:"primary",size:"sm",onClick:n,children:"+ Create Key"})]}),p.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border",children:[p.jsx("span",{className:"w-[140px]",children:"Name"}),p.jsx("span",{className:"w-[70px]",children:"Type"}),p.jsx("span",{className:"flex-1",children:"Prefix"}),p.jsx("span",{className:"w-[90px]",children:"Created"}),p.jsx("span",{className:"w-[80px] text-right",children:"Actions"})]}),t.map((f,d)=>p.jsxs("div",{className:me("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 hover:bg-white/[0.015] transition-colors cursor-default",d<t.length-1&&"border-b border-[#141414]"),children:[p.jsx("span",{className:"w-[140px] text-white truncate",children:f.name}),p.jsx("span",{className:"w-[70px]",children:p.jsx(Pn,{variant:Z9[f.type]??"ghost",children:f.type})}),p.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:f.prefix}),p.jsx("span",{className:"w-[90px] text-neutral-600 truncate",children:f.created}),p.jsxs("span",{className:"w-[80px] flex gap-2 justify-end",children:[s&&p.jsx(Ie,{variant:"default",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>s(f.name),children:"Rotate"}),i&&p.jsx(Ie,{variant:"destructive",size:"sm",className:"text-[9px] px-1.5 py-0.5",onClick:()=>i(f.name),children:"Revoke"})]})]},`${f.name}:${f.prefix}:${d}`))]}));Y9.displayName="ApiKeysTable";const Tj=_.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:s=!0,...i},a)=>p.jsxs("div",{ref:a,className:me("fixed bottom-0 left-0 right-0 z-100 h-8 border-t border-border bg-surface/92 backdrop-blur-lg flex items-center justify-between px-5",e),...i,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(l=>p.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${l}s`}},l))}),s&&p.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),p.jsx("div",{className:"flex items-center gap-6",children:t.map(l=>p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.label))}),n!=null&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));Tj.displayName="BottomBar";const Rj=_.forwardRef(({className:e,commits:t,onViewAll:n,...s},i)=>p.jsxs("div",{ref:i,className:me("px-5 pt-3 pb-2",e),...s,children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&p.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-0.5 border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03] cursor-pointer transition-all",children:"View all →"})]}),p.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-[22px] border-b border-border",children:[p.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),p.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),p.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),p.jsx("span",{className:"flex-1 truncate",children:"Tables"}),p.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(a=>p.jsxs("div",{className:"font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",children:[p.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",a.seq]}),p.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:a.actor}),p.jsx("span",{className:"w-[50px] text-white truncate",children:a.changes}),p.jsx("span",{className:"flex-1 truncate",children:p.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] uppercase tracking-wider bg-transparent text-neutral-500 border border-border-bright",children:a.tables})}),p.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:a.time})]},a.seq))]}));Rj.displayName="CommitTable";const Cj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,onConsoleTokenChange:f,onSaveAndConnect:d,onDisconnect:h,onTestConnection:g,statusMessage:v,...b},x)=>p.jsxs("div",{ref:x,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),p.jsx(Pn,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),p.jsxs("div",{className:"p-5 space-y-4",children:[p.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),p.jsx(cr,{id:"console-server-url",variant:"mono",value:i,onChange:S=>a?.(S.target.value)})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),p.jsx(cr,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx(Ie,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),p.jsx(Ie,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),p.jsx(Ie,{variant:"destructive",size:"md",onClick:h,disabled:!t,children:"Disconnect"})]}),v&&p.jsx("div",{className:me("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:v})]})]}));Cj.displayName="ConnectionForm";const X9=li("animate-spin text-neutral-500",{variants:{size:{sm:"h-3 w-3",md:"h-5 w-5",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),Dt=_.forwardRef(({className:e,size:t,...n},s)=>p.jsxs("svg",{ref:s,className:me(X9({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}));Dt.displayName="Spinner";function Q9({className:e,state:t}){switch(t){case"connected":return p.jsx(Pn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return p.jsx(Pn,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return p.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[p.jsx(Dt,{size:"sm"}),"Connecting"]});case"not-configured":return p.jsx(Pn,{variant:"ghost",className:e,children:"Not configured"})}}const $b=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));$b.displayName="Card";const W9=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));W9.displayName="CardHeader";const J9=_.forwardRef(({className:e,...t},n)=>p.jsx("h3",{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));J9.displayName="CardTitle";const Bb=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("p-4",e),...t}));Bb.displayName="CardContent";const eV=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-4 py-2.5 border-t border-border",e),...t}));eV.displayName="CardFooter";function Nj({action:e,className:t,icon:n,message:s}){return p.jsxs("div",{className:me("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?p.jsx("div",{className:"text-neutral-500",children:n}):null,p.jsx("p",{className:"text-sm text-neutral-500",children:s}),e?p.jsx("div",{children:e}):null]})}const jj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>p.jsxs("div",{ref:f,className:me("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,h)=>p.jsx(tV,{group:d,showDivider:h>0},h)),i!==void 0&&p.jsx("input",{className:"bg-surface border border-border rounded-md font-mono text-[10px] text-foreground outline-none transition focus:border-flow placeholder:text-neutral-600 max-w-[200px] px-2.5 py-1",placeholder:s,value:n,onChange:d=>i(d.target.value)}),a&&p.jsx("div",{className:"ml-auto flex items-center gap-2",children:a})]}));jj.displayName="FilterBar";function tV({group:e,showDivider:t}){return p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{className:"w-px h-4 bg-border"}),p.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&p.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>p.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:me("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))]})]})}function nV(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const rV={online:"healthy",syncing:"syncing",offline:"offline"},sV={realtime:"flow",polling:"ghost"},Oj=_.forwardRef(({className:e,client:t,headSeq:n,onEvict:s,...i},a)=>{const l=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),d=nV(l);return p.jsxs("div",{ref:a,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${d}`},...i,children:[p.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[p.jsx("div",{className:"flex items-center gap-2 min-w-0",children:p.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:t.id,children:t.id.length>14?`${t.id.substring(0,14)}…`:t.id})}),p.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[p.jsx(Pn,{variant:rV[t.status],children:t.status}),p.jsx(Pn,{variant:sV[t.mode],children:t.mode})]})]}),p.jsxs("div",{className:"p-3 space-y-3",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),p.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),p.jsx("div",{className:"h-1 rounded-full bg-surface",children:p.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:d}})}),p.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:d},children:l===0?"Caught up":`${l} behind`})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(_y,{label:"Actor",value:t.actor}),p.jsx(_y,{label:"Dialect",value:t.dialect}),p.jsx(_y,{label:"Last seen",value:t.lastSeen}),p.jsxs("div",{className:"flex justify-between items-start",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),p.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(h=>p.jsx(Pn,{variant:"ghost",children:h},h)),t.scopes.length>2&&p.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),s&&p.jsxs("button",{type:"button",onClick:s,className:"w-full inline-flex items-center justify-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-1 border border-offline/25 bg-offline/[0.04] text-offline hover:border-offline hover:bg-offline/[0.08] cursor-pointer transition-all",children:[p.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[p.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),p.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});Oj.displayName="FleetCard";function _y({label:e,value:t}){return p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const Aj=_.forwardRef(({className:e,handlers:t,tableCount:n,...s},i)=>{const a=n??t.length;return p.jsxs("div",{ref:i,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),p.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[a," tables"]})]}),p.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border",children:[p.jsx("span",{className:"flex-1",children:"Table"}),p.jsx("span",{className:"w-[100px]",children:"Depends On"}),p.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((l,f)=>p.jsxs("div",{className:me("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 hover:bg-white/[0.015] transition-colors cursor-default",f<t.length-1&&"border-b border-[#141414]"),children:[p.jsx("span",{className:"flex-1 text-white truncate",children:l.table}),p.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?p.jsx(Pn,{variant:"ghost",children:l.dependsOn}):p.jsx("span",{className:"text-neutral-600",children:"—"})}),p.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Aj.displayName="HandlersTable";const oV={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},kj=_.forwardRef(({className:e,items:t,...n},s)=>p.jsx("div",{ref:s,className:me("border-b border-border px-6 py-3 flex items-center justify-between flex-wrap gap-4","bg-[linear-gradient(to_bottom,rgba(17,17,17,0.8),#0c0c0c)]",e),...n,children:t.map((i,a)=>p.jsx(iV,{item:i,showDivider:a>0},i.label))}));kj.displayName="KpiStrip";function iV({item:e,showDivider:t}){const n=oV[e.color??"muted"]??"bg-neutral-500";return p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{className:"w-px h-4 bg-border"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",n)}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),p.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&p.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&p.jsx("span",{className:me("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const Mj=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;return p.jsxs("div",{ref:a,className:me("px-5 py-3 border-b border-border flex items-center gap-8",e),...i,children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),p.jsx("div",{className:"flex items-center gap-6",children:t.map(d=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:d.label}),p.jsxs("div",{className:"flex gap-1 items-end h-5",children:[p.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${d.pushBarPercent}%`}}),p.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${d.pullBarPercent}%`}})]}),p.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[d.pushMs," / ",d.pullMs,"ms"]})]},d.label))}),p.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[p.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[p.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),p.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${l} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),p.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",p.jsx("span",{className:"text-neutral-600",children:s})]})]})]})});Mj.displayName="LatencyPercentilesBar";const aV={PUSH:"syncing",PULL:"healthy",ACK:"flow"},Ij=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return p.jsxs("div",{ref:l,className:me("flex-shrink-0",e),style:{width:360},...a,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),p.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),p.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:i?{maxHeight:i}:void 0,children:f.length===0?p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((d,h)=>p.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[p.jsx(Pn,{variant:aV[d.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:d.type}),p.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[d.actor," · ",d.table]}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:d.time})]},`${d.time}-${h}`))})]})});Ij.displayName="LiveActivityFeed";const cV={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},pp=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="default",actionIcon:f,onAction:d,...h},g)=>p.jsxs("div",{ref:g,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...h,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[p.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",cV[s])}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),p.jsxs("div",{className:"p-4",children:[p.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),p.jsx("div",{className:me("grid gap-3 mb-4",i.length<=2?"grid-cols-2":"grid-cols-3"),children:i.map(v=>p.jsxs("div",{children:[p.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:v.label}),p.jsx("div",{className:me("font-mono font-semibold",v.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:v.value})]},v.label))}),p.jsxs(Ie,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));pp.displayName="MaintenanceCard";function lV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return p.jsxs($b,{className:me("border-border",n),children:[a||e?p.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[p.jsxs("div",{children:[a?p.jsx("h3",{className:"text-lg font-semibold",children:a}):null,i?p.jsx("p",{className:"mt-1 text-sm text-neutral-500",children:i}):null]}),e?p.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,p.jsx(Bb,{className:s,children:t})]})}const Pj=_.forwardRef(({className:e,rows:t,onResetDefaults:n,...s},i)=>p.jsxs("div",{ref:i,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&p.jsx(Ie,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),p.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>p.jsx(uV,{row:a,showDivider:l>0},a.label))})]}));Pj.displayName="PreferencesPanel";function uV({row:e,showDivider:t}){return p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{className:"border-t border-border"}),p.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),p.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>p.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:me("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&p.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),p.jsx(hp,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function zj({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return p.jsxs($b,{className:n,children:[a||e?p.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[p.jsxs("div",{children:[a?p.jsx("h3",{className:"text-lg font-semibold",children:a}):null,i?p.jsx("p",{className:"mt-1 text-sm text-neutral-500",children:i}):null]}),e?p.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,p.jsx(Bb,{className:s,children:t})]})}const fV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},dV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},Dj=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>p.jsxs("div",{ref:f,className:me("h-full flex flex-col",e),...l,children:[n,p.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border bg-white/[0.01]",children:[p.jsx("span",{className:"w-[50px] truncate",children:"Time"}),p.jsx("span",{className:"w-[65px] truncate",children:"Type"}),p.jsx("span",{className:"w-[55px] truncate",children:"ID"}),p.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),p.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),p.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),p.jsx("span",{className:"w-[120px] truncate",children:"Client"}),p.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),p.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((d,h)=>p.jsx(hV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${h}`))}),s]}));Dj.displayName="StreamLog";function hV({entry:e,isSelected:t,onClick:n}){const s=fV[e.type]??"text-neutral-500",i=dV[e.outcome]??"text-neutral-600",a=me("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors",n?"cursor-pointer":"cursor-default",t&&"bg-white/[0.05]"),l=p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),p.jsx("span",{className:me("w-[65px] font-medium truncate",s),children:e.type.toUpperCase()}),p.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),p.jsx("span",{className:me("w-[65px] truncate",i),children:e.outcome}),p.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),p.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),p.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),p.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?p.jsx("button",{type:"button",className:me(a,"w-full bg-transparent text-left"),onClick:()=>n(e),children:l}):p.jsx("div",{className:a,children:l})}function pV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const Lj=_.forwardRef(({className:e,clients:t,headSeq:n,maxLag:s,minSeq:i,...a},l)=>{const f=t.map(b=>b.cursor),d=i??Math.min(...f,n)-10,h=s??Math.max(...t.map(b=>n-b.cursor),0),g=n-d,v=[d,Math.round(d+g*.33),Math.round(d+g*.66),n];return p.jsxs("div",{ref:l,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[p.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),p.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),p.jsx("div",{className:"w-px h-3 bg-border"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),p.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:h})]})]})]}),p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[p.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:v.map(b=>p.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),p.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-flow/40",style:{right:"2%"}}),t.map(b=>{const x=g>0?(b.cursor-d)/g*96+2:50,S=pV(b.status),w=b.status==="offline"?.4:1;return p.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:w},title:`${b.id} → #${b.cursor}`,children:p.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:S,boxShadow:`0 0 4px ${S}`}})},b.id)})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),p.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});Lj.displayName="SyncHorizon";function mV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const gV=_.createContext(void 0);function Fb(e){const t=_.useContext(gV);if(t===void 0)throw new Error(hn(72));return t}const yV=[];function Hb(e){_.useEffect(e,yV)}const Wl=0;class ei{static create(){return new ei}currentId=Wl;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Wl,n()},t)}isStarted(){return this.currentId!==Wl}clear=()=>{this.currentId!==Wl&&(clearTimeout(this.currentId),this.currentId=Wl)};disposeEffect=()=>this.clear}function ts(){const e=zn(ei.create).current;return Hb(e.disposeEffect),e}function Go(e){const t=zn(vV,e).current;return t.next=e,De(t.effect),t}function vV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Tt(e){return e?.ownerDocument||document}const Xc=typeof navigator<"u",wy=SV(),Uj=wV(),$j=_V(),qb=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Bj=wy.platform==="MacIntel"&&wy.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(wy.platform),bV=Xc&&/apple/i.test(navigator.vendor),Rv=Xc&&/android/i.test(Uj)||/android/i.test($j);Xc&&Uj.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const xV=$j.includes("jsdom/");function SV(){if(!Xc)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function _V(){if(!Xc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function wV(){if(!Xc)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Cv="data-base-ui-focusable",Fj="active",Hj="selected",qj="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ey="ArrowLeft",Ty="ArrowRight",EV="ArrowUp",TV="ArrowDown";function Po(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ot(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&_v(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function RV(e,t){if(!Ct(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,s]of t.entries())if(Ot(s,n))return!s.hasAttribute("data-trigger-disabled");return!1}function Mr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function CV(e){return e.matches("html,body")}function Vj(e){return qt(e)&&e.matches(qj)}function ZT(e){return e?e.getAttribute("role")==="combobox"&&Vj(e):!1}function Mh(e){return e?e.hasAttribute(Cv)?e:e.querySelector(`[${Cv}]`)||e:null}function hc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...hc(e,i.id,n)])}function YT(e,t){let n=[],s=e.find(i=>i.id===t)?.parentId;for(;s;){const i=e.find(a=>a.id===s);s=i?.parentId,i&&(n=n.concat(i))}return n}function Li(e){e.preventDefault(),e.stopPropagation()}function NV(e){return"nativeEvent"in e}function jV(e){return e.pointerType===""&&e.isTrusted?!0:Rv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function OV(e){return xV?!1:!Rv&&e.width===0&&e.height===0||Rv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function AV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function kV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const MV=["top","right","bottom","left"],Ac=Math.min,ar=Math.max,Ih=Math.round,ic=Math.floor,gs=e=>({x:e,y:e}),IV={left:"right",right:"left",bottom:"top",top:"bottom"},PV={start:"end",end:"start"};function Nv(e,t,n){return ar(e,Ac(t,n))}function ro(e,t){return typeof e=="function"?e(t):e}function Vn(e){return e.split("-")[0]}function pi(e){return e.split("-")[1]}function Vb(e){return e==="x"?"y":"x"}function Gb(e){return e==="y"?"height":"width"}const zV=new Set(["top","bottom"]);function Lr(e){return zV.has(Vn(e))?"y":"x"}function Kb(e){return Vb(Lr(e))}function DV(e,t,n){n===void 0&&(n=!1);const s=pi(e),i=Kb(e),a=Gb(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Ph(l)),[l,Ph(l)]}function LV(e){const t=Ph(e);return[jv(e),t,jv(t)]}function jv(e){return e.replace(/start|end/g,t=>PV[t])}const XT=["left","right"],QT=["right","left"],UV=["top","bottom"],$V=["bottom","top"];function BV(e,t,n){switch(e){case"top":case"bottom":return n?t?QT:XT:t?XT:QT;case"left":case"right":return t?UV:$V;default:return[]}}function FV(e,t,n,s){const i=pi(e);let a=BV(Vn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(jv)))),a}function Ph(e){return e.replace(/left|right|bottom|top/g,t=>IV[t])}function HV(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gj(e){return typeof e!="number"?HV(e):{top:e,right:e,bottom:e,left:e}}function zh(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function Od(e,t,n){return Math.floor(e/t)!==n}function eh(e,t){return t<0||t>=e.current.length}function qV(e,t){return ir(e,{disabledIndices:t})}function VV(e,t){return ir(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ir(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&au(e,a,s));return a}function GV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:h,stopEvent:g=!1}){let v=h;const b=[],x={};let S=!1;{let R=null,k=-1;e.current.forEach((j,C)=>{if(j==null)return;const I=j.closest('[role="row"]');I&&(S=!0),(I!==R||k===-1)&&(R=I,k+=1,b[k]=[]),b[k].push(C),x[C]=k})}const w=S&&b.length>0&&b.some(R=>R.length!==a);function T(R){if(!w||h===-1)return;const k=x[h];if(k==null)return;const j=b[k].indexOf(h);let C=R==="up"?k-1:k+1;s&&(C<0?C=b.length-1:C>=b.length&&(C=0));const I=new Set;for(;C>=0&&C<b.length&&!I.has(C);){I.add(C);const D=b[C];if(D.length===0){C=R==="up"?C-1:C+1;continue}const N=Math.min(j,D.length-1);for(let A=N;A>=0;A-=1){const z=D[A];if(!au(e,z,l))return z}C=R==="up"?C-1:C+1,s&&(C<0?C=b.length-1:C>=b.length&&(C=0))}}if(t.key===EV){const R=T("up");if(R!==void 0)g&&Li(t),v=R;else{if(g&&Li(t),h===-1)v=d;else if(v=ir(e,{startingIndex:v,amount:a,decrement:!0,disabledIndices:l}),s&&(h-a<f||v<0)){const k=h%a,j=d%a,C=d-(j-k);j===k?v=d:v=j>k?C:C-a}eh(e,v)&&(v=h)}}if(t.key===TV){const R=T("down");R!==void 0?(g&&Li(t),v=R):(g&&Li(t),h===-1?v=f:(v=ir(e,{startingIndex:h,amount:a,disabledIndices:l}),s&&h+a>d&&(v=ir(e,{startingIndex:h%a-a,amount:a,disabledIndices:l}))),eh(e,v)&&(v=h))}if(n==="both"){const R=ic(h/a);t.key===(i?Ey:Ty)&&(g&&Li(t),h%a!==a-1?(v=ir(e,{startingIndex:h,disabledIndices:l}),s&&Od(v,a,R)&&(v=ir(e,{startingIndex:h-h%a-1,disabledIndices:l}))):s&&(v=ir(e,{startingIndex:h-h%a-1,disabledIndices:l})),Od(v,a,R)&&(v=h)),t.key===(i?Ty:Ey)&&(g&&Li(t),h%a!==0?(v=ir(e,{startingIndex:h,decrement:!0,disabledIndices:l}),s&&Od(v,a,R)&&(v=ir(e,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:l}))):s&&(v=ir(e,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:l})),Od(v,a,R)&&(v=h));const k=ic(d/a)===R;eh(e,v)&&(s&&k?v=t.key===(i?Ty:Ey)?d:ir(e,{startingIndex:h-h%a-1,disabledIndices:l}):v=h)}return v}function KV(e,t,n){const s=[];let i=0;return e.forEach(({width:a,height:l},f)=>{let d=!1;for(n&&(i=0);!d;){const h=[];for(let g=0;g<a;g+=1)for(let v=0;v<l;v+=1)h.push(i+g+v*t);i%t+a<=t&&h.every(g=>s[g]==null)?(h.forEach(g=>{s[g]=f}),d=!0):i+=1}}),[...s]}function ZV(e,t,n,s,i){if(e===-1)return-1;const a=n.indexOf(e),l=t[e];switch(i){case"tl":return a;case"tr":return l?a+l.width-1:a;case"bl":return l?a+(l.height-1)*s:a;case"br":return n.lastIndexOf(e);default:return-1}}function YV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function au(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var XV=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Dh=XV.join(","),Kj=typeof Element>"u",kc=Kj?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Lh=!Kj&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Uh=function(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),a=i===""||i==="true",l=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Uh(t.parentNode));return l},QV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},Zj=function(t,n,s){if(Uh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Dh));return n&&kc.call(t,Dh)&&i.unshift(t),i=i.filter(s),i},$h=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Uh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,h=$h(d,!0,s);s.flatten?i.push.apply(i,h):i.push({scopeParent:l,candidates:h})}else{var g=kc.call(l,Dh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var v=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Uh(v,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(v&&b){var x=$h(v===!0?l.children:v.children,!0,s);s.flatten?i.push.apply(i,x):i.push({scopeParent:l,candidates:x})}else a.unshift.apply(a,l.children)}}return i},Yj=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xj=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||QV(t))&&!Yj(t)?0:t.tabIndex},WV=function(t,n){var s=Xj(t);return s<0&&n&&!Yj(t)?0:s},JV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qj=function(t){return t.tagName==="INPUT"},e8=function(t){return Qj(t)&&t.type==="hidden"},t8=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},n8=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},r8=function(t){if(!t.name)return!0;var n=t.form||Lh(t),s=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var a=n8(i,t.form);return!a||a===t},s8=function(t){return Qj(t)&&t.type==="radio"},o8=function(t){return s8(t)&&!r8(t)},i8=function(t){var n,s=t&&Lh(t),i=(n=s)===null||n===void 0?void 0:n.host,a=!1;if(s&&s!==t){var l,f,d;for(a=!!((l=i)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(i)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!a&&i;){var h,g,v;s=Lh(i),i=(h=s)===null||h===void 0?void 0:h.host,a=!!((g=i)!==null&&g!==void 0&&(v=g.ownerDocument)!==null&&v!==void 0&&v.contains(i))}}return a},WT=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},a8=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var l=kc.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if(kc.call(f,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var h=t.parentElement,g=Lh(t);if(h&&!h.shadowRoot&&i(h)===!0)return WT(t);t.assignedSlot?t=t.assignedSlot:!h&&g!==t.ownerDocument?t=g.host:t=h}t=d}if(i8(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return WT(t);return!1},c8=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return kc.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Ov=function(t,n){return!(n.disabled||e8(n)||a8(n,t)||t8(n)||c8(n))},Av=function(t,n){return!(o8(n)||Xj(n)<0||!Ov(t,n))},l8=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Wj=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=WV(f,l),h=l?Wj(i.candidates):f;d===0?l?n.push.apply(n,h):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:h})}),s.sort(JV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},mp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=$h([t],n.includeContainer,{filter:Av.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:l8}):s=Zj(t,n.includeContainer,Av.bind(null,n)),Wj(s)},u8=function(t,n){n=n||{};var s;return n.getShadowRoot?s=$h([t],n.includeContainer,{filter:Ov.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=Zj(t,n.includeContainer,Ov.bind(null,n)),s},Jj=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kc.call(t,Dh)===!1?!1:Av(n,t)};const qu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eO(e,t){const n=mp(e,qu()),s=n.length;if(s===0)return;const i=Po(Tt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function tO(e){return eO(Tt(e).body,1)||e}function nO(e){return eO(Tt(e).body,-1)||e}function cu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function f8(e){mp(e,qu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function JT(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function d8(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const h8=_.createContext(null),p8=_.createContext(null),gp=()=>_.useContext(h8)?.id||null,yp=e=>{const t=_.useContext(p8);return e??t};function Su(e){return`data-base-ui-${e}`}const Ad=null;class m8{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const kd=new m8;class hs{static create(){return new hs}static request(t){return kd.request(t)}static cancel(t){return kd.cancel(t)}currentId=Ad;request(t){this.cancel(),this.currentId=kd.request(()=>{this.currentId=Ad,t()})}cancel=()=>{this.currentId!==Ad&&(kd.cancel(this.currentId),this.currentId=Ad)};disposeEffect=()=>this.cancel}function Zb(){const e=zn(hs.create).current;return Hb(e.disposeEffect),e}const Bh=_.forwardRef(function(t,n){const[s,i]=_.useState();De(()=>{bV&&i("button")},[]);const a={tabIndex:0,role:s};return p.jsx("span",{...t,ref:n,style:ap,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let eR=0;function Ry(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(eR);const a=()=>e?.focus({preventScroll:n});i?a():eR=requestAnimationFrame(a)}const pc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function tR(e){return e==="inert"?pc.inert:e==="aria-hidden"?pc["aria-hidden"]:pc.none}let Md=new WeakSet,Id={},Cy=0;const rO=e=>e&&(e.host||rO(e.parentNode)),g8=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=rO(n);return e.contains(s)?s:null}).filter(n=>n!=null);function y8(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=g8(t,e),f=new Set,d=new Set(l),h=[];Id[i]||(Id[i]=new WeakMap);const g=Id[i];l.forEach(v),b(t),f.clear();function v(x){!x||f.has(x)||(f.add(x),x.parentNode&&v(x.parentNode))}function b(x){!x||d.has(x)||[].forEach.call(x.children,S=>{if(ui(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",R=tR(a),k=(R.get(S)||0)+1,j=(g.get(S)||0)+1;R.set(S,k),g.set(S,j),h.push(S),k===1&&T&&Md.add(S),j===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return Cy+=1,()=>{h.forEach(x=>{const S=tR(a),T=(S.get(x)||0)-1,R=(g.get(x)||0)-1;S.set(x,T),g.set(x,R),T||(!Md.has(x)&&a&&x.removeAttribute(a),Md.delete(x)),R||x.removeAttribute(i)}),Cy-=1,Cy||(pc.inert=new WeakMap,pc["aria-hidden"]=new WeakMap,pc.none=new WeakMap,Md=new WeakSet,Id={})}}function v8(e,t=!1,n=!1){const s=Tt(e[0]).body;return y8(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const sO=_.createContext(null),oO=()=>_.useContext(sO),b8=Su("portal");function iO(e={}){const{ref:t,container:n,componentProps:s=rn,elementProps:i}=e,a=Hu(),f=oO()?.portalNode,[d,h]=_.useState(null),[g,v]=_.useState(null),b=Oe(T=>{T!==null&&v(T)}),x=_.useRef(null);De(()=>{if(n===null){x.current&&(x.current=null,v(null),h(null));return}if(a==null)return;const T=(n&&(Lb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,v(null),h(null));return}x.current!==T&&(x.current=T,v(null),h(T))},[n,f,a]);const S=Mt("div",s,{ref:[t,b],props:[{id:a,[b8]:""},i]});return{portalNode:g,portalSubtree:d&&S?ii.createPortal(S,d):null}}const aO=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:h,portalSubtree:g}=iO({container:i,ref:n,componentProps:t,elementProps:d}),v=_.useRef(null),b=_.useRef(null),x=_.useRef(null),S=_.useRef(null),[w,T]=_.useState(null),R=w?.modal,k=w?.open,j=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!h;_.useEffect(()=>{if(!h||R)return;function I(D){h&&D.relatedTarget&&cu(D)&&(D.type==="focusin"?JT:f8)(h)}return h.addEventListener("focusin",I,!0),h.addEventListener("focusout",I,!0),()=>{h.removeEventListener("focusin",I,!0),h.removeEventListener("focusout",I,!0)}},[h,R]),_.useEffect(()=>{!h||k||JT(h)},[k,h]);const C=_.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:S,portalNode:h,setFocusManagerState:T}),[h]);return p.jsxs(_.Fragment,{children:[g,p.jsxs(sO.Provider,{value:C,children:[j&&h&&p.jsx(Bh,{"data-type":"outside",ref:v,onFocus:I=>{if(cu(I,h))x.current?.focus();else{const D=w?w.domReference:null;nO(D)?.focus()}}}),j&&h&&p.jsx("span",{"aria-owns":h.id,style:x9}),h&&ii.createPortal(s,h),j&&h&&p.jsx(Bh,{"data-type":"outside",ref:b,onFocus:I=>{if(cu(I,h))S.current?.focus();else{const D=w?w.domReference:null;tO(D)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Vt(_j,I.nativeEvent))}}})]})]})});function Bs(e){return e==null?e:"current"in e?e.current:e}function x8(e,t){const n=an(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const nR=20;let Lo=[];function Yb(){Lo=Lo.filter(e=>e.deref()?.isConnected)}function S8(e){Yb(),e&&ui(e)!=="body"&&(Lo.push(new WeakRef(e)),Lo.length>nR&&(Lo=Lo.slice(-nR)))}function Ny(){return Yb(),Lo[Lo.length-1]?.deref()}function _8(e){if(!e)return null;const t=qu();return Jj(e,t)?e:mp(e,t)[0]||e}function w8(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():hr(e).display!=="none"}function rR(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=qu(),i=u8(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return Jj(l,n)||l.hasAttribute("data-tabindex")&&!f.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function cO(e){const{context:t,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:h="",nextFocusableElement:g,previousFocusableElement:v,beforeContentFocusGuardRef:b,externalTree:x}=e,S="rootStore"in t?t.rootStore:t,w=S.useState("open"),T=S.useState("domReferenceElement"),R=S.useState("floatingElement"),{events:k,dataRef:j}=S.context,C=Oe(()=>j.current.floatingContext?.nodeId),I=i===!1,D=ZT(T)&&I,N=_.useRef(["content"]),A=Go(i),z=Go(a),X=Go(h),q=yp(x),L=oO(),Z=_.useRef(null),G=_.useRef(null),te=_.useRef(!1),P=_.useRef(!1),V=_.useRef(!1),U=_.useRef(-1),F=_.useRef(""),H=_.useRef(""),M=_.useRef(null),K=_.useRef(null),W=to(M,b,L?.beforeInsideRef),Y=to(K,L?.afterInsideRef),le=ts(),ie=ts(),ce=Zb(),Se=L!=null,ge=Mh(R),$e=Oe((he=ge)=>he?mp(he,qu()):[]),Ee=Oe(he=>{const oe=$e(he);return N.current.map(()=>oe).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function he(_e){_e.key==="Tab"&&Ot(ge,Po(Tt(ge)))&&$e().length===0&&!D&&Li(_e)}const oe=Tt(ge);return oe.addEventListener("keydown",he),()=>{oe.removeEventListener("keydown",he)}},[s,T,ge,f,N,D,$e,Ee]),_.useEffect(()=>{if(s||!w)return;const he=Tt(ge);function oe(){V.current=!1}function _e(xe){const ve=Mr(xe),ke=Ot(R,ve)||Ot(T,ve)||Ot(L?.portalNode,ve);V.current=!ke,H.current=xe.pointerType||"keyboard",ve?.closest(`[${y9}]`)&&(P.current=!0)}function ye(){H.current="keyboard"}return he.addEventListener("pointerdown",_e,!0),he.addEventListener("pointerup",oe,!0),he.addEventListener("pointercancel",oe,!0),he.addEventListener("keydown",ye,!0),()=>{he.removeEventListener("pointerdown",_e,!0),he.removeEventListener("pointerup",oe,!0),he.removeEventListener("pointercancel",oe,!0),he.removeEventListener("keydown",ye,!0)}},[s,R,T,ge,w,L]),_.useEffect(()=>{if(s||!d)return;const he=Tt(ge);function oe(){P.current=!0,ie.start(0,()=>{P.current=!1})}function _e(Le){const we=Mr(Le),Qe=$e().indexOf(we);Qe!==-1&&(U.current=Qe)}function ye(Le){const we=Le.relatedTarget,qe=Le.currentTarget,Qe=Mr(Le);queueMicrotask(()=>{const Be=C(),We=S.context.triggerElements,Ve=we?.hasAttribute(Su("focus-guard"))&&[M.current,K.current,L?.beforeInsideRef.current,L?.afterInsideRef.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,Bs(v),Bs(g)].includes(we),pe=!(Ot(T,we)||Ot(R,we)||Ot(we,R)||Ot(L?.portalNode,we)||we!=null&&We.hasElement(we)||We.hasMatchingElement(Te=>Ot(Te,we))||Ve||q&&(hc(q.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,we)||Ot(Te.context?.elements.domReference,we))||YT(q.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Mh(Te.context?.elements.floating)].includes(we)||Te.context?.elements.domReference===we)));if(qe===T&&ge&&rR(ge,N),l&&qe!==T&&!w8(Qe)&&Po(he)===he.body){if(qt(ge)&&(ge.focus(),l==="popup")){ce.request(()=>{ge.focus()});return}const Te=U.current,He=$e(),ht=He[Te]||He[He.length-1]||ge;qt(ht)&&ht.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}(D||!f)&&we&&pe&&!P.current&&(D||we!==Ny())&&(te.current=!0,S.setOpen(!1,Vt(_j,Le)))})}function xe(){V.current||(j.current.insideReactTree=!0,le.start(0,()=>{j.current.insideReactTree=!1}))}const ve=qt(T)?T:null,ke=[];if(!(!R&&!ve))return ve&&(ve.addEventListener("focusout",ye),ve.addEventListener("pointerdown",oe),ke.push(()=>{ve.removeEventListener("focusout",ye),ve.removeEventListener("pointerdown",oe)})),R&&(R.addEventListener("focusin",_e),R.addEventListener("focusout",ye),L&&(R.addEventListener("focusout",xe,!0),ke.push(()=>{R.removeEventListener("focusout",xe,!0)})),ke.push(()=>{R.removeEventListener("focusin",_e),R.removeEventListener("focusout",ye)})),()=>{ke.forEach(Le=>{Le()})}},[s,T,R,ge,f,q,L,S,d,l,$e,D,C,N,j,le,ie,ce,g,v]),_.useEffect(()=>{if(s||!R||!w)return;const he=Array.from(L?.portalNode?.querySelectorAll(`[${Su("portal")}]`)||[]),_e=(q?YT(q.nodesRef.current,C()):[]).find(xe=>ZT(xe.context?.elements.domReference||null))?.context?.elements.domReference,ye=[R,_e,...he,Z.current,G.current,M.current,K.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,Bs(v),Bs(g),D?T:null].filter(xe=>xe!=null);return v8(ye,f||D)},[w,s,T,R,f,N,L,D,q,C,g,v]),De(()=>{if(!w||s||!qt(ge))return;const he=Tt(ge),oe=Po(he);queueMicrotask(()=>{const _e=Ee(ge),ye=A.current,xe=typeof ye=="function"?ye(X.current||""):ye;if(xe===void 0||xe===!1)return;let ve;xe===!0||xe===null?ve=_e[0]||ge:ve=Bs(xe),ve=ve||_e[0]||ge,!Ot(ge,oe)&&Ry(ve,{preventScroll:ve===ge})})},[s,w,ge,I,Ee,A,X]),De(()=>{if(s||!ge)return;const he=Tt(ge),oe=Po(he);S8(oe);function _e(ve){if(ve.open||(F.current=x8(ve.nativeEvent,H.current)),ve.reason===Tv&&ve.nativeEvent.type==="mouseleave"&&(te.current=!0),ve.reason===Sj)if(ve.nested)te.current=!1;else if(jV(ve.nativeEvent)||OV(ve.nativeEvent))te.current=!1;else{let ke=!1;document.createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?te.current=!1:te.current=!0}}k.on("openchange",_e);const ye=he.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,ap),Se&&T&&T.insertAdjacentElement("afterend",ye);function xe(){const ve=z.current;let ke=typeof ve=="function"?ve(F.current):ve;if(ke===void 0||ke===!1)return null;if(ke===null&&(ke=!0),typeof ke=="boolean"){const we=T||Ny();return we&&we.isConnected?we:ye}const Le=T||Ny()||ye;return Bs(ke)||Le}return()=>{k.off("openchange",_e);const ve=Po(he),ke=Ot(R,ve)||q&&hc(q.nodesRef.current,C(),!1).some(we=>Ot(we.context?.elements.floating,ve)),Le=xe();queueMicrotask(()=>{const we=_8(Le),qe=typeof z.current!="boolean";z.current&&!te.current&&qt(we)&&(!(!qe&&we!==ve&&ve!==he.body)||ke)&&we.focus({preventScroll:!0}),ye.remove(),te.current=!1})}},[s,R,ge,z,j,k,q,Se,T,C]),De(()=>{if(!qb||w||!R)return;const he=Po(Tt(R));!qt(he)||!Vj(he)||Ot(R,he)&&he.blur()},[w,R]),De(()=>{if(!(s||!L))return L.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{L.setFocusManagerState(null)}},[s,L,f,w,S,d,T]),De(()=>{if(!(s||!ge))return rR(ge,N),()=>{queueMicrotask(Yb)}},[s,ge,N]);const re=!s&&(f?!D:!0)&&(Se||f);return p.jsxs(_.Fragment,{children:[re&&p.jsx(Bh,{"data-type":"inside",ref:W,onFocus:he=>{if(f){const oe=Ee();Ry(oe[oe.length-1])}else L?.portalNode&&(te.current=!1,cu(he,L.portalNode)?tO(T)?.focus():Bs(v??L.beforeOutsideRef)?.focus())}}),n,re&&p.jsx(Bh,{"data-type":"inside",ref:Y,onFocus:he=>{f?Ry(Ee()[0]):L?.portalNode&&(d&&(te.current=!0),cu(he,L.portalNode)?nO(T)?.focus():Bs(g??L.afterOutsideRef)?.focus())}})]})}function sR(e,t,n){let{reference:s,floating:i}=e;const a=Lr(t),l=Kb(t),f=Gb(l),d=Vn(t),h=a==="y",g=s.x+s.width/2-i.width/2,v=s.y+s.height/2-i.height/2,b=s[f]/2-i[f]/2;let x;switch(d){case"top":x={x:g,y:s.y-i.height};break;case"bottom":x={x:g,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:v};break;case"left":x={x:s.x-i.width,y:v};break;default:x={x:s.x,y:s.y}}switch(pi(t)){case"start":x[l]-=b*(n&&h?-1:1);break;case"end":x[l]+=b*(n&&h?-1:1);break}return x}async function E8(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ro(t,e),S=Gj(x),T=f[b?v==="floating"?"reference":"floating":v],R=zh(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(T)))==null||n?T:T.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(f.floating)),boundary:h,rootBoundary:g,strategy:d})),k=v==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.reference,j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),C=await(a.isElement==null?void 0:a.isElement(j))?await(a.getScale==null?void 0:a.getScale(j))||{x:1,y:1}:{x:1,y:1},I=zh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:j,strategy:d}):k);return{top:(R.top-I.top+S.top)/C.y,bottom:(I.bottom-R.bottom+S.bottom)/C.y,left:(R.left-I.left+S.left)/C.x,right:(I.right-R.right+S.right)/C.x}}const T8=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,f=a.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:v}=sR(h,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:R,fn:k}=f[T],{x:j,y:C,data:I,reset:D}=await k({x:g,y:v,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:h,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:E8},elements:{reference:e,floating:t}});g=j??g,v=C??v,x={...x,[R]:{...x[R],...I}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(h=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:g,y:v}=sR(h,b,d)),T=-1)}return{x:g,y:v,placement:b,strategy:i,middlewareData:x}},R8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:a,rects:l,initialPlacement:f,platform:d,elements:h}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...T}=ro(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const R=Vn(i),k=Lr(f),j=Vn(f)===f,C=await(d.isRTL==null?void 0:d.isRTL(h.floating)),I=b||(j||!w?[Ph(f)]:LV(f)),D=S!=="none";!b&&D&&I.push(...FV(f,w,S,C));const N=[f,...I],A=await d.detectOverflow(t,T),z=[];let X=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&z.push(A[R]),v){const G=DV(i,l,C);z.push(A[G[0]],A[G[1]])}if(X=[...X,{placement:i,overflows:z}],!z.every(G=>G<=0)){var q,L;const G=(((q=a.flip)==null?void 0:q.index)||0)+1,te=N[G];if(te&&(!(v==="alignment"?k!==Lr(te):!1)||X.every(U=>Lr(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:G,overflows:X},reset:{placement:te}};let P=(L=X.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(x){case"bestFit":{var Z;const V=(Z=X.filter(U=>{if(D){const F=Lr(U.placement);return F===k||F==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(F=>F>0).reduce((F,H)=>F+H,0)]).sort((U,F)=>U[1]-F[1])[0])==null?void 0:Z[0];V&&(P=V);break}case"initialPlacement":P=f;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function oR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iR(e){return MV.some(t=>e[t]>=0)}const C8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=ro(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=oR(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:iR(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=oR(l,n.floating);return{data:{escapedOffsets:f,escaped:iR(f)}}}default:return{}}}}},lO=new Set(["left","top"]);async function N8(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Vn(n),f=pi(n),d=Lr(n)==="y",h=lO.has(l)?-1:1,g=a&&d?-1:1,v=ro(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),d?{x:x*g,y:b*h}:{x:b*h,y:x*g}}const j8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:a,placement:l,middlewareData:f}=t,d=await N8(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:l}}}}},O8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:f=!1,limiter:d={fn:R=>{let{x:k,y:j}=R;return{x:k,y:j}}},...h}=ro(e,t),g={x:n,y:s},v=await a.detectOverflow(t,h),b=Lr(Vn(i)),x=Vb(b);let S=g[x],w=g[b];if(l){const R=x==="y"?"top":"left",k=x==="y"?"bottom":"right",j=S+v[R],C=S-v[k];S=Nv(j,S,C)}if(f){const R=b==="y"?"top":"left",k=b==="y"?"bottom":"right",j=w+v[R],C=w-v[k];w=Nv(j,w,C)}const T=d.fn({...t,[x]:S,[b]:w});return{...T,data:{x:T.x-n,y:T.y-s,enabled:{[x]:l,[b]:f}}}}}},A8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:h=!0}=ro(e,t),g={x:n,y:s},v=Lr(i),b=Vb(v);let x=g[b],S=g[v];const w=ro(f,t),T=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const j=b==="y"?"height":"width",C=a.reference[b]-a.floating[j]+T.mainAxis,I=a.reference[b]+a.reference[j]-T.mainAxis;x<C?x=C:x>I&&(x=I)}if(h){var R,k;const j=b==="y"?"width":"height",C=lO.has(Vn(i)),I=a.reference[v]-a.floating[j]+(C&&((R=l.offset)==null?void 0:R[v])||0)+(C?0:T.crossAxis),D=a.reference[v]+a.reference[j]+(C?0:((k=l.offset)==null?void 0:k[v])||0)-(C?T.crossAxis:0);S<I?S=I:S>D&&(S=D)}return{[b]:x,[v]:S}}}},k8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:a,platform:l,elements:f}=t,{apply:d=()=>{},...h}=ro(e,t),g=await l.detectOverflow(t,h),v=Vn(i),b=pi(i),x=Lr(i)==="y",{width:S,height:w}=a.floating;let T,R;v==="top"||v==="bottom"?(T=v,R=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(R=v,T=b==="end"?"top":"bottom");const k=w-g.top-g.bottom,j=S-g.left-g.right,C=Ac(w-g[T],k),I=Ac(S-g[R],j),D=!t.middlewareData.shift;let N=C,A=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=j),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(N=k),D&&!b){const X=ar(g.left,0),q=ar(g.right,0),L=ar(g.top,0),Z=ar(g.bottom,0);x?A=S-2*(X!==0||q!==0?X+q:ar(g.left,g.right)):N=w-2*(L!==0||Z!==0?L+Z:ar(g.top,g.bottom))}await d({...t,availableWidth:A,availableHeight:N});const z=await l.getDimensions(f.floating);return S!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function uO(e){const t=hr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=qt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=Ih(n)!==a||Ih(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function Xb(e){return Ct(e)?e:e.contextElement}function mc(e){const t=Xb(e);if(!qt(t))return gs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=uO(t);let l=(a?Ih(n.width):n.width)/s,f=(a?Ih(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const M8=gs(0);function fO(e){const t=an(e);return!up()||!t.visualViewport?M8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function I8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function sa(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Xb(e);let l=gs(1);t&&(s?Ct(s)&&(l=mc(s)):l=mc(e));const f=I8(a,n,s)?fO(a):gs(0);let d=(i.left+f.x)/l.x,h=(i.top+f.y)/l.y,g=i.width/l.x,v=i.height/l.y;if(a){const b=an(a),x=s&&Ct(s)?an(s):s;let S=b,w=wv(S);for(;w&&s&&x!==S;){const T=mc(w),R=w.getBoundingClientRect(),k=hr(w),j=R.left+(w.clientLeft+parseFloat(k.paddingLeft))*T.x,C=R.top+(w.clientTop+parseFloat(k.paddingTop))*T.y;d*=T.x,h*=T.y,g*=T.x,v*=T.y,d+=j,h+=C,S=an(w),w=wv(S)}}return zh({width:g,height:v,x:d,y:h})}function vp(e,t){const n=fp(e).scrollLeft;return t?t.left+n:sa(bs(e)).left+n}function dO(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-vp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function P8(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=bs(s),f=t?lp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},h=gs(1);const g=gs(0),v=qt(s);if((v||!v&&!a)&&((ui(s)!=="body"||fi(l))&&(d=fp(s)),qt(s))){const x=sa(s);h=mc(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!v&&!a?dO(l,d):gs(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+g.x+b.x,y:n.y*h.y-d.scrollTop*h.y+g.y+b.y}}function z8(e){return Array.from(e.getClientRects())}function D8(e){const t=bs(e),n=fp(e),s=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=ar(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+vp(e);const f=-n.scrollTop;return hr(s).direction==="rtl"&&(l+=ar(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const aR=25;function L8(e,t){const n=an(e),s=bs(e),i=n.visualViewport;let a=s.clientWidth,l=s.clientHeight,f=0,d=0;if(i){a=i.width,l=i.height;const g=up();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const h=vp(s);if(h<=0){const g=s.ownerDocument,v=g.body,b=getComputedStyle(v),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-v.clientWidth-x);S<=aR&&(a-=S)}else h<=aR&&(a+=h);return{width:a,height:l,x:f,y:d}}const U8=new Set(["absolute","fixed"]);function $8(e,t){const n=sa(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=qt(e)?mc(e):gs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,h=s*a.y;return{width:l,height:f,x:d,y:h}}function cR(e,t,n){let s;if(t==="viewport")s=L8(e,n);else if(t==="document")s=D8(bs(e));else if(Ct(t))s=$8(t,n);else{const i=fO(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zh(s)}function hO(e,t){const n=no(e);return n===t||!Ct(n)||Gs(n)?!1:hr(n).position==="fixed"||hO(n,t)}function B8(e,t){const n=t.get(e);if(n)return n;let s=Vo(e,[],!1).filter(f=>Ct(f)&&ui(f)!=="body"),i=null;const a=hr(e).position==="fixed";let l=a?no(e):e;for(;Ct(l)&&!Gs(l);){const f=hr(l),d=Ub(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&U8.has(i.position)||fi(l)&&!d&&hO(e,l))?s=s.filter(g=>g!==l):i=f,l=no(l)}return t.set(e,s),s}function F8(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?lp(t)?[]:B8(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((h,g)=>{const v=cR(t,g,i);return h.top=ar(v.top,h.top),h.right=Ac(v.right,h.right),h.bottom=Ac(v.bottom,h.bottom),h.left=ar(v.left,h.left),h},cR(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function H8(e){const{width:t,height:n}=uO(e);return{width:t,height:n}}function q8(e,t,n){const s=qt(t),i=bs(t),a=n==="fixed",l=sa(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=gs(0);function h(){d.x=vp(i)}if(s||!s&&!a)if((ui(t)!=="body"||fi(i))&&(f=fp(t)),s){const x=sa(t,!0,a,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&h();a&&!s&&i&&h();const g=i&&!s&&!a?dO(i,f):gs(0),v=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:v,y:b,width:l.width,height:l.height}}function jy(e){return hr(e).position==="static"}function lR(e,t){if(!qt(e)||hr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bs(e)===n&&(n=n.ownerDocument.body),n}function pO(e,t){const n=an(e);if(lp(e))return n;if(!qt(e)){let i=no(e);for(;i&&!Gs(i);){if(Ct(i)&&!jy(i))return i;i=no(i)}return n}let s=lR(e,t);for(;s&&j9(s)&&jy(s);)s=lR(s,t);return s&&Gs(s)&&jy(s)&&!Ub(s)?n:s||I9(e)||n}const V8=async function(e){const t=this.getOffsetParent||pO,n=this.getDimensions,s=await n(e.floating);return{reference:q8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function G8(e){return hr(e).direction==="rtl"}const K8={convertOffsetParentRelativeRectToViewportRelativeRect:P8,getDocumentElement:bs,getClippingRect:F8,getOffsetParent:pO,getElementRects:V8,getClientRects:z8,getDimensions:H8,getScale:mc,isElement:Ct,isRTL:G8};function mO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z8(e,t){let n=null,s;const i=bs(e);function a(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),a();const h=e.getBoundingClientRect(),{left:g,top:v,width:b,height:x}=h;if(f||t(),!b||!x)return;const S=ic(v),w=ic(i.clientWidth-(g+b)),T=ic(i.clientHeight-(v+x)),R=ic(g),j={rootMargin:-S+"px "+-w+"px "+-T+"px "+-R+"px",threshold:ar(0,Ac(1,d))||1};let C=!0;function I(D){const N=D[0].intersectionRatio;if(N!==d){if(!C)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!mO(h,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(I,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,j)}n.observe(e)}return l(!0),a}function uR(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,h=Xb(e),g=i||a?[...h?Vo(h):[],...Vo(t)]:[];g.forEach(R=>{i&&R.addEventListener("scroll",n,{passive:!0}),a&&R.addEventListener("resize",n)});const v=h&&f?Z8(h,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(R=>{let[k]=R;k&&k.target===h&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var j;(j=x)==null||j.observe(t)})),n()}),h&&!d&&x.observe(h),x.observe(t));let S,w=d?sa(e):null;d&&T();function T(){const R=sa(e);w&&!mO(w,R)&&n(),w=R,S=requestAnimationFrame(T)}return n(),()=>{var R;g.forEach(k=>{i&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),v?.(),(R=x)==null||R.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const Y8=j8,X8=O8,Q8=R8,W8=k8,J8=C8,e7=A8,t7=(e,t,n)=>{const s=new Map,i={platform:K8,...n},a={...i.platform,_c:s};return T8(e,t,{...i,platform:a})};var n7=typeof document<"u",r7=function(){},th=n7?_.useLayoutEffect:r7;function Fh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Fh(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const a=i[s];if(!(a==="_owner"&&e.$$typeof)&&!Fh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function gO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fR(e,t){const n=gO(e);return Math.round(t*n)/n}function Oy(e){const t=_.useRef(e);return th(()=>{t.current=e}),t}function s7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:a,floating:l}={},transform:f=!0,whileElementsMounted:d,open:h}=e,[g,v]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=_.useState(s);Fh(b,s)||x(s);const[S,w]=_.useState(null),[T,R]=_.useState(null),k=_.useCallback(U=>{U!==D.current&&(D.current=U,w(U))},[]),j=_.useCallback(U=>{U!==N.current&&(N.current=U,R(U))},[]),C=a||S,I=l||T,D=_.useRef(null),N=_.useRef(null),A=_.useRef(g),z=d!=null,X=Oy(d),q=Oy(i),L=Oy(h),Z=_.useCallback(()=>{if(!D.current||!N.current)return;const U={placement:t,strategy:n,middleware:b};q.current&&(U.platform=q.current),t7(D.current,N.current,U).then(F=>{const H={...F,isPositioned:L.current!==!1};G.current&&!Fh(A.current,H)&&(A.current=H,ii.flushSync(()=>{v(H)}))})},[b,t,n,q,L]);th(()=>{h===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,v(U=>({...U,isPositioned:!1})))},[h]);const G=_.useRef(!1);th(()=>(G.current=!0,()=>{G.current=!1}),[]),th(()=>{if(C&&(D.current=C),I&&(N.current=I),C&&I){if(X.current)return X.current(C,I,Z);Z()}},[C,I,Z,X,z]);const te=_.useMemo(()=>({reference:D,floating:N,setReference:k,setFloating:j}),[k,j]),P=_.useMemo(()=>({reference:C,floating:I}),[C,I]),V=_.useMemo(()=>{const U={position:n,left:0,top:0};if(!P.floating)return U;const F=fR(P.floating,g.x),H=fR(P.floating,g.y);return f?{...U,transform:"translate("+F+"px, "+H+"px)",...gO(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:H}},[n,f,P.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Z,refs:te,elements:P,floatingStyles:V}),[g,Z,te,P,V])}const o7=(e,t)=>({...Y8(e),options:[e,t]}),i7=(e,t)=>({...X8(e),options:[e,t]}),a7=(e,t)=>({...e7(e),options:[e,t]}),c7=(e,t)=>({...Q8(e),options:[e,t]}),l7=(e,t)=>({...W8(e),options:[e,t]}),u7=(e,t)=>({...J8(e),options:[e,t]}),f7={intentional:"onClick",sloppy:"onPointerDown"};function d7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function h7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:d}=n.context,{enabled:h=!0,escapeKey:g=!0,outsidePress:v=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:T,externalTree:R}=t,k=yp(R),j=Oe(typeof v=="function"?v:()=>!1),C=typeof v=="function"?j:v,I=_.useRef(!1),{escapeKey:D,outsidePress:N}=d7(T),A=_.useRef(null),z=ts(),X=ts(),q=Oe(()=>{X.clear(),d.current.insideReactTree=!1}),L=_.useRef(!1),Z=_.useRef(""),G=Oe(re=>{Z.current=re.pointerType}),te=Oe(()=>{const re=Z.current,he=re==="pen"||!re?"mouse":re,oe=typeof b=="function"?b():b;return typeof oe=="string"?oe:oe[he]}),P=Oe(re=>{if(!s||!h||!g||re.key!=="Escape"||L.current)return;const he=d.current.floatingContext?.nodeId,oe=k?hc(k.nodesRef.current,he):[];if(!D&&oe.length>0){let xe=!0;if(oe.forEach(ve=>{ve.context?.open&&!ve.context.dataRef.current.__escapeKeyBubbles&&(xe=!1)}),!xe)return}const _e=NV(re)?re.nativeEvent:re,ye=Vt($9,_e);n.setOpen(!1,ye),!D&&!ye.isPropagationAllowed&&re.stopPropagation()}),V=Oe(re=>{const he=te();return he==="intentional"&&re.type!=="click"||he==="sloppy"&&re.type==="click"}),U=Oe(()=>{d.current.insideReactTree=!0,X.start(0,q)}),F=Oe((re,he=!1)=>{if(V(re)){q();return}if(d.current.insideReactTree){q();return}if(te()==="intentional"&&he||typeof C=="function"&&!C(re))return;const oe=Mr(re),_e=`[${Su("inert")}]`,ye=Tt(n.select("floatingElement")).querySelectorAll(_e),xe=n.context.triggerElements;if(oe&&(xe.hasElement(oe)||xe.hasMatchingElement(qe=>Ot(qe,oe))))return;let ve=Ct(oe)?oe:null;for(;ve&&!Gs(ve);){const qe=no(ve);if(Gs(qe)||!Ct(qe))break;ve=qe}if(ye.length&&Ct(oe)&&!CV(oe)&&!Ot(oe,n.select("floatingElement"))&&Array.from(ye).every(qe=>!Ot(ve,qe)))return;if(qt(oe)&&!("touches"in re)){const qe=Gs(oe),Qe=hr(oe),Be=/auto|scroll/,We=qe||Be.test(Qe.overflowX),Ve=qe||Be.test(Qe.overflowY),pe=We&&oe.clientWidth>0&&oe.scrollWidth>oe.clientWidth,Te=Ve&&oe.clientHeight>0&&oe.scrollHeight>oe.clientHeight,He=Qe.direction==="rtl",ht=Te&&(He?re.offsetX<=oe.offsetWidth-oe.clientWidth:re.offsetX>oe.clientWidth),lt=pe&&re.offsetY>oe.clientHeight;if(ht||lt)return}const ke=d.current.floatingContext?.nodeId,Le=k&&hc(k.nodesRef.current,ke).some(qe=>Qr(re,qe.context?.elements.floating));if(Qr(re,n.select("floatingElement"))||Qr(re,n.select("domReferenceElement"))||Le)return;const we=k?hc(k.nodesRef.current,ke):[];if(we.length>0){let qe=!0;if(we.forEach(Qe=>{Qe.context?.open&&!Qe.context.dataRef.current.__outsidePressBubbles&&(qe=!1)}),!qe)return}n.setOpen(!1,Vt(Sj,re)),q()}),H=Oe(re=>{te()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!h||Qr(re,n.select("floatingElement"))||Qr(re,n.select("domReferenceElement"))||F(re)}),M=Oe(re=>{if(te()!=="sloppy"||!n.select("open")||!h||Qr(re,n.select("floatingElement"))||Qr(re,n.select("domReferenceElement")))return;const he=re.touches[0];he&&(A.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),K=Oe(re=>{const he=Mr(re);function oe(){M(re),he?.removeEventListener(re.type,oe)}he?.addEventListener(re.type,oe)}),W=Oe(re=>{const he=I.current;if(I.current=!1,z.clear(),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const oe=Mr(re);function _e(){re.type==="pointerdown"?H(re):F(re,he),oe?.removeEventListener(re.type,_e)}oe?.addEventListener(re.type,_e)}),Y=Oe(re=>{if(te()!=="sloppy"||!A.current||Qr(re,n.select("floatingElement"))||Qr(re,n.select("domReferenceElement")))return;const he=re.touches[0];if(!he)return;const oe=Math.abs(he.clientX-A.current.startX),_e=Math.abs(he.clientY-A.current.startY),ye=Math.sqrt(oe*oe+_e*_e);ye>5&&(A.current.dismissOnTouchEnd=!0),ye>10&&(F(re),z.clear(),A.current=null)}),le=Oe(re=>{const he=Mr(re);function oe(){Y(re),he?.removeEventListener(re.type,oe)}he?.addEventListener(re.type,oe)}),ie=Oe(re=>{te()!=="sloppy"||!A.current||Qr(re,n.select("floatingElement"))||Qr(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&F(re),z.clear(),A.current=null)}),ce=Oe(re=>{const he=Mr(re);function oe(){ie(re),he?.removeEventListener(re.type,oe)}he?.addEventListener(re.type,oe)});_.useEffect(()=>{if(!s||!h)return;d.current.__escapeKeyBubbles=D,d.current.__outsidePressBubbles=N;const re=new ei;function he(ve){n.setOpen(!1,Vt(Jo,ve))}function oe(){re.clear(),L.current=!0}function _e(){re.start(up()?5:0,()=>{L.current=!1})}const ye=Tt(i);ye.addEventListener("pointerdown",G,!0),g&&(ye.addEventListener("keydown",P),ye.addEventListener("compositionstart",oe),ye.addEventListener("compositionend",_e)),C&&(ye.addEventListener("click",W,!0),ye.addEventListener("pointerdown",W,!0),ye.addEventListener("touchstart",K,!0),ye.addEventListener("touchmove",le,!0),ye.addEventListener("touchend",ce,!0),ye.addEventListener("mousedown",W,!0));let xe=[];return w&&(Ct(l)&&(xe=Vo(l)),Ct(i)&&(xe=xe.concat(Vo(i))),!Ct(a)&&a&&a.contextElement&&(xe=xe.concat(Vo(a.contextElement)))),xe=xe.filter(ve=>ve!==ye.defaultView?.visualViewport),xe.forEach(ve=>{ve.addEventListener("scroll",he,{passive:!0})}),()=>{ye.removeEventListener("pointerdown",G,!0),g&&(ye.removeEventListener("keydown",P),ye.removeEventListener("compositionstart",oe),ye.removeEventListener("compositionend",_e)),C&&(ye.removeEventListener("click",W,!0),ye.removeEventListener("pointerdown",W,!0),ye.removeEventListener("touchstart",K,!0),ye.removeEventListener("touchmove",le,!0),ye.removeEventListener("touchend",ce,!0),ye.removeEventListener("mousedown",W,!0)),xe.forEach(ve=>{ve.removeEventListener("scroll",he)}),re.clear(),I.current=!1}},[d,i,a,l,g,C,s,f,w,h,D,N,P,F,W,H,K,le,ce,G,n]),_.useEffect(q,[C,q]);const Se=_.useMemo(()=>({onKeyDown:P,...x&&{[f7[S]]:re=>{n.setOpen(!1,Vt(KT,re.nativeEvent))},...S!=="intentional"&&{onClick(re){n.setOpen(!1,Vt(KT,re.nativeEvent))}}}}),[P,n,x,S]),ge=Oe(re=>{const he=Mr(re.nativeEvent);!Ot(n.select("floatingElement"),he)||re.button!==0||(I.current=!0)}),$e=Oe(re=>{!s||!h||re.button!==0||(I.current=!0)}),Ee=_.useMemo(()=>({onKeyDown:P,onPointerDown:ge,onMouseDown:ge,onMouseUp:ge,onClickCapture:U,onMouseDownCapture(re){U(),$e(re)},onPointerDownCapture(re){U(),$e(re)},onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[P,ge,U,$e]);return _.useMemo(()=>h?{reference:Se,floating:Ee,trigger:Se}:{},[h,Se,Ee])}FN({memoize:IH,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Me=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(hn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var p7=ON();const m7=Db(19),g7=m7?v7:b7;function it(e,t,n,s,i){return g7(e,t,n,s,i)}function y7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return p7.useSyncExternalStore(e.subscribe,a,a)}function v7(e,t,n,s,i){return y7(e,t,n,s,i)}function b7(e,t,n,s,i){return AN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class x7{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,s,i){return it(this,t,n,s,i)}}class yO extends x7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),De(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;De(()=>(s.state[t]!==n&&s.set(t,n),()=>{s.set(t,void 0)}),[s,t,n])}useSyncedValues(t){const n=this,s=Object.values(t);De(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;De(()=>{s&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s])}select(t,n,s,i){const a=this.selectors[t];return a(this.state,n,s,i)}useState(t,n,s,i){return _.useDebugValue(t),it(this,this.selectors[t],n,s,i)}useContextCallback(t,n){_.useDebugValue(t);const s=Oe(n??Rn);this.context[t]=s}useStateSetter(t){const n=_.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let i=s(this.state);return n(i,i,this),this.subscribe(a=>{const l=s(a);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const S7={open:Me(e=>e.open),domReferenceElement:Me(e=>e.domReferenceElement),referenceElement:Me(e=>e.positionReference??e.referenceElement),floatingElement:Me(e=>e.floatingElement),floatingId:Me(e=>e.floatingId)};class Qb extends yO{constructor(t){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:d8(),nested:n,noEmit:s,triggerElements:a},S7)}setOpen=(t,n)=>{if((!t||!this.state.open||kV(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function bp(e,t=!1,n=!1){const[s,i]=_.useState(e&&t?"idle":void 0),[a,l]=_.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&s!=="ending"&&!n&&i("ending"),!e&&!a&&s==="ending"&&i(void 0),De(()=>{if(!e&&a&&s!=="ending"&&n){const f=hs.request(()=>{i("ending")});return()=>{hs.cancel(f)}}},[e,a,s,n]),De(()=>{if(!e||t)return;const f=hs.request(()=>{i(void 0)});return()=>{hs.cancel(f)}},[t,e]),De(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=hs.request(()=>{i("idle")});return()=>{hs.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let _u=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const _7={[_u.startingStyle]:""},w7={[_u.endingStyle]:""},ua={transitionStatus(e){return e==="starting"?_7:e==="ending"?w7:null}};function E7(e,t=!1,n=!0){const s=Zb();return Oe((i,a=null)=>{s.cancel();function l(){ii.flushSync(i)}const f=Bs(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let v=function(){const x=_u.startingStyle;if(!d.hasAttribute(x)){s.request(b);return}const S=new MutationObserver(()=>{d.hasAttribute(x)||(S.disconnect(),b())});S.observe(d,{attributes:!0,attributeFilter:[x]}),a?.addEventListener("abort",()=>S.disconnect(),{once:!0})},b=function(){Promise.all(d.getAnimations().map(x=>x.finished)).then(()=>{a?.aborted||l()}).catch(()=>{const x=d.getAnimations();if(n){if(a?.aborted)return;l()}else x.length>0&&x.some(S=>S.pending||S.playState!=="finished")&&b()})};var h=v,g=b;if(t){v();return}s.request(b)}})}function fa(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Oe(i),l=E7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function T7(e){const t=e.useState("open");De(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,i]=n.value;e.update({activeTriggerId:s,activeTriggerElement:i})}}},[t,e])}function R7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=bp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Oe(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return fa({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class Wb{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elementsSet.delete(s),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function C7(){return new Qb({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Wb,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function N7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:C7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:rn,inactiveTriggerProps:rn,popupProps:rn}}const Pd=Me(e=>e.triggerIdProp??e.activeTriggerId),j7={open:Me(e=>e.openProp??e.open),mounted:Me(e=>e.mounted),transitionStatus:Me(e=>e.transitionStatus),floatingRootContext:Me(e=>e.floatingRootContext),preventUnmountingOnClose:Me(e=>e.preventUnmountingOnClose),payload:Me(e=>e.payload),activeTriggerId:Pd,activeTriggerElement:Me(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Me((e,t)=>t!==void 0&&Pd(e)===t),isOpenedByTrigger:Me((e,t)=>t!==void 0&&Pd(e)===t&&e.open),isMountedByTrigger:Me((e,t)=>t!==void 0&&Pd(e)===t&&e.mounted),triggerProps:Me((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Me(e=>e.popupProps),popupElement:Me(e=>e.popupElement),positionerElement:Me(e=>e.positionerElement)};function O7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Hu(),a=gp()!=null,l=zn(()=>new Qb({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new Wb,floatingId:i,nested:a,noEmit:!1})).current;return De(()=>{const f={open:t,floatingId:i};s.reference!==void 0&&(f.referenceElement=s.reference,f.domReferenceElement=Ct(s.reference)?s.reference:null),s.floating!==void 0&&(f.floatingElement=s.floating),l.update(f)},[t,i,s.reference,s.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l.context.noEmit=!1,l}function A7(e={}){const{nodeId:t,externalTree:n}=e,s=O7(e),i=e.rootContext||s,a={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=_.useState(null),d=_.useRef(null),h=yp(n);De(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=s7({...e,elements:{...a,...l&&{reference:l}}}),v=_.useCallback(N=>{const A=Ct(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;f(A),g.refs.setReference(A)},[g.refs]),[b,x]=_.useState(null),[S,w]=_.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",Ct(b)?b:null),i.useSyncedValue("floatingElement",S);const T=_.useCallback(N=>{(Ct(N)||N===null)&&(d.current=N,x(N)),(Ct(g.refs.reference.current)||g.refs.reference.current===null||N!==null&&!Ct(N))&&g.refs.setReference(N)},[g.refs,x]),R=_.useCallback(N=>{w(N),g.refs.setFloating(N)},[g.refs]),k=_.useMemo(()=>({...g.refs,setReference:T,setFloating:R,setPositionReference:v,domReference:d}),[g.refs,T,R,v]),j=_.useMemo(()=>({...g.elements,domReference:a.domReference}),[g.elements,a.domReference]),C=i.useState("open"),I=i.useState("floatingId"),D=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:C,onOpenChange:i.setOpen,events:i.context.events,floatingId:I,refs:k,elements:j,nodeId:t,rootStore:i}),[g,k,j,t,i,C,I]);return De(()=>{i.context.dataRef.current.floatingContext=D;const N=h?.nodesRef.current.find(A=>A.id===t);N&&(N.context=D)}),_.useMemo(()=>({...g,context:D,refs:k,elements:j,rootStore:i}),[g,k,j,D,i])}function k7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Hu(),l=gp()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),h=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,v=zn(()=>new Qb({open:f,referenceElement:d,floatingElement:h,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return De(()=>{const b={open:f,floatingId:a,referenceElement:d,floatingElement:h};Ct(d)&&(b.domReferenceElement=d),v.state.positionReference===v.state.referenceElement&&(b.positionReference=d),v.update(b)},[f,a,d,h,v]),v.context.onOpenChange=i,v.context.nested=l,v.context.noEmit=n,v}const dR=Su("safe-polygon"),M7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${qj}`;function I7(e){return e?!!e.closest(M7):!1}class Jb{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new ei,this.restTimeout=new ei,this.handleCloseOptions=void 0}static create(){return new Jb}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function P7(e){const t=zn(Jb.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Hb(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const z7=new Set(["click","mousedown"]);function D7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,h=P7(n),g=yp(),v=gp(),b=Oe(()=>h.interactedInside?!0:l.current.openEvent?z7.has(l.current.openEvent.type):!1),x=Oe(()=>{const j=l.current.openEvent?.type;return j?.includes("mouse")&&j!=="mousedown"}),S=Oe(j=>RV(j,n.context.triggerElements)),w=_.useCallback((j,C=!0)=>{const I=L7(d,h.pointerType);I&&!h.handler?h.openChangeTimeout.start(I,()=>n.setOpen(!1,Vt(Tv,j))):C&&(h.openChangeTimeout.clear(),n.setOpen(!1,Vt(Tv,j)))},[d,n,h]),T=Oe(()=>{h.unbindMouseMove(),h.handler=void 0}),R=Oe(()=>{if(h.performedPointerEventsMutation){const j=Tt(i).body;j.style.pointerEvents="",j.removeAttribute(dR),h.performedPointerEventsMutation=!1}}),k=Oe(j=>{const C=Mr(j);if(!I7(C)){h.interactedInside=!1;return}h.interactedInside=!0});De(()=>{s||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,T(),R())},[s,h,T,R]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>R,[R]),De(()=>{if(f&&s&&h.handleCloseOptions?.blockPointerEvents&&x()&&Ct(a)&&i){h.performedPointerEventsMutation=!0;const j=Tt(i).body;j.setAttribute(dR,"");const C=a,I=i,D=g?.nodesRef.current.find(N=>N.id===v)?.context?.elements.floating;return D&&(D.style.pointerEvents=""),j.style.pointerEvents="none",C.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{j.style.pointerEvents="",C.style.pointerEvents="",I.style.pointerEvents=""}}},[f,s,a,i,h,x,g,v]),_.useEffect(()=>{if(!f)return;function j(N){b()||!l.current.floatingContext||!n.select("open")||S(N.relatedTarget)||(R(),T(),b()||w(N))}function C(N){h.openChangeTimeout.clear(),R(),h.handler?.(N),T()}function I(N){b()||w(N,!1)}const D=i;return D&&(D.addEventListener("mouseleave",j),D.addEventListener("mouseenter",C),D.addEventListener("mouseleave",I),D.addEventListener("pointerdown",k,!0)),()=>{D&&(D.removeEventListener("mouseleave",j),D.removeEventListener("mouseenter",C),D.removeEventListener("mouseleave",I),D.removeEventListener("pointerdown",k,!0))}},[f,i,n,l,b,S,w,R,T,k,h])}function L7(e,t){return t&&!AV(t)?0:typeof e=="function"?e():e}function U7(e=[]){const t=e.map(h=>h?.reference),n=e.map(h=>h?.floating),s=e.map(h=>h?.item),i=e.map(h=>h?.trigger),a=_.useCallback(h=>zd(h,e,"reference"),t),l=_.useCallback(h=>zd(h,e,"floating"),n),f=_.useCallback(h=>zd(h,e,"item"),s),d=_.useCallback(h=>zd(h,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function zd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[Cv]="");for(const l in e)i&&e&&(l===Fj||l===Hj)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let f;const d=t[l]?.[n];typeof d=="function"?f=e?d(e):null:f=d,f&&hR(a,f,i,s)}return hR(a,e,i,s),a}function hR(e,t,n,s){for(const i in t){const a=t[i];n&&(i===Fj||i===Hj)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof a=="function"&&(s.get(i)?.push(a),e[i]=(...l)=>s.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=a)}}const $7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function B7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingId"),a=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Hu(),h=a?.id||d,g=_.useMemo(()=>Mh(l)?.id||i,[l,i]),v=$7.get(f)??f,x=gp()!=null,S=_.useMemo(()=>v==="tooltip"||f==="label"?rn:{"aria-haspopup":v==="alertdialog"?"dialog":v,"aria-expanded":"false",...v==="listbox"&&{role:"combobox"},...v==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[v,x,f]),w=_.useMemo(()=>v==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:s?g:void 0}:{...S,"aria-expanded":s?"true":"false","aria-controls":s?g:void 0,...v==="menu"&&{id:h}},[v,g,s,h,f,S]),T=_.useMemo(()=>{const k={id:g,...v&&{role:v}};return v==="tooltip"||f==="label"?k:{...k,...v==="menu"&&{"aria-labelledby":h}}},[v,g,h,f]),R=_.useCallback(({active:k,selected:j})=>{const C={role:"option",...k&&{id:`${g}-fui-option`}};switch(f){case"select":case"combobox":return{...C,"aria-selected":j}}return{}},[g,f]);return _.useMemo(()=>({reference:w,floating:T,item:R,trigger:S}),[w,T,S,R])}let Hi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_u.startingStyle]="startingStyle",e[e.endingStyle=_u.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),pR=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const F7={[pR.popupOpen]:"",[pR.pressed]:""},H7={[Hi.open]:""},q7={[Hi.closed]:""},V7={[Hi.anchorHidden]:""},G7={open(e){return e?F7:null}},Qc={open(e){return e?H7:q7},anchorHidden(e){return e?V7:null}},vO=_.createContext(void 0);function K7(){const e=_.useContext(vO);if(e===void 0)throw new Error(hn(70));return e}const Z7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:h}=iO({container:i,ref:n,componentProps:t,elementProps:f});return!h&&!d?null:p.jsxs(_.Fragment,{children:[h,d&&ii.createPortal(s,d)]})}),Y7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return Fb().useState("mounted")||s?p.jsx(vO.Provider,{value:s,children:p.jsx(Z7,{ref:n,...i})}):null}),bO=_.createContext(void 0);function X7(){const e=_.useContext(bO);if(e===void 0)throw new Error(hn(71));return e}const Q7=_.createContext(void 0);function xO(){return _.useContext(Q7)?.direction??"ltr"}const W7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:a,platform:l,elements:f,middlewareData:d}=t,{element:h,padding:g=0,offsetParent:v="real"}=ro(e,t)||{};if(h==null)return{};const b=Gj(g),x={x:n,y:s},S=Kb(i),w=Gb(S),T=await l.getDimensions(h),R=S==="y",k=R?"top":"left",j=R?"bottom":"right",C=R?"clientHeight":"clientWidth",I=a.reference[w]+a.reference[S]-x[S]-a.floating[w],D=x[S]-a.reference[S],N=v==="real"?await l.getOffsetParent?.(h):f.floating;let A=f.floating[C]||a.floating[w];(!A||!await l.isElement?.(N))&&(A=f.floating[C]||a.floating[w]);const z=I/2-D/2,X=A/2-T[w]/2-1,q=Math.min(b[k],X),L=Math.min(b[j],X),Z=q,G=A-T[w]-L,te=A/2-T[w]/2+z,P=Nv(Z,te,G),V=!d.arrow&&pi(i)!=null&&te!==P&&a.reference[w]/2-(te<Z?q:L)-T[w]/2<0,U=V?te<Z?te-Z:te-G:0;return{[S]:x[S]+U,data:{[S]:P,centerOffset:te-P-U,...V&&{alignmentOffset:U}},reset:V}}}),J7=(e,t)=>({...W7(e),options:[e,t]}),eG={name:"hide",async fn(e){const{width:t,height:n,x:s,y:i}=e.rects.reference,a=t===0&&n===0&&s===0&&i===0;return{data:{referenceHidden:(await u7().fn(e)).data?.referenceHidden||a}}}},nh={sideX:"left",sideY:"top"},tG={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=an(i),h=d.getComputedStyle(i);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:n,data:nh};const v=await a.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(v===d){const k=Tt(i);b={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await a.isElement?.(v)&&(b=await a.getDimensions(v));const x=Vn(f);let S=t,w=n;x==="left"&&(S=b.width-(t+s.width)),x==="top"&&(w=b.height-(n+s.height));const T=x==="left"?"right":nh.sideX,R=x==="top"?"bottom":nh.sideY;return{x:S,y:w,data:{sideX:T,sideY:R}}}};function SO(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function mR(e,t,n){const{rects:s,placement:i}=e;return{side:SO(t,Vn(i),n),align:pi(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function _O(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:l=0,collisionBoundary:f,collisionPadding:d=5,sticky:h=!1,arrowPadding:g=5,disableAnchorTracking:v=!1,keepMounted:b=!1,floatingRootContext:x,mounted:S,collisionAvoidance:w,shiftCrossAxis:T=!1,nodeId:R,adaptiveOrigin:k,lazyFlip:j=!1,externalTree:C}=e,[I,D]=_.useState(null);!S&&I!==null&&D(null);const N=w.side||"flip",A=w.align||"flip",z=w.fallbackAxisSide||"end",X=typeof t=="function"?t:void 0,q=Oe(X),L=X?q:t,Z=Go(t),te=xO()==="rtl",P=I||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":te?"left":"right","inline-start":te?"right":"left"}[s],V=a==="center"?P:`${P}-${a}`;let U=d;const F=1,H=s==="bottom"?F:0,M=s==="top"?F:0,K=s==="right"?F:0,W=s==="left"?F:0;typeof U=="number"?U={top:U+H,right:U+W,bottom:U+M,left:U+K}:U&&(U={top:(U.top||0)+H,right:(U.right||0)+W,bottom:(U.bottom||0)+M,left:(U.left||0)+K});const Y={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:U},le=_.useRef(null),ie=Go(i),ce=Go(l),$e=[o7(st=>{const Yt=mR(st,s,te),pn=typeof ie.current=="function"?ie.current(Yt):ie.current,jt=typeof ce.current=="function"?ce.current(Yt):ce.current;return{mainAxis:pn,crossAxis:jt,alignmentAxis:jt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,te,s])],Ee=A==="none"&&N!=="shift",re=!Ee&&(h||T||N==="shift"),he=N==="none"?null:c7({...Y,padding:{top:U.top+F,right:U.right+F,bottom:U.bottom+F,left:U.left+F},mainAxis:!T&&N==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),oe=Ee?null:i7(st=>{const Yt=Tt(st.elements.floating).documentElement;return{...Y,rootBoundary:T?{x:0,y:0,width:Yt.clientWidth,height:Yt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:re,limiter:h||T?void 0:a7(pn=>{if(!le.current)return{};const{width:jt,height:En}=le.current.getBoundingClientRect(),Yn=Lr(Vn(pn.placement)),Cn=Yn==="y"?jt:En,ss=Yn==="y"?U.left+U.right:U.top+U.bottom;return{offset:Cn/2+ss/2}})}},[Y,h,T,U,A]);N==="shift"||A==="shift"||a==="center"?$e.push(oe,he):$e.push(he,oe),$e.push(l7({...Y,apply({elements:{floating:st},rects:{reference:Yt},availableWidth:pn,availableHeight:jt}){const En=st.style;En.setProperty("--available-width",`${pn}px`),En.setProperty("--available-height",`${jt}px`),En.setProperty("--anchor-width",`${Yt.width}px`),En.setProperty("--anchor-height",`${Yt.height}px`)}}),J7(()=>({element:le.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(st){const{elements:Yt,middlewareData:pn,placement:jt,rects:En,y:Yn}=st,Cn=Vn(jt),ss=Lr(Cn),os=le.current,pa=pn.arrow?.x||0,gi=pn.arrow?.y||0,yi=os?.clientWidth||0,xs=os?.clientHeight||0,Xn=pa+yi/2,is=gi+xs/2,oo=Math.abs(pn.shift?.y||0),io=En.reference.height/2,Qn=typeof i=="function"?i(mR(st,s,te)):i,Jc=oo>Qn,Ju={top:`${Xn}px calc(100% + ${Qn}px)`,bottom:`${Xn}px ${-Qn}px`,left:`calc(100% + ${Qn}px) ${is}px`,right:`${-Qn}px ${is}px`}[Cn],ef=`${Xn}px ${En.reference.y+io-Yn}px`;return Yt.floating.style.setProperty("--transform-origin",re&&ss==="y"&&Jc?ef:Ju),{}}},eG,k),De(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const _e=_.useMemo(()=>({elementResize:!v&&typeof ResizeObserver<"u",layoutShift:!v&&typeof IntersectionObserver<"u"}),[v]),{refs:ye,elements:xe,x:ve,y:ke,middlewareData:Le,update:we,placement:qe,context:Qe,isPositioned:Be,floatingStyles:We}=A7({rootContext:x,placement:V,middleware:$e,strategy:n,whileElementsMounted:b?void 0:(...st)=>uR(...st,_e),nodeId:R,externalTree:C}),{sideX:Ve,sideY:pe}=Le.adaptiveOrigin||nh,Te=Be?n:"fixed",He=_.useMemo(()=>{const st=k?{position:Te,[Ve]:ve,[pe]:ke}:{position:Te,...We};return Be||(st.opacity=0),st},[k,Te,Ve,ve,pe,ke,We,Be]),ht=_.useRef(null);De(()=>{if(!S)return;const st=Z.current,Yt=typeof st=="function"?st():st,jt=(gR(Yt)?Yt.current:Yt)||null||null;jt!==ht.current&&(ye.setPositionReference(jt),ht.current=jt)},[S,ye,L,Z]),_.useEffect(()=>{if(!S)return;const st=Z.current;typeof st!="function"&&gR(st)&&st.current!==ht.current&&(ye.setPositionReference(st.current),ht.current=st.current)},[S,ye,L,Z]),_.useEffect(()=>{if(b&&S&&xe.domReference&&xe.floating)return uR(xe.domReference,xe.floating,we,_e)},[b,S,xe,we,_e]);const lt=Vn(qe),yr=SO(s,lt,te),vr=pi(qe)||"center",Zt=!!Le.hide?.referenceHidden;De(()=>{j&&S&&Be&&D(lt)},[j,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Le.arrow?.y,left:Le.arrow?.x}),[Le.arrow]),vt=Le.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:He,arrowStyles:ut,arrowRef:le,arrowUncentered:vt,side:yr,align:vr,physicalSide:lt,anchorHidden:Zt,refs:ye,context:Qe,isPositioned:Be,update:we}),[He,ut,le,vt,yr,vr,lt,Zt,ye,Qe,Be,we])}function gR(e){return e!=null&&"current"in e}function xp(e){return e==="starting"?g9:rn}const nG=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:h=0,alignOffset:g=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:T=b9,...R}=t,k=Fb(),j=K7(),C=k.useState("open"),I=k.useState("mounted"),D=k.useState("trackCursorAxis"),N=k.useState("disableHoverablePopup"),A=k.useState("floatingRootContext"),z=k.useState("instantType"),X=k.useState("transitionStatus"),q=k.useState("hasViewport"),L=_O({anchor:a,positionMethod:l,floatingRootContext:A,mounted:I,side:f,sideOffset:h,align:d,alignOffset:g,collisionBoundary:v,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:j,collisionAvoidance:T,adaptiveOrigin:q?tG:void 0}),Z=_.useMemo(()=>{const V={};return(!C||D==="both"||N)&&(V.pointerEvents="none"),{role:"presentation",hidden:!I,style:{...L.positionerStyles,...V}}},[C,D,N,I,L.positionerStyles]),G=_.useMemo(()=>({open:C,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:D!=="none"?"tracking-cursor":z}),[C,L.side,L.align,L.anchorHidden,D,z]),te=_.useMemo(()=>({...G,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[G,L.arrowRef,L.arrowStyles,L.arrowUncentered]),P=Mt("div",t,{state:G,props:[Z,xp(X),R],ref:[n,k.useStateSetter("positionerElement")],stateAttributesMapping:Qc});return p.jsx(bO.Provider,{value:te,children:P})}),rG={...Qc,...ua},sG=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=Fb(),{side:f,align:d}=X7(),h=l.useState("open"),g=l.useState("instantType"),v=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");fa({open:h,ref:l.context.popupRef,onComplete(){h&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return D7(x,{enabled:!S,closeDelay:w}),Mt("div",t,{state:{open:h,side:f,align:d,instant:g,transitionStatus:v},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,xp(v),a],stateAttributesMapping:rG})});function ex(e){return Db(19)?e:e?"true":void 0}const oG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>p.jsx(Y7,{children:p.jsx(nG,{sideOffset:t,children:p.jsx(sG,{ref:i,className:me("bg-[#1e1e1e] border border-neutral-700 rounded-md px-2.5 py-1.5 text-xs text-neutral-300 font-mono shadow-lg",e),...s,children:n})})}));oG.displayName="TooltipContent";function yR(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const wO=_.forwardRef(({className:e,clients:t,positions:n,relayClientIds:s=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:l={width:1200,height:380},totalNodes:f,onlineCount:d,offlineCount:h,...g},v)=>{const b=i.x,x=i.y,S=a.x,w=a.y,T={},R=2*Math.PI/Math.max(t.length,1);t.forEach((N,A)=>{const z=s.includes(N.id),X=z?S:b,q=z?w:x,L=z?240:260,Z=z?130:150,G=R*A-Math.PI/2;T[N.id]={x:X+L*Math.cos(G),y:q+Z*Math.sin(G)}});const k={};if(n)for(const N of n)k[N.clientId]={x:N.x,y:N.y};function j(N){return k[N]??T[N]??{x:600,y:190}}const C=f??t.length+2,I=d??t.filter(N=>N.status!=="offline").length,D=h??t.filter(N=>N.status==="offline").length;return p.jsxs("div",{ref:v,className:me("relative overflow-hidden","bg-[radial-gradient(ellipse_at_35%_50%,rgba(59,130,246,0.06)_0%,transparent_50%),radial-gradient(ellipse_at_68%_50%,rgba(139,92,246,0.04)_0%,transparent_40%),#0c0c0c]","bg-[image:radial-gradient(circle_at_1px_1px,#1a1a1a_1px,transparent_0)] bg-[size:24px_24px]",e),style:{height:420},...g,children:[p.jsx("div",{className:"absolute left-0 right-0 h-px bg-[linear-gradient(90deg,transparent,rgba(59,130,246,0.3),transparent)] animate-[scanSweep_6s_ease-in-out_infinite] pointer-events-none"}),p.jsx("div",{className:"absolute top-4 left-5 z-10",children:p.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),p.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[p.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[C," nodes"]}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),p.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[I," online"]}),p.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),p.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[D," offline"]})]}),p.jsxs("svg",{viewBox:`0 0 ${l.width} ${l.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[p.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),p.jsx("ellipse",{cx:S,cy:w,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),p.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),p.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:p.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),p.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[p.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${S},${w}`}),p.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),p.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[p.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${S},${w} L${b},${x}`}),p.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),p.jsx("text",{x:(b+S)/2,y:x-20,textAnchor:"middle",fill:"#8b5cf6",fontFamily:"JetBrains Mono, monospace",fontSize:8,opacity:.4,letterSpacing:2,children:"BACKBONE"}),t.map(N=>{const A=j(N.id),z=s.includes(N.id),X=z?S:b,q=z?w:x,L=yR(N.status),Z=N.status==="syncing"?2.5:1.5;if(N.status==="offline")return p.jsx("line",{x1:X,y1:q,x2:A.x,y2:A.y,stroke:L,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${N.id}`);const G=N.status==="syncing"?"1.2s":"2.8s",te=`${Number.parseFloat(G)/2}s`;return p.jsxs("g",{children:[p.jsx("line",{x1:X,y1:q,x2:A.x,y2:A.y,stroke:L,strokeWidth:Z,strokeDasharray:"4 2",children:p.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),p.jsxs("circle",{r:2.5,fill:L,opacity:.7,children:[p.jsx("animateMotion",{dur:G,repeatCount:"indefinite",path:`M${X},${q} L${A.x},${A.y}`}),p.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:G,repeatCount:"indefinite"})]}),p.jsxs("circle",{r:2,fill:L,opacity:.5,children:[p.jsx("animateMotion",{dur:G,begin:te,repeatCount:"indefinite",path:`M${A.x},${A.y} L${X},${q}`}),p.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:G,begin:te,repeatCount:"indefinite"})]})]},`line-${N.id}`)}),p.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[p.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),p.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),p.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[p.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),p.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),p.jsx("circle",{cx:b,cy:x,r:32,fill:"#0c0c0c",stroke:"#3b82f6",strokeWidth:2,style:{filter:"drop-shadow(0 0 12px rgba(59,130,246,0.4))"}}),p.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),p.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),p.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),p.jsxs("circle",{cx:S,cy:w,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[p.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),p.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),p.jsx("circle",{cx:S,cy:w,r:26,fill:"#0c0c0c",stroke:"#8b5cf6",strokeWidth:2,style:{filter:"drop-shadow(0 0 10px rgba(139,92,246,0.35))"}}),p.jsx("circle",{cx:S,cy:w,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),p.jsx("circle",{cx:S,cy:w,r:5,fill:"#8b5cf6"}),p.jsx("text",{x:S,y:w+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(N=>{const A=j(N.id),z=yR(N.status),X=N.status==="offline"?.25:1,q=N.actor.replace("user-","").replace("svc-",""),L=s.includes(N.id);return p.jsxs("g",{opacity:X,children:[p.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:z,strokeWidth:1.5}),p.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:z}),p.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:q}),p.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[N.type,L?" · relay":""]})]},`node-${N.id}`)})]})]})});wO.displayName="TopologyHero";let vR=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function EO(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[vR.checked]:""}:{[vR.unchecked]:""}},...di}),[e.indeterminate])}const iG=_.createContext({disabled:!1});function aG(){return _.useContext(iG)}const cG=_.createContext(void 0);function lG(e=!0){const t=_.useContext(cG);if(t===void 0&&!e)throw new Error(hn(3));return t}const TO=_.createContext(void 0);function uG(){const e=_.useContext(TO);if(e===void 0)throw new Error(hn(14));return e}const fG="data-parent",dG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!1,id:f,indeterminate:d=!1,inputRef:h,name:g,onCheckedChange:v,parent:b=!1,readOnly:x=!1,render:S,required:w=!1,uncheckedValue:T,value:R,nativeButton:k=!1,...j}=t,{clearErrors:C}=Yc(),{disabled:I,name:D,setDirty:N,setFilled:A,setFocused:z,setTouched:X,state:q,validationMode:L,validityData:Z,shouldValidateOnChange:G,validation:te}=hi(),P=aG(),{labelId:V,controlId:U,registerControlId:F,getDescriptionProps:H}=so(),M=lG(),K=M?.parent,W=K&&M.allValues,Y=I||P.disabled||M?.disabled||l,le=D??g,ie=R??le,ce=dr(),Se=dr();let ge=U;W?ge=b?Se:`${K.id}-${ie}`:f&&(ge=f);let $e={};W&&(b?$e=M.parent.getParentProps():ie&&($e=M.parent.getChildProps(ie)));const Ee=Oe(v),{checked:re=s,indeterminate:he=d,onCheckedChange:oe,..._e}=$e,ye=M?.value,xe=M?.setValue,ve=M?.defaultValue,ke=_.useRef(null),Le=zn(()=>Symbol("checkbox-control")),we=_.useRef(!1),{getButtonProps:qe,buttonRef:Qe}=Zc({disabled:Y,native:k}),Be=M?.validation??te,[We,Ve]=ip({controlled:ie&&ye&&!b?ye.includes(ie):re,default:ie&&ve&&!b?ve.includes(ie):a,name:"Checkbox",state:"checked"});De(()=>{F!==Rn&&(we.current=!0,F(Le.current,ge))},[ge,M,F,b,Le]),_.useEffect(()=>{const ut=Le.current;return()=>{!we.current||F===Rn||(we.current=!1,F(ut,void 0))}},[F,Le]),vj({enabled:!M,id:ce,commit:Be.commit,value:We,controlRef:ke,name:le,getValue:()=>We});const pe=_.useRef(null),Te=to(h,pe,Be.inputRef);De(()=>{pe.current&&(pe.current.indeterminate=he,We&&A(!0))},[We,he,A]),wj(We,()=>{M&&!b||(C(le),A(We),N(We!==Z.initialValue),G()?Be.commit(We):Be.commit(We,!0))});const He=Wo({checked:We,disabled:Y,name:b?void 0:le,id:k?void 0:ge??void 0,required:w,ref:Te,style:le?lj:ap,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const vt=ut.target.checked,st=Vt(Jo,ut.nativeEvent);if(oe?.(vt,st),Ee(vt,st),!st.isCanceled&&(Ve(vt),ie&&ye&&xe&&!b)){const Yt=vt?[...ye,ie]:ye.filter(pn=>pn!==ie);xe(Yt,st)}},onFocus(){ke.current?.focus()}},R!==void 0?{value:(M?We&&R:R)||""}:rn,H,M?Be.getValidationProps:Be.getInputValidationProps),ht=W?!!re:We,lt=W&&he||d;_.useEffect(()=>{if(!K||!ie)return;const ut=K.disabledStatesRef.current;return ut.set(ie,Y),()=>{ut.delete(ie)}},[K,Y,ie]);const yr=_.useMemo(()=>({...q,checked:ht,disabled:Y,readOnly:x,required:w,indeterminate:lt}),[q,ht,Y,x,w,lt]),vr=EO(yr),Zt=Mt("span",t,{state:yr,ref:[Qe,ke,n,M?.registerControlRef],props:[{id:k?ge??void 0:ce,role:"checkbox","aria-checked":he?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":V,[fG]:b?"":void 0,onFocus(){z(!0)},onBlur(){const ut=pe.current;ut&&(X(!0),z(!1),L==="onBlur"&&Be.commit(M?ye:ut.checked))},onClick(ut){x||Y||(ut.preventDefault(),pe.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},H,Be.getValidationProps,j,_e,qe],stateAttributesMapping:vr});return p.jsxs(TO.Provider,{value:yr,children:[Zt,!We&&!M&&le&&!b&&T!==void 0&&p.jsx("input",{type:"hidden",name:le,value:T}),p.jsx("input",{...He})]})}),hG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=uG(),d=f.checked||f.indeterminate,{mounted:h,transitionStatus:g,setMounted:v}=bp(d),b=_.useRef(null),x={...f,transitionStatus:g};fa({open:d,ref:b,onComplete(){d||v(!1)}});const S=EO(f),w=_.useMemo(()=>({...S,...ua,...di}),[S]),T=a||h,R=Mt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?R:null}),kv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=p.jsx(dG,{ref:s,className:me("w-[15px] h-[15px] border-[1.5px] border-neutral-700 rounded-full flex items-center justify-center cursor-pointer transition-all duration-200","data-[checked]:bg-healthy data-[checked]:border-healthy data-[checked]:shadow-[0_0_6px_rgba(34,197,94,0.3)]",e),...n,children:p.jsx(hG,{className:"flex items-center justify-center text-white",children:p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?p.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,p.jsx("span",{children:t})]}):i});kv.displayName="Checkbox";const pG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function mG(e=!1){const t=_.useContext(pG);if(!t&&!e)throw new Error(hn(86));return t}const gG=function(t){const n=dr(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),h=zn(()=>new Map),{messageIds:g}=so(),v=Oe((S,w)=>{const T=h.current;if(w===void 0){T.delete(S);return}T.set(S,w),i(R=>{if(T.size===0)return;let k;for(const j of T.values()){if(R!==void 0&&j===R)return R;k===void 0&&(k=j)}return k})}),b=_.useCallback(S=>Wo({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:v,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,v,a,l,f,d,b]);return p.jsx(bj.Provider,{value:x,children:t.children})},rh=Object.keys(dp);function yG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of rh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function vG(e){const{formRef:t,clearErrors:n}=Yc(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:h,name:g,shouldValidateOnChange:v}=e,{controlId:b,getDescriptionProps:x}=so(),S=ts(),w=_.useRef(null),T=Oe(async(j,C=!1)=>{const I=w.current;if(!I)return;if(C){if(h.valid!==!1)return;const Z=I.validity;if(!Z.valueMissing){const te={value:j,state:{...dp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(I.setCustomValidity(""),b){const P=t.current.fields.get(b);P&&t.current.fields.set(b,{...P,...Ev(te,!1)})}s(te);return}const G=rh.reduce((te,P)=>(te[P]=Z[P],te),{});if(!G.valid&&!yG(G))return}function D(Z){const G=rh.reduce((P,V)=>(P[V]=Z.validity[V],P),{});let te=!1;for(const P of rh)if(P!=="valid"){if(P==="valueMissing"&&G[P])te=!0;else if(G[P])return G}return te&&!d.current&&(G.valid=!0,G.valueMissing=!1),G}S.clear();let N=null,A=[];const z=D(I);let X;const q=v();if(I.validationMessage&&!q)X=I.validationMessage,A=[I.validationMessage];else{const Z=Array.from(t.current.fields.values()).reduce((te,P)=>(P.name&&(te[P.name]=P.getValue()),te),{}),G=i(j,Z);typeof G=="object"&&G!==null&&"then"in G?N=await G:N=G,N!==null?(z.valid=!1,z.customError=!0,Array.isArray(N)?(A=N,I.setCustomValidity(N.join(`
|
|
75
|
-
`))):N&&(A=[N],I.setCustomValidity(N))):q&&(I.setCustomValidity(""),z.customError=!1,I.validationMessage?(X=I.validationMessage,A=[I.validationMessage]):I.validity.valid&&!z.valid&&(z.valid=!0))}const L={value:j,state:z,error:X??(Array.isArray(N)?N[0]:N??""),errors:A,initialValue:a.initialValue};if(b){const Z=t.current.fields.get(b);Z&&t.current.fields.set(b,{...Z,...Ev(L,f)})}s(L)}),R=_.useCallback((j={})=>Wo(x,h.valid===!1?{"aria-invalid":!0}:rn,j),[x,h.valid]),k=_.useCallback((j={})=>Wo({onChange(C){if(C.nativeEvent.defaultPrevented)return;if(n(g),!v()){T(C.currentTarget.value,!0);return}if(f)return;const I=C.currentTarget;if(I.value===""){T(I.value);return}S.clear(),l?S.start(l,()=>{T(I.value)}):T(I.value)}},R(j)),[R,n,g,S,T,f,l,v]);return _.useMemo(()=>({getValidationProps:R,getInputValidationProps:k,inputRef:w,commit:T}),[R,k,T])}const bG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=Yc(),{render:l,className:f,validate:d,validationDebounceTime:h=0,validationMode:g=i,name:v,disabled:b=!1,invalid:x,dirty:S,touched:w,actionsRef:T,...R}=t,{disabled:k}=mG(),j=Oe(d||(()=>null)),C=k||b,[I,D]=_.useState(!1),[N,A]=_.useState(!1),[z,X]=_.useState(!1),[q,L]=_.useState(!1),Z=S??N,G=w??I,te=_.useRef(!1),P=Oe(Se=>{S===void 0&&(Se&&(te.current=!0),A(Se))}),V=Oe(Se=>{w===void 0&&D(Se)}),U=Oe(()=>g==="onChange"||g==="onSubmit"&&a.current),F=!!(x||v&&{}.hasOwnProperty.call(s,v)&&s[v]!==void 0),[H,M]=_.useState({state:dp,error:"",errors:[],value:null,initialValue:null}),K=!F&&H.state.valid,W=_.useMemo(()=>({disabled:C,touched:G,dirty:Z,valid:K,filled:z,focused:q}),[C,G,Z,K,z,q]),Y=vG({setValidityData:M,validate:j,validityData:H,validationDebounceTime:h,invalid:F,markedDirtyRef:te,state:W,name:v,shouldValidateOnChange:U}),le=_.useCallback(()=>{te.current=!0,Y.commit(H.value)},[Y,H]);_.useImperativeHandle(T,()=>({validate:le}),[le]);const ie=_.useMemo(()=>({invalid:F,name:v,validityData:H,setValidityData:M,disabled:C,touched:G,setTouched:V,dirty:Z,setDirty:P,filled:z,setFilled:X,focused:q,setFocused:L,validate:j,validationMode:g,validationDebounceTime:h,shouldValidateOnChange:U,state:W,markedDirtyRef:te,validation:Y}),[F,v,H,C,G,V,Z,P,z,X,q,L,j,g,h,U,W,Y]),ce=Mt("div",t,{ref:n,state:W,props:R,stateAttributesMapping:di});return p.jsx(yj.Provider,{value:ie,children:ce})}),xG=_.forwardRef(function(t,n){return p.jsx(gG,{children:p.jsx(bG,{...t,ref:n})})}),SG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=hi(!1),{controlId:h,setLabelId:g,labelId:v}=so(),b=dr(a),x=_.useRef(null),S=Oe(T=>{if(Mr(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!h))return;const k=Tt(T.currentTarget).getElementById(h);qt(k)&&k.focus({focusVisible:!0})});return De(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),Mt("label",t,{ref:[n,x],state:d.state,props:[{id:v},l?{htmlFor:h??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:di})}),_G={...di,...ua},wG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=dr(i),{validityData:h,state:g,name:v}=hi(!1),{setMessageIds:b}=so(),{errors:x}=Yc(),S=v?x[v]:null;let w=!1;S||l===!0?w=!0:l?w=!!h.state[l]:w=h.state.valid===!1;const{mounted:T,transitionStatus:R,setMounted:k}=bp(w);De(()=>{if(!(!w||!d))return b(L=>L.concat(d)),()=>{b(L=>L.filter(Z=>Z!==d))}},[w,d,b]);const j=_.useRef(null),[C,I]=_.useState(null),[D,N]=_.useState(null),A=S||(h.errors.length>1?p.jsx("ul",{children:h.errors.map(L=>p.jsx("li",{children:L},L))}):h.error);let z=h.error;S!=null?z=Array.isArray(S)?JSON.stringify(S):S:h.errors.length>1&&(z=JSON.stringify(h.errors)),w&&z!==D&&(N(z),I(A)),fa({open:w,ref:j,onComplete(){w||k(!1)}});const X={...g,transitionStatus:R},q=Mt("div",t,{ref:[n,j],state:X,props:[{id:d,children:w?A:C},f],stateAttributesMapping:_G,enabled:T});return T?q:null}),EG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=dr(i),d=hi(!1),{setMessageIds:h}=so();return De(()=>{if(f)return h(v=>v.concat(f)),()=>{h(v=>v.filter(b=>b!==f))}},[f,h]),Mt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:di})}),ds=xG,Wr=_.forwardRef(({className:e,...t},n)=>p.jsx(SG,{ref:n,className:me("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));Wr.displayName="FieldLabel";const ac=_.forwardRef(({className:e,...t},n)=>p.jsx(EG,{ref:n,className:me("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));ac.displayName="FieldDescription";const TG=_.forwardRef(({className:e,...t},n)=>p.jsx(wG,{ref:n,className:me("font-mono text-[10px] text-offline mt-1",e),...t}));TG.displayName="FieldError";const RG=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me(e),...t}));RG.displayName="FieldContent";const CG=_.createContext(null),NG=_.createContext(null);function Vu(){const e=_.useContext(CG);if(e===null)throw new Error(hn(60));return e}function RO(){const e=_.useContext(NG);if(e===null)throw new Error(hn(61));return e}function Mc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function jG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Mc(t,s,n))}function Ay(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Mc(s,t,n))}function OG(e,t,n){return e.filter(s=>!Mc(t,s,n))}function bR(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function AG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function kG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(AG(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function MG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?bR(e.value):bR(e)}const ot={id:Me(e=>e.id),modal:Me(e=>e.modal),multiple:Me(e=>e.multiple),items:Me(e=>e.items),itemToStringLabel:Me(e=>e.itemToStringLabel),itemToStringValue:Me(e=>e.itemToStringValue),isItemEqualToValue:Me(e=>e.isItemEqualToValue),value:Me(e=>e.value),hasSelectedValue:Me(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:MG(t,s)!==""}),hasNullItemLabel:Me((e,t)=>t?kG(e.items):!1),open:Me(e=>e.open),mounted:Me(e=>e.mounted),forceMount:Me(e=>e.forceMount),transitionStatus:Me(e=>e.transitionStatus),openMethod:Me(e=>e.openMethod),activeIndex:Me(e=>e.activeIndex),selectedIndex:Me(e=>e.selectedIndex),isActive:Me((e,t)=>e.activeIndex===t),isSelected:Me((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Mc(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Mc(n,i,s)}),isSelectedByFocus:Me((e,t)=>e.selectedIndex===t),popupProps:Me(e=>e.popupProps),triggerProps:Me(e=>e.triggerProps),triggerElement:Me(e=>e.triggerElement),positionerElement:Me(e=>e.positionerElement),listElement:Me(e=>e.listElement),scrollUpArrowVisible:Me(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Me(e=>e.scrollDownArrowVisible),hasScrollArrows:Me(e=>e.hasScrollArrows)};function IG(e){const t=_.useRef(""),n=_.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:_.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function PG(e){const[t,n]=_.useState(null),s=Oe((f,d)=>{e||n(d||(Bj?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=IG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function zG(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const a=parseFloat(n.width)||0,l=parseFloat(n.height)||0,f=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(t.width,a,f),g=Math.max(t.height,l,d),v=h-t.width,b=g-t.height;return{left:t.left-v/2,right:t.right+v/2,top:t.top-b/2,bottom:t.bottom+b/2}}const Dd=2,DG=400,xR=200,LG={...G7,...di,value:()=>null},UG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:h,setFocused:g,validationMode:v,state:b,disabled:x}=hi(),{labelId:S}=so(),{store:w,setOpen:T,selectionRef:R,validation:k,readOnly:j,required:C,alignItemWithTriggerActiveRef:I,disabled:D,keyboardActiveRef:N}=Vu(),A=x||D||l,z=it(w,ot.open),X=it(w,ot.value),q=it(w,ot.triggerProps),L=it(w,ot.positionerElement),Z=it(w,ot.listElement),G=it(w,ot.id),te=it(w,ot.hasSelectedValue),P=!te&&z,V=it(w,ot.hasNullItemLabel,P),U=a??G;xj({id:U});const F=Go(L),H=_.useRef(null),{getButtonProps:M,buttonRef:K}=Zc({disabled:A,native:f}),W=Oe(re=>{w.set("triggerElement",re)}),Y=to(n,H,K,W),le=ts(),ie=ts(),ce=ts(),Se=ts();_.useEffect(()=>{if(z)return!(te||V)?ce.start(DG,()=>{R.current.allowUnselectedMouseUp=!0,R.current.allowSelectedMouseUp=!0}):Se.start(xR,()=>{R.current.allowUnselectedMouseUp=!0,ce.start(xR,()=>{R.current.allowSelectedMouseUp=!0})}),()=>{ce.clear(),Se.clear()};R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ie.clear()},[z,te,V,R,ie,ce,Se]);const ge=_.useMemo(()=>Z?.id??Mh(L)?.id,[Z,L]),$e=Wo(q,{id:U,role:"combobox","aria-expanded":z?"true":"false","aria-haspopup":"listbox","aria-controls":z?ge:void 0,"aria-labelledby":S,"aria-readonly":j||void 0,"aria-required":C||void 0,tabIndex:A?-1:0,ref:Y,onFocus(re){g(!0),z&&I.current&&T(!1,Vt(Jo,re.nativeEvent)),le.start(0,()=>{w.set("forceMount",!0)})},onBlur(re){Ot(L,re.relatedTarget)||(h(!0),g(!1),v==="onBlur"&&k.commit(X))},onPointerMove(){N.current=!1},onKeyDown(){N.current=!0},onMouseDown(re){if(z)return;const he=Tt(re.currentTarget);function oe(_e){if(!H.current)return;const ye=_e.target;if(Ot(H.current,ye)||Ot(F.current,ye)||ye===H.current)return;const xe=zG(H.current);_e.clientX>=xe.left-Dd&&_e.clientX<=xe.right+Dd&&_e.clientY>=xe.top-Dd&&_e.clientY<=xe.bottom+Dd||T(!1,Vt(B9,_e))}ie.start(0,()=>{he.addEventListener("mouseup",oe,{once:!0})})}},k.getValidationProps,d,M);$e.role="combobox";const Ee={...b,open:z,disabled:A,value:X,readOnly:j,placeholder:!te};return Mt("button",t,{ref:[n,H],state:Ee,stateAttributesMapping:LG,props:$e})}),$G=_.createContext(void 0),BG=_.forwardRef(function(t,n){const{store:s}=Vu(),i=it(s,ot.mounted),a=it(s,ot.forceMount);return i||a?p.jsx($G.Provider,{value:!0,children:p.jsx(aO,{ref:n,...t})}):null});let SR={},_R={},wR="";function FG(e){if(typeof document>"u")return!1;const t=Tt(e);return an(t).innerWidth-t.documentElement.clientWidth>0}function HG(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Tt(e),s=n.documentElement,i=n.body,a=fi(s)?s:i,l=a.style.overflowY,f=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const h=a.offsetWidth;return a.style.overflowY=l,s.style.scrollbarGutter=f,d===h}function qG(e){const t=Tt(e),n=t.documentElement,s=t.body,i=fi(n)?n:s,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function VG(e){const t=Tt(e),n=t.documentElement,s=t.body,i=an(n);let a=0,l=0,f=!1;const d=hs.create();if(qb&&(i.visualViewport?.scale??1)!==1)return()=>{};function h(){const b=i.getComputedStyle(n),x=i.getComputedStyle(s),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,SR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},wR=n.style.scrollBehavior,_R={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,j=b.overflowY==="scroll"||x.overflowY==="scroll",C=b.overflowX==="scroll"||x.overflowX==="scroll",I=Math.max(0,i.innerWidth-s.clientWidth),D=Math.max(0,i.innerHeight-s.clientHeight),N=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),z=fi(n)?n:s;if(f=HG(e),f){n.style.scrollbarGutter=T,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(R||j)&&(n.style.overflowY="scroll"),(k||C)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:N||D?`calc(100dvh - ${N+D}px)`:"100dvh",width:A||I?`calc(100vw - ${A+I}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,SR),Object.assign(s.style,_R),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=wR)}function v(){g(),d.request(h)}return h(),i.addEventListener("resize",v),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",v)}}class GG{lockCount=0;restore=null;timeoutLock=ei.create();timeoutUnlock=ei.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=Tt(t).documentElement,i=an(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=Rn;return}const a=Bj||!FG(t);this.restore=a?qG(t):VG(t)}}const KG=new GG;function CO(e=!0,t=null){De(()=>{if(e)return KG.acquire(t)},[e,t])}const NO=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ZG(){return _.useContext(NO)}function jO(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Oe(i),l=_.useRef(0),f=zn(XG).current,d=zn(YG).current,[h,g]=_.useState(0),v=_.useRef(h),b=Oe((R,k)=>{d.set(R,k??null),v.current+=1,g(v.current)}),x=Oe(R=>{d.delete(R),v.current+=1,g(v.current)}),S=_.useMemo(()=>{const R=new Map;return Array.from(d.keys()).filter(j=>j.isConnected).sort(QG).forEach((j,C)=>{const I=d.get(j)??{};R.set(j,{...I,index:C})}),R},[d,h]);De(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const R=new MutationObserver(k=>{const j=new Set,C=I=>j.has(I)?j.delete(I):j.add(I);k.forEach(I=>{I.removedNodes.forEach(C),I.addedNodes.forEach(C)}),j.size===0&&(v.current+=1,g(v.current))});return S.forEach((k,j)=>{j.parentElement&&R.observe(j.parentElement,{childList:!0})}),()=>{R.disconnect()}},[S]),De(()=>{v.current===h&&(n.current.length!==S.size&&(n.current.length=S.size),s&&s.current.length!==S.size&&(s.current.length=S.size),l.current=S.size),a(S)},[a,S,n,s,h]),De(()=>()=>{n.current=[]},[n]),De(()=>()=>{s&&(s.current=[])},[s]);const w=Oe(R=>(f.add(R),()=>{f.delete(R)}));De(()=>{f.forEach(R=>R(S))},[f,S]);const T=_.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:l}),[b,x,w,n,s,l]);return p.jsx(NO.Provider,{value:T,children:t})}function YG(){return new Map}function XG(){return new Set}function QG(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const OO=_.createContext(void 0);function WG(){const e=_.useContext(OO);if(!e)throw new Error(hn(59));return e}const AO=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
|
|
76
|
-
0% 0%,
|
|
77
|
-
100% 0%,
|
|
78
|
-
100% 100%,
|
|
79
|
-
0% 100%,
|
|
80
|
-
0% 0%,
|
|
81
|
-
${l.left}px ${l.top}px,
|
|
82
|
-
${l.left}px ${l.bottom}px,
|
|
83
|
-
${l.right}px ${l.bottom}px,
|
|
84
|
-
${l.right}px ${l.top}px,
|
|
85
|
-
${l.left}px ${l.top}px
|
|
86
|
-
)`}return p.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Hh(e,t){e&&Object.assign(e.style,t)}const JG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},eK={position:"fixed"},tK=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,side:f="bottom",align:d="center",sideOffset:h=0,alignOffset:g=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:T=!0,collisionAvoidance:R=v9,...k}=t,{store:j,listRef:C,labelsRef:I,alignItemWithTriggerActiveRef:D,selectedItemTextRef:N,valuesRef:A,initialValueRef:z,popupRef:X,setValue:q}=Vu(),L=RO(),Z=it(j,ot.open),G=it(j,ot.mounted),te=it(j,ot.modal),P=it(j,ot.value),V=it(j,ot.openMethod),U=it(j,ot.positionerElement),F=it(j,ot.triggerElement),H=it(j,ot.isItemEqualToValue),M=it(j,ot.transitionStatus),K=_.useRef(null),W=_.useRef(null),[Y,le]=_.useState(T),ie=G&&Y&&V!=="touch";!G&&Y!==T&&le(T),De(()=>{G||(ot.scrollUpArrowVisible(j.state)&&j.set("scrollUpArrowVisible",!1),ot.scrollDownArrowVisible(j.state)&&j.set("scrollDownArrowVisible",!1))},[j,G]),_.useImperativeHandle(D,()=>ie),CO((ie||te)&&Z&&V!=="touch",F);const ce=_O({anchor:s,floatingRootContext:L,positionMethod:i,mounted:G,side:f,sideOffset:h,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:v,collisionPadding:b,sticky:S,disableAnchorTracking:w??ie,collisionAvoidance:R,keepMounted:!0}),Se=ie?"none":ce.side,ge=ie?eK:ce.positionerStyles,$e=_.useMemo(()=>{const xe={};return Z||(xe.pointerEvents="none"),{role:"presentation",hidden:!G,style:{...ge,...xe}}},[Z,G,ge]),Ee={open:Z,side:Se,align:ce.align,anchorHidden:ce.anchorHidden},re=Oe(xe=>{j.set("positionerElement",xe)}),he=Mt("div",t,{ref:[n,re],state:Ee,stateAttributesMapping:Qc,props:[$e,xp(M),k]}),oe=_.useRef(0),_e=Oe(xe=>{if(xe.size===0&&oe.current===0||A.current.length===0)return;const ve=oe.current;if(oe.current=xe.size,xe.size===ve)return;const ke=Vt(Jo);if(ve!==0&&!j.state.multiple&&P!==null&&Ay(A.current,P,H)===-1){const we=z.current,Qe=we!=null&&Ay(A.current,we,H)!==-1?we:null;q(Qe,ke),Qe===null&&(j.set("selectedIndex",null),N.current=null)}if(ve!==0&&j.state.multiple&&Array.isArray(P)){const Le=qe=>Ay(A.current,qe,H)!==-1,we=P.filter(qe=>Le(qe));(we.length!==P.length||we.some(qe=>!jG(P,qe,H)))&&(q(we,ke),we.length===0&&(j.set("selectedIndex",null),N.current=null))}if(Z&&ie){j.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Le={height:""};Hh(U,Le),Hh(X.current,Le)}}),ye=_.useMemo(()=>({...ce,side:Se,alignItemWithTriggerActive:ie,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:K,scrollDownArrowRef:W}),[ce,Se,ie,le]);return p.jsx(jO,{elementsRef:C,labelsRef:I,onMapChange:_e,children:p.jsxs(OO.Provider,{value:ye,children:[G&&te&&p.jsx(AO,{inert:ex(!Z),cutout:F}),he]})})});function kO(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Ld="base-ui-disable-scrollbar",ER={className:Ld,getElement(e){return p.jsx("style",{nonce:e,href:Ld,precedence:"base-ui:low",children:`.${Ld}{scrollbar-width:none}.${Ld}::-webkit-scrollbar{display:none}`})}},nK=_.createContext(void 0);function MO(e){return _.useContext(nK)}const gc="ArrowUp",qi="ArrowDown",wu="ArrowLeft",yc="ArrowRight",Gu="Home",Ku="End",IO=new Set([wu,yc]),rK=new Set([wu,yc,Gu,Ku]),PO=new Set([gc,qi]),sK=new Set([gc,qi,Gu,Ku]),zO=new Set([...IO,...PO]),oK=new Set([...zO,Gu,Ku]),DO=new Set([gc,qi,wu,yc,Gu,Ku]),iK="Shift",aK="Control",cK="Alt",lK="Meta",uK=new Set([iK,aK,cK,lK]);function fK(e){return qt(e)&&e.tagName==="INPUT"}function TR(e){return!!(fK(e)&&e.selectionStart!=null||qt(e)&&e.tagName==="TEXTAREA")}function RR(e,t,n,s){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop;const l=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(l&&s!=="vertical"){const d=CR(e,t,"left"),h=Ud(e),g=Ud(t);n==="ltr"&&(d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-h.scrollPaddingRight?i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+h.scrollPaddingRight:d-g.scrollMarginLeft<e.scrollLeft+h.scrollPaddingLeft&&(i=d-g.scrollMarginLeft-h.scrollPaddingLeft)),n==="rtl"&&(d-g.scrollMarginRight<e.scrollLeft+h.scrollPaddingLeft?i=d-g.scrollMarginLeft-h.scrollPaddingLeft:d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-h.scrollPaddingRight&&(i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+h.scrollPaddingRight))}if(f&&s!=="horizontal"){const d=CR(e,t,"top"),h=Ud(e),g=Ud(t);d-g.scrollMarginTop<e.scrollTop+h.scrollPaddingTop?a=d-g.scrollMarginTop-h.scrollPaddingTop:d+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-h.scrollPaddingBottom&&(a=d+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+h.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function CR(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[s],t.offsetParent!==e);)t=t.offsetParent;return i}function Ud(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function ky(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const dK=_.createContext(void 0),hK={disableStyleElements:!1};function pK(){return _.useContext(dK)??hK}const Di=1,mK={...Qc,...ua},gK=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:h,setOpen:g,valueRef:v,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:R}=Vu(),{side:k,align:j,alignItemWithTriggerActive:C,setControlledAlignItemWithTrigger:I,scrollDownArrowRef:D,scrollUpArrowRef:N}=WG(),A=MO()!=null,z=RO(),{nonce:X,disableStyleElements:q}=pK(),L=ts(),Z=it(f,ot.id),G=it(f,ot.open),te=it(f,ot.mounted),P=it(f,ot.popupProps),V=it(f,ot.transitionStatus),U=it(f,ot.triggerElement),F=it(f,ot.positionerElement),H=it(f,ot.listElement),M=_.useRef(0),K=_.useRef(!1),W=_.useRef(0),Y=_.useRef(!1),le=_.useRef({}),ie=Zb(),ce=Oe(Ee=>{if(!F||!d.current||!Y.current)return;if(K.current||!C){w();return}const re=F.style.top==="0px",he=F.style.bottom==="0px",oe=F.getBoundingClientRect().height,_e=Tt(F),ye=getComputedStyle(F),xe=parseFloat(ye.marginTop),ve=parseFloat(ye.marginBottom),ke=NR(getComputedStyle(d.current)),Le=Math.min(_e.documentElement.clientHeight-xe-ve,ke),we=Ee.scrollTop,qe=jR(Ee);let Qe=0,Be=null,We=!1,Ve=!1;const pe=He=>{F.style.height=`${He}px`},Te=(He,ht)=>{const lt=ky(He,0,Le-oe);lt>0&&pe(oe+lt),Ee.scrollTop=ht,Le-(oe+lt)<=Di&&(K.current=!0),w()};if(re){const He=qe-we,ht=oe+He,lt=Math.min(ht,Le);if(Qe=lt,He<=Di){Te(He,qe);return}Le-lt>Di?Ve=!0:We=!0}else if(he){const He=we,ht=oe+He,lt=Math.min(ht,Le),yr=ht-Le;if(Qe=lt,He<=Di){Te(He,0);return}Le-lt>Di?Be=0:(We=!0,we<qe&&(Be=we-(He-yr)))}if(Qe=Math.ceil(Qe),Qe!==0&&pe(Qe),Ve||Be!=null){const He=jR(Ee),ht=Ve?He:ky(Be,0,He);Math.abs(Ee.scrollTop-ht)>Di&&(Ee.scrollTop=ht)}(We||Qe>=Le-Di)&&(K.current=!0),w()});_.useImperativeHandle(T,()=>ce,[ce]),fa({open:G,ref:d,onComplete(){G&&h?.(!0)}});const Se={open:G,transitionStatus:V,side:k,align:j};De(()=>{!F||!d.current||Object.keys(le.current).length||(le.current={top:F.style.top||"0",left:F.style.left||"0",right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[d,F]),De(()=>{G||C||(Y.current=!1,K.current=!1,M.current=0,W.current=0,Hh(F,le.current))},[G,C,F,d]),De(()=>{const Ee=d.current;if(!(!G||!U||!F||!Ee||f.state.transitionStatus==="ending")){if(!C){Y.current=!0,ie.request(w),Ee.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=yK(Ee);Ee.style.removeProperty("--transform-origin");try{const he=getComputedStyle(F),oe=getComputedStyle(Ee),_e=Tt(U),ye=an(F),xe=U.getBoundingClientRect(),ve=F.getBoundingClientRect(),ke=xe.left,Le=xe.height,we=H||Ee,qe=we.scrollHeight,Qe=parseFloat(oe.borderBottomWidth),Be=parseFloat(he.marginTop)||10,We=parseFloat(he.marginBottom)||10,Ve=parseFloat(he.minHeight)||100,pe=NR(oe),Te=5,He=5,ht=20,lt=_e.documentElement.clientHeight-Be-We,yr=_e.documentElement.clientWidth,vr=lt-xe.bottom+Le,Zt=b.current,ut=v.current;let vt,st=0,Yt=0;if(Zt&&ut){const Xn=ut.getBoundingClientRect();vt=Zt.getBoundingClientRect();const is=Xn.left-ke,oo=vt.left-ve.left,io=Xn.top-xe.top+Xn.height/2,Qn=vt.top-ve.top+vt.height/2;st=is-oo,Yt=Qn-io}const pn=vr+Yt+We+Qe;let jt=Math.min(lt,pn);const En=lt-Be-We,Yn=pn-jt,Cn=Math.max(Te,ke+st),ss=yr-He,os=Math.max(0,Cn+ve.width-ss);F.style.left=`${Cn-os}px`,F.style.height=`${jt}px`,F.style.maxHeight="auto",F.style.marginTop=`${Be}px`,F.style.marginBottom=`${We}px`,Ee.style.height="100%";const pa=we.scrollHeight-we.clientHeight,gi=Yn>=pa;gi&&(jt=Math.min(lt,ve.height)-(Yn-pa));const yi=xe.top<ht||xe.bottom>lt-ht||jt<Math.min(qe,Ve),xs=(ye.visualViewport?.scale??1)!==1&&qb;if(yi||xs){Y.current=!0,Hh(F,le.current),ii.flushSync(()=>I(!1));return}if(gi){const Xn=Math.max(0,lt-pn);F.style.top=ve.height>=En?"0":`${Xn}px`,F.style.height=`${jt}px`,we.scrollTop=we.scrollHeight-we.clientHeight,M.current=Math.max(Ve,jt)}else F.style.bottom="0",M.current=Math.max(Ve,jt),we.scrollTop=Yn;if(vt){const Xn=ve.top,is=ve.height,oo=vt.top+vt.height/2,io=is>0?(oo-Xn)/is*100:50,Qn=ky(io,0,100);Ee.style.setProperty("--transform-origin",`50% ${Qn}%`)}(M.current===lt||jt>=pe)&&(K.current=!0),w(),setTimeout(()=>{Y.current=!0})}finally{re()}})}},[f,G,F,U,v,b,d,w,C,I,ie,D,N,H]),_.useEffect(()=>{if(!C||!F||!G)return;const Ee=an(F);function re(he){g(!1,Vt(H9,he))}return Ee.addEventListener("resize",re),()=>{Ee.removeEventListener("resize",re)}},[g,C,F,G]);const ge={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Z}-list`},onKeyDown(Ee){x.current=!0,A&&DO.has(Ee.key)&&Ee.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(Ee){if(!R||kO(Ee)||Ee.pointerType==="touch")return;const re=Ee.currentTarget;L.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(Ee){H||ce(Ee.currentTarget)},...C&&{style:H?{height:"100%"}:JG}},$e=Mt("div",t,{ref:[n,d],state:Se,stateAttributesMapping:mK,props:[P,ge,xp(V),{className:!H&&C?ER.className:void 0},l]});return p.jsxs(_.Fragment,{children:[!q&&ER.getElement(X),p.jsx(cO,{context:z,modal:!1,disabled:!te,returnFocus:a,restoreFocus:!0,children:$e})]})});function NR(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function jR(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const OR=[["transform","none"],["scale","1"],["translate","0 0"]];function yK(e){const{style:t}=e,n={};for(const[s,i]of OR)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of OR){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let LO=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function tx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:h,labelsRef:g,nextIndexRef:v}=ZG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===LO.GuessFromOrder?()=>{if(b.current===-1){const R=v.current;v.current+=1,b.current=R}return b.current}:-1)),w=_.useRef(null),T=_.useCallback(R=>{if(w.current=R,x!==-1&&R!==null&&(h.current[x]=R,g)){const k=t!==void 0;g.current[x]=k?t:s?.current?.textContent??R.textContent}},[x,h,g,t,s]);return De(()=>{if(a!=null)return;const R=w.current;if(R)return l(R,n),()=>{f(R)}},[a,l,f,n]),De(()=>{if(a==null)return d(R=>{const k=w.current?R.get(w.current)?.index:null;k!=null&&S(k)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const vK=_.createContext(void 0),bK=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...h}=t,g=_.useRef(null),v=tx({label:l,textRef:g,indexGuessBehavior:LO.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:R,valuesRef:k,keyboardActiveRef:j,multiple:C,highlightItemOnHover:I}=Vu(),D=ts(),N=it(b,ot.isActive,v.index),A=it(b,ot.isSelected,v.index,a),z=it(b,ot.isSelectedByFocus,v.index),X=it(b,ot.isItemEqualToValue),q=v.index,L=q!==-1,Z=_.useRef(null),G=Go(q);De(()=>{if(!L)return;const ie=k.current;return ie[q]=a,()=>{delete ie[q]}},[L,q,a,k]),De(()=>{if(!L)return;const ie=b.state.value;let ce=ie;C&&Array.isArray(ie)&&ie.length>0&&(ce=ie[ie.length-1]),ce!==void 0&&Mc(a,ce,X)&&b.set("selectedIndex",q)},[L,q,C,X,b,a]);const te={disabled:f,selected:A,highlighted:N},P=x({active:N,selected:A});P.onFocus=void 0,P.id=void 0;const V=_.useRef(null),U=_.useRef("mouse"),F=_.useRef(!1),{getButtonProps:H,buttonRef:M}=Zc({disabled:f,focusableWhenDisabled:!0,native:d});function K(ie){const ce=b.state.value;if(C){const Se=Array.isArray(ce)?ce:[],ge=A?OG(Se,a,X):[...Se,a];w(ge,Vt(xy,ie))}else w(a,Vt(xy,ie)),S(!1,Vt(xy,ie))}const W={role:"option","aria-selected":A,tabIndex:N?0:-1,onFocus(){b.set("activeIndex",q)},onMouseEnter(){!j.current&&b.state.selectedIndex===null&&I&&b.set("activeIndex",q)},onMouseMove(){I&&b.set("activeIndex",q)},onMouseLeave(ie){!I||j.current||kO(ie)||D.start(0,()=>{b.state.activeIndex===q&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ie){V.current=ie.key,b.set("activeIndex",q)},onClick(ie){F.current=!1,!(ie.type==="keydown"&&V.current===null)&&(f||V.current===" "&&R.current||U.current!=="touch"&&!N||(V.current=null,K(ie.nativeEvent)))},onPointerEnter(ie){U.current=ie.pointerType},onPointerDown(ie){U.current=ie.pointerType,F.current=!0},onMouseUp(ie){if(f)return;if(F.current){F.current=!1;return}const ce=!T.current.allowSelectedMouseUp&&A,Se=!T.current.allowUnselectedMouseUp&&!A;ce||Se||U.current!=="touch"&&!N||K(ie.nativeEvent)}},Y=Mt("div",t,{ref:[M,n,v.ref,Z],state:te,props:[P,W,h,H]}),le=_.useMemo(()=>({selected:A,indexRef:G,textRef:g,selectedByFocus:z,hasRegistered:L}),[A,G,g,z,L]);return p.jsx(vK.Provider,{value:le,children:Y})})),xK=_.forwardRef(({className:e,children:t,...n},s)=>p.jsx(UG,{ref:s,className:me("inline-flex items-center justify-between bg-surface border border-border rounded-md px-3 py-1.5 font-mono text-[12px] text-foreground cursor-pointer hover:border-border-bright transition",e),...n,children:t}));xK.displayName="SelectTrigger";const SK=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>p.jsx(BG,{...t,children:p.jsx(tK,{...n,children:p.jsx(gK,{ref:i,className:me("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));SK.displayName="SelectContent";const _K=_.forwardRef(({className:e,...t},n)=>p.jsx(bK,{ref:n,className:me("font-mono text-[11px] px-3 py-1.5 text-neutral-400 cursor-pointer hover:bg-white/[0.03] hover:text-white data-[highlighted]:bg-white/[0.03] data-[highlighted]:text-white outline-none",e),...t}));_K.displayName="SelectItem";const wK=_.forwardRef(({className:e,...t},n)=>p.jsx("textarea",{ref:n,className:me("bg-surface border border-border rounded-md px-3 py-2 font-mono text-[12px] text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600 resize-none min-h-[80px]",e),...t}));wK.displayName="Textarea";const UO=_.createContext(void 0);function EK(e=!0){const t=_.useContext(UO);if(t===void 0&&!e)throw new Error(hn(7));return t}function $O(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=pj(),{ref:i,index:a}=tx(e),l=n===a,f=_.useRef(null),d=to(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const v=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!v&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function TK(e){const{render:t,className:n,state:s=rn,props:i=xu,refs:a=xu,metadata:l,stateAttributesMapping:f,tag:d="div",...h}=e,{compositeProps:g,compositeRef:v}=$O({metadata:l});return Mt(d,e,{state:s,ref:[...a,v],props:[g,...i,h],stateAttributesMapping:f})}const RK=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:h,type:g,value:v,nativeButton:b=!0,...x}=t,S=dr(v||void 0),w=EK(),T=w?.value??[],R=w?void 0:i,k=(a||w?.disabled)??!1,[j,C]=ip({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:R,name:"Toggle",state:"pressed"}),I=Oe((L,Z)=>{S&&w?.setGroupValue?.(S,L,Z),f?.(L,Z)}),{getButtonProps:D,buttonRef:N}=Zc({disabled:k,native:b}),A={disabled:k,pressed:j},z=[N,n],X=[{"aria-pressed":j,onClick(L){const Z=!j,G=Vt(Jo,L.nativeEvent);I(Z,G),!G.isCanceled&&C(Z)}},x,D],q=Mt("button",t,{enabled:!w,state:A,ref:z,props:X});return w?p.jsx(TK,{tag:"button",render:h,className:s,state:A,refs:z,props:X}):q}),Or=_.forwardRef(({className:e,...t},n)=>p.jsx(RK,{ref:n,className:me("font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 cursor-pointer transition-all hover:text-neutral-300 data-[pressed]:text-white data-[pressed]:border-border-bright data-[pressed]:bg-white/[0.03]",e),...t}));Or.displayName="Toggle";function CK(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const BO="data-composite-item-active",NK=[];function jK(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:h,enableHomeAndEndKeys:g=!1,stopEventPropagation:v=!1,disabledIndices:b,modifierKeys:x=NK}=e,[S,w]=_.useState(0),T=n>1,R=_.useRef(null),k=to(R,h),j=_.useRef([]),C=_.useRef(!1),I=f??S,D=Oe((z,X=!1)=>{if((d??w)(z),X){const q=j.current[z];RR(R.current,q,l,a)}}),N=Oe(z=>{if(z.size===0||C.current)return;C.current=!0;const X=Array.from(z.keys()),q=X.find(Z=>Z?.hasAttribute(BO))??null,L=q?X.indexOf(q):-1;L!==-1&&D(L),RR(R.current,q,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:k,onFocus(z){!R.current||!TR(z.target)||z.target.setSelectionRange(0,z.target.value.length??0)},onKeyDown(z){const X=g?oK:zO;if(!X.has(z.key)||OK(z,x)||!R.current)return;const L=l==="rtl",Z=L?wu:yc,G={horizontal:Z,vertical:qi,both:Z}[a],te=L?yc:wu,P={horizontal:te,vertical:gc,both:te}[a];if(TR(z.target)&&!CK(z.target)){const W=z.target.selectionStart,Y=z.target.selectionEnd,le=z.target.value??"";if(W==null||z.shiftKey||W!==Y||z.key!==P&&W<le.length||z.key!==G&&W>0)return}let V=I;const U=qV(j,b),F=VV(j,b);if(T){const W=t||Array.from({length:j.current.length},()=>({width:1,height:1})),Y=KV(W,n,i),le=Y.findIndex(ce=>ce!=null&&!au(j,ce,b)),ie=Y.reduce((ce,Se,ge)=>Se!=null&&!au(j,Se,b)?ge:ce,-1);V=Y[GV({current:Y.map(ce=>ce?j.current[ce]:null)},{event:z,orientation:a,loopFocus:s,cols:n,disabledIndices:YV([...b||j.current.map((ce,Se)=>au(j,Se)?Se:void 0),void 0],Y),minIndex:le,maxIndex:ie,prevIndex:ZV(I>F?U:I,W,Y,n,z.key===qi?"bl":z.key===yc?"tr":"tl"),rtl:L})]}const H={horizontal:[Z],vertical:[qi],both:[Z,qi]}[a],M={horizontal:[te],vertical:[gc],both:[te,gc]}[a],K=T?X:{horizontal:g?rK:IO,vertical:g?sK:PO,both:X}[a];g&&(z.key===Gu?V=U:z.key===Ku&&(V=F)),V===I&&(H.includes(z.key)||M.includes(z.key))&&(s&&V===F&&H.includes(z.key)?V=U:s&&V===U&&M.includes(z.key)?V=F:V=ir(j,{startingIndex:V,decrement:M.includes(z.key),disabledIndices:b})),V!==I&&!eh(j,V)&&(v&&z.stopPropagation(),K.has(z.key)&&z.preventDefault(),D(V,!0),queueMicrotask(()=>{j.current[V]?.focus()}))}}),[n,i,l,b,j,g,I,T,t,s,k,x,D,a,v]);return _.useMemo(()=>({props:A,highlightedIndex:I,onHighlightedIndexChange:D,elementsRef:j,disabledIndices:b,onMapChange:N,relayKeyboardEvent:A.onKeyDown}),[A,I,D,j,b,N])}function OK(e,t){for(const n of uK.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function FO(e){const{render:t,className:n,refs:s=xu,props:i=xu,state:a=rn,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:h,dense:g,itemSizes:v,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:R,disabledIndices:k,modifierKeys:j,highlightItemOnHover:C=!1,tag:I="div",...D}=e,N=xO(),{props:A,highlightedIndex:z,onHighlightedIndexChange:X,elementsRef:q,onMapChange:L,relayKeyboardEvent:Z}=jK({itemSizes:v,cols:x,loopFocus:b,dense:g,orientation:h,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:R,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:N,disabledIndices:k,modifierKeys:j}),G=Mt(I,e,{state:a,ref:s,props:[A,...i,D],stateAttributesMapping:l}),te=_.useMemo(()=>({highlightedIndex:z,onHighlightedIndexChange:X,highlightItemOnHover:C,relayKeyboardEvent:Z}),[z,X,C,Z]);return p.jsx(hj.Provider,{value:te,children:p.jsx(jO,{elementsRef:q,onMapChange:P=>{w?.(P),L(P)},children:G})})}let AK=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const AR={multiple(e){return e?{[AK.multiple]:""}:null}},kK=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:h,className:g,render:v,...b}=t,x=MO(),S=_.useMemo(()=>{if(h===void 0)return s??[]},[h,s]),w=_.useMemo(()=>h!==void 0||s!==void 0,[h,s]),T=(x?.disabled??!1)||i,[R,k]=ip({controlled:h,default:S,name:"ToggleGroup",state:"value"}),j=Oe((A,z,X)=>{let q;if(d?(q=R.slice(),z?q.push(A):q.splice(R.indexOf(A),1)):q=z?[A]:[],Array.isArray(q)){if(l?.(q,X),X.isCanceled)return;k(q)}}),C={disabled:T,multiple:d,orientation:f},I=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:j,value:R,isValueInitialized:w}),[T,f,j,R,w]),D={role:"group"},N=Mt("div",t,{enabled:!!x,state:C,ref:n,props:[D,b],stateAttributesMapping:AR});return p.jsx(UO.Provider,{value:I,children:x?N:p.jsx(FO,{render:v,className:g,state:C,refs:[n],props:[D,b],stateAttributesMapping:AR,loopFocus:a,enableHomeAndEndKeys:!0})})}),sh=_.forwardRef(({className:e,...t},n)=>p.jsx(kK,{ref:n,className:me("flex items-center gap-0.5",e),...t}));sh.displayName="ToggleGroup";function HO({active:e,onClick:t,children:n,className:s}){return p.jsxs("button",{type:"button",onClick:t,className:me("font-mono text-[10px] tracking-[1.5px] uppercase bg-transparent border-none px-3.5 py-1 cursor-pointer relative transition-colors",e?"text-white":"text-neutral-500 hover:text-neutral-300",s),children:[n,e&&p.jsx("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-4 h-0.5 bg-flow rounded-sm shadow-[0_0_8px_rgba(59,130,246,0.5)]"})]})}function MK({items:e,activeId:t,onItemChange:n,renderItem:s,className:i}){return p.jsx("div",{className:me("flex items-center gap-0.5",i),children:e.map(a=>{const l=a.id===t,f=()=>n?.(a.id);return s?p.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):p.jsx(HO,{active:l,onClick:f,children:a.label},a.id)})})}const IK=li("rounded-full inline-block flex-shrink-0",{variants:{color:{healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",flow:"bg-flow",relay:"bg-relay",encrypt:"bg-encrypt",muted:"bg-neutral-500"},size:{sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},glow:{true:"",false:""}},defaultVariants:{color:"healthy",size:"sm",glow:!1}}),PK={healthy:"0 0 6px #22c55e",syncing:"0 0 6px #f59e0b",offline:"0 0 6px #ef4444",flow:"0 0 6px #3b82f6",relay:"0 0 6px #8b5cf6",encrypt:"0 0 6px #f472b6",muted:"none"};function zK({color:e,size:t,glow:n,pulse:s,className:i}){return p.jsx("span",{className:me(IK({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:PK[e??"healthy"]}:void 0})}const DK="0.0.4-26",LK={version:DK},UK=LK.version;function $K({label:e,className:t}){return p.jsxs("div",{className:me("flex items-center gap-3",t),children:[p.jsx(zK,{color:"healthy",size:"md",glow:!0}),p.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&p.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),p.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",UK]})]})}function BK({brand:e,center:t,right:n,className:s}){return p.jsxs("nav",{className:me("fixed top-0 left-0 right-0 z-100 h-[42px] border-b border-border bg-surface/88 backdrop-blur-lg flex items-center justify-between px-5",s),children:[p.jsx("div",{className:"flex items-center gap-3",children:e}),p.jsx("div",{className:"flex items-center gap-0.5",children:t}),p.jsx("div",{className:"flex items-center gap-2",children:n})]})}const FK=li("border rounded-lg p-3 font-mono text-[11px]",{variants:{variant:{default:"border-border bg-panel",destructive:"border-offline/20 bg-offline/5 text-offline"}},defaultVariants:{variant:"default"}}),kn=_.forwardRef(({className:e,variant:t,...n},s)=>p.jsx("div",{ref:s,role:"alert",className:me(FK({variant:t,className:e})),...n}));kn.displayName="Alert";const Zu=_.forwardRef(({className:e,...t},n)=>p.jsx("h5",{ref:n,className:me("font-medium text-white mb-1",e),...t}));Zu.displayName="AlertTitle";const Mn=_.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,className:me("text-neutral-400",e),...t}));Mn.displayName="AlertDescription";const qO=_.createContext(void 0);function Wc(e){const t=_.useContext(qO);if(e===!1&&t===void 0)throw new Error(hn(27));return t}const HK={...Qc,...ua},nx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=Wc(),d=f.useState("open"),h=f.useState("nested"),g=f.useState("mounted"),v=f.useState("transitionStatus");return Mt("div",t,{state:{open:d,transitionStatus:v},ref:[f.context.backdropRef,n],stateAttributesMapping:HK,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!h})}),VO=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=Wc(),d=dr(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),Mt("p",t,{ref:n,props:[{id:d},l]})});let qK=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),VK=(function(e){return e[e.open=Hi.open]="open",e[e.closed=Hi.closed]="closed",e[e.startingStyle=Hi.startingStyle]="startingStyle",e[e.endingStyle=Hi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const GO=_.createContext(void 0);function GK(){const e=_.useContext(GO);if(e===void 0)throw new Error(hn(26));return e}const KK={...Qc,...ua,nestedDialogOpen(e){return e?{[VK.nestedDialogOpen]:""}:null}},KO=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=Wc(),h=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),v=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),T=d.useState("nestedOpenDialogCount"),R=d.useState("open"),k=d.useState("openMethod"),j=d.useState("titleElementId"),C=d.useState("transitionStatus"),I=d.useState("role");GK(),fa({open:R,ref:d.context.popupRef,onComplete(){R&&d.context.onOpenChangeComplete?.(!0)}});function D(q){return q==="touch"?d.context.popupRef.current:!0}const N=a===void 0?D:a,A=T>0,X=Mt("div",t,{state:{open:R,nested:w,transitionStatus:C,nestedDialogOpen:A},props:[b,{"aria-labelledby":j??void 0,"aria-describedby":h??void 0,role:I,tabIndex:-1,hidden:!S,onKeyDown(q){DO.has(q.key)&&q.stopPropagation()},style:{[qK.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:KK});return p.jsx(cO,{context:v,openInteractionType:k,disabled:!S,closeOnFocusOut:!g,initialFocus:N,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:X})}),ZO=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=Wc(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?p.jsx(GO.Provider,{value:s,children:p.jsxs(aO,{ref:n,...i,children:[l&&f===!0&&p.jsx(AO,{ref:a.context.internalBackdropRef,inert:ex(!d)}),t.children]})}):null});function ZK(e){const{store:t,parentContext:n,actionsRef:s}=e,i=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:h,reset:g}=PG(i);T7(t);const{forceUnmount:v}=R7(i,t,()=>{g()}),b=Oe(X=>{const q=Vt(X);return q.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},q}),x=_.useCallback(()=>{t.setOpen(!1,b(F9))},[t,b]);_.useImperativeHandle(s,()=>({unmount:v,close:x}),[v,x]);const S=k7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),R=w===0,k=B7(S),j=h7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(X){if(!t.context.outsidePressEnabledRef.current||"button"in X&&X.button!==0||"touches"in X&&X.touches.length!==1)return!1;const q=Mr(X);if(R&&!a){const L=q;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===L||t.context.backdropRef.current===L||Ot(L,f)&&!L?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:R});CO(i&&l===!0,f);const{getReferenceProps:C,getFloatingProps:I,getTriggerProps:D}=U7([k,j]);t.useContextCallback("onNestedDialogOpen",X=>{T(X+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),_.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,w]);const N=_.useMemo(()=>C(h),[C,h]),A=_.useMemo(()=>D(h),[D,h]),z=_.useMemo(()=>I(),[I]);t.useSyncedValues({openMethod:d,activeTriggerProps:N,inactiveTriggerProps:A,popupProps:z,floatingRootContext:S,nestedOpenDialogCount:w})}const YK={...j7,modal:Me(e=>e.modal),nested:Me(e=>e.nested),nestedOpenDialogCount:Me(e=>e.nestedOpenDialogCount),disablePointerDismissal:Me(e=>e.disablePointerDismissal),openMethod:Me(e=>e.openMethod),descriptionElementId:Me(e=>e.descriptionElementId),titleElementId:Me(e=>e.titleElementId),viewportElement:Me(e=>e.viewportElement),role:Me(e=>e.role)};class XK extends yO{constructor(t){super(QK(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Wb,onOpenChange:void 0,onOpenChangeComplete:void 0},YK)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const i={open:t},a=n.trigger?.id??null;(a||t)&&(i.activeTriggerId=a,i.activeTriggerElement=n.trigger??null),this.update(i)}}function QK(e={}){return{...N7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function WK(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:h,triggerId:g,defaultTriggerId:v=null}=e,b=Wc(!0),x=!!b,S=zn(()=>h?.store??new XK({open:s,openProp:n,activeTriggerId:v,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;mV(()=>{n===void 0&&S.state.open===!1&&s===!0&&S.update({open:!0,activeTriggerId:v})}),S.useControlledProp("openProp",n),S.useControlledProp("triggerIdProp",g),S.useSyncedValues({disablePointerDismissal:l,nested:x,modal:f}),S.useContextCallback("onOpenChange",i),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("payload");ZK({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return p.jsx(qO.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const YO=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=Wc(),d=dr(a);return f.useSyncedValueWithCleanup("titleElementId",d),Mt("h2",t,{ref:n,props:[{id:d},l]})}),es=WK,JK=_.forwardRef(({className:e,...t},n)=>p.jsx(nx,{ref:n,className:me("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));JK.displayName="DialogOverlay";const Ir=_.forwardRef(({className:e,children:t,...n},s)=>p.jsxs(ZO,{children:[p.jsx(nx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),p.jsx(KO,{ref:s,className:me("fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-panel border border-border rounded-lg shadow-lg max-w-lg w-full p-0",e),...n,children:t})]}));Ir.displayName="DialogContent";const Pr=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-5 py-3 border-b border-border",e),...t}));Pr.displayName="DialogHeader";const An=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));An.displayName="DialogFooter";const zr=_.forwardRef(({className:e,...t},n)=>p.jsx(YO,{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));zr.displayName="DialogTitle";const eZ=_.forwardRef(({className:e,...t},n)=>p.jsx(VO,{ref:n,className:me("text-sm text-neutral-400",e),...t}));eZ.displayName="DialogDescription";const rx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>p.jsxs("div",{ref:l,className:me("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...a,children:[p.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s," items · Page ",t," of ",n]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ie,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),p.jsx(Ie,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));rx.displayName="Pagination";const tZ=_.forwardRef(({className:e,orientation:t="horizontal",...n},s)=>p.jsx("hr",{ref:s,"aria-orientation":t==="vertical"?"vertical":void 0,className:me("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));tZ.displayName="Separator";const nZ=li("fixed z-50 bg-panel shadow-lg overflow-auto",{variants:{side:{top:"top-0 left-0 w-full h-[400px] border-b border-border",right:"right-0 top-0 h-full w-[400px] border-l border-border",bottom:"bottom-0 left-0 w-full h-[400px] border-t border-border",left:"left-0 top-0 h-full w-[400px] border-r border-border"}},defaultVariants:{side:"right"}}),rZ=_.forwardRef(({className:e,side:t,children:n,...s},i)=>p.jsxs(ZO,{children:[p.jsx(nx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),p.jsx(KO,{ref:i,className:me(nZ({side:t,className:e})),...s,children:n})]}));rZ.displayName="SheetContent";const sZ=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-5 py-3 border-b border-border",e),...t}));sZ.displayName="SheetHeader";const oZ=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));oZ.displayName="SheetFooter";const iZ=_.forwardRef(({className:e,...t},n)=>p.jsx(YO,{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));iZ.displayName="SheetTitle";const aZ=_.forwardRef(({className:e,...t},n)=>p.jsx(VO,{ref:n,className:me("text-sm text-neutral-400",e),...t}));aZ.displayName="SheetDescription";const cZ=_.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:me("rounded-md bg-neutral-800 animate-pulse",e),...t}));cZ.displayName="Skeleton";const sx=_.forwardRef(({className:e,...t},n)=>p.jsx("table",{ref:n,className:me("w-full",e),...t}));sx.displayName="Table";const ox=_.forwardRef(({className:e,...t},n)=>p.jsx("thead",{ref:n,className:me(e),...t}));ox.displayName="TableHeader";const ix=_.forwardRef(({className:e,...t},n)=>p.jsx("tbody",{ref:n,className:me(e),...t}));ix.displayName="TableBody";const Eu=_.forwardRef(({className:e,...t},n)=>p.jsx("tr",{ref:n,className:me("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",e),...t}));Eu.displayName="TableRow";const _n=_.forwardRef(({className:e,...t},n)=>p.jsx("th",{ref:n,className:me("font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left",e),...t}));_n.displayName="TableHead";const wn=_.forwardRef(({className:e,...t},n)=>p.jsx("td",{ref:n,className:me("whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));wn.displayName="TableCell";const lZ=_.createContext(void 0);function ax(){const e=_.useContext(lZ);if(e===void 0)throw new Error(hn(64));return e}let uZ=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const XO={tabActivationDirection:e=>({[uZ.activationDirection]:e})},QO=_.createContext(void 0);function fZ(){const e=_.useContext(QO);if(e===void 0)throw new Error(hn(65));return e}const dZ=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...h}=t,{value:g,getTabPanelIdByValue:v,orientation:b}=ax(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:R}=fZ(),k=dr(f),j=_.useMemo(()=>({disabled:i,id:k,value:l}),[i,k,l]),{compositeProps:C,compositeRef:I,index:D}=$O({metadata:j}),N=l===g,A=_.useRef(!1);De(()=>{if(A.current){A.current=!1;return}if(!(N&&D>-1&&S!==D))return;const F=R;if(F!=null){const H=Po(Tt(F));if(H&&Ot(F,H))return}i||T(D)},[N,D,S,T,i,R]);const{getButtonProps:z,buttonRef:X}=Zc({disabled:i,native:d,focusableWhenDisabled:!0}),q=v(l),L=_.useRef(!1),Z=_.useRef(!1);function G(F){N||i||w(l,Vt(Jo,F.nativeEvent,void 0,{activationDirection:"none"}))}function te(F){N||(D>-1&&!i&&T(D),!i&&x&&(!L.current||L.current&&Z.current)&&w(l,Vt(Jo,F.nativeEvent,void 0,{activationDirection:"none"})))}function P(F){if(N||i)return;L.current=!0;function H(){L.current=!1,Z.current=!1}(!F.button||F.button===0)&&(Z.current=!0,Tt(F.currentTarget).addEventListener("pointerup",H,{once:!0}))}return Mt("button",t,{state:{disabled:i,active:N,orientation:b},ref:[n,X,I],props:[C,{role:"tab","aria-controls":q,"aria-selected":N,id:k,onClick:G,onFocus:te,onPointerDown:P,[BO]:N?"":void 0,onKeyDownCapture(){A.current=!0}},h,z]})});let hZ=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const pZ={...XO,...ua},mZ=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:h,orientation:g,tabActivationDirection:v,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=ax(),S=dr(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:R}=tx({metadata:w}),k=i===d,{mounted:j,transitionStatus:C,setMounted:I}=bp(k),D=!j,N=h(i),A={hidden:D,orientation:g,tabActivationDirection:v,transitionStatus:C},z=_.useRef(null),X=Mt("div",t,{state:A,ref:[n,T,z],props:[{"aria-labelledby":N,hidden:D,id:S,role:"tabpanel",tabIndex:k?0:-1,inert:ex(!k),[hZ.index]:R},f],stateAttributesMapping:pZ});return fa({open:k,ref:z,onComplete(){k||I(!1)}}),De(()=>{if(!(D&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[D,l,i,S,b,x]),l||j?X:null}),gZ=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:h,orientation:g,value:v,setTabMap:b,tabActivationDirection:x}=ax(),[S,w]=_.useState(0),[T,R]=_.useState(null),k=yZ(v,g,T,d),j=Oe((N,A)=>{if(N!==v){const z=k(N);A.activationDirection=z,h(N,A)}}),C={orientation:g,tabActivationDirection:x},I={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},D=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:j,setHighlightedTabIndex:w,tabsListElement:T,value:v}),[s,S,j,w,T,v]);return p.jsx(QO.Provider,{value:D,children:p.jsx(FO,{render:l,className:i,state:C,refs:[n,R],props:[I,f],stateAttributesMapping:XO,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:xu})})});function kR(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),l=n-i,f=s-a;return{left:l,top:f}}function yZ(e,t,n,s){const[i,a]=_.useState(null);return De(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=kR(l,n);a(t==="horizontal"?f:d)},[t,s,n,e]),_.useCallback(l=>{if(l===e)return"none";if(l==null)return a(null),"none";if(l!=null&&n!=null){const f=s(l);if(f!=null){const{left:d,top:h}=kR(f,n);if(i==null)return a(t==="horizontal"?d:h),"none";if(t==="horizontal"){if(d<i)return a(d),"left";if(d>i)return a(d),"right"}else{if(h<i)return a(h),"up";if(h>i)return a(h),"down"}}}return"none"},[s,t,i,n,e])}const vZ=_.forwardRef(({className:e,...t},n)=>p.jsx(gZ,{ref:n,className:me("flex items-center gap-0.5",e),...t}));vZ.displayName="TabsList";const bZ=li("inline-flex items-center justify-center cursor-pointer transition-all outline-none",{variants:{variant:{default:"font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]",pills:"font-mono text-[10px] text-neutral-500 border border-transparent rounded-full px-3 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]"}},defaultVariants:{variant:"default"}}),xZ=_.forwardRef(({className:e,variant:t,...n},s)=>p.jsx(dZ,{ref:s,className:me(bZ({variant:t,className:e})),...n}));xZ.displayName="TabsTrigger";const SZ=_.forwardRef(({className:e,...t},n)=>p.jsx(mZ,{ref:n,className:me("outline-none",e),...t}));SZ.displayName="TabsContent";const WO=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const _Z=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const wZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const MR=e=>{const t=wZ(e);return t.charAt(0).toUpperCase()+t.slice(1)};var EZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const TZ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const RZ=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...EZ,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:WO("lucide",i),...!a&&!TZ(f)&&{"aria-hidden":"true"},...f},[...l.map(([h,g])=>_.createElement(h,g)),...Array.isArray(a)?a:[a]]));const CZ=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(RZ,{ref:a,iconNode:t,className:WO(`lucide-${_Z(MR(e))}`,`lucide-${e}`,s),...i}));return n.displayName=MR(e),n};const NZ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jZ=CZ("settings",NZ),OZ="console:instance-id";function It(){const[e,t]=ci(OZ,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const gr={stats:e=>["console","stats",e],timeseries:e=>["console","stats","timeseries",e],latency:e=>["console","stats","latency",e],commits:e=>["console","commits",e],commitDetail:(e,t,n)=>["console","commit-detail",e,t,n],timeline:e=>["console","timeline",e],clients:e=>["console","clients",e],eventDetail:(e,t,n)=>["console","event-detail",e,t,n],eventPayload:(e,t,n)=>["console","event-payload",e,t,n],handlers:e=>["console","handlers",e],prunePreview:e=>["console","prune","preview",e],operations:e=>["console","operations",e],apiKeys:e=>["console","api-keys",e]};function da(e,t){return e===0?!1:e??t}function Yu(e,t){return t?{...e,instanceId:t}:e}function ha(e){return encodeURIComponent(String(e))}function Kr(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function Xu(e={}){const t=Bt(),{instanceId:n}=It(),s=e.instanceId??n,i=Yu(e.partitionId?{partitionId:e.partitionId}:{},s);return mr({queryKey:gr.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Fu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:da(e.refetchIntervalMs,5e3)})}function AZ(e={},t={}){const n=Bt(),{config:s}=Kt(),{instanceId:i}=It(),a=e.instanceId??i;return mr({queryKey:gr.timeseries({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.interval&&l.set("interval",e.interval),e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/timeseries?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch timeseries stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:da(t.refetchIntervalMs,3e4)})}function kZ(e={},t={}){const n=Bt(),{config:s}=Kt(),{instanceId:i}=It(),a=e.instanceId??i;return mr({queryKey:gr.latency({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/latency?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch latency stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:da(t.refetchIntervalMs,3e4)})}function MZ(e={},t={}){const n=Bt(),{instanceId:s}=It(),i=e.instanceId??s,a=Yu({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return mr({queryKey:gr.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Fu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:da(t.refetchIntervalMs,1e4)})}function IZ(e,t={}){const n=Bt(),{config:s}=Kt(),{instanceId:i}=It(),a=t.instanceId??i;return mr({queryKey:gr.commitDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Commit sequence is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/commits/${ha(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch commit detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function PZ(e={},t={}){const n=Bt(),{instanceId:s}=It(),i=e.instanceId??s,a=Yu({limit:e.limit,offset:e.offset,partitionId:e.partitionId,view:e.view,eventType:e.eventType,actorId:e.actorId,clientId:e.clientId,requestId:e.requestId,traceId:e.traceId,table:e.table,outcome:e.outcome,search:e.search,from:e.from,to:e.to},i);return mr({queryKey:gr.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Fu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:da(t.refetchIntervalMs,1e4)})}function JO(e={},t={}){const n=Bt(),{instanceId:s}=It(),i=e.instanceId??s,a=Yu({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return mr({queryKey:gr.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Fu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:da(t.refetchIntervalMs,1e4)})}function zZ(e,t={}){const n=Bt(),{config:s}=Kt(),{instanceId:i}=It(),a=t.instanceId??i;return mr({queryKey:gr.eventDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${ha(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function DZ(e,t={}){const n=Bt(),{config:s}=Kt(),{instanceId:i}=It(),a=t.instanceId??i;return mr({queryKey:gr.eventPayload(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${ha(e)}/payload${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event payload");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function LZ(e={}){const t=Bt(),{config:n}=Kt(),{instanceId:s}=It(),i=e.instanceId??s;return mr({queryKey:gr.handlers(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Kr(n.serverUrl,"/console/handlers",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch handlers");return l.json()},enabled:!!t&&!!n})}function UZ(e={}){const t=Bt(),{config:n}=Kt(),{instanceId:s}=It(),i=e.instanceId??s;return mr({queryKey:gr.prunePreview(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Kr(n.serverUrl,"/console/prune/preview",a),{method:"POST",headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch prune preview");return l.json()},enabled:!!t&&!!n&&(e.enabled??!0)})}function $Z(e={},t={}){const n=Bt(),{instanceId:s}=It(),i=e.instanceId??s,a=Yu({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return mr({queryKey:gr.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Fu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:da(t.refetchIntervalMs,1e4)})}function BZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async({clientId:i,partitionId:a,instanceId:l})=>{if(!e||!t)throw new Error("Not connected");const f=l??n,d=new URLSearchParams;a&&d.set("partitionId",a),f&&d.set("instanceId",f);const h=await fetch(Kr(t.serverUrl,`/console/clients/${ha(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!h.ok)throw new Error("Failed to evict client");return h.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function FZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Kr(t.serverUrl,"/console/prune",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to prune");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","prune","preview"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function HZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Kr(t.serverUrl,"/console/compact",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to compact");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function qZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=i.instanceId??n,l=new URLSearchParams;a&&l.set("instanceId",a);const f=await fetch(Kr(t.serverUrl,"/console/notify-data-change",l),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify({tables:i.tables,partitionId:i.partitionId})});if(!f.ok)throw new Error("Failed to notify data change");return f.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function VZ(e={}){const t=Bt(),{config:n}=Kt(),{instanceId:s}=It(),i=e.instanceId??s;return mr({queryKey:gr.apiKeys({...e,instanceId:i}),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;e.limit!==void 0&&a.set("limit",String(e.limit)),e.offset!==void 0&&a.set("offset",String(e.offset)),e.type&&a.set("type",e.type),e.status&&a.set("status",e.status),e.expiresWithinDays!==void 0&&a.set("expiresWithinDays",String(e.expiresWithinDays)),i&&a.set("instanceId",i);const l=await fetch(Kr(n.serverUrl,"/console/api-keys",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch API keys");return l.json()},enabled:!!t&&!!n})}function GZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Kr(t.serverUrl,"/console/api-keys",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to create API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function KZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Kr(t.serverUrl,`/console/api-keys/${ha(i)}`,a),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to revoke API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function ZZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Kr(t.serverUrl,"/console/api-keys/bulk-revoke",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to bulk revoke API keys");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function YZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Kr(t.serverUrl,`/console/api-keys/${ha(i)}/rotate`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function XZ(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Kr(t.serverUrl,`/console/api-keys/${ha(i)}/rotate/stage`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to stage-rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}const QZ="console:partition-id";function Qu(){const[e,t]=ci(QZ,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const IR={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function Wu(){const[e,t]=ci("console:preferences",IR);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(IR)}}}const WZ=[{value:5,label:"5 seconds"},{value:10,label:"10 seconds"},{value:30,label:"30 seconds"},{value:60,label:"1 minute"},{value:0,label:"Manual only"}],JZ=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],cx="syncular-console-root";function eY(e){e.classList.add(cx)}const tY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/config",label:"Config"}];function nY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function My(e,t){return e?t?`${e}${t}`:e:t||"/"}function rY({basePath:e}){const{connect:t,config:n,isConnected:s,isConnecting:i}=Kt(),{preferences:a}=Wu(),{instanceId:l,rawInstanceId:f,setInstanceId:d,clearInstanceId:h}=It(),{partitionId:g,rawPartitionId:v,setPartitionId:b,clearPartitionId:x}=Qu(),S=fr({select:N=>N.location.pathname}),{data:w}=Xu({refetchIntervalMs:a.refreshInterval*1e3,partitionId:g,instanceId:l}),T=nY(e),R=_.useMemo(()=>tY.map(N=>({...N,id:My(T,N.suffix)})),[T]),k=My(T,""),j=My(T,"/config"),C=i?"connecting":s?"connected":n?"disconnected":"not-configured",I=R.find(N=>N.suffix===""?S===k||S===`${k}/`:S.startsWith(N.id))?.id??k,D=w?[{label:"HEAD",value:`#${w.maxCommitSeq}`},{label:"COMMITS",value:`${w.commitCount}`},{label:"CHANGES",value:`${w.changeCount}`},{label:"CLIENTS",value:`${w.activeClientCount}/${w.clientCount}`}]:[];return p.jsxs("div",{className:`${cx} h-screen bg-background text-foreground flex flex-col`,children:[p.jsx(BK,{brand:p.jsx(dc,{to:k,children:p.jsx($K,{label:"console"})}),center:p.jsx(MK,{items:R,activeId:I,renderItem:(N,{active:A})=>p.jsx(dc,{to:N.id,children:p.jsx(HO,{active:A,children:N.label})},N.id)}),right:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),p.jsx(cr,{variant:"mono",value:f,onChange:N=>d(N.target.value),onBlur:N=>d(N.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),l?p.jsx(Ie,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:h,children:"All"}):null]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),p.jsx(cr,{variant:"mono",value:v,onChange:N=>b(N.target.value),onBlur:N=>b(N.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),g?p.jsx(Ie,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:x,children:"All"}):null]}),p.jsx(Q9,{state:C}),p.jsx(dc,{to:j,children:p.jsx(Ie,{variant:S===j?"secondary":"ghost",size:"icon",children:p.jsx(jZ,{})})})]})}),p.jsx("main",{className:"flex-1 overflow-auto pt-[42px] pb-[32px]",children:p.jsx("div",{className:"min-h-full",children:s||S===j?p.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:p.jsx(PN,{})},S):p.jsx(sY,{configPath:j,hasSavedConfig:!!n,isConnecting:i,onConnect:()=>{t()}})})}),s&&p.jsx(Tj,{isLive:s,metrics:D,uptime:"--"})]})}function sY({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:s}){return p.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[p.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),p.jsxs("div",{className:"flex items-center gap-2",children:[t&&p.jsx(Ie,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),p.jsx(dc,{to:e,children:p.jsx(Ie,{variant:"link",children:"Configure connection"})})]})]})}const mi=J6({component:rY});function oY(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Kt(),{instanceId:h}=It(),g=l??h,[v,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[R,k]=_.useState(null),j=_.useRef(null),C=_.useRef(null),I=_.useRef(null),D=_.useRef(0),N=_.useRef(0),A=_.useRef(null),z=_.useCallback(()=>{b([]),A.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let X=!1;const q=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100,L=()=>{C.current&&(clearTimeout(C.current),C.current=null)},Z=()=>{I.current&&(clearInterval(I.current),I.current=null)},G=()=>{if(X||C.current)return;D.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,D.current-1)),U=Math.floor(V*.2*Math.random()),F=V+U;C.current=setTimeout(()=>{C.current=null,X||P()},F)},te=()=>{N.current=Date.now(),S(!0),T("connected")},P=()=>{if(X)return;T("connecting"),L();const V=(()=>{const F=new URL(f.serverUrl,window.location.origin);F.protocol=F.protocol==="https:"?"wss:":"ws:";const H=F.pathname.endsWith("/")?F.pathname.slice(0,-1):F.pathname;return F.pathname=`${H}/console/events/live`,F.search="",F.searchParams.set("token",f.token),A.current&&F.searchParams.set("since",A.current),F.searchParams.set("replayLimit",String(q)),a&&F.searchParams.set("partitionId",a),g&&F.searchParams.set("instanceId",g),F.toString()})(),U=new WebSocket(V);j.current=U,U.onopen=()=>{if(X){U.close();return}D.current=0,te(),k(null),Z(),I.current=setInterval(()=>{const F=j.current;if(!F||F.readyState!==WebSocket.OPEN)return;const H=N.current;!H||Date.now()-H<=s||(S(!1),T("stale"),F.close())},1e3)},U.onclose=()=>{X||(S(!1),T("disconnected"),Z(),G())},U.onerror=()=>{X||k(new Error("WebSocket connection failed"))},U.onmessage=F=>{try{const H=JSON.parse(F.data),M=H.type;if(te(),M==="connected"||M==="heartbeat")return;const K={type:M,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&K.data.partitionId!==a||g&&K.data.instanceId!==g)return;const W=Date.parse(A.current??""),Y=Date.parse(K.timestamp);Number.isFinite(Y)&&(!Number.isFinite(W)||Y>W)&&(A.current=K.timestamp),b(le=>[K,...le].slice(0,t))}catch{}}};return P(),()=>{X=!0,L(),Z(),j.current&&(j.current.close(),j.current=null),S(!1),T("disconnected")}},[n,d,f?.serverUrl,f?.token,t,a,g,i,s]),{events:v,isConnected:x,connectionState:w,error:R,clearEvents:z}}function iY(){const e=Bt(),{config:t}=Kt(),{instanceId:n}=It(),s=Vr();return vs({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=i.toString(),l=await fetch(`${t.serverUrl}/console/events${a?`?${a}`:""}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to clear events");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","events"]})}})}const aY=_.createContext(null);function eA(){const[e,t]=ci("console:time-range","24h");return{range:e,setRange:t}}const cY=[{hint:"ios",type:"mobile"},{hint:"android",type:"mobile"},{hint:"mobile",type:"mobile"},{hint:"tablet",type:"tablet"},{hint:"desktop",type:"desktop"},{hint:"mac",type:"desktop"},{hint:"windows",type:"desktop"},{hint:"linux",type:"desktop"},{hint:"browser",type:"browser"},{hint:"web",type:"browser"},{hint:"server",type:"server"},{hint:"api",type:"server"},{hint:"iot",type:"iot"},{hint:"sensor",type:"iot"}];function lY(e){const t=e.toLowerCase();for(const n of cY)if(t.includes(n.hint))return n.type;return"client"}function uY(e){const t=e.toLowerCase();return t.includes("pglite")?"PGlite":t.includes("sqlite")||t.includes("wa-sqlite")?"SQLite":t.includes("postgres")||t.includes("pg")?"PostgreSQL":"unknown"}function fY(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function dY(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function hY(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function pY(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=fY(i,t),f=dY(i,l);return{id:hY(i.clientId,a),type:lY(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:uY(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const mY={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function PR(e,t="relative"){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function gY(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function yY(){const e=sp(),t=_.useMemo(()=>typeof window>"u"?"/stream":gY(window.location.pathname),[]),n=eA(),{range:s}=n,{preferences:i}=Wu(),{partitionId:a}=Qu(),l=i.refreshInterval*1e3,[f]=ci("console:alert-config",mY),[d,h]=_.useState("1h"),{data:g}=Xu({refetchIntervalMs:l,partitionId:a}),{data:v}=AZ({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=kZ({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=MZ({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=JO({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=oY({maxEvents:8,partitionId:a}),R=_.useMemo(()=>{const L=v?.buckets??[];let Z=0,G=0;for(const P of L)Z+=P.pushCount+P.pullCount,G+=P.errorCount;const te=Z>0?G/Z*100:0;return{totalEvents:Z,errorRate:te}},[v?.buckets]),k=_.useMemo(()=>S?.items?pY(S.items,g,{maxNodes:12}):[],[S?.items,g]),j=k.filter(L=>L.status!=="offline").length,C=k.filter(L=>L.status==="offline").length,I=_.useMemo(()=>g?[{label:"Ops (Range)",value:R.totalEvents,color:"flow"},{label:"P50 Latency",value:b?.push?.p50??0,unit:"ms",color:"healthy"},{label:"Error Rate",value:`${R.errorRate.toFixed(1)}%`,color:R.errorRate>0?"offline":"muted"},{label:"Active Clients",value:g.activeClientCount,color:"syncing"},{label:"Pending",value:g.maxActiveClientCursor!==null&&g.maxCommitSeq>0?g.maxCommitSeq-(g.minActiveClientCursor??0):0,color:"relay"}]:[],[g,b,R.errorRate,R.totalEvents]),D=_.useMemo(()=>w.map(L=>({type:L.type.toUpperCase(),actor:L.data?.actorId??"",table:(L.data?.tables??[])[0]??"",time:PR(L.timestamp,i.timeFormat)})),[w,i.timeFormat]),N=_.useMemo(()=>{const L=v?.buckets;if(!L?.length)return[];const Z=Math.max(...L.map(G=>Math.max(G.pushCount,G.pullCount)),1);return L.map(G=>({pushPercent:Z>0?G.pushCount/Z*100:0,pullPercent:Z>0?G.pullCount/Z*100:0}))},[v?.buckets]),A=_.useMemo(()=>{if(!b)return[];const L=Math.max(b.push.p50,b.push.p90,b.push.p99,b.pull.p50,b.pull.p90,b.pull.p99,1);return[{label:"P50",pushMs:b.push.p50,pullMs:b.pull.p50,pushBarPercent:b.push.p50/L*100,pullBarPercent:b.pull.p50/L*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/L*100,pullBarPercent:b.pull.p90/L*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/L*100,pullBarPercent:b.pull.p99/L*100}]},[b]),z=_.useMemo(()=>x?.items?x.items.map(L=>({seq:L.commitSeq,actor:L.actorId,changes:L.changeCount,tables:(L.affectedTables??[]).join(", "),time:PR(L.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),X=_.useMemo(()=>Math.max(0,100-R.errorRate),[R.errorRate]),q=_.useMemo(()=>{if(!f.enabled||!g)return[];const L=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&L.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&L.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),R.errorRate>f.thresholds.errorRate&&L.push(`Error rate (${R.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),L},[f,g,b,R.errorRate]);return g?p.jsx(aY.Provider,{value:n,children:p.jsxs("div",{className:"flex flex-col",children:[q.length>0&&p.jsx("div",{className:"px-6 pb-4",children:p.jsxs(kn,{variant:"destructive",children:[p.jsx(Zu,{children:"Threshold Exceeded"}),p.jsx(Mn,{children:q.map((L,Z)=>p.jsx("span",{className:"block",children:L},Z))})]})}),p.jsx(wO,{clients:k,totalNodes:k.length+2,onlineCount:j,offlineCount:C,relayClientIds:[]}),p.jsx(kj,{items:I}),p.jsxs("div",{className:"flex",children:[p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[p.jsx("div",{className:"border-b border-border border-r border-border",children:p.jsx(oj,{bars:N,activeRange:d,onRangeChange:h})}),p.jsx("div",{className:"border-b border-border border-r border-border",children:p.jsx(Mj,{buckets:A,successRate:X})}),p.jsx("div",{className:"border-r border-border",children:p.jsx(Rj,{commits:z,onViewAll:()=>e({href:t})})})]}),p.jsx(Ij,{entries:D,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):p.jsx("div",{className:"flex items-center justify-center py-24",children:p.jsx(Dt,{size:"lg"})})}function vY(){return p.jsx(yY,{})}function bY(){return p.jsxs("div",{className:"space-y-4 px-5 py-5",children:[p.jsx(xY,{}),p.jsx(TY,{}),p.jsx(RY,{})]})}function xY(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Kt(),[f,d]=_.useState(t?.serverUrl??"/api"),[h,g]=_.useState(t?.token??""),[v,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[R,k]=ci("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const N=new URLSearchParams(window.location.search),A=N.get("token"),z=N.get("server");A&&(g(A),window.history.replaceState({},"",window.location.pathname)),z&&d(z)},[]),_.useEffect(()=>{t?.serverUrl&&d(t.serverUrl),t?.token&&g(t.token)},[t?.serverUrl,t?.token]),_.useEffect(()=>{T(null)},[]);const j=async()=>{e(),b(null);const N=await n({serverUrl:f.trim(),token:h.trim()},{persistOverride:!0});T(N?"Connected successfully and configuration saved.":"Failed to connect with the provided settings.")},C=()=>{s({clearSavedConfig:R}),R&&(d("/api"),g("")),T(R?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},I=async()=>{S(!0),b(null),T(null);const N=performance.now();try{const A=f.trim(),z=h.trim();if(!A||!z)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${z}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-N))}catch{b(-1)}finally{S(!1)}},D=i??w??(v!==null?v<0?"Connection failed":`Connection successful (${v}ms latency)`:void 0);return p.jsx(Cj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:h,onConsoleTokenChange:g,onSaveAndConnect:j,onDisconnect:C,onTestConnection:I,statusMessage:D,children:p.jsx("div",{className:"px-5 pb-5 -mt-2",children:p.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),p.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),p.jsx(hp,{checked:R,onCheckedChange:k})]})})})}const SY=1440*60*1e3;function zR(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function Iy(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function _Y(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function wY(e,t){if(e.revokedAt)return"revoked";if(!e.expiresAt)return"active";const n=Date.parse(e.expiresAt);if(!Number.isFinite(n))return"active";const s=Date.now();return n<=s?"expired":n<=s+t*SY?"expiring":"active"}function EY(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function TY(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,h]=_.useState(!1),[g,v]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,R]=_.useState(""),[k,j]=_.useState(""),[C,I]=_.useState(null),[D,N]=_.useState([]),[A,z]=_.useState(null),[X,q]=_.useState(null),[L,Z]=_.useState(null),[G,te]=_.useState(null),[P,V]=_.useState(null),[U,F]=_.useState(null),[H,M]=_.useState(null),K=_.useMemo(()=>zR(i),[i]),W=K??14,Y=_.useMemo(()=>zR(k),[k]),le=k.trim().length>0,ie=!le||Y!==null,ce=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:Se,isLoading:ge,error:$e}=VZ(ce),Ee=GZ(),re=ZZ(),he=KZ(),oe=YZ(),_e=XZ();_.useEffect(()=>{const pe=new Set((Se?.items??[]).map(Te=>Te.keyId));N(Te=>Te.filter(He=>pe.has(He)))},[Se?.items]);const ye=async()=>{try{const pe=T.split(",").map(He=>He.trim()).filter(He=>He.length>0),Te=await Ee.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:pe.length>0?pe:void 0,expiresInDays:le?Y??void 0:void 0});I(Te.secretKey),v(""),w(""),R(""),j("")}catch{}},xe=pe=>{navigator.clipboard.writeText(pe),q(pe),setTimeout(()=>q(null),2e3)},ve=async()=>{if(L)try{await he.mutateAsync(L)}finally{Z(null)}},ke=async()=>{if(D.length!==0)try{const pe=await re.mutateAsync({keyIds:D});z(pe),N([])}catch{}},Le=async()=>{if(G)try{const pe=await _e.mutateAsync(G.keyId);V({oldKeyId:G.keyId,oldKeyName:G.name,secretKey:pe.secretKey})}catch{}},we=async()=>{if(P)try{await he.mutateAsync(P.oldKeyId)}finally{V(null),te(null)}},qe=async()=>{if(U)try{const pe=await oe.mutateAsync(U);M(pe.secretKey)}finally{F(null)}};if(ge)return p.jsx("div",{className:"flex h-[200px] items-center justify-center",children:p.jsx(Dt,{size:"lg"})});if($e)return p.jsx("div",{className:"flex h-[200px] items-center justify-center",children:p.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",$e.message]})});const Qe=(Se?.items??[]).filter(pe=>pe.revokedAt===null).map(pe=>pe.keyId),Be=Qe.length>0&&Qe.every(pe=>D.includes(pe)),We=D.length>0,Ve=(Se?.items??[]).filter(pe=>D.includes(pe.keyId)).map(pe=>pe.name);return p.jsxs(p.Fragment,{children:[p.jsxs(zj,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Ie,{size:"sm",variant:"destructive",onClick:()=>h(!0),disabled:D.length===0,children:["Revoke Selected (",D.length,")"]}),p.jsx(Ie,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[p.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[p.jsxs(ds,{children:[p.jsx(Wr,{children:"Type filter"}),p.jsxs(sh,{value:[e],multiple:!1,onValueChange:pe=>{const Te=pe.find(He=>typeof He=="string");(Te==="all"||Te==="relay"||Te==="proxy"||Te==="admin")&&t(Te)},children:[p.jsx(Or,{value:"all",children:"all"}),p.jsx(Or,{value:"relay",children:"relay"}),p.jsx(Or,{value:"proxy",children:"proxy"}),p.jsx(Or,{value:"admin",children:"admin"})]})]}),p.jsxs(ds,{children:[p.jsx(Wr,{children:"Status filter"}),p.jsxs(sh,{value:[n],multiple:!1,onValueChange:pe=>{const Te=pe.find(He=>typeof He=="string");(Te==="all"||Te==="active"||Te==="revoked"||Te==="expiring")&&s(Te)},children:[p.jsx(Or,{value:"all",children:"all"}),p.jsx(Or,{value:"active",children:"active"}),p.jsx(Or,{value:"revoked",children:"revoked"}),p.jsx(Or,{value:"expiring",children:"expiring"})]})]}),p.jsxs(ds,{children:[p.jsx(Wr,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),p.jsx(ac,{children:"Used when status filter is set to expiring."}),p.jsx(cr,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:pe=>a(pe.target.value)}),K===null&&i.trim().length>0?p.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),Se?.items.length===0?p.jsx(Nj,{message:"No API keys match the current filters."}):p.jsxs(sx,{children:[p.jsx(ox,{children:p.jsxs(Eu,{children:[p.jsx(_n,{children:p.jsx(kv,{checked:Be,indeterminate:!Be&&We&&Qe.length>0,onCheckedChange:pe=>{N(pe?Qe:[])},"aria-label":"Select all active keys"})}),p.jsx(_n,{children:"NAME"}),p.jsx(_n,{children:"TYPE"}),p.jsx(_n,{children:"KEY PREFIX"}),p.jsx(_n,{children:"ACTOR"}),p.jsx(_n,{children:"SCOPES"}),p.jsx(_n,{children:"CREATED"}),p.jsx(_n,{children:"LAST USED"}),p.jsx(_n,{children:"EXPIRES"}),p.jsx(_n,{children:"STATUS"}),p.jsx(_n,{children:"ACTIONS"})]})}),p.jsx(ix,{children:(Se?.items??[]).map(pe=>{const Te=wY(pe,W);return p.jsxs(Eu,{children:[p.jsx(wn,{children:p.jsx(kv,{checked:D.includes(pe.keyId),onCheckedChange:He=>{N(ht=>He?[...new Set([...ht,pe.keyId])]:ht.filter(lt=>lt!==pe.keyId))},"aria-label":`Select ${pe.name}`,disabled:pe.revokedAt!==null})}),p.jsx(wn,{className:"font-medium",children:pe.name}),p.jsx(wn,{children:p.jsx(Pn,{variant:pe.keyType==="admin"?"flow":pe.keyType==="proxy"?"ghost":"relay",children:pe.keyType})}),p.jsx(wn,{children:p.jsxs("code",{className:"font-mono text-[11px]",children:[pe.keyPrefix,"..."]})}),p.jsx(wn,{className:"text-neutral-500",children:pe.actorId??"-"}),p.jsx(wn,{className:"max-w-[220px] text-neutral-500",children:p.jsx("code",{className:"font-mono text-[10px]",children:_Y(pe.scopeKeys)})}),p.jsx(wn,{className:"text-neutral-500",children:Iy(pe.createdAt)}),p.jsx(wn,{className:"text-neutral-500",children:Iy(pe.lastUsedAt)}),p.jsx(wn,{className:"text-neutral-500",children:Iy(pe.expiresAt)}),p.jsx(wn,{children:p.jsx(Pn,{variant:EY(Te),children:Te})}),p.jsx(wn,{children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>te(pe),disabled:pe.revokedAt!==null,children:"Stage"}),p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>F(pe.keyId),disabled:pe.revokedAt!==null,children:"Rotate"}),p.jsx(Ie,{variant:"destructive",size:"sm",onClick:()=>Z(pe.keyId),disabled:pe.revokedAt!==null,children:"Revoke"})]})})]},pe.keyId)})})]})]}),p.jsx(es,{open:l,onOpenChange:f,children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Create API Key"})}),C?p.jsx(DR,{copiedKeyId:X,onClose:()=>{I(null),f(!1)},onCopy:xe,secretKey:C,warning:"Copy this key now. You will not be able to view it again."}):p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[p.jsxs(ds,{children:[p.jsx(Wr,{htmlFor:"api-key-name",children:"Name"}),p.jsx(cr,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:pe=>v(pe.target.value)})]}),p.jsxs(ds,{children:[p.jsx(Wr,{children:"Key type"}),p.jsxs(sh,{value:[b],multiple:!1,onValueChange:pe=>{const Te=pe.find(He=>typeof He=="string");(Te==="relay"||Te==="proxy"||Te==="admin")&&x(Te)},children:[p.jsx(Or,{value:"relay",children:"relay"}),p.jsx(Or,{value:"proxy",children:"proxy"}),p.jsx(Or,{value:"admin",children:"admin"})]})]}),p.jsxs(ds,{children:[p.jsx(Wr,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),p.jsx(ac,{children:"Pin this key to a fixed actor ID"}),p.jsx(cr,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:pe=>w(pe.target.value)})]}),p.jsxs(ds,{children:[p.jsx(Wr,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),p.jsx(ac,{children:"Comma-separated list of allowed scope keys"}),p.jsx(cr,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:pe=>R(pe.target.value)})]}),p.jsxs(ds,{children:[p.jsx(Wr,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),p.jsx(ac,{children:"Leave empty to keep the key non-expiring."}),p.jsx(cr,{id:"api-key-expires-days",placeholder:"30",value:k,inputMode:"numeric",onChange:pe=>j(pe.target.value)}),ie?null:p.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),p.jsx(Ie,{variant:"primary",onClick:ye,disabled:Ee.isPending||!g||!ie,children:Ee.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),p.jsx(es,{open:d,onOpenChange:pe=>{h(pe),pe||z(null)},children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Bulk Revoke API Keys"})}),A?p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[p.jsx(kn,{variant:"destructive",children:p.jsxs(Mn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),p.jsx(An,{children:p.jsx(Ie,{variant:"primary",onClick:()=>{h(!1),z(null)},children:"Done"})})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[p.jsx(kn,{variant:"destructive",children:p.jsx(Mn,{children:"This revokes selected keys immediately and cannot be undone."})}),p.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",Ve.slice(0,5).join(", "),Ve.length>5?` +${Ve.length-5} more`:""]})]}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>h(!1),children:"Cancel"}),p.jsx(Ie,{variant:"destructive",onClick:ke,disabled:re.isPending||D.length===0,children:re.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),p.jsx(es,{open:G!==null||P!==null,onOpenChange:()=>{te(null),V(null)},children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Stage Rotate API Key"})}),P?p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[p.jsx(kn,{variant:"default",children:p.jsxs(Mn,{children:["Replacement key created for ",P.oldKeyName,". The old key is still active until you revoke it."]})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:P.secretKey}),p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>xe(P.secretKey),children:X===P.secretKey?"Copied":"Copy"})]}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>{V(null),te(null)},children:"Keep Old Key Active"}),p.jsx(Ie,{variant:"destructive",onClick:we,disabled:he.isPending,children:he.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"px-5 py-4",children:p.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Staged rotation creates a replacement key now and keeps the current key active until you explicitly revoke it."})}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>te(null),children:"Cancel"}),p.jsx(Ie,{variant:"primary",onClick:Le,disabled:_e.isPending||!G,children:_e.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),p.jsx(es,{open:L!==null,onOpenChange:()=>Z(null),children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Revoke API Key"})}),p.jsx("div",{className:"px-5 py-4",children:p.jsx(kn,{variant:"destructive",children:p.jsx(Mn,{children:"Revoking a key immediately invalidates it for all requests."})})}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>Z(null),children:"Cancel"}),p.jsx(Ie,{variant:"destructive",onClick:ve,disabled:he.isPending,children:he.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),p.jsx(es,{open:U!==null||H!==null,onOpenChange:()=>{F(null),M(null)},children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Rotate API Key"})}),H?p.jsx(DR,{copiedKeyId:X,onClose:()=>M(null),onCopy:xe,secretKey:H,warning:"The previous key has been invalidated. Store this replacement securely."}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"px-5 py-4",children:p.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>F(null),children:"Cancel"}),p.jsx(Ie,{variant:"primary",onClick:qe,disabled:oe.isPending,children:oe.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function RY(){const{preferences:e,updatePreference:t,resetPreferences:n}=Wu(),s=[{type:"filter",label:"Auto-refresh interval",options:WZ.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.refreshInterval}`,onActiveChange:i=>t("refreshInterval",Number.parseInt(i,10))},{type:"filter",label:"Items per page",options:JZ.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.pageSize}`,onActiveChange:i=>t("pageSize",Number.parseInt(i,10))},{type:"filter",label:"Time format",options:[{id:"relative",label:"Relative"},{id:"absolute",label:"Absolute"}],activeId:e.timeFormat,onActiveChange:i=>t("timeFormat",i)},{type:"toggle",label:"Show sparklines",description:"Display mini trend charts in dashboard metric cards",checked:e.showSparklines,onCheckedChange:i=>t("showSparklines",i)}];return p.jsx(Pj,{rows:s,onResetDefaults:n})}function DR({copiedKeyId:e,onClose:t,onCopy:n,secretKey:s,warning:i}){return p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[p.jsx(kn,{variant:"destructive",children:p.jsx(Mn,{children:i})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:s}),p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),p.jsx(An,{children:p.jsx(Ie,{variant:"primary",onClick:t,children:"Done"})})]})}function CY(e){const t=e.toLowerCase();return t.includes("mobile")||t.includes("ios")||t.includes("android")?"mobile":t.includes("tablet")?"tablet":t.includes("desktop")||t.includes("laptop")?"desktop":t.includes("edge")?"edge":t.includes("iot")?"iot":"desktop"}function NY(e){const t=e.toLowerCase();return t.includes("pglite")?"PGlite":t.includes("wa-sqlite")||t.includes("sqlite")?"SQLite":t.includes("postgres")||t.includes("pg")?"PostgreSQL":"unknown"}function jY(e,t){if(t==="absolute")return new Date(e).toLocaleString();try{const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3),l=Math.floor(a/60),f=Math.floor(l/60),d=Math.floor(f/24);return a<60?"just now":l<60?`${l}m ago`:f<24?`${f}h ago`:`${d}d ago`}catch{return e}}function OY(e,t,n){return{id:e.clientId,type:CY(e.clientId),status:e.activityState==="stale"?"offline":e.activityState==="idle"?"syncing":"online",cursor:e.cursor,actor:e.actorId,mode:e.connectionMode==="realtime"?"realtime":"polling",dialect:NY(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:jY(e.updatedAt,n)}}function AY(){const[e,t]=_.useState(1),[n,s]=_.useState(null),{preferences:i}=Wu(),{partitionId:a}=Qu(),l=i.pageSize,f=i.refreshInterval*1e3,{data:d,isLoading:h}=Xu({refetchIntervalMs:f,partitionId:a}),{data:g,isLoading:v,error:b}=JO({limit:l,offset:(e-1)*l,partitionId:a},{refetchIntervalMs:f}),x=BZ(),S=Math.ceil((g?.total??0)/l),w=d?.maxCommitSeq??0;_.useEffect(()=>{t(1)},[]);const T=async()=>{if(n)try{await x.mutateAsync({clientId:n,partitionId:a})}finally{s(null)}};if(v||h)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsx(Dt,{size:"lg"})});if(b)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",b.message]})});const R=(g?.items??[]).map(k=>OY(k,w,i.timeFormat));return p.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[R.length>0&&p.jsx(Lj,{clients:R,headSeq:w}),R.length===0?p.jsx(lV,{children:p.jsx(Nj,{message:"No clients yet"})}):p.jsx("div",{className:"grid grid-cols-3 gap-3",children:R.map((k,j)=>p.jsx(Oj,{client:k,headSeq:w,onEvict:()=>s(g?.items[j]?.clientId??k.id)},k.id))}),S>1&&p.jsx(rx,{page:e,totalPages:S,totalItems:g?.total??0,onPageChange:t}),p.jsx(es,{open:n!==null,onOpenChange:()=>s(null),children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Evict Client"})}),p.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[p.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",p.jsxs("span",{className:"font-mono text-white",children:[n?.slice(0,12),"..."]}),"?"]}),p.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>s(null),children:"Cancel"}),p.jsx(Ie,{variant:"destructive",onClick:T,disabled:x.isPending,children:x.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const kY={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function MY(e){return e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function IY(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function PY(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function LR(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function zY(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function DY(e){const t=LR(e.requestPayload),n=LR(e.resultPayload);if(e.operationType==="notify_data_change"){const a=zY(t?.tables),l=n?.commitSeq;return`${a.length} table${a.length===1?"":"s"} -> commit #${typeof l=="number"?l:"?"}`}if(e.operationType==="evict_client"){const a=n?.evicted===!0?"evicted":"not found";return`client ${e.targetClientId??"?"} ${a}`}if(e.operationType==="compact")return`${typeof n?.deletedChanges=="number"?n.deletedChanges:0} changes removed`;const s=typeof n?.deletedCommits=="number"?n.deletedCommits:0,i=typeof t?.watermarkCommitSeq=="number"?` at #${t.watermarkCommitSeq}`:"";return`${s} commits removed${i}`}function LY(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function UY(){const{partitionId:e}=Qu();return p.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[p.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[p.jsx($Y,{}),p.jsx(VY,{})]}),p.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[p.jsx(BY,{partitionId:e}),p.jsx(FY,{partitionId:e}),p.jsx(HY,{partitionId:e})]}),p.jsx(qY,{partitionId:e})]})}function $Y(){const{data:e,isLoading:t,error:n}=LZ();if(t)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsx(Dt,{size:"lg"})});if(n)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsxs("p",{className:"text-danger",children:["Failed to load handlers: ",n.message]})});const s=(e?.items??[]).map(i=>({table:i.table,dependsOn:i.dependsOn?.join(", ")??null,chunkTtl:i.snapshotChunkTtlMs?MY(i.snapshotChunkTtlMs):"default"}));return p.jsx(Aj,{handlers:s,tableCount:e?.items.length??0})}function BY({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=Xu({partitionId:e}),{data:f,isLoading:d,refetch:h}=UZ({enabled:!1}),g=FZ(),v=async()=>{n(!0),i(null),await h()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsx(Dt,{size:"lg"})});const x=[{label:"Total commits",value:a?.commitCount??0},{label:"Commit range",value:`${a?.minCommitSeq??0} - ${a?.maxCommitSeq??0}`},{label:"Min active cursor",value:a?.minActiveClientCursor??"N/A",tone:"syncing"}];return p.jsxs(p.Fragment,{children:[p.jsx(pp,{title:"Prune",description:"Delete commits that all clients have already synced. Pruning removes commits older than the oldest active client cursor.",dotColor:"syncing",stats:x,actionLabel:"Preview Prune",actionVariant:"destructive",onAction:v}),p.jsx(es,{open:t,onOpenChange:n,children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Prune Old Commits"})}),p.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?p.jsxs(kn,{variant:"default",children:[p.jsx(Zu,{children:"Pruning Complete"}),p.jsxs(Mn,{children:["Successfully deleted ",p.jsx("strong",{children:s})," commits."]})]}):d?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(Dt,{size:"sm"})}):f?p.jsxs(p.Fragment,{children:[p.jsx(kn,{variant:f.commitsToDelete>0?"destructive":"default",children:p.jsx(Mn,{children:f.commitsToDelete>0?p.jsxs(p.Fragment,{children:["This will delete"," ",p.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",p.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[p.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),p.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),p.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[p.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),p.jsx(Pn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&p.jsx(Ie,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function FY({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=Xu({partitionId:e}),f=HZ(),d=()=>{n(!0),i(null)},h=async()=>{const v=await f.mutateAsync();i(v.deletedChanges)};if(l)return p.jsx("div",{className:"flex items-center justify-center h-[200px]",children:p.jsx(Dt,{size:"lg"})});const g=[{label:"Total changes",value:a?.changeCount??0},{label:"Total commits",value:a?.commitCount??0}];return p.jsxs(p.Fragment,{children:[p.jsx(pp,{title:"Compact",description:"Merge old changes to reduce storage space. Compaction merges multiple changes to the same row into a single change.",dotColor:"flow",stats:g,actionLabel:"Run Compaction",actionVariant:"primary",onAction:d}),p.jsx(es,{open:t,onOpenChange:n,children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Compact Changes"})}),p.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?p.jsxs(kn,{variant:"default",children:[p.jsx(Zu,{children:"Compaction Complete"}),p.jsxs(Mn,{children:["Successfully removed ",p.jsx("strong",{children:s})," redundant changes."]})]}):p.jsx(kn,{variant:"default",children:p.jsx(Mn,{children:"Compaction will merge multiple changes to the same row, keeping only the most recent version. This is safe and can be run at any time."})})}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&p.jsx(Ie,{variant:"primary",onClick:h,disabled:f.isPending,children:f.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function HY({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[h,g]=_.useState(null),v=qZ(),b=IY(s),x=[{label:"Next tables",value:b.length,tone:"syncing"},{label:"Last commit seq",value:f?`#${f.commitSeq}`:"—",tone:"syncing"},{label:"Last chunks cleared",value:f?.deletedChunks??"—"}],S=()=>{n(!0),g(null)},w=async()=>{if(b.length===0){g("Provide at least one table name.");return}g(null);const T=await v.mutateAsync({tables:b,partitionId:a.trim()||void 0});d(T)};return p.jsxs(p.Fragment,{children:[p.jsx(pp,{title:"Notify Data Change",description:"Create a synthetic commit after external imports or direct DB writes so clients re-bootstrap for affected tables.",dotColor:"healthy",stats:x,actionLabel:"Notify Clients",actionVariant:"primary",onAction:S}),p.jsx(es,{open:t,onOpenChange:n,children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Notify External Data Change"})}),p.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?p.jsxs(kn,{variant:"default",children:[p.jsx(Zu,{children:"Notification Sent"}),p.jsxs(Mn,{children:["Created synthetic commit"," ",p.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",p.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",p.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):p.jsx(kn,{variant:"default",children:p.jsx(Mn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),h?p.jsx(kn,{variant:"destructive",children:p.jsx(Mn,{children:h})}):null,p.jsxs(ds,{children:[p.jsx(Wr,{children:"Tables (comma-separated)"}),p.jsx(cr,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:v.isPending}),p.jsx(ac,{children:"Enter one or more table names affected by the external change."})]}),p.jsxs(ds,{children:[p.jsx(Wr,{children:"Partition ID (optional)"}),p.jsx(cr,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:v.isPending})]})]}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:p.jsx(Ie,{variant:"primary",onClick:w,disabled:v.isPending,children:v.isPending?p.jsxs(p.Fragment,{children:[p.jsx(Dt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function qY({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=$Z({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return p.jsx(zj,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ie,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),p.jsx(Ie,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),p.jsx(Ie,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),p.jsx(Ie,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),p.jsx(Ie,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:i?p.jsx("div",{className:"flex items-center justify-center py-10",children:p.jsx(Dt,{size:"lg"})}):a?p.jsx(kn,{variant:"destructive",children:p.jsxs(Mn,{children:["Failed to load operation audit events: ",a.message]})}):(s?.items.length??0)===0?p.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):p.jsx("div",{className:"overflow-x-auto",children:p.jsxs(sx,{children:[p.jsx(ox,{children:p.jsxs(Eu,{children:[p.jsx(_n,{children:"Time"}),p.jsx(_n,{children:"Type"}),p.jsx(_n,{children:"User"}),p.jsx(_n,{children:"Target"}),p.jsx(_n,{children:"Result"})]})}),p.jsx(ix,{children:(s?.items??[]).map((l,f)=>p.jsxs(Eu,{children:[p.jsx(wn,{className:"whitespace-nowrap text-xs text-neutral-400",children:LY(l.createdAt)}),p.jsx(wn,{children:p.jsx(Pn,{variant:"ghost",children:PY(l.operationType)})}),p.jsx(wn,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),p.jsx(wn,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),p.jsx(wn,{className:"font-mono text-xs text-neutral-300",children:DY(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function VY(){const[e,t]=ci("console:alert-config",kY),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},s=a=>{t(l=>({...l,latencyThresholdMs:a.p90Latency,errorRateThreshold:a.errorRate,clientLagThreshold:a.clientLag}))},i=a=>{t(l=>({...l,enabled:a}))};return p.jsx(Ej,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}const GY={};function Jl(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function KY(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0),n={},s=[];for(const i of t){const[a="",...l]=i.split(":"),f=l.join(":").trim(),d=a.toLowerCase();if(!f){s.push(i);continue}if(d==="actor"){n.actorId=f;continue}if(d==="client"){n.clientId=f;continue}if(d==="table"){n.table=f;continue}if(d==="request"){n.requestId=f;continue}if(d==="trace"){n.traceId=f;continue}s.push(i)}return s.length>0&&(n.search=s.join(" ")),n}function ZY(e){return e==="1h"?3600*1e3:e==="6h"?360*60*1e3:e==="24h"?1440*60*1e3:e==="7d"?10080*60*1e3:720*60*60*1e3}function $d(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function YY(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function XY(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function QY(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function lx({initialSelectedEntryId:e}={}){const{preferences:t}=Wu(),{partitionId:n}=Qu(),{range:s,setRange:i}=eA(),a=t.pageSize,l=t.refreshInterval*1e3,f=GY?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[d,h]=_.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[g,v]=_.useState("all"),[b,x]=_.useState("all"),[S,w]=_.useState(""),[T,R]=_.useState(1),[k,j]=_.useState(!1),[C,I]=_.useState(e??null),D=_.useRef(!1),N=_.useMemo(()=>KY(S),[S]),A=_.useMemo(()=>new Date(Date.now()-ZY(s)).toISOString(),[s]),{data:z,isLoading:X,refetch:q}=PZ({limit:a,offset:(T-1)*a,...n?{partitionId:n}:{},view:d,...d!=="commits"&&g!=="all"?{eventType:g}:{},...d!=="commits"&&b!=="all"?{outcome:b}:{},...N.actorId?{actorId:N.actorId}:{},...N.clientId?{clientId:N.clientId}:{},...N.requestId?{requestId:N.requestId}:{},...N.traceId?{traceId:N.traceId}:{},...N.table?{table:N.table}:{},...N.search?{search:N.search}:{},from:A},{refetchIntervalMs:l}),L=iY(),Z=C?.startsWith("#")?C.slice(1):void 0,G=C?.startsWith("E")?C.slice(1):void 0,te=Z&&Z!=="?"?Z:void 0,P=G&&G!=="?"?G:void 0,{data:V,isLoading:U,error:F}=IZ(te,{enabled:te!==void 0,partitionId:n}),{data:H,isLoading:M,error:K}=zZ(P,{enabled:P!==void 0,partitionId:n}),{data:W,isLoading:Y,error:le}=DZ(P,{enabled:P!==void 0&&!!H?.payloadRef,partitionId:n}),ie=_.useMemo(()=>QY(f,H?.traceId??null,H?.spanId??null),[H?.spanId,H?.traceId]);_.useEffect(()=>{R(1)},[]),_.useEffect(()=>{R(1)},[]),_.useEffect(()=>{e&&I(e)},[e]),_.useEffect(()=>{if(!D.current){D.current=!0;return}I(null)},[]),_.useEffect(()=>{R(1),I(null)},[]);const Se=_.useMemo(()=>(z?.items??[]).map(_e=>{const ye=_e.instanceId??_e.commit?.instanceId??_e.event?.instanceId,xe=ye?`[${ye}] `:"";if(_e.type==="commit"&&_e.commit){const ke=_e.commit;return{type:"commit",id:YY(ke,ye),outcome:"--",duration:"--",actor:ke.actorId,client:ke.clientId,detail:`${xe}${ke.changeCount} chg | ${(ke.affectedTables??[]).join(", ")}`,time:Jl(_e.timestamp,t.timeFormat)}}const ve=_e.event;return ve?{type:ve.eventType,id:XY(ve,ye),outcome:ve.outcome,duration:`${ve.durationMs}ms`,actor:ve.actorId,client:ve.clientId,detail:`${xe}${(ve.tables??[]).join(", ")||"--"}`,time:Jl(_e.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:Jl(_e.timestamp,t.timeFormat)}}),[t.timeFormat,z?.items]),ge=z?.total??0,$e=Math.max(1,Math.ceil(ge/a)),Ee=X,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:oe=>{h(oe),oe==="commits"&&(v("all"),x("all")),R(1)}},{label:"Time",options:[{id:"1h",label:"1h"},{id:"6h",label:"6h"},{id:"24h",label:"24h"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],activeId:s,onActiveChange:oe=>{i(oe),R(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:oe=>{v(oe),R(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:oe=>{x(oe),R(1)}}];function he(){L.mutate(void 0,{onSuccess:()=>{j(!1),q()}})}return p.jsxs("div",{className:"flex flex-col h-full",children:[Ee&&Se.length===0?p.jsx("div",{className:"flex items-center justify-center py-24",children:p.jsx(Dt,{size:"lg"})}):p.jsx(Dj,{entries:Se,selectedEntryId:C,onEntryClick:oe=>I(oe.id),filterBar:p.jsx(jj,{groups:re,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:"sm",variant:"ghost",onClick:()=>{q()},children:"Refresh"}),p.jsx(Ie,{size:"sm",variant:"ghost",children:"Export"}),p.jsx(Ie,{size:"sm",variant:"destructive",onClick:()=>j(!0),children:"Clear"})]})}),pagination:p.jsx(rx,{page:T,totalPages:$e,totalItems:ge,onPageChange:R})}),p.jsx(es,{open:C!==null,onOpenChange:oe=>{oe||I(null)},children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:te!==void 0?`Commit #${te}`:P!==void 0?`Event E${P}`:"Entry details"})}),p.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:U||M?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(Dt,{size:"sm"})}):F||K?p.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):V?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Actor"}),p.jsx("div",{className:"text-neutral-100",children:V.actorId})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Client"}),p.jsx("div",{className:"text-neutral-100",children:V.clientId})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Instance"}),p.jsx("div",{className:"text-neutral-100",children:V.instanceId??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Created"}),p.jsx("div",{className:"text-neutral-100",children:Jl(V.createdAt,t.timeFormat)})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Changes"}),p.jsx("div",{className:"text-neutral-100",children:V.changeCount})]})]}),p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),p.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:V.affectedTables.join(", ")||"--"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),V.changes.length===0?p.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):V.changes.map(oe=>p.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[p.jsxs("span",{className:"text-neutral-300",children:[oe.table," | ",oe.op]}),p.jsxs("span",{className:"text-neutral-500",children:["#",oe.changeId]})]}),p.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",oe.rowId,oe.rowVersion!==null?` | version: ${oe.rowVersion}`:""]}),p.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:$d(oe.rowJson)})]},oe.changeId))]})]}):H?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Type"}),p.jsx("div",{className:"text-neutral-100",children:H.eventType})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Path"}),p.jsx("div",{className:"text-neutral-100",children:H.syncPath})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Instance"}),p.jsx("div",{className:"text-neutral-100",children:H.instanceId??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Outcome"}),p.jsx("div",{className:"text-neutral-100",children:H.outcome})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Response Status"}),p.jsx("div",{className:"text-neutral-100",children:H.responseStatus})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Actor"}),p.jsx("div",{className:"text-neutral-100",children:H.actorId})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Client"}),p.jsx("div",{className:"text-neutral-100",children:H.clientId})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Status"}),p.jsx("div",{className:"text-neutral-100",children:H.statusCode})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Transport"}),p.jsx("div",{className:"text-neutral-100",children:H.transportPath})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Duration"}),p.jsxs("div",{className:"text-neutral-100",children:[H.durationMs,"ms"]})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Request ID"}),p.jsx("div",{className:"text-neutral-100",children:H.requestId})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),p.jsx("div",{className:"text-neutral-100",children:H.traceId??"--"}),ie&&p.jsx("a",{href:ie,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Span ID"}),p.jsx("div",{className:"text-neutral-100",children:H.spanId??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),p.jsx("div",{className:"text-neutral-100",children:H.commitSeq??"--"}),H.commitSeq!==null&&p.jsx(Ie,{variant:"ghost",size:"sm",onClick:()=>I(`#${H.instanceId?`${H.instanceId}:`:""}${H.commitSeq}`),children:"Open linked commit"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),p.jsx("div",{className:"text-neutral-100",children:H.subscriptionCount??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Error Code"}),p.jsx("div",{className:"text-neutral-100",children:H.errorCode??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),p.jsx("div",{className:"text-neutral-100",children:H.payloadRef??"--"})]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-neutral-500",children:"Created"}),p.jsx("div",{className:"text-neutral-100",children:Jl(H.createdAt,t.timeFormat)})]})]}),p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),p.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:H.tables.join(", ")||"--"})]}),H.scopesSummary&&p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),p.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:$d(H.scopesSummary)})]}),H.payloadRef&&p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),Y?p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Dt,{size:"sm"}),p.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):le?p.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):W?p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),p.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:$d(W.requestPayload)}),p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),p.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:$d(W.responsePayload)})]}):p.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),H.errorMessage&&p.jsxs("div",{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),p.jsx("p",{className:"font-mono text-[11px] text-offline",children:H.errorMessage})]})]}):p.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),p.jsx(An,{children:p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>I(null),children:"Close"})})]})}),p.jsx(es,{open:k,onOpenChange:oe=>{oe||j(!1)},children:p.jsxs(Ir,{children:[p.jsx(Pr,{children:p.jsx(zr,{children:"Clear all events"})}),p.jsx("div",{className:"p-4",children:p.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"This will permanently delete all request events. Commits are not affected. Are you sure?"})}),p.jsxs(An,{children:[p.jsx(Ie,{variant:"default",size:"sm",onClick:()=>j(!1),children:"Cancel"}),p.jsx(Ie,{variant:"destructive",size:"sm",onClick:he,disabled:L.isPending,children:L.isPending?"Clearing...":"Clear all"})]})]})})]})}const WY=ai({getParentRoute:()=>mi,path:"/config",component:bY}),JY=ai({getParentRoute:()=>mi,path:"/fleet",component:AY}),eX=ai({getParentRoute:()=>mi,path:"/",component:vY});function tX(){const{seq:e}=tA.useParams();return p.jsx(lx,{initialSelectedEntryId:`#${e}`})}const tA=ai({getParentRoute:()=>mi,path:"/investigate/commit/$seq",component:tX});function nX(){const{id:e}=nA.useParams();return p.jsx(lx,{initialSelectedEntryId:`E${e}`})}const nA=ai({getParentRoute:()=>mi,path:"/investigate/event/$id",component:nX}),rX=ai({getParentRoute:()=>mi,path:"/ops",component:UY}),sX=ai({getParentRoute:()=>mi,path:"/stream",component:lx}),rA=mi.addChildren([eX,sX,tA,nA,JY,rX,WY]),oX="syncular-console-basepath",iX="syncular-console-server-url",aX="syncular-console-token";function cX(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Mv(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return cX(n)}function sA(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function lX(){return sA(Mv(oX))}function uX(){const e=Mv(iX),t=Mv(aX);return!e||!t?null:{serverUrl:e,token:t}}zN({routeTree:rA,basepath:"/"});function fX(){return new hF({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function dX(e){return sA(e??lX())}function hX(e){const[t]=_.useState(()=>fX()),n=_.useMemo(()=>zN({routeTree:rA,basepath:dX(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?uX():e.defaultConfig;return p.jsx(pF,{client:t,children:p.jsx(_H,{defaultConfig:s,children:p.jsx(lH,{router:n})})})}function pX(e){return p.jsx("div",{className:cx,children:p.jsx(hX,{...e})})}function mX(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function gX(e,t={}){const n=mX(e);eY(n);const s=HB.createRoot(n),i=p.jsx(pX,{basePath:t.basePath,defaultConfig:t.defaultConfig});return t.strictMode===!1?(s.render(i),s):(s.render(p.jsx(_.StrictMode,{children:i})),s)}var yX={};const vX="syncular-sentry-dsn",bX="syncular-sentry-environment",xX="syncular-sentry-release";function lu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Py(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return lu(t)}function zy(e){if(!(typeof process>"u"))return lu(yX[e])}function Dy(e){for(const t of e)if(t)return t}function SX(){const e=Dy([lu(globalThis.__SYNCULAR_SENTRY_DSN__),Py(vX),zy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Dy([lu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Py(bX),zy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Dy([lu(globalThis.__SYNCULAR_SENTRY_RELEASE__),Py(xX),zy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const UR=SX();UR&&IB(UR);gX("#root");
|