tmex-cli 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime/server.js +42 -2
- package/package.json +1 -1
- package/resources/fe-dist/assets/index-CJ--lZZc.css +32 -0
- package/resources/fe-dist/assets/index-NgVYQDSW.js +333 -0
- package/resources/fe-dist/assets/{index-DNlxXBdI.js.map → index-NgVYQDSW.js.map} +1 -1
- package/resources/fe-dist/assets/tmex-DcyZpuP8.png +0 -0
- package/resources/fe-dist/index.html +10 -3
- package/resources/fe-dist/assets/index-D7lUHQCR.css +0 -32
- package/resources/fe-dist/assets/index-DNlxXBdI.js +0 -333
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
var Fw=Object.defineProperty;var b_=i=>{throw TypeError(i)};var qw=(i,r,s)=>r in i?Fw(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s;var zt=(i,r,s)=>qw(i,typeof r!="symbol"?r+"":r,s),Yd=(i,r,s)=>r.has(i)||b_("Cannot "+s);var ee=(i,r,s)=>(Yd(i,r,"read from private field"),s?s.call(i):r.get(i)),$e=(i,r,s)=>r.has(i)?b_("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,s),Me=(i,r,s,a)=>(Yd(i,r,"write to private field"),a?a.call(i,s):r.set(i,s),s),it=(i,r,s)=>(Yd(i,r,"access private method"),s);var $c=(i,r,s,a)=>({set _(c){Me(i,r,c,s)},get _(){return ee(i,r,a)}});function $w(i,r){for(var s=0;s<r.length;s++){const a=r[s];if(typeof a!="string"&&!Array.isArray(a)){for(const c in a)if(c!=="default"&&!(c in i)){const f=Object.getOwnPropertyDescriptor(a,c);f&&Object.defineProperty(i,c,f.get?f:{enumerable:!0,get:()=>a[c]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))a(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const v of f.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&a(v)}).observe(document,{childList:!0,subtree:!0});function s(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(c){if(c.ep)return;c.ep=!0;const f=s(c);fetch(c.href,f)}})();function Ay(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Gd={exports:{}},Xo={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var S_;function Kw(){if(S_)return Xo;S_=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(a,c,f){var v=null;if(f!==void 0&&(v=""+f),c.key!==void 0&&(v=""+c.key),"key"in c){f={};for(var l in c)l!=="key"&&(f[l]=c[l])}else f=c;return c=f.ref,{$$typeof:i,type:a,key:v,ref:c!==void 0?c:null,props:f}}return Xo.Fragment=r,Xo.jsx=s,Xo.jsxs=s,Xo}var w_;function Vw(){return w_||(w_=1,Gd.exports=Kw()),Gd.exports}var H=Vw(),ro=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ww={setTimeout:(i,r)=>setTimeout(i,r),clearTimeout:i=>clearTimeout(i),setInterval:(i,r)=>setInterval(i,r),clearInterval:i=>clearInterval(i)},ts,om,yy,Yw=(yy=class{constructor(){$e(this,ts,Ww);$e(this,om,!1)}setTimeoutProvider(i){Me(this,ts,i)}setTimeout(i,r){return ee(this,ts).setTimeout(i,r)}clearTimeout(i){ee(this,ts).clearTimeout(i)}setInterval(i,r){return ee(this,ts).setInterval(i,r)}clearInterval(i){ee(this,ts).clearInterval(i)}},ts=new WeakMap,om=new WeakMap,yy),Hs=new Yw;function Gw(i){setTimeout(i,0)}var Gs=typeof window>"u"||"Deno"in globalThis;function Bi(){}function Xw(i,r){return typeof i=="function"?i(r):i}function Ef(i){return typeof i=="number"&&i>=0&&i!==1/0}function Ly(i,r){return Math.max(i+(r||0)-Date.now(),0)}function ds(i,r){return typeof i=="function"?i(r):i}function vr(i,r){return typeof i=="function"?i(r):i}function C_(i,r){const{type:s="all",exact:a,fetchStatus:c,predicate:f,queryKey:v,stale:l}=i;if(v){if(a){if(r.queryHash!==lm(v,r.options))return!1}else if(!ml(r.queryKey,v))return!1}if(s!=="all"){const u=r.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof l=="boolean"&&r.isStale()!==l||c&&c!==r.state.fetchStatus||f&&!f(r))}function E_(i,r){const{exact:s,status:a,predicate:c,mutationKey:f}=i;if(f){if(!r.options.mutationKey)return!1;if(s){if(Xs(r.options.mutationKey)!==Xs(f))return!1}else if(!ml(r.options.mutationKey,f))return!1}return!(a&&r.state.status!==a||c&&!c(r))}function lm(i,r){return((r==null?void 0:r.queryKeyHashFn)||Xs)(i)}function Xs(i){return JSON.stringify(i,(r,s)=>xf(s)?Object.keys(s).sort().reduce((a,c)=>(a[c]=s[c],a),{}):s)}function ml(i,r){return i===r?!0:typeof i!=typeof r?!1:i&&r&&typeof i=="object"&&typeof r=="object"?Object.keys(r).every(s=>ml(i[s],r[s])):!1}var Qw=Object.prototype.hasOwnProperty;function My(i,r,s=0){if(i===r)return i;if(s>500)return r;const a=x_(i)&&x_(r);if(!a&&!(xf(i)&&xf(r)))return r;const f=(a?i:Object.keys(i)).length,v=a?r:Object.keys(r),l=v.length,u=a?new Array(l):{};let h=0;for(let b=0;b<l;b++){const d=a?b:v[b],w=i[d],C=r[d];if(w===C){u[d]=w,(a?b<f:Qw.call(i,d))&&h++;continue}if(w===null||C===null||typeof w!="object"||typeof C!="object"){u[d]=C;continue}const R=My(w,C,s+1);u[d]=R,R===w&&h++}return f===l&&h===f?i:u}function hu(i,r){if(!r||Object.keys(i).length!==Object.keys(r).length)return!1;for(const s in i)if(i[s]!==r[s])return!1;return!0}function x_(i){return Array.isArray(i)&&i.length===Object.keys(i).length}function xf(i){if(!R_(i))return!1;const r=i.constructor;if(r===void 0)return!0;const s=r.prototype;return!(!R_(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(i)!==Object.prototype)}function R_(i){return Object.prototype.toString.call(i)==="[object Object]"}function Zw(i){return new Promise(r=>{Hs.setTimeout(r,i)})}function Rf(i,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(i,r):s.structuralSharing!==!1?My(i,r):r}function Jw(i,r,s=0){const a=[...i,r];return s&&a.length>s?a.slice(1):a}function eC(i,r,s=0){const a=[r,...i];return s&&a.length>s?a.slice(0,-1):a}var cm=Symbol();function ky(i,r){return!i.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!i.queryFn||i.queryFn===cm?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function um(i,r){return typeof i=="function"?i(...r):!!i}function tC(i,r,s){let a=!1,c;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(c??(c=r()),a||(a=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),i}var Is,is,Fa,by,iC=(by=class extends ro{constructor(){super();$e(this,Is);$e(this,is);$e(this,Fa);Me(this,Fa,r=>{if(!Gs&&window.addEventListener){const s=()=>r();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){ee(this,is)||this.setEventListener(ee(this,Fa))}onUnsubscribe(){var r;this.hasListeners()||((r=ee(this,is))==null||r.call(this),Me(this,is,void 0))}setEventListener(r){var s;Me(this,Fa,r),(s=ee(this,is))==null||s.call(this),Me(this,is,r(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(r){ee(this,Is)!==r&&(Me(this,Is,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(s=>{s(r)})}isFocused(){var r;return typeof ee(this,Is)=="boolean"?ee(this,Is):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},Is=new WeakMap,is=new WeakMap,Fa=new WeakMap,by),hm=new iC;function Tf(){let i,r;const s=new Promise((c,f)=>{i=c,r=f});s.status="pending",s.catch(()=>{});function a(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{a({status:"fulfilled",value:c}),i(c)},s.reject=c=>{a({status:"rejected",reason:c}),r(c)},s}var rC=Gw;function nC(){let i=[],r=0,s=l=>{l()},a=l=>{l()},c=rC;const f=l=>{r?i.push(l):c(()=>{s(l)})},v=()=>{const l=i;i=[],l.length&&c(()=>{a(()=>{l.forEach(u=>{s(u)})})})};return{batch:l=>{let u;r++;try{u=l()}finally{r--,r||v()}return u},batchCalls:l=>(...u)=>{f(()=>{l(...u)})},schedule:f,setNotifyFunction:l=>{s=l},setBatchNotifyFunction:l=>{a=l},setScheduler:l=>{c=l}}}var mi=nC(),qa,rs,$a,Sy,sC=(Sy=class extends ro{constructor(){super();$e(this,qa,!0);$e(this,rs);$e(this,$a);Me(this,$a,r=>{if(!Gs&&window.addEventListener){const s=()=>r(!0),a=()=>r(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",a)}}})}onSubscribe(){ee(this,rs)||this.setEventListener(ee(this,$a))}onUnsubscribe(){var r;this.hasListeners()||((r=ee(this,rs))==null||r.call(this),Me(this,rs,void 0))}setEventListener(r){var s;Me(this,$a,r),(s=ee(this,rs))==null||s.call(this),Me(this,rs,r(this.setOnline.bind(this)))}setOnline(r){ee(this,qa)!==r&&(Me(this,qa,r),this.listeners.forEach(a=>{a(r)}))}isOnline(){return ee(this,qa)}},qa=new WeakMap,rs=new WeakMap,$a=new WeakMap,Sy),du=new sC;function aC(i){return Math.min(1e3*2**i,3e4)}function By(i){return(i??"online")==="online"?du.isOnline():!0}var Df=class extends Error{constructor(i){super("CancelledError"),this.revert=i==null?void 0:i.revert,this.silent=i==null?void 0:i.silent}};function Ny(i){let r=!1,s=0,a;const c=Tf(),f=()=>c.status!=="pending",v=D=>{var m;if(!f()){const g=new Df(D);w(g),(m=i.onCancel)==null||m.call(i,g)}},l=()=>{r=!0},u=()=>{r=!1},h=()=>hm.isFocused()&&(i.networkMode==="always"||du.isOnline())&&i.canRun(),b=()=>By(i.networkMode)&&i.canRun(),d=D=>{f()||(a==null||a(),c.resolve(D))},w=D=>{f()||(a==null||a(),c.reject(D))},C=()=>new Promise(D=>{var m;a=g=>{(f()||h())&&D(g)},(m=i.onPause)==null||m.call(i)}).then(()=>{var D;a=void 0,f()||(D=i.onContinue)==null||D.call(i)}),R=()=>{if(f())return;let D;const m=s===0?i.initialPromise:void 0;try{D=m??i.fn()}catch(g){D=Promise.reject(g)}Promise.resolve(D).then(d).catch(g=>{var A;if(f())return;const _=i.retry??(Gs?0:3),y=i.retryDelay??aC,E=typeof y=="function"?y(s,g):y,T=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,g);if(r||!T){w(g);return}s++,(A=i.onFail)==null||A.call(i,s,g),Zw(E).then(()=>h()?void 0:C()).then(()=>{r?w(g):R()})})};return{promise:c,status:()=>c.status,cancel:v,continue:()=>(a==null||a(),c),cancelRetry:l,continueRetry:u,canStart:b,start:()=>(b()?R():C().then(R),c)}}var Us,wy,jy=(wy=class{constructor(){$e(this,Us)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ef(this.gcTime)&&Me(this,Us,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Gs?1/0:300*1e3))}clearGcTimeout(){ee(this,Us)&&(Hs.clearTimeout(ee(this,Us)),Me(this,Us,void 0))}},Us=new WeakMap,wy),Fs,Ka,pr,qs,vi,bl,$s,Ar,vn,Cy,oC=(Cy=class extends jy{constructor(r){super();$e(this,Ar);$e(this,Fs);$e(this,Ka);$e(this,pr);$e(this,qs);$e(this,vi);$e(this,bl);$e(this,$s);Me(this,$s,!1),Me(this,bl,r.defaultOptions),this.setOptions(r.options),this.observers=[],Me(this,qs,r.client),Me(this,pr,ee(this,qs).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,Me(this,Fs,D_(this.options)),this.state=r.state??ee(this,Fs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=ee(this,vi))==null?void 0:r.promise}setOptions(r){if(this.options={...ee(this,bl),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=D_(this.options);s.data!==void 0&&(this.setState(T_(s.data,s.dataUpdatedAt)),Me(this,Fs,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ee(this,pr).remove(this)}setData(r,s){const a=Rf(this.state.data,r,this.options);return it(this,Ar,vn).call(this,{data:a,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),a}setState(r,s){it(this,Ar,vn).call(this,{type:"setState",state:r,setStateOptions:s})}cancel(r){var a,c;const s=(a=ee(this,vi))==null?void 0:a.promise;return(c=ee(this,vi))==null||c.cancel(r),s?s.then(Bi).catch(Bi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,Fs))}isActive(){return this.observers.some(r=>vr(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>ds(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Ly(this.state.dataUpdatedAt,r)}onFocus(){var s;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(s=ee(this,vi))==null||s.continue()}onOnline(){var s;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(s=ee(this,vi))==null||s.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),ee(this,pr).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(s=>s!==r),this.observers.length||(ee(this,vi)&&(ee(this,$s)?ee(this,vi).cancel({revert:!0}):ee(this,vi).cancelRetry()),this.scheduleGc()),ee(this,pr).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||it(this,Ar,vn).call(this,{type:"invalidate"})}async fetch(r,s){var u,h,b,d,w,C,R,D,m,g,_,y;if(this.state.fetchStatus!=="idle"&&((u=ee(this,vi))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(ee(this,vi))return ee(this,vi).continueRetry(),ee(this,vi).promise}if(r&&this.setOptions(r),!this.options.queryFn){const E=this.observers.find(T=>T.options.queryFn);E&&this.setOptions(E.options)}const a=new AbortController,c=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Me(this,$s,!0),a.signal)})},f=()=>{const E=ky(this.options,s),A=(()=>{const O={client:ee(this,qs),queryKey:this.queryKey,meta:this.meta};return c(O),O})();return Me(this,$s,!1),this.options.persister?this.options.persister(E,A,this):E(A)},l=(()=>{const E={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:ee(this,qs),state:this.state,fetchFn:f};return c(E),E})();(h=this.options.behavior)==null||h.onFetch(l,this),Me(this,Ka,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=l.fetchOptions)==null?void 0:b.meta))&&it(this,Ar,vn).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Me(this,vi,Ny({initialPromise:s==null?void 0:s.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof Df&&E.revert&&this.setState({...ee(this,Ka),fetchStatus:"idle"}),a.abort()},onFail:(E,T)=>{it(this,Ar,vn).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{it(this,Ar,vn).call(this,{type:"pause"})},onContinue:()=>{it(this,Ar,vn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const E=await ee(this,vi).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(C=(w=ee(this,pr).config).onSuccess)==null||C.call(w,E,this),(D=(R=ee(this,pr).config).onSettled)==null||D.call(R,E,this.state.error,this),E}catch(E){if(E instanceof Df){if(E.silent)return ee(this,vi).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw it(this,Ar,vn).call(this,{type:"error",error:E}),(g=(m=ee(this,pr).config).onError)==null||g.call(m,E,this),(y=(_=ee(this,pr).config).onSettled)==null||y.call(_,this.state.data,E,this),E}finally{this.scheduleGc()}}},Fs=new WeakMap,Ka=new WeakMap,pr=new WeakMap,qs=new WeakMap,vi=new WeakMap,bl=new WeakMap,$s=new WeakMap,Ar=new WeakSet,vn=function(r){const s=a=>{switch(r.type){case"failed":return{...a,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Hy(a.data,this.options),fetchMeta:r.meta??null};case"success":const c={...a,...T_(r.data,r.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,Ka,r.manual?c:void 0),c;case"error":const f=r.error;return{...a,error:f,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...r.state}}};this.state=s(this.state),mi.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),ee(this,pr).notify({query:this,type:"updated",action:r})})},Cy);function Hy(i,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:By(r.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function T_(i,r){return{data:i,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function D_(i){const r=typeof i.initialData=="function"?i.initialData():i.initialData,s=r!==void 0,a=s?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var $i,gt,Sl,Mi,Ks,Va,bn,ns,wl,Wa,Ya,Vs,Ws,ss,Ga,Rt,rl,Of,Af,Lf,Mf,kf,Bf,Nf,Py,Ey,lC=(Ey=class extends ro{constructor(r,s){super();$e(this,Rt);$e(this,$i);$e(this,gt);$e(this,Sl);$e(this,Mi);$e(this,Ks);$e(this,Va);$e(this,bn);$e(this,ns);$e(this,wl);$e(this,Wa);$e(this,Ya);$e(this,Vs);$e(this,Ws);$e(this,ss);$e(this,Ga,new Set);this.options=s,Me(this,$i,r),Me(this,ns,null),Me(this,bn,Tf()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,gt).addObserver(this),O_(ee(this,gt),this.options)?it(this,Rt,rl).call(this):this.updateResult(),it(this,Rt,Mf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jf(ee(this,gt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jf(ee(this,gt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,it(this,Rt,kf).call(this),it(this,Rt,Bf).call(this),ee(this,gt).removeObserver(this)}setOptions(r){const s=this.options,a=ee(this,gt);if(this.options=ee(this,$i).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,ee(this,gt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");it(this,Rt,Nf).call(this),ee(this,gt).setOptions(this.options),s._defaulted&&!hu(this.options,s)&&ee(this,$i).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,gt),observer:this});const c=this.hasListeners();c&&A_(ee(this,gt),a,this.options,s)&&it(this,Rt,rl).call(this),this.updateResult(),c&&(ee(this,gt)!==a||vr(this.options.enabled,ee(this,gt))!==vr(s.enabled,ee(this,gt))||ds(this.options.staleTime,ee(this,gt))!==ds(s.staleTime,ee(this,gt)))&&it(this,Rt,Of).call(this);const f=it(this,Rt,Af).call(this);c&&(ee(this,gt)!==a||vr(this.options.enabled,ee(this,gt))!==vr(s.enabled,ee(this,gt))||f!==ee(this,ss))&&it(this,Rt,Lf).call(this,f)}getOptimisticResult(r){const s=ee(this,$i).getQueryCache().build(ee(this,$i),r),a=this.createResult(s,r);return uC(this,a)&&(Me(this,Mi,a),Me(this,Va,this.options),Me(this,Ks,ee(this,gt).state)),a}getCurrentResult(){return ee(this,Mi)}trackResult(r,s){return new Proxy(r,{get:(a,c)=>(this.trackProp(c),s==null||s(c),c==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ee(this,bn).status==="pending"&&ee(this,bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,c))})}trackProp(r){ee(this,Ga).add(r)}getCurrentQuery(){return ee(this,gt)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const s=ee(this,$i).defaultQueryOptions(r),a=ee(this,$i).getQueryCache().build(ee(this,$i),s);return a.fetch().then(()=>this.createResult(a,s))}fetch(r){return it(this,Rt,rl).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Mi)))}createResult(r,s){var L;const a=ee(this,gt),c=this.options,f=ee(this,Mi),v=ee(this,Ks),l=ee(this,Va),h=r!==a?r.state:ee(this,Sl),{state:b}=r;let d={...b},w=!1,C;if(s._optimisticResults){const I=this.hasListeners(),V=!I&&O_(r,s),P=I&&A_(r,a,s,c);(V||P)&&(d={...d,...Hy(b.data,r.options)}),s._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:R,errorUpdatedAt:D,status:m}=d;C=d.data;let g=!1;if(s.placeholderData!==void 0&&C===void 0&&m==="pending"){let I;f!=null&&f.isPlaceholderData&&s.placeholderData===(l==null?void 0:l.placeholderData)?(I=f.data,g=!0):I=typeof s.placeholderData=="function"?s.placeholderData((L=ee(this,Ya))==null?void 0:L.state.data,ee(this,Ya)):s.placeholderData,I!==void 0&&(m="success",C=Rf(f==null?void 0:f.data,I,s),w=!0)}if(s.select&&C!==void 0&&!g)if(f&&C===(v==null?void 0:v.data)&&s.select===ee(this,wl))C=ee(this,Wa);else try{Me(this,wl,s.select),C=s.select(C),C=Rf(f==null?void 0:f.data,C,s),Me(this,Wa,C),Me(this,ns,null)}catch(I){Me(this,ns,I)}ee(this,ns)&&(R=ee(this,ns),C=ee(this,Wa),D=Date.now(),m="error");const _=d.fetchStatus==="fetching",y=m==="pending",E=m==="error",T=y&&_,A=C!==void 0,x={status:m,fetchStatus:d.fetchStatus,isPending:y,isSuccess:m==="success",isError:E,isInitialLoading:T,isLoading:T,data:C,dataUpdatedAt:d.dataUpdatedAt,error:R,errorUpdatedAt:D,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>h.dataUpdateCount||d.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!y,isLoadingError:E&&!A,isPaused:d.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:E&&A,isStale:dm(r,s),refetch:this.refetch,promise:ee(this,bn),isEnabled:vr(s.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const I=x.data!==void 0,V=x.status==="error"&&!I,P=W=>{V?W.reject(x.error):I&&W.resolve(x.data)},$=()=>{const W=Me(this,bn,x.promise=Tf());P(W)},Z=ee(this,bn);switch(Z.status){case"pending":r.queryHash===a.queryHash&&P(Z);break;case"fulfilled":(V||x.data!==Z.value)&&$();break;case"rejected":(!V||x.error!==Z.reason)&&$();break}}return x}updateResult(){const r=ee(this,Mi),s=this.createResult(ee(this,gt),this.options);if(Me(this,Ks,ee(this,gt).state),Me(this,Va,this.options),ee(this,Ks).data!==void 0&&Me(this,Ya,ee(this,gt)),hu(s,r))return;Me(this,Mi,s);const a=()=>{if(!r)return!0;const{notifyOnChangeProps:c}=this.options,f=typeof c=="function"?c():c;if(f==="all"||!f&&!ee(this,Ga).size)return!0;const v=new Set(f??ee(this,Ga));return this.options.throwOnError&&v.add("error"),Object.keys(ee(this,Mi)).some(l=>{const u=l;return ee(this,Mi)[u]!==r[u]&&v.has(u)})};it(this,Rt,Py).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&it(this,Rt,Mf).call(this)}},$i=new WeakMap,gt=new WeakMap,Sl=new WeakMap,Mi=new WeakMap,Ks=new WeakMap,Va=new WeakMap,bn=new WeakMap,ns=new WeakMap,wl=new WeakMap,Wa=new WeakMap,Ya=new WeakMap,Vs=new WeakMap,Ws=new WeakMap,ss=new WeakMap,Ga=new WeakMap,Rt=new WeakSet,rl=function(r){it(this,Rt,Nf).call(this);let s=ee(this,gt).fetch(this.options,r);return r!=null&&r.throwOnError||(s=s.catch(Bi)),s},Of=function(){it(this,Rt,kf).call(this);const r=ds(this.options.staleTime,ee(this,gt));if(Gs||ee(this,Mi).isStale||!Ef(r))return;const a=Ly(ee(this,Mi).dataUpdatedAt,r)+1;Me(this,Vs,Hs.setTimeout(()=>{ee(this,Mi).isStale||this.updateResult()},a))},Af=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,gt)):this.options.refetchInterval)??!1},Lf=function(r){it(this,Rt,Bf).call(this),Me(this,ss,r),!(Gs||vr(this.options.enabled,ee(this,gt))===!1||!Ef(ee(this,ss))||ee(this,ss)===0)&&Me(this,Ws,Hs.setInterval(()=>{(this.options.refetchIntervalInBackground||hm.isFocused())&&it(this,Rt,rl).call(this)},ee(this,ss)))},Mf=function(){it(this,Rt,Of).call(this),it(this,Rt,Lf).call(this,it(this,Rt,Af).call(this))},kf=function(){ee(this,Vs)&&(Hs.clearTimeout(ee(this,Vs)),Me(this,Vs,void 0))},Bf=function(){ee(this,Ws)&&(Hs.clearInterval(ee(this,Ws)),Me(this,Ws,void 0))},Nf=function(){const r=ee(this,$i).getQueryCache().build(ee(this,$i),this.options);if(r===ee(this,gt))return;const s=ee(this,gt);Me(this,gt,r),Me(this,Sl,r.state),this.hasListeners()&&(s==null||s.removeObserver(this),r.addObserver(this))},Py=function(r){mi.batch(()=>{r.listeners&&this.listeners.forEach(s=>{s(ee(this,Mi))}),ee(this,$i).getQueryCache().notify({query:ee(this,gt),type:"observerResultsUpdated"})})},Ey);function cC(i,r){return vr(r.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&r.retryOnMount===!1)}function O_(i,r){return cC(i,r)||i.state.data!==void 0&&jf(i,r,r.refetchOnMount)}function jf(i,r,s){if(vr(r.enabled,i)!==!1&&ds(r.staleTime,i)!=="static"){const a=typeof s=="function"?s(i):s;return a==="always"||a!==!1&&dm(i,r)}return!1}function A_(i,r,s,a){return(i!==r||vr(a.enabled,i)===!1)&&(!s.suspense||i.state.status!=="error")&&dm(i,s)}function dm(i,r){return vr(r.enabled,i)!==!1&&i.isStaleByTime(ds(r.staleTime,i))}function uC(i,r){return!hu(i.getCurrentResult(),r)}function L_(i){return{onFetch:(r,s)=>{var b,d,w,C,R;const a=r.options,c=(w=(d=(b=r.fetchOptions)==null?void 0:b.meta)==null?void 0:d.fetchMore)==null?void 0:w.direction,f=((C=r.state.data)==null?void 0:C.pages)||[],v=((R=r.state.data)==null?void 0:R.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const h=async()=>{let D=!1;const m=y=>{tC(y,()=>r.signal,()=>D=!0)},g=ky(r.options,r.fetchOptions),_=async(y,E,T)=>{if(D)return Promise.reject();if(E==null&&y.pages.length)return Promise.resolve(y);const O=(()=>{const V={client:r.client,queryKey:r.queryKey,pageParam:E,direction:T?"backward":"forward",meta:r.options.meta};return m(V),V})(),x=await g(O),{maxPages:L}=r.options,I=T?eC:Jw;return{pages:I(y.pages,x,L),pageParams:I(y.pageParams,E,L)}};if(c&&f.length){const y=c==="backward",E=y?hC:M_,T={pages:f,pageParams:v},A=E(a,T);l=await _(T,A,y)}else{const y=i??f.length;do{const E=u===0?v[0]??a.initialPageParam:M_(a,l);if(u>0&&E==null)break;l=await _(l,E),u++}while(u<y)}return l};r.options.persister?r.fetchFn=()=>{var D,m;return(m=(D=r.options).persister)==null?void 0:m.call(D,h,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s)}:r.fetchFn=h}}}function M_(i,{pages:r,pageParams:s}){const a=r.length-1;return r.length>0?i.getNextPageParam(r[a],r,s[a],s):void 0}function hC(i,{pages:r,pageParams:s}){var a;return r.length>0?(a=i.getPreviousPageParam)==null?void 0:a.call(i,r[0],r,s[0],s):void 0}var Cl,Fr,Oi,Ys,qr,Qn,xy,dC=(xy=class extends jy{constructor(r){super();$e(this,qr);$e(this,Cl);$e(this,Fr);$e(this,Oi);$e(this,Ys);Me(this,Cl,r.client),this.mutationId=r.mutationId,Me(this,Oi,r.mutationCache),Me(this,Fr,[]),this.state=r.state||zy(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){ee(this,Fr).includes(r)||(ee(this,Fr).push(r),this.clearGcTimeout(),ee(this,Oi).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){Me(this,Fr,ee(this,Fr).filter(s=>s!==r)),this.scheduleGc(),ee(this,Oi).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){ee(this,Fr).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Oi).remove(this))}continue(){var r;return((r=ee(this,Ys))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var v,l,u,h,b,d,w,C,R,D,m,g,_,y,E,T,A,O;const s=()=>{it(this,qr,Qn).call(this,{type:"continue"})},a={client:ee(this,Cl),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Ys,Ny({fn:()=>this.options.mutationFn?this.options.mutationFn(r,a):Promise.reject(new Error("No mutationFn found")),onFail:(x,L)=>{it(this,qr,Qn).call(this,{type:"failed",failureCount:x,error:L})},onPause:()=>{it(this,qr,Qn).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ee(this,Oi).canRun(this)}));const c=this.state.status==="pending",f=!ee(this,Ys).canStart();try{if(c)s();else{it(this,qr,Qn).call(this,{type:"pending",variables:r,isPaused:f}),ee(this,Oi).config.onMutate&&await ee(this,Oi).config.onMutate(r,this,a);const L=await((l=(v=this.options).onMutate)==null?void 0:l.call(v,r,a));L!==this.state.context&&it(this,qr,Qn).call(this,{type:"pending",context:L,variables:r,isPaused:f})}const x=await ee(this,Ys).start();return await((h=(u=ee(this,Oi).config).onSuccess)==null?void 0:h.call(u,x,r,this.state.context,this,a)),await((d=(b=this.options).onSuccess)==null?void 0:d.call(b,x,r,this.state.context,a)),await((C=(w=ee(this,Oi).config).onSettled)==null?void 0:C.call(w,x,null,this.state.variables,this.state.context,this,a)),await((D=(R=this.options).onSettled)==null?void 0:D.call(R,x,null,r,this.state.context,a)),it(this,qr,Qn).call(this,{type:"success",data:x}),x}catch(x){try{await((g=(m=ee(this,Oi).config).onError)==null?void 0:g.call(m,x,r,this.state.context,this,a))}catch(L){Promise.reject(L)}try{await((y=(_=this.options).onError)==null?void 0:y.call(_,x,r,this.state.context,a))}catch(L){Promise.reject(L)}try{await((T=(E=ee(this,Oi).config).onSettled)==null?void 0:T.call(E,void 0,x,this.state.variables,this.state.context,this,a))}catch(L){Promise.reject(L)}try{await((O=(A=this.options).onSettled)==null?void 0:O.call(A,void 0,x,r,this.state.context,a))}catch(L){Promise.reject(L)}throw it(this,qr,Qn).call(this,{type:"error",error:x}),x}finally{ee(this,Oi).runNext(this)}}},Cl=new WeakMap,Fr=new WeakMap,Oi=new WeakMap,Ys=new WeakMap,qr=new WeakSet,Qn=function(r){const s=a=>{switch(r.type){case"failed":return{...a,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...a,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:r.error,failureCount:a.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=s(this.state),mi.batch(()=>{ee(this,Fr).forEach(a=>{a.onMutationUpdate(r)}),ee(this,Oi).notify({mutation:this,type:"updated",action:r})})},xy);function zy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sn,Lr,El,Ry,fC=(Ry=class extends ro{constructor(r={}){super();$e(this,Sn);$e(this,Lr);$e(this,El);this.config=r,Me(this,Sn,new Set),Me(this,Lr,new Map),Me(this,El,0)}build(r,s,a){const c=new dC({client:r,mutationCache:this,mutationId:++$c(this,El)._,options:r.defaultMutationOptions(s),state:a});return this.add(c),c}add(r){ee(this,Sn).add(r);const s=Kc(r);if(typeof s=="string"){const a=ee(this,Lr).get(s);a?a.push(r):ee(this,Lr).set(s,[r])}this.notify({type:"added",mutation:r})}remove(r){if(ee(this,Sn).delete(r)){const s=Kc(r);if(typeof s=="string"){const a=ee(this,Lr).get(s);if(a)if(a.length>1){const c=a.indexOf(r);c!==-1&&a.splice(c,1)}else a[0]===r&&ee(this,Lr).delete(s)}}this.notify({type:"removed",mutation:r})}canRun(r){const s=Kc(r);if(typeof s=="string"){const a=ee(this,Lr).get(s),c=a==null?void 0:a.find(f=>f.state.status==="pending");return!c||c===r}else return!0}runNext(r){var a;const s=Kc(r);if(typeof s=="string"){const c=(a=ee(this,Lr).get(s))==null?void 0:a.find(f=>f!==r&&f.state.isPaused);return(c==null?void 0:c.continue())??Promise.resolve()}else return Promise.resolve()}clear(){mi.batch(()=>{ee(this,Sn).forEach(r=>{this.notify({type:"removed",mutation:r})}),ee(this,Sn).clear(),ee(this,Lr).clear()})}getAll(){return Array.from(ee(this,Sn))}find(r){const s={exact:!0,...r};return this.getAll().find(a=>E_(s,a))}findAll(r={}){return this.getAll().filter(s=>E_(r,s))}notify(r){mi.batch(()=>{this.listeners.forEach(s=>{s(r)})})}resumePausedMutations(){const r=this.getAll().filter(s=>s.state.isPaused);return mi.batch(()=>Promise.all(r.map(s=>s.continue().catch(Bi))))}},Sn=new WeakMap,Lr=new WeakMap,El=new WeakMap,Ry);function Kc(i){var r;return(r=i.options.scope)==null?void 0:r.id}var wn,as,Ki,Cn,Rn,ru,Hf,Ty,mC=(Ty=class extends ro{constructor(s,a){super();$e(this,Rn);$e(this,wn);$e(this,as);$e(this,Ki);$e(this,Cn);Me(this,wn,s),this.setOptions(a),this.bindMethods(),it(this,Rn,ru).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var c;const a=this.options;this.options=ee(this,wn).defaultMutationOptions(s),hu(this.options,a)||ee(this,wn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ee(this,Ki),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Xs(a.mutationKey)!==Xs(this.options.mutationKey)?this.reset():((c=ee(this,Ki))==null?void 0:c.state.status)==="pending"&&ee(this,Ki).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=ee(this,Ki))==null||s.removeObserver(this)}onMutationUpdate(s){it(this,Rn,ru).call(this),it(this,Rn,Hf).call(this,s)}getCurrentResult(){return ee(this,as)}reset(){var s;(s=ee(this,Ki))==null||s.removeObserver(this),Me(this,Ki,void 0),it(this,Rn,ru).call(this),it(this,Rn,Hf).call(this)}mutate(s,a){var c;return Me(this,Cn,a),(c=ee(this,Ki))==null||c.removeObserver(this),Me(this,Ki,ee(this,wn).getMutationCache().build(ee(this,wn),this.options)),ee(this,Ki).addObserver(this),ee(this,Ki).execute(s)}},wn=new WeakMap,as=new WeakMap,Ki=new WeakMap,Cn=new WeakMap,Rn=new WeakSet,ru=function(){var a;const s=((a=ee(this,Ki))==null?void 0:a.state)??zy();Me(this,as,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Hf=function(s){mi.batch(()=>{var a,c,f,v,l,u,h,b;if(ee(this,Cn)&&this.hasListeners()){const d=ee(this,as).variables,w=ee(this,as).context,C={client:ee(this,wn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(c=(a=ee(this,Cn)).onSuccess)==null||c.call(a,s.data,d,w,C)}catch(R){Promise.reject(R)}try{(v=(f=ee(this,Cn)).onSettled)==null||v.call(f,s.data,null,d,w,C)}catch(R){Promise.reject(R)}}else if((s==null?void 0:s.type)==="error"){try{(u=(l=ee(this,Cn)).onError)==null||u.call(l,s.error,d,w,C)}catch(R){Promise.reject(R)}try{(b=(h=ee(this,Cn)).onSettled)==null||b.call(h,void 0,s.error,d,w,C)}catch(R){Promise.reject(R)}}}this.listeners.forEach(d=>{d(ee(this,as))})})},Ty),$r,Dy,pC=(Dy=class extends ro{constructor(r={}){super();$e(this,$r);this.config=r,Me(this,$r,new Map)}build(r,s,a){const c=s.queryKey,f=s.queryHash??lm(c,s);let v=this.get(f);return v||(v=new oC({client:r,queryKey:c,queryHash:f,options:r.defaultQueryOptions(s),state:a,defaultOptions:r.getQueryDefaults(c)}),this.add(v)),v}add(r){ee(this,$r).has(r.queryHash)||(ee(this,$r).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const s=ee(this,$r).get(r.queryHash);s&&(r.destroy(),s===r&&ee(this,$r).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){mi.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return ee(this,$r).get(r)}getAll(){return[...ee(this,$r).values()]}find(r){const s={exact:!0,...r};return this.getAll().find(a=>C_(s,a))}findAll(r={}){const s=this.getAll();return Object.keys(r).length>0?s.filter(a=>C_(r,a)):s}notify(r){mi.batch(()=>{this.listeners.forEach(s=>{s(r)})})}onFocus(){mi.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){mi.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},$r=new WeakMap,Dy),Qt,os,ls,Xa,Qa,cs,Za,Ja,Oy,gC=(Oy=class{constructor(i={}){$e(this,Qt);$e(this,os);$e(this,ls);$e(this,Xa);$e(this,Qa);$e(this,cs);$e(this,Za);$e(this,Ja);Me(this,Qt,i.queryCache||new pC),Me(this,os,i.mutationCache||new fC),Me(this,ls,i.defaultOptions||{}),Me(this,Xa,new Map),Me(this,Qa,new Map),Me(this,cs,0)}mount(){$c(this,cs)._++,ee(this,cs)===1&&(Me(this,Za,hm.subscribe(async i=>{i&&(await this.resumePausedMutations(),ee(this,Qt).onFocus())})),Me(this,Ja,du.subscribe(async i=>{i&&(await this.resumePausedMutations(),ee(this,Qt).onOnline())})))}unmount(){var i,r;$c(this,cs)._--,ee(this,cs)===0&&((i=ee(this,Za))==null||i.call(this),Me(this,Za,void 0),(r=ee(this,Ja))==null||r.call(this),Me(this,Ja,void 0))}isFetching(i){return ee(this,Qt).findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return ee(this,os).findAll({...i,status:"pending"}).length}getQueryData(i){var s;const r=this.defaultQueryOptions({queryKey:i});return(s=ee(this,Qt).get(r.queryHash))==null?void 0:s.state.data}ensureQueryData(i){const r=this.defaultQueryOptions(i),s=ee(this,Qt).build(this,r),a=s.state.data;return a===void 0?this.fetchQuery(i):(i.revalidateIfStale&&s.isStaleByTime(ds(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(a))}getQueriesData(i){return ee(this,Qt).findAll(i).map(({queryKey:r,state:s})=>{const a=s.data;return[r,a]})}setQueryData(i,r,s){const a=this.defaultQueryOptions({queryKey:i}),c=ee(this,Qt).get(a.queryHash),f=c==null?void 0:c.state.data,v=Xw(r,f);if(v!==void 0)return ee(this,Qt).build(this,a).setData(v,{...s,manual:!0})}setQueriesData(i,r,s){return mi.batch(()=>ee(this,Qt).findAll(i).map(({queryKey:a})=>[a,this.setQueryData(a,r,s)]))}getQueryState(i){var s;const r=this.defaultQueryOptions({queryKey:i});return(s=ee(this,Qt).get(r.queryHash))==null?void 0:s.state}removeQueries(i){const r=ee(this,Qt);mi.batch(()=>{r.findAll(i).forEach(s=>{r.remove(s)})})}resetQueries(i,r){const s=ee(this,Qt);return mi.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...i},r)))}cancelQueries(i,r={}){const s={revert:!0,...r},a=mi.batch(()=>ee(this,Qt).findAll(i).map(c=>c.cancel(s)));return Promise.all(a).then(Bi).catch(Bi)}invalidateQueries(i,r={}){return mi.batch(()=>(ee(this,Qt).findAll(i).forEach(s=>{s.invalidate()}),(i==null?void 0:i.refetchType)==="none"?Promise.resolve():this.refetchQueries({...i,type:(i==null?void 0:i.refetchType)??(i==null?void 0:i.type)??"active"},r)))}refetchQueries(i,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},a=mi.batch(()=>ee(this,Qt).findAll(i).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(Bi)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(a).then(Bi)}fetchQuery(i){const r=this.defaultQueryOptions(i);r.retry===void 0&&(r.retry=!1);const s=ee(this,Qt).build(this,r);return s.isStaleByTime(ds(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(Bi).catch(Bi)}fetchInfiniteQuery(i){return i.behavior=L_(i.pages),this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(Bi).catch(Bi)}ensureInfiniteQueryData(i){return i.behavior=L_(i.pages),this.ensureQueryData(i)}resumePausedMutations(){return du.isOnline()?ee(this,os).resumePausedMutations():Promise.resolve()}getQueryCache(){return ee(this,Qt)}getMutationCache(){return ee(this,os)}getDefaultOptions(){return ee(this,ls)}setDefaultOptions(i){Me(this,ls,i)}setQueryDefaults(i,r){ee(this,Xa).set(Xs(i),{queryKey:i,defaultOptions:r})}getQueryDefaults(i){const r=[...ee(this,Xa).values()],s={};return r.forEach(a=>{ml(i,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(i,r){ee(this,Qa).set(Xs(i),{mutationKey:i,defaultOptions:r})}getMutationDefaults(i){const r=[...ee(this,Qa).values()],s={};return r.forEach(a=>{ml(i,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(i){if(i._defaulted)return i;const r={...ee(this,ls).queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return r.queryHash||(r.queryHash=lm(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===cm&&(r.enabled=!1),r}defaultMutationOptions(i){return i!=null&&i._defaulted?i:{...ee(this,ls).mutations,...(i==null?void 0:i.mutationKey)&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){ee(this,Qt).clear(),ee(this,os).clear()}},Qt=new WeakMap,os=new WeakMap,ls=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,cs=new WeakMap,Za=new WeakMap,Ja=new WeakMap,Oy),Xd={exports:{}},Xe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var k_;function vC(){if(k_)return Xe;k_=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),w=Symbol.iterator;function C(B){return B===null||typeof B!="object"?null:(B=w&&B[w]||B["@@iterator"],typeof B=="function"?B:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,m={};function g(B,F,X){this.props=B,this.context=F,this.refs=m,this.updater=X||R}g.prototype.isReactComponent={},g.prototype.setState=function(B,F){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,F,"setState")},g.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function _(){}_.prototype=g.prototype;function y(B,F,X){this.props=B,this.context=F,this.refs=m,this.updater=X||R}var E=y.prototype=new _;E.constructor=y,D(E,g.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function L(B,F,X){var ne=X.ref;return{$$typeof:i,type:B,key:F,ref:ne!==void 0?ne:null,props:X}}function I(B,F){return L(B.type,F,B.props)}function V(B){return typeof B=="object"&&B!==null&&B.$$typeof===i}function P(B){var F={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(X){return F[X]})}var $=/\/+/g;function Z(B,F){return typeof B=="object"&&B!==null&&B.key!=null?P(""+B.key):F.toString(36)}function W(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(A,A):(B.status="pending",B.then(function(F){B.status==="pending"&&(B.status="fulfilled",B.value=F)},function(F){B.status==="pending"&&(B.status="rejected",B.reason=F)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function q(B,F,X,ne,ae){var pe=typeof B;(pe==="undefined"||pe==="boolean")&&(B=null);var j=!1;if(B===null)j=!0;else switch(pe){case"bigint":case"string":case"number":j=!0;break;case"object":switch(B.$$typeof){case i:case r:j=!0;break;case b:return j=B._init,q(j(B._payload),F,X,ne,ae)}}if(j)return ae=ae(B),j=ne===""?"."+Z(B,0):ne,T(ae)?(X="",j!=null&&(X=j.replace($,"$&/")+"/"),q(ae,F,X,"",function(le){return le})):ae!=null&&(V(ae)&&(ae=I(ae,X+(ae.key==null||B&&B.key===ae.key?"":(""+ae.key).replace($,"$&/")+"/")+j)),F.push(ae)),1;j=0;var G=ne===""?".":ne+":";if(T(B))for(var oe=0;oe<B.length;oe++)ne=B[oe],pe=G+Z(ne,oe),j+=q(ne,F,X,pe,ae);else if(oe=C(B),typeof oe=="function")for(B=oe.call(B),oe=0;!(ne=B.next()).done;)ne=ne.value,pe=G+Z(ne,oe++),j+=q(ne,F,X,pe,ae);else if(pe==="object"){if(typeof B.then=="function")return q(W(B),F,X,ne,ae);throw F=String(B),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return j}function Y(B,F,X){if(B==null)return B;var ne=[],ae=0;return q(B,ne,"","",function(pe){return F.call(X,pe,ae++)}),ne}function k(B){if(B._status===-1){var F=B._result;F=F(),F.then(function(X){(B._status===0||B._status===-1)&&(B._status=1,B._result=X)},function(X){(B._status===0||B._status===-1)&&(B._status=2,B._result=X)}),B._status===-1&&(B._status=0,B._result=F)}if(B._status===1)return B._result.default;throw B._result}var z=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},K={map:Y,forEach:function(B,F,X){Y(B,function(){F.apply(this,arguments)},X)},count:function(B){var F=0;return Y(B,function(){F++}),F},toArray:function(B){return Y(B,function(F){return F})||[]},only:function(B){if(!V(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Xe.Activity=d,Xe.Children=K,Xe.Component=g,Xe.Fragment=s,Xe.Profiler=c,Xe.PureComponent=y,Xe.StrictMode=a,Xe.Suspense=u,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},Xe.cache=function(B){return function(){return B.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(B,F,X){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ne=D({},B.props),ae=B.key;if(F!=null)for(pe in F.key!==void 0&&(ae=""+F.key),F)!x.call(F,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&F.ref===void 0||(ne[pe]=F[pe]);var pe=arguments.length-2;if(pe===1)ne.children=X;else if(1<pe){for(var j=Array(pe),G=0;G<pe;G++)j[G]=arguments[G+2];ne.children=j}return L(B.type,ae,ne)},Xe.createContext=function(B){return B={$$typeof:v,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:f,_context:B},B},Xe.createElement=function(B,F,X){var ne,ae={},pe=null;if(F!=null)for(ne in F.key!==void 0&&(pe=""+F.key),F)x.call(F,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ae[ne]=F[ne]);var j=arguments.length-2;if(j===1)ae.children=X;else if(1<j){for(var G=Array(j),oe=0;oe<j;oe++)G[oe]=arguments[oe+2];ae.children=G}if(B&&B.defaultProps)for(ne in j=B.defaultProps,j)ae[ne]===void 0&&(ae[ne]=j[ne]);return L(B,pe,ae)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(B){return{$$typeof:l,render:B}},Xe.isValidElement=V,Xe.lazy=function(B){return{$$typeof:b,_payload:{_status:-1,_result:B},_init:k}},Xe.memo=function(B,F){return{$$typeof:h,type:B,compare:F===void 0?null:F}},Xe.startTransition=function(B){var F=O.T,X={};O.T=X;try{var ne=B(),ae=O.S;ae!==null&&ae(X,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(A,z)}catch(pe){z(pe)}finally{F!==null&&X.types!==null&&(F.types=X.types),O.T=F}},Xe.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Xe.use=function(B){return O.H.use(B)},Xe.useActionState=function(B,F,X){return O.H.useActionState(B,F,X)},Xe.useCallback=function(B,F){return O.H.useCallback(B,F)},Xe.useContext=function(B){return O.H.useContext(B)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(B,F){return O.H.useDeferredValue(B,F)},Xe.useEffect=function(B,F){return O.H.useEffect(B,F)},Xe.useEffectEvent=function(B){return O.H.useEffectEvent(B)},Xe.useId=function(){return O.H.useId()},Xe.useImperativeHandle=function(B,F,X){return O.H.useImperativeHandle(B,F,X)},Xe.useInsertionEffect=function(B,F){return O.H.useInsertionEffect(B,F)},Xe.useLayoutEffect=function(B,F){return O.H.useLayoutEffect(B,F)},Xe.useMemo=function(B,F){return O.H.useMemo(B,F)},Xe.useOptimistic=function(B,F){return O.H.useOptimistic(B,F)},Xe.useReducer=function(B,F,X){return O.H.useReducer(B,F,X)},Xe.useRef=function(B){return O.H.useRef(B)},Xe.useState=function(B){return O.H.useState(B)},Xe.useSyncExternalStore=function(B,F,X){return O.H.useSyncExternalStore(B,F,X)},Xe.useTransition=function(){return O.H.useTransition()},Xe.version="19.2.4",Xe}var B_;function xl(){return B_||(B_=1,Xd.exports=vC()),Xd.exports}var N=xl();const Te=Ay(N),fm=$w({__proto__:null,default:Te},[N]);var Iy=N.createContext(void 0),ea=i=>{const r=N.useContext(Iy);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},_C=({client:i,children:r})=>(N.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),H.jsx(Iy.Provider,{value:i,children:r})),Uy=N.createContext(!1),yC=()=>N.useContext(Uy);Uy.Provider;function bC(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var SC=N.createContext(bC()),wC=()=>N.useContext(SC),CC=(i,r,s)=>{const a=s!=null&&s.state.error&&typeof i.throwOnError=="function"?um(i.throwOnError,[s.state.error,s]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||a)&&(r.isReset()||(i.retryOnMount=!1))},EC=i=>{N.useEffect(()=>{i.clearReset()},[i])},xC=({result:i,errorResetBoundary:r,throwOnError:s,query:a,suspense:c})=>i.isError&&!r.isReset()&&!i.isFetching&&a&&(c&&i.data===void 0||um(s,[i.error,a])),RC=i=>{if(i.suspense){const s=c=>c==="static"?c:Math.max(c??1e3,1e3),a=i.staleTime;i.staleTime=typeof a=="function"?(...c)=>s(a(...c)):s(a),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},TC=(i,r)=>i.isLoading&&i.isFetching&&!r,DC=(i,r)=>(i==null?void 0:i.suspense)&&r.isPending,N_=(i,r,s)=>r.fetchOptimistic(i).catch(()=>{s.clearReset()});function OC(i,r,s){var w,C,R,D;const a=yC(),c=wC(),f=ea(),v=f.defaultQueryOptions(i);(C=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||C.call(w,v);const l=f.getQueryCache().get(v.queryHash);v._optimisticResults=a?"isRestoring":"optimistic",RC(v),CC(v,c,l),EC(c);const u=!f.getQueryCache().get(v.queryHash),[h]=N.useState(()=>new r(f,v)),b=h.getOptimisticResult(v),d=!a&&i.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(m=>{const g=d?h.subscribe(mi.batchCalls(m)):Bi;return h.updateResult(),g},[h,d]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(v)},[v,h]),DC(v,b))throw N_(v,h,c);if(xC({result:b,errorResetBoundary:c,throwOnError:v.throwOnError,query:l,suspense:v.suspense}))throw b.error;if((D=(R=f.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||D.call(R,v,b),v.experimental_prefetchInRender&&!Gs&&TC(b,a)){const m=u?N_(v,h,c):l==null?void 0:l.promise;m==null||m.catch(Bi).finally(()=>{h.updateResult()})}return v.notifyOnChangeProps?b:h.trackResult(b)}function Qs(i,r){return OC(i,lC)}function _r(i,r){const s=ea(),[a]=N.useState(()=>new mC(s,i));N.useEffect(()=>{a.setOptions(i)},[a,i]);const c=N.useSyncExternalStore(N.useCallback(v=>a.subscribe(mi.batchCalls(v)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),f=N.useCallback((v,l)=>{a.mutate(v,l).catch(Bi)},[a]);if(c.error&&um(a.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:f,mutateAsync:c.mutate}}var Qd={exports:{}},Qo={},Zd={exports:{}},Jd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var j_;function AC(){return j_||(j_=1,(function(i){function r(q,Y){var k=q.length;q.push(Y);e:for(;0<k;){var z=k-1>>>1,K=q[z];if(0<c(K,Y))q[z]=Y,q[k]=K,k=z;else break e}}function s(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var Y=q[0],k=q.pop();if(k!==Y){q[0]=k;e:for(var z=0,K=q.length,B=K>>>1;z<B;){var F=2*(z+1)-1,X=q[F],ne=F+1,ae=q[ne];if(0>c(X,k))ne<K&&0>c(ae,X)?(q[z]=ae,q[ne]=k,z=ne):(q[z]=X,q[F]=k,z=F);else if(ne<K&&0>c(ae,k))q[z]=ae,q[ne]=k,z=ne;else break e}}return Y}function c(q,Y){var k=q.sortIndex-Y.sortIndex;return k!==0?k:q.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;i.unstable_now=function(){return f.now()}}else{var v=Date,l=v.now();i.unstable_now=function(){return v.now()-l}}var u=[],h=[],b=1,d=null,w=3,C=!1,R=!1,D=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var Y=s(h);Y!==null;){if(Y.callback===null)a(h);else if(Y.startTime<=q)a(h),Y.sortIndex=Y.expirationTime,r(u,Y);else break;Y=s(h)}}function T(q){if(D=!1,E(q),!R)if(s(u)!==null)R=!0,A||(A=!0,P());else{var Y=s(h);Y!==null&&W(T,Y.startTime-q)}}var A=!1,O=-1,x=5,L=-1;function I(){return m?!0:!(i.unstable_now()-L<x)}function V(){if(m=!1,A){var q=i.unstable_now();L=q;var Y=!0;try{e:{R=!1,D&&(D=!1,_(O),O=-1),C=!0;var k=w;try{t:{for(E(q),d=s(u);d!==null&&!(d.expirationTime>q&&I());){var z=d.callback;if(typeof z=="function"){d.callback=null,w=d.priorityLevel;var K=z(d.expirationTime<=q);if(q=i.unstable_now(),typeof K=="function"){d.callback=K,E(q),Y=!0;break t}d===s(u)&&a(u),E(q)}else a(u);d=s(u)}if(d!==null)Y=!0;else{var B=s(h);B!==null&&W(T,B.startTime-q),Y=!1}}break e}finally{d=null,w=k,C=!1}Y=void 0}}finally{Y?P():A=!1}}}var P;if(typeof y=="function")P=function(){y(V)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Z=$.port2;$.port1.onmessage=V,P=function(){Z.postMessage(null)}}else P=function(){g(V,0)};function W(q,Y){O=g(function(){q(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(q){q.callback=null},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return w},i.unstable_next=function(q){switch(w){case 1:case 2:case 3:var Y=3;break;default:Y=w}var k=w;w=Y;try{return q()}finally{w=k}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(q,Y){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var k=w;w=q;try{return Y()}finally{w=k}},i.unstable_scheduleCallback=function(q,Y,k){var z=i.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?z+k:z):k=z,q){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=k+K,q={id:b++,callback:Y,priorityLevel:q,startTime:k,expirationTime:K,sortIndex:-1},k>z?(q.sortIndex=k,r(h,q),s(u)===null&&q===s(h)&&(D?(_(O),O=-1):D=!0,W(T,k-z))):(q.sortIndex=K,r(u,q),R||C||(R=!0,A||(A=!0,P()))),q},i.unstable_shouldYield=I,i.unstable_wrapCallback=function(q){var Y=w;return function(){var k=w;w=Y;try{return q.apply(this,arguments)}finally{w=k}}}})(Jd)),Jd}var H_;function LC(){return H_||(H_=1,Zd.exports=AC()),Zd.exports}var ef={exports:{}},Di={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var P_;function MC(){if(P_)return Di;P_=1;var i=xl();function r(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(u,h,b){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:d==null?null:""+d,children:u,containerInfo:h,implementation:b}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Di.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Di.createPortal=function(u,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return f(u,h,null,b)},Di.flushSync=function(u){var h=v.T,b=a.p;try{if(v.T=null,a.p=2,u)return u()}finally{v.T=h,a.p=b,a.d.f()}},Di.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(u,h))},Di.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Di.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var b=h.as,d=l(b,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:d,integrity:w,fetchPriority:C}):b==="script"&&a.d.X(u,{crossOrigin:d,integrity:w,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Di.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=l(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(u)},Di.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,d=l(b,h.crossOrigin);a.d.L(u,b,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Di.preloadModule=function(u,h){if(typeof u=="string")if(h){var b=l(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},Di.requestFormReset=function(u){a.d.r(u)},Di.unstable_batchedUpdates=function(u,h){return u(h)},Di.useFormState=function(u,h,b){return v.H.useFormState(u,h,b)},Di.useFormStatus=function(){return v.H.useHostTransitionStatus()},Di.version="19.2.4",Di}var z_;function Fy(){if(z_)return ef.exports;z_=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),ef.exports=MC(),ef.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var I_;function kC(){if(I_)return Qo;I_=1;var i=LC(),r=xl(),s=Fy();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(f(e)!==e)throw Error(a(188))}function h(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(a(188));return t!==e?null:e}for(var n=e,o=t;;){var p=n.return;if(p===null)break;var S=p.alternate;if(S===null){if(o=p.return,o!==null){n=o;continue}break}if(p.child===S.child){for(S=p.child;S;){if(S===n)return u(p),e;if(S===o)return u(p),t;S=S.sibling}throw Error(a(188))}if(n.return!==o.return)n=p,o=S;else{for(var M=!1,U=p.child;U;){if(U===n){M=!0,n=p,o=S;break}if(U===o){M=!0,o=p,n=S;break}U=U.sibling}if(!M){for(U=S.child;U;){if(U===n){M=!0,n=S,o=p;break}if(U===o){M=!0,o=S,n=p;break}U=U.sibling}if(!M)throw Error(a(189))}}if(n.alternate!==o)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case y:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case E:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:Z(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return Z(e(t))}catch{}}return null}var W=Array.isArray,q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k={pending:!1,data:null,method:null,action:null},z=[],K=-1;function B(e){return{current:e}}function F(e){0>K||(e.current=z[K],z[K]=null,K--)}function X(e,t){K++,z[K]=e.current,e.current=t}var ne=B(null),ae=B(null),pe=B(null),j=B(null);function G(e,t){switch(X(pe,t),X(ae,e),X(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qv(t),e=$v(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(ne),X(ne,e)}function oe(){F(ne),F(ae),F(pe)}function le(e){e.memoizedState!==null&&X(j,e);var t=ne.current,n=$v(t,e.type);t!==n&&(X(ae,e),X(ne,n))}function me(e){ae.current===e&&(F(ne),F(ae)),j.current===e&&(F(j),Vo._currentValue=k)}var he,Ce;function Ve(e){if(he===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||"",Ce=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+he+e+Ce}var He=!1;function xe(e,t){if(!e||He)return"";He=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ge){var fe=ge}Reflect.construct(e,[],be)}else{try{be.call()}catch(ge){fe=ge}e.call(be.prototype)}}else{try{throw Error()}catch(ge){fe=ge}(be=e())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ge){if(ge&&fe&&typeof ge.stack=="string")return[ge.stack,fe.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=o.DetermineComponentFrameRoot(),M=S[0],U=S[1];if(M&&U){var J=M.split(`
|
|
44
|
+
`),ue=U.split(`
|
|
45
|
+
`);for(p=o=0;o<J.length&&!J[o].includes("DetermineComponentFrameRoot");)o++;for(;p<ue.length&&!ue[p].includes("DetermineComponentFrameRoot");)p++;if(o===J.length||p===ue.length)for(o=J.length-1,p=ue.length-1;1<=o&&0<=p&&J[o]!==ue[p];)p--;for(;1<=o&&0<=p;o--,p--)if(J[o]!==ue[p]){if(o!==1||p!==1)do if(o--,p--,0>p||J[o]!==ue[p]){var ve=`
|
|
46
|
+
`+J[o].replace(" at new "," at ");return e.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",e.displayName)),ve}while(1<=o&&0<=p);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ve(n):""}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve("Lazy");case 13:return e.child!==t&&t!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return Ve("Activity");default:return""}}function Ue(e){try{var t="",n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(o){return`
|
|
47
|
+
Error generating stack: `+o.message+`
|
|
48
|
+
`+o.stack}}var Fe=Object.prototype.hasOwnProperty,st=i.unstable_scheduleCallback,qe=i.unstable_cancelCallback,Ae=i.unstable_shouldYield,Ye=i.unstable_requestPaint,Be=i.unstable_now,at=i.unstable_getCurrentPriorityLevel,Wt=i.unstable_ImmediatePriority,Zt=i.unstable_UserBlockingPriority,et=i.unstable_NormalPriority,nt=i.unstable_LowPriority,dt=i.unstable_IdlePriority,It=i.log,Qe=i.unstable_setDisableYieldValue,Jt=null,bt=null;function ei(e){if(typeof It=="function"&&Qe(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Jt,e)}catch{}}var Tt=Math.clz32?Math.clz32:Ni,si=Math.log,Nr=Math.LN2;function Ni(e){return e>>>=0,e===0?32:31-(si(e)/Nr|0)|0}var rr=256,yi=262144,bi=4194304;function di(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Le(e,t,n){var o=e.pendingLanes;if(o===0)return 0;var p=0,S=e.suspendedLanes,M=e.pingedLanes;e=e.warmLanes;var U=o&134217727;return U!==0?(o=U&~S,o!==0?p=di(o):(M&=U,M!==0?p=di(M):n||(n=U&~e,n!==0&&(p=di(n))))):(U=o&~S,U!==0?p=di(U):M!==0?p=di(M):n||(n=o&~e,n!==0&&(p=di(n)))),p===0?0:t!==0&&t!==p&&(t&S)===0&&(S=p&-p,n=t&-t,S>=n||S===32&&(n&4194048)!==0)?t:p}function Dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ht(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;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 Pt(){var e=bi;return bi<<=1,(bi&62914560)===0&&(bi=4194304),e}function $t(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ti(e,t,n,o,p,S){var M=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var U=e.entanglements,J=e.expirationTimes,ue=e.hiddenUpdates;for(n=M&~n;0<n;){var ve=31-Tt(n),be=1<<ve;U[ve]=0,J[ve]=-1;var fe=ue[ve];if(fe!==null)for(ue[ve]=null,ve=0;ve<fe.length;ve++){var ge=fe[ve];ge!==null&&(ge.lane&=-536870913)}n&=~be}o!==0&&ji(e,o,0),S!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=S&~(M&~t))}function ji(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Tt(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|n&261930}function Q(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-Tt(n),p=1<<o;p&t|e[o]&t&&(e[o]|=t),n&=~p}}function re(e,t){var n=t&-t;return n=(n&42)!==0?1:de(n),(n&(e.suspendedLanes|t))!==0?0:n}function de(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Se(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Re(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:f_(e.type))}function Pe(e,t){var n=Y.p;try{return Y.p=e,t()}finally{Y.p=n}}var je=Math.random().toString(36).slice(2),De="__reactFiber$"+je,Oe="__reactProps$"+je,te="__reactContainer$"+je,ye="__reactEvents$"+je,we="__reactListeners$"+je,ke="__reactHandles$"+je,ze="__reactResources$"+je,Ze="__reactMarker$"+je;function vt(e){delete e[De],delete e[Oe],delete e[ye],delete e[we],delete e[ke]}function St(e){var t=e[De];if(t)return t;for(var n=e.parentNode;n;){if(t=n[te]||n[De]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qv(e);e!==null;){if(n=e[De])return n;e=Qv(e)}return t}e=n,n=e.parentNode}return null}function ot(e){if(e=e[De]||e[te]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Hi(e){var t=e[ze];return t||(t=e[ze]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[Ze]=!0}var Cr=new Set,Yi={};function Er(e,t){nr(e,t),nr(e+"Capture",t)}function nr(e,t){for(Yi[e]=t,e=0;e<t.length;e++)Cr.add(t[e])}var Zr=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]*$"),ps={},gs={};function ft(e){return Fe.call(gs,e)?!0:Fe.call(ps,e)?!1:Zr.test(e)?gs[e]=!0:(ps[e]=!0,!1)}function ii(e,t,n){if(ft(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function xr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Si(e,t,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+o)}}function mt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kl(e,t,n){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,S=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return p.call(this)},set:function(M){n=""+M,S.call(this,M)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return n},setValue:function(M){n=""+M},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oo(e){if(!e._valueTracker){var t=vs(e)?"checked":"value";e._valueTracker=kl(e,t,""+e[t])}}function jm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=vs(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function Bl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var j1=/[\n"\\]/g;function sr(e){return e.replace(j1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fu(e,t,n,o,p,S,M,U){e.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.type=M:e.removeAttribute("type"),t!=null?M==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mt(t)):e.value!==""+mt(t)&&(e.value=""+mt(t)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),t!=null?qu(e,M,mt(t)):n!=null?qu(e,M,mt(n)):o!=null&&e.removeAttribute("value"),p==null&&S!=null&&(e.defaultChecked=!!S),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?e.name=""+mt(U):e.removeAttribute("name")}function Hm(e,t,n,o,p,S,M,U){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.type=S),t!=null||n!=null){if(!(S!=="submit"&&S!=="reset"||t!=null)){oo(e);return}n=n!=null?""+mt(n):"",t=t!=null?""+mt(t):n,U||t===e.value||(e.value=t),e.defaultValue=t}o=o??p,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=U?e.checked:!!o,e.defaultChecked=!!o,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(e.name=M),oo(e)}function qu(e,t,n){t==="number"&&Bl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ia(e,t,n,o){if(e=e.options,t){t={};for(var p=0;p<n.length;p++)t["$"+n[p]]=!0;for(n=0;n<e.length;n++)p=t.hasOwnProperty("$"+e[n].value),e[n].selected!==p&&(e[n].selected=p),p&&o&&(e[n].defaultSelected=!0)}else{for(n=""+mt(n),t=null,p=0;p<e.length;p++){if(e[p].value===n){e[p].selected=!0,o&&(e[p].defaultSelected=!0);return}t!==null||e[p].disabled||(t=e[p])}t!==null&&(t.selected=!0)}}function Pm(e,t,n){if(t!=null&&(t=""+mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+mt(n):""}function zm(e,t,n,o){if(t==null){if(o!=null){if(n!=null)throw Error(a(92));if(W(o)){if(1<o.length)throw Error(a(93));o=o[0]}n=o}n==null&&(n=""),t=n}n=mt(t),e.defaultValue=n,o=e.textContent,o===n&&o!==""&&o!==null&&(e.value=o),oo(e)}function ra(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var H1=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 Im(e,t,n){var o=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,n):typeof n!="number"||n===0||H1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Um(e,t,n){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,n!=null){for(var o in n)!n.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var p in t)o=t[p],t.hasOwnProperty(p)&&n[p]!==o&&Im(e,p,o)}else for(var S in t)t.hasOwnProperty(S)&&Im(e,S,t[S])}function $u(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var P1=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"]]),z1=/^[\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 Nl(e){return z1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jr(){}var Ku=null;function Vu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var na=null,sa=null;function Fm(e){var t=ot(e);if(t&&(e=t.stateNode)){var n=e[Oe]||null;e:switch(e=t.stateNode,t.type){case"input":if(Fu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+sr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var p=o[Oe]||null;if(!p)throw Error(a(90));Fu(o,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(t=0;t<n.length;t++)o=n[t],o.form===e.form&&jm(o)}break e;case"textarea":Pm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ia(e,!!n.multiple,t,!1)}}}var Wu=!1;function qm(e,t,n){if(Wu)return e(t,n);Wu=!0;try{var o=e(t);return o}finally{if(Wu=!1,(na!==null||sa!==null)&&(wc(),na&&(t=na,e=sa,sa=na=null,Fm(t),e)))for(t=0;t<e.length;t++)Fm(e[t])}}function lo(e,t){var n=e.stateNode;if(n===null)return null;var o=n[Oe]||null;if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(a(231,t,typeof n));return n}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yu=!1;if(en)try{var co={};Object.defineProperty(co,"passive",{get:function(){Yu=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Yu=!1}var Dn=null,Gu=null,jl=null;function $m(){if(jl)return jl;var e,t=Gu,n=t.length,o,p="value"in Dn?Dn.value:Dn.textContent,S=p.length;for(e=0;e<n&&t[e]===p[e];e++);var M=n-e;for(o=1;o<=M&&t[n-o]===p[S-o];o++);return jl=p.slice(e,1<o?1-o:void 0)}function Hl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Pl(){return!0}function Km(){return!1}function Pi(e){function t(n,o,p,S,M){this._reactName=n,this._targetInst=p,this.type=o,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(n=e[U],this[U]=n?n(S):S[U]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Pl:Km,this.isPropagationStopped=Km,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=Pi(_s),uo=d({},_s,{view:0,detail:0}),I1=Pi(uo),Xu,Qu,ho,Il=d({},uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ju,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ho&&(ho&&e.type==="mousemove"?(Xu=e.screenX-ho.screenX,Qu=e.screenY-ho.screenY):Qu=Xu=0,ho=e),Xu)},movementY:function(e){return"movementY"in e?e.movementY:Qu}}),Vm=Pi(Il),U1=d({},Il,{dataTransfer:0}),F1=Pi(U1),q1=d({},uo,{relatedTarget:0}),Zu=Pi(q1),$1=d({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),K1=Pi($1),V1=d({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W1=Pi(V1),Y1=d({},_s,{data:0}),Wm=Pi(Y1),G1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X1={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"},Q1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Q1[e])?!!t[e]:!1}function Ju(){return Z1}var J1=d({},uo,{key:function(e){if(e.key){var t=G1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ju,charCode:function(e){return e.type==="keypress"?Hl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eS=Pi(J1),tS=d({},Il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ym=Pi(tS),iS=d({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ju}),rS=Pi(iS),nS=d({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),sS=Pi(nS),aS=d({},Il,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oS=Pi(aS),lS=d({},_s,{newState:0,oldState:0}),cS=Pi(lS),uS=[9,13,27,32],eh=en&&"CompositionEvent"in window,fo=null;en&&"documentMode"in document&&(fo=document.documentMode);var hS=en&&"TextEvent"in window&&!fo,Gm=en&&(!eh||fo&&8<fo&&11>=fo),Xm=" ",Qm=!1;function Zm(e,t){switch(e){case"keyup":return uS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var aa=!1;function dS(e,t){switch(e){case"compositionend":return Jm(t);case"keypress":return t.which!==32?null:(Qm=!0,Xm);case"textInput":return e=t.data,e===Xm&&Qm?null:e;default:return null}}function fS(e,t){if(aa)return e==="compositionend"||!eh&&Zm(e,t)?(e=$m(),jl=Gu=Dn=null,aa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gm&&t.locale!=="ko"?null:t.data;default:return null}}var mS={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 ep(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mS[e.type]:t==="textarea"}function tp(e,t,n,o){na?sa?sa.push(o):sa=[o]:na=o,t=Oc(t,"onChange"),0<t.length&&(n=new zl("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var mo=null,po=null;function pS(e){Hv(e,0)}function Ul(e){var t=pi(e);if(jm(t))return e}function ip(e,t){if(e==="change")return t}var rp=!1;if(en){var th;if(en){var ih="oninput"in document;if(!ih){var np=document.createElement("div");np.setAttribute("oninput","return;"),ih=typeof np.oninput=="function"}th=ih}else th=!1;rp=th&&(!document.documentMode||9<document.documentMode)}function sp(){mo&&(mo.detachEvent("onpropertychange",ap),po=mo=null)}function ap(e){if(e.propertyName==="value"&&Ul(po)){var t=[];tp(t,po,e,Vu(e)),qm(pS,t)}}function gS(e,t,n){e==="focusin"?(sp(),mo=t,po=n,mo.attachEvent("onpropertychange",ap)):e==="focusout"&&sp()}function vS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ul(po)}function _S(e,t){if(e==="click")return Ul(t)}function yS(e,t){if(e==="input"||e==="change")return Ul(t)}function bS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gi=typeof Object.is=="function"?Object.is:bS;function go(e,t){if(Gi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var p=n[o];if(!Fe.call(t,p)||!Gi(e[p],t[p]))return!1}return!0}function op(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lp(e,t){var n=op(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=op(n)}}function cp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function up(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bl(e.document)}return t}function rh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var SS=en&&"documentMode"in document&&11>=document.documentMode,oa=null,nh=null,vo=null,sh=!1;function hp(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sh||oa==null||oa!==Bl(o)||(o=oa,"selectionStart"in o&&rh(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),vo&&go(vo,o)||(vo=o,o=Oc(nh,"onSelect"),0<o.length&&(t=new zl("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=oa)))}function ys(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var la={animationend:ys("Animation","AnimationEnd"),animationiteration:ys("Animation","AnimationIteration"),animationstart:ys("Animation","AnimationStart"),transitionrun:ys("Transition","TransitionRun"),transitionstart:ys("Transition","TransitionStart"),transitioncancel:ys("Transition","TransitionCancel"),transitionend:ys("Transition","TransitionEnd")},ah={},dp={};en&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete la.animationend.animation,delete la.animationiteration.animation,delete la.animationstart.animation),"TransitionEvent"in window||delete la.transitionend.transition);function bs(e){if(ah[e])return ah[e];if(!la[e])return e;var t=la[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dp)return ah[e]=t[n];return e}var fp=bs("animationend"),mp=bs("animationiteration"),pp=bs("animationstart"),wS=bs("transitionrun"),CS=bs("transitionstart"),ES=bs("transitioncancel"),gp=bs("transitionend"),vp=new Map,oh="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(" ");oh.push("scrollEnd");function Rr(e,t){vp.set(e,t),Er(t,[e])}var Fl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ar=[],ca=0,lh=0;function ql(){for(var e=ca,t=lh=ca=0;t<e;){var n=ar[t];ar[t++]=null;var o=ar[t];ar[t++]=null;var p=ar[t];ar[t++]=null;var S=ar[t];if(ar[t++]=null,o!==null&&p!==null){var M=o.pending;M===null?p.next=p:(p.next=M.next,M.next=p),o.pending=p}S!==0&&_p(n,p,S)}}function $l(e,t,n,o){ar[ca++]=e,ar[ca++]=t,ar[ca++]=n,ar[ca++]=o,lh|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function ch(e,t,n,o){return $l(e,t,n,o),Kl(e)}function Ss(e,t){return $l(e,null,null,t),Kl(e)}function _p(e,t,n){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n);for(var p=!1,S=e.return;S!==null;)S.childLanes|=n,o=S.alternate,o!==null&&(o.childLanes|=n),S.tag===22&&(e=S.stateNode,e===null||e._visibility&1||(p=!0)),e=S,S=S.return;return e.tag===3?(S=e.stateNode,p&&t!==null&&(p=31-Tt(n),e=S.hiddenUpdates,o=e[p],o===null?e[p]=[t]:o.push(t),t.lane=n|536870912),S):null}function Kl(e){if(50<zo)throw zo=0,_d=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ua={};function xS(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xi(e,t,n,o){return new xS(e,t,n,o)}function uh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tn(e,t){var n=e.alternate;return n===null?(n=Xi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function yp(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vl(e,t,n,o,p,S){var M=0;if(o=e,typeof e=="function")uh(e)&&(M=1);else if(typeof e=="string")M=Aw(e,n,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=Xi(31,n,t,p),e.elementType=L,e.lanes=S,e;case D:return ws(n.children,p,S,t);case m:M=8,p|=24;break;case g:return e=Xi(12,n,t,p|2),e.elementType=g,e.lanes=S,e;case T:return e=Xi(13,n,t,p),e.elementType=T,e.lanes=S,e;case A:return e=Xi(19,n,t,p),e.elementType=A,e.lanes=S,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:M=10;break e;case _:M=9;break e;case E:M=11;break e;case O:M=14;break e;case x:M=16,o=null;break e}M=29,n=Error(a(130,e===null?"null":typeof e,"")),o=null}return t=Xi(M,n,t,p),t.elementType=e,t.type=o,t.lanes=S,t}function ws(e,t,n,o){return e=Xi(7,e,o,t),e.lanes=n,e}function hh(e,t,n){return e=Xi(6,e,null,t),e.lanes=n,e}function bp(e){var t=Xi(18,null,null,0);return t.stateNode=e,t}function dh(e,t,n){return t=Xi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Sp=new WeakMap;function or(e,t){if(typeof e=="object"&&e!==null){var n=Sp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ue(t)},Sp.set(e,t),t)}return{value:e,source:t,stack:Ue(t)}}var ha=[],da=0,Wl=null,_o=0,lr=[],cr=0,On=null,jr=1,Hr="";function rn(e,t){ha[da++]=_o,ha[da++]=Wl,Wl=e,_o=t}function wp(e,t,n){lr[cr++]=jr,lr[cr++]=Hr,lr[cr++]=On,On=e;var o=jr;e=Hr;var p=32-Tt(o)-1;o&=~(1<<p),n+=1;var S=32-Tt(t)+p;if(30<S){var M=p-p%5;S=(o&(1<<M)-1).toString(32),o>>=M,p-=M,jr=1<<32-Tt(t)+p|n<<p|o,Hr=S+e}else jr=1<<S|n<<p|o,Hr=e}function fh(e){e.return!==null&&(rn(e,1),wp(e,1,0))}function mh(e){for(;e===Wl;)Wl=ha[--da],ha[da]=null,_o=ha[--da],ha[da]=null;for(;e===On;)On=lr[--cr],lr[cr]=null,Hr=lr[--cr],lr[cr]=null,jr=lr[--cr],lr[cr]=null}function Cp(e,t){lr[cr++]=jr,lr[cr++]=Hr,lr[cr++]=On,jr=t.id,Hr=t.overflow,On=e}var wi=null,Ut=null,pt=!1,An=null,ur=!1,ph=Error(a(519));function Ln(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yo(or(t,e)),ph}function Ep(e){var t=e.stateNode,n=e.type,o=e.memoizedProps;switch(t[De]=e,t[Oe]=o,n){case"dialog":ct("cancel",t),ct("close",t);break;case"iframe":case"object":case"embed":ct("load",t);break;case"video":case"audio":for(n=0;n<Uo.length;n++)ct(Uo[n],t);break;case"source":ct("error",t);break;case"img":case"image":case"link":ct("error",t),ct("load",t);break;case"details":ct("toggle",t);break;case"input":ct("invalid",t),Hm(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ct("invalid",t);break;case"textarea":ct("invalid",t),zm(t,o.value,o.defaultValue,o.children)}n=o.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||o.suppressHydrationWarning===!0||Uv(t.textContent,n)?(o.popover!=null&&(ct("beforetoggle",t),ct("toggle",t)),o.onScroll!=null&&ct("scroll",t),o.onScrollEnd!=null&&ct("scrollend",t),o.onClick!=null&&(t.onclick=Jr),t=!0):t=!1,t||Ln(e,!0)}function xp(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:ur=!1;return;case 27:case 3:ur=!0;return;default:wi=wi.return}}function fa(e){if(e!==wi)return!1;if(!pt)return xp(e),pt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||kd(e.type,e.memoizedProps)),n=!n),n&&Ut&&Ln(e),xp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ut=Xv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ut=Xv(e)}else t===27?(t=Ut,Kn(e.type)?(e=Pd,Pd=null,Ut=e):Ut=t):Ut=wi?dr(e.stateNode.nextSibling):null;return!0}function Cs(){Ut=wi=null,pt=!1}function gh(){var e=An;return e!==null&&(Fi===null?Fi=e:Fi.push.apply(Fi,e),An=null),e}function yo(e){An===null?An=[e]:An.push(e)}var vh=B(null),Es=null,nn=null;function Mn(e,t,n){X(vh,t._currentValue),t._currentValue=n}function sn(e){e._currentValue=vh.current,F(vh)}function _h(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function yh(e,t,n,o){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var S=p.dependencies;if(S!==null){var M=p.child;S=S.firstContext;e:for(;S!==null;){var U=S;S=p;for(var J=0;J<t.length;J++)if(U.context===t[J]){S.lanes|=n,U=S.alternate,U!==null&&(U.lanes|=n),_h(S.return,n,e),o||(M=null);break e}S=U.next}}else if(p.tag===18){if(M=p.return,M===null)throw Error(a(341));M.lanes|=n,S=M.alternate,S!==null&&(S.lanes|=n),_h(M,n,e),M=null}else M=p.child;if(M!==null)M.return=p;else for(M=p;M!==null;){if(M===e){M=null;break}if(p=M.sibling,p!==null){p.return=M.return,M=p;break}M=M.return}p=M}}function ma(e,t,n,o){e=null;for(var p=t,S=!1;p!==null;){if(!S){if((p.flags&524288)!==0)S=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var M=p.alternate;if(M===null)throw Error(a(387));if(M=M.memoizedProps,M!==null){var U=p.type;Gi(p.pendingProps.value,M.value)||(e!==null?e.push(U):e=[U])}}else if(p===j.current){if(M=p.alternate,M===null)throw Error(a(387));M.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}p=p.return}e!==null&&yh(t,e,n,o),t.flags|=262144}function Yl(e){for(e=e.firstContext;e!==null;){if(!Gi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xs(e){Es=e,nn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ci(e){return Rp(Es,e)}function Gl(e,t){return Es===null&&xs(e),Rp(e,t)}function Rp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},nn===null){if(e===null)throw Error(a(308));nn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else nn=nn.next=t;return n}var RS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},TS=i.unstable_scheduleCallback,DS=i.unstable_NormalPriority,ai={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bh(){return{controller:new RS,data:new Map,refCount:0}}function bo(e){e.refCount--,e.refCount===0&&TS(DS,function(){e.controller.abort()})}var So=null,Sh=0,pa=0,ga=null;function OS(e,t){if(So===null){var n=So=[];Sh=0,pa=Ed(),ga={status:"pending",value:void 0,then:function(o){n.push(o)}}}return Sh++,t.then(Tp,Tp),t}function Tp(){if(--Sh===0&&So!==null){ga!==null&&(ga.status="fulfilled");var e=So;So=null,pa=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function AS(e,t){var n=[],o={status:"pending",value:null,reason:null,then:function(p){n.push(p)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var p=0;p<n.length;p++)(0,n[p])(t)},function(p){for(o.status="rejected",o.reason=p,p=0;p<n.length;p++)(0,n[p])(void 0)}),o}var Dp=q.S;q.S=function(e,t){hv=Be(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&OS(e,t),Dp!==null&&Dp(e,t)};var Rs=B(null);function wh(){var e=Rs.current;return e!==null?e:jt.pooledCache}function Xl(e,t){t===null?X(Rs,Rs.current):X(Rs,t.pool)}function Op(){var e=wh();return e===null?null:{parent:ai._currentValue,pool:e}}var va=Error(a(460)),Ch=Error(a(474)),Ql=Error(a(542)),Zl={then:function(){}};function Ap(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jr,Jr),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kp(e),e;default:if(typeof t.status=="string")t.then(Jr,Jr);else{if(e=jt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var p=t;p.status="fulfilled",p.value=o}},function(o){if(t.status==="pending"){var p=t;p.status="rejected",p.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kp(e),e}throw Ds=t,va}}function Ts(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ds=n,va):n}}var Ds=null;function Mp(){if(Ds===null)throw Error(a(459));var e=Ds;return Ds=null,e}function kp(e){if(e===va||e===Ql)throw Error(a(483))}var _a=null,wo=0;function Jl(e){var t=wo;return wo+=1,_a===null&&(_a=[]),Lp(_a,e,t)}function Co(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ec(e,t){throw t.$$typeof===w?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Bp(e){function t(se,ie){if(e){var ce=se.deletions;ce===null?(se.deletions=[ie],se.flags|=16):ce.push(ie)}}function n(se,ie){if(!e)return null;for(;ie!==null;)t(se,ie),ie=ie.sibling;return null}function o(se){for(var ie=new Map;se!==null;)se.key!==null?ie.set(se.key,se):ie.set(se.index,se),se=se.sibling;return ie}function p(se,ie){return se=tn(se,ie),se.index=0,se.sibling=null,se}function S(se,ie,ce){return se.index=ce,e?(ce=se.alternate,ce!==null?(ce=ce.index,ce<ie?(se.flags|=67108866,ie):ce):(se.flags|=67108866,ie)):(se.flags|=1048576,ie)}function M(se){return e&&se.alternate===null&&(se.flags|=67108866),se}function U(se,ie,ce,_e){return ie===null||ie.tag!==6?(ie=hh(ce,se.mode,_e),ie.return=se,ie):(ie=p(ie,ce),ie.return=se,ie)}function J(se,ie,ce,_e){var Ke=ce.type;return Ke===D?ve(se,ie,ce.props.children,_e,ce.key):ie!==null&&(ie.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===x&&Ts(Ke)===ie.type)?(ie=p(ie,ce.props),Co(ie,ce),ie.return=se,ie):(ie=Vl(ce.type,ce.key,ce.props,null,se.mode,_e),Co(ie,ce),ie.return=se,ie)}function ue(se,ie,ce,_e){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ce.containerInfo||ie.stateNode.implementation!==ce.implementation?(ie=dh(ce,se.mode,_e),ie.return=se,ie):(ie=p(ie,ce.children||[]),ie.return=se,ie)}function ve(se,ie,ce,_e,Ke){return ie===null||ie.tag!==7?(ie=ws(ce,se.mode,_e,Ke),ie.return=se,ie):(ie=p(ie,ce),ie.return=se,ie)}function be(se,ie,ce){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=hh(""+ie,se.mode,ce),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:return ce=Vl(ie.type,ie.key,ie.props,null,se.mode,ce),Co(ce,ie),ce.return=se,ce;case R:return ie=dh(ie,se.mode,ce),ie.return=se,ie;case x:return ie=Ts(ie),be(se,ie,ce)}if(W(ie)||P(ie))return ie=ws(ie,se.mode,ce,null),ie.return=se,ie;if(typeof ie.then=="function")return be(se,Jl(ie),ce);if(ie.$$typeof===y)return be(se,Gl(se,ie),ce);ec(se,ie)}return null}function fe(se,ie,ce,_e){var Ke=ie!==null?ie.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ke!==null?null:U(se,ie,""+ce,_e);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case C:return ce.key===Ke?J(se,ie,ce,_e):null;case R:return ce.key===Ke?ue(se,ie,ce,_e):null;case x:return ce=Ts(ce),fe(se,ie,ce,_e)}if(W(ce)||P(ce))return Ke!==null?null:ve(se,ie,ce,_e,null);if(typeof ce.then=="function")return fe(se,ie,Jl(ce),_e);if(ce.$$typeof===y)return fe(se,ie,Gl(se,ce),_e);ec(se,ce)}return null}function ge(se,ie,ce,_e,Ke){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return se=se.get(ce)||null,U(ie,se,""+_e,Ke);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case C:return se=se.get(_e.key===null?ce:_e.key)||null,J(ie,se,_e,Ke);case R:return se=se.get(_e.key===null?ce:_e.key)||null,ue(ie,se,_e,Ke);case x:return _e=Ts(_e),ge(se,ie,ce,_e,Ke)}if(W(_e)||P(_e))return se=se.get(ce)||null,ve(ie,se,_e,Ke,null);if(typeof _e.then=="function")return ge(se,ie,ce,Jl(_e),Ke);if(_e.$$typeof===y)return ge(se,ie,ce,Gl(ie,_e),Ke);ec(ie,_e)}return null}function Ne(se,ie,ce,_e){for(var Ke=null,wt=null,Ie=ie,tt=ie=0,ht=null;Ie!==null&&tt<ce.length;tt++){Ie.index>tt?(ht=Ie,Ie=null):ht=Ie.sibling;var Ct=fe(se,Ie,ce[tt],_e);if(Ct===null){Ie===null&&(Ie=ht);break}e&&Ie&&Ct.alternate===null&&t(se,Ie),ie=S(Ct,ie,tt),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct,Ie=ht}if(tt===ce.length)return n(se,Ie),pt&&rn(se,tt),Ke;if(Ie===null){for(;tt<ce.length;tt++)Ie=be(se,ce[tt],_e),Ie!==null&&(ie=S(Ie,ie,tt),wt===null?Ke=Ie:wt.sibling=Ie,wt=Ie);return pt&&rn(se,tt),Ke}for(Ie=o(Ie);tt<ce.length;tt++)ht=ge(Ie,se,tt,ce[tt],_e),ht!==null&&(e&&ht.alternate!==null&&Ie.delete(ht.key===null?tt:ht.key),ie=S(ht,ie,tt),wt===null?Ke=ht:wt.sibling=ht,wt=ht);return e&&Ie.forEach(function(Xn){return t(se,Xn)}),pt&&rn(se,tt),Ke}function We(se,ie,ce,_e){if(ce==null)throw Error(a(151));for(var Ke=null,wt=null,Ie=ie,tt=ie=0,ht=null,Ct=ce.next();Ie!==null&&!Ct.done;tt++,Ct=ce.next()){Ie.index>tt?(ht=Ie,Ie=null):ht=Ie.sibling;var Xn=fe(se,Ie,Ct.value,_e);if(Xn===null){Ie===null&&(Ie=ht);break}e&&Ie&&Xn.alternate===null&&t(se,Ie),ie=S(Xn,ie,tt),wt===null?Ke=Xn:wt.sibling=Xn,wt=Xn,Ie=ht}if(Ct.done)return n(se,Ie),pt&&rn(se,tt),Ke;if(Ie===null){for(;!Ct.done;tt++,Ct=ce.next())Ct=be(se,Ct.value,_e),Ct!==null&&(ie=S(Ct,ie,tt),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct);return pt&&rn(se,tt),Ke}for(Ie=o(Ie);!Ct.done;tt++,Ct=ce.next())Ct=ge(Ie,se,tt,Ct.value,_e),Ct!==null&&(e&&Ct.alternate!==null&&Ie.delete(Ct.key===null?tt:Ct.key),ie=S(Ct,ie,tt),wt===null?Ke=Ct:wt.sibling=Ct,wt=Ct);return e&&Ie.forEach(function(Uw){return t(se,Uw)}),pt&&rn(se,tt),Ke}function Nt(se,ie,ce,_e){if(typeof ce=="object"&&ce!==null&&ce.type===D&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case C:e:{for(var Ke=ce.key;ie!==null;){if(ie.key===Ke){if(Ke=ce.type,Ke===D){if(ie.tag===7){n(se,ie.sibling),_e=p(ie,ce.props.children),_e.return=se,se=_e;break e}}else if(ie.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===x&&Ts(Ke)===ie.type){n(se,ie.sibling),_e=p(ie,ce.props),Co(_e,ce),_e.return=se,se=_e;break e}n(se,ie);break}else t(se,ie);ie=ie.sibling}ce.type===D?(_e=ws(ce.props.children,se.mode,_e,ce.key),_e.return=se,se=_e):(_e=Vl(ce.type,ce.key,ce.props,null,se.mode,_e),Co(_e,ce),_e.return=se,se=_e)}return M(se);case R:e:{for(Ke=ce.key;ie!==null;){if(ie.key===Ke)if(ie.tag===4&&ie.stateNode.containerInfo===ce.containerInfo&&ie.stateNode.implementation===ce.implementation){n(se,ie.sibling),_e=p(ie,ce.children||[]),_e.return=se,se=_e;break e}else{n(se,ie);break}else t(se,ie);ie=ie.sibling}_e=dh(ce,se.mode,_e),_e.return=se,se=_e}return M(se);case x:return ce=Ts(ce),Nt(se,ie,ce,_e)}if(W(ce))return Ne(se,ie,ce,_e);if(P(ce)){if(Ke=P(ce),typeof Ke!="function")throw Error(a(150));return ce=Ke.call(ce),We(se,ie,ce,_e)}if(typeof ce.then=="function")return Nt(se,ie,Jl(ce),_e);if(ce.$$typeof===y)return Nt(se,ie,Gl(se,ce),_e);ec(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ie!==null&&ie.tag===6?(n(se,ie.sibling),_e=p(ie,ce),_e.return=se,se=_e):(n(se,ie),_e=hh(ce,se.mode,_e),_e.return=se,se=_e),M(se)):n(se,ie)}return function(se,ie,ce,_e){try{wo=0;var Ke=Nt(se,ie,ce,_e);return _a=null,Ke}catch(Ie){if(Ie===va||Ie===Ql)throw Ie;var wt=Xi(29,Ie,null,se.mode);return wt.lanes=_e,wt.return=se,wt}finally{}}}var Os=Bp(!0),Np=Bp(!1),kn=!1;function Eh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Bn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Et&2)!==0){var p=o.pending;return p===null?t.next=t:(t.next=p.next,p.next=t),o.pending=t,t=Kl(e),_p(e,null,n),t}return $l(e,o,t,n),Kl(e)}function Eo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Q(e,n)}}function Rh(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var p=null,S=null;if(n=n.firstBaseUpdate,n!==null){do{var M={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};S===null?p=S=M:S=S.next=M,n=n.next}while(n!==null);S===null?p=S=t:S=S.next=t}else p=S=t;n={baseState:o.baseState,firstBaseUpdate:p,lastBaseUpdate:S,shared:o.shared,callbacks:o.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Th=!1;function xo(){if(Th){var e=ga;if(e!==null)throw e}}function Ro(e,t,n,o){Th=!1;var p=e.updateQueue;kn=!1;var S=p.firstBaseUpdate,M=p.lastBaseUpdate,U=p.shared.pending;if(U!==null){p.shared.pending=null;var J=U,ue=J.next;J.next=null,M===null?S=ue:M.next=ue,M=J;var ve=e.alternate;ve!==null&&(ve=ve.updateQueue,U=ve.lastBaseUpdate,U!==M&&(U===null?ve.firstBaseUpdate=ue:U.next=ue,ve.lastBaseUpdate=J))}if(S!==null){var be=p.baseState;M=0,ve=ue=J=null,U=S;do{var fe=U.lane&-536870913,ge=fe!==U.lane;if(ge?(ut&fe)===fe:(o&fe)===fe){fe!==0&&fe===pa&&(Th=!0),ve!==null&&(ve=ve.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ne=e,We=U;fe=t;var Nt=n;switch(We.tag){case 1:if(Ne=We.payload,typeof Ne=="function"){be=Ne.call(Nt,be,fe);break e}be=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=We.payload,fe=typeof Ne=="function"?Ne.call(Nt,be,fe):Ne,fe==null)break e;be=d({},be,fe);break e;case 2:kn=!0}}fe=U.callback,fe!==null&&(e.flags|=64,ge&&(e.flags|=8192),ge=p.callbacks,ge===null?p.callbacks=[fe]:ge.push(fe))}else ge={lane:fe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ve===null?(ue=ve=ge,J=be):ve=ve.next=ge,M|=fe;if(U=U.next,U===null){if(U=p.shared.pending,U===null)break;ge=U,U=ge.next,ge.next=null,p.lastBaseUpdate=ge,p.shared.pending=null}}while(!0);ve===null&&(J=be),p.baseState=J,p.firstBaseUpdate=ue,p.lastBaseUpdate=ve,S===null&&(p.shared.lanes=0),In|=M,e.lanes=M,e.memoizedState=be}}function jp(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Hp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jp(n[e],t)}var ya=B(null),tc=B(0);function Pp(e,t){e=mn,X(tc,e),X(ya,t),mn=e|t.baseLanes}function Dh(){X(tc,mn),X(ya,ya.current)}function Oh(){mn=tc.current,F(ya),F(tc)}var Qi=B(null),hr=null;function jn(e){var t=e.alternate;X(ri,ri.current&1),X(Qi,e),hr===null&&(t===null||ya.current!==null||t.memoizedState!==null)&&(hr=e)}function Ah(e){X(ri,ri.current),X(Qi,e),hr===null&&(hr=e)}function zp(e){e.tag===22?(X(ri,ri.current),X(Qi,e),hr===null&&(hr=e)):Hn()}function Hn(){X(ri,ri.current),X(Qi,Qi.current)}function Zi(e){F(Qi),hr===e&&(hr=null),F(ri)}var ri=B(0);function ic(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||jd(n)||Hd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var an=0,Je=null,kt=null,oi=null,rc=!1,ba=!1,As=!1,nc=0,To=0,Sa=null,LS=0;function Gt(){throw Error(a(321))}function Lh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gi(e[n],t[n]))return!1;return!0}function Mh(e,t,n,o,p,S){return an=S,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?wg:Wh,As=!1,S=n(o,p),As=!1,ba&&(S=Up(t,n,o,p)),Ip(e),S}function Ip(e){q.H=Ao;var t=kt!==null&&kt.next!==null;if(an=0,oi=kt=Je=null,rc=!1,To=0,Sa=null,t)throw Error(a(300));e===null||li||(e=e.dependencies,e!==null&&Yl(e)&&(li=!0))}function Up(e,t,n,o){Je=e;var p=0;do{if(ba&&(Sa=null),To=0,ba=!1,25<=p)throw Error(a(301));if(p+=1,oi=kt=null,e.updateQueue!=null){var S=e.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}q.H=Cg,S=t(n,o)}while(ba);return S}function MS(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Do(t):t,e=e.useState()[0],(kt!==null?kt.memoizedState:null)!==e&&(Je.flags|=1024),t}function kh(){var e=nc!==0;return nc=0,e}function Bh(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nh(e){if(rc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}rc=!1}an=0,oi=kt=Je=null,ba=!1,To=nc=0,Sa=null}function Li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oi===null?Je.memoizedState=oi=e:oi=oi.next=e,oi}function ni(){if(kt===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=kt.next;var t=oi===null?Je.memoizedState:oi.next;if(t!==null)oi=t,kt=e;else{if(e===null)throw Je.alternate===null?Error(a(467)):Error(a(310));kt=e,e={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},oi===null?Je.memoizedState=oi=e:oi=oi.next=e}return oi}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=To;return To+=1,Sa===null&&(Sa=[]),e=Lp(Sa,e,t),t=Je,(oi===null?t.memoizedState:oi.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?wg:Wh),e}function ac(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Do(e);if(e.$$typeof===y)return Ci(e)}throw Error(a(438,String(e)))}function jh(e){var t=null,n=Je.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var o=Je.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(p){return p.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=sc(),Je.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),o=0;o<e;o++)n[o]=I;return t.index++,n}function on(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=ni();return Hh(t,kt,e)}function Hh(e,t,n){var o=e.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var p=e.baseQueue,S=o.pending;if(S!==null){if(p!==null){var M=p.next;p.next=S.next,S.next=M}t.baseQueue=p=S,o.pending=null}if(S=e.baseState,p===null)e.memoizedState=S;else{t=p.next;var U=M=null,J=null,ue=t,ve=!1;do{var be=ue.lane&-536870913;if(be!==ue.lane?(ut&be)===be:(an&be)===be){var fe=ue.revertLane;if(fe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),be===pa&&(ve=!0);else if((an&fe)===fe){ue=ue.next,fe===pa&&(ve=!0);continue}else be={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},J===null?(U=J=be,M=S):J=J.next=be,Je.lanes|=fe,In|=fe;be=ue.action,As&&n(S,be),S=ue.hasEagerState?ue.eagerState:n(S,be)}else fe={lane:be,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},J===null?(U=J=fe,M=S):J=J.next=fe,Je.lanes|=be,In|=be;ue=ue.next}while(ue!==null&&ue!==t);if(J===null?M=S:J.next=U,!Gi(S,e.memoizedState)&&(li=!0,ve&&(n=ga,n!==null)))throw n;e.memoizedState=S,e.baseState=M,e.baseQueue=J,o.lastRenderedState=S}return p===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Ph(e){var t=ni(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var o=n.dispatch,p=n.pending,S=t.memoizedState;if(p!==null){n.pending=null;var M=p=p.next;do S=e(S,M.action),M=M.next;while(M!==p);Gi(S,t.memoizedState)||(li=!0),t.memoizedState=S,t.baseQueue===null&&(t.baseState=S),n.lastRenderedState=S}return[S,o]}function Fp(e,t,n){var o=Je,p=ni(),S=pt;if(S){if(n===void 0)throw Error(a(407));n=n()}else n=t();var M=!Gi((kt||p).memoizedState,n);if(M&&(p.memoizedState=n,li=!0),p=p.queue,Uh(Kp.bind(null,o,p,e),[e]),p.getSnapshot!==t||M||oi!==null&&oi.memoizedState.tag&1){if(o.flags|=2048,wa(9,{destroy:void 0},$p.bind(null,o,p,n,t),null),jt===null)throw Error(a(349));S||(an&127)!==0||qp(o,t,n)}return n}function qp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t=sc(),Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $p(e,t,n,o){t.value=n,t.getSnapshot=o,Vp(t)&&Wp(e)}function Kp(e,t,n){return n(function(){Vp(t)&&Wp(e)})}function Vp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gi(e,n)}catch{return!0}}function Wp(e){var t=Ss(e,2);t!==null&&qi(t,e,2)}function zh(e){var t=Li();if(typeof e=="function"){var n=e;if(e=n(),As){ei(!0);try{n()}finally{ei(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t}function Yp(e,t,n,o){return e.baseState=n,Hh(e,kt,typeof o=="function"?o:on)}function kS(e,t,n,o,p){if(uc(e))throw Error(a(485));if(e=t.action,e!==null){var S={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){S.listeners.push(M)}};q.T!==null?n(!0):S.isTransition=!1,o(S),n=t.pending,n===null?(S.next=t.pending=S,Gp(t,S)):(S.next=n.next,t.pending=n.next=S)}}function Gp(e,t){var n=t.action,o=t.payload,p=e.state;if(t.isTransition){var S=q.T,M={};q.T=M;try{var U=n(p,o),J=q.S;J!==null&&J(M,U),Xp(e,t,U)}catch(ue){Ih(e,t,ue)}finally{S!==null&&M.types!==null&&(S.types=M.types),q.T=S}}else try{S=n(p,o),Xp(e,t,S)}catch(ue){Ih(e,t,ue)}}function Xp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(o){Qp(e,t,o)},function(o){return Ih(e,t,o)}):Qp(e,t,n)}function Qp(e,t,n){t.status="fulfilled",t.value=n,Zp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gp(e,n)))}function Ih(e,t,n){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=n,Zp(t),t=t.next;while(t!==o)}e.action=null}function Zp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jp(e,t){return t}function eg(e,t){if(pt){var n=jt.formState;if(n!==null){e:{var o=Je;if(pt){if(Ut){t:{for(var p=Ut,S=ur;p.nodeType!==8;){if(!S){p=null;break t}if(p=dr(p.nextSibling),p===null){p=null;break t}}S=p.data,p=S==="F!"||S==="F"?p:null}if(p){Ut=dr(p.nextSibling),o=p.data==="F!";break e}}Ln(o)}o=!1}o&&(t=n[0])}}return n=Li(),n.memoizedState=n.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jp,lastRenderedState:t},n.queue=o,n=yg.bind(null,Je,o),o.dispatch=n,o=zh(!1),S=Vh.bind(null,Je,!1,o.queue),o=Li(),p={state:t,dispatch:null,action:e,pending:null},o.queue=p,n=kS.bind(null,Je,p,S,n),p.dispatch=n,o.memoizedState=e,[t,n,!1]}function tg(e){var t=ni();return ig(t,kt,e)}function ig(e,t,n){if(t=Hh(e,t,Jp)[0],e=oc(on)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Do(t)}catch(M){throw M===va?Ql:M}else o=t;t=ni();var p=t.queue,S=p.dispatch;return n!==t.memoizedState&&(Je.flags|=2048,wa(9,{destroy:void 0},BS.bind(null,p,n),null)),[o,S,e]}function BS(e,t){e.action=t}function rg(e){var t=ni(),n=kt;if(n!==null)return ig(t,n,e);ni(),t=t.memoizedState,n=ni();var o=n.queue.dispatch;return n.memoizedState=e,[t,o,!1]}function wa(e,t,n,o){return e={tag:e,create:n,deps:o,inst:t,next:null},t=Je.updateQueue,t===null&&(t=sc(),Je.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e),e}function ng(){return ni().memoizedState}function lc(e,t,n,o){var p=Li();Je.flags|=e,p.memoizedState=wa(1|t,{destroy:void 0},n,o===void 0?null:o)}function cc(e,t,n,o){var p=ni();o=o===void 0?null:o;var S=p.memoizedState.inst;kt!==null&&o!==null&&Lh(o,kt.memoizedState.deps)?p.memoizedState=wa(t,S,n,o):(Je.flags|=e,p.memoizedState=wa(1|t,S,n,o))}function sg(e,t){lc(8390656,8,e,t)}function Uh(e,t){cc(2048,8,e,t)}function NS(e){Je.flags|=4;var t=Je.updateQueue;if(t===null)t=sc(),Je.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ag(e){var t=ni().memoizedState;return NS({ref:t,nextImpl:e}),function(){if((Et&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function og(e,t){return cc(4,2,e,t)}function lg(e,t){return cc(4,4,e,t)}function cg(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ug(e,t,n){n=n!=null?n.concat([e]):null,cc(4,4,cg.bind(null,t,e),n)}function Fh(){}function hg(e,t){var n=ni();t=t===void 0?null:t;var o=n.memoizedState;return t!==null&&Lh(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function dg(e,t){var n=ni();t=t===void 0?null:t;var o=n.memoizedState;if(t!==null&&Lh(t,o[1]))return o[0];if(o=e(),As){ei(!0);try{e()}finally{ei(!1)}}return n.memoizedState=[o,t],o}function qh(e,t,n){return n===void 0||(an&1073741824)!==0&&(ut&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=fv(),Je.lanes|=e,In|=e,n)}function fg(e,t,n,o){return Gi(n,t)?n:ya.current!==null?(e=qh(e,n,o),Gi(e,t)||(li=!0),e):(an&42)===0||(an&1073741824)!==0&&(ut&261930)===0?(li=!0,e.memoizedState=n):(e=fv(),Je.lanes|=e,In|=e,t)}function mg(e,t,n,o,p){var S=Y.p;Y.p=S!==0&&8>S?S:8;var M=q.T,U={};q.T=U,Vh(e,!1,t,n);try{var J=p(),ue=q.S;if(ue!==null&&ue(U,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=AS(J,o);Oo(e,t,ve,tr(e))}else Oo(e,t,o,tr(e))}catch(be){Oo(e,t,{then:function(){},status:"rejected",reason:be},tr())}finally{Y.p=S,M!==null&&U.types!==null&&(M.types=U.types),q.T=M}}function jS(){}function $h(e,t,n,o){if(e.tag!==5)throw Error(a(476));var p=pg(e).queue;mg(e,p,t,k,n===null?jS:function(){return gg(e),n(o)})}function pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:k,baseState:k,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:k},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gg(e){var t=pg(e);t.next===null&&(t=e.alternate.memoizedState),Oo(e,t.next.queue,{},tr())}function Kh(){return Ci(Vo)}function vg(){return ni().memoizedState}function _g(){return ni().memoizedState}function HS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=tr();e=Bn(n);var o=Nn(t,e,n);o!==null&&(qi(o,t,n),Eo(o,t,n)),t={cache:bh()},e.payload=t;return}t=t.return}}function PS(e,t,n){var o=tr();n={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?bg(t,n):(n=ch(e,t,n,o),n!==null&&(qi(n,e,o),Sg(n,t,o)))}function yg(e,t,n){var o=tr();Oo(e,t,n,o)}function Oo(e,t,n,o){var p={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))bg(t,p);else{var S=e.alternate;if(e.lanes===0&&(S===null||S.lanes===0)&&(S=t.lastRenderedReducer,S!==null))try{var M=t.lastRenderedState,U=S(M,n);if(p.hasEagerState=!0,p.eagerState=U,Gi(U,M))return $l(e,t,p,0),jt===null&&ql(),!1}catch{}finally{}if(n=ch(e,t,p,o),n!==null)return qi(n,e,o),Sg(n,t,o),!0}return!1}function Vh(e,t,n,o){if(o={lane:2,revertLane:Ed(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(a(479))}else t=ch(e,n,o,2),t!==null&&qi(t,e,2)}function uc(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function bg(e,t){ba=rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sg(e,t,n){if((n&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,Q(e,n)}}var Ao={readContext:Ci,use:ac,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};Ao.useEffectEvent=Gt;var wg={readContext:Ci,use:ac,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:Ci,useEffect:sg,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,lc(4194308,4,cg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return lc(4194308,4,e,t)},useInsertionEffect:function(e,t){lc(4,2,e,t)},useMemo:function(e,t){var n=Li();t=t===void 0?null:t;var o=e();if(As){ei(!0);try{e()}finally{ei(!1)}}return n.memoizedState=[o,t],o},useReducer:function(e,t,n){var o=Li();if(n!==void 0){var p=n(t);if(As){ei(!0);try{n(t)}finally{ei(!1)}}}else p=t;return o.memoizedState=o.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},o.queue=e,e=e.dispatch=PS.bind(null,Je,e),[o.memoizedState,e]},useRef:function(e){var t=Li();return e={current:e},t.memoizedState=e},useState:function(e){e=zh(e);var t=e.queue,n=yg.bind(null,Je,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fh,useDeferredValue:function(e,t){var n=Li();return qh(n,e,t)},useTransition:function(){var e=zh(!1);return e=mg.bind(null,Je,e.queue,!0,!1),Li().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=Je,p=Li();if(pt){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),jt===null)throw Error(a(349));(ut&127)!==0||qp(o,t,n)}p.memoizedState=n;var S={value:n,getSnapshot:t};return p.queue=S,sg(Kp.bind(null,o,S,e),[e]),o.flags|=2048,wa(9,{destroy:void 0},$p.bind(null,o,S,n,t),null),n},useId:function(){var e=Li(),t=jt.identifierPrefix;if(pt){var n=Hr,o=jr;n=(o&~(1<<32-Tt(o)-1)).toString(32)+n,t="_"+t+"R_"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=LS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kh,useFormState:eg,useActionState:eg,useOptimistic:function(e){var t=Li();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vh.bind(null,Je,!0,n),n.dispatch=t,[e,t]},useMemoCache:jh,useCacheRefresh:function(){return Li().memoizedState=HS.bind(null,Je)},useEffectEvent:function(e){var t=Li(),n={impl:e};return t.memoizedState=n,function(){if((Et&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Wh={readContext:Ci,use:ac,useCallback:hg,useContext:Ci,useEffect:Uh,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:lg,useMemo:dg,useReducer:oc,useRef:ng,useState:function(){return oc(on)},useDebugValue:Fh,useDeferredValue:function(e,t){var n=ni();return fg(n,kt.memoizedState,e,t)},useTransition:function(){var e=oc(on)[0],t=ni().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Fp,useId:vg,useHostTransitionStatus:Kh,useFormState:tg,useActionState:tg,useOptimistic:function(e,t){var n=ni();return Yp(n,kt,e,t)},useMemoCache:jh,useCacheRefresh:_g};Wh.useEffectEvent=ag;var Cg={readContext:Ci,use:ac,useCallback:hg,useContext:Ci,useEffect:Uh,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:lg,useMemo:dg,useReducer:Ph,useRef:ng,useState:function(){return Ph(on)},useDebugValue:Fh,useDeferredValue:function(e,t){var n=ni();return kt===null?qh(n,e,t):fg(n,kt.memoizedState,e,t)},useTransition:function(){var e=Ph(on)[0],t=ni().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Fp,useId:vg,useHostTransitionStatus:Kh,useFormState:rg,useActionState:rg,useOptimistic:function(e,t){var n=ni();return kt!==null?Yp(n,kt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jh,useCacheRefresh:_g};Cg.useEffectEvent=ag;function Yh(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:d({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gh={enqueueSetState:function(e,t,n){e=e._reactInternals;var o=tr(),p=Bn(o);p.payload=t,n!=null&&(p.callback=n),t=Nn(e,p,o),t!==null&&(qi(t,e,o),Eo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=tr(),p=Bn(o);p.tag=1,p.payload=t,n!=null&&(p.callback=n),t=Nn(e,p,o),t!==null&&(qi(t,e,o),Eo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tr(),o=Bn(n);o.tag=2,t!=null&&(o.callback=t),t=Nn(e,o,n),t!==null&&(qi(t,e,n),Eo(t,e,n))}};function Eg(e,t,n,o,p,S,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,S,M):t.prototype&&t.prototype.isPureReactComponent?!go(n,o)||!go(p,S):!0}function xg(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&Gh.enqueueReplaceState(t,t.state,null)}function Ls(e,t){var n=t;if("ref"in t){n={};for(var o in t)o!=="ref"&&(n[o]=t[o])}if(e=e.defaultProps){n===t&&(n=d({},n));for(var p in e)n[p]===void 0&&(n[p]=e[p])}return n}function Rg(e){Fl(e)}function Tg(e){console.error(e)}function Dg(e){Fl(e)}function hc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Og(e,t,n){try{var o=e.onCaughtError;o(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Xh(e,t,n){return n=Bn(n),n.tag=3,n.payload={element:null},n.callback=function(){hc(e,t)},n}function Ag(e){return e=Bn(e),e.tag=3,e}function Lg(e,t,n,o){var p=n.type.getDerivedStateFromError;if(typeof p=="function"){var S=o.value;e.payload=function(){return p(S)},e.callback=function(){Og(t,n,o)}}var M=n.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){Og(t,n,o),typeof p!="function"&&(Un===null?Un=new Set([this]):Un.add(this));var U=o.stack;this.componentDidCatch(o.value,{componentStack:U!==null?U:""})})}function zS(e,t,n,o,p){if(n.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=n.alternate,t!==null&&ma(t,n,p,!0),n=Qi.current,n!==null){switch(n.tag){case 31:case 13:return hr===null?Cc():n.alternate===null&&Xt===0&&(Xt=3),n.flags&=-257,n.flags|=65536,n.lanes=p,o===Zl?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([o]):t.add(o),Sd(e,o,p)),!1;case 22:return n.flags|=65536,o===Zl?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([o]):n.add(o)),Sd(e,o,p)),!1}throw Error(a(435,n.tag))}return Sd(e,o,p),Cc(),!1}if(pt)return t=Qi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=p,o!==ph&&(e=Error(a(422),{cause:o}),yo(or(e,n)))):(o!==ph&&(t=Error(a(423),{cause:o}),yo(or(t,n))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,o=or(o,n),p=Xh(e.stateNode,o,p),Rh(e,p),Xt!==4&&(Xt=2)),!1;var S=Error(a(520),{cause:o});if(S=or(S,n),Po===null?Po=[S]:Po.push(S),Xt!==4&&(Xt=2),t===null)return!0;o=or(o,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=p&-p,n.lanes|=e,e=Xh(n.stateNode,o,e),Rh(n,e),!1;case 1:if(t=n.type,S=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Un===null||!Un.has(S))))return n.flags|=65536,p&=-p,n.lanes|=p,p=Ag(p),Lg(p,e,n,o),Rh(n,p),!1}n=n.return}while(n!==null);return!1}var Qh=Error(a(461)),li=!1;function Ei(e,t,n,o){t.child=e===null?Np(t,null,n,o):Os(t,e.child,n,o)}function Mg(e,t,n,o,p){n=n.render;var S=t.ref;if("ref"in o){var M={};for(var U in o)U!=="ref"&&(M[U]=o[U])}else M=o;return xs(t),o=Mh(e,t,n,M,S,p),U=kh(),e!==null&&!li?(Bh(e,t,p),ln(e,t,p)):(pt&&U&&fh(t),t.flags|=1,Ei(e,t,o,p),t.child)}function kg(e,t,n,o,p){if(e===null){var S=n.type;return typeof S=="function"&&!uh(S)&&S.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=S,Bg(e,t,S,o,p)):(e=Vl(n.type,null,o,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(S=e.child,!sd(e,p)){var M=S.memoizedProps;if(n=n.compare,n=n!==null?n:go,n(M,o)&&e.ref===t.ref)return ln(e,t,p)}return t.flags|=1,e=tn(S,o),e.ref=t.ref,e.return=t,t.child=e}function Bg(e,t,n,o,p){if(e!==null){var S=e.memoizedProps;if(go(S,o)&&e.ref===t.ref)if(li=!1,t.pendingProps=o=S,sd(e,p))(e.flags&131072)!==0&&(li=!0);else return t.lanes=e.lanes,ln(e,t,p)}return Zh(e,t,n,o,p)}function Ng(e,t,n,o){var p=o.children,S=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(S=S!==null?S.baseLanes|n:n,e!==null){for(o=t.child=e.child,p=0;o!==null;)p=p|o.lanes|o.childLanes,o=o.sibling;o=p&~S}else o=0,t.child=null;return jg(e,t,S,n,o)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(t,S!==null?S.cachePool:null),S!==null?Pp(t,S):Dh(),zp(t);else return o=t.lanes=536870912,jg(e,t,S!==null?S.baseLanes|n:n,n,o)}else S!==null?(Xl(t,S.cachePool),Pp(t,S),Hn(),t.memoizedState=null):(e!==null&&Xl(t,null),Dh(),Hn());return Ei(e,t,p,n),t.child}function Lo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jg(e,t,n,o,p){var S=wh();return S=S===null?null:{parent:ai._currentValue,pool:S},t.memoizedState={baseLanes:n,cachePool:S},e!==null&&Xl(t,null),Dh(),zp(t),e!==null&&ma(e,t,o,!0),t.childLanes=p,null}function dc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hg(e,t,n){return Os(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,Zi(t),t.memoizedState=null,e}function IS(e,t,n){var o=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(pt){if(o.mode==="hidden")return e=dc(t,o),t.lanes=536870912,Lo(null,e);if(Ah(t),(e=Ut)?(e=Gv(e,ur),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:jr,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},n=bp(e),n.return=t,t.child=n,wi=t,Ut=null)):e=null,e===null)throw Ln(t);return t.lanes=536870912,null}return dc(t,o)}var S=e.memoizedState;if(S!==null){var M=S.dehydrated;if(Ah(t),p)if(t.flags&256)t.flags&=-257,t=Hg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(li||ma(e,t,n,!1),p=(n&e.childLanes)!==0,li||p){if(o=jt,o!==null&&(M=re(o,n),M!==0&&M!==S.retryLane))throw S.retryLane=M,Ss(e,M),qi(o,e,M),Qh;Cc(),t=Hg(e,t,n)}else e=S.treeContext,Ut=dr(M.nextSibling),wi=t,pt=!0,An=null,ur=!1,e!==null&&Cp(t,e),t=dc(t,o),t.flags|=4096;return t}return e=tn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Zh(e,t,n,o,p){return xs(t),n=Mh(e,t,n,o,void 0,p),o=kh(),e!==null&&!li?(Bh(e,t,p),ln(e,t,p)):(pt&&o&&fh(t),t.flags|=1,Ei(e,t,n,p),t.child)}function Pg(e,t,n,o,p,S){return xs(t),t.updateQueue=null,n=Up(t,o,n,p),Ip(e),o=kh(),e!==null&&!li?(Bh(e,t,S),ln(e,t,S)):(pt&&o&&fh(t),t.flags|=1,Ei(e,t,n,S),t.child)}function zg(e,t,n,o,p){if(xs(t),t.stateNode===null){var S=ua,M=n.contextType;typeof M=="object"&&M!==null&&(S=Ci(M)),S=new n(o,S),t.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Gh,t.stateNode=S,S._reactInternals=t,S=t.stateNode,S.props=o,S.state=t.memoizedState,S.refs={},Eh(t),M=n.contextType,S.context=typeof M=="object"&&M!==null?Ci(M):ua,S.state=t.memoizedState,M=n.getDerivedStateFromProps,typeof M=="function"&&(Yh(t,n,M,o),S.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(M=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),M!==S.state&&Gh.enqueueReplaceState(S,S.state,null),Ro(t,o,S,p),xo(),S.state=t.memoizedState),typeof S.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){S=t.stateNode;var U=t.memoizedProps,J=Ls(n,U);S.props=J;var ue=S.context,ve=n.contextType;M=ua,typeof ve=="object"&&ve!==null&&(M=Ci(ve));var be=n.getDerivedStateFromProps;ve=typeof be=="function"||typeof S.getSnapshotBeforeUpdate=="function",U=t.pendingProps!==U,ve||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(U||ue!==M)&&xg(t,S,o,M),kn=!1;var fe=t.memoizedState;S.state=fe,Ro(t,o,S,p),xo(),ue=t.memoizedState,U||fe!==ue||kn?(typeof be=="function"&&(Yh(t,n,be,o),ue=t.memoizedState),(J=kn||Eg(t,n,J,o,fe,ue,M))?(ve||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(t.flags|=4194308)):(typeof S.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=ue),S.props=o,S.state=ue,S.context=M,o=J):(typeof S.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{S=t.stateNode,xh(e,t),M=t.memoizedProps,ve=Ls(n,M),S.props=ve,be=t.pendingProps,fe=S.context,ue=n.contextType,J=ua,typeof ue=="object"&&ue!==null&&(J=Ci(ue)),U=n.getDerivedStateFromProps,(ue=typeof U=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==be||fe!==J)&&xg(t,S,o,J),kn=!1,fe=t.memoizedState,S.state=fe,Ro(t,o,S,p),xo();var ge=t.memoizedState;M!==be||fe!==ge||kn||e!==null&&e.dependencies!==null&&Yl(e.dependencies)?(typeof U=="function"&&(Yh(t,n,U,o),ge=t.memoizedState),(ve=kn||Eg(t,n,ve,o,fe,ge,J)||e!==null&&e.dependencies!==null&&Yl(e.dependencies))?(ue||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,ge,J),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,ge,J)),typeof S.componentDidUpdate=="function"&&(t.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&fe===e.memoizedState||(t.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&fe===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=ge),S.props=o,S.state=ge,S.context=J,o=ve):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&fe===e.memoizedState||(t.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&fe===e.memoizedState||(t.flags|=1024),o=!1)}return S=o,fc(e,t),o=(t.flags&128)!==0,S||o?(S=t.stateNode,n=o&&typeof n.getDerivedStateFromError!="function"?null:S.render(),t.flags|=1,e!==null&&o?(t.child=Os(t,e.child,null,p),t.child=Os(t,null,n,p)):Ei(e,t,n,p),t.memoizedState=S.state,e=t.child):e=ln(e,t,p),e}function Ig(e,t,n,o){return Cs(),t.flags|=256,Ei(e,t,n,o),t.child}var Jh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:Op()}}function td(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=er),e}function Ug(e,t,n){var o=t.pendingProps,p=!1,S=(t.flags&128)!==0,M;if((M=S)||(M=e!==null&&e.memoizedState===null?!1:(ri.current&2)!==0),M&&(p=!0,t.flags&=-129),M=(t.flags&32)!==0,t.flags&=-33,e===null){if(pt){if(p?jn(t):Hn(),(e=Ut)?(e=Gv(e,ur),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:On!==null?{id:jr,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},n=bp(e),n.return=t,t.child=n,wi=t,Ut=null)):e=null,e===null)throw Ln(t);return Hd(e)?t.lanes=32:t.lanes=536870912,null}var U=o.children;return o=o.fallback,p?(Hn(),p=t.mode,U=mc({mode:"hidden",children:U},p),o=ws(o,p,n,null),U.return=t,o.return=t,U.sibling=o,t.child=U,o=t.child,o.memoizedState=ed(n),o.childLanes=td(e,M,n),t.memoizedState=Jh,Lo(null,o)):(jn(t),id(t,U))}var J=e.memoizedState;if(J!==null&&(U=J.dehydrated,U!==null)){if(S)t.flags&256?(jn(t),t.flags&=-257,t=rd(e,t,n)):t.memoizedState!==null?(Hn(),t.child=e.child,t.flags|=128,t=null):(Hn(),U=o.fallback,p=t.mode,o=mc({mode:"visible",children:o.children},p),U=ws(U,p,n,null),U.flags|=2,o.return=t,U.return=t,o.sibling=U,t.child=o,Os(t,e.child,null,n),o=t.child,o.memoizedState=ed(n),o.childLanes=td(e,M,n),t.memoizedState=Jh,t=Lo(null,o));else if(jn(t),Hd(U)){if(M=U.nextSibling&&U.nextSibling.dataset,M)var ue=M.dgst;M=ue,o=Error(a(419)),o.stack="",o.digest=M,yo({value:o,source:null,stack:null}),t=rd(e,t,n)}else if(li||ma(e,t,n,!1),M=(n&e.childLanes)!==0,li||M){if(M=jt,M!==null&&(o=re(M,n),o!==0&&o!==J.retryLane))throw J.retryLane=o,Ss(e,o),qi(M,e,o),Qh;jd(U)||Cc(),t=rd(e,t,n)}else jd(U)?(t.flags|=192,t.child=e.child,t=null):(e=J.treeContext,Ut=dr(U.nextSibling),wi=t,pt=!0,An=null,ur=!1,e!==null&&Cp(t,e),t=id(t,o.children),t.flags|=4096);return t}return p?(Hn(),U=o.fallback,p=t.mode,J=e.child,ue=J.sibling,o=tn(J,{mode:"hidden",children:o.children}),o.subtreeFlags=J.subtreeFlags&65011712,ue!==null?U=tn(ue,U):(U=ws(U,p,n,null),U.flags|=2),U.return=t,o.return=t,o.sibling=U,t.child=o,Lo(null,o),o=t.child,U=e.child.memoizedState,U===null?U=ed(n):(p=U.cachePool,p!==null?(J=ai._currentValue,p=p.parent!==J?{parent:J,pool:J}:p):p=Op(),U={baseLanes:U.baseLanes|n,cachePool:p}),o.memoizedState=U,o.childLanes=td(e,M,n),t.memoizedState=Jh,Lo(e.child,o)):(jn(t),n=e.child,e=n.sibling,n=tn(n,{mode:"visible",children:o.children}),n.return=t,n.sibling=null,e!==null&&(M=t.deletions,M===null?(t.deletions=[e],t.flags|=16):M.push(e)),t.child=n,t.memoizedState=null,n)}function id(e,t){return t=mc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Xi(22,e,null,t),e.lanes=0,e}function rd(e,t,n){return Os(t,e.child,null,n),e=id(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fg(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),_h(e.return,t,n)}function nd(e,t,n,o,p,S){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:p,treeForkCount:S}:(M.isBackwards=t,M.rendering=null,M.renderingStartTime=0,M.last=o,M.tail=n,M.tailMode=p,M.treeForkCount=S)}function qg(e,t,n){var o=t.pendingProps,p=o.revealOrder,S=o.tail;o=o.children;var M=ri.current,U=(M&2)!==0;if(U?(M=M&1|2,t.flags|=128):M&=1,X(ri,M),Ei(e,t,o,n),o=pt?_o:0,!U&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fg(e,n,t);else if(e.tag===19)Fg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(p){case"forwards":for(n=t.child,p=null;n!==null;)e=n.alternate,e!==null&&ic(e)===null&&(p=n),n=n.sibling;n=p,n===null?(p=t.child,t.child=null):(p=n.sibling,n.sibling=null),nd(t,!1,p,n,S,o);break;case"backwards":case"unstable_legacy-backwards":for(n=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&ic(e)===null){t.child=p;break}e=p.sibling,p.sibling=n,n=p,p=e}nd(t,!0,n,null,S,o);break;case"together":nd(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),In|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ma(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=tn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=tn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Yl(e)))}function US(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),Mn(t,ai,e.memoizedState.cache),Cs();break;case 27:case 5:le(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:Mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ah(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(jn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Ug(e,t,n):(jn(t),e=ln(e,t,n),e!==null?e.sibling:null);jn(t);break;case 19:var p=(e.flags&128)!==0;if(o=(n&t.childLanes)!==0,o||(ma(e,t,n,!1),o=(n&t.childLanes)!==0),p){if(o)return qg(e,t,n);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),X(ri,ri.current),o)break;return null;case 22:return t.lanes=0,Ng(e,t,n,t.pendingProps);case 24:Mn(t,ai,e.memoizedState.cache)}return ln(e,t,n)}function $g(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)li=!0;else{if(!sd(e,n)&&(t.flags&128)===0)return li=!1,US(e,t,n);li=(e.flags&131072)!==0}else li=!1,pt&&(t.flags&1048576)!==0&&wp(t,_o,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ts(t.elementType),t.type=e,typeof e=="function")uh(e)?(o=Ls(e,o),t.tag=1,t=zg(null,t,e,o,n)):(t.tag=0,t=Zh(null,t,e,o,n));else{if(e!=null){var p=e.$$typeof;if(p===E){t.tag=11,t=Mg(null,t,e,o,n);break e}else if(p===O){t.tag=14,t=kg(null,t,e,o,n);break e}}throw t=Z(e)||e,Error(a(306,t,""))}}return t;case 0:return Zh(e,t,t.type,t.pendingProps,n);case 1:return o=t.type,p=Ls(o,t.pendingProps),zg(e,t,o,p,n);case 3:e:{if(G(t,t.stateNode.containerInfo),e===null)throw Error(a(387));o=t.pendingProps;var S=t.memoizedState;p=S.element,xh(e,t),Ro(t,o,null,n);var M=t.memoizedState;if(o=M.cache,Mn(t,ai,o),o!==S.cache&&yh(t,[ai],n,!0),xo(),o=M.element,S.isDehydrated)if(S={element:o,isDehydrated:!1,cache:M.cache},t.updateQueue.baseState=S,t.memoizedState=S,t.flags&256){t=Ig(e,t,o,n);break e}else if(o!==p){p=or(Error(a(424)),t),yo(p),t=Ig(e,t,o,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ut=dr(e.firstChild),wi=t,pt=!0,An=null,ur=!0,n=Np(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Cs(),o===p){t=ln(e,t,n);break e}Ei(e,t,o,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=t_(t.type,null,t.pendingProps,null))?t.memoizedState=n:pt||(n=t.type,e=t.pendingProps,o=Ac(pe.current).createElement(n),o[De]=t,o[Oe]=e,xi(o,n,e),Kt(o),t.stateNode=o):t.memoizedState=t_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&pt&&(o=t.stateNode=Zv(t.type,t.pendingProps,pe.current),wi=t,ur=!0,p=Ut,Kn(t.type)?(Pd=p,Ut=dr(o.firstChild)):Ut=p),Ei(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pt&&((p=o=Ut)&&(o=vw(o,t.type,t.pendingProps,ur),o!==null?(t.stateNode=o,wi=t,Ut=dr(o.firstChild),ur=!1,p=!0):p=!1),p||Ln(t)),le(t),p=t.type,S=t.pendingProps,M=e!==null?e.memoizedProps:null,o=S.children,kd(p,S)?o=null:M!==null&&kd(p,M)&&(t.flags|=32),t.memoizedState!==null&&(p=Mh(e,t,MS,null,null,n),Vo._currentValue=p),fc(e,t),Ei(e,t,o,n),t.child;case 6:return e===null&&pt&&((e=n=Ut)&&(n=_w(n,t.pendingProps,ur),n!==null?(t.stateNode=n,wi=t,Ut=null,e=!0):e=!1),e||Ln(t)),null;case 13:return Ug(e,t,n);case 4:return G(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Os(t,null,o,n):Ei(e,t,o,n),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,n);case 7:return Ei(e,t,t.pendingProps,n),t.child;case 8:return Ei(e,t,t.pendingProps.children,n),t.child;case 12:return Ei(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,Mn(t,t.type,o.value),Ei(e,t,o.children,n),t.child;case 9:return p=t.type._context,o=t.pendingProps.children,xs(t),p=Ci(p),o=o(p),t.flags|=1,Ei(e,t,o,n),t.child;case 14:return kg(e,t,t.type,t.pendingProps,n);case 15:return Bg(e,t,t.type,t.pendingProps,n);case 19:return qg(e,t,n);case 31:return IS(e,t,n);case 22:return Ng(e,t,n,t.pendingProps);case 24:return xs(t),o=Ci(ai),e===null?(p=wh(),p===null&&(p=jt,S=bh(),p.pooledCache=S,S.refCount++,S!==null&&(p.pooledCacheLanes|=n),p=S),t.memoizedState={parent:o,cache:p},Eh(t),Mn(t,ai,p)):((e.lanes&n)!==0&&(xh(e,t),Ro(t,null,null,n),xo()),p=e.memoizedState,S=t.memoizedState,p.parent!==o?(p={parent:o,cache:o},t.memoizedState=p,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=p),Mn(t,ai,o)):(o=S.cache,Mn(t,ai,o),o!==p.cache&&yh(t,[ai],n,!0))),Ei(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function cn(e){e.flags|=4}function ad(e,t,n,o,p){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(vv())e.flags|=8192;else throw Ds=Zl,Ch}else e.flags&=-16777217}function Kg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!a_(t))if(vv())e.flags|=8192;else throw Ds=Zl,Ch}function pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pt():536870912,e.lanes|=t,Ra|=t)}function Mo(e,t){if(!pt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var p=e.child;p!==null;)n|=p.lanes|p.childLanes,o|=p.subtreeFlags&65011712,o|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)n|=p.lanes|p.childLanes,o|=p.subtreeFlags,o|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function FS(e,t,n){var o=t.pendingProps;switch(mh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),sn(ai),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?cn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,gh())),Ft(t),null;case 26:var p=t.type,S=t.memoizedState;return e===null?(cn(t),S!==null?(Ft(t),Kg(t,S)):(Ft(t),ad(t,p,null,o,n))):S?S!==e.memoizedState?(cn(t),Ft(t),Kg(t,S)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&cn(t),Ft(t),ad(t,p,e,o,n)),null;case 27:if(me(t),n=pe.current,p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&cn(t);else{if(!o){if(t.stateNode===null)throw Error(a(166));return Ft(t),null}e=ne.current,fa(t)?Ep(t):(e=Zv(p,o,n),t.stateNode=e,cn(t))}return Ft(t),null;case 5:if(me(t),p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&cn(t);else{if(!o){if(t.stateNode===null)throw Error(a(166));return Ft(t),null}if(S=ne.current,fa(t))Ep(t);else{var M=Ac(pe.current);switch(S){case 1:S=M.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:S=M.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":S=M.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":S=M.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":S=M.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof o.is=="string"?M.createElement("select",{is:o.is}):M.createElement("select"),o.multiple?S.multiple=!0:o.size&&(S.size=o.size);break;default:S=typeof o.is=="string"?M.createElement(p,{is:o.is}):M.createElement(p)}}S[De]=t,S[Oe]=o;e:for(M=t.child;M!==null;){if(M.tag===5||M.tag===6)S.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===t)break e;for(;M.sibling===null;){if(M.return===null||M.return===t)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}t.stateNode=S;e:switch(xi(S,p,o),p){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&cn(t)}}return Ft(t),ad(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&cn(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(a(166));if(e=pe.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,p=wi,p!==null)switch(p.tag){case 27:case 5:o=p.memoizedProps}e[De]=t,e=!!(e.nodeValue===n||o!==null&&o.suppressHydrationWarning===!0||Uv(e.nodeValue,n)),e||Ln(t,!0)}else e=Ac(e).createTextNode(o),e[De]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(o=fa(t),n!==null){if(e===null){if(!o)throw Error(a(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[De]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=gh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Zi(t),t):(Zi(t),null);if((t.flags&128)!==0)throw Error(a(558))}return Ft(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=fa(t),o!==null&&o.dehydrated!==null){if(e===null){if(!p)throw Error(a(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[De]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),p=!1}else p=gh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(Zi(t),t):(Zi(t),null)}return Zi(t),(t.flags&128)!==0?(t.lanes=n,t):(n=o!==null,e=e!==null&&e.memoizedState!==null,n&&(o=t.child,p=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(p=o.alternate.memoizedState.cachePool.pool),S=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(S=o.memoizedState.cachePool.pool),S!==p&&(o.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pc(t,t.updateQueue),Ft(t),null);case 4:return oe(),e===null&&Dd(t.stateNode.containerInfo),Ft(t),null;case 10:return sn(t.type),Ft(t),null;case 19:if(F(ri),o=t.memoizedState,o===null)return Ft(t),null;if(p=(t.flags&128)!==0,S=o.rendering,S===null)if(p)Mo(o,!1);else{if(Xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(S=ic(e),S!==null){for(t.flags|=128,Mo(o,!1),e=S.updateQueue,t.updateQueue=e,pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)yp(n,e),n=n.sibling;return X(ri,ri.current&1|2),pt&&rn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Be()>bc&&(t.flags|=128,p=!0,Mo(o,!1),t.lanes=4194304)}else{if(!p)if(e=ic(S),e!==null){if(t.flags|=128,p=!0,e=e.updateQueue,t.updateQueue=e,pc(t,e),Mo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!S.alternate&&!pt)return Ft(t),null}else 2*Be()-o.renderingStartTime>bc&&n!==536870912&&(t.flags|=128,p=!0,Mo(o,!1),t.lanes=4194304);o.isBackwards?(S.sibling=t.child,t.child=S):(e=o.last,e!==null?e.sibling=S:t.child=S,o.last=S)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Be(),e.sibling=null,n=ri.current,X(ri,p?n&1|2:n&1),pt&&rn(t,o.treeForkCount),e):(Ft(t),null);case 22:case 23:return Zi(t),Oh(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(n&536870912)!==0&&(t.flags&128)===0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==n&&(t.flags|=2048),e!==null&&F(Rs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),sn(ai),Ft(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function qS(e,t){switch(mh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sn(ai),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(Zi(t),t.alternate===null)throw Error(a(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Zi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(ri),null;case 4:return oe(),null;case 10:return sn(t.type),null;case 22:case 23:return Zi(t),Oh(),e!==null&&F(Rs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sn(ai),null;case 25:return null;default:return null}}function Vg(e,t){switch(mh(t),t.tag){case 3:sn(ai),oe();break;case 26:case 27:case 5:me(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&Zi(t);break;case 13:Zi(t);break;case 19:F(ri);break;case 10:sn(t.type);break;case 22:case 23:Zi(t),Oh(),e!==null&&F(Rs);break;case 24:sn(ai)}}function ko(e,t){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var p=o.next;n=p;do{if((n.tag&e)===e){o=void 0;var S=n.create,M=n.inst;o=S(),M.destroy=o}n=n.next}while(n!==p)}}catch(U){At(t,t.return,U)}}function Pn(e,t,n){try{var o=t.updateQueue,p=o!==null?o.lastEffect:null;if(p!==null){var S=p.next;o=S;do{if((o.tag&e)===e){var M=o.inst,U=M.destroy;if(U!==void 0){M.destroy=void 0,p=t;var J=n,ue=U;try{ue()}catch(ve){At(p,J,ve)}}}o=o.next}while(o!==S)}}catch(ve){At(t,t.return,ve)}}function Wg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(o){At(e,e.return,o)}}}function Yg(e,t,n){n.props=Ls(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(o){At(e,t,o)}}function Bo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof n=="function"?e.refCleanup=n(o):n.current=o}}catch(p){At(e,t,p)}}function Pr(e,t){var n=e.ref,o=e.refCleanup;if(n!==null)if(typeof o=="function")try{o()}catch(p){At(e,t,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(p){At(e,t,p)}else n.current=null}function Gg(e){var t=e.type,n=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&o.focus();break e;case"img":n.src?o.src=n.src:n.srcSet&&(o.srcset=n.srcSet)}}catch(p){At(e,e.return,p)}}function od(e,t,n){try{var o=e.stateNode;hw(o,e.type,n,t),o[Oe]=t}catch(p){At(e,e.return,p)}}function Xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kn(e.type)||e.tag===4}function ld(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jr));else if(o!==4&&(o===27&&Kn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(cd(e,t,n),e=e.sibling;e!==null;)cd(e,t,n),e=e.sibling}function gc(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(o===27&&Kn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}function Qg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var o=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);xi(t,o,n),t[De]=e,t[Oe]=n}catch(S){At(e,e.return,S)}}var un=!1,ci=!1,ud=!1,Zg=typeof WeakSet=="function"?WeakSet:Set,gi=null;function $S(e,t){if(e=e.containerInfo,Ld=Hc,e=up(e),rh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var p=o.anchorOffset,S=o.focusNode;o=o.focusOffset;try{n.nodeType,S.nodeType}catch{n=null;break e}var M=0,U=-1,J=-1,ue=0,ve=0,be=e,fe=null;t:for(;;){for(var ge;be!==n||p!==0&&be.nodeType!==3||(U=M+p),be!==S||o!==0&&be.nodeType!==3||(J=M+o),be.nodeType===3&&(M+=be.nodeValue.length),(ge=be.firstChild)!==null;)fe=be,be=ge;for(;;){if(be===e)break t;if(fe===n&&++ue===p&&(U=M),fe===S&&++ve===o&&(J=M),(ge=be.nextSibling)!==null)break;be=fe,fe=be.parentNode}be=ge}n=U===-1||J===-1?null:{start:U,end:J}}else n=null}n=n||{start:0,end:0}}else n=null;for(Md={focusedElem:e,selectionRange:n},Hc=!1,gi=t;gi!==null;)if(t=gi,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gi=e;else for(;gi!==null;){switch(t=gi,S=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)p=e[n],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&S!==null){e=void 0,n=t,p=S.memoizedProps,S=S.memoizedState,o=n.stateNode;try{var Ne=Ls(n.type,p);e=o.getSnapshotBeforeUpdate(Ne,S),o.__reactInternalSnapshotBeforeUpdate=e}catch(We){At(n,n.return,We)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,gi=e;break}gi=t.return}}function Jg(e,t,n){var o=n.flags;switch(n.tag){case 0:case 11:case 15:dn(e,n),o&4&&ko(5,n);break;case 1:if(dn(e,n),o&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(M){At(n,n.return,M)}else{var p=Ls(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(M){At(n,n.return,M)}}o&64&&Wg(n),o&512&&Bo(n,n.return);break;case 3:if(dn(e,n),o&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Hp(e,t)}catch(M){At(n,n.return,M)}}break;case 27:t===null&&o&4&&Qg(n);case 26:case 5:dn(e,n),t===null&&o&4&&Gg(n),o&512&&Bo(n,n.return);break;case 12:dn(e,n);break;case 31:dn(e,n),o&4&&iv(e,n);break;case 13:dn(e,n),o&4&&rv(e,n),o&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=JS.bind(null,n),yw(e,n))));break;case 22:if(o=n.memoizedState!==null||un,!o){t=t!==null&&t.memoizedState!==null||ci,p=un;var S=ci;un=o,(ci=t)&&!S?fn(e,n,(n.subtreeFlags&8772)!==0):dn(e,n),un=p,ci=S}break;case 30:break;default:dn(e,n)}}function ev(e){var t=e.alternate;t!==null&&(e.alternate=null,ev(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Vt=null,zi=!1;function hn(e,t,n){for(n=n.child;n!==null;)tv(e,t,n),n=n.sibling}function tv(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Jt,n)}catch{}switch(n.tag){case 26:ci||Pr(n,t),hn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ci||Pr(n,t);var o=Vt,p=zi;Kn(n.type)&&(Vt=n.stateNode,zi=!1),hn(e,t,n),qo(n.stateNode),Vt=o,zi=p;break;case 5:ci||Pr(n,t);case 6:if(o=Vt,p=zi,Vt=null,hn(e,t,n),Vt=o,zi=p,Vt!==null)if(zi)try{(Vt.nodeType===9?Vt.body:Vt.nodeName==="HTML"?Vt.ownerDocument.body:Vt).removeChild(n.stateNode)}catch(S){At(n,t,S)}else try{Vt.removeChild(n.stateNode)}catch(S){At(n,t,S)}break;case 18:Vt!==null&&(zi?(e=Vt,Wv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ba(e)):Wv(Vt,n.stateNode));break;case 4:o=Vt,p=zi,Vt=n.stateNode.containerInfo,zi=!0,hn(e,t,n),Vt=o,zi=p;break;case 0:case 11:case 14:case 15:Pn(2,n,t),ci||Pn(4,n,t),hn(e,t,n);break;case 1:ci||(Pr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"&&Yg(n,t,o)),hn(e,t,n);break;case 21:hn(e,t,n);break;case 22:ci=(o=ci)||n.memoizedState!==null,hn(e,t,n),ci=o;break;default:hn(e,t,n)}}function iv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ba(e)}catch(n){At(t,t.return,n)}}}function rv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ba(e)}catch(n){At(t,t.return,n)}}function KS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zg),t;default:throw Error(a(435,e.tag))}}function vc(e,t){var n=KS(e);t.forEach(function(o){if(!n.has(o)){n.add(o);var p=ew.bind(null,e,o);o.then(p,p)}})}function Ii(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var p=n[o],S=e,M=t,U=M;e:for(;U!==null;){switch(U.tag){case 27:if(Kn(U.type)){Vt=U.stateNode,zi=!1;break e}break;case 5:Vt=U.stateNode,zi=!1;break e;case 3:case 4:Vt=U.stateNode.containerInfo,zi=!0;break e}U=U.return}if(Vt===null)throw Error(a(160));tv(S,M,p),Vt=null,zi=!1,S=p.alternate,S!==null&&(S.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nv(t,e),t=t.sibling}var Tr=null;function nv(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ii(t,e),Ui(e),o&4&&(Pn(3,e,e.return),ko(3,e),Pn(5,e,e.return));break;case 1:Ii(t,e),Ui(e),o&512&&(ci||n===null||Pr(n,n.return)),o&64&&un&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?o:n.concat(o))));break;case 26:var p=Tr;if(Ii(t,e),Ui(e),o&512&&(ci||n===null||Pr(n,n.return)),o&4){var S=n!==null?n.memoizedState:null;if(o=e.memoizedState,n===null)if(o===null)if(e.stateNode===null){e:{o=e.type,n=e.memoizedProps,p=p.ownerDocument||p;t:switch(o){case"title":S=p.getElementsByTagName("title")[0],(!S||S[Ze]||S[De]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=p.createElement(o),p.head.insertBefore(S,p.querySelector("head > title"))),xi(S,o,n),S[De]=e,Kt(S),o=S;break e;case"link":var M=n_("link","href",p).get(o+(n.href||""));if(M){for(var U=0;U<M.length;U++)if(S=M[U],S.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&S.getAttribute("rel")===(n.rel==null?null:n.rel)&&S.getAttribute("title")===(n.title==null?null:n.title)&&S.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){M.splice(U,1);break t}}S=p.createElement(o),xi(S,o,n),p.head.appendChild(S);break;case"meta":if(M=n_("meta","content",p).get(o+(n.content||""))){for(U=0;U<M.length;U++)if(S=M[U],S.getAttribute("content")===(n.content==null?null:""+n.content)&&S.getAttribute("name")===(n.name==null?null:n.name)&&S.getAttribute("property")===(n.property==null?null:n.property)&&S.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&S.getAttribute("charset")===(n.charSet==null?null:n.charSet)){M.splice(U,1);break t}}S=p.createElement(o),xi(S,o,n),p.head.appendChild(S);break;default:throw Error(a(468,o))}S[De]=e,Kt(S),o=S}e.stateNode=o}else s_(p,e.type,e.stateNode);else e.stateNode=r_(p,o,e.memoizedProps);else S!==o?(S===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):S.count--,o===null?s_(p,e.type,e.stateNode):r_(p,o,e.memoizedProps)):o===null&&e.stateNode!==null&&od(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ii(t,e),Ui(e),o&512&&(ci||n===null||Pr(n,n.return)),n!==null&&o&4&&od(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ii(t,e),Ui(e),o&512&&(ci||n===null||Pr(n,n.return)),e.flags&32){p=e.stateNode;try{ra(p,"")}catch(Ne){At(e,e.return,Ne)}}o&4&&e.stateNode!=null&&(p=e.memoizedProps,od(e,p,n!==null?n.memoizedProps:p)),o&1024&&(ud=!0);break;case 6:if(Ii(t,e),Ui(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(Ne){At(e,e.return,Ne)}}break;case 3:if(kc=null,p=Tr,Tr=Lc(t.containerInfo),Ii(t,e),Tr=p,Ui(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Ba(t.containerInfo)}catch(Ne){At(e,e.return,Ne)}ud&&(ud=!1,sv(e));break;case 4:o=Tr,Tr=Lc(e.stateNode.containerInfo),Ii(t,e),Ui(e),Tr=o;break;case 12:Ii(t,e),Ui(e);break;case 31:Ii(t,e),Ui(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vc(e,o)));break;case 13:Ii(t,e),Ui(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(yc=Be()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vc(e,o)));break;case 22:p=e.memoizedState!==null;var J=n!==null&&n.memoizedState!==null,ue=un,ve=ci;if(un=ue||p,ci=ve||J,Ii(t,e),ci=ve,un=ue,Ui(e),o&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(n===null||J||un||ci||Ms(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){J=n=t;try{if(S=J.stateNode,p)M=S.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{U=J.stateNode;var be=J.memoizedProps.style,fe=be!=null&&be.hasOwnProperty("display")?be.display:null;U.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Ne){At(J,J.return,Ne)}}}else if(t.tag===6){if(n===null){J=t;try{J.stateNode.nodeValue=p?"":J.memoizedProps}catch(Ne){At(J,J.return,Ne)}}}else if(t.tag===18){if(n===null){J=t;try{var ge=J.stateNode;p?Yv(ge,!0):Yv(J.stateNode,!1)}catch(Ne){At(J,J.return,Ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(n=o.retryQueue,n!==null&&(o.retryQueue=null,vc(e,n))));break;case 19:Ii(t,e),Ui(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vc(e,o)));break;case 30:break;case 21:break;default:Ii(t,e),Ui(e)}}function Ui(e){var t=e.flags;if(t&2){try{for(var n,o=e.return;o!==null;){if(Xg(o)){n=o;break}o=o.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var p=n.stateNode,S=ld(e);gc(e,S,p);break;case 5:var M=n.stateNode;n.flags&32&&(ra(M,""),n.flags&=-33);var U=ld(e);gc(e,U,M);break;case 3:case 4:var J=n.stateNode.containerInfo,ue=ld(e);cd(e,ue,J);break;default:throw Error(a(161))}}catch(ve){At(e,e.return,ve)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;sv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function dn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Jg(e,t.alternate,t),t=t.sibling}function Ms(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pn(4,t,t.return),Ms(t);break;case 1:Pr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Yg(t,t.return,n),Ms(t);break;case 27:qo(t.stateNode);case 26:case 5:Pr(t,t.return),Ms(t);break;case 22:t.memoizedState===null&&Ms(t);break;case 30:Ms(t);break;default:Ms(t)}e=e.sibling}}function fn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,p=e,S=t,M=S.flags;switch(S.tag){case 0:case 11:case 15:fn(p,S,n),ko(4,S);break;case 1:if(fn(p,S,n),o=S,p=o.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ue){At(o,o.return,ue)}if(o=S,p=o.updateQueue,p!==null){var U=o.stateNode;try{var J=p.shared.hiddenCallbacks;if(J!==null)for(p.shared.hiddenCallbacks=null,p=0;p<J.length;p++)jp(J[p],U)}catch(ue){At(o,o.return,ue)}}n&&M&64&&Wg(S),Bo(S,S.return);break;case 27:Qg(S);case 26:case 5:fn(p,S,n),n&&o===null&&M&4&&Gg(S),Bo(S,S.return);break;case 12:fn(p,S,n);break;case 31:fn(p,S,n),n&&M&4&&iv(p,S);break;case 13:fn(p,S,n),n&&M&4&&rv(p,S);break;case 22:S.memoizedState===null&&fn(p,S,n),Bo(S,S.return);break;case 30:break;default:fn(p,S,n)}t=t.sibling}}function hd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&bo(n))}function dd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bo(e))}function Dr(e,t,n,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)av(e,t,n,o),t=t.sibling}function av(e,t,n,o){var p=t.flags;switch(t.tag){case 0:case 11:case 15:Dr(e,t,n,o),p&2048&&ko(9,t);break;case 1:Dr(e,t,n,o);break;case 3:Dr(e,t,n,o),p&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bo(e)));break;case 12:if(p&2048){Dr(e,t,n,o),e=t.stateNode;try{var S=t.memoizedProps,M=S.id,U=S.onPostCommit;typeof U=="function"&&U(M,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(J){At(t,t.return,J)}}else Dr(e,t,n,o);break;case 31:Dr(e,t,n,o);break;case 13:Dr(e,t,n,o);break;case 23:break;case 22:S=t.stateNode,M=t.alternate,t.memoizedState!==null?S._visibility&2?Dr(e,t,n,o):No(e,t):S._visibility&2?Dr(e,t,n,o):(S._visibility|=2,Ca(e,t,n,o,(t.subtreeFlags&10256)!==0||!1)),p&2048&&hd(M,t);break;case 24:Dr(e,t,n,o),p&2048&&dd(t.alternate,t);break;default:Dr(e,t,n,o)}}function Ca(e,t,n,o,p){for(p=p&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var S=e,M=t,U=n,J=o,ue=M.flags;switch(M.tag){case 0:case 11:case 15:Ca(S,M,U,J,p),ko(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?Ca(S,M,U,J,p):No(S,M):(ve._visibility|=2,Ca(S,M,U,J,p)),p&&ue&2048&&hd(M.alternate,M);break;case 24:Ca(S,M,U,J,p),p&&ue&2048&&dd(M.alternate,M);break;default:Ca(S,M,U,J,p)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,o=t,p=o.flags;switch(o.tag){case 22:No(n,o),p&2048&&hd(o.alternate,o);break;case 24:No(n,o),p&2048&&dd(o.alternate,o);break;default:No(n,o)}t=t.sibling}}var jo=8192;function Ea(e,t,n){if(e.subtreeFlags&jo)for(e=e.child;e!==null;)ov(e,t,n),e=e.sibling}function ov(e,t,n){switch(e.tag){case 26:Ea(e,t,n),e.flags&jo&&e.memoizedState!==null&&Lw(n,Tr,e.memoizedState,e.memoizedProps);break;case 5:Ea(e,t,n);break;case 3:case 4:var o=Tr;Tr=Lc(e.stateNode.containerInfo),Ea(e,t,n),Tr=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=jo,jo=16777216,Ea(e,t,n),jo=o):Ea(e,t,n));break;default:Ea(e,t,n)}}function lv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ho(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];gi=o,uv(o,e)}lv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cv(e),e=e.sibling}function cv(e){switch(e.tag){case 0:case 11:case 15:Ho(e),e.flags&2048&&Pn(9,e,e.return);break;case 3:Ho(e);break;case 12:Ho(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,_c(e)):Ho(e);break;default:Ho(e)}}function _c(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];gi=o,uv(o,e)}lv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pn(8,t,t.return),_c(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,_c(t));break;default:_c(t)}e=e.sibling}}function uv(e,t){for(;gi!==null;){var n=gi;switch(n.tag){case 0:case 11:case 15:Pn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var o=n.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:bo(n.memoizedState.cache)}if(o=n.child,o!==null)o.return=n,gi=o;else e:for(n=e;gi!==null;){o=gi;var p=o.sibling,S=o.return;if(ev(o),o===n){gi=null;break e}if(p!==null){p.return=S,gi=p;break e}gi=S}}}var VS={getCacheForType:function(e){var t=Ci(ai),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ci(ai).controller.signal}},WS=typeof WeakMap=="function"?WeakMap:Map,Et=0,jt=null,lt=null,ut=0,Ot=0,Ji=null,zn=!1,xa=!1,fd=!1,mn=0,Xt=0,In=0,ks=0,md=0,er=0,Ra=0,Po=null,Fi=null,pd=!1,yc=0,hv=0,bc=1/0,Sc=null,Un=null,fi=0,Fn=null,Ta=null,pn=0,gd=0,vd=null,dv=null,zo=0,_d=null;function tr(){return(Et&2)!==0&&ut!==0?ut&-ut:q.T!==null?Ed():Re()}function fv(){if(er===0)if((ut&536870912)===0||pt){var e=yi;yi<<=1,(yi&3932160)===0&&(yi=262144),er=e}else er=536870912;return e=Qi.current,e!==null&&(e.flags|=32),er}function qi(e,t,n){(e===jt&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)&&(Da(e,0),qn(e,ut,er,!1)),yt(e,n),((Et&2)===0||e!==jt)&&(e===jt&&((Et&2)===0&&(ks|=n),Xt===4&&qn(e,ut,er,!1)),zr(e))}function mv(e,t,n){if((Et&6)!==0)throw Error(a(327));var o=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Dt(e,t),p=o?XS(e,t):bd(e,t,!0),S=o;do{if(p===0){xa&&!o&&qn(e,t,0,!1);break}else{if(n=e.current.alternate,S&&!YS(n)){p=bd(e,t,!1),S=!1;continue}if(p===2){if(S=t,e.errorRecoveryDisabledLanes&S)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){t=M;e:{var U=e;p=Po;var J=U.current.memoizedState.isDehydrated;if(J&&(Da(U,M).flags|=256),M=bd(U,M,!1),M!==2){if(fd&&!J){U.errorRecoveryDisabledLanes|=S,ks|=S,p=4;break e}S=Fi,Fi=p,S!==null&&(Fi===null?Fi=S:Fi.push.apply(Fi,S))}p=M}if(S=!1,p!==2)continue}}if(p===1){Da(e,0),qn(e,t,0,!0);break}e:{switch(o=e,S=p,S){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:qn(o,t,er,!zn);break e;case 2:Fi=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(p=yc+300-Be(),10<p)){if(qn(o,t,er,!zn),Le(o,0,!0)!==0)break e;pn=t,o.timeoutHandle=Kv(pv.bind(null,o,n,Fi,Sc,pd,t,er,ks,Ra,zn,S,"Throttled",-0,0),p);break e}pv(o,n,Fi,Sc,pd,t,er,ks,Ra,zn,S,null,-0,0)}}break}while(!0);zr(e)}function pv(e,t,n,o,p,S,M,U,J,ue,ve,be,fe,ge){if(e.timeoutHandle=-1,be=t.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jr},ov(t,S,be);var Ne=(S&62914560)===S?yc-Be():(S&4194048)===S?hv-Be():0;if(Ne=Mw(be,Ne),Ne!==null){pn=S,e.cancelPendingCommit=Ne(Cv.bind(null,e,t,S,n,o,p,M,U,J,ve,be,null,fe,ge)),qn(e,S,M,!ue);return}}Cv(e,t,S,n,o,p,M,U,J)}function YS(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var o=0;o<n.length;o++){var p=n[o],S=p.getSnapshot;p=p.value;try{if(!Gi(S(),p))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qn(e,t,n,o){t&=~md,t&=~ks,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var p=t;0<p;){var S=31-Tt(p),M=1<<S;o[S]=-1,p&=~M}n!==0&&ji(e,n,t)}function wc(){return(Et&6)===0?(Io(0),!1):!0}function yd(){if(lt!==null){if(Ot===0)var e=lt.return;else e=lt,nn=Es=null,Nh(e),_a=null,wo=0,e=lt;for(;e!==null;)Vg(e.alternate,e),e=e.return;lt=null}}function Da(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,mw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pn=0,yd(),jt=e,lt=n=tn(e.current,null),ut=t,Ot=0,Ji=null,zn=!1,xa=Dt(e,t),fd=!1,Ra=er=md=ks=In=Xt=0,Fi=Po=null,pd=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var p=31-Tt(o),S=1<<p;t|=e[p],o&=~S}return mn=t,ql(),n}function gv(e,t){Je=null,q.H=Ao,t===va||t===Ql?(t=Mp(),Ot=3):t===Ch?(t=Mp(),Ot=4):Ot=t===Qh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ji=t,lt===null&&(Xt=1,hc(e,or(t,e.current)))}function vv(){var e=Qi.current;return e===null?!0:(ut&4194048)===ut?hr===null:(ut&62914560)===ut||(ut&536870912)!==0?e===hr:!1}function _v(){var e=q.H;return q.H=Ao,e===null?Ao:e}function yv(){var e=q.A;return q.A=VS,e}function Cc(){Xt=4,zn||(ut&4194048)!==ut&&Qi.current!==null||(xa=!0),(In&134217727)===0&&(ks&134217727)===0||jt===null||qn(jt,ut,er,!1)}function bd(e,t,n){var o=Et;Et|=2;var p=_v(),S=yv();(jt!==e||ut!==t)&&(Sc=null,Da(e,t)),t=!1;var M=Xt;e:do try{if(Ot!==0&<!==null){var U=lt,J=Ji;switch(Ot){case 8:yd(),M=6;break e;case 3:case 2:case 9:case 6:Qi.current===null&&(t=!0);var ue=Ot;if(Ot=0,Ji=null,Oa(e,U,J,ue),n&&xa){M=0;break e}break;default:ue=Ot,Ot=0,Ji=null,Oa(e,U,J,ue)}}GS(),M=Xt;break}catch(ve){gv(e,ve)}while(!0);return t&&e.shellSuspendCounter++,nn=Es=null,Et=o,q.H=p,q.A=S,lt===null&&(jt=null,ut=0,ql()),M}function GS(){for(;lt!==null;)bv(lt)}function XS(e,t){var n=Et;Et|=2;var o=_v(),p=yv();jt!==e||ut!==t?(Sc=null,bc=Be()+500,Da(e,t)):xa=Dt(e,t);e:do try{if(Ot!==0&<!==null){t=lt;var S=Ji;t:switch(Ot){case 1:Ot=0,Ji=null,Oa(e,t,S,1);break;case 2:case 9:if(Ap(S)){Ot=0,Ji=null,Sv(t);break}t=function(){Ot!==2&&Ot!==9||jt!==e||(Ot=7),zr(e)},S.then(t,t);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:Ap(S)?(Ot=0,Ji=null,Sv(t)):(Ot=0,Ji=null,Oa(e,t,S,7));break;case 5:var M=null;switch(lt.tag){case 26:M=lt.memoizedState;case 5:case 27:var U=lt;if(M?a_(M):U.stateNode.complete){Ot=0,Ji=null;var J=U.sibling;if(J!==null)lt=J;else{var ue=U.return;ue!==null?(lt=ue,Ec(ue)):lt=null}break t}}Ot=0,Ji=null,Oa(e,t,S,5);break;case 6:Ot=0,Ji=null,Oa(e,t,S,6);break;case 8:yd(),Xt=6;break e;default:throw Error(a(462))}}QS();break}catch(ve){gv(e,ve)}while(!0);return nn=Es=null,q.H=o,q.A=p,Et=n,lt!==null?0:(jt=null,ut=0,ql(),Xt)}function QS(){for(;lt!==null&&!Ae();)bv(lt)}function bv(e){var t=$g(e.alternate,e,mn);e.memoizedProps=e.pendingProps,t===null?Ec(e):lt=t}function Sv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Pg(n,t,t.pendingProps,t.type,void 0,ut);break;case 11:t=Pg(n,t,t.pendingProps,t.type.render,t.ref,ut);break;case 5:Nh(t);default:Vg(n,t),t=lt=yp(t,mn),t=$g(n,t,mn)}e.memoizedProps=e.pendingProps,t===null?Ec(e):lt=t}function Oa(e,t,n,o){nn=Es=null,Nh(t),_a=null,wo=0;var p=t.return;try{if(zS(e,p,t,n,ut)){Xt=1,hc(e,or(n,e.current)),lt=null;return}}catch(S){if(p!==null)throw lt=p,S;Xt=1,hc(e,or(n,e.current)),lt=null;return}t.flags&32768?(pt||o===1?e=!0:xa||(ut&536870912)!==0?e=!1:(zn=e=!0,(o===2||o===9||o===3||o===6)&&(o=Qi.current,o!==null&&o.tag===13&&(o.flags|=16384))),wv(t,e)):Ec(t)}function Ec(e){var t=e;do{if((t.flags&32768)!==0){wv(t,zn);return}e=t.return;var n=FS(t.alternate,t,mn);if(n!==null){lt=n;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);Xt===0&&(Xt=5)}function wv(e,t){do{var n=qS(e.alternate,e);if(n!==null){n.flags&=32767,lt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){lt=e;return}lt=e=n}while(e!==null);Xt=6,lt=null}function Cv(e,t,n,o,p,S,M,U,J){e.cancelPendingCommit=null;do xc();while(fi!==0);if((Et&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(S=t.lanes|t.childLanes,S|=lh,ti(e,n,S,M,U,J),e===jt&&(lt=jt=null,ut=0),Ta=t,Fn=e,pn=n,gd=S,vd=p,dv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,tw(et,function(){return Dv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,p=Y.p,Y.p=2,M=Et,Et|=4;try{$S(e,t,n)}finally{Et=M,Y.p=p,q.T=o}}fi=1,Ev(),xv(),Rv()}}function Ev(){if(fi===1){fi=0;var e=Fn,t=Ta,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=q.T,q.T=null;var o=Y.p;Y.p=2;var p=Et;Et|=4;try{nv(t,e);var S=Md,M=up(e.containerInfo),U=S.focusedElem,J=S.selectionRange;if(M!==U&&U&&U.ownerDocument&&cp(U.ownerDocument.documentElement,U)){if(J!==null&&rh(U)){var ue=J.start,ve=J.end;if(ve===void 0&&(ve=ue),"selectionStart"in U)U.selectionStart=ue,U.selectionEnd=Math.min(ve,U.value.length);else{var be=U.ownerDocument||document,fe=be&&be.defaultView||window;if(fe.getSelection){var ge=fe.getSelection(),Ne=U.textContent.length,We=Math.min(J.start,Ne),Nt=J.end===void 0?We:Math.min(J.end,Ne);!ge.extend&&We>Nt&&(M=Nt,Nt=We,We=M);var se=lp(U,We),ie=lp(U,Nt);if(se&&ie&&(ge.rangeCount!==1||ge.anchorNode!==se.node||ge.anchorOffset!==se.offset||ge.focusNode!==ie.node||ge.focusOffset!==ie.offset)){var ce=be.createRange();ce.setStart(se.node,se.offset),ge.removeAllRanges(),We>Nt?(ge.addRange(ce),ge.extend(ie.node,ie.offset)):(ce.setEnd(ie.node,ie.offset),ge.addRange(ce))}}}}for(be=[],ge=U;ge=ge.parentNode;)ge.nodeType===1&&be.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<be.length;U++){var _e=be[U];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Hc=!!Ld,Md=Ld=null}finally{Et=p,Y.p=o,q.T=n}}e.current=t,fi=2}}function xv(){if(fi===2){fi=0;var e=Fn,t=Ta,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=q.T,q.T=null;var o=Y.p;Y.p=2;var p=Et;Et|=4;try{Jg(e,t.alternate,t)}finally{Et=p,Y.p=o,q.T=n}}fi=3}}function Rv(){if(fi===4||fi===3){fi=0,Ye();var e=Fn,t=Ta,n=pn,o=dv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?fi=5:(fi=0,Ta=Fn=null,Tv(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Un=null),Se(n),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=q.T,p=Y.p,Y.p=2,q.T=null;try{for(var S=e.onRecoverableError,M=0;M<o.length;M++){var U=o[M];S(U.value,{componentStack:U.stack})}}finally{q.T=t,Y.p=p}}(pn&3)!==0&&xc(),zr(e),p=e.pendingLanes,(n&261930)!==0&&(p&42)!==0?e===_d?zo++:(zo=0,_d=e):zo=0,Io(0)}}function Tv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bo(t)))}function xc(){return Ev(),xv(),Rv(),Dv()}function Dv(){if(fi!==5)return!1;var e=Fn,t=gd;gd=0;var n=Se(pn),o=q.T,p=Y.p;try{Y.p=32>n?32:n,q.T=null,n=vd,vd=null;var S=Fn,M=pn;if(fi=0,Ta=Fn=null,pn=0,(Et&6)!==0)throw Error(a(331));var U=Et;if(Et|=4,cv(S.current),av(S,S.current,M,n),Et=U,Io(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Jt,S)}catch{}return!0}finally{Y.p=p,q.T=o,Tv(e,t)}}function Ov(e,t,n){t=or(n,t),t=Xh(e.stateNode,t,2),e=Nn(e,t,2),e!==null&&(yt(e,2),zr(e))}function At(e,t,n){if(e.tag===3)Ov(e,e,n);else for(;t!==null;){if(t.tag===3){Ov(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Un===null||!Un.has(o))){e=or(n,e),n=Ag(2),o=Nn(t,n,2),o!==null&&(Lg(n,o,t,e),yt(o,2),zr(o));break}}t=t.return}}function Sd(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new WS;var p=new Set;o.set(t,p)}else p=o.get(t),p===void 0&&(p=new Set,o.set(t,p));p.has(n)||(fd=!0,p.add(n),e=ZS.bind(null,e,t,n),t.then(e,e))}function ZS(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,jt===e&&(ut&n)===n&&(Xt===4||Xt===3&&(ut&62914560)===ut&&300>Be()-yc?(Et&2)===0&&Da(e,0):md|=n,Ra===ut&&(Ra=0)),zr(e)}function Av(e,t){t===0&&(t=Pt()),e=Ss(e,t),e!==null&&(yt(e,t),zr(e))}function JS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Av(e,n)}function ew(e,t){var n=0;switch(e.tag){case 31:case 13:var o=e.stateNode,p=e.memoizedState;p!==null&&(n=p.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(t),Av(e,n)}function tw(e,t){return st(e,t)}var Rc=null,Aa=null,wd=!1,Tc=!1,Cd=!1,$n=0;function zr(e){e!==Aa&&e.next===null&&(Aa===null?Rc=Aa=e:Aa=Aa.next=e),Tc=!0,wd||(wd=!0,rw())}function Io(e,t){if(!Cd&&Tc){Cd=!0;do for(var n=!1,o=Rc;o!==null;){if(e!==0){var p=o.pendingLanes;if(p===0)var S=0;else{var M=o.suspendedLanes,U=o.pingedLanes;S=(1<<31-Tt(42|e)+1)-1,S&=p&~(M&~U),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(n=!0,Bv(o,S))}else S=ut,S=Le(o,o===jt?S:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(S&3)===0||Dt(o,S)||(n=!0,Bv(o,S));o=o.next}while(n);Cd=!1}}function iw(){Lv()}function Lv(){Tc=wd=!1;var e=0;$n!==0&&fw()&&(e=$n);for(var t=Be(),n=null,o=Rc;o!==null;){var p=o.next,S=Mv(o,t);S===0?(o.next=null,n===null?Rc=p:n.next=p,p===null&&(Aa=n)):(n=o,(e!==0||(S&3)!==0)&&(Tc=!0)),o=p}fi!==0&&fi!==5||Io(e),$n!==0&&($n=0)}function Mv(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,p=e.expirationTimes,S=e.pendingLanes&-62914561;0<S;){var M=31-Tt(S),U=1<<M,J=p[M];J===-1?((U&n)===0||(U&o)!==0)&&(p[M]=Ht(U,t)):J<=t&&(e.expiredLanes|=U),S&=~U}if(t=jt,n=ut,n=Le(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,n===0||e===t&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&qe(o),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Dt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(o!==null&&qe(o),Se(n)){case 2:case 8:n=Zt;break;case 32:n=et;break;case 268435456:n=dt;break;default:n=et}return o=kv.bind(null,e),n=st(n,o),e.callbackPriority=t,e.callbackNode=n,t}return o!==null&&o!==null&&qe(o),e.callbackPriority=2,e.callbackNode=null,2}function kv(e,t){if(fi!==0&&fi!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xc()&&e.callbackNode!==n)return null;var o=ut;return o=Le(e,e===jt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(mv(e,o,t),Mv(e,Be()),e.callbackNode!=null&&e.callbackNode===n?kv.bind(null,e):null)}function Bv(e,t){if(xc())return null;mv(e,t,!0)}function rw(){pw(function(){(Et&6)!==0?st(Wt,iw):Lv()})}function Ed(){if($n===0){var e=pa;e===0&&(e=rr,rr<<=1,(rr&261888)===0&&(rr=256)),$n=e}return $n}function Nv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Nl(""+e)}function jv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function nw(e,t,n,o,p){if(t==="submit"&&n&&n.stateNode===p){var S=Nv((p[Oe]||null).action),M=o.submitter;M&&(t=(t=M[Oe]||null)?Nv(t.formAction):M.getAttribute("formAction"),t!==null&&(S=t,M=null));var U=new zl("action","action",null,o,p);e.push({event:U,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if($n!==0){var J=M?jv(p,M):new FormData(p);$h(n,{pending:!0,data:J,method:p.method,action:S},null,J)}}else typeof S=="function"&&(U.preventDefault(),J=M?jv(p,M):new FormData(p),$h(n,{pending:!0,data:J,method:p.method,action:S},S,J))},currentTarget:p}]})}}for(var xd=0;xd<oh.length;xd++){var Rd=oh[xd],sw=Rd.toLowerCase(),aw=Rd[0].toUpperCase()+Rd.slice(1);Rr(sw,"on"+aw)}Rr(fp,"onAnimationEnd"),Rr(mp,"onAnimationIteration"),Rr(pp,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(wS,"onTransitionRun"),Rr(CS,"onTransitionStart"),Rr(ES,"onTransitionCancel"),Rr(gp,"onTransitionEnd"),nr("onMouseEnter",["mouseout","mouseover"]),nr("onMouseLeave",["mouseout","mouseover"]),nr("onPointerEnter",["pointerout","pointerover"]),nr("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),ow=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uo));function Hv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],p=o.event;o=o.listeners;e:{var S=void 0;if(t)for(var M=o.length-1;0<=M;M--){var U=o[M],J=U.instance,ue=U.currentTarget;if(U=U.listener,J!==S&&p.isPropagationStopped())break e;S=U,p.currentTarget=ue;try{S(p)}catch(ve){Fl(ve)}p.currentTarget=null,S=J}else for(M=0;M<o.length;M++){if(U=o[M],J=U.instance,ue=U.currentTarget,U=U.listener,J!==S&&p.isPropagationStopped())break e;S=U,p.currentTarget=ue;try{S(p)}catch(ve){Fl(ve)}p.currentTarget=null,S=J}}}}function ct(e,t){var n=t[ye];n===void 0&&(n=t[ye]=new Set);var o=e+"__bubble";n.has(o)||(Pv(t,e,2,!1),n.add(o))}function Td(e,t,n){var o=0;t&&(o|=4),Pv(n,e,o,t)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function Dd(e){if(!e[Dc]){e[Dc]=!0,Cr.forEach(function(n){n!=="selectionchange"&&(ow.has(n)||Td(n,!1,e),Td(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dc]||(t[Dc]=!0,Td("selectionchange",!1,t))}}function Pv(e,t,n,o){switch(f_(t)){case 2:var p=Nw;break;case 8:p=jw;break;default:p=qd}n=p.bind(null,t,n,e),p=void 0,!Yu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(p=!0),o?p!==void 0?e.addEventListener(t,n,{capture:!0,passive:p}):e.addEventListener(t,n,!0):p!==void 0?e.addEventListener(t,n,{passive:p}):e.addEventListener(t,n,!1)}function Od(e,t,n,o,p){var S=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var M=o.tag;if(M===3||M===4){var U=o.stateNode.containerInfo;if(U===p)break;if(M===4)for(M=o.return;M!==null;){var J=M.tag;if((J===3||J===4)&&M.stateNode.containerInfo===p)return;M=M.return}for(;U!==null;){if(M=St(U),M===null)return;if(J=M.tag,J===5||J===6||J===26||J===27){o=S=M;continue e}U=U.parentNode}}o=o.return}qm(function(){var ue=S,ve=Vu(n),be=[];e:{var fe=vp.get(e);if(fe!==void 0){var ge=zl,Ne=e;switch(e){case"keypress":if(Hl(n)===0)break e;case"keydown":case"keyup":ge=eS;break;case"focusin":Ne="focus",ge=Zu;break;case"focusout":Ne="blur",ge=Zu;break;case"beforeblur":case"afterblur":ge=Zu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Vm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=F1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=rS;break;case fp:case mp:case pp:ge=K1;break;case gp:ge=sS;break;case"scroll":case"scrollend":ge=I1;break;case"wheel":ge=oS;break;case"copy":case"cut":case"paste":ge=W1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Ym;break;case"toggle":case"beforetoggle":ge=cS}var We=(t&4)!==0,Nt=!We&&(e==="scroll"||e==="scrollend"),se=We?fe!==null?fe+"Capture":null:fe;We=[];for(var ie=ue,ce;ie!==null;){var _e=ie;if(ce=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||ce===null||se===null||(_e=lo(ie,se),_e!=null&&We.push(Fo(ie,_e,ce))),Nt)break;ie=ie.return}0<We.length&&(fe=new ge(fe,Ne,null,n,ve),be.push({event:fe,listeners:We}))}}if((t&7)===0){e:{if(fe=e==="mouseover"||e==="pointerover",ge=e==="mouseout"||e==="pointerout",fe&&n!==Ku&&(Ne=n.relatedTarget||n.fromElement)&&(St(Ne)||Ne[te]))break e;if((ge||fe)&&(fe=ve.window===ve?ve:(fe=ve.ownerDocument)?fe.defaultView||fe.parentWindow:window,ge?(Ne=n.relatedTarget||n.toElement,ge=ue,Ne=Ne?St(Ne):null,Ne!==null&&(Nt=f(Ne),We=Ne.tag,Ne!==Nt||We!==5&&We!==27&&We!==6)&&(Ne=null)):(ge=null,Ne=ue),ge!==Ne)){if(We=Vm,_e="onMouseLeave",se="onMouseEnter",ie="mouse",(e==="pointerout"||e==="pointerover")&&(We=Ym,_e="onPointerLeave",se="onPointerEnter",ie="pointer"),Nt=ge==null?fe:pi(ge),ce=Ne==null?fe:pi(Ne),fe=new We(_e,ie+"leave",ge,n,ve),fe.target=Nt,fe.relatedTarget=ce,_e=null,St(ve)===ue&&(We=new We(se,ie+"enter",Ne,n,ve),We.target=ce,We.relatedTarget=Nt,_e=We),Nt=_e,ge&&Ne)t:{for(We=lw,se=ge,ie=Ne,ce=0,_e=se;_e;_e=We(_e))ce++;_e=0;for(var Ke=ie;Ke;Ke=We(Ke))_e++;for(;0<ce-_e;)se=We(se),ce--;for(;0<_e-ce;)ie=We(ie),_e--;for(;ce--;){if(se===ie||ie!==null&&se===ie.alternate){We=se;break t}se=We(se),ie=We(ie)}We=null}else We=null;ge!==null&&zv(be,fe,ge,We,!1),Ne!==null&&Nt!==null&&zv(be,Nt,Ne,We,!0)}}e:{if(fe=ue?pi(ue):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var wt=ip;else if(ep(fe))if(rp)wt=yS;else{wt=vS;var Ie=gS}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&$u(ue.elementType)&&(wt=ip):wt=_S;if(wt&&(wt=wt(e,ue))){tp(be,wt,n,ve);break e}Ie&&Ie(e,fe,ue),e==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&qu(fe,"number",fe.value)}switch(Ie=ue?pi(ue):window,e){case"focusin":(ep(Ie)||Ie.contentEditable==="true")&&(oa=Ie,nh=ue,vo=null);break;case"focusout":vo=nh=oa=null;break;case"mousedown":sh=!0;break;case"contextmenu":case"mouseup":case"dragend":sh=!1,hp(be,n,ve);break;case"selectionchange":if(SS)break;case"keydown":case"keyup":hp(be,n,ve)}var tt;if(eh)e:{switch(e){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else aa?Zm(e,n)&&(ht="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ht="onCompositionStart");ht&&(Gm&&n.locale!=="ko"&&(aa||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&aa&&(tt=$m()):(Dn=ve,Gu="value"in Dn?Dn.value:Dn.textContent,aa=!0)),Ie=Oc(ue,ht),0<Ie.length&&(ht=new Wm(ht,e,null,n,ve),be.push({event:ht,listeners:Ie}),tt?ht.data=tt:(tt=Jm(n),tt!==null&&(ht.data=tt)))),(tt=hS?dS(e,n):fS(e,n))&&(ht=Oc(ue,"onBeforeInput"),0<ht.length&&(Ie=new Wm("onBeforeInput","beforeinput",null,n,ve),be.push({event:Ie,listeners:ht}),Ie.data=tt)),nw(be,e,ue,n,ve)}Hv(be,t)})}function Fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oc(e,t){for(var n=t+"Capture",o=[];e!==null;){var p=e,S=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||S===null||(p=lo(e,n),p!=null&&o.unshift(Fo(e,p,S)),p=lo(e,t),p!=null&&o.push(Fo(e,p,S))),e.tag===3)return o;e=e.return}return[]}function lw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zv(e,t,n,o,p){for(var S=t._reactName,M=[];n!==null&&n!==o;){var U=n,J=U.alternate,ue=U.stateNode;if(U=U.tag,J!==null&&J===o)break;U!==5&&U!==26&&U!==27||ue===null||(J=ue,p?(ue=lo(n,S),ue!=null&&M.unshift(Fo(n,ue,J))):p||(ue=lo(n,S),ue!=null&&M.push(Fo(n,ue,J)))),n=n.return}M.length!==0&&e.push({event:t,listeners:M})}var cw=/\r\n?/g,uw=/\u0000|\uFFFD/g;function Iv(e){return(typeof e=="string"?e:""+e).replace(cw,`
|
|
49
|
+
`).replace(uw,"")}function Uv(e,t){return t=Iv(t),Iv(e)===t}function Bt(e,t,n,o,p,S){switch(n){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||ra(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&ra(e,""+o);break;case"className":xr(e,"class",o);break;case"tabIndex":xr(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":xr(e,n,o);break;case"style":Um(e,o,S);break;case"data":if(t!=="object"){xr(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=Nl(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(n==="formAction"?(t!=="input"&&Bt(e,t,"name",p.name,p,null),Bt(e,t,"formEncType",p.formEncType,p,null),Bt(e,t,"formMethod",p.formMethod,p,null),Bt(e,t,"formTarget",p.formTarget,p,null)):(Bt(e,t,"encType",p.encType,p,null),Bt(e,t,"method",p.method,p,null),Bt(e,t,"target",p.target,p,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=Nl(""+o),e.setAttribute(n,o);break;case"onClick":o!=null&&(e.onclick=Jr);break;case"onScroll":o!=null&&ct("scroll",e);break;case"onScrollEnd":o!=null&&ct("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(n=o.__html,n!=null){if(p.children!=null)throw Error(a(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}n=Nl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":o===!0?e.setAttribute(n,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":ct("beforetoggle",e),ct("toggle",e),ii(e,"popover",o);break;case"xlinkActuate":Si(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Si(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Si(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Si(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Si(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Si(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Si(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Si(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Si(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ii(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=P1.get(n)||n,ii(e,n,o))}}function Ad(e,t,n,o,p,S){switch(n){case"style":Um(e,o,S);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(n=o.__html,n!=null){if(p.children!=null)throw Error(a(60));e.innerHTML=n}}break;case"children":typeof o=="string"?ra(e,o):(typeof o=="number"||typeof o=="bigint")&&ra(e,""+o);break;case"onScroll":o!=null&&ct("scroll",e);break;case"onScrollEnd":o!=null&&ct("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Jr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yi.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(p=n.endsWith("Capture"),t=n.slice(2,p?n.length-7:void 0),S=e[Oe]||null,S=S!=null?S[n]:null,typeof S=="function"&&e.removeEventListener(t,S,p),typeof o=="function")){typeof S!="function"&&S!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,p);break e}n in e?e[n]=o:o===!0?e.setAttribute(n,""):ii(e,n,o)}}}function xi(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",e),ct("load",e);var o=!1,p=!1,S;for(S in n)if(n.hasOwnProperty(S)){var M=n[S];if(M!=null)switch(S){case"src":o=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Bt(e,t,S,M,n,null)}}p&&Bt(e,t,"srcSet",n.srcSet,n,null),o&&Bt(e,t,"src",n.src,n,null);return;case"input":ct("invalid",e);var U=S=M=p=null,J=null,ue=null;for(o in n)if(n.hasOwnProperty(o)){var ve=n[o];if(ve!=null)switch(o){case"name":p=ve;break;case"type":M=ve;break;case"checked":J=ve;break;case"defaultChecked":ue=ve;break;case"value":S=ve;break;case"defaultValue":U=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(a(137,t));break;default:Bt(e,t,o,ve,n,null)}}Hm(e,S,U,J,ue,M,p,!1);return;case"select":ct("invalid",e),o=M=S=null;for(p in n)if(n.hasOwnProperty(p)&&(U=n[p],U!=null))switch(p){case"value":S=U;break;case"defaultValue":M=U;break;case"multiple":o=U;default:Bt(e,t,p,U,n,null)}t=S,n=M,e.multiple=!!o,t!=null?ia(e,!!o,t,!1):n!=null&&ia(e,!!o,n,!0);return;case"textarea":ct("invalid",e),S=p=o=null;for(M in n)if(n.hasOwnProperty(M)&&(U=n[M],U!=null))switch(M){case"value":o=U;break;case"defaultValue":p=U;break;case"children":S=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:Bt(e,t,M,U,n,null)}zm(e,o,p,S);return;case"option":for(J in n)if(n.hasOwnProperty(J)&&(o=n[J],o!=null))switch(J){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Bt(e,t,J,o,n,null)}return;case"dialog":ct("beforetoggle",e),ct("toggle",e),ct("cancel",e),ct("close",e);break;case"iframe":case"object":ct("load",e);break;case"video":case"audio":for(o=0;o<Uo.length;o++)ct(Uo[o],e);break;case"image":ct("error",e),ct("load",e);break;case"details":ct("toggle",e);break;case"embed":case"source":case"link":ct("error",e),ct("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in n)if(n.hasOwnProperty(ue)&&(o=n[ue],o!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Bt(e,t,ue,o,n,null)}return;default:if($u(t)){for(ve in n)n.hasOwnProperty(ve)&&(o=n[ve],o!==void 0&&Ad(e,t,ve,o,n,void 0));return}}for(U in n)n.hasOwnProperty(U)&&(o=n[U],o!=null&&Bt(e,t,U,o,n,null))}function hw(e,t,n,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,S=null,M=null,U=null,J=null,ue=null,ve=null;for(ge in n){var be=n[ge];if(n.hasOwnProperty(ge)&&be!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":J=be;default:o.hasOwnProperty(ge)||Bt(e,t,ge,null,o,be)}}for(var fe in o){var ge=o[fe];if(be=n[fe],o.hasOwnProperty(fe)&&(ge!=null||be!=null))switch(fe){case"type":S=ge;break;case"name":p=ge;break;case"checked":ue=ge;break;case"defaultChecked":ve=ge;break;case"value":M=ge;break;case"defaultValue":U=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(a(137,t));break;default:ge!==be&&Bt(e,t,fe,ge,o,be)}}Fu(e,M,U,J,ue,ve,S,p);return;case"select":ge=M=U=fe=null;for(S in n)if(J=n[S],n.hasOwnProperty(S)&&J!=null)switch(S){case"value":break;case"multiple":ge=J;default:o.hasOwnProperty(S)||Bt(e,t,S,null,o,J)}for(p in o)if(S=o[p],J=n[p],o.hasOwnProperty(p)&&(S!=null||J!=null))switch(p){case"value":fe=S;break;case"defaultValue":U=S;break;case"multiple":M=S;default:S!==J&&Bt(e,t,p,S,o,J)}t=U,n=M,o=ge,fe!=null?ia(e,!!n,fe,!1):!!o!=!!n&&(t!=null?ia(e,!!n,t,!0):ia(e,!!n,n?[]:"",!1));return;case"textarea":ge=fe=null;for(U in n)if(p=n[U],n.hasOwnProperty(U)&&p!=null&&!o.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Bt(e,t,U,null,o,p)}for(M in o)if(p=o[M],S=n[M],o.hasOwnProperty(M)&&(p!=null||S!=null))switch(M){case"value":fe=p;break;case"defaultValue":ge=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==S&&Bt(e,t,M,p,o,S)}Pm(e,fe,ge);return;case"option":for(var Ne in n)if(fe=n[Ne],n.hasOwnProperty(Ne)&&fe!=null&&!o.hasOwnProperty(Ne))switch(Ne){case"selected":e.selected=!1;break;default:Bt(e,t,Ne,null,o,fe)}for(J in o)if(fe=o[J],ge=n[J],o.hasOwnProperty(J)&&fe!==ge&&(fe!=null||ge!=null))switch(J){case"selected":e.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Bt(e,t,J,fe,o,ge)}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 We in n)fe=n[We],n.hasOwnProperty(We)&&fe!=null&&!o.hasOwnProperty(We)&&Bt(e,t,We,null,o,fe);for(ue in o)if(fe=o[ue],ge=n[ue],o.hasOwnProperty(ue)&&fe!==ge&&(fe!=null||ge!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,t));break;default:Bt(e,t,ue,fe,o,ge)}return;default:if($u(t)){for(var Nt in n)fe=n[Nt],n.hasOwnProperty(Nt)&&fe!==void 0&&!o.hasOwnProperty(Nt)&&Ad(e,t,Nt,void 0,o,fe);for(ve in o)fe=o[ve],ge=n[ve],!o.hasOwnProperty(ve)||fe===ge||fe===void 0&&ge===void 0||Ad(e,t,ve,fe,o,ge);return}}for(var se in n)fe=n[se],n.hasOwnProperty(se)&&fe!=null&&!o.hasOwnProperty(se)&&Bt(e,t,se,null,o,fe);for(be in o)fe=o[be],ge=n[be],!o.hasOwnProperty(be)||fe===ge||fe==null&&ge==null||Bt(e,t,be,fe,o,ge)}function Fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),o=0;o<n.length;o++){var p=n[o],S=p.transferSize,M=p.initiatorType,U=p.duration;if(S&&U&&Fv(M)){for(M=0,U=p.responseEnd,o+=1;o<n.length;o++){var J=n[o],ue=J.startTime;if(ue>U)break;var ve=J.transferSize,be=J.initiatorType;ve&&Fv(be)&&(J=J.responseEnd,M+=ve*(J<U?1:(U-ue)/(J-ue)))}if(--o,t+=8*(S+M)/(p.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ld=null,Md=null;function Ac(e){return e.nodeType===9?e:e.ownerDocument}function qv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $v(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function kd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bd=null;function fw(){var e=window.event;return e&&e.type==="popstate"?e===Bd?!1:(Bd=e,!0):(Bd=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,mw=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,pw=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(e){return Vv.resolve(null).then(e).catch(gw)}:Kv;function gw(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function Wv(e,t){var n=t,o=0;do{var p=n.nextSibling;if(e.removeChild(n),p&&p.nodeType===8)if(n=p.data,n==="/$"||n==="/&"){if(o===0){e.removeChild(p),Ba(t);return}o--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")o++;else if(n==="html")qo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,qo(n);for(var S=n.firstChild;S;){var M=S.nextSibling,U=S.nodeName;S[Ze]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&S.rel.toLowerCase()==="stylesheet"||n.removeChild(S),S=M}}else n==="body"&&qo(e.ownerDocument.body);n=p}while(n);Ba(t)}function Yv(e,t){var n=e;e=0;do{var o=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=o}while(n)}function Nd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nd(n),vt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function vw(e,t,n,o){for(;e.nodeType===1;){var p=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Ze])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(S=e.getAttribute("rel"),S==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(S!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(S=e.getAttribute("src"),(S!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&S&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var S=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===S)return e}else return e;if(e=dr(e.nextSibling),e===null)break}return null}function _w(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=dr(e.nextSibling),e===null))return null;return e}function Gv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=dr(e.nextSibling),e===null))return null;return e}function jd(e){return e.data==="$?"||e.data==="$~"}function Hd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yw(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var o=function(){t(),n.removeEventListener("DOMContentLoaded",o)};n.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function dr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Pd=null;function Xv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return dr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Qv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Zv(e,t,n){switch(t=Ac(n),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function qo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var fr=new Map,Jv=new Set;function Lc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gn=Y.d;Y.d={f:bw,r:Sw,D:ww,C:Cw,L:Ew,m:xw,X:Tw,S:Rw,M:Dw};function bw(){var e=gn.f(),t=wc();return e||t}function Sw(e){var t=ot(e);t!==null&&t.tag===5&&t.type==="form"?gg(t):gn.r(e)}var La=typeof document>"u"?null:document;function e_(e,t,n){var o=La;if(o&&typeof t=="string"&&t){var p=sr(t);p='link[rel="'+e+'"][href="'+p+'"]',typeof n=="string"&&(p+='[crossorigin="'+n+'"]'),Jv.has(p)||(Jv.add(p),e={rel:e,crossOrigin:n,href:t},o.querySelector(p)===null&&(t=o.createElement("link"),xi(t,"link",e),Kt(t),o.head.appendChild(t)))}}function ww(e){gn.D(e),e_("dns-prefetch",e,null)}function Cw(e,t){gn.C(e,t),e_("preconnect",e,t)}function Ew(e,t,n){gn.L(e,t,n);var o=La;if(o&&e&&t){var p='link[rel="preload"][as="'+sr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(p+='[imagesrcset="'+sr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(p+='[imagesizes="'+sr(n.imageSizes)+'"]')):p+='[href="'+sr(e)+'"]';var S=p;switch(t){case"style":S=Ma(e);break;case"script":S=ka(e)}fr.has(S)||(e=d({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),fr.set(S,e),o.querySelector(p)!==null||t==="style"&&o.querySelector($o(S))||t==="script"&&o.querySelector(Ko(S))||(t=o.createElement("link"),xi(t,"link",e),Kt(t),o.head.appendChild(t)))}}function xw(e,t){gn.m(e,t);var n=La;if(n&&e){var o=t&&typeof t.as=="string"?t.as:"script",p='link[rel="modulepreload"][as="'+sr(o)+'"][href="'+sr(e)+'"]',S=p;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=ka(e)}if(!fr.has(S)&&(e=d({rel:"modulepreload",href:e},t),fr.set(S,e),n.querySelector(p)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ko(S)))return}o=n.createElement("link"),xi(o,"link",e),Kt(o),n.head.appendChild(o)}}}function Rw(e,t,n){gn.S(e,t,n);var o=La;if(o&&e){var p=Hi(o).hoistableStyles,S=Ma(e);t=t||"default";var M=p.get(S);if(!M){var U={loading:0,preload:null};if(M=o.querySelector($o(S)))U.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},n),(n=fr.get(S))&&zd(e,n);var J=M=o.createElement("link");Kt(J),xi(J,"link",e),J._p=new Promise(function(ue,ve){J.onload=ue,J.onerror=ve}),J.addEventListener("load",function(){U.loading|=1}),J.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Mc(M,t,o)}M={type:"stylesheet",instance:M,count:1,state:U},p.set(S,M)}}}function Tw(e,t){gn.X(e,t);var n=La;if(n&&e){var o=Hi(n).hoistableScripts,p=ka(e),S=o.get(p);S||(S=n.querySelector(Ko(p)),S||(e=d({src:e,async:!0},t),(t=fr.get(p))&&Id(e,t),S=n.createElement("script"),Kt(S),xi(S,"link",e),n.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(p,S))}}function Dw(e,t){gn.M(e,t);var n=La;if(n&&e){var o=Hi(n).hoistableScripts,p=ka(e),S=o.get(p);S||(S=n.querySelector(Ko(p)),S||(e=d({src:e,async:!0,type:"module"},t),(t=fr.get(p))&&Id(e,t),S=n.createElement("script"),Kt(S),xi(S,"link",e),n.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(p,S))}}function t_(e,t,n,o){var p=(p=pe.current)?Lc(p):null;if(!p)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ma(n.href),n=Hi(p).hoistableStyles,o=n.get(t),o||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ma(n.href);var S=Hi(p).hoistableStyles,M=S.get(e);if(M||(p=p.ownerDocument||p,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(e,M),(S=p.querySelector($o(e)))&&!S._p&&(M.instance=S,M.state.loading=5),fr.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},fr.set(e,n),S||Ow(p,e,n,M.state))),t&&o===null)throw Error(a(528,""));return M}if(t&&o!==null)throw Error(a(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ka(n),n=Hi(p).hoistableScripts,o=n.get(t),o||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Ma(e){return'href="'+sr(e)+'"'}function $o(e){return'link[rel="stylesheet"]['+e+"]"}function i_(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function Ow(e,t,n,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),xi(t,"link",n),Kt(t),e.head.appendChild(t))}function ka(e){return'[src="'+sr(e)+'"]'}function Ko(e){return"script[async]"+e}function r_(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+sr(n.href)+'"]');if(o)return t.instance=o,Kt(o),o;var p=d({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Kt(o),xi(o,"style",p),Mc(o,n.precedence,e),t.instance=o;case"stylesheet":p=Ma(n.href);var S=e.querySelector($o(p));if(S)return t.state.loading|=4,t.instance=S,Kt(S),S;o=i_(n),(p=fr.get(p))&&zd(o,p),S=(e.ownerDocument||e).createElement("link"),Kt(S);var M=S;return M._p=new Promise(function(U,J){M.onload=U,M.onerror=J}),xi(S,"link",o),t.state.loading|=4,Mc(S,n.precedence,e),t.instance=S;case"script":return S=ka(n.src),(p=e.querySelector(Ko(S)))?(t.instance=p,Kt(p),p):(o=n,(p=fr.get(S))&&(o=d({},n),Id(o,p)),e=e.ownerDocument||e,p=e.createElement("script"),Kt(p),xi(p,"link",o),e.head.appendChild(p),t.instance=p);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Mc(o,n.precedence,e));return t.instance}function Mc(e,t,n){for(var o=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=o.length?o[o.length-1]:null,S=p,M=0;M<o.length;M++){var U=o[M];if(U.dataset.precedence===t)S=U;else if(S!==p)break}S?S.parentNode.insertBefore(e,S.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kc=null;function n_(e,t,n){if(kc===null){var o=new Map,p=kc=new Map;p.set(n,o)}else p=kc,o=p.get(n),o||(o=new Map,p.set(n,o));if(o.has(e))return o;for(o.set(e,null),n=n.getElementsByTagName(e),p=0;p<n.length;p++){var S=n[p];if(!(S[Ze]||S[De]||e==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(t)||"";M=e+M;var U=o.get(M);U?U.push(S):o.set(M,[S])}}return o}function s_(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Aw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function a_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Lw(e,t,n,o){if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var p=Ma(o.href),S=t.querySelector($o(p));if(S){t=S._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Bc.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=S,Kt(S);return}S=t.ownerDocument||t,o=i_(o),(p=fr.get(p))&&zd(o,p),S=S.createElement("link"),Kt(S);var M=S;M._p=new Promise(function(U,J){M.onload=U,M.onerror=J}),xi(S,"link",o),n.instance=S}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Bc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ud=0;function Mw(e,t){return e.stylesheets&&e.count===0&&jc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var o=setTimeout(function(){if(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend){var S=e.unsuspend;e.unsuspend=null,S()}},6e4+t);0<e.imgBytes&&Ud===0&&(Ud=62500*dw());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend)){var S=e.unsuspend;e.unsuspend=null,S()}},(e.imgBytes>Ud?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(p)}}:null}function Bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nc=null;function jc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nc=new Map,t.forEach(kw,e),Nc=null,Bc.call(e))}function kw(e,t){if(!(t.state.loading&4)){var n=Nc.get(e);if(n)var o=n.get(null);else{n=new Map,Nc.set(e,n);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<p.length;S++){var M=p[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(n.set(M.dataset.precedence,M),o=M)}o&&n.set(null,o)}p=t.instance,M=p.getAttribute("data-precedence"),S=n.get(M)||o,S===o&&n.set(null,p),n.set(M,p),this.count++,o=Bc.bind(this),p.addEventListener("load",o),p.addEventListener("error",o),S?S.parentNode.insertBefore(p,S.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),t.state.loading|=4}}var Vo={$$typeof:y,Provider:null,Consumer:null,_currentValue:k,_currentValue2:k,_threadCount:0};function Bw(e,t,n,o,p,S,M,U,J){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$t(0),this.hiddenUpdates=$t(null),this.identifierPrefix=o,this.onUncaughtError=p,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function o_(e,t,n,o,p,S,M,U,J,ue,ve,be){return e=new Bw(e,t,n,M,J,ue,ve,be,U),t=1,S===!0&&(t|=24),S=Xi(3,null,null,t),e.current=S,S.stateNode=e,t=bh(),t.refCount++,e.pooledCache=t,t.refCount++,S.memoizedState={element:o,isDehydrated:n,cache:t},Eh(S),e}function l_(e){return e?(e=ua,e):ua}function c_(e,t,n,o,p,S){p=l_(p),o.context===null?o.context=p:o.pendingContext=p,o=Bn(t),o.payload={element:n},S=S===void 0?null:S,S!==null&&(o.callback=S),n=Nn(e,o,t),n!==null&&(qi(n,e,t),Eo(n,e,t))}function u_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fd(e,t){u_(e,t),(e=e.alternate)&&u_(e,t)}function h_(e){if(e.tag===13||e.tag===31){var t=Ss(e,67108864);t!==null&&qi(t,e,67108864),Fd(e,67108864)}}function d_(e){if(e.tag===13||e.tag===31){var t=tr();t=de(t);var n=Ss(e,t);n!==null&&qi(n,e,t),Fd(e,t)}}var Hc=!0;function Nw(e,t,n,o){var p=q.T;q.T=null;var S=Y.p;try{Y.p=2,qd(e,t,n,o)}finally{Y.p=S,q.T=p}}function jw(e,t,n,o){var p=q.T;q.T=null;var S=Y.p;try{Y.p=8,qd(e,t,n,o)}finally{Y.p=S,q.T=p}}function qd(e,t,n,o){if(Hc){var p=$d(o);if(p===null)Od(e,t,o,Pc,n),m_(e,o);else if(Pw(p,e,t,n,o))o.stopPropagation();else if(m_(e,o),t&4&&-1<Hw.indexOf(e)){for(;p!==null;){var S=ot(p);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=di(S.pendingLanes);if(M!==0){var U=S;for(U.pendingLanes|=2,U.entangledLanes|=2;M;){var J=1<<31-Tt(M);U.entanglements[1]|=J,M&=~J}zr(S),(Et&6)===0&&(bc=Be()+500,Io(0))}}break;case 31:case 13:U=Ss(S,2),U!==null&&qi(U,S,2),wc(),Fd(S,2)}if(S=$d(o),S===null&&Od(e,t,o,Pc,n),S===p)break;p=S}p!==null&&o.stopPropagation()}else Od(e,t,o,null,n)}}function $d(e){return e=Vu(e),Kd(e)}var Pc=null;function Kd(e){if(Pc=null,e=St(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pc=e,null}function f_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(at()){case Wt:return 2;case Zt:return 8;case et:case nt:return 32;case dt:return 268435456;default:return 32}default:return 32}}var Vd=!1,Vn=null,Wn=null,Yn=null,Wo=new Map,Yo=new Map,Gn=[],Hw="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 m_(e,t){switch(e){case"focusin":case"focusout":Vn=null;break;case"dragenter":case"dragleave":Wn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":Wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yo.delete(t.pointerId)}}function Go(e,t,n,o,p,S){return e===null||e.nativeEvent!==S?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:S,targetContainers:[p]},t!==null&&(t=ot(t),t!==null&&h_(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function Pw(e,t,n,o,p){switch(t){case"focusin":return Vn=Go(Vn,e,t,n,o,p),!0;case"dragenter":return Wn=Go(Wn,e,t,n,o,p),!0;case"mouseover":return Yn=Go(Yn,e,t,n,o,p),!0;case"pointerover":var S=p.pointerId;return Wo.set(S,Go(Wo.get(S)||null,e,t,n,o,p)),!0;case"gotpointercapture":return S=p.pointerId,Yo.set(S,Go(Yo.get(S)||null,e,t,n,o,p)),!0}return!1}function p_(e){var t=St(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Pe(e.priority,function(){d_(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,Pe(e.priority,function(){d_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$d(e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Ku=o,n.target.dispatchEvent(o),Ku=null}else return t=ot(n),t!==null&&h_(t),e.blockedOn=n,!1;t.shift()}return!0}function g_(e,t,n){zc(e)&&n.delete(t)}function zw(){Vd=!1,Vn!==null&&zc(Vn)&&(Vn=null),Wn!==null&&zc(Wn)&&(Wn=null),Yn!==null&&zc(Yn)&&(Yn=null),Wo.forEach(g_),Yo.forEach(g_)}function Ic(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,zw)))}var Uc=null;function v_(e){Uc!==e&&(Uc=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Uc===e&&(Uc=null);for(var t=0;t<e.length;t+=3){var n=e[t],o=e[t+1],p=e[t+2];if(typeof o!="function"){if(Kd(o||n)===null)continue;break}var S=ot(n);S!==null&&(e.splice(t,3),t-=3,$h(S,{pending:!0,data:p,method:n.method,action:o},o,p))}}))}function Ba(e){function t(J){return Ic(J,e)}Vn!==null&&Ic(Vn,e),Wn!==null&&Ic(Wn,e),Yn!==null&&Ic(Yn,e),Wo.forEach(t),Yo.forEach(t);for(var n=0;n<Gn.length;n++){var o=Gn[n];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Gn.length&&(n=Gn[0],n.blockedOn===null);)p_(n),n.blockedOn===null&&Gn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(o=0;o<n.length;o+=3){var p=n[o],S=n[o+1],M=p[Oe]||null;if(typeof S=="function")M||v_(n);else if(M){var U=null;if(S&&S.hasAttribute("formAction")){if(p=S,M=S[Oe]||null)U=M.formAction;else if(Kd(p)!==null)continue}else U=M.action;typeof U=="function"?n[o+1]=U:(n.splice(o,3),o-=3),v_(n)}}}function __(){function e(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return p=M})},focusReset:"manual",scroll:"manual"})}function t(){p!==null&&(p(),p=null),o||setTimeout(n,20)}function n(){if(!o&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),p!==null&&(p(),p=null)}}}function Wd(e){this._internalRoot=e}Fc.prototype.render=Wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current,o=tr();c_(n,o,e,t,null,null)},Fc.prototype.unmount=Wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;c_(e.current,2,null,e,null,null),wc(),t[te]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Re();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gn.length&&t!==0&&t<Gn[n].priority;n++);Gn.splice(n,0,e),n===0&&p_(e)}};var y_=r.version;if(y_!=="19.2.4")throw Error(a(527,y_,"19.2.4"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=h(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Iw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{Jt=qc.inject(Iw),bt=qc}catch{}}return Qo.createRoot=function(e,t){if(!c(e))throw Error(a(299));var n=!1,o="",p=Rg,S=Tg,M=Dg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(p=t.onUncaughtError),t.onCaughtError!==void 0&&(S=t.onCaughtError),t.onRecoverableError!==void 0&&(M=t.onRecoverableError)),t=o_(e,1,!1,null,null,n,o,null,p,S,M,__),e[te]=t.current,Dd(e),new Wd(t)},Qo.hydrateRoot=function(e,t,n){if(!c(e))throw Error(a(299));var o=!1,p="",S=Rg,M=Tg,U=Dg,J=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(p=n.identifierPrefix),n.onUncaughtError!==void 0&&(S=n.onUncaughtError),n.onCaughtError!==void 0&&(M=n.onCaughtError),n.onRecoverableError!==void 0&&(U=n.onRecoverableError),n.formState!==void 0&&(J=n.formState)),t=o_(e,1,!0,t,n??null,o,p,J,S,M,U,__),t.context=l_(null),n=t.current,o=tr(),o=de(o),p=Bn(o),p.callback=null,Nn(n,p,o),n=o,t.current.lanes=n,yt(t,n),zr(t),e[te]=t.current,Dd(e),new Fc(t)},Qo.version="19.2.4",Qo}var U_;function BC(){if(U_)return Qd.exports;U_=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Qd.exports=kC(),Qd.exports}var NC=BC();/**
|
|
50
|
+
* react-router v7.13.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var qy=i=>{throw TypeError(i)},jC=(i,r,s)=>r.has(i)||qy("Cannot "+s),tf=(i,r,s)=>(jC(i,r,"read from private field"),s?s.call(i):r.get(i)),HC=(i,r,s)=>r.has(i)?qy("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,s),F_="popstate";function PC(i={}){function r(a,c){let{pathname:f,search:v,hash:l}=a.location;return pl("",{pathname:f,search:v,hash:l},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function s(a,c){return typeof c=="string"?c:Gr(c)}return IC(r,s,null,i)}function rt(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function hi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function zC(){return Math.random().toString(36).substring(2,10)}function q_(i,r){return{usr:i.state,key:i.key,idx:r}}function pl(i,r,s=null,a){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?fs(r):r,state:s,key:r&&r.key||a||zC()}}function Gr({pathname:i="/",search:r="",hash:s=""}){return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(i+=s.charAt(0)==="#"?s:"#"+s),i}function fs(i){let r={};if(i){let s=i.indexOf("#");s>=0&&(r.hash=i.substring(s),i=i.substring(0,s));let a=i.indexOf("?");a>=0&&(r.search=i.substring(a),i=i.substring(0,a)),i&&(r.pathname=i)}return r}function IC(i,r,s,a={}){let{window:c=document.defaultView,v5Compat:f=!1}=a,v=c.history,l="POP",u=null,h=b();h==null&&(h=0,v.replaceState({...v.state,idx:h},""));function b(){return(v.state||{idx:null}).idx}function d(){l="POP";let m=b(),g=m==null?null:m-h;h=m,u&&u({action:l,location:D.location,delta:g})}function w(m,g){l="PUSH";let _=pl(D.location,m,g);h=b()+1;let y=q_(_,h),E=D.createHref(_);try{v.pushState(y,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;c.location.assign(E)}f&&u&&u({action:l,location:D.location,delta:1})}function C(m,g){l="REPLACE";let _=pl(D.location,m,g);h=b();let y=q_(_,h),E=D.createHref(_);v.replaceState(y,"",E),f&&u&&u({action:l,location:D.location,delta:0})}function R(m){return $y(m)}let D={get action(){return l},get location(){return i(c,v)},listen(m){if(u)throw new Error("A history only accepts one active listener");return c.addEventListener(F_,d),u=m,()=>{c.removeEventListener(F_,d),u=null}},createHref(m){return r(c,m)},createURL:R,encodeLocation(m){let g=R(m);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:w,replace:C,go(m){return v.go(m)}};return D}function $y(i,r=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),rt(s,"No window.location.(origin|href) available to create URL");let a=typeof i=="string"?i:Gr(i);return a=a.replace(/ $/,"%20"),!r&&a.startsWith("//")&&(a=s+a),new URL(a,s)}var nl,$_=class{constructor(i){if(HC(this,nl,new Map),i)for(let[r,s]of i)this.set(r,s)}get(i){if(tf(this,nl).has(i))return tf(this,nl).get(i);if(i.defaultValue!==void 0)return i.defaultValue;throw new Error("No value found for context")}set(i,r){tf(this,nl).set(i,r)}};nl=new WeakMap;var UC=new Set(["lazy","caseSensitive","path","id","index","children"]);function FC(i){return UC.has(i)}var qC=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function $C(i){return qC.has(i)}function KC(i){return i.index===!0}function gl(i,r,s=[],a={},c=!1){return i.map((f,v)=>{let l=[...s,String(v)],u=typeof f.id=="string"?f.id:l.join("-");if(rt(f.index!==!0||!f.children,"Cannot specify children on an index route"),rt(c||!a[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),KC(f)){let h={...f,id:u};return a[u]=K_(h,r(h)),h}else{let h={...f,id:u,children:void 0};return a[u]=K_(h,r(h)),f.children&&(h.children=gl(f.children,r,l,a,c)),h}})}function K_(i,r){return Object.assign(i,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...i.lazy,...r.lazy}}:{}})}function Jn(i,r,s="/"){return sl(i,r,s,!1)}function sl(i,r,s,a){let c=typeof r=="string"?fs(r):r,f=br(c.pathname||"/",s);if(f==null)return null;let v=Ky(i);WC(v);let l=null;for(let u=0;l==null&&u<v.length;++u){let h=Wy(f);l=iE(v[u],h,a)}return l}function VC(i,r){let{route:s,pathname:a,params:c}=i;return{id:s.id,pathname:a,params:c,data:r[s.id],loaderData:r[s.id],handle:s.handle}}function Ky(i,r=[],s=[],a="",c=!1){let f=(v,l,u=c,h)=>{let b={relativePath:h===void 0?v.path||"":h,caseSensitive:v.caseSensitive===!0,childrenIndex:l,route:v};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;rt(b.relativePath.startsWith(a),`Absolute route path "${b.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(a.length)}let d=Yr([a,b.relativePath]),w=s.concat(b);v.children&&v.children.length>0&&(rt(v.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Ky(v.children,r,w,d,u)),!(v.path==null&&!v.index)&&r.push({path:d,score:eE(d,v.index),routesMeta:w})};return i.forEach((v,l)=>{var u;if(v.path===""||!((u=v.path)!=null&&u.includes("?")))f(v,l);else for(let h of Vy(v.path))f(v,l,!0,h)}),r}function Vy(i){let r=i.split("/");if(r.length===0)return[];let[s,...a]=r,c=s.endsWith("?"),f=s.replace(/\?$/,"");if(a.length===0)return c?[f,""]:[f];let v=Vy(a.join("/")),l=[];return l.push(...v.map(u=>u===""?f:[f,u].join("/"))),c&&l.push(...v),l.map(u=>i.startsWith("/")&&u===""?"/":u)}function WC(i){i.sort((r,s)=>r.score!==s.score?s.score-r.score:tE(r.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}var YC=/^:[\w-]+$/,GC=3,XC=2,QC=1,ZC=10,JC=-2,V_=i=>i==="*";function eE(i,r){let s=i.split("/"),a=s.length;return s.some(V_)&&(a+=JC),r&&(a+=XC),s.filter(c=>!V_(c)).reduce((c,f)=>c+(YC.test(f)?GC:f===""?QC:ZC),a)}function tE(i,r){return i.length===r.length&&i.slice(0,-1).every((a,c)=>a===r[c])?i[i.length-1]-r[r.length-1]:0}function iE(i,r,s=!1){let{routesMeta:a}=i,c={},f="/",v=[];for(let l=0;l<a.length;++l){let u=a[l],h=l===a.length-1,b=f==="/"?r:r.slice(f.length)||"/",d=Zs({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},b),w=u.route;if(!d&&h&&s&&!a[a.length-1].route.index&&(d=Zs({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!d)return null;Object.assign(c,d.params),v.push({params:c,pathname:Yr([f,d.pathname]),pathnameBase:aE(Yr([f,d.pathnameBase])),route:w}),d.pathnameBase!=="/"&&(f=Yr([f,d.pathnameBase]))}return v}function Zs(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[s,a]=rE(i.path,i.caseSensitive,i.end),c=r.match(s);if(!c)return null;let f=c[0],v=f.replace(/(.)\/+$/,"$1"),l=c.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:d},w)=>{if(b==="*"){let R=l[w]||"";v=f.slice(0,f.length-R.length).replace(/(.)\/+$/,"$1")}const C=l[w];return d&&!C?h[b]=void 0:h[b]=(C||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:v,pattern:i}}function rE(i,r=!1,s=!0){hi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let a=[],c="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(v,l,u)=>(a.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(a.push({paramName:"*"}),c+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?c+="\\/*$":i!==""&&i!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),a]}function Wy(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return hi(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),i}}function br(i,r){if(r==="/")return i;if(!i.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,a=i.charAt(s);return a&&a!=="/"?null:i.slice(s)||"/"}function nE({basename:i,pathname:r}){return r==="/"?i:Yr([i,r])}var Yy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mm=i=>Yy.test(i);function sE(i,r="/"){let{pathname:s,search:a="",hash:c=""}=typeof i=="string"?fs(i):i,f;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?f=W_(s.substring(1),"/"):f=W_(s,r)):f=r,{pathname:f,search:oE(a),hash:lE(c)}}function W_(i,r){let s=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(c=>{c===".."?s.length>1&&s.pop():c!=="."&&s.push(c)}),s.length>1?s.join("/"):"/"}function rf(i,r,s,a){return`Cannot include a '${i}' character in a manually specified \`to.${r}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Gy(i){return i.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function pm(i){let r=Gy(i);return r.map((s,a)=>a===r.length-1?s.pathname:s.pathnameBase)}function gm(i,r,s,a=!1){let c;typeof i=="string"?c=fs(i):(c={...i},rt(!c.pathname||!c.pathname.includes("?"),rf("?","pathname","search",c)),rt(!c.pathname||!c.pathname.includes("#"),rf("#","pathname","hash",c)),rt(!c.search||!c.search.includes("#"),rf("#","search","hash",c)));let f=i===""||c.pathname==="",v=f?"/":c.pathname,l;if(v==null)l=s;else{let d=r.length-1;if(!a&&v.startsWith("..")){let w=v.split("/");for(;w[0]==="..";)w.shift(),d-=1;c.pathname=w.join("/")}l=d>=0?r[d]:"/"}let u=sE(c,l),h=v&&v!=="/"&&v.endsWith("/"),b=(f||v===".")&&s.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var Yr=i=>i.join("/").replace(/\/\/+/g,"/"),aE=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),oE=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,lE=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,Rl=class{constructor(i,r,s,a=!1){this.status=i,this.statusText=r||"",this.internal=a,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function vl(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Tl(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qy(i,r){let s=i;if(typeof s!="string"||!Yy.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let a=s,c=!1;if(Xy)try{let f=new URL(window.location.href),v=s.startsWith("//")?new URL(f.protocol+s):new URL(s),l=br(v.pathname,r);v.origin===f.origin&&l!=null?s=l+v.search+v.hash:c=!0}catch{hi(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:c,to:s}}var us=Symbol("Uninstrumented");function cE(i,r){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};i.forEach(c=>c({id:r.id,index:r.index,path:r.path,instrument(f){let v=Object.keys(s);for(let l of v)f[l]&&s[l].push(f[l])}}));let a={};if(typeof r.lazy=="function"&&s.lazy.length>0){let c=Pa(s.lazy,r.lazy,()=>{});c&&(a.lazy=c)}if(typeof r.lazy=="object"){let c=r.lazy;["middleware","loader","action"].forEach(f=>{let v=c[f],l=s[`lazy.${f}`];if(typeof v=="function"&&l.length>0){let u=Pa(l,v,()=>{});u&&(a.lazy=Object.assign(a.lazy||{},{[f]:u}))}})}return["loader","action"].forEach(c=>{let f=r[c];if(typeof f=="function"&&s[c].length>0){let v=f[us]??f,l=Pa(s[c],v,(...u)=>Y_(u[0]));l&&(c==="loader"&&v.hydrate===!0&&(l.hydrate=!0),l[us]=v,a[c]=l)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(a.middleware=r.middleware.map(c=>{let f=c[us]??c,v=Pa(s.middleware,f,(...l)=>Y_(l[0]));return v?(v[us]=f,v):c})),a}function uE(i,r){let s={navigate:[],fetch:[]};if(r.forEach(a=>a({instrument(c){let f=Object.keys(c);for(let v of f)c[v]&&s[v].push(c[v])}})),s.navigate.length>0){let a=i.navigate[us]??i.navigate,c=Pa(s.navigate,a,(...f)=>{let[v,l]=f;return{to:typeof v=="number"||typeof v=="string"?v:v?Gr(v):".",...G_(i,l??{})}});c&&(c[us]=a,i.navigate=c)}if(s.fetch.length>0){let a=i.fetch[us]??i.fetch,c=Pa(s.fetch,a,(...f)=>{let[v,,l,u]=f;return{href:l??".",fetcherKey:v,...G_(i,u??{})}});c&&(c[us]=a,i.fetch=c)}return i}function Pa(i,r,s){return i.length===0?null:async(...a)=>{let c=await Zy(i,s(...a),()=>r(...a),i.length-1);if(c.type==="error")throw c.value;return c.value}}async function Zy(i,r,s,a){let c=i[a],f;if(c){let v,l=async()=>(v?console.error("You cannot call instrumented handlers more than once"):v=Zy(i,r,s,a-1),f=await v,rt(f,"Expected a result"),f.type==="error"&&f.value instanceof Error?{status:"error",error:f.value}:{status:"success",error:void 0});try{await c(l,r)}catch(u){console.error("An instrumentation function threw an error:",u)}v||await l(),await v}else try{f={type:"success",value:await s()}}catch(v){f={type:"error",value:v}}return f||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Y_(i){let{request:r,context:s,params:a,unstable_pattern:c}=i;return{request:hE(r),params:{...a},unstable_pattern:c,context:dE(s)}}function G_(i,r){return{currentUrl:Gr(i.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function hE(i){return{method:i.method,url:i.url,headers:{get:(...r)=>i.headers.get(...r)}}}function dE(i){if(mE(i)){let r={...i};return Object.freeze(r),r}else return{get:r=>i.get(r)}}var fE=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mE(i){if(i===null||typeof i!="object")return!1;const r=Object.getPrototypeOf(i);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===fE}var Jy=["POST","PUT","PATCH","DELETE"],pE=new Set(Jy),gE=["GET",...Jy],vE=new Set(gE),eb=new Set([301,302,303,307,308]),_E=new Set([307,308]),nf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yE={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},bE=i=>({hasErrorBoundary:!!i.hasErrorBoundary}),tb="remix-router-transitions",ib=Symbol("ResetLoaderData");function SE(i){const r=i.window?i.window:typeof window<"u"?window:void 0,s=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";rt(i.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=i.hydrationRouteProperties||[],c=i.mapRouteProperties||bE,f=c;if(i.unstable_instrumentations){let Q=i.unstable_instrumentations;f=re=>({...c(re),...cE(Q.map(de=>de.route).filter(Boolean),re)})}let v={},l=gl(i.routes,f,void 0,v),u,h=i.basename||"/";h.startsWith("/")||(h=`/${h}`);let b=i.dataStrategy||RE,d={...i.future},w=null,C=new Set,R=null,D=null,m=null,g=i.hydrationData!=null,_=Jn(l,i.history.location,h),y=!1,E=null,T;if(_==null&&!i.patchRoutesOnNavigation){let Q=gr(404,{pathname:i.history.location.pathname}),{matches:re,route:de}=Vc(l);T=!0,_=re,E={[de.id]:Q}}else if(_&&!i.hydrationData&&Pt(_,l,i.history.location.pathname).active&&(_=null),_)if(_.some(Q=>Q.route.lazy))T=!1;else if(!_.some(Q=>vm(Q.route)))T=!0;else{let Q=i.hydrationData?i.hydrationData.loaderData:null,re=i.hydrationData?i.hydrationData.errors:null;if(re){let de=_.findIndex(Se=>re[Se.route.id]!==void 0);T=_.slice(0,de+1).every(Se=>!zf(Se.route,Q,re))}else T=_.every(de=>!zf(de.route,Q,re))}else{T=!1,_=[];let Q=Pt(null,l,i.history.location.pathname);Q.active&&Q.matches&&(y=!0,_=Q.matches)}let A,O={historyAction:i.history.action,location:i.history.location,matches:_,initialized:T,navigation:nf,restoreScrollPosition:i.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:i.hydrationData&&i.hydrationData.loaderData||{},actionData:i.hydrationData&&i.hydrationData.actionData||null,errors:i.hydrationData&&i.hydrationData.errors||E,fetchers:new Map,blockers:new Map},x="POP",L=null,I=!1,V,P=!1,$=new Map,Z=null,W=!1,q=!1,Y=new Set,k=new Map,z=0,K=-1,B=new Map,F=new Set,X=new Map,ne=new Map,ae=new Set,pe=new Map,j,G=null;function oe(){if(w=i.history.listen(({action:Q,location:re,delta:de})=>{if(j){j(),j=void 0;return}hi(pe.size===0||de!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Se=yi({currentLocation:O.location,nextLocation:re,historyAction:Q});if(Se&&de!=null){let Re=new Promise(Pe=>{j=Pe});i.history.go(de*-1),rr(Se,{state:"blocked",location:re,proceed(){rr(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:re}),Re.then(()=>i.history.go(de))},reset(){let Pe=new Map(O.blockers);Pe.set(Se,Zo),he({blockers:Pe})}}),L==null||L.resolve(),L=null;return}return xe(Q,re)}),s){$E(r,$);let Q=()=>KE(r,$);r.addEventListener("pagehide",Q),Z=()=>r.removeEventListener("pagehide",Q)}return O.initialized||xe("POP",O.location,{initialHydration:!0}),A}function le(){w&&w(),Z&&Z(),C.clear(),V&&V.abort(),O.fetchers.forEach((Q,re)=>Qe(re)),O.blockers.forEach((Q,re)=>Ni(re))}function me(Q){return C.add(Q),()=>C.delete(Q)}function he(Q,re={}){Q.matches&&(Q.matches=Q.matches.map(Re=>{let Pe=v[Re.route.id],je=Re.route;return je.element!==Pe.element||je.errorElement!==Pe.errorElement||je.hydrateFallbackElement!==Pe.hydrateFallbackElement?{...Re,route:Pe}:Re})),O={...O,...Q};let de=[],Se=[];O.fetchers.forEach((Re,Pe)=>{Re.state==="idle"&&(ae.has(Pe)?de.push(Pe):Se.push(Pe))}),ae.forEach(Re=>{!O.fetchers.has(Re)&&!k.has(Re)&&de.push(Re)}),[...C].forEach(Re=>Re(O,{deletedFetchers:de,newErrors:Q.errors??null,viewTransitionOpts:re.viewTransitionOpts,flushSync:re.flushSync===!0})),de.forEach(Re=>Qe(Re)),Se.forEach(Re=>O.fetchers.delete(Re))}function Ce(Q,re,{flushSync:de}={}){var ye,we;let Se=O.actionData!=null&&O.navigation.formMethod!=null&&Ai(O.navigation.formMethod)&&O.navigation.state==="loading"&&((ye=Q.state)==null?void 0:ye._isRedirect)!==!0,Re;re.actionData?Object.keys(re.actionData).length>0?Re=re.actionData:Re=null:Se?Re=O.actionData:Re=null;let Pe=re.loaderData?s0(O.loaderData,re.loaderData,re.matches||[],re.errors):O.loaderData,je=O.blockers;je.size>0&&(je=new Map(je),je.forEach((ke,ze)=>je.set(ze,Zo)));let De=W?!1:Ht(Q,re.matches||O.matches),Oe=I===!0||O.navigation.formMethod!=null&&Ai(O.navigation.formMethod)&&((we=Q.state)==null?void 0:we._isRedirect)!==!0;u&&(l=u,u=void 0),W||x==="POP"||(x==="PUSH"?i.history.push(Q,Q.state):x==="REPLACE"&&i.history.replace(Q,Q.state));let te;if(x==="POP"){let ke=$.get(O.location.pathname);ke&&ke.has(Q.pathname)?te={currentLocation:O.location,nextLocation:Q}:$.has(Q.pathname)&&(te={currentLocation:Q,nextLocation:O.location})}else if(P){let ke=$.get(O.location.pathname);ke?ke.add(Q.pathname):(ke=new Set([Q.pathname]),$.set(O.location.pathname,ke)),te={currentLocation:O.location,nextLocation:Q}}he({...re,actionData:Re,loaderData:Pe,historyAction:x,location:Q,initialized:!0,navigation:nf,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Oe,blockers:je},{viewTransitionOpts:te,flushSync:de===!0}),x="POP",I=!1,P=!1,W=!1,q=!1,L==null||L.resolve(),L=null,G==null||G.resolve(),G=null}async function Ve(Q,re){if(L==null||L.resolve(),L=null,typeof Q=="number"){L||(L=c0());let ze=L.promise;return i.history.go(Q),ze}let de=Pf(O.location,O.matches,h,Q,re==null?void 0:re.fromRouteId,re==null?void 0:re.relative),{path:Se,submission:Re,error:Pe}=X_(!1,de,re),je=O.location,De=pl(O.location,Se,re&&re.state);De={...De,...i.history.encodeLocation(De)};let Oe=re&&re.replace!=null?re.replace:void 0,te="PUSH";Oe===!0?te="REPLACE":Oe===!1||Re!=null&&Ai(Re.formMethod)&&Re.formAction===O.location.pathname+O.location.search&&(te="REPLACE");let ye=re&&"preventScrollReset"in re?re.preventScrollReset===!0:void 0,we=(re&&re.flushSync)===!0,ke=yi({currentLocation:je,nextLocation:De,historyAction:te});if(ke){rr(ke,{state:"blocked",location:De,proceed(){rr(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:De}),Ve(Q,re)},reset(){let ze=new Map(O.blockers);ze.set(ke,Zo),he({blockers:ze})}});return}await xe(te,De,{submission:Re,pendingError:Pe,preventScrollReset:ye,replace:re&&re.replace,enableViewTransition:re&&re.viewTransition,flushSync:we,callSiteDefaultShouldRevalidate:re&&re.unstable_defaultShouldRevalidate})}function He(){G||(G=c0()),Zt(),he({revalidation:"loading"});let Q=G.promise;return O.navigation.state==="submitting"?Q:O.navigation.state==="idle"?(xe(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),Q):(xe(x||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:P===!0}),Q)}async function xe(Q,re,de){V&&V.abort(),V=null,x=Q,W=(de&&de.startUninterruptedRevalidation)===!0,Dt(O.location,O.matches),I=(de&&de.preventScrollReset)===!0,P=(de&&de.enableViewTransition)===!0;let Se=u||l,Re=de&&de.overrideNavigation,Pe=de!=null&&de.initialHydration&&O.matches&&O.matches.length>0&&!y?O.matches:Jn(Se,re,h),je=(de&&de.flushSync)===!0;if(Pe&&O.initialized&&!q&&BE(O.location,re)&&!(de&&de.submission&&Ai(de.submission.formMethod))){Ce(re,{matches:Pe},{flushSync:je});return}let De=Pt(Pe,Se,re.pathname);if(De.active&&De.matches&&(Pe=De.matches),!Pe){let{error:vt,notFoundMatches:St,route:ot}=bi(re.pathname);Ce(re,{matches:St,loaderData:{},errors:{[ot.id]:vt}},{flushSync:je});return}V=new AbortController;let Oe=ja(i.history,re,V.signal,de&&de.submission),te=i.getContext?await i.getContext():new $_,ye;if(de&&de.pendingError)ye=[es(Pe).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&Ai(de.submission.formMethod)){let vt=await Ee(Oe,re,de.submission,Pe,te,De.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:je});if(vt.shortCircuited)return;if(vt.pendingActionResult){let[St,ot]=vt.pendingActionResult;if(ir(ot)&&vl(ot.error)&&ot.error.status===404){V=null,Ce(re,{matches:vt.matches,loaderData:{},errors:{[St]:ot.error}});return}}Pe=vt.matches||Pe,ye=vt.pendingActionResult,Re=sf(re,de.submission),je=!1,De.active=!1,Oe=ja(i.history,Oe.url,Oe.signal)}let{shortCircuited:we,matches:ke,loaderData:ze,errors:Ze}=await Ue(Oe,re,Pe,te,De.active,Re,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,je,ye,de&&de.callSiteDefaultShouldRevalidate);we||(V=null,Ce(re,{matches:ke||Pe,...a0(ye),loaderData:ze,errors:Ze}))}async function Ee(Q,re,de,Se,Re,Pe,je,De={}){Zt();let Oe=FE(re,de);if(he({navigation:Oe},{flushSync:De.flushSync===!0}),Pe){let we=await $t(Se,re.pathname,Q.signal);if(we.type==="aborted")return{shortCircuited:!0};if(we.type==="error"){if(we.partialMatches.length===0){let{matches:ze,route:Ze}=Vc(l);return{matches:ze,pendingActionResult:[Ze.id,{type:"error",error:we.error}]}}let ke=es(we.partialMatches).route.id;return{matches:we.partialMatches,pendingActionResult:[ke,{type:"error",error:we.error}]}}else if(we.matches)Se=we.matches;else{let{notFoundMatches:ke,error:ze,route:Ze}=bi(re.pathname);return{matches:ke,pendingActionResult:[Ze.id,{type:"error",error:ze}]}}}let te,ye=nu(Se,re);if(!ye.route.action&&!ye.route.lazy)te={type:"error",error:gr(405,{method:Q.method,pathname:re.pathname,routeId:ye.route.id})};else{let we=za(f,v,Q,Se,ye,je?[]:a,Re),ke=await at(Q,we,Re,null);if(te=ke[ye.route.id],!te){for(let ze of Se)if(ke[ze.route.id]){te=ke[ze.route.id];break}}if(Q.signal.aborted)return{shortCircuited:!0}}if(Ps(te)){let we;return De&&De.replace!=null?we=De.replace:we=i0(te.response.headers.get("Location"),new URL(Q.url),h,i.history)===O.location.pathname+O.location.search,await Be(Q,te,!0,{submission:de,replace:we}),{shortCircuited:!0}}if(ir(te)){let we=es(Se,ye.route.id);return(De&&De.replace)!==!0&&(x="PUSH"),{matches:Se,pendingActionResult:[we.route.id,te,ye.route.id]}}return{matches:Se,pendingActionResult:[ye.route.id,te]}}async function Ue(Q,re,de,Se,Re,Pe,je,De,Oe,te,ye,we,ke){let ze=Pe||sf(re,je),Ze=je||De||l0(ze),vt=!W&&!te;if(Re){if(vt){let ii=Fe(we);he({navigation:ze,...ii!==void 0?{actionData:ii}:{}},{flushSync:ye})}let ft=await $t(de,re.pathname,Q.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:xr,route:Si}=Vc(l);return{matches:xr,loaderData:{},errors:{[Si.id]:ft.error}}}let ii=es(ft.partialMatches).route.id;return{matches:ft.partialMatches,loaderData:{},errors:{[ii]:ft.error}}}else if(ft.matches)de=ft.matches;else{let{error:ii,notFoundMatches:xr,route:Si}=bi(re.pathname);return{matches:xr,loaderData:{},errors:{[Si.id]:ii}}}}let St=u||l,{dsMatches:ot,revalidatingFetchers:pi}=Q_(Q,Se,f,v,i.history,O,de,Ze,re,te?[]:a,te===!0,q,Y,ae,X,F,St,h,i.patchRoutesOnNavigation!=null,we,ke);if(K=++z,!i.dataStrategy&&!ot.some(ft=>ft.shouldLoad)&&!ot.some(ft=>ft.route.middleware&&ft.route.middleware.length>0)&&pi.length===0){let ft=Tt();return Ce(re,{matches:de,loaderData:{},errors:we&&ir(we[1])?{[we[0]]:we[1].error}:null,...a0(we),...ft?{fetchers:new Map(O.fetchers)}:{}},{flushSync:ye}),{shortCircuited:!0}}if(vt){let ft={};if(!Re){ft.navigation=ze;let ii=Fe(we);ii!==void 0&&(ft.actionData=ii)}pi.length>0&&(ft.fetchers=st(pi)),he(ft,{flushSync:ye})}pi.forEach(ft=>{bt(ft.key),ft.controller&&k.set(ft.key,ft.controller)});let Hi=()=>pi.forEach(ft=>bt(ft.key));V&&V.signal.addEventListener("abort",Hi);let{loaderResults:Kt,fetcherResults:Cr}=await Wt(ot,pi,Q,Se);if(Q.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Hi),pi.forEach(ft=>k.delete(ft.key));let Yi=Wc(Kt);if(Yi)return await Be(Q,Yi.result,!0,{replace:Oe}),{shortCircuited:!0};if(Yi=Wc(Cr),Yi)return F.add(Yi.key),await Be(Q,Yi.result,!0,{replace:Oe}),{shortCircuited:!0};let{loaderData:Er,errors:nr}=n0(O,de,Kt,we,pi,Cr);te&&O.errors&&(nr={...O.errors,...nr});let Zr=Tt(),ps=si(K),gs=Zr||ps||pi.length>0;return{matches:de,loaderData:Er,errors:nr,...gs?{fetchers:new Map(O.fetchers)}:{}}}function Fe(Q){if(Q&&!ir(Q[1]))return{[Q[0]]:Q[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function st(Q){return Q.forEach(re=>{let de=O.fetchers.get(re.key),Se=Jo(void 0,de?de.data:void 0);O.fetchers.set(re.key,Se)}),new Map(O.fetchers)}async function qe(Q,re,de,Se){bt(Q);let Re=(Se&&Se.flushSync)===!0,Pe=u||l,je=Pf(O.location,O.matches,h,de,re,Se==null?void 0:Se.relative),De=Jn(Pe,je,h),Oe=Pt(De,Pe,je);if(Oe.active&&Oe.matches&&(De=Oe.matches),!De){nt(Q,re,gr(404,{pathname:je}),{flushSync:Re});return}let{path:te,submission:ye,error:we}=X_(!0,je,Se);if(we){nt(Q,re,we,{flushSync:Re});return}let ke=i.getContext?await i.getContext():new $_,ze=(Se&&Se.preventScrollReset)===!0;if(ye&&Ai(ye.formMethod)){await Ae(Q,re,te,De,ke,Oe.active,Re,ze,ye,Se&&Se.unstable_defaultShouldRevalidate);return}X.set(Q,{routeId:re,path:te}),await Ye(Q,re,te,De,ke,Oe.active,Re,ze,ye)}async function Ae(Q,re,de,Se,Re,Pe,je,De,Oe,te){Zt(),X.delete(Q);let ye=O.fetchers.get(Q);et(Q,qE(Oe,ye),{flushSync:je});let we=new AbortController,ke=ja(i.history,de,we.signal,Oe);if(Pe){let mt=await $t(Se,new URL(ke.url).pathname,ke.signal,Q);if(mt.type==="aborted")return;if(mt.type==="error"){nt(Q,re,mt.error,{flushSync:je});return}else if(mt.matches)Se=mt.matches;else{nt(Q,re,gr(404,{pathname:de}),{flushSync:je});return}}let ze=nu(Se,de);if(!ze.route.action&&!ze.route.lazy){let mt=gr(405,{method:Oe.formMethod,pathname:de,routeId:re});nt(Q,re,mt,{flushSync:je});return}k.set(Q,we);let Ze=z,vt=za(f,v,ke,Se,ze,a,Re),St=await at(ke,vt,Re,Q),ot=St[ze.route.id];if(!ot){for(let mt of vt)if(St[mt.route.id]){ot=St[mt.route.id];break}}if(ke.signal.aborted){k.get(Q)===we&&k.delete(Q);return}if(ae.has(Q)){if(Ps(ot)||ir(ot)){et(Q,_n(void 0));return}}else{if(Ps(ot))if(k.delete(Q),K>Ze){et(Q,_n(void 0));return}else return F.add(Q),et(Q,Jo(Oe)),Be(ke,ot,!1,{fetcherSubmission:Oe,preventScrollReset:De});if(ir(ot)){nt(Q,re,ot.error);return}}let pi=O.navigation.location||O.location,Hi=ja(i.history,pi,we.signal),Kt=u||l,Cr=O.navigation.state!=="idle"?Jn(Kt,O.navigation.location,h):O.matches;rt(Cr,"Didn't find any matches after fetcher action");let Yi=++z;B.set(Q,Yi);let Er=Jo(Oe,ot.data);O.fetchers.set(Q,Er);let{dsMatches:nr,revalidatingFetchers:Zr}=Q_(Hi,Re,f,v,i.history,O,Cr,Oe,pi,a,!1,q,Y,ae,X,F,Kt,h,i.patchRoutesOnNavigation!=null,[ze.route.id,ot],te);Zr.filter(mt=>mt.key!==Q).forEach(mt=>{let vs=mt.key,kl=O.fetchers.get(vs),oo=Jo(void 0,kl?kl.data:void 0);O.fetchers.set(vs,oo),bt(vs),mt.controller&&k.set(vs,mt.controller)}),he({fetchers:new Map(O.fetchers)});let ps=()=>Zr.forEach(mt=>bt(mt.key));we.signal.addEventListener("abort",ps);let{loaderResults:gs,fetcherResults:ft}=await Wt(nr,Zr,Hi,Re);if(we.signal.aborted)return;if(we.signal.removeEventListener("abort",ps),B.delete(Q),k.delete(Q),Zr.forEach(mt=>k.delete(mt.key)),O.fetchers.has(Q)){let mt=_n(ot.data);O.fetchers.set(Q,mt)}let ii=Wc(gs);if(ii)return Be(Hi,ii.result,!1,{preventScrollReset:De});if(ii=Wc(ft),ii)return F.add(ii.key),Be(Hi,ii.result,!1,{preventScrollReset:De});let{loaderData:xr,errors:Si}=n0(O,Cr,gs,void 0,Zr,ft);si(Yi),O.navigation.state==="loading"&&Yi>K?(rt(x,"Expected pending action"),V&&V.abort(),Ce(O.navigation.location,{matches:Cr,loaderData:xr,errors:Si,fetchers:new Map(O.fetchers)})):(he({errors:Si,loaderData:s0(O.loaderData,xr,Cr,Si),fetchers:new Map(O.fetchers)}),q=!1)}async function Ye(Q,re,de,Se,Re,Pe,je,De,Oe){let te=O.fetchers.get(Q);et(Q,Jo(Oe,te?te.data:void 0),{flushSync:je});let ye=new AbortController,we=ja(i.history,de,ye.signal);if(Pe){let ot=await $t(Se,new URL(we.url).pathname,we.signal,Q);if(ot.type==="aborted")return;if(ot.type==="error"){nt(Q,re,ot.error,{flushSync:je});return}else if(ot.matches)Se=ot.matches;else{nt(Q,re,gr(404,{pathname:de}),{flushSync:je});return}}let ke=nu(Se,de);k.set(Q,ye);let ze=z,Ze=za(f,v,we,Se,ke,a,Re),St=(await at(we,Ze,Re,Q))[ke.route.id];if(k.get(Q)===ye&&k.delete(Q),!we.signal.aborted){if(ae.has(Q)){et(Q,_n(void 0));return}if(Ps(St))if(K>ze){et(Q,_n(void 0));return}else{F.add(Q),await Be(we,St,!1,{preventScrollReset:De});return}if(ir(St)){nt(Q,re,St.error);return}et(Q,_n(St.data))}}async function Be(Q,re,de,{submission:Se,fetcherSubmission:Re,preventScrollReset:Pe,replace:je}={}){de||(L==null||L.resolve(),L=null),re.response.headers.has("X-Remix-Revalidate")&&(q=!0);let De=re.response.headers.get("Location");rt(De,"Expected a Location header on the redirect Response"),De=i0(De,new URL(Q.url),h,i.history);let Oe=pl(O.location,De,{_isRedirect:!0});if(s){let Ze=!1;if(re.response.headers.has("X-Remix-Reload-Document"))Ze=!0;else if(mm(De)){const vt=$y(De,!0);Ze=vt.origin!==r.location.origin||br(vt.pathname,h)==null}if(Ze){je?r.location.replace(De):r.location.assign(De);return}}V=null;let te=je===!0||re.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ye,formAction:we,formEncType:ke}=O.navigation;!Se&&!Re&&ye&&we&&ke&&(Se=l0(O.navigation));let ze=Se||Re;if(_E.has(re.response.status)&&ze&&Ai(ze.formMethod))await xe(te,Oe,{submission:{...ze,formAction:De},preventScrollReset:Pe||I,enableViewTransition:de?P:void 0});else{let Ze=sf(Oe,Se);await xe(te,Oe,{overrideNavigation:Ze,fetcherSubmission:Re,preventScrollReset:Pe||I,enableViewTransition:de?P:void 0})}}async function at(Q,re,de,Se){var je;let Re,Pe={};try{Re=await DE(b,Q,re,Se,de,!1)}catch(De){return re.filter(Oe=>Oe.shouldLoad).forEach(Oe=>{Pe[Oe.route.id]={type:"error",error:De}}),Pe}if(Q.signal.aborted)return Pe;if(!Ai(Q.method))for(let De of re){if(((je=Re[De.route.id])==null?void 0:je.type)==="error")break;!Re.hasOwnProperty(De.route.id)&&!O.loaderData.hasOwnProperty(De.route.id)&&(!O.errors||!O.errors.hasOwnProperty(De.route.id))&&De.shouldCallHandler()&&(Re[De.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${De.route.id}`)})}for(let[De,Oe]of Object.entries(Re))if(PE(Oe)){let te=Oe.result;Pe[De]={type:"redirect",response:ME(te,Q,De,re,h)}}else Pe[De]=await LE(Oe);return Pe}async function Wt(Q,re,de,Se){let Re=at(de,Q,Se,null),Pe=Promise.all(re.map(async Oe=>{if(Oe.matches&&Oe.match&&Oe.request&&Oe.controller){let ye=(await at(Oe.request,Oe.matches,Se,Oe.key))[Oe.match.route.id];return{[Oe.key]:ye}}else return Promise.resolve({[Oe.key]:{type:"error",error:gr(404,{pathname:Oe.path})}})})),je=await Re,De=(await Pe).reduce((Oe,te)=>Object.assign(Oe,te),{});return{loaderResults:je,fetcherResults:De}}function Zt(){q=!0,X.forEach((Q,re)=>{k.has(re)&&Y.add(re),bt(re)})}function et(Q,re,de={}){O.fetchers.set(Q,re),he({fetchers:new Map(O.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function nt(Q,re,de,Se={}){let Re=es(O.matches,re);Qe(Q),he({errors:{[Re.route.id]:de},fetchers:new Map(O.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function dt(Q){return ne.set(Q,(ne.get(Q)||0)+1),ae.has(Q)&&ae.delete(Q),O.fetchers.get(Q)||yE}function It(Q,re){bt(Q,re==null?void 0:re.reason),et(Q,_n(null))}function Qe(Q){let re=O.fetchers.get(Q);k.has(Q)&&!(re&&re.state==="loading"&&B.has(Q))&&bt(Q),X.delete(Q),B.delete(Q),F.delete(Q),ae.delete(Q),Y.delete(Q),O.fetchers.delete(Q)}function Jt(Q){let re=(ne.get(Q)||0)-1;re<=0?(ne.delete(Q),ae.add(Q)):ne.set(Q,re),he({fetchers:new Map(O.fetchers)})}function bt(Q,re){let de=k.get(Q);de&&(de.abort(re),k.delete(Q))}function ei(Q){for(let re of Q){let de=dt(re),Se=_n(de.data);O.fetchers.set(re,Se)}}function Tt(){let Q=[],re=!1;for(let de of F){let Se=O.fetchers.get(de);rt(Se,`Expected fetcher: ${de}`),Se.state==="loading"&&(F.delete(de),Q.push(de),re=!0)}return ei(Q),re}function si(Q){let re=[];for(let[de,Se]of B)if(Se<Q){let Re=O.fetchers.get(de);rt(Re,`Expected fetcher: ${de}`),Re.state==="loading"&&(bt(de),B.delete(de),re.push(de))}return ei(re),re.length>0}function Nr(Q,re){let de=O.blockers.get(Q)||Zo;return pe.get(Q)!==re&&pe.set(Q,re),de}function Ni(Q){O.blockers.delete(Q),pe.delete(Q)}function rr(Q,re){let de=O.blockers.get(Q)||Zo;rt(de.state==="unblocked"&&re.state==="blocked"||de.state==="blocked"&&re.state==="blocked"||de.state==="blocked"&&re.state==="proceeding"||de.state==="blocked"&&re.state==="unblocked"||de.state==="proceeding"&&re.state==="unblocked",`Invalid blocker state transition: ${de.state} -> ${re.state}`);let Se=new Map(O.blockers);Se.set(Q,re),he({blockers:Se})}function yi({currentLocation:Q,nextLocation:re,historyAction:de}){if(pe.size===0)return;pe.size>1&&hi(!1,"A router only supports one blocker at a time");let Se=Array.from(pe.entries()),[Re,Pe]=Se[Se.length-1],je=O.blockers.get(Re);if(!(je&&je.state==="proceeding")&&Pe({currentLocation:Q,nextLocation:re,historyAction:de}))return Re}function bi(Q){let re=gr(404,{pathname:Q}),de=u||l,{matches:Se,route:Re}=Vc(de);return{notFoundMatches:Se,route:Re,error:re}}function di(Q,re,de){if(R=Q,m=re,D=de||null,!g&&O.navigation===nf){g=!0;let Se=Ht(O.location,O.matches);Se!=null&&he({restoreScrollPosition:Se})}return()=>{R=null,m=null,D=null}}function Le(Q,re){return D&&D(Q,re.map(Se=>VC(Se,O.loaderData)))||Q.key}function Dt(Q,re){if(R&&m){let de=Le(Q,re);R[de]=m()}}function Ht(Q,re){if(R){let de=Le(Q,re),Se=R[de];if(typeof Se=="number")return Se}return null}function Pt(Q,re,de){if(i.patchRoutesOnNavigation)if(Q){if(Object.keys(Q[0].params).length>0)return{active:!0,matches:sl(re,de,h,!0)}}else return{active:!0,matches:sl(re,de,h,!0)||[]};return{active:!1,matches:null}}async function $t(Q,re,de,Se){if(!i.patchRoutesOnNavigation)return{type:"success",matches:Q};let Re=Q;for(;;){let Pe=u==null,je=u||l,De=v;try{await i.patchRoutesOnNavigation({signal:de,path:re,matches:Re,fetcherKey:Se,patch:(ye,we)=>{de.aborted||Z_(ye,we,je,De,f,!1)}})}catch(ye){return{type:"error",error:ye,partialMatches:Re}}finally{Pe&&!de.aborted&&(l=[...l])}if(de.aborted)return{type:"aborted"};let Oe=Jn(je,re,h),te=null;if(Oe){if(Object.keys(Oe[0].params).length===0)return{type:"success",matches:Oe};if(te=sl(je,re,h,!0),!(te&&Re.length<te.length&&yt(Re,te.slice(0,Re.length))))return{type:"success",matches:Oe}}if(te||(te=sl(je,re,h,!0)),!te||yt(Re,te))return{type:"success",matches:null};Re=te}}function yt(Q,re){return Q.length===re.length&&Q.every((de,Se)=>de.route.id===re[Se].route.id)}function ti(Q){v={},u=gl(Q,f,void 0,v)}function ji(Q,re,de=!1){let Se=u==null;Z_(Q,re,u||l,v,f,de),Se&&(l=[...l],he({}))}return A={get basename(){return h},get future(){return d},get state(){return O},get routes(){return l},get window(){return r},initialize:oe,subscribe:me,enableScrollRestoration:di,navigate:Ve,fetch:qe,revalidate:He,createHref:Q=>i.history.createHref(Q),encodeLocation:Q=>i.history.encodeLocation(Q),getFetcher:dt,resetFetcher:It,deleteFetcher:Jt,dispose:le,getBlocker:Nr,deleteBlocker:Ni,patchRoutes:ji,_internalFetchControllers:k,_internalSetRoutes:ti,_internalSetStateDoNotUseOrYouWillBreakYourApp(Q){he(Q)}},i.unstable_instrumentations&&(A=uE(A,i.unstable_instrumentations.map(Q=>Q.router).filter(Boolean))),A}function wE(i){return i!=null&&("formData"in i&&i.formData!=null||"body"in i&&i.body!==void 0)}function Pf(i,r,s,a,c,f){let v,l;if(c){v=[];for(let h of r)if(v.push(h),h.route.id===c){l=h;break}}else v=r,l=r[r.length-1];let u=gm(a||".",pm(v),br(i.pathname,s)||i.pathname,f==="path");if(a==null&&(u.search=i.search,u.hash=i.hash),(a==null||a===""||a===".")&&l){let h=ym(u.search);if(l.route.index&&!h)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&h){let b=new URLSearchParams(u.search),d=b.getAll("index");b.delete("index"),d.filter(C=>C).forEach(C=>b.append("index",C));let w=b.toString();u.search=w?`?${w}`:""}}return s!=="/"&&(u.pathname=nE({basename:s,pathname:u.pathname})),Gr(u)}function X_(i,r,s){if(!s||!wE(s))return{path:r};if(s.formMethod&&!UE(s.formMethod))return{path:r,error:gr(405,{method:s.formMethod})};let a=()=>({path:r,error:gr(400,{type:"invalid-body"})}),f=(s.formMethod||"get").toUpperCase(),v=lb(r);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Ai(f))return a();let d=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((w,[C,R])=>`${w}${C}=${R}
|
|
59
|
+
`,""):String(s.body);return{path:r,submission:{formMethod:f,formAction:v,formEncType:s.formEncType,formData:void 0,json:void 0,text:d}}}else if(s.formEncType==="application/json"){if(!Ai(f))return a();try{let d=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:r,submission:{formMethod:f,formAction:v,formEncType:s.formEncType,formData:void 0,json:d,text:void 0}}}catch{return a()}}}rt(typeof FormData=="function","FormData is not available in this environment");let l,u;if(s.formData)l=Uf(s.formData),u=s.formData;else if(s.body instanceof FormData)l=Uf(s.body),u=s.body;else if(s.body instanceof URLSearchParams)l=s.body,u=r0(l);else if(s.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(s.body),u=r0(l)}catch{return a()}let h={formMethod:f,formAction:v,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Ai(h.formMethod))return{path:r,submission:h};let b=fs(r);return i&&b.search&&ym(b.search)&&l.append("index",""),b.search=`?${l}`,{path:Gr(b),submission:h}}function Q_(i,r,s,a,c,f,v,l,u,h,b,d,w,C,R,D,m,g,_,y,E){var W;let T=y?ir(y[1])?y[1].error:y[1].data:void 0,A=c.createURL(f.location),O=c.createURL(u),x;if(b&&f.errors){let q=Object.keys(f.errors)[0];x=v.findIndex(Y=>Y.route.id===q)}else if(y&&ir(y[1])){let q=y[0];x=v.findIndex(Y=>Y.route.id===q)-1}let L=y?y[1].statusCode:void 0,I=L&&L>=400,V={currentUrl:A,currentParams:((W=f.matches[0])==null?void 0:W.params)||{},nextUrl:O,nextParams:v[0].params,...l,actionResult:T,actionStatus:L},P=Tl(v),$=v.map((q,Y)=>{let{route:k}=q,z=null;if(x!=null&&Y>x?z=!1:k.lazy?z=!0:vm(k)?b?z=zf(k,f.loaderData,f.errors):CE(f.loaderData,f.matches[Y],q)&&(z=!0):z=!1,z!==null)return If(s,a,i,P,q,h,r,z);let K=!1;typeof E=="boolean"?K=E:I?K=!1:(d||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||EE(f.matches[Y],q))&&(K=!0);let B={...V,defaultShouldRevalidate:K},F=ol(q,B);return If(s,a,i,P,q,h,r,F,B,E)}),Z=[];return R.forEach((q,Y)=>{if(b||!v.some(ae=>ae.route.id===q.routeId)||C.has(Y))return;let k=f.fetchers.get(Y),z=k&&k.state!=="idle"&&k.data===void 0,K=Jn(m,q.path,g);if(!K){if(_&&z)return;Z.push({key:Y,routeId:q.routeId,path:q.path,matches:null,match:null,request:null,controller:null});return}if(D.has(Y))return;let B=nu(K,q.path),F=new AbortController,X=ja(c,q.path,F.signal),ne=null;if(w.has(Y))w.delete(Y),ne=za(s,a,X,K,B,h,r);else if(z)d&&(ne=za(s,a,X,K,B,h,r));else{let ae;typeof E=="boolean"?ae=E:I?ae=!1:ae=d;let pe={...V,defaultShouldRevalidate:ae};ol(B,pe)&&(ne=za(s,a,X,K,B,h,r,pe))}ne&&Z.push({key:Y,routeId:q.routeId,path:q.path,matches:ne,match:B,request:X,controller:F})}),{dsMatches:$,revalidatingFetchers:Z}}function vm(i){return i.loader!=null||i.middleware!=null&&i.middleware.length>0}function zf(i,r,s){if(i.lazy)return!0;if(!vm(i))return!1;let a=r!=null&&i.id in r,c=s!=null&&s[i.id]!==void 0;return!a&&c?!1:typeof i.loader=="function"&&i.loader.hydrate===!0?!0:!a&&!c}function CE(i,r,s){let a=!r||s.route.id!==r.route.id,c=!i.hasOwnProperty(s.route.id);return a||c}function EE(i,r){let s=i.route.path;return i.pathname!==r.pathname||s!=null&&s.endsWith("*")&&i.params["*"]!==r.params["*"]}function ol(i,r){if(i.route.shouldRevalidate){let s=i.route.shouldRevalidate(r);if(typeof s=="boolean")return s}return r.defaultShouldRevalidate}function Z_(i,r,s,a,c,f){let v;if(i){let h=a[i];rt(h,`No route found to patch children into: routeId = ${i}`),h.children||(h.children=[]),v=h.children}else v=s;let l=[],u=[];if(r.forEach(h=>{let b=v.find(d=>rb(h,d));b?u.push({existingRoute:b,newRoute:h}):l.push(h)}),l.length>0){let h=gl(l,c,[i||"_","patch",String((v==null?void 0:v.length)||"0")],a);v.push(...h)}if(f&&u.length>0)for(let h=0;h<u.length;h++){let{existingRoute:b,newRoute:d}=u[h],w=b,[C]=gl([d],c,[],{},!0);Object.assign(w,{element:C.element?C.element:w.element,errorElement:C.errorElement?C.errorElement:w.errorElement,hydrateFallbackElement:C.hydrateFallbackElement?C.hydrateFallbackElement:w.hydrateFallbackElement})}}function rb(i,r){return"id"in i&&"id"in r&&i.id===r.id?!0:i.index===r.index&&i.path===r.path&&i.caseSensitive===r.caseSensitive?(!i.children||i.children.length===0)&&(!r.children||r.children.length===0)?!0:i.children.every((s,a)=>{var c;return(c=r.children)==null?void 0:c.some(f=>rb(s,f))}):!1}var J_=new WeakMap,nb=({key:i,route:r,manifest:s,mapRouteProperties:a})=>{let c=s[r.id];if(rt(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let f=c.lazy[i];if(!f)return;let v=J_.get(c);v||(v={},J_.set(c,v));let l=v[i];if(l)return l;let u=(async()=>{let h=FC(i),d=c[i]!==void 0&&i!=="hasErrorBoundary";if(h)hi(!h,"Route property "+i+" is not a supported lazy route property. This property will be ignored."),v[i]=Promise.resolve();else if(d)hi(!1,`Route "${c.id}" has a static property "${i}" defined. The lazy property will be ignored.`);else{let w=await f();w!=null&&(Object.assign(c,{[i]:w}),Object.assign(c,a(c)))}typeof c.lazy=="object"&&(c.lazy[i]=void 0,Object.values(c.lazy).every(w=>w===void 0)&&(c.lazy=void 0))})();return v[i]=u,u},e0=new WeakMap;function xE(i,r,s,a,c){let f=s[i.id];if(rt(f,"No route found in manifest"),!i.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof i.lazy=="function"){let b=e0.get(f);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let d=(async()=>{rt(typeof i.lazy=="function","No lazy route function found");let w=await i.lazy(),C={};for(let R in w){let D=w[R];if(D===void 0)continue;let m=$C(R),_=f[R]!==void 0&&R!=="hasErrorBoundary";m?hi(!m,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?hi(!_,`Route "${f.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):C[R]=D}Object.assign(f,C),Object.assign(f,{...a(f),lazy:void 0})})();return e0.set(f,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let v=Object.keys(i.lazy),l=[],u;for(let b of v){if(c&&c.includes(b))continue;let d=nb({key:b,route:i,manifest:s,mapRouteProperties:a});d&&(l.push(d),b===r&&(u=d))}let h=l.length>0?Promise.all(l).then(()=>{}):void 0;return h==null||h.catch(()=>{}),u==null||u.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:u}}async function t0(i){let r=i.matches.filter(c=>c.shouldLoad),s={};return(await Promise.all(r.map(c=>c.resolve()))).forEach((c,f)=>{s[r[f].route.id]=c}),s}async function RE(i){return i.matches.some(r=>r.route.middleware)?sb(i,()=>t0(i)):t0(i)}function sb(i,r){return TE(i,r,a=>{if(IE(a))throw a;return a},jE,s);function s(a,c,f){if(f)return Promise.resolve(Object.assign(f.value,{[c]:{type:"error",result:a}}));{let{matches:v}=i,l=Math.min(Math.max(v.findIndex(h=>h.route.id===c),0),Math.max(v.findIndex(h=>h.shouldCallHandler()),0)),u=es(v,v[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:a}})}}}async function TE(i,r,s,a,c){let{matches:f,request:v,params:l,context:u,unstable_pattern:h}=i,b=f.flatMap(w=>w.route.middleware?w.route.middleware.map(C=>[w.route.id,C]):[]);return await ab({request:v,params:l,context:u,unstable_pattern:h},b,r,s,a,c)}async function ab(i,r,s,a,c,f,v=0){let{request:l}=i;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=r[v];if(!u)return await s();let[h,b]=u,d,w=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");try{return d={value:await ab(i,r,s,a,c,f,v+1)},d.value}catch(C){return d={value:await f(C,h,d)},d.value}};try{let C=await b(i,w),R=C!=null?a(C):void 0;return c(R)?R:d?R??d.value:(d={value:await w()},d.value)}catch(C){return await f(C,h,d)}}function ob(i,r,s,a,c){let f=nb({key:"middleware",route:a.route,manifest:r,mapRouteProperties:i}),v=xE(a.route,Ai(s.method)?"action":"loader",r,i,c);return{middleware:f,route:v.lazyRoutePromise,handler:v.lazyHandlerPromise}}function If(i,r,s,a,c,f,v,l,u=null,h){let b=!1,d=ob(i,r,s,c,f);return{...c,_lazyPromises:d,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(w){return b=!0,u?typeof h=="boolean"?ol(c,{...u,defaultShouldRevalidate:h}):typeof w=="boolean"?ol(c,{...u,defaultShouldRevalidate:w}):ol(c,u):l},resolve(w){let{lazy:C,loader:R,middleware:D}=c.route,m=b||l||w&&!Ai(s.method)&&(C||R),g=D&&D.length>0&&!R&&!C;return m&&(Ai(s.method)||!g)?OE({request:s,unstable_pattern:a,match:c,lazyHandlerPromise:d==null?void 0:d.handler,lazyRoutePromise:d==null?void 0:d.route,handlerOverride:w,scopedContext:v}):Promise.resolve({type:"data",result:void 0})}}}function za(i,r,s,a,c,f,v,l=null){return a.map(u=>u.route.id!==c.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:ob(i,r,s,u,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:If(i,r,s,Tl(a),u,f,v,!0,l))}async function DE(i,r,s,a,c,f){s.some(h=>{var b;return(b=h._lazyPromises)==null?void 0:b.middleware})&&await Promise.all(s.map(h=>{var b;return(b=h._lazyPromises)==null?void 0:b.middleware}));let v={request:r,unstable_pattern:Tl(s),params:s[0].params,context:c,matches:s},u=await i({...v,fetcherKey:a,runClientMiddleware:h=>{let b=v;return sb(b,()=>h({...b,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(h=>{var b,d;return[(b=h._lazyPromises)==null?void 0:b.handler,(d=h._lazyPromises)==null?void 0:d.route]}))}catch{}return u}async function OE({request:i,unstable_pattern:r,match:s,lazyHandlerPromise:a,lazyRoutePromise:c,handlerOverride:f,scopedContext:v}){let l,u,h=Ai(i.method),b=h?"action":"loader",d=w=>{let C,R=new Promise((g,_)=>C=_);u=()=>C(),i.signal.addEventListener("abort",u);let D=g=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${s.route.id}]`)):w({request:i,unstable_pattern:r,params:s.params,context:v},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(f?f(_=>D(_)):D())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,R])};try{let w=h?s.route.action:s.route.loader;if(a||c)if(w){let C,[R]=await Promise.all([d(w).catch(D=>{C=D}),a,c]);if(C!==void 0)throw C;l=R}else{await a;let C=h?s.route.action:s.route.loader;if(C)[l]=await Promise.all([d(C),c]);else if(b==="action"){let R=new URL(i.url),D=R.pathname+R.search;throw gr(405,{method:i.method,pathname:D,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(w)l=await d(w);else{let C=new URL(i.url),R=C.pathname+C.search;throw gr(404,{pathname:R})}}catch(w){return{type:"error",result:w}}finally{u&&i.signal.removeEventListener("abort",u)}return l}async function AE(i){let r=i.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?i.body==null?null:i.json():i.text()}async function LE(i){var a,c,f,v,l;let{result:r,type:s}=i;if(_m(r)){let u;try{u=await AE(r)}catch(h){return{type:"error",error:h}}return s==="error"?{type:"error",error:new Rl(r.status,r.statusText,u),statusCode:r.status,headers:r.headers}:{type:"data",data:u,statusCode:r.status,headers:r.headers}}return s==="error"?o0(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:(a=r.init)==null?void 0:a.status,headers:(c=r.init)!=null&&c.headers?new Headers(r.init.headers):void 0}:{type:"error",error:NE(r),statusCode:vl(r)?r.status:void 0,headers:(f=r.init)!=null&&f.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:vl(r)?r.status:void 0}:o0(r)?{type:"data",data:r.data,statusCode:(v=r.init)==null?void 0:v.status,headers:(l=r.init)!=null&&l.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function ME(i,r,s,a,c){let f=i.headers.get("Location");if(rt(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!mm(f)){let v=a.slice(0,a.findIndex(l=>l.route.id===s)+1);f=Pf(new URL(r.url),v,c,f),i.headers.set("Location",f)}return i}function i0(i,r,s,a){let c=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(mm(i)){let f=i,v=f.startsWith("//")?new URL(r.protocol+f):new URL(f);if(c.includes(v.protocol))throw new Error("Invalid redirect location");let l=br(v.pathname,s)!=null;if(v.origin===r.origin&&l)return v.pathname+v.search+v.hash}try{let f=a.createURL(i);if(c.includes(f.protocol))throw new Error("Invalid redirect location")}catch{}return i}function ja(i,r,s,a){let c=i.createURL(lb(r)).toString(),f={signal:s};if(a&&Ai(a.formMethod)){let{formMethod:v,formEncType:l}=a;f.method=v.toUpperCase(),l==="application/json"?(f.headers=new Headers({"Content-Type":l}),f.body=JSON.stringify(a.json)):l==="text/plain"?f.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?f.body=Uf(a.formData):f.body=a.formData}return new Request(c,f)}function Uf(i){let r=new URLSearchParams;for(let[s,a]of i.entries())r.append(s,typeof a=="string"?a:a.name);return r}function r0(i){let r=new FormData;for(let[s,a]of i.entries())r.append(s,a);return r}function kE(i,r,s,a=!1,c=!1){let f={},v=null,l,u=!1,h={},b=s&&ir(s[1])?s[1].error:void 0;return i.forEach(d=>{if(!(d.route.id in r))return;let w=d.route.id,C=r[w];if(rt(!Ps(C),"Cannot handle redirect results in processLoaderData"),ir(C)){let R=C.error;if(b!==void 0&&(R=b,b=void 0),v=v||{},c)v[w]=R;else{let D=es(i,w);v[D.route.id]==null&&(v[D.route.id]=R)}a||(f[w]=ib),u||(u=!0,l=vl(C.error)?C.error.status:500),C.headers&&(h[w]=C.headers)}else f[w]=C.data,C.statusCode&&C.statusCode!==200&&!u&&(l=C.statusCode),C.headers&&(h[w]=C.headers)}),b!==void 0&&s&&(v={[s[0]]:b},s[2]&&(f[s[2]]=void 0)),{loaderData:f,errors:v,statusCode:l||200,loaderHeaders:h}}function n0(i,r,s,a,c,f){let{loaderData:v,errors:l}=kE(r,s,a);return c.filter(u=>!u.matches||u.matches.some(h=>h.shouldLoad)).forEach(u=>{let{key:h,match:b,controller:d}=u;if(d&&d.signal.aborted)return;let w=f[h];if(rt(w,"Did not find corresponding fetcher result"),ir(w)){let C=es(i.matches,b==null?void 0:b.route.id);l&&l[C.route.id]||(l={...l,[C.route.id]:w.error}),i.fetchers.delete(h)}else if(Ps(w))rt(!1,"Unhandled fetcher revalidation redirect");else{let C=_n(w.data);i.fetchers.set(h,C)}}),{loaderData:v,errors:l}}function s0(i,r,s,a){let c=Object.entries(r).filter(([,f])=>f!==ib).reduce((f,[v,l])=>(f[v]=l,f),{});for(let f of s){let v=f.route.id;if(!r.hasOwnProperty(v)&&i.hasOwnProperty(v)&&f.route.loader&&(c[v]=i[v]),a&&a.hasOwnProperty(v))break}return c}function a0(i){return i?ir(i[1])?{actionData:{}}:{actionData:{[i[0]]:i[1].data}}:{}}function es(i,r){return(r?i.slice(0,i.findIndex(a=>a.route.id===r)+1):[...i]).reverse().find(a=>a.route.hasErrorBoundary===!0)||i[0]}function Vc(i){let r=i.length===1?i[0]:i.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function gr(i,{pathname:r,routeId:s,method:a,type:c,message:f}={}){let v="Unknown Server Error",l="Unknown @remix-run/router error";return i===400?(v="Bad Request",a&&r&&s?l=`You made a ${a} request to "${r}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:c==="invalid-body"&&(l="Unable to encode submission body")):i===403?(v="Forbidden",l=`Route "${s}" does not match URL "${r}"`):i===404?(v="Not Found",l=`No route matches URL "${r}"`):i===405&&(v="Method Not Allowed",a&&r&&s?l=`You made a ${a.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:a&&(l=`Invalid request method "${a.toUpperCase()}"`)),new Rl(i||500,v,new Error(l),!0)}function Wc(i){let r=Object.entries(i);for(let s=r.length-1;s>=0;s--){let[a,c]=r[s];if(Ps(c))return{key:a,result:c}}}function lb(i){let r=typeof i=="string"?fs(i):i;return Gr({...r,hash:""})}function BE(i,r){return i.pathname!==r.pathname||i.search!==r.search?!1:i.hash===""?r.hash!=="":i.hash===r.hash?!0:r.hash!==""}function NE(i){var r,s;return new Rl(((r=i.init)==null?void 0:r.status)??500,((s=i.init)==null?void 0:s.statusText)??"Internal Server Error",i.data)}function jE(i){return i!=null&&typeof i=="object"&&Object.entries(i).every(([r,s])=>typeof r=="string"&&HE(s))}function HE(i){return i!=null&&typeof i=="object"&&"type"in i&&"result"in i&&(i.type==="data"||i.type==="error")}function PE(i){return _m(i.result)&&eb.has(i.result.status)}function ir(i){return i.type==="error"}function Ps(i){return(i&&i.type)==="redirect"}function o0(i){return typeof i=="object"&&i!=null&&"type"in i&&"data"in i&&"init"in i&&i.type==="DataWithResponseInit"}function _m(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.headers=="object"&&typeof i.body<"u"}function zE(i){return eb.has(i)}function IE(i){return _m(i)&&zE(i.status)&&i.headers.has("Location")}function UE(i){return vE.has(i.toUpperCase())}function Ai(i){return pE.has(i.toUpperCase())}function ym(i){return new URLSearchParams(i).getAll("index").some(r=>r==="")}function nu(i,r){let s=typeof r=="string"?fs(r).search:r.search;if(i[i.length-1].route.index&&ym(s||""))return i[i.length-1];let a=Gy(i);return a[a.length-1]}function l0(i){let{formMethod:r,formAction:s,formEncType:a,text:c,formData:f,json:v}=i;if(!(!r||!s||!a)){if(c!=null)return{formMethod:r,formAction:s,formEncType:a,formData:void 0,json:void 0,text:c};if(f!=null)return{formMethod:r,formAction:s,formEncType:a,formData:f,json:void 0,text:void 0};if(v!==void 0)return{formMethod:r,formAction:s,formEncType:a,formData:void 0,json:v,text:void 0}}}function sf(i,r){return r?{state:"loading",location:i,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function FE(i,r){return{state:"submitting",location:i,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Jo(i,r){return i?{state:"loading",formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function qE(i,r){return{state:"submitting",formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text,data:r?r.data:void 0}}function _n(i){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:i}}function $E(i,r){try{let s=i.sessionStorage.getItem(tb);if(s){let a=JSON.parse(s);for(let[c,f]of Object.entries(a||{}))f&&Array.isArray(f)&&r.set(c,new Set(f||[]))}}catch{}}function KE(i,r){if(r.size>0){let s={};for(let[a,c]of r)s[a]=[...c];try{i.sessionStorage.setItem(tb,JSON.stringify(s))}catch(a){hi(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function c0(){let i,r,s=new Promise((a,c)=>{i=async f=>{a(f);try{await s}catch{}},r=async f=>{c(f);try{await s}catch{}}});return{promise:s,resolve:i,reject:r}}var ta=N.createContext(null);ta.displayName="DataRouter";var Dl=N.createContext(null);Dl.displayName="DataRouterState";var cb=N.createContext(!1);function VE(){return N.useContext(cb)}var bm=N.createContext({isTransitioning:!1});bm.displayName="ViewTransition";var ub=N.createContext(new Map);ub.displayName="Fetchers";var WE=N.createContext(null);WE.displayName="Await";var Sr=N.createContext(null);Sr.displayName="Navigation";var Mu=N.createContext(null);Mu.displayName="Location";var Br=N.createContext({outlet:null,matches:[],isDataRoute:!1});Br.displayName="Route";var Sm=N.createContext(null);Sm.displayName="RouteError";var hb="REACT_ROUTER_ERROR",YE="REDIRECT",GE="ROUTE_ERROR_RESPONSE";function XE(i){if(i.startsWith(`${hb}:${YE}:{`))try{let r=JSON.parse(i.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function QE(i){if(i.startsWith(`${hb}:${GE}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Rl(r.status,r.statusText,r.data)}catch{}}function ZE(i,{relative:r}={}){rt(no(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:a}=N.useContext(Sr),{hash:c,pathname:f,search:v}=Ol(i,{relative:r}),l=f;return s!=="/"&&(l=f==="/"?s:Yr([s,f])),a.createHref({pathname:l,search:v,hash:c})}function no(){return N.useContext(Mu)!=null}function Xr(){return rt(no(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Mu).location}function JE(i){rt(no(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:r}=Xr();return N.useMemo(()=>Zs(i,Wy(r)),[r,i])}var db="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fb(i){N.useContext(Sr).static||N.useLayoutEffect(i)}function ku(){let{isDataRoute:i}=N.useContext(Br);return i?px():ex()}function ex(){rt(no(),"useNavigate() may be used only in the context of a <Router> component.");let i=N.useContext(ta),{basename:r,navigator:s}=N.useContext(Sr),{matches:a}=N.useContext(Br),{pathname:c}=Xr(),f=JSON.stringify(pm(a)),v=N.useRef(!1);return fb(()=>{v.current=!0}),N.useCallback((u,h={})=>{if(hi(v.current,db),!v.current)return;if(typeof u=="number"){s.go(u);return}let b=gm(u,JSON.parse(f),c,h.relative==="path");i==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:Yr([r,b.pathname])),(h.replace?s.replace:s.push)(b,h.state,h)},[r,s,f,c,i])}var tx=N.createContext(null);function ix(i){let r=N.useContext(Br).outlet;return N.useMemo(()=>r&&N.createElement(tx.Provider,{value:i},r),[r,i])}function rx(){let{matches:i}=N.useContext(Br),r=i[i.length-1];return r?r.params:{}}function Ol(i,{relative:r}={}){let{matches:s}=N.useContext(Br),{pathname:a}=Xr(),c=JSON.stringify(pm(s));return N.useMemo(()=>gm(i,JSON.parse(c),a,r==="path"),[i,c,a,r])}function nx(i,r,s,a,c){rt(no(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=N.useContext(Sr),{matches:v}=N.useContext(Br),l=v[v.length-1],u=l?l.params:{},h=l?l.pathname:"/",b=l?l.pathnameBase:"/",d=l&&l.route;{let _=d&&d.path||"";pb(h,!d||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let w=Xr(),C;C=w;let R=C.pathname||"/",D=R;if(b!=="/"){let _=b.replace(/^\//,"").split("/");D="/"+R.replace(/^\//,"").split("/").slice(_.length).join("/")}let m=Jn(i,{pathname:D});return hi(d||m!=null,`No routes matched location "${C.pathname}${C.search}${C.hash}" `),hi(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${C.pathname}${C.search}${C.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),cx(m&&m.map(_=>Object.assign({},_,{params:Object.assign({},u,_.params),pathname:Yr([b,f.encodeLocation?f.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:Yr([b,f.encodeLocation?f.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),v,s,a,c)}function sx(){let i=mx(),r=vl(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),s=i instanceof Error?i.stack:null,a="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:a},f={padding:"2px 4px",backgroundColor:a},v=null;return console.error("Error handled by React Router default ErrorBoundary:",i),v=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:f},"ErrorBoundary")," or"," ",N.createElement("code",{style:f},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},r),s?N.createElement("pre",{style:c},s):null,v)}var ax=N.createElement(sx,null),mb=class extends N.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,r){return r.location!==i.location||r.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:r.error,location:r.location,revalidation:i.revalidation||r.revalidation}}componentDidCatch(i,r){this.props.onError?this.props.onError(i,r):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const s=QE(i.digest);s&&(i=s)}let r=i!==void 0?N.createElement(Br.Provider,{value:this.props.routeContext},N.createElement(Sm.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?N.createElement(ox,{error:i},r):r}};mb.contextType=cb;var af=new WeakMap;function ox({children:i,error:r}){let{basename:s}=N.useContext(Sr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let a=XE(r.digest);if(a){let c=af.get(r);if(c)throw c;let f=Qy(a.location,s);if(Xy&&!af.get(r))if(f.isExternal||a.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const v=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:a.replace}));throw af.set(r,v),v}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return i}function lx({routeContext:i,match:r,children:s}){let a=N.useContext(ta);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),N.createElement(Br.Provider,{value:i},s)}function cx(i,r=[],s=null,a=null,c=null){if(i==null){if(!s)return null;if(s.errors)i=s.matches;else if(r.length===0&&!s.initialized&&s.matches.length>0)i=s.matches;else return null}let f=i,v=s==null?void 0:s.errors;if(v!=null){let b=f.findIndex(d=>d.route.id&&(v==null?void 0:v[d.route.id])!==void 0);rt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),f=f.slice(0,Math.min(f.length,b+1))}let l=!1,u=-1;if(s)for(let b=0;b<f.length;b++){let d=f[b];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=b),d.route.id){let{loaderData:w,errors:C}=s,R=d.route.loader&&!w.hasOwnProperty(d.route.id)&&(!C||C[d.route.id]===void 0);if(d.route.lazy||R){l=!0,u>=0?f=f.slice(0,u+1):f=[f[0]];break}}}let h=s&&a?(b,d)=>{var w,C;a(b,{location:s.location,params:((C=(w=s.matches)==null?void 0:w[0])==null?void 0:C.params)??{},unstable_pattern:Tl(s.matches),errorInfo:d})}:void 0;return f.reduceRight((b,d,w)=>{let C,R=!1,D=null,m=null;s&&(C=v&&d.route.id?v[d.route.id]:void 0,D=d.route.errorElement||ax,l&&(u<0&&w===0?(pb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,m=null):u===w&&(R=!0,m=d.route.hydrateFallbackElement||null)));let g=r.concat(f.slice(0,w+1)),_=()=>{let y;return C?y=D:R?y=m:d.route.Component?y=N.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=b,N.createElement(lx,{match:d,routeContext:{outlet:b,matches:g,isDataRoute:s!=null},children:y})};return s&&(d.route.ErrorBoundary||d.route.errorElement||w===0)?N.createElement(mb,{location:s.location,revalidation:s.revalidation,component:D,error:C,children:_(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:h}):_()},null)}function wm(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ux(i){let r=N.useContext(ta);return rt(r,wm(i)),r}function hx(i){let r=N.useContext(Dl);return rt(r,wm(i)),r}function dx(i){let r=N.useContext(Br);return rt(r,wm(i)),r}function Cm(i){let r=dx(i),s=r.matches[r.matches.length-1];return rt(s.route.id,`${i} can only be used on routes that contain a unique "id"`),s.route.id}function fx(){return Cm("useRouteId")}function mx(){var a;let i=N.useContext(Sm),r=hx("useRouteError"),s=Cm("useRouteError");return i!==void 0?i:(a=r.errors)==null?void 0:a[s]}function px(){let{router:i}=ux("useNavigate"),r=Cm("useNavigate"),s=N.useRef(!1);return fb(()=>{s.current=!0}),N.useCallback(async(c,f={})=>{hi(s.current,db),s.current&&(typeof c=="number"?await i.navigate(c):await i.navigate(c,{fromRouteId:r,...f}))},[i,r])}var u0={};function pb(i,r,s){!r&&!u0[i]&&(u0[i]=!0,hi(!1,s))}var h0={};function d0(i,r){!i&&!h0[r]&&(h0[r]=!0,console.warn(r))}var gx="useOptimistic",f0=fm[gx],vx=()=>{};function _x(i){return f0?f0(i):[i,vx]}function yx(i){let r={hasErrorBoundary:i.hasErrorBoundary||i.ErrorBoundary!=null||i.errorElement!=null};return i.Component&&(i.element&&hi(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:N.createElement(i.Component),Component:void 0})),i.HydrateFallback&&(i.hydrateFallbackElement&&hi(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:N.createElement(i.HydrateFallback),HydrateFallback:void 0})),i.ErrorBoundary&&(i.errorElement&&hi(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:N.createElement(i.ErrorBoundary),ErrorBoundary:void 0})),r}var bx=["HydrateFallback","hydrateFallbackElement"],Sx=class{constructor(){this.status="pending",this.promise=new Promise((i,r)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",i(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",r(s))}})}};function wx({router:i,flushSync:r,onError:s,unstable_useTransitions:a}){a=VE()||a;let[f,v]=N.useState(i.state),[l,u]=_x(f),[h,b]=N.useState(),[d,w]=N.useState({isTransitioning:!1}),[C,R]=N.useState(),[D,m]=N.useState(),[g,_]=N.useState(),y=N.useRef(new Map),E=N.useCallback((x,{deletedFetchers:L,newErrors:I,flushSync:V,viewTransitionOpts:P})=>{I&&s&&Object.values(I).forEach(Z=>{var W;return s(Z,{location:x.location,params:((W=x.matches[0])==null?void 0:W.params)??{},unstable_pattern:Tl(x.matches)})}),x.fetchers.forEach((Z,W)=>{Z.data!==void 0&&y.current.set(W,Z.data)}),L.forEach(Z=>y.current.delete(Z)),d0(V===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let $=i.window!=null&&i.window.document!=null&&typeof i.window.document.startViewTransition=="function";if(d0(P==null||$,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!$){r&&V?r(()=>v(x)):a===!1?v(x):N.startTransition(()=>{a===!0&&u(Z=>m0(Z,x)),v(x)});return}if(r&&V){r(()=>{D&&(C==null||C.resolve(),D.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let Z=i.window.document.startViewTransition(()=>{r(()=>v(x))});Z.finished.finally(()=>{r(()=>{R(void 0),m(void 0),b(void 0),w({isTransitioning:!1})})}),r(()=>m(Z));return}D?(C==null||C.resolve(),D.skipTransition(),_({state:x,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(b(x),w({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[i.window,r,D,C,a,u,s]);N.useLayoutEffect(()=>i.subscribe(E),[i,E]),N.useEffect(()=>{d.isTransitioning&&!d.flushSync&&R(new Sx)},[d]),N.useEffect(()=>{if(C&&h&&i.window){let x=h,L=C.promise,I=i.window.document.startViewTransition(async()=>{a===!1?v(x):N.startTransition(()=>{a===!0&&u(V=>m0(V,x)),v(x)}),await L});I.finished.finally(()=>{R(void 0),m(void 0),b(void 0),w({isTransitioning:!1})}),m(I)}},[h,C,i.window,a,u]),N.useEffect(()=>{C&&h&&l.location.key===h.location.key&&C.resolve()},[C,D,l.location,h]),N.useEffect(()=>{!d.isTransitioning&&g&&(b(g.state),w({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[d.isTransitioning,g]);let T=N.useMemo(()=>({createHref:i.createHref,encodeLocation:i.encodeLocation,go:x=>i.navigate(x),push:(x,L,I)=>i.navigate(x,{state:L,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(x,L,I)=>i.navigate(x,{replace:!0,state:L,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[i]),A=i.basename||"/",O=N.useMemo(()=>({router:i,navigator:T,static:!1,basename:A,onError:s}),[i,T,A,s]);return N.createElement(N.Fragment,null,N.createElement(ta.Provider,{value:O},N.createElement(Dl.Provider,{value:l},N.createElement(ub.Provider,{value:y.current},N.createElement(bm.Provider,{value:d},N.createElement(Rx,{basename:A,location:l.location,navigationType:l.historyAction,navigator:T,unstable_useTransitions:a},N.createElement(Cx,{routes:i.routes,future:i.future,state:l,onError:s})))))),null)}function m0(i,r){return{...i,navigation:r.navigation.state!=="idle"?r.navigation:i.navigation,revalidation:r.revalidation!=="idle"?r.revalidation:i.revalidation,actionData:r.navigation.state!=="submitting"?r.actionData:i.actionData,fetchers:r.fetchers}}var Cx=N.memo(Ex);function Ex({routes:i,future:r,state:s,onError:a}){return nx(i,void 0,s,a,r)}function xx(i){return ix(i.context)}function Rx({basename:i="/",children:r=null,location:s,navigationType:a="POP",navigator:c,static:f=!1,unstable_useTransitions:v}){rt(!no(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=i.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:l,navigator:c,static:f,unstable_useTransitions:v,future:{}}),[l,c,f,v]);typeof s=="string"&&(s=fs(s));let{pathname:h="/",search:b="",hash:d="",state:w=null,key:C="default"}=s,R=N.useMemo(()=>{let D=br(h,l);return D==null?null:{location:{pathname:D,search:b,hash:d,state:w,key:C},navigationType:a}},[l,h,b,d,w,C,a]);return hi(R!=null,`<Router basename="${l}"> is not able to match the URL "${h}${b}${d}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:N.createElement(Sr.Provider,{value:u},N.createElement(Mu.Provider,{children:r,value:R}))}var su="get",au="application/x-www-form-urlencoded";function Bu(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Tx(i){return Bu(i)&&i.tagName.toLowerCase()==="button"}function Dx(i){return Bu(i)&&i.tagName.toLowerCase()==="form"}function Ox(i){return Bu(i)&&i.tagName.toLowerCase()==="input"}function Ax(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Lx(i,r){return i.button===0&&(!r||r==="_self")&&!Ax(i)}var Yc=null;function Mx(){if(Yc===null)try{new FormData(document.createElement("form"),0),Yc=!1}catch{Yc=!0}return Yc}var kx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function of(i){return i!=null&&!kx.has(i)?(hi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${au}"`),null):i}function Bx(i,r){let s,a,c,f,v;if(Dx(i)){let l=i.getAttribute("action");a=l?br(l,r):null,s=i.getAttribute("method")||su,c=of(i.getAttribute("enctype"))||au,f=new FormData(i)}else if(Tx(i)||Ox(i)&&(i.type==="submit"||i.type==="image")){let l=i.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=i.getAttribute("formaction")||l.getAttribute("action");if(a=u?br(u,r):null,s=i.getAttribute("formmethod")||l.getAttribute("method")||su,c=of(i.getAttribute("formenctype"))||of(l.getAttribute("enctype"))||au,f=new FormData(l,i),!Mx()){let{name:h,type:b,value:d}=i;if(b==="image"){let w=h?`${h}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else h&&f.append(h,d)}}else{if(Bu(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=su,a=null,c=au,v=i}return f&&c==="text/plain"&&(v=f,f=void 0),{action:a,method:s.toLowerCase(),encType:c,formData:f,body:v}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Em(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Nx(i,r,s,a){let c=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return s?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${a}`:c.pathname=`${c.pathname}.${a}`:c.pathname==="/"?c.pathname=`_root.${a}`:r&&br(c.pathname,r)==="/"?c.pathname=`${r.replace(/\/$/,"")}/_root.${a}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${a}`,c}async function jx(i,r){if(i.id in r)return r[i.id];try{let s=await import(i.module);return r[i.id]=s,s}catch(s){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Hx(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function Px(i,r,s){let a=await Promise.all(i.map(async c=>{let f=r.routes[c.route.id];if(f){let v=await jx(f,s);return v.links?v.links():[]}return[]}));return Fx(a.flat(1).filter(Hx).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function p0(i,r,s,a,c,f){let v=(u,h)=>s[h]?u.route.id!==s[h].route.id:!0,l=(u,h)=>{var b;return s[h].pathname!==u.pathname||((b=s[h].route.path)==null?void 0:b.endsWith("*"))&&s[h].params["*"]!==u.params["*"]};return f==="assets"?r.filter((u,h)=>v(u,h)||l(u,h)):f==="data"?r.filter((u,h)=>{var d;let b=a.routes[u.route.id];if(!b||!b.hasLoader)return!1;if(v(u,h)||l(u,h))return!0;if(u.route.shouldRevalidate){let w=u.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((d=s[0])==null?void 0:d.params)||{},nextUrl:new URL(i,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function zx(i,r,{includeHydrateFallback:s}={}){return Ix(i.map(a=>{let c=r.routes[a.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),s&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function Ix(i){return[...new Set(i)]}function Ux(i){let r={},s=Object.keys(i).sort();for(let a of s)r[a]=i[a];return r}function Fx(i,r){let s=new Set;return new Set(r),i.reduce((a,c)=>{let f=JSON.stringify(Ux(c));return s.has(f)||(s.add(f),a.push({key:f,link:c})),a},[])}function gb(){let i=N.useContext(ta);return Em(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function qx(){let i=N.useContext(Dl);return Em(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var xm=N.createContext(void 0);xm.displayName="FrameworkContext";function vb(){let i=N.useContext(xm);return Em(i,"You must render this element inside a <HydratedRouter> element"),i}function $x(i,r){let s=N.useContext(xm),[a,c]=N.useState(!1),[f,v]=N.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:d}=r,w=N.useRef(null);N.useEffect(()=>{if(i==="render"&&v(!0),i==="viewport"){let D=g=>{g.forEach(_=>{v(_.isIntersecting)})},m=new IntersectionObserver(D,{threshold:.5});return w.current&&m.observe(w.current),()=>{m.disconnect()}}},[i]),N.useEffect(()=>{if(a){let D=setTimeout(()=>{v(!0)},100);return()=>{clearTimeout(D)}}},[a]);let C=()=>{c(!0)},R=()=>{c(!1),v(!1)};return s?i!=="intent"?[f,w,{}]:[f,w,{onFocus:el(l,C),onBlur:el(u,R),onMouseEnter:el(h,C),onMouseLeave:el(b,R),onTouchStart:el(d,C)}]:[!1,w,{}]}function el(i,r){return s=>{i&&i(s),s.defaultPrevented||r(s)}}function Kx({page:i,...r}){let{router:s}=gb(),a=N.useMemo(()=>Jn(s.routes,i,s.basename),[s.routes,i,s.basename]);return a?N.createElement(Wx,{page:i,matches:a,...r}):null}function Vx(i){let{manifest:r,routeModules:s}=vb(),[a,c]=N.useState([]);return N.useEffect(()=>{let f=!1;return Px(i,r,s).then(v=>{f||c(v)}),()=>{f=!0}},[i,r,s]),a}function Wx({page:i,matches:r,...s}){let a=Xr(),{future:c,manifest:f,routeModules:v}=vb(),{basename:l}=gb(),{loaderData:u,matches:h}=qx(),b=N.useMemo(()=>p0(i,r,h,f,a,"data"),[i,r,h,f,a]),d=N.useMemo(()=>p0(i,r,h,f,a,"assets"),[i,r,h,f,a]),w=N.useMemo(()=>{if(i===a.pathname+a.search+a.hash)return[];let D=new Set,m=!1;if(r.forEach(_=>{var E;let y=f.routes[_.route.id];!y||!y.hasLoader||(!b.some(T=>T.route.id===_.route.id)&&_.route.id in u&&((E=v[_.route.id])!=null&&E.shouldRevalidate)||y.hasClientLoader?m=!0:D.add(_.route.id))}),D.size===0)return[];let g=Nx(i,l,c.unstable_trailingSlashAwareDataRequests,"data");return m&&D.size>0&&g.searchParams.set("_routes",r.filter(_=>D.has(_.route.id)).map(_=>_.route.id).join(",")),[g.pathname+g.search]},[l,c.unstable_trailingSlashAwareDataRequests,u,a,f,b,r,i,v]),C=N.useMemo(()=>zx(d,f),[d,f]),R=Vx(d);return N.createElement(N.Fragment,null,w.map(D=>N.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...s})),C.map(D=>N.createElement("link",{key:D,rel:"modulepreload",href:D,...s})),R.map(({key:D,link:m})=>N.createElement("link",{key:D,nonce:s.nonce,...m,crossOrigin:m.crossOrigin??s.crossOrigin})))}function Yx(...i){return r=>{i.forEach(s=>{typeof s=="function"?s(r):s!=null&&(s.current=r)})}}var Gx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Gx&&(window.__reactRouterVersion="7.13.0")}catch{}function Xx(i,r){return SE({basename:r==null?void 0:r.basename,getContext:r==null?void 0:r.getContext,future:r==null?void 0:r.future,history:PC({window:r==null?void 0:r.window}),hydrationData:Qx(),routes:i,mapRouteProperties:yx,hydrationRouteProperties:bx,dataStrategy:r==null?void 0:r.dataStrategy,patchRoutesOnNavigation:r==null?void 0:r.patchRoutesOnNavigation,window:r==null?void 0:r.window,unstable_instrumentations:r==null?void 0:r.unstable_instrumentations}).initialize()}function Qx(){let i=window==null?void 0:window.__staticRouterHydrationData;return i&&i.errors&&(i={...i,errors:Zx(i.errors)}),i}function Zx(i){if(!i)return null;let r=Object.entries(i),s={};for(let[a,c]of r)if(c&&c.__type==="RouteErrorResponse")s[a]=new Rl(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let f=window[c.__subType];if(typeof f=="function")try{let v=new f(c.message);v.stack="",s[a]=v}catch{}}if(s[a]==null){let f=new Error(c.message);f.stack="",s[a]=f}}else s[a]=c;return s}var _b=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=N.forwardRef(function({onClick:r,discover:s="render",prefetch:a="none",relative:c,reloadDocument:f,replace:v,state:l,target:u,to:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w,...C},R){let{basename:D,unstable_useTransitions:m}=N.useContext(Sr),g=typeof h=="string"&&_b.test(h),_=Qy(h,D);h=_.to;let y=ZE(h,{relative:c}),[E,T,A]=$x(a,C),O=i2(h,{replace:v,state:l,target:u,preventScrollReset:b,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:w,unstable_useTransitions:m});function x(I){r&&r(I),I.defaultPrevented||O(I)}let L=N.createElement("a",{...C,...A,href:_.absoluteURL||y,onClick:_.isExternal||f?r:x,ref:Yx(R,T),target:u,"data-discover":!g&&s==="render"?"true":void 0});return E&&!g?N.createElement(N.Fragment,null,L,N.createElement(Kx,{page:y})):L});yn.displayName="Link";var Jx=N.forwardRef(function({"aria-current":r="page",caseSensitive:s=!1,className:a="",end:c=!1,style:f,to:v,viewTransition:l,children:u,...h},b){let d=Ol(v,{relative:h.relative}),w=Xr(),C=N.useContext(Dl),{navigator:R,basename:D}=N.useContext(Sr),m=C!=null&&o2(d)&&l===!0,g=R.encodeLocation?R.encodeLocation(d).pathname:d.pathname,_=w.pathname,y=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;s||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&D&&(y=br(y,D)||y);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let T=_===g||!c&&_.startsWith(g)&&_.charAt(E)==="/",A=y!=null&&(y===g||!c&&y.startsWith(g)&&y.charAt(g.length)==="/"),O={isActive:T,isPending:A,isTransitioning:m},x=T?r:void 0,L;typeof a=="function"?L=a(O):L=[a,T?"active":null,A?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let I=typeof f=="function"?f(O):f;return N.createElement(yn,{...h,"aria-current":x,className:L,ref:b,style:I,to:v,viewTransition:l},typeof u=="function"?u(O):u)});Jx.displayName="NavLink";var e2=N.forwardRef(({discover:i="render",fetcherKey:r,navigate:s,reloadDocument:a,replace:c,state:f,method:v=su,action:l,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w,...C},R)=>{let{unstable_useTransitions:D}=N.useContext(Sr),m=s2(),g=a2(l,{relative:h}),_=v.toLowerCase()==="get"?"get":"post",y=typeof l=="string"&&_b.test(l),E=T=>{if(u&&u(T),T.defaultPrevented)return;T.preventDefault();let A=T.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||v,x=()=>m(A||T.currentTarget,{fetcherKey:r,method:O,navigate:s,replace:c,state:f,relative:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w});D&&s!==!1?N.startTransition(()=>x()):x()};return N.createElement("form",{ref:R,method:_,action:g,onSubmit:a?u:E,...C,"data-discover":!y&&i==="render"?"true":void 0})});e2.displayName="Form";function t2(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yb(i){let r=N.useContext(ta);return rt(r,t2(i)),r}function i2(i,{target:r,replace:s,state:a,preventScrollReset:c,relative:f,viewTransition:v,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let h=ku(),b=Xr(),d=Ol(i,{relative:f});return N.useCallback(w=>{if(Lx(w,r)){w.preventDefault();let C=s!==void 0?s:Gr(b)===Gr(d),R=()=>h(i,{replace:C,state:a,preventScrollReset:c,relative:f,viewTransition:v,unstable_defaultShouldRevalidate:l});u?N.startTransition(()=>R()):R()}},[b,h,d,s,a,r,i,c,f,v,l,u])}var r2=0,n2=()=>`__${String(++r2)}__`;function s2(){let{router:i}=yb("useSubmit"),{basename:r}=N.useContext(Sr),s=fx(),a=i.fetch,c=i.navigate;return N.useCallback(async(f,v={})=>{let{action:l,method:u,encType:h,formData:b,body:d}=Bx(f,r);if(v.navigate===!1){let w=v.fetcherKey||n2();await a(w,s,v.action||l,{unstable_defaultShouldRevalidate:v.unstable_defaultShouldRevalidate,preventScrollReset:v.preventScrollReset,formData:b,body:d,formMethod:v.method||u,formEncType:v.encType||h,flushSync:v.flushSync})}else await c(v.action||l,{unstable_defaultShouldRevalidate:v.unstable_defaultShouldRevalidate,preventScrollReset:v.preventScrollReset,formData:b,body:d,formMethod:v.method||u,formEncType:v.encType||h,replace:v.replace,state:v.state,fromRouteId:s,flushSync:v.flushSync,viewTransition:v.viewTransition})},[a,c,r,s])}function a2(i,{relative:r}={}){let{basename:s}=N.useContext(Sr),a=N.useContext(Br);rt(a,"useFormAction must be used inside a RouteContext");let[c]=a.matches.slice(-1),f={...Ol(i||".",{relative:r})},v=Xr();if(i==null){f.search=v.search;let l=new URLSearchParams(f.search),u=l.getAll("index");if(u.some(b=>b==="")){l.delete("index"),u.filter(d=>d).forEach(d=>l.append("index",d));let b=l.toString();f.search=b?`?${b}`:""}}return(!i||i===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Yr([s,f.pathname])),Gr(f)}function o2(i,{relative:r}={}){let s=N.useContext(bm);rt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=yb("useViewTransitionState"),c=Ol(i,{relative:r});if(!s.isTransitioning)return!1;let f=br(s.currentLocation.pathname,a)||s.currentLocation.pathname,v=br(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Zs(c.pathname,v)!=null||Zs(c.pathname,f)!=null}var eo=Fy();const l2=Ay(eo);function c2(i){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}const u2=i=>{switch(i){case"success":return f2;case"info":return p2;case"warning":return m2;case"error":return g2;default:return null}},h2=Array(12).fill(0),d2=({visible:i,className:r})=>Te.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":i},Te.createElement("div",{className:"sonner-spinner"},h2.map((s,a)=>Te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),f2=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),m2=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Te.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p2=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g2=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),v2=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),_2=()=>{const[i,r]=Te.useState(document.hidden);return Te.useEffect(()=>{const s=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),i};let Ff=1;class y2{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const s=this.subscribers.indexOf(r);this.subscribers.splice(s,1)}),this.publish=r=>{this.subscribers.forEach(s=>s(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var s;const{message:a,...c}=r,f=typeof(r==null?void 0:r.id)=="number"||((s=r.id)==null?void 0:s.length)>0?r.id:Ff++,v=this.toasts.find(u=>u.id===f),l=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),v?this.toasts=this.toasts.map(u=>u.id===f?(this.publish({...u,...r,id:f,title:a}),{...u,...r,id:f,dismissible:l,title:a}):u):this.addToast({title:a,...c,dismissible:l,id:f}),f},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:r,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(a=>a({id:s.id,dismiss:!0}))}),r),this.message=(r,s)=>this.create({...s,message:r}),this.error=(r,s)=>this.create({...s,message:r,type:"error"}),this.success=(r,s)=>this.create({...s,type:"success",message:r}),this.info=(r,s)=>this.create({...s,type:"info",message:r}),this.warning=(r,s)=>this.create({...s,type:"warning",message:r}),this.loading=(r,s)=>this.create({...s,type:"loading",message:r}),this.promise=(r,s)=>{if(!s)return;let a;s.loading!==void 0&&(a=this.create({...s,promise:r,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const c=Promise.resolve(r instanceof Function?r():r);let f=a!==void 0,v;const l=c.then(async h=>{if(v=["resolve",h],Te.isValidElement(h))f=!1,this.create({id:a,type:"default",message:h});else if(S2(h)&&!h.ok){f=!1;const d=typeof s.error=="function"?await s.error(`HTTP error! status: ${h.status}`):s.error,w=typeof s.description=="function"?await s.description(`HTTP error! status: ${h.status}`):s.description,R=typeof d=="object"&&!Te.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:w,...R})}else if(h instanceof Error){f=!1;const d=typeof s.error=="function"?await s.error(h):s.error,w=typeof s.description=="function"?await s.description(h):s.description,R=typeof d=="object"&&!Te.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:w,...R})}else if(s.success!==void 0){f=!1;const d=typeof s.success=="function"?await s.success(h):s.success,w=typeof s.description=="function"?await s.description(h):s.description,R=typeof d=="object"&&!Te.isValidElement(d)?d:{message:d};this.create({id:a,type:"success",description:w,...R})}}).catch(async h=>{if(v=["reject",h],s.error!==void 0){f=!1;const b=typeof s.error=="function"?await s.error(h):s.error,d=typeof s.description=="function"?await s.description(h):s.description,C=typeof b=="object"&&!Te.isValidElement(b)?b:{message:b};this.create({id:a,type:"error",description:d,...C})}}).finally(()=>{f&&(this.dismiss(a),a=void 0),s.finally==null||s.finally.call(s)}),u=()=>new Promise((h,b)=>l.then(()=>v[0]==="reject"?b(v[1]):h(v[1])).catch(b));return typeof a!="string"&&typeof a!="number"?{unwrap:u}:Object.assign(a,{unwrap:u})},this.custom=(r,s)=>{const a=(s==null?void 0:s.id)||Ff++;return this.create({jsx:r(a),id:a,...s}),a},this.getActiveToasts=()=>this.toasts.filter(r=>!this.dismissedToasts.has(r.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Vi=new y2,b2=(i,r)=>{const s=(r==null?void 0:r.id)||Ff++;return Vi.addToast({title:i,...r,id:s}),s},S2=i=>i&&typeof i=="object"&&"ok"in i&&typeof i.ok=="boolean"&&"status"in i&&typeof i.status=="number",w2=b2,C2=()=>Vi.toasts,E2=()=>Vi.getActiveToasts(),_t=Object.assign(w2,{success:Vi.success,info:Vi.info,warning:Vi.warning,error:Vi.error,custom:Vi.custom,message:Vi.message,promise:Vi.promise,dismiss:Vi.dismiss,loading:Vi.loading},{getHistory:C2,getToasts:E2});c2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Gc(i){return i.label!==void 0}const x2=3,R2="24px",T2="16px",g0=4e3,D2=356,O2=14,A2=45,L2=200;function Ir(...i){return i.filter(Boolean).join(" ")}function M2(i){const[r,s]=i.split("-"),a=[];return r&&a.push(r),s&&a.push(s),a}const k2=i=>{var r,s,a,c,f,v,l,u,h;const{invert:b,toast:d,unstyled:w,interacting:C,setHeights:R,visibleToasts:D,heights:m,index:g,toasts:_,expanded:y,removeToast:E,defaultRichColors:T,closeButton:A,style:O,cancelButtonStyle:x,actionButtonStyle:L,className:I="",descriptionClassName:V="",duration:P,position:$,gap:Z,expandByDefault:W,classNames:q,icons:Y,closeButtonAriaLabel:k="Close toast"}=i,[z,K]=Te.useState(null),[B,F]=Te.useState(null),[X,ne]=Te.useState(!1),[ae,pe]=Te.useState(!1),[j,G]=Te.useState(!1),[oe,le]=Te.useState(!1),[me,he]=Te.useState(!1),[Ce,Ve]=Te.useState(0),[He,xe]=Te.useState(0),Ee=Te.useRef(d.duration||P||g0),Ue=Te.useRef(null),Fe=Te.useRef(null),st=g===0,qe=g+1<=D,Ae=d.type,Ye=d.dismissible!==!1,Be=d.className||"",at=d.descriptionClassName||"",Wt=Te.useMemo(()=>m.findIndex(Le=>Le.toastId===d.id)||0,[m,d.id]),Zt=Te.useMemo(()=>{var Le;return(Le=d.closeButton)!=null?Le:A},[d.closeButton,A]),et=Te.useMemo(()=>d.duration||P||g0,[d.duration,P]),nt=Te.useRef(0),dt=Te.useRef(0),It=Te.useRef(0),Qe=Te.useRef(null),[Jt,bt]=$.split("-"),ei=Te.useMemo(()=>m.reduce((Le,Dt,Ht)=>Ht>=Wt?Le:Le+Dt.height,0),[m,Wt]),Tt=_2(),si=d.invert||b,Nr=Ae==="loading";dt.current=Te.useMemo(()=>Wt*Z+ei,[Wt,ei]),Te.useEffect(()=>{Ee.current=et},[et]),Te.useEffect(()=>{ne(!0)},[]),Te.useEffect(()=>{const Le=Fe.current;if(Le){const Dt=Le.getBoundingClientRect().height;return xe(Dt),R(Ht=>[{toastId:d.id,height:Dt,position:d.position},...Ht]),()=>R(Ht=>Ht.filter(Pt=>Pt.toastId!==d.id))}},[R,d.id]),Te.useLayoutEffect(()=>{if(!X)return;const Le=Fe.current,Dt=Le.style.height;Le.style.height="auto";const Ht=Le.getBoundingClientRect().height;Le.style.height=Dt,xe(Ht),R(Pt=>Pt.find(yt=>yt.toastId===d.id)?Pt.map(yt=>yt.toastId===d.id?{...yt,height:Ht}:yt):[{toastId:d.id,height:Ht,position:d.position},...Pt])},[X,d.title,d.description,R,d.id,d.jsx,d.action,d.cancel]);const Ni=Te.useCallback(()=>{pe(!0),Ve(dt.current),R(Le=>Le.filter(Dt=>Dt.toastId!==d.id)),setTimeout(()=>{E(d)},L2)},[d,E,R,dt]);Te.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let Le;return y||C||Tt?(()=>{if(It.current<nt.current){const Pt=new Date().getTime()-nt.current;Ee.current=Ee.current-Pt}It.current=new Date().getTime()})():(()=>{Ee.current!==1/0&&(nt.current=new Date().getTime(),Le=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Ni()},Ee.current))})(),()=>clearTimeout(Le)},[y,C,d,Ae,Tt,Ni]),Te.useEffect(()=>{d.delete&&(Ni(),d.onDismiss==null||d.onDismiss.call(d,d))},[Ni,d.delete]);function rr(){var Le;if(Y!=null&&Y.loading){var Dt;return Te.createElement("div",{className:Ir(q==null?void 0:q.loader,d==null||(Dt=d.classNames)==null?void 0:Dt.loader,"sonner-loader"),"data-visible":Ae==="loading"},Y.loading)}return Te.createElement(d2,{className:Ir(q==null?void 0:q.loader,d==null||(Le=d.classNames)==null?void 0:Le.loader),visible:Ae==="loading"})}const yi=d.icon||(Y==null?void 0:Y[Ae])||u2(Ae);var bi,di;return Te.createElement("li",{tabIndex:0,ref:Fe,className:Ir(I,Be,q==null?void 0:q.toast,d==null||(r=d.classNames)==null?void 0:r.toast,q==null?void 0:q.default,q==null?void 0:q[Ae],d==null||(s=d.classNames)==null?void 0:s[Ae]),"data-sonner-toast":"","data-rich-colors":(bi=d.richColors)!=null?bi:T,"data-styled":!(d.jsx||d.unstyled||w),"data-mounted":X,"data-promise":!!d.promise,"data-swiped":me,"data-removed":ae,"data-visible":qe,"data-y-position":Jt,"data-x-position":bt,"data-index":g,"data-front":st,"data-swiping":j,"data-dismissible":Ye,"data-type":Ae,"data-invert":si,"data-swipe-out":oe,"data-swipe-direction":B,"data-expanded":!!(y||W&&X),"data-testid":d.testId,style:{"--index":g,"--toasts-before":g,"--z-index":_.length-g,"--offset":`${ae?Ce:dt.current}px`,"--initial-height":W?"auto":`${He}px`,...O,...d.style},onDragEnd:()=>{G(!1),K(null),Qe.current=null},onPointerDown:Le=>{Le.button!==2&&(Nr||!Ye||(Ue.current=new Date,Ve(dt.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(G(!0),Qe.current={x:Le.clientX,y:Le.clientY})))},onPointerUp:()=>{var Le,Dt,Ht;if(oe||!Ye)return;Qe.current=null;const Pt=Number(((Le=Fe.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$t=Number(((Dt=Fe.current)==null?void 0:Dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((Ht=Ue.current)==null?void 0:Ht.getTime()),ti=z==="x"?Pt:$t,ji=Math.abs(ti)/yt;if(Math.abs(ti)>=A2||ji>.11){Ve(dt.current),d.onDismiss==null||d.onDismiss.call(d,d),F(z==="x"?Pt>0?"right":"left":$t>0?"down":"up"),Ni(),le(!0);return}else{var Q,re;(Q=Fe.current)==null||Q.style.setProperty("--swipe-amount-x","0px"),(re=Fe.current)==null||re.style.setProperty("--swipe-amount-y","0px")}he(!1),G(!1),K(null)},onPointerMove:Le=>{var Dt,Ht,Pt;if(!Qe.current||!Ye||((Dt=window.getSelection())==null?void 0:Dt.toString().length)>0)return;const yt=Le.clientY-Qe.current.y,ti=Le.clientX-Qe.current.x;var ji;const Q=(ji=i.swipeDirections)!=null?ji:M2($);!z&&(Math.abs(ti)>1||Math.abs(yt)>1)&&K(Math.abs(ti)>Math.abs(yt)?"x":"y");let re={x:0,y:0};const de=Se=>1/(1.5+Math.abs(Se)/20);if(z==="y"){if(Q.includes("top")||Q.includes("bottom"))if(Q.includes("top")&&yt<0||Q.includes("bottom")&&yt>0)re.y=yt;else{const Se=yt*de(yt);re.y=Math.abs(Se)<Math.abs(yt)?Se:yt}}else if(z==="x"&&(Q.includes("left")||Q.includes("right")))if(Q.includes("left")&&ti<0||Q.includes("right")&&ti>0)re.x=ti;else{const Se=ti*de(ti);re.x=Math.abs(Se)<Math.abs(ti)?Se:ti}(Math.abs(re.x)>0||Math.abs(re.y)>0)&&he(!0),(Ht=Fe.current)==null||Ht.style.setProperty("--swipe-amount-x",`${re.x}px`),(Pt=Fe.current)==null||Pt.style.setProperty("--swipe-amount-y",`${re.y}px`)}},Zt&&!d.jsx&&Ae!=="loading"?Te.createElement("button",{"aria-label":k,"data-disabled":Nr,"data-close-button":!0,onClick:Nr||!Ye?()=>{}:()=>{Ni(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Ir(q==null?void 0:q.closeButton,d==null||(a=d.classNames)==null?void 0:a.closeButton)},(di=Y==null?void 0:Y.close)!=null?di:v2):null,(Ae||d.icon||d.promise)&&d.icon!==null&&((Y==null?void 0:Y[Ae])!==null||d.icon)?Te.createElement("div",{"data-icon":"",className:Ir(q==null?void 0:q.icon,d==null||(c=d.classNames)==null?void 0:c.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||rr():null,d.type!=="loading"?yi:null):null,Te.createElement("div",{"data-content":"",className:Ir(q==null?void 0:q.content,d==null||(f=d.classNames)==null?void 0:f.content)},Te.createElement("div",{"data-title":"",className:Ir(q==null?void 0:q.title,d==null||(v=d.classNames)==null?void 0:v.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Te.createElement("div",{"data-description":"",className:Ir(V,at,q==null?void 0:q.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),Te.isValidElement(d.cancel)?d.cancel:d.cancel&&Gc(d.cancel)?Te.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||x,onClick:Le=>{Gc(d.cancel)&&Ye&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Le),Ni())},className:Ir(q==null?void 0:q.cancelButton,d==null||(u=d.classNames)==null?void 0:u.cancelButton)},d.cancel.label):null,Te.isValidElement(d.action)?d.action:d.action&&Gc(d.action)?Te.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:Le=>{Gc(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Le),!Le.defaultPrevented&&Ni())},className:Ir(q==null?void 0:q.actionButton,d==null||(h=d.classNames)==null?void 0:h.actionButton)},d.action.label):null)};function v0(){if(typeof window>"u"||typeof document>"u")return"ltr";const i=document.documentElement.getAttribute("dir");return i==="auto"||!i?window.getComputedStyle(document.documentElement).direction:i}function B2(i,r){const s={};return[i,r].forEach((a,c)=>{const f=c===1,v=f?"--mobile-offset":"--offset",l=f?T2:R2;function u(h){["top","right","bottom","left"].forEach(b=>{s[`${v}-${b}`]=typeof h=="number"?`${h}px`:h})}typeof a=="number"||typeof a=="string"?u(a):typeof a=="object"?["top","right","bottom","left"].forEach(h=>{a[h]===void 0?s[`${v}-${h}`]=l:s[`${v}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):u(l)}),s}const N2=Te.forwardRef(function(r,s){const{id:a,invert:c,position:f="bottom-right",hotkey:v=["altKey","KeyT"],expand:l,closeButton:u,className:h,offset:b,mobileOffset:d,theme:w="light",richColors:C,duration:R,style:D,visibleToasts:m=x2,toastOptions:g,dir:_=v0(),gap:y=O2,icons:E,containerAriaLabel:T="Notifications"}=r,[A,O]=Te.useState([]),x=Te.useMemo(()=>a?A.filter(X=>X.toasterId===a):A.filter(X=>!X.toasterId),[A,a]),L=Te.useMemo(()=>Array.from(new Set([f].concat(x.filter(X=>X.position).map(X=>X.position)))),[x,f]),[I,V]=Te.useState([]),[P,$]=Te.useState(!1),[Z,W]=Te.useState(!1),[q,Y]=Te.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=Te.useRef(null),z=v.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=Te.useRef(null),B=Te.useRef(!1),F=Te.useCallback(X=>{O(ne=>{var ae;return(ae=ne.find(pe=>pe.id===X.id))!=null&&ae.delete||Vi.dismiss(X.id),ne.filter(({id:pe})=>pe!==X.id)})},[]);return Te.useEffect(()=>Vi.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{O(ne=>ne.map(ae=>ae.id===X.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{l2.flushSync(()=>{O(ne=>{const ae=ne.findIndex(pe=>pe.id===X.id);return ae!==-1?[...ne.slice(0,ae),{...ne[ae],...X},...ne.slice(ae+1)]:[X,...ne]})})})}),[A]),Te.useEffect(()=>{if(w!=="system"){Y(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:ne})=>{Y(ne?"dark":"light")})}catch{X.addListener(({matches:ae})=>{try{Y(ae?"dark":"light")}catch(pe){console.error(pe)}})}},[w]),Te.useEffect(()=>{A.length<=1&&$(!1)},[A]),Te.useEffect(()=>{const X=ne=>{var ae;if(v.every(G=>ne[G]||ne.code===G)){var j;$(!0),(j=k.current)==null||j.focus()}ne.code==="Escape"&&(document.activeElement===k.current||(ae=k.current)!=null&&ae.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[v]),Te.useEffect(()=>{if(k.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,B.current=!1)}},[k.current]),Te.createElement("section",{ref:s,"aria-label":`${T} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((X,ne)=>{var ae;const[pe,j]=X.split("-");return x.length?Te.createElement("ol",{key:X,dir:_==="auto"?v0():_,tabIndex:-1,ref:k,className:h,"data-sonner-toaster":!0,"data-sonner-theme":q,"data-y-position":pe,"data-x-position":j,style:{"--front-toast-height":`${((ae=I[0])==null?void 0:ae.height)||0}px`,"--width":`${D2}px`,"--gap":`${y}px`,...D,...B2(b,d)},onBlur:G=>{B.current&&!G.currentTarget.contains(G.relatedTarget)&&(B.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||B.current||(B.current=!0,K.current=G.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{Z||$(!1)},onDragEnd:()=>$(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},x.filter(G=>!G.position&&ne===0||G.position===X).map((G,oe)=>{var le,me;return Te.createElement(k2,{key:G.id,icons:E,index:oe,toast:G,defaultRichColors:C,duration:(le=g==null?void 0:g.duration)!=null?le:R,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:c,visibleToasts:m,closeButton:(me=g==null?void 0:g.closeButton)!=null?me:u,interacting:Z,position:X,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:F,toasts:x.filter(he=>he.position==G.position),heights:I.filter(he=>he.position==G.position),setHeights:V,expandByDefault:l,gap:y,expanded:P,swipeDirections:r.swipeDirections})})):null}))});/**
|
|
62
|
+
* @license lucide-react v0.563.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const bb=(...i)=>i.filter((r,s,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===s).join(" ").trim();/**
|
|
67
|
+
* @license lucide-react v0.563.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const j2=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
72
|
+
* @license lucide-react v0.563.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const H2=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,s,a)=>a?a.toUpperCase():s.toLowerCase());/**
|
|
77
|
+
* @license lucide-react v0.563.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const _0=i=>{const r=H2(i);return r.charAt(0).toUpperCase()+r.slice(1)};/**
|
|
82
|
+
* @license lucide-react v0.563.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/var P2={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"};/**
|
|
87
|
+
* @license lucide-react v0.563.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const z2=i=>{for(const r in i)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};/**
|
|
92
|
+
* @license lucide-react v0.563.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const I2=N.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:c="",children:f,iconNode:v,...l},u)=>N.createElement("svg",{ref:u,...P2,width:r,height:r,stroke:i,strokeWidth:a?Number(s)*24/Number(r):s,className:bb("lucide",c),...!f&&!z2(l)&&{"aria-hidden":"true"},...l},[...v.map(([h,b])=>N.createElement(h,b)),...Array.isArray(f)?f:[f]]));/**
|
|
97
|
+
* @license lucide-react v0.563.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Yt=(i,r)=>{const s=N.forwardRef(({className:a,...c},f)=>N.createElement(I2,{ref:f,iconNode:r,className:bb(`lucide-${j2(_0(i))}`,`lucide-${i}`,a),...c}));return s.displayName=_0(i),s};/**
|
|
102
|
+
* @license lucide-react v0.563.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const U2=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Sb=Yt("arrow-down-to-line",U2);/**
|
|
107
|
+
* @license lucide-react v0.563.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const F2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rm=Yt("chevron-down",F2);/**
|
|
112
|
+
* @license lucide-react v0.563.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const q2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],$2=Yt("chevron-left",q2);/**
|
|
117
|
+
* @license lucide-react v0.563.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const K2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tm=Yt("chevron-right",K2);/**
|
|
122
|
+
* @license lucide-react v0.563.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const V2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],W2=Yt("circle-alert",V2);/**
|
|
127
|
+
* @license lucide-react v0.563.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Y2=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],G2=Yt("circle-check-big",Y2);/**
|
|
132
|
+
* @license lucide-react v0.563.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const X2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],wb=Yt("globe",X2);/**
|
|
137
|
+
* @license lucide-react v0.563.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Q2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Z2=Yt("info",Q2);/**
|
|
142
|
+
* @license lucide-react v0.563.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const J2=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Cb=Yt("keyboard",J2);/**
|
|
147
|
+
* @license lucide-react v0.563.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const eR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tR=Yt("loader-circle",eR);/**
|
|
152
|
+
* @license lucide-react v0.563.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const iR=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],fu=Yt("monitor",iR);/**
|
|
157
|
+
* @license lucide-react v0.563.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const rR=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],nR=Yt("pencil",rR);/**
|
|
162
|
+
* @license lucide-react v0.563.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const sR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Eb=Yt("plus",sR);/**
|
|
167
|
+
* @license lucide-react v0.563.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const aR=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],oR=Yt("refresh-ccw",aR);/**
|
|
172
|
+
* @license lucide-react v0.563.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const lR=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],cR=Yt("rotate-ccw",lR);/**
|
|
177
|
+
* @license lucide-react v0.563.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const uR=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],qf=Yt("save",uR);/**
|
|
182
|
+
* @license lucide-react v0.563.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const hR=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],$f=Yt("send",hR);/**
|
|
187
|
+
* @license lucide-react v0.563.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const dR=[["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"}]],y0=Yt("settings",dR);/**
|
|
192
|
+
* @license lucide-react v0.563.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const fR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],b0=Yt("shield",fR);/**
|
|
197
|
+
* @license lucide-react v0.563.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const mR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],xb=Yt("smartphone",mR);/**
|
|
202
|
+
* @license lucide-react v0.563.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const pR=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Dm=Yt("trash-2",pR);/**
|
|
207
|
+
* @license lucide-react v0.563.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const gR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vR=Yt("triangle-alert",gR);/**
|
|
212
|
+
* @license lucide-react v0.563.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const _R=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Om=Yt("x",_R),Ge=i=>typeof i=="string",tl=()=>{let i,r;const s=new Promise((a,c)=>{i=a,r=c});return s.resolve=i,s.reject=r,s},S0=i=>i==null?"":""+i,yR=(i,r,s)=>{i.forEach(a=>{r[a]&&(s[a]=r[a])})},bR=/###/g,w0=i=>i&&i.indexOf("###")>-1?i.replace(bR,"."):i,C0=i=>!i||Ge(i),ll=(i,r,s)=>{const a=Ge(r)?r.split("."):r;let c=0;for(;c<a.length-1;){if(C0(i))return{};const f=w0(a[c]);!i[f]&&s&&(i[f]=new s),Object.prototype.hasOwnProperty.call(i,f)?i=i[f]:i={},++c}return C0(i)?{}:{obj:i,k:w0(a[c])}},E0=(i,r,s)=>{const{obj:a,k:c}=ll(i,r,Object);if(a!==void 0||r.length===1){a[c]=s;return}let f=r[r.length-1],v=r.slice(0,r.length-1),l=ll(i,v,Object);for(;l.obj===void 0&&v.length;)f=`${v[v.length-1]}.${f}`,v=v.slice(0,v.length-1),l=ll(i,v,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${f}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${f}`]=s},SR=(i,r,s,a)=>{const{obj:c,k:f}=ll(i,r,Object);c[f]=c[f]||[],c[f].push(s)},mu=(i,r)=>{const{obj:s,k:a}=ll(i,r);if(s&&Object.prototype.hasOwnProperty.call(s,a))return s[a]},wR=(i,r,s)=>{const a=mu(i,s);return a!==void 0?a:mu(r,s)},Rb=(i,r,s)=>{for(const a in r)a!=="__proto__"&&a!=="constructor"&&(a in i?Ge(i[a])||i[a]instanceof String||Ge(r[a])||r[a]instanceof String?s&&(i[a]=r[a]):Rb(i[a],r[a],s):i[a]=r[a]);return i},Na=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var CR={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ER=i=>Ge(i)?i.replace(/[&<>"'\/]/g,r=>CR[r]):i;class xR{constructor(r){this.capacity=r,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(r){const s=this.regExpMap.get(r);if(s!==void 0)return s;const a=new RegExp(r);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(r,a),this.regExpQueue.push(r),a}}const RR=[" ",",","?","!",";"],TR=new xR(20),DR=(i,r,s)=>{r=r||"",s=s||"";const a=RR.filter(v=>r.indexOf(v)<0&&s.indexOf(v)<0);if(a.length===0)return!0;const c=TR.getRegExp(`(${a.map(v=>v==="?"?"\\?":v).join("|")})`);let f=!c.test(i);if(!f){const v=i.indexOf(s);v>0&&!c.test(i.substring(0,v))&&(f=!0)}return f},Kf=(i,r,s=".")=>{if(!i)return;if(i[r])return Object.prototype.hasOwnProperty.call(i,r)?i[r]:void 0;const a=r.split(s);let c=i;for(let f=0;f<a.length;){if(!c||typeof c!="object")return;let v,l="";for(let u=f;u<a.length;++u)if(u!==f&&(l+=s),l+=a[u],v=c[l],v!==void 0){if(["string","number","boolean"].indexOf(typeof v)>-1&&u<a.length-1)continue;f+=u-f+1;break}c=v}return c},_l=i=>i==null?void 0:i.replace("_","-"),OR={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,r){var s,a;(a=(s=console==null?void 0:console[i])==null?void 0:s.apply)==null||a.call(s,console,r)}};class pu{constructor(r,s={}){this.init(r,s)}init(r,s={}){this.prefix=s.prefix||"i18next:",this.logger=r||OR,this.options=s,this.debug=s.debug}log(...r){return this.forward(r,"log","",!0)}warn(...r){return this.forward(r,"warn","",!0)}error(...r){return this.forward(r,"error","")}deprecate(...r){return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(r,s,a,c){return c&&!this.debug?null:(Ge(r[0])&&(r[0]=`${a}${this.prefix} ${r[0]}`),this.logger[s](r))}create(r){return new pu(this.logger,{prefix:`${this.prefix}:${r}:`,...this.options})}clone(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new pu(this.logger,r)}}var Wr=new pu;class Nu{constructor(){this.observers={}}on(r,s){return r.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const c=this.observers[a].get(s)||0;this.observers[a].set(s,c+1)}),this}off(r,s){if(this.observers[r]){if(!s){delete this.observers[r];return}this.observers[r].delete(s)}}emit(r,...s){this.observers[r]&&Array.from(this.observers[r].entries()).forEach(([c,f])=>{for(let v=0;v<f;v++)c(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,f])=>{for(let v=0;v<f;v++)c.apply(c,[r,...s])})}}class x0 extends Nu{constructor(r,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=r||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}removeNamespaces(r){const s=this.options.ns.indexOf(r);s>-1&&this.options.ns.splice(s,1)}getResource(r,s,a,c={}){var h,b;const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,v=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;r.indexOf(".")>-1?l=r.split("."):(l=[r,s],a&&(Array.isArray(a)?l.push(...a):Ge(a)&&f?l.push(...a.split(f)):l.push(a)));const u=mu(this.data,l);return!u&&!s&&!a&&r.indexOf(".")>-1&&(r=l[0],s=l[1],a=l.slice(2).join(".")),u||!v||!Ge(a)?u:Kf((b=(h=this.data)==null?void 0:h[r])==null?void 0:b[s],a,f)}addResource(r,s,a,c,f={silent:!1}){const v=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let l=[r,s];a&&(l=l.concat(v?a.split(v):a)),r.indexOf(".")>-1&&(l=r.split("."),c=s,s=l[1]),this.addNamespaces(s),E0(this.data,l,c),f.silent||this.emit("added",r,s,a,c)}addResources(r,s,a,c={silent:!1}){for(const f in a)(Ge(a[f])||Array.isArray(a[f]))&&this.addResource(r,s,f,a[f],{silent:!0});c.silent||this.emit("added",r,s,a)}addResourceBundle(r,s,a,c,f,v={silent:!1,skipCopy:!1}){let l=[r,s];r.indexOf(".")>-1&&(l=r.split("."),c=a,a=s,s=l[1]),this.addNamespaces(s);let u=mu(this.data,l)||{};v.skipCopy||(a=JSON.parse(JSON.stringify(a))),c?Rb(u,a,f):u={...u,...a},E0(this.data,l,u),v.silent||this.emit("added",r,s,a)}removeResourceBundle(r,s){this.hasResourceBundle(r,s)&&delete this.data[r][s],this.removeNamespaces(s),this.emit("removed",r,s)}hasResourceBundle(r,s){return this.getResource(r,s)!==void 0}getResourceBundle(r,s){return s||(s=this.options.defaultNS),this.getResource(r,s)}getDataByLanguage(r){return this.data[r]}hasLanguageSomeTranslations(r){const s=this.getDataByLanguage(r);return!!(s&&Object.keys(s)||[]).find(c=>s[c]&&Object.keys(s[c]).length>0)}toJSON(){return this.data}}var Tb={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,r,s,a,c){return i.forEach(f=>{var v;r=((v=this.processors[f])==null?void 0:v.process(r,s,a,c))??r}),r}};const Db=Symbol("i18next/PATH_KEY");function AR(){const i=[],r=Object.create(null);let s;return r.get=(a,c)=>{var f;return(f=s==null?void 0:s.revoke)==null||f.call(s),c===Db?i:(i.push(c),s=Proxy.revocable(a,r),s.proxy)},Proxy.revocable(Object.create(null),r).proxy}function Vf(i,r){const{[Db]:s}=i(AR());return s.join((r==null?void 0:r.keySeparator)??".")}const R0={},lf=i=>!Ge(i)&&typeof i!="boolean"&&typeof i!="number";class gu extends Nu{constructor(r,s={}){super(),yR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Wr.create("translator")}changeLanguage(r){r&&(this.language=r)}exists(r,s={interpolation:{}}){const a={...s};if(r==null)return!1;const c=this.resolve(r,a);if((c==null?void 0:c.res)===void 0)return!1;const f=lf(c.res);return!(a.returnObjects===!1&&f)}extractFromKey(r,s){let a=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let f=s.ns||this.options.defaultNS||[];const v=a&&r.indexOf(a)>-1,l=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!DR(r,a,c);if(v&&!l){const u=r.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:r,namespaces:Ge(f)?[f]:f};const h=r.split(a);(a!==c||a===c&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),r=h.join(c)}return{key:r,namespaces:Ge(f)?[f]:f}}translate(r,s,a){let c=typeof s=="object"?{...s}:s;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),r==null)return"";typeof r=="function"&&(r=Vf(r,{...this.options,...c})),Array.isArray(r)||(r=[String(r)]);const f=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,v=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:l,namespaces:u}=this.extractFromKey(r[r.length-1],c),h=u[u.length-1];let b=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const d=c.lng||this.language,w=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return w?f?{res:`${h}${b}${l}`,usedKey:l,exactUsedKey:l,usedLng:d,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:`${h}${b}${l}`:f?{res:l,usedKey:l,exactUsedKey:l,usedLng:d,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:l;const C=this.resolve(r,c);let R=C==null?void 0:C.res;const D=(C==null?void 0:C.usedKey)||l,m=(C==null?void 0:C.exactUsedKey)||l,g=["[object Number]","[object Function]","[object RegExp]"],_=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,E=c.count!==void 0&&!Ge(c.count),T=gu.hasDefaultValue(c),A=E?this.pluralResolver.getSuffix(d,c.count,c):"",O=c.ordinal&&E?this.pluralResolver.getSuffix(d,c.count,{ordinal:!1}):"",x=E&&!c.ordinal&&c.count===0,L=x&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${A}`]||c[`defaultValue${O}`]||c.defaultValue;let I=R;y&&!R&&T&&(I=L);const V=lf(I),P=Object.prototype.toString.apply(I);if(y&&I&&V&&g.indexOf(P)<0&&!(Ge(_)&&Array.isArray(I))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(D,I,{...c,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return f?(C.res=$,C.usedParams=this.getUsedParamsDetails(c),C):$}if(v){const $=Array.isArray(I),Z=$?[]:{},W=$?m:D;for(const q in I)if(Object.prototype.hasOwnProperty.call(I,q)){const Y=`${W}${v}${q}`;T&&!R?Z[q]=this.translate(Y,{...c,defaultValue:lf(L)?L[q]:void 0,joinArrays:!1,ns:u}):Z[q]=this.translate(Y,{...c,joinArrays:!1,ns:u}),Z[q]===Y&&(Z[q]=I[q])}R=Z}}else if(y&&Ge(_)&&Array.isArray(R))R=R.join(_),R&&(R=this.extendTranslation(R,r,c,a));else{let $=!1,Z=!1;!this.isValidLookup(R)&&T&&($=!0,R=L),this.isValidLookup(R)||(Z=!0,R=l);const q=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Z?void 0:R,Y=T&&L!==R&&this.options.updateMissing;if(Z||$||Y){if(this.logger.log(Y?"updateKey":"missingKey",d,h,l,Y?L:R),v){const B=this.resolve(l,{...c,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let k=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let B=0;B<z.length;B++)k.push(z[B]);else this.options.saveMissingTo==="all"?k=this.languageUtils.toResolveHierarchy(c.lng||this.language):k.push(c.lng||this.language);const K=(B,F,X)=>{var ae;const ne=T&&X!==R?X:q;this.options.missingKeyHandler?this.options.missingKeyHandler(B,h,F,ne,Y,c):(ae=this.backendConnector)!=null&&ae.saveMissing&&this.backendConnector.saveMissing(B,h,F,ne,Y,c),this.emit("missingKey",B,h,F,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?k.forEach(B=>{const F=this.pluralResolver.getSuffixes(B,c);x&&c[`defaultValue${this.options.pluralSeparator}zero`]&&F.indexOf(`${this.options.pluralSeparator}zero`)<0&&F.push(`${this.options.pluralSeparator}zero`),F.forEach(X=>{K([B],l+X,c[`defaultValue${X}`]||L)})}):K(k,l,L))}R=this.extendTranslation(R,r,c,C,a),Z&&R===l&&this.options.appendNamespaceToMissingKey&&(R=`${h}${b}${l}`),(Z||$)&&this.options.parseMissingKeyHandler&&(R=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${b}${l}`:l,$?R:void 0,c))}return f?(C.res=R,C.usedParams=this.getUsedParamsDetails(c),C):R}extendTranslation(r,s,a,c,f){var u,h;if((u=this.i18nFormat)!=null&&u.parse)r=this.i18nFormat.parse(r,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const b=Ge(r)&&(((h=a==null?void 0:a.interpolation)==null?void 0:h.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(b){const C=r.match(this.interpolator.nestingRegexp);d=C&&C.length}let w=a.replace&&!Ge(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(w={...this.options.interpolation.defaultVariables,...w}),r=this.interpolator.interpolate(r,w,a.lng||this.language||c.usedLng,a),b){const C=r.match(this.interpolator.nestingRegexp),R=C&&C.length;d<R&&(a.nest=!1)}!a.lng&&c&&c.res&&(a.lng=this.language||c.usedLng),a.nest!==!1&&(r=this.interpolator.nest(r,(...C)=>(f==null?void 0:f[0])===C[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${C[0]} in key: ${s[0]}`),null):this.translate(...C,s),a)),a.interpolation&&this.interpolator.reset()}const v=a.postProcess||this.options.postProcess,l=Ge(v)?[v]:v;return r!=null&&(l!=null&&l.length)&&a.applyPostProcessor!==!1&&(r=Tb.handle(l,r,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),r}resolve(r,s={}){let a,c,f,v,l;return Ge(r)&&(r=[r]),r.forEach(u=>{if(this.isValidLookup(a))return;const h=this.extractFromKey(u,s),b=h.key;c=b;let d=h.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const w=s.count!==void 0&&!Ge(s.count),C=w&&!s.ordinal&&s.count===0,R=s.context!==void 0&&(Ge(s.context)||typeof s.context=="number")&&s.context!=="",D=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);d.forEach(m=>{var g,_;this.isValidLookup(a)||(l=m,!R0[`${D[0]}-${m}`]&&((g=this.utils)!=null&&g.hasLoadedNamespace)&&!((_=this.utils)!=null&&_.hasLoadedNamespace(l))&&(R0[`${D[0]}-${m}`]=!0,this.logger.warn(`key "${c}" for languages "${D.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),D.forEach(y=>{var A;if(this.isValidLookup(a))return;v=y;const E=[b];if((A=this.i18nFormat)!=null&&A.addLookupKeys)this.i18nFormat.addLookupKeys(E,b,y,m,s);else{let O;w&&(O=this.pluralResolver.getSuffix(y,s.count,s));const x=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(s.ordinal&&O.indexOf(L)===0&&E.push(b+O.replace(L,this.options.pluralSeparator)),E.push(b+O),C&&E.push(b+x)),R){const I=`${b}${this.options.contextSeparator||"_"}${s.context}`;E.push(I),w&&(s.ordinal&&O.indexOf(L)===0&&E.push(I+O.replace(L,this.options.pluralSeparator)),E.push(I+O),C&&E.push(I+x))}}let T;for(;T=E.pop();)this.isValidLookup(a)||(f=T,a=this.getResource(y,m,T,s))}))})}),{res:a,usedKey:c,exactUsedKey:f,usedLng:v,usedNS:l}}isValidLookup(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}getResource(r,s,a,c={}){var f;return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(r,s,a,c):this.resourceStore.getResource(r,s,a,c)}getUsedParamsDetails(r={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=r.replace&&!Ge(r.replace);let c=a?r.replace:r;if(a&&typeof r.count<"u"&&(c.count=r.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!a){c={...c};for(const f of s)delete c[f]}return c}static hasDefaultValue(r){const s="defaultValue";for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&s===a.substring(0,s.length)&&r[a]!==void 0)return!0;return!1}}class T0{constructor(r){this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wr.create("languageUtils")}getScriptPartFromCode(r){if(r=_l(r),!r||r.indexOf("-")<0)return null;const s=r.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(r){if(r=_l(r),!r||r.indexOf("-")<0)return r;const s=r.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(r){if(Ge(r)&&r.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(r)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?r.toLowerCase():r)}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}isSupportedCode(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}getBestMatchFromCodes(r){if(!r)return null;let s;return r.forEach(a=>{if(s)return;const c=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(c))&&(s=c)}),!s&&this.options.supportedLngs&&r.forEach(a=>{if(s)return;const c=this.getScriptPartFromCode(a);if(this.isSupportedCode(c))return s=c;const f=this.getLanguagePartFromCode(a);if(this.isSupportedCode(f))return s=f;s=this.options.supportedLngs.find(v=>{if(v===f)return v;if(!(v.indexOf("-")<0&&f.indexOf("-")<0)&&(v.indexOf("-")>0&&f.indexOf("-")<0&&v.substring(0,v.indexOf("-"))===f||v.indexOf(f)===0&&f.length>1))return v})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(r,s){if(!r)return[];if(typeof r=="function"&&(r=r(s)),Ge(r)&&(r=[r]),Array.isArray(r))return r;if(!s)return r.default||[];let a=r[s];return a||(a=r[this.getScriptPartFromCode(s)]),a||(a=r[this.formatLanguageCode(s)]),a||(a=r[this.getLanguagePartFromCode(s)]),a||(a=r.default),a||[]}toResolveHierarchy(r,s){const a=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],r),c=[],f=v=>{v&&(this.isSupportedCode(v)?c.push(v):this.logger.warn(`rejecting language code not found in supportedLngs: ${v}`))};return Ge(r)&&(r.indexOf("-")>-1||r.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(r))):Ge(r)&&f(this.formatLanguageCode(r)),a.forEach(v=>{c.indexOf(v)<0&&f(this.formatLanguageCode(v))}),c}}const D0={zero:0,one:1,two:2,few:3,many:4,other:5},O0={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class LR{constructor(r,s={}){this.languageUtils=r,this.options=s,this.logger=Wr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(r,s={}){const a=_l(r==="dev"?"en":r),c=s.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:a,type:c});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let v;try{v=new Intl.PluralRules(a,{type:c})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),O0;if(!r.match(/-|_/))return O0;const u=this.languageUtils.getLanguagePartFromCode(r);v=this.getRule(u,s)}return this.pluralRulesCache[f]=v,v}needsPlural(r,s={}){let a=this.getRule(r,s);return a||(a=this.getRule("dev",s)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(r,s,a={}){return this.getSuffixes(r,a).map(c=>`${s}${c}`)}getSuffixes(r,s={}){let a=this.getRule(r,s);return a||(a=this.getRule("dev",s)),a?a.resolvedOptions().pluralCategories.sort((c,f)=>D0[c]-D0[f]).map(c=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(r,s,a={}){const c=this.getRule(r,a);return c?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${c.select(s)}`:(this.logger.warn(`no plural rule found for: ${r}`),this.getSuffix("dev",s,a))}}const A0=(i,r,s,a=".",c=!0)=>{let f=wR(i,r,s);return!f&&c&&Ge(s)&&(f=Kf(i,s,a),f===void 0&&(f=Kf(r,s,a))),f},cf=i=>i.replace(/\$/g,"$$$$");class L0{constructor(r={}){var s;this.logger=Wr.create("interpolator"),this.options=r,this.format=((s=r==null?void 0:r.interpolation)==null?void 0:s.format)||(a=>a),this.init(r)}init(r={}){r.interpolation||(r.interpolation={escapeValue:!0});const{escape:s,escapeValue:a,useRawValueToEscape:c,prefix:f,prefixEscaped:v,suffix:l,suffixEscaped:u,formatSeparator:h,unescapeSuffix:b,unescapePrefix:d,nestingPrefix:w,nestingPrefixEscaped:C,nestingSuffix:R,nestingSuffixEscaped:D,nestingOptionsSeparator:m,maxReplaces:g,alwaysFormat:_}=r.interpolation;this.escape=s!==void 0?s:ER,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=f?Na(f):v||"{{",this.suffix=l?Na(l):u||"}}",this.formatSeparator=h||",",this.unescapePrefix=b?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=w?Na(w):C||Na("$t("),this.nestingSuffix=R?Na(R):D||Na(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const r=(s,a)=>(s==null?void 0:s.source)===a?(s.lastIndex=0,s):new RegExp(a,"g");this.regexp=r(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=r(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=r(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(r,s,a,c){var C;let f,v,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=R=>{if(R.indexOf(this.formatSeparator)<0){const _=A0(s,u,R,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,a,{...c,...s,interpolationkey:R}):_}const D=R.split(this.formatSeparator),m=D.shift().trim(),g=D.join(this.formatSeparator).trim();return this.format(A0(s,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),g,a,{...c,...s,interpolationkey:m})};this.resetRegExp();const b=(c==null?void 0:c.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((C=c==null?void 0:c.interpolation)==null?void 0:C.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:R=>cf(R)},{regex:this.regexp,safeValue:R=>this.escapeValue?cf(this.escape(R)):cf(R)}].forEach(R=>{for(l=0;f=R.regex.exec(r);){const D=f[1].trim();if(v=h(D),v===void 0)if(typeof b=="function"){const g=b(r,f,c);v=Ge(g)?g:""}else if(c&&Object.prototype.hasOwnProperty.call(c,D))v="";else if(d){v=f[0];continue}else this.logger.warn(`missed to pass in variable ${D} for interpolating ${r}`),v="";else!Ge(v)&&!this.useRawValueToEscape&&(v=S0(v));const m=R.safeValue(v);if(r=r.replace(f[0],m),d?(R.regex.lastIndex+=v.length,R.regex.lastIndex-=f[0].length):R.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),r}nest(r,s,a={}){let c,f,v;const l=(u,h)=>{const b=this.nestingOptionsSeparator;if(u.indexOf(b)<0)return u;const d=u.split(new RegExp(`${b}[ ]*{`));let w=`{${d[1]}`;u=d[0],w=this.interpolate(w,v);const C=w.match(/'/g),R=w.match(/"/g);(((C==null?void 0:C.length)??0)%2===0&&!R||R.length%2!==0)&&(w=w.replace(/'/g,'"'));try{v=JSON.parse(w),h&&(v={...h,...v})}catch(D){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,D),`${u}${b}${w}`}return v.defaultValue&&v.defaultValue.indexOf(this.prefix)>-1&&delete v.defaultValue,u};for(;c=this.nestingRegexp.exec(r);){let u=[];v={...a},v=v.replace&&!Ge(v.replace)?v.replace:v,v.applyPostProcessor=!1,delete v.defaultValue;const h=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(h!==-1&&(u=c[1].slice(h).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),c[1]=c[1].slice(0,h)),f=s(l.call(this,c[1].trim(),v),v),f&&c[0]===r&&!Ge(f))return f;Ge(f)||(f=S0(f)),f||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${r}`),f=""),u.length&&(f=u.reduce((b,d)=>this.format(b,d,a.lng,{...a,interpolationkey:c[1].trim()}),f.trim())),r=r.replace(c[0],f),this.regexp.lastIndex=0}return r}}const MR=i=>{let r=i.toLowerCase().trim();const s={};if(i.indexOf("(")>-1){const a=i.split("(");r=a[0].toLowerCase().trim();const c=a[1].substring(0,a[1].length-1);r==="currency"&&c.indexOf(":")<0?s.currency||(s.currency=c.trim()):r==="relativetime"&&c.indexOf(":")<0?s.range||(s.range=c.trim()):c.split(";").forEach(v=>{if(v){const[l,...u]=v.split(":"),h=u.join(":").trim().replace(/^'+|'+$/g,""),b=l.trim();s[b]||(s[b]=h),h==="false"&&(s[b]=!1),h==="true"&&(s[b]=!0),isNaN(h)||(s[b]=parseInt(h,10))}})}return{formatName:r,formatOptions:s}},M0=i=>{const r={};return(s,a,c)=>{let f=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(f={...f,[c.interpolationkey]:void 0});const v=a+JSON.stringify(f);let l=r[v];return l||(l=i(_l(a),c),r[v]=l),l(s)}},kR=i=>(r,s,a)=>i(_l(s),a)(r);class BR{constructor(r={}){this.logger=Wr.create("formatter"),this.options=r,this.init(r)}init(r,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const a=s.cacheInBuiltFormats?M0:kR;this.formats={number:a((c,f)=>{const v=new Intl.NumberFormat(c,{...f});return l=>v.format(l)}),currency:a((c,f)=>{const v=new Intl.NumberFormat(c,{...f,style:"currency"});return l=>v.format(l)}),datetime:a((c,f)=>{const v=new Intl.DateTimeFormat(c,{...f});return l=>v.format(l)}),relativetime:a((c,f)=>{const v=new Intl.RelativeTimeFormat(c,{...f});return l=>v.format(l,f.range||"day")}),list:a((c,f)=>{const v=new Intl.ListFormat(c,{...f});return l=>v.format(l)})}}add(r,s){this.formats[r.toLowerCase().trim()]=s}addCached(r,s){this.formats[r.toLowerCase().trim()]=M0(s)}format(r,s,a,c={}){const f=s.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(l=>l.indexOf(")")>-1)){const l=f.findIndex(u=>u.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,l)].join(this.formatSeparator)}return f.reduce((l,u)=>{var d;const{formatName:h,formatOptions:b}=MR(u);if(this.formats[h]){let w=l;try{const C=((d=c==null?void 0:c.formatParams)==null?void 0:d[c.interpolationkey])||{},R=C.locale||C.lng||c.locale||c.lng||a;w=this.formats[h](l,R,{...b,...c,...C})}catch(C){this.logger.warn(C)}return w}else this.logger.warn(`there was no format function for ${h}`);return l},r)}}const NR=(i,r)=>{i.pending[r]!==void 0&&(delete i.pending[r],i.pendingCount--)};class jR extends Nu{constructor(r,s,a,c={}){var f,v;super(),this.backend=r,this.store=s,this.services=a,this.languageUtils=a.languageUtils,this.options=c,this.logger=Wr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],(v=(f=this.backend)==null?void 0:f.init)==null||v.call(f,a,c.backend,c)}queueLoad(r,s,a,c){const f={},v={},l={},u={};return r.forEach(h=>{let b=!0;s.forEach(d=>{const w=`${h}|${d}`;!a.reload&&this.store.hasResourceBundle(h,d)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?v[w]===void 0&&(v[w]=!0):(this.state[w]=1,b=!1,v[w]===void 0&&(v[w]=!0),f[w]===void 0&&(f[w]=!0),u[d]===void 0&&(u[d]=!0)))}),b||(l[h]=!0)}),(Object.keys(f).length||Object.keys(v).length)&&this.queue.push({pending:v,pendingCount:Object.keys(v).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(f),pending:Object.keys(v),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(u)}}loaded(r,s,a){const c=r.split("|"),f=c[0],v=c[1];s&&this.emit("failedLoading",f,v,s),!s&&a&&this.store.addResourceBundle(f,v,a,void 0,void 0,{skipCopy:!0}),this.state[r]=s?-1:2,s&&a&&(this.state[r]=0);const l={};this.queue.forEach(u=>{SR(u.loaded,[f],v),NR(u,r),s&&u.errors.push(s),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(h=>{l[h]||(l[h]={});const b=u.loaded[h];b.length&&b.forEach(d=>{l[h][d]===void 0&&(l[h][d]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(u=>!u.done)}read(r,s,a,c=0,f=this.retryTimeout,v){if(!r.length)return v(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:s,fcName:a,tried:c,wait:f,callback:v});return}this.readingCalls++;const l=(h,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(h&&b&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,r,s,a,c+1,f*2,v)},f);return}v(h,b)},u=this.backend[a].bind(this.backend);if(u.length===2){try{const h=u(r,s);h&&typeof h.then=="function"?h.then(b=>l(null,b)).catch(l):l(null,h)}catch(h){l(h)}return}return u(r,s,l)}prepareLoading(r,s,a={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();Ge(r)&&(r=this.languageUtils.toResolveHierarchy(r)),Ge(s)&&(s=[s]);const f=this.queueLoad(r,s,a,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(v=>{this.loadOne(v)})}load(r,s,a){this.prepareLoading(r,s,{},a)}reload(r,s,a){this.prepareLoading(r,s,{reload:!0},a)}loadOne(r,s=""){const a=r.split("|"),c=a[0],f=a[1];this.read(c,f,"read",void 0,void 0,(v,l)=>{v&&this.logger.warn(`${s}loading namespace ${f} for language ${c} failed`,v),!v&&l&&this.logger.log(`${s}loaded namespace ${f} for language ${c}`,l),this.loaded(r,v,l)})}saveMissing(r,s,a,c,f,v={},l=()=>{}){var u,h,b,d,w;if((h=(u=this.services)==null?void 0:u.utils)!=null&&h.hasLoadedNamespace&&!((d=(b=this.services)==null?void 0:b.utils)!=null&&d.hasLoadedNamespace(s))){this.logger.warn(`did not save key "${a}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if((w=this.backend)!=null&&w.create){const C={...v,isUpdate:f},R=this.backend.create.bind(this.backend);if(R.length<6)try{let D;R.length===5?D=R(r,s,a,c,C):D=R(r,s,a,c),D&&typeof D.then=="function"?D.then(m=>l(null,m)).catch(l):l(null,D)}catch(D){l(D)}else R(r,s,a,c,l,C)}!r||!r[0]||this.store.addResource(r[0],s,a,c)}}}const uf=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:i=>{let r={};if(typeof i[1]=="object"&&(r=i[1]),Ge(i[1])&&(r.defaultValue=i[1]),Ge(i[2])&&(r.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const s=i[3]||i[2];Object.keys(s).forEach(a=>{r[a]=s[a]})}return r},interpolation:{escapeValue:!0,format:i=>i,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),k0=i=>{var r,s;return Ge(i.ns)&&(i.ns=[i.ns]),Ge(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),Ge(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),((s=(r=i.supportedLngs)==null?void 0:r.indexOf)==null?void 0:s.call(r,"cimode"))<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),typeof i.initImmediate=="boolean"&&(i.initAsync=i.initImmediate),i},Xc=()=>{},HR=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(s=>{typeof i[s]=="function"&&(i[s]=i[s].bind(i))})},PR=i=>{var r,s,a,c,f,v,l,u,h;return!!(((a=(s=(r=i==null?void 0:i.modules)==null?void 0:r.backend)==null?void 0:s.name)==null?void 0:a.indexOf("Locize"))>0||((l=(v=(f=(c=i==null?void 0:i.modules)==null?void 0:c.backend)==null?void 0:f.constructor)==null?void 0:v.name)==null?void 0:l.indexOf("Locize"))>0||(h=(u=i==null?void 0:i.options)==null?void 0:u.backend)!=null&&h.backends&&i.options.backend.backends.some(b=>{var d,w,C;return((d=b==null?void 0:b.name)==null?void 0:d.indexOf("Locize"))>0||((C=(w=b==null?void 0:b.constructor)==null?void 0:w.name)==null?void 0:C.indexOf("Locize"))>0}))};class cl extends Nu{constructor(r={},s){if(super(),this.options=k0(r),this.services={},this.logger=Wr,this.modules={external:[]},HR(this),s&&!this.isInitialized&&!r.isClone){if(!this.options.initAsync)return this.init(r,s),this;setTimeout(()=>{this.init(r,s)},0)}}init(r={},s){this.isInitializing=!0,typeof r=="function"&&(s=r,r={}),r.defaultNS==null&&r.ns&&(Ge(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const a=uf();this.options={...a,...this.options,...k0(r)},this.options.interpolation={...a.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!PR(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const c=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Wr.init(c(this.modules.logger),this.options):Wr.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=BR;const b=new T0(this.options);this.store=new x0(this.options.resources,this.options);const d=this.services;d.logger=Wr,d.resourceStore=this.store,d.languageUtils=b,d.pluralResolver=new LR(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=c(h),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new L0(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new jR(c(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(C,...R)=>{this.emit(C,...R)}),this.modules.languageDetector&&(d.languageDetector=c(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=c(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new gu(this.services,this.options),this.translator.on("*",(C,...R)=>{this.emit(C,...R)}),this.modules.external.forEach(C=>{C.init&&C.init(this)})}if(this.format=this.options.interpolation.format,s||(s=Xc),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...b)=>this.store[h](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...b)=>(this.store[h](...b),this)});const l=tl(),u=()=>{const h=(b,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(d),s(b,d)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),l}loadResources(r,s=Xc){var f,v;let a=s;const c=Ge(r)?r:this.language;if(typeof r=="function"&&(a=r),!this.options.resources||this.options.partialBundledLanguages){if((c==null?void 0:c.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const l=[],u=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(d=>{d!=="cimode"&&l.indexOf(d)<0&&l.push(d)})};c?u(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>u(b)),(v=(f=this.options.preload)==null?void 0:f.forEach)==null||v.call(f,h=>u(h)),this.services.backendConnector.load(l,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(h)})}else a(null)}reloadResources(r,s,a){const c=tl();return typeof r=="function"&&(a=r,r=void 0),typeof s=="function"&&(a=s,s=void 0),r||(r=this.languages),s||(s=this.options.ns),a||(a=Xc),this.services.backendConnector.reload(r,s,f=>{c.resolve(),a(f)}),c}use(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&Tb.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}setResolvedLanguage(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1)){for(let s=0;s<this.languages.length;s++){const a=this.languages[s];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&this.languages.indexOf(r)<0&&this.store.hasLanguageSomeTranslations(r)&&(this.resolvedLanguage=r,this.languages.unshift(r))}}changeLanguage(r,s){this.isLanguageChangingTo=r;const a=tl();this.emit("languageChanging",r);const c=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},f=(l,u)=>{u?this.isLanguageChangingTo===r&&(c(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,a.resolve((...h)=>this.t(...h)),s&&s(l,(...h)=>this.t(...h))},v=l=>{var b,d;!r&&!l&&this.services.languageDetector&&(l=[]);const u=Ge(l)?l:l&&l[0],h=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Ge(l)?[l]:l);h&&(this.language||c(h),this.translator.language||this.translator.changeLanguage(h),(d=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||d.call(b,h)),this.loadResources(h,w=>{f(w,h)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?v(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(v):this.services.languageDetector.detect(v):v(r),a}getFixedT(r,s,a){const c=(f,v,...l)=>{let u;typeof v!="object"?u=this.options.overloadTranslationOptionHandler([f,v].concat(l)):u={...v},u.lng=u.lng||c.lng,u.lngs=u.lngs||c.lngs,u.ns=u.ns||c.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||a||c.keyPrefix);const h=this.options.keySeparator||".";let b;return u.keyPrefix&&Array.isArray(f)?b=f.map(d=>(typeof d=="function"&&(d=Vf(d,{...this.options,...v})),`${u.keyPrefix}${h}${d}`)):(typeof f=="function"&&(f=Vf(f,{...this.options,...v})),b=u.keyPrefix?`${u.keyPrefix}${h}${f}`:f),this.t(b,u)};return Ge(r)?c.lng=r:c.lngs=r,c.ns=s,c.keyPrefix=a,c}t(...r){var s;return(s=this.translator)==null?void 0:s.translate(...r)}exists(...r){var s;return(s=this.translator)==null?void 0:s.exists(...r)}setDefaultNamespace(r){this.options.defaultNS=r}hasLoadedNamespace(r,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const a=s.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const v=(l,u)=>{const h=this.services.backendConnector.state[`${l}|${u}`];return h===-1||h===0||h===2};if(s.precheck){const l=s.precheck(this,v);if(l!==void 0)return l}return!!(this.hasResourceBundle(a,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||v(a,r)&&(!c||v(f,r)))}loadNamespaces(r,s){const a=tl();return this.options.ns?(Ge(r)&&(r=[r]),r.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{a.resolve(),s&&s(c)}),a):(s&&s(),Promise.resolve())}loadLanguages(r,s){const a=tl();Ge(r)&&(r=[r]);const c=this.options.preload||[],f=r.filter(v=>c.indexOf(v)<0&&this.services.languageUtils.isSupportedCode(v));return f.length?(this.options.preload=c.concat(f),this.loadResources(v=>{a.resolve(),s&&s(v)}),a):(s&&s(),Promise.resolve())}dir(r){var c,f;if(r||(r=this.resolvedLanguage||(((c=this.languages)==null?void 0:c.length)>0?this.languages[0]:this.language)),!r)return"rtl";try{const v=new Intl.Locale(r);if(v&&v.getTextInfo){const l=v.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=((f=this.services)==null?void 0:f.languageUtils)||new T0(uf());return r.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(a.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(r={},s){const a=new cl(r,s);return a.createInstance=cl.createInstance,a}cloneInstance(r={},s=Xc){const a=r.forkResourceStore;a&&delete r.forkResourceStore;const c={...this.options,...r,isClone:!0},f=new cl(c);if((r.debug!==void 0||r.prefix!==void 0)&&(f.logger=f.logger.clone(r)),["store","services","language"].forEach(l=>{f[l]=this[l]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},a){const l=Object.keys(this.store.data).reduce((u,h)=>(u[h]={...this.store.data[h]},u[h]=Object.keys(u[h]).reduce((b,d)=>(b[d]={...u[h][d]},b),u[h]),u),{});f.store=new x0(l,c),f.services.resourceStore=f.store}if(r.interpolation){const u={...uf().interpolation,...this.options.interpolation,...r.interpolation},h={...c,interpolation:u};f.services.interpolator=new L0(h)}return f.translator=new gu(f.services,c),f.translator.on("*",(l,...u)=>{f.emit(l,...u)}),f.init(c,s),f.translator.options=c,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ti=cl.createInstance();Ti.createInstance;Ti.dir;Ti.init;Ti.loadResources;Ti.reloadResources;Ti.use;Ti.changeLanguage;Ti.getFixedT;Ti.t;Ti.exists;Ti.setDefaultNamespace;Ti.hasLoadedNamespace;Ti.loadNamespaces;Ti.loadLanguages;const zR=(i,r,s,a)=>{var f,v,l,u;const c=[s,{code:r,...a||{}}];if((v=(f=i==null?void 0:i.services)==null?void 0:f.logger)!=null&&v.forward)return i.services.logger.forward(c,"warn","react-i18next::",!0);Js(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),(u=(l=i==null?void 0:i.services)==null?void 0:l.logger)!=null&&u.warn?i.services.logger.warn(...c):console!=null&&console.warn&&console.warn(...c)},B0={},Ob=(i,r,s,a)=>{Js(s)&&B0[s]||(Js(s)&&(B0[s]=new Date),zR(i,r,s,a))},Ab=(i,r)=>()=>{if(i.isInitialized)r();else{const s=()=>{setTimeout(()=>{i.off("initialized",s)},0),r()};i.on("initialized",s)}},Wf=(i,r,s)=>{i.loadNamespaces(r,Ab(i,s))},N0=(i,r,s,a)=>{if(Js(s)&&(s=[s]),i.options.preload&&i.options.preload.indexOf(r)>-1)return Wf(i,s,a);s.forEach(c=>{i.options.ns.indexOf(c)<0&&i.options.ns.push(c)}),i.loadLanguages(r,Ab(i,a))},IR=(i,r,s={})=>!r.languages||!r.languages.length?(Ob(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(i,{lng:s.lng,precheck:(a,c)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!c(a.isLanguageChangingTo,i))return!1}}),Js=i=>typeof i=="string",UR=i=>typeof i=="object"&&i!==null,FR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qR={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},$R=i=>qR[i],KR=i=>i.replace(FR,$R);let Yf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:KR,transDefaultProps:void 0};const VR=(i={})=>{Yf={...Yf,...i}},WR=()=>Yf;let Lb;const YR=i=>{Lb=i},GR=()=>Lb,XR={type:"3rdParty",init(i){VR(i.options.react),YR(i)}},QR=N.createContext();class ZR{constructor(){this.usedNamespaces={}}addUsedNamespaces(r){r.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var hf={exports:{}},df={};/**
|
|
217
|
+
* @license React
|
|
218
|
+
* use-sync-external-store-shim.production.js
|
|
219
|
+
*
|
|
220
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the MIT license found in the
|
|
223
|
+
* LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/var j0;function JR(){if(j0)return df;j0=1;var i=xl();function r(d,w){return d===w&&(d!==0||1/d===1/w)||d!==d&&w!==w}var s=typeof Object.is=="function"?Object.is:r,a=i.useState,c=i.useEffect,f=i.useLayoutEffect,v=i.useDebugValue;function l(d,w){var C=w(),R=a({inst:{value:C,getSnapshot:w}}),D=R[0].inst,m=R[1];return f(function(){D.value=C,D.getSnapshot=w,u(D)&&m({inst:D})},[d,C,w]),c(function(){return u(D)&&m({inst:D}),d(function(){u(D)&&m({inst:D})})},[d]),v(C),C}function u(d){var w=d.getSnapshot;d=d.value;try{var C=w();return!s(d,C)}catch{return!0}}function h(d,w){return w()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:l;return df.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:b,df}var H0;function Mb(){return H0||(H0=1,hf.exports=JR()),hf.exports}var kb=Mb();const e3=(i,r)=>Js(r)?r:UR(r)&&Js(r.defaultValue)?r.defaultValue:Array.isArray(i)?i[i.length-1]:i,t3={t:e3,ready:!1},i3=()=>()=>{},wr=(i,r={})=>{var L,I,V;const{i18n:s}=r,{i18n:a,defaultNS:c}=N.useContext(QR)||{},f=s||a||GR();f&&!f.reportNamespaces&&(f.reportNamespaces=new ZR),f||Ob(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const v=N.useMemo(()=>{var P;return{...WR(),...(P=f==null?void 0:f.options)==null?void 0:P.react,...r}},[f,r]),{useSuspense:l,keyPrefix:u}=v,h=c||((L=f==null?void 0:f.options)==null?void 0:L.defaultNS),b=Js(h)?[h]:h||["translation"],d=N.useMemo(()=>b,b);(V=(I=f==null?void 0:f.reportNamespaces)==null?void 0:I.addUsedNamespaces)==null||V.call(I,d);const w=N.useRef(0),C=N.useCallback(P=>{if(!f)return i3;const{bindI18n:$,bindI18nStore:Z}=v,W=()=>{w.current+=1,P()};return $&&f.on($,W),Z&&f.store.on(Z,W),()=>{$&&$.split(" ").forEach(q=>f.off(q,W)),Z&&Z.split(" ").forEach(q=>f.store.off(q,W))}},[f,v]),R=N.useRef(),D=N.useCallback(()=>{if(!f)return t3;const P=!!(f.isInitialized||f.initializedStoreOnce)&&d.every(k=>IR(k,f,v)),$=r.lng||f.language,Z=w.current,W=R.current;if(W&&W.ready===P&&W.lng===$&&W.keyPrefix===u&&W.revision===Z)return W;const Y={t:f.getFixedT($,v.nsMode==="fallback"?d:d[0],u),ready:P,lng:$,keyPrefix:u,revision:Z};return R.current=Y,Y},[f,d,u,v,r.lng]),[m,g]=N.useState(0),{t:_,ready:y}=kb.useSyncExternalStore(C,D,D);N.useEffect(()=>{if(f&&!y&&!l){const P=()=>g($=>$+1);r.lng?N0(f,r.lng,d,P):Wf(f,d,P)}},[f,r.lng,d,y,l,m]);const E=f||{},T=N.useRef(null),A=N.useRef(),O=P=>{const $=Object.getOwnPropertyDescriptors(P);$.__original&&delete $.__original;const Z=Object.create(Object.getPrototypeOf(P),$);if(!Object.prototype.hasOwnProperty.call(Z,"__original"))try{Object.defineProperty(Z,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return Z},x=N.useMemo(()=>{const P=E,$=P==null?void 0:P.language;let Z=P;P&&(T.current&&T.current.__original===P?A.current!==$?(Z=O(P),T.current=Z,A.current=$):Z=T.current:(Z=O(P),T.current=Z,A.current=$));const W=[_,Z,y];return W.t=_,W.i18n=Z,W.ready=y,W},[_,E,y,E.resolvedLanguage,E.language,E.languages]);if(f&&l&&!y)throw new Promise(P=>{const $=()=>P();r.lng?N0(f,r.lng,d,$):Wf(f,d,$)});return x},r3={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{deviceManagement:"Device Management",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input"},device:{title:"Device Management",addDevice:"Add Device",addFirstDevice:"Add First Device",editDevice:"Edit Device",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnected:"Disconnected",connecting:"Connecting...",deleteConfirm:"Delete this device?",deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableTelegramBellPush:"Enable Telegram Bell Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries"},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
|
|
225
|
+
Site: {{siteName}}
|
|
226
|
+
Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
|
|
227
|
+
Bot: {{botName}}
|
|
228
|
+
Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and supports -CC mode.",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be en_US or zh_CN",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device"},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击“分享”,再选择“添加到主屏幕”。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击“分享”,再选择“添加到主屏幕”。"},nav:{deviceManagement:"设备管理",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入"},device:{title:"设备管理",addDevice:"添加设备",addFirstDevice:"添加第一个设备",editDevice:"修改设备",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnected:"已断开",connecting:"连接中...",deleteConfirm:"删除此设备?",deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数"},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
|
|
229
|
+
站点:{{siteName}}
|
|
230
|
+
时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
|
|
231
|
+
Bot:{{botName}}
|
|
232
|
+
时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux 且支持 -CC",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是 en_US 或 zh_CN",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备"},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址"}}}},Gf="en_US";function Bb(i){return i.replace("_","-")}const P0=i=>{let r;const s=new Set,a=(h,b)=>{const d=typeof h=="function"?h(r):h;if(!Object.is(d,r)){const w=r;r=b??(typeof d!="object"||d===null)?d:Object.assign({},r,d),s.forEach(C=>C(r,w))}},c=()=>r,l={setState:a,getState:c,getInitialState:()=>u,subscribe:h=>(s.add(h),()=>s.delete(h))},u=r=i(a,c,l);return l},n3=(i=>i?P0(i):P0),s3=i=>i;function a3(i,r=s3){const s=Te.useSyncExternalStore(i.subscribe,Te.useCallback(()=>r(i.getState()),[i,r]),Te.useCallback(()=>r(i.getInitialState()),[i,r]));return Te.useDebugValue(s),s}const z0=i=>{const r=n3(i),s=a=>a3(r,a);return Object.assign(s,r),s},Am=(i=>i?z0(i):z0),I0={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,enableBrowserBellToast:!0,enableTelegramBellPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Gf,updatedAt:new Date(0).toISOString()};async function U0(){const i=await fetch("/api/settings/site");if(!i.ok)throw new Error("Failed to load site settings");return(await i.json()).settings}const Tn=Am((i,r)=>({settings:null,loading:!1,fetchSettings:async()=>{const s=r().settings;if(s)return s;i({loading:!0});try{const a=await U0();return i({settings:a,loading:!1}),a}catch(a){return console.error("[site] failed to fetch settings:",a),i({settings:I0,loading:!1}),I0}},refreshSettings:async()=>{i({loading:!0});try{const s=await U0();return i({settings:s,loading:!1}),s}catch(s){throw console.error("[site] failed to refresh settings:",s),i({loading:!1}),s}}}));let ki=null;const ou=[],Bs=[],vu=[],o3=100,l3=500,Xf=new Map,c3=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function Nb(i){const r=Date.now(),s=Xf.get(i);return s!==void 0&&r-s<l3?!0:(Xf.set(i,r),!1)}function u3(i){if(i.length<4||i[0]!==1)return null;const r=i[1]<<8|i[2];if(i.length<3+r+2)return null;const s=new TextDecoder().decode(i.slice(3,3+r)),a=3+r,c=i[a]<<8|i[a+1],f=a+2;if(i.length<f+c)return null;const v=new TextDecoder().decode(i.slice(f,f+c)),l=i.slice(f+c);return{deviceId:s,paneId:v,output:l}}function h3(){const i=new Set;if(!ki||ki.readyState!==WebSocket.OPEN)return i;for(;vu.length>0;){const r=vu.shift();if(r){if(r.type==="device/connect"){const s=r.payload;s!=null&&s.deviceId&&i.add(s.deviceId)}ki.send(JSON.stringify({...r,timestamp:new Date().toISOString()}))}}return i}function mr(i){if(!ki||ki.readyState!==WebSocket.OPEN){vu.length<o3&&vu.push(i);return}ki.send(JSON.stringify({...i,timestamp:new Date().toISOString()}))}function ff(i,r){if(ki&&(ki.readyState===WebSocket.OPEN||ki.readyState===WebSocket.CONNECTING))return;const s=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;ki=new WebSocket(s),ki.onopen=()=>{i({socketReady:!0});const a=h3();for(const c of r().connectedDevices)a.has(c)||Nb(c)||mr({type:"device/connect",payload:{deviceId:c}})},ki.onmessage=async a=>{if(a.data instanceof Blob){const f=await a.data.arrayBuffer(),v=new Uint8Array(f),l=u3(v);if(!l)return;const u=r().selectedPanes;for(const h of ou){if(l.deviceId!==h.deviceId)continue;const b=u[h.deviceId];b&&l.paneId===b.paneId&&h.handler(l.output)}return}let c=null;try{c=JSON.parse(a.data)}catch{return}if(c)switch(c.type){case"device/connected":{const f=c.payload.deviceId;i(v=>({deviceConnected:{...v.deviceConnected,[f]:!0},deviceErrors:{...v.deviceErrors,[f]:void 0}}));return}case"device/disconnected":{const f=c.payload.deviceId;i(v=>({deviceConnected:{...v.deviceConnected,[f]:!1}}));return}case"event/device":{const f=c.payload;if(f.type==="error"){const v=f.message??"Device Error";i(l=>{const u=l.deviceErrors[f.deviceId];return(u==null?void 0:u.message)===v&&(u==null?void 0:u.type)===f.errorType?{}:{deviceErrors:{...l.deviceErrors,[f.deviceId]:{message:v,type:f.errorType}}}});return}if(f.type==="disconnected"){i(v=>({deviceConnected:{...v.deviceConnected,[f.deviceId]:!1}}));return}return}case"state/snapshot":{const f=c.payload;i(v=>({snapshots:{...v.snapshots,[f.deviceId]:f}}));return}case"term/history":{const f=c.payload;for(const v of Bs)v.deviceId===f.deviceId&&v.paneId===f.paneId&&v.handler(f.data);return}case"event/tmux":{const f=c.payload;if(f.type==="bell"){const v=Tn.getState().settings;if((v==null?void 0:v.enableBrowserBellToast)===!1)return;const l=f.data??{},u="Terminal Bell",h=[typeof l.windowIndex=="number"?`Window ${l.windowIndex}`:void 0,typeof l.paneIndex=="number"?`Pane ${l.paneIndex}`:void 0].filter(Boolean).join(" · ");window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:u,description:h||"Received tmux bell",paneUrl:typeof l.paneUrl=="string"?l.paneUrl:void 0}}))}return}}},ki.onclose=()=>{i(a=>{const c={...a.deviceConnected};for(const f of a.connectedDevices)c[f]=!1;return{socketReady:!1,deviceConnected:c}}),ki=null},ki.onerror=a=>{console.error("[tmux] WebSocket error:",a),i({socketReady:!1}),window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:"WebSocket Connection Error",description:"Please check Gateway status"}}))}}const qt=Am((i,r)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},selectedPanes:{},connectionRefs:{},lastConnectRequest:null,ensureSocketConnected:()=>{ff(i,r)},connectDevice:(s,a="page")=>{const c=r(),f=c.connectionRefs[s]??{};if(f[a]){ff(i,r);return}const v=Object.keys(f).length===0,l={...f,[a]:!0},u={...c.connectionRefs,[s]:l},h=new Set(c.connectedDevices);if(h.add(s),i(b=>({connectionRefs:u,connectedDevices:h,deviceErrors:{...b.deviceErrors,[s]:void 0},lastConnectRequest:{deviceId:s,ref:a,at:Date.now()}})),c3&&console.log("[tmux] connectDevice",{deviceId:s,ref:a,isFirstReference:v}),ff(i,r),v){if(Nb(s))return;mr({type:"device/connect",payload:{deviceId:s}})}},disconnectDevice:(s,a="page")=>{const c=r(),f=c.connectionRefs[s];if(!(f!=null&&f[a]))return;const v={...f};delete v[a];const l={...c.connectionRefs};if(Object.keys(v).length>0){l[s]=v,i({connectionRefs:l});return}delete l[s];const h=new Set(c.connectedDevices);h.delete(s),i(b=>({connectedDevices:h,connectionRefs:l,selectedPanes:{...b.selectedPanes,[s]:void 0},deviceConnected:{...b.deviceConnected,[s]:!1}})),Xf.delete(s),mr({type:"device/disconnect",payload:{deviceId:s}})},clearDeviceError:s=>{i(a=>({deviceErrors:{...a.deviceErrors,[s]:void 0}}))},selectPane:(s,a,c)=>{i(f=>({selectedPanes:{...f.selectedPanes,[s]:{windowId:a,paneId:c}}})),mr({type:"tmux/select",payload:{deviceId:s,windowId:a,paneId:c}})},selectWindow:(s,a)=>{mr({type:"tmux/select-window",payload:{deviceId:s,windowId:a}})},sendInput:(s,a,c,f)=>{mr({type:"term/input",payload:{deviceId:s,paneId:a,data:c,isComposing:f}})},resizePane:(s,a,c,f)=>{mr({type:"term/resize",payload:{deviceId:s,paneId:a,cols:c,rows:f}})},syncPaneSize:(s,a,c,f)=>{mr({type:"term/sync-size",payload:{deviceId:s,paneId:a,cols:c,rows:f}})},paste:(s,a,c)=>{mr({type:"term/paste",payload:{deviceId:s,paneId:a,data:c}})},createWindow:(s,a)=>{mr({type:"tmux/create-window",payload:{deviceId:s,name:a}})},closeWindow:(s,a)=>{mr({type:"tmux/close-window",payload:{deviceId:s,windowId:a}})},closePane:(s,a)=>{mr({type:"tmux/close-pane",payload:{deviceId:s,paneId:a}})},subscribeBinary:(s,a)=>{const c={deviceId:s,handler:a};return ou.push(c),()=>{const f=ou.indexOf(c);f>=0&&ou.splice(f,1)}},subscribeHistory:(s,a,c)=>{const f={deviceId:s,paneId:a,handler:c,subscribedAt:Date.now()};Bs.push(f);const v=Date.now()-600*1e3;for(let l=Bs.length-1;l>=0;l--)Bs[l].subscribedAt<v&&Bs.splice(l,1);return()=>{const l=Bs.indexOf(f);l>=0&&Bs.splice(l,1)}}}));function d3(i,r){let s;try{s=i()}catch{return}return{getItem:c=>{var f;const v=u=>u===null?null:JSON.parse(u,void 0),l=(f=s.getItem(c))!=null?f:null;return l instanceof Promise?l.then(v):v(l)},setItem:(c,f)=>s.setItem(c,JSON.stringify(f,void 0)),removeItem:c=>s.removeItem(c)}}const Qf=i=>r=>{try{const s=i(r);return s instanceof Promise?s:{then(a){return Qf(a)(s)},catch(a){return this}}}catch(s){return{then(a){return this},catch(a){return Qf(a)(s)}}}},f3=(i,r)=>(s,a,c)=>{let f={storage:d3(()=>window.localStorage),partialize:m=>m,version:0,merge:(m,g)=>({...g,...m}),...r},v=!1,l=0;const u=new Set,h=new Set;let b=f.storage;if(!b)return i((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${f.name}', the given storage is currently unavailable.`),s(...m)},a,c);const d=()=>{const m=f.partialize({...a()});return b.setItem(f.name,{state:m,version:f.version})},w=c.setState;c.setState=(m,g)=>(w(m,g),d());const C=i((...m)=>(s(...m),d()),a,c);c.getInitialState=()=>C;let R;const D=()=>{var m,g;if(!b)return;const _=++l;v=!1,u.forEach(E=>{var T;return E((T=a())!=null?T:C)});const y=((g=f.onRehydrateStorage)==null?void 0:g.call(f,(m=a())!=null?m:C))||void 0;return Qf(b.getItem.bind(b))(f.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==f.version){if(f.migrate){const T=f.migrate(E.state,E.version);return T instanceof Promise?T.then(A=>[!0,A]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var T;if(_!==l)return;const[A,O]=E;if(R=f.merge(O,(T=a())!=null?T:C),s(R,!0),A)return d()}).then(()=>{_===l&&(y==null||y(R,void 0),R=a(),v=!0,h.forEach(E=>E(R)))}).catch(E=>{_===l&&(y==null||y(void 0,E))})};return c.persist={setOptions:m=>{f={...f,...m},m.storage&&(b=m.storage)},clearStorage:()=>{b==null||b.removeItem(f.name)},getOptions:()=>f,rehydrate:()=>D(),hasHydrated:()=>v,onHydrate:m=>(u.add(m),()=>{u.delete(m)}),onFinishHydration:m=>(h.add(m),()=>{h.delete(m)})},f.skipHydration||D(),R||C},m3=f3,Ur=Am()(m3(i=>({sidebarCollapsed:!1,inputMode:"direct",editorSendWithEnter:!0,editorHistory:[],editorDrafts:{},setSidebarCollapsed:r=>i({sidebarCollapsed:r}),setInputMode:r=>i({inputMode:r}),setEditorSendWithEnter:r=>i({editorSendWithEnter:r}),addEditorHistory:r=>i(s=>({editorHistory:[r,...s.editorHistory.slice(0,49)]})),setEditorDraft:(r,s)=>i(a=>({editorDrafts:{...a.editorDrafts,[r]:s}})),removeEditorDraft:r=>i(s=>{if(!(r in s.editorDrafts))return s;const a={...s.editorDrafts};return delete a[r],{editorDrafts:a}})}),{name:"tmex-ui",partialize:i=>({sidebarCollapsed:i.sidebarCollapsed,inputMode:i.inputMode,editorSendWithEnter:i.editorSendWithEnter,editorHistory:i.editorHistory,editorDrafts:i.editorDrafts})}));function Lm(i){if(!i)return i;let r=i;for(let s=0;s<2;s++){if(!/%25/i.test(r))return r;try{r=decodeURIComponent(r)}catch{return r}}return r}function jb(i){return encodeURIComponent(i)}const xt=N.forwardRef(({className:i="",variant:r="default",size:s="default",asChild:a,children:c,...f},v)=>{const l="inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",u={default:"bg-[var(--color-bg-tertiary)] text-[var(--color-text)] border border-[var(--color-border)] hover:bg-[var(--color-border)]",primary:"bg-[var(--color-accent)] text-white border border-[var(--color-accent)] hover:bg-[var(--color-accent-hover)]",danger:"bg-[var(--color-danger)] text-white border border-[var(--color-danger)] hover:opacity-90",ghost:"hover:bg-[var(--color-bg-tertiary)] text-[var(--color-text)]"},h={default:"h-9 px-4 py-2 text-sm",sm:"h-8 px-3 py-1 text-xs",lg:"h-10 px-6 py-2 text-base"};if(a&&N.isValidElement(c)){const b=c;return N.cloneElement(b,{...f,className:`${l} ${u[r]} ${h[s]} ${i} ${b.props.className||""}`,ref:v})}return H.jsx("button",{ref:v,className:`${l} ${u[r]} ${h[s]} ${i}`,...f,children:c})});xt.displayName="Button";const Ri=N.forwardRef(({className:i="",...r},s)=>H.jsx("input",{ref:s,className:`flex h-9 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1 text-sm text-[var(--color-text)] shadow-sm transition-colors placeholder:text-[var(--color-text-muted)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent)] disabled:cursor-not-allowed disabled:opacity-50 ${i}`,...r}));Ri.displayName="Input";const Hb=N.forwardRef(({className:i="",...r},s)=>H.jsx("textarea",{ref:s,className:`flex min-h-[80px] w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] shadow-sm transition-colors placeholder:text-[var(--color-text-muted)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent)] disabled:cursor-not-allowed disabled:opacity-50 resize-y ${i}`,...r}));Hb.displayName="Textarea";const _u=N.forwardRef(({className:i="",children:r,...s},a)=>H.jsxs("div",{className:"relative",children:[H.jsx("select",{ref:a,className:`flex h-9 w-full appearance-none rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-1 pr-8 text-sm text-[var(--color-text)] shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-accent)] disabled:cursor-not-allowed disabled:opacity-50 ${i}`,...s,children:r}),H.jsx(Rm,{className:"absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--color-text-muted)] pointer-events-none"})]}));_u.displayName="Select";const Zn=({children:i,...r})=>H.jsx("option",{...r,children:i});function Al(i,...r){const s=new URL(`https://base-ui.com/production-error/${i}`);return r.forEach(a=>s.searchParams.append("args[]",a)),`Base UI error #${i}; visit ${s} for the full message.`}const Pb=N.createContext(void 0);function so(i){const r=N.useContext(Pb);if(i===!1&&r===void 0)throw new Error(Al(27));return r}const F0={};function ms(i,r){const s=N.useRef(F0);return s.current===F0&&(s.current=i(r)),s}function yu(i,r,s,a){const c=ms(zb).current;return g3(c,i,r,s,a)&&Ib(c,[i,r,s,a]),c.callback}function p3(i){const r=ms(zb).current;return v3(r,i)&&Ib(r,i),r.callback}function zb(){return{callback:null,cleanup:null,refs:[]}}function g3(i,r,s,a,c){return i.refs[0]!==r||i.refs[1]!==s||i.refs[2]!==a||i.refs[3]!==c}function v3(i,r){return i.refs.length!==r.length||i.refs.some((s,a)=>s!==r[a])}function Ib(i,r){if(i.refs=r,r.every(s=>s==null)){i.callback=null;return}i.callback=s=>{if(i.cleanup&&(i.cleanup(),i.cleanup=null),s!=null){const a=Array(r.length).fill(null);for(let c=0;c<r.length;c+=1){const f=r[c];if(f!=null)switch(typeof f){case"function":{const v=f(s);typeof v=="function"&&(a[c]=v);break}case"object":{f.current=s;break}}}i.cleanup=()=>{for(let c=0;c<r.length;c+=1){const f=r[c];if(f!=null)switch(typeof f){case"function":{const v=a[c];typeof v=="function"?v():f(null);break}case"object":{f.current=null;break}}}}}}}const _3=parseInt(N.version,10);function Mm(i){return _3>=i}function q0(i){if(!N.isValidElement(i))return null;const r=i,s=r.props;return(Mm(19)?s==null?void 0:s.ref:r.ref)??null}function Zf(i,r){if(i&&!r)return i;if(!i&&r)return r;if(i||r)return{...i,...r}}function y3(i,r){const s={};for(const a in i){const c=i[a];if(r!=null&&r.hasOwnProperty(a)){const f=r[a](c);f!=null&&Object.assign(s,f);continue}c===!0?s[`data-${a.toLowerCase()}`]="":c&&(s[`data-${a.toLowerCase()}`]=c.toString())}return s}function b3(i,r){return typeof i=="function"?i(r):i}function S3(i,r){return typeof i=="function"?i(r):i}const ul={};function Ub(i,r,s,a,c){let f={...Jf(i,ul)};return r&&(f=lu(f,r)),s&&(f=lu(f,s)),a&&(f=lu(f,a)),f}function w3(i){if(i.length===0)return ul;if(i.length===1)return Jf(i[0],ul);let r={...Jf(i[0],ul)};for(let s=1;s<i.length;s+=1)r=lu(r,i[s]);return r}function lu(i,r){return Fb(r)?r(i):C3(i,r)}function C3(i,r){if(!r)return i;for(const s in r){const a=r[s];switch(s){case"style":{i[s]=Zf(i.style,a);break}case"className":{i[s]=qb(i.className,a);break}default:E3(s,a)?i[s]=x3(i[s],a):i[s]=a}}return i}function E3(i,r){const s=i.charCodeAt(0),a=i.charCodeAt(1),c=i.charCodeAt(2);return s===111&&a===110&&c>=65&&c<=90&&(typeof r=="function"||typeof r>"u")}function Fb(i){return typeof i=="function"}function Jf(i,r){return Fb(i)?i(r):i??ul}function x3(i,r){return r?i?s=>{if(R3(s)){const c=s;em(c);const f=r(c);return c.baseUIHandlerPrevented||i==null||i(c),f}const a=r(s);return i==null||i(s),a}:r:i}function em(i){return i.preventBaseUIHandler=()=>{i.baseUIHandlerPrevented=!0},i}function qb(i,r){return r?i?r+" "+i:r:i}function R3(i){return i!=null&&typeof i=="object"&&"nativeEvent"in i}function $b(){}const yr=Object.freeze({}),T3="data-base-ui-click-trigger",D3={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ll(i,r,s={}){const a=r.render,c=O3(r,s);if(s.enabled===!1)return null;const f=s.state??yr;return A3(i,a,c,f)}function O3(i,r={}){const{className:s,style:a,render:c}=i,{state:f=yr,ref:v,props:l,stateAttributesMapping:u,enabled:h=!0}=r,b=h?b3(s,f):void 0,d=h?S3(a,f):void 0,w=h?y3(f,u):yr,C=h?Zf(w,Array.isArray(l)?w3(l):l)??yr:yr;return typeof document<"u"&&(h?Array.isArray(v)?C.ref=p3([C.ref,q0(c),...v]):C.ref=yu(C.ref,q0(c),v):yu(null,null)),h?(b!==void 0&&(C.className=qb(C.className,b)),d!==void 0&&(C.style=Zf(C.style,d)),C):yr}function A3(i,r,s,a){if(r){if(typeof r=="function")return r(s,a);const c=Ub(s,r.props);return c.ref=s.ref,N.cloneElement(r,c)}if(i&&typeof i=="string")return L3(i,s);throw new Error(Al(8))}function L3(i,r){return i==="button"?N.createElement("button",{type:"button",...r,key:r.key}):i==="img"?N.createElement("img",{alt:"",...r,key:r.key}):N.createElement(i,r)}let bu=(function(i){return i.startingStyle="data-starting-style",i.endingStyle="data-ending-style",i})({});const M3={[bu.startingStyle]:""},k3={[bu.endingStyle]:""},Kb={transitionStatus(i){return i==="starting"?M3:i==="ending"?k3:null}};let zs=(function(i){return i.open="data-open",i.closed="data-closed",i[i.startingStyle=bu.startingStyle]="startingStyle",i[i.endingStyle=bu.endingStyle]="endingStyle",i.anchorHidden="data-anchor-hidden",i})({});const B3={[zs.open]:""},N3={[zs.closed]:""},j3={[zs.anchorHidden]:""},Vb={open(i){return i?B3:N3},anchorHidden(i){return i?j3:null}},H3={...Vb,...Kb},P3=N.forwardRef(function(r,s){const{render:a,className:c,forceRender:f=!1,...v}=r,{store:l}=so(),u=l.useState("open"),h=l.useState("nested"),b=l.useState("mounted"),d=l.useState("transitionStatus"),w=N.useMemo(()=>({open:u,transitionStatus:d}),[u,d]);return Ll("div",r,{state:w,ref:[l.context.backdropRef,s],stateAttributesMapping:H3,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},v],enabled:f||!h})});function ju(){return typeof window<"u"}function Hu(i){return km(i)?(i.nodeName||"").toLowerCase():"#document"}function Qr(i){var r;return(i==null||(r=i.ownerDocument)==null?void 0:r.defaultView)||window}function z3(i){var r;return(r=(km(i)?i.ownerDocument:i.document)||window.document)==null?void 0:r.documentElement}function km(i){return ju()?i instanceof Node||i instanceof Qr(i).Node:!1}function Ns(i){return ju()?i instanceof Element||i instanceof Qr(i).Element:!1}function En(i){return ju()?i instanceof HTMLElement||i instanceof Qr(i).HTMLElement:!1}function tm(i){return!ju()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof Qr(i).ShadowRoot}const I3=new Set(["inline","contents"]);function Pu(i){const{overflow:r,overflowX:s,overflowY:a,display:c}=Bm(i);return/auto|scroll|overlay|hidden|clip/.test(r+a+s)&&!I3.has(c)}function U3(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const F3=new Set(["html","body","#document"]);function cu(i){return F3.has(Hu(i))}function Bm(i){return Qr(i).getComputedStyle(i)}function Wb(i){if(Hu(i)==="html")return i;const r=i.assignedSlot||i.parentNode||tm(i)&&i.host||z3(i);return tm(r)?r.host:r}function Yb(i){const r=Wb(i);return cu(r)?i.ownerDocument?i.ownerDocument.body:i.body:En(r)&&Pu(r)?r:Yb(r)}function hl(i,r,s){var a;r===void 0&&(r=[]),s===void 0&&(s=!0);const c=Yb(i),f=c===((a=i.ownerDocument)==null?void 0:a.body),v=Qr(c);if(f){const l=q3(v);return r.concat(v,v.visualViewport||[],Pu(c)?c:[],l&&s?hl(l):[])}return r.concat(c,hl(c,[],s))}function q3(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}const mf=fm[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],$3=mf&&mf!==N.useLayoutEffect?mf:i=>i();function Lt(i){const r=ms(K3).current;return r.next=i,$3(r.effect),r.trampoline}function K3(){const i={next:void 0,callback:V3,trampoline:(...r)=>{var s;return(s=i.callback)==null?void 0:s.call(i,...r)},effect:()=>{i.callback=i.next}};return i}function V3(){}const W3=()=>{},_i=typeof document<"u"?N.useLayoutEffect:W3,Y3=N.createContext(void 0);function G3(i=!1){const r=N.useContext(Y3);if(r===void 0&&!i)throw new Error(Al(16));return r}function X3(i){const{focusableWhenDisabled:r,disabled:s,composite:a=!1,tabIndex:c=0,isNativeButton:f}=i,v=a&&r!==!1,l=a&&r===!1;return{props:N.useMemo(()=>{const h={onKeyDown(b){s&&r&&b.key!=="Tab"&&b.preventDefault()}};return a||(h.tabIndex=c,!f&&s&&(h.tabIndex=r?c:-1)),(f&&(r||v)||!f&&s)&&(h["aria-disabled"]=s),f&&(!r||l)&&(h.disabled=s),h},[a,s,r,v,l,f,c])}}function Q3(i={}){const{disabled:r=!1,focusableWhenDisabled:s,tabIndex:a=0,native:c=!0}=i,f=N.useRef(null),v=G3(!0)!==void 0,l=Lt(()=>{const w=f.current;return!!((w==null?void 0:w.tagName)==="A"&&(w!=null&&w.href))}),{props:u}=X3({focusableWhenDisabled:s,disabled:r,composite:v,tabIndex:a,isNativeButton:c}),h=N.useCallback(()=>{const w=f.current;Z3(w)&&v&&r&&u.disabled===void 0&&w.disabled&&(w.disabled=!1)},[r,u.disabled,v]);_i(h,[h]);const b=N.useCallback((w={})=>{const{onClick:C,onMouseDown:R,onKeyUp:D,onKeyDown:m,onPointerDown:g,..._}=w;return Ub({type:c?"button":void 0,onClick(E){if(r){E.preventDefault();return}C==null||C(E)},onMouseDown(E){r||R==null||R(E)},onKeyDown(E){if(r||(em(E),m==null||m(E)),E.baseUIHandlerPrevented)return;const T=E.target===E.currentTarget&&!c&&!l()&&!r,A=E.key==="Enter",O=E.key===" ";T&&((O||A)&&E.preventDefault(),A&&(C==null||C(E)))},onKeyUp(E){r||(em(E),D==null||D(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!c&&!r&&E.key===" "&&(C==null||C(E))},onPointerDown(E){if(r){E.preventDefault();return}g==null||g(E)}},c?void 0:{role:"button"},u,_)},[r,u,c,l]),d=Lt(w=>{f.current=w,h()});return{getButtonProps:b,buttonRef:d}}function Z3(i){return En(i)&&i.tagName==="BUTTON"}const J3="none",$0="trigger-press",eT="trigger-hover",Gb="outside-press",tT="close-press",Xb="focus-out",iT="escape-key",rT="imperative-action";function xn(i,r,s,a){let c=!1,f=!1;const v=yr;return{reason:i,event:r??new Event("base-ui"),cancel(){c=!0},allowPropagation(){f=!0},get isCanceled(){return c},get isPropagationAllowed(){return f},trigger:s,...v}}const nT=N.forwardRef(function(r,s){const{render:a,className:c,disabled:f=!1,nativeButton:v=!0,...l}=r,{store:u}=so(),h=u.useState("open");function b(R){h&&u.setOpen(!1,xn(tT,R.nativeEvent))}const{getButtonProps:d,buttonRef:w}=Q3({disabled:f,native:v}),C=N.useMemo(()=>({disabled:f}),[f]);return Ll("button",r,{state:C,ref:[s,w],props:[{onClick:b},l,d]})}),sT={...fm};let K0=0;function aT(i,r="mui"){const[s,a]=N.useState(i),c=i||s;return N.useEffect(()=>{s==null&&(K0+=1,a(`${r}-${K0}`))},[s,r]),c}const V0=sT.useId;function zu(i,r){if(V0!==void 0){const s=V0();return i??(r?`${r}-${s}`:s)}return aT(i,r)}function oT(i){return zu(i,"base-ui")}const lT=[];function Qb(i){N.useEffect(i,lT)}const il=0;class to{constructor(){zt(this,"currentId",il);zt(this,"clear",()=>{this.currentId!==il&&(clearTimeout(this.currentId),this.currentId=il)});zt(this,"disposeEffect",()=>this.clear)}static create(){return new to}start(r,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=il,s()},r)}isStarted(){return this.currentId!==il}}function Su(){const i=ms(to.create).current;return Qb(i.disposeEffect),i}function al(i){const r=ms(cT,i).current;return r.next=i,_i(r.effect),r}function cT(i){const r={current:i,next:i,effect:()=>{r.current=r.next}};return r}const ao=typeof navigator<"u",pf=mT(),Zb=gT(),Jb=pT(),uT=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),hT=pf.platform==="MacIntel"&&pf.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(pf.platform),dT=ao&&/apple/i.test(navigator.vendor),im=ao&&/android/i.test(Zb)||/android/i.test(Jb);ao&&Zb.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const fT=Jb.includes("jsdom/");function mT(){if(!ao)return{platform:"",maxTouchPoints:-1};const i=navigator.userAgentData;return i!=null&&i.platform?{platform:i.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function pT(){if(!ao)return"";const i=navigator.userAgentData;return i&&Array.isArray(i.brands)?i.brands.map(({brand:r,version:s})=>`${r}/${s}`).join(" "):navigator.userAgent}function gT(){if(!ao)return"";const i=navigator.userAgentData;return i!=null&&i.platform?i.platform:navigator.platform??""}const rm="data-base-ui-focusable",e1="active",t1="selected",vT="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ha(i){var s;let r=i.activeElement;for(;((s=r==null?void 0:r.shadowRoot)==null?void 0:s.activeElement)!=null;)r=r.shadowRoot.activeElement;return r}function ui(i,r){var a;if(!i||!r)return!1;const s=(a=r.getRootNode)==null?void 0:a.call(r);if(i.contains(r))return!0;if(s&&tm(s)){let c=r;for(;c;){if(i===c)return!0;c=c.parentNode||c.host}}return!1}function Mr(i){return"composedPath"in i?i.composedPath()[0]:i.target}function Or(i,r){if(r==null)return!1;if("composedPath"in i)return i.composedPath().includes(r);const s=i;return s.target!=null&&r.contains(s.target)}function _T(i){return i.matches("html,body")}function Wi(i){return(i==null?void 0:i.ownerDocument)||document}function yT(i){return En(i)&&i.matches(vT)}function W0(i){return i?i.getAttribute("role")==="combobox"&&yT(i):!1}function nm(i){return i?i.hasAttribute(rm)?i:i.querySelector(`[${rm}]`)||i:null}function Ia(i,r,s=!0){return i.filter(c=>{var f;return c.parentId===r&&(!s||((f=c.context)==null?void 0:f.open))}).flatMap(c=>[c,...Ia(i,c.id,s)])}function Y0(i,r){var c;let s=[],a=(c=i.find(f=>f.id===r))==null?void 0:c.parentId;for(;a;){const f=i.find(v=>v.id===a);a=f==null?void 0:f.parentId,f&&(s=s.concat(f))}return s}function bT(i){i.preventDefault(),i.stopPropagation()}function ST(i){return"nativeEvent"in i}function wT(i){return i.mozInputSource===0&&i.isTrusted?!0:im&&i.pointerType?i.type==="click"&&i.buttons===1:i.detail===0&&!i.pointerType}function CT(i){return fT?!1:!im&&i.width===0&&i.height===0||im&&i.width===1&&i.height===1&&i.pressure===0&&i.detail===0&&i.pointerType==="mouse"||i.width<1&&i.height<1&&i.pressure===0&&i.detail===0&&i.pointerType==="touch"}function ET(i){const r=i.type;return r==="click"||r==="mousedown"||r==="keydown"||r==="keyup"}/*!
|
|
233
|
+
* tabbable 6.4.0
|
|
234
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
235
|
+
*/var xT=["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] *)"],wu=xT.join(","),i1=typeof Element>"u",io=i1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cu=!i1&&Element.prototype.getRootNode?function(i){var r;return i==null||(r=i.getRootNode)===null||r===void 0?void 0:r.call(i)}:function(i){return i==null?void 0:i.ownerDocument},Eu=function(r,s){var a;s===void 0&&(s=!0);var c=r==null||(a=r.getAttribute)===null||a===void 0?void 0:a.call(r,"inert"),f=c===""||c==="true",v=f||s&&r&&(typeof r.closest=="function"?r.closest("[inert]"):Eu(r.parentNode));return v},RT=function(r){var s,a=r==null||(s=r.getAttribute)===null||s===void 0?void 0:s.call(r,"contenteditable");return a===""||a==="true"},r1=function(r,s,a){if(Eu(r))return[];var c=Array.prototype.slice.apply(r.querySelectorAll(wu));return s&&io.call(r,wu)&&c.unshift(r),c=c.filter(a),c},xu=function(r,s,a){for(var c=[],f=Array.from(r);f.length;){var v=f.shift();if(!Eu(v,!1))if(v.tagName==="SLOT"){var l=v.assignedElements(),u=l.length?l:v.children,h=xu(u,!0,a);a.flatten?c.push.apply(c,h):c.push({scopeParent:v,candidates:h})}else{var b=io.call(v,wu);b&&a.filter(v)&&(s||!r.includes(v))&&c.push(v);var d=v.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(v),w=!Eu(d,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(v));if(d&&w){var C=xu(d===!0?v.children:d.children,!0,a);a.flatten?c.push.apply(c,C):c.push({scopeParent:v,candidates:C})}else f.unshift.apply(f,v.children)}}return c},n1=function(r){return!isNaN(parseInt(r.getAttribute("tabindex"),10))},s1=function(r){if(!r)throw new Error("No node provided");return r.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(r.tagName)||RT(r))&&!n1(r)?0:r.tabIndex},TT=function(r,s){var a=s1(r);return a<0&&s&&!n1(r)?0:a},DT=function(r,s){return r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex},a1=function(r){return r.tagName==="INPUT"},OT=function(r){return a1(r)&&r.type==="hidden"},AT=function(r){var s=r.tagName==="DETAILS"&&Array.prototype.slice.apply(r.children).some(function(a){return a.tagName==="SUMMARY"});return s},LT=function(r,s){for(var a=0;a<r.length;a++)if(r[a].checked&&r[a].form===s)return r[a]},MT=function(r){if(!r.name)return!0;var s=r.form||Cu(r),a=function(l){return s.querySelectorAll('input[type="radio"][name="'+l+'"]')},c;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")c=a(window.CSS.escape(r.name));else try{c=a(r.name)}catch(v){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",v.message),!1}var f=LT(c,r.form);return!f||f===r},kT=function(r){return a1(r)&&r.type==="radio"},BT=function(r){return kT(r)&&!MT(r)},NT=function(r){var s,a=r&&Cu(r),c=(s=a)===null||s===void 0?void 0:s.host,f=!1;if(a&&a!==r){var v,l,u;for(f=!!((v=c)!==null&&v!==void 0&&(l=v.ownerDocument)!==null&&l!==void 0&&l.contains(c)||r!=null&&(u=r.ownerDocument)!==null&&u!==void 0&&u.contains(r));!f&&c;){var h,b,d;a=Cu(c),c=(h=a)===null||h===void 0?void 0:h.host,f=!!((b=c)!==null&&b!==void 0&&(d=b.ownerDocument)!==null&&d!==void 0&&d.contains(c))}}return f},G0=function(r){var s=r.getBoundingClientRect(),a=s.width,c=s.height;return a===0&&c===0},jT=function(r,s){var a=s.displayCheck,c=s.getShadowRoot;if(a==="full-native"&&"checkVisibility"in r){var f=r.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!f}if(getComputedStyle(r).visibility==="hidden")return!0;var v=io.call(r,"details>summary:first-of-type"),l=v?r.parentElement:r;if(io.call(l,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof c=="function"){for(var u=r;r;){var h=r.parentElement,b=Cu(r);if(h&&!h.shadowRoot&&c(h)===!0)return G0(r);r.assignedSlot?r=r.assignedSlot:!h&&b!==r.ownerDocument?r=b.host:r=h}r=u}if(NT(r))return!r.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return G0(r);return!1},HT=function(r){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(r.tagName))for(var s=r.parentElement;s;){if(s.tagName==="FIELDSET"&&s.disabled){for(var a=0;a<s.children.length;a++){var c=s.children.item(a);if(c.tagName==="LEGEND")return io.call(s,"fieldset[disabled] *")?!0:!c.contains(r)}return!0}s=s.parentElement}return!1},sm=function(r,s){return!(s.disabled||OT(s)||jT(s,r)||AT(s)||HT(s))},am=function(r,s){return!(BT(s)||s1(s)<0||!sm(r,s))},PT=function(r){var s=parseInt(r.getAttribute("tabindex"),10);return!!(isNaN(s)||s>=0)},o1=function(r){var s=[],a=[];return r.forEach(function(c,f){var v=!!c.scopeParent,l=v?c.scopeParent:c,u=TT(l,v),h=v?o1(c.candidates):l;u===0?v?s.push.apply(s,h):s.push(l):a.push({documentOrder:f,tabIndex:u,item:c,isScope:v,content:h})}),a.sort(DT).reduce(function(c,f){return f.isScope?c.push.apply(c,f.content):c.push(f.content),c},[]).concat(s)},Iu=function(r,s){s=s||{};var a;return s.getShadowRoot?a=xu([r],s.includeContainer,{filter:am.bind(null,s),flatten:!1,getShadowRoot:s.getShadowRoot,shadowRootFilter:PT}):a=r1(r,s.includeContainer,am.bind(null,s)),o1(a)},zT=function(r,s){s=s||{};var a;return s.getShadowRoot?a=xu([r],s.includeContainer,{filter:sm.bind(null,s),flatten:!0,getShadowRoot:s.getShadowRoot}):a=r1(r,s.includeContainer,sm.bind(null,s)),a},l1=function(r,s){if(s=s||{},!r)throw new Error("No node provided");return io.call(r,wu)===!1?!1:am(s,r)};const Ml=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function c1(i,r){const s=Iu(i,Ml()),a=s.length;if(a===0)return;const c=Ha(Wi(i)),f=s.indexOf(c),v=f===-1?r===1?0:a-1:f+r;return s[v]}function u1(i){return c1(Wi(i).body,1)||i}function h1(i){return c1(Wi(i).body,-1)||i}function dl(i,r){const s=r||i.currentTarget,a=i.relatedTarget;return!a||!ui(s,a)}function IT(i){Iu(i,Ml()).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function X0(i){i.querySelectorAll("[data-tabindex]").forEach(s=>{const a=s.dataset.tabindex;delete s.dataset.tabindex,a?s.setAttribute("tabindex",a):s.removeAttribute("tabindex")})}function UT(){const i=new Map;return{emit(r,s){var a;(a=i.get(r))==null||a.forEach(c=>c(s))},on(r,s){i.has(r)||i.set(r,new Set),i.get(r).add(s)},off(r,s){var a;(a=i.get(r))==null||a.delete(s)}}}const FT=N.createContext(null),qT=N.createContext(null),d1=()=>{var i;return((i=N.useContext(FT))==null?void 0:i.id)||null},f1=i=>{const r=N.useContext(qT);return i??r};function Ru(i){return`data-base-ui-${i}`}const m1={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Qc=null;class $T{constructor(){zt(this,"callbacks",[]);zt(this,"callbacksCount",0);zt(this,"nextId",1);zt(this,"startId",1);zt(this,"isScheduled",!1);zt(this,"tick",r=>{var c;this.isScheduled=!1;const s=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let f=0;f<s.length;f+=1)(c=s[f])==null||c.call(s,r)})}request(r){const s=this.nextId;return this.nextId+=1,this.callbacks.push(r),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(r){const s=r-this.startId;s<0||s>=this.callbacks.length||(this.callbacks[s]=null,this.callbacksCount-=1)}}const Zc=new $T;class Kr{constructor(){zt(this,"currentId",Qc);zt(this,"cancel",()=>{this.currentId!==Qc&&(Zc.cancel(this.currentId),this.currentId=Qc)});zt(this,"disposeEffect",()=>this.cancel)}static create(){return new Kr}static request(r){return Zc.request(r)}static cancel(r){return Zc.cancel(r)}request(r){this.cancel(),this.currentId=Zc.request(()=>{this.currentId=Qc,r()})}}function p1(){const i=ms(Kr.create).current;return Qb(i.disposeEffect),i}function Uu(i){return(i==null?void 0:i.ownerDocument)||document}const Tu=N.forwardRef(function(r,s){const[a,c]=N.useState();_i(()=>{dT&&c("button")},[]);const f={tabIndex:0,role:a};return H.jsx("span",{...r,ref:s,style:m1,"aria-hidden":a?void 0:!0,...f,"data-base-ui-focus-guard":""})});let Q0=0;function gf(i,r={}){const{preventScroll:s=!1,cancelPrevious:a=!0,sync:c=!1}=r;a&&cancelAnimationFrame(Q0);const f=()=>i==null?void 0:i.focus({preventScroll:s});c?f():Q0=requestAnimationFrame(f)}const Ua={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Z0(i){return i==="inert"?Ua.inert:i==="aria-hidden"?Ua["aria-hidden"]:Ua.none}let Jc=new WeakSet,eu={},vf=0;const g1=i=>i&&(i.host||g1(i.parentNode)),KT=(i,r)=>r.map(s=>{if(i.contains(s))return s;const a=g1(s);return i.contains(a)?a:null}).filter(s=>s!=null);function VT(i,r,s,a){const c="data-base-ui-inert",f=a?"inert":s?"aria-hidden":null,v=KT(r,i),l=new Set,u=new Set(v),h=[];eu[c]||(eu[c]=new WeakMap);const b=eu[c];v.forEach(d),w(r),l.clear();function d(C){!C||l.has(C)||(l.add(C),C.parentNode&&d(C.parentNode))}function w(C){!C||u.has(C)||[].forEach.call(C.children,R=>{if(Hu(R)!=="script")if(l.has(R))w(R);else{const D=f?R.getAttribute(f):null,m=D!==null&&D!=="false",g=Z0(f),_=(g.get(R)||0)+1,y=(b.get(R)||0)+1;g.set(R,_),b.set(R,y),h.push(R),_===1&&m&&Jc.add(R),y===1&&R.setAttribute(c,""),!m&&f&&R.setAttribute(f,f==="inert"?"":"true")}})}return vf+=1,()=>{h.forEach(C=>{const R=Z0(f),m=(R.get(C)||0)-1,g=(b.get(C)||0)-1;R.set(C,m),b.set(C,g),m||(!Jc.has(C)&&f&&C.removeAttribute(f),Jc.delete(C)),g||C.removeAttribute(c)}),vf-=1,vf||(Ua.inert=new WeakMap,Ua["aria-hidden"]=new WeakMap,Ua.none=new WeakMap,Jc=new WeakSet,eu={})}}function WT(i,r=!1,s=!1){const a=Wi(i[0]).body;return VT(i.concat(Array.from(a.querySelectorAll("[aria-live]"))),a,r,s)}const v1=N.createContext(null),_1=()=>N.useContext(v1),YT=Ru("portal");function GT(i={}){const{ref:r,container:s,componentProps:a=yr,elementProps:c,elementState:f}=i,v=zu(),l=_1(),u=l==null?void 0:l.portalNode,[h,b]=N.useState(null),[d,w]=N.useState(null),C=N.useRef(null);_i(()=>{if(s===null){C.current&&(C.current=null,w(null),b(null));return}if(v==null)return;const m=(s&&(km(s)?s:s.current))??u??document.body;if(m==null){C.current&&(C.current=null,w(null),b(null));return}C.current!==m&&(C.current=m,w(null),b(m))},[s,u,v]);const R=Ll("div",a,{ref:[r,w],state:f,props:[{id:v,[YT]:""},c]});return{portalNode:d,portalSubtree:h&&R?eo.createPortal(R,h):null}}const XT=N.forwardRef(function(r,s){const{children:a,container:c,className:f,render:v,renderGuards:l,...u}=r,{portalNode:h,portalSubtree:b}=GT({container:c,ref:s,componentProps:r,elementProps:u}),d=N.useRef(null),w=N.useRef(null),C=N.useRef(null),R=N.useRef(null),[D,m]=N.useState(null),g=D==null?void 0:D.modal,_=D==null?void 0:D.open,y=typeof l=="boolean"?l:!!D&&!D.modal&&D.open&&!!h;N.useEffect(()=>{if(!h||g)return;function T(A){h&&dl(A)&&(A.type==="focusin"?X0:IT)(h)}return h.addEventListener("focusin",T,!0),h.addEventListener("focusout",T,!0),()=>{h.removeEventListener("focusin",T,!0),h.removeEventListener("focusout",T,!0)}},[h,g]),N.useEffect(()=>{!h||_||X0(h)},[_,h]);const E=N.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:R,portalNode:h,setFocusManagerState:m}),[h]);return H.jsxs(N.Fragment,{children:[b,H.jsxs(v1.Provider,{value:E,children:[y&&h&&H.jsx(Tu,{"data-type":"outside",ref:d,onFocus:T=>{var A;if(dl(T,h))(A=C.current)==null||A.focus();else{const O=D?D.domReference:null,x=h1(O);x==null||x.focus()}}}),y&&h&&H.jsx("span",{"aria-owns":h.id,style:D3}),h&&eo.createPortal(a,h),y&&h&&H.jsx(Tu,{"data-type":"outside",ref:w,onFocus:T=>{var A;if(dl(T,h))(A=R.current)==null||A.focus();else{const O=D?D.domReference:null,x=u1(O);x==null||x.focus(),D!=null&&D.closeOnFocusOut&&(D==null||D.onOpenChange(!1,xn(Xb,T.nativeEvent)))}}})]})]})});function js(i){return i==null?i:"current"in i?i.current:i}function QT(i,r){const s=Qr(i.target);return i instanceof s.KeyboardEvent?"keyboard":i instanceof s.FocusEvent?r||"keyboard":"pointerType"in i?i.pointerType||"keyboard":"touches"in i?"touch":i instanceof s.MouseEvent?r||(i.detail===0?"keyboard":"mouse"):""}const J0=20;let hs=[];function Nm(){hs=hs.filter(i=>i.isConnected)}function ZT(i){Nm(),i&&Hu(i)!=="body"&&(hs.push(i),hs.length>J0&&(hs=hs.slice(-J0)))}function _f(){return Nm(),hs[hs.length-1]}function JT(i){if(!i)return null;const r=Ml();return l1(i,r)?i:Iu(i,r)[0]||i}function eD(i){return!i||!i.isConnected?!1:typeof i.checkVisibility=="function"?i.checkVisibility():Bm(i).display!=="none"}function ey(i,r){var v;if(!r.current.includes("floating")&&!((v=i.getAttribute("role"))!=null&&v.includes("dialog")))return;const s=Ml(),c=zT(i,s).filter(l=>{const u=l.getAttribute("data-tabindex")||"";return l1(l,s)||l.hasAttribute("data-tabindex")&&!u.startsWith("-")}),f=i.getAttribute("tabindex");r.current.includes("floating")||c.length===0?f!=="0"&&i.setAttribute("tabindex","0"):(f!=="-1"||i.hasAttribute("data-tabindex")&&i.getAttribute("data-tabindex")!=="-1")&&(i.setAttribute("tabindex","-1"),i.setAttribute("data-tabindex","-1"))}function tD(i){const{context:r,children:s,disabled:a=!1,order:c=["content"],initialFocus:f=!0,returnFocus:v=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:b="",getInsideElements:d=()=>[],nextFocusableElement:w,previousFocusableElement:C,beforeContentFocusGuardRef:R,externalTree:D}=i,m="rootStore"in r?r.rootStore:r,g=m.useState("open"),_=m.useState("domReferenceElement"),y=m.useState("floatingElement"),{events:E,dataRef:T}=m.context,A=Lt(()=>{var xe;return(xe=T.current.floatingContext)==null?void 0:xe.nodeId}),O=Lt(d),x=f===!1,L=W0(_)&&x,I=al(c),V=al(f),P=al(v),$=al(b),Z=f1(D),W=_1(),q=N.useRef(null),Y=N.useRef(null),k=N.useRef(!1),z=N.useRef(!1),K=N.useRef(!1),B=N.useRef(-1),F=N.useRef(""),X=N.useRef(""),ne=Su(),ae=Su(),pe=p1(),j=W!=null,G=nm(y),oe=Lt((xe=G)=>xe?Iu(xe,Ml()):[]),le=Lt(xe=>{const Ee=oe(xe);return I.current.map(()=>Ee).filter(Boolean).flat()});N.useEffect(()=>{if(a||!u)return;function xe(Ue){Ue.key==="Tab"&&ui(G,Ha(Wi(G)))&&oe().length===0&&!L&&bT(Ue)}const Ee=Wi(G);return Ee.addEventListener("keydown",xe),()=>{Ee.removeEventListener("keydown",xe)}},[a,_,G,u,I,L,oe,le]),N.useEffect(()=>{if(a||!y)return;function xe(Ee){const Ue=Mr(Ee),st=oe().indexOf(Ue);st!==-1&&(B.current=st)}return y.addEventListener("focusin",xe),()=>{y.removeEventListener("focusin",xe)}},[a,y,oe]),N.useEffect(()=>{if(a||!g)return;const xe=Wi(G);function Ee(){K.current=!1}function Ue(st){const qe=Mr(st),Ae=ui(y,qe)||ui(_,qe)||ui(W==null?void 0:W.portalNode,qe);K.current=!Ae,X.current=st.pointerType||"keyboard"}function Fe(){X.current="keyboard"}return xe.addEventListener("pointerdown",Ue,!0),xe.addEventListener("pointerup",Ee,!0),xe.addEventListener("pointercancel",Ee,!0),xe.addEventListener("keydown",Fe,!0),()=>{xe.removeEventListener("pointerdown",Ue,!0),xe.removeEventListener("pointerup",Ee,!0),xe.removeEventListener("pointercancel",Ee,!0),xe.removeEventListener("keydown",Fe,!0)}},[a,y,_,G,g,W]),N.useEffect(()=>{if(a||!h)return;function xe(){z.current=!0,ae.start(0,()=>{z.current=!1})}function Ee(qe){const Ae=qe.relatedTarget,Ye=qe.currentTarget,Be=Mr(qe);queueMicrotask(()=>{const at=A(),Wt=m.context.triggerElements,Zt=!(ui(_,Ae)||ui(y,Ae)||ui(Ae,y)||ui(W==null?void 0:W.portalNode,Ae)||Ae!=null&&Wt.hasElement(Ae)||Wt.hasMatchingElement(et=>ui(et,Ae))||Ae!=null&&Ae.hasAttribute(Ru("focus-guard"))||Z&&(Ia(Z.nodesRef.current,at).find(et=>{var nt,dt;return ui((nt=et.context)==null?void 0:nt.elements.floating,Ae)||ui((dt=et.context)==null?void 0:dt.elements.domReference,Ae)})||Y0(Z.nodesRef.current,at).find(et=>{var nt,dt,It;return[(nt=et.context)==null?void 0:nt.elements.floating,nm((dt=et.context)==null?void 0:dt.elements.floating)].includes(Ae)||((It=et.context)==null?void 0:It.elements.domReference)===Ae})));if(Ye===_&&G&&ey(G,I),l&&Ye!==_&&!eD(Be)&&Ha(Wi(G))===Wi(G).body){if(En(G)&&(G.focus(),l==="popup")){pe.request(()=>{G.focus()});return}const et=B.current,nt=oe(),dt=nt[et]||nt[nt.length-1]||G;En(dt)&&dt.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(L||!u)&&Ae&&Zt&&!z.current&&(L||Ae!==_f())&&(k.current=!0,m.setOpen(!1,xn(Xb,qe)))})}function Ue(){K.current||(T.current.insideReactTree=!0,ne.start(0,()=>{T.current.insideReactTree=!1}))}const Fe=En(_)?_:null,st=[];if(!(!y&&!Fe))return Fe&&(Fe.addEventListener("focusout",Ee),Fe.addEventListener("pointerdown",xe),st.push(()=>{Fe.removeEventListener("focusout",Ee),Fe.removeEventListener("pointerdown",xe)})),y&&(y.addEventListener("focusout",Ee),W&&(y.addEventListener("focusout",Ue,!0),st.push(()=>{y.removeEventListener("focusout",Ue,!0)})),st.push(()=>{y.removeEventListener("focusout",Ee)})),()=>{st.forEach(qe=>{qe()})}},[a,_,y,G,u,Z,W,m,h,l,oe,L,A,I,T,ne,ae,pe]);const me=N.useRef(null),he=N.useRef(null),Ce=yu(me,R,W==null?void 0:W.beforeInsideRef),Ve=yu(he,W==null?void 0:W.afterInsideRef);N.useEffect(()=>{var qe,Ae,Ye;if(a||!y||!g)return;const xe=Array.from(((qe=W==null?void 0:W.portalNode)==null?void 0:qe.querySelectorAll(`[${Ru("portal")}]`))||[]),Ue=(Ye=(Ae=(Z?Y0(Z.nodesRef.current,A()):[]).find(Be=>{var at;return W0(((at=Be.context)==null?void 0:at.elements.domReference)||null)}))==null?void 0:Ae.context)==null?void 0:Ye.elements.domReference,Fe=[y,Ue,...xe,...O(),q.current,Y.current,me.current,he.current,W==null?void 0:W.beforeOutsideRef.current,W==null?void 0:W.afterOutsideRef.current,js(C),js(w),L?_:null].filter(Be=>Be!=null),st=WT(Fe,u||L);return()=>{st()}},[g,a,_,y,u,I,W,L,Z,A,O,w,C]),_i(()=>{if(!g||a||!En(G))return;const xe=Wi(G),Ee=Ha(xe);queueMicrotask(()=>{const Ue=le(G),Fe=V.current,st=typeof Fe=="function"?Fe($.current||""):Fe;if(st===void 0||st===!1)return;let qe;st===!0||st===null?qe=Ue[0]||G:qe=js(st),qe=qe||Ue[0]||G,!ui(G,Ee)&&gf(qe,{preventScroll:qe===G})})},[a,g,G,x,le,V,$]),_i(()=>{if(a||!G)return;const xe=Wi(G),Ee=Ha(xe);ZT(Ee);function Ue(qe){if(qe.open||(F.current=QT(qe.nativeEvent,X.current)),qe.reason===eT&&qe.nativeEvent.type==="mouseleave"&&(k.current=!0),qe.reason===Gb)if(qe.nested)k.current=!1;else if(wT(qe.nativeEvent)||CT(qe.nativeEvent))k.current=!1;else{let Ae=!1;document.createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?k.current=!1:k.current=!0}}E.on("openchange",Ue);const Fe=xe.createElement("span");Fe.setAttribute("tabindex","-1"),Fe.setAttribute("aria-hidden","true"),Object.assign(Fe.style,m1),j&&_&&_.insertAdjacentElement("afterend",Fe);function st(){const qe=P.current;let Ae=typeof qe=="function"?qe(F.current):qe;if(Ae===void 0||Ae===!1)return null;if(Ae===null&&(Ae=!0),typeof Ae=="boolean"){const Be=_||_f();return Be&&Be.isConnected?Be:Fe}const Ye=_||_f()||Fe;return js(Ae)||Ye}return()=>{E.off("openchange",Ue);const qe=Ha(xe),Ae=ui(y,qe)||Z&&Ia(Z.nodesRef.current,A(),!1).some(Be=>{var at;return ui((at=Be.context)==null?void 0:at.elements.floating,qe)}),Ye=st();queueMicrotask(()=>{const Be=JT(Ye),at=typeof P.current!="boolean";P.current&&!k.current&&En(Be)&&(!(!at&&Be!==qe&&qe!==xe.body)||Ae)&&Be.focus({preventScroll:!0}),Fe.remove()})}},[a,y,G,P,T,E,Z,j,_,A]),N.useEffect(()=>{queueMicrotask(()=>{k.current=!1})},[a]),N.useEffect(()=>{if(a||!g)return;function xe(Ue){const Fe=Mr(Ue);Fe!=null&&Fe.closest(`[${T3}]`)&&(z.current=!0)}const Ee=Wi(G);return Ee.addEventListener("pointerdown",xe,!0),()=>{Ee.removeEventListener("pointerdown",xe,!0)}},[a,g,G]),_i(()=>{if(!a&&W)return W.setFocusManagerState({modal:u,closeOnFocusOut:h,open:g,onOpenChange:m.setOpen,domReference:_}),()=>{W.setFocusManagerState(null)}},[a,W,u,g,m,h,_]),_i(()=>{if(!(a||!G))return ey(G,I),()=>{queueMicrotask(Nm)}},[a,G,I]);const He=!a&&(u?!L:!0)&&(j||u);return H.jsxs(N.Fragment,{children:[He&&H.jsx(Tu,{"data-type":"inside",ref:Ce,onFocus:xe=>{var Ee;if(u){const Ue=le();gf(Ue[Ue.length-1])}else if(W!=null&&W.portalNode)if(k.current=!1,dl(xe,W.portalNode)){const Ue=u1(_);Ue==null||Ue.focus()}else(Ee=js(C??W.beforeOutsideRef))==null||Ee.focus()}}),s,He&&H.jsx(Tu,{"data-type":"inside",ref:Ve,onFocus:xe=>{var Ee;if(u)gf(le()[0]);else if(W!=null&&W.portalNode)if(h&&(k.current=!0),dl(xe,W.portalNode)){const Ue=h1(_);Ue==null||Ue.focus()}else(Ee=js(w??W.afterOutsideRef))==null||Ee.focus()}})]})}const iD={intentional:"onClick",sloppy:"onPointerDown"};function rD(i){return{escapeKey:typeof i=="boolean"?i:(i==null?void 0:i.escapeKey)??!1,outsidePress:typeof i=="boolean"?i:(i==null?void 0:i.outsidePress)??!0}}function nD(i,r={}){const s="rootStore"in i?i.rootStore:i,a=s.useState("open"),c=s.useState("floatingElement"),f=s.useState("referenceElement"),v=s.useState("domReferenceElement"),{onOpenChange:l,dataRef:u}=s.context,{enabled:h=!0,escapeKey:b=!0,outsidePress:d=!0,outsidePressEvent:w="sloppy",referencePress:C=!1,referencePressEvent:R="sloppy",ancestorScroll:D=!1,bubbles:m,externalTree:g}=r,_=f1(g),y=Lt(typeof d=="function"?d:()=>!1),E=typeof d=="function"?y:d,T=N.useRef(!1),{escapeKey:A,outsidePress:O}=rD(m),x=N.useRef(null),L=Su(),I=Su(),V=Lt(()=>{I.clear(),u.current.insideReactTree=!1}),P=N.useRef(!1),$=N.useRef(""),Z=Lt(me=>{$.current=me.pointerType}),W=Lt(()=>{const me=$.current,he=me==="pen"||!me?"mouse":me,Ce=typeof w=="function"?w():w;return typeof Ce=="string"?Ce:Ce[he]}),q=Lt(me=>{var xe;if(!a||!h||!b||me.key!=="Escape"||P.current)return;const he=(xe=u.current.floatingContext)==null?void 0:xe.nodeId,Ce=_?Ia(_.nodesRef.current,he):[];if(!A&&Ce.length>0){let Ee=!0;if(Ce.forEach(Ue=>{var Fe;(Fe=Ue.context)!=null&&Fe.open&&!Ue.context.dataRef.current.__escapeKeyBubbles&&(Ee=!1)}),!Ee)return}const Ve=ST(me)?me.nativeEvent:me,He=xn(iT,Ve);s.setOpen(!1,He),!A&&!He.isPropagationAllowed&&me.stopPropagation()}),Y=Lt(me=>{const he=W();return he==="intentional"&&me.type!=="click"||he==="sloppy"&&me.type==="click"}),k=Lt(()=>{u.current.insideReactTree=!0,I.start(0,V)}),z=Lt((me,he=!1)=>{var qe;if(Y(me)){V();return}if(u.current.insideReactTree){V();return}if(W()==="intentional"&&he||typeof E=="function"&&!E(me))return;const Ce=Mr(me),Ve=`[${Ru("inert")}]`,He=Wi(s.select("floatingElement")).querySelectorAll(Ve),xe=s.context.triggerElements;if(Ce&&(xe.hasElement(Ce)||xe.hasMatchingElement(Ae=>ui(Ae,Ce))))return;let Ee=Ns(Ce)?Ce:null;for(;Ee&&!cu(Ee);){const Ae=Wb(Ee);if(cu(Ae)||!Ns(Ae))break;Ee=Ae}if(He.length&&Ns(Ce)&&!_T(Ce)&&!ui(Ce,s.select("floatingElement"))&&Array.from(He).every(Ae=>!ui(Ee,Ae)))return;if(En(Ce)&&!("touches"in me)){const Ae=cu(Ce),Ye=Bm(Ce),Be=/auto|scroll/,at=Ae||Be.test(Ye.overflowX),Wt=Ae||Be.test(Ye.overflowY),Zt=at&&Ce.clientWidth>0&&Ce.scrollWidth>Ce.clientWidth,et=Wt&&Ce.clientHeight>0&&Ce.scrollHeight>Ce.clientHeight,nt=Ye.direction==="rtl",dt=et&&(nt?me.offsetX<=Ce.offsetWidth-Ce.clientWidth:me.offsetX>Ce.clientWidth),It=Zt&&me.offsetY>Ce.clientHeight;if(dt||It)return}const Ue=(qe=u.current.floatingContext)==null?void 0:qe.nodeId,Fe=_&&Ia(_.nodesRef.current,Ue).some(Ae=>{var Ye;return Or(me,(Ye=Ae.context)==null?void 0:Ye.elements.floating)});if(Or(me,s.select("floatingElement"))||Or(me,s.select("domReferenceElement"))||Fe)return;const st=_?Ia(_.nodesRef.current,Ue):[];if(st.length>0){let Ae=!0;if(st.forEach(Ye=>{var Be;(Be=Ye.context)!=null&&Be.open&&!Ye.context.dataRef.current.__outsidePressBubbles&&(Ae=!1)}),!Ae)return}s.setOpen(!1,xn(Gb,me)),V()}),K=Lt(me=>{W()!=="sloppy"||me.pointerType==="touch"||!s.select("open")||!h||Or(me,s.select("floatingElement"))||Or(me,s.select("domReferenceElement"))||z(me)}),B=Lt(me=>{if(W()!=="sloppy"||!s.select("open")||!h||Or(me,s.select("floatingElement"))||Or(me,s.select("domReferenceElement")))return;const he=me.touches[0];he&&(x.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},L.start(1e3,()=>{x.current&&(x.current.dismissOnTouchEnd=!1,x.current.dismissOnMouseDown=!1)}))}),F=Lt(me=>{const he=Mr(me);function Ce(){B(me),he==null||he.removeEventListener(me.type,Ce)}he==null||he.addEventListener(me.type,Ce)}),X=Lt(me=>{const he=T.current;if(T.current=!1,L.clear(),me.type==="mousedown"&&x.current&&!x.current.dismissOnMouseDown)return;const Ce=Mr(me);function Ve(){me.type==="pointerdown"?K(me):z(me,he),Ce==null||Ce.removeEventListener(me.type,Ve)}Ce==null||Ce.addEventListener(me.type,Ve)}),ne=Lt(me=>{if(W()!=="sloppy"||!x.current||Or(me,s.select("floatingElement"))||Or(me,s.select("domReferenceElement")))return;const he=me.touches[0];if(!he)return;const Ce=Math.abs(he.clientX-x.current.startX),Ve=Math.abs(he.clientY-x.current.startY),He=Math.sqrt(Ce*Ce+Ve*Ve);He>5&&(x.current.dismissOnTouchEnd=!0),He>10&&(z(me),L.clear(),x.current=null)}),ae=Lt(me=>{const he=Mr(me);function Ce(){ne(me),he==null||he.removeEventListener(me.type,Ce)}he==null||he.addEventListener(me.type,Ce)}),pe=Lt(me=>{W()!=="sloppy"||!x.current||Or(me,s.select("floatingElement"))||Or(me,s.select("domReferenceElement"))||(x.current.dismissOnTouchEnd&&z(me),L.clear(),x.current=null)}),j=Lt(me=>{const he=Mr(me);function Ce(){pe(me),he==null||he.removeEventListener(me.type,Ce)}he==null||he.addEventListener(me.type,Ce)});N.useEffect(()=>{if(!a||!h)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=O;const me=new to;function he(Ee){s.setOpen(!1,xn(J3,Ee))}function Ce(){me.clear(),P.current=!0}function Ve(){me.start(U3()?5:0,()=>{P.current=!1})}const He=Wi(c);He.addEventListener("pointerdown",Z,!0),b&&(He.addEventListener("keydown",q),He.addEventListener("compositionstart",Ce),He.addEventListener("compositionend",Ve)),E&&(He.addEventListener("click",X,!0),He.addEventListener("pointerdown",X,!0),He.addEventListener("touchstart",F,!0),He.addEventListener("touchmove",ae,!0),He.addEventListener("touchend",j,!0),He.addEventListener("mousedown",X,!0));let xe=[];return D&&(Ns(v)&&(xe=hl(v)),Ns(c)&&(xe=xe.concat(hl(c))),!Ns(f)&&f&&f.contextElement&&(xe=xe.concat(hl(f.contextElement)))),xe=xe.filter(Ee=>{var Ue;return Ee!==((Ue=He.defaultView)==null?void 0:Ue.visualViewport)}),xe.forEach(Ee=>{Ee.addEventListener("scroll",he,{passive:!0})}),()=>{He.removeEventListener("pointerdown",Z,!0),b&&(He.removeEventListener("keydown",q),He.removeEventListener("compositionstart",Ce),He.removeEventListener("compositionend",Ve)),E&&(He.removeEventListener("click",X,!0),He.removeEventListener("pointerdown",X,!0),He.removeEventListener("touchstart",F,!0),He.removeEventListener("touchmove",ae,!0),He.removeEventListener("touchend",j,!0),He.removeEventListener("mousedown",X,!0)),xe.forEach(Ee=>{Ee.removeEventListener("scroll",he)}),me.clear()}},[u,c,f,v,b,E,a,l,D,h,A,O,q,z,X,K,F,ae,j,Z,s]),N.useEffect(V,[E,V]);const G=N.useMemo(()=>({onKeyDown:q,...C&&{[iD[R]]:me=>{s.setOpen(!1,xn($0,me.nativeEvent))},...R!=="intentional"&&{onClick(me){s.setOpen(!1,xn($0,me.nativeEvent))}}}}),[q,s,C,R]),oe=Lt(me=>{const he=Mr(me.nativeEvent);!ui(s.select("floatingElement"),he)||me.button!==0||(T.current=!0)}),le=N.useMemo(()=>({onKeyDown:q,onPointerDown:oe,onMouseDown:oe,onMouseUp:oe,onClickCapture:k,onMouseDownCapture:k,onPointerDownCapture:k,onMouseUpCapture:k,onTouchEndCapture:k,onTouchMoveCapture:k}),[q,oe,k]);return N.useMemo(()=>h?{reference:G,floating:le,trigger:G}:{},[h,G,le])}var Du=Symbol("NOT_FOUND");function sD(i,r=`expected a function, instead received ${typeof i}`){if(typeof i!="function")throw new TypeError(r)}function aD(i,r=`expected an object, instead received ${typeof i}`){if(typeof i!="object")throw new TypeError(r)}function oD(i,r="expected all items to be functions, instead received the following types: "){if(!i.every(s=>typeof s=="function")){const s=i.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${r}[${s}]`)}}var ty=i=>Array.isArray(i)?i:[i];function lD(i){const r=Array.isArray(i[0])?i[0]:i;return oD(r,"createSelector expects all input-selectors to be functions, but received the following types: "),r}function cD(i,r){const s=[],{length:a}=i;for(let c=0;c<a;c++)s.push(i[c].apply(null,r));return s}function uD(i){let r;return{get(s){return r&&i(r.key,s)?r.value:Du},put(s,a){r={key:s,value:a}},getEntries(){return r?[r]:[]},clear(){r=void 0}}}function hD(i,r){let s=[];function a(l){const u=s.findIndex(h=>r(l,h.key));if(u>-1){const h=s[u];return u>0&&(s.splice(u,1),s.unshift(h)),h.value}return Du}function c(l,u){a(l)===Du&&(s.unshift({key:l,value:u}),s.length>i&&s.pop())}function f(){return s}function v(){s=[]}return{get:a,put:c,getEntries:f,clear:v}}var dD=(i,r)=>i===r;function fD(i){return function(s,a){if(s===null||a===null||s.length!==a.length)return!1;const{length:c}=s;for(let f=0;f<c;f++)if(!i(s[f],a[f]))return!1;return!0}}function mD(i,r){const s=typeof r=="object"?r:{equalityCheck:r},{equalityCheck:a=dD,maxSize:c=1,resultEqualityCheck:f}=s,v=fD(a);let l=0;const u=c<=1?uD(v):hD(c,v);function h(){let b=u.get(arguments);if(b===Du){if(b=i.apply(null,arguments),l++,f){const w=u.getEntries().find(C=>f(C.value,b));w&&(b=w.value,l!==0&&l--)}u.put(arguments,b)}return b}return h.clearCache=()=>{u.clear(),h.resetResultsCount()},h.resultsCount=()=>l,h.resetResultsCount=()=>{l=0},h}var pD=class{constructor(i){this.value=i}deref(){return this.value}},gD=typeof WeakRef<"u"?WeakRef:pD,vD=0,iy=1;function tu(){return{s:vD,v:void 0,o:null,p:null}}function y1(i,r={}){let s=tu();const{resultEqualityCheck:a}=r;let c,f=0;function v(){var d;let l=s;const{length:u}=arguments;for(let w=0,C=u;w<C;w++){const R=arguments[w];if(typeof R=="function"||typeof R=="object"&&R!==null){let D=l.o;D===null&&(l.o=D=new WeakMap);const m=D.get(R);m===void 0?(l=tu(),D.set(R,l)):l=m}else{let D=l.p;D===null&&(l.p=D=new Map);const m=D.get(R);m===void 0?(l=tu(),D.set(R,l)):l=m}}const h=l;let b;if(l.s===iy)b=l.v;else if(b=i.apply(null,arguments),f++,a){const w=((d=c==null?void 0:c.deref)==null?void 0:d.call(c))??c;w!=null&&a(w,b)&&(b=w,f!==0&&f--),c=typeof b=="object"&&b!==null||typeof b=="function"?new gD(b):b}return h.s=iy,h.v=b,b}return v.clearCache=()=>{s=tu(),v.resetResultsCount()},v.resultsCount=()=>f,v.resetResultsCount=()=>{f=0},v}function b1(i,...r){const s=typeof i=="function"?{memoize:i,memoizeOptions:r}:i,a=(...c)=>{let f=0,v=0,l,u={},h=c.pop();typeof h=="object"&&(u=h,h=c.pop()),sD(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const b={...s,...u},{memoize:d,memoizeOptions:w=[],argsMemoize:C=y1,argsMemoizeOptions:R=[]}=b,D=ty(w),m=ty(R),g=lD(c),_=d(function(){return f++,h.apply(null,arguments)},...D),y=C(function(){v++;const T=cD(g,arguments);return l=_.apply(null,T),l},...m);return Object.assign(y,{resultFunc:h,memoizedResultFunc:_,dependencies:g,dependencyRecomputations:()=>v,resetDependencyRecomputations:()=>{v=0},lastResult:()=>l,recomputations:()=>f,resetRecomputations:()=>{f=0},memoize:d,argsMemoize:C})};return Object.assign(a,{withTypes:()=>a}),a}var _D=b1(y1),yD=Object.assign((i,r=_D)=>{aD(i,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof i}`);const s=Object.keys(i),a=s.map(f=>i[f]);return r(a,(...f)=>f.reduce((v,l,u)=>(v[s[u]]=l,v),{}))},{withTypes:()=>yD});b1({memoize:mD,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Mt=(i,r,s,a,c,f,...v)=>{if(v.length>0)throw new Error(Al(1));let l;if(i)l=i;else throw new Error("Missing arguments");return l};var yf={exports:{}},bf={};/**
|
|
236
|
+
* @license React
|
|
237
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
238
|
+
*
|
|
239
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the MIT license found in the
|
|
242
|
+
* LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/var ry;function bD(){if(ry)return bf;ry=1;var i=xl(),r=Mb();function s(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var a=typeof Object.is=="function"?Object.is:s,c=r.useSyncExternalStore,f=i.useRef,v=i.useEffect,l=i.useMemo,u=i.useDebugValue;return bf.useSyncExternalStoreWithSelector=function(h,b,d,w,C){var R=f(null);if(R.current===null){var D={hasValue:!1,value:null};R.current=D}else D=R.current;R=l(function(){function g(A){if(!_){if(_=!0,y=A,A=w(A),C!==void 0&&D.hasValue){var O=D.value;if(C(O,A))return E=O}return E=A}if(O=E,a(y,A))return O;var x=w(A);return C!==void 0&&C(O,x)?(y=A,O):(y=A,E=x)}var _=!1,y,E,T=d===void 0?null:d;return[function(){return g(b())},T===null?void 0:function(){return g(T())}]},[b,d,w,C]);var m=c(h,R[0],R[1]);return v(function(){D.hasValue=!0,D.value=m},[m]),u(m),m},bf}var ny;function SD(){return ny||(ny=1,yf.exports=bD()),yf.exports}var wD=SD();const CD=Mm(19),ED=CD?RD:TD;function xD(i,r,s,a,c){return ED(i,r,s,a,c)}function RD(i,r,s,a,c){const f=N.useCallback(()=>r(i.getSnapshot(),s,a,c),[i,r,s,a,c]);return kb.useSyncExternalStore(i.subscribe,f,f)}function TD(i,r,s,a,c){return wD.useSyncExternalStoreWithSelector(i.subscribe,i.getSnapshot,i.getSnapshot,f=>r(f,s,a,c))}class fl{constructor(r){zt(this,"subscribe",r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}));zt(this,"getSnapshot",()=>this.state);this.state=r,this.listeners=new Set,this.updateTick=0}setState(r){if(this.state===r)return;this.state=r,this.updateTick+=1;const s=this.updateTick;for(const a of this.listeners){if(s!==this.updateTick)return;a(r)}}update(r){for(const s in r)if(!Object.is(this.state[s],r[s])){fl.prototype.setState.call(this,{...this.state,...r});return}}set(r,s){Object.is(this.state[r],s)||fl.prototype.setState.call(this,{...this.state,[r]:s})}notifyAll(){const r={...this.state};fl.prototype.setState.call(this,r)}}class S1 extends fl{constructor(s,a={},c){super(s);zt(this,"controlledValues",new Map);zt(this,"select",(s,a,c,f)=>{const v=this.selectors[s];return v(this.state,a,c,f)});zt(this,"useState",(s,a,c,f)=>{N.useDebugValue(s);const v=this.selectors[s];return xD(this,v,a,c,f)});this.context=a,this.selectors=c}useSyncedValue(s,a){N.useDebugValue(s),_i(()=>{this.state[s]!==a&&this.set(s,a)},[s,a])}useSyncedValueWithCleanup(s,a){_i(()=>(this.state[s]!==a&&this.set(s,a),()=>{this.set(s,void 0)}),[s,a])}useSyncedValues(s){const a=Object.values(s);_i(()=>{this.update(s)},a)}useControlledProp(s,a,c){N.useDebugValue(s);const f=a!==void 0;this.controlledValues.has(s)||(this.controlledValues.set(s,f),!f&&!Object.is(this.state[s],c)&&super.setState({...this.state,[s]:c})),_i(()=>{f&&!Object.is(this.state[s],a)&&super.setState({...this.state,[s]:a})},[s,a,c,f])}set(s,a){this.controlledValues.get(s)!==!0&&super.set(s,a)}update(s){const a={...s};for(const c in a)if(Object.hasOwn(a,c)&&this.controlledValues.get(c)===!0){delete a[c];continue}super.update(a)}setState(s){const a={...s};for(const c in a)if(Object.hasOwn(a,c)&&this.controlledValues.get(c)===!0){delete a[c];continue}super.setState({...this.state,...a})}useContextCallback(s,a){N.useDebugValue(s);const c=Lt(a??$b);this.context[s]=c}useStateSetter(s){const a=N.useRef(void 0);return a.current===void 0&&(a.current=c=>{this.set(s,c)}),a.current}observe(s,a){let c;typeof s=="function"?c=s:c=this.selectors[s];let f=c(this.state);return a(f,f,this),this.subscribe(v=>{const l=c(v);if(!Object.is(f,l)){const u=f;f=l,a(l,u,this)}})}}const DD={open:Mt(i=>i.open),domReferenceElement:Mt(i=>i.domReferenceElement),referenceElement:Mt(i=>i.positionReference??i.referenceElement),floatingElement:Mt(i=>i.floatingElement),floatingId:Mt(i=>i.floatingId)};class w1 extends S1{constructor(s){const{nested:a,noEmit:c,onOpenChange:f,triggerElements:v,...l}=s;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:f,dataRef:{current:{}},events:UT(),nested:a,noEmit:c,triggerElements:v},DD);zt(this,"setOpen",(s,a)=>{var c,f;if((!s||!this.state.open||ET(a.event))&&(this.context.dataRef.current.openEvent=s?a.event:void 0),!this.context.noEmit){const v={open:s,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",v)}(f=(c=this.context).onOpenChange)==null||f.call(c,s,a)})}}function OD(i,r=!1,s=!1){const[a,c]=N.useState(i&&r?"idle":void 0),[f,v]=N.useState(i);return i&&!f&&(v(!0),c("starting")),!i&&f&&a!=="ending"&&!s&&c("ending"),!i&&!f&&a==="ending"&&c(void 0),_i(()=>{if(!i&&f&&a!=="ending"&&s){const l=Kr.request(()=>{c("ending")});return()=>{Kr.cancel(l)}}},[i,f,a,s]),_i(()=>{if(!i||r)return;const l=Kr.request(()=>{eo.flushSync(()=>{c(void 0)})});return()=>{Kr.cancel(l)}},[r,i]),_i(()=>{if(!i||!r)return;i&&f&&a!=="idle"&&c("starting");const l=Kr.request(()=>{c("idle")});return()=>{Kr.cancel(l)}},[r,i,f,c,a]),N.useMemo(()=>({mounted:f,setMounted:v,transitionStatus:a}),[f,a])}function AD(i,r=!1,s=!0){const a=p1();return Lt((c,f=null)=>{a.cancel();const v=js(i);v!=null&&(typeof v.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?c():a.request(()=>{function l(){v&&Promise.all(v.getAnimations().map(u=>u.finished)).then(()=>{f!=null&&f.aborted||eo.flushSync(c)}).catch(()=>{if(s){if(f!=null&&f.aborted)return;eo.flushSync(c)}else v.getAnimations().length>0&&v.getAnimations().some(u=>u.pending||u.playState!=="finished")&&l()})}r?a.request(l):l()}))})}function C1(i){const{enabled:r=!0,open:s,ref:a,onComplete:c}=i,f=al(s),v=Lt(c),l=AD(a,s);N.useEffect(()=>{r&&l(()=>{s===f.current&&v()})},[r,s,v,l,f])}function LD(i){const r=i.useState("open");_i(()=>{if(r&&!i.select("activeTriggerId")&&i.context.triggerElements.size===1){const s=i.context.triggerElements.entries().next();if(!s.done){const[a,c]=s.value;i.update({activeTriggerId:a,activeTriggerElement:c})}}},[r,i])}function MD(i,r,s){const{mounted:a,setMounted:c,transitionStatus:f}=OD(i);r.useSyncedValues({mounted:a,transitionStatus:f});const v=Lt(()=>{var u,h;c(!1),r.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),s==null||s(),(h=(u=r.context).onOpenChangeComplete)==null||h.call(u,!1)}),l=r.useState("preventUnmountingOnClose");return C1({enabled:!l,open:i,ref:r.context.popupRef,onComplete(){i||v()}}),{forceUnmount:v,transitionStatus:f}}class E1{constructor(){this.elements=new Set,this.idMap=new Map}add(r,s){const a=this.idMap.get(r);a!==s&&(a!==void 0&&this.elements.delete(a),this.elements.add(s),this.idMap.set(r,s))}delete(r){const s=this.idMap.get(r);s&&(this.elements.delete(s),this.idMap.delete(r))}hasElement(r){return this.elements.has(r)}hasMatchingElement(r){for(const s of this.elements)if(r(s))return!0;return!1}getById(r){return this.idMap.get(r)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function kD(){return new w1({open:!1,floatingElement:null,referenceElement:null,triggerElements:new E1,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function BD(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:kD(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:yr,inactiveTriggerProps:yr,popupProps:yr}}const ND={open:Mt(i=>i.open),mounted:Mt(i=>i.mounted),transitionStatus:Mt(i=>i.transitionStatus),floatingRootContext:Mt(i=>i.floatingRootContext),preventUnmountingOnClose:Mt(i=>i.preventUnmountingOnClose),payload:Mt(i=>i.payload),activeTriggerId:Mt(i=>i.activeTriggerId),activeTriggerElement:Mt(i=>i.mounted?i.activeTriggerElement:null),isTriggerActive:Mt((i,r)=>r!==void 0&&i.activeTriggerId===r),isOpenedByTrigger:Mt((i,r)=>r!==void 0&&i.activeTriggerId===r&&i.open),isMountedByTrigger:Mt((i,r)=>r!==void 0&&i.activeTriggerId===r&&i.mounted),triggerProps:Mt((i,r)=>r?i.activeTriggerProps:i.inactiveTriggerProps),popupProps:Mt(i=>i.popupProps),popupElement:Mt(i=>i.popupElement),positionerElement:Mt(i=>i.positionerElement)};function jD(i){const{popupStore:r,noEmit:s=!1,treatPopupAsFloatingElement:a=!1,onOpenChange:c}=i,f=zu(),v=d1()!=null,l=r.useState("open"),u=r.useState("activeTriggerElement"),h=r.useState(a?"popupElement":"positionerElement"),b=r.context.triggerElements,d=ms(()=>new w1({open:l,referenceElement:u,floatingElement:h,triggerElements:b,onOpenChange:c,floatingId:f,nested:v,noEmit:s})).current;return _i(()=>{const w={open:l,floatingId:f,referenceElement:u,floatingElement:h};Ns(u)&&(w.domReferenceElement=u),d.update(w)},[l,f,u,h,d]),d.context.onOpenChange=c,d.context.nested=v,d.context.noEmit=s,d}function HD(i=[]){const r=i.map(h=>h==null?void 0:h.reference),s=i.map(h=>h==null?void 0:h.floating),a=i.map(h=>h==null?void 0:h.item),c=i.map(h=>h==null?void 0:h.trigger),f=N.useCallback(h=>iu(h,i,"reference"),r),v=N.useCallback(h=>iu(h,i,"floating"),s),l=N.useCallback(h=>iu(h,i,"item"),a),u=N.useCallback(h=>iu(h,i,"trigger"),c);return N.useMemo(()=>({getReferenceProps:f,getFloatingProps:v,getItemProps:l,getTriggerProps:u}),[f,v,l,u])}function iu(i,r,s){var v;const a=new Map,c=s==="item",f={};s==="floating"&&(f.tabIndex=-1,f[rm]="");for(const l in i)c&&i&&(l===e1||l===t1)||(f[l]=i[l]);for(let l=0;l<r.length;l+=1){let u;const h=(v=r[l])==null?void 0:v[s];typeof h=="function"?u=i?h(i):null:u=h,u&&sy(f,u,c,a)}return sy(f,i,c,a),f}function sy(i,r,s,a){var c;for(const f in r){const v=r[f];s&&(f===e1||f===t1)||(f.startsWith("on")?(a.has(f)||a.set(f,[]),typeof v=="function"&&((c=a.get(f))==null||c.push(v),i[f]=(...l)=>{var u;return(u=a.get(f))==null?void 0:u.map(h=>h(...l)).find(h=>h!==void 0)})):i[f]=v)}}const PD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zD(i,r={}){const s="rootStore"in i?i.rootStore:i,a=s.useState("open"),c=s.useState("floatingId"),f=s.useState("domReferenceElement"),v=s.useState("floatingElement"),{enabled:l=!0,role:u="dialog"}=r,h=zu(),b=(f==null?void 0:f.id)||h,d=N.useMemo(()=>{var y;return((y=nm(v))==null?void 0:y.id)||c},[v,c]),w=PD.get(u)??u,R=d1()!=null,D=N.useMemo(()=>w==="tooltip"||u==="label"?yr:{"aria-haspopup":w==="alertdialog"?"dialog":w,"aria-expanded":"false",...w==="listbox"&&{role:"combobox"},...w==="menu"&&R&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[w,R,u]),m=N.useMemo(()=>w==="tooltip"||u==="label"?{[`aria-${u==="label"?"labelledby":"describedby"}`]:a?d:void 0}:{...D,"aria-expanded":a?"true":"false","aria-controls":a?d:void 0,...w==="menu"&&{id:b}},[w,d,a,b,u,D]),g=N.useMemo(()=>{const y={id:d,...w&&{role:w}};return w==="tooltip"||u==="label"?y:{...y,...w==="menu"&&{"aria-labelledby":b}}},[w,d,b,u]),_=N.useCallback(({active:y,selected:E})=>{const T={role:"option",...y&&{id:`${d}-fui-option`}};switch(u){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[d,u]);return N.useMemo(()=>l?{reference:m,floating:g,item:_,trigger:D}:{},[l,m,g,D,_])}let ID=(function(i){return i.nestedDialogs="--nested-dialogs",i})({}),UD=(function(i){return i[i.open=zs.open]="open",i[i.closed=zs.closed]="closed",i[i.startingStyle=zs.startingStyle]="startingStyle",i[i.endingStyle=zs.endingStyle]="endingStyle",i.nested="data-nested",i.nestedDialogOpen="data-nested-dialog-open",i})({});const x1=N.createContext(void 0);function FD(){const i=N.useContext(x1);if(i===void 0)throw new Error(Al(26));return i}const R1="ArrowUp",T1="ArrowDown",D1="ArrowLeft",O1="ArrowRight",A1="Home",L1="End",qD=new Set([D1,O1]),$D=new Set([R1,T1]),KD=new Set([...qD,...$D]);[...KD];const VD=new Set([R1,T1,D1,O1,A1,L1]),WD={...Vb,...Kb,nestedDialogOpen(i){return i?{[UD.nestedDialogOpen]:""}:null}},YD=N.forwardRef(function(r,s){const{className:a,finalFocus:c,initialFocus:f,render:v,...l}=r,{store:u}=so(),h=u.useState("descriptionElementId"),b=u.useState("disablePointerDismissal"),d=u.useState("floatingRootContext"),w=u.useState("popupProps"),C=u.useState("modal"),R=u.useState("mounted"),D=u.useState("nested"),m=u.useState("nestedOpenDialogCount"),g=u.useState("open"),_=u.useState("openMethod"),y=u.useState("titleElementId"),E=u.useState("transitionStatus"),T=u.useState("role");FD(),C1({open:g,ref:u.context.popupRef,onComplete(){var V,P;g&&((P=(V=u.context).onOpenChangeComplete)==null||P.call(V,!0))}});function A(V){return V==="touch"?u.context.popupRef.current:!0}const O=f===void 0?A:f,x=m>0,L=N.useMemo(()=>({open:g,nested:D,transitionStatus:E,nestedDialogOpen:x}),[g,D,E,x]),I=Ll("div",r,{state:L,props:[w,{"aria-labelledby":y??void 0,"aria-describedby":h??void 0,role:T,tabIndex:-1,hidden:!R,onKeyDown(V){VD.has(V.key)&&V.stopPropagation()},style:{[ID.nestedDialogs]:m}},l],ref:[s,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:WD});return H.jsx(tD,{context:d,openInteractionType:_,disabled:!R,closeOnFocusOut:!b,initialFocus:O,returnFocus:c,modal:C!==!1,restoreFocus:"popup",children:I})});function GD(i){return Mm(19)?i:i?"true":void 0}const XD=N.forwardRef(function(r,s){const{cutout:a,...c}=r;let f;if(a){const v=a==null?void 0:a.getBoundingClientRect();f=`polygon(
|
|
244
|
+
0% 0%,
|
|
245
|
+
100% 0%,
|
|
246
|
+
100% 100%,
|
|
247
|
+
0% 100%,
|
|
248
|
+
0% 0%,
|
|
249
|
+
${v.left}px ${v.top}px,
|
|
250
|
+
${v.left}px ${v.bottom}px,
|
|
251
|
+
${v.right}px ${v.bottom}px,
|
|
252
|
+
${v.right}px ${v.top}px,
|
|
253
|
+
${v.left}px ${v.top}px
|
|
254
|
+
)`}return H.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...c,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:f}})}),QD=N.forwardRef(function(r,s){const{keepMounted:a=!1,...c}=r,{store:f}=so(),v=f.useState("mounted"),l=f.useState("modal");return v||a?H.jsx(x1.Provider,{value:a,children:H.jsxs(XT,{ref:s,...c,children:[v&&l===!0&&H.jsx(XD,{ref:f.context.internalBackdropRef,inert:GD(!open)}),r.children]})}):null});let ay={},oy={},ly="";function ZD(i){if(typeof document>"u")return!1;const r=Uu(i);return Qr(r).innerWidth-r.documentElement.clientWidth>0}function JD(i){const r=Uu(i),s=r.documentElement,a=r.body,c=Pu(s)?s:a,f=c.style.overflow;return c.style.overflow="hidden",()=>{c.style.overflow=f}}function e4(i){var w,C;const r=Uu(i),s=r.documentElement,a=r.body,c=Qr(s);let f=0,v=0;const l=Kr.create(),u=typeof CSS<"u"&&((w=CSS.supports)==null?void 0:w.call(CSS,"scrollbar-gutter","stable"));if(uT&&(((C=c.visualViewport)==null?void 0:C.scale)??1)!==1)return()=>{};function h(){const R=c.getComputedStyle(s),D=c.getComputedStyle(a),_=(R.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";f=s.scrollTop,v=s.scrollLeft,ay={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},ly=s.style.scrollBehavior,oy={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const y=s.scrollHeight>s.clientHeight,E=s.scrollWidth>s.clientWidth,T=R.overflowY==="scroll"||D.overflowY==="scroll",A=R.overflowX==="scroll"||D.overflowX==="scroll",O=Math.max(0,c.innerWidth-s.clientWidth),x=Math.max(0,c.innerHeight-s.clientHeight),L=parseFloat(D.marginTop)+parseFloat(D.marginBottom),I=parseFloat(D.marginLeft)+parseFloat(D.marginRight),V=Pu(s)?s:a;if(u){s.style.scrollbarGutter=_,V.style.overflowY="hidden",V.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:_,overflowY:"hidden",overflowX:"hidden"}),(y||T)&&(s.style.overflowY="scroll"),(E||A)&&(s.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:L||x?`calc(100dvh - ${L+x}px)`:"100dvh",width:I||O?`calc(100vw - ${I+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),a.scrollTop=f,a.scrollLeft=v,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function b(){Object.assign(s.style,ay),Object.assign(a.style,oy),u||(s.scrollTop=f,s.scrollLeft=v,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=ly)}function d(){b(),l.request(h)}return h(),c.addEventListener("resize",d),()=>{l.cancel(),b(),typeof c.removeEventListener=="function"&&c.removeEventListener("resize",d)}}class t4{constructor(){zt(this,"lockCount",0);zt(this,"restore",null);zt(this,"timeoutLock",to.create());zt(this,"timeoutUnlock",to.create());zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});zt(this,"unlock",()=>{var r;this.lockCount===0&&this.restore&&((r=this.restore)==null||r.call(this),this.restore=null)})}acquire(r){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(r)),this.release}lock(r){if(this.lockCount===0||this.restore!==null)return;const a=Uu(r).documentElement,c=Qr(a).getComputedStyle(a).overflowY;if(c==="hidden"||c==="clip"){this.restore=$b;return}const f=hT||!ZD(r);this.restore=f?JD(r):e4(r)}}const i4=new t4;function r4(i=!0,r=null){_i(()=>{if(i)return i4.acquire(r)},[i,r])}function n4(i){const r=N.useRef(""),s=N.useCallback(c=>{c.defaultPrevented||(r.current=c.pointerType,i(c,c.pointerType))},[i]);return{onClick:N.useCallback(c=>{if(c.detail===0){i(c,"keyboard");return}"pointerType"in c&&i(c,c.pointerType),i(c,r.current),r.current=""},[i]),onPointerDown:s}}function s4(i){const[r,s]=N.useState(null),a=Lt((l,u)=>{i||s(u)}),c=N.useCallback(()=>{s(null)},[]),{onClick:f,onPointerDown:v}=n4(a);return N.useMemo(()=>({openMethod:r,reset:c,triggerProps:{onClick:f,onPointerDown:v}}),[r,c,f,v])}function a4(i){const{store:r,parentContext:s,actionsRef:a}=i,c=r.useState("open"),f=r.useState("disablePointerDismissal"),v=r.useState("modal"),l=r.useState("popupElement"),{openMethod:u,triggerProps:h,reset:b}=s4(c);LD(r);const{forceUnmount:d}=MD(c,r,()=>{b()}),w=Lt(I=>{const V=xn(I);return V.preventUnmountOnClose=()=>{r.set("preventUnmountingOnClose",!0)},V}),C=N.useCallback(()=>{r.setOpen(!1,w(rT))},[r,w]);N.useImperativeHandle(a,()=>({unmount:d,close:C}),[d,C]);const R=jD({popupStore:r,onOpenChange:r.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[D,m]=N.useState(0),g=D===0,_=zD(R),y=nD(R,{outsidePressEvent(){return r.context.internalBackdropRef.current||r.context.backdropRef.current?"intentional":{mouse:v==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(I){if("button"in I&&I.button!==0||"touches"in I&&I.touches.length!==1)return!1;const V=Mr(I);if(g&&!f){const P=V;return v&&(r.context.internalBackdropRef.current||r.context.backdropRef.current)?r.context.internalBackdropRef.current===P||r.context.backdropRef.current===P||ui(P,l)&&!(P!=null&&P.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:g});r4(c&&v===!0,l);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=HD([_,y]);r.useContextCallback("onNestedDialogOpen",I=>{m(I+1)}),r.useContextCallback("onNestedDialogClose",()=>{m(0)}),N.useEffect(()=>(s!=null&&s.onNestedDialogOpen&&c&&s.onNestedDialogOpen(D),s!=null&&s.onNestedDialogClose&&!c&&s.onNestedDialogClose(),()=>{s!=null&&s.onNestedDialogClose&&c&&s.onNestedDialogClose()}),[c,s,D]);const O=N.useMemo(()=>E(h),[E,h]),x=N.useMemo(()=>A(h),[A,h]),L=N.useMemo(()=>T(),[T]);r.useSyncedValues({openMethod:u,activeTriggerProps:O,inactiveTriggerProps:x,popupProps:L,floatingRootContext:R,nestedOpenDialogCount:D})}const o4={...ND,modal:Mt(i=>i.modal),nested:Mt(i=>i.nested),nestedOpenDialogCount:Mt(i=>i.nestedOpenDialogCount),disablePointerDismissal:Mt(i=>i.disablePointerDismissal),openMethod:Mt(i=>i.openMethod),descriptionElementId:Mt(i=>i.descriptionElementId),titleElementId:Mt(i=>i.titleElementId),viewportElement:Mt(i=>i.viewportElement),role:Mt(i=>i.role)};class l4 extends S1{constructor(s){super(c4(s),{popupRef:N.createRef(),backdropRef:N.createRef(),internalBackdropRef:N.createRef(),triggerElements:new E1,onOpenChange:void 0,onOpenChangeComplete:void 0},o4);zt(this,"setOpen",(s,a)=>{var l,u,h,b;if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!s&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),(u=(l=this.context).onOpenChange)==null||u.call(l,s,a),a.isCanceled)return;const c={open:s,nativeEvent:a.event,reason:a.reason,nested:this.state.nested};(h=this.state.floatingRootContext.context.events)==null||h.emit("openchange",c);const f={open:s},v=((b=a.trigger)==null?void 0:b.id)??null;(v||s)&&(f.activeTriggerId=v,f.activeTriggerElement=a.trigger??null),this.update(f)})}}function c4(i={}){return{...BD(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...i}}function u4(i){const{children:r,open:s,defaultOpen:a=!1,onOpenChange:c,onOpenChangeComplete:f,disablePointerDismissal:v=!1,modal:l=!0,actionsRef:u,handle:h,triggerId:b,defaultTriggerId:d=null}=i,w=so(!0),C=!!w,R=ms(()=>(h==null?void 0:h.store)??new l4({open:s??a,activeTriggerId:b!==void 0?b:d,modal:l,disablePointerDismissal:v,nested:C})).current;R.useControlledProp("open",s,a),R.useControlledProp("activeTriggerId",b,d),R.useSyncedValues({disablePointerDismissal:v,nested:C,modal:l}),R.useContextCallback("onOpenChange",c),R.useContextCallback("onOpenChangeComplete",f);const D=R.useState("payload");a4({store:R,actionsRef:u,parentContext:w==null?void 0:w.store.context});const m=N.useMemo(()=>({store:R}),[R]);return H.jsx(Pb.Provider,{value:m,children:typeof r=="function"?r({payload:D}):r})}const h4=N.forwardRef(function(r,s){const{render:a,className:c,id:f,...v}=r,{store:l}=so(),u=oT(f);return l.useSyncedValueWithCleanup("titleElementId",u),Ll("h2",r,{ref:s,props:[{id:u},v]})}),d4=({open:i,onOpenChange:r,children:s})=>H.jsx(u4,{open:i,onOpenChange:r,children:s}),f4=({children:i,className:r=""})=>H.jsxs(QD,{children:[H.jsx(P3,{className:"fixed inset-0 bg-black/50 z-50"}),H.jsx(YD,{className:`fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%] bg-[var(--color-bg-secondary)] border border-[var(--color-border)] rounded-lg shadow-lg max-h-[90vh] overflow-auto ${r}`,children:i})]}),m4=({children:i,className:r=""})=>H.jsx("div",{className:`flex items-center justify-between p-4 border-b border-[var(--color-border)] ${r}`,children:i}),p4=({children:i,className:r=""})=>H.jsx(h4,{className:`text-lg font-semibold ${r}`,children:i}),g4=({className:i=""})=>H.jsx(nT,{className:`p-1 rounded-md text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-tertiary)] transition-colors ${i}`,children:H.jsx(Om,{className:"h-4 w-4"})}),v4=({children:i,className:r=""})=>H.jsx("div",{className:`p-4 ${r}`,children:i}),_4=({children:i,className:r=""})=>H.jsx("div",{className:`flex gap-3 pt-4 ${r}`,children:i}),yl=N.forwardRef(({className:i="",...r},s)=>H.jsx("div",{ref:s,className:`rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-secondary)] shadow-sm ${i}`,...r}));yl.displayName="Card";const Ou=N.forwardRef(({className:i="",...r},s)=>H.jsx("div",{ref:s,className:`p-4 ${i}`,...r}));Ou.displayName="CardContent";const Au=N.forwardRef(({className:i="",...r},s)=>H.jsx("div",{ref:s,className:`flex items-center gap-4 p-4 ${i}`,...r}));Au.displayName="CardHeader";const Lu=N.forwardRef(({className:i="",...r},s)=>H.jsx("h3",{ref:s,className:`font-medium truncate ${i}`,...r}));Lu.displayName="CardTitle";const M1=N.forwardRef(({className:i="",...r},s)=>H.jsx("p",{ref:s,className:`text-sm text-[var(--color-text-secondary)] truncate ${i}`,...r}));M1.displayName="CardDescription";const y4=N.forwardRef(({className:i="",variant:r="default",children:s,...a},c)=>{const f={default:"bg-[var(--color-bg-tertiary)] border-[var(--color-border)] text-[var(--color-text)]",destructive:"bg-red-950/30 border-red-900/50 text-red-400",warning:"bg-yellow-950/30 border-yellow-900/50 text-yellow-400",success:"bg-green-950/30 border-green-900/50 text-green-400"},l={default:Z2,destructive:W2,warning:vR,success:G2}[r];return H.jsx("div",{ref:c,role:"alert",className:`relative rounded-lg border p-4 ${f[r]} ${i}`,...a,children:H.jsxs("div",{className:"flex gap-3",children:[H.jsx(l,{className:"h-5 w-5 flex-shrink-0 mt-0.5"}),H.jsx("div",{className:"flex-1",children:s})]})})});y4.displayName="Alert";const b4=N.forwardRef(({className:i="",...r},s)=>H.jsx("h5",{ref:s,className:`font-medium mb-1 ${i}`,...r}));b4.displayName="AlertTitle";const S4=N.forwardRef(({className:i="",...r},s)=>H.jsx("div",{ref:s,className:`text-sm opacity-90 ${i}`,...r}));S4.displayName="AlertDescription";function w4({onClose:i}){const{t:r}=wr(),s=Xr(),a=Zs("/devices/:deviceId/windows/:windowId/panes/:paneId",s.pathname),c=Zs("/devices/:deviceId",s.pathname),f=(a==null?void 0:a.params.deviceId)??(c==null?void 0:c.params.deviceId),v=a==null?void 0:a.params.windowId,l=Lm(a==null?void 0:a.params.paneId),{sidebarCollapsed:u,setSidebarCollapsed:h}=Ur(),[b,d]=N.useState(new Set),[w,C]=N.useState({}),R=ku(),D=ea(),m=qt(F=>F.snapshots),g=qt(F=>F.connectDevice),_=qt(F=>F.disconnectDevice),y=qt(F=>F.createWindow),E=qt(F=>F.closeWindow),T=qt(F=>F.closePane),A=qt(F=>F.selectWindow),O=qt(F=>F.deviceConnected),x=Tn(F=>{var X;return((X=F.settings)==null?void 0:X.siteName)??"tmex"}),L=Tn(F=>{var X;return((X=F.settings)==null?void 0:X.language)??"en_US"}),{data:I}=Qs({queryKey:["devices"],queryFn:async()=>{const F=await fetch("/api/devices");if(!F.ok)throw new Error("Failed to fetch devices");return F.json()},throwOnError:!1});N.useEffect(()=>{I||_t.error(r("common.error"))},[I,r]);const V=_r({mutationFn:async F=>{if(!(await fetch(`/api/devices/${F}`,{method:"DELETE"})).ok)throw new Error("Failed to delete device")},onSuccess:()=>{D.invalidateQueries({queryKey:["devices"]}),_t.success(r("common.success"))},onError:F=>{_t.error(F instanceof Error?F.message:r("common.error"))}}),P=N.useCallback(F=>{d(X=>{const ne=new Set(X);return ne.has(F)?(ne.delete(F),F!==f&&_(F,"sidebar")):(ne.add(F),g(F,"sidebar")),ne})},[g,_,f]),$=N.useCallback(F=>{R(`/devices/${F}`),i()},[R,i]),Z=N.useCallback((F,X,ne)=>{R(`/devices/${F}/windows/${X}/panes/${jb(ne)}`),i()},[R,i]),W=N.useCallback((F,X,ne)=>{Z(F,X,ne)},[Z]),q=N.useCallback((F,X,ne)=>{const ae=ne.find(pe=>pe.active)??ne[0];if(ae){Z(F,X,ae.id);return}C(pe=>({...pe,[F]:{windowId:X,requestedAt:Date.now()}})),A(F,X)},[Z,A]),Y=N.useCallback(F=>{y(F)},[y]),k=N.useCallback((F,X)=>{E(F,X)},[E]),z=N.useCallback((F,X,ne,ae)=>{if(ae<=1){E(F,X);return}T(F,ne)},[T,E]);N.useEffect(()=>{f&&!b.has(f)&&(d(X=>new Set(X).add(f)),a!=null&&a.params.deviceId||g(f,"sidebar"))},[f,b,g,a==null?void 0:a.params.deviceId]),N.useEffect(()=>{var pe;const F=Object.entries(w);if(F.length===0)return;const X=Date.now(),ne={...w};let ae=!1;for(const[j,G]of F){const oe=m[j],le=(pe=oe==null?void 0:oe.session)==null?void 0:pe.windows.find(he=>he.id===G.windowId),me=(le==null?void 0:le.panes.find(he=>he.active))??(le==null?void 0:le.panes[0]);if(le&&me){Z(j,le.id,me.id),delete ne[j],ae=!0;continue}X-G.requestedAt>3e3&&(delete ne[j],ae=!0)}ae&&C(ne)},[w,m,Z]);const K=(I==null?void 0:I.devices)??[],B=N.useMemo(()=>[...K].sort((F,X)=>F.name.localeCompare(X.name,Bb(L),{numeric:!0,sensitivity:"base"})),[K,L]);return H.jsxs("aside",{"data-testid":"sidebar",className:`
|
|
255
|
+
h-full flex-shrink-0 bg-[var(--color-bg-secondary)] border-r border-[var(--color-border)]
|
|
256
|
+
flex flex-col transition-all duration-200 ease-in-out
|
|
257
|
+
${u?"w-14":"w-64"}
|
|
258
|
+
`,children:[H.jsx("div",{className:"tmex-mobile-topbar border-b border-[var(--color-border)] flex-shrink-0",children:H.jsxs("div",{className:"h-11 flex items-center justify-between",children:[!u&&H.jsx("span",{className:"font-semibold text-base text-[var(--color-text)] truncate",children:x}),H.jsx(xt,{variant:"ghost",size:"sm","data-testid":"sidebar-collapse-toggle",onClick:()=>h(!u),title:r(u?"nav.sidebarExpand":"nav.sidebarCollapse"),className:`
|
|
259
|
+
p-1.5 h-8 w-8
|
|
260
|
+
${u?"mx-auto":""}
|
|
261
|
+
`,children:u?H.jsx(Tm,{className:"h-4 w-4"}):H.jsx($2,{className:"h-4 w-4"})})]})}),H.jsxs("div",{className:"flex-1 overflow-y-auto py-2 min-h-0",children:[B.map(F=>{var X,ne;return H.jsx(C4,{device:F,isExpanded:b.has(F.id),isSelected:F.id===f,selectedWindowId:v,selectedPaneId:l,windows:((ne=(X=m[F.id])==null?void 0:X.session)==null?void 0:ne.windows)??null,isConnected:O[F.id]??!1,onToggle:()=>P(F.id),onSelect:()=>$(F.id),onDelete:()=>V.mutate(F.id),onCreateWindow:()=>Y(F.id),onCloseWindow:k,onClosePane:z,collapsed:u,onPaneClick:W,onWindowClick:q},F.id)}),B.length===0&&!u&&H.jsxs("div",{className:"px-4 py-8 text-center text-[var(--color-text-secondary)] text-sm",children:[H.jsx("div",{className:"mb-2",children:r("sidebar.noDevices")}),H.jsxs("div",{className:"space-y-1",children:[H.jsx(yn,{to:"/devices",className:"block text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] hover:underline transition-colors",onClick:i,children:r("sidebar.addDevice")}),H.jsx(yn,{to:"/settings",className:"block text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] hover:underline transition-colors",onClick:i,children:r("sidebar.openSettings")})]})]})]}),!u&&H.jsx("div",{className:"p-3 tmex-sidebar-bottom-safe-md border-t border-[var(--color-border)] flex-shrink-0",children:H.jsxs("div",{className:"flex flex-col gap-2",children:[H.jsx(xt,{variant:"default",className:"w-full justify-start",asChild:!0,children:H.jsxs(yn,{"data-testid":"sidebar-manage-devices",to:"/devices",onClick:i,children:[H.jsx(fu,{className:"h-4 w-4 mr-2 flex-shrink-0"}),r("sidebar.manageDevices")]})}),H.jsx(xt,{variant:"default",className:"w-full justify-start",asChild:!0,children:H.jsxs(yn,{"data-testid":"sidebar-settings",to:"/settings",onClick:i,children:[H.jsx(y0,{className:"h-4 w-4 mr-2 flex-shrink-0"}),r("sidebar.settings")]})})]})}),u&&H.jsxs("div",{className:"p-2 tmex-sidebar-bottom-safe-sm border-t border-[var(--color-border)] flex-shrink-0 flex flex-col gap-2",children:[H.jsx(xt,{variant:"ghost",size:"sm",className:"w-full h-8 px-2 justify-start",asChild:!0,title:r("sidebar.manageDevices"),children:H.jsx(yn,{"data-testid":"sidebar-manage-devices",to:"/devices",onClick:i,children:H.jsx(fu,{className:"h-4 w-4"})})}),H.jsx(xt,{variant:"ghost",size:"sm",className:"w-full h-8 px-2 justify-start",asChild:!0,title:r("sidebar.settings"),children:H.jsx(yn,{"data-testid":"sidebar-settings",to:"/settings",onClick:i,children:H.jsx(y0,{className:"h-4 w-4"})})})]})]})}function C4({device:i,isExpanded:r,isSelected:s,selectedWindowId:a,selectedPaneId:c,onToggle:f,onSelect:v,onCreateWindow:l,onCloseWindow:u,onClosePane:h,collapsed:b,windows:d,isConnected:w,onPaneClick:C,onWindowClick:R}){const{t:D}=wr(),m=i.type==="local"?fu:wb,g=s&&!!c,_=g?d==null?void 0:d.find(T=>T.id===a):void 0,y=g?_==null?void 0:_.panes.find(T=>T.id===c):void 0,E=g&&!!y;return b?H.jsx("div",{className:"px-2 py-1",children:H.jsx("button",{type:"button",onClick:v,title:i.name,"data-testid":`device-icon-${i.id}`,"data-active":s,className:`
|
|
262
|
+
w-full h-9 rounded-md flex items-center justify-center
|
|
263
|
+
transition-all duration-150 ease-in-out
|
|
264
|
+
${s?"bg-[rgba(88,166,255,0.15)] text-[var(--color-text)] shadow-sm":"text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-tertiary)]"}
|
|
265
|
+
${w&&!s?"border-l-2 border-[var(--color-success)]":""}
|
|
266
|
+
`,children:H.jsx(m,{className:"h-4 w-4 flex-shrink-0"})})}):H.jsxs("div",{className:"select-none group",children:[H.jsx("div",{"data-testid":`device-item-${i.id}`,"data-active":s,className:`
|
|
267
|
+
mx-2 mb-1 rounded-md overflow-hidden
|
|
268
|
+
${E?"bg-[rgba(88,166,255,0.15)] text-[var(--color-text)]":s?"bg-[var(--color-bg-tertiary)] text-[var(--color-text)]":"text-[var(--color-text)] hover:bg-[var(--color-bg-tertiary)]"}
|
|
269
|
+
${s&&!E?"border-l-2 border-[var(--color-accent)]":""}
|
|
270
|
+
transition-colors duration-150
|
|
271
|
+
`,children:H.jsxs("div",{className:"flex items-center px-2 py-2",children:[H.jsx("button",{type:"button","data-testid":`device-expand-${i.id}`,onClick:f,className:`
|
|
272
|
+
p-1 rounded mr-1 flex-shrink-0
|
|
273
|
+
text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg)]
|
|
274
|
+
transition-colors duration-150
|
|
275
|
+
`,title:D(r?"common.collapse":"common.expand"),children:r?H.jsx(Rm,{className:"h-3.5 w-3.5"}):H.jsx(Tm,{className:"h-3.5 w-3.5"})}),H.jsx("span",{className:`
|
|
276
|
+
mr-2 flex-shrink-0
|
|
277
|
+
${s?"text-[var(--color-text)]":"text-[var(--color-text-secondary)]"}
|
|
278
|
+
`,children:H.jsx(m,{className:"h-4 w-4"})}),H.jsx("button",{type:"button","data-testid":`device-select-${i.id}`,onClick:v,className:"flex-1 min-w-0 text-left font-medium truncate",title:i.name,children:i.name}),w&&H.jsx("span",{className:`
|
|
279
|
+
ml-1.5 w-2 h-2 rounded-full flex-shrink-0
|
|
280
|
+
bg-[var(--color-success)]
|
|
281
|
+
`,title:D("device.connected")}),H.jsx("button",{type:"button","data-testid":`window-create-${i.id}`,onClick:T=>{T.stopPropagation(),l()},className:`
|
|
282
|
+
ml-1 p-1 rounded flex-shrink-0
|
|
283
|
+
transition-colors duration-150
|
|
284
|
+
${s?"text-[var(--color-text)] hover:bg-[var(--color-bg)]/40":"text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg)]"}
|
|
285
|
+
`,title:D("sidebar.newWindow"),"aria-label":`${i.name} ${D("sidebar.newWindow")}`,children:H.jsx(Eb,{className:"h-3.5 w-3.5"})})]})}),r&&H.jsxs("div",{className:"ml-4 mr-2 mb-2",children:[!d&&H.jsxs("div",{className:"px-3 py-2 text-sm text-[var(--color-text-secondary)] flex items-center gap-2",children:[H.jsx("span",{className:"w-1.5 h-1.5 bg-[var(--color-accent)] rounded-full animate-pulse"}),D("terminal.connecting")]}),d&&d.length===0&&H.jsx("div",{className:"px-3 py-2 text-sm text-[var(--color-text-secondary)]",children:"-"}),d==null?void 0:d.map(T=>H.jsx(E4,{device:i,window:T,isSelected:s&&T.id===a,isDeviceTreeSelected:E,selectedPaneId:c,parentSelected:s,onPaneClick:C,onWindowClick:R,onCloseWindow:u,onClosePane:h},T.id))]})]})}function E4({device:i,window:r,isSelected:s,isDeviceTreeSelected:a,selectedPaneId:c,parentSelected:f,onPaneClick:v,onWindowClick:l,onCloseWindow:u,onClosePane:h}){const{t:b}=wr(),[d,w]=N.useState(s);N.useEffect(()=>{s&&w(!0)},[s]);const C=N.useCallback(()=>{l(i.id,r.id,r.panes)},[i.id,r.id,r.panes,l]),R=r.panes.length>1,D=r.panes.find(g=>g.id===c),m=a&&!!D;return H.jsxs("div",{className:"select-none",children:[H.jsx("div",{"data-testid":`window-item-${r.id}`,"data-active":s,role:"button",tabIndex:0,onClick:C,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),C())},className:`
|
|
286
|
+
rounded-md mb-0.5
|
|
287
|
+
${m?"bg-[rgba(88,166,255,0.3)] text-[var(--color-text)] border-l-2 border-[var(--color-accent)]":s?"bg-[var(--color-bg-tertiary)] text-[var(--color-text)] border-l-2 border-[var(--color-accent)]":"text-[var(--color-text)] hover:bg-[var(--color-bg-tertiary)]"}
|
|
288
|
+
${!s&&f?"ml-2":""}
|
|
289
|
+
transition-colors duration-150
|
|
290
|
+
`,children:H.jsxs("div",{className:"flex items-center px-2 py-1.5",children:[R?H.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),w(!d)},className:`
|
|
291
|
+
p-0.5 rounded mr-1 flex-shrink-0
|
|
292
|
+
${s?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg)]"}
|
|
293
|
+
transition-colors duration-150
|
|
294
|
+
`,children:d?H.jsx(Rm,{className:"h-3 w-3"}):H.jsx(Tm,{className:"h-3 w-3"})}):H.jsx("span",{className:"w-5 flex-shrink-0"}),H.jsxs("span",{className:`
|
|
295
|
+
text-xs mr-1.5 flex-shrink-0 min-w-[1.25rem]
|
|
296
|
+
${s?"text-[var(--color-text-secondary)]":"text-[var(--color-text-muted)]"}
|
|
297
|
+
`,children:[r.index,":"]}),H.jsx("span",{className:"flex-1 min-w-0 text-left text-sm truncate",title:r.name,children:r.name}),r.active&&H.jsx("span",{className:`
|
|
298
|
+
ml-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0
|
|
299
|
+
bg-[var(--color-success)]
|
|
300
|
+
`,title:b("sidebar.currentWindow")}),H.jsx("button",{type:"button","data-testid":`window-close-${r.id}`,onClick:g=>{g.stopPropagation(),u(i.id,r.id)},className:`
|
|
301
|
+
ml-1 p-1 rounded flex-shrink-0
|
|
302
|
+
${s?"text-[var(--color-text)] hover:bg-[var(--color-bg)]/40":"text-[var(--color-text-muted)] hover:text-[var(--color-danger)] hover:bg-[var(--color-bg)]"}
|
|
303
|
+
transition-colors duration-150
|
|
304
|
+
`,title:b("sidebar.closeWindow"),"aria-label":`${b("sidebar.closeWindow")} ${r.name}`,children:H.jsx(Om,{className:"h-3 w-3"})})]})}),(d||!R)&&H.jsx("div",{className:`
|
|
305
|
+
${!s&&f?"ml-4":"ml-3"}
|
|
306
|
+
border-l border-[var(--color-border)] pl-2
|
|
307
|
+
`,children:r.panes.map(g=>H.jsx(x4,{deviceId:i.id,windowId:r.id,pane:g,isSelected:s&&g.id===c,isWindowTreeSelected:m,parentWindowSelected:s,paneCount:r.panes.length,onClick:v,onClosePane:h},g.id))})]})}function x4({deviceId:i,windowId:r,pane:s,isSelected:a,isWindowTreeSelected:c,parentWindowSelected:f,paneCount:v,onClick:l,onClosePane:u}){const{t:h}=wr();return H.jsxs("div",{"data-testid":`pane-item-${s.id}`,"data-active":a,className:`
|
|
308
|
+
w-full flex items-center px-2 py-1 rounded-md text-left text-sm
|
|
309
|
+
${a?"bg-[rgba(88,166,255,0.9)] text-[var(--color-bg)] border-l-2 border-[var(--color-accent)]":c?"text-[var(--color-text)] bg-[rgba(88,166,255,0.15)] hover:bg-[rgba(88,166,255,0.2)]":"text-[var(--color-text-secondary)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-tertiary)]"}
|
|
310
|
+
${!a&&f?"ml-2":""}
|
|
311
|
+
transition-colors duration-150 mb-0.5
|
|
312
|
+
`,children:[H.jsxs("button",{type:"button",onClick:()=>l(i,r,s.id),title:`Pane ${s.index}${s.active?" (active)":""}`,className:"flex items-center flex-1 min-w-0",children:[H.jsx("span",{className:`
|
|
313
|
+
mr-1.5 text-xs flex-shrink-0
|
|
314
|
+
${a?"text-[var(--color-bg)]":"text-[var(--color-text-muted)]"}
|
|
315
|
+
`,children:"›"}),H.jsxs("span",{className:"truncate flex-1 text-left",children:["Pane ",s.index]}),s.active&&H.jsx("span",{className:`
|
|
316
|
+
ml-1.5 w-1 h-1 rounded-full flex-shrink-0
|
|
317
|
+
${a?"bg-[var(--color-bg)]/80":"bg-[var(--color-success)]"}
|
|
318
|
+
`,title:h("sidebar.currentPane")})]}),H.jsx("button",{type:"button","data-testid":`pane-close-${s.id}`,onClick:b=>{b.stopPropagation(),u(i,r,s.id,v)},className:`
|
|
319
|
+
ml-1 p-1 rounded flex-shrink-0
|
|
320
|
+
${a?"text-[var(--color-bg)] hover:bg-[var(--color-bg)]/20":c?"text-[var(--color-text)] hover:text-[var(--color-danger)] hover:bg-[var(--color-bg)]/40":"text-[var(--color-text-muted)] hover:text-[var(--color-danger)] hover:bg-[var(--color-bg)]"}
|
|
321
|
+
transition-colors duration-150
|
|
322
|
+
`,title:h("sidebar.closePane"),"aria-label":`${h("sidebar.closePane")} ${s.index}`,children:H.jsx(Om,{className:"h-3 w-3"})})]})}function R4(){const i=Tn.getState().settings;return(i==null?void 0:i.siteName)||"tmex"}function cy(i){const r=i==null?void 0:i.trim();return r&&r.length>0?r:"?"}function k1({paneIdx:i,windowIdx:r,paneTitle:s,windowName:a,deviceName:c}){const f=r??"?",v=i??"?",l=cy(s??a),u=cy(c);return`${f}/${v}: ${l}@${u}`}function T4(i){const r=R4();return i!=null&&i.trim()?`[${r}]${i}`:r}function D4(){if(typeof navigator>"u")return!1;const i=navigator.userAgent,r=/iPad|iPhone|iPod/.test(i),s=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return r||s}function Sf(){var s;const i=navigator.standalone===!0,r=typeof window<"u"&&((s=window.matchMedia)==null?void 0:s.call(window,"(display-mode: standalone)").matches)===!0;return i||r}function O4(){return typeof navigator>"u"?!1:/\bCriOS\b/i.test(navigator.userAgent)}function A4(){const{t:i}=wr(),[r,s]=N.useState(!1),[a,c]=N.useState(!1),f=ku(),v=Xr(),l=JE("/devices/:deviceId/windows/:windowId/panes/:paneId"),u=l==null?void 0:l.params.deviceId,h=l==null?void 0:l.params.windowId,b=Lm(l==null?void 0:l.params.paneId),d=qt(P=>P.ensureSocketConnected),w=qt(P=>P.snapshots),C=qt(P=>{var $;return u?(($=P.deviceConnected)==null?void 0:$[u])??!1:!1}),R=qt(P=>{var $;return u?($=P.selectedPanes)==null?void 0:$[u]:void 0}),{inputMode:D,setInputMode:m}=Ur(),g=Tn(P=>P.settings),_=Tn(P=>P.fetchSettings),{data:y}=Qs({queryKey:["devices"],queryFn:async()=>{const P=await fetch("/api/devices");if(!P.ok)throw new Error(i("device.loadFailed"));return P.json()},throwOnError:!1}),E=N.useMemo(()=>{var W,q,Y;if(!l||!u||!h||!b)return null;const P=(q=(W=w[u])==null?void 0:W.session)==null?void 0:q.windows.find(k=>k.id===h),$=P==null?void 0:P.panes.find(k=>k.id===b);if(!P||!$)return null;const Z=((Y=y==null?void 0:y.devices.find(k=>k.id===u))==null?void 0:Y.name)??u;return k1({paneIdx:$.index,windowIdx:P.index,paneTitle:$.title,windowName:P.name,deviceName:Z})},[y==null?void 0:y.devices,u,b,h,l,w]),T=!!l,A=v.pathname.replace(/\/+$/,"")||"/",O=A==="/"||A==="/devices"||A==="/settings",x=!!(T&&b&&C&&(R==null?void 0:R.paneId)===b),L=N.useRef(null),I=()=>{m(D==="direct"?"editor":"direct")},V=()=>{T&&window.dispatchEvent(new CustomEvent("tmex:jump-to-latest"))};return N.useEffect(()=>{d()},[d]),N.useEffect(()=>{_()},[_]),N.useEffect(()=>{g!=null&&g.language&&Ti.language!==g.language&&Ti.changeLanguage(g.language)},[g==null?void 0:g.language]),N.useEffect(()=>{y||!T||_t.error(i("common.error"))},[y,T,i]),N.useEffect(()=>{document.title=(g==null?void 0:g.siteName)??"tmex"},[g==null?void 0:g.siteName]),N.useEffect(()=>{if(!D4()||Sf())return;const P="tmex:pwa:ios-install-hint-dismissed";let $=!1;try{$=localStorage.getItem(P)==="1"}catch{$=!1}if($)return;try{localStorage.setItem(P,"1")}catch{}const Z=O4()?i("common.pwaInstallHintIOSChrome"):i("common.pwaInstallHintIOSSafari");_t.custom(W=>H.jsxs("div",{className:"w-full max-w-[420px] rounded-md bg-[var(--color-bg-secondary)] border border-[var(--color-border)] px-3 py-2 text-left",children:[H.jsx("div",{className:"text-sm font-medium",children:i("common.pwaInstallTitle")}),H.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:Z}),H.jsx("button",{type:"button",className:"mt-2 text-xs text-[var(--color-accent)]",onClick:()=>{_t.dismiss(W)},children:i("common.close")})]}),{duration:12e3})},[i]),N.useEffect(()=>{var q,Y;const P=document.documentElement,$=()=>{P.dataset.tmexStandalone=Sf()?"1":"0"};$();const Z=(q=window.matchMedia)==null?void 0:q.call(window,"(display-mode: standalone)"),W=Z;return Z!=null&&Z.addEventListener?Z.addEventListener("change",$):(Y=W==null?void 0:W.addListener)==null||Y.call(W,$),()=>{var k;Z!=null&&Z.removeEventListener?Z.removeEventListener("change",$):(k=W==null?void 0:W.removeListener)==null||k.call(W,$)}},[]),N.useEffect(()=>{const P=$=>{const W=$.detail;if(!(W!=null&&W.title))return;const q=()=>{if(!W.paneUrl)return;const Y=new URL(W.paneUrl,window.location.origin);f(`${Y.pathname}${Y.search}${Y.hash}`)};if(W.paneUrl){_t.custom(Y=>H.jsxs("button",{type:"button",className:"w-full text-left rounded-md bg-[var(--color-bg-secondary)] px-3 py-2",onClick:()=>{_t.dismiss(Y),q()},children:[H.jsx("div",{className:"text-sm font-medium",children:W.title}),W.description&&H.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:W.description}),H.jsx("div",{className:"mt-1 text-xs text-[var(--color-accent)]",children:i("notification.clickToJump")})]}),{duration:6e3});return}_t.info(W.title,{description:W.description})};return window.addEventListener("tmex:sonner",P),()=>window.removeEventListener("tmex:sonner",P)},[f]),N.useEffect(()=>{const P=()=>{const $=window.innerWidth<768;c($),$||s(!1)};return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[]),N.useEffect(()=>{const P=document.body;if(a&&T)return P.classList.add("tmex-terminal-mobile-gesture-guard"),()=>P.classList.remove("tmex-terminal-mobile-gesture-guard");P.classList.remove("tmex-terminal-mobile-gesture-guard")},[a,T]),N.useEffect(()=>{if(!(a&&T))return;const P=L.current;if(!P)return;let $=0;const Z=Y=>{if(!(Y instanceof HTMLElement))return null;let k=Y;for(;k&&k!==P;){const z=window.getComputedStyle(k);if(/(auto|scroll)/.test(z.overflowY)&&k.scrollHeight>k.clientHeight)return k;k=k.parentElement}return null},W=Y=>{var k;Y.touches.length===1&&($=((k=Y.touches[0])==null?void 0:k.clientY)??0)},q=Y=>{var F;if(Y.touches.length!==1||(((F=Y.touches[0])==null?void 0:F.clientY)??0)-$<=0)return;const K=Z(Y.target);(!K||K.scrollTop<=0)&&Y.preventDefault()};return P.addEventListener("touchstart",W,{passive:!0}),P.addEventListener("touchmove",q,{passive:!1}),()=>{P.removeEventListener("touchstart",W),P.removeEventListener("touchmove",q)}},[a,T]),N.useEffect(()=>{var X,ne;let W=null,q=!1,Y=null,k=null;const z=ae=>{const pe=window.innerHeight,j=window.visualViewport,G=(j==null?void 0:j.offsetTop)??0;if(ae){const le=(j==null?void 0:j.height)??pe;let me=le;if(j&&Sf()){const Ce=pe-(le+G);Ce>=0&&Ce<=80&&(me=pe-G)}if(!Number.isFinite(me)||me<=0)return;const he=Math.round(me);(Y===null||Math.abs(he-Y)>=2)&&(Y=he,document.documentElement.style.setProperty("--tmex-viewport-height",`${he}px`))}if(!Number.isFinite(G))return;const oe=Math.max(0,Math.round(G));k!==null&&Math.abs(oe-k)<1||(k=oe,document.documentElement.style.setProperty("--tmex-viewport-offset-top",`${oe}px`))},K=ae=>{q||(q=ae),W===null&&(W=window.requestAnimationFrame(()=>{const pe=q;q=!1,W=null,z(pe)}))};z(!0);const B=()=>K(!0),F=()=>K(!1);return window.addEventListener("resize",B),(X=window.visualViewport)==null||X.addEventListener("resize",B),(ne=window.visualViewport)==null||ne.addEventListener("scroll",F),()=>{var ae,pe;window.removeEventListener("resize",B),(ae=window.visualViewport)==null||ae.removeEventListener("resize",B),(pe=window.visualViewport)==null||pe.removeEventListener("scroll",F),W!==null&&window.cancelAnimationFrame(W)}},[]),H.jsxs("div",{ref:L,className:"flex h-[100vh] w-screen overflow-hidden bg-[var(--color-bg)]",children:[a&&r&&H.jsx("button",{type:"button","data-testid":"mobile-sidebar-overlay","aria-label":i("nav.closeSidebar"),className:"fixed inset-0 bg-black/50 z-[99]",onClick:()=>s(!1)}),H.jsx("div",{className:`${a?"fixed left-0 top-0 bottom-0 z-[100] transform -translate-x-full transition-transform duration-200":""}
|
|
323
|
+
${a&&r?"translate-x-0":""}`,children:H.jsx(w4,{isOpen:r,onClose:()=>s(!1)})}),H.jsxs("div",{className:`flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden ${a?"tmex-mobile-topbar-spacer":""}`,children:[a&&H.jsx("header",{"data-testid":"mobile-topbar",className:"tmex-mobile-topbar fixed top-0 left-0 right-0 z-[120] bg-[var(--color-bg-secondary)] border-b border-[var(--color-border)]",children:H.jsxs("div",{className:"h-11 flex items-center justify-between gap-2",children:[H.jsx("button",{type:"button","data-testid":"mobile-sidebar-open",onClick:()=>s(!0),className:"h-7 w-7 inline-flex items-center justify-center -ml-1 rounded hover:bg-[var(--color-bg-tertiary)]","aria-label":i("nav.openSidebar"),title:i("nav.openSidebar"),children:H.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:H.jsx("path",{d:"M3 5h14v2H3V5zm0 4h14v2H3V9zm0 4h14v2H3v-2z"})})}),H.jsx("span",{"data-testid":"mobile-topbar-title",className:"font-medium text-sm truncate text-center flex-1",title:E??(g==null?void 0:g.siteName)??"tmex",children:E??(g==null?void 0:g.siteName)??"tmex"}),H.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[H.jsx("button",{type:"button","data-testid":"terminal-input-mode-toggle",onClick:I,className:"h-7 w-7 inline-flex items-center justify-center rounded hover:bg-[var(--color-bg-tertiary)]","aria-label":i(D==="direct"?"nav.switchToEditor":"nav.switchToDirect"),title:i(D==="direct"?"nav.switchToEditor":"nav.switchToDirect"),disabled:!T,children:D==="direct"?H.jsx(Cb,{className:"h-4 w-4"}):H.jsx(xb,{className:"h-4 w-4"})}),H.jsx("button",{type:"button","data-testid":"terminal-jump-latest",onClick:V,className:"h-7 w-7 inline-flex items-center justify-center rounded hover:bg-[var(--color-bg-tertiary)]","aria-label":i("nav.jumpToLatest"),title:i("nav.jumpToLatest"),disabled:!x,children:H.jsx(Sb,{className:"h-4 w-4"})})]})]})}),H.jsx("main",{className:`flex-1 min-w-0 min-h-0 ${O?"overflow-y-auto":"overflow-hidden"} ${a&&T?"overscroll-none":""}`,children:H.jsx(xx,{})})]})]})}var wf={exports:{}},uy;function L4(){return uy||(uy=1,(function(i,r){(function(s,a){i.exports=a()})(self,(()=>(()=>{var s={4567:function(v,l,u){var h=this&&this.__decorate||function(y,E,T,A){var O,x=arguments.length,L=x<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,T,A);else for(var I=y.length-1;I>=0;I--)(O=y[I])&&(L=(x<3?O(L):x>3?O(E,T,L):O(E,T))||L);return x>3&&L&&Object.defineProperty(E,T,L),L},b=this&&this.__param||function(y,E){return function(T,A){E(T,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),w=u(6114),C=u(9924),R=u(844),D=u(5596),m=u(4725),g=u(3656);let _=l.AccessibilityManager=class extends R.Disposable{constructor(y,E){super(),this._terminal=y,this._renderService=E,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
324
|
+
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new D.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,g.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,R.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(y){for(let E=0;E<y;E++)this._handleChar(" ")}_handleChar(y){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==y&&(this._charsToAnnounce+=y):this._charsToAnnounce+=y,y===`
|
|
325
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),w.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,w.isMac&&this._liveRegion.remove()}_handleKey(y){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(y)||this._charsToConsume.push(y)}_refreshRows(y,E){this._liveRegionDebouncer.refresh(y,E,this._terminal.rows)}_renderRows(y,E){const T=this._terminal.buffer,A=T.lines.length.toString();for(let O=y;O<=E;O++){const x=T.translateBufferLineToString(T.ydisp+O,!0),L=(T.ydisp+O+1).toString(),I=this._rowElements[O];I&&(x.length===0?I.innerText=" ":I.textContent=x,I.setAttribute("aria-posinset",L),I.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(y,E){const T=y.target,A=this._rowElements[E===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(E===0?"1":`${this._terminal.buffer.lines.length}`)||y.relatedTarget!==A)return;let O,x;if(E===0?(O=T,x=this._rowElements.pop(),this._rowContainer.removeChild(x)):(O=this._rowElements.shift(),x=T,this._rowContainer.removeChild(O)),O.removeEventListener("focus",this._topBoundaryFocusListener),x.removeEventListener("focus",this._bottomBoundaryFocusListener),E===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(E===0?-1:1),this._rowElements[E===0?1:this._rowElements.length-2].focus(),y.preventDefault(),y.stopImmediatePropagation()}_handleResize(y){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let E=this._rowContainer.children.length;E<this._terminal.rows;E++)this._rowElements[E]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[E]);for(;this._rowElements.length>y;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const y=document.createElement("div");return y.setAttribute("role","listitem"),y.tabIndex=-1,this._refreshRowDimensions(y),y}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let y=0;y<this._terminal.rows;y++)this._refreshRowDimensions(this._rowElements[y])}}_refreshRowDimensions(y){y.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=_=h([b(1,m.IRenderService)],_)},3614:(v,l)=>{function u(w){return w.replace(/\r?\n/g,"\r")}function h(w,C){return C?"\x1B[200~"+w+"\x1B[201~":w}function b(w,C,R,D){w=h(w=u(w),R.decPrivateModes.bracketedPasteMode&&D.rawOptions.ignoreBracketedPasteMode!==!0),R.triggerDataEvent(w,!0),C.value=""}function d(w,C,R){const D=R.getBoundingClientRect(),m=w.clientX-D.left-10,g=w.clientY-D.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${m}px`,C.style.top=`${g}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=h,l.copyHandler=function(w,C){w.clipboardData&&w.clipboardData.setData("text/plain",C.selectionText),w.preventDefault()},l.handlePasteEvent=function(w,C,R,D){w.stopPropagation(),w.clipboardData&&b(w.clipboardData.getData("text/plain"),C,R,D)},l.paste=b,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(w,C,R,D,m){d(w,C,R),m&&D.rightClickSelect(w),C.value=D.selectionText,C.select()}},7239:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=u(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(b,d,w){this._css.set(b,d,w)}getCss(b,d){return this._css.get(b,d)}setColor(b,d,w){this._color.set(b,d,w)}getColor(b,d){return this._color.get(b,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,h,b,d){u.addEventListener(h,b,d);let w=!1;return{dispose:()=>{w||(w=!0,u.removeEventListener(h,b,d))}}}},6465:function(v,l,u){var h=this&&this.__decorate||function(m,g,_,y){var E,T=arguments.length,A=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,g,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(T<3?E(A):T>3?E(g,_,A):E(g,_))||A);return T>3&&A&&Object.defineProperty(g,_,A),A},b=this&&this.__param||function(m,g){return function(_,y){g(_,y,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const d=u(3656),w=u(8460),C=u(844),R=u(2585);let D=l.Linkifier2=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(m){super(),this._bufferService=m,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new w.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new w.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(m){return this._linkProviders.push(m),{dispose:()=>{const g=this._linkProviders.indexOf(m);g!==-1&&this._linkProviders.splice(g,1)}}}attachToDom(m,g,_){this._element=m,this._mouseService=g,this._renderService=_,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){if(this._lastMouseEvent=m,!this._element||!this._mouseService)return;const g=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const _=m.composedPath();for(let y=0;y<_.length;y++){const E=_[y];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,g){var _,y;this._activeProviderReplies&&g||((_=this._activeProviderReplies)===null||_===void 0||_.forEach((T=>{T==null||T.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=m.y);let E=!1;for(const[T,A]of this._linkProviders.entries())g?!((y=this._activeProviderReplies)===null||y===void 0)&&y.get(T)&&(E=this._checkLinkProviderResult(T,m,E)):A.provideLinks(m.y,(O=>{var x,L;if(this._isMouseOut)return;const I=O==null?void 0:O.map((V=>({link:V})));(x=this._activeProviderReplies)===null||x===void 0||x.set(T,I),E=this._checkLinkProviderResult(T,m,E),((L=this._activeProviderReplies)===null||L===void 0?void 0:L.size)===this._linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)}))}_removeIntersectingLinks(m,g){const _=new Set;for(let y=0;y<g.size;y++){const E=g.get(y);if(E)for(let T=0;T<E.length;T++){const A=E[T],O=A.link.range.start.y<m?0:A.link.range.start.x,x=A.link.range.end.y>m?this._bufferService.cols:A.link.range.end.x;for(let L=O;L<=x;L++){if(_.has(L)){E.splice(T--,1);break}_.add(L)}}}}_checkLinkProviderResult(m,g,_){var y;if(!this._activeProviderReplies)return _;const E=this._activeProviderReplies.get(m);let T=!1;for(let A=0;A<m;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(T=!0);if(!T&&E){const A=E.find((O=>this._linkAtPosition(O.link,g)));A&&(_=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviders.length&&!_)for(let A=0;A<this._activeProviderReplies.size;A++){const O=(y=this._activeProviderReplies.get(A))===null||y===void 0?void 0:y.find((x=>this._linkAtPosition(x.link,g)));if(O){_=!0,this._handleNewLink(O);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._element||!this._mouseService||!this._currentLink)return;const g=this._positionFromMouseEvent(m,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,g){this._element&&this._currentLink&&this._lastMouseEvent&&(!m||!g||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(m.link,g)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var _,y;return(y=(_=this._currentLink)===null||_===void 0?void 0:_.state)===null||y===void 0?void 0:y.decorations.pointerCursor},set:_=>{var y,E;!((y=this._currentLink)===null||y===void 0)&&y.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&((E=this._element)===null||E===void 0||E.classList.toggle("xterm-cursor-pointer",_)))}},underline:{get:()=>{var _,y;return(y=(_=this._currentLink)===null||_===void 0?void 0:_.state)===null||y===void 0?void 0:y.decorations.underline},set:_=>{var y,E,T;!((y=this._currentLink)===null||y===void 0)&&y.state&&((T=(E=this._currentLink)===null||E===void 0?void 0:E.state)===null||T===void 0?void 0:T.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,_))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const y=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(y,E),this._lastMouseEvent&&this._element)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(m,g,_){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(_,g.text)}_fireUnderlineEvent(m,g){const _=m.range,y=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-y-1,_.end.x,_.end.y-y-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(m,g,_){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(_,g.text)}_linkAtPosition(m,g){const _=m.range.start.y*this._bufferService.cols+m.range.start.x,y=m.range.end.y*this._bufferService.cols+m.range.end.x,E=g.y*this._bufferService.cols+g.x;return _<=E&&E<=y}_positionFromMouseEvent(m,g,_){const y=_.getCoords(m,g,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,g,_,y,E){return{x1:m,y1:g,x2:_,y2:y,cols:this._bufferService.cols,fg:E}}};l.Linkifier2=D=h([b(0,R.IBufferService)],D)},9042:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(v,l,u){var h=this&&this.__decorate||function(D,m,g,_){var y,E=arguments.length,T=E<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(D,m,g,_);else for(var A=D.length-1;A>=0;A--)(y=D[A])&&(T=(E<3?y(T):E>3?y(m,g,T):y(m,g))||T);return E>3&&T&&Object.defineProperty(m,g,T),T},b=this&&this.__param||function(D,m){return function(g,_){m(g,_,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),w=u(2585);let C=l.OscLinkProvider=class{constructor(D,m,g){this._bufferService=D,this._optionsService=m,this._oscLinkService=g}provideLinks(D,m){var g;const _=this._bufferService.buffer.lines.get(D-1);if(!_)return void m(void 0);const y=[],E=this._optionsService.rawOptions.linkHandler,T=new d.CellData,A=_.getTrimmedLength();let O=-1,x=-1,L=!1;for(let I=0;I<A;I++)if(x!==-1||_.hasContent(I)){if(_.loadCell(I,T),T.hasExtendedAttrs()&&T.extended.urlId){if(x===-1){x=I,O=T.extended.urlId;continue}L=T.extended.urlId!==O}else x!==-1&&(L=!0);if(L||x!==-1&&I===A-1){const V=(g=this._oscLinkService.getLinkData(O))===null||g===void 0?void 0:g.uri;if(V){const P={start:{x:x+1,y:D},end:{x:I+(L||I!==A-1?0:1),y:D}};let $=!1;if(!(E!=null&&E.allowNonHttpProtocols))try{const Z=new URL(V);["http:","https:"].includes(Z.protocol)||($=!0)}catch{$=!0}$||y.push({text:V,range:P,activate:(Z,W)=>E?E.activate(Z,W,P):R(0,W),hover:(Z,W)=>{var q;return(q=E==null?void 0:E.hover)===null||q===void 0?void 0:q.call(E,Z,W,P)},leave:(Z,W)=>{var q;return(q=E==null?void 0:E.leave)===null||q===void 0?void 0:q.call(E,Z,W,P)}})}L=!1,T.hasExtendedAttrs()&&T.extended.urlId?(x=I,O=T.extended.urlId):(x=-1,O=-1)}}m(y)}};function R(D,m){if(confirm(`Do you want to navigate to ${m}?
|
|
326
|
+
|
|
327
|
+
WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=h([b(0,w.IBufferService),b(1,w.IOptionsService),b(2,w.IOscLinkService)],C)},6193:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,h){this._parentWindow=u,this._renderCallback=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},5596:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ScreenDprMonitor=void 0;const h=u(844);class b extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,h.toDisposable)((()=>{this.clearListener()})))}setListener(w){this._listener&&this.clearListener(),this._listener=w,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)===null||w===void 0||w.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}l.ScreenDprMonitor=b},3236:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=u(3614),b=u(3656),d=u(6465),w=u(9042),C=u(3730),R=u(1680),D=u(3107),m=u(5744),g=u(2950),_=u(1296),y=u(428),E=u(4269),T=u(5114),A=u(8934),O=u(3230),x=u(9312),L=u(4725),I=u(6731),V=u(8055),P=u(8969),$=u(8460),Z=u(844),W=u(6114),q=u(8437),Y=u(2584),k=u(7399),z=u(5941),K=u(9074),B=u(2585),F=u(5435),X=u(4567),ne=typeof window<"u"?window.document:null;class ae extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(j={}){super(j),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Z.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(K.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,oe)=>this.refresh(G,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,Z.toDisposable)((()=>{var G,oe;this._customKeyEventHandler=void 0,(oe=(G=this.element)===null||G===void 0?void 0:G.parentNode)===null||oe===void 0||oe.removeChild(this.element)})))}_handleColorEvent(j){if(this._themeService)for(const G of j){let oe,le="";switch(G.index){case 256:oe="foreground",le="10";break;case 257:oe="background",le="11";break;case 258:oe="cursor",le="12";break;default:oe="ansi",le="4;"+G.index}switch(G.type){case 0:const me=V.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,z.toRgbString)(me)}${Y.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((he=>he.ansi[G.index]=V.rgba.toColor(...G.color)));else{const he=oe;this._themeService.modifyColors((Ce=>Ce[he]=V.rgba.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(j){j?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(j){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.updateCursorStyle(j),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var j;return(j=this.textarea)===null||j===void 0?void 0:j.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const j=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(j);if(!G)return;const oe=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,me=G.getWidth(oe),he=this._renderService.dimensions.css.cell.width*me,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,Ve=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ve+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=he+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,b.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,h.copyHandler)(G,this._selectionService)})));const j=G=>(0,h.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",j)),this.register((0,b.addDisposableDomListener)(this.element,"paste",j)),W.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,h.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,h.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,h.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(j=>this._keyUp(j)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(j=>this._keyDown(j)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(j=>this._keyPress(j)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(j=>this._compositionHelper.compositionupdate(j)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(j=>this._inputEvent(j)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(j){var G;if(!j)throw new Error("Terminal requires a parent element.");j.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=j.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),j.appendChild(this.element);const oe=ne.createDocumentFragment();this._viewportElement=ne.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),oe.appendChild(this._viewportElement),this._viewportScrollArea=ne.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=ne.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=ne.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),oe.appendChild(this.screenElement),this.textarea=ne.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",w.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(T.CoreBrowserService,this.textarea,(G=this._document.defaultView)!==null&&G!==void 0?G:window),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(O.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=ne.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(oe);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(R.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(x.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const j=this,G=this.element;function oe(he){const Ce=j._mouseService.getMouseReportCoords(he,j.screenElement);if(!Ce)return!1;let Ve,He;switch(he.overrideType||he.type){case"mousemove":He=32,he.buttons===void 0?(Ve=3,he.button!==void 0&&(Ve=he.button<3?he.button:3)):Ve=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":He=0,Ve=he.button<3?he.button:3;break;case"mousedown":He=1,Ve=he.button<3?he.button:3;break;case"wheel":if(j.viewport.getLinesScrolled(he)===0)return!1;He=he.deltaY<0?0:1,Ve=4;break;default:return!1}return!(He===void 0||Ve===void 0||Ve>4)&&j.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:Ve,action:He,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:he=>(oe(he),he.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(he)),wheel:he=>(oe(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&oe(he)},mousemove:he=>{he.buttons||oe(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?le.mousemove||(G.addEventListener("mousemove",me.mousemove),le.mousemove=me.mousemove):(G.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&he?le.wheel||(G.addEventListener("wheel",me.wheel,{passive:!1}),le.wheel=me.wheel):(G.removeEventListener("wheel",le.wheel),le.wheel=null),2&he?le.mouseup||(G.addEventListener("mouseup",me.mouseup),le.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),G.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&he?le.mousedrag||(le.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)(G,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return oe(he),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(he)}))),this.register((0,b.addDisposableDomListener)(G,"wheel",(he=>{if(!le.wheel){if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(he);if(Ce===0)return;const Ve=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let He="";for(let xe=0;xe<Math.abs(Ce);xe++)He+=Ve;return this.coreService.triggerDataEvent(He,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)(G,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,b.addDisposableDomListener)(G,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(j,G){var oe;(oe=this._renderService)===null||oe===void 0||oe.refreshRows(j,G)}updateCursorStyle(j){var G;!((G=this._selectionService)===null||G===void 0)&&G.shouldColumnSelect(j)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(j,G,oe=0){var le;oe===1?(super.scrollLines(j,G,oe),this.refresh(0,this.rows-1)):(le=this.viewport)===null||le===void 0||le.scrollLines(j)}paste(j){(0,h.paste)(j,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(j){this._customKeyEventHandler=j}registerLinkProvider(j){return this.linkifier2.registerLinkProvider(j)}registerCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(j);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(j)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(j){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+j)}registerDecoration(j){return this._decorationService.registerDecoration(j)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(j,G,oe){this._selectionService.setSelection(j,G,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var j;(j=this._selectionService)===null||j===void 0||j.clearSelection()}selectAll(){var j;(j=this._selectionService)===null||j===void 0||j.selectAll()}selectLines(j,G){var oe;(oe=this._selectionService)===null||oe===void 0||oe.selectLines(j,G)}_keyDown(j){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&j.altKey;if(!G&&!this._compositionHelper.keydown(j))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||j.key!=="Dead"&&j.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,k.evaluateKeyboardEvent)(j,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(j),oe.type===3||oe.type===2){const le=this.rows-1;return this.scrollLines(oe.type===2?-le:le),this.cancel(j,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,j)||(oe.cancel&&this.cancel(j,!0),!oe.key||!!(j.key&&!j.ctrlKey&&!j.altKey&&!j.metaKey&&j.key.length===1&&j.key.charCodeAt(0)>=65&&j.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==Y.C0.ETX&&oe.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||j.altKey||j.ctrlKey?this.cancel(j,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(j,G){const oe=j.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||j.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||j.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?oe:oe&&(!G.keyCode||G.keyCode>47)}_keyUp(j){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(j)||this.focus(),this.updateCursorStyle(j),this._keyPressHandled=!1)}_keyPress(j){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;if(this.cancel(j),j.charCode)G=j.charCode;else if(j.which===null||j.which===void 0)G=j.keyCode;else{if(j.which===0||j.charCode===0)return!1;G=j.which}return!(!G||(j.altKey||j.ctrlKey||j.metaKey)&&!this._isThirdLevelShift(this.browser,j)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(j){if(j.data&&j.inputType==="insertText"&&(!j.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=j.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(j),!0}return!1}resize(j,G){j!==this.cols||G!==this.rows?super.resize(j,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(j,G){var oe,le;(oe=this._charSizeService)===null||oe===void 0||oe.measure(),(le=this.viewport)===null||le===void 0||le.syncScrollArea(!0)}clear(){var j;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let G=1;G<this.rows;G++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(j=this.viewport)===null||j===void 0||j.reset(),this.refresh(0,this.rows-1)}}reset(){var j,G;this.options.rows=this.rows,this.options.cols=this.cols;const oe=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)===null||j===void 0||j.reset(),this._decorationService.reset(),(G=this.viewport)===null||G===void 0||G.reset(),this._customKeyEventHandler=oe,this.refresh(0,this.rows-1)}clearTextureAtlas(){var j;(j=this._renderService)===null||j===void 0||j.clearTextureAtlas()}_reportFocus(){var j;!((j=this.element)===null||j===void 0)&&j.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(j){if(this._renderService)switch(j){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const G=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${oe};${G}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${me};${le}t`)}}cancel(j,G){if(this.options.cancelEvents||G)return j.preventDefault(),j.stopPropagation(),!1}}l.Terminal=ae},9924:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const w=d-this._lastRefreshMs,C=this._debounceThresholdMS-w;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(v,l,u){var h=this&&this.__decorate||function(g,_,y,E){var T,A=arguments.length,O=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(g,_,y,E);else for(var x=g.length-1;x>=0;x--)(T=g[x])&&(O=(A<3?T(O):A>3?T(_,y,O):T(_,y))||O);return A>3&&O&&Object.defineProperty(_,y,O),O},b=this&&this.__param||function(g,_){return function(y,E){_(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),w=u(4725),C=u(8460),R=u(844),D=u(2585);let m=l.Viewport=class extends R.Disposable{constructor(g,_,y,E,T,A,O,x){super(),this._viewportElement=g,this._scrollArea=_,this._bufferService=y,this._optionsService=E,this._charSizeService=T,this._renderService=A,this._coreBrowserService=O,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,_){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&y<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const _=this._getPixelsScrolled(g);return _!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(g,_))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let _=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(g,_){var y;let E,T="";const A=[],O=_??this._bufferService.buffer.lines.length,x=this._bufferService.buffer.lines;for(let L=g;L<O;L++){const I=x.get(L);if(!I)continue;const V=(y=x.get(L+1))===null||y===void 0?void 0:y.isWrapped;if(T+=I.translateToString(!V),!V||L===x.length-1){const P=document.createElement("div");P.textContent=T,A.push(P),T.length>0&&(E=P),T=""}}return{bufferElements:A,cursorElement:E}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let _=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(g,_){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&_.altKey||y==="ctrl"&&_.ctrlKey||y==="shift"&&_.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const _=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(g,_))}};l.Viewport=m=h([b(2,D.IBufferService),b(3,D.IOptionsService),b(4,w.ICharSizeService),b(5,w.IRenderService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],m)},3107:function(v,l,u){var h=this&&this.__decorate||function(m,g,_,y){var E,T=arguments.length,A=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,g,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(T<3?E(A):T>3?E(g,_,A):E(g,_))||A);return T>3&&A&&Object.defineProperty(g,_,A),A},b=this&&this.__param||function(m,g){return function(_,y){g(_,y,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(3656),w=u(4725),C=u(844),R=u(2585);let D=l.BufferDecorationRenderer=class extends C.Disposable{constructor(m,g,_,y){super(),this._screenElement=m,this._bufferService=g,this._decorationService=_,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,d.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,C.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var g,_;const y=document.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((g=m==null?void 0:m.options)===null||g===void 0?void 0:g.layer)==="top"),y.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const E=(_=m.options.x)!==null&&_!==void 0?_:0;return E&&E>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(m,y),y}_refreshStyle(m){const g=m.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let _=this._decorationElements.get(m);_||(_=this._createElement(m),m.element=_,this._decorationElements.set(m,_),this._container.appendChild(_),m.onDispose((()=>{this._decorationElements.delete(m),_.remove()}))),_.style.top=g*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(_)}}_refreshXPosition(m,g=m.element){var _;if(!g)return;const y=(_=m.options.x)!==null&&_!==void 0?_:0;(m.options.anchor||"left")==="right"?g.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var g;(g=this._decorationElements.get(m))===null||g===void 0||g.remove(),this._decorationElements.delete(m),m.dispose()}};l.BufferDecorationRenderer=D=h([b(1,R.IBufferService),b(2,R.IDecorationService),b(3,w.IRenderService)],D)},5871:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,b){return h>=u.startBufferLine-this._linePadding[b||"full"]&&h<=u.endBufferLine+this._linePadding[b||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(v,l,u){var h=this&&this.__decorate||function(E,T,A,O){var x,L=arguments.length,I=L<3?T:O===null?O=Object.getOwnPropertyDescriptor(T,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(E,T,A,O);else for(var V=E.length-1;V>=0;V--)(x=E[V])&&(I=(L<3?x(I):L>3?x(T,A,I):x(T,A))||I);return L>3&&I&&Object.defineProperty(T,A,I),I},b=this&&this.__param||function(E,T){return function(A,O){T(A,O,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),w=u(3656),C=u(4725),R=u(844),D=u(2585),m={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let y=l.OverviewRulerRenderer=class extends R.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(E,T,A,O,x,L,I){var V;super(),this._viewportElement=E,this._screenElement=T,this._bufferService=A,this._decorationService=O,this._renderService=x,this._optionsService=L,this._coreBrowseService=I,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(V=this._viewportElement.parentElement)===null||V===void 0||V.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,R.toDisposable)((()=>{var $;($=this._canvas)===null||$===void 0||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register((0,w.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const E=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=E,g.center=T,g.right=E,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=g.left,_.right=g.left+g.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowseService.dpr);const E=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(E,12),6)*this._coreBrowseService.dpr);m.left=T,m.center=T,m.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const E=this._colorZoneStore.zones;for(const T of E)T.position!=="full"&&this._renderColorZone(T);for(const T of E)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(E){this._ctx.fillStyle=E.color,this._ctx.fillRect(_[E.position||"full"],Math.round((this._canvas.height-1)*(E.startBufferLine/this._bufferService.buffers.active.lines.length)-m[E.position||"full"]/2),g[E.position||"full"],Math.round((this._canvas.height-1)*((E.endBufferLine-E.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[E.position||"full"]))}_queueRefresh(E,T){this._shouldUpdateDimensions=E||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=y=h([b(2,D.IBufferService),b(3,D.IDecorationService),b(4,C.IRenderService),b(5,D.IOptionsService),b(6,C.ICoreBrowserService)],y)},2950:function(v,l,u){var h=this&&this.__decorate||function(D,m,g,_){var y,E=arguments.length,T=E<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(D,m,g,_);else for(var A=D.length-1;A>=0;A--)(y=D[A])&&(T=(E<3?y(T):E>3?y(m,g,T):y(m,g))||T);return E>3&&T&&Object.defineProperty(m,g,T),T},b=this&&this.__param||function(D,m){return function(g,_){m(g,_,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),w=u(2585),C=u(2584);let R=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(D,m,g,_,y,E){this._textarea=D,this._compositionView=m,this._bufferService=g,this._optionsService=_,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(D){this._compositionView.textContent=D.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(D){if(this._isComposing||this._isSendingComposition){if(D.keyCode===229||D.keyCode===16||D.keyCode===17||D.keyCode===18)return!1;this._finalizeComposition(!1)}return D.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(D){if(this._compositionView.classList.remove("active"),this._isComposing=!1,D){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const D=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,g=m.replace(D,"");this._dataAlreadySent=g,m.length>D.length?this._coreService.triggerDataEvent(g,!0):m.length<D.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):m.length===D.length&&m!==D&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(D){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}D||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=R=h([b(2,w.IBufferService),b(3,w.IOptionsService),b(4,w.ICoreService),b(5,d.IRenderService)],R)},9806:(v,l)=>{function u(h,b,d){const w=d.getBoundingClientRect(),C=h.getComputedStyle(d),R=parseInt(C.getPropertyValue("padding-left")),D=parseInt(C.getPropertyValue("padding-top"));return[b.clientX-w.left-R,b.clientY-w.top-D]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(h,b,d,w,C,R,D,m,g){if(!R)return;const _=u(h,b,d);return _?(_[0]=Math.ceil((_[0]+(g?D/2:0))/D),_[1]=Math.ceil(_[1]/m),_[0]=Math.min(Math.max(_[0],1),w+(g?1:0)),_[1]=Math.min(Math.max(_[1],1),C),_):void 0}},9504:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=u(2584);function b(m,g,_,y){const E=m-d(m,_),T=g-d(g,_),A=Math.abs(E-T)-(function(O,x,L){let I=0;const V=O-d(O,L),P=x-d(x,L);for(let $=0;$<Math.abs(V-P);$++){const Z=w(O,x)==="A"?-1:1,W=L.buffer.lines.get(V+Z*$);W!=null&&W.isWrapped&&I++}return I})(m,g,_);return D(A,R(w(m,g),y))}function d(m,g){let _=0,y=g.buffer.lines.get(m),E=y==null?void 0:y.isWrapped;for(;E&&m>=0&&m<g.rows;)_++,y=g.buffer.lines.get(--m),E=y==null?void 0:y.isWrapped;return _}function w(m,g){return m>g?"A":"B"}function C(m,g,_,y,E,T){let A=m,O=g,x="";for(;A!==_||O!==y;)A+=E?1:-1,E&&A>T.cols-1?(x+=T.buffer.translateBufferLineToString(O,!1,m,A),A=0,m=0,O++):!E&&A<0&&(x+=T.buffer.translateBufferLineToString(O,!1,0,m+1),A=T.cols-1,m=A,O--);return x+T.buffer.translateBufferLineToString(O,!1,m,A)}function R(m,g){const _=g?"O":"[";return h.C0.ESC+_+m}function D(m,g){m=Math.floor(m);let _="";for(let y=0;y<m;y++)_+=g;return _}l.moveToCellSequence=function(m,g,_,y){const E=_.buffer.x,T=_.buffer.y;if(!_.buffer.hasScrollback)return(function(x,L,I,V,P,$){return b(L,V,P,$).length===0?"":D(C(x,L,x,L-d(L,P),!1,P).length,R("D",$))})(E,T,0,g,_,y)+b(T,g,_,y)+(function(x,L,I,V,P,$){let Z;Z=b(L,V,P,$).length>0?V-d(V,P):L;const W=V,q=(function(Y,k,z,K,B,F){let X;return X=b(z,K,B,F).length>0?K-d(K,B):k,Y<z&&X<=K||Y>=z&&X<K?"C":"D"})(x,L,I,V,P,$);return D(C(x,Z,I,W,q==="C",P).length,R(q,$))})(E,T,m,g,_,y);let A;if(T===g)return A=E>m?"D":"C",D(Math.abs(E-m),R(A,y));A=T>g?"D":"C";const O=Math.abs(T-g);return D((function(x,L){return L.cols-x})(T>g?m:E,_)+(O-1)*_.cols+1+((T>g?E:m)-1),R(A,y))}},1296:function(v,l,u){var h=this&&this.__decorate||function(P,$,Z,W){var q,Y=arguments.length,k=Y<3?$:W===null?W=Object.getOwnPropertyDescriptor($,Z):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(P,$,Z,W);else for(var z=P.length-1;z>=0;z--)(q=P[z])&&(k=(Y<3?q(k):Y>3?q($,Z,k):q($,Z))||k);return Y>3&&k&&Object.defineProperty($,Z,k),k},b=this&&this.__param||function(P,$){return function(Z,W){$(Z,W,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),w=u(2550),C=u(2223),R=u(6171),D=u(4725),m=u(8055),g=u(8460),_=u(844),y=u(2585),E="xterm-dom-renderer-owner-",T="xterm-rows",A="xterm-fg-",O="xterm-bg-",x="xterm-focus",L="xterm-selection";let I=1,V=l.DomRenderer=class extends _.Disposable{constructor(P,$,Z,W,q,Y,k,z,K,B){super(),this._element=P,this._screenElement=$,this._viewportElement=Z,this._linkifier2=W,this._charSizeService=Y,this._optionsService=k,this._bufferService=z,this._coreBrowserService=K,this._themeService=B,this._terminalClass=I++,this._rowElements=[],this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(T),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,R.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((F=>this._injectCss(F)))),this._injectCss(this._themeService.colors),this._rowFactory=q.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((F=>this._handleLinkHover(F)))),this.register(this._linkifier2.onHideLinkUnderline((F=>this._handleLinkLeave(F)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new w.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Z of this._rowElements)Z.style.width=`${this.dimensions.css.canvas.width}px`,Z.style.height=`${this.dimensions.css.cell.height}px`,Z.style.lineHeight=`${this.dimensions.css.cell.height}px`,Z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${T} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${T} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${T} .xterm-dim { color: ${m.color.multiplyOpacity(P.foreground,.5).css};}`,$+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,$+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",$+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,$+=`${this._terminalSelector} .${T}.${x} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${T}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,W]of P.ansi.entries())$+=`${this._terminalSelector} .${A}${Z} { color: ${W.css}; }${this._terminalSelector} .${A}${Z}.xterm-dim { color: ${m.color.multiplyOpacity(W,.5).css}; }${this._terminalSelector} .${O}${Z} { background-color: ${W.css}; }`;$+=`${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(P.background).css}; }${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${O}${C.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,$){for(let Z=this._rowElements.length;Z<=$;Z++){const W=document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,$){this._refreshRowElements(P,$),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(x)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,$,Z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,$,Z),this.renderRows(0,this._bufferService.rows-1),!P||!$)return;const W=P[1]-this._bufferService.buffer.ydisp,q=$[1]-this._bufferService.buffer.ydisp,Y=Math.max(W,0),k=Math.min(q,this._bufferService.rows-1);if(Y>=this._bufferService.rows||k<0)return;const z=document.createDocumentFragment();if(Z){const K=P[0]>$[0];z.appendChild(this._createSelectionElement(Y,K?$[0]:P[0],K?P[0]:$[0],k-Y+1))}else{const K=W===Y?P[0]:0,B=Y===q?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(Y,K,B));const F=k-Y-1;if(z.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,F)),Y!==k){const X=q===k?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(k,0,X))}}this._selectionContainer.appendChild(z)}_createSelectionElement(P,$,Z,W=1){const q=document.createElement("div");return q.style.height=W*this.dimensions.css.cell.height+"px",q.style.top=P*this.dimensions.css.cell.height+"px",q.style.left=$*this.dimensions.css.cell.width+"px",q.style.width=this.dimensions.css.cell.width*(Z-$)+"px",q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const P of this._rowElements)P.replaceChildren()}renderRows(P,$){const Z=this._bufferService.buffer,W=Z.ybase+Z.y,q=Math.min(Z.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,k=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=P;K<=$;K++){const B=K+Z.ydisp,F=this._rowElements[K],X=Z.lines.get(B);if(!F||!X)break;F.replaceChildren(...this._rowFactory.createRow(X,B,B===W,k,z,q,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,$,Z,W,q,Y){Z<0&&(P=0),W<0&&($=0);const k=this._bufferService.rows-1;Z=Math.max(Math.min(Z,k),0),W=Math.max(Math.min(W,k),0),q=Math.min(q,this._bufferService.cols);const z=this._bufferService.buffer,K=z.ybase+z.y,B=Math.min(z.x,q-1),F=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,ne=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=Z;ae<=W;++ae){const pe=ae+z.ydisp,j=this._rowElements[ae],G=z.lines.get(pe);if(!j||!G)break;j.replaceChildren(...this._rowFactory.createRow(G,pe,pe===K,X,ne,B,F,this.dimensions.css.cell.width,this._widthCache,Y?ae===Z?P:0:-1,Y?(ae===W?$:q)-1:-1))}}};l.DomRenderer=V=h([b(4,y.IInstantiationService),b(5,D.ICharSizeService),b(6,y.IOptionsService),b(7,y.IBufferService),b(8,D.ICoreBrowserService),b(9,D.IThemeService)],V)},3787:function(v,l,u){var h=this&&this.__decorate||function(A,O,x,L){var I,V=arguments.length,P=V<3?O:L===null?L=Object.getOwnPropertyDescriptor(O,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(A,O,x,L);else for(var $=A.length-1;$>=0;$--)(I=A[$])&&(P=(V<3?I(P):V>3?I(O,x,P):I(O,x))||P);return V>3&&P&&Object.defineProperty(O,x,P),P},b=this&&this.__param||function(A,O){return function(x,L){O(x,L,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),w=u(643),C=u(511),R=u(2585),D=u(8055),m=u(4725),g=u(4269),_=u(6171),y=u(3734);let E=l.DomRendererRowFactory=class{constructor(A,O,x,L,I,V,P){this._document=A,this._characterJoinerService=O,this._optionsService=x,this._coreBrowserService=L,this._coreService=I,this._decorationService=V,this._themeService=P,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,O,x){this._selectionStart=A,this._selectionEnd=O,this._columnSelectMode=x}createRow(A,O,x,L,I,V,P,$,Z,W,q){const Y=[],k=this._characterJoinerService.getJoinedCharacters(O),z=this._themeService.colors;let K,B=A.getNoBgTrimmedLength();x&&B<V+1&&(B=V+1);let F=0,X="",ne=0,ae=0,pe=0,j=!1,G=0,oe=!1,le=0;const me=[],he=W!==-1&&q!==-1;for(let Ce=0;Ce<B;Ce++){A.loadCell(Ce,this._workCell);let Ve=this._workCell.getWidth();if(Ve===0)continue;let He=!1,xe=Ce,Ee=this._workCell;if(k.length>0&&Ce===k[0][0]){He=!0;const Qe=k.shift();Ee=new g.JoinedCellData(this._workCell,A.translateToString(!0,Qe[0],Qe[1]),Qe[1]-Qe[0]),xe=Qe[1]-1,Ve=Ee.getWidth()}const Ue=this._isCellInSelection(Ce,O),Fe=x&&Ce===V,st=he&&Ce>=W&&Ce<=q;let qe=!1;this._decorationService.forEachDecorationAtCell(Ce,O,void 0,(Qe=>{qe=!0}));let Ae=Ee.getChars()||w.WHITESPACE_CELL_CHAR;if(Ae===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Ae=" "),le=Ve*$-Z.get(Ae,Ee.isBold(),Ee.isItalic()),K){if(F&&(Ue&&oe||!Ue&&!oe&&Ee.bg===ne)&&(Ue&&oe&&z.selectionForeground||Ee.fg===ae)&&Ee.extended.ext===pe&&st===j&&le===G&&!Fe&&!He&&!qe){X+=Ae,F++;continue}F&&(K.textContent=X),K=this._document.createElement("span"),F=0,X=""}else K=this._document.createElement("span");if(ne=Ee.bg,ae=Ee.fg,pe=Ee.extended.ext,j=st,G=le,oe=Ue,He&&V>=Ce&&V<=xe&&(V=Ce),!this._coreService.isCursorHidden&&Fe){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&me.push("xterm-cursor-blink"),me.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":me.push("xterm-cursor-outline");break;case"block":me.push("xterm-cursor-block");break;case"bar":me.push("xterm-cursor-bar");break;case"underline":me.push("xterm-cursor-underline")}}if(Ee.isBold()&&me.push("xterm-bold"),Ee.isItalic()&&me.push("xterm-italic"),Ee.isDim()&&me.push("xterm-dim"),X=Ee.isInvisible()?w.WHITESPACE_CELL_CHAR:Ee.getChars()||w.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(me.push(`xterm-underline-${Ee.extended.underlineStyle}`),X===" "&&(X=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())K.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Qe=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Qe<8&&(Qe+=8),K.style.textDecorationColor=z.ansi[Qe].css}Ee.isOverline()&&(me.push("xterm-overline"),X===" "&&(X=" ")),Ee.isStrikethrough()&&me.push("xterm-strikethrough"),st&&(K.style.textDecoration="underline");let Ye=Ee.getFgColor(),Be=Ee.getFgColorMode(),at=Ee.getBgColor(),Wt=Ee.getBgColorMode();const Zt=!!Ee.isInverse();if(Zt){const Qe=Ye;Ye=at,at=Qe;const Jt=Be;Be=Wt,Wt=Jt}let et,nt,dt,It=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,O,void 0,(Qe=>{Qe.options.layer!=="top"&&It||(Qe.backgroundColorRGB&&(Wt=50331648,at=Qe.backgroundColorRGB.rgba>>8&16777215,et=Qe.backgroundColorRGB),Qe.foregroundColorRGB&&(Be=50331648,Ye=Qe.foregroundColorRGB.rgba>>8&16777215,nt=Qe.foregroundColorRGB),It=Qe.options.layer==="top")})),!It&&Ue&&(et=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,at=et.rgba>>8&16777215,Wt=50331648,It=!0,z.selectionForeground&&(Be=50331648,Ye=z.selectionForeground.rgba>>8&16777215,nt=z.selectionForeground)),It&&me.push("xterm-decoration-top"),Wt){case 16777216:case 33554432:dt=z.ansi[at],me.push(`xterm-bg-${at}`);break;case 50331648:dt=D.rgba.toColor(at>>16,at>>8&255,255&at),this._addStyle(K,`background-color:#${T((at>>>0).toString(16),"0",6)}`);break;default:Zt?(dt=z.foreground,me.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):dt=z.background}switch(et||Ee.isDim()&&(et=D.color.multiplyOpacity(dt,.5)),Be){case 16777216:case 33554432:Ee.isBold()&&Ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ye+=8),this._applyMinimumContrast(K,dt,z.ansi[Ye],Ee,et,void 0)||me.push(`xterm-fg-${Ye}`);break;case 50331648:const Qe=D.rgba.toColor(Ye>>16&255,Ye>>8&255,255&Ye);this._applyMinimumContrast(K,dt,Qe,Ee,et,nt)||this._addStyle(K,`color:#${T(Ye.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(K,dt,z.foreground,Ee,et,void 0)||Zt&&me.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}me.length&&(K.className=me.join(" "),me.length=0),Fe||He||qe?K.textContent=X:F++,le!==this.defaultSpacing&&(K.style.letterSpacing=`${le}px`),Y.push(K),Ce=xe}return K&&F&&(K.textContent=X),Y}_applyMinimumContrast(A,O,x,L,I,V){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.excludeFromContrastRatioDemands)(L.getCode()))return!1;const P=this._getContrastCache(L);let $;if(I||V||($=P.getColor(O.rgba,x.rgba)),$===void 0){const Z=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);$=D.color.ensureContrastRatio(I||O,V||x,Z),P.setColor((I||O).rgba,(V||x).rgba,$??null)}return!!$&&(this._addStyle(A,`color:${$.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,O){A.setAttribute("style",`${A.getAttribute("style")||""}${O};`)}_isCellInSelection(A,O){const x=this._selectionStart,L=this._selectionEnd;return!(!x||!L)&&(this._columnSelectMode?x[0]<=L[0]?A>=x[0]&&O>=x[1]&&A<L[0]&&O<=L[1]:A<x[0]&&O>=x[1]&&A>=L[0]&&O<=L[1]:O>x[1]&&O<L[1]||x[1]===L[1]&&O===x[1]&&A>=x[0]&&A<L[0]||x[1]<L[1]&&O===L[1]&&A<L[0]||x[1]<L[1]&&O===x[1]&&A>=x[0])}};function T(A,O,x){for(;A.length<x;)A=O+A;return A}l.DomRendererRowFactory=E=h([b(1,m.ICharacterJoinerService),b(2,R.IOptionsService),b(3,m.ICoreBrowserService),b(4,R.ICoreService),b(5,R.IDecorationService),b(6,m.IThemeService)],E)},2550:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const h=u.createElement("span"),b=u.createElement("span");b.style.fontWeight="bold";const d=u.createElement("span");d.style.fontStyle="italic";const w=u.createElement("span");w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[h,b,d,w],this._container.appendChild(h),this._container.appendChild(b),this._container.appendChild(d),this._container.appendChild(w),u.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,b,d){u===this._font&&h===this._fontSize&&b===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=h,this._weight=b,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,h,b){let d=0;if(!h&&!b&&u.length===1&&(d=u.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(u,0);let w=u;h&&(w+="B"),b&&(w+="I");let C=this._holey.get(w);if(C===void 0){let R=0;h&&(R|=1),b&&(R|=2),C=this._measure(u,R),this._holey.set(w,C)}return C}_measure(u,h){const b=this._measureElements[h];return b.textContent=u.repeat(32),b.offsetWidth/32}}},2223:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(v,l)=>{function u(h){return 57508<=h&&h<=57558}Object.defineProperty(l,"__esModule",{value:!0}),l.createRenderDimensions=l.excludeFromContrastRatioDemands=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},l.excludeFromContrastRatioDemands=function(h){return u(h)||(function(b){return 9472<=b&&b<=9631})(h)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,l,u){var h=this&&this.__decorate||function(m,g,_,y){var E,T=arguments.length,A=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,g,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(T<3?E(A):T>3?E(g,_,A):E(g,_))||A);return T>3&&A&&Object.defineProperty(g,_,A),A},b=this&&this.__param||function(m,g){return function(_,y){g(_,y,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),w=u(8460),C=u(844);let R=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,g,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new w.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new D(m,g,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};l.CharSizeService=R=h([b(2,d.IOptionsService)],R);class D{constructor(g,_,y){this._document=g,this._parentElement=_,this._optionsService=y,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const g={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return g.width!==0&&g.height!==0&&(this._result.width=g.width/32,this._result.height=Math.ceil(g.height)),this._result}}},4269:function(v,l,u){var h=this&&this.__decorate||function(g,_,y,E){var T,A=arguments.length,O=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(g,_,y,E);else for(var x=g.length-1;x>=0;x--)(T=g[x])&&(O=(A<3?T(O):A>3?T(_,y,O):T(_,y))||O);return A>3&&O&&Object.defineProperty(_,y,O),O},b=this&&this.__param||function(g,_){return function(y,E){_(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),w=u(643),C=u(511),R=u(2585);class D extends d.AttributeData{constructor(_,y,E){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=D;let m=l.CharacterJoinerService=class B1{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(_){const y={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(y),y.id}deregister(_){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===_)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(_);if(!y||y.length===0)return[];const E=[],T=y.translateToString(!0);let A=0,O=0,x=0,L=y.getFg(0),I=y.getBg(0);for(let V=0;V<y.getTrimmedLength();V++)if(y.loadCell(V,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==I){if(V-A>1){const P=this._getJoinedRanges(T,x,O,y,A);for(let $=0;$<P.length;$++)E.push(P[$])}A=V,x=O,L=this._workCell.fg,I=this._workCell.bg}O+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const V=this._getJoinedRanges(T,x,O,y,A);for(let P=0;P<V.length;P++)E.push(V[P])}return E}_getJoinedRanges(_,y,E,T,A){const O=_.substring(y,E);let x=[];try{x=this._characterJoiners[0].handler(O)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const I=this._characterJoiners[L].handler(O);for(let V=0;V<I.length;V++)B1._mergeRanges(x,I[V])}catch(I){console.error(I)}return this._stringRangesToCellRanges(x,T,A),x}_stringRangesToCellRanges(_,y,E){let T=0,A=!1,O=0,x=_[T];if(x){for(let L=E;L<this._bufferService.cols;L++){const I=y.getWidth(L),V=y.getString(L).length||w.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!A&&x[0]<=O&&(x[0]=L,A=!0),x[1]<=O){if(x[1]=L,x=_[++T],!x)break;x[0]<=O?(x[0]=L,A=!0):A=!1}O+=V}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(_,y){let E=!1;for(let T=0;T<_.length;T++){const A=_[T];if(E){if(y[1]<=A[0])return _[T-1][1]=y[1],_;if(y[1]<=A[1])return _[T-1][1]=Math.max(y[1],A[1]),_.splice(T,1),_;_.splice(T,1),T--}else{if(y[1]<=A[0])return _.splice(T,0,y),_;if(y[1]<=A[1])return A[0]=Math.min(y[0],A[0]),_;y[0]<A[1]&&(A[0]=Math.min(y[0],A[0]),E=!0)}}return E?_[_.length-1][1]=y[1]:_.push(y),_}};l.CharacterJoinerService=m=h([b(0,R.IBufferService)],m)},5114:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0,l.CoreBrowserService=class{constructor(u,h){this._textarea=u,this.window=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}},8934:function(v,l,u){var h=this&&this.__decorate||function(R,D,m,g){var _,y=arguments.length,E=y<3?D:g===null?g=Object.getOwnPropertyDescriptor(D,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(R,D,m,g);else for(var T=R.length-1;T>=0;T--)(_=R[T])&&(E=(y<3?_(E):y>3?_(D,m,E):_(D,m))||E);return y>3&&E&&Object.defineProperty(D,m,E),E},b=this&&this.__param||function(R,D){return function(m,g){D(m,g,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),w=u(9806);let C=l.MouseService=class{constructor(R,D){this._renderService=R,this._charSizeService=D}getCoords(R,D,m,g,_){return(0,w.getCoords)(window,R,D,m,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(R,D){const m=(0,w.getCoordsRelativeToElement)(window,R,D);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};l.MouseService=C=h([b(0,d.IRenderService),b(1,d.ICharSizeService)],C)},3230:function(v,l,u){var h=this&&this.__decorate||function(E,T,A,O){var x,L=arguments.length,I=L<3?T:O===null?O=Object.getOwnPropertyDescriptor(T,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(E,T,A,O);else for(var V=E.length-1;V>=0;V--)(x=E[V])&&(I=(L<3?x(I):L>3?x(T,A,I):x(T,A))||I);return L>3&&I&&Object.defineProperty(T,A,I),I},b=this&&this.__param||function(E,T){return function(A,O){T(A,O,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(3656),w=u(6193),C=u(5596),R=u(4725),D=u(8460),m=u(844),g=u(7226),_=u(2585);let y=l.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(E,T,A,O,x,L,I,V){if(super(),this._rowCount=E,this._charSizeService=O,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new D.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new D.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new D.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new w.RenderDebouncer(I.window,((P,$)=>this._renderRows(P,$))),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(I.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var P;return(P=this._renderer.value)===null||P===void 0?void 0:P.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(x.onDecorationRegistered((()=>this._fullRefresh()))),this.register(x.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register((0,d.addDisposableDomListener)(I.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(V.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in I.window){const P=new I.window.IntersectionObserver(($=>this._handleIntersectionChange($[$.length-1])),{threshold:0});P.observe(T),this.register({dispose:()=>P.disconnect()})}}_handleIntersectionChange(E){this._isPaused=E.isIntersecting===void 0?E.intersectionRatio===0:!E.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(E,T,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(E,T,this._rowCount))}_renderRows(E,T){this._renderer.value&&(E=Math.min(E,this._rowCount-1),T=Math.min(T,this._rowCount-1),this._renderer.value.renderRows(E,T),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:E,end:T}),this._onRender.fire({start:E,end:T}),this._isNextRenderRedrawOnly=!0)}resize(E,T){this._rowCount=T,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(E){this._renderer.value=E,this._renderer.value.onRequestRedraw((T=>this.refreshRows(T.start,T.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(E){return this._renderDebouncer.addRefreshCallback(E)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var E,T;this._renderer.value&&((T=(E=this._renderer.value).clearTextureAtlas)===null||T===void 0||T.call(E),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(E,T){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(E,T))):this._renderer.value.handleResize(E,T),this._fullRefresh())}handleCharSizeChanged(){var E;(E=this._renderer.value)===null||E===void 0||E.handleCharSizeChanged()}handleBlur(){var E;(E=this._renderer.value)===null||E===void 0||E.handleBlur()}handleFocus(){var E;(E=this._renderer.value)===null||E===void 0||E.handleFocus()}handleSelectionChanged(E,T,A){var O;this._selectionState.start=E,this._selectionState.end=T,this._selectionState.columnSelectMode=A,(O=this._renderer.value)===null||O===void 0||O.handleSelectionChanged(E,T,A)}handleCursorMove(){var E;(E=this._renderer.value)===null||E===void 0||E.handleCursorMove()}clear(){var E;(E=this._renderer.value)===null||E===void 0||E.clear()}};l.RenderService=y=h([b(2,_.IOptionsService),b(3,R.ICharSizeService),b(4,_.IDecorationService),b(5,_.IBufferService),b(6,R.ICoreBrowserService),b(7,R.IThemeService)],y)},9312:function(v,l,u){var h=this&&this.__decorate||function(x,L,I,V){var P,$=arguments.length,Z=$<3?L:V===null?V=Object.getOwnPropertyDescriptor(L,I):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(x,L,I,V);else for(var W=x.length-1;W>=0;W--)(P=x[W])&&(Z=($<3?P(Z):$>3?P(L,I,Z):P(L,I))||Z);return $>3&&Z&&Object.defineProperty(L,I,Z),Z},b=this&&this.__param||function(x,L){return function(I,V){L(I,V,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),w=u(9504),C=u(456),R=u(4725),D=u(8460),m=u(844),g=u(6114),_=u(4841),y=u(511),E=u(2585),T=" ",A=new RegExp(T,"g");let O=l.SelectionService=class extends m.Disposable{constructor(x,L,I,V,P,$,Z,W,q){super(),this._element=x,this._screenElement=L,this._linkifier=I,this._bufferService=V,this._coreService=P,this._mouseService=$,this._optionsService=Z,this._renderService=W,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new D.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new D.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new D.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!x||!L||x[0]===L[0]&&x[1]===L[1])}get selectionText(){const x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!x||!L)return"";const I=this._bufferService.buffer,V=[];if(this._activeSelectionMode===3){if(x[0]===L[0])return"";const P=x[0]<L[0]?x[0]:L[0],$=x[0]<L[0]?L[0]:x[0];for(let Z=x[1];Z<=L[1];Z++){const W=I.translateBufferLineToString(Z,!0,P,$);V.push(W)}}else{const P=x[1]===L[1]?L[0]:void 0;V.push(I.translateBufferLineToString(x[1],!0,x[0],P));for(let $=x[1]+1;$<=L[1]-1;$++){const Z=I.lines.get($),W=I.translateBufferLineToString($,!0);Z!=null&&Z.isWrapped?V[V.length-1]+=W:V.push(W)}if(x[1]!==L[1]){const $=I.lines.get(L[1]),Z=I.translateBufferLineToString(L[1],!0,0,L[0]);$&&$.isWrapped?V[V.length-1]+=Z:V.push(Z)}}return V.map((P=>P.replace(A," "))).join(g.isWindows?`\r
|
|
328
|
+
`:`
|
|
329
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&x&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(x){const L=this._getMouseBufferCoords(x),I=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!!(I&&V&&L)&&this._areCoordsInSelection(L,I,V)}isCellInSelection(x,L){const I=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!(!I||!V)&&this._areCoordsInSelection([x,L],I,V)}_areCoordsInSelection(x,L,I){return x[1]>L[1]&&x[1]<I[1]||L[1]===I[1]&&x[1]===L[1]&&x[0]>=L[0]&&x[0]<I[0]||L[1]<I[1]&&x[1]===I[1]&&x[0]<I[0]||L[1]<I[1]&&x[1]===L[1]&&x[0]>=L[0]}_selectWordAtCursor(x,L){var I,V;const P=(V=(I=this._linkifier.currentLink)===null||I===void 0?void 0:I.link)===null||V===void 0?void 0:V.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(x);return!!$&&(this._selectWordAt($,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,L){this._model.clearSelection(),x=Math.max(x,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const L=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(x){let L=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=I?0:(L>I&&(L-=I),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(x){return g.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const L=this._getMouseBufferCoords(x);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(x){return x.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const V=I.lines.get(this._model.selectionEnd[1]);V&&V.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const L=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const V=(0,w.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(V,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,I=!(!x||!L||x[0]===L[0]&&x[1]===L[1]);I?x&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,L,I)):this._oldHasSelection&&this._fireOnSelectionChange(x,L,I)}_fireOnSelectionChange(x,L,I){this._oldSelectionStart=x,this._oldSelectionEnd=L,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(x,L){let I=L;for(let V=0;L>=V;V++){const P=x.loadCell(V,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:P>1&&L!==V&&(I+=P-1)}return I}setSelection(x,L,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,L],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,L,I=!0,V=!0){if(x[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,$=P.lines.get(x[1]);if(!$)return;const Z=P.translateBufferLineToString(x[1],!1);let W=this._convertViewportColToCharacterIndex($,x[0]),q=W;const Y=x[0]-W;let k=0,z=0,K=0,B=0;if(Z.charAt(W)===" "){for(;W>0&&Z.charAt(W-1)===" ";)W--;for(;q<Z.length&&Z.charAt(q+1)===" ";)q++}else{let ne=x[0],ae=x[0];$.getWidth(ne)===0&&(k++,ne--),$.getWidth(ae)===2&&(z++,ae++);const pe=$.getString(ae).length;for(pe>1&&(B+=pe-1,q+=pe-1);ne>0&&W>0&&!this._isCharWordSeparator($.loadCell(ne-1,this._workCell));){$.loadCell(ne-1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===0?(k++,ne--):j>1&&(K+=j-1,W-=j-1),W--,ne--}for(;ae<$.length&&q+1<Z.length&&!this._isCharWordSeparator($.loadCell(ae+1,this._workCell));){$.loadCell(ae+1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ae++):j>1&&(B+=j-1,q+=j-1),q++,ae++}}q++;let F=W+Y-k+K,X=Math.min(this._bufferService.cols,q-W+k+z-K-B);if(L||Z.slice(W,q).trim()!==""){if(I&&F===0&&$.getCodePoint(0)!==32){const ne=P.lines.get(x[1]-1);if(ne&&$.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(ae){const pe=this._bufferService.cols-ae.start;F-=pe,X+=pe}}}if(V&&F+X===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const ne=P.lines.get(x[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ae=this._getWordAt([0,x[1]+1],!1,!1,!0);ae&&(X+=ae.length)}}return{start:F,length:X}}}_selectWordAt(x,L){const I=this._getWordAt(x,L);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[I.start,x[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(x){const L=this._getWordAt(x,!0);if(L){let I=x[1];for(;L.start<0;)L.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,I]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const L=this._bufferService.buffer.getWrappedRangeForLine(x),I={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=O=h([b(3,E.IBufferService),b(4,E.ICoreService),b(5,R.IMouseService),b(6,E.IOptionsService),b(7,R.IRenderService),b(8,R.ICoreBrowserService)],O)},4725:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=u(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService")},6731:function(v,l,u){var h=this&&this.__decorate||function(O,x,L,I){var V,P=arguments.length,$=P<3?x:I===null?I=Object.getOwnPropertyDescriptor(x,L):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(O,x,L,I);else for(var Z=O.length-1;Z>=0;Z--)(V=O[Z])&&($=(P<3?V($):P>3?V(x,L,$):V(x,L))||$);return P>3&&$&&Object.defineProperty(x,L,$),$},b=this&&this.__param||function(O,x){return function(L,I){x(L,I,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),w=u(8055),C=u(8460),R=u(844),D=u(2585),m=w.css.toColor("#ffffff"),g=w.css.toColor("#000000"),_=w.css.toColor("#ffffff"),y=w.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const O=[w.css.toColor("#2e3436"),w.css.toColor("#cc0000"),w.css.toColor("#4e9a06"),w.css.toColor("#c4a000"),w.css.toColor("#3465a4"),w.css.toColor("#75507b"),w.css.toColor("#06989a"),w.css.toColor("#d3d7cf"),w.css.toColor("#555753"),w.css.toColor("#ef2929"),w.css.toColor("#8ae234"),w.css.toColor("#fce94f"),w.css.toColor("#729fcf"),w.css.toColor("#ad7fa8"),w.css.toColor("#34e2e2"),w.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let L=0;L<216;L++){const I=x[L/36%6|0],V=x[L/6%6|0],P=x[L%6];O.push({css:w.channels.toCss(I,V,P),rgba:w.channels.toRgba(I,V,P)})}for(let L=0;L<24;L++){const I=8+10*L;O.push({css:w.channels.toCss(I,I,I),rgba:w.channels.toRgba(I,I,I)})}return O})());let T=l.ThemeService=class extends R.Disposable{get colors(){return this._colors}constructor(O){super(),this._optionsService=O,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:g,cursor:_,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:w.color.blend(g,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:w.color.blend(g,E),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(O={}){const x=this._colors;if(x.foreground=A(O.foreground,m),x.background=A(O.background,g),x.cursor=A(O.cursor,_),x.cursorAccent=A(O.cursorAccent,y),x.selectionBackgroundTransparent=A(O.selectionBackground,E),x.selectionBackgroundOpaque=w.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=A(O.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=w.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=O.selectionForeground?A(O.selectionForeground,w.NULL_COLOR):void 0,x.selectionForeground===w.NULL_COLOR&&(x.selectionForeground=void 0),w.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=w.color.opacity(x.selectionBackgroundTransparent,.3)),w.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=w.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=l.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=A(O.black,l.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=A(O.red,l.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=A(O.green,l.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=A(O.yellow,l.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=A(O.blue,l.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=A(O.magenta,l.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=A(O.cyan,l.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=A(O.white,l.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=A(O.brightBlack,l.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=A(O.brightRed,l.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=A(O.brightGreen,l.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=A(O.brightYellow,l.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=A(O.brightBlue,l.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=A(O.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=A(O.brightCyan,l.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=A(O.brightWhite,l.DEFAULT_ANSI_COLORS[15]),O.extendedAnsi){const L=Math.min(x.ansi.length-16,O.extendedAnsi.length);for(let I=0;I<L;I++)x.ansi[I+16]=A(O.extendedAnsi[I],l.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(O){this._restoreColor(O),this._onChangeColors.fire(this.colors)}_restoreColor(O){if(O!==void 0)switch(O){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[O]=this._restoreColors.ansi[O]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(O){O(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function A(O,x){if(O!==void 0)try{return w.css.toColor(O)}catch{}return x}l.ThemeService=T=h([b(0,D.IOptionsService)],T)},6349:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=u(8460),b=u(844);class d extends b.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const R=new Array(C);for(let D=0;D<Math.min(C,this.length);D++)R[D]=this._array[this._getCyclicIndex(D)];this._array=R,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let R=this._length;R<C;R++)this._array[R]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,R){this._array[this._getCyclicIndex(C)]=R}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,R,...D){if(R){for(let m=C;m<this._length-R;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+R)];this._length-=R,this.onDeleteEmitter.fire({index:C,amount:R})}for(let m=this._length-1;m>=C;m--)this._array[this._getCyclicIndex(m+D.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<D.length;m++)this._array[this._getCyclicIndex(C+m)]=D[m];if(D.length&&this.onInsertEmitter.fire({index:C,amount:D.length}),this._length+D.length>this._maxLength){const m=this._length+D.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=D.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,R,D){if(!(R<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+D<0)throw new Error("Cannot shift elements in list beyond index 0");if(D>0){for(let g=R-1;g>=0;g--)this.set(C+g+D,this.get(C+g));const m=C+R+D-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<R;m++)this.set(C+m+D,this.get(C+m))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=d},1439:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(h,b=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const w in h)d[w]=b<=1?h[w]:h[w]&&u(h[w],b-1);return d}},8055:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const h=u(6114);let b=0,d=0,w=0,C=0;var R,D,m,g,_;function y(T){const A=T.toString(16);return A.length<2?"0"+A:A}function E(T,A){return T<A?(A+.05)/(T+.05):(T+.05)/(A+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(T){T.toCss=function(A,O,x,L){return L!==void 0?`#${y(A)}${y(O)}${y(x)}${y(L)}`:`#${y(A)}${y(O)}${y(x)}`},T.toRgba=function(A,O,x,L=255){return(A<<24|O<<16|x<<8|L)>>>0}})(R||(l.channels=R={})),(function(T){function A(O,x){return C=Math.round(255*x),[b,d,w]=_.toChannels(O.rgba),{css:R.toCss(b,d,w,C),rgba:R.toRgba(b,d,w,C)}}T.blend=function(O,x){if(C=(255&x.rgba)/255,C===1)return{css:x.css,rgba:x.rgba};const L=x.rgba>>24&255,I=x.rgba>>16&255,V=x.rgba>>8&255,P=O.rgba>>24&255,$=O.rgba>>16&255,Z=O.rgba>>8&255;return b=P+Math.round((L-P)*C),d=$+Math.round((I-$)*C),w=Z+Math.round((V-Z)*C),{css:R.toCss(b,d,w),rgba:R.toRgba(b,d,w)}},T.isOpaque=function(O){return(255&O.rgba)==255},T.ensureContrastRatio=function(O,x,L){const I=_.ensureContrastRatio(O.rgba,x.rgba,L);if(I)return _.toColor(I>>24&255,I>>16&255,I>>8&255)},T.opaque=function(O){const x=(255|O.rgba)>>>0;return[b,d,w]=_.toChannels(x),{css:R.toCss(b,d,w),rgba:x}},T.opacity=A,T.multiplyOpacity=function(O,x){return C=255&O.rgba,A(O,C*x/255)},T.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(D||(l.color=D={})),(function(T){let A,O;if(!h.isNode){const x=document.createElement("canvas");x.width=1,x.height=1;const L=x.getContext("2d",{willReadFrequently:!0});L&&(A=L,A.globalCompositeOperation="copy",O=A.createLinearGradient(0,0,1,1))}T.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return b=parseInt(x.slice(1,2).repeat(2),16),d=parseInt(x.slice(2,3).repeat(2),16),w=parseInt(x.slice(3,4).repeat(2),16),_.toColor(b,d,w);case 5:return b=parseInt(x.slice(1,2).repeat(2),16),d=parseInt(x.slice(2,3).repeat(2),16),w=parseInt(x.slice(3,4).repeat(2),16),C=parseInt(x.slice(4,5).repeat(2),16),_.toColor(b,d,w,C);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const L=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return b=parseInt(L[1]),d=parseInt(L[2]),w=parseInt(L[3]),C=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(b,d,w,C);if(!A||!O)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=O,A.fillStyle=x,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[b,d,w,C]=A.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:R.toRgba(b,d,w,C),css:x}}})(m||(l.css=m={})),(function(T){function A(O,x,L){const I=O/255,V=x/255,P=L/255;return .2126*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))+.7152*(V<=.03928?V/12.92:Math.pow((V+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}T.relativeLuminance=function(O){return A(O>>16&255,O>>8&255,255&O)},T.relativeLuminance2=A})(g||(l.rgb=g={})),(function(T){function A(x,L,I){const V=x>>24&255,P=x>>16&255,$=x>>8&255;let Z=L>>24&255,W=L>>16&255,q=L>>8&255,Y=E(g.relativeLuminance2(Z,W,q),g.relativeLuminance2(V,P,$));for(;Y<I&&(Z>0||W>0||q>0);)Z-=Math.max(0,Math.ceil(.1*Z)),W-=Math.max(0,Math.ceil(.1*W)),q-=Math.max(0,Math.ceil(.1*q)),Y=E(g.relativeLuminance2(Z,W,q),g.relativeLuminance2(V,P,$));return(Z<<24|W<<16|q<<8|255)>>>0}function O(x,L,I){const V=x>>24&255,P=x>>16&255,$=x>>8&255;let Z=L>>24&255,W=L>>16&255,q=L>>8&255,Y=E(g.relativeLuminance2(Z,W,q),g.relativeLuminance2(V,P,$));for(;Y<I&&(Z<255||W<255||q<255);)Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),W=Math.min(255,W+Math.ceil(.1*(255-W))),q=Math.min(255,q+Math.ceil(.1*(255-q))),Y=E(g.relativeLuminance2(Z,W,q),g.relativeLuminance2(V,P,$));return(Z<<24|W<<16|q<<8|255)>>>0}T.ensureContrastRatio=function(x,L,I){const V=g.relativeLuminance(x>>8),P=g.relativeLuminance(L>>8);if(E(V,P)<I){if(P<V){const W=A(x,L,I),q=E(V,g.relativeLuminance(W>>8));if(q<I){const Y=O(x,L,I);return q>E(V,g.relativeLuminance(Y>>8))?W:Y}return W}const $=O(x,L,I),Z=E(V,g.relativeLuminance($>>8));if(Z<I){const W=A(x,L,I);return Z>E(V,g.relativeLuminance(W>>8))?$:W}return $}},T.reduceLuminance=A,T.increaseLuminance=O,T.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]},T.toColor=function(x,L,I,V){return{css:R.toCss(x,L,I,V),rgba:R.toRgba(x,L,I,V)}}})(_||(l.rgba=_={})),l.toPaddedHex=y,l.contrastRatio=E},8969:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=u(844),b=u(2585),d=u(4348),w=u(7866),C=u(744),R=u(7302),D=u(6975),m=u(8460),g=u(1753),_=u(1480),y=u(7994),E=u(9282),T=u(5435),A=u(5981),O=u(2660);let x=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((V=>{var P;(P=this._onScrollApi)===null||P===void 0||P.fire(V.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(V){for(const P in V)this.optionsService.options[P]=V[P]}constructor(V){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new R.OptionsService(V)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(w.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(D.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(O.OscLinkService),this._instantiationService.setService(b.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new A.WriteBuffer(((P,$)=>this._inputHandler.parse(P,$)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(V,P){this._writeBuffer.write(V,P)}writeSync(V,P){this._logService.logLevel<=b.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(V,P)}resize(V,P){isNaN(V)||isNaN(P)||(V=Math.max(V,C.MINIMUM_COLS),P=Math.max(P,C.MINIMUM_ROWS),this._bufferService.resize(V,P))}scroll(V,P=!1){this._bufferService.scroll(V,P)}scrollLines(V,P,$){this._bufferService.scrollLines(V,P,$)}scrollPages(V){this.scrollLines(V*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(V){const P=V-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(V,P){return this._inputHandler.registerEscHandler(V,P)}registerDcsHandler(V,P){return this._inputHandler.registerDcsHandler(V,P)}registerCsiHandler(V,P){return this._inputHandler.registerCsiHandler(V,P)}registerOscHandler(V,P){return this._inputHandler.registerOscHandler(V,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let V=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?V=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(V=!0),V?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const V=[];V.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),V.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const P of V)P.dispose()}))}}}l.CoreTerminal=L},8460:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const b=[];for(let d=0;d<this._listeners.length;d++)b.push(this._listeners[d]);for(let d=0;d<b.length;d++)b[d].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,h){return u((b=>h.fire(b)))}},5435:function(v,l,u){var h=this&&this.__decorate||function(Y,k,z,K){var B,F=arguments.length,X=F<3?k:K===null?K=Object.getOwnPropertyDescriptor(k,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(Y,k,z,K);else for(var ne=Y.length-1;ne>=0;ne--)(B=Y[ne])&&(X=(F<3?B(X):F>3?B(k,z,X):B(k,z))||X);return F>3&&X&&Object.defineProperty(k,z,X),X},b=this&&this.__param||function(Y,k){return function(z,K){k(z,K,Y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),w=u(7116),C=u(2015),R=u(844),D=u(482),m=u(8437),g=u(8460),_=u(643),y=u(511),E=u(3734),T=u(2585),A=u(6242),O=u(6351),x=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function V(Y,k){if(Y>24)return k.setWinLines||!1;switch(Y){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var P;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(l.WindowsOptionsReportType=P={}));let $=0;class Z extends R.Disposable{getAttrData(){return this._curAttrData}constructor(k,z,K,B,F,X,ne,ae,pe=new C.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=z,this._coreService=K,this._logService=B,this._optionsService=F,this._oscLinkService=X,this._coreMouseService=ne,this._unicodeService=ae,this._parser=pe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new D.StringToUtf32,this._utf8Decoder=new D.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,G)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:G.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,G,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:G,data:oe})})),this._parser.setDcsHandlerFallback(((j,G,oe)=>{G==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:G,payload:oe})})),this._parser.setPrintHandler(((j,G,oe)=>this.print(j,G,oe))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new A.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new A.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new A.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new A.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new A.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new A.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new A.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new A.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new A.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new A.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new A.OscHandler((j=>this.restoreCursorColor(j)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const j in w.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new O.DcsHandler(((j,G)=>this.requestStatusString(j,G))))}_preserveStack(k,z,K,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=K,this._parseStack.position=B}_logSlowResolvingAsync(k){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([k,new Promise(((z,K)=>setTimeout((()=>K("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,z){let K,B=this._activeBuffer.x,F=this._activeBuffer.y,X=0;const ne=this._parseStack.paused;if(ne){if(K=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(K),K;B=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>I&&(X=this._parseStack.position+I)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,(ae=>String.fromCharCode(ae))).join("")}"`),typeof k=="string"?k.split("").map((ae=>ae.charCodeAt(0))):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(k.length,I))),ne||this._dirtyRowTracker.clearRange(),k.length>I)for(let ae=X;ae<k.length;ae+=I){const pe=ae+I<k.length?ae+I:k.length,j=typeof k=="string"?this._stringDecoder.decode(k.substring(ae,pe),this._parseBuffer):this._utf8Decoder.decode(k.subarray(ae,pe),this._parseBuffer);if(K=this._parser.parse(this._parseBuffer,j))return this._preserveStack(B,F,j,ae),this._logSlowResolvingAsync(K),K}else if(!ne){const ae=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(K=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(B,F,ae,0),this._logSlowResolvingAsync(K),K}this._activeBuffer.x===B&&this._activeBuffer.y===F||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(k,z,K){let B,F;const X=this._charsetService.charset,ne=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,pe=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,G=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&K-z>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodePoint(this._activeBuffer.x-1,0,1,G.fg,G.bg,G.extended);for(let le=z;le<K;++le){if(B=k[le],F=this._unicodeService.wcwidth(B),B<127&&X){const me=X[String.fromCharCode(B)];me&&(B=me.charCodeAt(0))}if(ne&&this._onA11yChar.fire((0,D.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),F||!this._activeBuffer.x){if(this._activeBuffer.x+F-1>=ae){if(pe){for(;this._activeBuffer.x<ae;)oe.setCellFromCodePoint(this._activeBuffer.x++,0,1,G.fg,G.bg,G.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=ae-1,F===2)continue}if(j&&(oe.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(G),G),oe.getWidth(ae-1)===2&&oe.setCellFromCodePoint(ae-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,G.fg,G.bg,G.extended)),oe.setCellFromCodePoint(this._activeBuffer.x++,B,F,G.fg,G.bg,G.extended),F>0)for(;--F;)oe.setCellFromCodePoint(this._activeBuffer.x++,0,0,G.fg,G.bg,G.extended)}else oe.getWidth(this._activeBuffer.x-1)?oe.addCodepointToCell(this._activeBuffer.x-1,B):oe.addCodepointToCell(this._activeBuffer.x-2,B)}K-z>0&&(oe.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<ae&&K-z>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodePoint(this._activeBuffer.x,0,1,G.fg,G.bg,G.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,z){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,z):this._parser.registerCsiHandler(k,(K=>!V(K.params[0],this._optionsService.rawOptions.windowOptions)||z(K)))}registerDcsHandler(k,z){return this._parser.registerDcsHandler(k,new O.DcsHandler(z))}registerEscHandler(k,z){return this._parser.registerEscHandler(k,z)}registerOscHandler(k,z){return this._parser.registerOscHandler(k,new A.OscHandler(z))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var k;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||k===void 0)&&k.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);z.hasWidth(this._activeBuffer.x)&&!z.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(k,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=k,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+z)}cursorUp(k){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const z=k.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=k.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=k.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const z=k.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,z,K,B=!1,F=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);X.replaceCells(z,K,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),F),B&&(X.isWrapped=!1)}_resetBufferLine(k,z=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);K&&(K.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),K.isWrapped=!1)}eraseInDisplay(k,z=!1){let K;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(K=this._activeBuffer.y,this._dirtyRowTracker.markDirty(K),this._eraseInBufferLine(K++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);K<this._bufferService.rows;K++)this._resetBufferLine(K,z);this._dirtyRowTracker.markDirty(K);break;case 1:for(K=this._activeBuffer.y,this._dirtyRowTracker.markDirty(K),this._eraseInBufferLine(K,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(K+1).isWrapped=!1);K--;)this._resetBufferLine(K,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(K=this._bufferService.rows,this._dirtyRowTracker.markDirty(K-1);K--;)this._resetBufferLine(K,z);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(k,z=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let z=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const K=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;z--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(K,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let z=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const K=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;z--;)this._activeBuffer.lines.splice(K,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(k){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let z=k.params[0]||1;for(;z--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(k){let z=k.params[0]||1;for(;z--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=k.params[0]||1;for(let K=this._activeBuffer.scrollTop;K<=this._activeBuffer.scrollBottom;++K){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+K);B.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=k.params[0]||1;for(let K=this._activeBuffer.scrollTop;K<=this._activeBuffer.scrollBottom;++K){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+K);B.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=k.params[0]||1;for(let K=this._activeBuffer.scrollTop;K<=this._activeBuffer.scrollBottom;++K){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+K);B.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=k.params[0]||1;for(let K=this._activeBuffer.scrollTop;K<=this._activeBuffer.scrollBottom;++K){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+K);B.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){if(!this._parser.precedingCodepoint)return!0;const z=k.params[0]||1,K=new Uint32Array(z);for(let B=0;B<z;++B)K[B]=this._parser.precedingCodepoint;return this.print(K,0,K.length),!0}sendDeviceAttributesPrimary(k){return k.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(k){return k.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let z=0;z<k.length;z++)switch(k.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let z=0;z<k.length;z++)switch(k.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),this._charsetService.setgCharset(1,w.DEFAULT_CHARSET),this._charsetService.setgCharset(2,w.DEFAULT_CHARSET),this._charsetService.setgCharset(3,w.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(k){for(let z=0;z<k.length;z++)switch(k.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let z=0;z<k.length;z++)switch(k.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),k.params[z]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(k,z){const K=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:F}=this._coreMouseService,X=this._coreService,{buffers:ne,cols:ae}=this._bufferService,{active:pe,alt:j}=ne,G=this._optionsService.rawOptions,oe=Ce=>Ce?1:2,le=k.params[0];return me=le,he=z?le===2?4:le===4?oe(X.modes.insertMode):le===12?3:le===20?oe(G.convertEol):0:le===1?oe(K.applicationCursorKeys):le===3?G.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:le===6?oe(K.origin):le===7?oe(K.wraparound):le===8?3:le===9?oe(B==="X10"):le===12?oe(G.cursorBlink):le===25?oe(!X.isCursorHidden):le===45?oe(K.reverseWraparound):le===66?oe(K.applicationKeypad):le===67?4:le===1e3?oe(B==="VT200"):le===1002?oe(B==="DRAG"):le===1003?oe(B==="ANY"):le===1004?oe(K.sendFocus):le===1005?4:le===1006?oe(F==="SGR"):le===1015?4:le===1016?oe(F==="SGR_PIXELS"):le===1048?1:le===47||le===1047||le===1049?oe(pe===j):le===2004?oe(K.bracketedPasteMode):0,X.triggerDataEvent(`${d.C0.ESC}[${z?"":"?"}${me};${he}$y`),!0;var me,he}_updateAttrColor(k,z,K,B,F){return z===2?(k|=50331648,k&=-16777216,k|=E.AttributeData.fromColorRGB([K,B,F])):z===5&&(k&=-50331904,k|=33554432|255&K),k}_extractColor(k,z,K){const B=[0,0,-1,0,0,0];let F=0,X=0;do{if(B[X+F]=k.params[z+X],k.hasSubParams(z+X)){const ne=k.getSubParams(z+X);let ae=0;do B[1]===5&&(F=1),B[X+ae+1+F]=ne[ae];while(++ae<ne.length&&ae+X+1+F<B.length);break}if(B[1]===5&&X+F>=2||B[1]===2&&X+F>=5)break;B[1]&&(F=1)}while(++X+z<k.length&&X+F<B.length);for(let ne=2;ne<B.length;++ne)B[ne]===-1&&(B[ne]=0);switch(B[0]){case 38:K.fg=this._updateAttrColor(K.fg,B[1],B[3],B[4],B[5]);break;case 48:K.bg=this._updateAttrColor(K.bg,B[1],B[3],B[4],B[5]);break;case 58:K.extended=K.extended.clone(),K.extended.underlineColor=this._updateAttrColor(K.extended.underlineColor,B[1],B[3],B[4],B[5])}return X}_processUnderline(k,z){z.extended=z.extended.clone(),(!~k||k>5)&&(k=1),z.extended.underlineStyle=k,z.fg|=268435456,k===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(k){k.fg=m.DEFAULT_ATTR_DATA.fg,k.bg=m.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=k.length;let K;const B=this._curAttrData;for(let F=0;F<z;F++)K=k.params[F],K>=30&&K<=37?(B.fg&=-50331904,B.fg|=16777216|K-30):K>=40&&K<=47?(B.bg&=-50331904,B.bg|=16777216|K-40):K>=90&&K<=97?(B.fg&=-50331904,B.fg|=16777224|K-90):K>=100&&K<=107?(B.bg&=-50331904,B.bg|=16777224|K-100):K===0?this._processSGR0(B):K===1?B.fg|=134217728:K===3?B.bg|=67108864:K===4?(B.fg|=268435456,this._processUnderline(k.hasSubParams(F)?k.getSubParams(F)[0]:1,B)):K===5?B.fg|=536870912:K===7?B.fg|=67108864:K===8?B.fg|=1073741824:K===9?B.fg|=2147483648:K===2?B.bg|=134217728:K===21?this._processUnderline(2,B):K===22?(B.fg&=-134217729,B.bg&=-134217729):K===23?B.bg&=-67108865:K===24?(B.fg&=-268435457,this._processUnderline(0,B)):K===25?B.fg&=-536870913:K===27?B.fg&=-67108865:K===28?B.fg&=-1073741825:K===29?B.fg&=2147483647:K===39?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):K===49?(B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):K===38||K===48||K===58?F+=this._extractColor(k,F,B):K===53?B.bg|=1073741824:K===55?B.bg&=-1073741825:K===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):K===100?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",K);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,K=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${z};${K}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const z=this._activeBuffer.y+1,K=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${z};${K}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(k){const z=k.params[0]||1;switch(z){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const K=z%2==1;return this._optionsService.options.cursorBlink=K,!0}setScrollRegion(k){const z=k.params[0]||1;let K;return(k.length<2||(K=k.params[1])>this._bufferService.rows||K===0)&&(K=this._bufferService.rows),K>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=K-1,this._setCursor(0,0)),!0}windowOptions(k){if(!V(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(k){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const z=[],K=k.split(";");for(;K.length>1;){const B=K.shift(),F=K.shift();if(/^\d+$/.exec(B)){const X=parseInt(B);if(q(X))if(F==="?")z.push({type:0,index:X});else{const ne=(0,x.parseColor)(F);ne&&z.push({type:1,index:X,color:ne})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(k){const z=k.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(k,z){this._getCurrentLinkId()&&this._finishHyperlink();const K=k.split(":");let B;const F=K.findIndex((X=>X.startsWith("id=")));return F!==-1&&(B=K[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,z){const K=k.split(";");for(let B=0;B<K.length&&!(z>=this._specialColors.length);++B,++z)if(K[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const F=(0,x.parseColor)(K[B]);F&&this._onColor.fire([{type:1,index:this._specialColors[z],color:F}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const z=[],K=k.split(";");for(let B=0;B<K.length;++B)if(/^\d+$/.exec(K[B])){const F=parseInt(K[B]);q(F)&&z.push({type:2,index:F})}return z.length&&this._onColor.fire(z),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(L[k[0]],w.CHARSETS[k[1]]||w.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new y.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z<this._bufferService.rows;++z){const K=this._activeBuffer.ybase+this._activeBuffer.y+z,B=this._activeBuffer.lines.get(K);B&&(B.fill(k),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,z){const K=this._bufferService.buffer,B=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${F}${d.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${K.scrollTop+1};${K.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,z){this._dirtyRowTracker.markRangeDirty(k,z)}}l.InputHandler=Z;let W=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,k){Y>k&&($=Y,Y=k,k=$),Y<this.start&&(this.start=Y),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(Y){return 0<=Y&&Y<256}W=h([b(0,T.IBufferService)],W)},844:(v,l)=>{function u(h){for(const b of h)b.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const b=this._disposables.indexOf(h);b!==-1&&this._disposables.splice(b,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var b;this._isDisposed||h===this._value||((b=this._value)===null||b===void 0||b.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)===null||h===void 0||h.dispose(),this._value=void 0}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=u,l.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(b,d,w){this._data[b]||(this._data[b]={}),this._data[b][d]=w}get(b,d){return this._data[b]?this._data[b][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(h,b,d,w,C){this._data.get(h,b)||this._data.set(h,b,new u),this._data.get(h,b).set(d,w,C)}get(h,b,d,w){var C;return(C=this._data.get(h,b))===null||C===void 0?void 0:C.get(d,w)}clear(){this._data.clear()}}},6114:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof navigator>"u";const u=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const b=u.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const b=this._getKey(h);if(b===void 0||(u=this._search(b),u===-1)||this._getKey(this._array[u])!==b)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===b);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,b){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do b(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let b=0,d=this._array.length-1;for(;d>=b;){let w=b+d>>1;const C=this._getKey(this._array[w]);if(C>h)d=w-1;else{if(!(C<h)){for(;w>0&&this._getKey(this._array[w-1])===h;)w--;return w}b=w+1}}return b}}},7226:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=u(6114);class b{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let R=0,D=0,m=C.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),D=Math.max(R,D),g=C.timeRemaining(),1.5*D>g)return m-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-R))}ms`),void this._start();m=g}this.clear()}}class d extends b{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const R=Date.now()+C;return{timeRemaining:()=>Math.max(0,R-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(w){return requestIdleCallback(w)}_cancelCallback(w){cancelIdleCallback(w)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(w){this._queue.clear(),this._queue.enqueue(w)}flush(){this._queue.flush()}}},9282:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=u(643);l.updateWindowsModeWrappedState=function(b){const d=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),w=d==null?void 0:d.get(b.cols-1),C=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);C&&w&&(C.isWrapped=w[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&w[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}l.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,w=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=w}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=h},9092:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=u(6349),b=u(7226),d=u(3734),w=u(8437),C=u(4634),R=u(511),D=u(643),m=u(4863),g=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(_,y,E){this._hasScrollback=_,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=w.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=R.CellData.fromCharData([0,D.NULL_CELL_CHAR,D.NULL_CELL_WIDTH,D.NULL_CELL_CODE]),this._whitespaceCell=R.CellData.fromCharData([0,D.WHITESPACE_CELL_CHAR,D.WHITESPACE_CELL_WIDTH,D.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new b.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,y){return new w.BufferLine(this._bufferService.cols,this.getNullCell(_),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const y=_+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=w.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(_))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(_,y){const E=this.getNullCell(w.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(y);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<_)for(let x=0;x<this.lines.length;x++)T+=+this.lines.get(x).resize(_,E);let O=0;if(this._rows<y)for(let x=this._rows;x<y;x++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new w.BufferLine(_,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+O+1?(this.ybase--,O++,this.ydisp>0&&this.ydisp--):this.lines.push(new w.BufferLine(_,E)));else for(let x=this._rows;x>y;x--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const x=this.lines.length-A;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=A}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,y-1),O&&(this.y+=O),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(_,y),this._cols>_))for(let O=0;O<this.lines.length;O++)T+=+this.lines.get(O).resize(_,E);this._cols=_,this._rows=y,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,y){this._cols!==_&&(_>this._cols?this._reflowLarger(_,y):this._reflowSmaller(_,y))}_reflowLarger(_,y){const E=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(w.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,C.reflowLargerCreateNewLayout)(this.lines,E);(0,C.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(_,y,T.countRemoved)}}_reflowLargerAdjustViewport(_,y,E){const T=this.getNullCell(w.DEFAULT_ATTR_DATA);let A=E;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new w.BufferLine(_,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(_,y){const E=this.getNullCell(w.DEFAULT_ATTR_DATA),T=[];let A=0;for(let O=this.lines.length-1;O>=0;O--){let x=this.lines.get(O);if(!x||!x.isWrapped&&x.getTrimmedLength()<=_)continue;const L=[x];for(;x.isWrapped&&O>0;)x=this.lines.get(--O),L.unshift(x);const I=this.ybase+this.y;if(I>=O&&I<O+L.length)continue;const V=L[L.length-1].getTrimmedLength(),P=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,_),$=P.length-L.length;let Z;Z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const W=[];for(let B=0;B<$;B++){const F=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);W.push(F)}W.length>0&&(T.push({start:O+L.length+A,newLines:W}),A+=W.length),L.push(...W);let q=P.length-1,Y=P[q];Y===0&&(q--,Y=P[q]);let k=L.length-$-1,z=V;for(;k>=0;){const B=Math.min(z,Y);if(L[q]===void 0)break;if(L[q].copyCellsFrom(L[k],z-B,Y-B,B,!0),Y-=B,Y===0&&(q--,Y=P[q]),z-=B,z===0){k--;const F=Math.max(k,0);z=(0,C.getWrappedLineTrimmedLength)(L,F,this._cols)}}for(let B=0;B<L.length;B++)P[B]<_&&L[B].setCell(P[B],E);let K=$-Z;for(;K-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+y-1)}if(T.length>0){const O=[],x=[];for(let q=0;q<this.lines.length;q++)x.push(this.lines.get(q));const L=this.lines.length;let I=L-1,V=0,P=T[V];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let $=0;for(let q=Math.min(this.lines.maxLength-1,L+A-1);q>=0;q--)if(P&&P.start>I+$){for(let Y=P.newLines.length-1;Y>=0;Y--)this.lines.set(q--,P.newLines[Y]);q++,O.push({index:I+1,amount:P.newLines.length}),$+=P.newLines.length,P=T[++V]}else this.lines.set(q,x[I--]);let Z=0;for(let q=O.length-1;q>=0;q--)O[q].index+=Z,this.lines.onInsertEmitter.fire(O[q]),Z+=O[q].amount;const W=Math.max(0,L+A-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(_,y,E=0,T){const A=this.lines.get(_);return A?A.translateToString(y,E,T):""}getWrappedRangeForLine(_){let y=_,E=_;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===_&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const y=new m.Marker(_);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=u(3734),b=u(511),d=u(643),w=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class R{constructor(m,g,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const y=g||b.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E<m;++E)this.setCell(E,y);this.length=m}get(m){const g=this._data[3*m+0],_=2097151&g;return[this._data[3*m+1],2097152&g?this._combined[m]:_?(0,w.stringFromCodePoint)(_):"",g>>22,2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):_]}set(m,g){this._data[3*m+1]=g[d.CHAR_DATA_ATTR_INDEX],g[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=g[1],this._data[3*m+0]=2097152|m|g[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&g}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m]:2097151&g?(0,w.stringFromCodePoint)(2097151&g):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,g){return C=3*m,g.content=this._data[C+0],g.fg=this._data[C+1],g.bg=this._data[C+2],2097152&g.content&&(g.combinedData=this._combined[m]),268435456&g.bg&&(g.extended=this._extendedAttrs[m]),g}setCell(m,g){2097152&g.content&&(this._combined[m]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[m]=g.extended),this._data[3*m+0]=g.content,this._data[3*m+1]=g.fg,this._data[3*m+2]=g.bg}setCellFromCodePoint(m,g,_,y,E,T){268435456&E&&(this._extendedAttrs[m]=T),this._data[3*m+0]=g|_<<22,this._data[3*m+1]=y,this._data[3*m+2]=E}addCodepointToCell(m,g){let _=this._data[3*m+0];2097152&_?this._combined[m]+=(0,w.stringFromCodePoint)(g):(2097151&_?(this._combined[m]=(0,w.stringFromCodePoint)(2097151&_)+(0,w.stringFromCodePoint)(g),_&=-2097152,_|=2097152):_=g|4194304,this._data[3*m+0]=_)}insertCells(m,g,_,y){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs),g<this.length-m){const E=new b.CellData;for(let T=this.length-m-g-1;T>=0;--T)this.setCell(m+g+T,this.loadCell(m+T,E));for(let T=0;T<g;++T)this.setCell(m+T,_)}else for(let E=m;E<this.length;++E)this.setCell(E,_);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs)}deleteCells(m,g,_,y){if(m%=this.length,g<this.length-m){const E=new b.CellData;for(let T=0;T<this.length-m-g;++T)this.setCell(m+T,this.loadCell(m+g+T,E));for(let T=this.length-g;T<this.length;++T)this.setCell(T,_)}else for(let E=m;E<this.length;++E)this.setCell(E,_);m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodePoint(m,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs)}replaceCells(m,g,_,y,E=!1){if(E)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodePoint(m-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodePoint(g,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs);m<g&&m<this.length;)this.isProtected(m)||this.setCell(m,_),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodePoint(g,0,1,(y==null?void 0:y.fg)||0,(y==null?void 0:y.bg)||0,(y==null?void 0:y.extended)||new h.ExtendedAttrs);m<g&&m<this.length;)this.setCell(m++,_)}resize(m,g){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const y=new Uint32Array(_);y.set(this._data),this._data=y}for(let y=this.length;y<m;++y)this.setCell(y,g)}else{this._data=this._data.subarray(0,_);const y=Object.keys(this._combined);for(let T=0;T<y.length;T++){const A=parseInt(y[T],10);A>=m&&delete this._combined[A]}const E=Object.keys(this._extendedAttrs);for(let T=0;T<E.length;T++){const A=parseInt(E[T],10);A>=m&&delete this._extendedAttrs[A]}}return this.length=m,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,g=!1){if(g)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,m);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const g in m._combined)this._combined[g]=m._combined[g];this._extendedAttrs={};for(const g in m._extendedAttrs)this._extendedAttrs[g]=m._extendedAttrs[g];this.isWrapped=m.isWrapped}clone(){const m=new R(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const g in this._combined)m._combined[g]=this._combined[g];for(const g in this._extendedAttrs)m._extendedAttrs[g]=this._extendedAttrs[g];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,g,_,y,E){const T=m._data;if(E)for(let O=y-1;O>=0;O--){for(let x=0;x<3;x++)this._data[3*(_+O)+x]=T[3*(g+O)+x];268435456&T[3*(g+O)+2]&&(this._extendedAttrs[_+O]=m._extendedAttrs[g+O])}else for(let O=0;O<y;O++){for(let x=0;x<3;x++)this._data[3*(_+O)+x]=T[3*(g+O)+x];268435456&T[3*(g+O)+2]&&(this._extendedAttrs[_+O]=m._extendedAttrs[g+O])}const A=Object.keys(m._combined);for(let O=0;O<A.length;O++){const x=parseInt(A[O],10);x>=g&&(this._combined[x-g+_]=m._combined[x])}}translateToString(m=!1,g=0,_=this.length){m&&(_=Math.min(_,this.getTrimmedLength()));let y="";for(;g<_;){const E=this._data[3*g+0],T=2097151&E;y+=2097152&E?this._combined[g]:T?(0,w.stringFromCodePoint)(T):d.WHITESPACE_CELL_CHAR,g+=E>>22||1}return y}}l.BufferLine=R},4841:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(v,l)=>{function u(h,b,d){if(b===h.length-1)return h[b].getTrimmedLength();const w=!h[b].hasContent(d-1)&&h[b].getWidth(d-1)===1,C=h[b+1].getWidth(0)===2;return w&&C?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,b,d,w,C){const R=[];for(let D=0;D<h.length-1;D++){let m=D,g=h.get(++m);if(!g.isWrapped)continue;const _=[h.get(D)];for(;m<h.length&&g.isWrapped;)_.push(g),g=h.get(++m);if(w>=D&&w<m){D+=_.length-1;continue}let y=0,E=u(_,y,b),T=1,A=0;for(;T<_.length;){const x=u(_,T,b),L=x-A,I=d-E,V=Math.min(L,I);_[y].copyCellsFrom(_[T],A,E,V,!1),E+=V,E===d&&(y++,E=0),A+=V,A===x&&(T++,A=0),E===0&&y!==0&&_[y-1].getWidth(d-1)===2&&(_[y].copyCellsFrom(_[y-1],d-1,E++,1,!1),_[y-1].setCell(d-1,C))}_[y].replaceCells(E,d,C);let O=0;for(let x=_.length-1;x>0&&(x>y||_[x].getTrimmedLength()===0);x--)O++;O>0&&(R.push(D+_.length-O),R.push(O)),D+=_.length-1}return R},l.reflowLargerCreateNewLayout=function(h,b){const d=[];let w=0,C=b[w],R=0;for(let D=0;D<h.length;D++)if(C===D){const m=b[++w];h.onDeleteEmitter.fire({index:D-R,amount:m}),D+=m-1,R+=m,C=b[++w]}else d.push(D);return{layout:d,countRemoved:R}},l.reflowLargerApplyNewLayout=function(h,b){const d=[];for(let w=0;w<b.length;w++)d.push(h.get(b[w]));for(let w=0;w<d.length;w++)h.set(w,d[w]);h.length=b.length},l.reflowSmallerGetNewLineLengths=function(h,b,d){const w=[],C=h.map(((g,_)=>u(h,_,b))).reduce(((g,_)=>g+_));let R=0,D=0,m=0;for(;m<C;){if(C-m<d){w.push(C-m);break}R+=d;const g=u(h,D,b);R>g&&(R-=g,D++);const _=h[D].getWidth(R-1)===2;_&&R--;const y=_?d-1:d;w.push(y),m+=y}return w},l.getWrappedLineTrimmedLength=u},5295:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=u(8460),b=u(844),d=u(9092);class w extends b.Disposable{constructor(R,D){super(),this._optionsService=R,this._bufferService=D,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(R){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(R),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(R,D){this._normal.resize(R,D),this._alt.resize(R,D),this.setupTabStops(R)}setupTabStops(R){this._normal.setupTabStops(R),this._alt.setupTabStops(R)}}l.BufferSet=w},511:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=u(482),b=u(643),d=u(3734);class w extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(R){const D=new w;return D.setFromCharData(R),D}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(R){this.fg=R[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let D=!1;if(R[b.CHAR_DATA_CHAR_INDEX].length>2)D=!0;else if(R[b.CHAR_DATA_CHAR_INDEX].length===2){const m=R[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const g=R[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(m-55296)+g-56320+65536|R[b.CHAR_DATA_WIDTH_INDEX]<<22:D=!0}else D=!0}else this.content=R[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[b.CHAR_DATA_WIDTH_INDEX]<<22;D&&(this.combinedData=R[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|R[b.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=w},643:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=u(8460),b=u(844);class d{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,b.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=d,d._nextId=1},7116:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(v,l)=>{var u,h,b;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
330
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(u||(l.C0=u={})),(function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""})(h||(l.C1=h={})),(function(d){d.ST=`${u.ESC}\\`})(b||(l.C1_ESCAPED=b={}))},7399:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=u(2584),b={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(d,w,C,R){const D={type:0,cancel:!1,key:void 0},m=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?D.key=w?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?D.key=w?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?D.key=w?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(D.key=w?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(d.altKey){D.key=h.C0.ESC+h.C0.DEL;break}D.key=h.C0.DEL;break;case 9:if(d.shiftKey){D.key=h.C0.ESC+"[Z";break}D.key=h.C0.HT,D.cancel=!0;break;case 13:D.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,D.cancel=!0;break;case 27:D.key=h.C0.ESC,d.altKey&&(D.key=h.C0.ESC+h.C0.ESC),D.cancel=!0;break;case 37:if(d.metaKey)break;m?(D.key=h.C0.ESC+"[1;"+(m+1)+"D",D.key===h.C0.ESC+"[1;3D"&&(D.key=h.C0.ESC+(C?"b":"[1;5D"))):D.key=w?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(D.key=h.C0.ESC+"[1;"+(m+1)+"C",D.key===h.C0.ESC+"[1;3C"&&(D.key=h.C0.ESC+(C?"f":"[1;5C"))):D.key=w?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(D.key=h.C0.ESC+"[1;"+(m+1)+"A",C||D.key!==h.C0.ESC+"[1;3A"||(D.key=h.C0.ESC+"[1;5A")):D.key=w?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(D.key=h.C0.ESC+"[1;"+(m+1)+"B",C||D.key!==h.C0.ESC+"[1;3B"||(D.key=h.C0.ESC+"[1;5B")):D.key=w?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(D.key=h.C0.ESC+"[2~");break;case 46:D.key=m?h.C0.ESC+"[3;"+(m+1)+"~":h.C0.ESC+"[3~";break;case 36:D.key=m?h.C0.ESC+"[1;"+(m+1)+"H":w?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:D.key=m?h.C0.ESC+"[1;"+(m+1)+"F":w?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?D.type=2:d.ctrlKey?D.key=h.C0.ESC+"[5;"+(m+1)+"~":D.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?D.type=3:d.ctrlKey?D.key=h.C0.ESC+"[6;"+(m+1)+"~":D.key=h.C0.ESC+"[6~";break;case 112:D.key=m?h.C0.ESC+"[1;"+(m+1)+"P":h.C0.ESC+"OP";break;case 113:D.key=m?h.C0.ESC+"[1;"+(m+1)+"Q":h.C0.ESC+"OQ";break;case 114:D.key=m?h.C0.ESC+"[1;"+(m+1)+"R":h.C0.ESC+"OR";break;case 115:D.key=m?h.C0.ESC+"[1;"+(m+1)+"S":h.C0.ESC+"OS";break;case 116:D.key=m?h.C0.ESC+"[15;"+(m+1)+"~":h.C0.ESC+"[15~";break;case 117:D.key=m?h.C0.ESC+"[17;"+(m+1)+"~":h.C0.ESC+"[17~";break;case 118:D.key=m?h.C0.ESC+"[18;"+(m+1)+"~":h.C0.ESC+"[18~";break;case 119:D.key=m?h.C0.ESC+"[19;"+(m+1)+"~":h.C0.ESC+"[19~";break;case 120:D.key=m?h.C0.ESC+"[20;"+(m+1)+"~":h.C0.ESC+"[20~";break;case 121:D.key=m?h.C0.ESC+"[21;"+(m+1)+"~":h.C0.ESC+"[21~";break;case 122:D.key=m?h.C0.ESC+"[23;"+(m+1)+"~":h.C0.ESC+"[23~";break;case 123:D.key=m?h.C0.ESC+"[24;"+(m+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(C&&!R||!d.altKey||d.metaKey)!C||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?D.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(D.key=h.C0.US),d.key==="@"&&(D.key=h.C0.NUL)):d.keyCode===65&&(D.type=1);else{const g=b[d.keyCode],_=g==null?void 0:g[d.shiftKey?1:0];if(_)D.key=h.C0.ESC+_;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(y);d.shiftKey&&(E=E.toUpperCase()),D.key=h.C0.ESC+E}else if(d.keyCode===32)D.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),D.key=h.C0.ESC+y,D.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?D.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?D.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?D.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?D.key=h.C0.DEL:d.keyCode===219?D.key=h.C0.ESC:d.keyCode===220?D.key=h.C0.FS:d.keyCode===221&&(D.key=h.C0.GS)}return D}},482:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,h=0,b=u.length){let d="";for(let w=h;w<b;++w){let C=u[w];C>65535?(C-=65536,d+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):d+=String.fromCharCode(C)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const b=u.length;if(!b)return 0;let d=0,w=0;if(this._interim){const C=u.charCodeAt(w++);56320<=C&&C<=57343?h[d++]=1024*(this._interim-55296)+C-56320+65536:(h[d++]=this._interim,h[d++]=C),this._interim=0}for(let C=w;C<b;++C){const R=u.charCodeAt(C);if(55296<=R&&R<=56319){if(++C>=b)return this._interim=R,d;const D=u.charCodeAt(C);56320<=D&&D<=57343?h[d++]=1024*(R-55296)+D-56320+65536:(h[d++]=R,h[d++]=D)}else R!==65279&&(h[d++]=R)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const b=u.length;if(!b)return 0;let d,w,C,R,D=0,m=0,g=0;if(this.interim[0]){let E=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let A,O=0;for(;(A=63&this.interim[++O])&&O<4;)T<<=6,T|=A;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=x-O;for(;g<L;){if(g>=b)return 0;if(A=u[g++],(192&A)!=128){g--,E=!0;break}this.interim[O++]=A,T<<=6,T|=63&A}E||(x===2?T<128?g--:h[D++]=T:x===3?T<2048||T>=55296&&T<=57343||T===65279||(h[D++]=T):T<65536||T>1114111||(h[D++]=T)),this.interim.fill(0)}const _=b-4;let y=g;for(;y<b;){for(;!(!(y<_)||128&(d=u[y])||128&(w=u[y+1])||128&(C=u[y+2])||128&(R=u[y+3]));)h[D++]=d,h[D++]=w,h[D++]=C,h[D++]=R,y+=4;if(d=u[y++],d<128)h[D++]=d;else if((224&d)==192){if(y>=b)return this.interim[0]=d,D;if(w=u[y++],(192&w)!=128){y--;continue}if(m=(31&d)<<6|63&w,m<128){y--;continue}h[D++]=m}else if((240&d)==224){if(y>=b)return this.interim[0]=d,D;if(w=u[y++],(192&w)!=128){y--;continue}if(y>=b)return this.interim[0]=d,this.interim[1]=w,D;if(C=u[y++],(192&C)!=128){y--;continue}if(m=(15&d)<<12|(63&w)<<6|63&C,m<2048||m>=55296&&m<=57343||m===65279)continue;h[D++]=m}else if((248&d)==240){if(y>=b)return this.interim[0]=d,D;if(w=u[y++],(192&w)!=128){y--;continue}if(y>=b)return this.interim[0]=d,this.interim[1]=w,D;if(C=u[y++],(192&C)!=128){y--;continue}if(y>=b)return this.interim[0]=d,this.interim[1]=w,this.interim[2]=C,D;if(R=u[y++],(192&R)!=128){y--;continue}if(m=(7&d)<<18|(63&w)<<12|(63&C)<<6|63&R,m<65536||m>1114111)continue;h[D++]=m}}return D}}},225:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;l.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let d=0;d<u.length;++d)b.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?b[d]:(function(w,C){let R,D=0,m=C.length-1;if(w<C[0][0]||w>C[m][1])return!1;for(;m>=D;)if(R=D+m>>1,w>C[R][1])D=R+1;else{if(!(w<C[R][0]))return!0;m=R-1}return!1})(d,h)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=u(8460),b=u(844);class d extends b.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,R){if(R!==void 0&&this._syncCalls>R)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let D;for(this._isSyncWriting=!0;D=this._writeBuffer.shift();){this._action(D);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,R){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(R),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(R)}_innerWrite(C=0,R=!0){const D=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],g=this._action(m,R);if(g){const y=E=>Date.now()-D>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(D,E);return void g.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-D>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=d},5941:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function b(d,w){const C=d.toString(16),R=C.length<2?"0"+C:C;switch(w){case 4:return C[0];case 8:return R;case 12:return(R+R).slice(0,3);default:return R+R}}l.parseColor=function(d){if(!d)return;let w=d.toLowerCase();if(w.indexOf("rgb:")===0){w=w.slice(4);const C=u.exec(w);if(C){const R=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/R*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/R*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/R*255)]}}else if(w.indexOf("#")===0&&(w=w.slice(1),h.exec(w)&&[3,6,9,12].includes(w.length))){const C=w.length/3,R=[0,0,0];for(let D=0;D<3;++D){const m=parseInt(w.slice(C*D,C*D+C),16);R[D]=C===1?m<<4:C===2?m:C===3?m>>4:m>>8}return R}},l.toRgbString=function(d,w=16){const[C,R,D]=d;return`rgb:${b(C,w)}/${b(R,w)}/${b(D,w)}`}},5770:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=u(482),b=u(8742),d=u(5770),w=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=w,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=w}registerHandler(R,D){this._handlers[R]===void 0&&(this._handlers[R]=[]);const m=this._handlers[R];return m.push(D),{dispose:()=>{const g=m.indexOf(D);g!==-1&&m.splice(g,1)}}}clearHandler(R){this._handlers[R]&&delete this._handlers[R]}setHandlerFallback(R){this._handlerFb=R}reset(){if(this._active.length)for(let R=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;R>=0;--R)this._active[R].unhook(!1);this._stack.paused=!1,this._active=w,this._ident=0}hook(R,D){if(this.reset(),this._ident=R,this._active=this._handlers[R]||w,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(D);else this._handlerFb(this._ident,"HOOK",D)}put(R,D,m){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(R,D,m);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(R,D,m))}unhook(R,D=!0){if(this._active.length){let m=!1,g=this._active.length-1,_=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,m=D,_=this._stack.fallThrough,this._stack.paused=!1),!_&&m===!1){for(;g>=0&&(m=this._active[g].unhook(R),m!==!0);g--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,m;g--}for(;g>=0;g--)if(m=this._active[g].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",R);this._active=w,this._ident=0}};const C=new b.Params;C.addParam(0),l.DcsHandler=class{constructor(R){this._handler=R,this._data="",this._params=C,this._hitLimit=!1}hook(R){this._params=R.length>1||R.params[0]?R.clone():C,this._data="",this._hitLimit=!1}put(R,D,m){this._hitLimit||(this._data+=(0,h.utf32ToString)(R,D,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(R){let D=!1;if(this._hitLimit)D=!1;else if(R&&(D=this._handler(this._data,this._params),D instanceof Promise))return D.then((m=>(this._params=C,this._data="",this._hitLimit=!1,m)));return this._params=C,this._data="",this._hitLimit=!1,D}}},2015:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=u(844),b=u(8742),d=u(6242),w=u(6351);class C{constructor(g){this.table=new Uint8Array(g)}setDefault(g,_){this.table.fill(g<<4|_)}add(g,_,y,E){this.table[_<<8|g]=y<<4|E}addMany(g,_,y,E){for(let T=0;T<g.length;T++)this.table[_<<8|g[T]]=y<<4|E}}l.TransitionTable=C;const R=160;l.VT500_TRANSITION_TABLE=(function(){const m=new C(4095),g=Array.apply(null,Array(256)).map(((O,x)=>x)),_=(O,x)=>g.slice(O,x),y=_(32,127),E=_(0,24);E.push(25),E.push.apply(E,_(28,32));const T=_(0,14);let A;for(A in m.setDefault(1,0),m.addMany(y,0,2,0),T)m.addMany([24,26,153,154],A,3,0),m.addMany(_(128,144),A,3,0),m.addMany(_(144,152),A,3,0),m.add(156,A,0,0),m.add(27,A,11,1),m.add(157,A,4,8),m.addMany([152,158,159],A,0,7),m.add(155,A,11,3),m.add(144,A,11,9);return m.addMany(E,0,3,0),m.addMany(E,1,3,1),m.add(127,1,0,1),m.addMany(E,8,0,8),m.addMany(E,3,3,3),m.add(127,3,0,3),m.addMany(E,4,3,4),m.add(127,4,0,4),m.addMany(E,6,3,6),m.addMany(E,5,3,5),m.add(127,5,0,5),m.addMany(E,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(y,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(_(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(y,7,0,7),m.addMany(E,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(_(64,127),3,7,0),m.addMany(_(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(_(48,60),4,8,4),m.addMany(_(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(_(32,64),6,0,6),m.add(127,6,0,6),m.addMany(_(64,127),6,0,0),m.addMany(_(32,48),3,9,5),m.addMany(_(32,48),5,9,5),m.addMany(_(48,64),5,0,6),m.addMany(_(64,127),5,7,0),m.addMany(_(32,48),4,9,5),m.addMany(_(32,48),1,9,2),m.addMany(_(32,48),2,9,2),m.addMany(_(48,127),2,10,0),m.addMany(_(48,80),1,10,0),m.addMany(_(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(_(96,127),1,10,0),m.add(80,1,11,9),m.addMany(E,9,0,9),m.add(127,9,0,9),m.addMany(_(28,32),9,0,9),m.addMany(_(32,48),9,9,12),m.addMany(_(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(E,11,0,11),m.addMany(_(32,128),11,0,11),m.addMany(_(28,32),11,0,11),m.addMany(E,10,0,10),m.add(127,10,0,10),m.addMany(_(28,32),10,0,10),m.addMany(_(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(_(32,48),10,9,12),m.addMany(E,12,0,12),m.add(127,12,0,12),m.addMany(_(28,32),12,0,12),m.addMany(_(32,48),12,9,12),m.addMany(_(48,64),12,0,11),m.addMany(_(64,127),12,12,13),m.addMany(_(64,127),10,12,13),m.addMany(_(64,127),9,12,13),m.addMany(E,13,13,13),m.addMany(y,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(R,0,2,0),m.add(R,8,5,8),m.add(R,6,0,6),m.add(R,11,0,11),m.add(R,13,13,13),m})();class D extends h.Disposable{constructor(g=l.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new b.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(_,y,E)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,y)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new w.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,_=[64,126]){let y=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=g.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<g.intermediates.length;++T){const A=g.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=A}}if(g.final.length!==1)throw new Error("final must be a single byte");const E=g.final.charCodeAt(0);if(_[0]>E||E>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return y<<=8,y|=E,y}identToString(g){const _=[];for(;g;)_.push(String.fromCharCode(255&g)),g>>=8;return _.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,_){const y=this._identifier(g,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(_),{dispose:()=>{const T=E.indexOf(_);T!==-1&&E.splice(T,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,_){this._executeHandlers[g.charCodeAt(0)]=_}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,_){const y=this._identifier(g);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(_),{dispose:()=>{const T=E.indexOf(_);T!==-1&&E.splice(T,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,_){return this._dcsParser.registerHandler(this._identifier(g),_)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,_){return this._oscParser.registerHandler(g,_)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(g,_,y,E,T){this._parseStack.state=g,this._parseStack.handlers=_,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(g,_,y){let E,T=0,A=0,O=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,O=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&L>-1){for(;L>=0&&(E=x[L](this._params),E!==!0);L--)if(E instanceof Promise)return this._parseStack.handlerPos=L,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&L>-1){for(;L>=0&&(E=x[L](),E!==!0);L--)if(E instanceof Promise)return this._parseStack.handlerPos=L,E}this._parseStack.handlers=[];break;case 6:if(T=g[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=g[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,O=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let x=O;x<_;++x){switch(T=g[x],A=this._transitions.table[this.currentState<<8|(T<160?T:R)],A>>4){case 2:for(let $=x+1;;++$){if($>=_||(T=g[$])<32||T>126&&T<R){this._printHandler(g,x,$),x=$-1;break}if(++$>=_||(T=g[$])<32||T>126&&T<R){this._printHandler(g,x,$),x=$-1;break}if(++$>=_||(T=g[$])<32||T>126&&T<R){this._printHandler(g,x,$),x=$-1;break}if(++$>=_||(T=g[$])<32||T>126&&T<R){this._printHandler(g,x,$),x=$-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|T];let I=L?L.length-1:-1;for(;I>=0&&(E=L[I](this._params),E!==!0);I--)if(E instanceof Promise)return this._preserveStack(3,L,I,A,x),E;I<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingCodepoint=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++x<_&&(T=g[x])>47&&T<60);x--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const V=this._escHandlers[this._collect<<8|T];let P=V?V.length-1:-1;for(;P>=0&&(E=V[P](),E!==!0);P--)if(E instanceof Promise)return this._preserveStack(4,V,P,A,x),E;P<0&&this._escHandlerFb(this._collect<<8|T),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let $=x+1;;++$)if($>=_||(T=g[$])===24||T===26||T===27||T>127&&T<R){this._dcsParser.put(g,x,$),x=$-1;break}break;case 14:if(E=this._dcsParser.unhook(T!==24&&T!==26),E)return this._preserveStack(6,[],0,A,x),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let $=x+1;;$++)if($>=_||(T=g[$])<32||T>127&&T<R){this._oscParser.put(g,x,$),x=$-1;break}break;case 6:if(E=this._oscParser.end(T!==24&&T!==26),E)return this._preserveStack(5,[],0,A,x),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&A}}}l.EscapeSequenceParser=D},6242:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=u(5770),b=u(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const R=this._handlers[w];return R.push(C),{dispose:()=>{const D=R.indexOf(C);D!==-1&&R.splice(D,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].start();else this._handlerFb(this._id,"START")}_put(w,C,R){if(this._active.length)for(let D=this._active.length-1;D>=0;D--)this._active[D].put(w,C,R);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(w,C,R))}start(){this.reset(),this._state=1}put(w,C,R){if(this._state!==3){if(this._state===1)for(;C<R;){const D=w[C++];if(D===59){this._state=2,this._start();break}if(D<48||57<D)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+D-48}this._state===2&&R-C>0&&this._put(w,C,R)}}end(w,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let R=!1,D=this._active.length-1,m=!1;if(this._stack.paused&&(D=this._stack.loopPosition-1,R=C,m=this._stack.fallThrough,this._stack.paused=!1),!m&&R===!1){for(;D>=0&&(R=this._active[D].end(w),R!==!0);D--)if(R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=D,this._stack.fallThrough=!1,R;D--}for(;D>=0;D--)if(R=this._active[D].end(!1),R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=D,this._stack.fallThrough=!0,R}else this._handlerFb(this._id,"END",w);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(w){this._handler=w,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(w,C,R){this._hitLimit||(this._data+=(0,b.utf32ToString)(w,C,R),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data),C instanceof Promise))return C.then((R=>(this._data="",this._hitLimit=!1,R)));return this._data="",this._hitLimit=!1,C}}},8742:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class h{static fromArray(d){const w=new h;if(!d.length)return w;for(let C=Array.isArray(d[0])?1:0;C<d.length;++C){const R=d[C];if(Array.isArray(R))for(let D=0;D<R.length;++D)w.addSubParam(R[D]);else w.addParam(R)}return w}constructor(d=32,w=32){if(this.maxLength=d,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(w),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let w=0;w<this.length;++w){d.push(this.params[w]);const C=this._subParamsIdx[w]>>8,R=255&this._subParamsIdx[w];R-C>0&&d.push(Array.prototype.slice.call(this._subParams,C,R))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const w=this._subParamsIdx[d]>>8,C=255&this._subParamsIdx[d];return C-w>0?this._subParams.subarray(w,C):null}getSubParamsAll(){const d={};for(let w=0;w<this.length;++w){const C=this._subParamsIdx[w]>>8,R=255&this._subParamsIdx[w];R-C>0&&(d[w]=this._subParams.slice(C,R))}return d}addDigit(d){let w;if(this._rejectDigits||!(w=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,R=C[w-1];C[w-1]=~R?Math.min(10*R+d,u):d}}l.Params=h},5741:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const b={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(b),h.dispose=()=>this._wrappedAddonDispose(b),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===u){h=b;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=u(3785),b=u(511);l.BufferApiView=class{constructor(d,w){this._buffer=d,this.type=w}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const w=this._buffer.lines.get(d);if(w)return new h.BufferLineApiView(w)}getNullCell(){return new b.CellData}}},3785:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=u(511);l.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,d){if(!(b<0||b>=this._line.length))return d?(this._line.loadCell(b,d),d):this._line.loadCell(b,new h.CellData)}translateToString(b,d,w){return this._line.translateToString(b,d,w)}}},8285:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=u(8771),b=u(8460),d=u(844);class w extends d.Disposable{constructor(R){super(),this._core=R,this._onBufferChange=this.register(new b.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=w},7975:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(b=>h(b.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((b,d)=>h(b,d.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(v,l,u){var h=this&&this.__decorate||function(m,g,_,y){var E,T=arguments.length,A=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,g,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(T<3?E(A):T>3?E(g,_,A):E(g,_))||A);return T>3&&A&&Object.defineProperty(g,_,A),A},b=this&&this.__param||function(m,g){return function(_,y){g(_,y,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),w=u(844),C=u(5295),R=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let D=l.BufferService=class extends w.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(m,this))}resize(m,g){this.cols=m,this.rows=g,this.buffers.resize(m,g),this._onResize.fire({cols:m,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,g=!1){const _=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===m.fg&&y.getBg(0)===m.bg||(y=_.getBlankLine(m,g),this._cachedBlankLine=y),y.isWrapped=g;const E=_.ybase+_.scrollTop,T=_.ybase+_.scrollBottom;if(_.scrollTop===0){const A=_.lines.isFull;T===_.lines.length-1?A?_.lines.recycle().copyFrom(y):_.lines.push(y.clone()):_.lines.splice(T+1,0,y.clone()),A?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const A=T-E+1;_.lines.shiftElements(E+1,A-1,-1),_.lines.set(T,y.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(m,g,_){const y=this.buffer;if(m<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else m+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+m,y.ybase),0),E!==y.ydisp&&(g||this._onScroll.fire(y.ydisp))}};l.BufferService=D=h([b(0,R.IOptionsService)],D)},7994:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(v,l,u){var h=this&&this.__decorate||function(y,E,T,A){var O,x=arguments.length,L=x<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,T,A);else for(var I=y.length-1;I>=0;I--)(O=y[I])&&(L=(x<3?O(L):x>3?O(E,T,L):O(E,T))||L);return x>3&&L&&Object.defineProperty(E,T,L),L},b=this&&this.__param||function(y,E){return function(T,A){E(T,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),w=u(8460),C=u(844),R={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function D(y,E){let T=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(T|=64,T|=y.action):(T|=3&y.button,4&y.button&&(T|=64),8&y.button&&(T|=128),y.action===32?T|=32:y.action!==0||E||(T|=3)),T}const m=String.fromCharCode,g={DEFAULT:y=>{const E=[D(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${m(E[0])}${m(E[1])}${m(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${D(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${D(y,!0)};${y.x};${y.y}${E}`}};let _=l.CoreMouseService=class extends C.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new w.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(R))this.addProtocol(T,R[T]);for(const T of Object.keys(g))this.addEncoding(T,g[T]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,T){if(T){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};l.CoreMouseService=_=h([b(0,d.IBufferService),b(1,d.ICoreService)],_)},6975:function(v,l,u){var h=this&&this.__decorate||function(_,y,E,T){var A,O=arguments.length,x=O<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,y,E,T);else for(var L=_.length-1;L>=0;L--)(A=_[L])&&(x=(O<3?A(x):O>3?A(y,E,x):A(y,E))||x);return O>3&&x&&Object.defineProperty(y,E,x),x},b=this&&this.__param||function(_,y){return function(E,T){y(E,T,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),w=u(8460),C=u(844),R=u(2585),D=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=l.CoreService=class extends C.Disposable{constructor(_,y,E){super(),this._bufferService=_,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new w.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new w.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new w.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new w.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(D),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(D),this.decPrivateModes=(0,d.clone)(m)}triggerDataEvent(_,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(_))}};l.CoreService=g=h([b(0,R.IBufferService),b(1,R.ILogService),b(2,R.IOptionsService)],g)},9074:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=u(8055),b=u(8460),d=u(844),w=u(6106);let C=0,R=0;class D extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new w.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new b.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new b.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const y=new m(_);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,y,E){var T,A,O;let x=0,L=0;for(const I of this._decorations.getKeyIterator(y))x=(T=I.options.x)!==null&&T!==void 0?T:0,L=x+((A=I.options.width)!==null&&A!==void 0?A:1),_>=x&&_<L&&(!E||((O=I.options.layer)!==null&&O!==void 0?O:"bottom")===E)&&(yield I)}forEachDecorationAtCell(_,y,E,T){this._decorations.forEachByKey(y,(A=>{var O,x,L;C=(O=A.options.x)!==null&&O!==void 0?O:0,R=C+((x=A.options.width)!==null&&x!==void 0?x:1),_>=C&&_<R&&(!E||((L=A.options.layer)!==null&&L!==void 0?L:"bottom")===E)&&T(A)}))}}l.DecorationService=D;class m extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(_){super(),this.options=_,this.onRenderEmitter=this.register(new b.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new b.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=u(2585),b=u(8343);class d{constructor(...C){this._entries=new Map;for(const[R,D]of C)this.set(R,D)}set(C,R){const D=this._entries.get(C);return this._entries.set(C,R),D}forEach(C){for(const[R,D]of this._entries.entries())C(R,D)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(w,C){this._services.set(w,C)}getService(w){return this._services.get(w)}createInstance(w,...C){const R=(0,b.getServiceDependencies)(w).sort(((g,_)=>g.index-_.index)),D=[];for(const g of R){const _=this._services.get(g.id);if(!_)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${g.id}.`);D.push(_)}const m=R.length>0?R[0].index:C.length;if(C.length!==m)throw new Error(`[createInstance] First service dependency of ${w.name} at position ${m+1} conflicts with ${C.length} static arguments`);return new w(...C,...D)}}},7866:function(v,l,u){var h=this&&this.__decorate||function(m,g,_,y){var E,T=arguments.length,A=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,g,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(T<3?E(A):T>3?E(g,_,A):E(g,_))||A);return T>3&&A&&Object.defineProperty(g,_,A),A},b=this&&this.__param||function(m,g){return function(_,y){g(_,y,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),w=u(2585),C={trace:w.LogLevelEnum.TRACE,debug:w.LogLevelEnum.DEBUG,info:w.LogLevelEnum.INFO,warn:w.LogLevelEnum.WARN,error:w.LogLevelEnum.ERROR,off:w.LogLevelEnum.OFF};let R,D=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=w.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),R=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let g=0;g<m.length;g++)typeof m[g]=="function"&&(m[g]=m[g]())}_log(m,g,_){this._evalLazyOptionalParams(_),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,..._)}trace(m,...g){var _,y;this._logLevel<=w.LogLevelEnum.TRACE&&this._log((y=(_=this._optionsService.options.logger)===null||_===void 0?void 0:_.trace.bind(this._optionsService.options.logger))!==null&&y!==void 0?y:console.log,m,g)}debug(m,...g){var _,y;this._logLevel<=w.LogLevelEnum.DEBUG&&this._log((y=(_=this._optionsService.options.logger)===null||_===void 0?void 0:_.debug.bind(this._optionsService.options.logger))!==null&&y!==void 0?y:console.log,m,g)}info(m,...g){var _,y;this._logLevel<=w.LogLevelEnum.INFO&&this._log((y=(_=this._optionsService.options.logger)===null||_===void 0?void 0:_.info.bind(this._optionsService.options.logger))!==null&&y!==void 0?y:console.info,m,g)}warn(m,...g){var _,y;this._logLevel<=w.LogLevelEnum.WARN&&this._log((y=(_=this._optionsService.options.logger)===null||_===void 0?void 0:_.warn.bind(this._optionsService.options.logger))!==null&&y!==void 0?y:console.warn,m,g)}error(m,...g){var _,y;this._logLevel<=w.LogLevelEnum.ERROR&&this._log((y=(_=this._optionsService.options.logger)===null||_===void 0?void 0:_.error.bind(this._optionsService.options.logger))!==null&&y!==void 0?y:console.error,m,g)}};l.LogService=D=h([b(0,w.IOptionsService)],D),l.setTraceLogger=function(m){R=m},l.traceCall=function(m,g,_){if(typeof _.value!="function")throw new Error("not supported");const y=_.value;_.value=function(...E){if(R.logLevel!==w.LogLevelEnum.TRACE)return y.apply(this,E);R.trace(`GlyphRenderer#${y.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=y.apply(this,E);return R.trace(`GlyphRenderer#${y.name} return`,T),T}}},7302:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=u(8460),b=u(844),d=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const w=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends b.Disposable{constructor(D){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m=Object.assign({},l.DEFAULT_OPTIONS);for(const g in D)if(g in m)try{const _=D[g];m[g]=this._sanitizeAndValidateOption(g,_)}catch(_){console.error(_)}this.rawOptions=m,this.options=Object.assign({},m),this._setupOptions()}onSpecificOptionChange(D,m){return this.onOptionChange((g=>{g===D&&m(this.rawOptions[D])}))}onMultipleOptionChange(D,m){return this.onOptionChange((g=>{D.indexOf(g)!==-1&&m()}))}_setupOptions(){const D=g=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},m=(g,_)=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);_=this._sanitizeAndValidateOption(g,_),this.rawOptions[g]!==_&&(this.rawOptions[g]=_,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const _={get:D.bind(this,g),set:m.bind(this,g)};Object.defineProperty(this.options,g,_)}}_sanitizeAndValidateOption(D,m){switch(D){case"cursorStyle":if(m||(m=l.DEFAULT_OPTIONS[D]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${D}`);break;case"wordSeparator":m||(m=l.DEFAULT_OPTIONS[D]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=w.includes(m)?m:l.DEFAULT_OPTIONS[D];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${D} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${D} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${D} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${D} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}l.OptionsService=C},2660:function(v,l,u){var h=this&&this.__decorate||function(C,R,D,m){var g,_=arguments.length,y=_<3?R:m===null?m=Object.getOwnPropertyDescriptor(R,D):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,R,D,m);else for(var E=C.length-1;E>=0;E--)(g=C[E])&&(y=(_<3?g(y):_>3?g(R,D,y):g(R,D))||y);return _>3&&y&&Object.defineProperty(R,D,y),y},b=this&&this.__param||function(C,R){return function(D,m){R(D,m,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let w=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const R=this._bufferService.buffer;if(C.id===void 0){const E=R.addMarker(R.ybase+R.y),T={data:C,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const D=C,m=this._getEntryIdKey(D),g=this._entriesWithId.get(m);if(g)return this.addLineToLink(g.id,R.ybase+R.y),g.id;const _=R.addMarker(R.ybase+R.y),y={id:this._nextId++,key:this._getEntryIdKey(D),data:D,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(y,_))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(C,R){const D=this._dataByLinkId.get(C);if(D&&D.lines.every((m=>m.line!==R))){const m=this._bufferService.buffer.addMarker(R);D.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(D,m)))}}getLinkData(C){var R;return(R=this._dataByLinkId.get(C))===null||R===void 0?void 0:R.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,R){const D=C.lines.indexOf(R);D!==-1&&(C.lines.splice(D,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=w=h([b(0,d.IBufferService)],w)},8343:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(b){return b[h]||[]},l.createDecorator=function(b){if(l.serviceRegistry.has(b))return l.serviceRegistry.get(b);const d=function(w,C,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(D,m,g){m[u]===m?m[h].push({id:D,index:g}):(m[h]=[{id:D,index:g}],m[u]=m)})(d,w,R)};return d.toString=()=>b,l.serviceRegistry.set(b,d),d}},2585:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=u(8343);var b;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(b||(l.LogLevelEnum=b={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(v,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=u(8460),b=u(225);l.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new b.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let w=0;const C=d.length;for(let R=0;R<C;++R){let D=d.charCodeAt(R);if(55296<=D&&D<=56319){if(++R>=C)return w+this.wcwidth(D);const m=d.charCodeAt(R);56320<=m&&m<=57343?D=1024*(D-55296)+m-56320+65536:w+=this.wcwidth(m)}w+=this.wcwidth(D)}return w}}}},a={};function c(v){var l=a[v];if(l!==void 0)return l.exports;var u=a[v]={exports:{}};return s[v].call(u.exports,u,u.exports,c),u.exports}var f={};return(()=>{var v=f;Object.defineProperty(v,"__esModule",{value:!0}),v.Terminal=void 0;const l=c(9042),u=c(3236),h=c(844),b=c(5741),d=c(8285),w=c(7975),C=c(7090),R=["cols","rows"];class D extends h.Disposable{constructor(g){super(),this._core=this.register(new u.Terminal(g)),this._addonManager=this.register(new b.AddonManager),this._publicOptions=Object.assign({},this._core.options);const _=E=>this._core.options[E],y=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:_.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(g){if(R.includes(g))throw new Error(`Option "${g}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new w.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const _ in g)this._publicOptions[_]=g[_]}blur(){this._core.blur()}focus(){this._core.focus()}resize(g,_){this._verifyIntegers(g,_),this._core.resize(g,_)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){var _,y,E;return this._checkProposedApi(),this._verifyPositiveIntegers((_=g.x)!==null&&_!==void 0?_:0,(y=g.width)!==null&&y!==void 0?y:0,(E=g.height)!==null&&E!==void 0?E:0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,_,y){this._verifyIntegers(g,_,y),this._core.select(g,_,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,_){this._verifyIntegers(g,_),this._core.selectLines(g,_)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,_){this._core.write(g,_)}writeln(g,_){this._core.write(g),this._core.write(`\r
|
|
331
|
+
`,_)}paste(g){this._core.paste(g)}refresh(g,_){this._verifyIntegers(g,_),this._core.refresh(g,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return l}_verifyIntegers(...g){for(const _ of g)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const _ of g)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}v.Terminal=D})(),f})()))})(wf)),wf.exports}var M4=L4(),Cf={exports:{}},hy;function k4(){return hy||(hy=1,(function(i,r){(function(s,a){i.exports=a()})(self,(()=>(()=>{var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(c){this._terminal=c}dispose(){}fit(){const c=this.proposeDimensions();if(!c||!this._terminal||isNaN(c.cols)||isNaN(c.rows))return;const f=this._terminal._core;this._terminal.rows===c.rows&&this._terminal.cols===c.cols||(f._renderService.clear(),this._terminal.resize(c.cols,c.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const c=this._terminal._core,f=c._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const v=this._terminal.options.scrollback===0?0:c.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),d=u-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),w=h-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-v;return{cols:Math.max(2,Math.floor(w/f.css.cell.width)),rows:Math.max(1,Math.floor(d/f.css.cell.height))}}}})(),s})()))})(Cf)),Cf.exports}var B4=k4(),uu={exports:{}},N4=uu.exports,dy;function j4(){return dy||(dy=1,(function(i,r){(function(s,a){i.exports=a()})(N4,(()=>(()=>{var s={433:(v,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV11=void 0;const u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],h=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],b=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function C(R,D){let m,g=0,_=D.length-1;if(R<D[0][0]||R>D[_][1])return!1;for(;_>=g;)if(m=g+_>>1,R>D[m][1])g=m+1;else{if(!(R<D[m][0]))return!0;_=m-1}return!1}l.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let R=0;R<u.length;++R)w.fill(0,u[R][0],u[R][1]+1);for(let R=0;R<b.length;++R)w.fill(2,b[R][0],b[R][1]+1)}}wcwidth(R){return R<32?0:R<127?1:R<65536?w[R]:C(R,h)?0:C(R,d)?2:1}}}},a={};function c(v){var l=a[v];if(l!==void 0)return l.exports;var u=a[v]={exports:{}};return s[v](u,u.exports,c),u.exports}var f={};return(()=>{var v=f;Object.defineProperty(v,"__esModule",{value:!0}),v.Unicode11Addon=void 0;const l=c(433);v.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),f})()))})(uu)),uu.exports}var H4=j4();function P4(){var i;return typeof window>"u"?!1:navigator.maxTouchPoints>0?!0:((i=window.matchMedia)==null?void 0:i.call(window,"(any-pointer: coarse)").matches)??!1}function z4(){if(typeof navigator>"u")return!1;const i=navigator.userAgent,r=/iPad|iPhone|iPod/.test(i),s=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return r||s}function I4(i){return i&&i.replace(/\r?\n/g,`\r
|
|
332
|
+
`)}function U4(i,r){let s=r,a=0;for(const l of i)l===10&&!s&&(a+=1),s=l===13;const c=s;if(a===0)return{normalized:i,endedWithCR:c};const f=new Uint8Array(i.length+a);let v=0;s=r;for(const l of i)l===10&&!s&&(f[v]=13,v+=1),f[v]=l,v+=1,s=l===13;return{normalized:f,endedWithCR:c}}const F4=[{key:"ctrl-c",label:"CTRL-C",payload:""},{key:"ctrl-d",label:"CTRL-D",payload:""},{key:"home",label:"HOME",payload:"\x1B[H"},{key:"end",label:"END",payload:"\x1B[F"},{key:"page-up",label:"PAGE-UP",payload:"\x1B[5;2~"},{key:"page-down",label:"PAGE-DOWN",payload:"\x1B[6;2~"},{key:"tab",label:"TAB",payload:" "},{key:"esc",label:"ESC",payload:"\x1B"},{key:"shift-enter",label:"SHIFT+ENTER",payload:"\x1B[13;2u"},{key:":",label:":",payload:":"},{key:"/",label:"/",payload:"/"},{key:"'",label:"'",payload:"'"},{key:'"',label:'"',payload:'"'},{key:"`",label:"`",payload:"`"},{key:"backspace",label:"BACKSPACE",payload:"\b"},{key:"delete",label:"DELETE",payload:""},{key:"up",label:"↑",payload:"\x1B[A"},{key:"down",label:"↓",payload:"\x1B[B"},{key:"left",label:"←",payload:"\x1B[D"},{key:"right",label:"→",payload:"\x1B[C"},{key:"enter",label:"ENTER",payload:"\r"}];function fy(){var Oe;const{t:i}=wr(),{deviceId:r,windowId:s,paneId:a}=rx(),c=ku(),f=N.useRef(null),v=N.useRef(null),l=N.useRef(null),u=N.useRef(null),h=N.useRef(!1),b=N.useRef([]),d=N.useRef(!1),w=N.useRef(0),C=N.useRef(null),R=N.useRef(!1),D=N.useRef(!1),m=N.useRef(null),g=N.useRef(!1),_=N.useRef(null),y=N.useRef(null),E=N.useRef(null),T=N.useRef(null),A=N.useRef(0),O=N.useRef([]),x=N.useRef(null),L=N.useRef(null),I=N.useRef(null),V=N.useRef(!1),P=qt(te=>te.connectDevice),$=qt(te=>te.disconnectDevice),Z=qt(te=>te.selectPane),W=qt(te=>te.sendInput),q=qt(te=>te.resizePane),Y=qt(te=>te.syncPaneSize),k=qt(te=>te.subscribeBinary),z=qt(te=>te.subscribeHistory),K=qt(te=>r?te.snapshots[r]:void 0),B=qt(te=>{var ye;return r?(ye=te.deviceErrors)==null?void 0:ye[r]:void 0}),F=qt(te=>{var ye;return r?(ye=te.deviceConnected)==null?void 0:ye[r]:!1}),X=qt(te=>te.lastConnectRequest),ne=qt(te=>te.socketReady),ae=Tn(te=>{var ye;return((ye=te.settings)==null?void 0:ye.siteName)??"tmex"}),pe=N.useMemo(()=>Lm(a),[a]),j=N.useMemo(()=>r&&pe?`${r}:${pe}`:null,[r,pe]),[G,oe]=N.useState(!1),[le,me]=N.useState(""),[he,Ce]=N.useState(!1),[Ve,He]=N.useState(!1),[xe,Ee]=N.useState(!0),[Ue,Fe]=N.useState(null),[st,qe]=N.useState(0),[Ae,Ye]=N.useState(0),Be=Ur(te=>te.inputMode),at=Ur(te=>te.editorSendWithEnter),Wt=Ur(te=>te.setEditorSendWithEnter),Zt=Ur(te=>te.addEditorHistory),et=Ur(te=>te.setEditorDraft),nt=Ur(te=>te.removeEditorDraft),dt=Ur(te=>j?te.editorDrafts[j]??"":""),It=N.useMemo(()=>z4(),[]),Qe=G&&Be==="editor"&&It&&he,Jt=(Oe=K==null?void 0:K.session)==null?void 0:Oe.windows,{data:bt}=Qs({queryKey:["devices"],queryFn:async()=>{const te=await fetch("/api/devices");if(!te.ok)throw new Error("Failed to fetch devices");return te.json()},throwOnError:!1}),ei=N.useMemo(()=>{if(r)return bt==null?void 0:bt.devices.find(te=>te.id===r)},[r,bt==null?void 0:bt.devices]),Tt=N.useMemo(()=>{if(!(!s||!Jt))return Jt.find(te=>te.id===s)},[s,Jt]),si=N.useMemo(()=>{if(!(!pe||!Tt))return Tt.panes.find(te=>te.id===pe)},[pe,Tt]),Nr=!!Jt,yi=Nr&&!!s&&!Tt||Nr&&!!s&&!!pe&&!!Tt&&!si?i("wsError.checkGateway"):null,bi=!!yi,di=N.useMemo(()=>!yi||!r||!s||!pe?null:`${r}:${s}:${pe}:${yi}`,[r,yi,pe,s]),Le=!!(F&&pe&&!bi),Dt=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");N.useEffect(()=>{!Dt||!r||X&&X.deviceId!==r&&console.warn("[tmux] route device mismatch with last connect request",{routeDeviceId:r,lastConnectRequest:X})},[r,Dt,X]);const Ht=N.useMemo(()=>{if(!Tt||!si)return null;const te=(ei==null?void 0:ei.name)??r;return k1({paneIdx:si.index,windowIdx:Tt.index,paneTitle:si.title,windowName:Tt.name,deviceName:te})},[ei==null?void 0:ei.name,r,si,Tt]),Pt=N.useCallback((te,ye=!1)=>{var vt;if(!r||!pe||!F||bi||!ye&&Date.now()<A.current)return!1;const we=l.current;if(!we)return!1;(vt=u.current)==null||vt.fit();const ke=Math.max(2,we.cols),ze=Math.max(2,we.rows),Ze=E.current;return!ye&&Ze&&Ze.cols===ke&&Ze.rows===ze||(te==="sync"?Y(r,pe,ke,ze):q(r,pe,ke,ze),E.current={cols:ke,rows:ze},T.current={cols:ke,rows:ze,at:Date.now()}),!0},[F,r,bi,q,pe,Y]),$t=N.useCallback((te="resize",ye={})=>{const{immediate:we=!1,force:ke=!1}=ye;y.current!==null&&(window.clearTimeout(y.current),y.current=null),_.current!==null&&(cancelAnimationFrame(_.current),_.current=null);const ze=()=>{_.current=requestAnimationFrame(()=>{_.current=null,Pt(te,ke)})};if(we){ze();return}y.current=window.setTimeout(()=>{y.current=null,ze()},80)},[Pt]),yt=N.useCallback(()=>{for(const te of O.current)window.clearTimeout(te);O.current=[]},[]),ti=N.useCallback(()=>{var ye;yt(),$t("sync",{immediate:!0,force:!0});const te=window.setTimeout(()=>{$t("sync",{immediate:!0,force:!0})},60);O.current.push(te),typeof document<"u"&&"fonts"in document&&((ye=document.fonts)!=null&&ye.ready)&&document.fonts.ready.then(()=>{$t("sync",{immediate:!0,force:!0})}).catch(()=>{})},[yt,$t]),ji=N.useCallback((te,ye)=>{if(te!==w.current)return;if(R.current){C.current=null;return}m.current!==null&&(window.clearTimeout(m.current),m.current=null);const we=l.current;if(!d.current||!we){C.current={sessionId:te,data:ye};return}we.write(I4(ye));for(const ke of b.current)we.write(ke);b.current=[],D.current=!0,R.current=!0,C.current=null},[]),Q=N.useCallback(te=>{if(te!==w.current||R.current)return;const ye=l.current;if(!(!d.current||!ye)){if(b.current.length>0){for(const we of b.current)ye.write(we);b.current=[]}D.current=!0,R.current=!0,C.current=null}},[]);N.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current),yt(),y.current!==null&&window.clearTimeout(y.current),_.current!==null&&cancelAnimationFrame(_.current)},[yt]),N.useEffect(()=>{if(!s||!pe)return;w.current+=1,D.current=!1,R.current=!1,C.current=null,b.current=[],g.current=!1,E.current=null,T.current=null,m.current!==null&&(window.clearTimeout(m.current),m.current=null),yt();const te=l.current;te&&d.current&&te.reset()},[yt,r,s,pe]),N.useEffect(()=>{const te=()=>{oe(window.innerWidth<768||"ontouchstart"in window)};return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[]),N.useEffect(()=>{if(!G||!It||V.current)return;V.current=!0;const te=()=>{window.scrollTo(0,1)},ye=window.requestAnimationFrame(te),we=window.setTimeout(te,120),ke=window.setTimeout(te,420);return()=>{window.cancelAnimationFrame(ye),window.clearTimeout(we),window.clearTimeout(ke)}},[It,G]),N.useEffect(()=>{Be!=="editor"&&Ce(!1)},[Be]),N.useEffect(()=>{var ke,ze;if(!(G&&It&&Be==="editor"&&he)){qe(0);return}let te=null;const ye=()=>{const Ze=window.visualViewport,vt=(Ze==null?void 0:Ze.height)??window.innerHeight,St=(Ze==null?void 0:Ze.offsetTop)??0,ot=Math.max(0,Math.round(window.innerHeight-vt-St));qe(ot)},we=()=>{te===null&&(te=window.requestAnimationFrame(()=>{te=null,ye()}))};return ye(),(ke=window.visualViewport)==null||ke.addEventListener("resize",we),(ze=window.visualViewport)==null||ze.addEventListener("scroll",we),window.addEventListener("resize",we),()=>{var Ze,vt;(Ze=window.visualViewport)==null||Ze.removeEventListener("resize",we),(vt=window.visualViewport)==null||vt.removeEventListener("scroll",we),window.removeEventListener("resize",we),te!==null&&window.cancelAnimationFrame(te)}},[Be,he,It,G]),N.useEffect(()=>{if(!Qe){Ye(0);return}const te=v.current;if(!te)return;const ye=()=>{Ye(Math.ceil(te.getBoundingClientRect().height))};ye();const we=new ResizeObserver(ye);return we.observe(te),()=>we.disconnect()},[Qe]),N.useEffect(()=>{if(!f.current||l.current)return;const te=f.current,ye=()=>{try{const ke=P4(),ze=new M4.Terminal({fontFamily:'"JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Sarasa Mono SC", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", monospace',fontSize:14,convertEol:!0,...ke?{scrollSensitivity:2,smoothScrollDuration:120}:{},fastScrollModifier:"ctrl",fastScrollSensitivity:1,letterSpacing:0,theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#c9d1d9",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4"},cursorBlink:!0,allowProposedApi:!0,scrollback:1e4}),Ze=new B4.FitAddon,vt=new H4.Unicode11Addon;ze.loadAddon(Ze),ze.loadAddon(vt),ze.unicode.versions.includes("11")&&(ze.unicode.activeVersion="11"),ze.open(te),requestAnimationFrame(()=>{Ze.fit(),d.current=!0;const St=C.current;St&&St.sessionId===w.current?ji(St.sessionId,St.data):St&&(C.current=null)}),l.current=ze,u.current=Ze,Ee(!1)}catch(ke){console.error("[DevicePage] Failed to initialize terminal:",ke),Fe(i("terminal.initFailed")),Ee(!1)}},we=te.getBoundingClientRect();if(we.width>0&&we.height>0)ye();else{const ke=new ResizeObserver(ze=>{for(const Ze of ze){const{width:vt,height:St}=Ze.contentRect;if(vt>0&&St>0&&!l.current){ye(),ke.disconnect();break}}});return ke.observe(te),()=>ke.disconnect()}return()=>{if(l.current){try{l.current.dispose()}catch{}l.current=null}u.current=null,d.current=!1}},[ji,i]),N.useEffect(()=>{if(r)return P(r,"page"),h.current=!1,()=>{$(r,"page")}},[P,r,$]),N.useEffect(()=>{if(r)return k(r,te=>{const ye=U4(te,g.current);if(g.current=ye.endedWithCR,!d.current||!l.current){b.current.push(ye.normalized.slice());return}if(!D.current){b.current.push(ye.normalized.slice());return}l.current.write(ye.normalized)})},[r,k]),N.useEffect(()=>{if(!r||!pe||!ne)return;const te=w.current;return z(r,pe,ye=>{ji(te,ye)})},[ji,r,pe,ne,z]),N.useEffect(()=>{if(!r||s&&pe||h.current||!F||!Jt||Jt.length===0)return;const te=Jt.find(we=>we.active)??Jt[0],ye=te.panes.find(we=>we.active)??te.panes[0];ye&&(h.current=!0,c(`/devices/${r}/windows/${te.id}/panes/${jb(ye.id)}`,{replace:!0}))},[F,r,c,pe,s,Jt]),N.useEffect(()=>{if(!r||!s||!pe||xe||!ne||!F||bi)return;const te=w.current;m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{m.current=null,Q(te)},400),Pt("sync",!0),Z(r,s,pe),ti()},[F,r,Q,xe,bi,Pt,pe,ti,Z,ne,s]),N.useEffect(()=>{if(!Le||!si||!d.current)return;const te=l.current;if(!te)return;const ye=Math.max(2,Math.floor(si.width||0)),we=Math.max(2,Math.floor(si.height||0));if(!ye||!we||te.cols===ye&&te.rows===we)return;const ke=T.current;if(ke){const ze=Date.now()-ke.at;if(ke.cols===ye&&ke.rows===we&&ze<1800){T.current=null,E.current={cols:ye,rows:we};return}if(ze<900)return;T.current=null}A.current=Date.now()+220,te.resize(ye,we),E.current={cols:ye,rows:we}},[Le,si]),N.useEffect(()=>{!Le||xe||$t("resize",{immediate:!0,force:!0})},[Le,xe,$t]),N.useEffect(()=>{!Le||!si||xe||ti()},[Le,xe,ti,si==null?void 0:si.id]),N.useEffect(()=>{const te=l.current;if(!te||!r||!pe)return;const ye=te.onData(we=>{Le&&(Ve||W(r,pe,we,!1))});return te.attachCustomKeyEventHandler(we=>!Le||Be!=="direct"||Ve||we.type!=="keydown"?!0:we.shiftKey&&we.key==="Enter"?(we.preventDefault(),W(r,pe,"\x1B[13;2u",!1),!1):!0),()=>{ye.dispose(),te.attachCustomKeyEventHandler(()=>!0)}},[Le,r,Be,Ve,pe,W]),N.useEffect(()=>{me(dt)},[dt]),N.useEffect(()=>{const te=l.current;if(!te||!d.current)return;const ye=window.requestAnimationFrame(()=>{te.scrollToBottom()}),we=window.setTimeout(()=>{te.scrollToBottom()},120);return()=>{window.cancelAnimationFrame(ye),window.clearTimeout(we)}},[Be]),N.useEffect(()=>{if(!Le)return;const te=()=>{$t("resize")};return window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[Le,$t]),N.useEffect(()=>{const te=f.current;if(!te||!Le)return;const ye=new ResizeObserver(()=>{$t("resize")});return ye.observe(te),()=>ye.disconnect()},[Le,$t]),N.useEffect(()=>{B!=null&&B.message&&_t.error(B.message)},[B==null?void 0:B.message]),N.useEffect(()=>{Ue&&_t.error(Ue)},[Ue]),N.useEffect(()=>{if(L.current=di,x.current!==null&&(window.clearTimeout(x.current),x.current=null),!di||!yi){I.current=null;return}if(I.current!==di)return x.current=window.setTimeout(()=>{L.current===di&&(_t.error(yi),I.current=di,x.current=null)},500),()=>{x.current!==null&&(window.clearTimeout(x.current),x.current=null)}},[di,yi]),N.useEffect(()=>(document.title=T4(Ht),()=>{document.title=ae}),[ae,Ht]),N.useEffect(()=>{const te=()=>{var ye;(ye=l.current)==null||ye.scrollToBottom()};return window.addEventListener("tmex:jump-to-latest",te),()=>{window.removeEventListener("tmex:jump-to-latest",te)}},[]);const re=N.useCallback(()=>{var te;(te=l.current)==null||te.scrollToBottom()},[]),de=N.useCallback(te=>{!r||!pe||!Le||W(r,pe,te,!1)},[Le,r,pe,W]),Se=N.useCallback(()=>{if(!r||!pe||!Le||!le.trim())return;const te=at?`${le}\r`:le;W(r,pe,te,!1),Zt(le),j&&nt(j),me("")},[Zt,Le,r,j,at,le,nt,pe,W]),Re=N.useCallback(()=>{if(!r||!pe||!Le||!le.trim())return;const te=le.split(/\r?\n/);for(const ye of te)ye.trim()&&W(r,pe,`${ye}\r`,!1);Zt(le),j&&nt(j),me("")},[Zt,Le,r,j,le,nt,pe,W]),Pe=N.useCallback(te=>{if(Ce(!0),!(G&&It))return;const ye=te.currentTarget;window.requestAnimationFrame(()=>{ye.scrollIntoView({block:"nearest",inline:"nearest"})}),window.setTimeout(()=>{window.scrollTo(0,1)},60)},[It,G]),je=N.useCallback(()=>{Ce(!1)},[]);if(!r)return H.jsx("div",{className:"flex items-center justify-center h-full",children:H.jsx("div",{className:"text-[var(--color-text-secondary)]",children:i("device.noDevices")})});const De=!F&&!B;return H.jsxs("div",{className:"flex flex-col h-full bg-[var(--color-bg)]","data-testid":"device-page",children:[!G&&H.jsxs("div",{className:"h-11 flex items-center justify-between px-3 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border)] gap-2 flex-shrink-0",children:[H.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1 overflow-hidden",children:H.jsx("span",{"data-testid":"terminal-topbar-title",className:"text-sm font-medium truncate",title:Ht??ae,children:Ht??ae})}),H.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[H.jsxs(xt,{variant:"ghost",size:"sm","data-testid":"terminal-jump-latest",className:"px-2 py-1 text-xs",onClick:re,title:i("nav.jumpToLatest"),disabled:!Le,children:[H.jsx(Sb,{className:"h-3 w-3 mr-1"}),H.jsx("span",{className:"hidden sm:inline",children:i("nav.jumpToLatest")})]}),H.jsx(xt,{variant:"default",size:"sm","data-testid":"terminal-input-mode-toggle",className:"px-2 py-1 text-xs",onClick:()=>Ur.setState({inputMode:Be==="direct"?"editor":"direct"}),children:Be==="direct"?H.jsxs(H.Fragment,{children:[H.jsx(Cb,{className:"h-3 w-3 mr-1"})," ",i("nav.switchToEditor")]}):H.jsxs(H.Fragment,{children:[H.jsx(xb,{className:"h-3 w-3 mr-1"})," ",i("nav.switchToDirect")]})})]})]}),H.jsx("div",{className:"terminal-shortcuts-strip","data-testid":"terminal-shortcuts-strip",children:H.jsx("div",{className:"shortcut-row","data-testid":"editor-shortcuts-row",children:F4.map(te=>H.jsx(xt,{variant:"default",size:"sm",title:te.label,"aria-label":te.label,"data-testid":`editor-shortcut-${te.key}`,onClick:()=>de(te.payload),disabled:!Le,children:te.label},te.key))})}),H.jsxs("div",{className:`flex-1 relative overflow-hidden min-h-0 min-w-0 ${G&&Be==="editor"&&!Qe?"pb-2":""}`,style:Qe?{paddingBottom:`${Ae}px`}:void 0,children:[H.jsx("div",{ref:f,className:"w-full h-full min-w-0 min-h-0"}),(xe||De)&&H.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--color-bg)]/80 backdrop-blur-sm","data-testid":"terminal-status-overlay",children:H.jsxs("div",{className:"flex flex-col items-center gap-3",children:[H.jsx("div",{className:"w-8 h-8 border-2 border-[var(--color-accent)] border-t-transparent rounded-full animate-spin"}),H.jsx("span",{className:"text-[var(--color-text-secondary)]","data-testid":"terminal-status-text",children:i(xe?"terminal.initializing":"terminal.connecting")})]})})]}),Be==="editor"&&H.jsxs("div",{ref:v,className:`editor-mode-input ${Qe?"editor-mode-input-docked":""}`,style:Qe?{bottom:`${st}px`}:void 0,children:[H.jsx("textarea",{"data-testid":"editor-input",value:le,onChange:te=>{const ye=te.target.value;if(me(ye),!!j){if(ye){et(j,ye);return}nt(j)}},placeholder:i("terminal.inputPlaceholder"),onFocus:Pe,onBlur:je,onCompositionStart:()=>He(!0),onCompositionEnd:()=>He(!1)}),H.jsx("div",{className:"actions",children:H.jsxs("div",{className:"send-row","data-testid":"editor-send-row",children:[H.jsxs("label",{className:"send-with-enter-toggle","data-testid":"editor-send-with-enter-toggle",children:[H.jsx("input",{type:"checkbox",checked:at,onChange:te=>Wt(te.target.checked)}),H.jsx("span",{children:i("terminal.editorSendWithEnter")})]}),H.jsxs(xt,{variant:"default",size:"sm","data-testid":"editor-clear",onClick:()=>{me(""),j&&nt(j)},title:i("terminal.clear"),children:[H.jsx(Dm,{className:"h-4 w-4 mr-1"}),i("terminal.clear")]}),H.jsxs(xt,{variant:"default",size:"sm","data-testid":"editor-send-line-by-line",onClick:Re,disabled:!Le,children:[H.jsx($f,{className:"h-4 w-4 mr-1"}),i("terminal.editorSendLineByLine")]}),H.jsxs(xt,{variant:"primary",size:"sm","data-testid":"editor-send",onClick:Se,disabled:!Le,children:[H.jsx($f,{className:"h-4 w-4 mr-1"}),i("common.send")]})]})})]}),G&&Be==="direct"&&H.jsx("input",{type:"text",className:"sr-only",onCompositionStart:()=>He(!0),onCompositionEnd:te=>{He(!1),!(!r||!pe||!Le)&&(W(r,pe,te.target.value,!1),te.target.value="")}})]})}function Vr(i){const r=i.trim();return r||void 0}function my(i){return i?{name:i.name,type:i.type,host:i.host??"",port:i.port??22,username:i.username??"",sshConfigRef:i.sshConfigRef??"",session:i.session??"tmex",authMode:i.type==="local"?"auto":i.authMode,password:"",privateKey:"",privateKeyPassphrase:""}:{name:"",type:"local",host:"",port:22,username:"",sshConfigRef:"",session:"tmex",authMode:"auto",password:"",privateKey:"",privateKeyPassphrase:""}}function q4(i){if(i.type==="local")return{name:i.name.trim(),type:"local",session:Vr(i.session)??"tmex",authMode:"auto"};const r={name:i.name.trim(),type:"ssh",host:Vr(i.host),port:i.port,username:Vr(i.username),sshConfigRef:Vr(i.sshConfigRef),session:Vr(i.session)??"tmex",authMode:i.authMode};return i.authMode==="password"&&(r.password=i.password),i.authMode==="key"&&(r.privateKey=i.privateKey,r.privateKeyPassphrase=i.privateKeyPassphrase||void 0),r}function $4(i){if(i.type==="local")return{name:i.name.trim(),session:Vr(i.session)??"tmex",authMode:"auto"};const r={name:i.name.trim(),host:Vr(i.host),port:i.port,username:Vr(i.username),sshConfigRef:Vr(i.sshConfigRef),session:Vr(i.session)??"tmex",authMode:i.authMode};return i.authMode==="password"&&i.password&&(r.password=i.password),i.authMode==="key"&&i.privateKey&&(r.privateKey=i.privateKey,r.privateKeyPassphrase=i.privateKeyPassphrase||void 0),r}async function py(i,r){try{return(await i.json()).error??r}catch{return r}}function gy(){const{t:i}=wr(),[r,s]=N.useState(!1),[a,c]=N.useState(null),f=ea(),{data:v,isLoading:l}=Qs({queryKey:["devices"],queryFn:async()=>{const b=await fetch("/api/devices");if(!b.ok)throw new Error(i("device.loadFailed"));return b.json()},throwOnError:!1}),u=_r({mutationFn:async b=>{if(!(await fetch(`/api/devices/${b}`,{method:"DELETE"})).ok)throw new Error(i("device.deleteFailed"))},onSuccess:()=>{f.invalidateQueries({queryKey:["devices"]}),_t.success(i("common.success"))},onError:b=>{_t.error(b instanceof Error?b.message:i("common.error"))}}),h=(v==null?void 0:v.devices)??[];return H.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[H.jsxs("div",{className:"flex items-center justify-between mb-6",children:[H.jsx("h1",{className:"text-2xl font-bold",children:i("device.title")}),H.jsxs(xt,{variant:"primary","data-testid":"devices-add",onClick:()=>s(!0),children:[H.jsx(Eb,{className:"h-4 w-4"}),i("device.addDevice")]})]}),l?H.jsx("div",{className:"text-center py-12 text-[var(--color-text-secondary)]",children:i("common.loading")}):h.length===0?H.jsx(yl,{children:H.jsxs(Ou,{className:"text-center py-12",children:[H.jsx("div",{className:"text-4xl mb-4",children:"🖥️"}),H.jsx("h3",{className:"text-lg font-medium mb-2",children:i("device.noDevices")}),H.jsxs("p",{className:"text-[var(--color-text-secondary)] mb-4",children:[i("device.typeLocal")," / SSH ",i("device.type")]}),H.jsx(xt,{variant:"primary","data-testid":"devices-add-empty",onClick:()=>s(!0),children:i("device.addDevice")})]})}):H.jsx("div",{className:"grid gap-4",children:h.map(b=>H.jsx(K4,{device:b,onEdit:()=>c(b),onDelete:()=>u.mutate(b.id)},b.id))}),r&&H.jsx(vy,{mode:"create",onClose:()=>s(!1)}),a&&H.jsx(vy,{mode:"edit",device:a,onClose:()=>c(null)})]})}function K4({device:i,onEdit:r,onDelete:s}){const{t:a}=wr(),c=i.type==="local"?H.jsx(fu,{className:"h-6 w-6"}):H.jsx(wb,{className:"h-6 w-6"}),f=i.type==="local"?a("device.typeLocal"):`${i.username}@${i.host}:${i.port}`;return H.jsx(yl,{"data-testid":"device-card","data-device-id":i.id,"data-device-name":i.name,children:H.jsxs(Au,{children:[H.jsx("div",{className:"text-[var(--color-accent)]",children:c}),H.jsxs("div",{className:"flex-1 min-w-0",children:[H.jsx(Lu,{children:i.name}),H.jsx(M1,{children:f}),i.session&&i.session!=="tmex"&&H.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:["Session: ",i.session]})]}),H.jsxs("div",{className:"flex items-center gap-2",children:[H.jsx(xt,{variant:"default",size:"sm",onClick:r,title:a("device.editDevice"),children:H.jsx(nR,{className:"h-4 w-4"})}),H.jsx(xt,{variant:"primary",size:"sm",asChild:!0,children:H.jsx(yn,{"data-testid":`device-connect-${i.id}`,to:`/devices/${i.id}`,children:a("device.connect")})}),H.jsx(xt,{variant:"danger",size:"sm",onClick:s,title:a("common.delete"),children:H.jsx(Dm,{className:"h-4 w-4"})})]})]})})}function vy({mode:i,device:r,onClose:s}){const{t:a}=wr(),c=ea(),[f,v]=N.useState(!1),[l,u]=N.useState(()=>my(r));N.useEffect(()=>{u(my(r))},[r]);const h=l.type==="ssh",b=i==="edit",d=_r({mutationFn:async x=>{const L=await fetch("/api/devices",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!L.ok)throw new Error(await py(L,a("device.createFailed")));return L.json()},onSuccess:()=>{c.invalidateQueries({queryKey:["devices"]}),_t.success(a("common.success")),s()},onError:x=>{_t.error(x instanceof Error?x.message:a("common.error"))}}),w=_r({mutationFn:async x=>{if(!r)throw new Error(a("apiError.deviceNotFound"));const L=await fetch(`/api/devices/${r.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!L.ok)throw new Error(await py(L,a("device.updateFailed")));return L.json()},onSuccess:()=>{c.invalidateQueries({queryKey:["devices"]}),_t.success(a("common.success")),s()},onError:x=>{_t.error(x instanceof Error?x.message:a("common.error"))}}),C=async x=>{x.preventDefault(),v(!0);try{i==="create"?await d.mutateAsync(q4(l)):await w.mutateAsync($4(l))}catch{}finally{v(!1)}},R=`${i}-device-name`,D=`${i}-device-type`,m=`${i}-device-host`,g=`${i}-device-port`,_=`${i}-device-username`,y=`${i}-device-session`,E=`${i}-device-auth-mode`,T=`${i}-device-password`,A=`${i}-device-private-key`,O=`${i}-device-private-key-passphrase`;return H.jsx(d4,{open:!0,onOpenChange:x=>!x&&s(),"data-testid":"device-dialog",children:H.jsxs(f4,{className:"w-full max-w-lg",children:[H.jsxs(m4,{children:[H.jsx(p4,{children:a(b?"device.editDevice":"device.addDevice")}),H.jsx(g4,{})]}),H.jsxs("form",{onSubmit:C,children:[H.jsxs(v4,{className:"space-y-4",children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:R,children:a("device.name")}),H.jsx(Ri,{id:R,"data-testid":"device-name-input",type:"text",value:l.name,onChange:x=>u(L=>({...L,name:x.target.value})),placeholder:a("device.namePlaceholder"),required:!0})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:D,children:a("device.type")}),H.jsxs(_u,{id:D,"data-testid":"device-type-select",value:l.type,onChange:x=>{const L=x.target.value;u(I=>({...I,type:L,authMode:L==="local"?"auto":I.authMode==="auto"?"password":I.authMode}))},disabled:b,children:[H.jsx(Zn,{value:"local",children:a("device.typeLocal")}),H.jsxs(Zn,{value:"ssh",children:["SSH ",a("device.type")]})]})]}),h&&H.jsxs(H.Fragment,{children:[H.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[H.jsxs("div",{className:"col-span-2",children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:m,children:a("device.host")}),H.jsx(Ri,{id:m,type:"text",value:l.host,onChange:x=>u(L=>({...L,host:x.target.value})),placeholder:a("device.hostPlaceholder")})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:g,children:a("device.port")}),H.jsx(Ri,{id:g,type:"number",value:l.port,onChange:x=>u(L=>({...L,port:Number.parseInt(x.target.value||"22",10)})),min:1,max:65535})]})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:_,children:a("device.username")}),H.jsx(Ri,{id:_,type:"text",value:l.username,onChange:x=>u(L=>({...L,username:x.target.value})),placeholder:a("device.usernamePlaceholder")})]})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:y,children:a("device.session")}),H.jsx(Ri,{id:y,"data-testid":"device-session-input",type:"text",value:l.session,onChange:x=>u(L=>({...L,session:x.target.value})),placeholder:a("device.sessionPlaceholder")}),H.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:'"tmex"'})]}),h&&H.jsxs(H.Fragment,{children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:E,children:a("device.authMode")}),H.jsxs(_u,{id:E,value:l.authMode,onChange:x=>u(L=>({...L,authMode:x.target.value})),children:[H.jsx(Zn,{value:"password",children:a("device.authPassword")}),H.jsx(Zn,{value:"key",children:a("device.authKey")}),H.jsx(Zn,{value:"agent",children:a("device.authAgent")}),H.jsx(Zn,{value:"configRef",children:"SSH Config"})]})]}),l.authMode==="password"&&H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:T,children:a("device.password")}),H.jsx(Ri,{id:T,type:"password",value:l.password,onChange:x=>u(L=>({...L,password:x.target.value}))})]}),l.authMode==="key"&&H.jsxs(H.Fragment,{children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:A,children:a("device.privateKey")}),H.jsx(Hb,{id:A,value:l.privateKey,onChange:x=>u(L=>({...L,privateKey:x.target.value})),className:"h-24 font-mono text-xs",placeholder:a("device.privateKeyPlaceholder")})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:O,children:a("device.passphrase")}),H.jsx(Ri,{id:O,type:"password",value:l.privateKeyPassphrase,onChange:x=>u(L=>({...L,privateKeyPassphrase:x.target.value}))})]})]})]})]}),H.jsxs(_4,{className:"px-4 pb-4",children:[H.jsx(xt,{type:"button",variant:"default",className:"flex-1",onClick:s,children:a("common.cancel")}),H.jsx(xt,{type:"submit",variant:"primary",className:"flex-1","data-testid":"device-dialog-save",disabled:f,children:a(f?"common.saving":"common.save")})]})]})]})})}async function kr(i,r){try{return(await i.json()).error??r}catch{return r}}function V4(){var Y,k;const{t:i}=wr(),r=ea(),{refreshSettings:s}=Tn(),[a,c]=N.useState("tmex"),[f,v]=N.useState(window.location.origin),[l,u]=N.useState("en_US"),[h,b]=N.useState(6),[d,w]=N.useState(!0),[C,R]=N.useState(!0),[D,m]=N.useState(2),[g,_]=N.useState(10),[y,E]=N.useState(!1),[T,A]=N.useState(""),[O,x]=N.useState(""),[L,I]=N.useState(null),V=Qs({queryKey:["site-settings"],queryFn:async()=>{const z=await fetch("/api/settings/site");if(!z.ok)throw new Error(await kr(z,i("settings.loadFailed")));return await z.json()}}),P=Qs({queryKey:["telegram-bots"],queryFn:async()=>{const z=await fetch("/api/settings/telegram/bots");if(!z.ok)throw new Error(await kr(z,i("telegram.loadBotsFailed")));return await z.json()}});N.useEffect(()=>{var K;const z=(K=V.data)==null?void 0:K.settings;z&&(c(z.siteName),v(z.siteUrl),u(z.language??"en_US"),b(z.bellThrottleSeconds),w(z.enableBrowserBellToast??!0),R(z.enableTelegramBellPush??!0),m(z.sshReconnectMaxRetries),_(z.sshReconnectDelaySeconds))},[(Y=V.data)==null?void 0:Y.settings]);const $=_r({mutationFn:async()=>{const K=await fetch("/api/settings/site",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:a,siteUrl:f,language:l,bellThrottleSeconds:h,enableBrowserBellToast:d,enableTelegramBellPush:C,sshReconnectMaxRetries:D,sshReconnectDelaySeconds:g})});if(!K.ok)throw new Error(await kr(K,i("settings.saveFailed")))},onSuccess:async()=>{var z,K;await Promise.all([r.invalidateQueries({queryKey:["site-settings"]}),s()]),_t.success(i("settings.settingsSaved")),((K=(z=V.data)==null?void 0:z.settings)==null?void 0:K.language)!==l&&E(!0)},onError:z=>{_t.error(z instanceof Error?z.message:i("common.error"))}}),Z=_r({mutationFn:async()=>{const z=await fetch("/api/settings/restart",{method:"POST"});if(!z.ok)throw new Error(await kr(z,i("settings.restartFailed")))},onSuccess:()=>{_t.success(i("settings.restartScheduled"))},onError:z=>{_t.error(z instanceof Error?z.message:i("common.error"))}}),W=_r({mutationFn:async()=>{const z=await fetch("/api/settings/telegram/bots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T,token:O,enabled:!0,allowAuthRequests:!0})});if(!z.ok)throw new Error(await kr(z,i("telegram.createFailed")))},onSuccess:async()=>{A(""),x(""),await r.invalidateQueries({queryKey:["telegram-bots"]}),_t.success(i("common.success"))},onError:z=>{_t.error(z instanceof Error?z.message:i("common.error"))}}),q=((k=P.data)==null?void 0:k.bots)??[];return H.jsxs("div",{className:"p-6 max-w-5xl mx-auto space-y-6","data-testid":"settings-page",children:[H.jsxs("div",{className:"flex items-center justify-between",children:[H.jsx("h1",{className:"text-2xl font-bold",children:i("nav.settings")}),H.jsxs(xt,{variant:"ghost",onClick:()=>{Promise.all([r.invalidateQueries({queryKey:["site-settings"]}),r.invalidateQueries({queryKey:["telegram-bots"]})])},children:[H.jsx(oR,{className:"h-4 w-4"}),i("common.refresh")]})]}),H.jsxs(yl,{children:[H.jsx(Au,{children:H.jsx(Lu,{children:i("settings.siteName")})}),H.jsxs(Ou,{className:"space-y-4",children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"site-name-input",children:i("settings.siteName")}),H.jsx(Ri,{id:"site-name-input",value:a,onChange:z=>c(z.target.value),placeholder:i("settings.siteNamePlaceholder")})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"site-url-input",children:i("settings.siteUrl")}),H.jsx(Ri,{id:"site-url-input",value:f,onChange:z=>v(z.target.value),placeholder:i("settings.siteUrlPlaceholder")})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"language-select",children:i("settings.language")}),H.jsxs(_u,{id:"language-select","data-testid":"settings-language-select",value:l,onChange:z=>u(z.target.value),children:[H.jsx(Zn,{value:"en_US",children:i("settings.language_en_US")}),H.jsx(Zn,{value:"zh_CN",children:i("settings.language_zh_CN")})]}),y&&H.jsx("p",{className:"text-xs text-[var(--color-accent)] mt-1","data-testid":"settings-refresh-notice",children:i("settings.refreshToApply")})]}),H.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[H.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer select-none",htmlFor:"enable-browser-bell-toast",children:[H.jsx("input",{id:"enable-browser-bell-toast","data-testid":"settings-enable-browser-bell-toast",type:"checkbox",checked:d,onChange:z=>w(z.target.checked)}),H.jsx("span",{children:i("settings.enableBrowserBellToast")})]}),H.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer select-none",htmlFor:"enable-telegram-bell-push",children:[H.jsx("input",{id:"enable-telegram-bell-push","data-testid":"settings-enable-telegram-bell-push",type:"checkbox",checked:C,onChange:z=>R(z.target.checked)}),H.jsx("span",{children:i("settings.enableTelegramBellPush")})]})]}),H.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"bell-throttle-input",children:i("settings.bellThrottle")}),H.jsx(Ri,{id:"bell-throttle-input",type:"number",value:h,min:0,max:300,onChange:z=>b(Number(z.target.value))})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"ssh-reconnect-retries-input",children:i("settings.sshReconnectMaxRetries")}),H.jsx(Ri,{id:"ssh-reconnect-retries-input",type:"number",value:D,min:0,max:20,onChange:z=>m(Number(z.target.value))})]}),H.jsxs("div",{children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"ssh-reconnect-delay-input",children:i("settings.sshReconnectDelay")}),H.jsx(Ri,{id:"ssh-reconnect-delay-input",type:"number",value:g,min:1,max:300,onChange:z=>_(Number(z.target.value))})]})]}),H.jsxs("div",{className:"flex items-center justify-end gap-2",children:[H.jsxs(xt,{variant:"danger","data-testid":"settings-restart",onClick:()=>Z.mutate(),disabled:Z.isPending,children:[H.jsx(cR,{className:"h-4 w-4"}),i("settings.restartGateway")]}),H.jsxs(xt,{variant:"primary","data-testid":"settings-save",onClick:()=>$.mutate(),disabled:$.isPending,children:[H.jsx(qf,{className:"h-4 w-4"}),i("common.save")]})]})]})]}),H.jsxs(yl,{children:[H.jsx(Au,{children:H.jsx(Lu,{children:i("telegram.title")})}),H.jsxs(Ou,{className:"space-y-4",children:[H.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end",children:[H.jsxs("div",{className:"md:col-span-3",children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"new-bot-name",children:i("telegram.botName")}),H.jsx(Ri,{id:"new-bot-name",value:T,onChange:z=>A(z.target.value),placeholder:i("telegram.botNamePlaceholder")})]}),H.jsxs("div",{className:"md:col-span-7",children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"new-bot-token",children:i("telegram.botToken")}),H.jsx(Ri,{id:"new-bot-token",type:"password",value:O,onChange:z=>x(z.target.value),placeholder:i("telegram.botTokenPlaceholder")})]}),H.jsx("div",{className:"md:col-span-2",children:H.jsxs(xt,{variant:"primary",className:"w-full",onClick:()=>W.mutate(),disabled:W.isPending||!T.trim()||!O.trim(),children:[W.isPending?H.jsx(tR,{className:"h-4 w-4 animate-spin"}):H.jsx(qf,{className:"h-4 w-4"}),i("telegram.addBot")]})})]}),H.jsxs("div",{className:"space-y-3",children:[P.isLoading&&H.jsx("div",{className:"text-sm text-[var(--color-text-secondary)]",children:i("common.loading")}),!P.isLoading&&q.length===0&&H.jsx("div",{className:"text-sm text-[var(--color-text-secondary)]",children:i("telegram.addBot")}),q.map(z=>H.jsx(W4,{bot:z,expanded:L===z.id,onToggleExpand:()=>{I(K=>K===z.id?null:z.id)}},z.id))]})]})]})]})}function W4({bot:i,expanded:r,onToggleExpand:s}){var E;const{t:a}=wr(),c=ea(),[f,v]=N.useState(i.name),[l,u]=N.useState(""),[h,b]=N.useState(i.enabled),[d,w]=N.useState(i.allowAuthRequests);N.useEffect(()=>{v(i.name),b(i.enabled),w(i.allowAuthRequests)},[i.allowAuthRequests,i.enabled,i.name]);const C=Qs({queryKey:["telegram-bot-chats",i.id],enabled:r,queryFn:async()=>{const T=await fetch(`/api/settings/telegram/bots/${i.id}/chats`);if(!T.ok)throw new Error(await kr(T,a("telegram.loadChatsFailed")));return await T.json()}}),R=N.useMemo(()=>{var A;const T=((A=C.data)==null?void 0:A.chats)??[];return{pending:T.filter(O=>O.status==="pending"),authorized:T.filter(O=>O.status==="authorized")}},[(E=C.data)==null?void 0:E.chats]),D=_r({mutationFn:async()=>{const T={name:f,enabled:h,allowAuthRequests:d};l.trim()&&(T.token=l.trim());const A=await fetch(`/api/settings/telegram/bots/${i.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!A.ok)throw new Error(await kr(A,a("telegram.updateFailed")))},onSuccess:async()=>{u(""),await c.invalidateQueries({queryKey:["telegram-bots"]}),_t.success(a("common.success"))},onError:T=>{_t.error(T instanceof Error?T.message:a("common.error"))}}),m=_r({mutationFn:async()=>{const T=await fetch(`/api/settings/telegram/bots/${i.id}`,{method:"DELETE"});if(!T.ok)throw new Error(await kr(T,a("telegram.deleteFailed")))},onSuccess:async()=>{await c.invalidateQueries({queryKey:["telegram-bots"]}),_t.success(a("common.success"))},onError:T=>{_t.error(T instanceof Error?T.message:a("common.error"))}}),g=_r({mutationFn:async T=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(T)}/approve`,{method:"POST"});if(!A.ok)throw new Error(await kr(A,a("telegram.approveFailed")))},onSuccess:async()=>{await Promise.all([c.invalidateQueries({queryKey:["telegram-bots"]}),c.invalidateQueries({queryKey:["telegram-bot-chats",i.id]})]),_t.success(a("common.success"))},onError:T=>{_t.error(T instanceof Error?T.message:a("common.error"))}}),_=_r({mutationFn:async T=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(T)}`,{method:"DELETE"});if(!A.ok)throw new Error(await kr(A,a("telegram.removeFailed")))},onSuccess:async()=>{await Promise.all([c.invalidateQueries({queryKey:["telegram-bots"]}),c.invalidateQueries({queryKey:["telegram-bot-chats",i.id]})]),_t.success(a("common.success"))},onError:T=>{_t.error(T instanceof Error?T.message:a("common.error"))}}),y=_r({mutationFn:async T=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(T)}/test`,{method:"POST"});if(!A.ok)throw new Error(await kr(A,a("telegram.testMessageFailed")))},onSuccess:()=>{_t.success(a("common.success"))},onError:T=>{_t.error(T instanceof Error?T.message:a("common.error"))}});return H.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-bg-secondary)] p-4 space-y-3",children:[H.jsxs("div",{className:"flex items-center justify-between gap-3",children:[H.jsxs("div",{children:[H.jsx("div",{className:"font-medium",children:i.name}),H.jsxs("div",{className:"text-xs text-[var(--color-text-secondary)]",children:[i.authorizedCount," / ",i.pendingCount]})]}),H.jsx(xt,{variant:"ghost",onClick:s,children:a(r?"common.collapse":"common.expand")})]}),H.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end",children:[H.jsxs("div",{className:"md:col-span-3",children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:`bot-name-${i.id}`,children:a("telegram.botName")}),H.jsx(Ri,{id:`bot-name-${i.id}`,value:f,onChange:T=>v(T.target.value)})]}),H.jsxs("div",{className:"md:col-span-4",children:[H.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:`bot-token-${i.id}`,children:a("telegram.botToken")}),H.jsx(Ri,{id:`bot-token-${i.id}`,type:"password",value:l,onChange:T=>u(T.target.value),placeholder:a("telegram.tokenPlaceholder")})]}),H.jsx("div",{className:"md:col-span-2",children:H.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[H.jsx("input",{type:"checkbox",checked:h,onChange:T=>b(T.target.checked)}),a("common.enabled")]})}),H.jsx("div",{className:"md:col-span-3",children:H.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[H.jsx("input",{type:"checkbox",checked:d,onChange:T=>w(T.target.checked)}),a("telegram.allowAuthRequests")]})})]}),H.jsxs("div",{className:"flex items-center justify-end gap-2",children:[H.jsxs(xt,{variant:"danger",onClick:()=>m.mutate(),children:[H.jsx(Dm,{className:"h-4 w-4"}),a("telegram.deleteBot")]}),H.jsxs(xt,{variant:"primary",onClick:()=>D.mutate(),children:[H.jsx(qf,{className:"h-4 w-4"}),a("common.save")]})]}),r&&H.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 pt-2 border-t border-[var(--color-border)]",children:[H.jsxs("div",{className:"space-y-2",children:[H.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1",children:[H.jsx(b0,{className:"h-4 w-4"}),a("telegram.pendingChats")]}),R.pending.length===0&&H.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:"-"}),R.pending.map(T=>H.jsx(_y,{chat:T,pending:!0,onApprove:()=>g.mutate(T.chatId),onDelete:()=>_.mutate(T.chatId)},`${T.botId}-${T.chatId}`))]}),H.jsxs("div",{className:"space-y-2",children:[H.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1",children:[H.jsx(b0,{className:"h-4 w-4"}),a("telegram.chats")]}),R.authorized.length===0&&H.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:"-"}),R.authorized.map(T=>H.jsx(_y,{chat:T,pending:!1,onTest:()=>y.mutate(T.chatId),onDelete:()=>_.mutate(T.chatId)},`${T.botId}-${T.chatId}`))]}),C.isLoading&&H.jsx("div",{className:"lg:col-span-2 text-xs text-[var(--color-text-secondary)]",children:a("common.loading")})]})]})}function _y({chat:i,pending:r,onApprove:s,onDelete:a,onTest:c}){const{t:f}=wr(),v=Tn(l=>{var u;return((u=l.settings)==null?void 0:u.language)??"en_US"});return H.jsxs("div",{className:"rounded border border-[var(--color-border)] p-3 bg-[var(--color-bg)] space-y-2",children:[H.jsx("div",{className:"text-sm font-medium truncate",title:i.displayName,children:i.displayName}),H.jsxs("div",{className:"text-xs text-[var(--color-text-secondary)]",children:[f("telegram.chatId"),":",i.chatId]}),H.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:new Date(i.appliedAt).toLocaleString(Bb(v))}),H.jsx("div",{className:"flex items-center justify-end gap-2",children:r?H.jsxs(H.Fragment,{children:[H.jsx(xt,{variant:"default",size:"sm",onClick:a,children:f("telegram.reject")}),H.jsx(xt,{variant:"primary",size:"sm",onClick:s,children:f("telegram.authorize")})]}):H.jsxs(H.Fragment,{children:[H.jsxs(xt,{variant:"default",size:"sm",onClick:c,children:[H.jsx($f,{className:"h-3.5 w-3.5"}),f("telegram.sendTestMessage")]}),H.jsx(xt,{variant:"danger",size:"sm",onClick:a,children:f("common.delete")})]})})]})}Ti.use(XR).init({resources:r3,lng:Gf,fallbackLng:Gf,interpolation:{escapeValue:!1},returnNull:!1});const Y4=new gC({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),G4=Xx([{path:"/",element:H.jsx(A4,{}),children:[{path:"settings",element:H.jsx(V4,{})},{path:"devices",element:H.jsx(gy,{})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:H.jsx(fy,{})},{path:"devices/:deviceId",element:H.jsx(fy,{})},{path:"",element:H.jsx(gy,{})}]}]),N1=document.getElementById("root");if(!N1)throw new Error("Root element not found");NC.createRoot(N1).render(H.jsx(N.StrictMode,{children:H.jsxs(_C,{client:Y4,children:[H.jsx(wx,{router:G4}),H.jsx(N2,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + var(--tmex-safe-area-top))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + var(--tmex-safe-area-top))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})]})}));
|
|
333
|
+
//# sourceMappingURL=index-NgVYQDSW.js.map
|