@syncular/console 0.0.6-144 → 0.0.6-152
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.
|
@@ -6,7 +6,7 @@ Error:`,i)}}let Fg=null;function oR(e){const t="error";ci(t,e),li(t,qM)}function
|
|
|
6
6
|
${JSON.stringify(l)}
|
|
7
7
|
`),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Vs(f))}i(d)}}return typeof s=="string"?s:tP(s)}function tP(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 nP(e){return[{type:"span"},e]}function rP(e){const t=typeof e.data=="string"?Jy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const sP={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 Nw(e){return sP[e]}function MR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function oP(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:Gc(s)},...i&&{trace:i}}}function iP(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 aP(e,t,n,s){const i=MR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Gc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ma(a,[l])}function cP(e,t,n,s){const i=MR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";iP(e,n?.sdk);const l=oP(e,i,s,t);return delete e.sdkProcessingMetadata,ma(l,[[{type:a},e]])}function lP(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=to(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:Gc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!gh(yt(x),d)):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const y=f?x=>{const S=yt(x),w=f(S);return w||(Xy(),S)}:yt,b=[];for(const x of p){const S=y(x);S&&b.push(nP(S))}return ma(l,b)}function uP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=yt(e),{spanId:i}=e.spanContext(),a=ui(e),l=Dn(e),f=l===e,d=`[Tracing] Starting ${a?"sampled":"unsampled"} ${f?"root ":""}span`,p=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(s&&p.push(`parent ID: ${s}`),!f){const{op:g,description:y}=yt(l);p.push(`root ID: ${l.spanContext().spanId}`),g&&p.push(`root op: ${g}`),y&&p.push(`root description: ${y}`)}be.log(`${d}
|
|
8
8
|
${p.join(`
|
|
9
|
-
`)}`)}function fP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function dP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Lu]:t,[zu]:n}))}function jw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[zu],a=s[Lu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Aw=1e3;class sp{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[gn]:"manual",[eo]: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?Jv:TR}}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=Ji(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vs,"custom"),this}end(t){this._endTime||(this._endTime=Ji(t),fP(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[eo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:NR(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[gn],profile_id:this._attributes[Xv],exclusive_time:this._attributes[Kc],measurements:jw(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(this).spanContext().spanId:void 0,links:RR(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=kw(n)?n:s||cn(),a=kw(n)?{}:n||{},l={name:t,time:Ji(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?pP(lP([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&&(mh(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!Ow(yt(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}=mh(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Qd(this).filter(g=>g!==this&&!hP(g)).map(g=>yt(g)).filter(Ow),l=this._attributes[vs];delete this._attributes[_w],a.forEach(g=>{delete g.data[_w]});const f={contexts:{trace:LI(this)},spans:a.length>Aw?a.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,Aw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:to(this)},request:s,...l&&{transaction_info:{source:l}}},d=jw(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 kw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ow(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function hP(e){return e instanceof sp&&e.isStandaloneSpan()}function pP(e){const t=vt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function mP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return gP(i,t,n,s)}function gP(e,t,n,s){return qc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function yP(e,t,n){if(!ss(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=bu(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 IR="__SENTRY_SUPPRESS_TRACING__";function PR(e,t){const n=rb();if(n.startSpan)return n.startSpan(e,t);const s=zR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Du(f,()=>bP(a)(()=>{const p=bt(),g=LR(p,a),b=e.onlyIfParent&&!g?new ei:DR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return jc(p,b),mP(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Zc(e){const t=rb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=zR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Du(e.scope,l):i!==void 0?l=>nb(i,l):l=>l())(()=>{const l=bt(),f=LR(l,i);return e.onlyIfParent&&!f?new ei:DR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function nb(e,t){const n=rb();return n.withActiveSpan?n.withActiveSpan(e,t):Du(s=>(jc(s,e||void 0),t(s)))}function DR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!ss()){const l=new ei;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...to(l)};Wd(l,f)}return l}const i=Zr();let a;if(e&&!n)a=vP(e,s,t),jR(e,a);else if(e){const l=to(e),{traceId:f,spanId:d}=e.spanContext(),p=ui(e);a=Mw({traceId:f,parentSpanId:d,...t},s,p),Wd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=Mw({traceId:l,parentSpanId:d,...t},s,p),f&&Wd(a,f)}return uP(a),SI(a,s,i),a}function zR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=Ji(e.startTime),delete s.startTime,s}return n}function rb(){const e=da();return Vc(e)}function Mw(e,t,n){const s=vt(),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,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[IR]?[!1]:yP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:bu(p.dsc?.sample_rate)},p.sampleRand),x=new sp({...e,attributes:{[vs]:"custom",[Yv]:y!==void 0&&b?y: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 vP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[IR]?!1:ui(e),l=a?new sp({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});jR(e,l);const f=vt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function LR(e,t){if(t)return t;if(t===null)return;const n=Ac(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function bP(e){return e!==void 0?t=>nb(e,t):t=>t()}const Jd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},xP="heartbeatFailed",SP="idleTimeout",_P="finalTimeout",wP="externalFinish";function UR(e,t={}){const n=new Map;let s=!1,i,a=wP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Jd.idleTimeout,finalTimeout:p=Jd.finalTimeout,childSpanTimeout:g=Jd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!ss()){const j=new ei,A={sample_rate:"0",sampled:"false",...to(j)};return Wd(j,A),j}const S=bt(),w=Xn(),T=EP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[G,...B]=P,z=G||cn(),Q=Ji(z),Y=Qd(T).filter(U=>U!==T),ee=yt(T);if(!Y.length||!b)return L(Q),Reflect.apply(j,A,[Q,...B]);const D=x.getOptions().ignoreSpans,K=Y?.reduce((U,I)=>{const H=yt(I);return!H.timestamp||D&&gh(H,D)?U:U?Math.max(U,H.timestamp):H.timestamp},void 0),q=ee.start_timestamp,V=Math.min(q?q+p/1e3:1/0,Math.max(q||-1/0,Math.min(Q,K||1/0)));return L(V),Reflect.apply(j,A,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function k(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=SP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=xP,T.end(j))},g)}function R(j){C(),n.set(j,!0);const A=cn();N(A+g/1e3)}function M(j){if(n.has(j)&&n.delete(j),n.size===0){const A=cn();k(A+d/1e3)}}function L(j){s=!0,n.clear(),f.forEach(Y=>Y()),jc(S,w);const A=yt(T),{start_timestamp:P}=A;if(!P)return;A.data[vu]||T.setAttribute(vu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Qv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const z=Qd(T).filter(Y=>Y!==T);let Q=0;z.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:hn,message:"cancelled"}),Y.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));const ee=yt(Y),{timestamp:D=0,start_timestamp:K=0}=ee,q=K<=j,V=(p+d)/1e3,U=D-K<=V;if(Ce){const I=JSON.stringify(Y,void 0,2);q?U||be.log("[Tracing] Discarding span since it finished after idle span final timeout",I):be.log("[Tracing] Discarding span since it happened after idle span was finished",I)}(!U||!q)&&(HI(T,Y),Q++)}),Q>0&&T.setAttribute("sentry.idle_span_discarded_spans",Q)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof sp&&j.isStandaloneSpan())return;Qd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||M(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(l=!0,k(),n.size&&N())})),t.disableAutoFinish||k(),setTimeout(()=>{s||(T.setStatus({code:hn,message:"deadline_exceeded"}),a=_P,T.end())},p),T}function EP(e){const t=Zc(e);return jc(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Kg=0,Iw=1,Pw=2;function Uu(e){return new xu(t=>{t(e)})}function sb(e){return new xu((t,n)=>{n(e)})}class xu{constructor(t){this._state=Kg,this._handlers=[],this._runExecutor(t)}then(t,n){return new xu((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 xu((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===Kg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Iw&&n[1](this._value),this._state===Pw&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Kg){if(qc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(Iw,a)},i=a=>{n(Pw,a)};try{t(s,i)}catch(a){i(a)}}}function TP(e,t,n,s=0){try{const i=ev(t,n,e,s);return qc(i)?i:Uu(i)}catch(i){return sb(i)}}function ev(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`),qc(a)?a.then(l=>ev(l,t,n,s+1)):ev(a,t,n,s+1)}let Bi,Dw,zw,zo;function CP(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(zo&&s.length===Dw&&i.length===zw)return zo;Dw=s.length,zw=i.length,zo={},Bi||(Bi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Bi?.[d];if(g&&zo&&p)zo[g[0]]=p,Bi&&(Bi[d]=[g[0],p]);else if(p){const y=e(d);for(let b=y.length-1;b>=0;b--){const S=y[b]?.filename;if(S&&zo&&Bi){zo[S]=p,Bi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),zo}function RP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;NP(e,t),s&&kP(e,s),OP(e,n),jP(e,i),AP(e,a)}function Lw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Wl(e,"extra",n),Wl(e,"tags",s),Wl(e,"attributes",i),Wl(e,"user",a),Wl(e,"contexts",l),e.sdkProcessingMetadata=Pu(e.sdkProcessingMetadata,d,2),f&&(e.level=f),S&&(e.transactionName=S),w&&(e.span=w),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),g.length&&(e.fingerprint=[...e.fingerprint,...g]),y.length&&(e.eventProcessors=[...e.eventProcessors,...y]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function Wl(e,t,n){e[t]=Pu(e[t],n,1)}function op(e,t){const n=pI().getScopeData();return e&&Lw(n,e.getScopeData()),t&&Lw(n,t.getScopeData()),n}function NP(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 jP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function AP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function kP(e,t){e.contexts={trace:CR(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function OP(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||qr(),timestamp:t.timestamp||pa()},p=n.integrations||e.integrations.map(C=>C.name);IP(d,e),zP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&PP(d,e.stackParser);const g=UP(s,n.captureContext);n.mechanism&&Rc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=op(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),RP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Uu(d):TP(S,d,n)).then(C=>(C&&DP(C),typeof l=="number"&&l>0?LP(C,l,f):C))}function IP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||eb,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=Ky(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Ky(f.value,a))})}function PP(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 DP(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 zP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function LP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))},...e.user&&{user:Vs(e.user,t,n)},...e.contexts&&{contexts:Vs(e.contexts,t,n)},...e.extra&&{extra:Vs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Vs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Vs(e.contexts.flags,3,n)),s}function UP(e,t){if(!t)return e;const n=e?e.clone():new Js;return n.update(t),n}function $R(e,t){return bt().captureException(e,void 0)}function BR(e,t){return bt().captureEvent(e,t)}function $P(e,t){Zr().setContext(e,t)}function BP(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Uw(e){const t=Zr(),{user:n}=op(t,bt()),{userAgent:s}=ct.navigator||{},i=sI({user:n,...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Nc(a,{status:"exited"}),FR(),t.setSession(i),i}function FR(){const e=Zr(),n=bt().getSession()||e.getSession();n&&oI(n),HR(),e.setSession()}function HR(){const e=Zr(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function Gg(e=!1){if(e){FR();return}HR()}const FP="7";function HP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function qP(e){return`${HP(e)}${e.projectId}/envelope/`}function VP(e,t){const n={sentry_version:FP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function KP(e,t,n){return t||`${qP(e)}?${VP(e,n)}`}const $w=[];function GP(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 ZP(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 GP(s)}function YP(e,t){const n={};return t.forEach(s=>{s&&qR(e,s,n)}),n}function Bw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function qR(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,!$w.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),$w.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 XP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function QP(e,t){const{value:n,unit:s}=XP(e)?e:{value:e,unit:void 0},i=WP(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 yh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=QP(i,t);a&&(n[s]=a)}return n}function WP(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 VR(e,t){return t?Du(t,()=>{const n=Xn(),s=n?CR(n):mR(t);return[n?to(n):tb(e,t),s]}):[void 0,void 0]}const JP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function eD(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function tD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[eD(e)])}const nD=100;function ps(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function rD(e,t){const n=ob(),s=KR(e);s===void 0?n.set(e,[t]):s.length>=nD?(vh(e,s),n.set(e,[t])):n.set(e,[...s,t])}function sD(e,t=bt(),n=rD){const s=t?.getClient()??vt();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]=VR(s,t),p={...e.attributes},{user:{id:g,email:y,username:b},attributes:x={}}=op(Zr(),t);ps(p,"user.id",g,!1),ps(p,"user.email",y,!1),ps(p,"user.name",b,!1),ps(p,"sentry.release",i),ps(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};ps(p,"sentry.sdk.name",S),ps(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);ps(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&ps(p,"sentry._internal.replay_is_buffering",!0);const k=e.message;if(np(k)){const{__sentry_template_string__:B,__sentry_template_values__:z=[]}=k;z?.length&&(p["sentry.message.template"]=B),z.forEach((Q,Y)=>{p[`sentry.message.parameter.${Y}`]=Q})}const N=Ac(t);ps(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const M=f?ha(()=>f(R)):R;if(!M){s.recordDroppedEvent("before_send","log_item",1),Ce&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:L,message:j,attributes:A={},severityNumber:P}=M,G={timestamp:cn(),level:L,body:j,trace_id:d?.trace_id,severity_number:P??JP[L],attributes:{...yh(x),...yh(A,!0)}};n(s,G),s.emit("afterCaptureLog",M)}function vh(e,t){const n=t??KR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=tD(n,s._metadata,s.tunnel,e.getDsn());ob().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function KR(e){return ob().get(e)}function ob(){return Fc("clientToLogBufferMap",()=>new WeakMap)}function oD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function iD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[oD(e)])}const aD=1e3;function Fs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function cD(e,t){const n=ab(),s=GR(e);s===void 0?n.set(e,[t]):s.length>=aD?(ib(e,s),n.set(e,[t])):n.set(e,[...s,t])}function lD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Fs(a,"user.id",n.id,!1),Fs(a,"user.email",n.email,!1),Fs(a,"user.name",n.username,!1),Fs(a,"sentry.release",s),Fs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Fs(a,"sentry.sdk.name",l),Fs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Fs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Fs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function uD(e,t,n,s){const[,i]=VR(t,n),a=Ac(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:cn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...yh(s),...yh(e.attributes,"skip-undefined")}}}function fD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??cD,i=n?.getClient()??vt();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:p,attributes:g}=op(Zr(),n),y=lD(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Ce&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=uD(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ib(e,t){const n=t??GR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=iD(n,s._metadata,s.tunnel,e.getDsn());ab().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function GR(e){return ab().get(e)}function ab(){return Fc("clientToMetricBufferMap",()=>new WeakMap)}function ZR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const cb=Symbol.for("SentryBufferFullError");function lb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return sb(cb);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Uu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(p=>ZR(setTimeout(()=>p(!1),l)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const dD=60*1e3;function hD(e,t=Iu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?dD:s-t}function pD(e,t){return e[t]||e.all||0}function mD(e,t,n=Iu()){return pD(e,t)>n}function gD(e,{statusCode:t,headers:n},s=Iu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(a)for(const f of a.trim().split(",")){const[d,p,,,g]=f.split(":",5),y=parseInt(d,10),b=(isNaN(y)?60:y)*1e3;if(!p)i.all=s+b;else for(const x of p.split(";"))x==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[x]=s+b):i[x]=s+b}else l?i.all=s+hD(l,s):t===429&&(i.all=s+60*1e3);return i}const YR=64;function yD(e,t,n=lb(e.bufferSize||YR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Wy(l,(y,b)=>{const x=Nw(b);mD(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=ma(l[0],f),p=y=>{if(JI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Wy(d,(b,x)=>{e.recordDroppedEvent(y,Nw(x))})},g=()=>t({body:eP(d)}).then(y=>y.statusCode===413?(Ce&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Ce&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=gD(s,y),y),y=>{throw p("network_error"),Ce&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===cb)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function vD(e,t,n){const s=[{type:"client_report"},{timestamp:pa(),discarded_events:e}];return ma(t?{dsn:t}:{},[s])}function XR(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 bD(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?.[Xv],exclusive_time:l?.[Kc],measurements:e.measurements,is_segment:!0}}function xD(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&&{[Xv]:e.profile_id},...e.exclusive_time&&{[Kc]:e.exclusive_time}}}},measurements:e.measurements}}const Fw="Not capturing exception because it's already been captured.",Hw="Discarded session because of missing or non-string release",QR=Symbol.for("SentryInternalError"),WR=Symbol.for("SentryDoNotSendEventError"),SD=5e3;function eh(e){return{message:e,[QR]:!0}}function Zg(e){return{message:e,[WR]:!0}}function qw(e){return!!e&&typeof e=="object"&&QR in e}function Vw(e){return!!e&&typeof e=="object"&&WR in e}function Kw(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=ZR(setTimeout(()=>{i(e)},SD)))}),e.on("flush",()=>{i(e)})}class _D{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=lb(t.transportOptions?.bufferSize??YR),t.dsn?this._dsn=II(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=KP(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&&Kw(this,"afterCaptureLog","flushLogs",CD,vh),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Kw(this,"afterCaptureMetric","flushMetrics",TD,ib)}captureException(t,n,s){const i=qr();if(bw(t))return Ce&&be.log(Fw),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:qr(),...s},l=np(t)?t:String(t),f=Cc(t),d=f?this.eventFromMessage(l,n,a):this.eventFromException(t,a);return this._process(()=>d.then(p=>this._captureEvent(p,a,i)),f?"unknown":"error"),a.event_id}captureEvent(t,n,s){const i=qr();if(n?.originalException&&bw(n.originalException))return Ce&&be.log(Fw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Gw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Nc(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){vh(this);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];qR(this,t,this._integrations),n||Bw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=cP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=WI(s,rP(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=eb}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn(Hw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn(Hw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=aP(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=YP(this,t),Bw(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)&&(Nc(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:mR(s),...f.contexts};const d=tb(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=Zr()){return Ce&&tv(t)&&be.log(`Captured error event \`${XR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(Vw(a)?be.log(a.message):qw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=JR(t),d=tv(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:bu(l);if(d&&typeof y=="number"&&Vo()>y)return this.recordDroppedEvent("sample_rate","error"),sb(Zg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Gw(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=ED(this,a,x,n);return wD(w,g)}).then(x=>{if(x===null){if(this.recordDroppedEvent("before_send",b),f){const C=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",C)}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,C=x.spans?x.spans.length:0,k=T-C;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 Vw(x)||qw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),eh(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
9
|
+
`)}`)}function fP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function dP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Lu]:t,[zu]:n}))}function jw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[zu],a=s[Lu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Aw=1e3;class sp{constructor(t={}){this._traceId=t.traceId||Ws(),this._spanId=t.spanId||Zs(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[gn]:"manual",[eo]: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?Jv:TR}}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=Ji(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vs,"custom"),this}end(t){this._endTime||(this._endTime=Ji(t),fP(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[eo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:NR(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[gn],profile_id:this._attributes[Xv],exclusive_time:this._attributes[Kc],measurements:jw(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(this).spanContext().spanId:void 0,links:RR(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=kw(n)?n:s||cn(),a=kw(n)?{}:n||{},l={name:t,time:Ji(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?pP(lP([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&&(mh(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!Ow(yt(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}=mh(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Qd(this).filter(g=>g!==this&&!hP(g)).map(g=>yt(g)).filter(Ow),l=this._attributes[vs];delete this._attributes[_w],a.forEach(g=>{delete g.data[_w]});const f={contexts:{trace:LI(this)},spans:a.length>Aw?a.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,Aw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:to(this)},request:s,...l&&{transaction_info:{source:l}}},d=jw(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 kw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ow(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function hP(e){return e instanceof sp&&e.isStandaloneSpan()}function pP(e){const t=vt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function mP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return gP(i,t,n,s)}function gP(e,t,n,s){return qc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function yP(e,t,n){if(!ss(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=bu(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 IR="__SENTRY_SUPPRESS_TRACING__";function PR(e,t){const n=rb();if(n.startSpan)return n.startSpan(e,t);const s=zR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Du(f,()=>bP(a)(()=>{const p=bt(),g=LR(p,a),b=e.onlyIfParent&&!g?new ei:DR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return jc(p,b),mP(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Zc(e){const t=rb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=zR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Du(e.scope,l):i!==void 0?l=>nb(i,l):l=>l())(()=>{const l=bt(),f=LR(l,i);return e.onlyIfParent&&!f?new ei:DR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function nb(e,t){const n=rb();return n.withActiveSpan?n.withActiveSpan(e,t):Du(s=>(jc(s,e||void 0),t(s)))}function DR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!ss()){const l=new ei;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...to(l)};Wd(l,f)}return l}const i=Zr();let a;if(e&&!n)a=vP(e,s,t),jR(e,a);else if(e){const l=to(e),{traceId:f,spanId:d}=e.spanContext(),p=ui(e);a=Mw({traceId:f,parentSpanId:d,...t},s,p),Wd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=Mw({traceId:l,parentSpanId:d,...t},s,p),f&&Wd(a,f)}return uP(a),SI(a,s,i),a}function zR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=Ji(e.startTime),delete s.startTime,s}return n}function rb(){const e=da();return Vc(e)}function Mw(e,t,n){const s=vt(),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,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[IR]?[!1]:yP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:bu(p.dsc?.sample_rate)},p.sampleRand),x=new sp({...e,attributes:{[vs]:"custom",[Yv]:y!==void 0&&b?y: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 vP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[IR]?!1:ui(e),l=a?new sp({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});jR(e,l);const f=vt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function LR(e,t){if(t)return t;if(t===null)return;const n=Ac(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function bP(e){return e!==void 0?t=>nb(e,t):t=>t()}const Jd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},xP="heartbeatFailed",SP="idleTimeout",_P="finalTimeout",wP="externalFinish";function UR(e,t={}){const n=new Map;let s=!1,i,a=wP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Jd.idleTimeout,finalTimeout:p=Jd.finalTimeout,childSpanTimeout:g=Jd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!ss()){const j=new ei,k={sample_rate:"0",sampled:"false",...to(j)};return Wd(j,k),j}const S=bt(),w=Xn(),T=EP(e);T.end=new Proxy(T.end,{apply(j,k,P){if(y&&y(T),k instanceof ei)return;const[G,...B]=P,z=G||cn(),Q=Ji(z),Y=Qd(T).filter(U=>U!==T),ee=yt(T);if(!Y.length||!b)return L(Q),Reflect.apply(j,k,[Q,...B]);const D=x.getOptions().ignoreSpans,K=Y?.reduce((U,I)=>{const H=yt(I);return!H.timestamp||D&&gh(H,D)?U:U?Math.max(U,H.timestamp):H.timestamp},void 0),q=ee.start_timestamp,V=Math.min(q?q+p/1e3:1/0,Math.max(q||-1/0,Math.min(Q,K||1/0)));return L(V),Reflect.apply(j,k,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function A(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=SP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=xP,T.end(j))},g)}function R(j){C(),n.set(j,!0);const k=cn();N(k+g/1e3)}function M(j){if(n.has(j)&&n.delete(j),n.size===0){const k=cn();A(k+d/1e3)}}function L(j){s=!0,n.clear(),f.forEach(Y=>Y()),jc(S,w);const k=yt(T),{start_timestamp:P}=k;if(!P)return;k.data[vu]||T.setAttribute(vu,a);const B=k.status;(!B||B==="unknown")&&T.setStatus({code:Qv}),be.log(`[Tracing] Idle span "${k.op}" finished`);const z=Qd(T).filter(Y=>Y!==T);let Q=0;z.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:hn,message:"cancelled"}),Y.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));const ee=yt(Y),{timestamp:D=0,start_timestamp:K=0}=ee,q=K<=j,V=(p+d)/1e3,U=D-K<=V;if(Ce){const I=JSON.stringify(Y,void 0,2);q?U||be.log("[Tracing] Discarding span since it finished after idle span final timeout",I):be.log("[Tracing] Discarding span since it happened after idle span was finished",I)}(!U||!q)&&(HI(T,Y),Q++)}),Q>0&&T.setAttribute("sentry.idle_span_discarded_spans",Q)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof sp&&j.isStandaloneSpan())return;Qd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||M(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(l=!0,A(),n.size&&N())})),t.disableAutoFinish||A(),setTimeout(()=>{s||(T.setStatus({code:hn,message:"deadline_exceeded"}),a=_P,T.end())},p),T}function EP(e){const t=Zc(e);return jc(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Kg=0,Iw=1,Pw=2;function Uu(e){return new xu(t=>{t(e)})}function sb(e){return new xu((t,n)=>{n(e)})}class xu{constructor(t){this._state=Kg,this._handlers=[],this._runExecutor(t)}then(t,n){return new xu((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 xu((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===Kg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Iw&&n[1](this._value),this._state===Pw&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Kg){if(qc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(Iw,a)},i=a=>{n(Pw,a)};try{t(s,i)}catch(a){i(a)}}}function TP(e,t,n,s=0){try{const i=ev(t,n,e,s);return qc(i)?i:Uu(i)}catch(i){return sb(i)}}function ev(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`),qc(a)?a.then(l=>ev(l,t,n,s+1)):ev(a,t,n,s+1)}let Bi,Dw,zw,zo;function CP(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(zo&&s.length===Dw&&i.length===zw)return zo;Dw=s.length,zw=i.length,zo={},Bi||(Bi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Bi?.[d];if(g&&zo&&p)zo[g[0]]=p,Bi&&(Bi[d]=[g[0],p]);else if(p){const y=e(d);for(let b=y.length-1;b>=0;b--){const S=y[b]?.filename;if(S&&zo&&Bi){zo[S]=p,Bi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),zo}function RP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;NP(e,t),s&&kP(e,s),OP(e,n),jP(e,i),AP(e,a)}function Lw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Wl(e,"extra",n),Wl(e,"tags",s),Wl(e,"attributes",i),Wl(e,"user",a),Wl(e,"contexts",l),e.sdkProcessingMetadata=Pu(e.sdkProcessingMetadata,d,2),f&&(e.level=f),S&&(e.transactionName=S),w&&(e.span=w),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),g.length&&(e.fingerprint=[...e.fingerprint,...g]),y.length&&(e.eventProcessors=[...e.eventProcessors,...y]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function Wl(e,t,n){e[t]=Pu(e[t],n,1)}function op(e,t){const n=pI().getScopeData();return e&&Lw(n,e.getScopeData()),t&&Lw(n,t.getScopeData()),n}function NP(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 jP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function AP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function kP(e,t){e.contexts={trace:CR(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:to(t),...e.sdkProcessingMetadata};const n=Dn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function OP(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||qr(),timestamp:t.timestamp||pa()},p=n.integrations||e.integrations.map(C=>C.name);IP(d,e),zP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&PP(d,e.stackParser);const g=UP(s,n.captureContext);n.mechanism&&Rc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=op(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),RP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Uu(d):TP(S,d,n)).then(C=>(C&&DP(C),typeof l=="number"&&l>0?LP(C,l,f):C))}function IP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||eb,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=Ky(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Ky(f.value,a))})}function PP(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 DP(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 zP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function LP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))},...e.user&&{user:Vs(e.user,t,n)},...e.contexts&&{contexts:Vs(e.contexts,t,n)},...e.extra&&{extra:Vs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Vs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Vs(e.contexts.flags,3,n)),s}function UP(e,t){if(!t)return e;const n=e?e.clone():new Js;return n.update(t),n}function $R(e,t){return bt().captureException(e,void 0)}function BR(e,t){return bt().captureEvent(e,t)}function $P(e,t){Zr().setContext(e,t)}function BP(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Uw(e){const t=Zr(),{user:n}=op(t,bt()),{userAgent:s}=ct.navigator||{},i=sI({user:n,...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Nc(a,{status:"exited"}),FR(),t.setSession(i),i}function FR(){const e=Zr(),n=bt().getSession()||e.getSession();n&&oI(n),HR(),e.setSession()}function HR(){const e=Zr(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function Gg(e=!1){if(e){FR();return}HR()}const FP="7";function HP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function qP(e){return`${HP(e)}${e.projectId}/envelope/`}function VP(e,t){const n={sentry_version:FP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function KP(e,t,n){return t||`${qP(e)}?${VP(e,n)}`}const $w=[];function GP(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 ZP(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 GP(s)}function YP(e,t){const n={};return t.forEach(s=>{s&&qR(e,s,n)}),n}function Bw(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function qR(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,!$w.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),$w.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 XP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function QP(e,t){const{value:n,unit:s}=XP(e)?e:{value:e,unit:void 0},i=WP(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 yh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=QP(i,t);a&&(n[s]=a)}return n}function WP(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 VR(e,t){return t?Du(t,()=>{const n=Xn(),s=n?CR(n):mR(t);return[n?to(n):tb(e,t),s]}):[void 0,void 0]}const JP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function eD(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function tD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[eD(e)])}const nD=100;function ps(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function rD(e,t){const n=ob(),s=KR(e);s===void 0?n.set(e,[t]):s.length>=nD?(vh(e,s),n.set(e,[t])):n.set(e,[...s,t])}function sD(e,t=bt(),n=rD){const s=t?.getClient()??vt();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]=VR(s,t),p={...e.attributes},{user:{id:g,email:y,username:b},attributes:x={}}=op(Zr(),t);ps(p,"user.id",g,!1),ps(p,"user.email",y,!1),ps(p,"user.name",b,!1),ps(p,"sentry.release",i),ps(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};ps(p,"sentry.sdk.name",S),ps(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);ps(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&ps(p,"sentry._internal.replay_is_buffering",!0);const A=e.message;if(np(A)){const{__sentry_template_string__:B,__sentry_template_values__:z=[]}=A;z?.length&&(p["sentry.message.template"]=B),z.forEach((Q,Y)=>{p[`sentry.message.parameter.${Y}`]=Q})}const N=Ac(t);ps(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const M=f?ha(()=>f(R)):R;if(!M){s.recordDroppedEvent("before_send","log_item",1),Ce&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:L,message:j,attributes:k={},severityNumber:P}=M,G={timestamp:cn(),level:L,body:j,trace_id:d?.trace_id,severity_number:P??JP[L],attributes:{...yh(x),...yh(k,!0)}};n(s,G),s.emit("afterCaptureLog",M)}function vh(e,t){const n=t??KR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=tD(n,s._metadata,s.tunnel,e.getDsn());ob().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function KR(e){return ob().get(e)}function ob(){return Fc("clientToLogBufferMap",()=>new WeakMap)}function oD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function iD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Gc(s)),ma(i,[oD(e)])}const aD=1e3;function Fs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function cD(e,t){const n=ab(),s=GR(e);s===void 0?n.set(e,[t]):s.length>=aD?(ib(e,s),n.set(e,[t])):n.set(e,[...s,t])}function lD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Fs(a,"user.id",n.id,!1),Fs(a,"user.email",n.email,!1),Fs(a,"user.name",n.username,!1),Fs(a,"sentry.release",s),Fs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Fs(a,"sentry.sdk.name",l),Fs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Fs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Fs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function uD(e,t,n,s){const[,i]=VR(t,n),a=Ac(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:cn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...yh(s),...yh(e.attributes,"skip-undefined")}}}function fD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??cD,i=n?.getClient()??vt();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:p,attributes:g}=op(Zr(),n),y=lD(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Ce&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=uD(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ib(e,t){const n=t??GR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=iD(n,s._metadata,s.tunnel,e.getDsn());ab().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function GR(e){return ab().get(e)}function ab(){return Fc("clientToMetricBufferMap",()=>new WeakMap)}function ZR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const cb=Symbol.for("SentryBufferFullError");function lb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return sb(cb);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Uu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(p=>ZR(setTimeout(()=>p(!1),l)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const dD=60*1e3;function hD(e,t=Iu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?dD:s-t}function pD(e,t){return e[t]||e.all||0}function mD(e,t,n=Iu()){return pD(e,t)>n}function gD(e,{statusCode:t,headers:n},s=Iu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(a)for(const f of a.trim().split(",")){const[d,p,,,g]=f.split(":",5),y=parseInt(d,10),b=(isNaN(y)?60:y)*1e3;if(!p)i.all=s+b;else for(const x of p.split(";"))x==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[x]=s+b):i[x]=s+b}else l?i.all=s+hD(l,s):t===429&&(i.all=s+60*1e3);return i}const YR=64;function yD(e,t,n=lb(e.bufferSize||YR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Wy(l,(y,b)=>{const x=Nw(b);mD(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=ma(l[0],f),p=y=>{if(JI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Wy(d,(b,x)=>{e.recordDroppedEvent(y,Nw(x))})},g=()=>t({body:eP(d)}).then(y=>y.statusCode===413?(Ce&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Ce&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=gD(s,y),y),y=>{throw p("network_error"),Ce&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===cb)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function vD(e,t,n){const s=[{type:"client_report"},{timestamp:pa(),discarded_events:e}];return ma(t?{dsn:t}:{},[s])}function XR(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 bD(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?.[Xv],exclusive_time:l?.[Kc],measurements:e.measurements,is_segment:!0}}function xD(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&&{[Xv]:e.profile_id},...e.exclusive_time&&{[Kc]:e.exclusive_time}}}},measurements:e.measurements}}const Fw="Not capturing exception because it's already been captured.",Hw="Discarded session because of missing or non-string release",QR=Symbol.for("SentryInternalError"),WR=Symbol.for("SentryDoNotSendEventError"),SD=5e3;function eh(e){return{message:e,[QR]:!0}}function Zg(e){return{message:e,[WR]:!0}}function qw(e){return!!e&&typeof e=="object"&&QR in e}function Vw(e){return!!e&&typeof e=="object"&&WR in e}function Kw(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=ZR(setTimeout(()=>{i(e)},SD)))}),e.on("flush",()=>{i(e)})}class _D{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=lb(t.transportOptions?.bufferSize??YR),t.dsn?this._dsn=II(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=KP(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&&Kw(this,"afterCaptureLog","flushLogs",CD,vh),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Kw(this,"afterCaptureMetric","flushMetrics",TD,ib)}captureException(t,n,s){const i=qr();if(bw(t))return Ce&&be.log(Fw),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:qr(),...s},l=np(t)?t:String(t),f=Cc(t),d=f?this.eventFromMessage(l,n,a):this.eventFromException(t,a);return this._process(()=>d.then(p=>this._captureEvent(p,a,i)),f?"unknown":"error"),a.event_id}captureEvent(t,n,s){const i=qr();if(n?.originalException&&bw(n.originalException))return Ce&&be.log(Fw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Gw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Nc(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){vh(this);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];qR(this,t,this._integrations),n||Bw(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=cP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=WI(s,rP(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=eb}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn(Hw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn(Hw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=aP(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=YP(this,t),Bw(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)&&(Nc(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:mR(s),...f.contexts};const d=tb(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=Zr()){return Ce&&tv(t)&&be.log(`Captured error event \`${XR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(Vw(a)?be.log(a.message):qw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=JR(t),d=tv(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:bu(l);if(d&&typeof y=="number"&&Vo()>y)return this.recordDroppedEvent("sample_rate","error"),sb(Zg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Gw(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=ED(this,a,x,n);return wD(w,g)}).then(x=>{if(x===null){if(this.recordDroppedEvent("before_send",b),f){const C=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",C)}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,C=x.spans?x.spans.length:0,A=T-C;A>0&&this.recordDroppedEvent("before_send","span",A)}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 Vw(x)||qw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),eh(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
10
|
Reason: ${x}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(s=>(this._numProcessing--,s),s=>(this._numProcessing--,s===cb&&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=vD(t,this._options.tunnel&&Gc(this._dsn));this.sendEnvelope(n)}}function Gw(e){return e==="replay_event"?"replay":e||"error"}function wD(e,t){const n=`${t} must return \`null\` or a valid event.`;if(qc(e))return e.then(s=>{if(!yu(s)&&s!==null)throw eh(n);return s},s=>{throw eh(`${t} rejected with ${s}`)});if(!yu(e)&&e!==null)throw eh(n);return e}function ED(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(tv(d)&&i)return i(d,s);if(JR(d)){if(l||f){const p=bD(d);if(f?.length&&gh(p,f))return null;if(l){const g=l(p);g?d=Pu(n,xD(g)):Xy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&gh(x,f)){VI(y,x);continue}if(l){const S=l(x);S?g.push(S):(Xy(),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 p=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return a(d,s)}}return d}function tv(e){return e.type===void 0}function JR(e){return e.type==="transaction"}function TD(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+e1(e.attributes)}function CD(e){let t=0;return e.message&&(t+=e.message.length*2),t+e1(e.attributes)}function e1(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Zw(n[0]):Cc(n)?t+=Zw(n):t+=100}),t}function Zw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function RD(e){return tp(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Yw(e){return RD(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function ND(e,t){t.debug===!0&&(Ce?be.enable():ha(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),bt().update(t.initialScope);const s=new e(t);return jD(s),s.init(),s}function jD(e){bt().setClient(e)}const AD="thismessage:/";function t1(e){return"isRelative"in e}function n1(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?AD: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 kD(e){if(t1(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 ta(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 OD(e){return e.split(/[?#]/,1)[0]}function Go(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 MD(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 ID=MD;function PD(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 r1(e,t,n=[t],s="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(a=>({name:`${s}:@sentry/${a}`,version:Wi})),i.version=Wi)}function s1(e={}){const t=e.client||vt();if(!BP()||!t)return{};const n=da(),s=Vc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?UI(a):DD(i),f=a?to(a):tb(t,i),d=EI(f);if(!_R.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):zD(i)),g}function DD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return wR(t,s,n)}function zD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return ER(t,s,n)}const LD=100;function oa(e,t){const n=vt(),s=Zr();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=LD}=n.getOptions();if(a<=0)return;const f={timestamp:pa(),...e},d=i?ha(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let Xw;const UD="FunctionToString",Qw=new WeakMap,$D=(()=>({name:UD,setupOnce(){Xw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Zv(this),n=Qw.has(vt())&&t!==void 0?t:this;return Xw.apply(n,e)}}catch{}},setup(e){Qw.set(e,!0)}})),BD=$D,FD=[/^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$/],HD="EventFilters",qD=(e={})=>{let t;return{name:HD,setup(n){const s=n.getOptions();t=Ww(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Ww(e,a)}return KD(n,t)?null:n}}},VD=((e={})=>({...qD(e),name:"InboundFilters"}));function Ww(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:FD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function KD(e,t){if(e.type){if(e.type==="transaction"&&ZD(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
11
|
Event: ${Ki(e)}`),!0}else{if(GD(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
12
|
Event: ${Ki(e)}`),!0;if(WD(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
@@ -18,7 +18,7 @@ Url: ${bh(e)}`),!0}return!1}function GD(e,t){return t?.length?XR(e).some(n=>Ko(n
|
|
|
18
18
|
Type: ${e}
|
|
19
19
|
Name: ${Xs(s)}
|
|
20
20
|
Error:`,i)}}function bz(){return oz(e=>{Vu("cls",{metric:e}),v1=e},{reportAllChanges:!0})}function xz(){return pz(e=>{Vu("lcp",{metric:e}),b1=e},{reportAllChanges:!0})}function Sz(){return gz(e=>{Vu("ttfb",{metric:e}),x1=e})}function _z(){return fz(e=>{Vu("inp",{metric:e}),S1=e})}function ap(e,t,n,s,i=!1){E1(e,t);let a;return wh[e]||(a=n(),wh[e]=!0),s&&t({metric:s}),T1(e,t,i?a:void 0)}function wz(e){const t={};e==="event"&&(t.durationThreshold=0),Qc(e,n=>{Vu(e,{entries:n})},t)}function E1(e,t){uu[e]=uu[e]||[],uu[e].push(t)}function T1(e,t,n){return()=>{n&&n();const s=uu[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function Ez(e){return"duration"in e}const Tz=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Zo("visibilitychange",t,{capture:!0,once:!0}),Zo("pagehide",t,{capture:!0,once:!0})};function Jg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=yt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),nb(e,()=>{const a=Zc({startTime:t,...s});return a&&a.end(n),a})}function yb(e){const t=vt();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(),y=bt(),b=y.getUser(),x=b!==void 0?b.email||b.id||b.ip_address:void 0;let S;try{S=y.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":Ge.navigator?.userAgent,"client.address":d?"{{auto}}":void 0,...i};return Zc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Ku(){return Ge.addEventListener&&Ge.performance}function Xt(e){return e/1e3}function Cz(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 C1(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function R1(e,t){let n,s=!1;function i(f){!s&&n&&t(f,n),s=!0}Tz(()=>{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 Rz(e){let t=0,n;if(!C1("layout-shift"))return;const s=_1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);R1(e,(i,a)=>{Nz(t,n,a,i),s()})}function Nz(e,t,n,s){$u&&be.log(`Sending CLS span (${e})`);const i=t?Xt((Sr()||0)+t.startTime):cn(),a=bt().getScopeData().transactionName,l=t?Vr(t.sources[0]?.node):"Layout shift",f={[gn]:"auto.http.browser.cls",[eo]:"ui.webvital.cls",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((p,g)=>{f[`cls.source.${g+1}`]=Vr(p.node)});const d=yb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[zu]:"",[Lu]:e}),d.end(i))}function jz(e){let t=0,n;if(!C1("largest-contentful-paint"))return;const s=w1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);R1(e,(i,a)=>{Az(t,n,a,i),s()})}function Az(e,t,n,s){$u&&be.log(`Sending LCP span (${e})`);const i=Xt((Sr()||0)+(t?.startTime||0)),a=bt().getScopeData().transactionName,l=t?Vr(t.element):"Largest contentful paint",f={[gn]:"auto.http.browser.lcp",[eo]:"ui.webvital.lcp",[Kc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=Vr(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=yb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[zu]:"millisecond",[Lu]:e}),d.end(i))}function Pr(e){return e&&((Sr()||performance.timeOrigin)+e)/1e3}function N1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=Cz(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Ku()?.timeOrigin?kz({...t,"http.request.redirect_start":Pr(e.redirectStart),"http.request.redirect_end":Pr(e.redirectEnd),"http.request.worker_start":Pr(e.workerStart),"http.request.fetch_start":Pr(e.fetchStart),"http.request.domain_lookup_start":Pr(e.domainLookupStart),"http.request.domain_lookup_end":Pr(e.domainLookupEnd),"http.request.connect_start":Pr(e.connectStart),"http.request.secure_connection_start":Pr(e.secureConnectionStart),"http.request.connection_end":Pr(e.connectEnd),"http.request.request_start":Pr(e.requestStart),"http.request.response_start":Pr(e.responseStart),"http.request.response_end":Pr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function kz(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Oz=2147483647;let aE=0,ns={},Kn,Eh;function Mz({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Ku();if(s&&Sr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?jz(n):Lz(),a=Uz(),l=e?Rz(n):zz();return()=>{i?.(),a(),l?.()}}return()=>{}}function Iz(){Mc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=yt(t);for(const i of e){const a=Xt(Sr()+i.startTime),l=Xt(i.duration);n==="navigation"&&s&&a<s||ti(t,a,a+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[gn]:"auto.ui.browser.metrics"}})}})}function Pz(){new PerformanceObserver(t=>{const n=Xn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Xt(Sr()+s.startTime),{start_timestamp:a,op:l}=yt(n);if(l==="navigation"&&a&&i<a)continue;const f=Xt(s.duration),d={[gn]:"auto.ui.browser.metrics"},p=s.scripts[0],{invoker:g,invokerType:y,sourceURL:b,sourceFunctionName:x,sourceCharPosition:S}=p;d["browser.script.invoker"]=g,d["browser.script.invoker_type"]=y,b&&(d["code.filepath"]=b),x&&(d["code.function"]=x),S!==-1&&(d["browser.script.source_char_position"]=S),ti(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function Dz(){Mc("event",({entries:e})=>{const t=Xn();if(t){for(const n of e)if(n.name==="click"){const s=Xt(Sr()+n.startTime),i=Xt(n.duration),a={name:Vr(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[gn]:"auto.ui.browser.metrics"}},l=uR(n.target);l&&(a.attributes["ui.component_name"]=l),ti(t,s,s+i,a)}}})}function zz(){return _1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.cls={value:e.value,unit:""},Eh=t)},!0)}function Lz(){return w1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ns.lcp={value:e.value,unit:"millisecond"},Kn=t)},!0)}function Uz(){return yz(({metric:e})=>{e.entries[e.entries.length-1]&&(ns.ttfb={value:e.value,unit:"millisecond"})})}function $z(e,t){const n=Ku(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=yt(e);a.slice(aE).forEach(d=>{const p=Xt(d.startTime),g=Xt(Math.max(0,d.duration));if(!(l==="navigation"&&f&&i+p<f))switch(d.entryType){case"navigation":{qz(e,d,i);break}case"mark":case"paint":case"measure":{Fz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Hu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ns.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ns.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{Gz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),aE=Math.max(a.length-1,0),Zz(e),l==="pageload"&&(Qz(ns),t.recordClsOnPageloadSpan||delete ns.cls,t.recordLcpOnPageloadSpan||delete ns.lcp,Object.entries(ns).forEach(([d,p])=>{dP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Xc()),Yz(e,t)),Kn=void 0,Eh=void 0,ns={}}function Bz(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Fz(e,t,n,s,i,a){if(Bz(t)||["mark","measure"].includes(t.entryType)&&Ko(t.name,a))return;const l=Fu(!1),f=Xt(l?l.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[gn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),Hz(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function Hz(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Cc(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(Cc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function qz(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{Td(e,t,s,n)}),Td(e,t,"secureConnection",n,"TLS/SSL"),Td(e,t,"fetch",n,"cache"),Td(e,t,"domainLookup",n,"DNS"),Kz(e,t,n)}function Td(e,t,n,s,i=n){const a=Vz(n),l=t[a],f=t[`${n}Start`];!f||!l||ti(e,s+Xt(f),s+Xt(l),{op:`browser.${i}`,name:t.name,attributes:{[gn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Vz(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Kz(e,t,n){const s=n+Xt(t.requestStart),i=n+Xt(t.responseEnd),a=n+Xt(t.responseStart);t.responseEnd&&(ti(e,s,i,{op:"browser.request",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}),ti(e,a,i,{op:"browser.response",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}))}function Gz(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={[gn]:"auto.resource.browser.metrics"},p=ta(n);p.protocol&&(d["url.scheme"]=p.protocol.split(":").pop()),p.host&&(d["server.address"]=p.host),d["url.same_origin"]=n.includes(Ge.location.origin),Xz(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,...N1(t)},y=a+s,b=y+i;ti(e,y,b,{name:n.replace(Ge.location.origin,""),op:f,attributes:g})}function Zz(e){const t=Ge.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Jg(n.rtt)&&(ns["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Jg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Jg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Yz(e,t){Kn&&t.recordLcpOnPageloadSpan&&(Kn.element&&e.setAttribute("lcp.element",Vr(Kn.element)),Kn.id&&e.setAttribute("lcp.id",Kn.id),Kn.url&&e.setAttribute("lcp.url",Kn.url.trim().slice(0,200)),Kn.loadTime!=null&&e.setAttribute("lcp.loadTime",Kn.loadTime),Kn.renderTime!=null&&e.setAttribute("lcp.renderTime",Kn.renderTime),e.setAttribute("lcp.size",Kn.size)),Eh?.sources&&t.recordClsOnPageloadSpan&&Eh.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function Xz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<Oz||typeof a=="string")&&(t[i]=a)})}function Qz(e){const t=Fu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Wz(){return Ku()&&Sr()?Mc("element",Jz):()=>{}}const Jz=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?yt(n).description:bt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const l=a.name,f=a.renderTime,d=a.loadTime,[p,g]=d?[Xt(d),"load-time"]:f?[Xt(f),"render-time"]:[cn(),"entry-emission"],y=l==="image-paint"?Xt(Math.max(0,(f??0)-(d??0))):0,b={[gn]:"auto.ui.browser.elementtiming",[eo]:"ui.elementtiming",[vs]:"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};PR({name:`element[${a.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+y)})})},eL=1e3;let cE,cv,lv;function tL(e){ci("dom",e),li("dom",nL)}function nL(){if(!Ge.document)return;const e=Hr.bind(null,"dom"),t=lE(e,!0);Ge.document.addEventListener("click",t,!1),Ge.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Ge[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(gr(i,"addEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[l]=p[l]||{refCount:0};if(!g.handler){const y=lE(e);g.handler=y,a.call(this,l,y,d)}g.refCount++}catch{}return a.call(this,l,f,d)}}),gr(i,"removeEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,f,d)}}))})}function rL(e){if(e.type!==cv)return!1;try{if(!e.target||e.target._sentryId!==lv)return!1}catch{}return!0}function sL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function lE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=oL(n);if(sL(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;rL(n)||(e({event:n,name:i,global:t}),cv=n.type,lv=s?s._sentryId:void 0),clearTimeout(cE),cE=Ge.setTimeout(()=>{lv=void 0,cv=void 0},eL)}}function oL(e){try{return e.target}catch{return null}}let Cd;function vb(e){const t="history";ci(t,e),li(t,iL)}function iL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Cd;if(Cd=t,n===t)return;Hr("history",{from:n,to:t})}),!T2())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Cd,a=aL(String(s));if(Cd=a,i===a)return t.apply(this,n);Hr("history",{from:i,to:a})}return t.apply(this,n)}}gr(Ge.history,"pushState",e),gr(Ge.history,"replaceState",e)}function aL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const rh={};function cL(e){const t=rh[e];if(t)return t;let n=Ge[e];if(rv(n))return rh[e]=n.bind(Ge);const s=Ge.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){$u&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(rh[e]=n.bind(Ge))}function lL(e){rh[e]=void 0}const fc="__sentry_xhr_v3__";function j1(e){ci("xhr",e),li("xhr",uL)}function uL(){if(!Ge.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=cn()*1e3,l=Gs(s[0])?s[0].toUpperCase():void 0,f=fL(s[1]);if(!l||!f)return t.apply(n,s);n[fc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[fc];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:cn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Hr("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,g,y){return d(),p.apply(g,y)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,g,y){const[b,x]=y,S=g[fc];return S&&Gs(b)&&Gs(x)&&(S.request_headers[b.toLowerCase()]=x),p.apply(g,y)}}),t.apply(n,s)}}),e.send=new Proxy(e.send,{apply(t,n,s){const i=n[fc];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:cn()*1e3,xhr:n};return Hr("xhr",a),t.apply(n,s)}})}function fL(e){if(Gs(e))return e;try{return e.toString()}catch{}}function dL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return $u&&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 ey=[],sh=new Map,cc=new Map,hL=60;function pL(){if(Ku()&&Sr()){const t=mL();return()=>{t()}}return()=>{}}const uv={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 mL(){return vz(gL)}const gL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>hL)return;const n=e.entries.find(S=>S.duration===e.value&&uv[S.name]);if(!n)return;const{interactionId:s}=n,i=uv[n.name],a=Xt(Sr()+n.startTime),l=Xn(),f=l?Dn(l):void 0,d=s!=null?sh.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Kc]:n.duration},x=yb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[zu]:"millisecond",[Lu]:e.value}),x.end(a+t))};function yL(){const e=Object.keys(uv);D2()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Vr(a),f=Math.round(i.timeStamp);if(cc.set(f,l),cc.size>50){const d=cc.keys().next().value;d!==void 0&&cc.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=cc.get(a);if(!l)for(let f=-5;f<=5;f++){const d=cc.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Xn(),l=a&&Dn(a);i.forEach(f=>{if(!Ez(f))return;const d=f.interactionId;if(d==null||sh.has(d))return;const p=f.target?Vr(f.target):n(f);if(ey.length>10){const g=ey.shift();sh.delete(g)}ey.push(d),sh.set(d,{span:l,elementName:p})})};Mc("event",s),Mc("first-input",s)}const vL=40;function bL(e,t=cL("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 lL("fetch"),d}finally{n-=l,s--}}return yD(e,i,lb(e.bufferSize||vL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,xL=30,SL=50;function fv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?sa:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const _L=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,EL=/\((\S*)(?::(\d+))(?::(\d+))\)/,TL=/at (.+?) ?\(data:(.+?),/,CL=e=>{const t=e.match(TL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=_L.exec(e);if(n){const[,i,a,l]=n;return fv(i,sa,+a,+l)}const s=wL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=EL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=A1(s[1]||sa,s[2]);return fv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},RL=[xL,CL],NL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,AL=e=>{const t=NL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=jL.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]||sa;return[i,s]=A1(i,s),fv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},kL=[SL,AL],OL=[RL,kL],ML=rR(...OL),A1=(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]:sa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Rd=1024,IL="Breadcrumbs",PL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:IL,setup(n){t.console&&e2(UL(n)),t.dom&&tL(LL(n,t.dom)),t.xhr&&j1($L(n)),t.fetch&&l1(BL(n)),t.history&&vb(FL(n)),t.sentry&&n.on("beforeSendEvent",zL(n))}}}),DL=PL;function zL(e){return function(n){vt()===e&&oa({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ki(n)},{event:n})}}function LL(e,t){return function(s){if(vt()!==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>Rd&&(Kr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${Rd}, but a value of ${f} was configured. Sentry will use ${Rd} instead.`),f=Rd),typeof l=="string"&&(l=[l]);try{const p=s.event,g=HL(p)?p.target:p;i=Vr(g,{keyAttrs:l,maxStringLength:f}),a=uR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),oa(d,{event:s.event,name:s.name,global:s.global})}}function UL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:n2(n.level),message:vw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${vw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;oa(s,{input:n.args,level:n.level})}}function $L(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[fc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:p}=a,g={method:l,url:f,status_code:d},y={xhr:n.xhr,input:p,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:c1(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,y),oa(b,y)}}function BL(e){return function(n){if(vt()!==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),oa(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:c1(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),oa(d,f)}}}function FL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=ta(st.location.href);let l=s?ta(s):void 0;const f=ta(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),oa({category:"navigation",data:{from:s,to:i}})}}function HL(e){return!!e&&!!e.target}const qL=["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"],VL="BrowserApiErrors",KL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:VL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",uE),t.setInterval&&gr(st,"setInterval",uE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",ZL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",YL);const n=t.eventTarget;n&&(Array.isArray(n)?n:qL).forEach(i=>XL(i,t))}}}),GL=KL;function uE(e){return function(...t){const n=t[0];return t[0]=Oc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function ZL(e){return function(t){return e.apply(this,[Oc(t,{mechanism:{data:{handler:Xs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function YL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&gr(n,i,function(a){const l={mechanism:{data:{handler:Xs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Zv(a);return f&&(l.mechanism.data.handler=Xs(f)),Oc(a,l)})}),e.apply(this,t)}}function XL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{QL(l)&&(l.handleEvent=Oc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&WL(this,a,l),i.apply(this,[a,Oc(l,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),gr(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 QL(e){return typeof e.handleEvent=="function"}function WL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const JL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Kr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Uw({ignoreDuration:!0}),Gg();const n=Zr();let s=n.getUser();n.addScopeListener(i=>{const a=i.getUser();(s?.id!==a?.id||s?.ip_address!==a?.ip_address)&&(Gg(),s=a)}),t==="route"&&vb(({from:i,to:a})=>{i!==a&&(Uw({ignoreDuration:!0}),Gg())})}}},e4="CultureContext",t4=(()=>({name:e4,preprocessEvent(e){const t=r4();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),n4=t4;function r4(){try{const e=st.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const s4="GlobalHandlers",o4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:s4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(a4(n),fE("onerror")),t.onunhandledrejection&&(c4(n),fE("onunhandledrejection"))}}}),i4=o4;function a4(e){oR(t=>{const{stackParser:n,attachStacktrace:s}=k1();if(vt()!==e||f1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=f4(pb(n,d||i,void 0,s,!1),a,l,f);p.level="error",BR(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function c4(e){iR(t=>{const{stackParser:n,attachStacktrace:s}=k1();if(vt()!==e||f1())return;const i=l4(t),a=Cc(i)?u4(i):pb(n,i,void 0,s,!0);a.level="error",BR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function l4(e){if(Cc(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 u4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function f4(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||[],p=s,g=n,y=d4(t)??Ou();return d.length===0&&d.push({colno:p,filename:y,function:sa,in_app:!0,lineno:g}),e}function fE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function k1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function d4(e){if(!(!Gs(e)||e.length===0))return e.startsWith("data:")?`<${Go(e,!1)}>`:e}const h4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=fb(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),p4="cause",m4=5,g4="LinkedErrors",y4=((e={})=>{const t=e.limit||m4,n=e.key||p4;return{name:g4,preprocessEvent(s,i,a){const l=a.getOptions();JD(db,l.stackParser,n,t,s,i)}}}),v4=y4;function b4(){return x4()?(Kr&&ha(()=>{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 x4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Ou(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function S4(e){return[VD(),BD(),f2(),GL(),DL(),i4(),v4(),o2(),h4(),n4(),JL()]}function _4(e={}){const t=!e.skipBrowserExtensionCheck&&b4();let n=e.defaultIntegrations==null?S4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:FM(e.stackParser||ML),integrations:ZP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||bL};return ND(X2,s)}function w4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function O1(e){try{return new URL(e,st.location.origin).href}catch{return}}function E4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function M1(e){try{return new Headers(e)}catch{return}}const dE=new WeakMap,ty=new Map,I1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function T4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...I1,...t},g=typeof a=="function"?a:S=>!0,y=S=>C4(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=ty.get(w.span_id);T&&(w.timestamp=T/1e3,ty.delete(w.span_id))}}),S)),i&&N2(S=>{if(S.response){const w=dE.get(S.response);w&&S.endTimestamp&&ty.set(w,S.endTimestamp)}}),l1(S=>{const w=d2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&dE.set(S.response,S.fetchData.__span),w){const T=O1(S.fetchData.url),C=T?ta(T).host:void 0;w.setAttributes({"http.url":T?Go(T):void 0,"server.address":C}),l&&hE(w),d?.(w,{headers:S.headers})}})),s&&j1(S=>{const w=R4(S,g,y,b,x,p);w&&(l&&hE(w),d?.(w,{headers:M1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function hE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Mc("resource",({entries:s})=>{s.forEach(i=>{E4(i)&&i.name.endsWith(t)&&(e.setAttributes(N1(i)),setTimeout(n))})})}function C4(e,t){const n=Ou();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?Ko(s.toString(),t)||a&&Ko(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Ko(e,t):s}}function R4(e,t,n,s,i,a){const l=e.xhr,f=l?.[fc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=ss()&&t(d);if(e.endTimestamp){const C=l.__sentry_xhr_span_id__;if(!C)return;const k=s[C];k&&(g&&f.status_code!==void 0&&(yR(k,f.status_code),k.end(),a?.(k,{headers:M1(dL(l)),error:e.error})),delete s[C]);return}const y=O1(d),b=ta(y||d),x=Go(OD(d)),S=!!Xn(),w=g&&S?Zc({name:`${p} ${x}`,attributes:{url:Go(d),type:"xhr","http.method":p,"http.url":y?Go(y):void 0,"server.address":b?.host,[gn]:"auto.http.browser",[eo]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new ei;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&N4(l,ss()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function N4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=s1({span:t,propagateTraceparent:n});s&&j4(e,s,i,a)}function j4(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||!w4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function A4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Xn();if(!e)return;const t=Dn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Kr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:hn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Kr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const k4=3600,P1="sentry_previous_trace",O4="sentry.previous_trace";function M4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?D4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=I4(i,l,f),s&&P4(i)});let a=!0;n&&e.on("beforeSampling",l=>{if(!i)return;const f=bt(),d=f.getPropagationContext();if(a&&d.parentSpanId){a=!1;return}f.setPropagationContext({...d,dsc:{...d.dsc,sample_rate:String(i.sampleRate),sampled:String(dv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=dv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[gR]:i.sampleRate}})}function I4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Yv])}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<=k4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[mI]:"previous_trace"}}),t.setAttribute(O4,`${l.traceId}-${l.spanId}-${dv(l)?1:0}`)),a)}function P4(e){try{st.sessionStorage.setItem(P1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function D4(){try{const e=st.sessionStorage?.getItem(P1);return JSON.parse(e)}catch{return}}function dv(e){return e.traceFlags===1}const z4="BrowserTracing",L4={...Jd,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:{},...I1},U4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:k,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:M,instrumentPageLoad:L,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:G,enableReportPageLoaded:B,onRequestSpanStart:z,onRequestSpanEnd:Q}={...L4,...e};let Y,ee,D;function K(q,V,U=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,X=W.attributes||{};if(H!==W.name&&(X[vs]="custom",W.attributes=X),!U){const de=pa();Zc({...W,startTime:de}).end(de);return}t.name=W.name,t.source=X[vs];const oe=UR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:de=>{Y?.(),$z(de,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),gE(q,void 0);const xe=bt(),he=xe.getPropagationContext();xe.setPropagationContext({...he,traceId:oe.spanContext().traceId,sampled:ui(oe),dsc:to(de)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=oe),gE(q,oe);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",oe)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:z4,setup(q){if(qI(),Y=Mz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&pL(),i&&Wz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Pz():a&&Iz(),f&&Dz(),A&&n){const U=()=>{ee=cn()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function V(){const U=_u(q);U&&!yt(U).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${yt(U).op}`),U.setAttribute(vu,"cancelled"),U.end())}q.on("startNavigationSpan",(U,I)=>{if(vt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),K(q,{op:"navigation.redirect",...U},!1);return}ee=void 0,V(),Zr().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),K(q,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(U,I={})=>{if(vt()!==q)return;V();const H=I.sentryTrace||pE("sentry-trace")||mE("sentry-trace"),W=I.baggage||pE("baggage")||mE("baggage"),X=DI(H,W),oe=bt();oe.setPropagationContext(X),ss()||(oe.getPropagationContext().propagationSpanId=Zs()),oe.setSDKProcessingMetadata({normalizedRequest:fb()}),K(q,{op:"pageload",...U})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(vu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=Ou();if(P!=="off"&&M4(q,{linkPreviousTrace:P,consistentTraceSampling:G}),st.location){if(L){const U=Sr();$4(q,{name:st.location.pathname,startTime:U?U/1e3:void 0,attributes:{[vs]:"url",[gn]:"auto.pageload.browser"}})}j&&vb(({to:U,from:I})=>{if(I===void 0&&V?.indexOf(U)!==-1){V=void 0;return}V=void 0;const H=n1(U),W=_u(q),X=W&&A&&H4(W,ee);B4(q,{name:H?.pathname||st.location.pathname,attributes:{[vs]:"url",[gn]:"auto.navigation.browser"}},{url:U,isRedirect:X})})}S&&A4(),f&&F4(q,y,b,x,t),s&&yL(),T4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:k,enableHTTPTimings:N,onRequestSpanStart:z,onRequestSpanEnd:Q})}}});function $4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=_u(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=bt();return a.setTransactionName(t.name),s&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...fb(),url:s}}),_u(e)}function pE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function mE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function F4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=_u(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Kr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(vu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Kr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=UR({name:i.name,op:d,attributes:{[vs]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const D1="_sentry_idleSpan";function _u(e){return e[D1]}function gE(e,t){Yn(e,D1,t)}const yE=1.5;function H4(e,t){const n=yt(e),s=pa(),i=n.start_timestamp;return!(s-i>yE||t&&s-t<=yE)}function z1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ny={exports:{}},Ke={};var vE;function q4(){if(vE)return Ke;vE=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"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function C(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,H,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=C.prototype;function N(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}var R=N.prototype=new k;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var X=W.ref;return{$$typeof:e,type:I,key:H,ref:X!==void 0?X:null,props:W}}function G(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Q=/\/+/g;function Y(I,H){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):H.toString(36)}function ee(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(L,L):(I.status="pending",I.then(function(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function D(I,H,W,X,oe){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var de=!1;if(I===null)de=!0;else switch(se){case"bigint":case"string":case"number":de=!0;break;case"object":switch(I.$$typeof){case e:case t:de=!0;break;case g:return de=I._init,D(de(I._payload),H,W,X,oe)}}if(de)return oe=oe(I),de=X===""?"."+Y(I,0):X,M(oe)?(W="",de!=null&&(W=de.replace(Q,"$&/")+"/"),D(oe,H,W,"",function(Me){return Me})):oe!=null&&(B(oe)&&(oe=G(oe,W+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(Q,"$&/")+"/")+de)),H.push(oe)),1;de=0;var xe=X===""?".":X+":";if(M(I))for(var he=0;he<I.length;he++)X=I[he],se=xe+Y(X,he),de+=D(X,H,W,se,oe);else if(he=x(I),typeof he=="function")for(I=he.call(I),he=0;!(X=I.next()).done;)X=X.value,se=xe+Y(X,he++),de+=D(X,H,W,se,oe);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,X,oe);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return de}function K(I,H,W){if(I==null)return I;var X=[],oe=0;return D(I,X,"","",function(se){return H.call(W,se,oe++)}),X}function q(I){if(I._status===-1){var H=I._result;H=H(),H.then(function(W){(I._status===0||I._status===-1)&&(I._status=1,I._result=W)},function(W){(I._status===0||I._status===-1)&&(I._status=2,I._result=W)}),I._status===-1&&(I._status=0,I._result=H)}if(I._status===1)return I._result.default;throw I._result}var V=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:K,forEach:function(I,H,W){K(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return K(I,function(){H++}),H},toArray:function(I){return K(I,function(H){return H})||[]},only:function(I){if(!B(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ke.Activity=y,Ke.Children=U,Ke.Component=C,Ke.Fragment=n,Ke.Profiler=i,Ke.PureComponent=N,Ke.StrictMode=s,Ke.Suspense=d,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Ke.cache=function(I){return function(){return I.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(I,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=w({},I.props),oe=I.key;if(H!=null)for(se in H.key!==void 0&&(oe=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(X[se]=H[se]);var se=arguments.length-2;if(se===1)X.children=W;else if(1<se){for(var de=Array(se),xe=0;xe<se;xe++)de[xe]=arguments[xe+2];X.children=de}return P(I.type,oe,X)},Ke.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,H,W){var X,oe={},se=null;if(H!=null)for(X in H.key!==void 0&&(se=""+H.key),H)A.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(oe[X]=H[X]);var de=arguments.length-2;if(de===1)oe.children=W;else if(1<de){for(var xe=Array(de),he=0;he<de;he++)xe[he]=arguments[he+2];oe.children=xe}if(I&&I.defaultProps)for(X in de=I.defaultProps,de)oe[X]===void 0&&(oe[X]=de[X]);return P(I,se,oe)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=B,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ke.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ke.startTransition=function(I){var H=j.T,W={};j.T=W;try{var X=I(),oe=j.S;oe!==null&&oe(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,V)}catch(se){V(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ke.useCallback=function(I,H){return j.H.useCallback(I,H)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ke.useEffect=function(I,H){return j.H.useEffect(I,H)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ke.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ke.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ke.useMemo=function(I,H){return j.H.useMemo(I,H)},Ke.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ke.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var bE;function Gu(){return bE||(bE=1,ny.exports=q4()),ny.exports}var _=Gu();const Ic=z1(_),L1=IM({__proto__:null,default:Ic},[_]);function V4(e){const t={...e};return r1(t,"react"),$P("react",{version:_.version}),_4(t)}function ue(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 p=l.prototype,g=Object.keys(p);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=p[b].bind(f))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(f){var d;const p=n?.Parent?new a:this;s(p,f),(d=p._zod).deferred??(d.deferred=[]);for(const g of p._zod.deferred)g();return p}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 yc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class U1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $1={};function ni(e){return $1}function B1(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 hv(e,t){return typeof t=="bigint"?t.toString():t}function bb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xb(e){return e==null}function Sb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function K4(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 xE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==xE)return s===void 0&&(s=xE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ga(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function SE(e){return JSON.stringify(e)}function G4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const F1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Th(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z4=bb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pc(e){if(Th(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Th(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function H1(e){return Pc(e)?{...e}:Array.isArray(e)?[...e]:e}const Y4=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function De(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 X4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Q4={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 W4(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=fi(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 ga(this,"shape",l),l},checks:[]});return di(e,a)}function J4(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=fi(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 ga(this,"shape",l),l},checks:[]});return di(e,a)}function e5(e,t){if(!Pc(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=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ga(this,"shape",a),a}});return di(e,i)}function t5(e,t){if(!Pc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ga(this,"shape",s),s}});return di(e,n)}function n5(e,t){const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ga(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return di(e,n)}function r5(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=fi(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)d[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return ga(this,"shape",d),d},checks:[]});return di(t,l)}function s5(e,t,n){const s=fi(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 ga(this,"shape",a),a}});return di(t,s)}function dc(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 hc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function Nd(e){return typeof e=="string"?e:e?.message}function ri(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=Nd(e.inst?._zod.def?.error?.(e))??Nd(t?.error?.(e))??Nd(n.customError?.(e))??Nd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function _b(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const q1=(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,hv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},V1=ue("$ZodError",q1),K1=ue("$ZodError",q1,{Parent:Error});function o5(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 i5(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 wb=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 yc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw F1(f,i?.callee),f}return l.value},Eb=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=>ri(d,a,ni())));throw F1(f,i?.callee),f}return l.value},cp=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 yc;return a.issues.length?{success:!1,error:new(e??V1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},a5=cp(K1),lp=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=>ri(l,i,ni())))}:{success:!0,data:a.value}},c5=lp(K1),l5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},u5=e=>(t,n,s)=>wb(e)(t,n,s),f5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Eb(e)(t,n,i)},d5=e=>async(t,n,s)=>Eb(e)(t,n,s),h5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cp(e)(t,n,i)},p5=e=>(t,n,s)=>cp(e)(t,n,s),m5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return lp(e)(t,n,i)},g5=e=>async(t,n,s)=>lp(e)(t,n,s),y5=/^[cC][^\s-]{8,}$/,v5=/^[0-9a-z]+$/,b5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x5=/^[0-9a-vA-V]{20}$/,S5=/^[A-Za-z0-9]{27}$/,_5=/^[a-zA-Z0-9_-]{21}$/,w5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,E5=/^([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})$/,_E=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)$/,T5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,C5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function R5(){return new RegExp(C5,"u")}const N5=/^(?:(?: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])$/,j5=/^(([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}|:))$/,A5=/^((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])$/,k5=/^(([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])$/,O5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G1=/^[A-Za-z0-9_-]*$/,M5=/^\+[1-9]\d{6,14}$/,Z1="(?:(?:\\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])))",I5=new RegExp(`^${Z1}$`);function Y1(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 P5(e){return new RegExp(`^${Y1(e)}$`)}function D5(e){const t=Y1({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(`^${Z1}T(?:${s})$`)}const z5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},L5=/^-?\d+$/,X1=/^-?\d+(?:\.\d+)?$/,U5=/^(?:true|false)$/i,$5=/^[^A-Z]*$/,B5=/^[^a-z]*$/,Qn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Q1={number:"number",bigint:"bigint",object:"date"},W1=ue("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=Q1[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})}}),J1=ue("$ZodCheckGreaterThan",(e,t)=>{Qn.init(e,t);const n=Q1[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})}}),F5=ue("$ZodCheckMultipleOf",(e,t)=>{Qn.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):K4(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})}}),H5=ue("$ZodCheckNumberFormat",(e,t)=>{Qn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=Q4[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=L5)}),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})}}),q5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),V5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),K5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(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})}}),up=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Qn.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=()=>{})}),G5=ue("$ZodCheckRegex",(e,t)=>{up.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})}}),Z5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$5),up.init(e,t)}),Y5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=B5),up.init(e,t)}),X5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Dc(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})}}),Q5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Dc(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})}}),W5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Dc(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})}}),J5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class eU{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(`
|
|
21
|
+
`).reduce((n,s)=>{const[i,a]=s.split(": ");return a&&(n[i.toLowerCase()]=a),n},{}):{}}const ey=[],sh=new Map,cc=new Map,hL=60;function pL(){if(Ku()&&Sr()){const t=mL();return()=>{t()}}return()=>{}}const uv={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 mL(){return vz(gL)}const gL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>hL)return;const n=e.entries.find(S=>S.duration===e.value&&uv[S.name]);if(!n)return;const{interactionId:s}=n,i=uv[n.name],a=Xt(Sr()+n.startTime),l=Xn(),f=l?Dn(l):void 0,d=s!=null?sh.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[eo]:`ui.interaction.${i}`,[Kc]:n.duration},x=yb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[zu]:"millisecond",[Lu]:e.value}),x.end(a+t))};function yL(){const e=Object.keys(uv);D2()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Vr(a),f=Math.round(i.timeStamp);if(cc.set(f,l),cc.size>50){const d=cc.keys().next().value;d!==void 0&&cc.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=cc.get(a);if(!l)for(let f=-5;f<=5;f++){const d=cc.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Xn(),l=a&&Dn(a);i.forEach(f=>{if(!Ez(f))return;const d=f.interactionId;if(d==null||sh.has(d))return;const p=f.target?Vr(f.target):n(f);if(ey.length>10){const g=ey.shift();sh.delete(g)}ey.push(d),sh.set(d,{span:l,elementName:p})})};Mc("event",s),Mc("first-input",s)}const vL=40;function bL(e,t=cL("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 lL("fetch"),d}finally{n-=l,s--}}return yD(e,i,lb(e.bufferSize||vL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,xL=30,SL=50;function fv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?sa:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const _L=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,EL=/\((\S*)(?::(\d+))(?::(\d+))\)/,TL=/at (.+?) ?\(data:(.+?),/,CL=e=>{const t=e.match(TL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=_L.exec(e);if(n){const[,i,a,l]=n;return fv(i,sa,+a,+l)}const s=wL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=EL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=A1(s[1]||sa,s[2]);return fv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},RL=[xL,CL],NL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,AL=e=>{const t=NL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=jL.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]||sa;return[i,s]=A1(i,s),fv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},kL=[SL,AL],OL=[RL,kL],ML=rR(...OL),A1=(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]:sa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Rd=1024,IL="Breadcrumbs",PL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:IL,setup(n){t.console&&e2(UL(n)),t.dom&&tL(LL(n,t.dom)),t.xhr&&j1($L(n)),t.fetch&&l1(BL(n)),t.history&&vb(FL(n)),t.sentry&&n.on("beforeSendEvent",zL(n))}}}),DL=PL;function zL(e){return function(n){vt()===e&&oa({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ki(n)},{event:n})}}function LL(e,t){return function(s){if(vt()!==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>Rd&&(Kr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${Rd}, but a value of ${f} was configured. Sentry will use ${Rd} instead.`),f=Rd),typeof l=="string"&&(l=[l]);try{const p=s.event,g=HL(p)?p.target:p;i=Vr(g,{keyAttrs:l,maxStringLength:f}),a=uR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),oa(d,{event:s.event,name:s.name,global:s.global})}}function UL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:n2(n.level),message:vw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${vw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;oa(s,{input:n.args,level:n.level})}}function $L(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[fc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:p}=a,g={method:l,url:f,status_code:d},y={xhr:n.xhr,input:p,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:c1(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,y),oa(b,y)}}function BL(e){return function(n){if(vt()!==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),oa(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:c1(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),oa(d,f)}}}function FL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=ta(st.location.href);let l=s?ta(s):void 0;const f=ta(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),oa({category:"navigation",data:{from:s,to:i}})}}function HL(e){return!!e&&!!e.target}const qL=["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"],VL="BrowserApiErrors",KL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:VL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",uE),t.setInterval&&gr(st,"setInterval",uE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",ZL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",YL);const n=t.eventTarget;n&&(Array.isArray(n)?n:qL).forEach(i=>XL(i,t))}}}),GL=KL;function uE(e){return function(...t){const n=t[0];return t[0]=Oc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xs(e)}`}}),e.apply(this,t)}}function ZL(e){return function(t){return e.apply(this,[Oc(t,{mechanism:{data:{handler:Xs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function YL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&gr(n,i,function(a){const l={mechanism:{data:{handler:Xs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Zv(a);return f&&(l.mechanism.data.handler=Xs(f)),Oc(a,l)})}),e.apply(this,t)}}function XL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{QL(l)&&(l.handleEvent=Oc(l.handleEvent,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&WL(this,a,l),i.apply(this,[a,Oc(l,{mechanism:{data:{handler:Xs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),gr(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 QL(e){return typeof e.handleEvent=="function"}function WL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const JL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Kr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Uw({ignoreDuration:!0}),Gg();const n=Zr();let s=n.getUser();n.addScopeListener(i=>{const a=i.getUser();(s?.id!==a?.id||s?.ip_address!==a?.ip_address)&&(Gg(),s=a)}),t==="route"&&vb(({from:i,to:a})=>{i!==a&&(Uw({ignoreDuration:!0}),Gg())})}}},e4="CultureContext",t4=(()=>({name:e4,preprocessEvent(e){const t=r4();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),n4=t4;function r4(){try{const e=st.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const s4="GlobalHandlers",o4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:s4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(a4(n),fE("onerror")),t.onunhandledrejection&&(c4(n),fE("onunhandledrejection"))}}}),i4=o4;function a4(e){oR(t=>{const{stackParser:n,attachStacktrace:s}=k1();if(vt()!==e||f1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=f4(pb(n,d||i,void 0,s,!1),a,l,f);p.level="error",BR(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function c4(e){iR(t=>{const{stackParser:n,attachStacktrace:s}=k1();if(vt()!==e||f1())return;const i=l4(t),a=Cc(i)?u4(i):pb(n,i,void 0,s,!0);a.level="error",BR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function l4(e){if(Cc(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 u4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function f4(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||[],p=s,g=n,y=d4(t)??Ou();return d.length===0&&d.push({colno:p,filename:y,function:sa,in_app:!0,lineno:g}),e}function fE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function k1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function d4(e){if(!(!Gs(e)||e.length===0))return e.startsWith("data:")?`<${Go(e,!1)}>`:e}const h4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=fb(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),p4="cause",m4=5,g4="LinkedErrors",y4=((e={})=>{const t=e.limit||m4,n=e.key||p4;return{name:g4,preprocessEvent(s,i,a){const l=a.getOptions();JD(db,l.stackParser,n,t,s,i)}}}),v4=y4;function b4(){return x4()?(Kr&&ha(()=>{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 x4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Ou(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function S4(e){return[VD(),BD(),f2(),GL(),DL(),i4(),v4(),o2(),h4(),n4(),JL()]}function _4(e={}){const t=!e.skipBrowserExtensionCheck&&b4();let n=e.defaultIntegrations==null?S4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:FM(e.stackParser||ML),integrations:ZP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||bL};return ND(X2,s)}function w4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function O1(e){try{return new URL(e,st.location.origin).href}catch{return}}function E4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function M1(e){try{return new Headers(e)}catch{return}}const dE=new WeakMap,ty=new Map,I1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function T4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...I1,...t},g=typeof a=="function"?a:S=>!0,y=S=>C4(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=ty.get(w.span_id);T&&(w.timestamp=T/1e3,ty.delete(w.span_id))}}),S)),i&&N2(S=>{if(S.response){const w=dE.get(S.response);w&&S.endTimestamp&&ty.set(w,S.endTimestamp)}}),l1(S=>{const w=d2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&dE.set(S.response,S.fetchData.__span),w){const T=O1(S.fetchData.url),C=T?ta(T).host:void 0;w.setAttributes({"http.url":T?Go(T):void 0,"server.address":C}),l&&hE(w),d?.(w,{headers:S.headers})}})),s&&j1(S=>{const w=R4(S,g,y,b,x,p);w&&(l&&hE(w),d?.(w,{headers:M1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function hE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Mc("resource",({entries:s})=>{s.forEach(i=>{E4(i)&&i.name.endsWith(t)&&(e.setAttributes(N1(i)),setTimeout(n))})})}function C4(e,t){const n=Ou();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?Ko(s.toString(),t)||a&&Ko(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Ko(e,t):s}}function R4(e,t,n,s,i,a){const l=e.xhr,f=l?.[fc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=ss()&&t(d);if(e.endTimestamp){const C=l.__sentry_xhr_span_id__;if(!C)return;const A=s[C];A&&(g&&f.status_code!==void 0&&(yR(A,f.status_code),A.end(),a?.(A,{headers:M1(dL(l)),error:e.error})),delete s[C]);return}const y=O1(d),b=ta(y||d),x=Go(OD(d)),S=!!Xn(),w=g&&S?Zc({name:`${p} ${x}`,attributes:{url:Go(d),type:"xhr","http.method":p,"http.url":y?Go(y):void 0,"server.address":b?.host,[gn]:"auto.http.browser",[eo]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new ei;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&N4(l,ss()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function N4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=s1({span:t,propagateTraceparent:n});s&&j4(e,s,i,a)}function j4(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||!w4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function A4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Xn();if(!e)return;const t=Dn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Kr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:hn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Kr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const k4=3600,P1="sentry_previous_trace",O4="sentry.previous_trace";function M4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?D4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=I4(i,l,f),s&&P4(i)});let a=!0;n&&e.on("beforeSampling",l=>{if(!i)return;const f=bt(),d=f.getPropagationContext();if(a&&d.parentSpanId){a=!1;return}f.setPropagationContext({...d,dsc:{...d.dsc,sample_rate:String(i.sampleRate),sampled:String(dv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=dv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[gR]:i.sampleRate}})}function I4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Yv])}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<=k4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[mI]:"previous_trace"}}),t.setAttribute(O4,`${l.traceId}-${l.spanId}-${dv(l)?1:0}`)),a)}function P4(e){try{st.sessionStorage.setItem(P1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function D4(){try{const e=st.sessionStorage?.getItem(P1);return JSON.parse(e)}catch{return}}function dv(e){return e.traceFlags===1}const z4="BrowserTracing",L4={...Jd,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:{},...I1},U4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:A,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:M,instrumentPageLoad:L,instrumentNavigation:j,detectRedirects:k,linkPreviousTrace:P,consistentTraceSampling:G,enableReportPageLoaded:B,onRequestSpanStart:z,onRequestSpanEnd:Q}={...L4,...e};let Y,ee,D;function K(q,V,U=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,X=W.attributes||{};if(H!==W.name&&(X[vs]="custom",W.attributes=X),!U){const de=pa();Zc({...W,startTime:de}).end(de);return}t.name=W.name,t.source=X[vs];const oe=UR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:de=>{Y?.(),$z(de,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),gE(q,void 0);const xe=bt(),he=xe.getPropagationContext();xe.setPropagationContext({...he,traceId:oe.spanContext().traceId,sampled:ui(oe),dsc:to(de)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=oe),gE(q,oe);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",oe)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:z4,setup(q){if(qI(),Y=Mz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&pL(),i&&Wz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Pz():a&&Iz(),f&&Dz(),k&&n){const U=()=>{ee=cn()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function V(){const U=_u(q);U&&!yt(U).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${yt(U).op}`),U.setAttribute(vu,"cancelled"),U.end())}q.on("startNavigationSpan",(U,I)=>{if(vt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),K(q,{op:"navigation.redirect",...U},!1);return}ee=void 0,V(),Zr().setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()});const H=bt();H.setPropagationContext({traceId:Ws(),sampleRand:Math.random(),propagationSpanId:ss()?void 0:Zs()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),K(q,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(U,I={})=>{if(vt()!==q)return;V();const H=I.sentryTrace||pE("sentry-trace")||mE("sentry-trace"),W=I.baggage||pE("baggage")||mE("baggage"),X=DI(H,W),oe=bt();oe.setPropagationContext(X),ss()||(oe.getPropagationContext().propagationSpanId=Zs()),oe.setSDKProcessingMetadata({normalizedRequest:fb()}),K(q,{op:"pageload",...U})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(vu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=Ou();if(P!=="off"&&M4(q,{linkPreviousTrace:P,consistentTraceSampling:G}),st.location){if(L){const U=Sr();$4(q,{name:st.location.pathname,startTime:U?U/1e3:void 0,attributes:{[vs]:"url",[gn]:"auto.pageload.browser"}})}j&&vb(({to:U,from:I})=>{if(I===void 0&&V?.indexOf(U)!==-1){V=void 0;return}V=void 0;const H=n1(U),W=_u(q),X=W&&k&&H4(W,ee);B4(q,{name:H?.pathname||st.location.pathname,attributes:{[vs]:"url",[gn]:"auto.navigation.browser"}},{url:U,isRedirect:X})})}S&&A4(),f&&F4(q,y,b,x,t),s&&yL(),T4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:A,enableHTTPTimings:N,onRequestSpanStart:z,onRequestSpanEnd:Q})}}});function $4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=_u(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=bt();return a.setTransactionName(t.name),s&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...fb(),url:s}}),_u(e)}function pE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function mE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function F4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=_u(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Kr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(vu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Kr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=UR({name:i.name,op:d,attributes:{[vs]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const D1="_sentry_idleSpan";function _u(e){return e[D1]}function gE(e,t){Yn(e,D1,t)}const yE=1.5;function H4(e,t){const n=yt(e),s=pa(),i=n.start_timestamp;return!(s-i>yE||t&&s-t<=yE)}function z1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ny={exports:{}},Ke={};var vE;function q4(){if(vE)return Ke;vE=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"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function C(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,H,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function A(){}A.prototype=C.prototype;function N(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}var R=N.prototype=new A;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function P(I,H,W){var X=W.ref;return{$$typeof:e,type:I,key:H,ref:X!==void 0?X:null,props:W}}function G(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Q=/\/+/g;function Y(I,H){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):H.toString(36)}function ee(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(L,L):(I.status="pending",I.then(function(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function D(I,H,W,X,oe){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var de=!1;if(I===null)de=!0;else switch(se){case"bigint":case"string":case"number":de=!0;break;case"object":switch(I.$$typeof){case e:case t:de=!0;break;case g:return de=I._init,D(de(I._payload),H,W,X,oe)}}if(de)return oe=oe(I),de=X===""?"."+Y(I,0):X,M(oe)?(W="",de!=null&&(W=de.replace(Q,"$&/")+"/"),D(oe,H,W,"",function(Me){return Me})):oe!=null&&(B(oe)&&(oe=G(oe,W+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(Q,"$&/")+"/")+de)),H.push(oe)),1;de=0;var xe=X===""?".":X+":";if(M(I))for(var he=0;he<I.length;he++)X=I[he],se=xe+Y(X,he),de+=D(X,H,W,se,oe);else if(he=x(I),typeof he=="function")for(I=he.call(I),he=0;!(X=I.next()).done;)X=X.value,se=xe+Y(X,he++),de+=D(X,H,W,se,oe);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,X,oe);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return de}function K(I,H,W){if(I==null)return I;var X=[],oe=0;return D(I,X,"","",function(se){return H.call(W,se,oe++)}),X}function q(I){if(I._status===-1){var H=I._result;H=H(),H.then(function(W){(I._status===0||I._status===-1)&&(I._status=1,I._result=W)},function(W){(I._status===0||I._status===-1)&&(I._status=2,I._result=W)}),I._status===-1&&(I._status=0,I._result=H)}if(I._status===1)return I._result.default;throw I._result}var V=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:K,forEach:function(I,H,W){K(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return K(I,function(){H++}),H},toArray:function(I){return K(I,function(H){return H})||[]},only:function(I){if(!B(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ke.Activity=y,Ke.Children=U,Ke.Component=C,Ke.Fragment=n,Ke.Profiler=i,Ke.PureComponent=N,Ke.StrictMode=s,Ke.Suspense=d,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Ke.cache=function(I){return function(){return I.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(I,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=w({},I.props),oe=I.key;if(H!=null)for(se in H.key!==void 0&&(oe=""+H.key),H)!k.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(X[se]=H[se]);var se=arguments.length-2;if(se===1)X.children=W;else if(1<se){for(var de=Array(se),xe=0;xe<se;xe++)de[xe]=arguments[xe+2];X.children=de}return P(I.type,oe,X)},Ke.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,H,W){var X,oe={},se=null;if(H!=null)for(X in H.key!==void 0&&(se=""+H.key),H)k.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(oe[X]=H[X]);var de=arguments.length-2;if(de===1)oe.children=W;else if(1<de){for(var xe=Array(de),he=0;he<de;he++)xe[he]=arguments[he+2];oe.children=xe}if(I&&I.defaultProps)for(X in de=I.defaultProps,de)oe[X]===void 0&&(oe[X]=de[X]);return P(I,se,oe)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=B,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ke.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ke.startTransition=function(I){var H=j.T,W={};j.T=W;try{var X=I(),oe=j.S;oe!==null&&oe(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,V)}catch(se){V(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ke.useCallback=function(I,H){return j.H.useCallback(I,H)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ke.useEffect=function(I,H){return j.H.useEffect(I,H)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ke.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ke.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ke.useMemo=function(I,H){return j.H.useMemo(I,H)},Ke.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ke.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var bE;function Gu(){return bE||(bE=1,ny.exports=q4()),ny.exports}var _=Gu();const Ic=z1(_),L1=IM({__proto__:null,default:Ic},[_]);function V4(e){const t={...e};return r1(t,"react"),$P("react",{version:_.version}),_4(t)}function ue(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 p=l.prototype,g=Object.keys(p);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=p[b].bind(f))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(f){var d;const p=n?.Parent?new a:this;s(p,f),(d=p._zod).deferred??(d.deferred=[]);for(const g of p._zod.deferred)g();return p}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 yc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class U1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $1={};function ni(e){return $1}function B1(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 hv(e,t){return typeof t=="bigint"?t.toString():t}function bb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xb(e){return e==null}function Sb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function K4(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 xE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==xE)return s===void 0&&(s=xE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ga(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function SE(e){return JSON.stringify(e)}function G4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const F1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Th(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z4=bb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pc(e){if(Th(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Th(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function H1(e){return Pc(e)?{...e}:Array.isArray(e)?[...e]:e}const Y4=new Set(["string","number","symbol"]);function Dc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function De(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 X4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Q4={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 W4(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=fi(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 ga(this,"shape",l),l},checks:[]});return di(e,a)}function J4(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=fi(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 ga(this,"shape",l),l},checks:[]});return di(e,a)}function e5(e,t){if(!Pc(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=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ga(this,"shape",a),a}});return di(e,i)}function t5(e,t){if(!Pc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ga(this,"shape",s),s}});return di(e,n)}function n5(e,t){const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ga(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return di(e,n)}function r5(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=fi(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)d[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return ga(this,"shape",d),d},checks:[]});return di(t,l)}function s5(e,t,n){const s=fi(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 ga(this,"shape",a),a}});return di(t,s)}function dc(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 hc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function Nd(e){return typeof e=="string"?e:e?.message}function ri(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=Nd(e.inst?._zod.def?.error?.(e))??Nd(t?.error?.(e))??Nd(n.customError?.(e))??Nd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function _b(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const q1=(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,hv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},V1=ue("$ZodError",q1),K1=ue("$ZodError",q1,{Parent:Error});function o5(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 i5(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 wb=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 yc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw F1(f,i?.callee),f}return l.value},Eb=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=>ri(d,a,ni())));throw F1(f,i?.callee),f}return l.value},cp=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 yc;return a.issues.length?{success:!1,error:new(e??V1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},a5=cp(K1),lp=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=>ri(l,i,ni())))}:{success:!0,data:a.value}},c5=lp(K1),l5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},u5=e=>(t,n,s)=>wb(e)(t,n,s),f5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Eb(e)(t,n,i)},d5=e=>async(t,n,s)=>Eb(e)(t,n,s),h5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cp(e)(t,n,i)},p5=e=>(t,n,s)=>cp(e)(t,n,s),m5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return lp(e)(t,n,i)},g5=e=>async(t,n,s)=>lp(e)(t,n,s),y5=/^[cC][^\s-]{8,}$/,v5=/^[0-9a-z]+$/,b5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x5=/^[0-9a-vA-V]{20}$/,S5=/^[A-Za-z0-9]{27}$/,_5=/^[a-zA-Z0-9_-]{21}$/,w5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,E5=/^([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})$/,_E=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)$/,T5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,C5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function R5(){return new RegExp(C5,"u")}const N5=/^(?:(?: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])$/,j5=/^(([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}|:))$/,A5=/^((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])$/,k5=/^(([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])$/,O5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G1=/^[A-Za-z0-9_-]*$/,M5=/^\+[1-9]\d{6,14}$/,Z1="(?:(?:\\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])))",I5=new RegExp(`^${Z1}$`);function Y1(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 P5(e){return new RegExp(`^${Y1(e)}$`)}function D5(e){const t=Y1({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(`^${Z1}T(?:${s})$`)}const z5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},L5=/^-?\d+$/,X1=/^-?\d+(?:\.\d+)?$/,U5=/^(?:true|false)$/i,$5=/^[^A-Z]*$/,B5=/^[^a-z]*$/,Qn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Q1={number:"number",bigint:"bigint",object:"date"},W1=ue("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=Q1[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})}}),J1=ue("$ZodCheckGreaterThan",(e,t)=>{Qn.init(e,t);const n=Q1[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})}}),F5=ue("$ZodCheckMultipleOf",(e,t)=>{Qn.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):K4(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})}}),H5=ue("$ZodCheckNumberFormat",(e,t)=>{Qn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=Q4[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=L5)}),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})}}),q5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),V5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),K5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xb(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=_b(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})}}),up=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Qn.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=()=>{})}),G5=ue("$ZodCheckRegex",(e,t)=>{up.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})}}),Z5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$5),up.init(e,t)}),Y5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=B5),up.init(e,t)}),X5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Dc(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})}}),Q5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Dc(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})}}),W5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Dc(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})}}),J5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class eU{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
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
23
|
`))}}const tU={major:4,minor:3,patch:6},Ft=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tU;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 p=dc(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(p)continue;const b=l.issues.length,x=y._zod.check(l);if(x instanceof Promise&&d?.async===!1)throw new yc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=dc(l,b)))});else{if(l.issues.length===b)continue;p||(p=dc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(dc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new yc;return p.then(g=>e._zod.parse(g,d))}return e._zod.parse(p,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(g=>a(g,l,f)):a(p,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new yc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=a5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return c5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Tb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??z5(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}}),Bt=ue("$ZodStringFormat",(e,t)=>{up.init(e,t),Tb.init(e,t)}),nU=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=E5),Bt.init(e,t)}),rU=ue("$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=_E(s))}else t.pattern??(t.pattern=_E());Bt.init(e,t)}),sU=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=T5),Bt.init(e,t)}),oU=ue("$ZodURL",(e,t)=>{Bt.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})}}}),iU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=R5()),Bt.init(e,t)}),aU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_5),Bt.init(e,t)}),cU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),lU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),uU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),fU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),dU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=S5),Bt.init(e,t)}),hU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=D5(t)),Bt.init(e,t)}),pU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=I5),Bt.init(e,t)}),mU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=P5(t)),Bt.init(e,t)}),gU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=w5),Bt.init(e,t)}),yU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=N5),Bt.init(e,t),e._zod.bag.format="ipv4"}),vU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=j5),Bt.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})}}}),bU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=A5),Bt.init(e,t)}),xU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=k5),Bt.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 eN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const SU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=O5),Bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{eN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function _U(e){if(!G1.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return eN(n)}const wU=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=G1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{_U(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),EU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=M5),Bt.init(e,t)});function TU(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 CU=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{TU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tN=ue("$ZodNumber",(e,t)=>{Ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??X1,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}}),RU=ue("$ZodNumberFormat",(e,t)=>{H5.init(e,t),tN.init(e,t)}),NU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=U5,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}}),jU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),AU=ue("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function wE(e,t,n){e.issues.length&&t.issues.push(...hc(n,e.issues)),t.value[n]=e.value}const kU=ue("$ZodArray",(e,t)=>{Ft.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(p=>wE(p,n,l))):wE(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Ch(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...hc(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function nN(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=X4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rN(e,t,n,s,i,a){const l=[],f=i.keySet,d=i.catchall._zod,p=d.def.type,g=d.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){l.push(y);continue}const b=d.run({value:t[y],issues:[]},s);b instanceof Promise?e.push(b.then(x=>Ch(x,n,y,t,g))):Ch(b,n,y,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 OU=ue("$ZodObject",(e,t)=>{if(Ft.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=bb(()=>nN(t));wt(e._zod,"propValues",()=>{const f=t.shape,d={};for(const p in f){const g=f[p]._zod;if(g.values){d[p]??(d[p]=new Set);for(const y of g.values)d[p].add(y)}}return d});const i=Th,a=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=s.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const g=[],y=l.shape;for(const b of l.keys){const x=y[b],S=x._zod.optout==="optional",w=x._zod.run({value:p[b],issues:[]},d);w instanceof Promise?g.push(w.then(T=>Ch(T,f,b,p,S))):Ch(w,f,b,p,S)}return a?rN(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),MU=ue("$ZodObjectJIT",(e,t)=>{OU.init(e,t);const n=e._zod.parse,s=bb(()=>nN(t)),i=b=>{const x=new eU(["shape","payload","ctx"]),S=s.value,w=N=>{const R=SE(N);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};x.write("const input = payload.value;");const T=Object.create(null);let C=0;for(const N of S.keys)T[N]=`key_${C++}`;x.write("const newResult = {};");for(const N of S.keys){const R=T[N],M=SE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
|
|
24
24
|
if (${R}.issues.length) {
|
|
@@ -54,25 +54,25 @@ Error:`,i)}}function bz(){return oz(e=>{Vu("cls",{metric:e}),v1=e},{reportAllCha
|
|
|
54
54
|
newResult[${M}] = ${R}.value;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");const k=x.compile();return(N,R)=>k(b,N,R)};let a;const l=Th,f=!$1.jitless,p=f&&Z4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return l(S)?f&&p&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?rN([],S,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function EE(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=>!dc(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=>ri(l,s,ni())))}),t)}const IU=ue("$ZodUnion",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),wt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),wt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),wt(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=>Sb(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 p=d._zod.run({value:i.value,issues:[]},a);if(p instanceof Promise)f.push(p),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>EE(d,i,e,a)):EE(f,i,e,a)}}),PU=ue("$ZodIntersection",(e,t)=>{Ft.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,p])=>TE(n,d,p)):TE(n,a,l)}});function pv(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(Pc(e)&&Pc(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=pv(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=pv(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 TE(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}),dc(e))return e;const l=pv(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 DU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Pc(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 p of l)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const g=t.valueType._zod.run({value:i[p],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...hc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...hc(p,g.issues)),n.value[p]=g.value)}let d;for(const p in i)f.has(p)||(d=d??[],d.push(p));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"&&X1.test(f)&&d.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ri(y,s,ni())),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(y=>{y.issues.length&&n.issues.push(...hc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...hc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),zU=ue("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=B1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>Y4.has(typeof i)).map(i=>typeof i=="string"?Dc(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}}),LU=ue("$ZodLiteral",(e,t)=>{if(Ft.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"?Dc(s):s?Dc(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}}),UU=ue("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new U1(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 yc;return n.value=i,n}});function CE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const sN=ue("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sb(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=>CE(a,n.value)):CE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),$U=ue("$ZodExactOptional",(e,t)=>{sN.init(e,t),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),BU=ue("$ZodNullable",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sb(n.source)}|null)$`):void 0}),wt(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)}),FU=ue("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(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=>RE(a,t)):RE(i,t)}});function RE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const HU=ue("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(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))}),qU=ue("$ZodNonOptional",(e,t)=>{Ft.init(e,t),wt(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=>NE(a,e)):NE(i,e)}});function NE(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 VU=ue("$ZodCatch",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(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=>ri(l,s,ni()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ri(a,s,ni()))},input:n.value}),n.issues=[]),n)}}),KU=ue("$ZodPipe",(e,t)=>{Ft.init(e,t),wt(e._zod,"values",()=>t.in._zod.values),wt(e._zod,"optin",()=>t.in._zod.optin),wt(e._zod,"optout",()=>t.out._zod.optout),wt(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=>jd(l,t.in,s)):jd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>jd(a,t.out,s)):jd(i,t.out,s)}});function jd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const GU=ue("$ZodReadonly",(e,t)=>{Ft.init(e,t),wt(e._zod,"propValues",()=>t.innerType._zod.propValues),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"optin",()=>t.innerType?._zod?.optin),wt(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(jE):jE(i)}});function jE(e){return e.value=Object.freeze(e.value),e}const ZU=ue("$ZodCustom",(e,t)=>{Qn.init(e,t),Ft.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=>AE(a,n,s,e));AE(i,n,s,e)}});function AE(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(wu(i))}}var kE;class YU{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 XU(){return new YU}(kE=globalThis).__zod_globalRegistry??(kE.__zod_globalRegistry=XU());const cu=globalThis.__zod_globalRegistry;function QU(e,t){return new e({type:"string",...De(t)})}function WU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function OE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function e3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function t3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function n3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function r3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function g3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function y3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function v3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function b3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function x3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function S3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function _3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function w3(e,t){return new e({type:"number",checks:[],...De(t)})}function E3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function T3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function C3(e,t){return new e({type:"boolean",...De(t)})}function R3(e){return new e({type:"unknown"})}function N3(e,t){return new e({type:"never",...De(t)})}function ME(e,t){return new W1({check:"less_than",...De(t),value:e,inclusive:!1})}function ry(e,t){return new W1({check:"less_than",...De(t),value:e,inclusive:!0})}function IE(e,t){return new J1({check:"greater_than",...De(t),value:e,inclusive:!1})}function sy(e,t){return new J1({check:"greater_than",...De(t),value:e,inclusive:!0})}function PE(e,t){return new F5({check:"multiple_of",...De(t),value:e})}function oN(e,t){return new q5({check:"max_length",...De(t),maximum:e})}function Rh(e,t){return new V5({check:"min_length",...De(t),minimum:e})}function iN(e,t){return new K5({check:"length_equals",...De(t),length:e})}function j3(e,t){return new G5({check:"string_format",format:"regex",...De(t),pattern:e})}function A3(e){return new Z5({check:"string_format",format:"lowercase",...De(e)})}function k3(e){return new Y5({check:"string_format",format:"uppercase",...De(e)})}function O3(e,t){return new X5({check:"string_format",format:"includes",...De(t),includes:e})}function M3(e,t){return new Q5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function I3(e,t){return new W5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Wc(e){return new J5({check:"overwrite",tx:e})}function P3(e){return Wc(t=>t.normalize(e))}function D3(){return Wc(e=>e.trim())}function z3(){return Wc(e=>e.toLowerCase())}function L3(){return Wc(e=>e.toUpperCase())}function U3(){return Wc(e=>G4(e))}function $3(e,t,n){return new e({type:"array",element:t,...De(n)})}function B3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function F3(e){const t=H3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(wu(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(wu(i))}},e(n.value,n)));return t}function H3(e,t){const n=new Qn({check:"custom",...De(t)});return n._zod.check=e,n}function aN(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??cu,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 ln(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 y=e._zod.parent;y&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&On(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 cN(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 y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};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 p=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);f.def={...f.schema},p&&(f.defId=p);const g=f.schema;for(const y in g)delete g[y];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>
|
|
57
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const A=x.compile();return(N,R)=>A(b,N,R)};let a;const l=Th,f=!$1.jitless,p=f&&Z4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return l(S)?f&&p&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?rN([],S,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function EE(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=>!dc(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=>ri(l,s,ni())))}),t)}const IU=ue("$ZodUnion",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),wt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),wt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),wt(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=>Sb(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 p=d._zod.run({value:i.value,issues:[]},a);if(p instanceof Promise)f.push(p),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>EE(d,i,e,a)):EE(f,i,e,a)}}),PU=ue("$ZodIntersection",(e,t)=>{Ft.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,p])=>TE(n,d,p)):TE(n,a,l)}});function pv(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(Pc(e)&&Pc(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=pv(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=pv(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 TE(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}),dc(e))return e;const l=pv(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 DU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Pc(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 p of l)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const g=t.valueType._zod.run({value:i[p],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...hc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...hc(p,g.issues)),n.value[p]=g.value)}let d;for(const p in i)f.has(p)||(d=d??[],d.push(p));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"&&X1.test(f)&&d.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ri(y,s,ni())),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(y=>{y.issues.length&&n.issues.push(...hc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...hc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),zU=ue("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=B1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>Y4.has(typeof i)).map(i=>typeof i=="string"?Dc(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}}),LU=ue("$ZodLiteral",(e,t)=>{if(Ft.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"?Dc(s):s?Dc(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}}),UU=ue("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new U1(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 yc;return n.value=i,n}});function CE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const sN=ue("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sb(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=>CE(a,n.value)):CE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),$U=ue("$ZodExactOptional",(e,t)=>{sN.init(e,t),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),BU=ue("$ZodNullable",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sb(n.source)}|null)$`):void 0}),wt(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)}),FU=ue("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(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=>RE(a,t)):RE(i,t)}});function RE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const HU=ue("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(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))}),qU=ue("$ZodNonOptional",(e,t)=>{Ft.init(e,t),wt(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=>NE(a,e)):NE(i,e)}});function NE(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 VU=ue("$ZodCatch",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(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=>ri(l,s,ni()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ri(a,s,ni()))},input:n.value}),n.issues=[]),n)}}),KU=ue("$ZodPipe",(e,t)=>{Ft.init(e,t),wt(e._zod,"values",()=>t.in._zod.values),wt(e._zod,"optin",()=>t.in._zod.optin),wt(e._zod,"optout",()=>t.out._zod.optout),wt(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=>jd(l,t.in,s)):jd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>jd(a,t.out,s)):jd(i,t.out,s)}});function jd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const GU=ue("$ZodReadonly",(e,t)=>{Ft.init(e,t),wt(e._zod,"propValues",()=>t.innerType._zod.propValues),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"optin",()=>t.innerType?._zod?.optin),wt(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(jE):jE(i)}});function jE(e){return e.value=Object.freeze(e.value),e}const ZU=ue("$ZodCustom",(e,t)=>{Qn.init(e,t),Ft.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=>AE(a,n,s,e));AE(i,n,s,e)}});function AE(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(wu(i))}}var kE;class YU{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 XU(){return new YU}(kE=globalThis).__zod_globalRegistry??(kE.__zod_globalRegistry=XU());const cu=globalThis.__zod_globalRegistry;function QU(e,t){return new e({type:"string",...De(t)})}function WU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function OE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function JU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function e3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function t3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function n3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function r3(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function g3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function y3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function v3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function b3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function x3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function S3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function _3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function w3(e,t){return new e({type:"number",checks:[],...De(t)})}function E3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function T3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function C3(e,t){return new e({type:"boolean",...De(t)})}function R3(e){return new e({type:"unknown"})}function N3(e,t){return new e({type:"never",...De(t)})}function ME(e,t){return new W1({check:"less_than",...De(t),value:e,inclusive:!1})}function ry(e,t){return new W1({check:"less_than",...De(t),value:e,inclusive:!0})}function IE(e,t){return new J1({check:"greater_than",...De(t),value:e,inclusive:!1})}function sy(e,t){return new J1({check:"greater_than",...De(t),value:e,inclusive:!0})}function PE(e,t){return new F5({check:"multiple_of",...De(t),value:e})}function oN(e,t){return new q5({check:"max_length",...De(t),maximum:e})}function Rh(e,t){return new V5({check:"min_length",...De(t),minimum:e})}function iN(e,t){return new K5({check:"length_equals",...De(t),length:e})}function j3(e,t){return new G5({check:"string_format",format:"regex",...De(t),pattern:e})}function A3(e){return new Z5({check:"string_format",format:"lowercase",...De(e)})}function k3(e){return new Y5({check:"string_format",format:"uppercase",...De(e)})}function O3(e,t){return new X5({check:"string_format",format:"includes",...De(t),includes:e})}function M3(e,t){return new Q5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function I3(e,t){return new W5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Wc(e){return new J5({check:"overwrite",tx:e})}function P3(e){return Wc(t=>t.normalize(e))}function D3(){return Wc(e=>e.trim())}function z3(){return Wc(e=>e.toLowerCase())}function L3(){return Wc(e=>e.toUpperCase())}function U3(){return Wc(e=>G4(e))}function $3(e,t,n){return new e({type:"array",element:t,...De(n)})}function B3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function F3(e){const t=H3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(wu(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(wu(i))}},e(n.value,n)));return t}function H3(e,t){const n=new Qn({check:"custom",...De(t)});return n._zod.check=e,n}function aN(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??cu,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 ln(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 y=e._zod.parent;y&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&On(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 cN(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 y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};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 p=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);f.def={...f.schema},p&&(f.defId=p);const g=f.schema;for(const y in g)delete g[y];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
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 p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){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 lN(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,p={...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,p),l._zod.parent===g)for(const w in d)w==="$ref"||w==="allOf"||w in p||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 y=l._zod.parent;if(y&&y!==g){s(y);const b=e.seen.get(y);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:Nh(t,"input",e.processors),output:Nh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function On(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 On(s.element,n);if(s.type==="set")return On(s.valueType,n);if(s.type==="lazy")return On(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 On(s.innerType,n);if(s.type==="intersection")return On(s.left,n)||On(s.right,n);if(s.type==="record"||s.type==="map")return On(s.keyType,n)||On(s.valueType,n);if(s.type==="pipe")return On(s.in,n)||On(s.out,n);if(s.type==="object"){for(const i in s.shape)if(On(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(On(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(On(i,n))return!0;return!!(s.rest&&On(s.rest,n))}return!1}const q3=(e,t={})=>n=>{const s=aN({...n,processors:t});return ln(e,s),cN(s,e),lN(s,e)},Nh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=aN({...i??{},target:a,io:t,processors:n});return ln(e,l),cN(l,e),lN(l,e)},V3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=V3[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),d&&d.size>0){const g=[...d];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},G3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,format:f,multipleOf:d,exclusiveMaximum:p,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 p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},Z3=(e,t,n,s)=>{n.type="boolean"},Y3=(e,t,n,s)=>{n.not={}},X3=(e,t,n,s)=>{},Q3=(e,t,n,s)=>{const i=e._zod.def,a=B1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},W3=(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},J3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},e$=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},t$=(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=ln(a.element,t,{...s,path:[...s.path,"items"]})},n$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const p in l)i.properties[p]=ln(l[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(p=>{const g=a.shape[p]._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=ln(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},r$=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>ln(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},s$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=ln(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,d=[...f(a)?a.allOf:[a],...f(l)?l.allOf:[l]];n.allOf=d},o$=(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=ln(a.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const y of d)i.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=ln(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ln(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=l._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},i$=(e,t,n,s)=>{const i=e._zod.def,a=ln(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"}]},a$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},c$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},l$=(e,t,n,s)=>{const i=e._zod.def;ln(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)))},u$=(e,t,n,s)=>{const i=e._zod.def;ln(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},f$=(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;ln(a,t,s);const l=t.seen.get(e);l.ref=a},d$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},uN=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},h$=ue("ZodISODateTime",(e,t)=>{hU.init(e,t),qt.init(e,t)});function p$(e){return b3(h$,e)}const m$=ue("ZodISODate",(e,t)=>{pU.init(e,t),qt.init(e,t)});function g$(e){return x3(m$,e)}const y$=ue("ZodISOTime",(e,t)=>{mU.init(e,t),qt.init(e,t)});function v$(e){return S3(y$,e)}const b$=ue("ZodISODuration",(e,t)=>{gU.init(e,t),qt.init(e,t)});function x$(e){return _3(b$,e)}const S$=(e,t)=>{V1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>i5(e,n)},flatten:{value:n=>o5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yr=ue("ZodError",S$,{Parent:Error}),_$=wb(Yr),w$=Eb(Yr),E$=cp(Yr),T$=lp(Yr),C$=l5(Yr),R$=u5(Yr),N$=f5(Yr),j$=d5(Yr),A$=h5(Yr),k$=p5(Yr),O$=m5(Yr),M$=g5(Yr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nh(e,"input"),output:Nh(e,"output")}}),e.toJSONSchema=q3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>di(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>_$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>E$(e,n,s),e.parseAsync=async(n,s)=>w$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>T$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>C$(e,n,s),e.decode=(n,s)=>R$(e,n,s),e.encodeAsync=async(n,s)=>N$(e,n,s),e.decodeAsync=async(n,s)=>j$(e,n,s),e.safeEncode=(n,s)=>A$(e,n,s),e.safeDecode=(n,s)=>k$(e,n,s),e.safeEncodeAsync=async(n,s)=>O$(e,n,s),e.safeDecodeAsync=async(n,s)=>M$(e,n,s),e.refine=(n,s)=>e.check(CB(n,s)),e.superRefine=n=>e.check(RB(n)),e.overwrite=n=>e.check(Wc(n)),e.optional=()=>LE(e),e.exactOptional=()=>hB(e),e.nullable=()=>UE(e),e.nullish=()=>LE(UE(e)),e.nonoptional=n=>bB(e,n),e.array=()=>Gr(e),e.or=n=>Rb([e,n]),e.and=n=>aB(e,n),e.transform=n=>$E(e,fB(n)),e.default=n=>gB(e,n),e.prefault=n=>vB(e,n),e.catch=n=>SB(e,n),e.pipe=n=>$E(e,n),e.readonly=()=>EB(e),e.describe=n=>{const s=e.clone();return cu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return cu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const s=e.clone();return cu.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),fN=ue("_ZodString",(e,t)=>{Tb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>K3(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(j3(...s)),e.includes=(...s)=>e.check(O3(...s)),e.startsWith=(...s)=>e.check(M3(...s)),e.endsWith=(...s)=>e.check(I3(...s)),e.min=(...s)=>e.check(Rh(...s)),e.max=(...s)=>e.check(oN(...s)),e.length=(...s)=>e.check(iN(...s)),e.nonempty=(...s)=>e.check(Rh(1,...s)),e.lowercase=s=>e.check(A3(s)),e.uppercase=s=>e.check(k3(s)),e.trim=()=>e.check(D3()),e.normalize=(...s)=>e.check(P3(...s)),e.toLowerCase=()=>e.check(z3()),e.toUpperCase=()=>e.check(L3()),e.slugify=()=>e.check(U3())}),I$=ue("ZodString",(e,t)=>{Tb.init(e,t),fN.init(e,t),e.email=n=>e.check(WU(P$,n)),e.url=n=>e.check(r3(D$,n)),e.jwt=n=>e.check(v3(Q$,n)),e.emoji=n=>e.check(s3(z$,n)),e.guid=n=>e.check(OE(DE,n)),e.uuid=n=>e.check(JU(Ad,n)),e.uuidv4=n=>e.check(e3(Ad,n)),e.uuidv6=n=>e.check(t3(Ad,n)),e.uuidv7=n=>e.check(n3(Ad,n)),e.nanoid=n=>e.check(o3(L$,n)),e.guid=n=>e.check(OE(DE,n)),e.cuid=n=>e.check(i3(U$,n)),e.cuid2=n=>e.check(a3($$,n)),e.ulid=n=>e.check(c3(B$,n)),e.base64=n=>e.check(m3(Z$,n)),e.base64url=n=>e.check(g3(Y$,n)),e.xid=n=>e.check(l3(F$,n)),e.ksuid=n=>e.check(u3(H$,n)),e.ipv4=n=>e.check(f3(q$,n)),e.ipv6=n=>e.check(d3(V$,n)),e.cidrv4=n=>e.check(h3(K$,n)),e.cidrv6=n=>e.check(p3(G$,n)),e.e164=n=>e.check(y3(X$,n)),e.datetime=n=>e.check(p$(n)),e.date=n=>e.check(g$(n)),e.time=n=>e.check(v$(n)),e.duration=n=>e.check(x$(n))});function Fe(e){return QU(I$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),fN.init(e,t)}),P$=ue("ZodEmail",(e,t)=>{sU.init(e,t),qt.init(e,t)}),DE=ue("ZodGUID",(e,t)=>{nU.init(e,t),qt.init(e,t)}),Ad=ue("ZodUUID",(e,t)=>{rU.init(e,t),qt.init(e,t)}),D$=ue("ZodURL",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodEmoji",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodNanoID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodCUID",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodCUID2",(e,t)=>{lU.init(e,t),qt.init(e,t)}),B$=ue("ZodULID",(e,t)=>{uU.init(e,t),qt.init(e,t)}),F$=ue("ZodXID",(e,t)=>{fU.init(e,t),qt.init(e,t)}),H$=ue("ZodKSUID",(e,t)=>{dU.init(e,t),qt.init(e,t)}),q$=ue("ZodIPv4",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodIPv6",(e,t)=>{vU.init(e,t),qt.init(e,t)}),K$=ue("ZodCIDRv4",(e,t)=>{bU.init(e,t),qt.init(e,t)}),G$=ue("ZodCIDRv6",(e,t)=>{xU.init(e,t),qt.init(e,t)}),Z$=ue("ZodBase64",(e,t)=>{SU.init(e,t),qt.init(e,t)}),Y$=ue("ZodBase64URL",(e,t)=>{wU.init(e,t),qt.init(e,t)}),X$=ue("ZodE164",(e,t)=>{EU.init(e,t),qt.init(e,t)}),Q$=ue("ZodJWT",(e,t)=>{CU.init(e,t),qt.init(e,t)}),Cb=ue("ZodNumber",(e,t)=>{tN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>G3(e,s,i),e.gt=(s,i)=>e.check(IE(s,i)),e.gte=(s,i)=>e.check(sy(s,i)),e.min=(s,i)=>e.check(sy(s,i)),e.lt=(s,i)=>e.check(ME(s,i)),e.lte=(s,i)=>e.check(ry(s,i)),e.max=(s,i)=>e.check(ry(s,i)),e.int=s=>e.check(zE(s)),e.safe=s=>e.check(zE(s)),e.positive=s=>e.check(IE(0,s)),e.nonnegative=s=>e.check(sy(0,s)),e.negative=s=>e.check(ME(0,s)),e.nonpositive=s=>e.check(ry(0,s)),e.multipleOf=(s,i)=>e.check(PE(s,i)),e.step=(s,i)=>e.check(PE(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 tn(e){return w3(Cb,e)}const W$=ue("ZodNumberFormat",(e,t)=>{RU.init(e,t),Cb.init(e,t)});function zE(e){return T3(W$,e)}const J$=ue("ZodBoolean",(e,t)=>{NU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(e,n,s)});function no(e){return C3(J$,e)}const eB=ue("ZodUnknown",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3()});function ia(){return R3(eB)}const tB=ue("ZodNever",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(e,n,s)});function nB(e){return N3(tB,e)}const rB=ue("ZodArray",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Rh(n,s)),e.nonempty=n=>e.check(Rh(1,n)),e.max=(n,s)=>e.check(oN(n,s)),e.length=(n,s)=>e.check(iN(n,s)),e.unwrap=()=>e.element});function Gr(e,t){return $3(rB,e,t)}const sB=ue("ZodObject",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Yu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ia()}),e.loose=()=>e.clone({...e._zod.def,catchall:ia()}),e.strict=()=>e.clone({...e._zod.def,catchall:nB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>e5(e,n),e.safeExtend=n=>t5(e,n),e.merge=n=>n5(e,n),e.pick=n=>W4(e,n),e.omit=n=>J4(e,n),e.partial=(...n)=>r5(dN,e,n[0]),e.required=(...n)=>s5(hN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new sB(n)}const oB=ue("ZodUnion",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.options=t.options});function Rb(e,t){return new oB({type:"union",options:e,...De(t)})}const iB=ue("ZodIntersection",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i)});function aB(e,t){return new iB({type:"intersection",left:e,right:t})}const cB=ue("ZodRecord",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Zu(e,t,n){return new cB({type:"record",keyType:e,valueType:t,...De(n)})}const mv=ue("ZodEnum",(e,t)=>{zU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>Q3(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 mv({...t,checks:[],...De(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 mv({...t,checks:[],...De(i),entries:a})}});function Yu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new mv({type:"enum",entries:n,...De(t)})}const lB=ue("ZodLiteral",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(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 si(e,t){return new lB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const uB=ue("ZodTransform",(e,t)=>{UU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new U1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wu(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(wu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function fB(e){return new uB({type:"transform",transform:e})}const dN=ue("ZodOptional",(e,t)=>{sN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>uN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new dN({type:"optional",innerType:e})}const dB=ue("ZodExactOptional",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>uN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function hB(e){return new dB({type:"optional",innerType:e})}const pB=ue("ZodNullable",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function UE(e){return new pB({type:"nullable",innerType:e})}const mB=ue("ZodDefault",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gB(e,t){return new mB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():H1(t)}})}const yB=ue("ZodPrefault",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>l$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function vB(e,t){return new yB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():H1(t)}})}const hN=ue("ZodNonOptional",(e,t)=>{qU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function bB(e,t){return new hN({type:"nonoptional",innerType:e,...De(t)})}const xB=ue("ZodCatch",(e,t)=>{VU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>u$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function SB(e,t){return new xB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _B=ue("ZodPipe",(e,t)=>{KU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>f$(e,n,s,i),e.in=t.in,e.out=t.out});function $E(e,t){return new _B({type:"pipe",in:e,out:t})}const wB=ue("ZodReadonly",(e,t)=>{GU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>d$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function EB(e){return new wB({type:"readonly",innerType:e})}const TB=ue("ZodCustom",(e,t)=>{ZU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n)});function CB(e,t={}){return B3(TB,e,t)}function RB(e){return F3(e)}function BE(e){return E3(Cb,e)}At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1),encrypted:no().optional(),keyId:Fe().optional()});const pN=At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:tn().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:no()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1)});At({exists:no(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Yu(["PUT","POST"]).optional(),uploadHeaders:Zu(Fe(),Fe()).optional(),chunkSize:tn().int().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:no(),metadata:pN.optional(),error:Fe().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Fe().url(),expiresAt:Fe(),metadata:pN});At({error:Fe(),message:Fe().optional(),code:Fe().optional()});At({limit:BE().int().min(1).max(100).default(50),offset:BE().int().min(0).default(0)});const NB="json-row-frame-v1",jB="gzip",mN=Yu(["upsert","delete"]),AB=Zu(Fe(),Fe()),gN=Zu(Fe(),Rb([Fe(),Gr(Fe())])),kB=At({table:Fe(),row_id:Fe(),op:mN,payload:Zu(Fe(),ia()).nullable(),base_version:tn().int().nullable().optional()}),OB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(kB).min(1),schemaVersion:tn().int().min(1)}),MB=At({opIndex:tn().int(),status:si("applied")}),IB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:ia()}),PB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),DB=Rb([MB,IB,PB]),zB=At({ok:si(!0),status:Yu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(DB)}),yN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),LB=At({id:Fe().min(1),table:Fe().min(1),scopes:gN,params:Zu(Fe(),ia()).optional(),cursor:tn().int(),bootstrapState:yN.nullable().optional()}),UB=At({clientId:Fe().min(1),limitCommits:tn().int().min(1),limitSnapshotRows:tn().int().min(1).optional(),maxSnapshotPages:tn().int().min(1).optional(),dedupeRows:no().optional(),subscriptions:Gr(LB)}),$B=At({table:Fe(),row_id:Fe(),op:mN,row_json:ia().nullable(),row_version:tn().int().nullable(),scopes:AB}),BB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr($B)}),FB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(NB),compression:si(jB)}),HB=At({table:Fe(),rows:Gr(ia()),chunks:Gr(FB).optional(),isFirstPage:no(),isLastPage:no()}),qB=At({id:Fe(),status:Yu(["active","revoked"]),scopes:gN,bootstrap:no(),bootstrapState:yN.nullable().optional(),nextCursor:tn().int(),commits:Gr(BB),snapshots:Gr(HB).optional()}),VB=At({ok:si(!0),subscriptions:Gr(qB)});At({clientId:Fe().min(1),push:OB.omit({clientId:!0}).optional(),pull:UB.omit({clientId:!0}).optional()});At({ok:si(!0),push:zB.optional(),pull:VB.optional()});new TextEncoder;const KB={setAttribute(){},setAttributes(){},setStatus(){}};function GB(e){return e.level?e.level:e.error?"error":"info"}function oy(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 ZB(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 YB(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 FE(e){const t={};for(const[n,s]of Object.entries(e)){const i=YB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function XB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(ZB(s))):n(KB)}}}function QB(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 WB(e){return{log(t){const n=GB(t),{event:s,...i}=t,a=oy(e.logger,n);if(!a)return;const l=FE(i);if(!l){a(s);return}a(s,l)},tracer:XB(e),metrics:QB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=oy(e.logger,"error")??oy(e.logger,"info");if(!s)return;const i=FE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function JB(e){if(e?.attributes)return{attributes:e.attributes}}function HE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function e6(){return WB({logger:E2,startSpan(e,t){return PR(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=JB(n);if(s){rE(e,t,s);return}rE(e,t)},gauge(e,t,n){const s=HE(n);if(s){sE(e,t,s);return}sE(e,t)},distribution(e,t,n){const s=HE(n);if(s){oE(e,t,s);return}oE(e,t)}},captureException(e){$R(e)}})}function t6(){return e6()}function n6(e){const t=r6(e);return V4(t),t6()}function r6(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[U4(),...n]}}var iy={exports:{}},Jl={};var qE;function s6(){if(qE)return Jl;qE=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 Jl.Fragment=t,Jl.jsx=n,Jl.jsxs=n,Jl}var VE;function o6(){return VE||(VE=1,iy.exports=s6()),iy.exports}var h=o6(),ay={exports:{}},eu={},cy={exports:{}},ly={};var KE;function i6(){return KE||(KE=1,(function(e){function t(D,K){var q=D.length;D.push(K);e:for(;0<q;){var V=q-1>>>1,U=D[V];if(0<i(U,K))D[V]=K,D[q]=U,q=V;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var K=D[0],q=D.pop();if(q!==K){D[0]=q;e:for(var V=0,U=D.length,I=U>>>1;V<I;){var H=2*(V+1)-1,W=D[H],X=H+1,oe=D[X];if(0>i(W,q))X<U&&0>i(oe,W)?(D[V]=oe,D[X]=q,V=X):(D[V]=W,D[H]=q,V=H);else if(X<U&&0>i(oe,q))D[V]=oe,D[X]=q,V=X;else break e}}return K}function i(D,K){var q=D.sortIndex-K.sortIndex;return q!==0?q:D.id-K.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=[],p=[],g=1,y=null,b=3,x=!1,S=!1,w=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(D){for(var K=n(p);K!==null;){if(K.callback===null)s(p);else if(K.startTime<=D)s(p),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,L||(L=!0,z());else{var K=n(p);K!==null&&ee(M,K.startTime-D)}}var L=!1,j=-1,A=5,P=-1;function G(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,L){var D=e.unstable_now();P=D;var K=!0;try{e:{S=!1,w&&(w=!1,k(j),j=-1),x=!0;var q=b;try{t:{for(R(D),y=n(d);y!==null&&!(y.expirationTime>D&&G());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var U=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof U=="function"){y.callback=U,R(D),K=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)K=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),K=!1}}break e}finally{y=null,b=q,x=!1}K=void 0}}finally{K?z():L=!1}}}var z;if(typeof N=="function")z=function(){N(B)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=B,z=function(){Y.postMessage(null)}}else z=function(){C(B,0)};function ee(D,K){j=C(function(){D(e.unstable_now())},K)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var q=b;b=K;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,K){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return K()}finally{b=q}},e.unstable_scheduleCallback=function(D,K,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,D){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=q+U,D={id:g++,callback:K,priorityLevel:D,startTime:q,expirationTime:U,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(k(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=U,t(d,D),S||x||(S=!0,L||(L=!0,z()))),D},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(D){var K=b;return function(){var q=b;b=K;try{return D.apply(this,arguments)}finally{b=q}}}})(ly)),ly}var GE;function a6(){return GE||(GE=1,cy.exports=i6()),cy.exports}var uy={exports:{}},Rn={};var ZE;function c6(){if(ZE)return Rn;ZE=1;var e=Gu();function t(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+p+" 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,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:d,containerInfo:p,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rn.createPortal=function(d,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return a(d,p,null,g)},Rn.flushSync=function(d){var p=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=p,s.p=g,s.d.f()}},Rn.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(d,p))},Rn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Rn.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?s.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):g==="script"&&s.d.X(d,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rn.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);s.d.M(d,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(d)},Rn.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin);s.d.L(d,g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Rn.preloadModule=function(d,p){if(typeof d=="string")if(p){var g=f(p.as,p.crossOrigin);s.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(d)},Rn.requestFormReset=function(d){s.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,g){return l.H.useFormState(d,p,g)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var YE;function vN(){if(YE)return uy.exports;YE=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(),uy.exports=c6(),uy.exports}var XE;function l6(){if(XE)return eu;XE=1;var e=a6(),t=Gu(),n=vN();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 p(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 v=m.alternate;if(v===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===c)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=v;else{for(var E=!1,O=m.child;O;){if(O===c){E=!0,c=m,u=v;break}if(O===u){E=!0,u=m,c=v;break}O=O.sibling}if(!E){for(O=v.child;O;){if(O===c){E=!0,c=v,u=m;break}if(O===u){E=!0,u=v,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 y=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"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function z(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case k:return(r._context.displayName||"Context")+".Consumer";case R:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case j:return o=r.displayName||null,o!==null?o:Y(r.type)||"Memo";case A:o=r._payload,r=r._init;try{return Y(r(o))}catch{}}return null}var ee=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},V=[],U=-1;function I(r){return{current:r}}function H(r){0>U||(r.current=V[U],V[U]=null,U--)}function W(r,o){U++,V[U]=r.current,r.current=o}var X=I(null),oe=I(null),se=I(null),de=I(null);function xe(r,o){switch(W(se,o),W(oe,r),W(X,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?I_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=I_(o),r=P_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),W(X,r)}function he(){H(X),H(oe),H(se)}function Me(r){r.memoizedState!==null&&W(de,r);var o=X.current,c=P_(o,r.type);o!==c&&(W(oe,r),W(X,c))}function _e(r){oe.current===r&&(H(X),H(oe)),de.current===r&&(H(de),Zl._currentValue=q)}var ne,pe;function ae(r){if(ne===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);ne=o&&o[1]||"",pe=-1<c.stack.indexOf(`
|
|
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 p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){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 lN(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,p={...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,p),l._zod.parent===g)for(const w in d)w==="$ref"||w==="allOf"||w in p||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 y=l._zod.parent;if(y&&y!==g){s(y);const b=e.seen.get(y);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:Nh(t,"input",e.processors),output:Nh(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function On(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 On(s.element,n);if(s.type==="set")return On(s.valueType,n);if(s.type==="lazy")return On(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 On(s.innerType,n);if(s.type==="intersection")return On(s.left,n)||On(s.right,n);if(s.type==="record"||s.type==="map")return On(s.keyType,n)||On(s.valueType,n);if(s.type==="pipe")return On(s.in,n)||On(s.out,n);if(s.type==="object"){for(const i in s.shape)if(On(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(On(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(On(i,n))return!0;return!!(s.rest&&On(s.rest,n))}return!1}const q3=(e,t={})=>n=>{const s=aN({...n,processors:t});return ln(e,s),cN(s,e),lN(s,e)},Nh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=aN({...i??{},target:a,io:t,processors:n});return ln(e,l),cN(l,e),lN(l,e)},V3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=V3[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),d&&d.size>0){const g=[...d];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},G3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,format:f,multipleOf:d,exclusiveMaximum:p,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 p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},Z3=(e,t,n,s)=>{n.type="boolean"},Y3=(e,t,n,s)=>{n.not={}},X3=(e,t,n,s)=>{},Q3=(e,t,n,s)=>{const i=e._zod.def,a=B1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},W3=(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},J3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},e$=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},t$=(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=ln(a.element,t,{...s,path:[...s.path,"items"]})},n$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const p in l)i.properties[p]=ln(l[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(p=>{const g=a.shape[p]._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=ln(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},r$=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>ln(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},s$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=ln(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,d=[...f(a)?a.allOf:[a],...f(l)?l.allOf:[l]];n.allOf=d},o$=(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=ln(a.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const y of d)i.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=ln(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ln(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=l._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},i$=(e,t,n,s)=>{const i=e._zod.def,a=ln(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"}]},a$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},c$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},l$=(e,t,n,s)=>{const i=e._zod.def;ln(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)))},u$=(e,t,n,s)=>{const i=e._zod.def;ln(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},f$=(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;ln(a,t,s);const l=t.seen.get(e);l.ref=a},d$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},uN=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},h$=ue("ZodISODateTime",(e,t)=>{hU.init(e,t),qt.init(e,t)});function p$(e){return b3(h$,e)}const m$=ue("ZodISODate",(e,t)=>{pU.init(e,t),qt.init(e,t)});function g$(e){return x3(m$,e)}const y$=ue("ZodISOTime",(e,t)=>{mU.init(e,t),qt.init(e,t)});function v$(e){return S3(y$,e)}const b$=ue("ZodISODuration",(e,t)=>{gU.init(e,t),qt.init(e,t)});function x$(e){return _3(b$,e)}const S$=(e,t)=>{V1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>i5(e,n)},flatten:{value:n=>o5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yr=ue("ZodError",S$,{Parent:Error}),_$=wb(Yr),w$=Eb(Yr),E$=cp(Yr),T$=lp(Yr),C$=l5(Yr),R$=u5(Yr),N$=f5(Yr),j$=d5(Yr),A$=h5(Yr),k$=p5(Yr),O$=m5(Yr),M$=g5(Yr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nh(e,"input"),output:Nh(e,"output")}}),e.toJSONSchema=q3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>di(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>_$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>E$(e,n,s),e.parseAsync=async(n,s)=>w$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>T$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>C$(e,n,s),e.decode=(n,s)=>R$(e,n,s),e.encodeAsync=async(n,s)=>N$(e,n,s),e.decodeAsync=async(n,s)=>j$(e,n,s),e.safeEncode=(n,s)=>A$(e,n,s),e.safeDecode=(n,s)=>k$(e,n,s),e.safeEncodeAsync=async(n,s)=>O$(e,n,s),e.safeDecodeAsync=async(n,s)=>M$(e,n,s),e.refine=(n,s)=>e.check(CB(n,s)),e.superRefine=n=>e.check(RB(n)),e.overwrite=n=>e.check(Wc(n)),e.optional=()=>LE(e),e.exactOptional=()=>hB(e),e.nullable=()=>UE(e),e.nullish=()=>LE(UE(e)),e.nonoptional=n=>bB(e,n),e.array=()=>Gr(e),e.or=n=>Rb([e,n]),e.and=n=>aB(e,n),e.transform=n=>$E(e,fB(n)),e.default=n=>gB(e,n),e.prefault=n=>vB(e,n),e.catch=n=>SB(e,n),e.pipe=n=>$E(e,n),e.readonly=()=>EB(e),e.describe=n=>{const s=e.clone();return cu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return cu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const s=e.clone();return cu.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),fN=ue("_ZodString",(e,t)=>{Tb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>K3(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(j3(...s)),e.includes=(...s)=>e.check(O3(...s)),e.startsWith=(...s)=>e.check(M3(...s)),e.endsWith=(...s)=>e.check(I3(...s)),e.min=(...s)=>e.check(Rh(...s)),e.max=(...s)=>e.check(oN(...s)),e.length=(...s)=>e.check(iN(...s)),e.nonempty=(...s)=>e.check(Rh(1,...s)),e.lowercase=s=>e.check(A3(s)),e.uppercase=s=>e.check(k3(s)),e.trim=()=>e.check(D3()),e.normalize=(...s)=>e.check(P3(...s)),e.toLowerCase=()=>e.check(z3()),e.toUpperCase=()=>e.check(L3()),e.slugify=()=>e.check(U3())}),I$=ue("ZodString",(e,t)=>{Tb.init(e,t),fN.init(e,t),e.email=n=>e.check(WU(P$,n)),e.url=n=>e.check(r3(D$,n)),e.jwt=n=>e.check(v3(Q$,n)),e.emoji=n=>e.check(s3(z$,n)),e.guid=n=>e.check(OE(DE,n)),e.uuid=n=>e.check(JU(Ad,n)),e.uuidv4=n=>e.check(e3(Ad,n)),e.uuidv6=n=>e.check(t3(Ad,n)),e.uuidv7=n=>e.check(n3(Ad,n)),e.nanoid=n=>e.check(o3(L$,n)),e.guid=n=>e.check(OE(DE,n)),e.cuid=n=>e.check(i3(U$,n)),e.cuid2=n=>e.check(a3($$,n)),e.ulid=n=>e.check(c3(B$,n)),e.base64=n=>e.check(m3(Z$,n)),e.base64url=n=>e.check(g3(Y$,n)),e.xid=n=>e.check(l3(F$,n)),e.ksuid=n=>e.check(u3(H$,n)),e.ipv4=n=>e.check(f3(q$,n)),e.ipv6=n=>e.check(d3(V$,n)),e.cidrv4=n=>e.check(h3(K$,n)),e.cidrv6=n=>e.check(p3(G$,n)),e.e164=n=>e.check(y3(X$,n)),e.datetime=n=>e.check(p$(n)),e.date=n=>e.check(g$(n)),e.time=n=>e.check(v$(n)),e.duration=n=>e.check(x$(n))});function Fe(e){return QU(I$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),fN.init(e,t)}),P$=ue("ZodEmail",(e,t)=>{sU.init(e,t),qt.init(e,t)}),DE=ue("ZodGUID",(e,t)=>{nU.init(e,t),qt.init(e,t)}),Ad=ue("ZodUUID",(e,t)=>{rU.init(e,t),qt.init(e,t)}),D$=ue("ZodURL",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodEmoji",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodNanoID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodCUID",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodCUID2",(e,t)=>{lU.init(e,t),qt.init(e,t)}),B$=ue("ZodULID",(e,t)=>{uU.init(e,t),qt.init(e,t)}),F$=ue("ZodXID",(e,t)=>{fU.init(e,t),qt.init(e,t)}),H$=ue("ZodKSUID",(e,t)=>{dU.init(e,t),qt.init(e,t)}),q$=ue("ZodIPv4",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodIPv6",(e,t)=>{vU.init(e,t),qt.init(e,t)}),K$=ue("ZodCIDRv4",(e,t)=>{bU.init(e,t),qt.init(e,t)}),G$=ue("ZodCIDRv6",(e,t)=>{xU.init(e,t),qt.init(e,t)}),Z$=ue("ZodBase64",(e,t)=>{SU.init(e,t),qt.init(e,t)}),Y$=ue("ZodBase64URL",(e,t)=>{wU.init(e,t),qt.init(e,t)}),X$=ue("ZodE164",(e,t)=>{EU.init(e,t),qt.init(e,t)}),Q$=ue("ZodJWT",(e,t)=>{CU.init(e,t),qt.init(e,t)}),Cb=ue("ZodNumber",(e,t)=>{tN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>G3(e,s,i),e.gt=(s,i)=>e.check(IE(s,i)),e.gte=(s,i)=>e.check(sy(s,i)),e.min=(s,i)=>e.check(sy(s,i)),e.lt=(s,i)=>e.check(ME(s,i)),e.lte=(s,i)=>e.check(ry(s,i)),e.max=(s,i)=>e.check(ry(s,i)),e.int=s=>e.check(zE(s)),e.safe=s=>e.check(zE(s)),e.positive=s=>e.check(IE(0,s)),e.nonnegative=s=>e.check(sy(0,s)),e.negative=s=>e.check(ME(0,s)),e.nonpositive=s=>e.check(ry(0,s)),e.multipleOf=(s,i)=>e.check(PE(s,i)),e.step=(s,i)=>e.check(PE(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 tn(e){return w3(Cb,e)}const W$=ue("ZodNumberFormat",(e,t)=>{RU.init(e,t),Cb.init(e,t)});function zE(e){return T3(W$,e)}const J$=ue("ZodBoolean",(e,t)=>{NU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(e,n,s)});function no(e){return C3(J$,e)}const eB=ue("ZodUnknown",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3()});function ia(){return R3(eB)}const tB=ue("ZodNever",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(e,n,s)});function nB(e){return N3(tB,e)}const rB=ue("ZodArray",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Rh(n,s)),e.nonempty=n=>e.check(Rh(1,n)),e.max=(n,s)=>e.check(oN(n,s)),e.length=(n,s)=>e.check(iN(n,s)),e.unwrap=()=>e.element});function Gr(e,t){return $3(rB,e,t)}const sB=ue("ZodObject",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Yu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ia()}),e.loose=()=>e.clone({...e._zod.def,catchall:ia()}),e.strict=()=>e.clone({...e._zod.def,catchall:nB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>e5(e,n),e.safeExtend=n=>t5(e,n),e.merge=n=>n5(e,n),e.pick=n=>W4(e,n),e.omit=n=>J4(e,n),e.partial=(...n)=>r5(dN,e,n[0]),e.required=(...n)=>s5(hN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new sB(n)}const oB=ue("ZodUnion",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.options=t.options});function Rb(e,t){return new oB({type:"union",options:e,...De(t)})}const iB=ue("ZodIntersection",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i)});function aB(e,t){return new iB({type:"intersection",left:e,right:t})}const cB=ue("ZodRecord",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Zu(e,t,n){return new cB({type:"record",keyType:e,valueType:t,...De(n)})}const mv=ue("ZodEnum",(e,t)=>{zU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>Q3(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 mv({...t,checks:[],...De(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 mv({...t,checks:[],...De(i),entries:a})}});function Yu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new mv({type:"enum",entries:n,...De(t)})}const lB=ue("ZodLiteral",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(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 si(e,t){return new lB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const uB=ue("ZodTransform",(e,t)=>{UU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new U1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wu(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(wu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function fB(e){return new uB({type:"transform",transform:e})}const dN=ue("ZodOptional",(e,t)=>{sN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>uN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new dN({type:"optional",innerType:e})}const dB=ue("ZodExactOptional",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>uN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function hB(e){return new dB({type:"optional",innerType:e})}const pB=ue("ZodNullable",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function UE(e){return new pB({type:"nullable",innerType:e})}const mB=ue("ZodDefault",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gB(e,t){return new mB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():H1(t)}})}const yB=ue("ZodPrefault",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>l$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function vB(e,t){return new yB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():H1(t)}})}const hN=ue("ZodNonOptional",(e,t)=>{qU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function bB(e,t){return new hN({type:"nonoptional",innerType:e,...De(t)})}const xB=ue("ZodCatch",(e,t)=>{VU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>u$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function SB(e,t){return new xB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _B=ue("ZodPipe",(e,t)=>{KU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>f$(e,n,s,i),e.in=t.in,e.out=t.out});function $E(e,t){return new _B({type:"pipe",in:e,out:t})}const wB=ue("ZodReadonly",(e,t)=>{GU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>d$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function EB(e){return new wB({type:"readonly",innerType:e})}const TB=ue("ZodCustom",(e,t)=>{ZU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n)});function CB(e,t={}){return B3(TB,e,t)}function RB(e){return F3(e)}function BE(e){return E3(Cb,e)}At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1),encrypted:no().optional(),keyId:Fe().optional()});const pN=At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:tn().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:no()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1)});At({exists:no(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Yu(["PUT","POST"]).optional(),uploadHeaders:Zu(Fe(),Fe()).optional(),chunkSize:tn().int().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:no(),metadata:pN.optional(),error:Fe().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Fe().url(),expiresAt:Fe(),metadata:pN});At({error:Fe(),message:Fe().optional(),code:Fe().optional()});At({limit:BE().int().min(1).max(100).default(50),offset:BE().int().min(0).default(0)});const NB="json-row-frame-v1",jB="gzip",mN=Yu(["upsert","delete"]),AB=Zu(Fe(),Fe()),gN=Zu(Fe(),Rb([Fe(),Gr(Fe())])),kB=At({table:Fe(),row_id:Fe(),op:mN,payload:Zu(Fe(),ia()).nullable(),base_version:tn().int().nullable().optional()}),OB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(kB).min(1),schemaVersion:tn().int().min(1)}),MB=At({opIndex:tn().int(),status:si("applied")}),IB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:ia()}),PB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:no().optional()}),DB=Rb([MB,IB,PB]),zB=At({ok:si(!0),status:Yu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(DB)}),yN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),LB=At({id:Fe().min(1),table:Fe().min(1),scopes:gN,params:Zu(Fe(),ia()).optional(),cursor:tn().int(),bootstrapState:yN.nullable().optional()}),UB=At({clientId:Fe().min(1),limitCommits:tn().int().min(1),limitSnapshotRows:tn().int().min(1).optional(),maxSnapshotPages:tn().int().min(1).optional(),dedupeRows:no().optional(),subscriptions:Gr(LB)}),$B=At({table:Fe(),row_id:Fe(),op:mN,row_json:ia().nullable(),row_version:tn().int().nullable(),scopes:AB}),BB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr($B)}),FB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(NB),compression:si(jB)}),HB=At({table:Fe(),rows:Gr(ia()),chunks:Gr(FB).optional(),isFirstPage:no(),isLastPage:no()}),qB=At({id:Fe(),status:Yu(["active","revoked"]),scopes:gN,bootstrap:no(),bootstrapState:yN.nullable().optional(),nextCursor:tn().int(),commits:Gr(BB),snapshots:Gr(HB).optional()}),VB=At({ok:si(!0),subscriptions:Gr(qB)});At({clientId:Fe().min(1),push:OB.omit({clientId:!0}).optional(),pull:UB.omit({clientId:!0}).optional()});At({ok:si(!0),push:zB.optional(),pull:VB.optional()});new TextEncoder;const KB={setAttribute(){},setAttributes(){},setStatus(){}};function GB(e){return e.level?e.level:e.error?"error":"info"}function oy(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 ZB(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 YB(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 FE(e){const t={};for(const[n,s]of Object.entries(e)){const i=YB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function XB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(ZB(s))):n(KB)}}}function QB(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 WB(e){return{log(t){const n=GB(t),{event:s,...i}=t,a=oy(e.logger,n);if(!a)return;const l=FE(i);if(!l){a(s);return}a(s,l)},tracer:XB(e),metrics:QB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=oy(e.logger,"error")??oy(e.logger,"info");if(!s)return;const i=FE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function JB(e){if(e?.attributes)return{attributes:e.attributes}}function HE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function e6(){return WB({logger:E2,startSpan(e,t){return PR(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=JB(n);if(s){rE(e,t,s);return}rE(e,t)},gauge(e,t,n){const s=HE(n);if(s){sE(e,t,s);return}sE(e,t)},distribution(e,t,n){const s=HE(n);if(s){oE(e,t,s);return}oE(e,t)}},captureException(e){$R(e)}})}function t6(){return e6()}function n6(e){const t=r6(e);return V4(t),t6()}function r6(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[U4(),...n]}}var iy={exports:{}},Jl={};var qE;function s6(){if(qE)return Jl;qE=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 Jl.Fragment=t,Jl.jsx=n,Jl.jsxs=n,Jl}var VE;function o6(){return VE||(VE=1,iy.exports=s6()),iy.exports}var h=o6(),ay={exports:{}},eu={},cy={exports:{}},ly={};var KE;function i6(){return KE||(KE=1,(function(e){function t(D,K){var q=D.length;D.push(K);e:for(;0<q;){var V=q-1>>>1,U=D[V];if(0<i(U,K))D[V]=K,D[q]=U,q=V;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var K=D[0],q=D.pop();if(q!==K){D[0]=q;e:for(var V=0,U=D.length,I=U>>>1;V<I;){var H=2*(V+1)-1,W=D[H],X=H+1,oe=D[X];if(0>i(W,q))X<U&&0>i(oe,W)?(D[V]=oe,D[X]=q,V=X):(D[V]=W,D[H]=q,V=H);else if(X<U&&0>i(oe,q))D[V]=oe,D[X]=q,V=X;else break e}}return K}function i(D,K){var q=D.sortIndex-K.sortIndex;return q!==0?q:D.id-K.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=[],p=[],g=1,y=null,b=3,x=!1,S=!1,w=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(D){for(var K=n(p);K!==null;){if(K.callback===null)s(p);else if(K.startTime<=D)s(p),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,L||(L=!0,z());else{var K=n(p);K!==null&&ee(M,K.startTime-D)}}var L=!1,j=-1,k=5,P=-1;function G(){return T?!0:!(e.unstable_now()-P<k)}function B(){if(T=!1,L){var D=e.unstable_now();P=D;var K=!0;try{e:{S=!1,w&&(w=!1,A(j),j=-1),x=!0;var q=b;try{t:{for(R(D),y=n(d);y!==null&&!(y.expirationTime>D&&G());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var U=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof U=="function"){y.callback=U,R(D),K=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)K=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),K=!1}}break e}finally{y=null,b=q,x=!1}K=void 0}}finally{K?z():L=!1}}}var z;if(typeof N=="function")z=function(){N(B)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=B,z=function(){Y.postMessage(null)}}else z=function(){C(B,0)};function ee(D,K){j=C(function(){D(e.unstable_now())},K)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var q=b;b=K;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,K){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return K()}finally{b=q}},e.unstable_scheduleCallback=function(D,K,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,D){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=q+U,D={id:g++,callback:K,priorityLevel:D,startTime:q,expirationTime:U,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(A(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=U,t(d,D),S||x||(S=!0,L||(L=!0,z()))),D},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(D){var K=b;return function(){var q=b;b=K;try{return D.apply(this,arguments)}finally{b=q}}}})(ly)),ly}var GE;function a6(){return GE||(GE=1,cy.exports=i6()),cy.exports}var uy={exports:{}},Rn={};var ZE;function c6(){if(ZE)return Rn;ZE=1;var e=Gu();function t(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+p+" 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,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:d,containerInfo:p,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rn.createPortal=function(d,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return a(d,p,null,g)},Rn.flushSync=function(d){var p=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=p,s.p=g,s.d.f()}},Rn.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(d,p))},Rn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Rn.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?s.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):g==="script"&&s.d.X(d,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rn.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);s.d.M(d,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(d)},Rn.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin);s.d.L(d,g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Rn.preloadModule=function(d,p){if(typeof d=="string")if(p){var g=f(p.as,p.crossOrigin);s.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(d)},Rn.requestFormReset=function(d){s.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,g){return l.H.useFormState(d,p,g)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var YE;function vN(){if(YE)return uy.exports;YE=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(),uy.exports=c6(),uy.exports}var XE;function l6(){if(XE)return eu;XE=1;var e=a6(),t=Gu(),n=vN();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 p(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 v=m.alternate;if(v===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===c)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=v;else{for(var E=!1,O=m.child;O;){if(O===c){E=!0,c=m,u=v;break}if(O===u){E=!0,u=m,c=v;break}O=O.sibling}if(!E){for(O=v.child;O;){if(O===c){E=!0,c=v,u=m;break}if(O===u){E=!0,u=v,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 y=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"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function z(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case R:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case j:return o=r.displayName||null,o!==null?o:Y(r.type)||"Memo";case k:o=r._payload,r=r._init;try{return Y(r(o))}catch{}}return null}var ee=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},V=[],U=-1;function I(r){return{current:r}}function H(r){0>U||(r.current=V[U],V[U]=null,U--)}function W(r,o){U++,V[U]=r.current,r.current=o}var X=I(null),oe=I(null),se=I(null),de=I(null);function xe(r,o){switch(W(se,o),W(oe,r),W(X,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?I_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=I_(o),r=P_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),W(X,r)}function he(){H(X),H(oe),H(se)}function Me(r){r.memoizedState!==null&&W(de,r);var o=X.current,c=P_(o,r.type);o!==c&&(W(oe,r),W(X,c))}function _e(r){oe.current===r&&(H(X),H(oe)),de.current===r&&(H(de),Zl._currentValue=q)}var ne,pe;function ae(r){if(ne===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);ne=o&&o[1]||"",pe=-1<c.stack.indexOf(`
|
|
60
60
|
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
61
61
|
`+ne+r+pe}var we=!1;function ve(r,o){if(!r||we)return"";we=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ie){var re=ie}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(ie){re=ie}r.call(fe.prototype)}}else{try{throw Error()}catch(ie){re=ie}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.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 v=u.DetermineComponentFrameRoot(),E=v[0],O=v[1];if(E&&O){var $=E.split(`
|
|
62
62
|
`),te=O.split(`
|
|
63
63
|
`);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<te.length&&!te[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===te.length)for(u=$.length-1,m=te.length-1;1<=u&&0<=m&&$[u]!==te[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==te[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==te[m]){var ce=`
|
|
64
64
|
`+$[u].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=u&&0<=m);break}}}finally{we=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ae(c):""}function Se(r,o){switch(r.tag){case 26:case 27:case 5:return ae(r.type);case 16:return ae("Lazy");case 13:return r.child!==o&&o!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return ve(r.type,!1);case 11:return ve(r.type.render,!1);case 1:return ve(r.type,!0);case 31:return ae("Activity");default:return""}}function ye(r){try{var o="",c=null;do o+=Se(r,c),c=r,r=r.return;while(r);return o}catch(u){return`
|
|
65
65
|
Error generating stack: `+u.message+`
|
|
66
|
-
`+u.stack}}var Ue=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Xe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,lt=e.log,wr=e.unstable_setDisableYieldValue,Er=null,Qt=null;function ut(r){if(typeof lt=="function"&&wr(r),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Er,r)}catch{}}var xt=Math.clz32?Math.clz32:vn,ot=Math.log,Wt=Math.LN2;function vn(r){return r>>>=0,r===0?32:31-(ot(r)/Wt|0)|0}var kt=256,Cn=262144,er=4194304;function An(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 as(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var O=u&134217727;return O!==0?(u=O&~v,u!==0?m=An(u):(E&=O,E!==0?m=An(E):c||(c=O&~r,c!==0&&(m=An(c))))):(O=u&~v,O!==0?m=An(O):E!==0?m=An(E):c||(c=u&~r,c!==0&&(m=An(c)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:m}function cs(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function _a(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 _i(){var r=er;return er<<=1,(er&62914560)===0&&(er=4194304),r}function wi(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function ws(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tr(r,o,c,u,m,v){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,te=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-xt(c),fe=1<<ce;O[ce]=0,$[ce]=-1;var re=te[ce];if(re!==null)for(te[ce]=null,ce=0;ce<re.length;ce++){var ie=re[ce];ie!==null&&(ie.lane&=-536870913)}c&=~fe}u!==0&&ls(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function ls(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function uo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-xt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function fo(r,o){var c=o&-o;return c=(c&42)!==0?1:nr(c),(c&(r.suspendedLanes|o))!==0?0:c}function nr(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 cl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function cf(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:sw(r.type))}function lf(r,o){var c=K.p;try{return K.p=r,o()}finally{K.p=c}}var ho=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ho,Un="__reactProps$"+ho,wa="__reactContainer$"+ho,Op="__reactEvents$"+ho,wk="__reactListeners$"+ho,Ek="__reactHandles$"+ho,Sx="__reactResources$"+ho,ll="__reactMarker$"+ho;function Mp(r){delete r[Sn],delete r[Un],delete r[Op],delete r[wk],delete r[Ek]}function Ea(r){var o=r[Sn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[wa]||c[Sn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=F_(r);r!==null;){if(c=r[Sn])return c;r=F_(r)}return o}r=c,c=r.parentNode}return null}function Ta(r){if(r=r[Sn]||r[wa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ul(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Ca(r){var o=r[Sx];return o||(o=r[Sx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[ll]=!0}var _x=new Set,wx={};function Ei(r,o){Ra(r,o),Ra(r+"Capture",o)}function Ra(r,o){for(wx[r]=o,r=0;r<o.length;r++)_x.add(o[r])}var Tk=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]*$"),Ex={},Tx={};function Ck(r){return Ue.call(Tx,r)?!0:Ue.call(Ex,r)?!1:Tk.test(r)?Tx[r]=!0:(Ex[r]=!0,!1)}function uf(r,o,c){if(Ck(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 ff(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 Es(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 Tr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Cx(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Rk(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,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return m.call(this)},set:function(E){c=""+E,v.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 Ip(r){if(!r._valueTracker){var o=Cx(r)?"checked":"value";r._valueTracker=Rk(r,o,""+r[o])}}function Rx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=Cx(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function df(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 Nk=/[\n"\\]/g;function Cr(r){return r.replace(Nk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Pp(r,o,c,u,m,v,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=""+Tr(o)):r.value!==""+Tr(o)&&(r.value=""+Tr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Dp(r,E,Tr(o)):c!=null?Dp(r,E,Tr(c)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+Tr(O):r.removeAttribute("name")}function Nx(r,o,c,u,m,v,E,O){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Ip(r);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(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),Ip(r)}function Dp(r,o,c){o==="number"&&df(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Na(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=""+Tr(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 jx(r,o,c){if(o!=null&&(o=""+Tr(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Tr(c):""}function Ax(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=Tr(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),Ip(r)}function ja(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var jk=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 kx(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||jk.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function Ox(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&&kx(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&kx(r,v,o[v])}function zp(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 Ak=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"]]),kk=/^[\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 hf(r){return kk.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ts(){}var Lp=null;function Up(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Aa=null,ka=null;function Mx(r){var o=Ta(r);if(o&&(r=o.stateNode)){var c=r[Un]||null;e:switch(r=o.stateNode,o.type){case"input":if(Pp(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="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Un]||null;if(!m)throw Error(s(90));Pp(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&&Rx(u)}break e;case"textarea":jx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Na(r,!!c.multiple,o,!1)}}}var $p=!1;function Ix(r,o,c){if($p)return r(o,c);$p=!0;try{var u=r(o);return u}finally{if($p=!1,(Aa!==null||ka!==null)&&(ed(),Aa&&(o=Aa,r=ka,ka=Aa=null,Mx(o),r)))for(o=0;o<r.length;o++)Mx(r[o])}}function fl(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Un]||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 Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(Cs)try{var dl={};Object.defineProperty(dl,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{Bp=!1}var po=null,Fp=null,pf=null;function Px(){if(pf)return pf;var r,o=Fp,c=o.length,u,m="value"in po?po.value:po.textContent,v=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[v-u];u++);return pf=m.slice(r,1<u?1-u:void 0)}function mf(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 gf(){return!0}function Dx(){return!1}function $n(r){function o(c,u,m,v,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var O in r)r.hasOwnProperty(O)&&(c=r[O],this[O]=c?c(v):v[O]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?gf:Dx,this.isPropagationStopped=Dx,this}return y(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=gf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=gf)},persist:function(){},isPersistent:gf}),o}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yf=$n(Ti),hl=y({},Ti,{view:0,detail:0}),Ok=$n(hl),Hp,qp,pl,vf=y({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==pl&&(pl&&r.type==="mousemove"?(Hp=r.screenX-pl.screenX,qp=r.screenY-pl.screenY):qp=Hp=0,pl=r),Hp)},movementY:function(r){return"movementY"in r?r.movementY:qp}}),zx=$n(vf),Mk=y({},vf,{dataTransfer:0}),Ik=$n(Mk),Pk=y({},hl,{relatedTarget:0}),Vp=$n(Pk),Dk=y({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),zk=$n(Dk),Lk=y({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Uk=$n(Lk),$k=y({},Ti,{data:0}),Lx=$n($k),Bk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fk={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"},Hk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qk(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Hk[r])?!!o[r]:!1}function Kp(){return qk}var Vk=y({},hl,{key:function(r){if(r.key){var o=Bk[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=mf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Fk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(r){return r.type==="keypress"?mf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?mf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Kk=$n(Vk),Gk=y({},vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ux=$n(Gk),Zk=y({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),Yk=$n(Zk),Xk=y({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qk=$n(Xk),Wk=y({},vf,{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}),Jk=$n(Wk),eO=y({},Ti,{newState:0,oldState:0}),tO=$n(eO),nO=[9,13,27,32],Gp=Cs&&"CompositionEvent"in window,ml=null;Cs&&"documentMode"in document&&(ml=document.documentMode);var rO=Cs&&"TextEvent"in window&&!ml,$x=Cs&&(!Gp||ml&&8<ml&&11>=ml),Bx=" ",Fx=!1;function Hx(r,o){switch(r){case"keyup":return nO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Oa=!1;function sO(r,o){switch(r){case"compositionend":return qx(o);case"keypress":return o.which!==32?null:(Fx=!0,Bx);case"textInput":return r=o.data,r===Bx&&Fx?null:r;default:return null}}function oO(r,o){if(Oa)return r==="compositionend"||!Gp&&Hx(r,o)?(r=Px(),pf=Fp=po=null,Oa=!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 $x&&o.locale!=="ko"?null:o.data;default:return null}}var iO={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 Vx(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!iO[r.type]:o==="textarea"}function Kx(r,o,c,u){Aa?ka?ka.push(u):ka=[u]:Aa=u,o=ad(o,"onChange"),0<o.length&&(c=new yf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var gl=null,yl=null;function aO(r){N_(r,0)}function bf(r){var o=ul(r);if(Rx(o))return r}function Gx(r,o){if(r==="change")return o}var Zx=!1;if(Cs){var Zp;if(Cs){var Yp="oninput"in document;if(!Yp){var Yx=document.createElement("div");Yx.setAttribute("oninput","return;"),Yp=typeof Yx.oninput=="function"}Zp=Yp}else Zp=!1;Zx=Zp&&(!document.documentMode||9<document.documentMode)}function Xx(){gl&&(gl.detachEvent("onpropertychange",Qx),yl=gl=null)}function Qx(r){if(r.propertyName==="value"&&bf(yl)){var o=[];Kx(o,yl,r,Up(r)),Ix(aO,o)}}function cO(r,o,c){r==="focusin"?(Xx(),gl=o,yl=c,gl.attachEvent("onpropertychange",Qx)):r==="focusout"&&Xx()}function lO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bf(yl)}function uO(r,o){if(r==="click")return bf(o)}function fO(r,o){if(r==="input"||r==="change")return bf(o)}function dO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:dO;function vl(r,o){if(rr(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(!Ue.call(o,m)||!rr(r[m],o[m]))return!1}return!0}function Wx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Jx(r,o){var c=Wx(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=Wx(c)}}function e0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?e0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function t0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=df(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=df(r.document)}return o}function Xp(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 hO=Cs&&"documentMode"in document&&11>=document.documentMode,Ma=null,Qp=null,bl=null,Wp=!1;function n0(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Wp||Ma==null||Ma!==df(u)||(u=Ma,"selectionStart"in u&&Xp(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}),bl&&vl(bl,u)||(bl=u,u=ad(Qp,"onSelect"),0<u.length&&(o=new yf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ma)))}function Ci(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ia={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},Jp={},r0={};Cs&&(r0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ri(r){if(Jp[r])return Jp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in r0)return Jp[r]=o[c];return r}var s0=Ri("animationend"),o0=Ri("animationiteration"),i0=Ri("animationstart"),pO=Ri("transitionrun"),mO=Ri("transitionstart"),gO=Ri("transitioncancel"),a0=Ri("transitionend"),c0=new Map,em="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(" ");em.push("scrollEnd");function Qr(r,o){c0.set(r,o),Ei(o,[r])}var xf=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)},Rr=[],Pa=0,tm=0;function Sf(){for(var r=Pa,o=tm=Pa=0;o<r;){var c=Rr[o];Rr[o++]=null;var u=Rr[o];Rr[o++]=null;var m=Rr[o];Rr[o++]=null;var v=Rr[o];if(Rr[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}v!==0&&l0(c,m,v)}}function _f(r,o,c,u){Rr[Pa++]=r,Rr[Pa++]=o,Rr[Pa++]=c,Rr[Pa++]=u,tm|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function nm(r,o,c,u){return _f(r,o,c,u),wf(r)}function Ni(r,o){return _f(r,null,null,o),wf(r)}function l0(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,v=r.return;v!==null;)v.childLanes|=c,u=v.alternate,u!==null&&(u.childLanes|=c),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(m=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,m&&o!==null&&(m=31-xt(c),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),v):null}function wf(r){if(50<Bl)throw Bl=0,fg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function yO(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 sr(r,o,c,u){return new yO(r,o,c,u)}function rm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Rs(r,o){var c=r.alternate;return c===null?(c=sr(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 u0(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 Ef(r,o,c,u,m,v){var E=0;if(u=r,typeof r=="function")rm(r)&&(E=1);else if(typeof r=="string")E=_M(r,c,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=sr(31,c,o,m),r.elementType=P,r.lanes=v,r;case w:return ji(c.children,m,v,o);case T:E=8,m|=24;break;case C:return r=sr(12,c,o,m|2),r.elementType=C,r.lanes=v,r;case M:return r=sr(13,c,o,m),r.elementType=M,r.lanes=v,r;case L:return r=sr(19,c,o,m),r.elementType=L,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:E=10;break e;case k:E=9;break e;case R:E=11;break e;case j: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=sr(E,c,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function ji(r,o,c,u){return r=sr(7,r,u,o),r.lanes=c,r}function sm(r,o,c){return r=sr(6,r,null,o),r.lanes=c,r}function f0(r){var o=sr(18,null,null,0);return o.stateNode=r,o}function om(r,o,c){return o=sr(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var d0=new WeakMap;function Nr(r,o){if(typeof r=="object"&&r!==null){var c=d0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ye(o)},d0.set(r,o),o)}return{value:r,source:o,stack:ye(o)}}var za=[],La=0,Tf=null,xl=0,jr=[],Ar=0,mo=null,us=1,fs="";function Ns(r,o){za[La++]=xl,za[La++]=Tf,Tf=r,xl=o}function h0(r,o,c){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,mo=r;var u=us;r=fs;var m=32-xt(u)-1;u&=~(1<<m),c+=1;var v=32-xt(o)+m;if(30<v){var E=m-m%5;v=(u&(1<<E)-1).toString(32),u>>=E,m-=E,us=1<<32-xt(o)+m|c<<m|u,fs=v+r}else us=1<<v|c<<m|u,fs=r}function im(r){r.return!==null&&(Ns(r,1),h0(r,1,0))}function am(r){for(;r===Tf;)Tf=za[--La],za[La]=null,xl=za[--La],za[La]=null;for(;r===mo;)mo=jr[--Ar],jr[Ar]=null,fs=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null}function p0(r,o){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,us=o.id,fs=o.overflow,mo=r}var _n=null,Mt=null,rt=!1,go=null,kr=!1,cm=Error(s(519));function yo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sl(Nr(o,r)),cm}function m0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[Sn]=r,o[Un]=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<Hl.length;c++)et(Hl[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),Nx(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),Ax(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||O_(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=Ts),o=!0):o=!1,o||yo(r,!0)}function g0(r){for(_n=r.return;_n;)switch(_n.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:_n=_n.return}}function Ua(r){if(r!==_n)return!1;if(!rt)return g0(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")||Cg(r.type,r.memoizedProps)),c=!c),c&&Mt&&yo(r),g0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=B_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=B_(r)}else o===27?(o=Mt,ko(r.type)?(r=kg,kg=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function Ai(){Mt=_n=null,rt=!1}function lm(){var r=go;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),go=null),r}function Sl(r){go===null?go=[r]:go.push(r)}var um=I(null),ki=null,js=null;function vo(r,o,c){W(um,o._currentValue),o._currentValue=c}function As(r){r._currentValue=um.current,H(um)}function fm(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 dm(r,o,c,u){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var v=m.dependencies;if(v!==null){var E=m.child;v=v.firstContext;e:for(;v!==null;){var O=v;v=m;for(var $=0;$<o.length;$++)if(O.context===o[$]){v.lanes|=c,O=v.alternate,O!==null&&(O.lanes|=c),fm(v.return,c,r),u||(E=null);break e}v=O.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),fm(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 $a(r,o,c,u){r=null;for(var m=o,v=!1;m!==null;){if(!v){if((m.flags&524288)!==0)v=!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;rr(m.pendingProps.value,E.value)||(r!==null?r.push(O):r=[O])}}else if(m===de.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Zl):r=[Zl])}m=m.return}r!==null&&dm(o,r,c,u),o.flags|=262144}function Cf(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Oi(r){ki=r,js=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function wn(r){return y0(ki,r)}function Rf(r,o){return ki===null&&Oi(r),y0(r,o)}function y0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},js===null){if(r===null)throw Error(s(308));js=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else js=js.next=o;return c}var vO=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()})}},bO=e.unstable_scheduleCallback,xO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hm(){return{controller:new vO,data:new Map,refCount:0}}function _l(r){r.refCount--,r.refCount===0&&bO(xO,function(){r.controller.abort()})}var wl=null,pm=0,Ba=0,Fa=null;function SO(r,o){if(wl===null){var c=wl=[];pm=0,Ba=yg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return pm++,o.then(v0,v0),o}function v0(){if(--pm===0&&wl!==null){Fa!==null&&(Fa.status="fulfilled");var r=wl;wl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function _O(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 b0=D.S;D.S=function(r,o){n_=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&SO(r,o),b0!==null&&b0(r,o)};var Mi=I(null);function mm(){var r=Mi.current;return r!==null?r:Nt.pooledCache}function Nf(r,o){o===null?W(Mi,Mi.current):W(Mi,o.pool)}function x0(){var r=mm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),gm=Error(s(474)),jf=Error(s(542)),Af={then:function(){}};function S0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function _0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ts,Ts),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,E0(r),r;default:if(typeof o.status=="string")o.then(Ts,Ts);else{if(r=Nt,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,E0(r),r}throw Pi=o,Ha}}function Ii(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Pi=c,Ha):c}}var Pi=null;function w0(){if(Pi===null)throw Error(s(459));var r=Pi;return Pi=null,r}function E0(r){if(r===Ha||r===jf)throw Error(s(483))}var qa=null,El=0;function kf(r){var o=El;return El+=1,qa===null&&(qa=[]),_0(qa,r,o)}function Tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Of(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 T0(r){function o(Z,F){if(r){var J=Z.deletions;J===null?(Z.deletions=[F],Z.flags|=16):J.push(F)}}function c(Z,F){if(!r)return null;for(;F!==null;)o(Z,F),F=F.sibling;return null}function u(Z){for(var F=new Map;Z!==null;)Z.key!==null?F.set(Z.key,Z):F.set(Z.index,Z),Z=Z.sibling;return F}function m(Z,F){return Z=Rs(Z,F),Z.index=0,Z.sibling=null,Z}function v(Z,F,J){return Z.index=J,r?(J=Z.alternate,J!==null?(J=J.index,J<F?(Z.flags|=67108866,F):J):(Z.flags|=67108866,F)):(Z.flags|=1048576,F)}function E(Z){return r&&Z.alternate===null&&(Z.flags|=67108866),Z}function O(Z,F,J,le){return F===null||F.tag!==6?(F=sm(J,Z.mode,le),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function $(Z,F,J,le){var ze=J.type;return ze===w?ce(Z,F,J.props.children,le,J.key):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ii(ze)===F.type)?(F=m(F,J.props),Tl(F,J),F.return=Z,F):(F=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(F,J),F.return=Z,F)}function te(Z,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=om(J,Z.mode,le),F.return=Z,F):(F=m(F,J.children||[]),F.return=Z,F)}function ce(Z,F,J,le,ze){return F===null||F.tag!==7?(F=ji(J,Z.mode,le,ze),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function fe(Z,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=sm(""+F,Z.mode,J),F.return=Z,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=Ef(F.type,F.key,F.props,null,Z.mode,J),Tl(J,F),J.return=Z,J;case S:return F=om(F,Z.mode,J),F.return=Z,F;case A:return F=Ii(F),fe(Z,F,J)}if(ee(F)||z(F))return F=ji(F,Z.mode,J,null),F.return=Z,F;if(typeof F.then=="function")return fe(Z,kf(F),J);if(F.$$typeof===N)return fe(Z,Rf(Z,F),J);Of(Z,F)}return null}function re(Z,F,J,le){var ze=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:O(Z,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(Z,F,J,le):null;case S:return J.key===ze?te(Z,F,J,le):null;case A:return J=Ii(J),re(Z,F,J,le)}if(ee(J)||z(J))return ze!==null?null:ce(Z,F,J,le,null);if(typeof J.then=="function")return re(Z,F,kf(J),le);if(J.$$typeof===N)return re(Z,F,Rf(Z,J),le);Of(Z,J)}return null}function ie(Z,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Z=Z.get(J)||null,O(F,Z,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return Z=Z.get(le.key===null?J:le.key)||null,$(F,Z,le,ze);case S:return Z=Z.get(le.key===null?J:le.key)||null,te(F,Z,le,ze);case A:return le=Ii(le),ie(Z,F,J,le,ze)}if(ee(le)||z(le))return Z=Z.get(J)||null,ce(F,Z,le,ze,null);if(typeof le.then=="function")return ie(Z,F,J,kf(le),ze);if(le.$$typeof===N)return ie(Z,F,J,Rf(F,le),ze);Of(F,le)}return null}function Re(Z,F,J,le){for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null;ke!==null&&Ye<J.length;Ye++){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var dt=re(Z,ke,J[Ye],le);if(dt===null){ke===null&&(ke=nt);break}r&&ke&&dt.alternate===null&&o(Z,ke),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,ke=nt}if(Ye===J.length)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;Ye<J.length;Ye++)ke=fe(Z,J[Ye],le),ke!==null&&(F=v(ke,F,Ye),ft===null?ze=ke:ft.sibling=ke,ft=ke);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);Ye<J.length;Ye++)nt=ie(ke,Z,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&ke.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&ke.forEach(function(Do){return o(Z,Do)}),rt&&Ns(Z,Ye),ze}function $e(Z,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null,dt=J.next();ke!==null&&!dt.done;Ye++,dt=J.next()){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var Do=re(Z,ke,dt.value,le);if(Do===null){ke===null&&(ke=nt);break}r&&ke&&Do.alternate===null&&o(Z,ke),F=v(Do,F,Ye),ft===null?ze=Do:ft.sibling=Do,ft=Do,ke=nt}if(dt.done)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;!dt.done;Ye++,dt=J.next())dt=fe(Z,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);!dt.done;Ye++,dt=J.next())dt=ie(ke,Z,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&ke.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&ke.forEach(function(MM){return o(Z,MM)}),rt&&Ns(Z,Ye),ze}function Ct(Z,F,J,le){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;F!==null;){if(F.key===ze){if(ze=J.type,ze===w){if(F.tag===7){c(Z,F.sibling),le=m(F,J.props.children),le.return=Z,Z=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Ii(ze)===F.type){c(Z,F.sibling),le=m(F,J.props),Tl(le,J),le.return=Z,Z=le;break e}c(Z,F);break}else o(Z,F);F=F.sibling}J.type===w?(le=ji(J.props.children,Z.mode,le,J.key),le.return=Z,Z=le):(le=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(le,J),le.return=Z,Z=le)}return E(Z);case S:e:{for(ze=J.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){c(Z,F.sibling),le=m(F,J.children||[]),le.return=Z,Z=le;break e}else{c(Z,F);break}else o(Z,F);F=F.sibling}le=om(J,Z.mode,le),le.return=Z,Z=le}return E(Z);case A:return J=Ii(J),Ct(Z,F,J,le)}if(ee(J))return Re(Z,F,J,le);if(z(J)){if(ze=z(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(Z,F,J,le)}if(typeof J.then=="function")return Ct(Z,F,kf(J),le);if(J.$$typeof===N)return Ct(Z,F,Rf(Z,J),le);Of(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(Z,F.sibling),le=m(F,J),le.return=Z,Z=le):(c(Z,F),le=sm(J,Z.mode,le),le.return=Z,Z=le),E(Z)):c(Z,F)}return function(Z,F,J,le){try{El=0;var ze=Ct(Z,F,J,le);return qa=null,ze}catch(ke){if(ke===Ha||ke===jf)throw ke;var ft=sr(29,ke,null,Z.mode);return ft.lanes=le,ft.return=Z,ft}}}var Di=T0(!0),C0=T0(!1),bo=!1;function ym(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vm(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 xo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function So(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(gt&2)!==0){var m=u.pending;return m===null?o.next=o:(o.next=m.next,m.next=o),u.pending=o,o=wf(r),l0(r,null,c),o}return _f(r,u,o,c),wf(r)}function Cl(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,uo(r,c)}}function bm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?m=v=o:v=v.next=o}else m=v=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,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 xm=!1;function Rl(){if(xm){var r=Fa;if(r!==null)throw r}}function Nl(r,o,c,u){xm=!1;var m=r.updateQueue;bo=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var $=O,te=$.next;$.next=null,E===null?v=te:E.next=te,E=$;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,O=ce.lastBaseUpdate,O!==E&&(O===null?ce.firstBaseUpdate=te:O.next=te,ce.lastBaseUpdate=$))}if(v!==null){var fe=m.baseState;E=0,ce=te=$=null,O=v;do{var re=O.lane&-536870913,ie=re!==O.lane;if(ie?(tt&re)===re:(u&re)===re){re!==0&&re===Ba&&(xm=!0),ce!==null&&(ce=ce.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Re=r,$e=O;re=o;var Ct=c;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){fe=Re.call(Ct,fe,re);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,re=typeof Re=="function"?Re.call(Ct,fe,re):Re,re==null)break e;fe=y({},fe,re);break e;case 2:bo=!0}}re=O.callback,re!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ce===null?(te=ce=ie,$=fe):ce=ce.next=ie,E|=re;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);ce===null&&($=fe),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Co|=E,r.lanes=E,r.memoizedState=fe}}function R0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function N0(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)R0(c[r],o)}var Va=I(null),Mf=I(0);function j0(r,o){r=Us,W(Mf,r),W(Va,o),Us=r|o.baseLanes}function Sm(){W(Mf,Us),W(Va,Va.current)}function _m(){Us=Mf.current,H(Va),H(Mf)}var or=I(null),Or=null;function _o(r){var o=r.alternate;W(Jt,Jt.current&1),W(or,r),Or===null&&(o===null||Va.current!==null||o.memoizedState!==null)&&(Or=r)}function wm(r){W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)}function A0(r){r.tag===22?(W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)):wo()}function wo(){W(Jt,Jt.current),W(or,or.current)}function ir(r){H(or),Or===r&&(Or=null),H(Jt)}var Jt=I(0);function If(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||jg(c)||Ag(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 ks=0,Ze=null,Et=null,rn=null,Pf=!1,Ka=!1,zi=!1,Df=0,jl=0,Ga=null,wO=0;function Kt(){throw Error(s(321))}function Em(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!rr(r[c],o[c]))return!1;return!0}function Tm(r,o,c,u,m,v){return ks=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?hS:$m,zi=!1,v=c(u,m),zi=!1,Ka&&(v=O0(o,c,u,m)),k0(r),v}function k0(r){D.H=Ol;var o=Et!==null&&Et.next!==null;if(ks=0,rn=Et=Ze=null,Pf=!1,jl=0,Ga=null,o)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&Cf(r)&&(sn=!0))}function O0(r,o,c,u){Ze=r;var m=0;do{if(Ka&&(Ga=null),jl=0,Ka=!1,25<=m)throw Error(s(301));if(m+=1,rn=Et=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}D.H=pS,v=o(c,u)}while(Ka);return v}function EO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Al(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function Cm(){var r=Df!==0;return Df=0,r}function Rm(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Nm(r){if(Pf){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Pf=!1}ks=0,rn=Et=Ze=null,Ka=!1,jl=Df=0,Ga=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=r:rn=rn.next=r,rn}function en(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=rn===null?Ze.memoizedState:rn.next;if(o!==null)rn=o,Et=r;else{if(r===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));Et=r,r={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?Ze.memoizedState=rn=r:rn=rn.next=r}return rn}function zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(r){var o=jl;return jl+=1,Ga===null&&(Ga=[]),r=_0(Ga,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?hS:$m),r}function Lf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Al(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function jm(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=zf(),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]=G;return o.index++,c}function Os(r,o){return typeof o=="function"?o(r):o}function Uf(r){var o=en();return Am(o,Et,r)}function Am(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;var m=r.baseQueue,v=u.pending;if(v!==null){if(m!==null){var E=m.next;m.next=v.next,v.next=E}o.baseQueue=m=v,u.pending=null}if(v=r.baseState,m===null)r.memoizedState=v;else{o=m.next;var O=E=null,$=null,te=o,ce=!1;do{var fe=te.lane&-536870913;if(fe!==te.lane?(tt&fe)===fe:(ks&fe)===fe){var re=te.revertLane;if(re===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),fe===Ba&&(ce=!0);else if((ks&re)===re){te=te.next,re===Ba&&(ce=!0);continue}else fe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=fe,E=v):$=$.next=fe,Ze.lanes|=re,Co|=re;fe=te.action,zi&&c(v,fe),v=te.hasEagerState?te.eagerState:c(v,fe)}else re={lane:fe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=re,E=v):$=$.next=re,Ze.lanes|=fe,Co|=fe;te=te.next}while(te!==null&&te!==o);if($===null?E=v:$.next=O,!rr(v,r.memoizedState)&&(sn=!0,ce&&(c=Fa,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function km(r){var o=en(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,v=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);rr(v,o.memoizedState)||(sn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,u]}function M0(r,o,c){var u=Ze,m=en(),v=rt;if(v){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!rr((Et||m).memoizedState,c);if(E&&(m.memoizedState=c,sn=!0),m=m.queue,Im(D0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,Za(9,{destroy:void 0},P0.bind(null,u,m,c,o),null),Nt===null)throw Error(s(349));v||(ks&127)!==0||I0(u,o,c)}return c}function I0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=zf(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function P0(r,o,c,u){o.value=c,o.getSnapshot=u,z0(o)&&L0(r)}function D0(r,o,c){return c(function(){z0(o)&&L0(r)})}function z0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!rr(r,c)}catch{return!0}}function L0(r){var o=Ni(r,2);o!==null&&Vn(o,r,2)}function Om(r){var o=kn();if(typeof r=="function"){var c=r;if(r=c(),zi){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:r},o}function U0(r,o,c,u){return r.baseState=c,Am(r,Et,typeof u=="function"?u:Os)}function TO(r,o,c,u,m){if(Ff(r))throw Error(s(485));if(r=o.action,r!==null){var v={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){v.listeners.push(E)}};D.T!==null?c(!0):v.isTransition=!1,u(v),c=o.pending,c===null?(v.next=o.pending=v,$0(o,v)):(v.next=c.next,o.pending=c.next=v)}}function $0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=D.T,E={};D.T=E;try{var O=c(m,u),$=D.S;$!==null&&$(E,O),B0(r,o,O)}catch(te){Mm(r,o,te)}finally{v!==null&&E.types!==null&&(v.types=E.types),D.T=v}}else try{v=c(m,u),B0(r,o,v)}catch(te){Mm(r,o,te)}}function B0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){F0(r,o,u)},function(u){return Mm(r,o,u)}):F0(r,o,c)}function F0(r,o,c){o.status="fulfilled",o.value=c,H0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,$0(r,c)))}function Mm(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,H0(o),o=o.next;while(o!==u)}r.action=null}function H0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function q0(r,o){return o}function V0(r,o){if(rt){var c=Nt.formState;if(c!==null){e:{var u=Ze;if(rt){if(Mt){t:{for(var m=Mt,v=kr;m.nodeType!==8;){if(!v){m=null;break t}if(m=Mr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){Mt=Mr(m.nextSibling),u=m.data==="F!";break e}}yo(u)}u=!1}u&&(o=c[0])}}return c=kn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:q0,lastRenderedState:o},c.queue=u,c=uS.bind(null,Ze,u),u.dispatch=c,u=Om(!1),v=Um.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=TO.bind(null,Ze,m,v,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function K0(r){var o=en();return G0(o,Et,r)}function G0(r,o,c){if(o=Am(r,o,q0)[0],r=Uf(Os)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Al(o)}catch(E){throw E===Ha?jf:E}else u=o;o=en();var m=o.queue,v=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,Za(9,{destroy:void 0},CO.bind(null,m,c),null)),[u,v,r]}function CO(r,o){r.action=o}function Z0(r){var o=en(),c=Et;if(c!==null)return G0(o,c,r);en(),o=o.memoizedState,c=en();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function Za(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=zf(),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 Y0(){return en().memoizedState}function $f(r,o,c,u){var m=kn();Ze.flags|=r,m.memoizedState=Za(1|o,{destroy:void 0},c,u===void 0?null:u)}function Bf(r,o,c,u){var m=en();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&Em(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function X0(r,o){$f(8390656,8,r,o)}function Im(r,o){Bf(2048,8,r,o)}function RO(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=zf(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function Q0(r){var o=en().memoizedState;return RO({ref:o,nextImpl:r}),function(){if((gt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function W0(r,o){return Bf(4,2,r,o)}function J0(r,o){return Bf(4,4,r,o)}function eS(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 tS(r,o,c){c=c!=null?c.concat([r]):null,Bf(4,4,eS.bind(null,o,r),c)}function Pm(){}function nS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Em(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function rS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&Em(o,u[1]))return u[0];if(u=r(),zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Dm(r,o,c){return c===void 0||(ks&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=s_(),Ze.lanes|=r,Co|=r,c)}function sS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Dm(r,c,u),rr(r,o)||(sn=!0),r):(ks&42)===0||(ks&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=s_(),Ze.lanes|=r,Co|=r,o)}function oS(r,o,c,u,m){var v=K.p;K.p=v!==0&&8>v?v:8;var E=D.T,O={};D.T=O,Um(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(O,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=_O($,u);kl(r,o,ce,lr(r))}else kl(r,o,u,lr(r))}catch(fe){kl(r,o,{then:function(){},status:"rejected",reason:fe},lr())}finally{K.p=v,E!==null&&O.types!==null&&(E.types=O.types),D.T=E}}function NO(){}function zm(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=iS(r).queue;oS(r,m,o,q,c===null?NO:function(){return aS(r),c(u)})}function iS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function aS(r){var o=iS(r);o.next===null&&(o=r.alternate.memoizedState),kl(r,o.next.queue,{},lr())}function Lm(){return wn(Zl)}function cS(){return en().memoizedState}function lS(){return en().memoizedState}function jO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=xo(c);var u=So(o,r,c);u!==null&&(Vn(u,o,c),Cl(u,o,c)),o={cache:hm()},r.payload=o;return}o=o.return}}function AO(r,o,c){var u=lr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ff(r)?fS(o,c):(c=nm(r,o,c,u),c!==null&&(Vn(c,r,u),dS(c,o,u)))}function uS(r,o,c){var u=lr();kl(r,o,c,u)}function kl(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ff(r))fS(o,m);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,O=v(E,c);if(m.hasEagerState=!0,m.eagerState=O,rr(O,E))return _f(r,o,m,0),Nt===null&&Sf(),!1}catch{}if(c=nm(r,o,m,u),c!==null)return Vn(c,r,u),dS(c,o,u),!0}return!1}function Um(r,o,c,u){if(u={lane:2,revertLane:yg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ff(r)){if(o)throw Error(s(479))}else o=nm(r,c,u,2),o!==null&&Vn(o,r,2)}function Ff(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function fS(r,o){Ka=Pf=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function dS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}var Ol={readContext:wn,use:Lf,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Ol.useEffectEvent=Kt;var hS={readContext:wn,use:Lf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:X0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,$f(4194308,4,eS.bind(null,o,r),c)},useLayoutEffect:function(r,o){return $f(4194308,4,r,o)},useInsertionEffect:function(r,o){$f(4,2,r,o)},useMemo:function(r,o){var c=kn();o=o===void 0?null:o;var u=r();if(zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=kn();if(c!==void 0){var m=c(o);if(zi){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=AO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=Om(r);var o=r.queue,c=uS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Pm,useDeferredValue:function(r,o){var c=kn();return Dm(c,r,o)},useTransition:function(){var r=Om(!1);return r=oS.bind(null,Ze,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=kn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Nt===null)throw Error(s(349));(tt&127)!==0||I0(u,o,c)}m.memoizedState=c;var v={value:c,getSnapshot:o};return m.queue=v,X0(D0.bind(null,u,v,r),[r]),u.flags|=2048,Za(9,{destroy:void 0},P0.bind(null,u,v,c,o),null),c},useId:function(){var r=kn(),o=Nt.identifierPrefix;if(rt){var c=fs,u=us;c=(u&~(1<<32-xt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Df++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=wO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Lm,useFormState:V0,useActionState:V0,useOptimistic:function(r){var o=kn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Um.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:jm,useCacheRefresh:function(){return kn().memoizedState=jO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((gt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},$m={readContext:wn,use:Lf,useCallback:nS,useContext:wn,useEffect:Im,useImperativeHandle:tS,useInsertionEffect:W0,useLayoutEffect:J0,useMemo:rS,useReducer:Uf,useRef:Y0,useState:function(){return Uf(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return sS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Uf(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:M0,useId:cS,useHostTransitionStatus:Lm,useFormState:K0,useActionState:K0,useOptimistic:function(r,o){var c=en();return U0(c,Et,r,o)},useMemoCache:jm,useCacheRefresh:lS};$m.useEffectEvent=Q0;var pS={readContext:wn,use:Lf,useCallback:nS,useContext:wn,useEffect:Im,useImperativeHandle:tS,useInsertionEffect:W0,useLayoutEffect:J0,useMemo:rS,useReducer:km,useRef:Y0,useState:function(){return km(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return Et===null?Dm(c,r,o):sS(c,Et.memoizedState,r,o)},useTransition:function(){var r=km(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:M0,useId:cS,useHostTransitionStatus:Lm,useFormState:Z0,useActionState:Z0,useOptimistic:function(r,o){var c=en();return Et!==null?U0(c,Et,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:jm,useCacheRefresh:lS};pS.useEffectEvent=Q0;function Bm(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:y({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Fm={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=xo(c);u.tag=2,o!=null&&(u.callback=o),o=So(r,u,c),o!==null&&(Vn(o,r,c),Cl(o,r,c))}};function mS(r,o,c,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!vl(c,u)||!vl(m,v):!0}function gS(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&&Fm.enqueueReplaceState(o,o.state,null)}function Li(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=y({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function yS(r){xf(r)}function vS(r){console.error(r)}function bS(r){xf(r)}function Hf(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function xS(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 Hm(r,o,c){return c=xo(c),c.tag=3,c.payload={element:null},c.callback=function(){Hf(r,o)},c}function SS(r){return r=xo(r),r.tag=3,r}function _S(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){xS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){xS(o,c,u),typeof m!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function kO(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,m,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?td():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===Af?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),pg(r,u,m)),!1;case 22:return c.flags|=65536,u===Af?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)),pg(r,u,m)),!1}throw Error(s(435,c.tag))}return pg(r,u,m),td(),!1}if(rt)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==cm&&(r=Error(s(422),{cause:u}),Sl(Nr(r,c)))):(u!==cm&&(o=Error(s(423),{cause:u}),Sl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=Hm(r.stateNode,u,m),bm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),$l===null?$l=[v]:$l.push(v),Gt!==4&&(Gt=2),o===null)return!0;u=Nr(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=Hm(c.stateNode,u,r),bm(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=SS(m),_S(m,r,c,u),bm(c,m),!1}c=c.return}while(c!==null);return!1}var qm=Error(s(461)),sn=!1;function En(r,o,c,u){o.child=r===null?C0(o,null,c,u):Di(o,r.child,c,u)}function wS(r,o,c,u,m){c=c.render;var v=o.ref;if("ref"in u){var E={};for(var O in u)O!=="ref"&&(E[O]=u[O])}else E=u;return Oi(o),u=Tm(r,o,c,E,v,m),O=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&O&&im(o),o.flags|=1,En(r,o,u,m),o.child)}function ES(r,o,c,u,m){if(r===null){var v=c.type;return typeof v=="function"&&!rm(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,TS(r,o,v,u,m)):(r=Ef(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Wm(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:vl,c(E,u)&&r.ref===o.ref)return Ms(r,o,m)}return o.flags|=1,r=Rs(v,u),r.ref=o.ref,r.return=o,o.child=r}function TS(r,o,c,u,m){if(r!==null){var v=r.memoizedProps;if(vl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Wm(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Ms(r,o,m)}return Vm(r,o,c,u,m)}function CS(r,o,c,u){var m=u.children,v=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(v=v!==null?v.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&~v}else u=0,o.child=null;return RS(r,o,v,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nf(o,v!==null?v.cachePool:null),v!==null?j0(o,v):Sm(),A0(o);else return u=o.lanes=536870912,RS(r,o,v!==null?v.baseLanes|c:c,c,u)}else v!==null?(Nf(o,v.cachePool),j0(o,v),wo(),o.memoizedState=null):(r!==null&&Nf(o,null),Sm(),wo());return En(r,o,m,c),o.child}function Ml(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function RS(r,o,c,u,m){var v=mm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Nf(o,null),Sm(),A0(o),r!==null&&$a(r,o,u,!0),o.childLanes=m,null}function qf(r,o){return o=Kf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function NS(r,o,c){return Di(o,r.child,null,c),r=qf(o,o.pendingProps),r.flags|=2,ir(o),o.memoizedState=null,r}function OO(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=qf(o,u),o.lanes=536870912,Ml(null,r);if(wm(o),(r=Mt)?(r=$_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=f0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return o.lanes=536870912,null}return qf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(wm(o),m)if(o.flags&256)o.flags&=-257,o=NS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(sn||$a(r,o,c,!1),m=(c&r.childLanes)!==0,sn||m){if(u=Nt,u!==null&&(E=fo(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,Ni(r,E),Vn(u,r,E),qm;td(),o=NS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&p0(o,r),o=qf(o,u),o.flags|=4096;return o}return r=Rs(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function Vf(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 Vm(r,o,c,u,m){return Oi(o),c=Tm(r,o,c,u,void 0,m),u=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,m),o.child)}function jS(r,o,c,u,m,v){return Oi(o),o.updateQueue=null,c=O0(o,u,c,m),k0(r),u=Cm(),r!==null&&!sn?(Rm(r,o,v),Ms(r,o,v)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,v),o.child)}function AS(r,o,c,u,m){if(Oi(o),o.stateNode===null){var v=Da,E=c.contextType;typeof E=="object"&&E!==null&&(v=wn(E)),v=new c(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Fm,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},ym(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Bm(o,c,E,u),v.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&Fm.enqueueReplaceState(v,v.state,null),Nl(o,u,v,m),Rl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var O=o.memoizedProps,$=Li(c,O);v.props=$;var te=v.context,ce=c.contextType;E=Da,typeof ce=="object"&&ce!==null&&(E=wn(ce));var fe=c.getDerivedStateFromProps;ce=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(O||te!==E)&&gS(o,v,u,E),bo=!1;var re=o.memoizedState;v.state=re,Nl(o,u,v,m),Rl(),te=o.memoizedState,O||re!==te||bo?(typeof fe=="function"&&(Bm(o,c,fe,u),te=o.memoizedState),($=bo||mS(o,c,$,u,re,te,E))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=te),v.props=u,v.state=te,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,vm(r,o),E=o.memoizedProps,ce=Li(c,E),v.props=ce,fe=o.pendingProps,re=v.context,te=c.contextType,$=Da,typeof te=="object"&&te!==null&&($=wn(te)),O=c.getDerivedStateFromProps,(te=typeof O=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==fe||re!==$)&&gS(o,v,u,$),bo=!1,re=o.memoizedState,v.state=re,Nl(o,u,v,m),Rl();var ie=o.memoizedState;E!==fe||re!==ie||bo||r!==null&&r.dependencies!==null&&Cf(r.dependencies)?(typeof O=="function"&&(Bm(o,c,O,u),ie=o.memoizedState),(ce=bo||mS(o,c,ce,u,re,ie,$)||r!==null&&r.dependencies!==null&&Cf(r.dependencies))?(te||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ie,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ie,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,Vf(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=Di(o,r.child,null,m),o.child=Di(o,null,c,m)):En(r,o,c,m),o.memoizedState=v.state,r=o.child):r=Ms(r,o,m),r}function kS(r,o,c,u){return Ai(),o.flags|=256,En(r,o,c,u),o.child}var Km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gm(r){return{baseLanes:r,cachePool:x0()}}function Zm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=cr),r}function OS(r,o,c){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Jt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?_o(o):wo(),(r=Mt)?(r=$_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=f0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return Ag(r)?o.lanes=32:o.lanes=536870912,null}var O=u.children;return u=u.fallback,m?(wo(),m=o.mode,O=Kf({mode:"hidden",children:O},m),u=ji(u,m,c,null),O.return=o,u.return=o,O.sibling=u,o.child=O,u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(null,u)):(_o(o),Ym(o,O))}var $=r.memoizedState;if($!==null&&(O=$.dehydrated,O!==null)){if(v)o.flags&256?(_o(o),o.flags&=-257,o=Xm(r,o,c)):o.memoizedState!==null?(wo(),o.child=r.child,o.flags|=128,o=null):(wo(),O=u.fallback,m=o.mode,u=Kf({mode:"visible",children:u.children},m),O=ji(O,m,c,null),O.flags|=2,u.return=o,O.return=o,u.sibling=O,o.child=u,Di(o,r.child,null,c),u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,o=Ml(null,u));else if(_o(o),Ag(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,Sl({value:u,source:null,stack:null}),o=Xm(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=fo(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,Ni(r,u),Vn(E,r,u),qm;jg(O)||td(),o=Xm(r,o,c)}else jg(O)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(O.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&p0(o,r),o=Ym(o,u.children),o.flags|=4096);return o}return m?(wo(),O=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Rs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?O=Rs(te,O):(O=ji(O,m,c,null),O.flags|=2),O.return=o,u.return=o,u.sibling=O,o.child=u,Ml(null,u),u=o.child,O=r.child.memoizedState,O===null?O=Gm(c):(m=O.cachePool,m!==null?($=nn._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=x0(),O={baseLanes:O.baseLanes|c,cachePool:m}),u.memoizedState=O,u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(r.child,u)):(_o(o),c=r.child,r=c.sibling,c=Rs(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 Ym(r,o){return o=Kf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Kf(r,o){return r=sr(22,r,null,o),r.lanes=0,r}function Xm(r,o,c){return Di(o,r.child,null,c),r=Ym(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function MS(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),fm(r.return,o,c)}function Qm(r,o,c,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=v)}function IS(r,o,c){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Jt.current,O=(E&2)!==0;if(O?(E=E&1|2,o.flags|=128):E&=1,W(Jt,E),En(r,o,u,c),u=rt?xl:0,!O&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&MS(r,c,o);else if(r.tag===19)MS(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&&If(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),Qm(o,!1,m,c,v,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&&If(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Qm(o,!0,c,null,v,u);break;case"together":Qm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Ms(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Co|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(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=Rs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Rs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Wm(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Cf(r)))}function MO(r,o,c){switch(o.tag){case 3:xe(o,o.stateNode.containerInfo),vo(o,nn,r.memoizedState.cache),Ai();break;case 27:case 5:Me(o);break;case 4:xe(o,o.stateNode.containerInfo);break;case 10:vo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,wm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(_o(o),o.flags|=128,null):(c&o.child.childLanes)!==0?OS(r,o,c):(_o(o),r=Ms(r,o,c),r!==null?r.sibling:null);_o(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||($a(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return IS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Jt,Jt.current),u)break;return null;case 22:return o.lanes=0,CS(r,o,c,o.pendingProps);case 24:vo(o,nn,r.memoizedState.cache)}return Ms(r,o,c)}function PS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Wm(r,c)&&(o.flags&128)===0)return sn=!1,MO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&h0(o,xl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Ii(o.elementType),o.type=r,typeof r=="function")rm(r)?(u=Li(r,u),o.tag=1,o=AS(null,o,r,u,c)):(o.tag=0,o=Vm(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=wS(null,o,r,u,c);break e}else if(m===j){o.tag=14,o=ES(null,o,r,u,c);break e}}throw o=Y(r)||r,Error(s(306,o,""))}}return o;case 0:return Vm(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=Li(u,o.pendingProps),AS(r,o,u,m,c);case 3:e:{if(xe(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,vm(r,o),Nl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,vo(o,nn,u),u!==v.cache&&dm(o,[nn],c,!0),Rl(),u=E.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=kS(r,o,u,c);break e}else if(u!==m){m=Nr(Error(s(424)),o),Sl(m),o=kS(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,Mt=Mr(r.firstChild),_n=o,rt=!0,go=null,kr=!0,c=C0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ai(),u===m){o=Ms(r,o,c);break e}En(r,o,u,c)}o=o.child}return o;case 26:return Vf(r,o),r===null?(c=K_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=cd(se.current).createElement(c),u[Sn]=o,u[Un]=r,Tn(u,c,r),bn(u),o.stateNode=u):o.memoizedState=K_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Me(o),r===null&&rt&&(u=o.stateNode=H_(o.type,o.pendingProps,se.current),_n=o,kr=!0,m=Mt,ko(o.type)?(kg=m,Mt=Mr(u.firstChild)):Mt=m),En(r,o,o.pendingProps.children,c),Vf(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=Mt)&&(u=lM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||yo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,Cg(m,v)?u=null:E!==null&&Cg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=Tm(r,o,EO,null,null,c),Zl._currentValue=m),Vf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=uM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||yo(o)),null;case 13:return OS(r,o,c);case 4:return xe(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=Di(o,null,u,c):En(r,o,u,c),o.child;case 11:return wS(r,o,o.type,o.pendingProps,c);case 7:return En(r,o,o.pendingProps,c),o.child;case 8:return En(r,o,o.pendingProps.children,c),o.child;case 12:return En(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,vo(o,o.type,u.value),En(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Oi(o),m=wn(m),u=u(m),o.flags|=1,En(r,o,u,c),o.child;case 14:return ES(r,o,o.type,o.pendingProps,c);case 15:return TS(r,o,o.type,o.pendingProps,c);case 19:return IS(r,o,c);case 31:return OO(r,o,c);case 22:return CS(r,o,c,o.pendingProps);case 24:return Oi(o),u=wn(nn),r===null?(m=mm(),m===null&&(m=Nt,v=hm(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},ym(o),vo(o,nn,m)):((r.lanes&c)!==0&&(vm(r,o),Nl(o,null,null,c),Rl()),m=r.memoizedState,v=o.memoizedState,m.parent!==u?(m={parent:u,cache:u},o.memoizedState=m,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=m),vo(o,nn,u)):(u=v.cache,vo(o,nn,u),u!==m.cache&&dm(o,[nn],c,!0))),En(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Is(r){r.flags|=4}function Jm(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(c_())r.flags|=8192;else throw Pi=Af,gm}else r.flags&=-16777217}function DS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Q_(o))if(c_())r.flags|=8192;else throw Pi=Af,gm}function Gf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?_i():536870912,r.lanes|=o,Wa|=o)}function Il(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 It(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 IO(r,o,c){var u=o.pendingProps;switch(am(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),As(nn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Is(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,lm())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Is(o),v!==null?(It(o),DS(o,v)):(It(o),Jm(o,m,null,u,c))):v?v!==r.memoizedState?(Is(o),It(o),DS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Is(o),It(o),Jm(o,m,r,u,c)),null;case 27:if(_e(o),c=se.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=X.current,Ua(o)?m0(o):(r=H_(m,u,c),o.stateNode=r,Is(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=X.current,Ua(o))m0(o);else{var E=cd(se.current);switch(v){case 1:v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":v=E.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?E.createElement(m,{is:u.is}):E.createElement(m)}}v[Sn]=o,v[Un]=u;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)v.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=v;e:switch(Tn(v,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&&Is(o)}}return It(o),Jm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=se.current,Ua(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=_n,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[Sn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||O_(r.nodeValue,c)),r||yo(o,!0)}else r=cd(r).createTextNode(u),r[Sn]=o,o.stateNode=r}return It(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Ua(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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else c=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(ir(o),o):(ir(o),null);if((o.flags&128)!==0)throw Error(s(558))}return It(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Ua(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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(ir(o),o):(ir(o),null)}return ir(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),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),Gf(o,o.updateQueue),It(o),null);case 4:return he(),r===null&&Sg(o.stateNode.containerInfo),It(o),null;case 10:return As(o.type),It(o),null;case 19:if(H(Jt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Il(u,!1);else{if(Gt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=If(r),v!==null){for(o.flags|=128,Il(u,!1),r=v.updateQueue,o.updateQueue=r,Gf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)u0(c,r),c=c.sibling;return W(Jt,Jt.current&1|2),rt&&Ns(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Wf&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304)}else{if(!m)if(r=If(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Gf(o,r),Il(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*Be()-u.renderingStartTime>Wf&&c!==536870912&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Be(),r.sibling=null,c=Jt.current,W(Jt,m?c&1|2:c&1),rt&&Ns(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),_m(),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&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Gf(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&&H(Mi),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),As(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function PO(r,o){switch(am(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return As(nn),he(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(ir(o),o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(ir(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return H(Jt),null;case 4:return he(),null;case 10:return As(o.type),null;case 22:case 23:return ir(o),_m(),r!==null&&H(Mi),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return As(nn),null;case 25:return null;default:return null}}function zS(r,o){switch(am(o),o.tag){case 3:As(nn),he();break;case 26:case 27:case 5:_e(o);break;case 4:he();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:As(o.type);break;case 22:case 23:ir(o),_m(),r!==null&&H(Mi);break;case 24:As(nn)}}function Pl(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 v=c.create,E=c.inst;u=v(),E.destroy=u}c=c.next}while(c!==m)}}catch(O){_t(o,o.return,O)}}function Eo(r,o,c){try{var u=o.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;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,te=O;try{te()}catch(ce){_t(m,$,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(o,o.return,ce)}}function LS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{N0(o,c)}catch(u){_t(r,r.return,u)}}}function US(r,o,c){c.props=Li(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){_t(r,o,u)}}function Dl(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){_t(r,o,m)}}function ds(r,o){var c=r.ref,u=r.refCleanup;if(c!==null)if(typeof u=="function")try{u()}catch(m){_t(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){_t(r,o,m)}else c.current=null}function $S(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){_t(r,r.return,m)}}function eg(r,o,c){try{var u=r.stateNode;rM(u,r.type,c,o),u[Un]=o}catch(m){_t(r,r.return,m)}}function BS(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ko(r.type)||r.tag===4}function tg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||BS(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&&ko(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 ng(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=Ts));else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(ng(r,o,c),r=r.sibling;r!==null;)ng(r,o,c),r=r.sibling}function Zf(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&&ko(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Zf(r,o,c),r=r.sibling;r!==null;)Zf(r,o,c),r=r.sibling}function FS(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Tn(o,u,c),o[Sn]=r,o[Un]=c}catch(v){_t(r,r.return,v)}}var Ps=!1,on=!1,rg=!1,HS=typeof WeakSet=="function"?WeakSet:Set,xn=null;function DO(r,o){if(r=r.containerInfo,Eg=md,r=t0(r),Xp(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,v=u.focusNode;u=u.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,O=-1,$=-1,te=0,ce=0,fe=r,re=null;t:for(;;){for(var ie;fe!==c||m!==0&&fe.nodeType!==3||(O=E+m),fe!==v||u!==0&&fe.nodeType!==3||($=E+u),fe.nodeType===3&&(E+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)re=fe,fe=ie;for(;;){if(fe===r)break t;if(re===c&&++te===m&&(O=E),re===v&&++ce===u&&($=E),(ie=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ie}c=O===-1||$===-1?null:{start:O,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(Tg={focusedElem:r,selectionRange:c},md=!1,xn=o;xn!==null;)if(o=xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,xn=r;else for(;xn!==null;){switch(o=xn,v=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&&v!==null){r=void 0,c=o,m=v.memoizedProps,v=v.memoizedState,u=c.stateNode;try{var Re=Li(c.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch($e){_t(c,c.return,$e)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)Ng(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ng(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,xn=r;break}xn=o.return}}function qS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:zs(r,c),u&4&&Pl(5,c);break;case 1:if(zs(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(c,c.return,E)}else{var m=Li(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(c,c.return,E)}}u&64&&LS(c),u&512&&Dl(c,c.return);break;case 3:if(zs(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{N0(r,o)}catch(E){_t(c,c.return,E)}}break;case 27:o===null&&u&4&&FS(c);case 26:case 5:zs(r,c),o===null&&u&4&&$S(c),u&512&&Dl(c,c.return);break;case 12:zs(r,c);break;case 31:zs(r,c),u&4&&GS(r,c);break;case 13:zs(r,c),u&4&&ZS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=VO.bind(null,c),fM(r,c))));break;case 22:if(u=c.memoizedState!==null||Ps,!u){o=o!==null&&o.memoizedState!==null||on,m=Ps;var v=on;Ps=u,(on=o)&&!v?Ls(r,c,(c.subtreeFlags&8772)!==0):zs(r,c),Ps=m,on=v}break;case 30:break;default:zs(r,c)}}function VS(r){var o=r.alternate;o!==null&&(r.alternate=null,VS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Mp(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 Ut=null,Bn=!1;function Ds(r,o,c){for(c=c.child;c!==null;)KS(r,o,c),c=c.sibling}function KS(r,o,c){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Er,c)}catch{}switch(c.tag){case 26:on||ds(c,o),Ds(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||ds(c,o);var u=Ut,m=Bn;ko(c.type)&&(Ut=c.stateNode,Bn=!1),Ds(r,o,c),Vl(c.stateNode),Ut=u,Bn=m;break;case 5:on||ds(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ds(r,o,c),Ut=u,Bn=m,Ut!==null)if(Bn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(c.stateNode)}catch(v){_t(c,o,v)}else try{Ut.removeChild(c.stateNode)}catch(v){_t(c,o,v)}break;case 18:Ut!==null&&(Bn?(r=Ut,L_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),ic(r)):L_(Ut,c.stateNode));break;case 4:u=Ut,m=Bn,Ut=c.stateNode.containerInfo,Bn=!0,Ds(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:Eo(2,c,o),on||Eo(4,c,o),Ds(r,o,c);break;case 1:on||(ds(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&US(c,o,u)),Ds(r,o,c);break;case 21:Ds(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ds(r,o,c),on=u;break;default:Ds(r,o,c)}}function GS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ic(r)}catch(c){_t(o,o.return,c)}}}function ZS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ic(r)}catch(c){_t(o,o.return,c)}}function zO(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new HS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new HS),o;default:throw Error(s(435,r.tag))}}function Yf(r,o){var c=zO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=KO.bind(null,r,u);u.then(m,m)}})}function Fn(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],v=r,E=o,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(ko(O.type)){Ut=O.stateNode,Bn=!1;break e}break;case 5:Ut=O.stateNode,Bn=!1;break e;case 3:case 4:Ut=O.stateNode.containerInfo,Bn=!0;break e}O=O.return}if(Ut===null)throw Error(s(160));KS(v,E,m),Ut=null,Bn=!1,v=m.alternate,v!==null&&(v.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)YS(o,r),o=o.sibling}var Wr=null;function YS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Fn(o,r),Hn(r),u&4&&(Eo(3,r,r.return),Pl(3,r),Eo(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&64&&Ps&&(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=Wr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&4){var v=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":v=m.getElementsByTagName("title")[0],(!v||v[ll]||v[Sn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),Tn(v,u,c),v[Sn]=r,bn(v),u=v;break e;case"link":var E=Y_("link","href",m).get(u+(c.href||""));if(E){for(var O=0;O<E.length;O++)if(v=E[O],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;case"meta":if(E=Y_("meta","content",m).get(u+(c.content||""))){for(O=0;O<E.length;O++)if(v=E[O],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[Sn]=r,bn(v),u=v}r.stateNode=u}else X_(m,r.type,r.stateNode);else r.stateNode=Z_(m,u,r.memoizedProps);else v!==u?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,u===null?X_(m,r.type,r.stateNode):Z_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&eg(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),c!==null&&u&4&&eg(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,eg(r,m,c!==null?c.memoizedProps:m)),u&1024&&(rg=!0);break;case 6:if(Fn(o,r),Hn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(fd=null,m=Wr,Wr=ld(o.containerInfo),Fn(o,r),Wr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Re){_t(r,r.return,Re)}rg&&(rg=!1,XS(r));break;case 4:u=Wr,Wr=ld(r.stateNode.containerInfo),Fn(o,r),Hn(r),Wr=u;break;case 12:Fn(o,r),Hn(r);break;case 31:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 13:Fn(o,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Qf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,te=Ps,ce=on;if(Ps=te||m,on=ce||$,Fn(o,r),on=ce,Ps=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Ps||on||Ui(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=$.stateNode;var fe=$.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;O.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(c===null){$=o;try{var ie=$.stateNode;m?U_(ie,!0):U_($.stateNode,!1)}catch(Re){_t($,$.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,Yf(r,c))));break;case 19:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 30:break;case 21:break;default:Fn(o,r),Hn(r)}}function Hn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if(BS(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,v=tg(r);Zf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var O=tg(r);Zf(r,O,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=tg(r);ng(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function XS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;XS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function zs(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)qS(r,o.alternate,o),o=o.sibling}function Ui(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Eo(4,o,o.return),Ui(o);break;case 1:ds(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&US(o,o.return,c),Ui(o);break;case 27:Vl(o.stateNode);case 26:case 5:ds(o,o.return),Ui(o);break;case 22:o.memoizedState===null&&Ui(o);break;case 30:Ui(o);break;default:Ui(o)}r=r.sibling}}function Ls(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,m=r,v=o,E=v.flags;switch(v.tag){case 0:case 11:case 15:Ls(m,v,c),Pl(4,v);break;case 1:if(Ls(m,v,c),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){_t(u,u.return,te)}if(u=v,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++)R0($[m],O)}catch(te){_t(u,u.return,te)}}c&&E&64&&LS(v),Dl(v,v.return);break;case 27:FS(v);case 26:case 5:Ls(m,v,c),c&&u===null&&E&4&&$S(v),Dl(v,v.return);break;case 12:Ls(m,v,c);break;case 31:Ls(m,v,c),c&&E&4&&GS(m,v);break;case 13:Ls(m,v,c),c&&E&4&&ZS(m,v);break;case 22:v.memoizedState===null&&Ls(m,v,c),Dl(v,v.return);break;case 30:break;default:Ls(m,v,c)}o=o.sibling}}function sg(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&&_l(c))}function og(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r))}function Jr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)QS(r,o,c,u),o=o.sibling}function QS(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o,c,u),m&2048&&Pl(9,o);break;case 1:Jr(r,o,c,u);break;case 3:Jr(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&&_l(r)));break;case 12:if(m&2048){Jr(r,o,c,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,O=v.onPostCommit;typeof O=="function"&&O(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Jr(r,o,c,u);break;case 31:Jr(r,o,c,u);break;case 13:Jr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Jr(r,o,c,u):zl(r,o):v._visibility&2?Jr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&sg(E,o);break;case 24:Jr(r,o,c,u),m&2048&&og(o.alternate,o);break;default:Jr(r,o,c,u)}}function Ya(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,O=c,$=u,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ya(v,E,O,$,m),Pl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,O,$,m):zl(v,E):(ce._visibility|=2,Ya(v,E,O,$,m)),m&&te&2048&&sg(E.alternate,E);break;case 24:Ya(v,E,O,$,m),m&&te&2048&&og(E.alternate,E);break;default:Ya(v,E,O,$,m)}o=o.sibling}}function zl(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:zl(c,u),m&2048&&sg(u.alternate,u);break;case 24:zl(c,u),m&2048&&og(u.alternate,u);break;default:zl(c,u)}o=o.sibling}}var Ll=8192;function Xa(r,o,c){if(r.subtreeFlags&Ll)for(r=r.child;r!==null;)WS(r,o,c),r=r.sibling}function WS(r,o,c){switch(r.tag){case 26:Xa(r,o,c),r.flags&Ll&&r.memoizedState!==null&&wM(c,Wr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Wr;Wr=ld(r.stateNode.containerInfo),Xa(r,o,c),Wr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Ll,Ll=16777216,Xa(r,o,c),Ll=u):Xa(r,o,c));break;default:Xa(r,o,c)}}function JS(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 Ul(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];xn=u,t_(u,r)}JS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)e_(r),r=r.sibling}function e_(r){switch(r.tag){case 0:case 11:case 15:Ul(r),r.flags&2048&&Eo(9,r,r.return);break;case 3:Ul(r);break;case 12:Ul(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Xf(r)):Ul(r);break;default:Ul(r)}}function Xf(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];xn=u,t_(u,r)}JS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Eo(8,o,o.return),Xf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Xf(o));break;default:Xf(o)}r=r.sibling}}function t_(r,o){for(;xn!==null;){var c=xn;switch(c.tag){case 0:case 11:case 15:Eo(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:_l(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,xn=u;else e:for(c=r;xn!==null;){u=xn;var m=u.sibling,v=u.return;if(VS(u),u===c){xn=null;break e}if(m!==null){m.return=v,xn=m;break e}xn=v}}}var LO={getCacheForType:function(r){var o=wn(nn),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return wn(nn).controller.signal}},UO=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,ar=null,To=!1,Qa=!1,ig=!1,Us=0,Gt=0,Co=0,$i=0,ag=0,cr=0,Wa=0,$l=null,qn=null,cg=!1,Qf=0,n_=0,Wf=1/0,Jf=null,Ro=null,fn=0,No=null,Ja=null,$s=0,lg=0,ug=null,r_=null,Bl=0,fg=null;function lr(){return(gt&2)!==0&&tt!==0?tt&-tt:D.T!==null?yg():cf()}function s_(){if(cr===0)if((tt&536870912)===0||rt){var r=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),cr=r}else cr=536870912;return r=or.current,r!==null&&(r.flags|=32),cr}function Vn(r,o,c){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(ec(r,0),jo(r,tt,cr,!1)),ws(r,c),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&($i|=c),Gt===4&&jo(r,tt,cr,!1)),hs(r))}function o_(r,o,c){if((gt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||cs(r,o),m=u?FO(r,o):hg(r,o,!0),v=u;do{if(m===0){Qa&&!u&&jo(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!$O(c)){m=hg(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)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=$l;var $=O.current.memoizedState.isDehydrated;if($&&(ec(O,E).flags|=256),E=hg(O,E,!1),E!==2){if(ig&&!$){O.errorRecoveryDisabledLanes|=v,$i|=v,m=4;break e}v=qn,qn=m,v!==null&&(qn===null?qn=v:qn.push.apply(qn,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){ec(r,0),jo(r,o,0,!0);break}e:{switch(u=r,v=m,v){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:jo(u,o,cr,!To);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Qf+300-Be(),10<m)){if(jo(u,o,cr,!To),as(u,0,!0)!==0)break e;$s=o,u.timeoutHandle=D_(i_.bind(null,u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,"Throttled",-0,0),m);break e}i_(u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,null,-0,0)}}break}while(!0);hs(r)}function i_(r,o,c,u,m,v,E,O,$,te,ce,fe,re,ie){if(r.timeoutHandle=-1,fe=o.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},WS(o,v,fe);var Re=(v&62914560)===v?Qf-Be():(v&4194048)===v?n_-Be():0;if(Re=EM(fe,Re),Re!==null){$s=v,r.cancelPendingCommit=Re(p_.bind(null,r,o,v,c,u,m,E,O,$,ce,fe,null,re,ie)),jo(r,v,E,!te);return}}p_(r,o,v,c,u,m,E,O,$)}function $O(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],v=m.getSnapshot;m=m.value;try{if(!rr(v(),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 jo(r,o,c,u){o&=~ag,o&=~$i,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var m=o;0<m;){var v=31-xt(m),E=1<<v;u[v]=-1,m&=~E}c!==0&&ls(r,c,o)}function ed(){return(gt&6)===0?(Fl(0),!1):!0}function dg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,js=ki=null,Nm(r),qa=null,El=0,r=Je;for(;r!==null;)zS(r.alternate,r),r=r.return;Je=null}}function ec(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,iM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),$s=0,dg(),Nt=r,Je=c=Rs(r.current,null),tt=o,St=0,ar=null,To=!1,Qa=cs(r,o),ig=!1,Wa=cr=ag=$i=Co=Gt=0,qn=$l=null,cg=!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-xt(u),v=1<<m;o|=r[m],u&=~v}return Us=o,Sf(),c}function a_(r,o){Ze=null,D.H=Ol,o===Ha||o===jf?(o=w0(),St=3):o===gm?(o=w0(),St=4):St=o===qm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Gt=1,Hf(r,Nr(o,r.current)))}function c_(){var r=or.current;return r===null?!0:(tt&4194048)===tt?Or===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Or:!1}function l_(){var r=D.H;return D.H=Ol,r===null?Ol:r}function u_(){var r=D.A;return D.A=LO,r}function td(){Gt=4,To||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Co&134217727)===0&&($i&134217727)===0||Nt===null||jo(Nt,tt,cr,!1)}function hg(r,o,c){var u=gt;gt|=2;var m=l_(),v=u_();(Nt!==r||tt!==o)&&(Jf=null,ec(r,o)),o=!1;var E=Gt;e:do try{if(St!==0&&Je!==null){var O=Je,$=ar;switch(St){case 8:dg(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=St;if(St=0,ar=null,tc(r,O,$,te),c&&Qa){E=0;break e}break;default:te=St,St=0,ar=null,tc(r,O,$,te)}}BO(),E=Gt;break}catch(ce){a_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,js=ki=null,gt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,Sf()),E}function BO(){for(;Je!==null;)f_(Je)}function FO(r,o){var c=gt;gt|=2;var u=l_(),m=u_();Nt!==r||tt!==o?(Jf=null,Wf=Be()+500,ec(r,o)):Qa=cs(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=ar;t:switch(St){case 1:St=0,ar=null,tc(r,o,v,1);break;case 2:case 9:if(S0(v)){St=0,ar=null,d_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),hs(r)},v.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:S0(v)?(St=0,ar=null,d_(o)):(St=0,ar=null,tc(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var O=Je;if(E?Q_(E):O.stateNode.complete){St=0,ar=null;var $=O.sibling;if($!==null)Je=$;else{var te=O.return;te!==null?(Je=te,nd(te)):Je=null}break t}}St=0,ar=null,tc(r,o,v,5);break;case 6:St=0,ar=null,tc(r,o,v,6);break;case 8:dg(),Gt=6;break e;default:throw Error(s(462))}}HO();break}catch(ce){a_(r,ce)}while(!0);return js=ki=null,D.H=u,D.A=m,gt=c,Je!==null?0:(Nt=null,tt=0,Sf(),Gt)}function HO(){for(;Je!==null&&!Ve();)f_(Je)}function f_(r){var o=PS(r.alternate,r,Us);r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function d_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=jS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=jS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Nm(o);default:zS(c,o),o=Je=u0(o,Us),o=PS(c,o,Us)}r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function tc(r,o,c,u){js=ki=null,Nm(o),qa=null,El=0;var m=o.return;try{if(kO(r,m,o,c,tt)){Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(To=r=!0,(u===2||u===9||u===3||u===6)&&(u=or.current,u!==null&&u.tag===13&&(u.flags|=16384))),h_(o,r)):nd(o)}function nd(r){var o=r;do{if((o.flags&32768)!==0){h_(o,To);return}r=o.return;var c=IO(o.alternate,o,Us);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Gt===0&&(Gt=5)}function h_(r,o){do{var c=PO(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);Gt=6,Je=null}function p_(r,o,c,u,m,v,E,O,$){r.cancelPendingCommit=null;do rd();while(fn!==0);if((gt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=tm,tr(r,c,v,E,O,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,No=r,$s=c,lg=v,ug=m,r_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,GO(Te,function(){return b_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=K.p,K.p=2,E=gt,gt|=4;try{DO(r,o,c)}finally{gt=E,K.p=m,D.T=u}}fn=1,m_(),g_(),y_()}}function m_(){if(fn===1){fn=0;var r=No,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{YS(o,r);var v=Tg,E=t0(r.containerInfo),O=v.focusedElem,$=v.selectionRange;if(E!==O&&O&&O.ownerDocument&&e0(O.ownerDocument.documentElement,O)){if($!==null&&Xp(O)){var te=$.start,ce=$.end;if(ce===void 0&&(ce=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(ce,O.value.length);else{var fe=O.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Re=O.textContent.length,$e=Math.min($.start,Re),Ct=$.end===void 0?$e:Math.min($.end,Re);!ie.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var Z=Jx(O,$e),F=Jx(O,Ct);if(Z&&F&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==F.node||ie.focusOffset!==F.offset)){var J=fe.createRange();J.setStart(Z.node,Z.offset),ie.removeAllRanges(),$e>Ct?(ie.addRange(J),ie.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),ie.addRange(J))}}}}for(fe=[],ie=O;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<fe.length;O++){var le=fe[O];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}md=!!Eg,Tg=Eg=null}finally{gt=m,K.p=u,D.T=c}}r.current=o,fn=2}}function g_(){if(fn===2){fn=0;var r=No,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{qS(r,o.alternate,o)}finally{gt=m,K.p=u,D.T=c}}fn=3}}function y_(){if(fn===4||fn===3){fn=0,Xe();var r=No,o=Ja,c=$s,u=r_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=No=null,v_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(Ro=null),cl(c),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Er,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=D.T,m=K.p,K.p=2,D.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var O=u[E];v(O.value,{componentStack:O.stack})}}finally{D.T=o,K.p=m}}($s&3)!==0&&rd(),hs(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===fg?Bl++:(Bl=0,fg=r):Bl=0,Fl(0)}}function v_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,_l(o)))}function rd(){return m_(),g_(),y_(),b_()}function b_(){if(fn!==5)return!1;var r=No,o=lg;lg=0;var c=cl($s),u=D.T,m=K.p;try{K.p=32>c?32:c,D.T=null,c=ug,ug=null;var v=No,E=$s;if(fn=0,Ja=No=null,$s=0,(gt&6)!==0)throw Error(s(331));var O=gt;if(gt|=4,e_(v.current),QS(v,v.current,E,c),gt=O,Fl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{K.p=m,D.T=u,v_(r,o)}}function x_(r,o,c){o=Nr(c,o),o=Hm(r.stateNode,o,2),r=So(r,o,2),r!==null&&(ws(r,2),hs(r))}function _t(r,o,c){if(r.tag===3)x_(r,r,c);else for(;o!==null;){if(o.tag===3){x_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ro===null||!Ro.has(u))){r=Nr(c,r),c=SS(2),u=So(o,c,2),u!==null&&(_S(c,u,o,r),ws(u,2),hs(u));break}}o=o.return}}function pg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new UO;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)||(ig=!0,m.add(c),r=qO.bind(null,r,o,c),o.then(r,r))}function qO(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Nt===r&&(tt&c)===c&&(Gt===4||Gt===3&&(tt&62914560)===tt&&300>Be()-Qf?(gt&2)===0&&ec(r,0):ag|=c,Wa===tt&&(Wa=0)),hs(r)}function S_(r,o){o===0&&(o=_i()),r=Ni(r,o),r!==null&&(ws(r,o),hs(r))}function VO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),S_(r,c)}function KO(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),S_(r,c)}function GO(r,o){return Ie(r,o)}var sd=null,nc=null,mg=!1,od=!1,gg=!1,Ao=0;function hs(r){r!==nc&&r.next===null&&(nc===null?sd=nc=r:nc=nc.next=r),od=!0,mg||(mg=!0,YO())}function Fl(r,o){if(!gg&&od){gg=!0;do for(var c=!1,u=sd;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,O=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~O),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,T_(u,v))}else v=tt,v=as(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||cs(u,v)||(c=!0,T_(u,v));u=u.next}while(c);gg=!1}}function ZO(){__()}function __(){od=mg=!1;var r=0;Ao!==0&&oM()&&(r=Ao);for(var o=Be(),c=null,u=sd;u!==null;){var m=u.next,v=w_(u,o);v===0?(u.next=null,c===null?sd=m:c.next=m,m===null&&(nc=c)):(c=u,(r!==0||(v&3)!==0)&&(od=!0)),u=m}fn!==0&&fn!==5||Fl(r),Ao!==0&&(Ao=0)}function w_(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),O=1<<E,$=m[E];$===-1?((O&c)===0||(O&u)!==0)&&(m[E]=_a(O,o)):$<=o&&(r.expiredLanes|=O),v&=~O}if(o=Nt,c=tt,c=as(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||cs(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),cl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=mt;break;default:c=Te}return u=E_.bind(null,r),c=Ie(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&Ee(u),r.callbackPriority=2,r.callbackNode=null,2}function E_(r,o){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(rd()&&r.callbackNode!==c)return null;var u=tt;return u=as(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(o_(r,u,o),w_(r,Be()),r.callbackNode!=null&&r.callbackNode===c?E_.bind(null,r):null)}function T_(r,o){if(rd())return null;o_(r,o,!0)}function YO(){aM(function(){(gt&6)!==0?Ie(He,ZO):__()})}function yg(){if(Ao===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),Ao=r}return Ao}function C_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:hf(""+r)}function R_(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 XO(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var v=C_((m[Un]||null).action),E=u.submitter;E&&(o=(o=E[Un]||null)?C_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var O=new yf("action","action",null,u,m);r.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ao!==0){var $=E?R_(m,E):new FormData(m);zm(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(O.preventDefault(),$=E?R_(m,E):new FormData(m),zm(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var vg=0;vg<em.length;vg++){var bg=em[vg],QO=bg.toLowerCase(),WO=bg[0].toUpperCase()+bg.slice(1);Qr(QO,"on"+WO)}Qr(s0,"onAnimationEnd"),Qr(o0,"onAnimationIteration"),Qr(i0,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(pO,"onTransitionRun"),Qr(mO,"onTransitionStart"),Qr(gO,"onTransitionCancel"),Qr(a0,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),JO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function N_(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 v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var O=u[E],$=O.instance,te=O.currentTarget;if(O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(O=u[E],$=O.instance,te=O.currentTarget,O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}}}}function et(r,o){var c=o[Op];c===void 0&&(c=o[Op]=new Set);var u=r+"__bubble";c.has(u)||(j_(o,r,2,!1),c.add(u))}function xg(r,o,c){var u=0;o&&(u|=4),j_(c,r,u,o)}var id="_reactListening"+Math.random().toString(36).slice(2);function Sg(r){if(!r[id]){r[id]=!0,_x.forEach(function(c){c!=="selectionchange"&&(JO.has(c)||xg(c,!1,r),xg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[id]||(o[id]=!0,xg("selectionchange",!1,o))}}function j_(r,o,c,u){switch(sw(o)){case 2:var m=RM;break;case 8:m=NM;break;default:m=Dg}c=m.bind(null,o,c,r),m=void 0,!Bp||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 _g(r,o,c,u,m){var v=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=Ea(O),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}O=O.parentNode}}u=u.return}Ix(function(){var te=v,ce=Up(c),fe=[];e:{var re=c0.get(r);if(re!==void 0){var ie=yf,Re=r;switch(r){case"keypress":if(mf(c)===0)break e;case"keydown":case"keyup":ie=Kk;break;case"focusin":Re="focus",ie=Vp;break;case"focusout":Re="blur",ie=Vp;break;case"beforeblur":case"afterblur":ie=Vp;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":ie=zx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Ik;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Yk;break;case s0:case o0:case i0:ie=zk;break;case a0:ie=Qk;break;case"scroll":case"scrollend":ie=Ok;break;case"wheel":ie=Jk;break;case"copy":case"cut":case"paste":ie=Uk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Ux;break;case"toggle":case"beforetoggle":ie=tO}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),Z=$e?re!==null?re+"Capture":null:re;$e=[];for(var F=te,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||Z===null||(le=fl(F,Z),le!=null&&$e.push(ql(F,le,J))),Ct)break;F=F.return}0<$e.length&&(re=new ie(re,Re,null,c,ce),fe.push({event:re,listeners:$e}))}}if((o&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",re&&c!==Lp&&(Re=c.relatedTarget||c.fromElement)&&(Ea(Re)||Re[wa]))break e;if((ie||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Re=c.relatedTarget||c.toElement,ie=te,Re=Re?Ea(Re):null,Re!==null&&(Ct=a(Re),$e=Re.tag,Re!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(ie=null,Re=te),ie!==Re)){if($e=zx,le="onMouseLeave",Z="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Ux,le="onPointerLeave",Z="onPointerEnter",F="pointer"),Ct=ie==null?re:ul(ie),J=Re==null?re:ul(Re),re=new $e(le,F+"leave",ie,c,ce),re.target=Ct,re.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(Z,F+"enter",Re,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,ie&&Re)t:{for($e=eM,Z=ie,F=Re,J=0,le=Z;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)Z=$e(Z),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(Z===F||F!==null&&Z===F.alternate){$e=Z;break t}Z=$e(Z),F=$e(F)}$e=null}else $e=null;ie!==null&&A_(fe,re,ie,$e,!1),Re!==null&&Ct!==null&&A_(fe,Ct,Re,$e,!0)}}e:{if(re=te?ul(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var ft=Gx;else if(Vx(re))if(Zx)ft=fO;else{ft=lO;var ke=cO}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&zp(te.elementType)&&(ft=Gx):ft=uO;if(ft&&(ft=ft(r,te))){Kx(fe,ft,c,ce);break e}ke&&ke(r,re,te),r==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Dp(re,"number",re.value)}switch(ke=te?ul(te):window,r){case"focusin":(Vx(ke)||ke.contentEditable==="true")&&(Ma=ke,Qp=te,bl=null);break;case"focusout":bl=Qp=Ma=null;break;case"mousedown":Wp=!0;break;case"contextmenu":case"mouseup":case"dragend":Wp=!1,n0(fe,c,ce);break;case"selectionchange":if(hO)break;case"keydown":case"keyup":n0(fe,c,ce)}var Ye;if(Gp)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 Oa?Hx(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&($x&&c.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ye=Px()):(po=ce,Fp="value"in po?po.value:po.textContent,Oa=!0)),ke=ad(te,nt),0<ke.length&&(nt=new Lx(nt,r,null,c,ce),fe.push({event:nt,listeners:ke}),Ye?nt.data=Ye:(Ye=qx(c),Ye!==null&&(nt.data=Ye)))),(Ye=rO?sO(r,c):oO(r,c))&&(nt=ad(te,"onBeforeInput"),0<nt.length&&(ke=new Lx("onBeforeInput","beforeinput",null,c,ce),fe.push({event:ke,listeners:nt}),ke.data=Ye)),XO(fe,r,te,c,ce)}N_(fe,o)})}function ql(r,o,c){return{instance:r,listener:o,currentTarget:c}}function ad(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=fl(r,c),m!=null&&u.unshift(ql(r,m,v)),m=fl(r,o),m!=null&&u.push(ql(r,m,v))),r.tag===3)return u;r=r.return}return[]}function eM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function A_(r,o,c,u,m){for(var v=o._reactName,E=[];c!==null&&c!==u;){var O=c,$=O.alternate,te=O.stateNode;if(O=O.tag,$!==null&&$===u)break;O!==5&&O!==26&&O!==27||te===null||($=te,m?(te=fl(c,v),te!=null&&E.unshift(ql(c,te,$))):m||(te=fl(c,v),te!=null&&E.push(ql(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var tM=/\r\n?/g,nM=/\u0000|\uFFFD/g;function k_(r){return(typeof r=="string"?r:""+r).replace(tM,`
|
|
67
|
-
`).replace(nM,"")}function O_(r,o){return o=k_(o),k_(r)===o}function Tt(r,o,c,u,m,v){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ja(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ja(r,""+u);break;case"className":ff(r,"class",u);break;case"tabIndex":ff(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ff(r,c,u);break;case"style":Ox(r,u,v);break;case"data":if(o!=="object"){ff(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=hf(""+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 v=="function"&&(c==="formAction"?(o!=="input"&&Tt(r,o,"name",m.name,m,null),Tt(r,o,"formEncType",m.formEncType,m,null),Tt(r,o,"formMethod",m.formMethod,m,null),Tt(r,o,"formTarget",m.formTarget,m,null)):(Tt(r,o,"encType",m.encType,m,null),Tt(r,o,"method",m.method,m,null),Tt(r,o,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=hf(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=Ts);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=hf(""+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),uf(r,"popover",u);break;case"xlinkActuate":Es(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Es(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Es(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Es(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Es(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Es(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Es(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Es(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Es(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":uf(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=Ak.get(c)||c,uf(r,c,u))}}function wg(r,o,c,u,m,v){switch(c){case"style":Ox(r,u,v);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"?ja(r,u):(typeof u=="number"||typeof u=="bigint")&&ja(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=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wx.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),v=r[Un]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==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,""):uf(r,c,u)}}}function Tn(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,v;for(v in c)if(c.hasOwnProperty(v)){var E=c[v];if(E!=null)switch(v){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,v,E,c,null)}}m&&Tt(r,o,"srcSet",c.srcSet,c,null),u&&Tt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var O=v=E=m=null,$=null,te=null;for(u in c)if(c.hasOwnProperty(u)){var ce=c[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":E=ce;break;case"checked":$=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":O=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,o));break;default:Tt(r,o,u,ce,c,null)}}Nx(r,v,O,$,te,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in c)if(c.hasOwnProperty(m)&&(O=c[m],O!=null))switch(m){case"value":v=O;break;case"defaultValue":E=O;break;case"multiple":u=O;default:Tt(r,o,m,O,c,null)}o=v,c=E,r.multiple=!!u,o!=null?Na(r,!!u,o,!1):c!=null&&Na(r,!!u,c,!0);return;case"textarea":et("invalid",r),v=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":v=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:Tt(r,o,E,O,c,null)}Ax(r,u,m,v);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(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<Hl.length;u++)et(Hl[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(te in c)if(c.hasOwnProperty(te)&&(u=c[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,te,u,c,null)}return;default:if(zp(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&wg(r,o,ce,u,c,void 0));return}}for(O in c)c.hasOwnProperty(O)&&(u=c[O],u!=null&&Tt(r,o,O,u,c,null))}function rM(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,v=null,E=null,O=null,$=null,te=null,ce=null;for(ie in c){var fe=c[ie];if(c.hasOwnProperty(ie)&&fe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":$=fe;default:u.hasOwnProperty(ie)||Tt(r,o,ie,null,u,fe)}}for(var re in u){var ie=u[re];if(fe=c[re],u.hasOwnProperty(re)&&(ie!=null||fe!=null))switch(re){case"type":v=ie;break;case"name":m=ie;break;case"checked":te=ie;break;case"defaultChecked":ce=ie;break;case"value":E=ie;break;case"defaultValue":O=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,o));break;default:ie!==fe&&Tt(r,o,re,ie,u,fe)}}Pp(r,E,O,$,te,ce,v,m);return;case"select":ie=E=O=re=null;for(v in c)if($=c[v],c.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":ie=$;default:u.hasOwnProperty(v)||Tt(r,o,v,null,u,$)}for(m in u)if(v=u[m],$=c[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":re=v;break;case"defaultValue":O=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=O,c=E,u=ie,re!=null?Na(r,!!c,re,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":ie=re=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:Tt(r,o,O,null,u,m)}for(E in u)if(m=u[E],v=c[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":re=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==v&&Tt(r,o,E,m,u,v)}jx(r,re,ie);return;case"option":for(var Re in c)re=c[Re],c.hasOwnProperty(Re)&&re!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,re));for($ in u)re=u[$],ie=c[$],u.hasOwnProperty($)&&re!==ie&&(re!=null||ie!=null)&&($==="selected"?r.selected=re&&typeof re!="function"&&typeof re!="symbol":Tt(r,o,$,re,u,ie));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 $e in c)re=c[$e],c.hasOwnProperty($e)&&re!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,re);for(te in u)if(re=u[te],ie=c[te],u.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,o));break;default:Tt(r,o,te,re,u,ie)}return;default:if(zp(o)){for(var Ct in c)re=c[Ct],c.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&wg(r,o,Ct,void 0,u,re);for(ce in u)re=u[ce],ie=c[ce],!u.hasOwnProperty(ce)||re===ie||re===void 0&&ie===void 0||wg(r,o,ce,re,u,ie);return}}for(var Z in c)re=c[Z],c.hasOwnProperty(Z)&&re!=null&&!u.hasOwnProperty(Z)&&Tt(r,o,Z,null,u,re);for(fe in u)re=u[fe],ie=c[fe],!u.hasOwnProperty(fe)||re===ie||re==null&&ie==null||Tt(r,o,fe,re,u,ie)}function M_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sM(){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],v=m.transferSize,E=m.initiatorType,O=m.duration;if(v&&O&&M_(E)){for(E=0,O=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],te=$.startTime;if(te>O)break;var ce=$.transferSize,fe=$.initiatorType;ce&&M_(fe)&&($=$.responseEnd,E+=ce*($<O?1:(O-te)/($-te)))}if(--u,o+=8*(v+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 Eg=null,Tg=null;function cd(r){return r.nodeType===9?r:r.ownerDocument}function I_(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 P_(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 Cg(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 Rg=null;function oM(){var r=window.event;return r&&r.type==="popstate"?r===Rg?!1:(Rg=r,!0):(Rg=null,!1)}var D_=typeof setTimeout=="function"?setTimeout:void 0,iM=typeof clearTimeout=="function"?clearTimeout:void 0,z_=typeof Promise=="function"?Promise:void 0,aM=typeof queueMicrotask=="function"?queueMicrotask:typeof z_<"u"?function(r){return z_.resolve(null).then(r).catch(cM)}:D_;function cM(r){setTimeout(function(){throw r})}function ko(r){return r==="head"}function L_(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),ic(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")Vl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Vl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,O=v.nodeName;v[ll]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Vl(r.ownerDocument.body);c=m}while(c);ic(o)}function U_(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 Ng(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":Ng(c),Mp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function lM(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[ll])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==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(v=r.getAttribute("src"),(v!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Mr(r.nextSibling),r===null)break}return null}function uM(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Mr(r.nextSibling),r===null))return null;return r}function $_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Mr(r.nextSibling),r===null))return null;return r}function jg(r){return r.data==="$?"||r.data==="$~"}function Ag(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function fM(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 Mr(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 kg=null;function B_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Mr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function F_(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 H_(r,o,c){switch(o=cd(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 Vl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Mp(r)}var Ir=new Map,q_=new Set;function ld(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Bs=K.d;K.d={f:dM,r:hM,D:pM,C:mM,L:gM,m:yM,X:bM,S:vM,M:xM};function dM(){var r=Bs.f(),o=ed();return r||o}function hM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?aS(o):Bs.r(r)}var rc=typeof document>"u"?null:document;function V_(r,o,c){var u=rc;if(u&&typeof o=="string"&&o){var m=Cr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),q_.has(m)||(q_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function pM(r){Bs.D(r),V_("dns-prefetch",r,null)}function mM(r,o){Bs.C(r,o),V_("preconnect",r,o)}function gM(r,o,c){Bs.L(r,o,c);var u=rc;if(u&&r&&o){var m='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Cr(c.imageSizes)+'"]')):m+='[href="'+Cr(r)+'"]';var v=m;switch(o){case"style":v=sc(r);break;case"script":v=oc(r)}Ir.has(v)||(r=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Ir.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Kl(v))||o==="script"&&u.querySelector(Gl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function yM(r,o){Bs.m(r,o);var c=rc;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+Cr(u)+'"][href="'+Cr(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oc(r)}if(!Ir.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ir.set(v,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Gl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function vM(r,o,c){Bs.S(r,o,c);var u=rc;if(u&&r){var m=Ca(u).hoistableStyles,v=sc(r);o=o||"default";var E=m.get(v);if(!E){var O={loading:0,preload:null};if(E=u.querySelector(Kl(v)))O.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&Og(r,c);var $=E=u.createElement("link");bn($),Tn($,"link",r),$._p=new Promise(function(te,ce){$.onload=te,$.onerror=ce}),$.addEventListener("load",function(){O.loading|=1}),$.addEventListener("error",function(){O.loading|=2}),O.loading|=4,ud(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:O},m.set(v,E)}}}function bM(r,o){Bs.X(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function xM(r,o){Bs.M(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function K_(r,o,c,u){var m=(m=se.current)?ld(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=sc(c.href),c=Ca(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=sc(c.href);var v=Ca(m).hoistableStyles,E=v.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,E),(v=m.querySelector(Kl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ir.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},Ir.set(r,c),v||SM(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=oc(c),c=Ca(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 sc(r){return'href="'+Cr(r)+'"'}function Kl(r){return'link[rel="stylesheet"]['+r+"]"}function G_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function SM(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}),Tn(o,"link",c),bn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Gl(r){return"script[async]"+r}function Z_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(u)return o.instance=u,bn(u),u;var m=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),Tn(u,"style",m),ud(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Kl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=G_(c),(m=Ir.get(m))&&Og(u,m),v=(r.ownerDocument||r).createElement("link"),bn(v);var E=v;return E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),o.state.loading|=4,ud(v,c.precedence,r),o.instance=v;case"script":return v=oc(c.src),(m=r.querySelector(Gl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Mg(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),bn(m),Tn(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,ud(u,c.precedence,r));return o.instance}function ud(r,o,c){for(var u=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,v=m,E=0;E<u.length;E++){var O=u[E];if(O.dataset.precedence===o)v=O;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function Og(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Mg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var fd=null;function Y_(r,o,c){if(fd===null){var u=new Map,m=fd=new Map;m.set(c,u)}else m=fd,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 v=c[m];if(!(v[ll]||v[Sn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var O=u.get(E);O?O.push(v):u.set(E,[v])}}return u}function X_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function _M(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 Q_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function wM(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=sc(u.href),v=o.querySelector(Kl(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=dd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,bn(v);return}v=o.ownerDocument||o,u=G_(u),(m=Ir.get(m))&&Og(u,m),v=v.createElement("link"),bn(v);var E=v;E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=dd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var Ig=0;function EM(r,o){return r.stylesheets&&r.count===0&&pd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Ig===0&&(Ig=62500*sM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Ig?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var hd=null;function pd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,hd=new Map,o.forEach(TM,r),hd=null,dd.call(r))}function TM(r,o){if(!(o.state.loading&4)){var c=hd.get(r);if(c)var u=c.get(null);else{c=new Map,hd.set(r,c);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<m.length;v++){var E=m[v];(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"),v=c.get(E)||u,v===u&&c.set(null,m),c.set(E,m),this.count++,u=dd.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),v?v.parentNode.insertBefore(m,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),o.state.loading|=4}}var Zl={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function CM(r,o,c,u,m,v,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=wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.hiddenUpdates=wi(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=v,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function W_(r,o,c,u,m,v,E,O,$,te,ce,fe){return r=new CM(r,o,c,E,$,te,ce,fe,O),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=hm(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},ym(v),r}function J_(r){return r?(r=Da,r):Da}function ew(r,o,c,u,m,v){m=J_(m),u.context===null?u.context=m:u.pendingContext=m,u=xo(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=So(r,u,o),c!==null&&(Vn(c,r,o),Cl(c,r,o))}function tw(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Pg(r,o){tw(r,o),(r=r.alternate)&&tw(r,o)}function nw(r){if(r.tag===13||r.tag===31){var o=Ni(r,67108864);o!==null&&Vn(o,r,67108864),Pg(r,67108864)}}function rw(r){if(r.tag===13||r.tag===31){var o=lr();o=nr(o);var c=Ni(r,o);c!==null&&Vn(c,r,o),Pg(r,o)}}var md=!0;function RM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=2,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function NM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=8,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function Dg(r,o,c,u){if(md){var m=zg(u);if(m===null)_g(r,o,u,gd,c),ow(r,u);else if(AM(m,r,o,c,u))u.stopPropagation();else if(ow(r,u),o&4&&-1<jM.indexOf(r)){for(;m!==null;){var v=Ta(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=An(v.pendingLanes);if(E!==0){var O=v;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var $=1<<31-xt(E);O.entanglements[1]|=$,E&=~$}hs(v),(gt&6)===0&&(Wf=Be()+500,Fl(0))}}break;case 31:case 13:O=Ni(v,2),O!==null&&Vn(O,v,2),ed(),Pg(v,2)}if(v=zg(u),v===null&&_g(r,o,u,gd,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else _g(r,o,u,null,c)}}function zg(r){return r=Up(r),Lg(r)}var gd=null;function Lg(r){if(gd=null,r=Ea(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 gd=r,null}function sw(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 He:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Ug=!1,Oo=null,Mo=null,Io=null,Yl=new Map,Xl=new Map,Po=[],jM="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 ow(r,o){switch(r){case"focusin":case"focusout":Oo=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":Yl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(o.pointerId)}}function Ql(r,o,c,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=Ta(o),o!==null&&nw(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function AM(r,o,c,u,m){switch(o){case"focusin":return Oo=Ql(Oo,r,o,c,u,m),!0;case"dragenter":return Mo=Ql(Mo,r,o,c,u,m),!0;case"mouseover":return Io=Ql(Io,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Yl.set(v,Ql(Yl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Xl.set(v,Ql(Xl.get(v)||null,r,o,c,u,m)),!0}return!1}function iw(r){var o=Ea(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,lf(r.priority,function(){rw(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,lf(r.priority,function(){rw(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 yd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=zg(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Lp=u,c.target.dispatchEvent(u),Lp=null}else return o=Ta(c),o!==null&&nw(o),r.blockedOn=c,!1;o.shift()}return!0}function aw(r,o,c){yd(r)&&c.delete(o)}function kM(){Ug=!1,Oo!==null&&yd(Oo)&&(Oo=null),Mo!==null&&yd(Mo)&&(Mo=null),Io!==null&&yd(Io)&&(Io=null),Yl.forEach(aw),Xl.forEach(aw)}function vd(r,o){r.blockedOn===o&&(r.blockedOn=null,Ug||(Ug=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kM)))}var bd=null;function cw(r){bd!==r&&(bd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bd===r&&(bd=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(Lg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,zm(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return vd($,r)}Oo!==null&&vd(Oo,r),Mo!==null&&vd(Mo,r),Io!==null&&vd(Io,r),Yl.forEach(o),Xl.forEach(o);for(var c=0;c<Po.length;c++){var u=Po[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Po.length&&(c=Po[0],c.blockedOn===null);)iw(c),c.blockedOn===null&&Po.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],v=c[u+1],E=m[Un]||null;if(typeof v=="function")E||cw(c);else if(E){var O=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Un]||null)O=E.formAction;else if(Lg(m)!==null)continue}else O=E.action;typeof O=="function"?c[u+1]=O:(c.splice(u,3),u-=3),cw(c)}}}function lw(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.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 v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.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 $g(r){this._internalRoot=r}xd.prototype.render=$g.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=lr();ew(c,u,r,o,null,null)},xd.prototype.unmount=$g.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;ew(r.current,2,null,r,null,null),ed(),o[wa]=null}};function xd(r){this._internalRoot=r}xd.prototype.unstable_scheduleHydration=function(r){if(r){var o=cf();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Po.length&&o!==0&&o<Po[c].priority;c++);Po.splice(c,0,r),c===0&&iw(r)}};var uw=t.version;if(uw!=="19.2.4")throw Error(s(527,uw,"19.2.4"));K.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=p(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var OM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sd.isDisabled&&Sd.supportsFiber)try{Er=Sd.inject(OM),Qt=Sd}catch{}}return eu.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=yS,v=vS,E=bS;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&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=W_(r,1,!1,null,null,c,u,null,m,v,E,lw),r[wa]=o.current,Sg(r),new $g(o)},eu.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",v=yS,E=vS,O=bS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(O=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=W_(r,1,!0,o,c??null,u,m,$,v,E,O,lw),o.context=J_(null),c=o.current,u=lr(),u=nr(u),m=xo(u),m.callback=null,So(c,m,u),c=u,o.current.lanes=c,ws(o,c),hs(o),r[wa]=o.current,Sg(r),new xd(o)},eu.version="19.2.4",eu}var QE;function u6(){if(QE)return ay.exports;QE=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(),ay.exports=l6(),ay.exports}var f6=u6(),Jc=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(){}},d6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},h6=class{#e=d6;#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)}},Gi=new h6;function p6(e){setTimeout(e,0)}var aa=typeof window>"u"||"Deno"in globalThis;function Mn(){}function m6(e,t){return typeof e=="function"?e(t):e}function gv(e){return typeof e=="number"&&e>=0&&e!==1/0}function bN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function WE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Nb(l,t.options))return!1}else if(!Eu(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 JE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ca(t.options.mutationKey)!==ca(a))return!1}else if(!Eu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Nb(e,t){return(t?.queryKeyHashFn||ca)(e)}function ca(e){return JSON.stringify(e,(t,n)=>yv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eu(e[n],t[n])):!1}var g6=Object.prototype.hasOwnProperty;function xN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=eT(e)&&eT(t);if(!s&&!(yv(e)&&yv(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 p=0;for(let g=0;g<f;g++){const y=s?g:l[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:g6.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[y]=x;continue}const S=xN(b,x,n+1);d[y]=S,S===b&&p++}return a===f&&p===a?e:d}function jh(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 eT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yv(e){if(!tT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!tT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tT(e){return Object.prototype.toString.call(e)==="[object Object]"}function y6(e){return new Promise(t=>{Gi.setTimeout(t,e)})}function vv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xN(e,t):t}function v6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function b6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var jb=Symbol();function SN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ab(e,t){return typeof e=="function"?e(...t):!!e}function x6(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 S6=class extends Jc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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"}},kb=new S6;function bv(){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 _6=p6;function w6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=_6;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 pn=w6(),E6=class extends Jc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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}},Ah=new E6;function T6(e){return Math.min(1e3*2**e,3e4)}function _N(e){return(e??"online")==="online"?Ah.isOnline():!0}var xv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wN(e){let t=!1,n=0,s;const i=bv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new xv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>kb.isFocused()&&(e.networkMode==="always"||Ah.isOnline())&&e.canRun(),g=()=>_N(e.networkMode)&&e.canRun(),y=w=>{a()||(s?.(),i.resolve(w))},b=w=>{a()||(s?.(),i.reject(w))},x=()=>new Promise(w=>{s=T=>{(a()||p())&&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(C){w=Promise.reject(C)}Promise.resolve(w).then(y).catch(C=>{if(a())return;const k=e.retry??(aa?0:3),N=e.retryDelay??T6,R=typeof N=="function"?N(n,C):N,M=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,C);if(t||!M){b(C);return}n++,e.onFail?.(n,C),y6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):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 EN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gv(this.gcTime)&&(this.#e=Gi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Gi.clearTimeout(this.#e),this.#e=void 0)}},C6=class extends EN{#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=rT(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=rT(this.options);t.data!==void 0&&(this.setState(nT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=vv(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(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Yo(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:!bN(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=SN(this.options,t),p=(()=>{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,p,this):f(p)},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=wN({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof xv&&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 xv){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,...TN(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...nT(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),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function TN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_N(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rT(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 R6=class extends Jc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=bv(),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),sT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sv(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 zr(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&&!jh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&oT(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||Yo(this.options.staleTime,this.#t)!==Yo(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(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 j6(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(Mn)),t}#g(){this.#x();const e=Yo(this.options.staleTime,this.#t);if(aa||this.#s.isStale||!gv(e))return;const n=bN(this.#s.dataUpdatedAt,e)+1;this.#l=Gi.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,!(aa||zr(this.options.enabled,this.#t)===!1||!gv(this.#c)||this.#c===0)&&(this.#u=Gi.setInterval(()=>{(this.options.refetchIntervalInBackground||kb.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(Gi.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&(Gi.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:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&sT(e,t),G=A&&oT(e,n,t,s);(P||G)&&(g={...g,...TN(p.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=vv(i?.data,A,t),y=!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=vv(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 C=g.fetchStatus==="fetching",k=w==="pending",N=w==="error",R=k&&C,M=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:k,isSuccess:w==="success",isError:N,isInitialLoading:R,isLoading:R,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:C,isRefetching:C&&!k,isLoadingError:N&&!M,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&M,isStale:Ob(e,t),refetch:this.refetch,promise:this.#a,isEnabled:zr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=j.data!==void 0,P=j.status==="error"&&!A,G=Q=>{P?Q.reject(j.error):A&&Q.resolve(j.data)},B=()=>{const Q=this.#a=j.promise=bv();G(Q)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&G(z);break;case"fulfilled":(P||j.data!==z.value)&&B();break;case"rejected":(!P||j.error!==z.reason)&&B();break}}return j}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),jh(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){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function N6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sT(e,t){return N6(e,t)||e.state.data!==void 0&&Sv(e,t,t.refetchOnMount)}function Sv(e,t,n){if(zr(t.enabled,e)!==!1&&Yo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Ob(e,t)}return!1}function oT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ob(e,n)}function Ob(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Yo(t.staleTime,e))}function j6(e,t){return!jh(e.getCurrentResult(),t)}function iT(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 p=async()=>{let g=!1;const y=S=>{x6(S,()=>t.signal,()=>g=!0)},b=SN(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 L={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(L),L})(),N=await b(k),{maxPages:R}=t.options,M=T?b6:v6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?A6:aT,T={pages:a,pageParams:l},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?l[0]??s.initialPageParam:aT(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?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=p}}}function aT(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 A6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k6=class extends EN{#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||CN(),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=wN({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),pn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function CN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var O6=class extends Jc{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 k6({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=kd(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=kd(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=kd(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=kd(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.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=>JE(t,n))}findAll(e={}){return this.getAll().filter(t=>JE(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mn))))}};function kd(e){return e.options.scope?.id}var M6=class extends Jc{#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),jh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ca(n.mutationKey)!==ca(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??CN();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){pn.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)})})}},I6=class extends Jc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Nb(s,t);let a=this.get(i);return a||(a=new C6({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(){pn.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=>WE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>WE(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},P6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new I6,this.#t=e.mutationCache||new O6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=kb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ah.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(Yo(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=m6(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pn.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;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return pn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=pn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return pn.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=pn.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(Mn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Yo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=iT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=iT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ah.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(ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Eu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Eu(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=Nb(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===jb&&(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()}},RN=_.createContext(void 0),_r=e=>{const t=_.useContext(RN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(RN.Provider,{value:e,children:t})),NN=_.createContext(!1),z6=()=>_.useContext(NN);NN.Provider;function L6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U6=_.createContext(L6()),$6=()=>_.useContext(U6),B6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Ab(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},F6=e=>{_.useEffect(()=>{e.clearReset()},[e])},H6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Ab(n,[e.error,s])),q6=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))}},V6=(e,t)=>e.isLoading&&e.isFetching&&!t,K6=(e,t)=>e?.suspense&&t.isPending,cT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function G6(e,t,n){const s=z6(),i=$6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",q6(l),B6(l,i,f),F6(i);const d=!a.getQueryCache().get(l.queryHash),[p]=_.useState(()=>new t(a,l)),g=p.getOptimisticResult(l),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(pn.batchCalls(b)):Mn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(l)},[l,p]),K6(l,g))throw cT(l,p,i);if(H6({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&&!aa&&V6(g,s)&&(d?cT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return G6(e,R6)}function is(e,t){const n=_r(),[s]=_.useState(()=>new M6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(pn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(Mn)},[s]);if(i.error&&Ab(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $t=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))($t||{});function jN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:l,shallowPropagate:f};function s(p,g,y){const b=g.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===p){x.version=y,g.depsTail=x;return}const S=p.subsTail;if(S!==void 0&&S.version===y&&S.sub===g)return;const w=g.depsTail=p.subsTail={version:y,dep:p,sub:g,prevDep:b,nextDep:x,prevSub:S,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:g.deps=w,S!==void 0?S.nextSub=w:p.subs=w}function i(p,g=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,S=p.nextSub,w=p.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,S!==void 0?S.prevSub=w:y.subsTail=w,w!==void 0?w.nextSub=S:(y.subs=S)===void 0&&n(y),x}function a(p){let g=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(p,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const S=b.subs;if(S!==void 0){const w=(p=S).nextSub;w!==void 0&&(y={value:g,prev:y},g=w);continue}}if((p=g)!==void 0){g=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){g=p.nextSub;continue e}break}while(!0)}function l(p,g){let y,b=0,x=!1;e:do{const S=p.dep,w=S.flags;if(g.flags&16)x=!0;else if((w&17)===17){if(e(S)){const T=S.subs;T.nextSub!==void 0&&f(T),x=!0}}else if((w&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=S.deps,g=S,++b;continue}if(!x){const T=p.nextDep;if(T!==void 0){p=T;continue}}for(;b--;){const T=g.subs,C=T.nextSub!==void 0;if(C?(p=y.value,y=y.prev):p=T,x){if(e(g)){C&&f(T),g=p.sub;continue}x=!1}else g.flags&=-33;g=p.sub;const k=p.nextDep;if(k!==void 0){p=k;continue e}}return x}while(!0)}function f(p){do{const g=p.sub,y=g.flags;(y&48)===32&&(g.flags=y|16,(y&6)===2&&t(g))}while((p=p.nextSub)!==void 0)}function d(p,g){let y=g.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let Mb=0,Fi=0,fu=0;const Ks=[],{link:RQ,unlink:AN,propagate:NQ,checkDirty:Z6,shallowPropagate:jQ}=jN({update(e){return e.depsTail!==void 0?W6(e):J6(e)},notify(e){let t=fu,n=t;do if(Ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(fu=t;n<--t;){const s=Ks[n];Ks[n++]=Ks[t],Ks[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,fp(e)):nF.call(e)}});function Y6(){return Mb}function X6(){++Mb}function Q6(){--Mb||tF()}function W6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,fp(e)}}function J6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function eF(e){const t=e.flags;if(t&16||t&32&&Z6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,fp(e)}}else e.flags=2}function tF(){try{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,eF(e)}}finally{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,e.flags|=10}Fi=0,fu=0}}function nF(){this.depsTail=void 0,this.flags=0,fp(this);const e=this.subs;e!==void 0&&AN(e)}function fp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=AN(n,e)}function Ib(e,t,n){const s=typeof e=="object",i=s?e:void 0;return{next:(s?e.next:e)?.bind(i),error:(s?e.error:t)?.bind(i),complete:(s?e.complete:n)?.bind(i)}}const _v=[];let oh=0;const{link:lT,unlink:rF,propagate:sF,checkDirty:kN,shallowPropagate:uT}=jN({update(e){return e._update()},notify(e){_v[wv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,kh(e))}});let Od=0,wv=0,gs;function kh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=rF(n,e)}function ON(){if(!(Y6()>0)){for(;Od<wv;){const e=_v[Od];_v[Od++]=void 0,e.notify()}Od=0,wv=0}}function MN(e,t){const n=typeof e=="function",s=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?$t.None:$t.Mutable,get(){return gs!==void 0&&lT(i,gs,oh),i._snapshot},subscribe(a){const l=Ib(a),f={current:!1},d=oF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=gs,f=Object.is;gs=i,++oh,i.depsTail=void 0,n&&(i.flags=$t.Mutable|$t.RecursedCheck);try{const d=i._snapshot,p=typeof a=="function"?a(d):a===void 0&&n?s(d):a;return d===void 0||!f(d,p)?(i._snapshot=p,!0):!1}finally{gs=l,n&&(i.flags&=~$t.RecursedCheck),kh(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const a=i.flags;if(a&$t.Dirty||a&$t.Pending&&kN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&uT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return gs!==void 0&&lT(i,gs,oh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(sF(l),uT(l),ON())}},i}function oF(e){const t=()=>{const s=gs;gs=n,++oh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{gs=s,n.flags&=~$t.RecursedCheck,kh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const s=this.flags;s&$t.Dirty||s&$t.Pending&&kN(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,kh(this)}};return t(),n}let iF=class{constructor(t){this.atom=MN(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ib(t))}};class aF{constructor(t){this.atom=MN(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ib(t))}}function cF(e){return typeof e=="function"?new aF(e):new iF(e)}function lF(e){try{X6(),e()}finally{Q6(),ON()}}const Xo="__TSR_index",fT="popstate",dT="beforeunload";function uF(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?.()??[],y=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const b of g){const x=Oh(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 p=t.state[Xo];f=hT(p+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Xo];f=hT(p,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[Xo]!==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(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function hT(e,t){t||(t={});const n=Pb();return{...t,key:n,__TSR_key:n,[Xo]:e}}function fF(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=(()=>Oh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Pb();t.history.replaceState({[Xo]:0,key:A,__TSR_key:A},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const k=()=>{T&&(j._ignoreSubscribers=!0,(T.isPush?t.history.pushState:t.history.replaceState)(T.state,"",T.href),j._ignoreSubscribers=!1,T=void 0,C=void 0,g=void 0)},N=(A,P,G)=>{const B=f(P);C||(g=p),p=Oh(P,G),T={href:B,state:G,isPush:T?.isPush||A==="push"},C||(C=Promise.resolve().then(()=>k()))},R=A=>{p=d(),j.notify({type:A})},M=async()=>{if(b){b=!1;return}const A=d(),P=A.state[Xo]-p.state[Xo],G=P===1,B=P===-1,z=!G&&!B||y;y=!1;const Q=z?"GO":B?"BACK":"FORWARD",Y=z?{type:"GO",index:P}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const ee=a();if(typeof document<"u"&&ee.length){for(const D of ee)if(await D.blockerFn({currentLocation:p,nextLocation:A,action:Q})){b=!0,t.history.go(1),j.notify(Y);return}}}p=d(),j.notify(Y)},L=A=>{if(S){S=!1;return}let P=!1;const G=a();if(typeof document<"u"&&G.length)for(const B of G){const z=B.enableBeforeUnload??!0;if(z===!0){P=!0;break}if(typeof z=="function"&&z()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=uF({getLocation:w,getLength:()=>t.history.length,pushState:(A,P)=>N("push",A,P),replaceState:(A,P)=>N("replace",A,P),back:A=>(A&&(x=!0),S=!0,t.history.back()),forward:A=>{A&&(x=!0),S=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(dT,L,{capture:!0}),t.removeEventListener(fT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(dT,L,{capture:!0}),t.addEventListener(fT,M),t.history.pushState=function(...A){const P=n.apply(t.history,A);return j._ignoreSubscribers||R("PUSH"),P},t.history.replaceState=function(...A){const P=s.apply(t.history,A);return j._ignoreSubscribers||R("REPLACE"),P},j}function dF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Oh(e,t){const n=dF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Pb();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||{[Xo]:0,key:a,__TSR_key:a}}}function Pb(){return(Math.random()+1).toString(36).substring(7)}const hF=!1;function du(e){let t;return lF(()=>{t=e()}),t}function Tu(e){return e[e.length-1]}function pF(e){return typeof e=="function"}function Fo(e,t){return pF(e)?e(t):e}const mF=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=yT(e)&&yT(s);if(!i&&!(Mh(e)&&Mh(s)))return s;const a=i?e:mT(e);if(!a)return s;const l=i?s:mT(s);if(!l)return s;const f=a.length,d=l.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:l[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:mF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=ur(x,S,n+1);p[b]=w,w===x&&g++}return f===d&&g===f?e:p}function mT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!pT.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(!pT.call(e,i))return!1;s.push(i)}return s}function Mh(e){if(!gT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!gT(n)||!n.hasOwnProperty("isPrototypeOf"))}function gT(e){return Object.prototype.toString.call(e)==="[object Object]"}function yT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function na(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(!na(e[s],t[s],n))return!1;return!0}if(Mh(e)&&Mh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!na(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||!na(e[l],t[l],n)))return!1;return i===a}return!1}function zc(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 vc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function gF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function vT(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 gF(t)}const yF=["http:","https:","mailto:","tel:"];function Ih(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function tu(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+=vT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+vT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function vF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var bF="Invariant failed";function ro(e,t){if(!e)throw new Error(bF)}function Ph(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 Lc=0,la=1,ua=2,Cu=3,Zi=4,IN=5;function xF(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 Db(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]=Lc,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]=ua,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=la,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=xF(a);if(l){const[f,d]=l,p=a.charCodeAt(f+1);if(p===45){if(f+2<a.length&&a.charCodeAt(f+2)===36){const g=f+3,y=d;if(g<y)return n[0]=Cu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=ua,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=la,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Lc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function dp(e,t,n,s,i,a,l){l?.(n);let f=s;{const d=n.fullPath??n.from,p=d.length,g=n.options?.caseSensitive??e,y=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Db(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Lc:{const k=d.substring(x[2],x[3]);if(g){const N=i.static?.get(k);if(N)S=N;else{i.static??=new Map;const R=Yi(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(k,R)}}else{const N=k.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const M=Yi(n.fullPath??n.from);M.parent=i,M.depth=a,S=M,i.staticInsensitive.set(N,M)}}break}case la:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=dy(la,n.fullPath??n.from,R,M,L);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case Cu:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===L);if(j)S=j;else{const A=dy(Cu,n.fullPath??n.from,R,M,L);S=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case ua:{const k=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(k||N),M=k?R?k:k.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=dy(ua,n.fullPath??n.from,R,M,L);S=j,j.parent=i,j.depth=a,i.wildcard??=[],i.wildcard.push(j)}}i=S}if(y&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Yi(n.fullPath??n.from);x.kind=IN,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=Yi(n.fullPath??n.from);x.kind=Zi,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=n.options?.params?.parse??null,i.skipOnParamError=y,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)dp(e,t,d,f,i,a,l)}function fy(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 $o(e){if(e.pathless)for(const t of e.pathless)$o(t);if(e.static)for(const t of e.static.values())$o(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())$o(t);if(e.dynamic?.length){e.dynamic.sort(fy);for(const t of e.dynamic)$o(t)}if(e.optional?.length){e.optional.sort(fy);for(const t of e.optional)$o(t)}if(e.wildcard?.length){e.wildcard.sort(fy);for(const t of e.wildcard)$o(t)}}function Yi(e){return{kind:Lc,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 dy(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 SF(e,t){const n=Yi("/"),s=new Uint16Array(6);for(const i of e)dp(!1,s,i,1,n,0);$o(n),t.masksTree=n,t.flatCache=Ph(1e3)}function _F(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=zb(e,t.masksTree);return t.flatCache.set(e,s),s}function wF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Yi("/");const f=new Uint16Array(6);dp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return zb(s,l,n)}function EF(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=zb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=RF(a.route)),t.matchCache.set(s,a),a}function TF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function CF(e,t=!1,n){const s=Yi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return dp(t,i,e,1,s,0,p=>{if(n?.(p,f),ro(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=TF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),$o(s),{processedTree:{segmentTree:s,singleCache:Ph(1e3),matchCache:Ph(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function zb(e,t,n=!1){const s=e.split("/"),i=jF(e,s,t,n);if(!i)return null;const[a]=PN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function PN(e,t,n){const s=NF(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,p++){const g=s[f];if(g.kind===Zi)break;if(g.kind===IN){p--,l--,d--;continue}const y=t[l],b=d;if(y&&(d+=y.length),g.kind===la){i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0;if(x.charCodeAt(S)===123){const T=g.suffix?.length??0,C=x.substring(S+2,x.length-T-1),k=y.substring(S,y.length-T);a[C]=decodeURIComponent(k)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===Cu){if(n.skipped&1<<f){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0,w=g.suffix?.length??0,T=x.substring(S+3,x.length-w-1),C=g.suffix||g.prefix?y.substring(S,y.length-w):y;C&&(a[T]=decodeURIComponent(C))}else if(g.kind===ua){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:p}]}function RF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function NF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function jF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Tu(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,p=null,g=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:S,depth:w,statics:T,dynamics:C,optionals:k}=y;let{extract:N,rawParams:R,parsedParams:M}=y;if(b.skipOnParamError){if(!hy(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Zi&&nu(p,y)&&(p=y);const L=x===l;if(L&&(b.route&&!a&&nu(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=L?void 0:t[x];let A;if(L&&b.index){const P={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M};let G=!0;if(b.index.skipOnParamError&&(hy(e,t,P)||(G=!1)),G){if(T===l&&!C&&!k&&!S)return P;nu(g,P)&&(g=P)}}if(b.wildcard&&nu(d,y))for(const P of b.wildcard){const{prefix:G,suffix:B}=P;if(G&&(L||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(G)))continue;if(B){if(L)continue;const Q=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Q:Q.toLowerCase())!==B)continue}const z={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!hy(e,t,z))){d=z;break}}if(b.optional){const P=S|1<<w,G=w+1;for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B];f.push({node:z,index:x,skipped:P,depth:G,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L)for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B],{prefix:Q,suffix:Y}=z;if(Q||Y){const ee=z.caseSensitive?j:A??=j.toLowerCase();if(Q&&!ee.startsWith(Q)||Y&&!ee.endsWith(Y))continue}f.push({node:z,index:x+1,skipped:S,depth:G,statics:T,dynamics:C,optionals:k+1,extract:N,rawParams:R,parsedParams:M})}}if(!L&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const G=b.dynamic[P],{prefix:B,suffix:z}=G;if(B||z){const Q=G.caseSensitive?j:A??=j.toLowerCase();if(B&&!Q.startsWith(B)||z&&!Q.endsWith(z))continue}f.push({node:G,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.staticInsensitive){const P=b.staticInsensitive.get(A??=j.toLowerCase());P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.static){const P=b.static.get(j);P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}if(b.pathless){const P=w+1;for(let G=b.pathless.length-1;G>=0;G--){const B=b.pathless[G];f.push({node:B,index:x,skipped:S,depth:P,statics:T,dynamics:C,optionals:k,extract:N,rawParams:R,parsedParams:M})}}}if(g&&d)return nu(d,g)?g:d;if(g)return g;if(d)return d;if(s&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function hy(e,t,n){try{const[s,i]=PN(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 nu(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===Zi)>(e.node.kind===Zi)||t.node.kind===Zi==(e.node.kind===Zi)&&t.depth>e.depth))):!0}function ih(e){return Lb(e.filter(t=>t!==void 0).join("/"))}function Lb(e){return e.replace(/\/{2,}/g,"/")}function DN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function zN(e){return Qo(DN(e))}function Dh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function AF(e,t,n){return Dh(e,n)===Dh(t,n)}function kF({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 y=s.get(l);if(y)return y}let f;if(a)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Tu(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(Tu(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Db(b,0,d);const x=d[0];if(x===Lc){p+=b;continue}const S=d[5],w=b.substring(0,d[1]),T=b.substring(d[4],S),C=b.substring(d[2],d[3]);x===la?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===ua?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=Lb(p);const g=p||"/";return l&&s&&s.set(l,g),g}function OF(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 py(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=>xT(i,n)).join("/"):xT(s,n)}function bT({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,p="";for(;f<l;){const y=f;d=Db(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===Lc){p+="/"+e.substring(y,b);continue}if(x===ua){const S=t._splat;a._splat=S,a["*"]=S;const w=e.substring(y,d[1]),T=e.substring(d[4],b);if(!S){i=!0,(w||T)&&(p+="/"+w+T);continue}const C=py("_splat",t,n);p+="/"+w+C+T;continue}if(x===la){const S=e.substring(d[2],d[3]);!i&&!(S in t)&&(i=!0),a[S]=t[S];const w=e.substring(y,d[1]),T=e.substring(d[4],b),C=py(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===Cu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),k=py(S,t,n)??"";p+="/"+T+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:a,interpolatedPath:p||"/",isMissingParams:i}}function xT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function MF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ev="tsr-scroll-restoration-v1_3",IF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function PF(){const e=MF();if(!e)return null;const t=e.getItem(Ev);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Fo(s,n)||n;try{e.setItem(Ev,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Md=PF(),DF=e=>e.state.__TSR_key||e.href;function zF(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 zh=!1;function LF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];zh=!0;e:{if(s&&d&&Object.keys(d).length>0){for(const y in d){const b=d[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(a??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);b&&b.scrollIntoView(y)}break e}const g={top:0,left:0,behavior:n};if(window.scrollTo(g),i)for(const y of i){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(g)}}zh=!1}function UF(e,t){if(!Md||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Md))return;e.isScrollRestorationSetup=!0,zh=!1;const s=e.options.getScrollRestorationKey||DF;window.history.scrollRestoration="manual";const i=a=>{if(zh||!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=zF(a.target)}const f=s(e.state.location);Md.set(d=>{const p=d[f]||={},g=p[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const y=document.querySelector(l);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",IF(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})||(LF({storageKey:Ev,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Md.set(f=>(f[l]||={},f)))})}function $F(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 BF(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 my(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function FF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=my(i):Array.isArray(a)?a.push(my(i)):n[s]=[a,my(i)]}return n}const HF=VF(JSON.parse),qF=KF(JSON.stringify,JSON.parse);function VF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=FF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function KF(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=BF(i,s);return a?`?${a}`:""}}const Lr="__root__";function GF(e){if(e.statusCode=e.statusCode||e.code||307,!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 Br(e){return e instanceof Response&&!!e.options}const ah=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},hp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),bc=(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},LN=(e,t,n)=>{const s=e.router.routesById[t.routeId??""]??e.router.routeTree;!s.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&s.parentRoute;i||ro(s.options.notFoundComponent);const a=e.matches.find(l=>l.routeId===s.id);ro(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,LN(e,t,n))},Ho=(e,t,n,s)=>{if(!(!Br(n)&&!yr(n))){if(Br(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 i=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:bc(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(LN(e,n,s),n)}},UN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ru=(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,Ho(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,Ho(e,e.router.getMatch(i),n,s)}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&&!hp(e,t)&&(n.options.loader||n.options.beforeLoad||HN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{ah(e)},i);s._nonReactive.pendingTimeout=l}},ZF=(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")&&Ho(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},YF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=zc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&ru(e,n,l,"PARSE_PARAMS"),f&&ru(e,n,f,"VALIDATE_SEARCH"),$N(e,t,s,i);const d=new AbortController;let p=!1;const g=()=>{p||(p=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},y=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){du(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=zc();const b={...bc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=hp(e,t),C={search:x,abortController:d,params:S,preload:T,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":w,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},k=R=>{if(R===void 0){du(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),ru(e,n,R,"BEFORE_LOAD")),du(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),vc(N))return g(),N.catch(R=>{ru(e,n,R,"BEFORE_LOAD")}).then(k)}catch(R){g(),ru(e,n,R,"BEFORE_LOAD")}k(N)},XF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>YF(e,n,t,i),f=()=>{if(UN(e,n))return;const d=ZF(e,n,i);return vc(d)?d.then(l):l()};return a()},QF=(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,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:l,styles:y}})},BN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=bc(e,n),g=hp(e,t);return{params:a,deps:l,preload:!!g,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},ST=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(hF??e.router.isServer)||i.ssr===!0)&&FN(s);const a=s.options.loader?.(BN(e,t,n,s)),l=s.options.loader&&vc(a);if((l||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),s.options.loader){const p=l?await a:a;Ho(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:bc(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:bc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),Ho(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,Ho(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:bc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),Ho(e,a,i)}},WF=async(e,t)=>{async function n(g,y,b,x){const S=Date.now()-y.updatedAt,w=g?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,T=x.options.shouldReload,C=typeof T=="function"?T(BN(e,s,t,x)):T,{status:k,invalid:N}=b;a=k==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!0,(async()=>{try{await ST(e,s,t,x);const R=e.router.getMatch(s);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){Br(R)&&await e.router.navigate(R.options)}})()):(k!=="success"||a&&e.sync)&&await ST(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!UN(e,s)){const g=e.router.getMatch(s),y=hp(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&&Ho(e,b,x),b.status==="pending"&&await n(y,g,b,f)}else{const b=y&&!e.router.state.matches.some(S=>S.id===s),x=e.router.getMatch(s);x._nonReactive.loaderPromise=zc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,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 p=l?d.isFetching:!1;return p!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):d};async function _T(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ah(t);try{for(let f=0;f<t.matches.length;f++){const d=XF(t,f);vc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(WF(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(Br(f))throw f;!a&&yr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=QF(t,d,g);if(y){const b=await y;t.updateMatch(d,x=>({...x,...b}))}}catch(y){console.error(`Error executing head for route ${p}:`,y)}}if(a)throw a;const l=ah(t);vc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ah(t);throw vc(s)&&await s,n}if(Br(n))throw n}return t.matches}async function FN(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 qN){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 HN(e){for(const t of qN)if(e.options[t]?.preload)return!0;return!1}const qN=["component","errorComponent","pendingComponent","notFoundComponent"];function JF(e){return{input:({url:t})=>{for(const n of e)t=Tv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=VN(e[n],t);return t}}}function eH(e){const t=zN(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=ih(["/",t,l.pathname]),l)}}function Tv(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 VN(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 ra(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}}function tH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class nH{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=>{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.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=OF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=fF()),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=Ph(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=cF(sH(this.latestLocation)),UF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||l!==p){this.basepath=d;const b=[],x=zN(d);x&&x!=="/"&&b.push(eH({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:JF(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(b=>({...b,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=CF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&SF(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:p,hash:g,href:y,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const k=this.options.parseSearch(p),N=this.options.stringifySearch(k);return{href:d+N+g,publicHref:y,pathname:tu(d).path,external:!1,searchStr:N,search:ur(s?.search,k),hash:tu(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=Tv(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:y,pathname:tu(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:tu(S.hash.slice(1)).path,state:ur(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)=>kF({base:n,to:Lb(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=>oH({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,p=this.resolvePathWithBase(d,"."),g=f.search,y={...f.params},b=a.to?this.resolvePathWithBase(p,`${a.to}`):this.resolvePathWithBase(p,"."),x=a.params===!1||a.params===null?{}:(a.params??!0)===!0?y:Object.assign(y,Fo(a.params,y)),S=this.getMatchedRoutes(b);let w=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const B of w){const z=B.options.params?.stringify??B.options.stringifyParams;if(z)try{Object.assign(x,z(x))}catch{}}const C=n.leaveParams?b:tu(bT({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let k=g;if(n._includeValidateSearch&&this.options.search?.strict){const B={};w.forEach(z=>{if(z.options.validateSearch)try{Object.assign(B,ch(z.options.validateSearch,{...B,...k}))}catch{}}),k=B}k=iH({search:k,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),k=ur(g,k);const N=this.options.stringifySearch(k),R=a.hash===!0?l.hash:a.hash?Fo(a.hash,l.hash):void 0,M=R?`#${R}`:"";let L=a.state===!0?l.state:a.state?Fo(a.state,l.state):{};L=ur(l.state,L);const j=`${C}${N}${M}`;let A,P,G=!1;if(this.rewrite){const B=new URL(j,this.origin),z=VN(this.rewrite,B);A=B.href.replace(B.origin,""),z.origin!==this.origin?(P=z.href,G=!0):P=z.pathname+z.search+z.hash}else A=vF(j),P=A;return{publicHref:P,href:A,pathname:C,search:k,searchStr:N,state:L,hash:R??"",external:G,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const p={};if(this.options.routeMasks){const g=_F(f.pathname,this.processedTree);if(g){Object.assign(p,g.rawParams);const{from:y,params:b,...x}=g.route,S=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,Fo(b,p));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 p=na(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},l=Qo(this.latestLocation.href)===Qo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=zc(()=>{f?.resolve()}),l&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...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=p??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 y=this.history.location.state.__TSR_index,b=Oh(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=Tv(this.rewrite,x);d.to=S.pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const g=this.commitLocation({...p,viewTransition:a,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(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 p=this.buildLocation({to:n,...l});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(Ih(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.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,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ra({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...ra({resolvedLocation:p,location:d})}),await _T({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],y=[],b=[];du(()=>{this.__store.setState(x=>{const S=x.matches,w=x.pendingMatches||x.matches;return g=S.filter(T=>!w.some(C=>C.id===T.id)),y=w.filter(T=>!S.some(C=>C.id===T.id)),b=w.filter(T=>S.some(C=>C.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"&&T.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[b,"onStay"]].forEach(([x,S])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[S]?.(w)})})})})}})}catch(d){Br(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):yr(d)&&(i=d),this.__store.setState(p=>({...p,statusCode:s?s.status:i?404:p.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(ra({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&&(i==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:tH(a.cachedMatches.map(l=>l.id===n?s(l):l))})):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{}if(n.options.href&&!n.options._builtLocation&&Ih(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");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=FN,this.preloadRoute=async n=>{const s=n._builtLocation??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)]);du(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await _T({router:this,matches:i,location:s,preload:!0,updateMatch:(f,d)=>{a.has(f)?i=i.map(p=>p.id===f?d(p):p):this.updateMatch(f,d)}}),i}catch(f){if(Br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});yr(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=wF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!na(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?na(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??qF,parseSearch:t.parseSearch??HF,protocolAllowlist:t.protocolAllowlist??yF}),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["**"]:Qo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?cH(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=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,C;{const Y=S?.search??t.search,ee=S?._strictSearch??void 0;try{const D=ch(x.options.validateSearch,{...Y})??void 0;w={...Y,...D},T={...ee,...D},C=void 0}catch(D){let K=D;if(D instanceof Lh||(K=new Lh(D.message,{cause:D})),n?.throwOnError)throw K;w=Y,T={},C=K}}const k=x.options.loaderDeps?.({search:w})??"",N=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:M}=bT({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+N,j=this.getMatch(L),A=y.get(x.id),P=j?._strictParams??M;let G;if(!j)try{wT(x,M,l,P)}catch(Y){if(yr(Y)||Br(Y)?G=Y:G=new rH(Y.message,{cause:Y}),n?.throwOnError)throw G}Object.assign(a,P);const B=A?"stay":"enter";let z;if(j)z={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const Y=x.options.loader||x.options.beforeLoad||x.lazyFn||HN(x)?"pending":"success";z={id:L,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??a,_strictParams:P,pathname:R,updatedAt:Date.now(),search:A?ur(A.search,w):w,_strictSearch:T,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:G,__routeContext:void 0,_nonReactive:{loadPromise:zc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:A?ur(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||(z.globalNotFound=p===x.id),z.searchError=C;const Q=this.getParentContext(S);z.context={...Q,...z.__routeContext,...z.__beforeLoadContext},g[b]=z}for(let b=0;b<g.length;b++){const x=g[b],S=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),T=y.get(x.routeId);if(x.params=T?ur(T.params,a):a,!w){const C=g[b-1],k=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:k??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:g,routeId:S.id};x.__routeContext=S.options.context(N)??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=Tu(n),l={...t.search};for(const g of n)try{Object.assign(l,ch(g.options.validateSearch,l))}catch{}const f=Tu(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{wT(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class Lh extends Error{}class rH extends Error{}function sH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ch(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Lh("Async validation not supported");if(n.issues)throw new Lh(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 oH({pathname:e,routesById:t,processedTree:n}){const s={},i=Qo(e);let a,l;const f=EF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Lr]],routeParams:s,foundRoute:a,parsedParams:l}}function iH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return aH(n)(e,t,s??!1)}function aH(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,y)=>y(g),l));const p=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,y)=>y(g),p):p};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,...ch(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:Fo(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:p=>s(i+1,p,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function cH(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 Lr}function wT(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 lH="Error preloading route! ☝️";class KN{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=Lr:this.parentRoute||ro(!1);let a=i?Lr:s?.path;a&&a!=="/"&&(a=DN(a));const l=s?.id||a;let f=i?Lr:ih([this.parentRoute.id===Lr?"":this.parentRoute.id,l]);a===Lr&&(a="/"),f!==Lr&&(f=ih(["/",f]));const d=f===Lr?"/":ih([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Qo(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=>GF({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 uH extends KN{constructor(t){super(t)}}const Id=typeof window<"u"?_.useLayoutEffect:_.useEffect;function gy(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 fH(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 dH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function Ub(e){const t=e.errorComponent??$b;return h.jsx(hH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class hH 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 $b({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.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"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function pH({children:e,fallback:t=null}){return GN()?h.jsx(Ic.Fragment,{children:e}):h.jsx(Ic.Fragment,{children:t})}function GN(){return Ic.useSyncExternalStore(mH,()=>!0,()=>!1)}function mH(){return()=>{}}var yy={exports:{}},vy={},by={exports:{}},xy={};var ET;function gH(){if(ET)return xy;ET=1;var e=Gu();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&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(y,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})},[y,x,b]),i(function(){return d(w)&&T({inst:w}),y(function(){d(w)&&T({inst:w})})},[y]),l(x),x}function d(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!n(y,x)}catch{return!0}}function p(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return xy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,xy}var TT;function ZN(){return TT||(TT=1,by.exports=gH()),by.exports}var CT;function yH(){if(CT)return vy;CT=1;var e=Gu(),t=ZN();function n(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&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 vy.useSyncExternalStoreWithSelector=function(p,g,y,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 C(L){if(!k){if(k=!0,N=L,L=b(L),x!==void 0&&w.hasValue){var j=w.value;if(x(j,L))return R=j}return R=L}if(j=R,s(N,L))return j;var A=b(L);return x!==void 0&&x(j,A)?(N=L,j):(N=L,R=A)}var k=!1,N,R,M=y===void 0?null:y;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},vy}var RT;function vH(){return RT||(RT=1,yy.exports=yH()),yy.exports}var YN=vH();function bH(e,t){return e===t}function xH(e,t,n=bH){const s=_.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return YN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const XN=_.createContext(null);function Xr(e){const t=_.useContext(XN);return e?.warn,t}function vr(e){const t=Xr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return xH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ur(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const pp=_.createContext(void 0),SH=_.createContext(void 0);function Ss(e){const t=_.useContext(e.from?SH:pp);return vr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(ro(!((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 Bb(e){return Ss({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fb(e){const{select:t,...n}=e;return Ss({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Hb(e){return Ss({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 qb(e){return Ss({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mp(e){const t=Xr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=vN();function _H(e,t){const n=Xr(),s=dH(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:k,className:N,onClick:R,onBlur:M,onFocus:L,onMouseEnter:j,onMouseLeave:A,onTouchStart:P,ignoreBlocker:G,params:B,search:z,hash:Q,state:Y,mask:ee,reloadDocument:D,unsafeRelative:K,from:q,_fromLocation:V,...U}=e,I=GN(),H=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),W=e.from,X=_.useMemo(()=>({...e,from:W}),[n,H,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=_.useMemo(()=>n.buildLocation({...X}),[n,X]),se=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,de=oe.maskedLocation?oe.maskedLocation.external:oe.external,xe=_.useMemo(()=>NH(se,de,n.history,C),[C,de,se,n.history]),he=_.useMemo(()=>{if(xe?.external)return Ih(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!jH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Ih(f,n.protocolAllowlist)?void 0:f}catch{}},[f,xe,n.protocolAllowlist]),Me=vr({select:He=>{if(he)return!1;if(l?.exact){if(!AF(He.location.pathname,oe.pathname,n.basepath))return!1}else{const me=Dh(He.location.pathname,n.basepath),Te=Dh(oe.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!na(He.location.search,oe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?I&&He.location.hash===oe.hash:!0}}),_e=Me?Fo(i,{})??wH:Sy,ne=Me?Sy:Fo(a,{})??Sy,pe=[N,_e.className,ne.className].filter(Boolean).join(" "),ae=(k||_e.style||ne.style)&&{...k,..._e.style,...ne.style},[we,ve]=_.useState(!1),Se=_.useRef(!1),ye=e.reloadDocument||he?!1:d??n.options.defaultPreload,Ue=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...X,_builtLocation:oe}).catch(He=>{console.warn(He),console.warn(lH)})},[n,X,oe]),Ee=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);fH(s,Ee,RH,{disabled:!!C||ye!=="viewport"}),_.useEffect(()=>{Se.current||!C&&ye==="render"&&(Ie(),Se.current=!0)},[C,Ie,ye]);const Ve=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!AH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{ve(!0)});const qe=n.subscribe("onResolved",()=>{qe(),ve(!1)});n.navigate({...X,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:G})}};if(he)return{...U,ref:s,href:he,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...k&&{style:k},...N&&{className:N},...R&&{onClick:R},...M&&{onBlur:M},...L&&{onFocus:L},...j&&{onMouseEnter:j},...A&&{onMouseLeave:A},...P&&{onTouchStart:P}};const Xe=He=>{if(C||ye!=="intent")return;if(!Ue){Ie();return}const me=He.currentTarget;if(su.has(me))return;const Te=setTimeout(()=>{su.delete(me),Ie()},Ue);su.set(me,Te)},Be=He=>{C||ye!=="intent"||Ie()},We=He=>{if(C||!ye||!Ue)return;const me=He.currentTarget,Te=su.get(me);Te&&(clearTimeout(Te),su.delete(me))};return{...U,..._e,...ne,href:xe?.href,ref:s,onClick:lc([R,Ve]),onBlur:lc([M,We]),onFocus:lc([L,Xe]),onMouseEnter:lc([j,Xe]),onMouseLeave:lc([A,We]),onTouchStart:lc([P,Be]),disabled:!!C,target:T,...ae&&{style:ae},...pe&&{className:pe},...C&&EH,...Me&&TH,...I&&we&&CH}}const Sy={},wH={className:"active"},EH={role:"link","aria-disabled":!0},TH={"data-status":"active","aria-current":"page"},CH={"data-transitioning":"transitioning"},su=new WeakMap,RH={rootMargin:"100px"},lc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function NH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const xc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=_H(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 AH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let kH=class extends KN{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fb({...n,from:this.id}),this.useLoaderData=n=>Bb({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ao(e){return new kH(e)}class OH extends uH{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fb({...n,from:this.id}),this.useLoaderData=n=>Bb({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function MH(e){return new OH(e)}function NT(e){return typeof e=="object"?new jT(e,{silent:!0}).createRoute(e):new jT(e,{silent:!0}).createRoute}class jT{constructor(t,n){this.path=t,this.createRoute=s=>{const i=ao(s);return i.isRoot=!1,i},this.silent=n?.silent}}class AT{constructor(t){this.useMatch=n=>Ss({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Fb({...n,from:this.options.id}),this.useLoaderData=n=>Bb({...n,from:this.options.id}),this.useNavigate=()=>{const n=Xr();return mp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function kT(e){return typeof e=="object"?new AT(e):t=>new AT({id:e,...t})}function IH(){const e=Xr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=vr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=gy(a),f=a||n||i,d=gy(f),p=a||i,g=gy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qo(e.latestLocation.publicHref)!==Qo(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Id(()=>{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]),Id(()=>{l&&!a&&e.emit({type:"onLoad",...ra(e.state)})},[l,e,a]),Id(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...ra(e.state)})},[p,g,e]),Id(()=>{if(d&&!f){const y=ra(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&$F(e)}},[f,d,e]),null}function PH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(Ub,{getResetKey:()=>t,onCatch:(n,s)=>{if(yr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function DH(){return h.jsx("p",{children:"Not Found"})}function uc(e){return h.jsx(h.Fragment,{children:e.children})}function QN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(DH,{})}function zH(){return Xr().isScrollRestoring,null}const WN=_.memo(function({matchId:t}){const n=Xr(),s=vr({select:w=>{const T=w.matches.findIndex(k=>k.id===t),C=w.matches[T];return ro(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._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?h.jsx(a,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",y=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?_.Suspense:uc,b=f?Ub:uc,x=p?PH:uc,S=i.isRoot?i.options.shellComponent??uc:uc;return h.jsxs(S,{children:[h.jsx(pp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||$b,onCatch:(w,T)=>{if(yr(w))throw w;d?.(w,T)},children:h.jsx(x,{fallback:w=>{if(!p||w.routeId&&w.routeId!==s.routeId||!w.routeId&&!i.isRoot)throw w;return _.createElement(p,w)},children:g||s._displayPending?h.jsx(pH,{fallback:l,children:h.jsx(OT,{matchId:t})}):h.jsx(OT,{matchId:t})})})})}),s.parentRouteId===Lr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(LH,{}),h.jsx(zH,{})]}):null]})});function LH(){const e=Xr(),t=_.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ra(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const OT=_.memo(function({matchId:t}){const n=Xr(),{match:s,key:i,routeId:a}=vr({select:d=>{const p=d.matches.find(S=>S.id===t),g=p.routeId,b=(n.routesById[g].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:g,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:g,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(JN,{})},[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 p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=zc();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ro(yr(s.error)),QN(n,l,s.error);if(s.status==="redirected")throw ro(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),JN=_.memo(function(){const t=Xr(),n=_.useContext(pp),s=vr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=vr({select:p=>{const y=p.matches.find(b=>b.id===n);return ro(y),y.globalNotFound}}),l=vr({select:p=>{const g=p.matches,y=g.findIndex(b=>b.id===n);return g[y+1]?.id}}),f=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(a)return QN(t,i,void 0);if(!l)return null;const d=h.jsx(WN,{matchId:l});return s===Lr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function UH(){const e=Xr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?uc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(IH,{}),h.jsx($H,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function $H(){const e=Xr(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),s=t?h.jsx(WN,{matchId:t}):null;return h.jsx(pp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(Ub,{getResetKey:()=>n,errorComponent:$b,onCatch:void 0,children:s})})}const BH=e=>new FH(e);class FH extends nH{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=NT,globalThis.createLazyFileRoute=kT):typeof window<"u"&&(window.createFileRoute=NT,window.createLazyFileRoute=kT);function HH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=h.jsx(XN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:s}):s}function qH({router:e,...t}){return h.jsx(HH,{router:e,...t,children:h.jsx(UH,{})})}const VH=/\{[^{}]+\}/g,KH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function GH(){return Math.random().toString(36).slice(2,11)}function ZH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...p}={...e};d=KH()?d:void 0,t=PT(t);const g=[];async function y(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:C,params:k={},parseAs:N="json",querySerializer:R,bodySerializer:M=a??XH,pathSerializer:L,body:j,middleware:A=[],...P}=x||{};let G=t;S&&(G=PT(S)??t);let B=typeof i=="function"?i:MT(i);R&&(B=typeof R=="function"?R:MT({...typeof i=="object"?i:{},...R}));const z=L||l||YH,Q=j===void 0?void 0:M(j,IT(f,C,k.header)),Y=IT(Q===void 0||Q instanceof FormData?{}:{"Content-Type":"application/json"},f,C,k.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Q,headers:Y};let K,q,V=new T(QH(b,{baseUrl:G,params:k,querySerializer:B,pathSerializer:z}),D),U;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){K=GH(),q=Object.freeze({baseUrl:G,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:z});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const X=await W.onRequest({request:V,schemaPath:b,params:k,options:q,id:K});if(X)if(X instanceof T)V=X;else if(X instanceof Response){U=X;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await w(V,d)}catch(W){let X=W;if(ee.length)for(let oe=ee.length-1;oe>=0;oe--){const se=ee[oe];if(se&&typeof se=="object"&&typeof se.onError=="function"){const de=await se.onError({request:V,error:X,schemaPath:b,params:k,options:q,id:K});if(de){if(de instanceof Response){X=void 0,U=de;break}if(de instanceof Error){X=de;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(X)throw X}if(ee.length)for(let W=ee.length-1;W>=0;W--){const X=ee[W];if(X&&typeof X=="object"&&typeof X.onResponse=="function"){const oe=await X.onResponse({request:V,response:U,schemaPath:b,params:k,options:q,id:K});if(oe){if(!(oe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=oe}}}}const I=U.headers.get("Content-Length");if(U.status===204||V.method==="HEAD"||I==="0"&&!U.headers.get("Transfer-Encoding")?.includes("chunked"))return U.ok?{data:void 0,response:U}:{error:void 0,response:U};if(U.ok)return{data:await(async()=>{if(N==="stream")return U.body;if(N==="json"&&!I){const X=await U.text();return X?JSON.parse(X):void 0}return await U[N]()})(),response:U};let H=await U.text();try{H=JSON.parse(H)}catch{}return{error:H,response:U}}return{request(b,x,S){return y(x,{...S,method:b.toUpperCase()})},GET(b,x){return y(b,{...x,method:"GET"})},PUT(b,x){return y(b,{...x,method:"PUT"})},POST(b,x){return y(b,{...x,method:"POST"})},DELETE(b,x){return y(b,{...x,method:"DELETE"})},OPTIONS(b,x){return y(b,{...x,method:"OPTIONS"})},HEAD(b,x){return y(b,{...x,method:"HEAD"})},PATCH(b,x){return y(b,{...x,method:"PATCH"})},TRACE(b,x){return y(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 gp(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 ej(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(gp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function tj(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(gp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function MT(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(tj(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(ej(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(gp(i,a,e))}}return s.join("&")}}function YH(e,t){let n=e;for(const s of e.match(VH)??[]){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,tj(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,ej(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${gp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function XH(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 QH(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 IT(...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 PT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class WH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function JH(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 Xu(e){const{data:t,error:n}=await e;if(n||!t)throw new WH(JH(n),n);return t}function eq(e){const t=ZH({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 tq(e){return eq({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function nq(e){try{const{error:t,response:n}=await e.GET("/console/stats");if(!t)return;const s=n.status;let i=null;if(typeof t=="string")i=t;else if(t&&typeof t=="object"){const a=t,l=a.error,f=a.message;if(typeof l=="string"&&l.length>0)i=l;else if(typeof f=="string"&&f.length>0)i=f;else try{i=JSON.stringify(a)}catch{i=null}}throw new Error(i&&i.length>0?`Console API /console/stats returned ${s}: ${i}`:`Console API /console/stats returned ${s}`)}catch(t){throw t instanceof Error?t:new Error("Failed to connect to console API")}}const Ru="sync-console-connection";function Cv(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:{serverUrl:t,token:n}}function nj(e){return typeof window>"u"?null:e==="local"?window.localStorage:e==="session"?window.sessionStorage:null}function DT(e){const t=nj(e);if(!t)return null;try{const n=t.getItem(Ru);return n?Cv(JSON.parse(n)):null}catch{return null}}function rq(e,t){const n=nj(e);if(n)try{if(!t){n.removeItem(Ru);return}n.setItem(Ru,JSON.stringify(t))}catch{}}const rj=_.createContext(null);function sq({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:s="session"}){const[i,a]=_.useState(()=>DT(s));_.useEffect(()=>{const w=DT(s);a(w)},[s]),_.useEffect(()=>{typeof window>"u"||(s!=="local"&&window.localStorage.removeItem(Ru),s==="memory"&&window.sessionStorage.removeItem(Ru))},[s]);const l=_.useCallback(w=>{const T=Cv(w);a(T),rq(s,T)},[s]),[f,d]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),p=_.useRef(null);_.useEffect(()=>{if(!(i?.serverUrl?.trim()&&i.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){l({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[l,i,t]);const g=_.useCallback(async(w,T)=>{const C=w??i;if(!C)return d(N=>({...N,error:"No connection configured"})),!1;const k=Cv(C);if(!k){const N=(C.serverUrl?.trim()??"").length>0;return d(R=>({...R,error:N?"Token is required":"Server URL is required"})),!1}w&&(T?.persistOverride??!0)&&l(k),d(N=>({...N,isConnecting:!0,error:null}));try{const N=tq(k);return await nq(N),d({isConnected:!0,isConnecting:!1,client:N,error:null}),!0}catch(N){return d({isConnected:!1,isConnecting:!1,client:null,error:N instanceof Error?N.message:"Connection failed"}),!1}},[i,l]),y=_.useCallback(w=>{w?.clearSavedConfig&&l(null),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),b=_.useCallback(()=>{d(w=>({...w,error:null}))},[]),x=_.useCallback(w=>{l(w),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),S=_.useMemo(()=>({config:i,setConfig:x,isConnected:f.isConnected,isConnecting:f.isConnecting,error:f.error,client:f.client,connect:g,disconnect:y,clearError:b}),[i,x,f,g,y,b]);return _.useEffect(()=>{if(!n||f.isConnected||f.isConnecting)return;const w=i??t,T=oq(w);!w||!T||p.current!==T&&(p.current=T,g(w,{persistOverride:!0}))},[n,i,t,f.isConnected,f.isConnecting,g]),h.jsx(rj.Provider,{value:S,children:e})}function oq(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function Dt(){const e=_.useContext(rj);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function sj(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=sj(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Vb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=sj(e))&&(s&&(s+=" "),s+=t);return s}var iq=e=>typeof e=="number"&&e!=+e,Uh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,zT=e=>(typeof e=="number"||e instanceof Number)&&!iq(e);function aq(){}var $h=Symbol("NOT_FOUND");function cq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function lq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function uq(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 LT=e=>Array.isArray(e)?e:[e];function fq(e){const t=Array.isArray(e[0])?e[0]:e;return uq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function hq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$h},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function pq(e,t){let n=[];function s(f){const d=n.findIndex(p=>t(f,p.key));if(d>-1){const p=n[d];return d>0&&(n.splice(d,1),n.unshift(p)),p.value}return $h}function i(f,d){s(f)===$h&&(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 mq=(e,t)=>e===t;function gq(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 yq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=mq,maxSize:i=1,resultEqualityCheck:a}=n,l=gq(s);let f=0;const d=i<=1?hq(l):pq(i,l);function p(){let g=d.get(arguments);if(g===$h){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 p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var vq=class{constructor(e){this.value=e}deref(){return this.value}},bq=typeof WeakRef<"u"?WeakRef:vq,xq=0,UT=1;function Pd(){return{s:xq,v:void 0,o:null,p:null}}function oj(e,t={}){let n=Pd();const{resultEqualityCheck:s}=t;let i,a=0;function l(){let f=n;const{length:d}=arguments;for(let y=0,b=d;y<b;y++){const x=arguments[y];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=Pd(),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=Pd(),S.set(x,f)):f=w}}const p=f;let g;if(f.s===UT)g=f.v;else if(g=e.apply(null,arguments),a++,s){const y=i?.deref?.()??i;y!=null&&s(y,g)&&(g=y,a!==0&&a--),i=typeof g=="object"&&g!==null||typeof g=="function"?new bq(g):g}return p.s=UT,p.v=g,g}return l.clearCache=()=>{n=Pd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function ij(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),cq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=oj,argsMemoizeOptions:S=[]}=g,w=LT(b),T=LT(S),C=fq(i),k=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=dq(C,arguments);return f=k.apply(null,M),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:k,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var Sq=ij(oj),_q=Object.assign((e,t=Sq)=>{lq(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:()=>_q});function Bh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var _y={},wy={},Ey={},$T;function wq(){return $T||($T=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"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=void 0,f=null)},y=()=>{p&&g(),w()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,y()},s)},S=()=>{b!==null&&(clearTimeout(b),b=null)},w=()=>{S(),l=void 0,f=null},T=()=>{g()},C=function(...k){if(i?.aborted)return;l=this,f=k;const N=b==null;x(),d&&N&&g()};return C.schedule=x,C.cancel=w,C.flush=T,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(Ey)),Ey}var BT;function Eq(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);l&&(p[0]="leading"),f&&(p[1]="trailing");let g,y=null;const b=t.debounce(function(...w){g=s.apply(this,w),y=null},i,{edges:p}),x=function(...w){return d!=null&&(y===null&&(y=Date.now()),Date.now()-y>=d)?(g=s.apply(this,w),y=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})(wy)),wy}var FT;function Tq(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Eq();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})(_y)),_y}var Ty,HT;function Cq(){return HT||(HT=1,Ty=Tq().throttle),Ty}var Rq=Cq();const Nq=z1(Rq);var qT=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++]))}},bs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},aj=(e,t,n)=>{var{width:s=bs.width,height:i=bs.height,aspect:a,maxHeight:l}=n,f=Uh(s)?e:Number(s),d=Uh(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}},jq={width:0,height:0,overflow:"visible"},Aq={width:0,overflowX:"visible"},kq={height:0,overflowY:"visible"},Oq={},Mq=e=>{var{width:t,height:n}=e,s=Uh(t),i=Uh(n);return s&&i?jq:s?Aq:i?kq:Oq};function Iq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bs.width,a=bs.height):i===void 0?i=s&&s>0?void 0:bs.width:a===void 0&&(a=s&&s>0?void 0:bs.height),{width:i,height:a}}function Rv(){return Rv=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},Rv.apply(null,arguments)}function VT(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?VT(Object(n),!0).forEach(function(s){Pq(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Pq(e,t,n){return(t=Dq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dq(e){var t=zq(e,"string");return typeof t=="symbol"?t:t+""}function zq(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 cj=_.createContext(bs.initialDimension);function Lq(e){return Bh(e.width)&&Bh(e.height)}function lj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Lq(i)?_.createElement(cj.Provider,{value:i},t):null}var Uq=()=>_.useContext(cj),$q=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=bs.initialDimension,width:i,height:a,minWidth:l=bs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=bs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,k]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((A,P)=>{k(G=>{var B=Math.round(A),z=Math.round(P);return G.containerWidth===B&&G.containerHeight===z?G:{containerWidth:B,containerHeight:z}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return aq;var A=z=>{var Q,Y=z[0];if(Y!=null){var{width:ee,height:D}=Y.contentRect;N(ee,D),(Q=T.current)===null||Q===void 0||Q.call(T,ee,D)}};g>0&&(A=Nq(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:G,height:B}=w.current.getBoundingClientRect();return N(G,B),P.observe(w.current),()=>{P.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:M}=C;qT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:L,calculatedHeight:j}=aj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return qT(L!=null&&L>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
66
|
+
`+u.stack}}var Ue=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Xe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,lt=e.log,wr=e.unstable_setDisableYieldValue,Er=null,Qt=null;function ut(r){if(typeof lt=="function"&&wr(r),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Er,r)}catch{}}var xt=Math.clz32?Math.clz32:vn,ot=Math.log,Wt=Math.LN2;function vn(r){return r>>>=0,r===0?32:31-(ot(r)/Wt|0)|0}var kt=256,Cn=262144,er=4194304;function An(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 as(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var O=u&134217727;return O!==0?(u=O&~v,u!==0?m=An(u):(E&=O,E!==0?m=An(E):c||(c=O&~r,c!==0&&(m=An(c))))):(O=u&~v,O!==0?m=An(O):E!==0?m=An(E):c||(c=u&~r,c!==0&&(m=An(c)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:m}function cs(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function _a(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 _i(){var r=er;return er<<=1,(er&62914560)===0&&(er=4194304),r}function wi(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function ws(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tr(r,o,c,u,m,v){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,te=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-xt(c),fe=1<<ce;O[ce]=0,$[ce]=-1;var re=te[ce];if(re!==null)for(te[ce]=null,ce=0;ce<re.length;ce++){var ie=re[ce];ie!==null&&(ie.lane&=-536870913)}c&=~fe}u!==0&&ls(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function ls(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function uo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-xt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function fo(r,o){var c=o&-o;return c=(c&42)!==0?1:nr(c),(c&(r.suspendedLanes|o))!==0?0:c}function nr(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 cl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function cf(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:sw(r.type))}function lf(r,o){var c=K.p;try{return K.p=r,o()}finally{K.p=c}}var ho=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ho,Un="__reactProps$"+ho,wa="__reactContainer$"+ho,Op="__reactEvents$"+ho,wk="__reactListeners$"+ho,Ek="__reactHandles$"+ho,Sx="__reactResources$"+ho,ll="__reactMarker$"+ho;function Mp(r){delete r[Sn],delete r[Un],delete r[Op],delete r[wk],delete r[Ek]}function Ea(r){var o=r[Sn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[wa]||c[Sn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=F_(r);r!==null;){if(c=r[Sn])return c;r=F_(r)}return o}r=c,c=r.parentNode}return null}function Ta(r){if(r=r[Sn]||r[wa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ul(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Ca(r){var o=r[Sx];return o||(o=r[Sx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[ll]=!0}var _x=new Set,wx={};function Ei(r,o){Ra(r,o),Ra(r+"Capture",o)}function Ra(r,o){for(wx[r]=o,r=0;r<o.length;r++)_x.add(o[r])}var Tk=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]*$"),Ex={},Tx={};function Ck(r){return Ue.call(Tx,r)?!0:Ue.call(Ex,r)?!1:Tk.test(r)?Tx[r]=!0:(Ex[r]=!0,!1)}function uf(r,o,c){if(Ck(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 ff(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 Es(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 Tr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Cx(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Rk(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,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return m.call(this)},set:function(E){c=""+E,v.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 Ip(r){if(!r._valueTracker){var o=Cx(r)?"checked":"value";r._valueTracker=Rk(r,o,""+r[o])}}function Rx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=Cx(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function df(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 Nk=/[\n"\\]/g;function Cr(r){return r.replace(Nk,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Pp(r,o,c,u,m,v,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=""+Tr(o)):r.value!==""+Tr(o)&&(r.value=""+Tr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Dp(r,E,Tr(o)):c!=null?Dp(r,E,Tr(c)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+Tr(O):r.removeAttribute("name")}function Nx(r,o,c,u,m,v,E,O){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Ip(r);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(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),Ip(r)}function Dp(r,o,c){o==="number"&&df(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Na(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=""+Tr(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 jx(r,o,c){if(o!=null&&(o=""+Tr(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Tr(c):""}function Ax(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=Tr(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),Ip(r)}function ja(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var jk=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 kx(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||jk.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function Ox(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&&kx(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&kx(r,v,o[v])}function zp(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 Ak=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"]]),kk=/^[\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 hf(r){return kk.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ts(){}var Lp=null;function Up(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Aa=null,ka=null;function Mx(r){var o=Ta(r);if(o&&(r=o.stateNode)){var c=r[Un]||null;e:switch(r=o.stateNode,o.type){case"input":if(Pp(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="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Un]||null;if(!m)throw Error(s(90));Pp(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&&Rx(u)}break e;case"textarea":jx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Na(r,!!c.multiple,o,!1)}}}var $p=!1;function Ix(r,o,c){if($p)return r(o,c);$p=!0;try{var u=r(o);return u}finally{if($p=!1,(Aa!==null||ka!==null)&&(ed(),Aa&&(o=Aa,r=ka,ka=Aa=null,Mx(o),r)))for(o=0;o<r.length;o++)Mx(r[o])}}function fl(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Un]||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 Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(Cs)try{var dl={};Object.defineProperty(dl,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{Bp=!1}var po=null,Fp=null,pf=null;function Px(){if(pf)return pf;var r,o=Fp,c=o.length,u,m="value"in po?po.value:po.textContent,v=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[v-u];u++);return pf=m.slice(r,1<u?1-u:void 0)}function mf(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 gf(){return!0}function Dx(){return!1}function $n(r){function o(c,u,m,v,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var O in r)r.hasOwnProperty(O)&&(c=r[O],this[O]=c?c(v):v[O]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?gf:Dx,this.isPropagationStopped=Dx,this}return y(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=gf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=gf)},persist:function(){},isPersistent:gf}),o}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yf=$n(Ti),hl=y({},Ti,{view:0,detail:0}),Ok=$n(hl),Hp,qp,pl,vf=y({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==pl&&(pl&&r.type==="mousemove"?(Hp=r.screenX-pl.screenX,qp=r.screenY-pl.screenY):qp=Hp=0,pl=r),Hp)},movementY:function(r){return"movementY"in r?r.movementY:qp}}),zx=$n(vf),Mk=y({},vf,{dataTransfer:0}),Ik=$n(Mk),Pk=y({},hl,{relatedTarget:0}),Vp=$n(Pk),Dk=y({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),zk=$n(Dk),Lk=y({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Uk=$n(Lk),$k=y({},Ti,{data:0}),Lx=$n($k),Bk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fk={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"},Hk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qk(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Hk[r])?!!o[r]:!1}function Kp(){return qk}var Vk=y({},hl,{key:function(r){if(r.key){var o=Bk[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=mf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Fk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(r){return r.type==="keypress"?mf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?mf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Kk=$n(Vk),Gk=y({},vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ux=$n(Gk),Zk=y({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),Yk=$n(Zk),Xk=y({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qk=$n(Xk),Wk=y({},vf,{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}),Jk=$n(Wk),eO=y({},Ti,{newState:0,oldState:0}),tO=$n(eO),nO=[9,13,27,32],Gp=Cs&&"CompositionEvent"in window,ml=null;Cs&&"documentMode"in document&&(ml=document.documentMode);var rO=Cs&&"TextEvent"in window&&!ml,$x=Cs&&(!Gp||ml&&8<ml&&11>=ml),Bx=" ",Fx=!1;function Hx(r,o){switch(r){case"keyup":return nO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Oa=!1;function sO(r,o){switch(r){case"compositionend":return qx(o);case"keypress":return o.which!==32?null:(Fx=!0,Bx);case"textInput":return r=o.data,r===Bx&&Fx?null:r;default:return null}}function oO(r,o){if(Oa)return r==="compositionend"||!Gp&&Hx(r,o)?(r=Px(),pf=Fp=po=null,Oa=!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 $x&&o.locale!=="ko"?null:o.data;default:return null}}var iO={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 Vx(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!iO[r.type]:o==="textarea"}function Kx(r,o,c,u){Aa?ka?ka.push(u):ka=[u]:Aa=u,o=ad(o,"onChange"),0<o.length&&(c=new yf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var gl=null,yl=null;function aO(r){N_(r,0)}function bf(r){var o=ul(r);if(Rx(o))return r}function Gx(r,o){if(r==="change")return o}var Zx=!1;if(Cs){var Zp;if(Cs){var Yp="oninput"in document;if(!Yp){var Yx=document.createElement("div");Yx.setAttribute("oninput","return;"),Yp=typeof Yx.oninput=="function"}Zp=Yp}else Zp=!1;Zx=Zp&&(!document.documentMode||9<document.documentMode)}function Xx(){gl&&(gl.detachEvent("onpropertychange",Qx),yl=gl=null)}function Qx(r){if(r.propertyName==="value"&&bf(yl)){var o=[];Kx(o,yl,r,Up(r)),Ix(aO,o)}}function cO(r,o,c){r==="focusin"?(Xx(),gl=o,yl=c,gl.attachEvent("onpropertychange",Qx)):r==="focusout"&&Xx()}function lO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bf(yl)}function uO(r,o){if(r==="click")return bf(o)}function fO(r,o){if(r==="input"||r==="change")return bf(o)}function dO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:dO;function vl(r,o){if(rr(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(!Ue.call(o,m)||!rr(r[m],o[m]))return!1}return!0}function Wx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Jx(r,o){var c=Wx(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=Wx(c)}}function e0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?e0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function t0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=df(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=df(r.document)}return o}function Xp(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 hO=Cs&&"documentMode"in document&&11>=document.documentMode,Ma=null,Qp=null,bl=null,Wp=!1;function n0(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Wp||Ma==null||Ma!==df(u)||(u=Ma,"selectionStart"in u&&Xp(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}),bl&&vl(bl,u)||(bl=u,u=ad(Qp,"onSelect"),0<u.length&&(o=new yf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ma)))}function Ci(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ia={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},Jp={},r0={};Cs&&(r0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ri(r){if(Jp[r])return Jp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in r0)return Jp[r]=o[c];return r}var s0=Ri("animationend"),o0=Ri("animationiteration"),i0=Ri("animationstart"),pO=Ri("transitionrun"),mO=Ri("transitionstart"),gO=Ri("transitioncancel"),a0=Ri("transitionend"),c0=new Map,em="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(" ");em.push("scrollEnd");function Qr(r,o){c0.set(r,o),Ei(o,[r])}var xf=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)},Rr=[],Pa=0,tm=0;function Sf(){for(var r=Pa,o=tm=Pa=0;o<r;){var c=Rr[o];Rr[o++]=null;var u=Rr[o];Rr[o++]=null;var m=Rr[o];Rr[o++]=null;var v=Rr[o];if(Rr[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}v!==0&&l0(c,m,v)}}function _f(r,o,c,u){Rr[Pa++]=r,Rr[Pa++]=o,Rr[Pa++]=c,Rr[Pa++]=u,tm|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function nm(r,o,c,u){return _f(r,o,c,u),wf(r)}function Ni(r,o){return _f(r,null,null,o),wf(r)}function l0(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,v=r.return;v!==null;)v.childLanes|=c,u=v.alternate,u!==null&&(u.childLanes|=c),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(m=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,m&&o!==null&&(m=31-xt(c),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),v):null}function wf(r){if(50<Bl)throw Bl=0,fg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function yO(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 sr(r,o,c,u){return new yO(r,o,c,u)}function rm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Rs(r,o){var c=r.alternate;return c===null?(c=sr(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 u0(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 Ef(r,o,c,u,m,v){var E=0;if(u=r,typeof r=="function")rm(r)&&(E=1);else if(typeof r=="string")E=_M(r,c,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=sr(31,c,o,m),r.elementType=P,r.lanes=v,r;case w:return ji(c.children,m,v,o);case T:E=8,m|=24;break;case C:return r=sr(12,c,o,m|2),r.elementType=C,r.lanes=v,r;case M:return r=sr(13,c,o,m),r.elementType=M,r.lanes=v,r;case L:return r=sr(19,c,o,m),r.elementType=L,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:E=10;break e;case A:E=9;break e;case R:E=11;break e;case j:E=14;break e;case k:E=16,u=null;break e}E=29,c=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=sr(E,c,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function ji(r,o,c,u){return r=sr(7,r,u,o),r.lanes=c,r}function sm(r,o,c){return r=sr(6,r,null,o),r.lanes=c,r}function f0(r){var o=sr(18,null,null,0);return o.stateNode=r,o}function om(r,o,c){return o=sr(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var d0=new WeakMap;function Nr(r,o){if(typeof r=="object"&&r!==null){var c=d0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ye(o)},d0.set(r,o),o)}return{value:r,source:o,stack:ye(o)}}var za=[],La=0,Tf=null,xl=0,jr=[],Ar=0,mo=null,us=1,fs="";function Ns(r,o){za[La++]=xl,za[La++]=Tf,Tf=r,xl=o}function h0(r,o,c){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,mo=r;var u=us;r=fs;var m=32-xt(u)-1;u&=~(1<<m),c+=1;var v=32-xt(o)+m;if(30<v){var E=m-m%5;v=(u&(1<<E)-1).toString(32),u>>=E,m-=E,us=1<<32-xt(o)+m|c<<m|u,fs=v+r}else us=1<<v|c<<m|u,fs=r}function im(r){r.return!==null&&(Ns(r,1),h0(r,1,0))}function am(r){for(;r===Tf;)Tf=za[--La],za[La]=null,xl=za[--La],za[La]=null;for(;r===mo;)mo=jr[--Ar],jr[Ar]=null,fs=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null}function p0(r,o){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=mo,us=o.id,fs=o.overflow,mo=r}var _n=null,Mt=null,rt=!1,go=null,kr=!1,cm=Error(s(519));function yo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sl(Nr(o,r)),cm}function m0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[Sn]=r,o[Un]=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<Hl.length;c++)et(Hl[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),Nx(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),Ax(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||O_(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=Ts),o=!0):o=!1,o||yo(r,!0)}function g0(r){for(_n=r.return;_n;)switch(_n.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:_n=_n.return}}function Ua(r){if(r!==_n)return!1;if(!rt)return g0(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")||Cg(r.type,r.memoizedProps)),c=!c),c&&Mt&&yo(r),g0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=B_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=B_(r)}else o===27?(o=Mt,ko(r.type)?(r=kg,kg=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function Ai(){Mt=_n=null,rt=!1}function lm(){var r=go;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),go=null),r}function Sl(r){go===null?go=[r]:go.push(r)}var um=I(null),ki=null,js=null;function vo(r,o,c){W(um,o._currentValue),o._currentValue=c}function As(r){r._currentValue=um.current,H(um)}function fm(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 dm(r,o,c,u){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var v=m.dependencies;if(v!==null){var E=m.child;v=v.firstContext;e:for(;v!==null;){var O=v;v=m;for(var $=0;$<o.length;$++)if(O.context===o[$]){v.lanes|=c,O=v.alternate,O!==null&&(O.lanes|=c),fm(v.return,c,r),u||(E=null);break e}v=O.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),fm(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 $a(r,o,c,u){r=null;for(var m=o,v=!1;m!==null;){if(!v){if((m.flags&524288)!==0)v=!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;rr(m.pendingProps.value,E.value)||(r!==null?r.push(O):r=[O])}}else if(m===de.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Zl):r=[Zl])}m=m.return}r!==null&&dm(o,r,c,u),o.flags|=262144}function Cf(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Oi(r){ki=r,js=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function wn(r){return y0(ki,r)}function Rf(r,o){return ki===null&&Oi(r),y0(r,o)}function y0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},js===null){if(r===null)throw Error(s(308));js=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else js=js.next=o;return c}var vO=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()})}},bO=e.unstable_scheduleCallback,xO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hm(){return{controller:new vO,data:new Map,refCount:0}}function _l(r){r.refCount--,r.refCount===0&&bO(xO,function(){r.controller.abort()})}var wl=null,pm=0,Ba=0,Fa=null;function SO(r,o){if(wl===null){var c=wl=[];pm=0,Ba=yg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return pm++,o.then(v0,v0),o}function v0(){if(--pm===0&&wl!==null){Fa!==null&&(Fa.status="fulfilled");var r=wl;wl=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function _O(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 b0=D.S;D.S=function(r,o){n_=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&SO(r,o),b0!==null&&b0(r,o)};var Mi=I(null);function mm(){var r=Mi.current;return r!==null?r:Nt.pooledCache}function Nf(r,o){o===null?W(Mi,Mi.current):W(Mi,o.pool)}function x0(){var r=mm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),gm=Error(s(474)),jf=Error(s(542)),Af={then:function(){}};function S0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function _0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ts,Ts),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,E0(r),r;default:if(typeof o.status=="string")o.then(Ts,Ts);else{if(r=Nt,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,E0(r),r}throw Pi=o,Ha}}function Ii(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Pi=c,Ha):c}}var Pi=null;function w0(){if(Pi===null)throw Error(s(459));var r=Pi;return Pi=null,r}function E0(r){if(r===Ha||r===jf)throw Error(s(483))}var qa=null,El=0;function kf(r){var o=El;return El+=1,qa===null&&(qa=[]),_0(qa,r,o)}function Tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Of(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 T0(r){function o(Z,F){if(r){var J=Z.deletions;J===null?(Z.deletions=[F],Z.flags|=16):J.push(F)}}function c(Z,F){if(!r)return null;for(;F!==null;)o(Z,F),F=F.sibling;return null}function u(Z){for(var F=new Map;Z!==null;)Z.key!==null?F.set(Z.key,Z):F.set(Z.index,Z),Z=Z.sibling;return F}function m(Z,F){return Z=Rs(Z,F),Z.index=0,Z.sibling=null,Z}function v(Z,F,J){return Z.index=J,r?(J=Z.alternate,J!==null?(J=J.index,J<F?(Z.flags|=67108866,F):J):(Z.flags|=67108866,F)):(Z.flags|=1048576,F)}function E(Z){return r&&Z.alternate===null&&(Z.flags|=67108866),Z}function O(Z,F,J,le){return F===null||F.tag!==6?(F=sm(J,Z.mode,le),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function $(Z,F,J,le){var ze=J.type;return ze===w?ce(Z,F,J.props.children,le,J.key):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===k&&Ii(ze)===F.type)?(F=m(F,J.props),Tl(F,J),F.return=Z,F):(F=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(F,J),F.return=Z,F)}function te(Z,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=om(J,Z.mode,le),F.return=Z,F):(F=m(F,J.children||[]),F.return=Z,F)}function ce(Z,F,J,le,ze){return F===null||F.tag!==7?(F=ji(J,Z.mode,le,ze),F.return=Z,F):(F=m(F,J),F.return=Z,F)}function fe(Z,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=sm(""+F,Z.mode,J),F.return=Z,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=Ef(F.type,F.key,F.props,null,Z.mode,J),Tl(J,F),J.return=Z,J;case S:return F=om(F,Z.mode,J),F.return=Z,F;case k:return F=Ii(F),fe(Z,F,J)}if(ee(F)||z(F))return F=ji(F,Z.mode,J,null),F.return=Z,F;if(typeof F.then=="function")return fe(Z,kf(F),J);if(F.$$typeof===N)return fe(Z,Rf(Z,F),J);Of(Z,F)}return null}function re(Z,F,J,le){var ze=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:O(Z,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(Z,F,J,le):null;case S:return J.key===ze?te(Z,F,J,le):null;case k:return J=Ii(J),re(Z,F,J,le)}if(ee(J)||z(J))return ze!==null?null:ce(Z,F,J,le,null);if(typeof J.then=="function")return re(Z,F,kf(J),le);if(J.$$typeof===N)return re(Z,F,Rf(Z,J),le);Of(Z,J)}return null}function ie(Z,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Z=Z.get(J)||null,O(F,Z,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return Z=Z.get(le.key===null?J:le.key)||null,$(F,Z,le,ze);case S:return Z=Z.get(le.key===null?J:le.key)||null,te(F,Z,le,ze);case k:return le=Ii(le),ie(Z,F,J,le,ze)}if(ee(le)||z(le))return Z=Z.get(J)||null,ce(F,Z,le,ze,null);if(typeof le.then=="function")return ie(Z,F,J,kf(le),ze);if(le.$$typeof===N)return ie(Z,F,J,Rf(F,le),ze);Of(F,le)}return null}function Re(Z,F,J,le){for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null;ke!==null&&Ye<J.length;Ye++){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var dt=re(Z,ke,J[Ye],le);if(dt===null){ke===null&&(ke=nt);break}r&&ke&&dt.alternate===null&&o(Z,ke),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,ke=nt}if(Ye===J.length)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;Ye<J.length;Ye++)ke=fe(Z,J[Ye],le),ke!==null&&(F=v(ke,F,Ye),ft===null?ze=ke:ft.sibling=ke,ft=ke);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);Ye<J.length;Ye++)nt=ie(ke,Z,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&ke.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&ke.forEach(function(Do){return o(Z,Do)}),rt&&Ns(Z,Ye),ze}function $e(Z,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null,dt=J.next();ke!==null&&!dt.done;Ye++,dt=J.next()){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var Do=re(Z,ke,dt.value,le);if(Do===null){ke===null&&(ke=nt);break}r&&ke&&Do.alternate===null&&o(Z,ke),F=v(Do,F,Ye),ft===null?ze=Do:ft.sibling=Do,ft=Do,ke=nt}if(dt.done)return c(Z,ke),rt&&Ns(Z,Ye),ze;if(ke===null){for(;!dt.done;Ye++,dt=J.next())dt=fe(Z,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ns(Z,Ye),ze}for(ke=u(ke);!dt.done;Ye++,dt=J.next())dt=ie(ke,Z,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&ke.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&ke.forEach(function(MM){return o(Z,MM)}),rt&&Ns(Z,Ye),ze}function Ct(Z,F,J,le){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;F!==null;){if(F.key===ze){if(ze=J.type,ze===w){if(F.tag===7){c(Z,F.sibling),le=m(F,J.props.children),le.return=Z,Z=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===k&&Ii(ze)===F.type){c(Z,F.sibling),le=m(F,J.props),Tl(le,J),le.return=Z,Z=le;break e}c(Z,F);break}else o(Z,F);F=F.sibling}J.type===w?(le=ji(J.props.children,Z.mode,le,J.key),le.return=Z,Z=le):(le=Ef(J.type,J.key,J.props,null,Z.mode,le),Tl(le,J),le.return=Z,Z=le)}return E(Z);case S:e:{for(ze=J.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){c(Z,F.sibling),le=m(F,J.children||[]),le.return=Z,Z=le;break e}else{c(Z,F);break}else o(Z,F);F=F.sibling}le=om(J,Z.mode,le),le.return=Z,Z=le}return E(Z);case k:return J=Ii(J),Ct(Z,F,J,le)}if(ee(J))return Re(Z,F,J,le);if(z(J)){if(ze=z(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(Z,F,J,le)}if(typeof J.then=="function")return Ct(Z,F,kf(J),le);if(J.$$typeof===N)return Ct(Z,F,Rf(Z,J),le);Of(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(Z,F.sibling),le=m(F,J),le.return=Z,Z=le):(c(Z,F),le=sm(J,Z.mode,le),le.return=Z,Z=le),E(Z)):c(Z,F)}return function(Z,F,J,le){try{El=0;var ze=Ct(Z,F,J,le);return qa=null,ze}catch(ke){if(ke===Ha||ke===jf)throw ke;var ft=sr(29,ke,null,Z.mode);return ft.lanes=le,ft.return=Z,ft}}}var Di=T0(!0),C0=T0(!1),bo=!1;function ym(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vm(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 xo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function So(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(gt&2)!==0){var m=u.pending;return m===null?o.next=o:(o.next=m.next,m.next=o),u.pending=o,o=wf(r),l0(r,null,c),o}return _f(r,u,o,c),wf(r)}function Cl(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,uo(r,c)}}function bm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?m=v=o:v=v.next=o}else m=v=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,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 xm=!1;function Rl(){if(xm){var r=Fa;if(r!==null)throw r}}function Nl(r,o,c,u){xm=!1;var m=r.updateQueue;bo=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var $=O,te=$.next;$.next=null,E===null?v=te:E.next=te,E=$;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,O=ce.lastBaseUpdate,O!==E&&(O===null?ce.firstBaseUpdate=te:O.next=te,ce.lastBaseUpdate=$))}if(v!==null){var fe=m.baseState;E=0,ce=te=$=null,O=v;do{var re=O.lane&-536870913,ie=re!==O.lane;if(ie?(tt&re)===re:(u&re)===re){re!==0&&re===Ba&&(xm=!0),ce!==null&&(ce=ce.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Re=r,$e=O;re=o;var Ct=c;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){fe=Re.call(Ct,fe,re);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,re=typeof Re=="function"?Re.call(Ct,fe,re):Re,re==null)break e;fe=y({},fe,re);break e;case 2:bo=!0}}re=O.callback,re!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ce===null?(te=ce=ie,$=fe):ce=ce.next=ie,E|=re;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);ce===null&&($=fe),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Co|=E,r.lanes=E,r.memoizedState=fe}}function R0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function N0(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)R0(c[r],o)}var Va=I(null),Mf=I(0);function j0(r,o){r=Us,W(Mf,r),W(Va,o),Us=r|o.baseLanes}function Sm(){W(Mf,Us),W(Va,Va.current)}function _m(){Us=Mf.current,H(Va),H(Mf)}var or=I(null),Or=null;function _o(r){var o=r.alternate;W(Jt,Jt.current&1),W(or,r),Or===null&&(o===null||Va.current!==null||o.memoizedState!==null)&&(Or=r)}function wm(r){W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)}function A0(r){r.tag===22?(W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)):wo()}function wo(){W(Jt,Jt.current),W(or,or.current)}function ir(r){H(or),Or===r&&(Or=null),H(Jt)}var Jt=I(0);function If(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||jg(c)||Ag(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 ks=0,Ze=null,Et=null,rn=null,Pf=!1,Ka=!1,zi=!1,Df=0,jl=0,Ga=null,wO=0;function Kt(){throw Error(s(321))}function Em(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!rr(r[c],o[c]))return!1;return!0}function Tm(r,o,c,u,m,v){return ks=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?hS:$m,zi=!1,v=c(u,m),zi=!1,Ka&&(v=O0(o,c,u,m)),k0(r),v}function k0(r){D.H=Ol;var o=Et!==null&&Et.next!==null;if(ks=0,rn=Et=Ze=null,Pf=!1,jl=0,Ga=null,o)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&Cf(r)&&(sn=!0))}function O0(r,o,c,u){Ze=r;var m=0;do{if(Ka&&(Ga=null),jl=0,Ka=!1,25<=m)throw Error(s(301));if(m+=1,rn=Et=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}D.H=pS,v=o(c,u)}while(Ka);return v}function EO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?Al(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function Cm(){var r=Df!==0;return Df=0,r}function Rm(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Nm(r){if(Pf){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Pf=!1}ks=0,rn=Et=Ze=null,Ka=!1,jl=Df=0,Ga=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=r:rn=rn.next=r,rn}function en(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=rn===null?Ze.memoizedState:rn.next;if(o!==null)rn=o,Et=r;else{if(r===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));Et=r,r={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?Ze.memoizedState=rn=r:rn=rn.next=r}return rn}function zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(r){var o=jl;return jl+=1,Ga===null&&(Ga=[]),r=_0(Ga,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?hS:$m),r}function Lf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Al(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function jm(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=zf(),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]=G;return o.index++,c}function Os(r,o){return typeof o=="function"?o(r):o}function Uf(r){var o=en();return Am(o,Et,r)}function Am(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;var m=r.baseQueue,v=u.pending;if(v!==null){if(m!==null){var E=m.next;m.next=v.next,v.next=E}o.baseQueue=m=v,u.pending=null}if(v=r.baseState,m===null)r.memoizedState=v;else{o=m.next;var O=E=null,$=null,te=o,ce=!1;do{var fe=te.lane&-536870913;if(fe!==te.lane?(tt&fe)===fe:(ks&fe)===fe){var re=te.revertLane;if(re===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),fe===Ba&&(ce=!0);else if((ks&re)===re){te=te.next,re===Ba&&(ce=!0);continue}else fe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=fe,E=v):$=$.next=fe,Ze.lanes|=re,Co|=re;fe=te.action,zi&&c(v,fe),v=te.hasEagerState?te.eagerState:c(v,fe)}else re={lane:fe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(O=$=re,E=v):$=$.next=re,Ze.lanes|=fe,Co|=fe;te=te.next}while(te!==null&&te!==o);if($===null?E=v:$.next=O,!rr(v,r.memoizedState)&&(sn=!0,ce&&(c=Fa,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function km(r){var o=en(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,v=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);rr(v,o.memoizedState)||(sn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,u]}function M0(r,o,c){var u=Ze,m=en(),v=rt;if(v){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!rr((Et||m).memoizedState,c);if(E&&(m.memoizedState=c,sn=!0),m=m.queue,Im(D0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,Za(9,{destroy:void 0},P0.bind(null,u,m,c,o),null),Nt===null)throw Error(s(349));v||(ks&127)!==0||I0(u,o,c)}return c}function I0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=zf(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function P0(r,o,c,u){o.value=c,o.getSnapshot=u,z0(o)&&L0(r)}function D0(r,o,c){return c(function(){z0(o)&&L0(r)})}function z0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!rr(r,c)}catch{return!0}}function L0(r){var o=Ni(r,2);o!==null&&Vn(o,r,2)}function Om(r){var o=kn();if(typeof r=="function"){var c=r;if(r=c(),zi){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:r},o}function U0(r,o,c,u){return r.baseState=c,Am(r,Et,typeof u=="function"?u:Os)}function TO(r,o,c,u,m){if(Ff(r))throw Error(s(485));if(r=o.action,r!==null){var v={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){v.listeners.push(E)}};D.T!==null?c(!0):v.isTransition=!1,u(v),c=o.pending,c===null?(v.next=o.pending=v,$0(o,v)):(v.next=c.next,o.pending=c.next=v)}}function $0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=D.T,E={};D.T=E;try{var O=c(m,u),$=D.S;$!==null&&$(E,O),B0(r,o,O)}catch(te){Mm(r,o,te)}finally{v!==null&&E.types!==null&&(v.types=E.types),D.T=v}}else try{v=c(m,u),B0(r,o,v)}catch(te){Mm(r,o,te)}}function B0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){F0(r,o,u)},function(u){return Mm(r,o,u)}):F0(r,o,c)}function F0(r,o,c){o.status="fulfilled",o.value=c,H0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,$0(r,c)))}function Mm(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,H0(o),o=o.next;while(o!==u)}r.action=null}function H0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function q0(r,o){return o}function V0(r,o){if(rt){var c=Nt.formState;if(c!==null){e:{var u=Ze;if(rt){if(Mt){t:{for(var m=Mt,v=kr;m.nodeType!==8;){if(!v){m=null;break t}if(m=Mr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){Mt=Mr(m.nextSibling),u=m.data==="F!";break e}}yo(u)}u=!1}u&&(o=c[0])}}return c=kn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:q0,lastRenderedState:o},c.queue=u,c=uS.bind(null,Ze,u),u.dispatch=c,u=Om(!1),v=Um.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=TO.bind(null,Ze,m,v,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function K0(r){var o=en();return G0(o,Et,r)}function G0(r,o,c){if(o=Am(r,o,q0)[0],r=Uf(Os)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Al(o)}catch(E){throw E===Ha?jf:E}else u=o;o=en();var m=o.queue,v=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,Za(9,{destroy:void 0},CO.bind(null,m,c),null)),[u,v,r]}function CO(r,o){r.action=o}function Z0(r){var o=en(),c=Et;if(c!==null)return G0(o,c,r);en(),o=o.memoizedState,c=en();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function Za(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=zf(),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 Y0(){return en().memoizedState}function $f(r,o,c,u){var m=kn();Ze.flags|=r,m.memoizedState=Za(1|o,{destroy:void 0},c,u===void 0?null:u)}function Bf(r,o,c,u){var m=en();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&Em(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function X0(r,o){$f(8390656,8,r,o)}function Im(r,o){Bf(2048,8,r,o)}function RO(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=zf(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function Q0(r){var o=en().memoizedState;return RO({ref:o,nextImpl:r}),function(){if((gt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function W0(r,o){return Bf(4,2,r,o)}function J0(r,o){return Bf(4,4,r,o)}function eS(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 tS(r,o,c){c=c!=null?c.concat([r]):null,Bf(4,4,eS.bind(null,o,r),c)}function Pm(){}function nS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Em(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function rS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&Em(o,u[1]))return u[0];if(u=r(),zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Dm(r,o,c){return c===void 0||(ks&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=s_(),Ze.lanes|=r,Co|=r,c)}function sS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Dm(r,c,u),rr(r,o)||(sn=!0),r):(ks&42)===0||(ks&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=s_(),Ze.lanes|=r,Co|=r,o)}function oS(r,o,c,u,m){var v=K.p;K.p=v!==0&&8>v?v:8;var E=D.T,O={};D.T=O,Um(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(O,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=_O($,u);kl(r,o,ce,lr(r))}else kl(r,o,u,lr(r))}catch(fe){kl(r,o,{then:function(){},status:"rejected",reason:fe},lr())}finally{K.p=v,E!==null&&O.types!==null&&(E.types=O.types),D.T=E}}function NO(){}function zm(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=iS(r).queue;oS(r,m,o,q,c===null?NO:function(){return aS(r),c(u)})}function iS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function aS(r){var o=iS(r);o.next===null&&(o=r.alternate.memoizedState),kl(r,o.next.queue,{},lr())}function Lm(){return wn(Zl)}function cS(){return en().memoizedState}function lS(){return en().memoizedState}function jO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=xo(c);var u=So(o,r,c);u!==null&&(Vn(u,o,c),Cl(u,o,c)),o={cache:hm()},r.payload=o;return}o=o.return}}function AO(r,o,c){var u=lr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ff(r)?fS(o,c):(c=nm(r,o,c,u),c!==null&&(Vn(c,r,u),dS(c,o,u)))}function uS(r,o,c){var u=lr();kl(r,o,c,u)}function kl(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ff(r))fS(o,m);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,O=v(E,c);if(m.hasEagerState=!0,m.eagerState=O,rr(O,E))return _f(r,o,m,0),Nt===null&&Sf(),!1}catch{}if(c=nm(r,o,m,u),c!==null)return Vn(c,r,u),dS(c,o,u),!0}return!1}function Um(r,o,c,u){if(u={lane:2,revertLane:yg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ff(r)){if(o)throw Error(s(479))}else o=nm(r,c,u,2),o!==null&&Vn(o,r,2)}function Ff(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function fS(r,o){Ka=Pf=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function dS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,uo(r,c)}}var Ol={readContext:wn,use:Lf,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Ol.useEffectEvent=Kt;var hS={readContext:wn,use:Lf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:X0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,$f(4194308,4,eS.bind(null,o,r),c)},useLayoutEffect:function(r,o){return $f(4194308,4,r,o)},useInsertionEffect:function(r,o){$f(4,2,r,o)},useMemo:function(r,o){var c=kn();o=o===void 0?null:o;var u=r();if(zi){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=kn();if(c!==void 0){var m=c(o);if(zi){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=AO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=Om(r);var o=r.queue,c=uS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Pm,useDeferredValue:function(r,o){var c=kn();return Dm(c,r,o)},useTransition:function(){var r=Om(!1);return r=oS.bind(null,Ze,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=kn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Nt===null)throw Error(s(349));(tt&127)!==0||I0(u,o,c)}m.memoizedState=c;var v={value:c,getSnapshot:o};return m.queue=v,X0(D0.bind(null,u,v,r),[r]),u.flags|=2048,Za(9,{destroy:void 0},P0.bind(null,u,v,c,o),null),c},useId:function(){var r=kn(),o=Nt.identifierPrefix;if(rt){var c=fs,u=us;c=(u&~(1<<32-xt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Df++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=wO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Lm,useFormState:V0,useActionState:V0,useOptimistic:function(r){var o=kn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Um.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:jm,useCacheRefresh:function(){return kn().memoizedState=jO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((gt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},$m={readContext:wn,use:Lf,useCallback:nS,useContext:wn,useEffect:Im,useImperativeHandle:tS,useInsertionEffect:W0,useLayoutEffect:J0,useMemo:rS,useReducer:Uf,useRef:Y0,useState:function(){return Uf(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return sS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Uf(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:M0,useId:cS,useHostTransitionStatus:Lm,useFormState:K0,useActionState:K0,useOptimistic:function(r,o){var c=en();return U0(c,Et,r,o)},useMemoCache:jm,useCacheRefresh:lS};$m.useEffectEvent=Q0;var pS={readContext:wn,use:Lf,useCallback:nS,useContext:wn,useEffect:Im,useImperativeHandle:tS,useInsertionEffect:W0,useLayoutEffect:J0,useMemo:rS,useReducer:km,useRef:Y0,useState:function(){return km(Os)},useDebugValue:Pm,useDeferredValue:function(r,o){var c=en();return Et===null?Dm(c,r,o):sS(c,Et.memoizedState,r,o)},useTransition:function(){var r=km(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:Al(r),o]},useSyncExternalStore:M0,useId:cS,useHostTransitionStatus:Lm,useFormState:Z0,useActionState:Z0,useOptimistic:function(r,o){var c=en();return Et!==null?U0(c,Et,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:jm,useCacheRefresh:lS};pS.useEffectEvent=Q0;function Bm(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:y({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Fm={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=xo(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=So(r,m,u),o!==null&&(Vn(o,r,u),Cl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=xo(c);u.tag=2,o!=null&&(u.callback=o),o=So(r,u,c),o!==null&&(Vn(o,r,c),Cl(o,r,c))}};function mS(r,o,c,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!vl(c,u)||!vl(m,v):!0}function gS(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&&Fm.enqueueReplaceState(o,o.state,null)}function Li(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=y({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function yS(r){xf(r)}function vS(r){console.error(r)}function bS(r){xf(r)}function Hf(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function xS(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 Hm(r,o,c){return c=xo(c),c.tag=3,c.payload={element:null},c.callback=function(){Hf(r,o)},c}function SS(r){return r=xo(r),r.tag=3,r}function _S(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){xS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){xS(o,c,u),typeof m!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function kO(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,m,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?td():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===Af?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),pg(r,u,m)),!1;case 22:return c.flags|=65536,u===Af?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)),pg(r,u,m)),!1}throw Error(s(435,c.tag))}return pg(r,u,m),td(),!1}if(rt)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==cm&&(r=Error(s(422),{cause:u}),Sl(Nr(r,c)))):(u!==cm&&(o=Error(s(423),{cause:u}),Sl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=Hm(r.stateNode,u,m),bm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),$l===null?$l=[v]:$l.push(v),Gt!==4&&(Gt=2),o===null)return!0;u=Nr(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=Hm(c.stateNode,u,r),bm(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=SS(m),_S(m,r,c,u),bm(c,m),!1}c=c.return}while(c!==null);return!1}var qm=Error(s(461)),sn=!1;function En(r,o,c,u){o.child=r===null?C0(o,null,c,u):Di(o,r.child,c,u)}function wS(r,o,c,u,m){c=c.render;var v=o.ref;if("ref"in u){var E={};for(var O in u)O!=="ref"&&(E[O]=u[O])}else E=u;return Oi(o),u=Tm(r,o,c,E,v,m),O=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&O&&im(o),o.flags|=1,En(r,o,u,m),o.child)}function ES(r,o,c,u,m){if(r===null){var v=c.type;return typeof v=="function"&&!rm(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,TS(r,o,v,u,m)):(r=Ef(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Wm(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:vl,c(E,u)&&r.ref===o.ref)return Ms(r,o,m)}return o.flags|=1,r=Rs(v,u),r.ref=o.ref,r.return=o,o.child=r}function TS(r,o,c,u,m){if(r!==null){var v=r.memoizedProps;if(vl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Wm(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Ms(r,o,m)}return Vm(r,o,c,u,m)}function CS(r,o,c,u){var m=u.children,v=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(v=v!==null?v.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&~v}else u=0,o.child=null;return RS(r,o,v,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nf(o,v!==null?v.cachePool:null),v!==null?j0(o,v):Sm(),A0(o);else return u=o.lanes=536870912,RS(r,o,v!==null?v.baseLanes|c:c,c,u)}else v!==null?(Nf(o,v.cachePool),j0(o,v),wo(),o.memoizedState=null):(r!==null&&Nf(o,null),Sm(),wo());return En(r,o,m,c),o.child}function Ml(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function RS(r,o,c,u,m){var v=mm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Nf(o,null),Sm(),A0(o),r!==null&&$a(r,o,u,!0),o.childLanes=m,null}function qf(r,o){return o=Kf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function NS(r,o,c){return Di(o,r.child,null,c),r=qf(o,o.pendingProps),r.flags|=2,ir(o),o.memoizedState=null,r}function OO(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=qf(o,u),o.lanes=536870912,Ml(null,r);if(wm(o),(r=Mt)?(r=$_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=f0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return o.lanes=536870912,null}return qf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(wm(o),m)if(o.flags&256)o.flags&=-257,o=NS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(sn||$a(r,o,c,!1),m=(c&r.childLanes)!==0,sn||m){if(u=Nt,u!==null&&(E=fo(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,Ni(r,E),Vn(u,r,E),qm;td(),o=NS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&p0(o,r),o=qf(o,u),o.flags|=4096;return o}return r=Rs(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function Vf(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 Vm(r,o,c,u,m){return Oi(o),c=Tm(r,o,c,u,void 0,m),u=Cm(),r!==null&&!sn?(Rm(r,o,m),Ms(r,o,m)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,m),o.child)}function jS(r,o,c,u,m,v){return Oi(o),o.updateQueue=null,c=O0(o,u,c,m),k0(r),u=Cm(),r!==null&&!sn?(Rm(r,o,v),Ms(r,o,v)):(rt&&u&&im(o),o.flags|=1,En(r,o,c,v),o.child)}function AS(r,o,c,u,m){if(Oi(o),o.stateNode===null){var v=Da,E=c.contextType;typeof E=="object"&&E!==null&&(v=wn(E)),v=new c(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Fm,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},ym(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Bm(o,c,E,u),v.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&Fm.enqueueReplaceState(v,v.state,null),Nl(o,u,v,m),Rl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var O=o.memoizedProps,$=Li(c,O);v.props=$;var te=v.context,ce=c.contextType;E=Da,typeof ce=="object"&&ce!==null&&(E=wn(ce));var fe=c.getDerivedStateFromProps;ce=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(O||te!==E)&&gS(o,v,u,E),bo=!1;var re=o.memoizedState;v.state=re,Nl(o,u,v,m),Rl(),te=o.memoizedState,O||re!==te||bo?(typeof fe=="function"&&(Bm(o,c,fe,u),te=o.memoizedState),($=bo||mS(o,c,$,u,re,te,E))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=te),v.props=u,v.state=te,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,vm(r,o),E=o.memoizedProps,ce=Li(c,E),v.props=ce,fe=o.pendingProps,re=v.context,te=c.contextType,$=Da,typeof te=="object"&&te!==null&&($=wn(te)),O=c.getDerivedStateFromProps,(te=typeof O=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==fe||re!==$)&&gS(o,v,u,$),bo=!1,re=o.memoizedState,v.state=re,Nl(o,u,v,m),Rl();var ie=o.memoizedState;E!==fe||re!==ie||bo||r!==null&&r.dependencies!==null&&Cf(r.dependencies)?(typeof O=="function"&&(Bm(o,c,O,u),ie=o.memoizedState),(ce=bo||mS(o,c,ce,u,re,ie,$)||r!==null&&r.dependencies!==null&&Cf(r.dependencies))?(te||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ie,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ie,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&re===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,Vf(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=Di(o,r.child,null,m),o.child=Di(o,null,c,m)):En(r,o,c,m),o.memoizedState=v.state,r=o.child):r=Ms(r,o,m),r}function kS(r,o,c,u){return Ai(),o.flags|=256,En(r,o,c,u),o.child}var Km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gm(r){return{baseLanes:r,cachePool:x0()}}function Zm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=cr),r}function OS(r,o,c){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Jt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?_o(o):wo(),(r=Mt)?(r=$_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:mo!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=f0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw yo(o);return Ag(r)?o.lanes=32:o.lanes=536870912,null}var O=u.children;return u=u.fallback,m?(wo(),m=o.mode,O=Kf({mode:"hidden",children:O},m),u=ji(u,m,c,null),O.return=o,u.return=o,O.sibling=u,o.child=O,u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(null,u)):(_o(o),Ym(o,O))}var $=r.memoizedState;if($!==null&&(O=$.dehydrated,O!==null)){if(v)o.flags&256?(_o(o),o.flags&=-257,o=Xm(r,o,c)):o.memoizedState!==null?(wo(),o.child=r.child,o.flags|=128,o=null):(wo(),O=u.fallback,m=o.mode,u=Kf({mode:"visible",children:u.children},m),O=ji(O,m,c,null),O.flags|=2,u.return=o,O.return=o,u.sibling=O,o.child=u,Di(o,r.child,null,c),u=o.child,u.memoizedState=Gm(c),u.childLanes=Zm(r,E,c),o.memoizedState=Km,o=Ml(null,u));else if(_o(o),Ag(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,Sl({value:u,source:null,stack:null}),o=Xm(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=fo(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,Ni(r,u),Vn(E,r,u),qm;jg(O)||td(),o=Xm(r,o,c)}else jg(O)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(O.nextSibling),_n=o,rt=!0,go=null,kr=!1,r!==null&&p0(o,r),o=Ym(o,u.children),o.flags|=4096);return o}return m?(wo(),O=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Rs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?O=Rs(te,O):(O=ji(O,m,c,null),O.flags|=2),O.return=o,u.return=o,u.sibling=O,o.child=u,Ml(null,u),u=o.child,O=r.child.memoizedState,O===null?O=Gm(c):(m=O.cachePool,m!==null?($=nn._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=x0(),O={baseLanes:O.baseLanes|c,cachePool:m}),u.memoizedState=O,u.childLanes=Zm(r,E,c),o.memoizedState=Km,Ml(r.child,u)):(_o(o),c=r.child,r=c.sibling,c=Rs(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 Ym(r,o){return o=Kf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Kf(r,o){return r=sr(22,r,null,o),r.lanes=0,r}function Xm(r,o,c){return Di(o,r.child,null,c),r=Ym(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function MS(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),fm(r.return,o,c)}function Qm(r,o,c,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=v)}function IS(r,o,c){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Jt.current,O=(E&2)!==0;if(O?(E=E&1|2,o.flags|=128):E&=1,W(Jt,E),En(r,o,u,c),u=rt?xl:0,!O&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&MS(r,c,o);else if(r.tag===19)MS(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&&If(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),Qm(o,!1,m,c,v,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&&If(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Qm(o,!0,c,null,v,u);break;case"together":Qm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Ms(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Co|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(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=Rs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Rs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Wm(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Cf(r)))}function MO(r,o,c){switch(o.tag){case 3:xe(o,o.stateNode.containerInfo),vo(o,nn,r.memoizedState.cache),Ai();break;case 27:case 5:Me(o);break;case 4:xe(o,o.stateNode.containerInfo);break;case 10:vo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,wm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(_o(o),o.flags|=128,null):(c&o.child.childLanes)!==0?OS(r,o,c):(_o(o),r=Ms(r,o,c),r!==null?r.sibling:null);_o(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||($a(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return IS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Jt,Jt.current),u)break;return null;case 22:return o.lanes=0,CS(r,o,c,o.pendingProps);case 24:vo(o,nn,r.memoizedState.cache)}return Ms(r,o,c)}function PS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Wm(r,c)&&(o.flags&128)===0)return sn=!1,MO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&h0(o,xl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Ii(o.elementType),o.type=r,typeof r=="function")rm(r)?(u=Li(r,u),o.tag=1,o=AS(null,o,r,u,c)):(o.tag=0,o=Vm(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=wS(null,o,r,u,c);break e}else if(m===j){o.tag=14,o=ES(null,o,r,u,c);break e}}throw o=Y(r)||r,Error(s(306,o,""))}}return o;case 0:return Vm(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=Li(u,o.pendingProps),AS(r,o,u,m,c);case 3:e:{if(xe(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,vm(r,o),Nl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,vo(o,nn,u),u!==v.cache&&dm(o,[nn],c,!0),Rl(),u=E.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=kS(r,o,u,c);break e}else if(u!==m){m=Nr(Error(s(424)),o),Sl(m),o=kS(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,Mt=Mr(r.firstChild),_n=o,rt=!0,go=null,kr=!0,c=C0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ai(),u===m){o=Ms(r,o,c);break e}En(r,o,u,c)}o=o.child}return o;case 26:return Vf(r,o),r===null?(c=K_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=cd(se.current).createElement(c),u[Sn]=o,u[Un]=r,Tn(u,c,r),bn(u),o.stateNode=u):o.memoizedState=K_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Me(o),r===null&&rt&&(u=o.stateNode=H_(o.type,o.pendingProps,se.current),_n=o,kr=!0,m=Mt,ko(o.type)?(kg=m,Mt=Mr(u.firstChild)):Mt=m),En(r,o,o.pendingProps.children,c),Vf(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=Mt)&&(u=lM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||yo(o)),Me(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,Cg(m,v)?u=null:E!==null&&Cg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=Tm(r,o,EO,null,null,c),Zl._currentValue=m),Vf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=uM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||yo(o)),null;case 13:return OS(r,o,c);case 4:return xe(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=Di(o,null,u,c):En(r,o,u,c),o.child;case 11:return wS(r,o,o.type,o.pendingProps,c);case 7:return En(r,o,o.pendingProps,c),o.child;case 8:return En(r,o,o.pendingProps.children,c),o.child;case 12:return En(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,vo(o,o.type,u.value),En(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Oi(o),m=wn(m),u=u(m),o.flags|=1,En(r,o,u,c),o.child;case 14:return ES(r,o,o.type,o.pendingProps,c);case 15:return TS(r,o,o.type,o.pendingProps,c);case 19:return IS(r,o,c);case 31:return OO(r,o,c);case 22:return CS(r,o,c,o.pendingProps);case 24:return Oi(o),u=wn(nn),r===null?(m=mm(),m===null&&(m=Nt,v=hm(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},ym(o),vo(o,nn,m)):((r.lanes&c)!==0&&(vm(r,o),Nl(o,null,null,c),Rl()),m=r.memoizedState,v=o.memoizedState,m.parent!==u?(m={parent:u,cache:u},o.memoizedState=m,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=m),vo(o,nn,u)):(u=v.cache,vo(o,nn,u),u!==m.cache&&dm(o,[nn],c,!0))),En(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Is(r){r.flags|=4}function Jm(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(c_())r.flags|=8192;else throw Pi=Af,gm}else r.flags&=-16777217}function DS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Q_(o))if(c_())r.flags|=8192;else throw Pi=Af,gm}function Gf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?_i():536870912,r.lanes|=o,Wa|=o)}function Il(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 It(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 IO(r,o,c){var u=o.pendingProps;switch(am(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),As(nn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Is(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,lm())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Is(o),v!==null?(It(o),DS(o,v)):(It(o),Jm(o,m,null,u,c))):v?v!==r.memoizedState?(Is(o),It(o),DS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Is(o),It(o),Jm(o,m,r,u,c)),null;case 27:if(_e(o),c=se.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=X.current,Ua(o)?m0(o):(r=H_(m,u,c),o.stateNode=r,Is(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=X.current,Ua(o))m0(o);else{var E=cd(se.current);switch(v){case 1:v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":v=E.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?E.createElement(m,{is:u.is}):E.createElement(m)}}v[Sn]=o,v[Un]=u;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)v.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=v;e:switch(Tn(v,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&&Is(o)}}return It(o),Jm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=se.current,Ua(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=_n,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[Sn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||O_(r.nodeValue,c)),r||yo(o,!0)}else r=cd(r).createTextNode(u),r[Sn]=o,o.stateNode=r}return It(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Ua(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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else c=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(ir(o),o):(ir(o),null);if((o.flags&128)!==0)throw Error(s(558))}return It(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Ua(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[Sn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=lm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(ir(o),o):(ir(o),null)}return ir(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),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),Gf(o,o.updateQueue),It(o),null);case 4:return he(),r===null&&Sg(o.stateNode.containerInfo),It(o),null;case 10:return As(o.type),It(o),null;case 19:if(H(Jt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Il(u,!1);else{if(Gt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=If(r),v!==null){for(o.flags|=128,Il(u,!1),r=v.updateQueue,o.updateQueue=r,Gf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)u0(c,r),c=c.sibling;return W(Jt,Jt.current&1|2),rt&&Ns(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Wf&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304)}else{if(!m)if(r=If(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Gf(o,r),Il(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*Be()-u.renderingStartTime>Wf&&c!==536870912&&(o.flags|=128,m=!0,Il(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Be(),r.sibling=null,c=Jt.current,W(Jt,m?c&1|2:c&1),rt&&Ns(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),_m(),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&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Gf(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&&H(Mi),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),As(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function PO(r,o){switch(am(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return As(nn),he(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(ir(o),o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(ir(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return H(Jt),null;case 4:return he(),null;case 10:return As(o.type),null;case 22:case 23:return ir(o),_m(),r!==null&&H(Mi),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return As(nn),null;case 25:return null;default:return null}}function zS(r,o){switch(am(o),o.tag){case 3:As(nn),he();break;case 26:case 27:case 5:_e(o);break;case 4:he();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:As(o.type);break;case 22:case 23:ir(o),_m(),r!==null&&H(Mi);break;case 24:As(nn)}}function Pl(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 v=c.create,E=c.inst;u=v(),E.destroy=u}c=c.next}while(c!==m)}}catch(O){_t(o,o.return,O)}}function Eo(r,o,c){try{var u=o.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;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,te=O;try{te()}catch(ce){_t(m,$,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(o,o.return,ce)}}function LS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{N0(o,c)}catch(u){_t(r,r.return,u)}}}function US(r,o,c){c.props=Li(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){_t(r,o,u)}}function Dl(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){_t(r,o,m)}}function ds(r,o){var c=r.ref,u=r.refCleanup;if(c!==null)if(typeof u=="function")try{u()}catch(m){_t(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){_t(r,o,m)}else c.current=null}function $S(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){_t(r,r.return,m)}}function eg(r,o,c){try{var u=r.stateNode;rM(u,r.type,c,o),u[Un]=o}catch(m){_t(r,r.return,m)}}function BS(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ko(r.type)||r.tag===4}function tg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||BS(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&&ko(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 ng(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=Ts));else if(u!==4&&(u===27&&ko(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(ng(r,o,c),r=r.sibling;r!==null;)ng(r,o,c),r=r.sibling}function Zf(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&&ko(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Zf(r,o,c),r=r.sibling;r!==null;)Zf(r,o,c),r=r.sibling}function FS(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Tn(o,u,c),o[Sn]=r,o[Un]=c}catch(v){_t(r,r.return,v)}}var Ps=!1,on=!1,rg=!1,HS=typeof WeakSet=="function"?WeakSet:Set,xn=null;function DO(r,o){if(r=r.containerInfo,Eg=md,r=t0(r),Xp(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,v=u.focusNode;u=u.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,O=-1,$=-1,te=0,ce=0,fe=r,re=null;t:for(;;){for(var ie;fe!==c||m!==0&&fe.nodeType!==3||(O=E+m),fe!==v||u!==0&&fe.nodeType!==3||($=E+u),fe.nodeType===3&&(E+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)re=fe,fe=ie;for(;;){if(fe===r)break t;if(re===c&&++te===m&&(O=E),re===v&&++ce===u&&($=E),(ie=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=ie}c=O===-1||$===-1?null:{start:O,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(Tg={focusedElem:r,selectionRange:c},md=!1,xn=o;xn!==null;)if(o=xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,xn=r;else for(;xn!==null;){switch(o=xn,v=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&&v!==null){r=void 0,c=o,m=v.memoizedProps,v=v.memoizedState,u=c.stateNode;try{var Re=Li(c.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch($e){_t(c,c.return,$e)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)Ng(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ng(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,xn=r;break}xn=o.return}}function qS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:zs(r,c),u&4&&Pl(5,c);break;case 1:if(zs(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(c,c.return,E)}else{var m=Li(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(c,c.return,E)}}u&64&&LS(c),u&512&&Dl(c,c.return);break;case 3:if(zs(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{N0(r,o)}catch(E){_t(c,c.return,E)}}break;case 27:o===null&&u&4&&FS(c);case 26:case 5:zs(r,c),o===null&&u&4&&$S(c),u&512&&Dl(c,c.return);break;case 12:zs(r,c);break;case 31:zs(r,c),u&4&&GS(r,c);break;case 13:zs(r,c),u&4&&ZS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=VO.bind(null,c),fM(r,c))));break;case 22:if(u=c.memoizedState!==null||Ps,!u){o=o!==null&&o.memoizedState!==null||on,m=Ps;var v=on;Ps=u,(on=o)&&!v?Ls(r,c,(c.subtreeFlags&8772)!==0):zs(r,c),Ps=m,on=v}break;case 30:break;default:zs(r,c)}}function VS(r){var o=r.alternate;o!==null&&(r.alternate=null,VS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Mp(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 Ut=null,Bn=!1;function Ds(r,o,c){for(c=c.child;c!==null;)KS(r,o,c),c=c.sibling}function KS(r,o,c){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Er,c)}catch{}switch(c.tag){case 26:on||ds(c,o),Ds(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||ds(c,o);var u=Ut,m=Bn;ko(c.type)&&(Ut=c.stateNode,Bn=!1),Ds(r,o,c),Vl(c.stateNode),Ut=u,Bn=m;break;case 5:on||ds(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ds(r,o,c),Ut=u,Bn=m,Ut!==null)if(Bn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(c.stateNode)}catch(v){_t(c,o,v)}else try{Ut.removeChild(c.stateNode)}catch(v){_t(c,o,v)}break;case 18:Ut!==null&&(Bn?(r=Ut,L_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),ic(r)):L_(Ut,c.stateNode));break;case 4:u=Ut,m=Bn,Ut=c.stateNode.containerInfo,Bn=!0,Ds(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:Eo(2,c,o),on||Eo(4,c,o),Ds(r,o,c);break;case 1:on||(ds(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&US(c,o,u)),Ds(r,o,c);break;case 21:Ds(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ds(r,o,c),on=u;break;default:Ds(r,o,c)}}function GS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ic(r)}catch(c){_t(o,o.return,c)}}}function ZS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ic(r)}catch(c){_t(o,o.return,c)}}function zO(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new HS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new HS),o;default:throw Error(s(435,r.tag))}}function Yf(r,o){var c=zO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=KO.bind(null,r,u);u.then(m,m)}})}function Fn(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],v=r,E=o,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(ko(O.type)){Ut=O.stateNode,Bn=!1;break e}break;case 5:Ut=O.stateNode,Bn=!1;break e;case 3:case 4:Ut=O.stateNode.containerInfo,Bn=!0;break e}O=O.return}if(Ut===null)throw Error(s(160));KS(v,E,m),Ut=null,Bn=!1,v=m.alternate,v!==null&&(v.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)YS(o,r),o=o.sibling}var Wr=null;function YS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Fn(o,r),Hn(r),u&4&&(Eo(3,r,r.return),Pl(3,r),Eo(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&64&&Ps&&(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=Wr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&4){var v=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":v=m.getElementsByTagName("title")[0],(!v||v[ll]||v[Sn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),Tn(v,u,c),v[Sn]=r,bn(v),u=v;break e;case"link":var E=Y_("link","href",m).get(u+(c.href||""));if(E){for(var O=0;O<E.length;O++)if(v=E[O],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;case"meta":if(E=Y_("meta","content",m).get(u+(c.content||""))){for(O=0;O<E.length;O++)if(v=E[O],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(O,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[Sn]=r,bn(v),u=v}r.stateNode=u}else X_(m,r.type,r.stateNode);else r.stateNode=Z_(m,u,r.memoizedProps);else v!==u?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,u===null?X_(m,r.type,r.stateNode):Z_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&eg(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),c!==null&&u&4&&eg(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,eg(r,m,c!==null?c.memoizedProps:m)),u&1024&&(rg=!0);break;case 6:if(Fn(o,r),Hn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(fd=null,m=Wr,Wr=ld(o.containerInfo),Fn(o,r),Wr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Re){_t(r,r.return,Re)}rg&&(rg=!1,XS(r));break;case 4:u=Wr,Wr=ld(r.stateNode.containerInfo),Fn(o,r),Hn(r),Wr=u;break;case 12:Fn(o,r),Hn(r);break;case 31:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 13:Fn(o,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Qf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,te=Ps,ce=on;if(Ps=te||m,on=ce||$,Fn(o,r),on=ce,Ps=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Ps||on||Ui(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=$.stateNode;var fe=$.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;O.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(c===null){$=o;try{var ie=$.stateNode;m?U_(ie,!0):U_($.stateNode,!1)}catch(Re){_t($,$.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,Yf(r,c))));break;case 19:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Yf(r,u)));break;case 30:break;case 21:break;default:Fn(o,r),Hn(r)}}function Hn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if(BS(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,v=tg(r);Zf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var O=tg(r);Zf(r,O,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=tg(r);ng(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function XS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;XS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function zs(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)qS(r,o.alternate,o),o=o.sibling}function Ui(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Eo(4,o,o.return),Ui(o);break;case 1:ds(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&US(o,o.return,c),Ui(o);break;case 27:Vl(o.stateNode);case 26:case 5:ds(o,o.return),Ui(o);break;case 22:o.memoizedState===null&&Ui(o);break;case 30:Ui(o);break;default:Ui(o)}r=r.sibling}}function Ls(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,m=r,v=o,E=v.flags;switch(v.tag){case 0:case 11:case 15:Ls(m,v,c),Pl(4,v);break;case 1:if(Ls(m,v,c),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){_t(u,u.return,te)}if(u=v,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++)R0($[m],O)}catch(te){_t(u,u.return,te)}}c&&E&64&&LS(v),Dl(v,v.return);break;case 27:FS(v);case 26:case 5:Ls(m,v,c),c&&u===null&&E&4&&$S(v),Dl(v,v.return);break;case 12:Ls(m,v,c);break;case 31:Ls(m,v,c),c&&E&4&&GS(m,v);break;case 13:Ls(m,v,c),c&&E&4&&ZS(m,v);break;case 22:v.memoizedState===null&&Ls(m,v,c),Dl(v,v.return);break;case 30:break;default:Ls(m,v,c)}o=o.sibling}}function sg(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&&_l(c))}function og(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&_l(r))}function Jr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)QS(r,o,c,u),o=o.sibling}function QS(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o,c,u),m&2048&&Pl(9,o);break;case 1:Jr(r,o,c,u);break;case 3:Jr(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&&_l(r)));break;case 12:if(m&2048){Jr(r,o,c,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,O=v.onPostCommit;typeof O=="function"&&O(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Jr(r,o,c,u);break;case 31:Jr(r,o,c,u);break;case 13:Jr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Jr(r,o,c,u):zl(r,o):v._visibility&2?Jr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&sg(E,o);break;case 24:Jr(r,o,c,u),m&2048&&og(o.alternate,o);break;default:Jr(r,o,c,u)}}function Ya(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,O=c,$=u,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ya(v,E,O,$,m),Pl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,O,$,m):zl(v,E):(ce._visibility|=2,Ya(v,E,O,$,m)),m&&te&2048&&sg(E.alternate,E);break;case 24:Ya(v,E,O,$,m),m&&te&2048&&og(E.alternate,E);break;default:Ya(v,E,O,$,m)}o=o.sibling}}function zl(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:zl(c,u),m&2048&&sg(u.alternate,u);break;case 24:zl(c,u),m&2048&&og(u.alternate,u);break;default:zl(c,u)}o=o.sibling}}var Ll=8192;function Xa(r,o,c){if(r.subtreeFlags&Ll)for(r=r.child;r!==null;)WS(r,o,c),r=r.sibling}function WS(r,o,c){switch(r.tag){case 26:Xa(r,o,c),r.flags&Ll&&r.memoizedState!==null&&wM(c,Wr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Wr;Wr=ld(r.stateNode.containerInfo),Xa(r,o,c),Wr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Ll,Ll=16777216,Xa(r,o,c),Ll=u):Xa(r,o,c));break;default:Xa(r,o,c)}}function JS(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 Ul(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];xn=u,t_(u,r)}JS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)e_(r),r=r.sibling}function e_(r){switch(r.tag){case 0:case 11:case 15:Ul(r),r.flags&2048&&Eo(9,r,r.return);break;case 3:Ul(r);break;case 12:Ul(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Xf(r)):Ul(r);break;default:Ul(r)}}function Xf(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];xn=u,t_(u,r)}JS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Eo(8,o,o.return),Xf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Xf(o));break;default:Xf(o)}r=r.sibling}}function t_(r,o){for(;xn!==null;){var c=xn;switch(c.tag){case 0:case 11:case 15:Eo(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:_l(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,xn=u;else e:for(c=r;xn!==null;){u=xn;var m=u.sibling,v=u.return;if(VS(u),u===c){xn=null;break e}if(m!==null){m.return=v,xn=m;break e}xn=v}}}var LO={getCacheForType:function(r){var o=wn(nn),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return wn(nn).controller.signal}},UO=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,ar=null,To=!1,Qa=!1,ig=!1,Us=0,Gt=0,Co=0,$i=0,ag=0,cr=0,Wa=0,$l=null,qn=null,cg=!1,Qf=0,n_=0,Wf=1/0,Jf=null,Ro=null,fn=0,No=null,Ja=null,$s=0,lg=0,ug=null,r_=null,Bl=0,fg=null;function lr(){return(gt&2)!==0&&tt!==0?tt&-tt:D.T!==null?yg():cf()}function s_(){if(cr===0)if((tt&536870912)===0||rt){var r=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),cr=r}else cr=536870912;return r=or.current,r!==null&&(r.flags|=32),cr}function Vn(r,o,c){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(ec(r,0),jo(r,tt,cr,!1)),ws(r,c),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&($i|=c),Gt===4&&jo(r,tt,cr,!1)),hs(r))}function o_(r,o,c){if((gt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||cs(r,o),m=u?FO(r,o):hg(r,o,!0),v=u;do{if(m===0){Qa&&!u&&jo(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!$O(c)){m=hg(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)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=$l;var $=O.current.memoizedState.isDehydrated;if($&&(ec(O,E).flags|=256),E=hg(O,E,!1),E!==2){if(ig&&!$){O.errorRecoveryDisabledLanes|=v,$i|=v,m=4;break e}v=qn,qn=m,v!==null&&(qn===null?qn=v:qn.push.apply(qn,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){ec(r,0),jo(r,o,0,!0);break}e:{switch(u=r,v=m,v){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:jo(u,o,cr,!To);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Qf+300-Be(),10<m)){if(jo(u,o,cr,!To),as(u,0,!0)!==0)break e;$s=o,u.timeoutHandle=D_(i_.bind(null,u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,"Throttled",-0,0),m);break e}i_(u,c,qn,Jf,cg,o,cr,$i,Wa,To,v,null,-0,0)}}break}while(!0);hs(r)}function i_(r,o,c,u,m,v,E,O,$,te,ce,fe,re,ie){if(r.timeoutHandle=-1,fe=o.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},WS(o,v,fe);var Re=(v&62914560)===v?Qf-Be():(v&4194048)===v?n_-Be():0;if(Re=EM(fe,Re),Re!==null){$s=v,r.cancelPendingCommit=Re(p_.bind(null,r,o,v,c,u,m,E,O,$,ce,fe,null,re,ie)),jo(r,v,E,!te);return}}p_(r,o,v,c,u,m,E,O,$)}function $O(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],v=m.getSnapshot;m=m.value;try{if(!rr(v(),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 jo(r,o,c,u){o&=~ag,o&=~$i,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var m=o;0<m;){var v=31-xt(m),E=1<<v;u[v]=-1,m&=~E}c!==0&&ls(r,c,o)}function ed(){return(gt&6)===0?(Fl(0),!1):!0}function dg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,js=ki=null,Nm(r),qa=null,El=0,r=Je;for(;r!==null;)zS(r.alternate,r),r=r.return;Je=null}}function ec(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,iM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),$s=0,dg(),Nt=r,Je=c=Rs(r.current,null),tt=o,St=0,ar=null,To=!1,Qa=cs(r,o),ig=!1,Wa=cr=ag=$i=Co=Gt=0,qn=$l=null,cg=!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-xt(u),v=1<<m;o|=r[m],u&=~v}return Us=o,Sf(),c}function a_(r,o){Ze=null,D.H=Ol,o===Ha||o===jf?(o=w0(),St=3):o===gm?(o=w0(),St=4):St=o===qm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Gt=1,Hf(r,Nr(o,r.current)))}function c_(){var r=or.current;return r===null?!0:(tt&4194048)===tt?Or===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Or:!1}function l_(){var r=D.H;return D.H=Ol,r===null?Ol:r}function u_(){var r=D.A;return D.A=LO,r}function td(){Gt=4,To||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Co&134217727)===0&&($i&134217727)===0||Nt===null||jo(Nt,tt,cr,!1)}function hg(r,o,c){var u=gt;gt|=2;var m=l_(),v=u_();(Nt!==r||tt!==o)&&(Jf=null,ec(r,o)),o=!1;var E=Gt;e:do try{if(St!==0&&Je!==null){var O=Je,$=ar;switch(St){case 8:dg(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=St;if(St=0,ar=null,tc(r,O,$,te),c&&Qa){E=0;break e}break;default:te=St,St=0,ar=null,tc(r,O,$,te)}}BO(),E=Gt;break}catch(ce){a_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,js=ki=null,gt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,Sf()),E}function BO(){for(;Je!==null;)f_(Je)}function FO(r,o){var c=gt;gt|=2;var u=l_(),m=u_();Nt!==r||tt!==o?(Jf=null,Wf=Be()+500,ec(r,o)):Qa=cs(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=ar;t:switch(St){case 1:St=0,ar=null,tc(r,o,v,1);break;case 2:case 9:if(S0(v)){St=0,ar=null,d_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),hs(r)},v.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:S0(v)?(St=0,ar=null,d_(o)):(St=0,ar=null,tc(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var O=Je;if(E?Q_(E):O.stateNode.complete){St=0,ar=null;var $=O.sibling;if($!==null)Je=$;else{var te=O.return;te!==null?(Je=te,nd(te)):Je=null}break t}}St=0,ar=null,tc(r,o,v,5);break;case 6:St=0,ar=null,tc(r,o,v,6);break;case 8:dg(),Gt=6;break e;default:throw Error(s(462))}}HO();break}catch(ce){a_(r,ce)}while(!0);return js=ki=null,D.H=u,D.A=m,gt=c,Je!==null?0:(Nt=null,tt=0,Sf(),Gt)}function HO(){for(;Je!==null&&!Ve();)f_(Je)}function f_(r){var o=PS(r.alternate,r,Us);r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function d_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=jS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=jS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Nm(o);default:zS(c,o),o=Je=u0(o,Us),o=PS(c,o,Us)}r.memoizedProps=r.pendingProps,o===null?nd(r):Je=o}function tc(r,o,c,u){js=ki=null,Nm(o),qa=null,El=0;var m=o.return;try{if(kO(r,m,o,c,tt)){Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Gt=1,Hf(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(To=r=!0,(u===2||u===9||u===3||u===6)&&(u=or.current,u!==null&&u.tag===13&&(u.flags|=16384))),h_(o,r)):nd(o)}function nd(r){var o=r;do{if((o.flags&32768)!==0){h_(o,To);return}r=o.return;var c=IO(o.alternate,o,Us);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Gt===0&&(Gt=5)}function h_(r,o){do{var c=PO(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);Gt=6,Je=null}function p_(r,o,c,u,m,v,E,O,$){r.cancelPendingCommit=null;do rd();while(fn!==0);if((gt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=tm,tr(r,c,v,E,O,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,No=r,$s=c,lg=v,ug=m,r_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,GO(Te,function(){return b_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=K.p,K.p=2,E=gt,gt|=4;try{DO(r,o,c)}finally{gt=E,K.p=m,D.T=u}}fn=1,m_(),g_(),y_()}}function m_(){if(fn===1){fn=0;var r=No,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{YS(o,r);var v=Tg,E=t0(r.containerInfo),O=v.focusedElem,$=v.selectionRange;if(E!==O&&O&&O.ownerDocument&&e0(O.ownerDocument.documentElement,O)){if($!==null&&Xp(O)){var te=$.start,ce=$.end;if(ce===void 0&&(ce=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(ce,O.value.length);else{var fe=O.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),Re=O.textContent.length,$e=Math.min($.start,Re),Ct=$.end===void 0?$e:Math.min($.end,Re);!ie.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var Z=Jx(O,$e),F=Jx(O,Ct);if(Z&&F&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==F.node||ie.focusOffset!==F.offset)){var J=fe.createRange();J.setStart(Z.node,Z.offset),ie.removeAllRanges(),$e>Ct?(ie.addRange(J),ie.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),ie.addRange(J))}}}}for(fe=[],ie=O;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<fe.length;O++){var le=fe[O];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}md=!!Eg,Tg=Eg=null}finally{gt=m,K.p=u,D.T=c}}r.current=o,fn=2}}function g_(){if(fn===2){fn=0;var r=No,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=K.p;K.p=2;var m=gt;gt|=4;try{qS(r,o.alternate,o)}finally{gt=m,K.p=u,D.T=c}}fn=3}}function y_(){if(fn===4||fn===3){fn=0,Xe();var r=No,o=Ja,c=$s,u=r_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=No=null,v_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(Ro=null),cl(c),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Er,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=D.T,m=K.p,K.p=2,D.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var O=u[E];v(O.value,{componentStack:O.stack})}}finally{D.T=o,K.p=m}}($s&3)!==0&&rd(),hs(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===fg?Bl++:(Bl=0,fg=r):Bl=0,Fl(0)}}function v_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,_l(o)))}function rd(){return m_(),g_(),y_(),b_()}function b_(){if(fn!==5)return!1;var r=No,o=lg;lg=0;var c=cl($s),u=D.T,m=K.p;try{K.p=32>c?32:c,D.T=null,c=ug,ug=null;var v=No,E=$s;if(fn=0,Ja=No=null,$s=0,(gt&6)!==0)throw Error(s(331));var O=gt;if(gt|=4,e_(v.current),QS(v,v.current,E,c),gt=O,Fl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{K.p=m,D.T=u,v_(r,o)}}function x_(r,o,c){o=Nr(c,o),o=Hm(r.stateNode,o,2),r=So(r,o,2),r!==null&&(ws(r,2),hs(r))}function _t(r,o,c){if(r.tag===3)x_(r,r,c);else for(;o!==null;){if(o.tag===3){x_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ro===null||!Ro.has(u))){r=Nr(c,r),c=SS(2),u=So(o,c,2),u!==null&&(_S(c,u,o,r),ws(u,2),hs(u));break}}o=o.return}}function pg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new UO;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)||(ig=!0,m.add(c),r=qO.bind(null,r,o,c),o.then(r,r))}function qO(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Nt===r&&(tt&c)===c&&(Gt===4||Gt===3&&(tt&62914560)===tt&&300>Be()-Qf?(gt&2)===0&&ec(r,0):ag|=c,Wa===tt&&(Wa=0)),hs(r)}function S_(r,o){o===0&&(o=_i()),r=Ni(r,o),r!==null&&(ws(r,o),hs(r))}function VO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),S_(r,c)}function KO(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),S_(r,c)}function GO(r,o){return Ie(r,o)}var sd=null,nc=null,mg=!1,od=!1,gg=!1,Ao=0;function hs(r){r!==nc&&r.next===null&&(nc===null?sd=nc=r:nc=nc.next=r),od=!0,mg||(mg=!0,YO())}function Fl(r,o){if(!gg&&od){gg=!0;do for(var c=!1,u=sd;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,O=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~O),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,T_(u,v))}else v=tt,v=as(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||cs(u,v)||(c=!0,T_(u,v));u=u.next}while(c);gg=!1}}function ZO(){__()}function __(){od=mg=!1;var r=0;Ao!==0&&oM()&&(r=Ao);for(var o=Be(),c=null,u=sd;u!==null;){var m=u.next,v=w_(u,o);v===0?(u.next=null,c===null?sd=m:c.next=m,m===null&&(nc=c)):(c=u,(r!==0||(v&3)!==0)&&(od=!0)),u=m}fn!==0&&fn!==5||Fl(r),Ao!==0&&(Ao=0)}function w_(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),O=1<<E,$=m[E];$===-1?((O&c)===0||(O&u)!==0)&&(m[E]=_a(O,o)):$<=o&&(r.expiredLanes|=O),v&=~O}if(o=Nt,c=tt,c=as(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||cs(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),cl(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=mt;break;default:c=Te}return u=E_.bind(null,r),c=Ie(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&Ee(u),r.callbackPriority=2,r.callbackNode=null,2}function E_(r,o){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(rd()&&r.callbackNode!==c)return null;var u=tt;return u=as(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(o_(r,u,o),w_(r,Be()),r.callbackNode!=null&&r.callbackNode===c?E_.bind(null,r):null)}function T_(r,o){if(rd())return null;o_(r,o,!0)}function YO(){aM(function(){(gt&6)!==0?Ie(He,ZO):__()})}function yg(){if(Ao===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),Ao=r}return Ao}function C_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:hf(""+r)}function R_(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 XO(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var v=C_((m[Un]||null).action),E=u.submitter;E&&(o=(o=E[Un]||null)?C_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var O=new yf("action","action",null,u,m);r.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ao!==0){var $=E?R_(m,E):new FormData(m);zm(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(O.preventDefault(),$=E?R_(m,E):new FormData(m),zm(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var vg=0;vg<em.length;vg++){var bg=em[vg],QO=bg.toLowerCase(),WO=bg[0].toUpperCase()+bg.slice(1);Qr(QO,"on"+WO)}Qr(s0,"onAnimationEnd"),Qr(o0,"onAnimationIteration"),Qr(i0,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(pO,"onTransitionRun"),Qr(mO,"onTransitionStart"),Qr(gO,"onTransitionCancel"),Qr(a0,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),JO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function N_(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 v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var O=u[E],$=O.instance,te=O.currentTarget;if(O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(O=u[E],$=O.instance,te=O.currentTarget,O=O.listener,$!==v&&m.isPropagationStopped())break e;v=O,m.currentTarget=te;try{v(m)}catch(ce){xf(ce)}m.currentTarget=null,v=$}}}}function et(r,o){var c=o[Op];c===void 0&&(c=o[Op]=new Set);var u=r+"__bubble";c.has(u)||(j_(o,r,2,!1),c.add(u))}function xg(r,o,c){var u=0;o&&(u|=4),j_(c,r,u,o)}var id="_reactListening"+Math.random().toString(36).slice(2);function Sg(r){if(!r[id]){r[id]=!0,_x.forEach(function(c){c!=="selectionchange"&&(JO.has(c)||xg(c,!1,r),xg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[id]||(o[id]=!0,xg("selectionchange",!1,o))}}function j_(r,o,c,u){switch(sw(o)){case 2:var m=RM;break;case 8:m=NM;break;default:m=Dg}c=m.bind(null,o,c,r),m=void 0,!Bp||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 _g(r,o,c,u,m){var v=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=Ea(O),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}O=O.parentNode}}u=u.return}Ix(function(){var te=v,ce=Up(c),fe=[];e:{var re=c0.get(r);if(re!==void 0){var ie=yf,Re=r;switch(r){case"keypress":if(mf(c)===0)break e;case"keydown":case"keyup":ie=Kk;break;case"focusin":Re="focus",ie=Vp;break;case"focusout":Re="blur",ie=Vp;break;case"beforeblur":case"afterblur":ie=Vp;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":ie=zx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Ik;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Yk;break;case s0:case o0:case i0:ie=zk;break;case a0:ie=Qk;break;case"scroll":case"scrollend":ie=Ok;break;case"wheel":ie=Jk;break;case"copy":case"cut":case"paste":ie=Uk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Ux;break;case"toggle":case"beforetoggle":ie=tO}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),Z=$e?re!==null?re+"Capture":null:re;$e=[];for(var F=te,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||Z===null||(le=fl(F,Z),le!=null&&$e.push(ql(F,le,J))),Ct)break;F=F.return}0<$e.length&&(re=new ie(re,Re,null,c,ce),fe.push({event:re,listeners:$e}))}}if((o&7)===0){e:{if(re=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",re&&c!==Lp&&(Re=c.relatedTarget||c.fromElement)&&(Ea(Re)||Re[wa]))break e;if((ie||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(Re=c.relatedTarget||c.toElement,ie=te,Re=Re?Ea(Re):null,Re!==null&&(Ct=a(Re),$e=Re.tag,Re!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(ie=null,Re=te),ie!==Re)){if($e=zx,le="onMouseLeave",Z="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=Ux,le="onPointerLeave",Z="onPointerEnter",F="pointer"),Ct=ie==null?re:ul(ie),J=Re==null?re:ul(Re),re=new $e(le,F+"leave",ie,c,ce),re.target=Ct,re.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(Z,F+"enter",Re,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,ie&&Re)t:{for($e=eM,Z=ie,F=Re,J=0,le=Z;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)Z=$e(Z),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(Z===F||F!==null&&Z===F.alternate){$e=Z;break t}Z=$e(Z),F=$e(F)}$e=null}else $e=null;ie!==null&&A_(fe,re,ie,$e,!1),Re!==null&&Ct!==null&&A_(fe,Ct,Re,$e,!0)}}e:{if(re=te?ul(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var ft=Gx;else if(Vx(re))if(Zx)ft=fO;else{ft=lO;var ke=cO}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&zp(te.elementType)&&(ft=Gx):ft=uO;if(ft&&(ft=ft(r,te))){Kx(fe,ft,c,ce);break e}ke&&ke(r,re,te),r==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Dp(re,"number",re.value)}switch(ke=te?ul(te):window,r){case"focusin":(Vx(ke)||ke.contentEditable==="true")&&(Ma=ke,Qp=te,bl=null);break;case"focusout":bl=Qp=Ma=null;break;case"mousedown":Wp=!0;break;case"contextmenu":case"mouseup":case"dragend":Wp=!1,n0(fe,c,ce);break;case"selectionchange":if(hO)break;case"keydown":case"keyup":n0(fe,c,ce)}var Ye;if(Gp)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 Oa?Hx(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&($x&&c.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ye=Px()):(po=ce,Fp="value"in po?po.value:po.textContent,Oa=!0)),ke=ad(te,nt),0<ke.length&&(nt=new Lx(nt,r,null,c,ce),fe.push({event:nt,listeners:ke}),Ye?nt.data=Ye:(Ye=qx(c),Ye!==null&&(nt.data=Ye)))),(Ye=rO?sO(r,c):oO(r,c))&&(nt=ad(te,"onBeforeInput"),0<nt.length&&(ke=new Lx("onBeforeInput","beforeinput",null,c,ce),fe.push({event:ke,listeners:nt}),ke.data=Ye)),XO(fe,r,te,c,ce)}N_(fe,o)})}function ql(r,o,c){return{instance:r,listener:o,currentTarget:c}}function ad(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=fl(r,c),m!=null&&u.unshift(ql(r,m,v)),m=fl(r,o),m!=null&&u.push(ql(r,m,v))),r.tag===3)return u;r=r.return}return[]}function eM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function A_(r,o,c,u,m){for(var v=o._reactName,E=[];c!==null&&c!==u;){var O=c,$=O.alternate,te=O.stateNode;if(O=O.tag,$!==null&&$===u)break;O!==5&&O!==26&&O!==27||te===null||($=te,m?(te=fl(c,v),te!=null&&E.unshift(ql(c,te,$))):m||(te=fl(c,v),te!=null&&E.push(ql(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var tM=/\r\n?/g,nM=/\u0000|\uFFFD/g;function k_(r){return(typeof r=="string"?r:""+r).replace(tM,`
|
|
67
|
+
`).replace(nM,"")}function O_(r,o){return o=k_(o),k_(r)===o}function Tt(r,o,c,u,m,v){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ja(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ja(r,""+u);break;case"className":ff(r,"class",u);break;case"tabIndex":ff(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ff(r,c,u);break;case"style":Ox(r,u,v);break;case"data":if(o!=="object"){ff(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=hf(""+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 v=="function"&&(c==="formAction"?(o!=="input"&&Tt(r,o,"name",m.name,m,null),Tt(r,o,"formEncType",m.formEncType,m,null),Tt(r,o,"formMethod",m.formMethod,m,null),Tt(r,o,"formTarget",m.formTarget,m,null)):(Tt(r,o,"encType",m.encType,m,null),Tt(r,o,"method",m.method,m,null),Tt(r,o,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=hf(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=Ts);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=hf(""+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),uf(r,"popover",u);break;case"xlinkActuate":Es(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Es(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Es(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Es(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Es(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Es(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Es(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Es(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Es(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":uf(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=Ak.get(c)||c,uf(r,c,u))}}function wg(r,o,c,u,m,v){switch(c){case"style":Ox(r,u,v);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"?ja(r,u):(typeof u=="number"||typeof u=="bigint")&&ja(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=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wx.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),v=r[Un]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==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,""):uf(r,c,u)}}}function Tn(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,v;for(v in c)if(c.hasOwnProperty(v)){var E=c[v];if(E!=null)switch(v){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,v,E,c,null)}}m&&Tt(r,o,"srcSet",c.srcSet,c,null),u&&Tt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var O=v=E=m=null,$=null,te=null;for(u in c)if(c.hasOwnProperty(u)){var ce=c[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":E=ce;break;case"checked":$=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":O=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,o));break;default:Tt(r,o,u,ce,c,null)}}Nx(r,v,O,$,te,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in c)if(c.hasOwnProperty(m)&&(O=c[m],O!=null))switch(m){case"value":v=O;break;case"defaultValue":E=O;break;case"multiple":u=O;default:Tt(r,o,m,O,c,null)}o=v,c=E,r.multiple=!!u,o!=null?Na(r,!!u,o,!1):c!=null&&Na(r,!!u,c,!0);return;case"textarea":et("invalid",r),v=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":v=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:Tt(r,o,E,O,c,null)}Ax(r,u,m,v);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(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<Hl.length;u++)et(Hl[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(te in c)if(c.hasOwnProperty(te)&&(u=c[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,te,u,c,null)}return;default:if(zp(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&wg(r,o,ce,u,c,void 0));return}}for(O in c)c.hasOwnProperty(O)&&(u=c[O],u!=null&&Tt(r,o,O,u,c,null))}function rM(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,v=null,E=null,O=null,$=null,te=null,ce=null;for(ie in c){var fe=c[ie];if(c.hasOwnProperty(ie)&&fe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":$=fe;default:u.hasOwnProperty(ie)||Tt(r,o,ie,null,u,fe)}}for(var re in u){var ie=u[re];if(fe=c[re],u.hasOwnProperty(re)&&(ie!=null||fe!=null))switch(re){case"type":v=ie;break;case"name":m=ie;break;case"checked":te=ie;break;case"defaultChecked":ce=ie;break;case"value":E=ie;break;case"defaultValue":O=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,o));break;default:ie!==fe&&Tt(r,o,re,ie,u,fe)}}Pp(r,E,O,$,te,ce,v,m);return;case"select":ie=E=O=re=null;for(v in c)if($=c[v],c.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":ie=$;default:u.hasOwnProperty(v)||Tt(r,o,v,null,u,$)}for(m in u)if(v=u[m],$=c[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":re=v;break;case"defaultValue":O=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=O,c=E,u=ie,re!=null?Na(r,!!c,re,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":ie=re=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:Tt(r,o,O,null,u,m)}for(E in u)if(m=u[E],v=c[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":re=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==v&&Tt(r,o,E,m,u,v)}jx(r,re,ie);return;case"option":for(var Re in c)re=c[Re],c.hasOwnProperty(Re)&&re!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,re));for($ in u)re=u[$],ie=c[$],u.hasOwnProperty($)&&re!==ie&&(re!=null||ie!=null)&&($==="selected"?r.selected=re&&typeof re!="function"&&typeof re!="symbol":Tt(r,o,$,re,u,ie));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 $e in c)re=c[$e],c.hasOwnProperty($e)&&re!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,re);for(te in u)if(re=u[te],ie=c[te],u.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,o));break;default:Tt(r,o,te,re,u,ie)}return;default:if(zp(o)){for(var Ct in c)re=c[Ct],c.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&wg(r,o,Ct,void 0,u,re);for(ce in u)re=u[ce],ie=c[ce],!u.hasOwnProperty(ce)||re===ie||re===void 0&&ie===void 0||wg(r,o,ce,re,u,ie);return}}for(var Z in c)re=c[Z],c.hasOwnProperty(Z)&&re!=null&&!u.hasOwnProperty(Z)&&Tt(r,o,Z,null,u,re);for(fe in u)re=u[fe],ie=c[fe],!u.hasOwnProperty(fe)||re===ie||re==null&&ie==null||Tt(r,o,fe,re,u,ie)}function M_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sM(){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],v=m.transferSize,E=m.initiatorType,O=m.duration;if(v&&O&&M_(E)){for(E=0,O=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],te=$.startTime;if(te>O)break;var ce=$.transferSize,fe=$.initiatorType;ce&&M_(fe)&&($=$.responseEnd,E+=ce*($<O?1:(O-te)/($-te)))}if(--u,o+=8*(v+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 Eg=null,Tg=null;function cd(r){return r.nodeType===9?r:r.ownerDocument}function I_(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 P_(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 Cg(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 Rg=null;function oM(){var r=window.event;return r&&r.type==="popstate"?r===Rg?!1:(Rg=r,!0):(Rg=null,!1)}var D_=typeof setTimeout=="function"?setTimeout:void 0,iM=typeof clearTimeout=="function"?clearTimeout:void 0,z_=typeof Promise=="function"?Promise:void 0,aM=typeof queueMicrotask=="function"?queueMicrotask:typeof z_<"u"?function(r){return z_.resolve(null).then(r).catch(cM)}:D_;function cM(r){setTimeout(function(){throw r})}function ko(r){return r==="head"}function L_(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),ic(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")Vl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Vl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,O=v.nodeName;v[ll]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Vl(r.ownerDocument.body);c=m}while(c);ic(o)}function U_(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 Ng(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":Ng(c),Mp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function lM(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[ll])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==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(v=r.getAttribute("src"),(v!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Mr(r.nextSibling),r===null)break}return null}function uM(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Mr(r.nextSibling),r===null))return null;return r}function $_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Mr(r.nextSibling),r===null))return null;return r}function jg(r){return r.data==="$?"||r.data==="$~"}function Ag(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function fM(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 Mr(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 kg=null;function B_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Mr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function F_(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 H_(r,o,c){switch(o=cd(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 Vl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Mp(r)}var Ir=new Map,q_=new Set;function ld(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Bs=K.d;K.d={f:dM,r:hM,D:pM,C:mM,L:gM,m:yM,X:bM,S:vM,M:xM};function dM(){var r=Bs.f(),o=ed();return r||o}function hM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?aS(o):Bs.r(r)}var rc=typeof document>"u"?null:document;function V_(r,o,c){var u=rc;if(u&&typeof o=="string"&&o){var m=Cr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),q_.has(m)||(q_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function pM(r){Bs.D(r),V_("dns-prefetch",r,null)}function mM(r,o){Bs.C(r,o),V_("preconnect",r,o)}function gM(r,o,c){Bs.L(r,o,c);var u=rc;if(u&&r&&o){var m='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Cr(c.imageSizes)+'"]')):m+='[href="'+Cr(r)+'"]';var v=m;switch(o){case"style":v=sc(r);break;case"script":v=oc(r)}Ir.has(v)||(r=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Ir.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Kl(v))||o==="script"&&u.querySelector(Gl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function yM(r,o){Bs.m(r,o);var c=rc;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+Cr(u)+'"][href="'+Cr(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oc(r)}if(!Ir.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ir.set(v,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Gl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function vM(r,o,c){Bs.S(r,o,c);var u=rc;if(u&&r){var m=Ca(u).hoistableStyles,v=sc(r);o=o||"default";var E=m.get(v);if(!E){var O={loading:0,preload:null};if(E=u.querySelector(Kl(v)))O.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&Og(r,c);var $=E=u.createElement("link");bn($),Tn($,"link",r),$._p=new Promise(function(te,ce){$.onload=te,$.onerror=ce}),$.addEventListener("load",function(){O.loading|=1}),$.addEventListener("error",function(){O.loading|=2}),O.loading|=4,ud(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:O},m.set(v,E)}}}function bM(r,o){Bs.X(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function xM(r,o){Bs.M(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Gl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Mg(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function K_(r,o,c,u){var m=(m=se.current)?ld(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=sc(c.href),c=Ca(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=sc(c.href);var v=Ca(m).hoistableStyles,E=v.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,E),(v=m.querySelector(Kl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ir.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},Ir.set(r,c),v||SM(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=oc(c),c=Ca(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 sc(r){return'href="'+Cr(r)+'"'}function Kl(r){return'link[rel="stylesheet"]['+r+"]"}function G_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function SM(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}),Tn(o,"link",c),bn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Gl(r){return"script[async]"+r}function Z_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(u)return o.instance=u,bn(u),u;var m=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),Tn(u,"style",m),ud(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Kl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=G_(c),(m=Ir.get(m))&&Og(u,m),v=(r.ownerDocument||r).createElement("link"),bn(v);var E=v;return E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),o.state.loading|=4,ud(v,c.precedence,r),o.instance=v;case"script":return v=oc(c.src),(m=r.querySelector(Gl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Mg(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),bn(m),Tn(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,ud(u,c.precedence,r));return o.instance}function ud(r,o,c){for(var u=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,v=m,E=0;E<u.length;E++){var O=u[E];if(O.dataset.precedence===o)v=O;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function Og(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Mg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var fd=null;function Y_(r,o,c){if(fd===null){var u=new Map,m=fd=new Map;m.set(c,u)}else m=fd,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 v=c[m];if(!(v[ll]||v[Sn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var O=u.get(E);O?O.push(v):u.set(E,[v])}}return u}function X_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function _M(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 Q_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function wM(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=sc(u.href),v=o.querySelector(Kl(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=dd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,bn(v);return}v=o.ownerDocument||o,u=G_(u),(m=Ir.get(m))&&Og(u,m),v=v.createElement("link"),bn(v);var E=v;E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),Tn(v,"link",u),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=dd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var Ig=0;function EM(r,o){return r.stylesheets&&r.count===0&&pd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Ig===0&&(Ig=62500*sM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&pd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Ig?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var hd=null;function pd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,hd=new Map,o.forEach(TM,r),hd=null,dd.call(r))}function TM(r,o){if(!(o.state.loading&4)){var c=hd.get(r);if(c)var u=c.get(null);else{c=new Map,hd.set(r,c);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<m.length;v++){var E=m[v];(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"),v=c.get(E)||u,v===u&&c.set(null,m),c.set(E,m),this.count++,u=dd.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),v?v.parentNode.insertBefore(m,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),o.state.loading|=4}}var Zl={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function CM(r,o,c,u,m,v,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=wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.hiddenUpdates=wi(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=v,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function W_(r,o,c,u,m,v,E,O,$,te,ce,fe){return r=new CM(r,o,c,E,$,te,ce,fe,O),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=hm(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},ym(v),r}function J_(r){return r?(r=Da,r):Da}function ew(r,o,c,u,m,v){m=J_(m),u.context===null?u.context=m:u.pendingContext=m,u=xo(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=So(r,u,o),c!==null&&(Vn(c,r,o),Cl(c,r,o))}function tw(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Pg(r,o){tw(r,o),(r=r.alternate)&&tw(r,o)}function nw(r){if(r.tag===13||r.tag===31){var o=Ni(r,67108864);o!==null&&Vn(o,r,67108864),Pg(r,67108864)}}function rw(r){if(r.tag===13||r.tag===31){var o=lr();o=nr(o);var c=Ni(r,o);c!==null&&Vn(c,r,o),Pg(r,o)}}var md=!0;function RM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=2,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function NM(r,o,c,u){var m=D.T;D.T=null;var v=K.p;try{K.p=8,Dg(r,o,c,u)}finally{K.p=v,D.T=m}}function Dg(r,o,c,u){if(md){var m=zg(u);if(m===null)_g(r,o,u,gd,c),ow(r,u);else if(AM(m,r,o,c,u))u.stopPropagation();else if(ow(r,u),o&4&&-1<jM.indexOf(r)){for(;m!==null;){var v=Ta(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=An(v.pendingLanes);if(E!==0){var O=v;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var $=1<<31-xt(E);O.entanglements[1]|=$,E&=~$}hs(v),(gt&6)===0&&(Wf=Be()+500,Fl(0))}}break;case 31:case 13:O=Ni(v,2),O!==null&&Vn(O,v,2),ed(),Pg(v,2)}if(v=zg(u),v===null&&_g(r,o,u,gd,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else _g(r,o,u,null,c)}}function zg(r){return r=Up(r),Lg(r)}var gd=null;function Lg(r){if(gd=null,r=Ea(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 gd=r,null}function sw(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 He:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Ug=!1,Oo=null,Mo=null,Io=null,Yl=new Map,Xl=new Map,Po=[],jM="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 ow(r,o){switch(r){case"focusin":case"focusout":Oo=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":Yl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(o.pointerId)}}function Ql(r,o,c,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=Ta(o),o!==null&&nw(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function AM(r,o,c,u,m){switch(o){case"focusin":return Oo=Ql(Oo,r,o,c,u,m),!0;case"dragenter":return Mo=Ql(Mo,r,o,c,u,m),!0;case"mouseover":return Io=Ql(Io,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Yl.set(v,Ql(Yl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Xl.set(v,Ql(Xl.get(v)||null,r,o,c,u,m)),!0}return!1}function iw(r){var o=Ea(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,lf(r.priority,function(){rw(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,lf(r.priority,function(){rw(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 yd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=zg(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Lp=u,c.target.dispatchEvent(u),Lp=null}else return o=Ta(c),o!==null&&nw(o),r.blockedOn=c,!1;o.shift()}return!0}function aw(r,o,c){yd(r)&&c.delete(o)}function kM(){Ug=!1,Oo!==null&&yd(Oo)&&(Oo=null),Mo!==null&&yd(Mo)&&(Mo=null),Io!==null&&yd(Io)&&(Io=null),Yl.forEach(aw),Xl.forEach(aw)}function vd(r,o){r.blockedOn===o&&(r.blockedOn=null,Ug||(Ug=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kM)))}var bd=null;function cw(r){bd!==r&&(bd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bd===r&&(bd=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(Lg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,zm(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return vd($,r)}Oo!==null&&vd(Oo,r),Mo!==null&&vd(Mo,r),Io!==null&&vd(Io,r),Yl.forEach(o),Xl.forEach(o);for(var c=0;c<Po.length;c++){var u=Po[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Po.length&&(c=Po[0],c.blockedOn===null);)iw(c),c.blockedOn===null&&Po.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],v=c[u+1],E=m[Un]||null;if(typeof v=="function")E||cw(c);else if(E){var O=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Un]||null)O=E.formAction;else if(Lg(m)!==null)continue}else O=E.action;typeof O=="function"?c[u+1]=O:(c.splice(u,3),u-=3),cw(c)}}}function lw(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.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 v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.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 $g(r){this._internalRoot=r}xd.prototype.render=$g.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=lr();ew(c,u,r,o,null,null)},xd.prototype.unmount=$g.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;ew(r.current,2,null,r,null,null),ed(),o[wa]=null}};function xd(r){this._internalRoot=r}xd.prototype.unstable_scheduleHydration=function(r){if(r){var o=cf();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Po.length&&o!==0&&o<Po[c].priority;c++);Po.splice(c,0,r),c===0&&iw(r)}};var uw=t.version;if(uw!=="19.2.4")throw Error(s(527,uw,"19.2.4"));K.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=p(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var OM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sd.isDisabled&&Sd.supportsFiber)try{Er=Sd.inject(OM),Qt=Sd}catch{}}return eu.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=yS,v=vS,E=bS;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&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=W_(r,1,!1,null,null,c,u,null,m,v,E,lw),r[wa]=o.current,Sg(r),new $g(o)},eu.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",v=yS,E=vS,O=bS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(O=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=W_(r,1,!0,o,c??null,u,m,$,v,E,O,lw),o.context=J_(null),c=o.current,u=lr(),u=nr(u),m=xo(u),m.callback=null,So(c,m,u),c=u,o.current.lanes=c,ws(o,c),hs(o),r[wa]=o.current,Sg(r),new xd(o)},eu.version="19.2.4",eu}var QE;function u6(){if(QE)return ay.exports;QE=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(),ay.exports=l6(),ay.exports}var f6=u6(),Jc=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(){}},d6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},h6=class{#e=d6;#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)}},Gi=new h6;function p6(e){setTimeout(e,0)}var aa=typeof window>"u"||"Deno"in globalThis;function Mn(){}function m6(e,t){return typeof e=="function"?e(t):e}function gv(e){return typeof e=="number"&&e>=0&&e!==1/0}function bN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function WE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Nb(l,t.options))return!1}else if(!Eu(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 JE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ca(t.options.mutationKey)!==ca(a))return!1}else if(!Eu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Nb(e,t){return(t?.queryKeyHashFn||ca)(e)}function ca(e){return JSON.stringify(e,(t,n)=>yv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eu(e[n],t[n])):!1}var g6=Object.prototype.hasOwnProperty;function xN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=eT(e)&&eT(t);if(!s&&!(yv(e)&&yv(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 p=0;for(let g=0;g<f;g++){const y=s?g:l[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:g6.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[y]=x;continue}const S=xN(b,x,n+1);d[y]=S,S===b&&p++}return a===f&&p===a?e:d}function jh(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 eT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yv(e){if(!tT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!tT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tT(e){return Object.prototype.toString.call(e)==="[object Object]"}function y6(e){return new Promise(t=>{Gi.setTimeout(t,e)})}function vv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xN(e,t):t}function v6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function b6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var jb=Symbol();function SN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ab(e,t){return typeof e=="function"?e(...t):!!e}function x6(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 S6=class extends Jc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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"}},kb=new S6;function bv(){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 _6=p6;function w6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=_6;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 pn=w6(),E6=class extends Jc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!aa&&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}},Ah=new E6;function T6(e){return Math.min(1e3*2**e,3e4)}function _N(e){return(e??"online")==="online"?Ah.isOnline():!0}var xv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wN(e){let t=!1,n=0,s;const i=bv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new xv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>kb.isFocused()&&(e.networkMode==="always"||Ah.isOnline())&&e.canRun(),g=()=>_N(e.networkMode)&&e.canRun(),y=w=>{a()||(s?.(),i.resolve(w))},b=w=>{a()||(s?.(),i.reject(w))},x=()=>new Promise(w=>{s=T=>{(a()||p())&&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(C){w=Promise.reject(C)}Promise.resolve(w).then(y).catch(C=>{if(a())return;const A=e.retry??(aa?0:3),N=e.retryDelay??T6,R=typeof N=="function"?N(n,C):N,M=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!M){b(C);return}n++,e.onFail?.(n,C),y6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):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 EN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gv(this.gcTime)&&(this.#e=Gi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Gi.clearTimeout(this.#e),this.#e=void 0)}},C6=class extends EN{#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=rT(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=rT(this.options);t.data!==void 0&&(this.setState(nT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=vv(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(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Yo(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:!bN(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=SN(this.options,t),p=(()=>{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,p,this):f(p)},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=wN({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof xv&&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 xv){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,...TN(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...nT(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),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function TN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_N(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rT(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 R6=class extends Jc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=bv(),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),sT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sv(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 zr(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&&!jh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&oT(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||Yo(this.options.staleTime,this.#t)!==Yo(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(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 j6(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(Mn)),t}#g(){this.#x();const e=Yo(this.options.staleTime,this.#t);if(aa||this.#s.isStale||!gv(e))return;const n=bN(this.#s.dataUpdatedAt,e)+1;this.#l=Gi.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,!(aa||zr(this.options.enabled,this.#t)===!1||!gv(this.#c)||this.#c===0)&&(this.#u=Gi.setInterval(()=>{(this.options.refetchIntervalInBackground||kb.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(Gi.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&(Gi.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:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const k=this.hasListeners(),P=!k&&sT(e,t),G=k&&oT(e,n,t,s);(P||G)&&(g={...g,...TN(p.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 k;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(k=i.data,T=!0):k=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,k!==void 0&&(w="success",b=vv(i?.data,k,t),y=!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=vv(i?.data,b,t),this.#d=b,this.#o=null}catch(k){this.#o=k}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const C=g.fetchStatus==="fetching",A=w==="pending",N=w==="error",R=A&&C,M=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:A,isSuccess:w==="success",isError:N,isInitialLoading:R,isLoading:R,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:C,isRefetching:C&&!A,isLoadingError:N&&!M,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&M,isStale:Ob(e,t),refetch:this.refetch,promise:this.#a,isEnabled:zr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const k=j.data!==void 0,P=j.status==="error"&&!k,G=Q=>{P?Q.reject(j.error):k&&Q.resolve(j.data)},B=()=>{const Q=this.#a=j.promise=bv();G(Q)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&G(z);break;case"fulfilled":(P||j.data!==z.value)&&B();break;case"rejected":(!P||j.error!==z.reason)&&B();break}}return j}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),jh(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){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function N6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sT(e,t){return N6(e,t)||e.state.data!==void 0&&Sv(e,t,t.refetchOnMount)}function Sv(e,t,n){if(zr(t.enabled,e)!==!1&&Yo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Ob(e,t)}return!1}function oT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ob(e,n)}function Ob(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Yo(t.staleTime,e))}function j6(e,t){return!jh(e.getCurrentResult(),t)}function iT(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 p=async()=>{let g=!1;const y=S=>{x6(S,()=>t.signal,()=>g=!0)},b=SN(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 A=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(L),L})(),N=await b(A),{maxPages:R}=t.options,M=T?b6:v6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?A6:aT,T={pages:a,pageParams:l},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?l[0]??s.initialPageParam:aT(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?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=p}}}function aT(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 A6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k6=class extends EN{#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||CN(),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=wN({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),pn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function CN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var O6=class extends Jc{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 k6({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=kd(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=kd(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=kd(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=kd(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.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=>JE(t,n))}findAll(e={}){return this.getAll().filter(t=>JE(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mn))))}};function kd(e){return e.options.scope?.id}var M6=class extends Jc{#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),jh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ca(n.mutationKey)!==ca(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??CN();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){pn.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)})})}},I6=class extends Jc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Nb(s,t);let a=this.get(i);return a||(a=new C6({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(){pn.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=>WE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>WE(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},P6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new I6,this.#t=e.mutationCache||new O6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=kb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ah.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(Yo(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=m6(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pn.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;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return pn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=pn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return pn.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=pn.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(Mn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Yo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=iT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=iT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ah.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(ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Eu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Eu(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=Nb(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===jb&&(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()}},RN=_.createContext(void 0),_r=e=>{const t=_.useContext(RN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(RN.Provider,{value:e,children:t})),NN=_.createContext(!1),z6=()=>_.useContext(NN);NN.Provider;function L6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U6=_.createContext(L6()),$6=()=>_.useContext(U6),B6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Ab(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},F6=e=>{_.useEffect(()=>{e.clearReset()},[e])},H6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Ab(n,[e.error,s])),q6=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))}},V6=(e,t)=>e.isLoading&&e.isFetching&&!t,K6=(e,t)=>e?.suspense&&t.isPending,cT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function G6(e,t,n){const s=z6(),i=$6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",q6(l),B6(l,i,f),F6(i);const d=!a.getQueryCache().get(l.queryHash),[p]=_.useState(()=>new t(a,l)),g=p.getOptimisticResult(l),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(pn.batchCalls(b)):Mn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(l)},[l,p]),K6(l,g))throw cT(l,p,i);if(H6({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&&!aa&&V6(g,s)&&(d?cT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return G6(e,R6)}function is(e,t){const n=_r(),[s]=_.useState(()=>new M6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(pn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(Mn)},[s]);if(i.error&&Ab(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $t=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))($t||{});function jN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:l,shallowPropagate:f};function s(p,g,y){const b=g.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===p){x.version=y,g.depsTail=x;return}const S=p.subsTail;if(S!==void 0&&S.version===y&&S.sub===g)return;const w=g.depsTail=p.subsTail={version:y,dep:p,sub:g,prevDep:b,nextDep:x,prevSub:S,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:g.deps=w,S!==void 0?S.nextSub=w:p.subs=w}function i(p,g=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,S=p.nextSub,w=p.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,S!==void 0?S.prevSub=w:y.subsTail=w,w!==void 0?w.nextSub=S:(y.subs=S)===void 0&&n(y),x}function a(p){let g=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(p,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const S=b.subs;if(S!==void 0){const w=(p=S).nextSub;w!==void 0&&(y={value:g,prev:y},g=w);continue}}if((p=g)!==void 0){g=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){g=p.nextSub;continue e}break}while(!0)}function l(p,g){let y,b=0,x=!1;e:do{const S=p.dep,w=S.flags;if(g.flags&16)x=!0;else if((w&17)===17){if(e(S)){const T=S.subs;T.nextSub!==void 0&&f(T),x=!0}}else if((w&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=S.deps,g=S,++b;continue}if(!x){const T=p.nextDep;if(T!==void 0){p=T;continue}}for(;b--;){const T=g.subs,C=T.nextSub!==void 0;if(C?(p=y.value,y=y.prev):p=T,x){if(e(g)){C&&f(T),g=p.sub;continue}x=!1}else g.flags&=-33;g=p.sub;const A=p.nextDep;if(A!==void 0){p=A;continue e}}return x}while(!0)}function f(p){do{const g=p.sub,y=g.flags;(y&48)===32&&(g.flags=y|16,(y&6)===2&&t(g))}while((p=p.nextSub)!==void 0)}function d(p,g){let y=g.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let Mb=0,Fi=0,fu=0;const Ks=[],{link:RQ,unlink:AN,propagate:NQ,checkDirty:Z6,shallowPropagate:jQ}=jN({update(e){return e.depsTail!==void 0?W6(e):J6(e)},notify(e){let t=fu,n=t;do if(Ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(fu=t;n<--t;){const s=Ks[n];Ks[n++]=Ks[t],Ks[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,fp(e)):nF.call(e)}});function Y6(){return Mb}function X6(){++Mb}function Q6(){--Mb||tF()}function W6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,fp(e)}}function J6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function eF(e){const t=e.flags;if(t&16||t&32&&Z6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,fp(e)}}else e.flags=2}function tF(){try{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,eF(e)}}finally{for(;Fi<fu;){const e=Ks[Fi];Ks[Fi++]=void 0,e.flags|=10}Fi=0,fu=0}}function nF(){this.depsTail=void 0,this.flags=0,fp(this);const e=this.subs;e!==void 0&&AN(e)}function fp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=AN(n,e)}function Ib(e,t,n){const s=typeof e=="object",i=s?e:void 0;return{next:(s?e.next:e)?.bind(i),error:(s?e.error:t)?.bind(i),complete:(s?e.complete:n)?.bind(i)}}const _v=[];let oh=0;const{link:lT,unlink:rF,propagate:sF,checkDirty:kN,shallowPropagate:uT}=jN({update(e){return e._update()},notify(e){_v[wv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,kh(e))}});let Od=0,wv=0,gs;function kh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=rF(n,e)}function ON(){if(!(Y6()>0)){for(;Od<wv;){const e=_v[Od];_v[Od++]=void 0,e.notify()}Od=0,wv=0}}function MN(e,t){const n=typeof e=="function",s=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?$t.None:$t.Mutable,get(){return gs!==void 0&&lT(i,gs,oh),i._snapshot},subscribe(a){const l=Ib(a),f={current:!1},d=oF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=gs,f=Object.is;gs=i,++oh,i.depsTail=void 0,n&&(i.flags=$t.Mutable|$t.RecursedCheck);try{const d=i._snapshot,p=typeof a=="function"?a(d):a===void 0&&n?s(d):a;return d===void 0||!f(d,p)?(i._snapshot=p,!0):!1}finally{gs=l,n&&(i.flags&=~$t.RecursedCheck),kh(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const a=i.flags;if(a&$t.Dirty||a&$t.Pending&&kN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&uT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return gs!==void 0&&lT(i,gs,oh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(sF(l),uT(l),ON())}},i}function oF(e){const t=()=>{const s=gs;gs=n,++oh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{gs=s,n.flags&=~$t.RecursedCheck,kh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const s=this.flags;s&$t.Dirty||s&$t.Pending&&kN(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,kh(this)}};return t(),n}let iF=class{constructor(t){this.atom=MN(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ib(t))}};class aF{constructor(t){this.atom=MN(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ib(t))}}function cF(e){return typeof e=="function"?new aF(e):new iF(e)}function lF(e){try{X6(),e()}finally{Q6(),ON()}}const Xo="__TSR_index",fT="popstate",dT="beforeunload";function uF(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?.()??[],y=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const b of g){const x=Oh(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 p=t.state[Xo];f=hT(p+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Xo];f=hT(p,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[Xo]!==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(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function hT(e,t){t||(t={});const n=Pb();return{...t,key:n,__TSR_key:n,[Xo]:e}}function fF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,l=k=>i=k,f=(k=>k),d=(()=>Oh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const k=Pb();t.history.replaceState({[Xo]:0,key:k,__TSR_key:k},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const A=()=>{T&&(j._ignoreSubscribers=!0,(T.isPush?t.history.pushState:t.history.replaceState)(T.state,"",T.href),j._ignoreSubscribers=!1,T=void 0,C=void 0,g=void 0)},N=(k,P,G)=>{const B=f(P);C||(g=p),p=Oh(P,G),T={href:B,state:G,isPush:T?.isPush||k==="push"},C||(C=Promise.resolve().then(()=>A()))},R=k=>{p=d(),j.notify({type:k})},M=async()=>{if(b){b=!1;return}const k=d(),P=k.state[Xo]-p.state[Xo],G=P===1,B=P===-1,z=!G&&!B||y;y=!1;const Q=z?"GO":B?"BACK":"FORWARD",Y=z?{type:"GO",index:P}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const ee=a();if(typeof document<"u"&&ee.length){for(const D of ee)if(await D.blockerFn({currentLocation:p,nextLocation:k,action:Q})){b=!0,t.history.go(1),j.notify(Y);return}}}p=d(),j.notify(Y)},L=k=>{if(S){S=!1;return}let P=!1;const G=a();if(typeof document<"u"&&G.length)for(const B of G){const z=B.enableBeforeUnload??!0;if(z===!0){P=!0;break}if(typeof z=="function"&&z()===!0){P=!0;break}}if(P)return k.preventDefault(),k.returnValue=""},j=uF({getLocation:w,getLength:()=>t.history.length,pushState:(k,P)=>N("push",k,P),replaceState:(k,P)=>N("replace",k,P),back:k=>(k&&(x=!0),S=!0,t.history.back()),forward:k=>{k&&(x=!0),S=!0,t.history.forward()},go:k=>{y=!0,t.history.go(k)},createHref:k=>f(k),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(dT,L,{capture:!0}),t.removeEventListener(fT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(dT,L,{capture:!0}),t.addEventListener(fT,M),t.history.pushState=function(...k){const P=n.apply(t.history,k);return j._ignoreSubscribers||R("PUSH"),P},t.history.replaceState=function(...k){const P=s.apply(t.history,k);return j._ignoreSubscribers||R("REPLACE"),P},j}function dF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Oh(e,t){const n=dF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Pb();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||{[Xo]:0,key:a,__TSR_key:a}}}function Pb(){return(Math.random()+1).toString(36).substring(7)}const hF=!1;function du(e){let t;return lF(()=>{t=e()}),t}function Tu(e){return e[e.length-1]}function pF(e){return typeof e=="function"}function Fo(e,t){return pF(e)?e(t):e}const mF=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=yT(e)&&yT(s);if(!i&&!(Mh(e)&&Mh(s)))return s;const a=i?e:mT(e);if(!a)return s;const l=i?s:mT(s);if(!l)return s;const f=a.length,d=l.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:l[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:mF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=ur(x,S,n+1);p[b]=w,w===x&&g++}return f===d&&g===f?e:p}function mT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!pT.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(!pT.call(e,i))return!1;s.push(i)}return s}function Mh(e){if(!gT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!gT(n)||!n.hasOwnProperty("isPrototypeOf"))}function gT(e){return Object.prototype.toString.call(e)==="[object Object]"}function yT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function na(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(!na(e[s],t[s],n))return!1;return!0}if(Mh(e)&&Mh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!na(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||!na(e[l],t[l],n)))return!1;return i===a}return!1}function zc(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 vc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function gF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function vT(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 gF(t)}const yF=["http:","https:","mailto:","tel:"];function Ih(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function tu(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+=vT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+vT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function vF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var bF="Invariant failed";function ro(e,t){if(!e)throw new Error(bF)}function Ph(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 Lc=0,la=1,ua=2,Cu=3,Zi=4,IN=5;function xF(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 Db(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]=Lc,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]=ua,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=la,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=xF(a);if(l){const[f,d]=l,p=a.charCodeAt(f+1);if(p===45){if(f+2<a.length&&a.charCodeAt(f+2)===36){const g=f+3,y=d;if(g<y)return n[0]=Cu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=ua,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=la,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Lc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function dp(e,t,n,s,i,a,l){l?.(n);let f=s;{const d=n.fullPath??n.from,p=d.length,g=n.options?.caseSensitive??e,y=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Db(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Lc:{const A=d.substring(x[2],x[3]);if(g){const N=i.static?.get(A);if(N)S=N;else{i.static??=new Map;const R=Yi(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(A,R)}}else{const N=A.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const M=Yi(n.fullPath??n.from);M.parent=i,M.depth=a,S=M,i.staticInsensitive.set(N,M)}}break}case la:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),M=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(k=>!k.skipOnParamError&&k.caseSensitive===R&&k.prefix===M&&k.suffix===L);if(j)S=j;else{const k=dy(la,n.fullPath??n.from,R,M,L);S=k,k.depth=a,k.parent=i,i.dynamic??=[],i.dynamic.push(k)}break}case Cu:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),M=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(k=>!k.skipOnParamError&&k.caseSensitive===R&&k.prefix===M&&k.suffix===L);if(j)S=j;else{const k=dy(Cu,n.fullPath??n.from,R,M,L);S=k,k.parent=i,k.depth=a,i.optional??=[],i.optional.push(k)}break}case ua:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),M=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=dy(ua,n.fullPath??n.from,R,M,L);S=j,j.parent=i,j.depth=a,i.wildcard??=[],i.wildcard.push(j)}}i=S}if(y&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Yi(n.fullPath??n.from);x.kind=IN,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=Yi(n.fullPath??n.from);x.kind=Zi,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=n.options?.params?.parse??null,i.skipOnParamError=y,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)dp(e,t,d,f,i,a,l)}function fy(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 $o(e){if(e.pathless)for(const t of e.pathless)$o(t);if(e.static)for(const t of e.static.values())$o(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())$o(t);if(e.dynamic?.length){e.dynamic.sort(fy);for(const t of e.dynamic)$o(t)}if(e.optional?.length){e.optional.sort(fy);for(const t of e.optional)$o(t)}if(e.wildcard?.length){e.wildcard.sort(fy);for(const t of e.wildcard)$o(t)}}function Yi(e){return{kind:Lc,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 dy(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 SF(e,t){const n=Yi("/"),s=new Uint16Array(6);for(const i of e)dp(!1,s,i,1,n,0);$o(n),t.masksTree=n,t.flatCache=Ph(1e3)}function _F(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=zb(e,t.masksTree);return t.flatCache.set(e,s),s}function wF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Yi("/");const f=new Uint16Array(6);dp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return zb(s,l,n)}function EF(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=zb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=RF(a.route)),t.matchCache.set(s,a),a}function TF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function CF(e,t=!1,n){const s=Yi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return dp(t,i,e,1,s,0,p=>{if(n?.(p,f),ro(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=TF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),$o(s),{processedTree:{segmentTree:s,singleCache:Ph(1e3),matchCache:Ph(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function zb(e,t,n=!1){const s=e.split("/"),i=jF(e,s,t,n);if(!i)return null;const[a]=PN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function PN(e,t,n){const s=NF(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,p++){const g=s[f];if(g.kind===Zi)break;if(g.kind===IN){p--,l--,d--;continue}const y=t[l],b=d;if(y&&(d+=y.length),g.kind===la){i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0;if(x.charCodeAt(S)===123){const T=g.suffix?.length??0,C=x.substring(S+2,x.length-T-1),A=y.substring(S,y.length-T);a[C]=decodeURIComponent(A)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===Cu){if(n.skipped&1<<f){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0,w=g.suffix?.length??0,T=x.substring(S+3,x.length-w-1),C=g.suffix||g.prefix?y.substring(S,y.length-w):y;C&&(a[T]=decodeURIComponent(C))}else if(g.kind===ua){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:p}]}function RF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function NF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function jF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Tu(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,p=null,g=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:S,depth:w,statics:T,dynamics:C,optionals:A}=y;let{extract:N,rawParams:R,parsedParams:M}=y;if(b.skipOnParamError){if(!hy(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Zi&&nu(p,y)&&(p=y);const L=x===l;if(L&&(b.route&&!a&&nu(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=L?void 0:t[x];let k;if(L&&b.index){const P={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M};let G=!0;if(b.index.skipOnParamError&&(hy(e,t,P)||(G=!1)),G){if(T===l&&!C&&!A&&!S)return P;nu(g,P)&&(g=P)}}if(b.wildcard&&nu(d,y))for(const P of b.wildcard){const{prefix:G,suffix:B}=P;if(G&&(L||!(P.caseSensitive?j:k??=j.toLowerCase()).startsWith(G)))continue;if(B){if(L)continue;const Q=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Q:Q.toLowerCase())!==B)continue}const z={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!hy(e,t,z))){d=z;break}}if(b.optional){const P=S|1<<w,G=w+1;for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B];f.push({node:z,index:x,skipped:P,depth:G,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M})}if(!L)for(let B=b.optional.length-1;B>=0;B--){const z=b.optional[B],{prefix:Q,suffix:Y}=z;if(Q||Y){const ee=z.caseSensitive?j:k??=j.toLowerCase();if(Q&&!ee.startsWith(Q)||Y&&!ee.endsWith(Y))continue}f.push({node:z,index:x+1,skipped:S,depth:G,statics:T,dynamics:C,optionals:A+1,extract:N,rawParams:R,parsedParams:M})}}if(!L&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const G=b.dynamic[P],{prefix:B,suffix:z}=G;if(B||z){const Q=G.caseSensitive?j:k??=j.toLowerCase();if(B&&!Q.startsWith(B)||z&&!Q.endsWith(z))continue}f.push({node:G,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:A,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.staticInsensitive){const P=b.staticInsensitive.get(k??=j.toLowerCase());P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M})}if(!L&&b.static){const P=b.static.get(j);P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M})}if(b.pathless){const P=w+1;for(let G=b.pathless.length-1;G>=0;G--){const B=b.pathless[G];f.push({node:B,index:x,skipped:S,depth:P,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:M})}}}if(g&&d)return nu(d,g)?g:d;if(g)return g;if(d)return d;if(s&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function hy(e,t,n){try{const[s,i]=PN(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 nu(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===Zi)>(e.node.kind===Zi)||t.node.kind===Zi==(e.node.kind===Zi)&&t.depth>e.depth))):!0}function ih(e){return Lb(e.filter(t=>t!==void 0).join("/"))}function Lb(e){return e.replace(/\/{2,}/g,"/")}function DN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Qo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function zN(e){return Qo(DN(e))}function Dh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function AF(e,t,n){return Dh(e,n)===Dh(t,n)}function kF({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 y=s.get(l);if(y)return y}let f;if(a)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Tu(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(Tu(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Db(b,0,d);const x=d[0];if(x===Lc){p+=b;continue}const S=d[5],w=b.substring(0,d[1]),T=b.substring(d[4],S),C=b.substring(d[2],d[3]);x===la?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===ua?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=Lb(p);const g=p||"/";return l&&s&&s.set(l,g),g}function OF(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 py(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=>xT(i,n)).join("/"):xT(s,n)}function bT({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,p="";for(;f<l;){const y=f;d=Db(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===Lc){p+="/"+e.substring(y,b);continue}if(x===ua){const S=t._splat;a._splat=S,a["*"]=S;const w=e.substring(y,d[1]),T=e.substring(d[4],b);if(!S){i=!0,(w||T)&&(p+="/"+w+T);continue}const C=py("_splat",t,n);p+="/"+w+C+T;continue}if(x===la){const S=e.substring(d[2],d[3]);!i&&!(S in t)&&(i=!0),a[S]=t[S];const w=e.substring(y,d[1]),T=e.substring(d[4],b),C=py(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===Cu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),A=py(S,t,n)??"";p+="/"+T+A+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:a,interpolatedPath:p||"/",isMissingParams:i}}function xT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function MF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ev="tsr-scroll-restoration-v1_3",IF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function PF(){const e=MF();if(!e)return null;const t=e.getItem(Ev);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Fo(s,n)||n;try{e.setItem(Ev,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Md=PF(),DF=e=>e.state.__TSR_key||e.href;function zF(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 zh=!1;function LF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];zh=!0;e:{if(s&&d&&Object.keys(d).length>0){for(const y in d){const b=d[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(a??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);b&&b.scrollIntoView(y)}break e}const g={top:0,left:0,behavior:n};if(window.scrollTo(g),i)for(const y of i){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(g)}}zh=!1}function UF(e,t){if(!Md||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Md))return;e.isScrollRestorationSetup=!0,zh=!1;const s=e.options.getScrollRestorationKey||DF;window.history.scrollRestoration="manual";const i=a=>{if(zh||!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=zF(a.target)}const f=s(e.state.location);Md.set(d=>{const p=d[f]||={},g=p[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const y=document.querySelector(l);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",IF(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})||(LF({storageKey:Ev,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Md.set(f=>(f[l]||={},f)))})}function $F(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 BF(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 my(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function FF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=my(i):Array.isArray(a)?a.push(my(i)):n[s]=[a,my(i)]}return n}const HF=VF(JSON.parse),qF=KF(JSON.stringify,JSON.parse);function VF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=FF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function KF(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=BF(i,s);return a?`?${a}`:""}}const Lr="__root__";function GF(e){if(e.statusCode=e.statusCode||e.code||307,!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 Br(e){return e instanceof Response&&!!e.options}const ah=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},hp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),bc=(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},LN=(e,t,n)=>{const s=e.router.routesById[t.routeId??""]??e.router.routeTree;!s.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&s.parentRoute;i||ro(s.options.notFoundComponent);const a=e.matches.find(l=>l.routeId===s.id);ro(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,LN(e,t,n))},Ho=(e,t,n,s)=>{if(!(!Br(n)&&!yr(n))){if(Br(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 i=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:bc(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(LN(e,n,s),n)}},UN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ru=(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,Ho(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,Ho(e,e.router.getMatch(i),n,s)}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&&!hp(e,t)&&(n.options.loader||n.options.beforeLoad||HN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{ah(e)},i);s._nonReactive.pendingTimeout=l}},ZF=(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")&&Ho(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},YF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=zc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&ru(e,n,l,"PARSE_PARAMS"),f&&ru(e,n,f,"VALIDATE_SEARCH"),$N(e,t,s,i);const d=new AbortController;let p=!1;const g=()=>{p||(p=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},y=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){du(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=zc();const b={...bc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=hp(e,t),C={search:x,abortController:d,params:S,preload:T,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":w,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},A=R=>{if(R===void 0){du(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),ru(e,n,R,"BEFORE_LOAD")),du(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),vc(N))return g(),N.catch(R=>{ru(e,n,R,"BEFORE_LOAD")}).then(A)}catch(R){g(),ru(e,n,R,"BEFORE_LOAD")}A(N)},XF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>YF(e,n,t,i),f=()=>{if(UN(e,n))return;const d=ZF(e,n,i);return vc(d)?d.then(l):l()};return a()},QF=(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,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:l,styles:y}})},BN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=bc(e,n),g=hp(e,t);return{params:a,deps:l,preload:!!g,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},ST=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(hF??e.router.isServer)||i.ssr===!0)&&FN(s);const a=s.options.loader?.(BN(e,t,n,s)),l=s.options.loader&&vc(a);if((l||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),s.options.loader){const p=l?await a:a;Ho(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:bc(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:bc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),Ho(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,Ho(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:bc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),Ho(e,a,i)}},WF=async(e,t)=>{async function n(g,y,b,x){const S=Date.now()-y.updatedAt,w=g?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,T=x.options.shouldReload,C=typeof T=="function"?T(BN(e,s,t,x)):T,{status:A,invalid:N}=b;a=A==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!0,(async()=>{try{await ST(e,s,t,x);const R=e.router.getMatch(s);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){Br(R)&&await e.router.navigate(R.options)}})()):(A!=="success"||a&&e.sync)&&await ST(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!UN(e,s)){const g=e.router.getMatch(s),y=hp(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&&Ho(e,b,x),b.status==="pending"&&await n(y,g,b,f)}else{const b=y&&!e.router.state.matches.some(S=>S.id===s),x=e.router.getMatch(s);x._nonReactive.loaderPromise=zc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,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 p=l?d.isFetching:!1;return p!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):d};async function _T(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ah(t);try{for(let f=0;f<t.matches.length;f++){const d=XF(t,f);vc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(WF(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(Br(f))throw f;!a&&yr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=QF(t,d,g);if(y){const b=await y;t.updateMatch(d,x=>({...x,...b}))}}catch(y){console.error(`Error executing head for route ${p}:`,y)}}if(a)throw a;const l=ah(t);vc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ah(t);throw vc(s)&&await s,n}if(Br(n))throw n}return t.matches}async function FN(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 qN){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 HN(e){for(const t of qN)if(e.options[t]?.preload)return!0;return!1}const qN=["component","errorComponent","pendingComponent","notFoundComponent"];function JF(e){return{input:({url:t})=>{for(const n of e)t=Tv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=VN(e[n],t);return t}}}function eH(e){const t=zN(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=ih(["/",t,l.pathname]),l)}}function Tv(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 VN(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 ra(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}}function tH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class nH{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=>{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.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=OF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=fF()),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=Ph(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=cF(sH(this.latestLocation)),UF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||l!==p){this.basepath=d;const b=[],x=zN(d);x&&x!=="/"&&b.push(eH({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:JF(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(b=>({...b,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=CF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&SF(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:p,hash:g,href:y,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const A=this.options.parseSearch(p),N=this.options.stringifySearch(A);return{href:d+N+g,publicHref:y,pathname:tu(d).path,external:!1,searchStr:N,search:ur(s?.search,A),hash:tu(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=Tv(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:y,pathname:tu(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:tu(S.hash.slice(1)).path,state:ur(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)=>kF({base:n,to:Lb(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=>oH({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,p=this.resolvePathWithBase(d,"."),g=f.search,y={...f.params},b=a.to?this.resolvePathWithBase(p,`${a.to}`):this.resolvePathWithBase(p,"."),x=a.params===!1||a.params===null?{}:(a.params??!0)===!0?y:Object.assign(y,Fo(a.params,y)),S=this.getMatchedRoutes(b);let w=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const B of w){const z=B.options.params?.stringify??B.options.stringifyParams;if(z)try{Object.assign(x,z(x))}catch{}}const C=n.leaveParams?b:tu(bT({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=g;if(n._includeValidateSearch&&this.options.search?.strict){const B={};w.forEach(z=>{if(z.options.validateSearch)try{Object.assign(B,ch(z.options.validateSearch,{...B,...A}))}catch{}}),A=B}A=iH({search:A,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),A=ur(g,A);const N=this.options.stringifySearch(A),R=a.hash===!0?l.hash:a.hash?Fo(a.hash,l.hash):void 0,M=R?`#${R}`:"";let L=a.state===!0?l.state:a.state?Fo(a.state,l.state):{};L=ur(l.state,L);const j=`${C}${N}${M}`;let k,P,G=!1;if(this.rewrite){const B=new URL(j,this.origin),z=VN(this.rewrite,B);k=B.href.replace(B.origin,""),z.origin!==this.origin?(P=z.href,G=!0):P=z.pathname+z.search+z.hash}else k=vF(j),P=k;return{publicHref:P,href:k,pathname:C,search:A,searchStr:N,state:L,hash:R??"",external:G,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const p={};if(this.options.routeMasks){const g=_F(f.pathname,this.processedTree);if(g){Object.assign(p,g.rawParams);const{from:y,params:b,...x}=g.route,S=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,Fo(b,p));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 p=na(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},l=Qo(this.latestLocation.href)===Qo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=zc(()=>{f?.resolve()}),l&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...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=p??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 y=this.history.location.state.__TSR_index,b=Oh(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=Tv(this.rewrite,x);d.to=S.pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const g=this.commitLocation({...p,viewTransition:a,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(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 p=this.buildLocation({to:n,...l});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(Ih(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.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,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ra({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...ra({resolvedLocation:p,location:d})}),await _T({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],y=[],b=[],x=[];du(()=>{this.__store.setState(S=>{const w=S.matches,T=S.pendingMatches||S.matches;return g=w.filter(C=>!T.some(A=>A.id===C.id)),y=w.filter(C=>!T.some(A=>A.routeId===C.routeId)),b=T.filter(C=>!w.some(A=>A.routeId===C.routeId)),x=T.filter(C=>w.some(A=>A.routeId===C.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:T,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...g.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([S,w])=>{S.forEach(T=>{this.looseRoutesById[T.routeId].options[w]?.(T)})})})})}})}catch(d){Br(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):yr(d)&&(i=d),this.__store.setState(p=>({...p,statusCode:s?s.status:i?404:p.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(ra({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&&(i==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:tH(a.cachedMatches.map(l=>l.id===n?s(l):l))})):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{}if(n.options.href&&!n.options._builtLocation&&Ih(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");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=FN,this.preloadRoute=async n=>{const s=n._builtLocation??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)]);du(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await _T({router:this,matches:i,location:s,preload:!0,updateMatch:(f,d)=>{a.has(f)?i=i.map(p=>p.id===f?d(p):p):this.updateMatch(f,d)}}),i}catch(f){if(Br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});yr(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=wF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!na(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?na(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??qF,parseSearch:t.parseSearch??HF,protocolAllowlist:t.protocolAllowlist??yF}),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["**"]:Qo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?cH(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=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,C;{const Y=S?.search??t.search,ee=S?._strictSearch??void 0;try{const D=ch(x.options.validateSearch,{...Y})??void 0;w={...Y,...D},T={...ee,...D},C=void 0}catch(D){let K=D;if(D instanceof Lh||(K=new Lh(D.message,{cause:D})),n?.throwOnError)throw K;w=Y,T={},C=K}}const A=x.options.loaderDeps?.({search:w})??"",N=A?JSON.stringify(A):"",{interpolatedPath:R,usedParams:M}=bT({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+N,j=this.getMatch(L),k=y.get(x.id),P=j?._strictParams??M;let G;if(!j)try{wT(x,M,l,P)}catch(Y){if(yr(Y)||Br(Y)?G=Y:G=new rH(Y.message,{cause:Y}),n?.throwOnError)throw G}Object.assign(a,P);const B=k?"stay":"enter";let z;if(j)z={...j,cause:B,params:k?.params??a,_strictParams:P,search:ur(k?k.search:j.search,w),_strictSearch:T};else{const Y=x.options.loader||x.options.beforeLoad||x.lazyFn||HN(x)?"pending":"success";z={id:L,ssr:x.options.ssr,index:b,routeId:x.id,params:k?.params??a,_strictParams:P,pathname:R,updatedAt:Date.now(),search:k?ur(k.search,w):w,_strictSearch:T,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:G,__routeContext:void 0,_nonReactive:{loadPromise:zc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:k?ur(k.loaderDeps,A):A,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||(z.globalNotFound=p===x.id),z.searchError=C;const Q=this.getParentContext(S);z.context={...Q,...z.__routeContext,...z.__beforeLoadContext},g[b]=z}for(let b=0;b<g.length;b++){const x=g[b],S=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),T=y.get(x.routeId);if(x.params=T?ur(T.params,a):a,!w){const C=g[b-1],A=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:A??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:g,routeId:S.id};x.__routeContext=S.options.context(N)??void 0}x.context={...A,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=Tu(n),l={...t.search};for(const g of n)try{Object.assign(l,ch(g.options.validateSearch,l))}catch{}const f=Tu(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{wT(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class Lh extends Error{}class rH extends Error{}function sH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ch(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Lh("Async validation not supported");if(n.issues)throw new Lh(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 oH({pathname:e,routesById:t,processedTree:n}){const s={},i=Qo(e);let a,l;const f=EF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Lr]],routeParams:s,foundRoute:a,parsedParams:l}}function iH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return aH(n)(e,t,s??!1)}function aH(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,y)=>y(g),l));const p=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,y)=>y(g),p):p};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,...ch(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:Fo(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:p=>s(i+1,p,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function cH(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 Lr}function wT(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 lH="Error preloading route! ☝️";class KN{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=Lr:this.parentRoute||ro(!1);let a=i?Lr:s?.path;a&&a!=="/"&&(a=DN(a));const l=s?.id||a;let f=i?Lr:ih([this.parentRoute.id===Lr?"":this.parentRoute.id,l]);a===Lr&&(a="/"),f!==Lr&&(f=ih(["/",f]));const d=f===Lr?"/":ih([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Qo(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=>GF({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 uH extends KN{constructor(t){super(t)}}const Id=typeof window<"u"?_.useLayoutEffect:_.useEffect;function gy(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 fH(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 dH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function Ub(e){const t=e.errorComponent??$b;return h.jsx(hH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class hH 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 $b({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.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"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function pH({children:e,fallback:t=null}){return GN()?h.jsx(Ic.Fragment,{children:e}):h.jsx(Ic.Fragment,{children:t})}function GN(){return Ic.useSyncExternalStore(mH,()=>!0,()=>!1)}function mH(){return()=>{}}var yy={exports:{}},vy={},by={exports:{}},xy={};var ET;function gH(){if(ET)return xy;ET=1;var e=Gu();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&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(y,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})},[y,x,b]),i(function(){return d(w)&&T({inst:w}),y(function(){d(w)&&T({inst:w})})},[y]),l(x),x}function d(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!n(y,x)}catch{return!0}}function p(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return xy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,xy}var TT;function ZN(){return TT||(TT=1,by.exports=gH()),by.exports}var CT;function yH(){if(CT)return vy;CT=1;var e=Gu(),t=ZN();function n(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&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 vy.useSyncExternalStoreWithSelector=function(p,g,y,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 C(L){if(!A){if(A=!0,N=L,L=b(L),x!==void 0&&w.hasValue){var j=w.value;if(x(j,L))return R=j}return R=L}if(j=R,s(N,L))return j;var k=b(L);return x!==void 0&&x(j,k)?(N=L,j):(N=L,R=k)}var A=!1,N,R,M=y===void 0?null:y;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},vy}var RT;function vH(){return RT||(RT=1,yy.exports=yH()),yy.exports}var YN=vH();function bH(e,t){return e===t}function xH(e,t,n=bH){const s=_.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return YN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const XN=_.createContext(null);function Xr(e){const t=_.useContext(XN);return e?.warn,t}function vr(e){const t=Xr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return xH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ur(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const pp=_.createContext(void 0),SH=_.createContext(void 0);function Ss(e){const t=_.useContext(e.from?SH:pp);return vr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(ro(!((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 Bb(e){return Ss({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fb(e){const{select:t,...n}=e;return Ss({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Hb(e){return Ss({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 qb(e){return Ss({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mp(e){const t=Xr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=vN();function _H(e,t){const n=Xr(),s=dH(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:A,className:N,onClick:R,onBlur:M,onFocus:L,onMouseEnter:j,onMouseLeave:k,onTouchStart:P,ignoreBlocker:G,params:B,search:z,hash:Q,state:Y,mask:ee,reloadDocument:D,unsafeRelative:K,from:q,_fromLocation:V,...U}=e,I=GN(),H=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),W=e.from,X=_.useMemo(()=>({...e,from:W}),[n,H,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=_.useMemo(()=>n.buildLocation({...X}),[n,X]),se=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,de=oe.maskedLocation?oe.maskedLocation.external:oe.external,xe=_.useMemo(()=>NH(se,de,n.history,C),[C,de,se,n.history]),he=_.useMemo(()=>{if(xe?.external)return Ih(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!jH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Ih(f,n.protocolAllowlist)?void 0:f}catch{}},[f,xe,n.protocolAllowlist]),Me=vr({select:He=>{if(he)return!1;if(l?.exact){if(!AF(He.location.pathname,oe.pathname,n.basepath))return!1}else{const me=Dh(He.location.pathname,n.basepath),Te=Dh(oe.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!na(He.location.search,oe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?I&&He.location.hash===oe.hash:!0}}),_e=Me?Fo(i,{})??wH:Sy,ne=Me?Sy:Fo(a,{})??Sy,pe=[N,_e.className,ne.className].filter(Boolean).join(" "),ae=(A||_e.style||ne.style)&&{...A,..._e.style,...ne.style},[we,ve]=_.useState(!1),Se=_.useRef(!1),ye=e.reloadDocument||he?!1:d??n.options.defaultPreload,Ue=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...X,_builtLocation:oe}).catch(He=>{console.warn(He),console.warn(lH)})},[n,X,oe]),Ee=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);fH(s,Ee,RH,{disabled:!!C||ye!=="viewport"}),_.useEffect(()=>{Se.current||!C&&ye==="render"&&(Ie(),Se.current=!0)},[C,Ie,ye]);const Ve=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!AH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{ve(!0)});const qe=n.subscribe("onResolved",()=>{qe(),ve(!1)});n.navigate({...X,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:G})}};if(he)return{...U,ref:s,href:he,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...A&&{style:A},...N&&{className:N},...R&&{onClick:R},...M&&{onBlur:M},...L&&{onFocus:L},...j&&{onMouseEnter:j},...k&&{onMouseLeave:k},...P&&{onTouchStart:P}};const Xe=He=>{if(C||ye!=="intent")return;if(!Ue){Ie();return}const me=He.currentTarget;if(su.has(me))return;const Te=setTimeout(()=>{su.delete(me),Ie()},Ue);su.set(me,Te)},Be=He=>{C||ye!=="intent"||Ie()},We=He=>{if(C||!ye||!Ue)return;const me=He.currentTarget,Te=su.get(me);Te&&(clearTimeout(Te),su.delete(me))};return{...U,..._e,...ne,href:xe?.href,ref:s,onClick:lc([R,Ve]),onBlur:lc([M,We]),onFocus:lc([L,Xe]),onMouseEnter:lc([j,Xe]),onMouseLeave:lc([k,We]),onTouchStart:lc([P,Be]),disabled:!!C,target:T,...ae&&{style:ae},...pe&&{className:pe},...C&&EH,...Me&&TH,...I&&we&&CH}}const Sy={},wH={className:"active"},EH={role:"link","aria-disabled":!0},TH={"data-status":"active","aria-current":"page"},CH={"data-transitioning":"transitioning"},su=new WeakMap,RH={rootMargin:"100px"},lc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function NH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function jH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const xc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=_H(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 AH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let kH=class extends KN{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fb({...n,from:this.id}),this.useLoaderData=n=>Bb({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ao(e){return new kH(e)}class OH extends uH{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fb({...n,from:this.id}),this.useLoaderData=n=>Bb({...n,from:this.id}),this.useNavigate=()=>mp({from:this.fullPath}),this.Link=Ic.forwardRef((n,s)=>h.jsx(xc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function MH(e){return new OH(e)}function NT(e){return typeof e=="object"?new jT(e,{silent:!0}).createRoute(e):new jT(e,{silent:!0}).createRoute}class jT{constructor(t,n){this.path=t,this.createRoute=s=>{const i=ao(s);return i.isRoot=!1,i},this.silent=n?.silent}}class AT{constructor(t){this.useMatch=n=>Ss({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>qb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Hb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Fb({...n,from:this.options.id}),this.useLoaderData=n=>Bb({...n,from:this.options.id}),this.useNavigate=()=>{const n=Xr();return mp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function kT(e){return typeof e=="object"?new AT(e):t=>new AT({id:e,...t})}function IH(){const e=Xr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=vr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=gy(a),f=a||n||i,d=gy(f),p=a||i,g=gy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qo(e.latestLocation.publicHref)!==Qo(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Id(()=>{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]),Id(()=>{l&&!a&&e.emit({type:"onLoad",...ra(e.state)})},[l,e,a]),Id(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...ra(e.state)})},[p,g,e]),Id(()=>{if(d&&!f){const y=ra(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&$F(e)}},[f,d,e]),null}function PH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(Ub,{getResetKey:()=>t,onCatch:(n,s)=>{if(yr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function DH(){return h.jsx("p",{children:"Not Found"})}function uc(e){return h.jsx(h.Fragment,{children:e.children})}function QN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(DH,{})}function zH(){return Xr().isScrollRestoring,null}const WN=_.memo(function({matchId:t}){const n=Xr(),s=vr({select:w=>{const T=w.matches.findIndex(A=>A.id===t),C=w.matches[T];return ro(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._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?h.jsx(a,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",y=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?_.Suspense:uc,b=f?Ub:uc,x=p?PH:uc,S=i.isRoot?i.options.shellComponent??uc:uc;return h.jsxs(S,{children:[h.jsx(pp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||$b,onCatch:(w,T)=>{if(yr(w))throw w;d?.(w,T)},children:h.jsx(x,{fallback:w=>{if(!p||w.routeId&&w.routeId!==s.routeId||!w.routeId&&!i.isRoot)throw w;return _.createElement(p,w)},children:g||s._displayPending?h.jsx(pH,{fallback:l,children:h.jsx(OT,{matchId:t})}):h.jsx(OT,{matchId:t})})})})}),s.parentRouteId===Lr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(LH,{}),h.jsx(zH,{})]}):null]})});function LH(){const e=Xr(),t=_.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ra(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const OT=_.memo(function({matchId:t}){const n=Xr(),{match:s,key:i,routeId:a}=vr({select:d=>{const p=d.matches.find(S=>S.id===t),g=p.routeId,b=(n.routesById[g].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:g,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:g,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(JN,{})},[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 p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=zc();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ro(yr(s.error)),QN(n,l,s.error);if(s.status==="redirected")throw ro(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),JN=_.memo(function(){const t=Xr(),n=_.useContext(pp),s=vr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=vr({select:p=>{const y=p.matches.find(b=>b.id===n);return ro(y),y.globalNotFound}}),l=vr({select:p=>{const g=p.matches,y=g.findIndex(b=>b.id===n);return g[y+1]?.id}}),f=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(a)return QN(t,i,void 0);if(!l)return null;const d=h.jsx(WN,{matchId:l});return s===Lr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function UH(){const e=Xr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?uc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(IH,{}),h.jsx($H,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function $H(){const e=Xr(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),s=t?h.jsx(WN,{matchId:t}):null;return h.jsx(pp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(Ub,{getResetKey:()=>n,errorComponent:$b,onCatch:void 0,children:s})})}const BH=e=>new FH(e);class FH extends nH{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=NT,globalThis.createLazyFileRoute=kT):typeof window<"u"&&(window.createFileRoute=NT,window.createLazyFileRoute=kT);function HH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=h.jsx(XN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:s}):s}function qH({router:e,...t}){return h.jsx(HH,{router:e,...t,children:h.jsx(UH,{})})}const VH=/\{[^{}]+\}/g,KH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function GH(){return Math.random().toString(36).slice(2,11)}function ZH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...p}={...e};d=KH()?d:void 0,t=PT(t);const g=[];async function y(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:C,params:A={},parseAs:N="json",querySerializer:R,bodySerializer:M=a??XH,pathSerializer:L,body:j,middleware:k=[],...P}=x||{};let G=t;S&&(G=PT(S)??t);let B=typeof i=="function"?i:MT(i);R&&(B=typeof R=="function"?R:MT({...typeof i=="object"?i:{},...R}));const z=L||l||YH,Q=j===void 0?void 0:M(j,IT(f,C,A.header)),Y=IT(Q===void 0||Q instanceof FormData?{}:{"Content-Type":"application/json"},f,C,A.header),ee=[...g,...k],D={redirect:"follow",...p,...P,body:Q,headers:Y};let K,q,V=new T(QH(b,{baseUrl:G,params:A,querySerializer:B,pathSerializer:z}),D),U;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){K=GH(),q=Object.freeze({baseUrl:G,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:z});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const X=await W.onRequest({request:V,schemaPath:b,params:A,options:q,id:K});if(X)if(X instanceof T)V=X;else if(X instanceof Response){U=X;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await w(V,d)}catch(W){let X=W;if(ee.length)for(let oe=ee.length-1;oe>=0;oe--){const se=ee[oe];if(se&&typeof se=="object"&&typeof se.onError=="function"){const de=await se.onError({request:V,error:X,schemaPath:b,params:A,options:q,id:K});if(de){if(de instanceof Response){X=void 0,U=de;break}if(de instanceof Error){X=de;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(X)throw X}if(ee.length)for(let W=ee.length-1;W>=0;W--){const X=ee[W];if(X&&typeof X=="object"&&typeof X.onResponse=="function"){const oe=await X.onResponse({request:V,response:U,schemaPath:b,params:A,options:q,id:K});if(oe){if(!(oe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=oe}}}}const I=U.headers.get("Content-Length");if(U.status===204||V.method==="HEAD"||I==="0"&&!U.headers.get("Transfer-Encoding")?.includes("chunked"))return U.ok?{data:void 0,response:U}:{error:void 0,response:U};if(U.ok)return{data:await(async()=>{if(N==="stream")return U.body;if(N==="json"&&!I){const X=await U.text();return X?JSON.parse(X):void 0}return await U[N]()})(),response:U};let H=await U.text();try{H=JSON.parse(H)}catch{}return{error:H,response:U}}return{request(b,x,S){return y(x,{...S,method:b.toUpperCase()})},GET(b,x){return y(b,{...x,method:"GET"})},PUT(b,x){return y(b,{...x,method:"PUT"})},POST(b,x){return y(b,{...x,method:"POST"})},DELETE(b,x){return y(b,{...x,method:"DELETE"})},OPTIONS(b,x){return y(b,{...x,method:"OPTIONS"})},HEAD(b,x){return y(b,{...x,method:"HEAD"})},PATCH(b,x){return y(b,{...x,method:"PATCH"})},TRACE(b,x){return y(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 gp(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 ej(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(gp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function tj(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(gp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function MT(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(tj(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(ej(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(gp(i,a,e))}}return s.join("&")}}function YH(e,t){let n=e;for(const s of e.match(VH)??[]){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,tj(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,ej(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${gp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function XH(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 QH(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 IT(...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 PT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class WH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function JH(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 Xu(e){const{data:t,error:n}=await e;if(n||!t)throw new WH(JH(n),n);return t}function eq(e){const t=ZH({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 tq(e){return eq({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function nq(e){try{const{error:t,response:n}=await e.GET("/console/stats");if(!t)return;const s=n.status;let i=null;if(typeof t=="string")i=t;else if(t&&typeof t=="object"){const a=t,l=a.error,f=a.message;if(typeof l=="string"&&l.length>0)i=l;else if(typeof f=="string"&&f.length>0)i=f;else try{i=JSON.stringify(a)}catch{i=null}}throw new Error(i&&i.length>0?`Console API /console/stats returned ${s}: ${i}`:`Console API /console/stats returned ${s}`)}catch(t){throw t instanceof Error?t:new Error("Failed to connect to console API")}}const Ru="sync-console-connection";function Cv(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:{serverUrl:t,token:n}}function nj(e){return typeof window>"u"?null:e==="local"?window.localStorage:e==="session"?window.sessionStorage:null}function DT(e){const t=nj(e);if(!t)return null;try{const n=t.getItem(Ru);return n?Cv(JSON.parse(n)):null}catch{return null}}function rq(e,t){const n=nj(e);if(n)try{if(!t){n.removeItem(Ru);return}n.setItem(Ru,JSON.stringify(t))}catch{}}const rj=_.createContext(null);function sq({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:s="session"}){const[i,a]=_.useState(()=>DT(s));_.useEffect(()=>{const w=DT(s);a(w)},[s]),_.useEffect(()=>{typeof window>"u"||(s!=="local"&&window.localStorage.removeItem(Ru),s==="memory"&&window.sessionStorage.removeItem(Ru))},[s]);const l=_.useCallback(w=>{const T=Cv(w);a(T),rq(s,T)},[s]),[f,d]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),p=_.useRef(null);_.useEffect(()=>{if(!(i?.serverUrl?.trim()&&i.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){l({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[l,i,t]);const g=_.useCallback(async(w,T)=>{const C=w??i;if(!C)return d(N=>({...N,error:"No connection configured"})),!1;const A=Cv(C);if(!A){const N=(C.serverUrl?.trim()??"").length>0;return d(R=>({...R,error:N?"Token is required":"Server URL is required"})),!1}w&&(T?.persistOverride??!0)&&l(A),d(N=>({...N,isConnecting:!0,error:null}));try{const N=tq(A);return await nq(N),d({isConnected:!0,isConnecting:!1,client:N,error:null}),!0}catch(N){return d({isConnected:!1,isConnecting:!1,client:null,error:N instanceof Error?N.message:"Connection failed"}),!1}},[i,l]),y=_.useCallback(w=>{w?.clearSavedConfig&&l(null),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),b=_.useCallback(()=>{d(w=>({...w,error:null}))},[]),x=_.useCallback(w=>{l(w),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[l]),S=_.useMemo(()=>({config:i,setConfig:x,isConnected:f.isConnected,isConnecting:f.isConnecting,error:f.error,client:f.client,connect:g,disconnect:y,clearError:b}),[i,x,f,g,y,b]);return _.useEffect(()=>{if(!n||f.isConnected||f.isConnecting)return;const w=i??t,T=oq(w);!w||!T||p.current!==T&&(p.current=T,g(w,{persistOverride:!0}))},[n,i,t,f.isConnected,f.isConnecting,g]),h.jsx(rj.Provider,{value:S,children:e})}function oq(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function Dt(){const e=_.useContext(rj);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function sj(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=sj(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Vb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=sj(e))&&(s&&(s+=" "),s+=t);return s}var iq=e=>typeof e=="number"&&e!=+e,Uh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,zT=e=>(typeof e=="number"||e instanceof Number)&&!iq(e);function aq(){}var $h=Symbol("NOT_FOUND");function cq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function lq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function uq(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 LT=e=>Array.isArray(e)?e:[e];function fq(e){const t=Array.isArray(e[0])?e[0]:e;return uq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function hq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$h},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function pq(e,t){let n=[];function s(f){const d=n.findIndex(p=>t(f,p.key));if(d>-1){const p=n[d];return d>0&&(n.splice(d,1),n.unshift(p)),p.value}return $h}function i(f,d){s(f)===$h&&(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 mq=(e,t)=>e===t;function gq(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 yq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=mq,maxSize:i=1,resultEqualityCheck:a}=n,l=gq(s);let f=0;const d=i<=1?hq(l):pq(i,l);function p(){let g=d.get(arguments);if(g===$h){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 p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var vq=class{constructor(e){this.value=e}deref(){return this.value}},bq=typeof WeakRef<"u"?WeakRef:vq,xq=0,UT=1;function Pd(){return{s:xq,v:void 0,o:null,p:null}}function oj(e,t={}){let n=Pd();const{resultEqualityCheck:s}=t;let i,a=0;function l(){let f=n;const{length:d}=arguments;for(let y=0,b=d;y<b;y++){const x=arguments[y];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=Pd(),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=Pd(),S.set(x,f)):f=w}}const p=f;let g;if(f.s===UT)g=f.v;else if(g=e.apply(null,arguments),a++,s){const y=i?.deref?.()??i;y!=null&&s(y,g)&&(g=y,a!==0&&a--),i=typeof g=="object"&&g!==null||typeof g=="function"?new bq(g):g}return p.s=UT,p.v=g,g}return l.clearCache=()=>{n=Pd(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function ij(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),cq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=oj,argsMemoizeOptions:S=[]}=g,w=LT(b),T=LT(S),C=fq(i),A=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=dq(C,arguments);return f=A.apply(null,M),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:A,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var Sq=ij(oj),_q=Object.assign((e,t=Sq)=>{lq(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:()=>_q});function Bh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var _y={},wy={},Ey={},$T;function wq(){return $T||($T=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"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=void 0,f=null)},y=()=>{p&&g(),w()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,y()},s)},S=()=>{b!==null&&(clearTimeout(b),b=null)},w=()=>{S(),l=void 0,f=null},T=()=>{g()},C=function(...A){if(i?.aborted)return;l=this,f=A;const N=b==null;x(),d&&N&&g()};return C.schedule=x,C.cancel=w,C.flush=T,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(Ey)),Ey}var BT;function Eq(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);l&&(p[0]="leading"),f&&(p[1]="trailing");let g,y=null;const b=t.debounce(function(...w){g=s.apply(this,w),y=null},i,{edges:p}),x=function(...w){return d!=null&&(y===null&&(y=Date.now()),Date.now()-y>=d)?(g=s.apply(this,w),y=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})(wy)),wy}var FT;function Tq(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Eq();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})(_y)),_y}var Ty,HT;function Cq(){return HT||(HT=1,Ty=Tq().throttle),Ty}var Rq=Cq();const Nq=z1(Rq);var qT=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++]))}},bs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},aj=(e,t,n)=>{var{width:s=bs.width,height:i=bs.height,aspect:a,maxHeight:l}=n,f=Uh(s)?e:Number(s),d=Uh(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}},jq={width:0,height:0,overflow:"visible"},Aq={width:0,overflowX:"visible"},kq={height:0,overflowY:"visible"},Oq={},Mq=e=>{var{width:t,height:n}=e,s=Uh(t),i=Uh(n);return s&&i?jq:s?Aq:i?kq:Oq};function Iq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bs.width,a=bs.height):i===void 0?i=s&&s>0?void 0:bs.width:a===void 0&&(a=s&&s>0?void 0:bs.height),{width:i,height:a}}function Rv(){return Rv=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},Rv.apply(null,arguments)}function VT(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?VT(Object(n),!0).forEach(function(s){Pq(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Pq(e,t,n){return(t=Dq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dq(e){var t=zq(e,"string");return typeof t=="symbol"?t:t+""}function zq(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 cj=_.createContext(bs.initialDimension);function Lq(e){return Bh(e.width)&&Bh(e.height)}function lj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Lq(i)?_.createElement(cj.Provider,{value:i},t):null}var Uq=()=>_.useContext(cj),$q=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=bs.initialDimension,width:i,height:a,minWidth:l=bs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=bs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,A]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((k,P)=>{A(G=>{var B=Math.round(k),z=Math.round(P);return G.containerWidth===B&&G.containerHeight===z?G:{containerWidth:B,containerHeight:z}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return aq;var k=z=>{var Q,Y=z[0];if(Y!=null){var{width:ee,height:D}=Y.contentRect;N(ee,D),(Q=T.current)===null||Q===void 0||Q.call(T,ee,D)}};g>0&&(k=Nq(k,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(k),{width:G,height:B}=w.current.getBoundingClientRect();return N(G,B),P.observe(w.current),()=>{P.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:M}=C;qT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:L,calculatedHeight:j}=aj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return qT(L!=null&&L>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
68
68
|
please check the style of container, or the props width(%s) and height(%s),
|
|
69
69
|
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
70
|
-
height and width.`,L,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Vb("recharts-responsive-container",b),style:KT(KT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Mq({width:i,height:a})},_.createElement(lj,{width:L,height:j},p)))}),Bq=_.forwardRef((e,t)=>{var n=Uq();if(Bh(n.width)&&Bh(n.height))return e.children;var{width:s,height:i}=Iq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=aj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return zT(a)&&zT(l)?_.createElement(lj,{width:a,height:l},e.children):_.createElement($q,Rv({},e,{width:s,height:i,ref:t}))});const Fq=(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},Hq=(e,t)=>({classGroupId:e,validator:t}),uj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fh="-",GT=[],qq="arbitrary..",Vq=e=>{const t=Gq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Kq(l);const f=l.split(Fh),d=f[0]===""&&f.length>1?1:0;return fj(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?Fq(p,d):d:p||GT}return n[l]||GT}}},fj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=fj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join(Fh):e.slice(t).join(Fh),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},Kq=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?qq+s:void 0})(),Gq=e=>{const{theme:t,classGroups:n}=e;return Zq(n,t)},Zq=(e,t)=>{const n=uj();for(const s in e){const i=e[s];Kb(i,n,s,t)}return n},Kb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Yq(l,t,n,s)}},Yq=(e,t,n,s)=>{if(typeof e=="string"){Xq(e,t,n);return}if(typeof e=="function"){Qq(e,t,n,s);return}Wq(e,t,n,s)},Xq=(e,t,n)=>{const s=e===""?t:dj(t,e);s.classGroupId=n},Qq=(e,t,n,s)=>{if(Jq(e)){Kb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Hq(n,e))},Wq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];Kb(d,dj(t,f),n,s)}},dj=(e,t)=>{let n=e;const s=t.split(Fh),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=uj(),n.nextPart.set(l,f)),n=f}return n},Jq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,e9=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)}}},Nv="!",ZT=":",t9=[],YT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),n9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===ZT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Nv)?(b=y.slice(0,-1),x=!0):y.startsWith(Nv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return YT(a,x,b,S)};if(t){const i=t+ZT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):YT(t9,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},r9=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}},s9=e=>({cache:e9(e.cacheSize),parseClassName:n9(e),sortModifiers:r9(e),...Vq(e)}),o9=/\s+/,i9=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(o9);let d="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(g);if(y){d=g+(d.length>0?" "+d:d);continue}let T=!!w,C=s(T?S.substring(0,w):S);if(!C){if(!T){d=g+(d.length>0?" "+d:d);continue}if(C=s(S),!C){d=g+(d.length>0?" "+d:d);continue}T=!1}const k=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?k+Nv:k,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let L=0;L<M.length;++L){const j=M[L];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},a9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=hj(n))&&(i&&(i+=" "),i+=s);return i},hj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=hj(e[s]))&&(n&&(n+=" "),n+=t);return n},c9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=s9(p),s=n.cache.get,i=n.cache.set,a=f,f(d)},f=d=>{const p=s(d);if(p)return p;const g=i9(d,n);return i(d,g),g};return a=l,(...d)=>a(a9(...d))},l9=[],dn=e=>{const t=n=>n[e]||l9;return t.isThemeGetter=!0,t},pj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,f9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d9=/\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$/,h9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,p9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,m9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lo=e=>u9.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),Cy=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Hs=e=>f9.test(e),gj=()=>!0,g9=e=>d9.test(e)&&!h9.test(e),Gb=()=>!1,y9=e=>p9.test(e),v9=e=>m9.test(e),b9=e=>!Ne(e)&&!je(e),x9=e=>pi(e,bj,Gb),Ne=e=>pj.test(e),Hi=e=>pi(e,xj,g9),XT=e=>pi(e,N9,Qe),S9=e=>pi(e,_j,gj),_9=e=>pi(e,Sj,Gb),QT=e=>pi(e,yj,Gb),w9=e=>pi(e,vj,v9),Dd=e=>pi(e,wj,y9),je=e=>mj.test(e),ou=e=>ya(e,xj),E9=e=>ya(e,Sj),WT=e=>ya(e,yj),T9=e=>ya(e,bj),C9=e=>ya(e,vj),zd=e=>ya(e,wj,!0),R9=e=>ya(e,_j,!0),pi=(e,t,n)=>{const s=pj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},ya=(e,t,n=!1)=>{const s=mj.exec(e);return s?s[1]?t(s[1]):n:!1},yj=e=>e==="position"||e==="percentage",vj=e=>e==="image"||e==="url",bj=e=>e==="length"||e==="size"||e==="bg-size",xj=e=>e==="length",N9=e=>e==="number",Sj=e=>e==="family-name",_j=e=>e==="number"||e==="weight",wj=e=>e==="shadow",j9=()=>{const e=dn("color"),t=dn("font"),n=dn("text"),s=dn("font-weight"),i=dn("tracking"),a=dn("leading"),l=dn("breakpoint"),f=dn("container"),d=dn("spacing"),p=dn("radius"),g=dn("shadow"),y=dn("inset-shadow"),b=dn("text-shadow"),x=dn("drop-shadow"),S=dn("blur"),w=dn("perspective"),T=dn("aspect"),C=dn("ease"),k=dn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),je,Ne],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[je,Ne,d],P=()=>[Lo,"full","auto",...A()],G=()=>[Uo,"none","subgrid",je,Ne],B=()=>["auto",{span:["full",Uo,je,Ne]},Uo,je,Ne],z=()=>[Uo,"auto",je,Ne],Q=()=>["auto","min","max","fr",je,Ne],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],K=()=>[Lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Lo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[Lo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],U=()=>[e,je,Ne],I=()=>[...R(),WT,QT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",T9,x9,{size:[je,Ne]}],X=()=>[Cy,ou,Hi],oe=()=>["","none","full",p,je,Ne],se=()=>["",Qe,ou,Hi],de=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Qe,Cy,WT,QT],Me=()=>["","none",S,je,Ne],_e=()=>["none",Qe,je,Ne],ne=()=>["none",Qe,je,Ne],pe=()=>[Qe,je,Ne],ae=()=>[Lo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[gj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[b9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Qe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lo,Ne,je,T]}],container:["container"],columns:[{columns:[Qe,Ne,je,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:M()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",je,Ne]}],basis:[{basis:[Lo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Lo,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,je,Ne]}],shrink:[{shrink:["",Qe,je,Ne]}],order:[{order:[Uo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...K()]}],"min-w":[{"min-w":[f,"screen","none",...K()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ou,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,R9,S9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cy,Ne]}],"font-family":[{font:[E9,_9,t]}],"font-features":[{"font-features":[Ne]}],"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":[Qe,"none",je,XT]}],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:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",je,Hi]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Qe,"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:I()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,je,Ne],radial:["",je,Ne],conic:[Uo,je,Ne]},C9,w9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"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-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":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:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,je,Ne]}],"outline-w":[{outline:["",Qe,ou,Hi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,zd,Dd]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",y,zd,Dd]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Qe,Hi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,zd,Dd]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Qe,je,Ne]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"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":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"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":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"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":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"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":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"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":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"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":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"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":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"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:I()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Me()}],brightness:[{brightness:[Qe,je,Ne]}],contrast:[{contrast:[Qe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,zd,Dd]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Qe,je,Ne]}],"hue-rotate":[{"hue-rotate":[Qe,je,Ne]}],invert:[{invert:["",Qe,je,Ne]}],saturate:[{saturate:[Qe,je,Ne]}],sepia:[{sepia:["",Qe,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Qe,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,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:[Qe,"initial",je,Ne]}],ease:[{ease:["linear","initial",C,je,Ne]}],delay:[{delay:[Qe,je,Ne]}],animate:[{animate:["none",k,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"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-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":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-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":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:[Qe,ou,Hi,XT]}],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","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},A9=c9(j9);function ge(...e){return A9(Vb(e))}const k9={light:"",dark:".dark"},Ej=_.createContext(null);function O9(){const e=_.useContext(Ej);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const M9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(Ej.Provider,{value:{config:s},children:h.jsxs("div",{className:ge("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:[h.jsx(I9,{config:s,id:f}),h.jsx(Bq,{initialDimension:{width:1,height:1},children:n})]})})});M9.displayName="ChartContainer";function I9({config:e,id:t}){const n=Object.entries(e).filter(([,s])=>s.theme||s.color);return n.length<1?null:h.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(k9).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(`
|
|
70
|
+
height and width.`,L,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Vb("recharts-responsive-container",b),style:KT(KT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Mq({width:i,height:a})},_.createElement(lj,{width:L,height:j},p)))}),Bq=_.forwardRef((e,t)=>{var n=Uq();if(Bh(n.width)&&Bh(n.height))return e.children;var{width:s,height:i}=Iq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=aj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return zT(a)&&zT(l)?_.createElement(lj,{width:a,height:l},e.children):_.createElement($q,Rv({},e,{width:s,height:i,ref:t}))});const Fq=(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},Hq=(e,t)=>({classGroupId:e,validator:t}),uj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fh="-",GT=[],qq="arbitrary..",Vq=e=>{const t=Gq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Kq(l);const f=l.split(Fh),d=f[0]===""&&f.length>1?1:0;return fj(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?Fq(p,d):d:p||GT}return n[l]||GT}}},fj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=fj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join(Fh):e.slice(t).join(Fh),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},Kq=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?qq+s:void 0})(),Gq=e=>{const{theme:t,classGroups:n}=e;return Zq(n,t)},Zq=(e,t)=>{const n=uj();for(const s in e){const i=e[s];Kb(i,n,s,t)}return n},Kb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Yq(l,t,n,s)}},Yq=(e,t,n,s)=>{if(typeof e=="string"){Xq(e,t,n);return}if(typeof e=="function"){Qq(e,t,n,s);return}Wq(e,t,n,s)},Xq=(e,t,n)=>{const s=e===""?t:dj(t,e);s.classGroupId=n},Qq=(e,t,n,s)=>{if(Jq(e)){Kb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Hq(n,e))},Wq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];Kb(d,dj(t,f),n,s)}},dj=(e,t)=>{let n=e;const s=t.split(Fh),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=uj(),n.nextPart.set(l,f)),n=f}return n},Jq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,e9=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)}}},Nv="!",ZT=":",t9=[],YT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),n9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===ZT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Nv)?(b=y.slice(0,-1),x=!0):y.startsWith(Nv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return YT(a,x,b,S)};if(t){const i=t+ZT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):YT(t9,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},r9=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}},s9=e=>({cache:e9(e.cacheSize),parseClassName:n9(e),sortModifiers:r9(e),...Vq(e)}),o9=/\s+/,i9=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(o9);let d="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(g);if(y){d=g+(d.length>0?" "+d:d);continue}let T=!!w,C=s(T?S.substring(0,w):S);if(!C){if(!T){d=g+(d.length>0?" "+d:d);continue}if(C=s(S),!C){d=g+(d.length>0?" "+d:d);continue}T=!1}const A=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?A+Nv:A,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let L=0;L<M.length;++L){const j=M[L];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},a9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=hj(n))&&(i&&(i+=" "),i+=s);return i},hj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=hj(e[s]))&&(n&&(n+=" "),n+=t);return n},c9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=s9(p),s=n.cache.get,i=n.cache.set,a=f,f(d)},f=d=>{const p=s(d);if(p)return p;const g=i9(d,n);return i(d,g),g};return a=l,(...d)=>a(a9(...d))},l9=[],dn=e=>{const t=n=>n[e]||l9;return t.isThemeGetter=!0,t},pj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,f9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d9=/\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$/,h9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,p9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,m9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lo=e=>u9.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),Cy=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Hs=e=>f9.test(e),gj=()=>!0,g9=e=>d9.test(e)&&!h9.test(e),Gb=()=>!1,y9=e=>p9.test(e),v9=e=>m9.test(e),b9=e=>!Ne(e)&&!je(e),x9=e=>pi(e,bj,Gb),Ne=e=>pj.test(e),Hi=e=>pi(e,xj,g9),XT=e=>pi(e,N9,Qe),S9=e=>pi(e,_j,gj),_9=e=>pi(e,Sj,Gb),QT=e=>pi(e,yj,Gb),w9=e=>pi(e,vj,v9),Dd=e=>pi(e,wj,y9),je=e=>mj.test(e),ou=e=>ya(e,xj),E9=e=>ya(e,Sj),WT=e=>ya(e,yj),T9=e=>ya(e,bj),C9=e=>ya(e,vj),zd=e=>ya(e,wj,!0),R9=e=>ya(e,_j,!0),pi=(e,t,n)=>{const s=pj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},ya=(e,t,n=!1)=>{const s=mj.exec(e);return s?s[1]?t(s[1]):n:!1},yj=e=>e==="position"||e==="percentage",vj=e=>e==="image"||e==="url",bj=e=>e==="length"||e==="size"||e==="bg-size",xj=e=>e==="length",N9=e=>e==="number",Sj=e=>e==="family-name",_j=e=>e==="number"||e==="weight",wj=e=>e==="shadow",j9=()=>{const e=dn("color"),t=dn("font"),n=dn("text"),s=dn("font-weight"),i=dn("tracking"),a=dn("leading"),l=dn("breakpoint"),f=dn("container"),d=dn("spacing"),p=dn("radius"),g=dn("shadow"),y=dn("inset-shadow"),b=dn("text-shadow"),x=dn("drop-shadow"),S=dn("blur"),w=dn("perspective"),T=dn("aspect"),C=dn("ease"),A=dn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),je,Ne],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],k=()=>[je,Ne,d],P=()=>[Lo,"full","auto",...k()],G=()=>[Uo,"none","subgrid",je,Ne],B=()=>["auto",{span:["full",Uo,je,Ne]},Uo,je,Ne],z=()=>[Uo,"auto",je,Ne],Q=()=>["auto","min","max","fr",je,Ne],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...k()],K=()=>[Lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],q=()=>[Lo,"screen","full","dvw","lvw","svw","min","max","fit",...k()],V=()=>[Lo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],U=()=>[e,je,Ne],I=()=>[...R(),WT,QT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",T9,x9,{size:[je,Ne]}],X=()=>[Cy,ou,Hi],oe=()=>["","none","full",p,je,Ne],se=()=>["",Qe,ou,Hi],de=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Qe,Cy,WT,QT],Me=()=>["","none",S,je,Ne],_e=()=>["none",Qe,je,Ne],ne=()=>["none",Qe,je,Ne],pe=()=>[Qe,je,Ne],ae=()=>[Lo,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[gj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[b9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Qe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lo,Ne,je,T]}],container:["container"],columns:[{columns:[Qe,Ne,je,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:M()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",je,Ne]}],basis:[{basis:[Lo,"full","auto",f,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Lo,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,je,Ne]}],shrink:[{shrink:["",Qe,je,Ne]}],order:[{order:[Uo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...K()]}],"min-w":[{"min-w":[f,"screen","none",...K()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ou,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,R9,S9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cy,Ne]}],"font-family":[{font:[E9,_9,t]}],"font-features":[{"font-features":[Ne]}],"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":[Qe,"none",je,XT]}],leading:[{leading:[a,...k()]}],"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:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",je,Hi]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Qe,"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:k()}],"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:I()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,je,Ne],radial:["",je,Ne],conic:[Uo,je,Ne]},C9,w9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"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-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":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:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,je,Ne]}],"outline-w":[{outline:["",Qe,ou,Hi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,zd,Dd]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",y,zd,Dd]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Qe,Hi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,zd,Dd]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Qe,je,Ne]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"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":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"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":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"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":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"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":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"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":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"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":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"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":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"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:I()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Me()}],brightness:[{brightness:[Qe,je,Ne]}],contrast:[{contrast:[Qe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,zd,Dd]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Qe,je,Ne]}],"hue-rotate":[{"hue-rotate":[Qe,je,Ne]}],invert:[{invert:["",Qe,je,Ne]}],saturate:[{saturate:[Qe,je,Ne]}],sepia:[{sepia:["",Qe,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Qe,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,je,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"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:[Qe,"initial",je,Ne]}],ease:[{ease:["linear","initial",C,je,Ne]}],delay:[{delay:[Qe,je,Ne]}],animate:[{animate:["none",A,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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:[Qe,ou,Hi,XT]}],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","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},A9=c9(j9);function ge(...e){return A9(Vb(e))}const k9={light:"",dark:".dark"},Ej=_.createContext(null);function O9(){const e=_.useContext(Ej);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const M9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(Ej.Provider,{value:{config:s},children:h.jsxs("div",{className:ge("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:[h.jsx(I9,{config:s,id:f}),h.jsx(Bq,{initialDimension:{width:1,height:1},children:n})]})})});M9.displayName="ChartContainer";function I9({config:e,id:t}){const n=Object.entries(e).filter(([,s])=>s.theme||s.color);return n.length<1?null:h.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(k9).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
71
|
`);return`${i} [data-chart='${t}'] {
|
|
72
72
|
${a}
|
|
73
73
|
}`}).join(`
|
|
74
|
-
`)}})}const P9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=O9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const k=`${g||C.dataKey||C.name||"value"}`,N=JT(S,C,k),R=!g&&typeof f=="string"?S[f]?.label??f:N?.label;return p?h.jsx("div",{className:ge("font-medium",d),children:p(R??"",b)}):R?h.jsx("div",{className:ge("font-medium",d),children:R}):null},[S,a,f,d,p,g,b]);if(!e||!b?.length)return null;const T=b.length===1&&l!=="dot";return h.jsxs("div",{className:ge("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,h.jsx("div",{className:"grid gap-1.5",children:b.map((C,k)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=JT(S,C,N),M=n||C.payload?.fill||C.color;return h.jsx("div",{className:ge("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&&C.value!==void 0&&C.name?s(C.value,C.name,C,k,C.payload??{}):h.jsxs(h.Fragment,{children:[R?.icon?h.jsx(R.icon,{}):i?null:h.jsx("div",{className:ge("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":M,"--color-border":M}}),h.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[h.jsxs("div",{className:"grid gap-1.5",children:[T?w:null,h.jsx("span",{className:"text-neutral-500",children:R?.label||C.name})]}),C.value!==void 0?h.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof C.value=="number"?C.value.toLocaleString():C.value}):null]})]})},N)})})]})});P9.displayName="ChartTooltipContent";function JT(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 D9=["1h","6h","24h","7d"],Tj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="now",...f},d)=>h.jsxs("div",{ref:d,className:ge("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),h.jsx("div",{className:"flex gap-0.5 ml-2",children:D9.map(p=>h.jsx("button",{type:"button",onClick:()=>s?.(p),className:ge("font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all",p===n?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:p},p))})]})]}),h.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((p,g)=>h.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[h.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pullPercent}%`}}),h.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pushPercent}%`}})]},g))}),h.jsxs("div",{className:"flex justify-between mt-1.5",children:[h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:i}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:a}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:l})]})]}));Tj.displayName="ActivityBars";const eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=Vb,mi=(e,t)=>n=>{var s;if(t?.variants==null)return tC(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(p=>{const g=n?.[p],y=a?.[p];if(g===null)return null;const b=eC(g)||eC(y);return i[p][b]}),f=n&&Object.entries(n).reduce((p,g)=>{let[y,b]=g;return b===void 0||(p[y]=b),p},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,g)=>{let{class:y,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})?[...p,y,b]:p},[]);return tC(e,l,d,n?.class,n?.className)},z9=mi("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"}}),Gn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(z9({variant:t,className:e})),...n}));Gn.displayName="Input";function yp({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(p=>{i||l(p)},[]);return[f,d]}const nC={};function zn(e,t){const n=_.useRef(nC);return n.current===nC&&(n.current=e(t)),n}const Ry=L1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],L9=Ry&&Ry!==_.useLayoutEffect?Ry:e=>e();function Ae(e){const t=zn(U9).current;return t.next=e,L9(t.effect),t.trampoline}function U9(){const e={next:void 0,callback:$9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function $9(){}function so(e,t,n,s){const i=zn(Cj).current;return F9(i,e,t,n,s)&&Rj(i,[e,t,n,s]),i.callback}function B9(e){const t=zn(Cj).current;return H9(t,e)&&Rj(t,e),t.callback}function Cj(){return{callback:null,cleanup:null,refs:[]}}function F9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function H9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function Rj(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 q9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:q9,Nj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vp={...Nj,position:"fixed",top:0,left:0},jj={...Nj,position:"absolute"};function jn(){}const Nu=Object.freeze([]),an=Object.freeze({});function yn(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 V9=parseInt(_.version,10);function Zb(e){return V9>=e}function rC(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Zb(19)?n?.ref:t.ref)??null}function jv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function K9(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 G9(e,t){return typeof e=="function"?e(t):e}function Z9(e,t){return typeof e=="function"?e(t):e}const hu={};function oi(e,t,n,s,i){let a={...Av(e,hu)};return t&&(a=lu(a,t)),n&&(a=lu(a,n)),s&&(a=lu(a,s)),i&&(a=lu(a,i)),a}function Y9(e){if(e.length===0)return hu;if(e.length===1)return Av(e[0],hu);let t={...Av(e[0],hu)};for(let n=1;n<e.length;n+=1)t=lu(t,e[n]);return t}function lu(e,t){return Aj(t)?t(e):X9(e,t)}function X9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=jv(e.style,s);break}case"className":{e[n]=kj(e.className,s);break}default:Q9(n,s)?e[n]=W9(e[n],s):e[n]=s}}return e}function Q9(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 Aj(e){return typeof e=="function"}function Av(e,t){return Aj(e)?e(t):e??hu}function W9(e,t){return t?e?n=>{if(J9(n)){const i=n;kv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function kv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function kj(e,t){return t?e?t+" "+e:t:e}function J9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const e8={style:{transition:"none"}},t8="data-base-ui-click-trigger",n8={fallbackAxisSide:"none"},r8={fallbackAxisSide:"end"},s8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=o8(t,n);if(n.enabled===!1)return null;const a=n.state??an;return a8(e,s,i,a)}function o8(e,t={}){const{className:n,style:s,render:i}=e,{state:a=an,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?G9(n,a):void 0,y=p?Z9(s,a):void 0,b=p?K9(a,d):an,x=p?jv(b,Array.isArray(f)?Y9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=B9([x.ref,rC(i),...l]):x.ref=so(x.ref,rC(i),l):so(null,null)),p?(g!==void 0&&(x.className=kj(x.className,g)),y!==void 0&&(x.style=jv(x.style,y)),x):an}const i8=Symbol.for("react.lazy");function a8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=oi(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===i8&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return c8(e,n);throw new Error(yn(8))}function c8(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 l8={...L1};let sC=0;function u8(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(sC+=1,s(`${t}-${sC}`))},[n,t]),i}const oC=l8.useId;function Qu(e,t){if(oC!==void 0){const n=oC();return e??(t?`${t}-${n}`:n)}return u8(e,t)}function br(e){return Qu(e,"base-ui")}function bp(){return typeof window<"u"}function gi(e){return Yb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Yb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yb(e){return bp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return bp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return bp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Ov(e){return!bp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const f8=new Set(["inline","contents"]);function yi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!f8.has(i)}const d8=new Set(["table","td","th"]);function h8(e){return d8.has(gi(e))}const p8=[":popover-open",":modal"];function xp(e){return p8.some(t=>{try{return e.matches(t)}catch{return!1}})}const m8=["transform","translate","scale","rotate","perspective"],g8=["transform","translate","scale","rotate","perspective","filter"],y8=["paint","layout","strict","content"];function Xb(e){const t=Sp(),n=jt(e)?xr(e):e;return m8.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)||g8.some(s=>(n.willChange||"").includes(s))||y8.some(s=>(n.contain||"").includes(s))}function v8(e){let t=oo(e);for(;Zt(t)&&!Ys(t);){if(Xb(t))return t;if(xp(t))return null;t=oo(t)}return null}function Sp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const b8=new Set(["html","body","#document"]);function Ys(e){return b8.has(gi(e))}function xr(e){return un(e).getComputedStyle(e)}function _p(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(gi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ov(e)&&e.host||_s(e);return Ov(t)?t.host:t}function Oj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&yi(t)?t:Oj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Oj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Mv(l);return t.concat(l,l.visualViewport||[],yi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Mv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mj=_.createContext(void 0);function Ij(e=!1){const t=_.useContext(Mj);if(t===void 0&&!e)throw new Error(yn(16));return t}function x8(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 p={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return s||(p.tabIndex=i,!a&&n&&(p.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,l,f,a,i])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Ij(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=x8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;S8(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);Le(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...k}=b;return oi({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(kv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,L=R.key==="Enter",j=R.key===" ";M&&((j||L)&&R.preventDefault(),L&&x?.(R))},onKeyUp(R){t||(kv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,k)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function S8(e){return Zt(e)&&e.tagName==="BUTTON"}const Pj=_.createContext(void 0);function _8(){const e=_.useContext(Pj);if(e===void 0)throw new Error(yn(63));return e}let iC=(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 wp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vi={valid(e){return e===null?null:e?{[iC.valid]:""}:{[iC.invalid]:""}}};let aC=(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 Dj={...vi,checked(e){return e?{[aC.checked]:""}:{[aC.unchecked]:""}}};function Iv(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const w8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function tl(){return _.useContext(w8)}const zj=_.createContext({invalid:void 0,name:void 0,validityData:{state:wp,errors:[],error:"",value:"",initialValue:null},setValidityData:jn,disabled:void 0,touched:!1,setTouched:jn,dirty:!1,setDirty:jn,filled:!1,setFilled:jn,focused:!1,setFocused:jn,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=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}});function bi(e=!0){const t=_.useContext(zj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function Lj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=tl(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=bi(),b=Ae(e.getValue);Le(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&y(S=>({...S,initialValue:x}))},[t,y,n,g.initialValue,b]),Le(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:Iv(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),p.current=!0,x?hi.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,p,i,g,n]),Le(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Uj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function co(){return _.useContext(Uj)}function $j(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=co(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===jn||(p.current=!1,a(d.current,void 0))});return Le(()=>{if(a===jn)return;let b;if(n){const x=s?.current;jt(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{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,y]),_.useEffect(()=>y,[y]),i??l}const ii="none",cC="trigger-press",Pv="trigger-hover",Bj="outside-press",Ny="item-press",Fj="focus-out",E8="escape-key",T8="cancel-open",C8="imperative-action",R8="window-resize";function Yt(e,t,n,s){let i=!1,a=!1;const l=s??an;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 Hj(e,t){const n=_.useRef(e),s=Ae(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const N8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,inputRef:f,name:d,nativeButton:p=!1,onCheckedChange:g,readOnly:y=!1,required:b=!1,disabled:x=!1,render:S,uncheckedValue:w,value:T,...C}=t,{clearErrors:k}=tl(),{state:N,setTouched:R,setDirty:M,validityData:L,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:G,disabled:B,name:z,validation:Q}=bi(),{labelId:Y}=co(),ee=B||x,D=z??d,K=Ae(g),q=_.useRef(null),V=so(q,f,Q.inputRef),U=_.useRef(null),I=br(),H=$j({id:l,implicit:!1,controlRef:U}),W=p?void 0:H,[X,oe]=yp({controlled:s,default:!!a,name:"Switch",state:"checked"});Lj({id:I,commit:Q.commit,value:X,controlRef:U,name:D,getValue:()=>X}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Hj(X,()=>{k(D),M(X!==L.initialValue),j(X),P()?Q.commit(X):Q.commit(X,!0)});const{getButtonProps:se,buttonRef:de}=el({disabled:ee,native:p}),xe={id:p?H:I,role:"switch","aria-checked":X,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":Y,onFocus(){ee||A(!0)},onBlur(){const ne=q.current;!ne||ee||(R(!0),A(!1),G==="onBlur"&&Q.commit(ne.checked))},onClick(ne){y||ee||(ne.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ne.shiftKey,ctrlKey:ne.ctrlKey,altKey:ne.altKey,metaKey:ne.metaKey})))}},he=_.useMemo(()=>oi({checked:X,disabled:ee,id:W,name:D,required:b,style:D?jj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const pe=ne.target.checked,ae=Yt(ii,ne.nativeEvent);K?.(pe,ae),!ae.isCanceled&&oe(pe)},onFocus(){U.current?.focus()}},Q.getInputValidationProps,T!==void 0?{value:T}:an),[X,ee,V,W,D,K,b,oe,Q,T]),Me=_.useMemo(()=>({...N,checked:X,disabled:ee,readOnly:y,required:b}),[N,X,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,U,de],props:[xe,Q.getValidationProps,C,se],stateAttributesMapping:Dj});return h.jsxs(Pj.Provider,{value:Me,children:[_e,!X&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...he})]})}),j8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=bi(),f=_8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:Dj,props:a})}),Ep=_.forwardRef(({className:e,...t},n)=>h.jsx(N8,{ref:n,className:ge("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:h.jsx(j8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Ep.displayName="Switch";const qj=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),h.jsx(Ep,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(jy,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(jy,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(jy,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});qj.displayName="AlertsConfig";function jy({label:e,value:t,onChange:n}){return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),h.jsx(Gn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const A8=mi("inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] leading-normal 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"}}),mn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(A8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));mn.displayName="Badge";const nl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));nl.displayName="Table";const rl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));rl.displayName="TableHeader";const sl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));sl.displayName="TableBody";const os=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"row",className:ge("font-mono text-[11px] leading-6 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",e),...t}));os.displayName="TableRow";const ht=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"columnheader",className:ge("min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate",e),...t}));ht.displayName="TableHead";const pt=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"cell",className:ge("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));pt.displayName="TableCell";const k8={relay:"relay",admin:"flow",proxy:"ghost"},O8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>h.jsx("div",{ref:l,className:ge("w-full",e),...a,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(sl,{children:t.map((f,d)=>h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(mn,{variant:k8[f.type]??"ghost",children:f.type})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-500 truncate",children:f.prefix})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-600 truncate",children:f.created})}),(s||i)&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s&&h.jsx("button",{type:"button",onClick:()=>s(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),i&&h.jsx("button",{type:"button",onClick:()=>i(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},`${f.name}:${f.prefix}:${d}`))})]})}));O8.displayName="ApiKeysTable";const Vj=_.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:s=!0,...i},a)=>h.jsxs("div",{ref:a,className:ge("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:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(l=>h.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&&h.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(l=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.label))}),n!=null&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));Vj.displayName="BottomBar";const Kj=_.forwardRef(({className:e,commits:t,onViewAll:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("px-5 pt-3 pb-2",e),...s,children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&h.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 →"})]}),h.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:[h.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),h.jsx("span",{className:"flex-1 truncate",children:"Tables"}),h.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(a=>h.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:[h.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",a.seq]}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:a.actor}),h.jsx("span",{className:"w-[50px] text-white truncate",children:a.changes}),h.jsx("span",{className:"flex-1 truncate",children:h.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})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:a.time})]},a.seq))]}));Kj.displayName="CommitTable";const Gj=mi("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"}}),Oe=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Gj({variant:t,size:n,className:e})),...s}));Oe.displayName="Button";const Zj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,onConsoleTokenChange:f,onSaveAndConnect:d,onDisconnect:p,onTestConnection:g,statusMessage:y,...b},x)=>h.jsxs("div",{ref:x,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),h.jsx(mn,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),h.jsxs("div",{className:"p-5 space-y-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),h.jsx(Gn,{id:"console-server-url",variant:"mono",value:i,onChange:S=>a?.(S.target.value)})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),h.jsx(Gn,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Oe,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Oe,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Oe,{variant:"destructive",size:"md",onClick:p,disabled:!t,children:"Disconnect"})]}),y&&h.jsx("div",{className:ge("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:y})]})]}));Zj.displayName="ConnectionForm";const M8=mi("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"}}),Pt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(M8({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.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"})]}));Pt.displayName="Spinner";function I8({className:e,state:t}){switch(t){case"connected":return h.jsx(mn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(mn,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[h.jsx(Pt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(mn,{variant:"ghost",className:e,children:"Not configured"})}}const Qb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Qb.displayName="Card";const P8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));P8.displayName="CardHeader";const D8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));D8.displayName="CardTitle";const Wb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Wb.displayName="CardContent";const z8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));z8.displayName="CardFooter";function Jb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const Yj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,p)=>h.jsx(L8,{group:d,showDivider:p>0},p)),i!==void 0&&h.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&&h.jsx("div",{className:"ml-auto flex items-center gap-2",children:a})]}));Yj.displayName="FilterBar";function L8({group:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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 U8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const $8={online:"healthy",syncing:"syncing",offline:"offline"},B8={realtime:"flow",polling:"ghost"},F8=_.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=U8(l);return h.jsxs("div",{ref:a,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${d}`},...i,children:[h.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.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})}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx(mn,{variant:$8[t.status],children:t.status}),h.jsx(mn,{variant:B8[t.mode],children:t.mode})]})]}),h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"h-1 rounded-full bg-surface",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:d}})}),h.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:d},children:l===0?"Caught up":`${l} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ay,{label:"Actor",value:t.actor}),h.jsx(Ay,{label:"Dialect",value:t.dialect}),h.jsx(Ay,{label:"Last seen",value:t.lastSeen}),h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),h.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(p=>h.jsx(mn,{variant:"ghost",children:p},p)),t.scopes.length>2&&h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),s&&h.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:[h.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),h.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});F8.displayName="FleetCard";function Ay({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const Xj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const H8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const q8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const lC=e=>{const t=q8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var V8={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 K8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const G8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...V8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Xj("lucide",i),...!a&&!K8(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const ex=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(G8,{ref:a,iconNode:t,className:Xj(`lucide-${H8(lC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=lC(e),n};const Z8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y8=ex("arrow-left",Z8);const X8=[["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"}]],Q8=ex("settings",X8);const W8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],J8=ex("user-x",W8);function eV(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const tV={online:"healthy",syncing:"syncing",offline:"offline"},Qj=_.forwardRef(({className:e,clients:t,headSeq:n,onEvict:s,...i},a)=>h.jsx("div",{ref:a,className:ge("w-full",e),...i,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[160px]",children:"Client"}),h.jsx(ht,{className:"w-[70px]",children:"Status"}),h.jsx(ht,{className:"w-[60px]",children:"Type"}),h.jsx(ht,{className:"w-[80px]",children:"Cursor"}),h.jsx(ht,{className:"w-[110px]",children:"Lag"}),h.jsx(ht,{className:"w-[60px]",children:"Dialect"}),h.jsx(ht,{className:"flex-1",children:"Mode"})]})}),h.jsx(sl,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=eV(f);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[160px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:p,boxShadow:`0 0 4px ${p}`}}),h.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:l.id,children:l.id.length>18?`${l.id.substring(0,18)}…`:l.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(mn,{variant:tV[l.status],children:l.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.cursor.toLocaleString()]})}),h.jsx(pt,{className:"w-[110px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-[60px] h-[3px] rounded-full bg-surface overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${d}%`,background:p}})}),h.jsx("span",{className:"font-mono text-[10px] font-medium",style:{color:p},children:f===0?"0":`${f}`})]})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(l.id),className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors opacity-0 group-hover:opacity-100",children:[h.jsx(J8,{size:10}),"evict"]})]},l.id)})})]})}));Qj.displayName="FleetTable";const Wj=_.forwardRef(({className:e,handlers:t,tableCount:n,...s},i)=>{const a=n??t.length;return h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[a," tables"]})]}),h.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:[h.jsx("span",{className:"flex-1",children:"Table"}),h.jsx("span",{className:"w-[100px]",children:"Depends On"}),h.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((l,f)=>h.jsxs("div",{className:ge("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:[h.jsx("span",{className:"flex-1 text-white truncate",children:l.table}),h.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?h.jsx(mn,{variant:"ghost",children:l.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Wj.displayName="HandlersTable";const nV={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Jj=_.forwardRef(({className:e,items:t,...n},s)=>h.jsx("div",{ref:s,className:ge("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)=>h.jsx(rV,{item:i,showDivider:a>0},i.label))}));Jj.displayName="KpiStrip";function rV({item:e,showDivider:t}){const n=nV[e.color??"muted"]??"bg-neutral-500";return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n)}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),h.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&h.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&h.jsx("span",{className:ge("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const eA=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;return h.jsxs("div",{ref:a,className:ge("px-5 py-3 border-b border-border flex items-center gap-8",e),...i,children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(d=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:d.label}),h.jsxs("div",{className:"flex gap-1 items-end h-5",children:[h.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${d.pushBarPercent}%`}}),h.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${d.pullBarPercent}%`}})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[d.pushMs," / ",d.pullMs,"ms"]})]},d.label))}),h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${l} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",h.jsx("span",{className:"text-neutral-600",children:s})]})]})]})});eA.displayName="LatencyPercentilesBar";const sV={PUSH:"syncing",PULL:"healthy",ACK:"flow"},tA=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:l,className:ge("flex-shrink-0",e),style:{width:360},...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),h.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:i?{maxHeight:i}:void 0,children:f.length===0?h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((d,p)=>h.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[h.jsx(mn,{variant:sV[d.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:d.type}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[d.actor," · ",d.table]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:d.time})]},`${d.time}-${p}`))})]})});tA.displayName="LiveActivityFeed";const oV={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},Tp=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="default",actionIcon:f,onAction:d,...p},g)=>h.jsxs("div",{ref:g,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...p,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",oV[s])}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),h.jsx("div",{className:ge("grid gap-3 mb-4",i.length<=2?"grid-cols-2":"grid-cols-3"),children:i.map(y=>h.jsxs("div",{children:[h.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:y.label}),h.jsx("div",{className:ge("font-mono font-semibold",y.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:y.value})]},y.label))}),h.jsxs(Oe,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));Tp.displayName="MaintenanceCard";function iV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Qb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Wb,{className:s,children:t})]})}const nA=_.forwardRef(({className:e,rows:t,onResetDefaults:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&h.jsx(Oe,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>h.jsx(aV,{row:a,showDivider:l>0},a.label))})]}));nA.displayName="PreferencesPanel";function aV({row:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"border-t border-border"}),h.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),h.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&h.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),h.jsx(Ep,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function tx({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Qb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Wb,{className:s,children:t})]})}const cV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},lV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},rA=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...l,children:[n,h.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:[h.jsx("span",{className:"w-[50px] truncate",children:"Time"}),h.jsx("span",{className:"w-[65px] truncate",children:"Type"}),h.jsx("span",{className:"w-[55px] truncate",children:"ID"}),h.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),h.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[120px] truncate",children:"Client"}),h.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((d,p)=>h.jsx(uV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));rA.displayName="StreamLog";function uV({entry:e,isSelected:t,onClick:n}){const s=cV[e.type]??"text-neutral-500",i=lV[e.outcome]??"text-neutral-600",a=ge("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=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),h.jsx("span",{className:ge("w-[65px] font-medium truncate",s),children:e.type.toUpperCase()}),h.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),h.jsx("span",{className:ge("w-[65px] truncate",i),children:e.outcome}),h.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),h.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?h.jsx("button",{type:"button",className:ge(a,"w-full bg-transparent text-left"),onClick:()=>n(e),children:l}):h.jsx("div",{className:a,children:l})}function fV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const sA=_.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,p=s??Math.max(...t.map(b=>n-b.cursor),0),g=n-d,y=[d,Math.round(d+g*.33),Math.round(d+g*.66),n];return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),h.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"w-px h-3 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),h.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:p})]})]})]}),h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:y.map(b=>h.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),h.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=fV(b.status),w=b.status==="offline"?.4:1;return h.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:w},title:`${b.id} → #${b.cursor}`,children:h.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:S,boxShadow:`0 0 4px ${S}`}})},b.id)})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});sA.displayName="SyncHorizon";function dV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const hV=_.createContext(void 0);function nx(e){const t=_.useContext(hV);if(t===void 0)throw new Error(yn(72));return t}const pV=[];function rx(e){_.useEffect(e,pV)}const iu=0;class ai{static create(){return new ai}currentId=iu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}clear=()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)};disposeEffect=()=>this.clear}function rs(){const e=zn(ai.create).current;return rx(e.disposeEffect),e}function Jo(e){const t=zn(mV,e).current;return t.next=e,Le(t.effect),t}function mV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const ol=typeof navigator<"u",ky=vV(),oA=xV(),iA=bV(),sx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),aA=ky.platform==="MacIntel"&&ky.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ky.platform),gV=ol&&/apple/i.test(navigator.vendor),Dv=ol&&/android/i.test(oA)||/android/i.test(iA);ol&&oA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const yV=iA.includes("jsdom/");function vV(){if(!ol)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 bV(){if(!ol)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function xV(){if(!ol)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const zv="data-base-ui-focusable",cA="active",lA="selected",uA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Oy="ArrowLeft",My="ArrowRight",SV="ArrowUp",_V="ArrowDown";function Bo(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&&Ov(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function wV(e,t){if(!jt(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 Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function es(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 EV(e){return e.matches("html,body")}function fA(e){return Zt(e)&&e.matches(uA)}function uC(e){return e?e.getAttribute("role")==="combobox"&&fA(e):!1}function Hh(e){return e?e.hasAttribute(zv)?e:e.querySelector(`[${zv}]`)||e:null}function Sc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Sc(e,i.id,n)])}function fC(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 Vi(e){e.preventDefault(),e.stopPropagation()}function TV(e){return"nativeEvent"in e}function CV(e){return e.pointerType===""&&e.isTrusted?!0:Dv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function RV(e){return yV?!1:!Dv&&e.width===0&&e.height===0||Dv&&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 NV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function jV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const AV=["top","right","bottom","left"],Uc=Math.min,dr=Math.max,qh=Math.round,pc=Math.floor,xs=e=>({x:e,y:e}),kV={left:"right",right:"left",bottom:"top",top:"bottom"},OV={start:"end",end:"start"};function Lv(e,t,n){return dr(e,Uc(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function xi(e){return e.split("-")[1]}function ox(e){return e==="x"?"y":"x"}function ix(e){return e==="y"?"height":"width"}const MV=new Set(["top","bottom"]);function Fr(e){return MV.has(Zn(e))?"y":"x"}function ax(e){return ox(Fr(e))}function IV(e,t,n){n===void 0&&(n=!1);const s=xi(e),i=ax(e),a=ix(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Vh(l)),[l,Vh(l)]}function PV(e){const t=Vh(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.replace(/start|end/g,t=>OV[t])}const dC=["left","right"],hC=["right","left"],DV=["top","bottom"],zV=["bottom","top"];function LV(e,t,n){switch(e){case"top":case"bottom":return n?t?hC:dC:t?dC:hC;case"left":case"right":return t?DV:zV;default:return[]}}function UV(e,t,n,s){const i=xi(e);let a=LV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Uv)))),a}function Vh(e){return e.replace(/left|right|bottom|top/g,t=>kV[t])}function $V(e){return{top:0,right:0,bottom:0,left:0,...e}}function dA(e){return typeof e!="number"?$V(e):{top:e,right:e,bottom:e,left:e}}function Kh(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 Ld(e,t,n){return Math.floor(e/t)!==n}function lh(e,t){return t<0||t>=e.current.length}function BV(e,t){return fr(e,{disabledIndices:t})}function FV(e,t){return fr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fr(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&&pu(e,a,s));return a}function HV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,k=-1;e.current.forEach((N,R)=>{if(N==null)return;const M=N.closest('[role="row"]');M&&(S=!0),(M!==C||k===-1)&&(C=M,k+=1,b[k]=[]),b[k].push(R),x[R]=k})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const k=x[p];if(k==null)return;const N=b[k].indexOf(p);let R=C==="up"?k-1:k+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const M=new Set;for(;R>=0&&R<b.length&&!M.has(R);){M.add(R);const L=b[R];if(L.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,L.length-1);for(let A=j;A>=0;A-=1){const P=L[A];if(!pu(e,P,l))return P}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===SV){const C=T("up");if(C!==void 0)g&&Vi(t),y=C;else{if(g&&Vi(t),p===-1)y=d;else if(y=fr(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:l}),s&&(p-a<f||y<0)){const k=p%a,N=d%a,R=d-(N-k);N===k?y=d:y=N>k?R:R-a}lh(e,y)&&(y=p)}}if(t.key===_V){const C=T("down");C!==void 0?(g&&Vi(t),y=C):(g&&Vi(t),p===-1?y=f:(y=fr(e,{startingIndex:p,amount:a,disabledIndices:l}),s&&p+a>d&&(y=fr(e,{startingIndex:p%a-a,amount:a,disabledIndices:l}))),lh(e,y)&&(y=p))}if(n==="both"){const C=pc(p/a);t.key===(i?Oy:My)&&(g&&Vi(t),p%a!==a-1?(y=fr(e,{startingIndex:p,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l})),Ld(y,a,C)&&(y=p)),t.key===(i?My:Oy)&&(g&&Vi(t),p%a!==0?(y=fr(e,{startingIndex:p,decrement:!0,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l})),Ld(y,a,C)&&(y=p));const k=pc(d/a)===C;lh(e,y)&&(s&&k?y=t.key===(i?My:Oy)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function qV(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 p=[];for(let g=0;g<a;g+=1)for(let y=0;y<l;y+=1)p.push(i+g+y*t);i%t+a<=t&&p.every(g=>s[g]==null)?(p.forEach(g=>{s[g]=f}),d=!0):i+=1}}),[...s]}function VV(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 KV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function pu(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 GV=["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] *)"],Gh=GV.join(","),hA=typeof Element>"u",$c=hA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zh=!hA&&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},Yh=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]"):Yh(t.parentNode));return l},ZV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},pA=function(t,n,s){if(Yh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gh));return n&&$c.call(t,Gh)&&i.unshift(t),i=i.filter(s),i},Xh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Yh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Xh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=$c.call(l,Gh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Yh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Xh(y===!0?l.children:y.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},mA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ZV(t))&&!mA(t)?0:t.tabIndex},YV=function(t,n){var s=gA(t);return s<0&&n&&!mA(t)?0:s},XV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yA=function(t){return t.tagName==="INPUT"},QV=function(t){return yA(t)&&t.type==="hidden"},WV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},JV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},eK=function(t){if(!t.name)return!0;var n=t.form||Zh(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=JV(i,t.form);return!a||a===t},tK=function(t){return yA(t)&&t.type==="radio"},nK=function(t){return tK(t)&&!eK(t)},rK=function(t){var n,s=t&&Zh(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 p,g,y;s=Zh(i),i=(p=s)===null||p===void 0?void 0:p.host,a=!!((g=i)!==null&&g!==void 0&&(y=g.ownerDocument)!==null&&y!==void 0&&y.contains(i))}}return a},pC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},sK=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=$c.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if($c.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 p=t.parentElement,g=Zh(t);if(p&&!p.shadowRoot&&i(p)===!0)return pC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(rK(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return pC(t);return!1},oK=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 $c.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$v=function(t,n){return!(n.disabled||QV(n)||sK(n,t)||WV(n)||oK(n))},Bv=function(t,n){return!(nK(n)||gA(n)<0||!$v(t,n))},iK=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=YV(f,l),p=l?vA(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:p})}),s.sort(XV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Cp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:Bv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iK}):s=pA(t,n.includeContainer,Bv.bind(null,n)),vA(s)},aK=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:$v.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=pA(t,n.includeContainer,$v.bind(null,n)),s},bA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $c.call(t,Gh)===!1?!1:Bv(n,t)};const Wu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xA(e,t){const n=Cp(e,Wu()),s=n.length;if(s===0)return;const i=Bo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function SA(e){return xA(Rt(e).body,1)||e}function _A(e){return xA(Rt(e).body,-1)||e}function mu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function cK(e){Cp(e,Wu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function mC(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 lK(){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 uK=_.createContext(null),fK=_.createContext(null),Rp=()=>_.useContext(uK)?.id||null,Np=e=>{const t=_.useContext(fK);return e??t};function ju(e){return`data-base-ui-${e}`}const Ud=null;class dK{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 $d=new dK;class ys{static create(){return new ys}static request(t){return $d.request(t)}static cancel(t){return $d.cancel(t)}currentId=Ud;request(t){this.cancel(),this.currentId=$d.request(()=>{this.currentId=Ud,t()})}cancel=()=>{this.currentId!==Ud&&($d.cancel(this.currentId),this.currentId=Ud)};disposeEffect=()=>this.cancel}function cx(){const e=zn(ys.create).current;return rx(e.disposeEffect),e}const Qh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{gV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:vp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let gC=0;function Iy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(gC);const a=()=>e?.focus({preventScroll:n});i?a():gC=requestAnimationFrame(a)}const _c={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function yC(e){return e==="inert"?_c.inert:e==="aria-hidden"?_c["aria-hidden"]:_c.none}let Bd=new WeakSet,Fd={},Py=0;const wA=e=>e&&(e.host||wA(e.parentNode)),hK=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=wA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function pK(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=hK(t,e),f=new Set,d=new Set(l),p=[];Fd[i]||(Fd[i]=new WeakMap);const g=Fd[i];l.forEach(y),b(t),f.clear();function y(x){!x||f.has(x)||(f.add(x),x.parentNode&&y(x.parentNode))}function b(x){!x||d.has(x)||[].forEach.call(x.children,S=>{if(gi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=yC(a),k=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,k),g.set(S,N),p.push(S),k===1&&T&&Bd.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return Py+=1,()=>{p.forEach(x=>{const S=yC(a),T=(S.get(x)||0)-1,C=(g.get(x)||0)-1;S.set(x,T),g.set(x,C),T||(!Bd.has(x)&&a&&x.removeAttribute(a),Bd.delete(x)),C||x.removeAttribute(i)}),Py-=1,Py||(_c.inert=new WeakMap,_c["aria-hidden"]=new WeakMap,_c.none=new WeakMap,Bd=new WeakSet,Fd={})}}function mK(e,t=!1,n=!1){const s=Rt(e[0]).body;return pK(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const EA=_.createContext(null),TA=()=>_.useContext(EA),gK=ju("portal");function CA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Qu(),f=TA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);Le(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Yb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,y(null),p(null));return}x.current!==T&&(x.current=T,y(null),p(T))},[n,f,a]);const S=zt("div",s,{ref:[t,b],props:[{id:a,[gK]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const RA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=CA({container:i,ref:n,componentProps:t,elementProps:d}),y=_.useRef(null),b=_.useRef(null),x=_.useRef(null),S=_.useRef(null),[w,T]=_.useState(null),C=w?.modal,k=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function M(L){p&&L.relatedTarget&&mu(L)&&(L.type==="focusin"?mC:cK)(p)}return p.addEventListener("focusin",M,!0),p.addEventListener("focusout",M,!0),()=>{p.removeEventListener("focusin",M,!0),p.removeEventListener("focusout",M,!0)}},[p,C]),_.useEffect(()=>{!p||k||mC(p)},[k,p]);const R=_.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:S,portalNode:p,setFocusManagerState:T}),[p]);return h.jsxs(_.Fragment,{children:[g,h.jsxs(EA.Provider,{value:R,children:[N&&p&&h.jsx(Qh,{"data-type":"outside",ref:y,onFocus:M=>{if(mu(M,p))x.current?.focus();else{const L=w?w.domReference:null;_A(L)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:s8}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Qh,{"data-type":"outside",ref:b,onFocus:M=>{if(mu(M,p))S.current?.focus();else{const L=w?w.domReference:null;SA(L)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Fj,M.nativeEvent))}}})]})]})});function qs(e){return e==null?e:"current"in e?e.current:e}function yK(e,t){const n=un(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 vC=20;let qo=[];function lx(){qo=qo.filter(e=>e.deref()?.isConnected)}function vK(e){lx(),e&&gi(e)!=="body"&&(qo.push(new WeakRef(e)),qo.length>vC&&(qo=qo.slice(-vC)))}function Dy(){return lx(),qo[qo.length-1]?.deref()}function bK(e){if(!e)return null;const t=Wu();return bA(e,t)?e:Cp(e,t)[0]||e}function xK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function bC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Wu(),i=aK(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return bA(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 NA(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:p="",nextFocusableElement:g,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x}=e,S="rootStore"in t?t.rootStore:t,w=S.useState("open"),T=S.useState("domReferenceElement"),C=S.useState("floatingElement"),{events:k,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),M=i===!1,L=uC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),G=Jo(p),B=Np(x),z=TA(),Q=_.useRef(null),Y=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),K=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),U=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,z?.beforeInsideRef),X=so(H,z?.afterInsideRef),oe=rs(),se=rs(),de=cx(),xe=z!=null,he=Hh(C),Me=Ae((pe=he)=>pe?Cp(pe,Wu()):[]),_e=Ae(pe=>{const ae=Me(pe);return j.current.map(()=>ae).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function pe(we){we.key==="Tab"&&Ot(he,Bo(Rt(he)))&&Me().length===0&&!L&&Vi(we)}const ae=Rt(he);return ae.addEventListener("keydown",pe),()=>{ae.removeEventListener("keydown",pe)}},[s,T,he,f,j,L,Me,_e]),_.useEffect(()=>{if(s||!w)return;const pe=Rt(he);function ae(){K.current=!1}function we(Se){const ye=Ur(Se),Ue=Ot(C,ye)||Ot(T,ye)||Ot(z?.portalNode,ye);K.current=!Ue,U.current=Se.pointerType||"keyboard",ye?.closest(`[${t8}]`)&&(D.current=!0)}function ve(){U.current="keyboard"}return pe.addEventListener("pointerdown",we,!0),pe.addEventListener("pointerup",ae,!0),pe.addEventListener("pointercancel",ae,!0),pe.addEventListener("keydown",ve,!0),()=>{pe.removeEventListener("pointerdown",we,!0),pe.removeEventListener("pointerup",ae,!0),pe.removeEventListener("pointercancel",ae,!0),pe.removeEventListener("keydown",ve,!0)}},[s,C,T,he,w,z]),_.useEffect(()=>{if(s||!d)return;const pe=Rt(he);function ae(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ie){const Ee=Ur(Ie),Xe=Me().indexOf(Ee);Xe!==-1&&(q.current=Xe)}function ve(Ie){const Ee=Ie.relatedTarget,Ve=Ie.currentTarget,Xe=Ur(Ie);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(ju("focus-guard"))&&[I.current,H.current,z?.beforeInsideRef.current,z?.afterInsideRef.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(z?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(Sc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||fC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Hh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&he&&bC(he,j),l&&Ve!==T&&!xK(Xe)&&Bo(pe)===pe.body){if(Zt(he)&&(he.focus(),l==="popup")){de.request(()=>{he.focus()});return}const Te=q.current,qe=Me(),mt=qe[Te]||qe[qe.length-1]||he;Zt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(L||!f)&&Ee&&me&&!D.current&&(L||Ee!==Dy())&&(ee.current=!0,S.setOpen(!1,Yt(Fj,Ie)))})}function Se(){K.current||(N.current.insideReactTree=!0,oe.start(0,()=>{N.current.insideReactTree=!1}))}const ye=Zt(T)?T:null,Ue=[];if(!(!C&&!ye))return ye&&(ye.addEventListener("focusout",ve),ye.addEventListener("pointerdown",ae),Ue.push(()=>{ye.removeEventListener("focusout",ve),ye.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ve),z&&(C.addEventListener("focusout",Se,!0),Ue.push(()=>{C.removeEventListener("focusout",Se,!0)})),Ue.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ve)})),()=>{Ue.forEach(Ie=>{Ie()})}},[s,T,C,he,f,B,z,S,d,l,Me,L,R,j,N,oe,se,de,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const pe=Array.from(z?.portalNode?.querySelectorAll(`[${ju("portal")}]`)||[]),we=(B?fC(B.nodesRef.current,R()):[]).find(Se=>uC(Se.context?.elements.domReference||null))?.context?.elements.domReference,ve=[C,we,...pe,Q.current,Y.current,I.current,H.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g),L?T:null].filter(Se=>Se!=null);return mK(ve,f||L)},[w,s,T,C,f,j,z,L,B,R,g,y]),Le(()=>{if(!w||s||!Zt(he))return;const pe=Rt(he),ae=Bo(pe);queueMicrotask(()=>{const we=_e(he),ve=A.current,Se=typeof ve=="function"?ve(G.current||""):ve;if(Se===void 0||Se===!1)return;let ye;Se===!0||Se===null?ye=we[0]||he:ye=qs(Se),ye=ye||we[0]||he,!Ot(he,ae)&&Iy(ye,{preventScroll:ye===he})})},[s,w,he,M,_e,A,G]),Le(()=>{if(s||!he)return;const pe=Rt(he),ae=Bo(pe);vK(ae);function we(ye){if(ye.open||(V.current=yK(ye.nativeEvent,U.current)),ye.reason===Pv&&ye.nativeEvent.type==="mouseleave"&&(ee.current=!0),ye.reason===Bj)if(ye.nested)ee.current=!1;else if(CV(ye.nativeEvent)||RV(ye.nativeEvent))ee.current=!1;else{let Ue=!1;document.createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?ee.current=!1:ee.current=!0}}k.on("openchange",we);const ve=pe.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,vp),xe&&T&&T.insertAdjacentElement("afterend",ve);function Se(){const ye=P.current;let Ue=typeof ye=="function"?ye(V.current):ye;if(Ue===void 0||Ue===!1)return null;if(Ue===null&&(Ue=!0),typeof Ue=="boolean"){const Ee=T||Dy();return Ee&&Ee.isConnected?Ee:ve}const Ie=T||Dy()||ve;return qs(Ue)||Ie}return()=>{k.off("openchange",we);const ye=Bo(pe),Ue=Ot(C,ye)||B&&Sc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ye)),Ie=Se();queueMicrotask(()=>{const Ee=bK(Ie),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ye&&ye!==pe.body)||Ue)&&Ee.focus({preventScroll:!0}),ve.remove(),ee.current=!1})}},[s,C,he,P,N,k,B,xe,T,R]),Le(()=>{if(!sx||w||!C)return;const pe=Bo(Rt(C));!Zt(pe)||!fA(pe)||Ot(C,pe)&&pe.blur()},[w,C]),Le(()=>{if(!(s||!z))return z.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{z.setFocusManagerState(null)}},[s,z,f,w,S,d,T]),Le(()=>{if(!(s||!he))return bC(he,j),()=>{queueMicrotask(lx)}},[s,he,j]);const ne=!s&&(f?!L:!0)&&(xe||f);return h.jsxs(_.Fragment,{children:[ne&&h.jsx(Qh,{"data-type":"inside",ref:W,onFocus:pe=>{if(f){const ae=_e();Iy(ae[ae.length-1])}else z?.portalNode&&(ee.current=!1,mu(pe,z.portalNode)?SA(T)?.focus():qs(y??z.beforeOutsideRef)?.focus())}}),n,ne&&h.jsx(Qh,{"data-type":"inside",ref:X,onFocus:pe=>{f?Iy(_e()[0]):z?.portalNode&&(d&&(ee.current=!0),mu(pe,z.portalNode)?_A(T)?.focus():qs(g??z.afterOutsideRef)?.focus())}})]})}function xC(e,t,n){let{reference:s,floating:i}=e;const a=Fr(t),l=ax(t),f=ix(l),d=Zn(t),p=a==="y",g=s.x+s.width/2-i.width/2,y=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};break;case"left":x={x:s.x-i.width,y};break;default:x={x:s.x,y:s.y}}switch(xi(t)){case"start":x[l]-=b*(n&&p?-1:1);break;case"end":x[l]+=b*(n&&p?-1:1);break}return x}async function SK(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=io(t,e),S=dA(x),T=f[b?y==="floating"?"reference":"floating":y],C=Kh(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:p,rootBoundary:g,strategy:d})),k=y==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),R=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},M=Kh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:N,strategy:d}):k);return{top:(C.top-M.top+S.top)/R.y,bottom:(M.bottom-C.bottom+S.bottom)/R.y,left:(C.left-M.left+S.left)/R.x,right:(M.right-C.right+S.right)/R.x}}const _K=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 p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=xC(p,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:C,fn:k}=f[T],{x:N,y:R,data:M,reset:L}=await k({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:SK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(p=L.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:g,y}=xC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},wK=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:p}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...T}=io(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Zn(i),k=Fr(f),N=Zn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),M=b||(N||!w?[Vh(f)]:PV(f)),L=S!=="none";!b&&L&&M.push(...UV(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let G=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const Y=IV(i,l,R);P.push(A[Y[0]],A[Y[1]])}if(G=[...G,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var B,z;const Y=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[Y];if(ee&&(!(y==="alignment"?k!==Fr(ee):!1)||G.every(q=>Fr(q.placement)===k?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:G},reset:{placement:ee}};let D=(z=G.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(x){case"bestFit":{var Q;const K=(Q=G.filter(q=>{if(L){const V=Fr(q.placement);return V===k||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,U)=>V+U,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Q[0];K&&(D=K);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function SC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _C(e){return AV.some(t=>e[t]>=0)}const EK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=io(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=SC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:_C(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=SC(l,n.floating);return{data:{escapedOffsets:f,escaped:_C(f)}}}default:return{}}}}},jA=new Set(["left","top"]);async function TK(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=xi(n),d=Fr(n)==="y",p=jA.has(l)?-1:1,g=a&&d?-1:1,y=io(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),d?{x:x*g,y:b*p}:{x:b*p,y:x*g}}const CK=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 TK(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}}}}},RK=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:C=>{let{x:k,y:N}=C;return{x:k,y:N}}},...p}=io(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=Fr(Zn(i)),x=ox(b);let S=g[x],w=g[b];if(l){const C=x==="y"?"top":"left",k=x==="y"?"bottom":"right",N=S+y[C],R=S-y[k];S=Lv(N,S,R)}if(f){const C=b==="y"?"top":"left",k=b==="y"?"bottom":"right",N=w+y[C],R=w-y[k];w=Lv(N,w,R)}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}}}}}},NK=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:p=!0}=io(e,t),g={x:n,y:s},y=Fr(i),b=ox(y);let x=g[b],S=g[y];const w=io(f,t),T=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const N=b==="y"?"height":"width",R=a.reference[b]-a.floating[N]+T.mainAxis,M=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>M&&(x=M)}if(p){var C,k;const N=b==="y"?"width":"height",R=jA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),L=a.reference[y]+a.reference[N]+(R?0:((k=l.offset)==null?void 0:k[y])||0)-(R?T.crossAxis:0);S<M?S=M:S>L&&(S=L)}return{[b]:x,[y]:S}}}},jK=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=()=>{},...p}=io(e,t),g=await l.detectOverflow(t,p),y=Zn(i),b=xi(i),x=Fr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const k=w-g.top-g.bottom,N=S-g.left-g.right,R=Uc(w-g[T],k),M=Uc(S-g[C],N),L=!t.middlewareData.shift;let j=R,A=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=k),L&&!b){const G=dr(g.left,0),B=dr(g.right,0),z=dr(g.top,0),Q=dr(g.bottom,0);x?A=S-2*(G!==0||B!==0?G+B:dr(g.left,g.right)):j=w-2*(z!==0||Q!==0?z+Q:dr(g.top,g.bottom))}await d({...t,availableWidth:A,availableHeight:j});const P=await l.getDimensions(f.floating);return S!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function AA(e){const t=xr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Zt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=qh(n)!==a||qh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function ux(e){return jt(e)?e:e.contextElement}function wc(e){const t=ux(e);if(!Zt(t))return xs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=AA(t);let l=(a?qh(n.width):n.width)/s,f=(a?qh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const AK=xs(0);function kA(e){const t=un(e);return!Sp()||!t.visualViewport?AK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function fa(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=ux(e);let l=xs(1);t&&(s?jt(s)&&(l=wc(s)):l=wc(e));const f=kK(a,n,s)?kA(a):xs(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,g=i.width/l.x,y=i.height/l.y;if(a){const b=un(a),x=s&&jt(s)?un(s):s;let S=b,w=Mv(S);for(;w&&s&&x!==S;){const T=wc(w),C=w.getBoundingClientRect(),k=xr(w),N=C.left+(w.clientLeft+parseFloat(k.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(k.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=un(w),w=Mv(S)}}return Kh({width:g,height:y,x:d,y:p})}function jp(e,t){const n=_p(e).scrollLeft;return t?t.left+n:fa(_s(e)).left+n}function OA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-jp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function OK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=_s(s),f=t?xp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=xs(1);const g=xs(0),y=Zt(s);if((y||!y&&!a)&&((gi(s)!=="body"||yi(l))&&(d=_p(s)),Zt(s))){const x=fa(s);p=wc(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?OA(l,d):xs(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+g.x+b.x,y:n.y*p.y-d.scrollTop*p.y+g.y+b.y}}function MK(e){return Array.from(e.getClientRects())}function IK(e){const t=_s(e),n=_p(e),s=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=dr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+jp(e);const f=-n.scrollTop;return xr(s).direction==="rtl"&&(l+=dr(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const wC=25;function PK(e,t){const n=un(e),s=_s(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=Sp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=jp(s);if(p<=0){const g=s.ownerDocument,y=g.body,b=getComputedStyle(y),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-y.clientWidth-x);S<=wC&&(a-=S)}else p<=wC&&(a+=p);return{width:a,height:l,x:f,y:d}}const DK=new Set(["absolute","fixed"]);function zK(e,t){const n=fa(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?wc(e):xs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:l,height:f,x:d,y:p}}function EC(e,t,n){let s;if(t==="viewport")s=PK(e,n);else if(t==="document")s=IK(_s(e));else if(jt(t))s=zK(t,n);else{const i=kA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kh(s)}function MA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||MA(n,t)}function LK(e,t){const n=t.get(e);if(n)return n;let s=Wo(e,[],!1).filter(f=>jt(f)&&gi(f)!=="body"),i=null;const a=xr(e).position==="fixed";let l=a?oo(e):e;for(;jt(l)&&!Ys(l);){const f=xr(l),d=Xb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&DK.has(i.position)||yi(l)&&!d&&MA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function UK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?xp(t)?[]:LK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=EC(t,g,i);return p.top=dr(y.top,p.top),p.right=Uc(y.right,p.right),p.bottom=Uc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},EC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function $K(e){const{width:t,height:n}=AA(e);return{width:t,height:n}}function BK(e,t,n){const s=Zt(t),i=_s(t),a=n==="fixed",l=fa(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=xs(0);function p(){d.x=jp(i)}if(s||!s&&!a)if((gi(t)!=="body"||yi(i))&&(f=_p(t)),s){const x=fa(t,!0,a,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&p();a&&!s&&i&&p();const g=i&&!s&&!a?OA(i,f):xs(0),y=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:l.width,height:l.height}}function zy(e){return xr(e).position==="static"}function TC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function IA(e,t){const n=un(e);if(xp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!zy(i))return i;i=oo(i)}return n}let s=TC(e,t);for(;s&&h8(s)&&zy(s);)s=TC(s,t);return s&&Ys(s)&&zy(s)&&!Xb(s)?n:s||v8(e)||n}const FK=async function(e){const t=this.getOffsetParent||IA,n=this.getDimensions,s=await n(e.floating);return{reference:BK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function HK(e){return xr(e).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:OK,getDocumentElement:_s,getClippingRect:UK,getOffsetParent:IA,getElementRects:FK,getClientRects:MK,getDimensions:$K,getScale:wc,isElement:jt,isRTL:HK};function PA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VK(e,t){let n=null,s;const i=_s(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 p=e.getBoundingClientRect(),{left:g,top:y,width:b,height:x}=p;if(f||t(),!b||!x)return;const S=pc(y),w=pc(i.clientWidth-(g+b)),T=pc(i.clientHeight-(y+x)),C=pc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Uc(1,d))||1};let R=!0;function M(L){const j=L[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!PA(p,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(M,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return l(!0),a}function CC(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,p=ux(e),g=i||a?[...p?Wo(p):[],...Wo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?VK(p,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[k]=C;k&&k.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let S,w=d?fa(e):null;d&&T();function T(){const C=fa(e);w&&!PA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(k=>{i&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const KK=CK,GK=RK,ZK=wK,YK=jK,XK=EK,QK=NK,WK=(e,t,n)=>{const s=new Map,i={platform:qK,...n},a={...i.platform,_c:s};return _K(e,t,{...i,platform:a})};var JK=typeof document<"u",e7=function(){},uh=JK?_.useLayoutEffect:e7;function Wh(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(!Wh(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)&&!Wh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function DA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RC(e,t){const n=DA(e);return Math.round(t*n)/n}function Ly(e){const t=_.useRef(e);return uh(()=>{t.current=e}),t}function t7(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:p}=e,[g,y]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=_.useState(s);Wh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),k=_.useCallback(q=>{q!==L.current&&(L.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,L=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,G=Ly(d),B=Ly(i),z=Ly(p),Q=_.useCallback(()=>{if(!L.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),WK(L.current,j.current,q).then(V=>{const U={...V,isPositioned:z.current!==!1};Y.current&&!Wh(A.current,U)&&(A.current=U,hi.flushSync(()=>{y(U)}))})},[b,t,n,B,z]);uh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const Y=_.useRef(!1);uh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),uh(()=>{if(R&&(L.current=R),M&&(j.current=M),R&&M){if(G.current)return G.current(R,M,Q);Q()}},[R,M,Q,G,P]);const ee=_.useMemo(()=>({reference:L,floating:j,setReference:k,setFloating:N}),[k,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),K=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const V=RC(D.floating,g.x),U=RC(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+U+"px)",...DA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:U}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Q,refs:ee,elements:D,floatingStyles:K}),[g,Q,ee,D,K])}const n7=(e,t)=>({...KK(e),options:[e,t]}),r7=(e,t)=>({...GK(e),options:[e,t]}),s7=(e,t)=>({...QK(e),options:[e,t]}),o7=(e,t)=>({...ZK(e),options:[e,t]}),i7=(e,t)=>({...YK(e),options:[e,t]}),a7=(e,t)=>({...XK(e),options:[e,t]}),c7={intentional:"onClick",sloppy:"onPointerDown"};function l7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function u7(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:p=!0,escapeKey:g=!0,outsidePress:y=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:T,externalTree:C}=t,k=Np(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:L,outsidePress:j}=l7(T),A=_.useRef(null),P=rs(),G=rs(),B=Ae(()=>{G.clear(),d.current.insideReactTree=!1}),z=_.useRef(!1),Q=_.useRef(""),Y=Ae(ne=>{Q.current=ne.pointerType}),ee=Ae(()=>{const ne=Q.current,pe=ne==="pen"||!ne?"mouse":ne,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[pe]}),D=Ae(ne=>{if(!s||!p||!g||ne.key!=="Escape"||z.current)return;const pe=d.current.floatingContext?.nodeId,ae=k?Sc(k.nodesRef.current,pe):[];if(!L&&ae.length>0){let Se=!0;if(ae.forEach(ye=>{ye.context?.open&&!ye.context.dataRef.current.__escapeKeyBubbles&&(Se=!1)}),!Se)return}const we=TV(ne)?ne.nativeEvent:ne,ve=Yt(E8,we);n.setOpen(!1,ve),!L&&!ve.isPropagationAllowed&&ne.stopPropagation()}),K=Ae(ne=>{const pe=ee();return pe==="intentional"&&ne.type!=="click"||pe==="sloppy"&&ne.type==="click"}),q=Ae(()=>{d.current.insideReactTree=!0,G.start(0,B)}),V=Ae((ne,pe=!1)=>{if(K(ne)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&pe||typeof R=="function"&&!R(ne))return;const ae=Ur(ne),we=`[${ju("inert")}]`,ve=Rt(n.select("floatingElement")).querySelectorAll(we),Se=n.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ve=>Ot(Ve,ae))))return;let ye=jt(ae)?ae:null;for(;ye&&!Ys(ye);){const Ve=oo(ye);if(Ys(Ve)||!jt(Ve))break;ye=Ve}if(ve.length&&jt(ae)&&!EV(ae)&&!Ot(ae,n.select("floatingElement"))&&Array.from(ve).every(Ve=>!Ot(ye,Ve)))return;if(Zt(ae)&&!("touches"in ne)){const Ve=Ys(ae),Xe=xr(ae),Be=/auto|scroll/,We=Ve||Be.test(Xe.overflowX),He=Ve||Be.test(Xe.overflowY),me=We&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Te=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,qe=Xe.direction==="rtl",mt=Te&&(qe?ne.offsetX<=ae.offsetWidth-ae.clientWidth:ne.offsetX>ae.clientWidth),lt=me&&ne.offsetY>ae.clientHeight;if(mt||lt)return}const Ue=d.current.floatingContext?.nodeId,Ie=k&&Sc(k.nodesRef.current,Ue).some(Ve=>es(ne,Ve.context?.elements.floating));if(es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||Ie)return;const Ee=k?Sc(k.nodesRef.current,Ue):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Xe=>{Xe.context?.open&&!Xe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(Bj,ne)),B()}),U=Ae(ne=>{ee()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||V(ne)}),I=Ae(ne=>{if(ee()!=="sloppy"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];pe&&(A.current={startTime:Date.now(),startX:pe.clientX,startY:pe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),H=Ae(ne=>{const pe=Ur(ne);function ae(){I(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),W=Ae(ne=>{const pe=M.current;if(M.current=!1,P.clear(),ne.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ae=Ur(ne);function we(){ne.type==="pointerdown"?U(ne):V(ne,pe),ae?.removeEventListener(ne.type,we)}ae?.addEventListener(ne.type,we)}),X=Ae(ne=>{if(ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];if(!pe)return;const ae=Math.abs(pe.clientX-A.current.startX),we=Math.abs(pe.clientY-A.current.startY),ve=Math.sqrt(ae*ae+we*we);ve>5&&(A.current.dismissOnTouchEnd=!0),ve>10&&(V(ne),P.clear(),A.current=null)}),oe=Ae(ne=>{const pe=Ur(ne);function ae(){X(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),se=Ae(ne=>{ee()!=="sloppy"||!A.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(ne),P.clear(),A.current=null)}),de=Ae(ne=>{const pe=Ur(ne);function ae(){se(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=j;const ne=new ai;function pe(ye){n.setOpen(!1,Yt(ii,ye))}function ae(){ne.clear(),z.current=!0}function we(){ne.start(Sp()?5:0,()=>{z.current=!1})}const ve=Rt(i);ve.addEventListener("pointerdown",Y,!0),g&&(ve.addEventListener("keydown",D),ve.addEventListener("compositionstart",ae),ve.addEventListener("compositionend",we)),R&&(ve.addEventListener("click",W,!0),ve.addEventListener("pointerdown",W,!0),ve.addEventListener("touchstart",H,!0),ve.addEventListener("touchmove",oe,!0),ve.addEventListener("touchend",de,!0),ve.addEventListener("mousedown",W,!0));let Se=[];return w&&(jt(l)&&(Se=Wo(l)),jt(i)&&(Se=Se.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(Se=Se.concat(Wo(a.contextElement)))),Se=Se.filter(ye=>ye!==ve.defaultView?.visualViewport),Se.forEach(ye=>{ye.addEventListener("scroll",pe,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),g&&(ve.removeEventListener("keydown",D),ve.removeEventListener("compositionstart",ae),ve.removeEventListener("compositionend",we)),R&&(ve.removeEventListener("click",W,!0),ve.removeEventListener("pointerdown",W,!0),ve.removeEventListener("touchstart",H,!0),ve.removeEventListener("touchmove",oe,!0),ve.removeEventListener("touchend",de,!0),ve.removeEventListener("mousedown",W,!0)),Se.forEach(ye=>{ye.removeEventListener("scroll",pe)}),ne.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,L,j,D,V,W,U,H,oe,de,Y,n]),_.useEffect(B,[R,B]);const xe=_.useMemo(()=>({onKeyDown:D,...x&&{[c7[S]]:ne=>{n.setOpen(!1,Yt(cC,ne.nativeEvent))},...S!=="intentional"&&{onClick(ne){n.setOpen(!1,Yt(cC,ne.nativeEvent))}}}}),[D,n,x,S]),he=Ae(ne=>{const pe=Ur(ne.nativeEvent);!Ot(n.select("floatingElement"),pe)||ne.button!==0||(M.current=!0)}),Me=Ae(ne=>{!s||!p||ne.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:he,onMouseDown:he,onMouseUp:he,onClickCapture:q,onMouseDownCapture(ne){q(),Me(ne)},onPointerDownCapture(ne){q(),Me(ne)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,he,q,Me]);return _.useMemo(()=>p?{reference:xe,floating:_e,trigger:xe}:{},[p,xe,_e])}ij({memoize:yq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(yn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var f7=ZN();const d7=Zb(19),h7=d7?m7:g7;function at(e,t,n,s,i){return h7(e,t,n,s,i)}function p7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return f7.useSyncExternalStore(e.subscribe,a,a)}function m7(e,t,n,s,i){return p7(e,t,n,s,i)}function g7(e,t,n,s,i){return YN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class y7{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 at(this,t,n,s,i)}}class zA extends y7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),Le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Le(()=>(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);Le(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;Le(()=>{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),at(this,this.selectors[t],n,s,i)}useContextCallback(t,n){_.useDebugValue(t);const s=Ae(n??jn);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 v7={open:Pe(e=>e.open),domReferenceElement:Pe(e=>e.domReferenceElement),referenceElement:Pe(e=>e.positionReference??e.referenceElement),floatingElement:Pe(e=>e.floatingElement),floatingId:Pe(e=>e.floatingId)};class fx extends zA{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:lK(),nested:n,noEmit:s,triggerElements:a},v7)}setOpen=(t,n)=>{if((!t||!this.state.open||jV(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 Ap(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),Le(()=>{if(!e&&a&&s!=="ending"&&n){const f=ys.request(()=>{i("ending")});return()=>{ys.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=ys.request(()=>{i(void 0)});return()=>{ys.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ys.request(()=>{i("idle")});return()=>{ys.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let Au=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const b7={[Au.startingStyle]:""},x7={[Au.endingStyle]:""},va={transitionStatus(e){return e==="starting"?b7:e==="ending"?x7:null}};function S7(e,t=!1,n=!0){const s=cx();return Ae((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=qs(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let y=function(){const x=Au.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 p=y,g=b;if(t){y();return}s.request(b)}})}function ba(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),l=S7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function _7(e){const t=e.useState("open");Le(()=>{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 w7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Ap(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return ba({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class dx{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 E7(){return new fx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new dx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function T7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:E7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}const Hd=Pe(e=>e.triggerIdProp??e.activeTriggerId),C7={open:Pe(e=>e.openProp??e.open),mounted:Pe(e=>e.mounted),transitionStatus:Pe(e=>e.transitionStatus),floatingRootContext:Pe(e=>e.floatingRootContext),preventUnmountingOnClose:Pe(e=>e.preventUnmountingOnClose),payload:Pe(e=>e.payload),activeTriggerId:Hd,activeTriggerElement:Pe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pe((e,t)=>t!==void 0&&Hd(e)===t),isOpenedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.open),isMountedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.mounted),triggerProps:Pe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pe(e=>e.popupProps),popupElement:Pe(e=>e.popupElement),positionerElement:Pe(e=>e.positionerElement)};function R7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Qu(),a=Rp()!=null,l=zn(()=>new fx({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new dx,floatingId:i,nested:a,noEmit:!1})).current;return Le(()=>{const f={open:t,floatingId:i};s.reference!==void 0&&(f.referenceElement=s.reference,f.domReferenceElement=jt(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 N7(e={}){const{nodeId:t,externalTree:n}=e,s=R7(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),p=Np(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=t7({...e,elements:{...a,...l&&{reference:l}}}),y=_.useCallback(j=>{const A=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(A),g.refs.setReference(A)},[g.refs]),[b,x]=_.useState(null),[S,w]=_.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",jt(b)?b:null),i.useSyncedValue("floatingElement",S);const T=_.useCallback(j=>{(jt(j)||j===null)&&(d.current=j,x(j)),(jt(g.refs.reference.current)||g.refs.reference.current===null||j!==null&&!jt(j))&&g.refs.setReference(j)},[g.refs,x]),C=_.useCallback(j=>{w(j),g.refs.setFloating(j)},[g.refs]),k=_.useMemo(()=>({...g.refs,setReference:T,setFloating:C,setPositionReference:y,domReference:d}),[g.refs,T,C,y]),N=_.useMemo(()=>({...g.elements,domReference:a.domReference}),[g.elements,a.domReference]),R=i.useState("open"),M=i.useState("floatingId"),L=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:M,refs:k,elements:N,nodeId:t,rootStore:i}),[g,k,N,t,i,R,M]);return Le(()=>{i.context.dataRef.current.floatingContext=L;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=L)}),_.useMemo(()=>({...g,context:L,refs:k,elements:N,rootStore:i}),[g,k,N,L,i])}function j7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Qu(),l=Rp()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=zn(()=>new fx({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return Le(()=>{const b={open:f,floatingId:a,referenceElement:d,floatingElement:p};jt(d)&&(b.domReferenceElement=d),y.state.positionReference===y.state.referenceElement&&(b.positionReference=d),y.update(b)},[f,a,d,p,y]),y.context.onOpenChange=i,y.context.nested=l,y.context.noEmit=n,y}const NC=ju("safe-polygon"),A7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${uA}`;function k7(e){return e?!!e.closest(A7):!1}class hx{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 ai,this.restTimeout=new ai,this.handleCloseOptions=void 0}static create(){return new hx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function O7(e){const t=zn(hx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),rx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const M7=new Set(["click","mousedown"]);function I7(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,p=O7(n),g=Np(),y=Rp(),b=Ae(()=>p.interactedInside?!0:l.current.openEvent?M7.has(l.current.openEvent.type):!1),x=Ae(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>wV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=P7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Pv,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Pv,N)))},[d,n,p]),T=Ae(()=>{p.unbindMouseMove(),p.handler=void 0}),C=Ae(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(NC),p.performedPointerEventsMutation=!1}}),k=Ae(N=>{const R=Ur(N);if(!k7(R)){p.interactedInside=!1;return}p.interactedInside=!0});Le(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),Le(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(NC,"");const R=a,M=i,L=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return L&&(L.style.pointerEvents=""),N.style.pointerEvents="none",R.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",M.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!l.current.floatingContext||!n.select("open")||S(j.relatedTarget)||(C(),T(),b()||w(j))}function R(j){p.openChangeTimeout.clear(),C(),p.handler?.(j),T()}function M(j){b()||w(j,!1)}const L=i;return L&&(L.addEventListener("mouseleave",N),L.addEventListener("mouseenter",R),L.addEventListener("mouseleave",M),L.addEventListener("pointerdown",k,!0)),()=>{L&&(L.removeEventListener("mouseleave",N),L.removeEventListener("mouseenter",R),L.removeEventListener("mouseleave",M),L.removeEventListener("pointerdown",k,!0))}},[f,i,n,l,b,S,w,C,T,k,p])}function P7(e,t){return t&&!NV(t)?0:typeof e=="function"?e():e}function D7(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),s=e.map(p=>p?.item),i=e.map(p=>p?.trigger),a=_.useCallback(p=>qd(p,e,"reference"),t),l=_.useCallback(p=>qd(p,e,"floating"),n),f=_.useCallback(p=>qd(p,e,"item"),s),d=_.useCallback(p=>qd(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function qd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[zv]="");for(const l in e)i&&e&&(l===cA||l===lA)||(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&&jC(a,f,i,s)}return jC(a,e,i,s),a}function jC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===cA||i===lA)||(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 z7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function L7(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=Qu(),p=a?.id||d,g=_.useMemo(()=>Hh(l)?.id||i,[l,i]),y=z7.get(f)??f,x=Rp()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?an:{"aria-haspopup":y==="alertdialog"?"dialog":y,"aria-expanded":"false",...y==="listbox"&&{role:"combobox"},...y==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,x,f]),w=_.useMemo(()=>y==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:s?g:void 0}:{...S,"aria-expanded":s?"true":"false","aria-controls":s?g:void 0,...y==="menu"&&{id:p}},[y,g,s,p,f,S]),T=_.useMemo(()=>{const k={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?k:{...k,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:k,selected:N})=>{const R={role:"option",...k&&{id:`${g}-fui-option`}};switch(f){case"select":case"combobox":return{...R,"aria-selected":N}}return{}},[g,f]);return _.useMemo(()=>({reference:w,floating:T,item:C,trigger:S}),[w,T,S,C])}let Xi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Au.startingStyle]="startingStyle",e[e.endingStyle=Au.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),AC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const U7={[AC.popupOpen]:"",[AC.pressed]:""},$7={[Xi.open]:""},B7={[Xi.closed]:""},F7={[Xi.anchorHidden]:""},H7={open(e){return e?U7:null}},il={open(e){return e?$7:B7},anchorHidden(e){return e?F7:null}},LA=_.createContext(void 0);function q7(){const e=_.useContext(LA);if(e===void 0)throw new Error(yn(70));return e}const V7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=CA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),K7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return nx().useState("mounted")||s?h.jsx(LA.Provider,{value:s,children:h.jsx(V7,{ref:n,...i})}):null}),UA=_.createContext(void 0);function G7(){const e=_.useContext(UA);if(e===void 0)throw new Error(yn(71));return e}const Z7=_.createContext(void 0);function $A(){return _.useContext(Z7)?.direction??"ltr"}const Y7=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:p,padding:g=0,offsetParent:y="real"}=io(e,t)||{};if(p==null)return{};const b=dA(g),x={x:n,y:s},S=ax(i),w=ix(S),T=await l.getDimensions(p),C=S==="y",k=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[S]-x[S]-a.floating[w],L=x[S]-a.reference[S],j=y==="real"?await l.getOffsetParent?.(p):f.floating;let A=f.floating[R]||a.floating[w];(!A||!await l.isElement?.(j))&&(A=f.floating[R]||a.floating[w]);const P=M/2-L/2,G=A/2-T[w]/2-1,B=Math.min(b[k],G),z=Math.min(b[N],G),Q=B,Y=A-T[w]-z,ee=A/2-T[w]/2+P,D=Lv(Q,ee,Y),K=!d.arrow&&xi(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Q?B:z)-T[w]/2<0,q=K?ee<Q?ee-Q:ee-Y:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...K&&{alignmentOffset:q}},reset:K}}}),X7=(e,t)=>({...Y7(e),options:[e,t]}),Q7={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 a7().fn(e)).data?.referenceHidden||a}}}},fh={sideX:"left",sideY:"top"},W7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=un(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:fh};const y=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(y===d){const k=Rt(i);b={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=Zn(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":fh.sideX,C=x==="top"?"bottom":fh.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function BA(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 kC(e,t,n){const{rects:s,placement:i}=e;return{side:BA(t,Zn(i),n),align:xi(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function FA(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:p=!1,arrowPadding:g=5,disableAnchorTracking:y=!1,keepMounted:b=!1,floatingRootContext:x,mounted:S,collisionAvoidance:w,shiftCrossAxis:T=!1,nodeId:C,adaptiveOrigin:k,lazyFlip:N=!1,externalTree:R}=e,[M,L]=_.useState(null);!S&&M!==null&&L(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",G=typeof t=="function"?t:void 0,B=Ae(G),z=G?B:t,Q=Jo(t),ee=$A()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],K=a==="center"?D:`${D}-${a}`;let q=d;const V=1,U=s==="bottom"?V:0,I=s==="top"?V:0,H=s==="right"?V:0,W=s==="left"?V:0;typeof q=="number"?q={top:q+U,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+U,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const X={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},oe=_.useRef(null),se=Jo(i),de=Jo(l),Me=[n7(ot=>{const Wt=kC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof de.current=="function"?de.current(Wt):de.current;return{mainAxis:vn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=A==="none"&&j!=="shift",ne=!_e&&(p||T||j==="shift"),pe=j==="none"?null:o7({...X,padding:{top:q.top+V,right:q.right+V,bottom:q.bottom+V,left:q.left+V},mainAxis:!T&&j==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ae=_e?null:r7(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...X,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:ne,limiter:p||T?void 0:s7(vn=>{if(!oe.current)return{};const{width:kt,height:Cn}=oe.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,as=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+as/2}})}},[X,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Me.push(ae,pe):Me.push(pe,ae),Me.push(i7({...X,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:vn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${vn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),X7(()=>({element:oe.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:vn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),as=Fr(An),cs=oe.current,_a=vn.arrow?.x||0,_i=vn.arrow?.y||0,wi=cs?.clientWidth||0,ws=cs?.clientHeight||0,tr=_a+wi/2,ls=_i+ws/2,uo=Math.abs(vn.shift?.y||0),fo=Cn.reference.height/2,nr=typeof i=="function"?i(kC(ot,s,ee)):i,cl=uo>nr,cf={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${ls}px`,right:`${-nr}px ${ls}px`}[An],lf=`${tr}px ${Cn.reference.y+fo-er}px`;return Wt.floating.style.setProperty("--transform-origin",ne&&as==="y"&&cl?lf:cf),{}}},Q7,k),Le(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const we=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ve,elements:Se,x:ye,y:Ue,middlewareData:Ie,update:Ee,placement:Ve,context:Xe,isPositioned:Be,floatingStyles:We}=N7({rootContext:x,placement:K,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>CC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ie.adaptiveOrigin||fh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=k?{position:Te,[He]:ye,[me]:Ue}:{position:Te,...We};return Be||(ot.opacity=0),ot},[k,Te,He,ye,me,Ue,We,Be]),mt=_.useRef(null);Le(()=>{if(!S)return;const ot=Q.current,Wt=typeof ot=="function"?ot():ot,kt=(OC(Wt)?Wt.current:Wt)||null||null;kt!==mt.current&&(ve.setPositionReference(kt),mt.current=kt)},[S,ve,z,Q]),_.useEffect(()=>{if(!S)return;const ot=Q.current;typeof ot!="function"&&OC(ot)&&ot.current!==mt.current&&(ve.setPositionReference(ot.current),mt.current=ot.current)},[S,ve,z,Q]),_.useEffect(()=>{if(b&&S&&Se.domReference&&Se.floating)return CC(Se.domReference,Se.floating,Ee,we)},[b,S,Se,Ee,we]);const lt=Zn(Ve),wr=BA(s,lt,ee),Er=xi(Ve)||"center",Qt=!!Ie.hide?.referenceHidden;Le(()=>{N&&S&&Be&&L(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ie.arrow?.y,left:Ie.arrow?.x}),[Ie.arrow]),xt=Ie.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:oe,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ve,context:Xe,isPositioned:Be,update:Ee}),[qe,ut,oe,xt,wr,Er,lt,Qt,ve,Xe,Be,Ee])}function OC(e){return e!=null&&"current"in e}function kp(e){return e==="starting"?e8:an}const J7=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:T=r8,...C}=t,k=nx(),N=q7(),R=k.useState("open"),M=k.useState("mounted"),L=k.useState("trackCursorAxis"),j=k.useState("disableHoverablePopup"),A=k.useState("floatingRootContext"),P=k.useState("instantType"),G=k.useState("transitionStatus"),B=k.useState("hasViewport"),z=FA({anchor:a,positionMethod:l,floatingRootContext:A,mounted:M,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:B?W7:void 0}),Q=_.useMemo(()=>{const K={};return(!R||L==="both"||j)&&(K.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...z.positionerStyles,...K}}},[R,L,j,M,z.positionerStyles]),Y=_.useMemo(()=>({open:R,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:L!=="none"?"tracking-cursor":P}),[R,z.side,z.align,z.anchorHidden,L,P]),ee=_.useMemo(()=>({...Y,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[Y,z.arrowRef,z.arrowStyles,z.arrowUncentered]),D=zt("div",t,{state:Y,props:[Q,kp(G),C],ref:[n,k.useStateSetter("positionerElement")],stateAttributesMapping:il});return h.jsx(UA.Provider,{value:ee,children:D})}),eG={...il,...va},tG=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=nx(),{side:f,align:d}=G7(),p=l.useState("open"),g=l.useState("instantType"),y=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");ba({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return I7(x,{enabled:!S,closeDelay:w}),zt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,kp(y),a],stateAttributesMapping:eG})});function px(e){return Zb(19)?e:e?"true":void 0}const nG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(K7,{children:h.jsx(J7,{sideOffset:t,children:h.jsx(tG,{ref:i,className:ge("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})})}));nG.displayName="TooltipContent";function MC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const HA=_.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:p,...g},y)=>{const b=i.x,x=i.y,S=a.x,w=a.y,T={},C=2*Math.PI/Math.max(t.length,1);t.forEach((j,A)=>{const P=s.includes(j.id),G=P?S:b,B=P?w:x,z=P?240:260,Q=P?130:150,Y=C*A-Math.PI/2;T[j.id]={x:G+z*Math.cos(Y),y:B+Q*Math.sin(Y)}});const k={};if(n)for(const j of n)k[j.clientId]={x:j.x,y:j.y};function N(j){return k[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,M=d??t.filter(j=>j.status!=="offline").length,L=p??t.filter(j=>j.status==="offline").length;return h.jsxs("div",{ref:y,className:ge("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:[h.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"}),h.jsx("div",{className:"absolute top-4 left-5 z-10",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),h.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[R," nodes"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[M," online"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[L," offline"]})]}),h.jsxs("svg",{viewBox:`0 0 ${l.width} ${l.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[h.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("ellipse",{cx:S,cy:w,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${S},${w}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${S},${w} L${b},${x}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),h.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(j=>{const A=N(j.id),P=s.includes(j.id),G=P?S:b,B=P?w:x,z=MC(j.status),Q=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:G,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const Y=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(Y)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:G,y1:B,x2:A.x,y2:A.y,stroke:z,strokeWidth:Q,strokeDasharray:"4 2",children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:2.5,fill:z,opacity:.7,children:[h.jsx("animateMotion",{dur:Y,repeatCount:"indefinite",path:`M${G},${B} L${A.x},${A.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:Y,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:z,opacity:.5,children:[h.jsx("animateMotion",{dur:Y,begin:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${G},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:Y,begin:ee,repeatCount:"indefinite"})]})]},`line-${j.id}`)}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),h.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))"}}),h.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),h.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),h.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),h.jsxs("circle",{cx:S,cy:w,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),h.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))"}}),h.jsx("circle",{cx:S,cy:w,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),h.jsx("circle",{cx:S,cy:w,r:5,fill:"#8b5cf6"}),h.jsx("text",{x:S,y:w+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(j=>{const A=N(j.id),P=MC(j.status),G=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),z=s.includes(j.id);return h.jsxs("g",{opacity:G,children:[h.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:P,strokeWidth:1.5}),h.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:P}),h.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:B}),h.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,z?" · relay":""]})]},`node-${j.id}`)})]})]})});HA.displayName="TopologyHero";let IC=(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 qA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[IC.checked]:""}:{[IC.unchecked]:""}},...vi}),[e.indeterminate])}const rG=_.createContext({disabled:!1});function sG(){return _.useContext(rG)}const oG=_.createContext(void 0);function iG(e=!0){const t=_.useContext(oG);if(t===void 0&&!e)throw new Error(yn(3));return t}const VA=_.createContext(void 0);function aG(){const e=_.useContext(VA);if(e===void 0)throw new Error(yn(14));return e}const cG="data-parent",lG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!1,id:f,indeterminate:d=!1,inputRef:p,name:g,onCheckedChange:y,parent:b=!1,readOnly:x=!1,render:S,required:w=!1,uncheckedValue:T,value:C,nativeButton:k=!1,...N}=t,{clearErrors:R}=tl(),{disabled:M,name:L,setDirty:j,setFilled:A,setFocused:P,setTouched:G,state:B,validationMode:z,validityData:Q,shouldValidateOnChange:Y,validation:ee}=bi(),D=sG(),{labelId:K,controlId:q,registerControlId:V,getDescriptionProps:U}=co(),I=iG(),H=I?.parent,W=H&&I.allValues,X=M||D.disabled||I?.disabled||l,oe=L??g,se=C??oe,de=br(),xe=br();let he=q;W?he=b?xe:`${H.id}-${se}`:f&&(he=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=Ae(y),{checked:ne=s,indeterminate:pe=d,onCheckedChange:ae,...we}=Me,ve=I?.value,Se=I?.setValue,ye=I?.defaultValue,Ue=_.useRef(null),Ie=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Xe}=el({disabled:X,native:k}),Be=I?.validation??ee,[We,He]=yp({controlled:se&&ve&&!b?ve.includes(se):ne,default:se&&ye&&!b?ye.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ie.current,he))},[he,I,V,b,Ie]),_.useEffect(()=>{const ut=Ie.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ie]),Lj({enabled:!I,id:de,commit:Be.commit,value:We,controlRef:Ue,name:oe,getValue:()=>We});const me=_.useRef(null),Te=so(p,me,Be.inputRef);Le(()=>{me.current&&(me.current.indeterminate=pe,We&&A(!0))},[We,pe,A]),Hj(We,()=>{I&&!b||(R(oe),A(We),j(We!==Q.initialValue),Y()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:X,name:b?void 0:oe,id:k?void 0:he??void 0,required:w,ref:Te,style:oe?jj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Yt(ii,ut.nativeEvent);if(ae?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ve&&Se&&!b)){const Wt=xt?[...ve,se]:ve.filter(vn=>vn!==se);Se(Wt,ot)}},onFocus(){Ue.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,U,I?Be.getValidationProps:Be.getInputValidationProps),mt=W?!!ne:We,lt=W&&pe||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,X),()=>{ut.delete(se)}},[H,X,se]);const wr=_.useMemo(()=>({...B,checked:mt,disabled:X,readOnly:x,required:w,indeterminate:lt}),[B,mt,X,x,w,lt]),Er=qA(wr),Qt=zt("span",t,{state:wr,ref:[Xe,Ue,n,I?.registerControlRef],props:[{id:k?he??void 0:de,role:"checkbox","aria-checked":pe?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":K,[cG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(G(!0),P(!1),z==="onBlur"&&Be.commit(I?ve:ut.checked))},onClick(ut){x||X||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},U,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(VA.Provider,{value:wr,children:[Qt,!We&&!I&&oe&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:oe,value:T}),h.jsx("input",{...qe})]})}),uG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=aG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Ap(d),b=_.useRef(null),x={...f,transitionStatus:g};ba({open:d,ref:b,onComplete(){d||y(!1)}});const S=qA(f),w=_.useMemo(()=>({...S,...va,...vi}),[S]),T=a||p,C=zt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?C:null}),Fv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(lG,{ref:s,className:ge("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:h.jsx(uG,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Fv.displayName="Checkbox";const fG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function dG(e=!1){const t=_.useContext(fG);if(!t&&!e)throw new Error(yn(86));return t}const hG=function(t){const n=br(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),p=zn(()=>new Map),{messageIds:g}=co(),y=Ae((S,w)=>{const T=p.current;if(w===void 0){T.delete(S);return}T.set(S,w),i(C=>{if(T.size===0)return;let k;for(const N of T.values()){if(C!==void 0&&N===C)return C;k===void 0&&(k=N)}return k})}),b=_.useCallback(S=>oi({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,l,f,d,b]);return h.jsx(Uj.Provider,{value:x,children:t.children})},dh=Object.keys(wp);function pG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of dh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function mG(e){const{formRef:t,clearErrors:n}=tl(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=co(),S=rs(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Q=M.validity;if(!Q.valueMissing){const ee={value:N,state:{...wp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(M.setCustomValidity(""),b){const D=t.current.fields.get(b);D&&t.current.fields.set(b,{...D,...Iv(ee,!1)})}s(ee);return}const Y=dh.reduce((ee,D)=>(ee[D]=Q[D],ee),{});if(!Y.valid&&!pG(Y))return}function L(Q){const Y=dh.reduce((D,K)=>(D[K]=Q.validity[K],D),{});let ee=!1;for(const D of dh)if(D!=="valid"){if(D==="valueMissing"&&Y[D])ee=!0;else if(Y[D])return Y}return ee&&!d.current&&(Y.valid=!0,Y.valueMissing=!1),Y}S.clear();let j=null,A=[];const P=L(M);let G;const B=y();if(M.validationMessage&&!B)G=M.validationMessage,A=[M.validationMessage];else{const Q=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),Y=i(N,Q);typeof Y=="object"&&Y!==null&&"then"in Y?j=await Y:j=Y,j!==null?(P.valid=!1,P.customError=!0,Array.isArray(j)?(A=j,M.setCustomValidity(j.join(`
|
|
75
|
-
`))):j&&(A=[j],M.setCustomValidity(j))):B&&(M.setCustomValidity(""),P.customError=!1,M.validationMessage?(G=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const z={value:N,state:P,error:G??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Q=t.current.fields.get(b);Q&&t.current.fields.set(b,{...Q,...Iv(z,f)})}s(z)}),C=_.useCallback((N={})=>oi(x,p.valid===!1?{"aria-invalid":!0}:an,N),[x,p.valid]),k=_.useCallback((N={})=>oi({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const M=R.currentTarget;if(M.value===""){T(M.value);return}S.clear(),l?S.start(l,()=>{T(M.value)}):T(M.value)}},C(N)),[C,n,g,S,T,f,l,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:k,inputRef:w,commit:T}),[C,k,T])}const gG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=tl(),{render:l,className:f,validate:d,validationDebounceTime:p=0,validationMode:g=i,name:y,disabled:b=!1,invalid:x,dirty:S,touched:w,actionsRef:T,...C}=t,{disabled:k}=dG(),N=Ae(d||(()=>null)),R=k||b,[M,L]=_.useState(!1),[j,A]=_.useState(!1),[P,G]=_.useState(!1),[B,z]=_.useState(!1),Q=S??j,Y=w??M,ee=_.useRef(!1),D=Ae(xe=>{S===void 0&&(xe&&(ee.current=!0),A(xe))}),K=Ae(xe=>{w===void 0&&L(xe)}),q=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[U,I]=_.useState({state:wp,error:"",errors:[],value:null,initialValue:null}),H=!V&&U.state.valid,W=_.useMemo(()=>({disabled:R,touched:Y,dirty:Q,valid:H,filled:P,focused:B}),[R,Y,Q,H,P,B]),X=mG({setValidityData:I,validate:N,validityData:U,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),oe=_.useCallback(()=>{ee.current=!0,X.commit(U.value)},[X,U]);_.useImperativeHandle(T,()=>({validate:oe}),[oe]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:U,setValidityData:I,disabled:R,touched:Y,setTouched:K,dirty:Q,setDirty:D,filled:P,setFilled:G,focused:B,setFocused:z,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:X}),[V,y,U,R,Y,K,Q,D,P,G,B,z,N,g,p,q,W,X]),de=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:vi});return h.jsx(zj.Provider,{value:se,children:de})}),yG=_.forwardRef(function(t,n){return h.jsx(hG,{children:h.jsx(gG,{...t,ref:n})})}),vG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=bi(!1),{controlId:p,setLabelId:g,labelId:y}=co(),b=br(a),x=_.useRef(null),S=Ae(T=>{if(Ur(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!p))return;const k=Rt(T.currentTarget).getElementById(p);Zt(k)&&k.focus({focusVisible:!0})});return Le(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),zt("label",t,{ref:[n,x],state:d.state,props:[{id:y},l?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:vi})}),bG={...vi,...va},xG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=br(i),{validityData:p,state:g,name:y}=bi(!1),{setMessageIds:b}=co(),{errors:x}=tl(),S=y?x[y]:null;let w=!1;S||l===!0?w=!0:l?w=!!p.state[l]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:k}=Ap(w);Le(()=>{if(!(!w||!d))return b(z=>z.concat(d)),()=>{b(z=>z.filter(Q=>Q!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[L,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(z=>h.jsx("li",{children:z},z))}):p.error);let P=p.error;S!=null?P=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(P=JSON.stringify(p.errors)),w&&P!==L&&(j(P),M(A)),ba({open:w,ref:N,onComplete(){w||k(!1)}});const G={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:G,props:[{id:d,children:w?A:R},f],stateAttributesMapping:bG,enabled:T});return T?B:null}),SG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=bi(!1),{setMessageIds:p}=co();return Le(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),zt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:vi})}),ms=yG,ts=_.forwardRef(({className:e,...t},n)=>h.jsx(vG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));ts.displayName="FieldLabel";const mc=_.forwardRef(({className:e,...t},n)=>h.jsx(SG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));mc.displayName="FieldDescription";const _G=_.forwardRef(({className:e,...t},n)=>h.jsx(xG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));_G.displayName="FieldError";const wG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));wG.displayName="FieldContent";const EG=_.createContext(null),TG=_.createContext(null);function Ju(){const e=_.useContext(EG);if(e===null)throw new Error(yn(60));return e}function KA(){const e=_.useContext(TG);if(e===null)throw new Error(yn(61));return e}function Bc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function CG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Bc(t,s,n))}function Uy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Bc(s,t,n))}function RG(e,t,n){return e.filter(s=>!Bc(t,s,n))}function PC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function NG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function jG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(NG(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 AG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?PC(e.value):PC(e)}const it={id:Pe(e=>e.id),modal:Pe(e=>e.modal),multiple:Pe(e=>e.multiple),items:Pe(e=>e.items),itemToStringLabel:Pe(e=>e.itemToStringLabel),itemToStringValue:Pe(e=>e.itemToStringValue),isItemEqualToValue:Pe(e=>e.isItemEqualToValue),value:Pe(e=>e.value),hasSelectedValue:Pe(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:AG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?jG(e.items):!1),open:Pe(e=>e.open),mounted:Pe(e=>e.mounted),forceMount:Pe(e=>e.forceMount),transitionStatus:Pe(e=>e.transitionStatus),openMethod:Pe(e=>e.openMethod),activeIndex:Pe(e=>e.activeIndex),selectedIndex:Pe(e=>e.selectedIndex),isActive:Pe((e,t)=>e.activeIndex===t),isSelected:Pe((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Bc(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Bc(n,i,s)}),isSelectedByFocus:Pe((e,t)=>e.selectedIndex===t),popupProps:Pe(e=>e.popupProps),triggerProps:Pe(e=>e.triggerProps),triggerElement:Pe(e=>e.triggerElement),positionerElement:Pe(e=>e.positionerElement),listElement:Pe(e=>e.listElement),scrollUpArrowVisible:Pe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Pe(e=>e.scrollDownArrowVisible),hasScrollArrows:Pe(e=>e.hasScrollArrows)};function kG(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 OG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(aA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=kG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function MG(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,p=Math.max(t.width,a,f),g=Math.max(t.height,l,d),y=p-t.width,b=g-t.height;return{left:t.left-y/2,right:t.right+y/2,top:t.top-b/2,bottom:t.bottom+b/2}}const Vd=2,IG=400,DC=200,PG={...H7,...vi,value:()=>null},DG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=bi(),{labelId:S}=co(),{store:w,setOpen:T,selectionRef:C,validation:k,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:L,keyboardActiveRef:j}=Ju(),A=x||L||l,P=at(w,it.open),G=at(w,it.value),B=at(w,it.triggerProps),z=at(w,it.positionerElement),Q=at(w,it.listElement),Y=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,K=at(w,it.hasNullItemLabel,D),q=a??Y;$j({id:q});const V=Jo(z),U=_.useRef(null),{getButtonProps:I,buttonRef:H}=el({disabled:A,native:f}),W=Ae(ne=>{w.set("triggerElement",ne)}),X=so(n,U,H,W),oe=rs(),se=rs(),de=rs(),xe=rs();_.useEffect(()=>{if(P)return!(ee||K)?de.start(IG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):xe.start(DC,()=>{C.current.allowUnselectedMouseUp=!0,de.start(DC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{de.clear(),xe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,K,C,se,de,xe]);const he=_.useMemo(()=>Q?.id??Hh(z)?.id,[Q,z]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?he:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:X,onFocus(ne){g(!0),P&&M.current&&T(!1,Yt(ii,ne.nativeEvent)),oe.start(0,()=>{w.set("forceMount",!0)})},onBlur(ne){Ot(z,ne.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&k.commit(G))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(ne){if(P)return;const pe=Rt(ne.currentTarget);function ae(we){if(!U.current)return;const ve=we.target;if(Ot(U.current,ve)||Ot(V.current,ve)||ve===U.current)return;const Se=MG(U.current);we.clientX>=Se.left-Vd&&we.clientX<=Se.right+Vd&&we.clientY>=Se.top-Vd&&we.clientY<=Se.bottom+Vd||T(!1,Yt(T8,we))}se.start(0,()=>{pe.addEventListener("mouseup",ae,{once:!0})})}},k.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:A,value:G,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,U],state:_e,stateAttributesMapping:PG,props:Me})}),zG=_.createContext(void 0),LG=_.forwardRef(function(t,n){const{store:s}=Ju(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(zG.Provider,{value:!0,children:h.jsx(RA,{ref:n,...t})}):null});let zC={},LC={},UC="";function UG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function $G(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Rt(e),s=n.documentElement,i=n.body,a=yi(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 p=a.offsetWidth;return a.style.overflowY=l,s.style.scrollbarGutter=f,d===p}function BG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=yi(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 FG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=ys.create();if(sx&&(i.visualViewport?.scale??1)!==1)return()=>{};function p(){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,zC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},UC=n.style.scrollBehavior,LC={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 C=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",M=Math.max(0,i.innerWidth-s.clientWidth),L=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),P=yi(n)?n:s;if(f=$G(e),f){n.style.scrollbarGutter=T,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||N)&&(n.style.overflowY="scroll"),(k||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||L?`calc(100dvh - ${j+L}px)`:"100dvh",width:A||M?`calc(100vw - ${A+M}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,zC),Object.assign(s.style,LC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=UC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class HG{lockCount=0;restore=null;timeoutLock=ai.create();timeoutUnlock=ai.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=Rt(t).documentElement,i=un(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=jn;return}const a=aA||!UG(t);this.restore=a?BG(t):FG(t)}}const qG=new HG;function GA(e=!0,t=null){Le(()=>{if(e)return qG.acquire(t)},[e,t])}const ZA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function VG(){return _.useContext(ZA)}function YA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),l=_.useRef(0),f=zn(GG).current,d=zn(KG).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,k)=>{d.set(C,k??null),y.current+=1,g(y.current)}),x=Ae(C=>{d.delete(C),y.current+=1,g(y.current)}),S=_.useMemo(()=>{const C=new Map;return Array.from(d.keys()).filter(N=>N.isConnected).sort(ZG).forEach((N,R)=>{const M=d.get(N)??{};C.set(N,{...M,index:R})}),C},[d,p]);Le(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(k=>{const N=new Set,R=M=>N.has(M)?N.delete(M):N.add(M);k.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((k,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Le(()=>{y.current===p&&(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,p]),Le(()=>()=>{n.current=[]},[n]),Le(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));Le(()=>{f.forEach(C=>C(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 h.jsx(ZA.Provider,{value:T,children:t})}function KG(){return new Map}function GG(){return new Set}function ZG(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 XA=_.createContext(void 0);function YG(){const e=_.useContext(XA);if(!e)throw new Error(yn(59));return e}const QA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
|
|
74
|
+
`)}})}const P9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=O9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const A=`${g||C.dataKey||C.name||"value"}`,N=JT(S,C,A),R=!g&&typeof f=="string"?S[f]?.label??f:N?.label;return p?h.jsx("div",{className:ge("font-medium",d),children:p(R??"",b)}):R?h.jsx("div",{className:ge("font-medium",d),children:R}):null},[S,a,f,d,p,g,b]);if(!e||!b?.length)return null;const T=b.length===1&&l!=="dot";return h.jsxs("div",{className:ge("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,h.jsx("div",{className:"grid gap-1.5",children:b.map((C,A)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=JT(S,C,N),M=n||C.payload?.fill||C.color;return h.jsx("div",{className:ge("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&&C.value!==void 0&&C.name?s(C.value,C.name,C,A,C.payload??{}):h.jsxs(h.Fragment,{children:[R?.icon?h.jsx(R.icon,{}):i?null:h.jsx("div",{className:ge("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":M,"--color-border":M}}),h.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[h.jsxs("div",{className:"grid gap-1.5",children:[T?w:null,h.jsx("span",{className:"text-neutral-500",children:R?.label||C.name})]}),C.value!==void 0?h.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof C.value=="number"?C.value.toLocaleString():C.value}):null]})]})},N)})})]})});P9.displayName="ChartTooltipContent";function JT(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 D9=["1h","6h","24h","7d"],Tj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="now",...f},d)=>h.jsxs("div",{ref:d,className:ge("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),h.jsx("div",{className:"flex gap-0.5 ml-2",children:D9.map(p=>h.jsx("button",{type:"button",onClick:()=>s?.(p),className:ge("font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all",p===n?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:p},p))})]})]}),h.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((p,g)=>h.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[h.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pullPercent}%`}}),h.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pushPercent}%`}})]},g))}),h.jsxs("div",{className:"flex justify-between mt-1.5",children:[h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:i}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:a}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:l})]})]}));Tj.displayName="ActivityBars";const eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=Vb,mi=(e,t)=>n=>{var s;if(t?.variants==null)return tC(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(p=>{const g=n?.[p],y=a?.[p];if(g===null)return null;const b=eC(g)||eC(y);return i[p][b]}),f=n&&Object.entries(n).reduce((p,g)=>{let[y,b]=g;return b===void 0||(p[y]=b),p},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,g)=>{let{class:y,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})?[...p,y,b]:p},[]);return tC(e,l,d,n?.class,n?.className)},z9=mi("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"}}),Gn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(z9({variant:t,className:e})),...n}));Gn.displayName="Input";function yp({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(p=>{i||l(p)},[]);return[f,d]}const nC={};function zn(e,t){const n=_.useRef(nC);return n.current===nC&&(n.current=e(t)),n}const Ry=L1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],L9=Ry&&Ry!==_.useLayoutEffect?Ry:e=>e();function Ae(e){const t=zn(U9).current;return t.next=e,L9(t.effect),t.trampoline}function U9(){const e={next:void 0,callback:$9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function $9(){}function so(e,t,n,s){const i=zn(Cj).current;return F9(i,e,t,n,s)&&Rj(i,[e,t,n,s]),i.callback}function B9(e){const t=zn(Cj).current;return H9(t,e)&&Rj(t,e),t.callback}function Cj(){return{callback:null,cleanup:null,refs:[]}}function F9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function H9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function Rj(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 q9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:q9,Nj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vp={...Nj,position:"fixed",top:0,left:0},jj={...Nj,position:"absolute"};function jn(){}const Nu=Object.freeze([]),an=Object.freeze({});function yn(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 V9=parseInt(_.version,10);function Zb(e){return V9>=e}function rC(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Zb(19)?n?.ref:t.ref)??null}function jv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function K9(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 G9(e,t){return typeof e=="function"?e(t):e}function Z9(e,t){return typeof e=="function"?e(t):e}const hu={};function oi(e,t,n,s,i){let a={...Av(e,hu)};return t&&(a=lu(a,t)),n&&(a=lu(a,n)),s&&(a=lu(a,s)),i&&(a=lu(a,i)),a}function Y9(e){if(e.length===0)return hu;if(e.length===1)return Av(e[0],hu);let t={...Av(e[0],hu)};for(let n=1;n<e.length;n+=1)t=lu(t,e[n]);return t}function lu(e,t){return Aj(t)?t(e):X9(e,t)}function X9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=jv(e.style,s);break}case"className":{e[n]=kj(e.className,s);break}default:Q9(n,s)?e[n]=W9(e[n],s):e[n]=s}}return e}function Q9(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 Aj(e){return typeof e=="function"}function Av(e,t){return Aj(e)?e(t):e??hu}function W9(e,t){return t?e?n=>{if(J9(n)){const i=n;kv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function kv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function kj(e,t){return t?e?t+" "+e:t:e}function J9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const e8={style:{transition:"none"}},t8="data-base-ui-click-trigger",n8={fallbackAxisSide:"none"},r8={fallbackAxisSide:"end"},s8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=o8(t,n);if(n.enabled===!1)return null;const a=n.state??an;return a8(e,s,i,a)}function o8(e,t={}){const{className:n,style:s,render:i}=e,{state:a=an,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?G9(n,a):void 0,y=p?Z9(s,a):void 0,b=p?K9(a,d):an,x=p?jv(b,Array.isArray(f)?Y9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=B9([x.ref,rC(i),...l]):x.ref=so(x.ref,rC(i),l):so(null,null)),p?(g!==void 0&&(x.className=kj(x.className,g)),y!==void 0&&(x.style=jv(x.style,y)),x):an}const i8=Symbol.for("react.lazy");function a8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=oi(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===i8&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return c8(e,n);throw new Error(yn(8))}function c8(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 l8={...L1};let sC=0;function u8(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(sC+=1,s(`${t}-${sC}`))},[n,t]),i}const oC=l8.useId;function Qu(e,t){if(oC!==void 0){const n=oC();return e??(t?`${t}-${n}`:n)}return u8(e,t)}function br(e){return Qu(e,"base-ui")}function bp(){return typeof window<"u"}function gi(e){return Yb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Yb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yb(e){return bp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return bp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return bp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Ov(e){return!bp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const f8=new Set(["inline","contents"]);function yi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!f8.has(i)}const d8=new Set(["table","td","th"]);function h8(e){return d8.has(gi(e))}const p8=[":popover-open",":modal"];function xp(e){return p8.some(t=>{try{return e.matches(t)}catch{return!1}})}const m8=["transform","translate","scale","rotate","perspective"],g8=["transform","translate","scale","rotate","perspective","filter"],y8=["paint","layout","strict","content"];function Xb(e){const t=Sp(),n=jt(e)?xr(e):e;return m8.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)||g8.some(s=>(n.willChange||"").includes(s))||y8.some(s=>(n.contain||"").includes(s))}function v8(e){let t=oo(e);for(;Zt(t)&&!Ys(t);){if(Xb(t))return t;if(xp(t))return null;t=oo(t)}return null}function Sp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const b8=new Set(["html","body","#document"]);function Ys(e){return b8.has(gi(e))}function xr(e){return un(e).getComputedStyle(e)}function _p(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(gi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ov(e)&&e.host||_s(e);return Ov(t)?t.host:t}function Oj(e){const t=oo(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&yi(t)?t:Oj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Oj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Mv(l);return t.concat(l,l.visualViewport||[],yi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Mv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mj=_.createContext(void 0);function Ij(e=!1){const t=_.useContext(Mj);if(t===void 0&&!e)throw new Error(yn(16));return t}function x8(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 p={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return s||(p.tabIndex=i,!a&&n&&(p.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,l,f,a,i])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Ij(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=x8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;S8(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);Le(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...A}=b;return oi({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(kv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,L=R.key==="Enter",j=R.key===" ";M&&((j||L)&&R.preventDefault(),L&&x?.(R))},onKeyUp(R){t||(kv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,A)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function S8(e){return Zt(e)&&e.tagName==="BUTTON"}const Pj=_.createContext(void 0);function _8(){const e=_.useContext(Pj);if(e===void 0)throw new Error(yn(63));return e}let iC=(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 wp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vi={valid(e){return e===null?null:e?{[iC.valid]:""}:{[iC.invalid]:""}}};let aC=(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 Dj={...vi,checked(e){return e?{[aC.checked]:""}:{[aC.unchecked]:""}}};function Iv(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const w8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function tl(){return _.useContext(w8)}const zj=_.createContext({invalid:void 0,name:void 0,validityData:{state:wp,errors:[],error:"",value:"",initialValue:null},setValidityData:jn,disabled:void 0,touched:!1,setTouched:jn,dirty:!1,setDirty:jn,filled:!1,setFilled:jn,focused:!1,setFocused:jn,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=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}});function bi(e=!0){const t=_.useContext(zj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function Lj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=tl(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=bi(),b=Ae(e.getValue);Le(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&y(S=>({...S,initialValue:x}))},[t,y,n,g.initialValue,b]),Le(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:Iv(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),p.current=!0,x?hi.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,p,i,g,n]),Le(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Uj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function co(){return _.useContext(Uj)}function $j(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=co(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===jn||(p.current=!1,a(d.current,void 0))});return Le(()=>{if(a===jn)return;let b;if(n){const x=s?.current;jt(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{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,y]),_.useEffect(()=>y,[y]),i??l}const ii="none",cC="trigger-press",Pv="trigger-hover",Bj="outside-press",Ny="item-press",Fj="focus-out",E8="escape-key",T8="cancel-open",C8="imperative-action",R8="window-resize";function Yt(e,t,n,s){let i=!1,a=!1;const l=s??an;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 Hj(e,t){const n=_.useRef(e),s=Ae(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const N8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,inputRef:f,name:d,nativeButton:p=!1,onCheckedChange:g,readOnly:y=!1,required:b=!1,disabled:x=!1,render:S,uncheckedValue:w,value:T,...C}=t,{clearErrors:A}=tl(),{state:N,setTouched:R,setDirty:M,validityData:L,setFilled:j,setFocused:k,shouldValidateOnChange:P,validationMode:G,disabled:B,name:z,validation:Q}=bi(),{labelId:Y}=co(),ee=B||x,D=z??d,K=Ae(g),q=_.useRef(null),V=so(q,f,Q.inputRef),U=_.useRef(null),I=br(),H=$j({id:l,implicit:!1,controlRef:U}),W=p?void 0:H,[X,oe]=yp({controlled:s,default:!!a,name:"Switch",state:"checked"});Lj({id:I,commit:Q.commit,value:X,controlRef:U,name:D,getValue:()=>X}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Hj(X,()=>{A(D),M(X!==L.initialValue),j(X),P()?Q.commit(X):Q.commit(X,!0)});const{getButtonProps:se,buttonRef:de}=el({disabled:ee,native:p}),xe={id:p?H:I,role:"switch","aria-checked":X,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":Y,onFocus(){ee||k(!0)},onBlur(){const ne=q.current;!ne||ee||(R(!0),k(!1),G==="onBlur"&&Q.commit(ne.checked))},onClick(ne){y||ee||(ne.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ne.shiftKey,ctrlKey:ne.ctrlKey,altKey:ne.altKey,metaKey:ne.metaKey})))}},he=_.useMemo(()=>oi({checked:X,disabled:ee,id:W,name:D,required:b,style:D?jj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const pe=ne.target.checked,ae=Yt(ii,ne.nativeEvent);K?.(pe,ae),!ae.isCanceled&&oe(pe)},onFocus(){U.current?.focus()}},Q.getInputValidationProps,T!==void 0?{value:T}:an),[X,ee,V,W,D,K,b,oe,Q,T]),Me=_.useMemo(()=>({...N,checked:X,disabled:ee,readOnly:y,required:b}),[N,X,ee,y,b]),_e=zt("span",t,{state:Me,ref:[n,U,de],props:[xe,Q.getValidationProps,C,se],stateAttributesMapping:Dj});return h.jsxs(Pj.Provider,{value:Me,children:[_e,!X&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...he})]})}),j8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=bi(),f=_8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:Dj,props:a})}),Ep=_.forwardRef(({className:e,...t},n)=>h.jsx(N8,{ref:n,className:ge("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:h.jsx(j8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Ep.displayName="Switch";const qj=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),h.jsx(Ep,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(jy,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(jy,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(jy,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});qj.displayName="AlertsConfig";function jy({label:e,value:t,onChange:n}){return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),h.jsx(Gn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const A8=mi("inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] leading-normal 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"}}),mn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(A8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));mn.displayName="Badge";const nl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));nl.displayName="Table";const rl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));rl.displayName="TableHeader";const sl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));sl.displayName="TableBody";const os=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"row",className:ge("font-mono text-[11px] leading-6 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",e),...t}));os.displayName="TableRow";const ht=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"columnheader",className:ge("min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate",e),...t}));ht.displayName="TableHead";const pt=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"cell",className:ge("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));pt.displayName="TableCell";const k8={relay:"relay",admin:"flow",proxy:"ghost"},O8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>h.jsx("div",{ref:l,className:ge("w-full",e),...a,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(sl,{children:t.map((f,d)=>h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(mn,{variant:k8[f.type]??"ghost",children:f.type})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-500 truncate",children:f.prefix})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-600 truncate",children:f.created})}),(s||i)&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s&&h.jsx("button",{type:"button",onClick:()=>s(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),i&&h.jsx("button",{type:"button",onClick:()=>i(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},`${f.name}:${f.prefix}:${d}`))})]})}));O8.displayName="ApiKeysTable";const Vj=_.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:s=!0,...i},a)=>h.jsxs("div",{ref:a,className:ge("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:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(l=>h.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&&h.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(l=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.label))}),n!=null&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));Vj.displayName="BottomBar";const Kj=_.forwardRef(({className:e,commits:t,onViewAll:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("px-5 pt-3 pb-2",e),...s,children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&h.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 →"})]}),h.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:[h.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),h.jsx("span",{className:"flex-1 truncate",children:"Tables"}),h.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(a=>h.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:[h.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",a.seq]}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:a.actor}),h.jsx("span",{className:"w-[50px] text-white truncate",children:a.changes}),h.jsx("span",{className:"flex-1 truncate",children:h.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})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:a.time})]},a.seq))]}));Kj.displayName="CommitTable";const Gj=mi("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"}}),Oe=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Gj({variant:t,size:n,className:e})),...s}));Oe.displayName="Button";const Zj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,onConsoleTokenChange:f,onSaveAndConnect:d,onDisconnect:p,onTestConnection:g,statusMessage:y,...b},x)=>h.jsxs("div",{ref:x,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),h.jsx(mn,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),h.jsxs("div",{className:"p-5 space-y-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),h.jsx(Gn,{id:"console-server-url",variant:"mono",value:i,onChange:S=>a?.(S.target.value)})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),h.jsx(Gn,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Oe,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Oe,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Oe,{variant:"destructive",size:"md",onClick:p,disabled:!t,children:"Disconnect"})]}),y&&h.jsx("div",{className:ge("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:y})]})]}));Zj.displayName="ConnectionForm";const M8=mi("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"}}),Pt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(M8({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.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"})]}));Pt.displayName="Spinner";function I8({className:e,state:t}){switch(t){case"connected":return h.jsx(mn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(mn,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[h.jsx(Pt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(mn,{variant:"ghost",className:e,children:"Not configured"})}}const Qb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Qb.displayName="Card";const P8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));P8.displayName="CardHeader";const D8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));D8.displayName="CardTitle";const Wb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Wb.displayName="CardContent";const z8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));z8.displayName="CardFooter";function Jb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const Yj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,p)=>h.jsx(L8,{group:d,showDivider:p>0},p)),i!==void 0&&h.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&&h.jsx("div",{className:"ml-auto flex items-center gap-2",children:a})]}));Yj.displayName="FilterBar";function L8({group:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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 U8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const $8={online:"healthy",syncing:"syncing",offline:"offline"},B8={realtime:"flow",polling:"ghost"},F8=_.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=U8(l);return h.jsxs("div",{ref:a,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${d}`},...i,children:[h.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.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})}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx(mn,{variant:$8[t.status],children:t.status}),h.jsx(mn,{variant:B8[t.mode],children:t.mode})]})]}),h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"h-1 rounded-full bg-surface",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:d}})}),h.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:d},children:l===0?"Caught up":`${l} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ay,{label:"Actor",value:t.actor}),h.jsx(Ay,{label:"Dialect",value:t.dialect}),h.jsx(Ay,{label:"Last seen",value:t.lastSeen}),h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),h.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(p=>h.jsx(mn,{variant:"ghost",children:p},p)),t.scopes.length>2&&h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),s&&h.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:[h.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),h.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});F8.displayName="FleetCard";function Ay({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const Xj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const H8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const q8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const lC=e=>{const t=q8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var V8={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 K8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const G8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...V8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Xj("lucide",i),...!a&&!K8(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const ex=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(G8,{ref:a,iconNode:t,className:Xj(`lucide-${H8(lC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=lC(e),n};const Z8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y8=ex("arrow-left",Z8);const X8=[["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"}]],Q8=ex("settings",X8);const W8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],J8=ex("user-x",W8);function eV(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const tV={online:"healthy",syncing:"syncing",offline:"offline"},Qj=_.forwardRef(({className:e,clients:t,headSeq:n,onEvict:s,...i},a)=>h.jsx("div",{ref:a,className:ge("w-full",e),...i,children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[160px]",children:"Client"}),h.jsx(ht,{className:"w-[70px]",children:"Status"}),h.jsx(ht,{className:"w-[60px]",children:"Type"}),h.jsx(ht,{className:"w-[80px]",children:"Cursor"}),h.jsx(ht,{className:"w-[110px]",children:"Lag"}),h.jsx(ht,{className:"w-[60px]",children:"Dialect"}),h.jsx(ht,{className:"flex-1",children:"Mode"})]})}),h.jsx(sl,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=eV(f);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[160px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:p,boxShadow:`0 0 4px ${p}`}}),h.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:l.id,children:l.id.length>18?`${l.id.substring(0,18)}…`:l.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(mn,{variant:tV[l.status],children:l.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.cursor.toLocaleString()]})}),h.jsx(pt,{className:"w-[110px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-[60px] h-[3px] rounded-full bg-surface overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${d}%`,background:p}})}),h.jsx("span",{className:"font-mono text-[10px] font-medium",style:{color:p},children:f===0?"0":`${f}`})]})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(l.id),className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors opacity-0 group-hover:opacity-100",children:[h.jsx(J8,{size:10}),"evict"]})]},l.id)})})]})}));Qj.displayName="FleetTable";const Wj=_.forwardRef(({className:e,handlers:t,tableCount:n,...s},i)=>{const a=n??t.length;return h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[a," tables"]})]}),h.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:[h.jsx("span",{className:"flex-1",children:"Table"}),h.jsx("span",{className:"w-[100px]",children:"Depends On"}),h.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((l,f)=>h.jsxs("div",{className:ge("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:[h.jsx("span",{className:"flex-1 text-white truncate",children:l.table}),h.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?h.jsx(mn,{variant:"ghost",children:l.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Wj.displayName="HandlersTable";const nV={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Jj=_.forwardRef(({className:e,items:t,...n},s)=>h.jsx("div",{ref:s,className:ge("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)=>h.jsx(rV,{item:i,showDivider:a>0},i.label))}));Jj.displayName="KpiStrip";function rV({item:e,showDivider:t}){const n=nV[e.color??"muted"]??"bg-neutral-500";return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n)}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),h.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&h.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&h.jsx("span",{className:ge("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const eA=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;return h.jsxs("div",{ref:a,className:ge("px-5 py-3 border-b border-border flex items-center gap-8",e),...i,children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(d=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:d.label}),h.jsxs("div",{className:"flex gap-1 items-end h-5",children:[h.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${d.pushBarPercent}%`}}),h.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${d.pullBarPercent}%`}})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[d.pushMs," / ",d.pullMs,"ms"]})]},d.label))}),h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${l} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",h.jsx("span",{className:"text-neutral-600",children:s})]})]})]})});eA.displayName="LatencyPercentilesBar";const sV={PUSH:"syncing",PULL:"healthy",ACK:"flow"},tA=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:l,className:ge("flex-shrink-0",e),style:{width:360},...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),h.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:i?{maxHeight:i}:void 0,children:f.length===0?h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((d,p)=>h.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[h.jsx(mn,{variant:sV[d.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:d.type}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[d.actor," · ",d.table]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:d.time})]},`${d.time}-${p}`))})]})});tA.displayName="LiveActivityFeed";const oV={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},Tp=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="default",actionIcon:f,onAction:d,...p},g)=>h.jsxs("div",{ref:g,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...p,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",oV[s])}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),h.jsx("div",{className:ge("grid gap-3 mb-4",i.length<=2?"grid-cols-2":"grid-cols-3"),children:i.map(y=>h.jsxs("div",{children:[h.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:y.label}),h.jsx("div",{className:ge("font-mono font-semibold",y.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:y.value})]},y.label))}),h.jsxs(Oe,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));Tp.displayName="MaintenanceCard";function iV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Qb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Wb,{className:s,children:t})]})}const nA=_.forwardRef(({className:e,rows:t,onResetDefaults:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&h.jsx(Oe,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>h.jsx(aV,{row:a,showDivider:l>0},a.label))})]}));nA.displayName="PreferencesPanel";function aV({row:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"border-t border-border"}),h.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),h.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&h.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),h.jsx(Ep,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function tx({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Qb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Wb,{className:s,children:t})]})}const cV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},lV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},rA=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...l,children:[n,h.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:[h.jsx("span",{className:"w-[50px] truncate",children:"Time"}),h.jsx("span",{className:"w-[65px] truncate",children:"Type"}),h.jsx("span",{className:"w-[55px] truncate",children:"ID"}),h.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),h.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[120px] truncate",children:"Client"}),h.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((d,p)=>h.jsx(uV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));rA.displayName="StreamLog";function uV({entry:e,isSelected:t,onClick:n}){const s=cV[e.type]??"text-neutral-500",i=lV[e.outcome]??"text-neutral-600",a=ge("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=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),h.jsx("span",{className:ge("w-[65px] font-medium truncate",s),children:e.type.toUpperCase()}),h.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),h.jsx("span",{className:ge("w-[65px] truncate",i),children:e.outcome}),h.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),h.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?h.jsx("button",{type:"button",className:ge(a,"w-full bg-transparent text-left"),onClick:()=>n(e),children:l}):h.jsx("div",{className:a,children:l})}function fV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const sA=_.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,p=s??Math.max(...t.map(b=>n-b.cursor),0),g=n-d,y=[d,Math.round(d+g*.33),Math.round(d+g*.66),n];return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),h.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"w-px h-3 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),h.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:p})]})]})]}),h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:y.map(b=>h.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),h.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=fV(b.status),w=b.status==="offline"?.4:1;return h.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:w},title:`${b.id} → #${b.cursor}`,children:h.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:S,boxShadow:`0 0 4px ${S}`}})},b.id)})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});sA.displayName="SyncHorizon";function dV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const hV=_.createContext(void 0);function nx(e){const t=_.useContext(hV);if(t===void 0)throw new Error(yn(72));return t}const pV=[];function rx(e){_.useEffect(e,pV)}const iu=0;class ai{static create(){return new ai}currentId=iu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}clear=()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)};disposeEffect=()=>this.clear}function rs(){const e=zn(ai.create).current;return rx(e.disposeEffect),e}function Jo(e){const t=zn(mV,e).current;return t.next=e,Le(t.effect),t}function mV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const ol=typeof navigator<"u",ky=vV(),oA=xV(),iA=bV(),sx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),aA=ky.platform==="MacIntel"&&ky.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ky.platform),gV=ol&&/apple/i.test(navigator.vendor),Dv=ol&&/android/i.test(oA)||/android/i.test(iA);ol&&oA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const yV=iA.includes("jsdom/");function vV(){if(!ol)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 bV(){if(!ol)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function xV(){if(!ol)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const zv="data-base-ui-focusable",cA="active",lA="selected",uA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Oy="ArrowLeft",My="ArrowRight",SV="ArrowUp",_V="ArrowDown";function Bo(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&&Ov(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function wV(e,t){if(!jt(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 Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function es(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 EV(e){return e.matches("html,body")}function fA(e){return Zt(e)&&e.matches(uA)}function uC(e){return e?e.getAttribute("role")==="combobox"&&fA(e):!1}function Hh(e){return e?e.hasAttribute(zv)?e:e.querySelector(`[${zv}]`)||e:null}function Sc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...Sc(e,i.id,n)])}function fC(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 Vi(e){e.preventDefault(),e.stopPropagation()}function TV(e){return"nativeEvent"in e}function CV(e){return e.pointerType===""&&e.isTrusted?!0:Dv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function RV(e){return yV?!1:!Dv&&e.width===0&&e.height===0||Dv&&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 NV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function jV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const AV=["top","right","bottom","left"],Uc=Math.min,dr=Math.max,qh=Math.round,pc=Math.floor,xs=e=>({x:e,y:e}),kV={left:"right",right:"left",bottom:"top",top:"bottom"},OV={start:"end",end:"start"};function Lv(e,t,n){return dr(e,Uc(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function xi(e){return e.split("-")[1]}function ox(e){return e==="x"?"y":"x"}function ix(e){return e==="y"?"height":"width"}const MV=new Set(["top","bottom"]);function Fr(e){return MV.has(Zn(e))?"y":"x"}function ax(e){return ox(Fr(e))}function IV(e,t,n){n===void 0&&(n=!1);const s=xi(e),i=ax(e),a=ix(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Vh(l)),[l,Vh(l)]}function PV(e){const t=Vh(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.replace(/start|end/g,t=>OV[t])}const dC=["left","right"],hC=["right","left"],DV=["top","bottom"],zV=["bottom","top"];function LV(e,t,n){switch(e){case"top":case"bottom":return n?t?hC:dC:t?dC:hC;case"left":case"right":return t?DV:zV;default:return[]}}function UV(e,t,n,s){const i=xi(e);let a=LV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Uv)))),a}function Vh(e){return e.replace(/left|right|bottom|top/g,t=>kV[t])}function $V(e){return{top:0,right:0,bottom:0,left:0,...e}}function dA(e){return typeof e!="number"?$V(e):{top:e,right:e,bottom:e,left:e}}function Kh(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 Ld(e,t,n){return Math.floor(e/t)!==n}function lh(e,t){return t<0||t>=e.current.length}function BV(e,t){return fr(e,{disabledIndices:t})}function FV(e,t){return fr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fr(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&&pu(e,a,s));return a}function HV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,A=-1;e.current.forEach((N,R)=>{if(N==null)return;const M=N.closest('[role="row"]');M&&(S=!0),(M!==C||A===-1)&&(C=M,A+=1,b[A]=[]),b[A].push(R),x[R]=A})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const A=x[p];if(A==null)return;const N=b[A].indexOf(p);let R=C==="up"?A-1:A+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const M=new Set;for(;R>=0&&R<b.length&&!M.has(R);){M.add(R);const L=b[R];if(L.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,L.length-1);for(let k=j;k>=0;k-=1){const P=L[k];if(!pu(e,P,l))return P}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===SV){const C=T("up");if(C!==void 0)g&&Vi(t),y=C;else{if(g&&Vi(t),p===-1)y=d;else if(y=fr(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:l}),s&&(p-a<f||y<0)){const A=p%a,N=d%a,R=d-(N-A);N===A?y=d:y=N>A?R:R-a}lh(e,y)&&(y=p)}}if(t.key===_V){const C=T("down");C!==void 0?(g&&Vi(t),y=C):(g&&Vi(t),p===-1?y=f:(y=fr(e,{startingIndex:p,amount:a,disabledIndices:l}),s&&p+a>d&&(y=fr(e,{startingIndex:p%a-a,amount:a,disabledIndices:l}))),lh(e,y)&&(y=p))}if(n==="both"){const C=pc(p/a);t.key===(i?Oy:My)&&(g&&Vi(t),p%a!==a-1?(y=fr(e,{startingIndex:p,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l})),Ld(y,a,C)&&(y=p)),t.key===(i?My:Oy)&&(g&&Vi(t),p%a!==0?(y=fr(e,{startingIndex:p,decrement:!0,disabledIndices:l}),s&&Ld(y,a,C)&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l})),Ld(y,a,C)&&(y=p));const A=pc(d/a)===C;lh(e,y)&&(s&&A?y=t.key===(i?My:Oy)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function qV(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 p=[];for(let g=0;g<a;g+=1)for(let y=0;y<l;y+=1)p.push(i+g+y*t);i%t+a<=t&&p.every(g=>s[g]==null)?(p.forEach(g=>{s[g]=f}),d=!0):i+=1}}),[...s]}function VV(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 KV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function pu(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 GV=["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] *)"],Gh=GV.join(","),hA=typeof Element>"u",$c=hA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zh=!hA&&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},Yh=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]"):Yh(t.parentNode));return l},ZV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},pA=function(t,n,s){if(Yh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gh));return n&&$c.call(t,Gh)&&i.unshift(t),i=i.filter(s),i},Xh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Yh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Xh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=$c.call(l,Gh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Yh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Xh(y===!0?l.children:y.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},mA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ZV(t))&&!mA(t)?0:t.tabIndex},YV=function(t,n){var s=gA(t);return s<0&&n&&!mA(t)?0:s},XV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yA=function(t){return t.tagName==="INPUT"},QV=function(t){return yA(t)&&t.type==="hidden"},WV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},JV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},eK=function(t){if(!t.name)return!0;var n=t.form||Zh(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=JV(i,t.form);return!a||a===t},tK=function(t){return yA(t)&&t.type==="radio"},nK=function(t){return tK(t)&&!eK(t)},rK=function(t){var n,s=t&&Zh(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 p,g,y;s=Zh(i),i=(p=s)===null||p===void 0?void 0:p.host,a=!!((g=i)!==null&&g!==void 0&&(y=g.ownerDocument)!==null&&y!==void 0&&y.contains(i))}}return a},pC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},sK=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=$c.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if($c.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 p=t.parentElement,g=Zh(t);if(p&&!p.shadowRoot&&i(p)===!0)return pC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(rK(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return pC(t);return!1},oK=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 $c.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$v=function(t,n){return!(n.disabled||QV(n)||sK(n,t)||WV(n)||oK(n))},Bv=function(t,n){return!(nK(n)||gA(n)<0||!$v(t,n))},iK=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=YV(f,l),p=l?vA(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:p})}),s.sort(XV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Cp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:Bv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iK}):s=pA(t,n.includeContainer,Bv.bind(null,n)),vA(s)},aK=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Xh([t],n.includeContainer,{filter:$v.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=pA(t,n.includeContainer,$v.bind(null,n)),s},bA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $c.call(t,Gh)===!1?!1:Bv(n,t)};const Wu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xA(e,t){const n=Cp(e,Wu()),s=n.length;if(s===0)return;const i=Bo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function SA(e){return xA(Rt(e).body,1)||e}function _A(e){return xA(Rt(e).body,-1)||e}function mu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function cK(e){Cp(e,Wu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function mC(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 lK(){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 uK=_.createContext(null),fK=_.createContext(null),Rp=()=>_.useContext(uK)?.id||null,Np=e=>{const t=_.useContext(fK);return e??t};function ju(e){return`data-base-ui-${e}`}const Ud=null;class dK{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 $d=new dK;class ys{static create(){return new ys}static request(t){return $d.request(t)}static cancel(t){return $d.cancel(t)}currentId=Ud;request(t){this.cancel(),this.currentId=$d.request(()=>{this.currentId=Ud,t()})}cancel=()=>{this.currentId!==Ud&&($d.cancel(this.currentId),this.currentId=Ud)};disposeEffect=()=>this.cancel}function cx(){const e=zn(ys.create).current;return rx(e.disposeEffect),e}const Qh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{gV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:vp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let gC=0;function Iy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(gC);const a=()=>e?.focus({preventScroll:n});i?a():gC=requestAnimationFrame(a)}const _c={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function yC(e){return e==="inert"?_c.inert:e==="aria-hidden"?_c["aria-hidden"]:_c.none}let Bd=new WeakSet,Fd={},Py=0;const wA=e=>e&&(e.host||wA(e.parentNode)),hK=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=wA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function pK(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=hK(t,e),f=new Set,d=new Set(l),p=[];Fd[i]||(Fd[i]=new WeakMap);const g=Fd[i];l.forEach(y),b(t),f.clear();function y(x){!x||f.has(x)||(f.add(x),x.parentNode&&y(x.parentNode))}function b(x){!x||d.has(x)||[].forEach.call(x.children,S=>{if(gi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=yC(a),A=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,A),g.set(S,N),p.push(S),A===1&&T&&Bd.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return Py+=1,()=>{p.forEach(x=>{const S=yC(a),T=(S.get(x)||0)-1,C=(g.get(x)||0)-1;S.set(x,T),g.set(x,C),T||(!Bd.has(x)&&a&&x.removeAttribute(a),Bd.delete(x)),C||x.removeAttribute(i)}),Py-=1,Py||(_c.inert=new WeakMap,_c["aria-hidden"]=new WeakMap,_c.none=new WeakMap,Bd=new WeakSet,Fd={})}}function mK(e,t=!1,n=!1){const s=Rt(e[0]).body;return pK(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const EA=_.createContext(null),TA=()=>_.useContext(EA),gK=ju("portal");function CA(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Qu(),f=TA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);Le(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Yb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,y(null),p(null));return}x.current!==T&&(x.current=T,y(null),p(T))},[n,f,a]);const S=zt("div",s,{ref:[t,b],props:[{id:a,[gK]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const RA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=CA({container:i,ref:n,componentProps:t,elementProps:d}),y=_.useRef(null),b=_.useRef(null),x=_.useRef(null),S=_.useRef(null),[w,T]=_.useState(null),C=w?.modal,A=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function M(L){p&&L.relatedTarget&&mu(L)&&(L.type==="focusin"?mC:cK)(p)}return p.addEventListener("focusin",M,!0),p.addEventListener("focusout",M,!0),()=>{p.removeEventListener("focusin",M,!0),p.removeEventListener("focusout",M,!0)}},[p,C]),_.useEffect(()=>{!p||A||mC(p)},[A,p]);const R=_.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:S,portalNode:p,setFocusManagerState:T}),[p]);return h.jsxs(_.Fragment,{children:[g,h.jsxs(EA.Provider,{value:R,children:[N&&p&&h.jsx(Qh,{"data-type":"outside",ref:y,onFocus:M=>{if(mu(M,p))x.current?.focus();else{const L=w?w.domReference:null;_A(L)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:s8}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Qh,{"data-type":"outside",ref:b,onFocus:M=>{if(mu(M,p))S.current?.focus();else{const L=w?w.domReference:null;SA(L)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Fj,M.nativeEvent))}}})]})]})});function qs(e){return e==null?e:"current"in e?e.current:e}function yK(e,t){const n=un(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 vC=20;let qo=[];function lx(){qo=qo.filter(e=>e.deref()?.isConnected)}function vK(e){lx(),e&&gi(e)!=="body"&&(qo.push(new WeakRef(e)),qo.length>vC&&(qo=qo.slice(-vC)))}function Dy(){return lx(),qo[qo.length-1]?.deref()}function bK(e){if(!e)return null;const t=Wu();return bA(e,t)?e:Cp(e,t)[0]||e}function xK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function bC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Wu(),i=aK(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return bA(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 NA(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:p="",nextFocusableElement:g,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x}=e,S="rootStore"in t?t.rootStore:t,w=S.useState("open"),T=S.useState("domReferenceElement"),C=S.useState("floatingElement"),{events:A,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),M=i===!1,L=uC(T)&&M,j=_.useRef(["content"]),k=Jo(i),P=Jo(a),G=Jo(p),B=Np(x),z=TA(),Q=_.useRef(null),Y=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),K=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),U=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=so(I,b,z?.beforeInsideRef),X=so(H,z?.afterInsideRef),oe=rs(),se=rs(),de=cx(),xe=z!=null,he=Hh(C),Me=Ae((pe=he)=>pe?Cp(pe,Wu()):[]),_e=Ae(pe=>{const ae=Me(pe);return j.current.map(()=>ae).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function pe(we){we.key==="Tab"&&Ot(he,Bo(Rt(he)))&&Me().length===0&&!L&&Vi(we)}const ae=Rt(he);return ae.addEventListener("keydown",pe),()=>{ae.removeEventListener("keydown",pe)}},[s,T,he,f,j,L,Me,_e]),_.useEffect(()=>{if(s||!w)return;const pe=Rt(he);function ae(){K.current=!1}function we(Se){const ye=Ur(Se),Ue=Ot(C,ye)||Ot(T,ye)||Ot(z?.portalNode,ye);K.current=!Ue,U.current=Se.pointerType||"keyboard",ye?.closest(`[${t8}]`)&&(D.current=!0)}function ve(){U.current="keyboard"}return pe.addEventListener("pointerdown",we,!0),pe.addEventListener("pointerup",ae,!0),pe.addEventListener("pointercancel",ae,!0),pe.addEventListener("keydown",ve,!0),()=>{pe.removeEventListener("pointerdown",we,!0),pe.removeEventListener("pointerup",ae,!0),pe.removeEventListener("pointercancel",ae,!0),pe.removeEventListener("keydown",ve,!0)}},[s,C,T,he,w,z]),_.useEffect(()=>{if(s||!d)return;const pe=Rt(he);function ae(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ie){const Ee=Ur(Ie),Xe=Me().indexOf(Ee);Xe!==-1&&(q.current=Xe)}function ve(Ie){const Ee=Ie.relatedTarget,Ve=Ie.currentTarget,Xe=Ur(Ie);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(ju("focus-guard"))&&[I.current,H.current,z?.beforeInsideRef.current,z?.afterInsideRef.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(z?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(Sc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||fC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Hh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&he&&bC(he,j),l&&Ve!==T&&!xK(Xe)&&Bo(pe)===pe.body){if(Zt(he)&&(he.focus(),l==="popup")){de.request(()=>{he.focus()});return}const Te=q.current,qe=Me(),mt=qe[Te]||qe[qe.length-1]||he;Zt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(L||!f)&&Ee&&me&&!D.current&&(L||Ee!==Dy())&&(ee.current=!0,S.setOpen(!1,Yt(Fj,Ie)))})}function Se(){K.current||(N.current.insideReactTree=!0,oe.start(0,()=>{N.current.insideReactTree=!1}))}const ye=Zt(T)?T:null,Ue=[];if(!(!C&&!ye))return ye&&(ye.addEventListener("focusout",ve),ye.addEventListener("pointerdown",ae),Ue.push(()=>{ye.removeEventListener("focusout",ve),ye.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ve),z&&(C.addEventListener("focusout",Se,!0),Ue.push(()=>{C.removeEventListener("focusout",Se,!0)})),Ue.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ve)})),()=>{Ue.forEach(Ie=>{Ie()})}},[s,T,C,he,f,B,z,S,d,l,Me,L,R,j,N,oe,se,de,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const pe=Array.from(z?.portalNode?.querySelectorAll(`[${ju("portal")}]`)||[]),we=(B?fC(B.nodesRef.current,R()):[]).find(Se=>uC(Se.context?.elements.domReference||null))?.context?.elements.domReference,ve=[C,we,...pe,Q.current,Y.current,I.current,H.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,qs(y),qs(g),L?T:null].filter(Se=>Se!=null);return mK(ve,f||L)},[w,s,T,C,f,j,z,L,B,R,g,y]),Le(()=>{if(!w||s||!Zt(he))return;const pe=Rt(he),ae=Bo(pe);queueMicrotask(()=>{const we=_e(he),ve=k.current,Se=typeof ve=="function"?ve(G.current||""):ve;if(Se===void 0||Se===!1)return;let ye;Se===!0||Se===null?ye=we[0]||he:ye=qs(Se),ye=ye||we[0]||he,!Ot(he,ae)&&Iy(ye,{preventScroll:ye===he})})},[s,w,he,M,_e,k,G]),Le(()=>{if(s||!he)return;const pe=Rt(he),ae=Bo(pe);vK(ae);function we(ye){if(ye.open||(V.current=yK(ye.nativeEvent,U.current)),ye.reason===Pv&&ye.nativeEvent.type==="mouseleave"&&(ee.current=!0),ye.reason===Bj)if(ye.nested)ee.current=!1;else if(CV(ye.nativeEvent)||RV(ye.nativeEvent))ee.current=!1;else{let Ue=!1;document.createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?ee.current=!1:ee.current=!0}}A.on("openchange",we);const ve=pe.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,vp),xe&&T&&T.insertAdjacentElement("afterend",ve);function Se(){const ye=P.current;let Ue=typeof ye=="function"?ye(V.current):ye;if(Ue===void 0||Ue===!1)return null;if(Ue===null&&(Ue=!0),typeof Ue=="boolean"){const Ee=T||Dy();return Ee&&Ee.isConnected?Ee:ve}const Ie=T||Dy()||ve;return qs(Ue)||Ie}return()=>{A.off("openchange",we);const ye=Bo(pe),Ue=Ot(C,ye)||B&&Sc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ye)),Ie=Se();queueMicrotask(()=>{const Ee=bK(Ie),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ye&&ye!==pe.body)||Ue)&&Ee.focus({preventScroll:!0}),ve.remove(),ee.current=!1})}},[s,C,he,P,N,A,B,xe,T,R]),Le(()=>{if(!sx||w||!C)return;const pe=Bo(Rt(C));!Zt(pe)||!fA(pe)||Ot(C,pe)&&pe.blur()},[w,C]),Le(()=>{if(!(s||!z))return z.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{z.setFocusManagerState(null)}},[s,z,f,w,S,d,T]),Le(()=>{if(!(s||!he))return bC(he,j),()=>{queueMicrotask(lx)}},[s,he,j]);const ne=!s&&(f?!L:!0)&&(xe||f);return h.jsxs(_.Fragment,{children:[ne&&h.jsx(Qh,{"data-type":"inside",ref:W,onFocus:pe=>{if(f){const ae=_e();Iy(ae[ae.length-1])}else z?.portalNode&&(ee.current=!1,mu(pe,z.portalNode)?SA(T)?.focus():qs(y??z.beforeOutsideRef)?.focus())}}),n,ne&&h.jsx(Qh,{"data-type":"inside",ref:X,onFocus:pe=>{f?Iy(_e()[0]):z?.portalNode&&(d&&(ee.current=!0),mu(pe,z.portalNode)?_A(T)?.focus():qs(g??z.afterOutsideRef)?.focus())}})]})}function xC(e,t,n){let{reference:s,floating:i}=e;const a=Fr(t),l=ax(t),f=ix(l),d=Zn(t),p=a==="y",g=s.x+s.width/2-i.width/2,y=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};break;case"left":x={x:s.x-i.width,y};break;default:x={x:s.x,y:s.y}}switch(xi(t)){case"start":x[l]-=b*(n&&p?-1:1);break;case"end":x[l]+=b*(n&&p?-1:1);break}return x}async function SK(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=io(t,e),S=dA(x),T=f[b?y==="floating"?"reference":"floating":y],C=Kh(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:p,rootBoundary:g,strategy:d})),A=y==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),R=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},M=Kh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:A,offsetParent:N,strategy:d}):A);return{top:(C.top-M.top+S.top)/R.y,bottom:(M.bottom-C.bottom+S.bottom)/R.y,left:(C.left-M.left+S.left)/R.x,right:(M.right-C.right+S.right)/R.x}}const _K=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 p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=xC(p,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:C,fn:A}=f[T],{x:N,y:R,data:M,reset:L}=await A({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:SK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(p=L.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:g,y}=xC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},wK=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:p}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...T}=io(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Zn(i),A=Fr(f),N=Zn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),M=b||(N||!w?[Vh(f)]:PV(f)),L=S!=="none";!b&&L&&M.push(...UV(f,w,S,R));const j=[f,...M],k=await d.detectOverflow(t,T),P=[];let G=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(k[C]),y){const Y=IV(i,l,R);P.push(k[Y[0]],k[Y[1]])}if(G=[...G,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var B,z;const Y=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[Y];if(ee&&(!(y==="alignment"?A!==Fr(ee):!1)||G.every(q=>Fr(q.placement)===A?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:G},reset:{placement:ee}};let D=(z=G.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(x){case"bestFit":{var Q;const K=(Q=G.filter(q=>{if(L){const V=Fr(q.placement);return V===A||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,U)=>V+U,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Q[0];K&&(D=K);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function SC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _C(e){return AV.some(t=>e[t]>=0)}const EK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=io(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=SC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:_C(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=SC(l,n.floating);return{data:{escapedOffsets:f,escaped:_C(f)}}}default:return{}}}}},jA=new Set(["left","top"]);async function TK(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=xi(n),d=Fr(n)==="y",p=jA.has(l)?-1:1,g=a&&d?-1:1,y=io(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),d?{x:x*g,y:b*p}:{x:b*p,y:x*g}}const CK=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 TK(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}}}}},RK=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:C=>{let{x:A,y:N}=C;return{x:A,y:N}}},...p}=io(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=Fr(Zn(i)),x=ox(b);let S=g[x],w=g[b];if(l){const C=x==="y"?"top":"left",A=x==="y"?"bottom":"right",N=S+y[C],R=S-y[A];S=Lv(N,S,R)}if(f){const C=b==="y"?"top":"left",A=b==="y"?"bottom":"right",N=w+y[C],R=w-y[A];w=Lv(N,w,R)}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}}}}}},NK=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:p=!0}=io(e,t),g={x:n,y:s},y=Fr(i),b=ox(y);let x=g[b],S=g[y];const w=io(f,t),T=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const N=b==="y"?"height":"width",R=a.reference[b]-a.floating[N]+T.mainAxis,M=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>M&&(x=M)}if(p){var C,A;const N=b==="y"?"width":"height",R=jA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),L=a.reference[y]+a.reference[N]+(R?0:((A=l.offset)==null?void 0:A[y])||0)-(R?T.crossAxis:0);S<M?S=M:S>L&&(S=L)}return{[b]:x,[y]:S}}}},jK=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=()=>{},...p}=io(e,t),g=await l.detectOverflow(t,p),y=Zn(i),b=xi(i),x=Fr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const A=w-g.top-g.bottom,N=S-g.left-g.right,R=Uc(w-g[T],A),M=Uc(S-g[C],N),L=!t.middlewareData.shift;let j=R,k=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=A),L&&!b){const G=dr(g.left,0),B=dr(g.right,0),z=dr(g.top,0),Q=dr(g.bottom,0);x?k=S-2*(G!==0||B!==0?G+B:dr(g.left,g.right)):j=w-2*(z!==0||Q!==0?z+Q:dr(g.top,g.bottom))}await d({...t,availableWidth:k,availableHeight:j});const P=await l.getDimensions(f.floating);return S!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function AA(e){const t=xr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Zt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=qh(n)!==a||qh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function ux(e){return jt(e)?e:e.contextElement}function wc(e){const t=ux(e);if(!Zt(t))return xs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=AA(t);let l=(a?qh(n.width):n.width)/s,f=(a?qh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const AK=xs(0);function kA(e){const t=un(e);return!Sp()||!t.visualViewport?AK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function fa(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=ux(e);let l=xs(1);t&&(s?jt(s)&&(l=wc(s)):l=wc(e));const f=kK(a,n,s)?kA(a):xs(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,g=i.width/l.x,y=i.height/l.y;if(a){const b=un(a),x=s&&jt(s)?un(s):s;let S=b,w=Mv(S);for(;w&&s&&x!==S;){const T=wc(w),C=w.getBoundingClientRect(),A=xr(w),N=C.left+(w.clientLeft+parseFloat(A.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(A.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=un(w),w=Mv(S)}}return Kh({width:g,height:y,x:d,y:p})}function jp(e,t){const n=_p(e).scrollLeft;return t?t.left+n:fa(_s(e)).left+n}function OA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-jp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function OK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=_s(s),f=t?xp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=xs(1);const g=xs(0),y=Zt(s);if((y||!y&&!a)&&((gi(s)!=="body"||yi(l))&&(d=_p(s)),Zt(s))){const x=fa(s);p=wc(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?OA(l,d):xs(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+g.x+b.x,y:n.y*p.y-d.scrollTop*p.y+g.y+b.y}}function MK(e){return Array.from(e.getClientRects())}function IK(e){const t=_s(e),n=_p(e),s=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=dr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+jp(e);const f=-n.scrollTop;return xr(s).direction==="rtl"&&(l+=dr(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const wC=25;function PK(e,t){const n=un(e),s=_s(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=Sp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=jp(s);if(p<=0){const g=s.ownerDocument,y=g.body,b=getComputedStyle(y),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-y.clientWidth-x);S<=wC&&(a-=S)}else p<=wC&&(a+=p);return{width:a,height:l,x:f,y:d}}const DK=new Set(["absolute","fixed"]);function zK(e,t){const n=fa(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?wc(e):xs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:l,height:f,x:d,y:p}}function EC(e,t,n){let s;if(t==="viewport")s=PK(e,n);else if(t==="document")s=IK(_s(e));else if(jt(t))s=zK(t,n);else{const i=kA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kh(s)}function MA(e,t){const n=oo(e);return n===t||!jt(n)||Ys(n)?!1:xr(n).position==="fixed"||MA(n,t)}function LK(e,t){const n=t.get(e);if(n)return n;let s=Wo(e,[],!1).filter(f=>jt(f)&&gi(f)!=="body"),i=null;const a=xr(e).position==="fixed";let l=a?oo(e):e;for(;jt(l)&&!Ys(l);){const f=xr(l),d=Xb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&DK.has(i.position)||yi(l)&&!d&&MA(e,l))?s=s.filter(g=>g!==l):i=f,l=oo(l)}return t.set(e,s),s}function UK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?xp(t)?[]:LK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=EC(t,g,i);return p.top=dr(y.top,p.top),p.right=Uc(y.right,p.right),p.bottom=Uc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},EC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function $K(e){const{width:t,height:n}=AA(e);return{width:t,height:n}}function BK(e,t,n){const s=Zt(t),i=_s(t),a=n==="fixed",l=fa(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=xs(0);function p(){d.x=jp(i)}if(s||!s&&!a)if((gi(t)!=="body"||yi(i))&&(f=_p(t)),s){const x=fa(t,!0,a,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&p();a&&!s&&i&&p();const g=i&&!s&&!a?OA(i,f):xs(0),y=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:l.width,height:l.height}}function zy(e){return xr(e).position==="static"}function TC(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function IA(e,t){const n=un(e);if(xp(e))return n;if(!Zt(e)){let i=oo(e);for(;i&&!Ys(i);){if(jt(i)&&!zy(i))return i;i=oo(i)}return n}let s=TC(e,t);for(;s&&h8(s)&&zy(s);)s=TC(s,t);return s&&Ys(s)&&zy(s)&&!Xb(s)?n:s||v8(e)||n}const FK=async function(e){const t=this.getOffsetParent||IA,n=this.getDimensions,s=await n(e.floating);return{reference:BK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function HK(e){return xr(e).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:OK,getDocumentElement:_s,getClippingRect:UK,getOffsetParent:IA,getElementRects:FK,getClientRects:MK,getDimensions:$K,getScale:wc,isElement:jt,isRTL:HK};function PA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VK(e,t){let n=null,s;const i=_s(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 p=e.getBoundingClientRect(),{left:g,top:y,width:b,height:x}=p;if(f||t(),!b||!x)return;const S=pc(y),w=pc(i.clientWidth-(g+b)),T=pc(i.clientHeight-(y+x)),C=pc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Uc(1,d))||1};let R=!0;function M(L){const j=L[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!PA(p,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(M,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return l(!0),a}function CC(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,p=ux(e),g=i||a?[...p?Wo(p):[],...Wo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?VK(p,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[A]=C;A&&A.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let S,w=d?fa(e):null;d&&T();function T(){const C=fa(e);w&&!PA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(A=>{i&&A.removeEventListener("scroll",n),a&&A.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const KK=CK,GK=RK,ZK=wK,YK=jK,XK=EK,QK=NK,WK=(e,t,n)=>{const s=new Map,i={platform:qK,...n},a={...i.platform,_c:s};return _K(e,t,{...i,platform:a})};var JK=typeof document<"u",e7=function(){},uh=JK?_.useLayoutEffect:e7;function Wh(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(!Wh(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)&&!Wh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function DA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RC(e,t){const n=DA(e);return Math.round(t*n)/n}function Ly(e){const t=_.useRef(e);return uh(()=>{t.current=e}),t}function t7(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:p}=e,[g,y]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=_.useState(s);Wh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),A=_.useCallback(q=>{q!==L.current&&(L.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,L=_.useRef(null),j=_.useRef(null),k=_.useRef(g),P=d!=null,G=Ly(d),B=Ly(i),z=Ly(p),Q=_.useCallback(()=>{if(!L.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),WK(L.current,j.current,q).then(V=>{const U={...V,isPositioned:z.current!==!1};Y.current&&!Wh(k.current,U)&&(k.current=U,hi.flushSync(()=>{y(U)}))})},[b,t,n,B,z]);uh(()=>{p===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const Y=_.useRef(!1);uh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),uh(()=>{if(R&&(L.current=R),M&&(j.current=M),R&&M){if(G.current)return G.current(R,M,Q);Q()}},[R,M,Q,G,P]);const ee=_.useMemo(()=>({reference:L,floating:j,setReference:A,setFloating:N}),[A,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),K=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const V=RC(D.floating,g.x),U=RC(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+U+"px)",...DA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:U}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Q,refs:ee,elements:D,floatingStyles:K}),[g,Q,ee,D,K])}const n7=(e,t)=>({...KK(e),options:[e,t]}),r7=(e,t)=>({...GK(e),options:[e,t]}),s7=(e,t)=>({...QK(e),options:[e,t]}),o7=(e,t)=>({...ZK(e),options:[e,t]}),i7=(e,t)=>({...YK(e),options:[e,t]}),a7=(e,t)=>({...XK(e),options:[e,t]}),c7={intentional:"onClick",sloppy:"onPointerDown"};function l7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function u7(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:p=!0,escapeKey:g=!0,outsidePress:y=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:T,externalTree:C}=t,A=Np(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:L,outsidePress:j}=l7(T),k=_.useRef(null),P=rs(),G=rs(),B=Ae(()=>{G.clear(),d.current.insideReactTree=!1}),z=_.useRef(!1),Q=_.useRef(""),Y=Ae(ne=>{Q.current=ne.pointerType}),ee=Ae(()=>{const ne=Q.current,pe=ne==="pen"||!ne?"mouse":ne,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[pe]}),D=Ae(ne=>{if(!s||!p||!g||ne.key!=="Escape"||z.current)return;const pe=d.current.floatingContext?.nodeId,ae=A?Sc(A.nodesRef.current,pe):[];if(!L&&ae.length>0){let Se=!0;if(ae.forEach(ye=>{ye.context?.open&&!ye.context.dataRef.current.__escapeKeyBubbles&&(Se=!1)}),!Se)return}const we=TV(ne)?ne.nativeEvent:ne,ve=Yt(E8,we);n.setOpen(!1,ve),!L&&!ve.isPropagationAllowed&&ne.stopPropagation()}),K=Ae(ne=>{const pe=ee();return pe==="intentional"&&ne.type!=="click"||pe==="sloppy"&&ne.type==="click"}),q=Ae(()=>{d.current.insideReactTree=!0,G.start(0,B)}),V=Ae((ne,pe=!1)=>{if(K(ne)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&pe||typeof R=="function"&&!R(ne))return;const ae=Ur(ne),we=`[${ju("inert")}]`,ve=Rt(n.select("floatingElement")).querySelectorAll(we),Se=n.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ve=>Ot(Ve,ae))))return;let ye=jt(ae)?ae:null;for(;ye&&!Ys(ye);){const Ve=oo(ye);if(Ys(Ve)||!jt(Ve))break;ye=Ve}if(ve.length&&jt(ae)&&!EV(ae)&&!Ot(ae,n.select("floatingElement"))&&Array.from(ve).every(Ve=>!Ot(ye,Ve)))return;if(Zt(ae)&&!("touches"in ne)){const Ve=Ys(ae),Xe=xr(ae),Be=/auto|scroll/,We=Ve||Be.test(Xe.overflowX),He=Ve||Be.test(Xe.overflowY),me=We&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Te=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,qe=Xe.direction==="rtl",mt=Te&&(qe?ne.offsetX<=ae.offsetWidth-ae.clientWidth:ne.offsetX>ae.clientWidth),lt=me&&ne.offsetY>ae.clientHeight;if(mt||lt)return}const Ue=d.current.floatingContext?.nodeId,Ie=A&&Sc(A.nodesRef.current,Ue).some(Ve=>es(ne,Ve.context?.elements.floating));if(es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||Ie)return;const Ee=A?Sc(A.nodesRef.current,Ue):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Xe=>{Xe.context?.open&&!Xe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(Bj,ne)),B()}),U=Ae(ne=>{ee()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||V(ne)}),I=Ae(ne=>{if(ee()!=="sloppy"||!n.select("open")||!p||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];pe&&(k.current={startTime:Date.now(),startX:pe.clientX,startY:pe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}),H=Ae(ne=>{const pe=Ur(ne);function ae(){I(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),W=Ae(ne=>{const pe=M.current;if(M.current=!1,P.clear(),ne.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)return;const ae=Ur(ne);function we(){ne.type==="pointerdown"?U(ne):V(ne,pe),ae?.removeEventListener(ne.type,we)}ae?.addEventListener(ne.type,we)}),X=Ae(ne=>{if(ee()!=="sloppy"||!k.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement")))return;const pe=ne.touches[0];if(!pe)return;const ae=Math.abs(pe.clientX-k.current.startX),we=Math.abs(pe.clientY-k.current.startY),ve=Math.sqrt(ae*ae+we*we);ve>5&&(k.current.dismissOnTouchEnd=!0),ve>10&&(V(ne),P.clear(),k.current=null)}),oe=Ae(ne=>{const pe=Ur(ne);function ae(){X(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)}),se=Ae(ne=>{ee()!=="sloppy"||!k.current||es(ne,n.select("floatingElement"))||es(ne,n.select("domReferenceElement"))||(k.current.dismissOnTouchEnd&&V(ne),P.clear(),k.current=null)}),de=Ae(ne=>{const pe=Ur(ne);function ae(){se(ne),pe?.removeEventListener(ne.type,ae)}pe?.addEventListener(ne.type,ae)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=j;const ne=new ai;function pe(ye){n.setOpen(!1,Yt(ii,ye))}function ae(){ne.clear(),z.current=!0}function we(){ne.start(Sp()?5:0,()=>{z.current=!1})}const ve=Rt(i);ve.addEventListener("pointerdown",Y,!0),g&&(ve.addEventListener("keydown",D),ve.addEventListener("compositionstart",ae),ve.addEventListener("compositionend",we)),R&&(ve.addEventListener("click",W,!0),ve.addEventListener("pointerdown",W,!0),ve.addEventListener("touchstart",H,!0),ve.addEventListener("touchmove",oe,!0),ve.addEventListener("touchend",de,!0),ve.addEventListener("mousedown",W,!0));let Se=[];return w&&(jt(l)&&(Se=Wo(l)),jt(i)&&(Se=Se.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(Se=Se.concat(Wo(a.contextElement)))),Se=Se.filter(ye=>ye!==ve.defaultView?.visualViewport),Se.forEach(ye=>{ye.addEventListener("scroll",pe,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),g&&(ve.removeEventListener("keydown",D),ve.removeEventListener("compositionstart",ae),ve.removeEventListener("compositionend",we)),R&&(ve.removeEventListener("click",W,!0),ve.removeEventListener("pointerdown",W,!0),ve.removeEventListener("touchstart",H,!0),ve.removeEventListener("touchmove",oe,!0),ve.removeEventListener("touchend",de,!0),ve.removeEventListener("mousedown",W,!0)),Se.forEach(ye=>{ye.removeEventListener("scroll",pe)}),ne.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,L,j,D,V,W,U,H,oe,de,Y,n]),_.useEffect(B,[R,B]);const xe=_.useMemo(()=>({onKeyDown:D,...x&&{[c7[S]]:ne=>{n.setOpen(!1,Yt(cC,ne.nativeEvent))},...S!=="intentional"&&{onClick(ne){n.setOpen(!1,Yt(cC,ne.nativeEvent))}}}}),[D,n,x,S]),he=Ae(ne=>{const pe=Ur(ne.nativeEvent);!Ot(n.select("floatingElement"),pe)||ne.button!==0||(M.current=!0)}),Me=Ae(ne=>{!s||!p||ne.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:he,onMouseDown:he,onMouseUp:he,onClickCapture:q,onMouseDownCapture(ne){q(),Me(ne)},onPointerDownCapture(ne){q(),Me(ne)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,he,q,Me]);return _.useMemo(()=>p?{reference:xe,floating:_e,trigger:xe}:{},[p,xe,_e])}ij({memoize:yq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(yn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var f7=ZN();const d7=Zb(19),h7=d7?m7:g7;function at(e,t,n,s,i){return h7(e,t,n,s,i)}function p7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return f7.useSyncExternalStore(e.subscribe,a,a)}function m7(e,t,n,s,i){return p7(e,t,n,s,i)}function g7(e,t,n,s,i){return YN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class y7{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 at(this,t,n,s,i)}}class zA extends y7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),Le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Le(()=>(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);Le(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;Le(()=>{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),at(this,this.selectors[t],n,s,i)}useContextCallback(t,n){_.useDebugValue(t);const s=Ae(n??jn);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 v7={open:Pe(e=>e.open),domReferenceElement:Pe(e=>e.domReferenceElement),referenceElement:Pe(e=>e.positionReference??e.referenceElement),floatingElement:Pe(e=>e.floatingElement),floatingId:Pe(e=>e.floatingId)};class fx extends zA{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:lK(),nested:n,noEmit:s,triggerElements:a},v7)}setOpen=(t,n)=>{if((!t||!this.state.open||jV(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 Ap(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),Le(()=>{if(!e&&a&&s!=="ending"&&n){const f=ys.request(()=>{i("ending")});return()=>{ys.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=ys.request(()=>{i(void 0)});return()=>{ys.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ys.request(()=>{i("idle")});return()=>{ys.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let Au=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const b7={[Au.startingStyle]:""},x7={[Au.endingStyle]:""},va={transitionStatus(e){return e==="starting"?b7:e==="ending"?x7:null}};function S7(e,t=!1,n=!0){const s=cx();return Ae((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=qs(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let y=function(){const x=Au.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 p=y,g=b;if(t){y();return}s.request(b)}})}function ba(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),l=S7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function _7(e){const t=e.useState("open");Le(()=>{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 w7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Ap(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return ba({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class dx{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 E7(){return new fx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new dx,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function T7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:E7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}const Hd=Pe(e=>e.triggerIdProp??e.activeTriggerId),C7={open:Pe(e=>e.openProp??e.open),mounted:Pe(e=>e.mounted),transitionStatus:Pe(e=>e.transitionStatus),floatingRootContext:Pe(e=>e.floatingRootContext),preventUnmountingOnClose:Pe(e=>e.preventUnmountingOnClose),payload:Pe(e=>e.payload),activeTriggerId:Hd,activeTriggerElement:Pe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pe((e,t)=>t!==void 0&&Hd(e)===t),isOpenedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.open),isMountedByTrigger:Pe((e,t)=>t!==void 0&&Hd(e)===t&&e.mounted),triggerProps:Pe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pe(e=>e.popupProps),popupElement:Pe(e=>e.popupElement),positionerElement:Pe(e=>e.positionerElement)};function R7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Qu(),a=Rp()!=null,l=zn(()=>new fx({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new dx,floatingId:i,nested:a,noEmit:!1})).current;return Le(()=>{const f={open:t,floatingId:i};s.reference!==void 0&&(f.referenceElement=s.reference,f.domReferenceElement=jt(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 N7(e={}){const{nodeId:t,externalTree:n}=e,s=R7(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),p=Np(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=t7({...e,elements:{...a,...l&&{reference:l}}}),y=_.useCallback(j=>{const k=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(k),g.refs.setReference(k)},[g.refs]),[b,x]=_.useState(null),[S,w]=_.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",jt(b)?b:null),i.useSyncedValue("floatingElement",S);const T=_.useCallback(j=>{(jt(j)||j===null)&&(d.current=j,x(j)),(jt(g.refs.reference.current)||g.refs.reference.current===null||j!==null&&!jt(j))&&g.refs.setReference(j)},[g.refs,x]),C=_.useCallback(j=>{w(j),g.refs.setFloating(j)},[g.refs]),A=_.useMemo(()=>({...g.refs,setReference:T,setFloating:C,setPositionReference:y,domReference:d}),[g.refs,T,C,y]),N=_.useMemo(()=>({...g.elements,domReference:a.domReference}),[g.elements,a.domReference]),R=i.useState("open"),M=i.useState("floatingId"),L=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:M,refs:A,elements:N,nodeId:t,rootStore:i}),[g,A,N,t,i,R,M]);return Le(()=>{i.context.dataRef.current.floatingContext=L;const j=p?.nodesRef.current.find(k=>k.id===t);j&&(j.context=L)}),_.useMemo(()=>({...g,context:L,refs:A,elements:N,rootStore:i}),[g,A,N,L,i])}function j7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Qu(),l=Rp()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=zn(()=>new fx({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return Le(()=>{const b={open:f,floatingId:a,referenceElement:d,floatingElement:p};jt(d)&&(b.domReferenceElement=d),y.state.positionReference===y.state.referenceElement&&(b.positionReference=d),y.update(b)},[f,a,d,p,y]),y.context.onOpenChange=i,y.context.nested=l,y.context.noEmit=n,y}const NC=ju("safe-polygon"),A7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${uA}`;function k7(e){return e?!!e.closest(A7):!1}class hx{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 ai,this.restTimeout=new ai,this.handleCloseOptions=void 0}static create(){return new hx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function O7(e){const t=zn(hx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),rx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const M7=new Set(["click","mousedown"]);function I7(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,p=O7(n),g=Np(),y=Rp(),b=Ae(()=>p.interactedInside?!0:l.current.openEvent?M7.has(l.current.openEvent.type):!1),x=Ae(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>wV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=P7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Pv,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Pv,N)))},[d,n,p]),T=Ae(()=>{p.unbindMouseMove(),p.handler=void 0}),C=Ae(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(NC),p.performedPointerEventsMutation=!1}}),A=Ae(N=>{const R=Ur(N);if(!k7(R)){p.interactedInside=!1;return}p.interactedInside=!0});Le(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),Le(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(NC,"");const R=a,M=i,L=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return L&&(L.style.pointerEvents=""),N.style.pointerEvents="none",R.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",M.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!l.current.floatingContext||!n.select("open")||S(j.relatedTarget)||(C(),T(),b()||w(j))}function R(j){p.openChangeTimeout.clear(),C(),p.handler?.(j),T()}function M(j){b()||w(j,!1)}const L=i;return L&&(L.addEventListener("mouseleave",N),L.addEventListener("mouseenter",R),L.addEventListener("mouseleave",M),L.addEventListener("pointerdown",A,!0)),()=>{L&&(L.removeEventListener("mouseleave",N),L.removeEventListener("mouseenter",R),L.removeEventListener("mouseleave",M),L.removeEventListener("pointerdown",A,!0))}},[f,i,n,l,b,S,w,C,T,A,p])}function P7(e,t){return t&&!NV(t)?0:typeof e=="function"?e():e}function D7(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),s=e.map(p=>p?.item),i=e.map(p=>p?.trigger),a=_.useCallback(p=>qd(p,e,"reference"),t),l=_.useCallback(p=>qd(p,e,"floating"),n),f=_.useCallback(p=>qd(p,e,"item"),s),d=_.useCallback(p=>qd(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function qd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[zv]="");for(const l in e)i&&e&&(l===cA||l===lA)||(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&&jC(a,f,i,s)}return jC(a,e,i,s),a}function jC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===cA||i===lA)||(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 z7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function L7(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=Qu(),p=a?.id||d,g=_.useMemo(()=>Hh(l)?.id||i,[l,i]),y=z7.get(f)??f,x=Rp()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?an:{"aria-haspopup":y==="alertdialog"?"dialog":y,"aria-expanded":"false",...y==="listbox"&&{role:"combobox"},...y==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,x,f]),w=_.useMemo(()=>y==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:s?g:void 0}:{...S,"aria-expanded":s?"true":"false","aria-controls":s?g:void 0,...y==="menu"&&{id:p}},[y,g,s,p,f,S]),T=_.useMemo(()=>{const A={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?A:{...A,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:A,selected:N})=>{const R={role:"option",...A&&{id:`${g}-fui-option`}};switch(f){case"select":case"combobox":return{...R,"aria-selected":N}}return{}},[g,f]);return _.useMemo(()=>({reference:w,floating:T,item:C,trigger:S}),[w,T,S,C])}let Xi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Au.startingStyle]="startingStyle",e[e.endingStyle=Au.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),AC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const U7={[AC.popupOpen]:"",[AC.pressed]:""},$7={[Xi.open]:""},B7={[Xi.closed]:""},F7={[Xi.anchorHidden]:""},H7={open(e){return e?U7:null}},il={open(e){return e?$7:B7},anchorHidden(e){return e?F7:null}},LA=_.createContext(void 0);function q7(){const e=_.useContext(LA);if(e===void 0)throw new Error(yn(70));return e}const V7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=CA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),K7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return nx().useState("mounted")||s?h.jsx(LA.Provider,{value:s,children:h.jsx(V7,{ref:n,...i})}):null}),UA=_.createContext(void 0);function G7(){const e=_.useContext(UA);if(e===void 0)throw new Error(yn(71));return e}const Z7=_.createContext(void 0);function $A(){return _.useContext(Z7)?.direction??"ltr"}const Y7=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:p,padding:g=0,offsetParent:y="real"}=io(e,t)||{};if(p==null)return{};const b=dA(g),x={x:n,y:s},S=ax(i),w=ix(S),T=await l.getDimensions(p),C=S==="y",A=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[S]-x[S]-a.floating[w],L=x[S]-a.reference[S],j=y==="real"?await l.getOffsetParent?.(p):f.floating;let k=f.floating[R]||a.floating[w];(!k||!await l.isElement?.(j))&&(k=f.floating[R]||a.floating[w]);const P=M/2-L/2,G=k/2-T[w]/2-1,B=Math.min(b[A],G),z=Math.min(b[N],G),Q=B,Y=k-T[w]-z,ee=k/2-T[w]/2+P,D=Lv(Q,ee,Y),K=!d.arrow&&xi(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Q?B:z)-T[w]/2<0,q=K?ee<Q?ee-Q:ee-Y:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...K&&{alignmentOffset:q}},reset:K}}}),X7=(e,t)=>({...Y7(e),options:[e,t]}),Q7={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 a7().fn(e)).data?.referenceHidden||a}}}},fh={sideX:"left",sideY:"top"},W7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=un(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:fh};const y=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(y===d){const A=Rt(i);b={width:A.documentElement.clientWidth,height:A.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=Zn(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":fh.sideX,C=x==="top"?"bottom":fh.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function BA(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 kC(e,t,n){const{rects:s,placement:i}=e;return{side:BA(t,Zn(i),n),align:xi(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function FA(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:p=!1,arrowPadding:g=5,disableAnchorTracking:y=!1,keepMounted:b=!1,floatingRootContext:x,mounted:S,collisionAvoidance:w,shiftCrossAxis:T=!1,nodeId:C,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:R}=e,[M,L]=_.useState(null);!S&&M!==null&&L(null);const j=w.side||"flip",k=w.align||"flip",P=w.fallbackAxisSide||"end",G=typeof t=="function"?t:void 0,B=Ae(G),z=G?B:t,Q=Jo(t),ee=$A()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],K=a==="center"?D:`${D}-${a}`;let q=d;const V=1,U=s==="bottom"?V:0,I=s==="top"?V:0,H=s==="right"?V:0,W=s==="left"?V:0;typeof q=="number"?q={top:q+U,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+U,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const X={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},oe=_.useRef(null),se=Jo(i),de=Jo(l),Me=[n7(ot=>{const Wt=kC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof de.current=="function"?de.current(Wt):de.current;return{mainAxis:vn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=k==="none"&&j!=="shift",ne=!_e&&(p||T||j==="shift"),pe=j==="none"?null:o7({...X,padding:{top:q.top+V,right:q.right+V,bottom:q.bottom+V,left:q.left+V},mainAxis:!T&&j==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ae=_e?null:r7(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...X,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:k!=="none",crossAxis:ne,limiter:p||T?void 0:s7(vn=>{if(!oe.current)return{};const{width:kt,height:Cn}=oe.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,as=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+as/2}})}},[X,p,T,q,k]);j==="shift"||k==="shift"||a==="center"?Me.push(ae,pe):Me.push(pe,ae),Me.push(i7({...X,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:vn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${vn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),X7(()=>({element:oe.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:vn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),as=Fr(An),cs=oe.current,_a=vn.arrow?.x||0,_i=vn.arrow?.y||0,wi=cs?.clientWidth||0,ws=cs?.clientHeight||0,tr=_a+wi/2,ls=_i+ws/2,uo=Math.abs(vn.shift?.y||0),fo=Cn.reference.height/2,nr=typeof i=="function"?i(kC(ot,s,ee)):i,cl=uo>nr,cf={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${ls}px`,right:`${-nr}px ${ls}px`}[An],lf=`${tr}px ${Cn.reference.y+fo-er}px`;return Wt.floating.style.setProperty("--transform-origin",ne&&as==="y"&&cl?lf:cf),{}}},Q7,A),Le(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const we=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ve,elements:Se,x:ye,y:Ue,middlewareData:Ie,update:Ee,placement:Ve,context:Xe,isPositioned:Be,floatingStyles:We}=N7({rootContext:x,placement:K,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ot)=>CC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ie.adaptiveOrigin||fh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=A?{position:Te,[He]:ye,[me]:Ue}:{position:Te,...We};return Be||(ot.opacity=0),ot},[A,Te,He,ye,me,Ue,We,Be]),mt=_.useRef(null);Le(()=>{if(!S)return;const ot=Q.current,Wt=typeof ot=="function"?ot():ot,kt=(OC(Wt)?Wt.current:Wt)||null||null;kt!==mt.current&&(ve.setPositionReference(kt),mt.current=kt)},[S,ve,z,Q]),_.useEffect(()=>{if(!S)return;const ot=Q.current;typeof ot!="function"&&OC(ot)&&ot.current!==mt.current&&(ve.setPositionReference(ot.current),mt.current=ot.current)},[S,ve,z,Q]),_.useEffect(()=>{if(b&&S&&Se.domReference&&Se.floating)return CC(Se.domReference,Se.floating,Ee,we)},[b,S,Se,Ee,we]);const lt=Zn(Ve),wr=BA(s,lt,ee),Er=xi(Ve)||"center",Qt=!!Ie.hide?.referenceHidden;Le(()=>{N&&S&&Be&&L(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ie.arrow?.y,left:Ie.arrow?.x}),[Ie.arrow]),xt=Ie.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:oe,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ve,context:Xe,isPositioned:Be,update:Ee}),[qe,ut,oe,xt,wr,Er,lt,Qt,ve,Xe,Be,Ee])}function OC(e){return e!=null&&"current"in e}function kp(e){return e==="starting"?e8:an}const J7=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:T=r8,...C}=t,A=nx(),N=q7(),R=A.useState("open"),M=A.useState("mounted"),L=A.useState("trackCursorAxis"),j=A.useState("disableHoverablePopup"),k=A.useState("floatingRootContext"),P=A.useState("instantType"),G=A.useState("transitionStatus"),B=A.useState("hasViewport"),z=FA({anchor:a,positionMethod:l,floatingRootContext:k,mounted:M,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:B?W7:void 0}),Q=_.useMemo(()=>{const K={};return(!R||L==="both"||j)&&(K.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...z.positionerStyles,...K}}},[R,L,j,M,z.positionerStyles]),Y=_.useMemo(()=>({open:R,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:L!=="none"?"tracking-cursor":P}),[R,z.side,z.align,z.anchorHidden,L,P]),ee=_.useMemo(()=>({...Y,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[Y,z.arrowRef,z.arrowStyles,z.arrowUncentered]),D=zt("div",t,{state:Y,props:[Q,kp(G),C],ref:[n,A.useStateSetter("positionerElement")],stateAttributesMapping:il});return h.jsx(UA.Provider,{value:ee,children:D})}),eG={...il,...va},tG=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=nx(),{side:f,align:d}=G7(),p=l.useState("open"),g=l.useState("instantType"),y=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");ba({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return I7(x,{enabled:!S,closeDelay:w}),zt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,kp(y),a],stateAttributesMapping:eG})});function px(e){return Zb(19)?e:e?"true":void 0}const nG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(K7,{children:h.jsx(J7,{sideOffset:t,children:h.jsx(tG,{ref:i,className:ge("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})})}));nG.displayName="TooltipContent";function MC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const HA=_.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:p,...g},y)=>{const b=i.x,x=i.y,S=a.x,w=a.y,T={},C=2*Math.PI/Math.max(t.length,1);t.forEach((j,k)=>{const P=s.includes(j.id),G=P?S:b,B=P?w:x,z=P?240:260,Q=P?130:150,Y=C*k-Math.PI/2;T[j.id]={x:G+z*Math.cos(Y),y:B+Q*Math.sin(Y)}});const A={};if(n)for(const j of n)A[j.clientId]={x:j.x,y:j.y};function N(j){return A[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,M=d??t.filter(j=>j.status!=="offline").length,L=p??t.filter(j=>j.status==="offline").length;return h.jsxs("div",{ref:y,className:ge("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:[h.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"}),h.jsx("div",{className:"absolute top-4 left-5 z-10",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),h.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[R," nodes"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[M," online"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[L," offline"]})]}),h.jsxs("svg",{viewBox:`0 0 ${l.width} ${l.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[h.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("ellipse",{cx:S,cy:w,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${S},${w}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${S},${w} L${b},${x}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),h.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(j=>{const k=N(j.id),P=s.includes(j.id),G=P?S:b,B=P?w:x,z=MC(j.status),Q=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:G,y1:B,x2:k.x,y2:k.y,stroke:z,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const Y=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(Y)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:G,y1:B,x2:k.x,y2:k.y,stroke:z,strokeWidth:Q,strokeDasharray:"4 2",children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:2.5,fill:z,opacity:.7,children:[h.jsx("animateMotion",{dur:Y,repeatCount:"indefinite",path:`M${G},${B} L${k.x},${k.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:Y,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:z,opacity:.5,children:[h.jsx("animateMotion",{dur:Y,begin:ee,repeatCount:"indefinite",path:`M${k.x},${k.y} L${G},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:Y,begin:ee,repeatCount:"indefinite"})]})]},`line-${j.id}`)}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),h.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))"}}),h.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),h.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),h.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),h.jsxs("circle",{cx:S,cy:w,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),h.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))"}}),h.jsx("circle",{cx:S,cy:w,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),h.jsx("circle",{cx:S,cy:w,r:5,fill:"#8b5cf6"}),h.jsx("text",{x:S,y:w+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(j=>{const k=N(j.id),P=MC(j.status),G=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),z=s.includes(j.id);return h.jsxs("g",{opacity:G,children:[h.jsx("circle",{cx:k.x,cy:k.y,r:20,fill:"#0c0c0c",stroke:P,strokeWidth:1.5}),h.jsx("circle",{cx:k.x,cy:k.y,r:5,fill:P}),h.jsx("text",{x:k.x,y:k.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:B}),h.jsxs("text",{x:k.x,y:k.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,z?" · relay":""]})]},`node-${j.id}`)})]})]})});HA.displayName="TopologyHero";let IC=(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 qA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[IC.checked]:""}:{[IC.unchecked]:""}},...vi}),[e.indeterminate])}const rG=_.createContext({disabled:!1});function sG(){return _.useContext(rG)}const oG=_.createContext(void 0);function iG(e=!0){const t=_.useContext(oG);if(t===void 0&&!e)throw new Error(yn(3));return t}const VA=_.createContext(void 0);function aG(){const e=_.useContext(VA);if(e===void 0)throw new Error(yn(14));return e}const cG="data-parent",lG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!1,id:f,indeterminate:d=!1,inputRef:p,name:g,onCheckedChange:y,parent:b=!1,readOnly:x=!1,render:S,required:w=!1,uncheckedValue:T,value:C,nativeButton:A=!1,...N}=t,{clearErrors:R}=tl(),{disabled:M,name:L,setDirty:j,setFilled:k,setFocused:P,setTouched:G,state:B,validationMode:z,validityData:Q,shouldValidateOnChange:Y,validation:ee}=bi(),D=sG(),{labelId:K,controlId:q,registerControlId:V,getDescriptionProps:U}=co(),I=iG(),H=I?.parent,W=H&&I.allValues,X=M||D.disabled||I?.disabled||l,oe=L??g,se=C??oe,de=br(),xe=br();let he=q;W?he=b?xe:`${H.id}-${se}`:f&&(he=f);let Me={};W&&(b?Me=I.parent.getParentProps():se&&(Me=I.parent.getChildProps(se)));const _e=Ae(y),{checked:ne=s,indeterminate:pe=d,onCheckedChange:ae,...we}=Me,ve=I?.value,Se=I?.setValue,ye=I?.defaultValue,Ue=_.useRef(null),Ie=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Xe}=el({disabled:X,native:A}),Be=I?.validation??ee,[We,He]=yp({controlled:se&&ve&&!b?ve.includes(se):ne,default:se&&ye&&!b?ye.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ie.current,he))},[he,I,V,b,Ie]),_.useEffect(()=>{const ut=Ie.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ie]),Lj({enabled:!I,id:de,commit:Be.commit,value:We,controlRef:Ue,name:oe,getValue:()=>We});const me=_.useRef(null),Te=so(p,me,Be.inputRef);Le(()=>{me.current&&(me.current.indeterminate=pe,We&&k(!0))},[We,pe,k]),Hj(We,()=>{I&&!b||(R(oe),k(We),j(We!==Q.initialValue),Y()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:X,name:b?void 0:oe,id:A?void 0:he??void 0,required:w,ref:Te,style:oe?jj:vp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Yt(ii,ut.nativeEvent);if(ae?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ve&&Se&&!b)){const Wt=xt?[...ve,se]:ve.filter(vn=>vn!==se);Se(Wt,ot)}},onFocus(){Ue.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,U,I?Be.getValidationProps:Be.getInputValidationProps),mt=W?!!ne:We,lt=W&&pe||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,X),()=>{ut.delete(se)}},[H,X,se]);const wr=_.useMemo(()=>({...B,checked:mt,disabled:X,readOnly:x,required:w,indeterminate:lt}),[B,mt,X,x,w,lt]),Er=qA(wr),Qt=zt("span",t,{state:wr,ref:[Xe,Ue,n,I?.registerControlRef],props:[{id:A?he??void 0:de,role:"checkbox","aria-checked":pe?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":K,[cG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(G(!0),P(!1),z==="onBlur"&&Be.commit(I?ve:ut.checked))},onClick(ut){x||X||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},U,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(VA.Provider,{value:wr,children:[Qt,!We&&!I&&oe&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:oe,value:T}),h.jsx("input",{...qe})]})}),uG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=aG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Ap(d),b=_.useRef(null),x={...f,transitionStatus:g};ba({open:d,ref:b,onComplete(){d||y(!1)}});const S=qA(f),w=_.useMemo(()=>({...S,...va,...vi}),[S]),T=a||p,C=zt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?C:null}),Fv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(lG,{ref:s,className:ge("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:h.jsx(uG,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Fv.displayName="Checkbox";const fG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function dG(e=!1){const t=_.useContext(fG);if(!t&&!e)throw new Error(yn(86));return t}const hG=function(t){const n=br(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),p=zn(()=>new Map),{messageIds:g}=co(),y=Ae((S,w)=>{const T=p.current;if(w===void 0){T.delete(S);return}T.set(S,w),i(C=>{if(T.size===0)return;let A;for(const N of T.values()){if(C!==void 0&&N===C)return C;A===void 0&&(A=N)}return A})}),b=_.useCallback(S=>oi({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,l,f,d,b]);return h.jsx(Uj.Provider,{value:x,children:t.children})},dh=Object.keys(wp);function pG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of dh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function mG(e){const{formRef:t,clearErrors:n}=tl(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=co(),S=rs(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Q=M.validity;if(!Q.valueMissing){const ee={value:N,state:{...wp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(M.setCustomValidity(""),b){const D=t.current.fields.get(b);D&&t.current.fields.set(b,{...D,...Iv(ee,!1)})}s(ee);return}const Y=dh.reduce((ee,D)=>(ee[D]=Q[D],ee),{});if(!Y.valid&&!pG(Y))return}function L(Q){const Y=dh.reduce((D,K)=>(D[K]=Q.validity[K],D),{});let ee=!1;for(const D of dh)if(D!=="valid"){if(D==="valueMissing"&&Y[D])ee=!0;else if(Y[D])return Y}return ee&&!d.current&&(Y.valid=!0,Y.valueMissing=!1),Y}S.clear();let j=null,k=[];const P=L(M);let G;const B=y();if(M.validationMessage&&!B)G=M.validationMessage,k=[M.validationMessage];else{const Q=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),Y=i(N,Q);typeof Y=="object"&&Y!==null&&"then"in Y?j=await Y:j=Y,j!==null?(P.valid=!1,P.customError=!0,Array.isArray(j)?(k=j,M.setCustomValidity(j.join(`
|
|
75
|
+
`))):j&&(k=[j],M.setCustomValidity(j))):B&&(M.setCustomValidity(""),P.customError=!1,M.validationMessage?(G=M.validationMessage,k=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const z={value:N,state:P,error:G??(Array.isArray(j)?j[0]:j??""),errors:k,initialValue:a.initialValue};if(b){const Q=t.current.fields.get(b);Q&&t.current.fields.set(b,{...Q,...Iv(z,f)})}s(z)}),C=_.useCallback((N={})=>oi(x,p.valid===!1?{"aria-invalid":!0}:an,N),[x,p.valid]),A=_.useCallback((N={})=>oi({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const M=R.currentTarget;if(M.value===""){T(M.value);return}S.clear(),l?S.start(l,()=>{T(M.value)}):T(M.value)}},C(N)),[C,n,g,S,T,f,l,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:A,inputRef:w,commit:T}),[C,A,T])}const gG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=tl(),{render:l,className:f,validate:d,validationDebounceTime:p=0,validationMode:g=i,name:y,disabled:b=!1,invalid:x,dirty:S,touched:w,actionsRef:T,...C}=t,{disabled:A}=dG(),N=Ae(d||(()=>null)),R=A||b,[M,L]=_.useState(!1),[j,k]=_.useState(!1),[P,G]=_.useState(!1),[B,z]=_.useState(!1),Q=S??j,Y=w??M,ee=_.useRef(!1),D=Ae(xe=>{S===void 0&&(xe&&(ee.current=!0),k(xe))}),K=Ae(xe=>{w===void 0&&L(xe)}),q=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[U,I]=_.useState({state:wp,error:"",errors:[],value:null,initialValue:null}),H=!V&&U.state.valid,W=_.useMemo(()=>({disabled:R,touched:Y,dirty:Q,valid:H,filled:P,focused:B}),[R,Y,Q,H,P,B]),X=mG({setValidityData:I,validate:N,validityData:U,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),oe=_.useCallback(()=>{ee.current=!0,X.commit(U.value)},[X,U]);_.useImperativeHandle(T,()=>({validate:oe}),[oe]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:U,setValidityData:I,disabled:R,touched:Y,setTouched:K,dirty:Q,setDirty:D,filled:P,setFilled:G,focused:B,setFocused:z,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:X}),[V,y,U,R,Y,K,Q,D,P,G,B,z,N,g,p,q,W,X]),de=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:vi});return h.jsx(zj.Provider,{value:se,children:de})}),yG=_.forwardRef(function(t,n){return h.jsx(hG,{children:h.jsx(gG,{...t,ref:n})})}),vG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=bi(!1),{controlId:p,setLabelId:g,labelId:y}=co(),b=br(a),x=_.useRef(null),S=Ae(T=>{if(Ur(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!p))return;const A=Rt(T.currentTarget).getElementById(p);Zt(A)&&A.focus({focusVisible:!0})});return Le(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),zt("label",t,{ref:[n,x],state:d.state,props:[{id:y},l?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:vi})}),bG={...vi,...va},xG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=br(i),{validityData:p,state:g,name:y}=bi(!1),{setMessageIds:b}=co(),{errors:x}=tl(),S=y?x[y]:null;let w=!1;S||l===!0?w=!0:l?w=!!p.state[l]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:A}=Ap(w);Le(()=>{if(!(!w||!d))return b(z=>z.concat(d)),()=>{b(z=>z.filter(Q=>Q!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[L,j]=_.useState(null),k=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(z=>h.jsx("li",{children:z},z))}):p.error);let P=p.error;S!=null?P=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(P=JSON.stringify(p.errors)),w&&P!==L&&(j(P),M(k)),ba({open:w,ref:N,onComplete(){w||A(!1)}});const G={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:G,props:[{id:d,children:w?k:R},f],stateAttributesMapping:bG,enabled:T});return T?B:null}),SG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=bi(!1),{setMessageIds:p}=co();return Le(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),zt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:vi})}),ms=yG,ts=_.forwardRef(({className:e,...t},n)=>h.jsx(vG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));ts.displayName="FieldLabel";const mc=_.forwardRef(({className:e,...t},n)=>h.jsx(SG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));mc.displayName="FieldDescription";const _G=_.forwardRef(({className:e,...t},n)=>h.jsx(xG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));_G.displayName="FieldError";const wG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));wG.displayName="FieldContent";const EG=_.createContext(null),TG=_.createContext(null);function Ju(){const e=_.useContext(EG);if(e===null)throw new Error(yn(60));return e}function KA(){const e=_.useContext(TG);if(e===null)throw new Error(yn(61));return e}function Bc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function CG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Bc(t,s,n))}function Uy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Bc(s,t,n))}function RG(e,t,n){return e.filter(s=>!Bc(t,s,n))}function PC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function NG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function jG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(NG(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 AG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?PC(e.value):PC(e)}const it={id:Pe(e=>e.id),modal:Pe(e=>e.modal),multiple:Pe(e=>e.multiple),items:Pe(e=>e.items),itemToStringLabel:Pe(e=>e.itemToStringLabel),itemToStringValue:Pe(e=>e.itemToStringValue),isItemEqualToValue:Pe(e=>e.isItemEqualToValue),value:Pe(e=>e.value),hasSelectedValue:Pe(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:AG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?jG(e.items):!1),open:Pe(e=>e.open),mounted:Pe(e=>e.mounted),forceMount:Pe(e=>e.forceMount),transitionStatus:Pe(e=>e.transitionStatus),openMethod:Pe(e=>e.openMethod),activeIndex:Pe(e=>e.activeIndex),selectedIndex:Pe(e=>e.selectedIndex),isActive:Pe((e,t)=>e.activeIndex===t),isSelected:Pe((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Bc(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Bc(n,i,s)}),isSelectedByFocus:Pe((e,t)=>e.selectedIndex===t),popupProps:Pe(e=>e.popupProps),triggerProps:Pe(e=>e.triggerProps),triggerElement:Pe(e=>e.triggerElement),positionerElement:Pe(e=>e.positionerElement),listElement:Pe(e=>e.listElement),scrollUpArrowVisible:Pe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Pe(e=>e.scrollDownArrowVisible),hasScrollArrows:Pe(e=>e.hasScrollArrows)};function kG(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 OG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(aA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=kG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function MG(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,p=Math.max(t.width,a,f),g=Math.max(t.height,l,d),y=p-t.width,b=g-t.height;return{left:t.left-y/2,right:t.right+y/2,top:t.top-b/2,bottom:t.bottom+b/2}}const Vd=2,IG=400,DC=200,PG={...H7,...vi,value:()=>null},DG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=bi(),{labelId:S}=co(),{store:w,setOpen:T,selectionRef:C,validation:A,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:L,keyboardActiveRef:j}=Ju(),k=x||L||l,P=at(w,it.open),G=at(w,it.value),B=at(w,it.triggerProps),z=at(w,it.positionerElement),Q=at(w,it.listElement),Y=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,K=at(w,it.hasNullItemLabel,D),q=a??Y;$j({id:q});const V=Jo(z),U=_.useRef(null),{getButtonProps:I,buttonRef:H}=el({disabled:k,native:f}),W=Ae(ne=>{w.set("triggerElement",ne)}),X=so(n,U,H,W),oe=rs(),se=rs(),de=rs(),xe=rs();_.useEffect(()=>{if(P)return!(ee||K)?de.start(IG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):xe.start(DC,()=>{C.current.allowUnselectedMouseUp=!0,de.start(DC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{de.clear(),xe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,K,C,se,de,xe]);const he=_.useMemo(()=>Q?.id??Hh(z)?.id,[Q,z]),Me=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?he:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:k?-1:0,ref:X,onFocus(ne){g(!0),P&&M.current&&T(!1,Yt(ii,ne.nativeEvent)),oe.start(0,()=>{w.set("forceMount",!0)})},onBlur(ne){Ot(z,ne.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&A.commit(G))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(ne){if(P)return;const pe=Rt(ne.currentTarget);function ae(we){if(!U.current)return;const ve=we.target;if(Ot(U.current,ve)||Ot(V.current,ve)||ve===U.current)return;const Se=MG(U.current);we.clientX>=Se.left-Vd&&we.clientX<=Se.right+Vd&&we.clientY>=Se.top-Vd&&we.clientY<=Se.bottom+Vd||T(!1,Yt(T8,we))}se.start(0,()=>{pe.addEventListener("mouseup",ae,{once:!0})})}},A.getValidationProps,d,I);Me.role="combobox";const _e={...b,open:P,disabled:k,value:G,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,U],state:_e,stateAttributesMapping:PG,props:Me})}),zG=_.createContext(void 0),LG=_.forwardRef(function(t,n){const{store:s}=Ju(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(zG.Provider,{value:!0,children:h.jsx(RA,{ref:n,...t})}):null});let zC={},LC={},UC="";function UG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function $G(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Rt(e),s=n.documentElement,i=n.body,a=yi(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 p=a.offsetWidth;return a.style.overflowY=l,s.style.scrollbarGutter=f,d===p}function BG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=yi(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 FG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=ys.create();if(sx&&(i.visualViewport?.scale??1)!==1)return()=>{};function p(){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,zC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},UC=n.style.scrollBehavior,LC={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 C=n.scrollHeight>n.clientHeight,A=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",M=Math.max(0,i.innerWidth-s.clientWidth),L=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),k=parseFloat(x.marginLeft)+parseFloat(x.marginRight),P=yi(n)?n:s;if(f=$G(e),f){n.style.scrollbarGutter=T,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||N)&&(n.style.overflowY="scroll"),(A||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||L?`calc(100dvh - ${j+L}px)`:"100dvh",width:k||M?`calc(100vw - ${k+M}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,zC),Object.assign(s.style,LC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=UC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class HG{lockCount=0;restore=null;timeoutLock=ai.create();timeoutUnlock=ai.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=Rt(t).documentElement,i=un(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=jn;return}const a=aA||!UG(t);this.restore=a?BG(t):FG(t)}}const qG=new HG;function GA(e=!0,t=null){Le(()=>{if(e)return qG.acquire(t)},[e,t])}const ZA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function VG(){return _.useContext(ZA)}function YA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),l=_.useRef(0),f=zn(GG).current,d=zn(KG).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,A)=>{d.set(C,A??null),y.current+=1,g(y.current)}),x=Ae(C=>{d.delete(C),y.current+=1,g(y.current)}),S=_.useMemo(()=>{const C=new Map;return Array.from(d.keys()).filter(N=>N.isConnected).sort(ZG).forEach((N,R)=>{const M=d.get(N)??{};C.set(N,{...M,index:R})}),C},[d,p]);Le(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(A=>{const N=new Set,R=M=>N.has(M)?N.delete(M):N.add(M);A.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((A,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Le(()=>{y.current===p&&(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,p]),Le(()=>()=>{n.current=[]},[n]),Le(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));Le(()=>{f.forEach(C=>C(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 h.jsx(ZA.Provider,{value:T,children:t})}function KG(){return new Map}function GG(){return new Set}function ZG(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 XA=_.createContext(void 0);function YG(){const e=_.useContext(XA);if(!e)throw new Error(yn(59));return e}const QA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
|
|
76
76
|
0% 0%,
|
|
77
77
|
100% 0%,
|
|
78
78
|
100% 100%,
|
|
@@ -83,4 +83,4 @@ ${a}
|
|
|
83
83
|
${l.right}px ${l.bottom}px,
|
|
84
84
|
${l.right}px ${l.top}px,
|
|
85
85
|
${l.left}px ${l.top}px
|
|
86
|
-
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Jh(e,t){e&&Object.assign(e.style,t)}const XG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},QG={position:"fixed"},WG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,side:f="bottom",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:T=!0,collisionAvoidance:C=n8,...k}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:L,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:G,setValue:B}=Ju(),z=KA(),Q=at(N,it.open),Y=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),K=at(N,it.openMethod),q=at(N,it.positionerElement),V=at(N,it.triggerElement),U=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[X,oe]=_.useState(T),se=Y&&X&&K!=="touch";!Y&&X!==T&&oe(T),Le(()=>{Y||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),_.useImperativeHandle(L,()=>se),GA((se||ee)&&Q&&K!=="touch",V);const de=FA({anchor:s,floatingRootContext:z,positionMethod:i,mounted:Y,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??se,collisionAvoidance:C,keepMounted:!0}),xe=se?"none":de.side,he=se?QG:de.positionerStyles,Me=_.useMemo(()=>{const Se={};return Q||(Se.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...he,...Se}}},[Q,Y,he]),_e={open:Q,side:xe,align:de.align,anchorHidden:de.anchorHidden},ne=Ae(Se=>{N.set("positionerElement",Se)}),pe=zt("div",t,{ref:[n,ne],state:_e,stateAttributesMapping:il,props:[Me,kp(I),k]}),ae=_.useRef(0),we=Ae(Se=>{if(Se.size===0&&ae.current===0||A.current.length===0)return;const ye=ae.current;if(ae.current=Se.size,Se.size===ye)return;const Ue=Yt(ii);if(ye!==0&&!N.state.multiple&&D!==null&&Uy(A.current,D,U)===-1){const Ee=P.current,Xe=Ee!=null&&Uy(A.current,Ee,U)!==-1?Ee:null;B(Xe,Ue),Xe===null&&(N.set("selectedIndex",null),j.current=null)}if(ye!==0&&N.state.multiple&&Array.isArray(D)){const Ie=Ve=>Uy(A.current,Ve,U)!==-1,Ee=D.filter(Ve=>Ie(Ve));(Ee.length!==D.length||Ee.some(Ve=>!CG(D,Ve,U)))&&(B(Ee,Ue),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Q&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};Jh(q,Ie),Jh(G.current,Ie)}}),ve=_.useMemo(()=>({...de,side:xe,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:H,scrollDownArrowRef:W}),[de,xe,se,oe]);return h.jsx(YA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(XA.Provider,{value:ve,children:[Y&&ee&&h.jsx(QA,{inert:px(!Q),cutout:V}),pe]})})});function WA(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 Kd="base-ui-disable-scrollbar",$C={className:Kd,getElement(e){return h.jsx("style",{nonce:e,href:Kd,precedence:"base-ui:low",children:`.${Kd}{scrollbar-width:none}.${Kd}::-webkit-scrollbar{display:none}`})}},JG=_.createContext(void 0);function JA(e){return _.useContext(JG)}const Ec="ArrowUp",Qi="ArrowDown",ku="ArrowLeft",Tc="ArrowRight",ef="Home",tf="End",ek=new Set([ku,Tc]),eZ=new Set([ku,Tc,ef,tf]),tk=new Set([Ec,Qi]),tZ=new Set([Ec,Qi,ef,tf]),nk=new Set([...ek,...tk]),nZ=new Set([...nk,ef,tf]),rk=new Set([Ec,Qi,ku,Tc,ef,tf]),rZ="Shift",sZ="Control",oZ="Alt",iZ="Meta",aZ=new Set([rZ,sZ,oZ,iZ]);function cZ(e){return Zt(e)&&e.tagName==="INPUT"}function BC(e){return!!(cZ(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function FC(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=HC(e,t,"left"),p=Gd(e),g=Gd(t);n==="ltr"&&(d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight?i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight:d-g.scrollMarginLeft<e.scrollLeft+p.scrollPaddingLeft&&(i=d-g.scrollMarginLeft-p.scrollPaddingLeft)),n==="rtl"&&(d-g.scrollMarginRight<e.scrollLeft+p.scrollPaddingLeft?i=d-g.scrollMarginLeft-p.scrollPaddingLeft:d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight&&(i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight))}if(f&&s!=="horizontal"){const d=HC(e,t,"top"),p=Gd(e),g=Gd(t);d-g.scrollMarginTop<e.scrollTop+p.scrollPaddingTop?a=d-g.scrollMarginTop-p.scrollPaddingTop:d+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-p.scrollPaddingBottom&&(a=d+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+p.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function HC(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 Gd(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 $y(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const lZ=_.createContext(void 0),uZ={disableStyleElements:!1};function fZ(){return _.useContext(lZ)??uZ}const qi=1,dZ={...il,...va},hZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Ju(),{side:k,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:L,scrollUpArrowRef:j}=YG(),A=JA()!=null,P=KA(),{nonce:G,disableStyleElements:B}=fZ(),z=rs(),Q=at(f,it.id),Y=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),K=at(f,it.transitionStatus),q=at(f,it.triggerElement),V=at(f,it.positionerElement),U=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),X=_.useRef(!1),oe=_.useRef({}),se=cx(),de=Ae(_e=>{if(!V||!d.current||!X.current)return;if(H.current||!R){w();return}const ne=V.style.top==="0px",pe=V.style.bottom==="0px",ae=V.getBoundingClientRect().height,we=Rt(V),ve=getComputedStyle(V),Se=parseFloat(ve.marginTop),ye=parseFloat(ve.marginBottom),Ue=qC(getComputedStyle(d.current)),Ie=Math.min(we.documentElement.clientHeight-Se-ye,Ue),Ee=_e.scrollTop,Ve=VC(_e);let Xe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,mt)=>{const lt=$y(qe,0,Ie-ae);lt>0&&me(ae+lt),_e.scrollTop=mt,Ie-(ae+lt)<=qi&&(H.current=!0),w()};if(ne){const qe=Ve-Ee,mt=ae+qe,lt=Math.min(mt,Ie);if(Xe=lt,qe<=qi){Te(qe,Ve);return}Ie-lt>qi?He=!0:We=!0}else if(pe){const qe=Ee,mt=ae+qe,lt=Math.min(mt,Ie),wr=mt-Ie;if(Xe=lt,qe<=qi){Te(qe,0);return}Ie-lt>qi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Xe=Math.ceil(Xe),Xe!==0&&me(Xe),He||Be!=null){const qe=VC(_e),mt=He?qe:$y(Be,0,qe);Math.abs(_e.scrollTop-mt)>qi&&(_e.scrollTop=mt)}(We||Xe>=Ie-qi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>de,[de]),ba({open:Y,ref:d,onComplete(){Y&&p?.(!0)}});const xe={open:Y,transitionStatus:K,side:k,align:N};Le(()=>{!V||!d.current||Object.keys(oe.current).length||(oe.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),Le(()=>{Y||R||(X.current=!1,H.current=!1,I.current=0,W.current=0,Jh(V,oe.current))},[Y,R,V,d]),Le(()=>{const _e=d.current;if(!(!Y||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){X.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ne=pZ(_e);_e.style.removeProperty("--transform-origin");try{const pe=getComputedStyle(V),ae=getComputedStyle(_e),we=Rt(q),ve=un(V),Se=q.getBoundingClientRect(),ye=V.getBoundingClientRect(),Ue=Se.left,Ie=Se.height,Ee=U||_e,Ve=Ee.scrollHeight,Xe=parseFloat(ae.borderBottomWidth),Be=parseFloat(pe.marginTop)||10,We=parseFloat(pe.marginBottom)||10,He=parseFloat(pe.minHeight)||100,me=qC(ae),Te=5,qe=5,mt=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-Se.bottom+Ie,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const ls=tr.left-Ue,uo=xt.left-ye.left,fo=tr.top-Se.top+tr.height/2,nr=xt.top-ye.top+xt.height/2;ot=ls-uo,Wt=nr-fo}const vn=Er+Wt+We+Xe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ue+ot),as=wr-qe,cs=Math.max(0,An+ye.width-as);V.style.left=`${An-cs}px`,V.style.height=`${kt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Be}px`,V.style.marginBottom=`${We}px`,_e.style.height="100%";const _a=Ee.scrollHeight-Ee.clientHeight,_i=er>=_a;_i&&(kt=Math.min(lt,ye.height)-(er-_a));const wi=Se.top<mt||Se.bottom>lt-mt||kt<Math.min(Ve,He),ws=(ve.visualViewport?.scale??1)!==1&&sx;if(wi||ws){X.current=!0,Jh(V,oe.current),hi.flushSync(()=>M(!1));return}if(_i){const tr=Math.max(0,lt-vn);V.style.top=ye.height>=Cn?"0":`${tr}px`,V.style.height=`${kt}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(He,kt)}else V.style.bottom="0",I.current=Math.max(He,kt),Ee.scrollTop=er;if(xt){const tr=ye.top,ls=ye.height,uo=xt.top+xt.height/2,fo=ls>0?(uo-tr)/ls*100:50,nr=$y(fo,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{X.current=!0})}finally{ne()}})}},[f,Y,V,q,y,b,d,w,R,M,se,L,j,U]),_.useEffect(()=>{if(!R||!V||!Y)return;const _e=un(V);function ne(pe){g(!1,Yt(R8,pe))}return _e.addEventListener("resize",ne),()=>{_e.removeEventListener("resize",ne)}},[g,R,V,Y]);const he={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Q}-list`},onKeyDown(_e){x.current=!0,A&&rk.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||WA(_e)||_e.pointerType==="touch")return;const ne=_e.currentTarget;z.start(0,()=>{f.set("activeIndex",null),ne.focus({preventScroll:!0})})},onScroll(_e){U||de(_e.currentTarget)},...R&&{style:U?{height:"100%"}:XG}},Me=zt("div",t,{ref:[n,d],state:xe,stateAttributesMapping:dZ,props:[D,he,kp(K),{className:!U&&R?$C.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&$C.getElement(G),h.jsx(NA,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});function qC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function VC(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const KC=[["transform","none"],["scale","1"],["translate","0 0"]];function pZ(e){const{style:t}=e,n={};for(const[s,i]of KC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of KC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let sk=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function mx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=VG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===sk.GuessFromOrder?()=>{if(b.current===-1){const C=y.current;y.current+=1,b.current=C}return b.current}:-1)),w=_.useRef(null),T=_.useCallback(C=>{if(w.current=C,x!==-1&&C!==null&&(p.current[x]=C,g)){const k=t!==void 0;g.current[x]=k?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return Le(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{f(C)}},[a,l,f,n]),Le(()=>{if(a==null)return d(C=>{const k=w.current?C.get(w.current)?.index:null;k!=null&&S(k)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const mZ=_.createContext(void 0),gZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=mx({label:l,textRef:g,indexGuessBehavior:sk.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:k,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Ju(),L=rs(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),G=at(b,it.isItemEqualToValue),B=y.index,z=B!==-1,Q=_.useRef(null),Y=Jo(B);Le(()=>{if(!z)return;const se=k.current;return se[B]=a,()=>{delete se[B]}},[z,B,a,k]),Le(()=>{if(!z)return;const se=b.state.value;let de=se;R&&Array.isArray(se)&&se.length>0&&(de=se[se.length-1]),de!==void 0&&Bc(a,de,G)&&b.set("selectedIndex",B)},[z,B,R,G,b,a]);const ee={disabled:f,selected:A,highlighted:j},D=x({active:j,selected:A});D.onFocus=void 0,D.id=void 0;const K=_.useRef(null),q=_.useRef("mouse"),V=_.useRef(!1),{getButtonProps:U,buttonRef:I}=el({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const de=b.state.value;if(R){const xe=Array.isArray(de)?de:[],he=A?RG(xe,a,G):[...xe,a];w(he,Yt(Ny,se))}else w(a,Yt(Ny,se)),S(!1,Yt(Ny,se))}const W={role:"option","aria-selected":A,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",B)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&M&&b.set("activeIndex",B)},onMouseMove(){M&&b.set("activeIndex",B)},onMouseLeave(se){!M||N.current||WA(se)||L.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){K.current=se.key,b.set("activeIndex",B)},onClick(se){V.current=!1,!(se.type==="keydown"&&K.current===null)&&(f||K.current===" "&&C.current||q.current!=="touch"&&!j||(K.current=null,H(se.nativeEvent)))},onPointerEnter(se){q.current=se.pointerType},onPointerDown(se){q.current=se.pointerType,V.current=!0},onMouseUp(se){if(f)return;if(V.current){V.current=!1;return}const de=!T.current.allowSelectedMouseUp&&A,xe=!T.current.allowUnselectedMouseUp&&!A;de||xe||q.current!=="touch"&&!j||H(se.nativeEvent)}},X=zt("div",t,{ref:[I,n,y.ref,Q],state:ee,props:[D,W,p,U]}),oe=_.useMemo(()=>({selected:A,indexRef:Y,textRef:g,selectedByFocus:P,hasRegistered:z}),[A,Y,g,P,z]);return h.jsx(mZ.Provider,{value:oe,children:X})})),yZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(DG,{ref:s,className:ge("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}));yZ.displayName="SelectTrigger";const vZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(LG,{...t,children:h.jsx(WG,{...n,children:h.jsx(hZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));vZ.displayName="SelectContent";const bZ=_.forwardRef(({className:e,...t},n)=>h.jsx(gZ,{ref:n,className:ge("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}));bZ.displayName="SelectItem";const xZ=_.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,className:ge("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}));xZ.displayName="Textarea";const ok=_.createContext(void 0);function SZ(e=!0){const t=_.useContext(ok);if(t===void 0&&!e)throw new Error(yn(7));return t}function ik(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Ij(),{ref:i,index:a}=mx(e),l=n===a,f=_.useRef(null),d=so(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!y&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function _Z(e){const{render:t,className:n,state:s=an,props:i=Nu,refs:a=Nu,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=ik({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const wZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=br(y||void 0),w=SZ(),T=w?.value??[],C=w?void 0:i,k=(a||w?.disabled)??!1,[N,R]=yp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=Ae((z,Q)=>{S&&w?.setGroupValue?.(S,z,Q),f?.(z,Q)}),{getButtonProps:L,buttonRef:j}=el({disabled:k,native:b}),A={disabled:k,pressed:N},P=[j,n],G=[{"aria-pressed":N,onClick(z){const Q=!N,Y=Yt(ii,z.nativeEvent);M(Q,Y),!Y.isCanceled&&R(Q)}},x,L],B=zt("button",t,{enabled:!w,state:A,ref:P,props:G});return w?h.jsx(_Z,{tag:"button",render:p,className:s,state:A,refs:P,props:G}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(wZ,{ref:n,className:ge("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}));Dr.displayName="Toggle";function EZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const ak="data-composite-item-active",TZ=[];function CZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=TZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),k=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,L=Ae((P,G=!1)=>{if((d??w)(P),G){const B=N.current[P];FC(C.current,B,l,a)}}),j=Ae(P=>{if(P.size===0||R.current)return;R.current=!0;const G=Array.from(P.keys()),B=G.find(Q=>Q?.hasAttribute(ak))??null,z=B?G.indexOf(B):-1;z!==-1&&L(z),FC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:k,onFocus(P){!C.current||!BC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const G=g?nZ:nk;if(!G.has(P.key)||RZ(P,x)||!C.current)return;const z=l==="rtl",Q=z?ku:Tc,Y={horizontal:Q,vertical:Qi,both:Q}[a],ee=z?Tc:ku,D={horizontal:ee,vertical:Ec,both:ee}[a];if(BC(P.target)&&!EZ(P.target)){const W=P.target.selectionStart,X=P.target.selectionEnd,oe=P.target.value??"";if(W==null||P.shiftKey||W!==X||P.key!==D&&W<oe.length||P.key!==Y&&W>0)return}let K=M;const q=BV(N,b),V=FV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),X=qV(W,n,i),oe=X.findIndex(de=>de!=null&&!pu(N,de,b)),se=X.reduce((de,xe,he)=>xe!=null&&!pu(N,xe,b)?he:de,-1);K=X[HV({current:X.map(de=>de?N.current[de]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:KV([...b||N.current.map((de,xe)=>pu(N,xe)?xe:void 0),void 0],X),minIndex:oe,maxIndex:se,prevIndex:VV(M>V?q:M,W,X,n,P.key===Qi?"bl":P.key===Tc?"tr":"tl"),rtl:z})]}const U={horizontal:[Q],vertical:[Qi],both:[Q,Qi]}[a],I={horizontal:[ee],vertical:[Ec],both:[ee,Ec]}[a],H=T?G:{horizontal:g?eZ:ek,vertical:g?tZ:tk,both:G}[a];g&&(P.key===ef?K=q:P.key===tf&&(K=V)),K===M&&(U.includes(P.key)||I.includes(P.key))&&(s&&K===V&&U.includes(P.key)?K=q:s&&K===q&&I.includes(P.key)?K=V:K=fr(N,{startingIndex:K,decrement:I.includes(P.key),disabledIndices:b})),K!==M&&!lh(N,K)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),L(K,!0),queueMicrotask(()=>{N.current[K]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,k,x,L,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:L,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,L,N,b,j])}function RZ(e,t){for(const n of aZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ck(e){const{render:t,className:n,refs:s=Nu,props:i=Nu,state:a=an,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:k,modifierKeys:N,highlightItemOnHover:R=!1,tag:M="div",...L}=e,j=$A(),{props:A,highlightedIndex:P,onHighlightedIndexChange:G,elementsRef:B,onMapChange:z,relayKeyboardEvent:Q}=CZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:k,modifierKeys:N}),Y=zt(M,e,{state:a,ref:s,props:[A,...i,L],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:G,highlightItemOnHover:R,relayKeyboardEvent:Q}),[P,G,R,Q]);return h.jsx(Mj.Provider,{value:ee,children:h.jsx(YA,{elementsRef:B,onMapChange:D=>{w?.(D),z(D)},children:Y})})}let NZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const GC={multiple(e){return e?{[NZ.multiple]:""}:null}},jZ=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=JA(),S=_.useMemo(()=>{if(p===void 0)return s??[]},[p,s]),w=_.useMemo(()=>p!==void 0||s!==void 0,[p,s]),T=(x?.disabled??!1)||i,[C,k]=yp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((A,P,G)=>{let B;if(d?(B=C.slice(),P?B.push(A):B.splice(C.indexOf(A),1)):B=P?[A]:[],Array.isArray(B)){if(l?.(B,G),G.isCanceled)return;k(B)}}),R={disabled:T,multiple:d,orientation:f},M=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),L={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[L,b],stateAttributesMapping:GC});return h.jsx(ok.Provider,{value:M,children:x?j:h.jsx(ck,{render:y,className:g,state:R,refs:[n],props:[L,b],stateAttributesMapping:GC,loopFocus:a,enableHomeAndEndKeys:!0})})}),hh=_.forwardRef(({className:e,...t},n)=>h.jsx(jZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));hh.displayName="ToggleGroup";const AZ=ge(Gj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function lk({active:e,onClick:t,children:n,className:s}){return h.jsxs("button",{type:"button",onClick:t,className:ge("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&&h.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 kZ({items:e,activeId:t,onItemChange:n,renderItem:s,className:i}){return h.jsx("div",{className:ge("flex items-center gap-0.5",i),children:e.map(a=>{const l=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):h.jsx(lk,{active:l,onClick:f,children:a.label},a.id)})})}const OZ=mi("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}}),MZ={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 IZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(OZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:MZ[e??"healthy"]}:void 0})}const PZ="0.0.6-144",DZ={version:PZ},zZ=DZ.version;function LZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(IZ,{color:"healthy",size:"md",glow:!0}),h.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",zZ]})]})}function UZ({brand:e,center:t,right:n,className:s}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{"aria-hidden":"true",className:"h-[42px] shrink-0"}),h.jsxs("nav",{className:ge("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:[h.jsx("div",{className:"flex items-center gap-3",children:e}),h.jsx("div",{className:"flex items-center gap-0.5",children:t}),h.jsx("div",{className:"flex items-center gap-2",children:n})]})]})}const $Z=mi("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"}}),In=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge($Z({variant:t,className:e})),...n}));In.displayName="Alert";const nf=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));nf.displayName="AlertTitle";const Pn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Pn.displayName="AlertDescription";const uk=_.createContext(void 0);function al(e){const t=_.useContext(uk);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const BZ={...il,...va},gx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=al(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return zt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:BZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),fk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let FZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),HZ=(function(e){return e[e.open=Xi.open]="open",e[e.closed=Xi.closed]="closed",e[e.startingStyle=Xi.startingStyle]="startingStyle",e[e.endingStyle=Xi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const dk=_.createContext(void 0);function qZ(){const e=_.useContext(dk);if(e===void 0)throw new Error(yn(26));return e}const VZ={...il,...va,nestedDialogOpen(e){return e?{[HZ.nestedDialogOpen]:""}:null}},hk=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=al(),p=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),y=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),T=d.useState("nestedOpenDialogCount"),C=d.useState("open"),k=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),M=d.useState("role");qZ(),ba({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function L(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?L:a,A=T>0,G=zt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:A},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:M,tabIndex:-1,hidden:!S,onKeyDown(B){rk.has(B.key)&&B.stopPropagation()},style:{[FZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:VZ});return h.jsx(NA,{context:y,openInteractionType:k,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:G})}),pk=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=al(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(dk.Provider,{value:s,children:h.jsxs(RA,{ref:n,...i,children:[l&&f===!0&&h.jsx(QA,{ref:a.context.internalBackdropRef,inert:px(!d)}),t.children]})}):null});function KZ(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:p,reset:g}=OG(i);_7(t);const{forceUnmount:y}=w7(i,t,()=>{g()}),b=Ae(G=>{const B=Yt(G);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(C8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=j7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,k=L7(S),N=u7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(G){if(!t.context.outsidePressEnabledRef.current||"button"in G&&G.button!==0||"touches"in G&&G.touches.length!==1)return!1;const B=Ur(G);if(C&&!a){const z=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||Ot(z,f)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});GA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:L}=D7([k,N]);t.useContextCallback("onNestedDialogOpen",G=>{T(G+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 j=_.useMemo(()=>R(p),[R,p]),A=_.useMemo(()=>L(p),[L,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const GZ={...C7,modal:Pe(e=>e.modal),nested:Pe(e=>e.nested),nestedOpenDialogCount:Pe(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pe(e=>e.disablePointerDismissal),openMethod:Pe(e=>e.openMethod),descriptionElementId:Pe(e=>e.descriptionElementId),titleElementId:Pe(e=>e.titleElementId),viewportElement:Pe(e=>e.viewportElement),role:Pe(e=>e.role)};class ZZ extends zA{constructor(t){super(YZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new dx,onOpenChange:void 0,onOpenChangeComplete:void 0},GZ)}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 YZ(e={}){return{...T7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function XZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=al(!0),x=!!b,S=zn(()=>p?.store??new ZZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;dV(()=>{n===void 0&&S.state.open===!1&&s===!0&&S.update({open:!0,activeTriggerId:y})}),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");KZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(uk.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const mk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=XZ,QZ=_.forwardRef(({className:e,...t},n)=>h.jsx(gx,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));QZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(pk,{children:[h.jsx(gx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(hk,{ref:s,className:ge("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})]}));hr.displayName="DialogContent";const pr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));pr.displayName="DialogHeader";const Nn=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));Nn.displayName="DialogFooter";const mr=_.forwardRef(({className:e,...t},n)=>h.jsx(mk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));WZ.displayName="DialogDescription";const yx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>h.jsxs("div",{ref:l,className:ge("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...a,children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s," items · Page ",t," of ",n]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Oe,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Oe,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));yx.displayName="Pagination";const JZ=_.forwardRef(({className:e,orientation:t="horizontal",...n},s)=>h.jsx("hr",{ref:s,"aria-orientation":t==="vertical"?"vertical":void 0,className:ge("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));JZ.displayName="Separator";const eY=mi("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"}}),tY=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(pk,{children:[h.jsx(gx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(hk,{ref:i,className:ge(eY({side:t,className:e})),...s,children:n})]}));tY.displayName="SheetContent";const nY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));nY.displayName="SheetHeader";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));rY.displayName="SheetFooter";const sY=_.forwardRef(({className:e,...t},n)=>h.jsx(mk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));sY.displayName="SheetTitle";const oY=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));oY.displayName="SheetDescription";const iY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));iY.displayName="Skeleton";const aY=_.createContext(void 0);function vx(){const e=_.useContext(aY);if(e===void 0)throw new Error(yn(64));return e}let cY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const gk={tabActivationDirection:e=>({[cY.activationDirection]:e})},yk=_.createContext(void 0);function lY(){const e=_.useContext(yk);if(e===void 0)throw new Error(yn(65));return e}const uY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=vx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=lY(),k=br(f),N=_.useMemo(()=>({disabled:i,id:k,value:l}),[i,k,l]),{compositeProps:R,compositeRef:M,index:L}=ik({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&L>-1&&S!==L))return;const V=C;if(V!=null){const U=Bo(Rt(V));if(U&&Ot(V,U))return}i||T(L)},[j,L,S,T,i,C]);const{getButtonProps:P,buttonRef:G}=el({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),z=_.useRef(!1),Q=_.useRef(!1);function Y(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(L>-1&&!i&&T(L),!i&&x&&(!z.current||z.current&&Q.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;z.current=!0;function U(){z.current=!1,Q.current=!1}(!V.button||V.button===0)&&(Q.current=!0,Rt(V.currentTarget).addEventListener("pointerup",U,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,G,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:k,onClick:Y,onFocus:ee,onPointerDown:D,[ak]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let fY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const dY={...gk,...va},hY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=vx(),S=br(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=mx({metadata:w}),k=i===d,{mounted:N,transitionStatus:R,setMounted:M}=Ap(k),L=!N,j=p(i),A={hidden:L,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),G=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:L,id:S,role:"tabpanel",tabIndex:k?0:-1,inert:px(!k),[fY.index]:C},f],stateAttributesMapping:dY});return ba({open:k,ref:P,onComplete(){k||M(!1)}}),Le(()=>{if(!(L&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[L,l,i,S,b,x]),l||N?G:null}),pY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=vx(),[S,w]=_.useState(0),[T,C]=_.useState(null),k=mY(y,g,T,d),N=Ae((j,A)=>{if(j!==y){const P=k(j);A.activationDirection=P,p(j,A)}}),R={orientation:g,tabActivationDirection:x},M={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},L=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(yk.Provider,{value:L,children:h.jsx(ck,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:gk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Nu})})});function ZC(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 mY(e,t,n,s){const[i,a]=_.useState(null);return Le(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=ZC(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:p}=ZC(f,n);if(i==null)return a(t==="horizontal"?d:p),"none";if(t==="horizontal"){if(d<i)return a(d),"left";if(d>i)return a(d),"right"}else{if(p<i)return a(p),"up";if(p>i)return a(p),"down"}}}return"none"},[s,t,i,n,e])}const gY=_.forwardRef(({className:e,...t},n)=>h.jsx(pY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));gY.displayName="TabsList";const yY=mi("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"}}),vY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(uY,{ref:s,className:ge(yY({variant:t,className:e})),...n}));vY.displayName="TabsTrigger";const bY=_.forwardRef(({className:e,...t},n)=>h.jsx(hY,{ref:n,className:ge("outline-none",e),...t}));bY.displayName="TabsContent";const xY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));xY.displayName="Text";const SY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));SY.displayName="TextMuted";const _Y=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));_Y.displayName="TextCode";const wY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));wY.displayName="TextLabel";const EY=_.forwardRef(({className:e,...t},n)=>h.jsx("pre",{ref:n,className:ge("font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto",e),...t}));EY.displayName="CodeBlock";function xa(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 TY="console:instance-id";function Lt(){const[e,t]=xa(TY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Jn={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],storage:e=>["console","storage",e]};function Si(e,t){return e===0?!1:e??t}function rf(e,t){return t?{...e,instanceId:t}:e}function Sa(e){return encodeURIComponent(String(e))}function Ln(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function sf(e={}){const t=Vt(),{instanceId:n}=Lt(),s=e.instanceId??n,i=rf(e.partitionId?{partitionId:e.partitionId}:{},s);return Wn({queryKey:Jn.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Xu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,5e3)})}function CY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.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:Si(t.refetchIntervalMs,3e4)})}function RY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.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:Si(t.refetchIntervalMs,3e4)})}function NY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function jY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 AY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({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 Wn({queryKey:Jn.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function vk(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function kY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 OY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 MY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 IY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 PY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return Wn({queryKey:Jn.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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 p=await fetch(Ln(t.serverUrl,`/console/clients/${Sa(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!p.ok)throw new Error("Failed to evict client");return p.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function zY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(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 LY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(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 UY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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(Ln(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 $Y(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 BY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(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 FY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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 HY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(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 qY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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 VY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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"]})}})}function KY(e={}){const{config:t}=Dt();return Wn({queryKey:Jn.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),queryFn:async()=>{if(!t)throw new Error("Not connected");const n=new URLSearchParams;e.prefix&&n.set("prefix",e.prefix),e.cursor&&n.set("cursor",e.cursor),e.limit&&n.set("limit",String(e.limit));const s=await fetch(Ln(t.serverUrl,"/console/storage",n),{method:"GET",headers:{Authorization:`Bearer ${t.token}`}});if(!s.ok)throw new Error("Failed to list blobs");return s.json()},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,3e4)})}function GY(){const{config:e}=Dt(),t=_r();return is({mutationFn:async n=>{if(!e)throw new Error("Not connected");const s=encodeURIComponent(n),i=await fetch(Ln(e.serverUrl,`/console/storage/${s}`,new URLSearchParams),{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!i.ok)throw new Error("Failed to delete blob");return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["console","storage"]})}})}function ZY(){const{config:e}=Dt();return async t=>{if(!e)throw new Error("Not connected");const n=encodeURIComponent(t),s=await fetch(Ln(e.serverUrl,`/console/storage/${n}/download`,new URLSearchParams),{method:"GET",headers:{Authorization:`Bearer ${e.token}`}});if(!s.ok)throw new Error("Failed to download blob");const i=await s.blob(),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=t.split("/").pop()||t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}const YY="console:partition-id";function of(){const[e,t]=xa(YY,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const YC={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function af(){const[e,t]=xa("console:preferences",YC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(YC)}}}const XY=[{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"}],QY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],bx="syncular-console-root";function WY(e){e.classList.add(bx)}const JY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function eX(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function By(e,t){return e?t?`${e}${t}`:e:t||"/"}function tX({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:l}=Dt(),{preferences:f}=af(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Lt(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=of(),T=vr({select:P=>P.location.pathname}),{data:C}=sf({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),k=eX(e),N=_.useMemo(()=>JY.map(P=>({...P,id:By(k,P.suffix)})),[k]),R=By(k,""),M=By(k,"/config"),L=l?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(P=>P.suffix===""?T===R||T===`${R}/`:T.startsWith(P.id))?.id??R,A=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${bx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx(UZ,{brand:h.jsx(xc,{to:R,children:h.jsx(LZ,{label:"console"})}),center:h.jsx(kZ,{items:N,activeId:j,renderItem:(P,{active:G})=>h.jsx(xc,{to:P.id,children:h.jsx(lk,{active:G,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(mn,{variant:"flow",className:"hidden md:inline-flex px-2 py-1 text-[10px]",children:n}):null,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),h.jsx(Gn,{variant:"mono",value:p,onChange:P=>g(P.target.value),onBlur:P=>g(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:y,children:"All"}):null]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),h.jsx(Gn,{variant:"mono",value:x,onChange:P=>S(P.target.value),onBlur:P=>S(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(I8,{state:L}),h.jsx(xc,{to:M,children:h.jsx(Oe,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(Q8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:AZ,children:[h.jsx(Y8,{className:"h-3 w-3"}),"Go to app"]}):null]})}),h.jsx("main",{className:"flex-1 overflow-auto pb-[32px]",children:h.jsx("div",{className:"min-h-full",children:a||T===M?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(JN,{})},T):h.jsx(nX,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(Vj,{isLive:a,metrics:A,uptime:"--"})]})}function nX({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:s}){return h.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[h.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),h.jsxs("div",{className:"flex items-center gap-2",children:[t&&h.jsx(Oe,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(xc,{to:e,children:h.jsx(Oe,{variant:"link",children:"Configure connection"})})]})]})}const lo=MH({component:tX});function rX(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function sX(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Dt(),{instanceId:p}=Lt(),g=l??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,k]=_.useState(null),N=_.useRef(null),R=_.useRef(null),M=_.useRef(null),L=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),G=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const z=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(rX()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,U=!1;const I=async()=>{if(!(B||U)){U=!0;try{const H=new URL(f.serverUrl,window.location.origin),W=H.pathname.endsWith("/")?H.pathname.slice(0,-1):H.pathname;H.pathname=`${W}/console/events`,H.search="",H.searchParams.set("limit",String(z)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const X=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!X.ok)throw new Error(`Live event polling failed (${X.status})`);const oe=await X.json(),de=(Array.isArray(oe.items)?oe.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),xe=P.current??-1,he=de.filter(Me=>Me.eventId>xe);if(he.length>0){const Me=he.map(ne=>({type:ne.eventType,timestamp:ne.createdAt,data:ne})).reverse();b(ne=>[...Me,...ne].slice(0,t));const _e=he[he.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(de.length>0){const Me=de[de.length-1];P.current=Math.max(P.current??-1,Me.eventId),A.current=Me.createdAt}k(null),S(!0),T("connected")}catch(H){B||(S(!1),T("disconnected"),k(H instanceof Error?H:new Error("Live event polling failed")))}finally{U=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const Y=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;L.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,L.current-1)),U=Math.floor(V*.2*Math.random()),I=V+U;R.current=setTimeout(()=>{R.current=null,B||q()},I)},K=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),Y();const V=(()=>{const I=new URL(f.serverUrl,window.location.origin);I.protocol=I.protocol==="https:"?"wss:":"ws:";const H=I.pathname.endsWith("/")?I.pathname.slice(0,-1):I.pathname;return I.pathname=`${H}/console/events/live`,I.search="",A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(z)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),U=new WebSocket(V);N.current=U,U.onopen=()=>{if(B){U.close();return}L.current=0,k(null),T("connecting"),S(!1);try{U.send(JSON.stringify({type:"auth",token:f.token}))}catch{U.close();return}ee(),M.current=setInterval(()=>{const I=N.current;if(!I||I.readyState!==WebSocket.OPEN)return;const H=j.current;!H||Date.now()-H<=s||(S(!1),T("stale"),I.close())},1e3)},U.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},U.onerror=()=>{B||k(new Error("WebSocket connection failed"))},U.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(K(),W==="connected"||W==="heartbeat"||W==="auth_required")return;if(W==="error"){const de=typeof H.message=="string"?H.message:"Live events authentication failed";k(new Error(de));return}const X={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&X.data.partitionId!==a||g&&X.data.instanceId!==g)return;const oe=Date.parse(A.current??""),se=Date.parse(X.timestamp);Number.isFinite(se)&&(!Number.isFinite(oe)||se>oe)&&(A.current=X.timestamp),b(de=>[X,...de].slice(0,t))}catch{}}};return q(),()=>{B=!0,Y(),ee(),N.current&&(N.current.close(),N.current=null),S(!1),T("disconnected")}},[n,d,f?.serverUrl,f?.token,t,a,g,i,s]),{events:y,isConnected:x,connectionState:w,error:C,clearEvents:G}}function oX(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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 iX=_.createContext(null);function bk(){const[e,t]=xa("console:time-range","24h");return{range:e,setRange:t}}const aX=[{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 cX(e){const t=e.toLowerCase();for(const n of aX)if(t.includes(n.hint))return n.type;return"client"}function lX(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 uX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function fX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function dX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function hX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=uX(i,t),f=fX(i,l);return{id:dX(i.clientId,a),type:cX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:lX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const pX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function XC(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 mX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function gX(){const e=mp(),t=_.useMemo(()=>typeof window>"u"?"/stream":mX(window.location.pathname),[]),n=bk(),{range:s}=n,{preferences:i}=af(),{partitionId:a}=of(),l=i.refreshInterval*1e3,[f]=xa("console:alert-config",pX),[d,p]=_.useState("1h"),{data:g}=sf({refetchIntervalMs:l,partitionId:a}),{data:y}=CY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=RY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=NY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=vk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=sX({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const z=y?.buckets??[];let Q=0,Y=0;for(const D of z)Q+=D.pushCount+D.pullCount,Y+=D.errorCount;const ee=Q>0?Y/Q*100:0;return{totalEvents:Q,errorRate:ee}},[y?.buckets]),k=_.useMemo(()=>S?.items?hX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=k.filter(z=>z.status!=="offline").length,R=k.filter(z=>z.status==="offline").length,M=_.useMemo(()=>g?[{label:"Ops (Range)",value:C.totalEvents,color:"flow"},{label:"P50 Latency",value:b?.push?.p50??0,unit:"ms",color:"healthy"},{label:"Error Rate",value:`${C.errorRate.toFixed(1)}%`,color:C.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,C.errorRate,C.totalEvents]),L=_.useMemo(()=>w.map(z=>({type:z.type.toUpperCase(),actor:z.data?.actorId??"",table:(z.data?.tables??[])[0]??"",time:XC(z.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const z=y?.buckets;if(!z?.length)return[];const Q=Math.max(...z.map(Y=>Math.max(Y.pushCount,Y.pullCount)),1);return z.map(Y=>({pushPercent:Q>0?Y.pushCount/Q*100:0,pullPercent:Q>0?Y.pullCount/Q*100:0}))},[y?.buckets]),A=_.useMemo(()=>{if(!b)return[];const z=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/z*100,pullBarPercent:b.pull.p50/z*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/z*100,pullBarPercent:b.pull.p90/z*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/z*100,pullBarPercent:b.pull.p99/z*100}]},[b]),P=_.useMemo(()=>x?.items?x.items.map(z=>({seq:z.commitSeq,actor:z.actorId,changes:z.changeCount,tables:(z.affectedTables??[]).join(", "),time:XC(z.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),G=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.useMemo(()=>{if(!f.enabled||!g)return[];const z=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&z.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&z.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&z.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),z},[f,g,b,C.errorRate]);return g?h.jsx(iX.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[B.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(In,{variant:"destructive",children:[h.jsx(nf,{children:"Threshold Exceeded"}),h.jsx(Pn,{children:B.map((z,Q)=>h.jsx("span",{className:"block",children:z},Q))})]})}),h.jsx(HA,{clients:k,totalNodes:k.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Jj,{items:M}),h.jsxs("div",{className:"flex",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Tj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(eA,{buckets:A,successRate:G})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Kj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(tA,{entries:L,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})})}function yX(){return h.jsx(gX,{})}function vX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(bX,{}),h.jsx(EX,{}),h.jsx(TX,{}),e]})}function bX(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Dt(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,k]=xa("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),A=j.get("server");let P=!1;if(A&&(d(A),j.delete("server"),P=!0),j.has("token")&&(j.delete("token"),P=!0),P){const G=j.toString(),B=G?`${window.location.pathname}?${G}`:window.location.pathname;window.history.replaceState({},"",B)}},[]),_.useEffect(()=>{t?.serverUrl&&d(t.serverUrl),t?.token&&g(t.token)},[t?.serverUrl,t?.token]),_.useEffect(()=>{T(null)},[]);const N=async()=>{e(),b(null);const j=await n({serverUrl:f.trim(),token:p.trim()},{persistOverride:!0});T(j?"Connected successfully and configuration saved.":"Failed to connect with the provided settings.")},R=()=>{s({clearSavedConfig:C}),C&&(d("/api"),g("")),T(C?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},M=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const A=f.trim(),P=p.trim();if(!A||!P)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${P}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-j))}catch{b(-1)}finally{S(!1)}},L=i??w??(y!==null?y<0?"Connection failed":`Connection successful (${y}ms latency)`:void 0);return h.jsx(Zj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:M,statusMessage:L,children:h.jsx("div",{className:"px-5 pb-5 -mt-2",children:h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),h.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),h.jsx(Ep,{checked:C,onCheckedChange:k})]})})})}const xX=1440*60*1e3;function QC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function Fy(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function SX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function _X(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*xX?"expiring":"active"}function wX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function EX(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[k,N]=_.useState(""),[R,M]=_.useState(null),[L,j]=_.useState([]),[A,P]=_.useState(null),[G,B]=_.useState(null),[z,Q]=_.useState(null),[Y,ee]=_.useState(null),[D,K]=_.useState(null),[q,V]=_.useState(null),[U,I]=_.useState(null),H=_.useMemo(()=>QC(i),[i]),W=H??14,X=_.useMemo(()=>QC(k),[k]),oe=k.trim().length>0,se=!oe||X!==null,de=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:xe,isLoading:he,error:Me}=$Y(de),_e=BY(),ne=HY(),pe=FY(),ae=qY(),we=VY();_.useEffect(()=>{const me=new Set((xe?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[xe?.items]);const ve=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await _e.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:oe?X??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},Se=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ye=async()=>{if(z)try{await pe.mutateAsync(z)}finally{Q(null)}},Ue=async()=>{if(L.length!==0)try{const me=await ne.mutateAsync({keyIds:L});P(me),j([])}catch{}},Ie=async()=>{if(Y)try{const me=await we.mutateAsync(Y.keyId);K({oldKeyId:Y.keyId,oldKeyName:Y.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await pe.mutateAsync(D.oldKeyId)}finally{K(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ae.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(he)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Pt,{size:"lg"})});if(Me)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",Me.message]})});const Xe=(xe?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Xe.length>0&&Xe.every(me=>L.includes(me)),We=L.length>0,He=(xe?.items??[]).filter(me=>L.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(tx,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Oe,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:L.length===0,children:["Revoke Selected (",L.length,")"]}),h.jsx(Oe,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[h.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[h.jsxs(ms,{children:[h.jsx(ts,{children:"Type filter"}),h.jsxs(hh,{value:[e],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="relay"||Te==="proxy"||Te==="admin")&&t(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Status filter"}),h.jsxs(hh,{value:[n],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="active"||Te==="revoked"||Te==="expiring")&&s(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"active",children:"active"}),h.jsx(Dr,{value:"revoked",children:"revoked"}),h.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(mc,{children:"Used when status filter is set to expiring."}),h.jsx(Gn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),H===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),xe?.items.length===0?h.jsx(Jb,{message:"No API keys match the current filters."}):h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx(Fv,{checked:Be,indeterminate:!Be&&We&&Xe.length>0,onCheckedChange:me=>{j(me?Xe:[])},"aria-label":"Select all active keys"})}),h.jsx(ht,{className:"w-[100px]",children:"NAME"}),h.jsx(ht,{className:"w-[55px]",children:"TYPE"}),h.jsx(ht,{className:"w-[90px]",children:"KEY PREFIX"}),h.jsx(ht,{className:"w-[80px]",children:"ACTOR"}),h.jsx(ht,{className:"w-[100px]",children:"SCOPES"}),h.jsx(ht,{className:"w-[120px]",children:"CREATED"}),h.jsx(ht,{className:"w-[120px]",children:"LAST USED"}),h.jsx(ht,{className:"w-[120px]",children:"EXPIRES"}),h.jsx(ht,{className:"flex-1",children:"STATUS"})]})}),h.jsx(sl,{children:(xe?.items??[]).map(me=>{const Te=_X(me,W);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx(Fv,{checked:L.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(lt=>lt!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(pt,{className:"w-[100px] font-medium",children:me.name}),h.jsx(pt,{className:"w-[55px]",children:h.jsx(mn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(pt,{className:"w-[90px]",children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(pt,{className:"w-[80px] text-neutral-500",children:me.actorId??"-"}),h.jsx(pt,{className:"w-[100px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:SX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:wX(Te),children:Te})}),me.revokedAt===null&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{type:"button",onClick:()=>ee(me),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"stage"}),h.jsx("button",{type:"button",onClick:()=>V(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),h.jsx("button",{type:"button",onClick:()=>Q(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},me.keyId)})})]})]}),h.jsx($r,{open:l,onOpenChange:f,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Create API Key"})}),R?h.jsx(WC,{copiedKeyId:G,onClose:()=>{M(null),f(!1)},onCopy:Se,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Gn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Key type"}),h.jsxs(hh,{value:[b],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="relay"||Te==="proxy"||Te==="admin")&&x(Te)},children:[h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(mc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Gn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(mc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Gn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(mc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Gn,{id:"api-key-expires-days",placeholder:"30",value:k,inputMode:"numeric",onChange:me=>N(me.target.value)}),se?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:ve,disabled:_e.isPending||!g||!se,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx($r,{open:d,onOpenChange:me=>{p(me),me||P(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Bulk Revoke API Keys"})}),A?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:()=>{p(!1),P(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",He.slice(0,5).join(", "),He.length>5?` +${He.length-5} more`:""]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:Ue,disabled:ne.isPending||L.length===0,children:ne.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:Y!==null||D!==null,onOpenChange:()=>{ee(null),K(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Stage Rotate API Key"})}),D?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"default",children:h.jsxs(Pn,{children:["Replacement key created for ",D.oldKeyName,". The old key is still active until you revoke it."]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:D.secretKey}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>Se(D.secretKey),children:G===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>{K(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Oe,{variant:"destructive",onClick:Ee,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.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."})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ie,disabled:we.isPending||!Y,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:z!==null,onOpenChange:()=>Q(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>Q(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:ye,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||U!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),U?h.jsx(WC,{copiedKeyId:G,onClose:()=>I(null),onCopy:Se,secretKey:U,warning:"The previous key has been invalidated. Store this replacement securely."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ve,disabled:ae.isPending,children:ae.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function TX(){const{preferences:e,updatePreference:t,resetPreferences:n}=af(),s=[{type:"filter",label:"Auto-refresh interval",options:XY.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:QY.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 h.jsx(nA,{rows:s,onResetDefaults:n})}function WC({copiedKeyId:e,onClose:t,onCopy:n,secretKey:s,warning:i}){return h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:i})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:s}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:t,children:"Done"})})]})}function CX(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 RX(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 NX(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 jX(e,t,n){return{id:e.clientId,type:CX(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:RX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:NX(e.updatedAt,n)}}function AX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=af(),{partitionId:l}=of(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=sf({refetchIntervalMs:d,partitionId:l}),{data:y,isLoading:b,error:x}=vk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=DY(),w=Math.ceil((y?.total??0)/f),T=p?.maxCommitSeq??0;_.useEffect(()=>{n(1)},[]);const C=async()=>{if(s)try{await S.mutateAsync({clientId:s,partitionId:l})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(x)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",x.message]})});const k=(y?.items??[]).map(N=>jX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[k.length>0&&h.jsx(sA,{clients:k,headSeq:T}),k.length===0?e??h.jsx(iV,{children:h.jsx(Jb,{message:"No clients yet"})}):h.jsx(Qj,{clients:k,headSeq:T,onEvict:N=>{const R=y?.items.find(M=>M.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(yx,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx($r,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Evict Client"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",h.jsxs("span",{className:"font-mono text-white",children:[s?.slice(0,12),"..."]}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const kX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function OX(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 MX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function IX(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function JC(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function PX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function DX(e){const t=JC(e.requestPayload),n=JC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=PX(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 zX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function LX(){const{partitionId:e}=of();return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[h.jsx(UX,{}),h.jsx(qX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx($X,{partitionId:e}),h.jsx(BX,{partitionId:e}),h.jsx(FX,{partitionId:e})]}),h.jsx(HX,{partitionId:e})]})}function UX(){const{data:e,isLoading:t,error:n}=MY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(n)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.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?OX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Wj,{handlers:s,tableCount:e?.items.length??0})}function $X({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),{data:f,isLoading:d,refetch:p}=IY({enabled:!1}),g=zY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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 h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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:y}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Pruning Complete"}),h.jsxs(Pn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(In,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Pn,{children:f.commitsToDelete>0?h.jsxs(h.Fragment,{children:["This will delete"," ",h.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",h.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[h.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),h.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),h.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[h.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),h.jsx(mn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function BX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),f=LY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});const g=[{label:"Total changes",value:a?.changeCount??0},{label:"Total commits",value:a?.commitCount??0}];return h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Compaction Complete"}),h.jsxs(Pn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{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."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function FX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=UY(),b=MX(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 y.mutateAsync({tables:b,partitionId:a.trim()||void 0});d(T)};return h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Notification Sent"}),h.jsxs(Pn,{children:["Created synthetic commit"," ",h.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",h.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",h.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),p?h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:p})}):null,h.jsxs(ms,{children:[h.jsx(ts,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(mc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Partition ID (optional)"}),h.jsx(Gn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Oe,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function HX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=PY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(tx,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Oe,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Oe,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Oe,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Oe,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Oe,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:i?h.jsx("div",{className:"flex items-center justify-center py-10",children:h.jsx(Pt,{size:"lg"})}):a?h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Failed to load operation audit events: ",a.message]})}):(s?.items.length??0)===0?h.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Time"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"User"}),h.jsx(ht,{children:"Target"}),h.jsx(ht,{children:"Result"})]})}),h.jsx(sl,{children:(s?.items??[]).map((l,f)=>h.jsxs(os,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:zX(l.createdAt)}),h.jsx(pt,{children:h.jsx(mn,{variant:"ghost",children:IX(l.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:DX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function qX(){const[e,t]=xa("console:alert-config",kX),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 h.jsx(qj,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function VX(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`}function KX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function GX(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[l,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=KY({prefix:n,cursor:i,limit:100}),x=GY(),S=ZY();function w(){const M=e.trim();s(M.length>0?M:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(M=>[...M,i??""]),a(g.cursor))}function k(){f(M=>{const L=[...M],j=L.pop();return a(j&&j.length>0?j:void 0),L})}function N(){d&&x.mutate(d,{onSuccess:()=>p(null)})}if(y)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})})});if(b)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger font-mono text-[11px]",children:["Failed to load storage items: ",b.message]})})});const R=g?.items??[];return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsx(tx,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Gn,{placeholder:"Prefix filter...",value:e,onChange:M=>t(M.target.value),onKeyDown:M=>{M.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Oe,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Jb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Key"}),h.jsx(ht,{children:"Size"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Uploaded"}),h.jsx(ht,{children:"Actions"})]})}),h.jsx(sl,{children:R.map(M=>h.jsxs(os,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:VX(M.size)}),h.jsx(pt,{children:M.httpMetadata?.contentType?h.jsx(mn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:KX(M.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>p(M.key),children:"Delete"})]})})]},M.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Oe,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:k,children:"Previous"}),h.jsx(Oe,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx($r,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Delete Storage Item"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to delete"," ",h.jsx("span",{className:"font-mono text-white",children:d}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This action cannot be undone."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const ZX={};function au(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 YX(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 XX(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 Zd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function QX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function WX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function JX(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function xx({initialSelectedEntryId:e}={}){const{preferences:t}=af(),{partitionId:n}=of(),{range:s,setRange:i}=bk(),a=t.pageSize,l=t.refreshInterval*1e3,f=ZX?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[d,p]=_.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[g,y]=_.useState("all"),[b,x]=_.useState("all"),[S,w]=_.useState(""),[T,C]=_.useState(1),[k,N]=_.useState(!1),[R,M]=_.useState(e??null),L=_.useRef(!1),j=_.useMemo(()=>YX(S),[S]),A=_.useMemo(()=>new Date(Date.now()-XX(s)).toISOString(),[s]),{data:P,isLoading:G,refetch:B}=AY({limit:a,offset:(T-1)*a,...n?{partitionId:n}:{},view:d,...d!=="commits"&&g!=="all"?{eventType:g}:{},...d!=="commits"&&b!=="all"?{outcome:b}:{},...j.actorId?{actorId:j.actorId}:{},...j.clientId?{clientId:j.clientId}:{},...j.requestId?{requestId:j.requestId}:{},...j.traceId?{traceId:j.traceId}:{},...j.table?{table:j.table}:{},...j.search?{search:j.search}:{},from:A},{refetchIntervalMs:l}),z=oX(),Q=R?.startsWith("#")?R.slice(1):void 0,Y=R?.startsWith("E")?R.slice(1):void 0,ee=Q&&Q!=="?"?Q:void 0,D=Y&&Y!=="?"?Y:void 0,{data:K,isLoading:q,error:V}=jY(ee,{enabled:ee!==void 0,partitionId:n}),{data:U,isLoading:I,error:H}=kY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:X,error:oe}=OY(D,{enabled:D!==void 0&&!!U?.payloadRef,partitionId:n}),se=_.useMemo(()=>JX(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!L.current){L.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const xe=_.useMemo(()=>(P?.items??[]).map(we=>{const ve=we.instanceId??we.commit?.instanceId??we.event?.instanceId,Se=ve?`[${ve}] `:"";if(we.type==="commit"&&we.commit){const Ue=we.commit;return{type:"commit",id:QX(Ue,ve),outcome:"--",duration:"--",actor:Ue.actorId,client:Ue.clientId,detail:`${Se}${Ue.changeCount} chg | ${(Ue.affectedTables??[]).join(", ")}`,time:au(we.timestamp,t.timeFormat)}}const ye=we.event;return ye?{type:ye.eventType,id:WX(ye,ve),outcome:ye.outcome,duration:`${ye.durationMs}ms`,actor:ye.actorId,client:ye.clientId,detail:`${Se}${(ye.tables??[]).join(", ")||"--"}`,time:au(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:au(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),he=P?.total??0,Me=Math.max(1,Math.ceil(he/a)),_e=G,ne=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ae=>{p(ae),ae==="commits"&&(y("all"),x("all")),C(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:ae=>{i(ae),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ae=>{y(ae),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ae=>{x(ae),C(1)}}];function pe(){z.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&xe.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(rA,{entries:xe,selectedEntryId:R,onEntryClick:ae=>M(ae.id),filterBar:h.jsx(Yj,{groups:ne,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Oe,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Oe,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(yx,{page:T,totalPages:Me,totalItems:he,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ae=>{ae||M(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:ee!==void 0?`Commit #${ee}`:D!==void 0?`Event E${D}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:q||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):V||H?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):K?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:K.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:K.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:K.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(K.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:K.changeCount})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:K.affectedTables.join(", ")||"--"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),K.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):K.changes.map(ae=>h.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[h.jsxs("span",{className:"text-neutral-300",children:[ae.table," | ",ae.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ae.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ae.rowId,ae.rowVersion!==null?` | version: ${ae.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(ae.rowJson)})]},ae.changeId))]})]}):U?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Type"}),h.jsx("div",{className:"text-neutral-100",children:U.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:U.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:U.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:U.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:U.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:U.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:U.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:U.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:U.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[U.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:U.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:U.traceId??"--"}),se&&h.jsx("a",{href:se,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Span ID"}),h.jsx("div",{className:"text-neutral-100",children:U.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:U.commitSeq??"--"}),U.commitSeq!==null&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>M(`#${U.instanceId?`${U.instanceId}:`:""}${U.commitSeq}`),children:"Open linked commit"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),h.jsx("div",{className:"text-neutral-100",children:U.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:U.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:U.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(U.createdAt,t.timeFormat)})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:U.tables.join(", ")||"--"})]}),U.scopesSummary&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(U.scopesSummary)})]}),U.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),X?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):oe?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):W?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(W.requestPayload)}),h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(W.responsePayload)})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),U.errorMessage&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),h.jsx("p",{className:"font-mono text-[11px] text-offline",children:U.errorMessage})]})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:k,onOpenChange:ae=>{ae||N(!1)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Clear all events"})}),h.jsx("div",{className:"p-4",children:h.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?"})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",size:"sm",onClick:pe,disabled:z.isPending,children:z.isPending?"Clearing...":"Clear all"})]})]})})]})}const eQ=ao({getParentRoute:()=>lo,path:"/config",component:vX}),tQ=ao({getParentRoute:()=>lo,path:"/fleet",component:AX}),nQ=ao({getParentRoute:()=>lo,path:"/",component:yX});function rQ(){const{seq:e}=xk.useParams();return h.jsx(xx,{initialSelectedEntryId:`#${e}`})}const xk=ao({getParentRoute:()=>lo,path:"/investigate/commit/$seq",component:rQ});function sQ(){const{id:e}=Sk.useParams();return h.jsx(xx,{initialSelectedEntryId:`E${e}`})}const Sk=ao({getParentRoute:()=>lo,path:"/investigate/event/$id",component:sQ}),oQ=ao({getParentRoute:()=>lo,path:"/ops",component:LX}),iQ=ao({getParentRoute:()=>lo,path:"/storage",component:GX}),aQ=ao({getParentRoute:()=>lo,path:"/stream",component:xx}),cQ=lo.addChildren([nQ,aQ,xk,Sk,tQ,oQ,iQ,eQ]),lQ="syncular-console-basepath",uQ="syncular-console-server-url",fQ="syncular-console-token";function dQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hv(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return dQ(n)}function _k(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function hQ(){return _k(Hv(lQ))}function pQ(){const e=Hv(uQ),t=Hv(fQ);return!e||!t?null:{serverUrl:e,token:t}}function mQ(){return new P6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function gQ(e){return _k(e??hQ())}function yQ(e){const[t]=_.useState(()=>mQ()),n=_.useMemo(()=>BH({routeTree:cQ,basepath:gQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?pQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(D6,{client:t,children:h.jsx(sq,{defaultConfig:s,autoConnect:i,storageMode:e.storageMode,children:h.jsx(qH,{router:n})})})}function vQ(e){return h.jsx("div",{className:bx,children:h.jsx(yQ,{...e})})}function bQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function xQ(e,t={}){const n=bQ(e);WY(n);const s=f6.createRoot(n),i=h.jsx(vQ,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var SQ={};const _Q="syncular-sentry-dsn",wQ="syncular-sentry-environment",EQ="syncular-sentry-release";function gu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hy(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return gu(t)}function qy(e){if(!(typeof process>"u"))return gu(SQ[e])}function Vy(e){for(const t of e)if(t)return t}function TQ(){const e=Vy([gu(globalThis.__SYNCULAR_SENTRY_DSN__),Hy(_Q),qy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Vy([gu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Hy(wQ),qy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Vy([gu(globalThis.__SYNCULAR_SENTRY_RELEASE__),Hy(EQ),qy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const eR=TQ();eR&&n6(eR);xQ("#root");
|
|
86
|
+
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Jh(e,t){e&&Object.assign(e.style,t)}const XG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},QG={position:"fixed"},WG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,side:f="bottom",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:T=!0,collisionAvoidance:C=n8,...A}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:L,selectedItemTextRef:j,valuesRef:k,initialValueRef:P,popupRef:G,setValue:B}=Ju(),z=KA(),Q=at(N,it.open),Y=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),K=at(N,it.openMethod),q=at(N,it.positionerElement),V=at(N,it.triggerElement),U=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[X,oe]=_.useState(T),se=Y&&X&&K!=="touch";!Y&&X!==T&&oe(T),Le(()=>{Y||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),_.useImperativeHandle(L,()=>se),GA((se||ee)&&Q&&K!=="touch",V);const de=FA({anchor:s,floatingRootContext:z,positionMethod:i,mounted:Y,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??se,collisionAvoidance:C,keepMounted:!0}),xe=se?"none":de.side,he=se?QG:de.positionerStyles,Me=_.useMemo(()=>{const Se={};return Q||(Se.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...he,...Se}}},[Q,Y,he]),_e={open:Q,side:xe,align:de.align,anchorHidden:de.anchorHidden},ne=Ae(Se=>{N.set("positionerElement",Se)}),pe=zt("div",t,{ref:[n,ne],state:_e,stateAttributesMapping:il,props:[Me,kp(I),A]}),ae=_.useRef(0),we=Ae(Se=>{if(Se.size===0&&ae.current===0||k.current.length===0)return;const ye=ae.current;if(ae.current=Se.size,Se.size===ye)return;const Ue=Yt(ii);if(ye!==0&&!N.state.multiple&&D!==null&&Uy(k.current,D,U)===-1){const Ee=P.current,Xe=Ee!=null&&Uy(k.current,Ee,U)!==-1?Ee:null;B(Xe,Ue),Xe===null&&(N.set("selectedIndex",null),j.current=null)}if(ye!==0&&N.state.multiple&&Array.isArray(D)){const Ie=Ve=>Uy(k.current,Ve,U)!==-1,Ee=D.filter(Ve=>Ie(Ve));(Ee.length!==D.length||Ee.some(Ve=>!CG(D,Ve,U)))&&(B(Ee,Ue),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Q&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};Jh(q,Ie),Jh(G.current,Ie)}}),ve=_.useMemo(()=>({...de,side:xe,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:oe,scrollUpArrowRef:H,scrollDownArrowRef:W}),[de,xe,se,oe]);return h.jsx(YA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(XA.Provider,{value:ve,children:[Y&&ee&&h.jsx(QA,{inert:px(!Q),cutout:V}),pe]})})});function WA(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 Kd="base-ui-disable-scrollbar",$C={className:Kd,getElement(e){return h.jsx("style",{nonce:e,href:Kd,precedence:"base-ui:low",children:`.${Kd}{scrollbar-width:none}.${Kd}::-webkit-scrollbar{display:none}`})}},JG=_.createContext(void 0);function JA(e){return _.useContext(JG)}const Ec="ArrowUp",Qi="ArrowDown",ku="ArrowLeft",Tc="ArrowRight",ef="Home",tf="End",ek=new Set([ku,Tc]),eZ=new Set([ku,Tc,ef,tf]),tk=new Set([Ec,Qi]),tZ=new Set([Ec,Qi,ef,tf]),nk=new Set([...ek,...tk]),nZ=new Set([...nk,ef,tf]),rk=new Set([Ec,Qi,ku,Tc,ef,tf]),rZ="Shift",sZ="Control",oZ="Alt",iZ="Meta",aZ=new Set([rZ,sZ,oZ,iZ]);function cZ(e){return Zt(e)&&e.tagName==="INPUT"}function BC(e){return!!(cZ(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function FC(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=HC(e,t,"left"),p=Gd(e),g=Gd(t);n==="ltr"&&(d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight?i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight:d-g.scrollMarginLeft<e.scrollLeft+p.scrollPaddingLeft&&(i=d-g.scrollMarginLeft-p.scrollPaddingLeft)),n==="rtl"&&(d-g.scrollMarginRight<e.scrollLeft+p.scrollPaddingLeft?i=d-g.scrollMarginLeft-p.scrollPaddingLeft:d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight&&(i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight))}if(f&&s!=="horizontal"){const d=HC(e,t,"top"),p=Gd(e),g=Gd(t);d-g.scrollMarginTop<e.scrollTop+p.scrollPaddingTop?a=d-g.scrollMarginTop-p.scrollPaddingTop:d+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-p.scrollPaddingBottom&&(a=d+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+p.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function HC(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 Gd(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 $y(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const lZ=_.createContext(void 0),uZ={disableStyleElements:!1};function fZ(){return _.useContext(lZ)??uZ}const qi=1,dZ={...il,...va},hZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Ju(),{side:A,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:L,scrollUpArrowRef:j}=YG(),k=JA()!=null,P=KA(),{nonce:G,disableStyleElements:B}=fZ(),z=rs(),Q=at(f,it.id),Y=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),K=at(f,it.transitionStatus),q=at(f,it.triggerElement),V=at(f,it.positionerElement),U=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),X=_.useRef(!1),oe=_.useRef({}),se=cx(),de=Ae(_e=>{if(!V||!d.current||!X.current)return;if(H.current||!R){w();return}const ne=V.style.top==="0px",pe=V.style.bottom==="0px",ae=V.getBoundingClientRect().height,we=Rt(V),ve=getComputedStyle(V),Se=parseFloat(ve.marginTop),ye=parseFloat(ve.marginBottom),Ue=qC(getComputedStyle(d.current)),Ie=Math.min(we.documentElement.clientHeight-Se-ye,Ue),Ee=_e.scrollTop,Ve=VC(_e);let Xe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,mt)=>{const lt=$y(qe,0,Ie-ae);lt>0&&me(ae+lt),_e.scrollTop=mt,Ie-(ae+lt)<=qi&&(H.current=!0),w()};if(ne){const qe=Ve-Ee,mt=ae+qe,lt=Math.min(mt,Ie);if(Xe=lt,qe<=qi){Te(qe,Ve);return}Ie-lt>qi?He=!0:We=!0}else if(pe){const qe=Ee,mt=ae+qe,lt=Math.min(mt,Ie),wr=mt-Ie;if(Xe=lt,qe<=qi){Te(qe,0);return}Ie-lt>qi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Xe=Math.ceil(Xe),Xe!==0&&me(Xe),He||Be!=null){const qe=VC(_e),mt=He?qe:$y(Be,0,qe);Math.abs(_e.scrollTop-mt)>qi&&(_e.scrollTop=mt)}(We||Xe>=Ie-qi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>de,[de]),ba({open:Y,ref:d,onComplete(){Y&&p?.(!0)}});const xe={open:Y,transitionStatus:K,side:A,align:N};Le(()=>{!V||!d.current||Object.keys(oe.current).length||(oe.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),Le(()=>{Y||R||(X.current=!1,H.current=!1,I.current=0,W.current=0,Jh(V,oe.current))},[Y,R,V,d]),Le(()=>{const _e=d.current;if(!(!Y||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){X.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ne=pZ(_e);_e.style.removeProperty("--transform-origin");try{const pe=getComputedStyle(V),ae=getComputedStyle(_e),we=Rt(q),ve=un(V),Se=q.getBoundingClientRect(),ye=V.getBoundingClientRect(),Ue=Se.left,Ie=Se.height,Ee=U||_e,Ve=Ee.scrollHeight,Xe=parseFloat(ae.borderBottomWidth),Be=parseFloat(pe.marginTop)||10,We=parseFloat(pe.marginBottom)||10,He=parseFloat(pe.minHeight)||100,me=qC(ae),Te=5,qe=5,mt=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-Se.bottom+Ie,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const ls=tr.left-Ue,uo=xt.left-ye.left,fo=tr.top-Se.top+tr.height/2,nr=xt.top-ye.top+xt.height/2;ot=ls-uo,Wt=nr-fo}const vn=Er+Wt+We+Xe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ue+ot),as=wr-qe,cs=Math.max(0,An+ye.width-as);V.style.left=`${An-cs}px`,V.style.height=`${kt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Be}px`,V.style.marginBottom=`${We}px`,_e.style.height="100%";const _a=Ee.scrollHeight-Ee.clientHeight,_i=er>=_a;_i&&(kt=Math.min(lt,ye.height)-(er-_a));const wi=Se.top<mt||Se.bottom>lt-mt||kt<Math.min(Ve,He),ws=(ve.visualViewport?.scale??1)!==1&&sx;if(wi||ws){X.current=!0,Jh(V,oe.current),hi.flushSync(()=>M(!1));return}if(_i){const tr=Math.max(0,lt-vn);V.style.top=ye.height>=Cn?"0":`${tr}px`,V.style.height=`${kt}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(He,kt)}else V.style.bottom="0",I.current=Math.max(He,kt),Ee.scrollTop=er;if(xt){const tr=ye.top,ls=ye.height,uo=xt.top+xt.height/2,fo=ls>0?(uo-tr)/ls*100:50,nr=$y(fo,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{X.current=!0})}finally{ne()}})}},[f,Y,V,q,y,b,d,w,R,M,se,L,j,U]),_.useEffect(()=>{if(!R||!V||!Y)return;const _e=un(V);function ne(pe){g(!1,Yt(R8,pe))}return _e.addEventListener("resize",ne),()=>{_e.removeEventListener("resize",ne)}},[g,R,V,Y]);const he={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Q}-list`},onKeyDown(_e){x.current=!0,k&&rk.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||WA(_e)||_e.pointerType==="touch")return;const ne=_e.currentTarget;z.start(0,()=>{f.set("activeIndex",null),ne.focus({preventScroll:!0})})},onScroll(_e){U||de(_e.currentTarget)},...R&&{style:U?{height:"100%"}:XG}},Me=zt("div",t,{ref:[n,d],state:xe,stateAttributesMapping:dZ,props:[D,he,kp(K),{className:!U&&R?$C.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&$C.getElement(G),h.jsx(NA,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Me})]})});function qC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function VC(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const KC=[["transform","none"],["scale","1"],["translate","0 0"]];function pZ(e){const{style:t}=e,n={};for(const[s,i]of KC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of KC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let sk=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function mx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=VG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===sk.GuessFromOrder?()=>{if(b.current===-1){const C=y.current;y.current+=1,b.current=C}return b.current}:-1)),w=_.useRef(null),T=_.useCallback(C=>{if(w.current=C,x!==-1&&C!==null&&(p.current[x]=C,g)){const A=t!==void 0;g.current[x]=A?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return Le(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{f(C)}},[a,l,f,n]),Le(()=>{if(a==null)return d(C=>{const A=w.current?C.get(w.current)?.index:null;A!=null&&S(A)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const mZ=_.createContext(void 0),gZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=mx({label:l,textRef:g,indexGuessBehavior:sk.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:A,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Ju(),L=rs(),j=at(b,it.isActive,y.index),k=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),G=at(b,it.isItemEqualToValue),B=y.index,z=B!==-1,Q=_.useRef(null),Y=Jo(B);Le(()=>{if(!z)return;const se=A.current;return se[B]=a,()=>{delete se[B]}},[z,B,a,A]),Le(()=>{if(!z)return;const se=b.state.value;let de=se;R&&Array.isArray(se)&&se.length>0&&(de=se[se.length-1]),de!==void 0&&Bc(a,de,G)&&b.set("selectedIndex",B)},[z,B,R,G,b,a]);const ee={disabled:f,selected:k,highlighted:j},D=x({active:j,selected:k});D.onFocus=void 0,D.id=void 0;const K=_.useRef(null),q=_.useRef("mouse"),V=_.useRef(!1),{getButtonProps:U,buttonRef:I}=el({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const de=b.state.value;if(R){const xe=Array.isArray(de)?de:[],he=k?RG(xe,a,G):[...xe,a];w(he,Yt(Ny,se))}else w(a,Yt(Ny,se)),S(!1,Yt(Ny,se))}const W={role:"option","aria-selected":k,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",B)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&M&&b.set("activeIndex",B)},onMouseMove(){M&&b.set("activeIndex",B)},onMouseLeave(se){!M||N.current||WA(se)||L.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){K.current=se.key,b.set("activeIndex",B)},onClick(se){V.current=!1,!(se.type==="keydown"&&K.current===null)&&(f||K.current===" "&&C.current||q.current!=="touch"&&!j||(K.current=null,H(se.nativeEvent)))},onPointerEnter(se){q.current=se.pointerType},onPointerDown(se){q.current=se.pointerType,V.current=!0},onMouseUp(se){if(f)return;if(V.current){V.current=!1;return}const de=!T.current.allowSelectedMouseUp&&k,xe=!T.current.allowUnselectedMouseUp&&!k;de||xe||q.current!=="touch"&&!j||H(se.nativeEvent)}},X=zt("div",t,{ref:[I,n,y.ref,Q],state:ee,props:[D,W,p,U]}),oe=_.useMemo(()=>({selected:k,indexRef:Y,textRef:g,selectedByFocus:P,hasRegistered:z}),[k,Y,g,P,z]);return h.jsx(mZ.Provider,{value:oe,children:X})})),yZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(DG,{ref:s,className:ge("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}));yZ.displayName="SelectTrigger";const vZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(LG,{...t,children:h.jsx(WG,{...n,children:h.jsx(hZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));vZ.displayName="SelectContent";const bZ=_.forwardRef(({className:e,...t},n)=>h.jsx(gZ,{ref:n,className:ge("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}));bZ.displayName="SelectItem";const xZ=_.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,className:ge("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}));xZ.displayName="Textarea";const ok=_.createContext(void 0);function SZ(e=!0){const t=_.useContext(ok);if(t===void 0&&!e)throw new Error(yn(7));return t}function ik(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Ij(),{ref:i,index:a}=mx(e),l=n===a,f=_.useRef(null),d=so(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!y&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function _Z(e){const{render:t,className:n,state:s=an,props:i=Nu,refs:a=Nu,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=ik({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const wZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=br(y||void 0),w=SZ(),T=w?.value??[],C=w?void 0:i,A=(a||w?.disabled)??!1,[N,R]=yp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=Ae((z,Q)=>{S&&w?.setGroupValue?.(S,z,Q),f?.(z,Q)}),{getButtonProps:L,buttonRef:j}=el({disabled:A,native:b}),k={disabled:A,pressed:N},P=[j,n],G=[{"aria-pressed":N,onClick(z){const Q=!N,Y=Yt(ii,z.nativeEvent);M(Q,Y),!Y.isCanceled&&R(Q)}},x,L],B=zt("button",t,{enabled:!w,state:k,ref:P,props:G});return w?h.jsx(_Z,{tag:"button",render:p,className:s,state:k,refs:P,props:G}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(wZ,{ref:n,className:ge("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}));Dr.displayName="Toggle";function EZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const ak="data-composite-item-active",TZ=[];function CZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=TZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),A=so(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,L=Ae((P,G=!1)=>{if((d??w)(P),G){const B=N.current[P];FC(C.current,B,l,a)}}),j=Ae(P=>{if(P.size===0||R.current)return;R.current=!0;const G=Array.from(P.keys()),B=G.find(Q=>Q?.hasAttribute(ak))??null,z=B?G.indexOf(B):-1;z!==-1&&L(z),FC(C.current,B,l,a)}),k=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:A,onFocus(P){!C.current||!BC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const G=g?nZ:nk;if(!G.has(P.key)||RZ(P,x)||!C.current)return;const z=l==="rtl",Q=z?ku:Tc,Y={horizontal:Q,vertical:Qi,both:Q}[a],ee=z?Tc:ku,D={horizontal:ee,vertical:Ec,both:ee}[a];if(BC(P.target)&&!EZ(P.target)){const W=P.target.selectionStart,X=P.target.selectionEnd,oe=P.target.value??"";if(W==null||P.shiftKey||W!==X||P.key!==D&&W<oe.length||P.key!==Y&&W>0)return}let K=M;const q=BV(N,b),V=FV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),X=qV(W,n,i),oe=X.findIndex(de=>de!=null&&!pu(N,de,b)),se=X.reduce((de,xe,he)=>xe!=null&&!pu(N,xe,b)?he:de,-1);K=X[HV({current:X.map(de=>de?N.current[de]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:KV([...b||N.current.map((de,xe)=>pu(N,xe)?xe:void 0),void 0],X),minIndex:oe,maxIndex:se,prevIndex:VV(M>V?q:M,W,X,n,P.key===Qi?"bl":P.key===Tc?"tr":"tl"),rtl:z})]}const U={horizontal:[Q],vertical:[Qi],both:[Q,Qi]}[a],I={horizontal:[ee],vertical:[Ec],both:[ee,Ec]}[a],H=T?G:{horizontal:g?eZ:ek,vertical:g?tZ:tk,both:G}[a];g&&(P.key===ef?K=q:P.key===tf&&(K=V)),K===M&&(U.includes(P.key)||I.includes(P.key))&&(s&&K===V&&U.includes(P.key)?K=q:s&&K===q&&I.includes(P.key)?K=V:K=fr(N,{startingIndex:K,decrement:I.includes(P.key),disabledIndices:b})),K!==M&&!lh(N,K)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),L(K,!0),queueMicrotask(()=>{N.current[K]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,A,x,L,a,y]);return _.useMemo(()=>({props:k,highlightedIndex:M,onHighlightedIndexChange:L,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:k.onKeyDown}),[k,M,L,N,b,j])}function RZ(e,t){for(const n of aZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ck(e){const{render:t,className:n,refs:s=Nu,props:i=Nu,state:a=an,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:A,modifierKeys:N,highlightItemOnHover:R=!1,tag:M="div",...L}=e,j=$A(),{props:k,highlightedIndex:P,onHighlightedIndexChange:G,elementsRef:B,onMapChange:z,relayKeyboardEvent:Q}=CZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:A,modifierKeys:N}),Y=zt(M,e,{state:a,ref:s,props:[k,...i,L],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:G,highlightItemOnHover:R,relayKeyboardEvent:Q}),[P,G,R,Q]);return h.jsx(Mj.Provider,{value:ee,children:h.jsx(YA,{elementsRef:B,onMapChange:D=>{w?.(D),z(D)},children:Y})})}let NZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const GC={multiple(e){return e?{[NZ.multiple]:""}:null}},jZ=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=JA(),S=_.useMemo(()=>{if(p===void 0)return s??[]},[p,s]),w=_.useMemo(()=>p!==void 0||s!==void 0,[p,s]),T=(x?.disabled??!1)||i,[C,A]=yp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((k,P,G)=>{let B;if(d?(B=C.slice(),P?B.push(k):B.splice(C.indexOf(k),1)):B=P?[k]:[],Array.isArray(B)){if(l?.(B,G),G.isCanceled)return;A(B)}}),R={disabled:T,multiple:d,orientation:f},M=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),L={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[L,b],stateAttributesMapping:GC});return h.jsx(ok.Provider,{value:M,children:x?j:h.jsx(ck,{render:y,className:g,state:R,refs:[n],props:[L,b],stateAttributesMapping:GC,loopFocus:a,enableHomeAndEndKeys:!0})})}),hh=_.forwardRef(({className:e,...t},n)=>h.jsx(jZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));hh.displayName="ToggleGroup";const AZ=ge(Gj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function lk({active:e,onClick:t,children:n,className:s}){return h.jsxs("button",{type:"button",onClick:t,className:ge("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&&h.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 kZ({items:e,activeId:t,onItemChange:n,renderItem:s,className:i}){return h.jsx("div",{className:ge("flex items-center gap-0.5",i),children:e.map(a=>{const l=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):h.jsx(lk,{active:l,onClick:f,children:a.label},a.id)})})}const OZ=mi("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}}),MZ={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 IZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(OZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:MZ[e??"healthy"]}:void 0})}const PZ="0.0.6-152",DZ={version:PZ},zZ=DZ.version;function LZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(IZ,{color:"healthy",size:"md",glow:!0}),h.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",zZ]})]})}function UZ({brand:e,center:t,right:n,className:s}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{"aria-hidden":"true",className:"h-[42px] shrink-0"}),h.jsxs("nav",{className:ge("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:[h.jsx("div",{className:"flex items-center gap-3",children:e}),h.jsx("div",{className:"flex items-center gap-0.5",children:t}),h.jsx("div",{className:"flex items-center gap-2",children:n})]})]})}const $Z=mi("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"}}),In=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge($Z({variant:t,className:e})),...n}));In.displayName="Alert";const nf=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));nf.displayName="AlertTitle";const Pn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Pn.displayName="AlertDescription";const uk=_.createContext(void 0);function al(e){const t=_.useContext(uk);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const BZ={...il,...va},gx=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=al(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return zt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:BZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),fk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let FZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),HZ=(function(e){return e[e.open=Xi.open]="open",e[e.closed=Xi.closed]="closed",e[e.startingStyle=Xi.startingStyle]="startingStyle",e[e.endingStyle=Xi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const dk=_.createContext(void 0);function qZ(){const e=_.useContext(dk);if(e===void 0)throw new Error(yn(26));return e}const VZ={...il,...va,nestedDialogOpen(e){return e?{[HZ.nestedDialogOpen]:""}:null}},hk=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=al(),p=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),y=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),T=d.useState("nestedOpenDialogCount"),C=d.useState("open"),A=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),M=d.useState("role");qZ(),ba({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function L(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?L:a,k=T>0,G=zt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:k},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:M,tabIndex:-1,hidden:!S,onKeyDown(B){rk.has(B.key)&&B.stopPropagation()},style:{[FZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:VZ});return h.jsx(NA,{context:y,openInteractionType:A,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:G})}),pk=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=al(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(dk.Provider,{value:s,children:h.jsxs(RA,{ref:n,...i,children:[l&&f===!0&&h.jsx(QA,{ref:a.context.internalBackdropRef,inert:px(!d)}),t.children]})}):null});function KZ(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:p,reset:g}=OG(i);_7(t);const{forceUnmount:y}=w7(i,t,()=>{g()}),b=Ae(G=>{const B=Yt(G);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(C8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=j7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,A=L7(S),N=u7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(G){if(!t.context.outsidePressEnabledRef.current||"button"in G&&G.button!==0||"touches"in G&&G.touches.length!==1)return!1;const B=Ur(G);if(C&&!a){const z=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||Ot(z,f)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});GA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:L}=D7([A,N]);t.useContextCallback("onNestedDialogOpen",G=>{T(G+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 j=_.useMemo(()=>R(p),[R,p]),k=_.useMemo(()=>L(p),[L,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:k,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const GZ={...C7,modal:Pe(e=>e.modal),nested:Pe(e=>e.nested),nestedOpenDialogCount:Pe(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pe(e=>e.disablePointerDismissal),openMethod:Pe(e=>e.openMethod),descriptionElementId:Pe(e=>e.descriptionElementId),titleElementId:Pe(e=>e.titleElementId),viewportElement:Pe(e=>e.viewportElement),role:Pe(e=>e.role)};class ZZ extends zA{constructor(t){super(YZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new dx,onOpenChange:void 0,onOpenChangeComplete:void 0},GZ)}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 YZ(e={}){return{...T7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function XZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=al(!0),x=!!b,S=zn(()=>p?.store??new ZZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;dV(()=>{n===void 0&&S.state.open===!1&&s===!0&&S.update({open:!0,activeTriggerId:y})}),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");KZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(uk.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const mk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=al(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=XZ,QZ=_.forwardRef(({className:e,...t},n)=>h.jsx(gx,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));QZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(pk,{children:[h.jsx(gx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(hk,{ref:s,className:ge("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})]}));hr.displayName="DialogContent";const pr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));pr.displayName="DialogHeader";const Nn=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));Nn.displayName="DialogFooter";const mr=_.forwardRef(({className:e,...t},n)=>h.jsx(mk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));WZ.displayName="DialogDescription";const yx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>h.jsxs("div",{ref:l,className:ge("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...a,children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s," items · Page ",t," of ",n]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Oe,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Oe,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));yx.displayName="Pagination";const JZ=_.forwardRef(({className:e,orientation:t="horizontal",...n},s)=>h.jsx("hr",{ref:s,"aria-orientation":t==="vertical"?"vertical":void 0,className:ge("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));JZ.displayName="Separator";const eY=mi("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"}}),tY=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(pk,{children:[h.jsx(gx,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(hk,{ref:i,className:ge(eY({side:t,className:e})),...s,children:n})]}));tY.displayName="SheetContent";const nY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));nY.displayName="SheetHeader";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));rY.displayName="SheetFooter";const sY=_.forwardRef(({className:e,...t},n)=>h.jsx(mk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));sY.displayName="SheetTitle";const oY=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));oY.displayName="SheetDescription";const iY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));iY.displayName="Skeleton";const aY=_.createContext(void 0);function vx(){const e=_.useContext(aY);if(e===void 0)throw new Error(yn(64));return e}let cY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const gk={tabActivationDirection:e=>({[cY.activationDirection]:e})},yk=_.createContext(void 0);function lY(){const e=_.useContext(yk);if(e===void 0)throw new Error(yn(65));return e}const uY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=vx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=lY(),A=br(f),N=_.useMemo(()=>({disabled:i,id:A,value:l}),[i,A,l]),{compositeProps:R,compositeRef:M,index:L}=ik({metadata:N}),j=l===g,k=_.useRef(!1);Le(()=>{if(k.current){k.current=!1;return}if(!(j&&L>-1&&S!==L))return;const V=C;if(V!=null){const U=Bo(Rt(V));if(U&&Ot(V,U))return}i||T(L)},[j,L,S,T,i,C]);const{getButtonProps:P,buttonRef:G}=el({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),z=_.useRef(!1),Q=_.useRef(!1);function Y(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(L>-1&&!i&&T(L),!i&&x&&(!z.current||z.current&&Q.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;z.current=!0;function U(){z.current=!1,Q.current=!1}(!V.button||V.button===0)&&(Q.current=!0,Rt(V.currentTarget).addEventListener("pointerup",U,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,G,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:A,onClick:Y,onFocus:ee,onPointerDown:D,[ak]:j?"":void 0,onKeyDownCapture(){k.current=!0}},p,P]})});let fY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const dY={...gk,...va},hY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=vx(),S=br(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=mx({metadata:w}),A=i===d,{mounted:N,transitionStatus:R,setMounted:M}=Ap(A),L=!N,j=p(i),k={hidden:L,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),G=zt("div",t,{state:k,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:L,id:S,role:"tabpanel",tabIndex:A?0:-1,inert:px(!A),[fY.index]:C},f],stateAttributesMapping:dY});return ba({open:A,ref:P,onComplete(){A||M(!1)}}),Le(()=>{if(!(L&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[L,l,i,S,b,x]),l||N?G:null}),pY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=vx(),[S,w]=_.useState(0),[T,C]=_.useState(null),A=mY(y,g,T,d),N=Ae((j,k)=>{if(j!==y){const P=A(j);k.activationDirection=P,p(j,k)}}),R={orientation:g,tabActivationDirection:x},M={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},L=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(yk.Provider,{value:L,children:h.jsx(ck,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:gk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Nu})})});function ZC(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 mY(e,t,n,s){const[i,a]=_.useState(null);return Le(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=ZC(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:p}=ZC(f,n);if(i==null)return a(t==="horizontal"?d:p),"none";if(t==="horizontal"){if(d<i)return a(d),"left";if(d>i)return a(d),"right"}else{if(p<i)return a(p),"up";if(p>i)return a(p),"down"}}}return"none"},[s,t,i,n,e])}const gY=_.forwardRef(({className:e,...t},n)=>h.jsx(pY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));gY.displayName="TabsList";const yY=mi("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"}}),vY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(uY,{ref:s,className:ge(yY({variant:t,className:e})),...n}));vY.displayName="TabsTrigger";const bY=_.forwardRef(({className:e,...t},n)=>h.jsx(hY,{ref:n,className:ge("outline-none",e),...t}));bY.displayName="TabsContent";const xY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));xY.displayName="Text";const SY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));SY.displayName="TextMuted";const _Y=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));_Y.displayName="TextCode";const wY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));wY.displayName="TextLabel";const EY=_.forwardRef(({className:e,...t},n)=>h.jsx("pre",{ref:n,className:ge("font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto",e),...t}));EY.displayName="CodeBlock";function xa(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 TY="console:instance-id";function Lt(){const[e,t]=xa(TY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Jn={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],storage:e=>["console","storage",e]};function Si(e,t){return e===0?!1:e??t}function rf(e,t){return t?{...e,instanceId:t}:e}function Sa(e){return encodeURIComponent(String(e))}function Ln(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function sf(e={}){const t=Vt(),{instanceId:n}=Lt(),s=e.instanceId??n,i=rf(e.partitionId?{partitionId:e.partitionId}:{},s);return Wn({queryKey:Jn.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Xu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,5e3)})}function CY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.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:Si(t.refetchIntervalMs,3e4)})}function RY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.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:Si(t.refetchIntervalMs,3e4)})}function NY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function jY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 AY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({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 Wn({queryKey:Jn.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function vk(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function kY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 OY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.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/${Sa(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 MY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 IY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 PY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=rf({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return Wn({queryKey:Jn.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Xu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:Si(t.refetchIntervalMs,1e4)})}function DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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 p=await fetch(Ln(t.serverUrl,`/console/clients/${Sa(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!p.ok)throw new Error("Failed to evict client");return p.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function zY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(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 LY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(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 UY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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(Ln(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 $Y(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.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(Ln(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 BY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(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 FY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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 HY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(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 qY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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 VY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(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"]})}})}function KY(e={}){const{config:t}=Dt();return Wn({queryKey:Jn.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),queryFn:async()=>{if(!t)throw new Error("Not connected");const n=new URLSearchParams;e.prefix&&n.set("prefix",e.prefix),e.cursor&&n.set("cursor",e.cursor),e.limit&&n.set("limit",String(e.limit));const s=await fetch(Ln(t.serverUrl,"/console/storage",n),{method:"GET",headers:{Authorization:`Bearer ${t.token}`}});if(!s.ok)throw new Error("Failed to list blobs");return s.json()},enabled:!!t,refetchInterval:Si(e.refetchIntervalMs,3e4)})}function GY(){const{config:e}=Dt(),t=_r();return is({mutationFn:async n=>{if(!e)throw new Error("Not connected");const s=encodeURIComponent(n),i=await fetch(Ln(e.serverUrl,`/console/storage/${s}`,new URLSearchParams),{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!i.ok)throw new Error("Failed to delete blob");return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["console","storage"]})}})}function ZY(){const{config:e}=Dt();return async t=>{if(!e)throw new Error("Not connected");const n=encodeURIComponent(t),s=await fetch(Ln(e.serverUrl,`/console/storage/${n}/download`,new URLSearchParams),{method:"GET",headers:{Authorization:`Bearer ${e.token}`}});if(!s.ok)throw new Error("Failed to download blob");const i=await s.blob(),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=t.split("/").pop()||t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}const YY="console:partition-id";function of(){const[e,t]=xa(YY,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const YC={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function af(){const[e,t]=xa("console:preferences",YC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(YC)}}}const XY=[{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"}],QY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],bx="syncular-console-root";function WY(e){e.classList.add(bx)}const JY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function eX(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function By(e,t){return e?t?`${e}${t}`:e:t||"/"}function tX({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:l}=Dt(),{preferences:f}=af(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Lt(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=of(),T=vr({select:P=>P.location.pathname}),{data:C}=sf({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),A=eX(e),N=_.useMemo(()=>JY.map(P=>({...P,id:By(A,P.suffix)})),[A]),R=By(A,""),M=By(A,"/config"),L=l?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(P=>P.suffix===""?T===R||T===`${R}/`:T.startsWith(P.id))?.id??R,k=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${bx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx(UZ,{brand:h.jsx(xc,{to:R,children:h.jsx(LZ,{label:"console"})}),center:h.jsx(kZ,{items:N,activeId:j,renderItem:(P,{active:G})=>h.jsx(xc,{to:P.id,children:h.jsx(lk,{active:G,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(mn,{variant:"flow",className:"hidden md:inline-flex px-2 py-1 text-[10px]",children:n}):null,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),h.jsx(Gn,{variant:"mono",value:p,onChange:P=>g(P.target.value),onBlur:P=>g(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:y,children:"All"}):null]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),h.jsx(Gn,{variant:"mono",value:x,onChange:P=>S(P.target.value),onBlur:P=>S(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Oe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(I8,{state:L}),h.jsx(xc,{to:M,children:h.jsx(Oe,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(Q8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:AZ,children:[h.jsx(Y8,{className:"h-3 w-3"}),"Go to app"]}):null]})}),h.jsx("main",{className:"flex-1 overflow-auto pb-[32px]",children:h.jsx("div",{className:"min-h-full",children:a||T===M?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(JN,{})},T):h.jsx(nX,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(Vj,{isLive:a,metrics:k,uptime:"--"})]})}function nX({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:s}){return h.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[h.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),h.jsxs("div",{className:"flex items-center gap-2",children:[t&&h.jsx(Oe,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(xc,{to:e,children:h.jsx(Oe,{variant:"link",children:"Configure connection"})})]})]})}const lo=MH({component:tX});function rX(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function sX(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Dt(),{instanceId:p}=Lt(),g=l??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,A]=_.useState(null),N=_.useRef(null),R=_.useRef(null),M=_.useRef(null),L=_.useRef(0),j=_.useRef(0),k=_.useRef(null),P=_.useRef(null),G=_.useCallback(()=>{b([]),k.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const z=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(rX()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,U=!1;const I=async()=>{if(!(B||U)){U=!0;try{const H=new URL(f.serverUrl,window.location.origin),W=H.pathname.endsWith("/")?H.pathname.slice(0,-1):H.pathname;H.pathname=`${W}/console/events`,H.search="",H.searchParams.set("limit",String(z)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const X=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!X.ok)throw new Error(`Live event polling failed (${X.status})`);const oe=await X.json(),de=(Array.isArray(oe.items)?oe.items:[]).filter(Me=>g?Me.instanceId===g:!0).sort((Me,_e)=>Me.eventId-_e.eventId),xe=P.current??-1,he=de.filter(Me=>Me.eventId>xe);if(he.length>0){const Me=he.map(ne=>({type:ne.eventType,timestamp:ne.createdAt,data:ne})).reverse();b(ne=>[...Me,...ne].slice(0,t));const _e=he[he.length-1];P.current=_e.eventId,k.current=_e.createdAt}else if(de.length>0){const Me=de[de.length-1];P.current=Math.max(P.current??-1,Me.eventId),k.current=Me.createdAt}A(null),S(!0),T("connected")}catch(H){B||(S(!1),T("disconnected"),A(H instanceof Error?H:new Error("Live event polling failed")))}finally{U=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const Y=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;L.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,L.current-1)),U=Math.floor(V*.2*Math.random()),I=V+U;R.current=setTimeout(()=>{R.current=null,B||q()},I)},K=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),Y();const V=(()=>{const I=new URL(f.serverUrl,window.location.origin);I.protocol=I.protocol==="https:"?"wss:":"ws:";const H=I.pathname.endsWith("/")?I.pathname.slice(0,-1):I.pathname;return I.pathname=`${H}/console/events/live`,I.search="",k.current&&I.searchParams.set("since",k.current),I.searchParams.set("replayLimit",String(z)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),U=new WebSocket(V);N.current=U,U.onopen=()=>{if(B){U.close();return}L.current=0,A(null),T("connecting"),S(!1);try{U.send(JSON.stringify({type:"auth",token:f.token}))}catch{U.close();return}ee(),M.current=setInterval(()=>{const I=N.current;if(!I||I.readyState!==WebSocket.OPEN)return;const H=j.current;!H||Date.now()-H<=s||(S(!1),T("stale"),I.close())},1e3)},U.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},U.onerror=()=>{B||A(new Error("WebSocket connection failed"))},U.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(K(),W==="connected"||W==="heartbeat"||W==="auth_required")return;if(W==="error"){const de=typeof H.message=="string"?H.message:"Live events authentication failed";A(new Error(de));return}const X={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&X.data.partitionId!==a||g&&X.data.instanceId!==g)return;const oe=Date.parse(k.current??""),se=Date.parse(X.timestamp);Number.isFinite(se)&&(!Number.isFinite(oe)||se>oe)&&(k.current=X.timestamp),b(de=>[X,...de].slice(0,t))}catch{}}};return q(),()=>{B=!0,Y(),ee(),N.current&&(N.current.close(),N.current=null),S(!1),T("disconnected")}},[n,d,f?.serverUrl,f?.token,t,a,g,i,s]),{events:y,isConnected:x,connectionState:w,error:C,clearEvents:G}}function oX(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({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 iX=_.createContext(null);function bk(){const[e,t]=xa("console:time-range","24h");return{range:e,setRange:t}}const aX=[{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 cX(e){const t=e.toLowerCase();for(const n of aX)if(t.includes(n.hint))return n.type;return"client"}function lX(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 uX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function fX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function dX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function hX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=uX(i,t),f=fX(i,l);return{id:dX(i.clientId,a),type:cX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:lX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const pX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function XC(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 mX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function gX(){const e=mp(),t=_.useMemo(()=>typeof window>"u"?"/stream":mX(window.location.pathname),[]),n=bk(),{range:s}=n,{preferences:i}=af(),{partitionId:a}=of(),l=i.refreshInterval*1e3,[f]=xa("console:alert-config",pX),[d,p]=_.useState("1h"),{data:g}=sf({refetchIntervalMs:l,partitionId:a}),{data:y}=CY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=RY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=NY({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=vk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=sX({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const z=y?.buckets??[];let Q=0,Y=0;for(const D of z)Q+=D.pushCount+D.pullCount,Y+=D.errorCount;const ee=Q>0?Y/Q*100:0;return{totalEvents:Q,errorRate:ee}},[y?.buckets]),A=_.useMemo(()=>S?.items?hX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=A.filter(z=>z.status!=="offline").length,R=A.filter(z=>z.status==="offline").length,M=_.useMemo(()=>g?[{label:"Ops (Range)",value:C.totalEvents,color:"flow"},{label:"P50 Latency",value:b?.push?.p50??0,unit:"ms",color:"healthy"},{label:"Error Rate",value:`${C.errorRate.toFixed(1)}%`,color:C.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,C.errorRate,C.totalEvents]),L=_.useMemo(()=>w.map(z=>({type:z.type.toUpperCase(),actor:z.data?.actorId??"",table:(z.data?.tables??[])[0]??"",time:XC(z.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const z=y?.buckets;if(!z?.length)return[];const Q=Math.max(...z.map(Y=>Math.max(Y.pushCount,Y.pullCount)),1);return z.map(Y=>({pushPercent:Q>0?Y.pushCount/Q*100:0,pullPercent:Q>0?Y.pullCount/Q*100:0}))},[y?.buckets]),k=_.useMemo(()=>{if(!b)return[];const z=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/z*100,pullBarPercent:b.pull.p50/z*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/z*100,pullBarPercent:b.pull.p90/z*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/z*100,pullBarPercent:b.pull.p99/z*100}]},[b]),P=_.useMemo(()=>x?.items?x.items.map(z=>({seq:z.commitSeq,actor:z.actorId,changes:z.changeCount,tables:(z.affectedTables??[]).join(", "),time:XC(z.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),G=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.useMemo(()=>{if(!f.enabled||!g)return[];const z=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&z.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&z.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&z.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),z},[f,g,b,C.errorRate]);return g?h.jsx(iX.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[B.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(In,{variant:"destructive",children:[h.jsx(nf,{children:"Threshold Exceeded"}),h.jsx(Pn,{children:B.map((z,Q)=>h.jsx("span",{className:"block",children:z},Q))})]})}),h.jsx(HA,{clients:A,totalNodes:A.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Jj,{items:M}),h.jsxs("div",{className:"flex",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Tj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(eA,{buckets:k,successRate:G})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Kj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(tA,{entries:L,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})})}function yX(){return h.jsx(gX,{})}function vX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(bX,{}),h.jsx(EX,{}),h.jsx(TX,{}),e]})}function bX(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Dt(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,A]=xa("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),k=j.get("server");let P=!1;if(k&&(d(k),j.delete("server"),P=!0),j.has("token")&&(j.delete("token"),P=!0),P){const G=j.toString(),B=G?`${window.location.pathname}?${G}`:window.location.pathname;window.history.replaceState({},"",B)}},[]),_.useEffect(()=>{t?.serverUrl&&d(t.serverUrl),t?.token&&g(t.token)},[t?.serverUrl,t?.token]),_.useEffect(()=>{T(null)},[]);const N=async()=>{e(),b(null);const j=await n({serverUrl:f.trim(),token:p.trim()},{persistOverride:!0});T(j?"Connected successfully and configuration saved.":"Failed to connect with the provided settings.")},R=()=>{s({clearSavedConfig:C}),C&&(d("/api"),g("")),T(C?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},M=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const k=f.trim(),P=p.trim();if(!k||!P)throw new Error("Missing server URL or token");if(!(await fetch(`${k}/console/stats`,{headers:{Authorization:`Bearer ${P}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-j))}catch{b(-1)}finally{S(!1)}},L=i??w??(y!==null?y<0?"Connection failed":`Connection successful (${y}ms latency)`:void 0);return h.jsx(Zj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:M,statusMessage:L,children:h.jsx("div",{className:"px-5 pb-5 -mt-2",children:h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),h.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),h.jsx(Ep,{checked:C,onCheckedChange:A})]})})})}const xX=1440*60*1e3;function QC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function Fy(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function SX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function _X(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*xX?"expiring":"active"}function wX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function EX(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[A,N]=_.useState(""),[R,M]=_.useState(null),[L,j]=_.useState([]),[k,P]=_.useState(null),[G,B]=_.useState(null),[z,Q]=_.useState(null),[Y,ee]=_.useState(null),[D,K]=_.useState(null),[q,V]=_.useState(null),[U,I]=_.useState(null),H=_.useMemo(()=>QC(i),[i]),W=H??14,X=_.useMemo(()=>QC(A),[A]),oe=A.trim().length>0,se=!oe||X!==null,de=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:xe,isLoading:he,error:Me}=$Y(de),_e=BY(),ne=HY(),pe=FY(),ae=qY(),we=VY();_.useEffect(()=>{const me=new Set((xe?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[xe?.items]);const ve=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await _e.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:oe?X??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},Se=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ye=async()=>{if(z)try{await pe.mutateAsync(z)}finally{Q(null)}},Ue=async()=>{if(L.length!==0)try{const me=await ne.mutateAsync({keyIds:L});P(me),j([])}catch{}},Ie=async()=>{if(Y)try{const me=await we.mutateAsync(Y.keyId);K({oldKeyId:Y.keyId,oldKeyName:Y.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await pe.mutateAsync(D.oldKeyId)}finally{K(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ae.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(he)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Pt,{size:"lg"})});if(Me)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",Me.message]})});const Xe=(xe?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Xe.length>0&&Xe.every(me=>L.includes(me)),We=L.length>0,He=(xe?.items??[]).filter(me=>L.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(tx,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Oe,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:L.length===0,children:["Revoke Selected (",L.length,")"]}),h.jsx(Oe,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[h.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[h.jsxs(ms,{children:[h.jsx(ts,{children:"Type filter"}),h.jsxs(hh,{value:[e],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="relay"||Te==="proxy"||Te==="admin")&&t(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Status filter"}),h.jsxs(hh,{value:[n],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="active"||Te==="revoked"||Te==="expiring")&&s(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"active",children:"active"}),h.jsx(Dr,{value:"revoked",children:"revoked"}),h.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(mc,{children:"Used when status filter is set to expiring."}),h.jsx(Gn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),H===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),xe?.items.length===0?h.jsx(Jb,{message:"No API keys match the current filters."}):h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx(Fv,{checked:Be,indeterminate:!Be&&We&&Xe.length>0,onCheckedChange:me=>{j(me?Xe:[])},"aria-label":"Select all active keys"})}),h.jsx(ht,{className:"w-[100px]",children:"NAME"}),h.jsx(ht,{className:"w-[55px]",children:"TYPE"}),h.jsx(ht,{className:"w-[90px]",children:"KEY PREFIX"}),h.jsx(ht,{className:"w-[80px]",children:"ACTOR"}),h.jsx(ht,{className:"w-[100px]",children:"SCOPES"}),h.jsx(ht,{className:"w-[120px]",children:"CREATED"}),h.jsx(ht,{className:"w-[120px]",children:"LAST USED"}),h.jsx(ht,{className:"w-[120px]",children:"EXPIRES"}),h.jsx(ht,{className:"flex-1",children:"STATUS"})]})}),h.jsx(sl,{children:(xe?.items??[]).map(me=>{const Te=_X(me,W);return h.jsxs(os,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx(Fv,{checked:L.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(lt=>lt!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(pt,{className:"w-[100px] font-medium",children:me.name}),h.jsx(pt,{className:"w-[55px]",children:h.jsx(mn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(pt,{className:"w-[90px]",children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(pt,{className:"w-[80px] text-neutral-500",children:me.actorId??"-"}),h.jsx(pt,{className:"w-[100px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:SX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Fy(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:wX(Te),children:Te})}),me.revokedAt===null&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{type:"button",onClick:()=>ee(me),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"stage"}),h.jsx("button",{type:"button",onClick:()=>V(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),h.jsx("button",{type:"button",onClick:()=>Q(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},me.keyId)})})]})]}),h.jsx($r,{open:l,onOpenChange:f,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Create API Key"})}),R?h.jsx(WC,{copiedKeyId:G,onClose:()=>{M(null),f(!1)},onCopy:Se,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Gn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Key type"}),h.jsxs(hh,{value:[b],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="relay"||Te==="proxy"||Te==="admin")&&x(Te)},children:[h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(mc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Gn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(mc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Gn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(ts,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(mc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Gn,{id:"api-key-expires-days",placeholder:"30",value:A,inputMode:"numeric",onChange:me=>N(me.target.value)}),se?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:ve,disabled:_e.isPending||!g||!se,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx($r,{open:d,onOpenChange:me=>{p(me),me||P(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Bulk Revoke API Keys"})}),k?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Requested ",k.requestedCount," keys. Revoked"," ",k.revokedCount,", already revoked"," ",k.alreadyRevokedCount,", not found"," ",k.notFoundCount,"."]})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:()=>{p(!1),P(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",He.slice(0,5).join(", "),He.length>5?` +${He.length-5} more`:""]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:Ue,disabled:ne.isPending||L.length===0,children:ne.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:Y!==null||D!==null,onOpenChange:()=>{ee(null),K(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Stage Rotate API Key"})}),D?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"default",children:h.jsxs(Pn,{children:["Replacement key created for ",D.oldKeyName,". The old key is still active until you revoke it."]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:D.secretKey}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>Se(D.secretKey),children:G===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>{K(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Oe,{variant:"destructive",onClick:Ee,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.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."})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ie,disabled:we.isPending||!Y,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:z!==null,onOpenChange:()=>Q(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>Q(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:ye,disabled:pe.isPending,children:pe.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||U!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),U?h.jsx(WC,{copiedKeyId:G,onClose:()=>I(null),onCopy:Se,secretKey:U,warning:"The previous key has been invalidated. Store this replacement securely."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Oe,{variant:"primary",onClick:Ve,disabled:ae.isPending,children:ae.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function TX(){const{preferences:e,updatePreference:t,resetPreferences:n}=af(),s=[{type:"filter",label:"Auto-refresh interval",options:XY.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:QY.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 h.jsx(nA,{rows:s,onResetDefaults:n})}function WC({copiedKeyId:e,onClose:t,onCopy:n,secretKey:s,warning:i}){return h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:i})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:s}),h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"primary",onClick:t,children:"Done"})})]})}function CX(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 RX(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 NX(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 jX(e,t,n){return{id:e.clientId,type:CX(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:RX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:NX(e.updatedAt,n)}}function AX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=af(),{partitionId:l}=of(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=sf({refetchIntervalMs:d,partitionId:l}),{data:y,isLoading:b,error:x}=vk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=DY(),w=Math.ceil((y?.total??0)/f),T=p?.maxCommitSeq??0;_.useEffect(()=>{n(1)},[]);const C=async()=>{if(s)try{await S.mutateAsync({clientId:s,partitionId:l})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(x)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",x.message]})});const A=(y?.items??[]).map(N=>jX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[A.length>0&&h.jsx(sA,{clients:A,headSeq:T}),A.length===0?e??h.jsx(iV,{children:h.jsx(Jb,{message:"No clients yet"})}):h.jsx(Qj,{clients:A,headSeq:T,onEvict:N=>{const R=y?.items.find(M=>M.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(yx,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx($r,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Evict Client"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",h.jsxs("span",{className:"font-mono text-white",children:[s?.slice(0,12),"..."]}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const kX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function OX(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 MX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function IX(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function JC(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function PX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function DX(e){const t=JC(e.requestPayload),n=JC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=PX(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 zX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function LX(){const{partitionId:e}=of();return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[h.jsx(UX,{}),h.jsx(qX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx($X,{partitionId:e}),h.jsx(BX,{partitionId:e}),h.jsx(FX,{partitionId:e})]}),h.jsx(HX,{partitionId:e})]})}function UX(){const{data:e,isLoading:t,error:n}=MY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(n)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.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?OX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Wj,{handlers:s,tableCount:e?.items.length??0})}function $X({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),{data:f,isLoading:d,refetch:p}=IY({enabled:!1}),g=zY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{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 h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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:y}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Pruning Complete"}),h.jsxs(Pn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(In,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Pn,{children:f.commitsToDelete>0?h.jsxs(h.Fragment,{children:["This will delete"," ",h.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",h.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[h.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),h.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),h.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[h.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),h.jsx(mn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function BX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=sf({partitionId:e}),f=LY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});const g=[{label:"Total changes",value:a?.changeCount??0},{label:"Total commits",value:a?.commitCount??0}];return h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Compaction Complete"}),h.jsxs(Pn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{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."})})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Oe,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function FX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=UY(),b=MX(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 y.mutateAsync({tables:b,partitionId:a.trim()||void 0});d(T)};return h.jsxs(h.Fragment,{children:[h.jsx(Tp,{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}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(In,{variant:"default",children:[h.jsx(nf,{children:"Notification Sent"}),h.jsxs(Pn,{children:["Created synthetic commit"," ",h.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",h.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",h.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),p?h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:p})}):null,h.jsxs(ms,{children:[h.jsx(ts,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(mc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ms,{children:[h.jsx(ts,{children:"Partition ID (optional)"}),h.jsx(Gn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Oe,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function HX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=PY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(tx,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Oe,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Oe,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Oe,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Oe,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Oe,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:i?h.jsx("div",{className:"flex items-center justify-center py-10",children:h.jsx(Pt,{size:"lg"})}):a?h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Failed to load operation audit events: ",a.message]})}):(s?.items.length??0)===0?h.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Time"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"User"}),h.jsx(ht,{children:"Target"}),h.jsx(ht,{children:"Result"})]})}),h.jsx(sl,{children:(s?.items??[]).map((l,f)=>h.jsxs(os,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:zX(l.createdAt)}),h.jsx(pt,{children:h.jsx(mn,{variant:"ghost",children:IX(l.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:DX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function qX(){const[e,t]=xa("console:alert-config",kX),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 h.jsx(qj,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function VX(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`}function KX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function GX(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[l,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=KY({prefix:n,cursor:i,limit:100}),x=GY(),S=ZY();function w(){const M=e.trim();s(M.length>0?M:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(M=>[...M,i??""]),a(g.cursor))}function A(){f(M=>{const L=[...M],j=L.pop();return a(j&&j.length>0?j:void 0),L})}function N(){d&&x.mutate(d,{onSuccess:()=>p(null)})}if(y)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})})});if(b)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger font-mono text-[11px]",children:["Failed to load storage items: ",b.message]})})});const R=g?.items??[];return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsx(tx,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Gn,{placeholder:"Prefix filter...",value:e,onChange:M=>t(M.target.value),onKeyDown:M=>{M.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Oe,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Jb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(nl,{children:[h.jsx(rl,{children:h.jsxs(os,{children:[h.jsx(ht,{children:"Key"}),h.jsx(ht,{children:"Size"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Uploaded"}),h.jsx(ht,{children:"Actions"})]})}),h.jsx(sl,{children:R.map(M=>h.jsxs(os,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:VX(M.size)}),h.jsx(pt,{children:M.httpMetadata?.contentType?h.jsx(mn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:KX(M.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>p(M.key),children:"Delete"})]})})]},M.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Oe,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:A,children:"Previous"}),h.jsx(Oe,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx($r,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Delete Storage Item"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to delete"," ",h.jsx("span",{className:"font-mono text-white",children:d}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This action cannot be undone."})]}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const ZX={};function au(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 YX(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 XX(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 Zd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function QX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function WX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function JX(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function xx({initialSelectedEntryId:e}={}){const{preferences:t}=af(),{partitionId:n}=of(),{range:s,setRange:i}=bk(),a=t.pageSize,l=t.refreshInterval*1e3,f=ZX?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[d,p]=_.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[g,y]=_.useState("all"),[b,x]=_.useState("all"),[S,w]=_.useState(""),[T,C]=_.useState(1),[A,N]=_.useState(!1),[R,M]=_.useState(e??null),L=_.useRef(!1),j=_.useMemo(()=>YX(S),[S]),k=_.useMemo(()=>new Date(Date.now()-XX(s)).toISOString(),[s]),{data:P,isLoading:G,refetch:B}=AY({limit:a,offset:(T-1)*a,...n?{partitionId:n}:{},view:d,...d!=="commits"&&g!=="all"?{eventType:g}:{},...d!=="commits"&&b!=="all"?{outcome:b}:{},...j.actorId?{actorId:j.actorId}:{},...j.clientId?{clientId:j.clientId}:{},...j.requestId?{requestId:j.requestId}:{},...j.traceId?{traceId:j.traceId}:{},...j.table?{table:j.table}:{},...j.search?{search:j.search}:{},from:k},{refetchIntervalMs:l}),z=oX(),Q=R?.startsWith("#")?R.slice(1):void 0,Y=R?.startsWith("E")?R.slice(1):void 0,ee=Q&&Q!=="?"?Q:void 0,D=Y&&Y!=="?"?Y:void 0,{data:K,isLoading:q,error:V}=jY(ee,{enabled:ee!==void 0,partitionId:n}),{data:U,isLoading:I,error:H}=kY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:X,error:oe}=OY(D,{enabled:D!==void 0&&!!U?.payloadRef,partitionId:n}),se=_.useMemo(()=>JX(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!L.current){L.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const xe=_.useMemo(()=>(P?.items??[]).map(we=>{const ve=we.instanceId??we.commit?.instanceId??we.event?.instanceId,Se=ve?`[${ve}] `:"";if(we.type==="commit"&&we.commit){const Ue=we.commit;return{type:"commit",id:QX(Ue,ve),outcome:"--",duration:"--",actor:Ue.actorId,client:Ue.clientId,detail:`${Se}${Ue.changeCount} chg | ${(Ue.affectedTables??[]).join(", ")}`,time:au(we.timestamp,t.timeFormat)}}const ye=we.event;return ye?{type:ye.eventType,id:WX(ye,ve),outcome:ye.outcome,duration:`${ye.durationMs}ms`,actor:ye.actorId,client:ye.clientId,detail:`${Se}${(ye.tables??[]).join(", ")||"--"}`,time:au(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:au(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),he=P?.total??0,Me=Math.max(1,Math.ceil(he/a)),_e=G,ne=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ae=>{p(ae),ae==="commits"&&(y("all"),x("all")),C(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:ae=>{i(ae),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ae=>{y(ae),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ae=>{x(ae),C(1)}}];function pe(){z.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&xe.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(rA,{entries:xe,selectedEntryId:R,onEntryClick:ae=>M(ae.id),filterBar:h.jsx(Yj,{groups:ne,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Oe,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Oe,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Oe,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(yx,{page:T,totalPages:Me,totalItems:he,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ae=>{ae||M(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:ee!==void 0?`Commit #${ee}`:D!==void 0?`Event E${D}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:q||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):V||H?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):K?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:K.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:K.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:K.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(K.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:K.changeCount})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:K.affectedTables.join(", ")||"--"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),K.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):K.changes.map(ae=>h.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[h.jsxs("span",{className:"text-neutral-300",children:[ae.table," | ",ae.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ae.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ae.rowId,ae.rowVersion!==null?` | version: ${ae.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(ae.rowJson)})]},ae.changeId))]})]}):U?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Type"}),h.jsx("div",{className:"text-neutral-100",children:U.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:U.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:U.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:U.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:U.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:U.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:U.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:U.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:U.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[U.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:U.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:U.traceId??"--"}),se&&h.jsx("a",{href:se,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Span ID"}),h.jsx("div",{className:"text-neutral-100",children:U.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:U.commitSeq??"--"}),U.commitSeq!==null&&h.jsx(Oe,{variant:"ghost",size:"sm",onClick:()=>M(`#${U.instanceId?`${U.instanceId}:`:""}${U.commitSeq}`),children:"Open linked commit"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),h.jsx("div",{className:"text-neutral-100",children:U.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:U.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:U.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(U.createdAt,t.timeFormat)})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:U.tables.join(", ")||"--"})]}),U.scopesSummary&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(U.scopesSummary)})]}),U.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),X?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):oe?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):W?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(W.requestPayload)}),h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Zd(W.responsePayload)})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),U.errorMessage&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),h.jsx("p",{className:"font-mono text-[11px] text-offline",children:U.errorMessage})]})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),h.jsx(Nn,{children:h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:A,onOpenChange:ae=>{ae||N(!1)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Clear all events"})}),h.jsx("div",{className:"p-4",children:h.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?"})}),h.jsxs(Nn,{children:[h.jsx(Oe,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Oe,{variant:"destructive",size:"sm",onClick:pe,disabled:z.isPending,children:z.isPending?"Clearing...":"Clear all"})]})]})})]})}const eQ=ao({getParentRoute:()=>lo,path:"/config",component:vX}),tQ=ao({getParentRoute:()=>lo,path:"/fleet",component:AX}),nQ=ao({getParentRoute:()=>lo,path:"/",component:yX});function rQ(){const{seq:e}=xk.useParams();return h.jsx(xx,{initialSelectedEntryId:`#${e}`})}const xk=ao({getParentRoute:()=>lo,path:"/investigate/commit/$seq",component:rQ});function sQ(){const{id:e}=Sk.useParams();return h.jsx(xx,{initialSelectedEntryId:`E${e}`})}const Sk=ao({getParentRoute:()=>lo,path:"/investigate/event/$id",component:sQ}),oQ=ao({getParentRoute:()=>lo,path:"/ops",component:LX}),iQ=ao({getParentRoute:()=>lo,path:"/storage",component:GX}),aQ=ao({getParentRoute:()=>lo,path:"/stream",component:xx}),cQ=lo.addChildren([nQ,aQ,xk,Sk,tQ,oQ,iQ,eQ]),lQ="syncular-console-basepath",uQ="syncular-console-server-url",fQ="syncular-console-token";function dQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hv(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return dQ(n)}function _k(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function hQ(){return _k(Hv(lQ))}function pQ(){const e=Hv(uQ),t=Hv(fQ);return!e||!t?null:{serverUrl:e,token:t}}function mQ(){return new P6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function gQ(e){return _k(e??hQ())}function yQ(e){const[t]=_.useState(()=>mQ()),n=_.useMemo(()=>BH({routeTree:cQ,basepath:gQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?pQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(D6,{client:t,children:h.jsx(sq,{defaultConfig:s,autoConnect:i,storageMode:e.storageMode,children:h.jsx(qH,{router:n})})})}function vQ(e){return h.jsx("div",{className:bx,children:h.jsx(yQ,{...e})})}function bQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function xQ(e,t={}){const n=bQ(e);WY(n);const s=f6.createRoot(n),i=h.jsx(vQ,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var SQ={};const _Q="syncular-sentry-dsn",wQ="syncular-sentry-environment",EQ="syncular-sentry-release";function gu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Hy(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return gu(t)}function qy(e){if(!(typeof process>"u"))return gu(SQ[e])}function Vy(e){for(const t of e)if(t)return t}function TQ(){const e=Vy([gu(globalThis.__SYNCULAR_SENTRY_DSN__),Hy(_Q),qy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Vy([gu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Hy(wQ),qy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Vy([gu(globalThis.__SYNCULAR_SENTRY_RELEASE__),Hy(EQ),qy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const eR=TQ();eR&&n6(eR);xQ("#root");
|