tmex-cli 0.1.4 → 0.1.6

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.
Files changed (27) hide show
  1. package/dist/runtime/server.js +421 -14
  2. package/package.json +3 -2
  3. package/resources/fe-dist/assets/DevicePage-Beg8tuEN.css +32 -0
  4. package/resources/fe-dist/assets/DevicePage-DXr7cn5f.js +31 -0
  5. package/resources/fe-dist/assets/DevicePage-DXr7cn5f.js.map +1 -0
  6. package/resources/fe-dist/assets/DevicesPage-DClS6lhB.js +17 -0
  7. package/resources/fe-dist/assets/DevicesPage-DClS6lhB.js.map +1 -0
  8. package/resources/fe-dist/assets/SettingsPage-DZPiSKLS.js +17 -0
  9. package/resources/fe-dist/assets/SettingsPage-DZPiSKLS.js.map +1 -0
  10. package/resources/fe-dist/assets/index-DLLCJhRn.css +1 -0
  11. package/resources/fe-dist/assets/index-uap7lu9-.js +200 -0
  12. package/resources/fe-dist/assets/index-uap7lu9-.js.map +1 -0
  13. package/resources/fe-dist/assets/select-DOLHUgAj.js +12 -0
  14. package/resources/fe-dist/assets/select-DOLHUgAj.js.map +1 -0
  15. package/resources/fe-dist/assets/switch-DbiHVHFg.js +12 -0
  16. package/resources/fe-dist/assets/switch-DbiHVHFg.js.map +1 -0
  17. package/resources/fe-dist/assets/tmex-DcyZpuP8.png +0 -0
  18. package/resources/fe-dist/assets/useValueChanged-DoNZeDee.js +2 -0
  19. package/resources/fe-dist/assets/useValueChanged-DoNZeDee.js.map +1 -0
  20. package/resources/fe-dist/index.html +10 -3
  21. package/resources/fe-dist/logo.png +0 -0
  22. package/resources/gateway-drizzle/0000_busy_starjammers.sql +1 -2
  23. package/resources/gateway-drizzle/meta/0000_snapshot.json +0 -4
  24. package/resources/gateway-drizzle/meta/0001_snapshot.json +0 -4
  25. package/resources/fe-dist/assets/index-D7lUHQCR.css +0 -32
  26. package/resources/fe-dist/assets/index-DNlxXBdI.js +0 -333
  27. package/resources/fe-dist/assets/index-DNlxXBdI.js.map +0 -1
@@ -1,333 +0,0 @@
1
- var Iw=Object.defineProperty;var y_=i=>{throw TypeError(i)};var Fw=(i,r,s)=>r in i?Iw(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s;var Ht=(i,r,s)=>Fw(i,typeof r!="symbol"?r+"":r,s),Yd=(i,r,s)=>r.has(i)||y_("Cannot "+s);var ee=(i,r,s)=>(Yd(i,r,"read from private field"),s?s.call(i):r.get(i)),Fe=(i,r,s)=>r.has(i)?y_("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,s),Ae=(i,r,s,a)=>(Yd(i,r,"write to private field"),a?a.call(i,s):r.set(i,s),s),st=(i,r,s)=>(Yd(i,r,"access private method"),s);var $c=(i,r,s,a)=>({set _(c){Ae(i,r,c,s)},get _(){return ee(i,r,a)}});function qw(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 g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&a(g)}).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 Oy(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 b_;function $w(){if(b_)return Xo;b_=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(a,c,f){var g=null;if(f!==void 0&&(g=""+f),c.key!==void 0&&(g=""+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:g,ref:c!==void 0?c:null,props:f}}return Xo.Fragment=r,Xo.jsx=s,Xo.jsxs=s,Xo}var S_;function Kw(){return S_||(S_=1,Gd.exports=$w()),Gd.exports}var P=Kw(),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(){}},Vw={setTimeout:(i,r)=>setTimeout(i,r),clearTimeout:i=>clearTimeout(i),setInterval:(i,r)=>setInterval(i,r),clearInterval:i=>clearInterval(i)},ts,am,_y,Ww=(_y=class{constructor(){Fe(this,ts,Vw);Fe(this,am,!1)}setTimeoutProvider(i){Ae(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,am=new WeakMap,_y),Hs=new Ww;function Yw(i){setTimeout(i,0)}var Gs=typeof window>"u"||"Deno"in globalThis;function Bi(){}function Gw(i,r){return typeof i=="function"?i(r):i}function Cf(i){return typeof i=="number"&&i>=0&&i!==1/0}function Ay(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 w_(i,r){const{type:s="all",exact:a,fetchStatus:c,predicate:f,queryKey:g,stale:l}=i;if(g){if(a){if(r.queryHash!==om(g,r.options))return!1}else if(!ml(r.queryKey,g))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 C_(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 om(i,r){return((r==null?void 0:r.queryKeyHashFn)||Xs)(i)}function Xs(i){return JSON.stringify(i,(r,s)=>Ef(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 Xw=Object.prototype.hasOwnProperty;function Ly(i,r,s=0){if(i===r)return i;if(s>500)return r;const a=E_(i)&&E_(r);if(!a&&!(Ef(i)&&Ef(r)))return r;const f=(a?i:Object.keys(i)).length,g=a?r:Object.keys(r),l=g.length,u=a?new Array(l):{};let h=0;for(let b=0;b<l;b++){const d=a?b:g[b],w=i[d],C=r[d];if(w===C){u[d]=w,(a?b<f:Xw.call(i,d))&&h++;continue}if(w===null||C===null||typeof w!="object"||typeof C!="object"){u[d]=C;continue}const R=Ly(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 E_(i){return Array.isArray(i)&&i.length===Object.keys(i).length}function Ef(i){if(!x_(i))return!1;const r=i.constructor;if(r===void 0)return!0;const s=r.prototype;return!(!x_(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(i)!==Object.prototype)}function x_(i){return Object.prototype.toString.call(i)==="[object Object]"}function Qw(i){return new Promise(r=>{Hs.setTimeout(r,i)})}function xf(i,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(i,r):s.structuralSharing!==!1?Ly(i,r):r}function Zw(i,r,s=0){const a=[...i,r];return s&&a.length>s?a.slice(1):a}function Jw(i,r,s=0){const a=[r,...i];return s&&a.length>s?a.slice(0,-1):a}var lm=Symbol();function My(i,r){return!i.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!i.queryFn||i.queryFn===lm?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function cm(i,r){return typeof i=="function"?i(...r):!!i}function eC(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 Us,is,Fa,yy,tC=(yy=class extends ro{constructor(){super();Fe(this,Us);Fe(this,is);Fe(this,Fa);Ae(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),Ae(this,is,void 0))}setEventListener(r){var s;Ae(this,Fa,r),(s=ee(this,is))==null||s.call(this),Ae(this,is,r(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(r){ee(this,Us)!==r&&(Ae(this,Us,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(s=>{s(r)})}isFocused(){var r;return typeof ee(this,Us)=="boolean"?ee(this,Us):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},Us=new WeakMap,is=new WeakMap,Fa=new WeakMap,yy),um=new tC;function Rf(){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 iC=Yw;function rC(){let i=[],r=0,s=l=>{l()},a=l=>{l()},c=iC;const f=l=>{r?i.push(l):c(()=>{s(l)})},g=()=>{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||g()}return u},batchCalls:l=>(...u)=>{f(()=>{l(...u)})},schedule:f,setNotifyFunction:l=>{s=l},setBatchNotifyFunction:l=>{a=l},setScheduler:l=>{c=l}}}var hi=rC(),qa,rs,$a,by,nC=(by=class extends ro{constructor(){super();Fe(this,qa,!0);Fe(this,rs);Fe(this,$a);Ae(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),Ae(this,rs,void 0))}setEventListener(r){var s;Ae(this,$a,r),(s=ee(this,rs))==null||s.call(this),Ae(this,rs,r(this.setOnline.bind(this)))}setOnline(r){ee(this,qa)!==r&&(Ae(this,qa,r),this.listeners.forEach(a=>{a(r)}))}isOnline(){return ee(this,qa)}},qa=new WeakMap,rs=new WeakMap,$a=new WeakMap,by),du=new nC;function sC(i){return Math.min(1e3*2**i,3e4)}function ky(i){return(i??"online")==="online"?du.isOnline():!0}var Tf=class extends Error{constructor(i){super("CancelledError"),this.revert=i==null?void 0:i.revert,this.silent=i==null?void 0:i.silent}};function By(i){let r=!1,s=0,a;const c=Rf(),f=()=>c.status!=="pending",g=x=>{var m;if(!f()){const v=new Tf(x);w(v),(m=i.onCancel)==null||m.call(i,v)}},l=()=>{r=!0},u=()=>{r=!1},h=()=>um.isFocused()&&(i.networkMode==="always"||du.isOnline())&&i.canRun(),b=()=>ky(i.networkMode)&&i.canRun(),d=x=>{f()||(a==null||a(),c.resolve(x))},w=x=>{f()||(a==null||a(),c.reject(x))},C=()=>new Promise(x=>{var m;a=v=>{(f()||h())&&x(v)},(m=i.onPause)==null||m.call(i)}).then(()=>{var x;a=void 0,f()||(x=i.onContinue)==null||x.call(i)}),R=()=>{if(f())return;let x;const m=s===0?i.initialPromise:void 0;try{x=m??i.fn()}catch(v){x=Promise.reject(v)}Promise.resolve(x).then(d).catch(v=>{var A;if(f())return;const _=i.retry??(Gs?0:3),y=i.retryDelay??sC,E=typeof y=="function"?y(s,v):y,D=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,v);if(r||!D){w(v);return}s++,(A=i.onFail)==null||A.call(i,s,v),Qw(E).then(()=>h()?void 0:C()).then(()=>{r?w(v):R()})})};return{promise:c,status:()=>c.status,cancel:g,continue:()=>(a==null||a(),c),cancelRetry:l,continueRetry:u,canStart:b,start:()=>(b()?R():C().then(R),c)}}var Is,Sy,Ny=(Sy=class{constructor(){Fe(this,Is)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cf(this.gcTime)&&Ae(this,Is,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Gs?1/0:300*1e3))}clearGcTimeout(){ee(this,Is)&&(Hs.clearTimeout(ee(this,Is)),Ae(this,Is,void 0))}},Is=new WeakMap,Sy),Fs,Ka,pr,qs,gi,bl,$s,Lr,vn,wy,aC=(wy=class extends Ny{constructor(r){super();Fe(this,Lr);Fe(this,Fs);Fe(this,Ka);Fe(this,pr);Fe(this,qs);Fe(this,gi);Fe(this,bl);Fe(this,$s);Ae(this,$s,!1),Ae(this,bl,r.defaultOptions),this.setOptions(r.options),this.observers=[],Ae(this,qs,r.client),Ae(this,pr,ee(this,qs).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,Ae(this,Fs,T_(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,gi))==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=T_(this.options);s.data!==void 0&&(this.setState(R_(s.data,s.dataUpdatedAt)),Ae(this,Fs,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ee(this,pr).remove(this)}setData(r,s){const a=xf(this.state.data,r,this.options);return st(this,Lr,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){st(this,Lr,vn).call(this,{type:"setState",state:r,setStateOptions:s})}cancel(r){var a,c;const s=(a=ee(this,gi))==null?void 0:a.promise;return(c=ee(this,gi))==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===lm||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:!Ay(this.state.dataUpdatedAt,r)}onFocus(){var s;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(s=ee(this,gi))==null||s.continue()}onOnline(){var s;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(s=ee(this,gi))==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,gi)&&(ee(this,$s)?ee(this,gi).cancel({revert:!0}):ee(this,gi).cancelRetry()),this.scheduleGc()),ee(this,pr).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||st(this,Lr,vn).call(this,{type:"invalidate"})}async fetch(r,s){var u,h,b,d,w,C,R,x,m,v,_,y;if(this.state.fetchStatus!=="idle"&&((u=ee(this,gi))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(ee(this,gi))return ee(this,gi).continueRetry(),ee(this,gi).promise}if(r&&this.setOptions(r),!this.options.queryFn){const E=this.observers.find(D=>D.options.queryFn);E&&this.setOptions(E.options)}const a=new AbortController,c=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Ae(this,$s,!0),a.signal)})},f=()=>{const E=My(this.options,s),A=(()=>{const O={client:ee(this,qs),queryKey:this.queryKey,meta:this.meta};return c(O),O})();return Ae(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),Ae(this,Ka,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=l.fetchOptions)==null?void 0:b.meta))&&st(this,Lr,vn).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Ae(this,gi,By({initialPromise:s==null?void 0:s.initialPromise,fn:l.fetchFn,onCancel:E=>{E instanceof Tf&&E.revert&&this.setState({...ee(this,Ka),fetchStatus:"idle"}),a.abort()},onFail:(E,D)=>{st(this,Lr,vn).call(this,{type:"failed",failureCount:E,error:D})},onPause:()=>{st(this,Lr,vn).call(this,{type:"pause"})},onContinue:()=>{st(this,Lr,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,gi).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),(x=(R=ee(this,pr).config).onSettled)==null||x.call(R,E,this.state.error,this),E}catch(E){if(E instanceof Tf){if(E.silent)return ee(this,gi).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw st(this,Lr,vn).call(this,{type:"error",error:E}),(v=(m=ee(this,pr).config).onError)==null||v.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,gi=new WeakMap,bl=new WeakMap,$s=new WeakMap,Lr=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,...jy(a.data,this.options),fetchMeta:r.meta??null};case"success":const c={...a,...R_(r.data,r.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(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),hi.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),ee(this,pr).notify({query:this,type:"updated",action:r})})},wy);function jy(i,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ky(r.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function R_(i,r){return{data:i,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function T_(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 Ki,vt,Sl,Mi,Ks,Va,bn,ns,wl,Wa,Ya,Vs,Ws,ss,Ga,Tt,rl,Df,Of,Af,Lf,Mf,kf,Bf,Hy,Cy,oC=(Cy=class extends ro{constructor(r,s){super();Fe(this,Tt);Fe(this,Ki);Fe(this,vt);Fe(this,Sl);Fe(this,Mi);Fe(this,Ks);Fe(this,Va);Fe(this,bn);Fe(this,ns);Fe(this,wl);Fe(this,Wa);Fe(this,Ya);Fe(this,Vs);Fe(this,Ws);Fe(this,ss);Fe(this,Ga,new Set);this.options=s,Ae(this,Ki,r),Ae(this,ns,null),Ae(this,bn,Rf()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,vt).addObserver(this),D_(ee(this,vt),this.options)?st(this,Tt,rl).call(this):this.updateResult(),st(this,Tt,Lf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nf(ee(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nf(ee(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,st(this,Tt,Mf).call(this),st(this,Tt,kf).call(this),ee(this,vt).removeObserver(this)}setOptions(r){const s=this.options,a=ee(this,vt);if(this.options=ee(this,Ki).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,ee(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");st(this,Tt,Bf).call(this),ee(this,vt).setOptions(this.options),s._defaulted&&!hu(this.options,s)&&ee(this,Ki).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,vt),observer:this});const c=this.hasListeners();c&&O_(ee(this,vt),a,this.options,s)&&st(this,Tt,rl).call(this),this.updateResult(),c&&(ee(this,vt)!==a||vr(this.options.enabled,ee(this,vt))!==vr(s.enabled,ee(this,vt))||ds(this.options.staleTime,ee(this,vt))!==ds(s.staleTime,ee(this,vt)))&&st(this,Tt,Df).call(this);const f=st(this,Tt,Of).call(this);c&&(ee(this,vt)!==a||vr(this.options.enabled,ee(this,vt))!==vr(s.enabled,ee(this,vt))||f!==ee(this,ss))&&st(this,Tt,Af).call(this,f)}getOptimisticResult(r){const s=ee(this,Ki).getQueryCache().build(ee(this,Ki),r),a=this.createResult(s,r);return cC(this,a)&&(Ae(this,Mi,a),Ae(this,Va,this.options),Ae(this,Ks,ee(this,vt).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,vt)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const s=ee(this,Ki).defaultQueryOptions(r),a=ee(this,Ki).getQueryCache().build(ee(this,Ki),s);return a.fetch().then(()=>this.createResult(a,s))}fetch(r){return st(this,Tt,rl).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Mi)))}createResult(r,s){var L;const a=ee(this,vt),c=this.options,f=ee(this,Mi),g=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 U=this.hasListeners(),V=!U&&D_(r,s),j=U&&O_(r,a,s,c);(V||j)&&(d={...d,...jy(b.data,r.options)}),s._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:R,errorUpdatedAt:x,status:m}=d;C=d.data;let v=!1;if(s.placeholderData!==void 0&&C===void 0&&m==="pending"){let U;f!=null&&f.isPlaceholderData&&s.placeholderData===(l==null?void 0:l.placeholderData)?(U=f.data,v=!0):U=typeof s.placeholderData=="function"?s.placeholderData((L=ee(this,Ya))==null?void 0:L.state.data,ee(this,Ya)):s.placeholderData,U!==void 0&&(m="success",C=xf(f==null?void 0:f.data,U,s),w=!0)}if(s.select&&C!==void 0&&!v)if(f&&C===(g==null?void 0:g.data)&&s.select===ee(this,wl))C=ee(this,Wa);else try{Ae(this,wl,s.select),C=s.select(C),C=xf(f==null?void 0:f.data,C,s),Ae(this,Wa,C),Ae(this,ns,null)}catch(U){Ae(this,ns,U)}ee(this,ns)&&(R=ee(this,ns),C=ee(this,Wa),x=Date.now(),m="error");const _=d.fetchStatus==="fetching",y=m==="pending",E=m==="error",D=y&&_,A=C!==void 0,T={status:m,fetchStatus:d.fetchStatus,isPending:y,isSuccess:m==="success",isError:E,isInitialLoading:D,isLoading:D,data:C,dataUpdatedAt:d.dataUpdatedAt,error:R,errorUpdatedAt:x,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:hm(r,s),refetch:this.refetch,promise:ee(this,bn),isEnabled:vr(s.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const U=T.data!==void 0,V=T.status==="error"&&!U,j=X=>{V?X.reject(T.error):U&&X.resolve(T.data)},$=()=>{const X=Ae(this,bn,T.promise=Rf());j(X)},Z=ee(this,bn);switch(Z.status){case"pending":r.queryHash===a.queryHash&&j(Z);break;case"fulfilled":(V||T.data!==Z.value)&&$();break;case"rejected":(!V||T.error!==Z.reason)&&$();break}}return T}updateResult(){const r=ee(this,Mi),s=this.createResult(ee(this,vt),this.options);if(Ae(this,Ks,ee(this,vt).state),Ae(this,Va,this.options),ee(this,Ks).data!==void 0&&Ae(this,Ya,ee(this,vt)),hu(s,r))return;Ae(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 g=new Set(f??ee(this,Ga));return this.options.throwOnError&&g.add("error"),Object.keys(ee(this,Mi)).some(l=>{const u=l;return ee(this,Mi)[u]!==r[u]&&g.has(u)})};st(this,Tt,Hy).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&st(this,Tt,Lf).call(this)}},Ki=new WeakMap,vt=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,Tt=new WeakSet,rl=function(r){st(this,Tt,Bf).call(this);let s=ee(this,vt).fetch(this.options,r);return r!=null&&r.throwOnError||(s=s.catch(Bi)),s},Df=function(){st(this,Tt,Mf).call(this);const r=ds(this.options.staleTime,ee(this,vt));if(Gs||ee(this,Mi).isStale||!Cf(r))return;const a=Ay(ee(this,Mi).dataUpdatedAt,r)+1;Ae(this,Vs,Hs.setTimeout(()=>{ee(this,Mi).isStale||this.updateResult()},a))},Of=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,vt)):this.options.refetchInterval)??!1},Af=function(r){st(this,Tt,kf).call(this),Ae(this,ss,r),!(Gs||vr(this.options.enabled,ee(this,vt))===!1||!Cf(ee(this,ss))||ee(this,ss)===0)&&Ae(this,Ws,Hs.setInterval(()=>{(this.options.refetchIntervalInBackground||um.isFocused())&&st(this,Tt,rl).call(this)},ee(this,ss)))},Lf=function(){st(this,Tt,Df).call(this),st(this,Tt,Af).call(this,st(this,Tt,Of).call(this))},Mf=function(){ee(this,Vs)&&(Hs.clearTimeout(ee(this,Vs)),Ae(this,Vs,void 0))},kf=function(){ee(this,Ws)&&(Hs.clearInterval(ee(this,Ws)),Ae(this,Ws,void 0))},Bf=function(){const r=ee(this,Ki).getQueryCache().build(ee(this,Ki),this.options);if(r===ee(this,vt))return;const s=ee(this,vt);Ae(this,vt,r),Ae(this,Sl,r.state),this.hasListeners()&&(s==null||s.removeObserver(this),r.addObserver(this))},Hy=function(r){hi.batch(()=>{r.listeners&&this.listeners.forEach(s=>{s(ee(this,Mi))}),ee(this,Ki).getQueryCache().notify({query:ee(this,vt),type:"observerResultsUpdated"})})},Cy);function lC(i,r){return vr(r.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&r.retryOnMount===!1)}function D_(i,r){return lC(i,r)||i.state.data!==void 0&&Nf(i,r,r.refetchOnMount)}function Nf(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&&hm(i,r)}return!1}function O_(i,r,s,a){return(i!==r||vr(a.enabled,i)===!1)&&(!s.suspense||i.state.status!=="error")&&hm(i,s)}function hm(i,r){return vr(r.enabled,i)!==!1&&i.isStaleByTime(ds(r.staleTime,i))}function cC(i,r){return!hu(i.getCurrentResult(),r)}function A_(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)||[],g=((R=r.state.data)==null?void 0:R.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const h=async()=>{let x=!1;const m=y=>{eC(y,()=>r.signal,()=>x=!0)},v=My(r.options,r.fetchOptions),_=async(y,E,D)=>{if(x)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:D?"backward":"forward",meta:r.options.meta};return m(V),V})(),T=await v(O),{maxPages:L}=r.options,U=D?Jw:Zw;return{pages:U(y.pages,T,L),pageParams:U(y.pageParams,E,L)}};if(c&&f.length){const y=c==="backward",E=y?uC:L_,D={pages:f,pageParams:g},A=E(a,D);l=await _(D,A,y)}else{const y=i??f.length;do{const E=u===0?g[0]??a.initialPageParam:L_(a,l);if(u>0&&E==null)break;l=await _(l,E),u++}while(u<y)}return l};r.options.persister?r.fetchFn=()=>{var x,m;return(m=(x=r.options).persister)==null?void 0:m.call(x,h,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s)}:r.fetchFn=h}}}function L_(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 uC(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,Ey,hC=(Ey=class extends Ny{constructor(r){super();Fe(this,qr);Fe(this,Cl);Fe(this,Fr);Fe(this,Oi);Fe(this,Ys);Ae(this,Cl,r.client),this.mutationId=r.mutationId,Ae(this,Oi,r.mutationCache),Ae(this,Fr,[]),this.state=r.state||Py(),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){Ae(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 g,l,u,h,b,d,w,C,R,x,m,v,_,y,E,D,A,O;const s=()=>{st(this,qr,Qn).call(this,{type:"continue"})},a={client:ee(this,Cl),meta:this.options.meta,mutationKey:this.options.mutationKey};Ae(this,Ys,By({fn:()=>this.options.mutationFn?this.options.mutationFn(r,a):Promise.reject(new Error("No mutationFn found")),onFail:(T,L)=>{st(this,qr,Qn).call(this,{type:"failed",failureCount:T,error:L})},onPause:()=>{st(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{st(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=(g=this.options).onMutate)==null?void 0:l.call(g,r,a));L!==this.state.context&&st(this,qr,Qn).call(this,{type:"pending",context:L,variables:r,isPaused:f})}const T=await ee(this,Ys).start();return await((h=(u=ee(this,Oi).config).onSuccess)==null?void 0:h.call(u,T,r,this.state.context,this,a)),await((d=(b=this.options).onSuccess)==null?void 0:d.call(b,T,r,this.state.context,a)),await((C=(w=ee(this,Oi).config).onSettled)==null?void 0:C.call(w,T,null,this.state.variables,this.state.context,this,a)),await((x=(R=this.options).onSettled)==null?void 0:x.call(R,T,null,r,this.state.context,a)),st(this,qr,Qn).call(this,{type:"success",data:T}),T}catch(T){try{await((v=(m=ee(this,Oi).config).onError)==null?void 0:v.call(m,T,r,this.state.context,this,a))}catch(L){Promise.reject(L)}try{await((y=(_=this.options).onError)==null?void 0:y.call(_,T,r,this.state.context,a))}catch(L){Promise.reject(L)}try{await((D=(E=ee(this,Oi).config).onSettled)==null?void 0:D.call(E,void 0,T,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,T,r,this.state.context,a))}catch(L){Promise.reject(L)}throw st(this,qr,Qn).call(this,{type:"error",error:T}),T}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),hi.batch(()=>{ee(this,Fr).forEach(a=>{a.onMutationUpdate(r)}),ee(this,Oi).notify({mutation:this,type:"updated",action:r})})},Ey);function Py(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sn,Mr,El,xy,dC=(xy=class extends ro{constructor(r={}){super();Fe(this,Sn);Fe(this,Mr);Fe(this,El);this.config=r,Ae(this,Sn,new Set),Ae(this,Mr,new Map),Ae(this,El,0)}build(r,s,a){const c=new hC({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,Mr).get(s);a?a.push(r):ee(this,Mr).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,Mr).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,Mr).delete(s)}}this.notify({type:"removed",mutation:r})}canRun(r){const s=Kc(r);if(typeof s=="string"){const a=ee(this,Mr).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,Mr).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(){hi.batch(()=>{ee(this,Sn).forEach(r=>{this.notify({type:"removed",mutation:r})}),ee(this,Sn).clear(),ee(this,Mr).clear()})}getAll(){return Array.from(ee(this,Sn))}find(r){const s={exact:!0,...r};return this.getAll().find(a=>C_(s,a))}findAll(r={}){return this.getAll().filter(s=>C_(r,s))}notify(r){hi.batch(()=>{this.listeners.forEach(s=>{s(r)})})}resumePausedMutations(){const r=this.getAll().filter(s=>s.state.isPaused);return hi.batch(()=>Promise.all(r.map(s=>s.continue().catch(Bi))))}},Sn=new WeakMap,Mr=new WeakMap,El=new WeakMap,xy);function Kc(i){var r;return(r=i.options.scope)==null?void 0:r.id}var wn,as,Vi,Cn,Rn,ru,jf,Ry,fC=(Ry=class extends ro{constructor(s,a){super();Fe(this,Rn);Fe(this,wn);Fe(this,as);Fe(this,Vi);Fe(this,Cn);Ae(this,wn,s),this.setOptions(a),this.bindMethods(),st(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,Vi),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Xs(a.mutationKey)!==Xs(this.options.mutationKey)?this.reset():((c=ee(this,Vi))==null?void 0:c.state.status)==="pending"&&ee(this,Vi).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=ee(this,Vi))==null||s.removeObserver(this)}onMutationUpdate(s){st(this,Rn,ru).call(this),st(this,Rn,jf).call(this,s)}getCurrentResult(){return ee(this,as)}reset(){var s;(s=ee(this,Vi))==null||s.removeObserver(this),Ae(this,Vi,void 0),st(this,Rn,ru).call(this),st(this,Rn,jf).call(this)}mutate(s,a){var c;return Ae(this,Cn,a),(c=ee(this,Vi))==null||c.removeObserver(this),Ae(this,Vi,ee(this,wn).getMutationCache().build(ee(this,wn),this.options)),ee(this,Vi).addObserver(this),ee(this,Vi).execute(s)}},wn=new WeakMap,as=new WeakMap,Vi=new WeakMap,Cn=new WeakMap,Rn=new WeakSet,ru=function(){var a;const s=((a=ee(this,Vi))==null?void 0:a.state)??Py();Ae(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})},jf=function(s){hi.batch(()=>{var a,c,f,g,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{(g=(f=ee(this,Cn)).onSettled)==null||g.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))})})},Ry),$r,Ty,mC=(Ty=class extends ro{constructor(r={}){super();Fe(this,$r);this.config=r,Ae(this,$r,new Map)}build(r,s,a){const c=s.queryKey,f=s.queryHash??om(c,s);let g=this.get(f);return g||(g=new aC({client:r,queryKey:c,queryHash:f,options:r.defaultQueryOptions(s),state:a,defaultOptions:r.getQueryDefaults(c)}),this.add(g)),g}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(){hi.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=>w_(s,a))}findAll(r={}){const s=this.getAll();return Object.keys(r).length>0?s.filter(a=>w_(r,a)):s}notify(r){hi.batch(()=>{this.listeners.forEach(s=>{s(r)})})}onFocus(){hi.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){hi.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},$r=new WeakMap,Ty),Jt,os,ls,Xa,Qa,cs,Za,Ja,Dy,pC=(Dy=class{constructor(i={}){Fe(this,Jt);Fe(this,os);Fe(this,ls);Fe(this,Xa);Fe(this,Qa);Fe(this,cs);Fe(this,Za);Fe(this,Ja);Ae(this,Jt,i.queryCache||new mC),Ae(this,os,i.mutationCache||new dC),Ae(this,ls,i.defaultOptions||{}),Ae(this,Xa,new Map),Ae(this,Qa,new Map),Ae(this,cs,0)}mount(){$c(this,cs)._++,ee(this,cs)===1&&(Ae(this,Za,um.subscribe(async i=>{i&&(await this.resumePausedMutations(),ee(this,Jt).onFocus())})),Ae(this,Ja,du.subscribe(async i=>{i&&(await this.resumePausedMutations(),ee(this,Jt).onOnline())})))}unmount(){var i,r;$c(this,cs)._--,ee(this,cs)===0&&((i=ee(this,Za))==null||i.call(this),Ae(this,Za,void 0),(r=ee(this,Ja))==null||r.call(this),Ae(this,Ja,void 0))}isFetching(i){return ee(this,Jt).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,Jt).get(r.queryHash))==null?void 0:s.state.data}ensureQueryData(i){const r=this.defaultQueryOptions(i),s=ee(this,Jt).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,Jt).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,Jt).get(a.queryHash),f=c==null?void 0:c.state.data,g=Gw(r,f);if(g!==void 0)return ee(this,Jt).build(this,a).setData(g,{...s,manual:!0})}setQueriesData(i,r,s){return hi.batch(()=>ee(this,Jt).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,Jt).get(r.queryHash))==null?void 0:s.state}removeQueries(i){const r=ee(this,Jt);hi.batch(()=>{r.findAll(i).forEach(s=>{r.remove(s)})})}resetQueries(i,r){const s=ee(this,Jt);return hi.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...i},r)))}cancelQueries(i,r={}){const s={revert:!0,...r},a=hi.batch(()=>ee(this,Jt).findAll(i).map(c=>c.cancel(s)));return Promise.all(a).then(Bi).catch(Bi)}invalidateQueries(i,r={}){return hi.batch(()=>(ee(this,Jt).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=hi.batch(()=>ee(this,Jt).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,Jt).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=A_(i.pages),this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(Bi).catch(Bi)}ensureInfiniteQueryData(i){return i.behavior=A_(i.pages),this.ensureQueryData(i)}resumePausedMutations(){return du.isOnline()?ee(this,os).resumePausedMutations():Promise.resolve()}getQueryCache(){return ee(this,Jt)}getMutationCache(){return ee(this,os)}getDefaultOptions(){return ee(this,ls)}setDefaultOptions(i){Ae(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=om(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===lm&&(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,Jt).clear(),ee(this,os).clear()}},Jt=new WeakMap,os=new WeakMap,ls=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,cs=new WeakMap,Za=new WeakMap,Ja=new WeakMap,Dy),Xd={exports:{}},Qe={};/**
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 M_;function gC(){if(M_)return Qe;M_=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"),g=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(){}},x=Object.assign,m={};function v(B,q,Q){this.props=B,this.context=q,this.refs=m,this.updater=Q||R}v.prototype.isReactComponent={},v.prototype.setState=function(B,q){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,q,"setState")},v.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function _(){}_.prototype=v.prototype;function y(B,q,Q){this.props=B,this.context=q,this.refs=m,this.updater=Q||R}var E=y.prototype=new _;E.constructor=y,x(E,v.prototype),E.isPureReactComponent=!0;var D=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function L(B,q,Q){var te=Q.ref;return{$$typeof:i,type:B,key:q,ref:te!==void 0?te:null,props:Q}}function U(B,q){return L(B.type,q,B.props)}function V(B){return typeof B=="object"&&B!==null&&B.$$typeof===i}function j(B){var q={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(Q){return q[Q]})}var $=/\/+/g;function Z(B,q){return typeof B=="object"&&B!==null&&B.key!=null?j(""+B.key):q.toString(36)}function X(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(q){B.status==="pending"&&(B.status="fulfilled",B.value=q)},function(q){B.status==="pending"&&(B.status="rejected",B.reason=q)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function F(B,q,Q,te,se){var be=typeof B;(be==="undefined"||be==="boolean")&&(B=null);var H=!1;if(B===null)H=!0;else switch(be){case"bigint":case"string":case"number":H=!0;break;case"object":switch(B.$$typeof){case i:case r:H=!0;break;case b:return H=B._init,F(H(B._payload),q,Q,te,se)}}if(H)return se=se(B),H=te===""?"."+Z(B,0):te,D(se)?(Q="",H!=null&&(Q=H.replace($,"$&/")+"/"),F(se,q,Q,"",function(fe){return fe})):se!=null&&(V(se)&&(se=U(se,Q+(se.key==null||B&&B.key===se.key?"":(""+se.key).replace($,"$&/")+"/")+H)),q.push(se)),1;H=0;var G=te===""?".":te+":";if(D(B))for(var ae=0;ae<B.length;ae++)te=B[ae],be=G+Z(te,ae),H+=F(te,q,Q,be,se);else if(ae=C(B),typeof ae=="function")for(B=ae.call(B),ae=0;!(te=B.next()).done;)te=te.value,be=G+Z(te,ae++),H+=F(te,q,Q,be,se);else if(be==="object"){if(typeof B.then=="function")return F(X(B),q,Q,te,se);throw q=String(B),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return H}function Y(B,q,Q){if(B==null)return B;var te=[],se=0;return F(B,te,"","",function(be){return q.call(Q,be,se++)}),te}function k(B){if(B._status===-1){var q=B._result;q=q(),q.then(function(Q){(B._status===0||B._status===-1)&&(B._status=1,B._result=Q)},function(Q){(B._status===0||B._status===-1)&&(B._status=2,B._result=Q)}),B._status===-1&&(B._status=0,B._result=q)}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 q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},K={map:Y,forEach:function(B,q,Q){Y(B,function(){q.apply(this,arguments)},Q)},count:function(B){var q=0;return Y(B,function(){q++}),q},toArray:function(B){return Y(B,function(q){return q})||[]},only:function(B){if(!V(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Qe.Activity=d,Qe.Children=K,Qe.Component=v,Qe.Fragment=s,Qe.Profiler=c,Qe.PureComponent=y,Qe.StrictMode=a,Qe.Suspense=u,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},Qe.cache=function(B){return function(){return B.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(B,q,Q){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var te=x({},B.props),se=B.key;if(q!=null)for(be in q.key!==void 0&&(se=""+q.key),q)!T.call(q,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&q.ref===void 0||(te[be]=q[be]);var be=arguments.length-2;if(be===1)te.children=Q;else if(1<be){for(var H=Array(be),G=0;G<be;G++)H[G]=arguments[G+2];te.children=H}return L(B.type,se,te)},Qe.createContext=function(B){return B={$$typeof:g,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:f,_context:B},B},Qe.createElement=function(B,q,Q){var te,se={},be=null;if(q!=null)for(te in q.key!==void 0&&(be=""+q.key),q)T.call(q,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(se[te]=q[te]);var H=arguments.length-2;if(H===1)se.children=Q;else if(1<H){for(var G=Array(H),ae=0;ae<H;ae++)G[ae]=arguments[ae+2];se.children=G}if(B&&B.defaultProps)for(te in H=B.defaultProps,H)se[te]===void 0&&(se[te]=H[te]);return L(B,be,se)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(B){return{$$typeof:l,render:B}},Qe.isValidElement=V,Qe.lazy=function(B){return{$$typeof:b,_payload:{_status:-1,_result:B},_init:k}},Qe.memo=function(B,q){return{$$typeof:h,type:B,compare:q===void 0?null:q}},Qe.startTransition=function(B){var q=O.T,Q={};O.T=Q;try{var te=B(),se=O.S;se!==null&&se(Q,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(A,z)}catch(be){z(be)}finally{q!==null&&Q.types!==null&&(q.types=Q.types),O.T=q}},Qe.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Qe.use=function(B){return O.H.use(B)},Qe.useActionState=function(B,q,Q){return O.H.useActionState(B,q,Q)},Qe.useCallback=function(B,q){return O.H.useCallback(B,q)},Qe.useContext=function(B){return O.H.useContext(B)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(B,q){return O.H.useDeferredValue(B,q)},Qe.useEffect=function(B,q){return O.H.useEffect(B,q)},Qe.useEffectEvent=function(B){return O.H.useEffectEvent(B)},Qe.useId=function(){return O.H.useId()},Qe.useImperativeHandle=function(B,q,Q){return O.H.useImperativeHandle(B,q,Q)},Qe.useInsertionEffect=function(B,q){return O.H.useInsertionEffect(B,q)},Qe.useLayoutEffect=function(B,q){return O.H.useLayoutEffect(B,q)},Qe.useMemo=function(B,q){return O.H.useMemo(B,q)},Qe.useOptimistic=function(B,q){return O.H.useOptimistic(B,q)},Qe.useReducer=function(B,q,Q){return O.H.useReducer(B,q,Q)},Qe.useRef=function(B){return O.H.useRef(B)},Qe.useState=function(B){return O.H.useState(B)},Qe.useSyncExternalStore=function(B,q,Q){return O.H.useSyncExternalStore(B,q,Q)},Qe.useTransition=function(){return O.H.useTransition()},Qe.version="19.2.4",Qe}var k_;function xl(){return k_||(k_=1,Xd.exports=gC()),Xd.exports}var N=xl();const xe=Oy(N),dm=qw({__proto__:null,default:xe},[N]);var zy=N.createContext(void 0),ea=i=>{const r=N.useContext(zy);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},vC=({client:i,children:r})=>(N.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),P.jsx(zy.Provider,{value:i,children:r})),Uy=N.createContext(!1),_C=()=>N.useContext(Uy);Uy.Provider;function yC(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var bC=N.createContext(yC()),SC=()=>N.useContext(bC),wC=(i,r,s)=>{const a=s!=null&&s.state.error&&typeof i.throwOnError=="function"?cm(i.throwOnError,[s.state.error,s]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||a)&&(r.isReset()||(i.retryOnMount=!1))},CC=i=>{N.useEffect(()=>{i.clearReset()},[i])},EC=({result:i,errorResetBoundary:r,throwOnError:s,query:a,suspense:c})=>i.isError&&!r.isReset()&&!i.isFetching&&a&&(c&&i.data===void 0||cm(s,[i.error,a])),xC=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))}},RC=(i,r)=>i.isLoading&&i.isFetching&&!r,TC=(i,r)=>(i==null?void 0:i.suspense)&&r.isPending,B_=(i,r,s)=>r.fetchOptimistic(i).catch(()=>{s.clearReset()});function DC(i,r,s){var w,C,R,x;const a=_C(),c=SC(),f=ea(),g=f.defaultQueryOptions(i);(C=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||C.call(w,g);const l=f.getQueryCache().get(g.queryHash);g._optimisticResults=a?"isRestoring":"optimistic",xC(g),wC(g,c,l),CC(c);const u=!f.getQueryCache().get(g.queryHash),[h]=N.useState(()=>new r(f,g)),b=h.getOptimisticResult(g),d=!a&&i.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(m=>{const v=d?h.subscribe(hi.batchCalls(m)):Bi;return h.updateResult(),v},[h,d]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(g)},[g,h]),TC(g,b))throw B_(g,h,c);if(EC({result:b,errorResetBoundary:c,throwOnError:g.throwOnError,query:l,suspense:g.suspense}))throw b.error;if((x=(R=f.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||x.call(R,g,b),g.experimental_prefetchInRender&&!Gs&&RC(b,a)){const m=u?B_(g,h,c):l==null?void 0:l.promise;m==null||m.catch(Bi).finally(()=>{h.updateResult()})}return g.notifyOnChangeProps?b:h.trackResult(b)}function Qs(i,r){return DC(i,oC)}function _r(i,r){const s=ea(),[a]=N.useState(()=>new fC(s,i));N.useEffect(()=>{a.setOptions(i)},[a,i]);const c=N.useSyncExternalStore(N.useCallback(g=>a.subscribe(hi.batchCalls(g)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),f=N.useCallback((g,l)=>{a.mutate(g,l).catch(Bi)},[a]);if(c.error&&cm(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 N_;function OC(){return N_||(N_=1,(function(i){function r(F,Y){var k=F.length;F.push(Y);e:for(;0<k;){var z=k-1>>>1,K=F[z];if(0<c(K,Y))F[z]=Y,F[k]=K,k=z;else break e}}function s(F){return F.length===0?null:F[0]}function a(F){if(F.length===0)return null;var Y=F[0],k=F.pop();if(k!==Y){F[0]=k;e:for(var z=0,K=F.length,B=K>>>1;z<B;){var q=2*(z+1)-1,Q=F[q],te=q+1,se=F[te];if(0>c(Q,k))te<K&&0>c(se,Q)?(F[z]=se,F[te]=k,z=te):(F[z]=Q,F[q]=k,z=q);else if(te<K&&0>c(se,k))F[z]=se,F[te]=k,z=te;else break e}}return Y}function c(F,Y){var k=F.sortIndex-Y.sortIndex;return k!==0?k:F.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 g=Date,l=g.now();i.unstable_now=function(){return g.now()-l}}var u=[],h=[],b=1,d=null,w=3,C=!1,R=!1,x=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(F){for(var Y=s(h);Y!==null;){if(Y.callback===null)a(h);else if(Y.startTime<=F)a(h),Y.sortIndex=Y.expirationTime,r(u,Y);else break;Y=s(h)}}function D(F){if(x=!1,E(F),!R)if(s(u)!==null)R=!0,A||(A=!0,j());else{var Y=s(h);Y!==null&&X(D,Y.startTime-F)}}var A=!1,O=-1,T=5,L=-1;function U(){return m?!0:!(i.unstable_now()-L<T)}function V(){if(m=!1,A){var F=i.unstable_now();L=F;var Y=!0;try{e:{R=!1,x&&(x=!1,_(O),O=-1),C=!0;var k=w;try{t:{for(E(F),d=s(u);d!==null&&!(d.expirationTime>F&&U());){var z=d.callback;if(typeof z=="function"){d.callback=null,w=d.priorityLevel;var K=z(d.expirationTime<=F);if(F=i.unstable_now(),typeof K=="function"){d.callback=K,E(F),Y=!0;break t}d===s(u)&&a(u),E(F)}else a(u);d=s(u)}if(d!==null)Y=!0;else{var B=s(h);B!==null&&X(D,B.startTime-F),Y=!1}}break e}finally{d=null,w=k,C=!1}Y=void 0}}finally{Y?j():A=!1}}}var j;if(typeof y=="function")j=function(){y(V)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Z=$.port2;$.port1.onmessage=V,j=function(){Z.postMessage(null)}}else j=function(){v(V,0)};function X(F,Y){O=v(function(){F(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(F){F.callback=null},i.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<F?Math.floor(1e3/F):5},i.unstable_getCurrentPriorityLevel=function(){return w},i.unstable_next=function(F){switch(w){case 1:case 2:case 3:var Y=3;break;default:Y=w}var k=w;w=Y;try{return F()}finally{w=k}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(F,Y){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var k=w;w=F;try{return Y()}finally{w=k}},i.unstable_scheduleCallback=function(F,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,F){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,F={id:b++,callback:Y,priorityLevel:F,startTime:k,expirationTime:K,sortIndex:-1},k>z?(F.sortIndex=k,r(h,F),s(u)===null&&F===s(h)&&(x?(_(O),O=-1):x=!0,X(D,k-z))):(F.sortIndex=K,r(u,F),R||C||(R=!0,A||(A=!0,j()))),F},i.unstable_shouldYield=U,i.unstable_wrapCallback=function(F){var Y=w;return function(){var k=w;w=Y;try{return F.apply(this,arguments)}finally{w=k}}}})(Jd)),Jd}var j_;function AC(){return j_||(j_=1,Zd.exports=OC()),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 H_;function LC(){if(H_)return Di;H_=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 g=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=g.T,b=a.p;try{if(g.T=null,a.p=2,u)return u()}finally{g.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 g.H.useFormState(u,h,b)},Di.useFormStatus=function(){return g.H.useHostTransitionStatus()},Di.version="19.2.4",Di}var P_;function Iy(){if(P_)return ef.exports;P_=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=LC(),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 z_;function MC(){if(z_)return Qo;z_=1;var i=AC(),r=xl(),s=Iy();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 g(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,I=p.child;I;){if(I===n){M=!0,n=p,o=S;break}if(I===o){M=!0,o=p,n=S;break}I=I.sibling}if(!M){for(I=S.child;I;){if(I===n){M=!0,n=S,o=p;break}if(I===o){M=!0,o=S,n=p;break}I=I.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"),x=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function j(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 x:return"Fragment";case v:return"Profiler";case m:return"StrictMode";case D: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 T:t=e._payload,e=e._init;try{return Z(e(t))}catch{}}return null}var X=Array.isArray,F=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 q(e){0>K||(e.current=z[K],z[K]=null,K--)}function Q(e,t){K++,z[K]=e.current,e.current=t}var te=B(null),se=B(null),be=B(null),H=B(null);function G(e,t){switch(Q(be,t),Q(se,e),Q(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fv(t),e=qv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(te),Q(te,e)}function ae(){q(te),q(se),q(be)}function fe(e){e.memoizedState!==null&&Q(H,e);var t=te.current,n=qv(t,e.type);t!==n&&(Q(se,e),Q(te,n))}function me(e){se.current===e&&(q(te),q(se)),H.current===e&&(q(H),Vo._currentValue=k)}var ue,we;function Ke(e){if(ue===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||"",we=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ue+e+we}var Pe=!1;function Ee(e,t){if(!e||Pe)return"";Pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(pe){var de=pe}Reflect.construct(e,[],ye)}else{try{ye.call()}catch(pe){de=pe}e.call(ye.prototype)}}else{try{throw Error()}catch(pe){de=pe}(ye=e())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(pe){if(pe&&de&&typeof pe.stack=="string")return[pe.stack,de.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],I=S[1];if(M&&I){var J=M.split(`
44
- `),ce=I.split(`
45
- `);for(p=o=0;o<J.length&&!J[o].includes("DetermineComponentFrameRoot");)o++;for(;p<ce.length&&!ce[p].includes("DetermineComponentFrameRoot");)p++;if(o===J.length||p===ce.length)for(o=J.length-1,p=ce.length-1;1<=o&&0<=p&&J[o]!==ce[p];)p--;for(;1<=o&&0<=p;o--,p--)if(J[o]!==ce[p]){if(o!==1||p!==1)do if(o--,p--,0>p||J[o]!==ce[p]){var ge=`
46
- `+J[o].replace(" at new "," at ");return e.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",e.displayName)),ge}while(1<=o&&0<=p);break}}}finally{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ke(n):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return Ke(e.type);case 16:return Ke("Lazy");case 13:return e.child!==t&&t!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return Ke("Activity");default:return""}}function Ie(e){try{var t="",n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var je=Object.prototype.hasOwnProperty,ot=i.unstable_scheduleCallback,Ne=i.unstable_cancelCallback,De=i.unstable_shouldYield,$e=i.unstable_requestPaint,ze=i.unstable_now,nt=i.unstable_getCurrentPriorityLevel,Ct=i.unstable_ImmediatePriority,xt=i.unstable_UserBlockingPriority,Je=i.unstable_NormalPriority,yt=i.unstable_LowPriority,_t=i.unstable_IdlePriority,Pt=i.log,et=i.unstable_setDisableYieldValue,di=null,Ye=null;function _i(e){if(typeof Pt=="function"&&et(e),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(di,e)}catch{}}var Ft=Math.clz32?Math.clz32:ri,Cr=Math.log,fi=Math.LN2;function ri(e){return e>>>=0,e===0?32:31-(Cr(e)/fi|0)|0}var Ri=256,Ni=262144,ji=4194304;function Hi(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 Ve(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 I=o&134217727;return I!==0?(o=I&~S,o!==0?p=Hi(o):(M&=I,M!==0?p=Hi(M):n||(n=I&~e,n!==0&&(p=Hi(n))))):(I=o&~S,I!==0?p=Hi(I):M!==0?p=Hi(M):n||(n=o&~e,n!==0&&(p=Hi(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 Mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kt(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 Vt(){var e=ji;return ji<<=1,(ji&62914560)===0&&(ji=4194304),e}function Ti(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function he(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Oe(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 I=e.entanglements,J=e.expirationTimes,ce=e.hiddenUpdates;for(n=M&~n;0<n;){var ge=31-Ft(n),ye=1<<ge;I[ge]=0,J[ge]=-1;var de=ce[ge];if(de!==null)for(ce[ge]=null,ge=0;ge<de.length;ge++){var pe=de[ge];pe!==null&&(pe.lane&=-536870913)}n&=~ye}o!==0&&tt(e,o,0),S!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=S&~(M&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ft(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|n&261930}function W(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-Ft(n),p=1<<o;p&t|e[o]&t&&(e[o]|=t),n&=~p}}function ie(e,t){var n=t&-t;return n=(n&42)!==0?1:oe(n),(n&(e.suspendedLanes|t))!==0?0:n}function oe(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 _e(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ce(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:d_(e.type))}function He(e,t){var n=Y.p;try{return Y.p=e,t()}finally{Y.p=n}}var Me=Math.random().toString(36).slice(2),Re="__reactFiber$"+Me,Te="__reactProps$"+Me,ke="__reactContainer$"+Me,Ge="__reactEvents$"+Me,Ue="__reactListeners$"+Me,Ze="__reactHandles$"+Me,lt="__reactResources$"+Me,Wt="__reactMarker$"+Me;function Gt(e){delete e[Re],delete e[Te],delete e[Ge],delete e[Ue],delete e[Ze]}function Xt(e){var t=e[Re];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ke]||n[Re]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Xv(e);e!==null;){if(n=e[Re])return n;e=Xv(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[Re]||e[ke]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Pi(e){var t=e[lt];return t||(t=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function qt(e){e[Wt]=!0}var Er=new Set,Gi={};function xr(e,t){nr(e,t),nr(e+"Capture",t)}function nr(e,t){for(Gi[e]=t,e=0;e<t.length;e++)Er.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 mt(e){return je.call(gs,e)?!0:je.call(ps,e)?!1:Zr.test(e)?gs[e]=!0:(ps[e]=!0,!1)}function ei(e,t,n){if(mt(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 Rr(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 yi(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 pt(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 Nm(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 N1=/[\n"\\]/g;function sr(e){return e.replace(N1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fu(e,t,n,o,p,S,M,I){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=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),t!=null?qu(e,M,pt(t)):n!=null?qu(e,M,pt(n)):o!=null&&e.removeAttribute("value"),p==null&&S!=null&&(e.defaultChecked=!!S),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?e.name=""+pt(I):e.removeAttribute("name")}function jm(e,t,n,o,p,S,M,I){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?""+pt(n):"",t=t!=null?""+pt(t):n,I||t===e.value||(e.value=t),e.defaultValue=t}o=o??p,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=I?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=""+pt(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 Hm(e,t,n){if(t!=null&&(t=""+pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+pt(n):""}function Pm(e,t,n,o){if(t==null){if(o!=null){if(n!=null)throw Error(a(92));if(X(o)){if(1<o.length)throw Error(a(93));o=o[0]}n=o}n==null&&(n=""),t=n}n=pt(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 j1=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 zm(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||j1.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&&zm(e,p,o)}else for(var S in t)t.hasOwnProperty(S)&&zm(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 H1=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"]]),P1=/^[\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 P1.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 Im(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[Te]||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[Te]||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&&Nm(o)}break e;case"textarea":Hm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ia(e,!!n.multiple,t,!1)}}}var Wu=!1;function Fm(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,Im(t),e)))for(t=0;t<e.length;t++)Im(e[t])}}function lo(e,t){var n=e.stateNode;if(n===null)return null;var o=n[Te]||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 qm(){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 $m(){return!1}function zi(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 I in e)e.hasOwnProperty(I)&&(n=e[I],this[I]=n?n(S):S[I]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Pl:$m,this.isPropagationStopped=$m,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=zi(_s),uo=d({},_s,{view:0,detail:0}),z1=zi(uo),Xu,Qu,ho,Ul=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}}),Km=zi(Ul),U1=d({},Ul,{dataTransfer:0}),I1=zi(U1),F1=d({},uo,{relatedTarget:0}),Zu=zi(F1),q1=d({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),$1=zi(q1),K1=d({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),V1=zi(K1),W1=d({},_s,{data:0}),Vm=zi(W1),Y1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G1={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"},X1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=X1[e])?!!t[e]:!1}function Ju(){return Q1}var Z1=d({},uo,{key:function(e){if(e.key){var t=Y1[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"?G1[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}}),J1=zi(Z1),eS=d({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wm=zi(eS),tS=d({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ju}),iS=zi(tS),rS=d({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),nS=zi(rS),sS=d({},Ul,{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}),aS=zi(sS),oS=d({},_s,{newState:0,oldState:0}),lS=zi(oS),cS=[9,13,27,32],eh=en&&"CompositionEvent"in window,fo=null;en&&"documentMode"in document&&(fo=document.documentMode);var uS=en&&"TextEvent"in window&&!fo,Ym=en&&(!eh||fo&&8<fo&&11>=fo),Gm=" ",Xm=!1;function Qm(e,t){switch(e){case"keyup":return cS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var aa=!1;function hS(e,t){switch(e){case"compositionend":return Zm(t);case"keypress":return t.which!==32?null:(Xm=!0,Gm);case"textInput":return e=t.data,e===Gm&&Xm?null:e;default:return null}}function dS(e,t){if(aa)return e==="compositionend"||!eh&&Qm(e,t)?(e=qm(),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 Ym&&t.locale!=="ko"?null:t.data;default:return null}}var fS={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 Jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fS[e.type]:t==="textarea"}function ep(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 mS(e){jv(e,0)}function Il(e){var t=mi(e);if(Nm(t))return e}function tp(e,t){if(e==="change")return t}var ip=!1;if(en){var th;if(en){var ih="oninput"in document;if(!ih){var rp=document.createElement("div");rp.setAttribute("oninput","return;"),ih=typeof rp.oninput=="function"}th=ih}else th=!1;ip=th&&(!document.documentMode||9<document.documentMode)}function np(){mo&&(mo.detachEvent("onpropertychange",sp),po=mo=null)}function sp(e){if(e.propertyName==="value"&&Il(po)){var t=[];ep(t,po,e,Vu(e)),Fm(mS,t)}}function pS(e,t,n){e==="focusin"?(np(),mo=t,po=n,mo.attachEvent("onpropertychange",sp)):e==="focusout"&&np()}function gS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Il(po)}function vS(e,t){if(e==="click")return Il(t)}function _S(e,t){if(e==="input"||e==="change")return Il(t)}function yS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xi=typeof Object.is=="function"?Object.is:yS;function go(e,t){if(Xi(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(!je.call(t,p)||!Xi(e[p],t[p]))return!1}return!0}function ap(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function op(e,t){var n=ap(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=ap(n)}}function lp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(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 bS=en&&"documentMode"in document&&11>=document.documentMode,oa=null,nh=null,vo=null,sh=!1;function up(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={},hp={};en&&(hp=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 hp)return ah[e]=t[n];return e}var dp=bs("animationend"),fp=bs("animationiteration"),mp=bs("animationstart"),SS=bs("transitionrun"),wS=bs("transitionstart"),CS=bs("transitioncancel"),pp=bs("transitionend"),gp=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 Tr(e,t){gp.set(e,t),xr(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&&vp(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 vp(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-Ft(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 ES(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 Qi(e,t,n,o){return new ES(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=Qi(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 _p(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=Ow(e,n,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=Qi(31,n,t,p),e.elementType=L,e.lanes=S,e;case x:return ws(n.children,p,S,t);case m:M=8,p|=24;break;case v:return e=Qi(12,n,t,p|2),e.elementType=v,e.lanes=S,e;case D:return e=Qi(13,n,t,p),e.elementType=D,e.lanes=S,e;case A:return e=Qi(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 T:M=16,o=null;break e}M=29,n=Error(a(130,e===null?"null":typeof e,"")),o=null}return t=Qi(M,n,t,p),t.elementType=e,t.type=o,t.lanes=S,t}function ws(e,t,n,o){return e=Qi(7,e,o,t),e.lanes=n,e}function hh(e,t,n){return e=Qi(6,e,null,t),e.lanes=n,e}function yp(e){var t=Qi(18,null,null,0);return t.stateNode=e,t}function dh(e,t,n){return t=Qi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bp=new WeakMap;function or(e,t){if(typeof e=="object"&&e!==null){var n=bp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ie(t)},bp.set(e,t),t)}return{value:e,source:t,stack:Ie(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 Sp(e,t,n){lr[cr++]=jr,lr[cr++]=Hr,lr[cr++]=On,On=e;var o=jr;e=Hr;var p=32-Ft(o)-1;o&=~(1<<p),n+=1;var S=32-Ft(t)+p;if(30<S){var M=p-p%5;S=(o&(1<<M)-1).toString(32),o>>=M,p-=M,jr=1<<32-Ft(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),Sp(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 wp(e,t){lr[cr++]=jr,lr[cr++]=Hr,lr[cr++]=On,jr=t.id,Hr=t.overflow,On=e}var bi=null,zt=null,gt=!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 Cp(e){var t=e.stateNode,n=e.type,o=e.memoizedProps;switch(t[Re]=e,t[Te]=o,n){case"dialog":ut("cancel",t),ut("close",t);break;case"iframe":case"object":case"embed":ut("load",t);break;case"video":case"audio":for(n=0;n<Io.length;n++)ut(Io[n],t);break;case"source":ut("error",t);break;case"img":case"image":case"link":ut("error",t),ut("load",t);break;case"details":ut("toggle",t);break;case"input":ut("invalid",t),jm(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ut("invalid",t);break;case"textarea":ut("invalid",t),Pm(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&&(ut("beforetoggle",t),ut("toggle",t)),o.onScroll!=null&&ut("scroll",t),o.onScrollEnd!=null&&ut("scrollend",t),o.onClick!=null&&(t.onclick=Jr),t=!0):t=!1,t||Ln(e,!0)}function Ep(e){for(bi=e.return;bi;)switch(bi.tag){case 5:case 31:case 13:ur=!1;return;case 27:case 3:ur=!0;return;default:bi=bi.return}}function fa(e){if(e!==bi)return!1;if(!gt)return Ep(e),gt=!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&&zt&&Ln(e),Ep(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=Gv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=Gv(e)}else t===27?(t=zt,Kn(e.type)?(e=Pd,Pd=null,zt=e):zt=t):zt=bi?dr(e.stateNode.nextSibling):null;return!0}function Cs(){zt=bi=null,gt=!1}function gh(){var e=An;return e!==null&&(qi===null?qi=e:qi.push.apply(qi,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){Q(vh,t._currentValue),t._currentValue=n}function sn(e){e._currentValue=vh.current,q(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 I=S;S=p;for(var J=0;J<t.length;J++)if(I.context===t[J]){S.lanes|=n,I=S.alternate,I!==null&&(I.lanes|=n),_h(S.return,n,e),o||(M=null);break e}S=I.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 I=p.type;Xi(p.pendingProps.value,M.value)||(e!==null?e.push(I):e=[I])}}else if(p===H.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(!Xi(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 Si(e){return xp(Es,e)}function Gl(e,t){return Es===null&&xs(e),xp(e,t)}function xp(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 xS=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()})}},RS=i.unstable_scheduleCallback,TS=i.unstable_NormalPriority,ni={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bh(){return{controller:new xS,data:new Map,refCount:0}}function bo(e){e.refCount--,e.refCount===0&&RS(TS,function(){e.controller.abort()})}var So=null,Sh=0,pa=0,ga=null;function DS(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(Rp,Rp),t}function Rp(){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 OS(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 Tp=F.S;F.S=function(e,t){uv=ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&DS(e,t),Tp!==null&&Tp(e,t)};var Rs=B(null);function wh(){var e=Rs.current;return e!==null?e:jt.pooledCache}function Xl(e,t){t===null?Q(Rs,Rs.current):Q(Rs,t.pool)}function Dp(){var e=wh();return e===null?null:{parent:ni._currentValue,pool:e}}var va=Error(a(460)),Ch=Error(a(474)),Ql=Error(a(542)),Zl={then:function(){}};function Op(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ap(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,Mp(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,Mp(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 Lp(){if(Ds===null)throw Error(a(459));var e=Ds;return Ds=null,e}function Mp(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=[]),Ap(_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 kp(e){function t(ne,re){if(e){var le=ne.deletions;le===null?(ne.deletions=[re],ne.flags|=16):le.push(re)}}function n(ne,re){if(!e)return null;for(;re!==null;)t(ne,re),re=re.sibling;return null}function o(ne){for(var re=new Map;ne!==null;)ne.key!==null?re.set(ne.key,ne):re.set(ne.index,ne),ne=ne.sibling;return re}function p(ne,re){return ne=tn(ne,re),ne.index=0,ne.sibling=null,ne}function S(ne,re,le){return ne.index=le,e?(le=ne.alternate,le!==null?(le=le.index,le<re?(ne.flags|=67108866,re):le):(ne.flags|=67108866,re)):(ne.flags|=1048576,re)}function M(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function I(ne,re,le,ve){return re===null||re.tag!==6?(re=hh(le,ne.mode,ve),re.return=ne,re):(re=p(re,le),re.return=ne,re)}function J(ne,re,le,ve){var qe=le.type;return qe===x?ge(ne,re,le.props.children,ve,le.key):re!==null&&(re.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===T&&Ts(qe)===re.type)?(re=p(re,le.props),Co(re,le),re.return=ne,re):(re=Vl(le.type,le.key,le.props,null,ne.mode,ve),Co(re,le),re.return=ne,re)}function ce(ne,re,le,ve){return re===null||re.tag!==4||re.stateNode.containerInfo!==le.containerInfo||re.stateNode.implementation!==le.implementation?(re=dh(le,ne.mode,ve),re.return=ne,re):(re=p(re,le.children||[]),re.return=ne,re)}function ge(ne,re,le,ve,qe){return re===null||re.tag!==7?(re=ws(le,ne.mode,ve,qe),re.return=ne,re):(re=p(re,le),re.return=ne,re)}function ye(ne,re,le){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=hh(""+re,ne.mode,le),re.return=ne,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case C:return le=Vl(re.type,re.key,re.props,null,ne.mode,le),Co(le,re),le.return=ne,le;case R:return re=dh(re,ne.mode,le),re.return=ne,re;case T:return re=Ts(re),ye(ne,re,le)}if(X(re)||j(re))return re=ws(re,ne.mode,le,null),re.return=ne,re;if(typeof re.then=="function")return ye(ne,Jl(re),le);if(re.$$typeof===y)return ye(ne,Gl(ne,re),le);ec(ne,re)}return null}function de(ne,re,le,ve){var qe=re!==null?re.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return qe!==null?null:I(ne,re,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===qe?J(ne,re,le,ve):null;case R:return le.key===qe?ce(ne,re,le,ve):null;case T:return le=Ts(le),de(ne,re,le,ve)}if(X(le)||j(le))return qe!==null?null:ge(ne,re,le,ve,null);if(typeof le.then=="function")return de(ne,re,Jl(le),ve);if(le.$$typeof===y)return de(ne,re,Gl(ne,le),ve);ec(ne,le)}return null}function pe(ne,re,le,ve,qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ne=ne.get(le)||null,I(re,ne,""+ve,qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case C:return ne=ne.get(ve.key===null?le:ve.key)||null,J(re,ne,ve,qe);case R:return ne=ne.get(ve.key===null?le:ve.key)||null,ce(re,ne,ve,qe);case T:return ve=Ts(ve),pe(ne,re,le,ve,qe)}if(X(ve)||j(ve))return ne=ne.get(le)||null,ge(re,ne,ve,qe,null);if(typeof ve.then=="function")return pe(ne,re,le,Jl(ve),qe);if(ve.$$typeof===y)return pe(ne,re,le,Gl(re,ve),qe);ec(re,ve)}return null}function Le(ne,re,le,ve){for(var qe=null,bt=null,Be=re,rt=re=0,dt=null;Be!==null&&rt<le.length;rt++){Be.index>rt?(dt=Be,Be=null):dt=Be.sibling;var St=de(ne,Be,le[rt],ve);if(St===null){Be===null&&(Be=dt);break}e&&Be&&St.alternate===null&&t(ne,Be),re=S(St,re,rt),bt===null?qe=St:bt.sibling=St,bt=St,Be=dt}if(rt===le.length)return n(ne,Be),gt&&rn(ne,rt),qe;if(Be===null){for(;rt<le.length;rt++)Be=ye(ne,le[rt],ve),Be!==null&&(re=S(Be,re,rt),bt===null?qe=Be:bt.sibling=Be,bt=Be);return gt&&rn(ne,rt),qe}for(Be=o(Be);rt<le.length;rt++)dt=pe(Be,ne,rt,le[rt],ve),dt!==null&&(e&&dt.alternate!==null&&Be.delete(dt.key===null?rt:dt.key),re=S(dt,re,rt),bt===null?qe=dt:bt.sibling=dt,bt=dt);return e&&Be.forEach(function(Xn){return t(ne,Xn)}),gt&&rn(ne,rt),qe}function We(ne,re,le,ve){if(le==null)throw Error(a(151));for(var qe=null,bt=null,Be=re,rt=re=0,dt=null,St=le.next();Be!==null&&!St.done;rt++,St=le.next()){Be.index>rt?(dt=Be,Be=null):dt=Be.sibling;var Xn=de(ne,Be,St.value,ve);if(Xn===null){Be===null&&(Be=dt);break}e&&Be&&Xn.alternate===null&&t(ne,Be),re=S(Xn,re,rt),bt===null?qe=Xn:bt.sibling=Xn,bt=Xn,Be=dt}if(St.done)return n(ne,Be),gt&&rn(ne,rt),qe;if(Be===null){for(;!St.done;rt++,St=le.next())St=ye(ne,St.value,ve),St!==null&&(re=S(St,re,rt),bt===null?qe=St:bt.sibling=St,bt=St);return gt&&rn(ne,rt),qe}for(Be=o(Be);!St.done;rt++,St=le.next())St=pe(Be,ne,rt,St.value,ve),St!==null&&(e&&St.alternate!==null&&Be.delete(St.key===null?rt:St.key),re=S(St,re,rt),bt===null?qe=St:bt.sibling=St,bt=St);return e&&Be.forEach(function(Uw){return t(ne,Uw)}),gt&&rn(ne,rt),qe}function Nt(ne,re,le,ve){if(typeof le=="object"&&le!==null&&le.type===x&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var qe=le.key;re!==null;){if(re.key===qe){if(qe=le.type,qe===x){if(re.tag===7){n(ne,re.sibling),ve=p(re,le.props.children),ve.return=ne,ne=ve;break e}}else if(re.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===T&&Ts(qe)===re.type){n(ne,re.sibling),ve=p(re,le.props),Co(ve,le),ve.return=ne,ne=ve;break e}n(ne,re);break}else t(ne,re);re=re.sibling}le.type===x?(ve=ws(le.props.children,ne.mode,ve,le.key),ve.return=ne,ne=ve):(ve=Vl(le.type,le.key,le.props,null,ne.mode,ve),Co(ve,le),ve.return=ne,ne=ve)}return M(ne);case R:e:{for(qe=le.key;re!==null;){if(re.key===qe)if(re.tag===4&&re.stateNode.containerInfo===le.containerInfo&&re.stateNode.implementation===le.implementation){n(ne,re.sibling),ve=p(re,le.children||[]),ve.return=ne,ne=ve;break e}else{n(ne,re);break}else t(ne,re);re=re.sibling}ve=dh(le,ne.mode,ve),ve.return=ne,ne=ve}return M(ne);case T:return le=Ts(le),Nt(ne,re,le,ve)}if(X(le))return Le(ne,re,le,ve);if(j(le)){if(qe=j(le),typeof qe!="function")throw Error(a(150));return le=qe.call(le),We(ne,re,le,ve)}if(typeof le.then=="function")return Nt(ne,re,Jl(le),ve);if(le.$$typeof===y)return Nt(ne,re,Gl(ne,le),ve);ec(ne,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,re!==null&&re.tag===6?(n(ne,re.sibling),ve=p(re,le),ve.return=ne,ne=ve):(n(ne,re),ve=hh(le,ne.mode,ve),ve.return=ne,ne=ve),M(ne)):n(ne,re)}return function(ne,re,le,ve){try{wo=0;var qe=Nt(ne,re,le,ve);return _a=null,qe}catch(Be){if(Be===va||Be===Ql)throw Be;var bt=Qi(29,Be,null,ne.mode);return bt.lanes=ve,bt.return=ne,bt}finally{}}}var Os=kp(!0),Bp=kp(!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),vp(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,W(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,I=p.shared.pending;if(I!==null){p.shared.pending=null;var J=I,ce=J.next;J.next=null,M===null?S=ce:M.next=ce,M=J;var ge=e.alternate;ge!==null&&(ge=ge.updateQueue,I=ge.lastBaseUpdate,I!==M&&(I===null?ge.firstBaseUpdate=ce:I.next=ce,ge.lastBaseUpdate=J))}if(S!==null){var ye=p.baseState;M=0,ge=ce=J=null,I=S;do{var de=I.lane&-536870913,pe=de!==I.lane;if(pe?(ht&de)===de:(o&de)===de){de!==0&&de===pa&&(Th=!0),ge!==null&&(ge=ge.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Le=e,We=I;de=t;var Nt=n;switch(We.tag){case 1:if(Le=We.payload,typeof Le=="function"){ye=Le.call(Nt,ye,de);break e}ye=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=We.payload,de=typeof Le=="function"?Le.call(Nt,ye,de):Le,de==null)break e;ye=d({},ye,de);break e;case 2:kn=!0}}de=I.callback,de!==null&&(e.flags|=64,pe&&(e.flags|=8192),pe=p.callbacks,pe===null?p.callbacks=[de]:pe.push(de))}else pe={lane:de,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ge===null?(ce=ge=pe,J=ye):ge=ge.next=pe,M|=de;if(I=I.next,I===null){if(I=p.shared.pending,I===null)break;pe=I,I=pe.next,pe.next=null,p.lastBaseUpdate=pe,p.shared.pending=null}}while(!0);ge===null&&(J=ye),p.baseState=J,p.firstBaseUpdate=ce,p.lastBaseUpdate=ge,S===null&&(p.shared.lanes=0),Un|=M,e.lanes=M,e.memoizedState=ye}}function Np(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function jp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Np(n[e],t)}var ya=B(null),tc=B(0);function Hp(e,t){e=mn,Q(tc,e),Q(ya,t),mn=e|t.baseLanes}function Dh(){Q(tc,mn),Q(ya,ya.current)}function Oh(){mn=tc.current,q(ya),q(tc)}var Zi=B(null),hr=null;function jn(e){var t=e.alternate;Q(ti,ti.current&1),Q(Zi,e),hr===null&&(t===null||ya.current!==null||t.memoizedState!==null)&&(hr=e)}function Ah(e){Q(ti,ti.current),Q(Zi,e),hr===null&&(hr=e)}function Pp(e){e.tag===22?(Q(ti,ti.current),Q(Zi,e),hr===null&&(hr=e)):Hn()}function Hn(){Q(ti,ti.current),Q(Zi,Zi.current)}function Ji(e){q(Zi),hr===e&&(hr=null),q(ti)}var ti=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,it=null,kt=null,si=null,rc=!1,ba=!1,As=!1,nc=0,To=0,Sa=null,AS=0;function Qt(){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(!Xi(e[n],t[n]))return!1;return!0}function Mh(e,t,n,o,p,S){return an=S,it=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Sg:Wh,As=!1,S=n(o,p),As=!1,ba&&(S=Up(t,n,o,p)),zp(e),S}function zp(e){F.H=Ao;var t=kt!==null&&kt.next!==null;if(an=0,si=kt=it=null,rc=!1,To=0,Sa=null,t)throw Error(a(300));e===null||ai||(e=e.dependencies,e!==null&&Yl(e)&&(ai=!0))}function Up(e,t,n,o){it=e;var p=0;do{if(ba&&(Sa=null),To=0,ba=!1,25<=p)throw Error(a(301));if(p+=1,si=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)}F.H=wg,S=t(n,o)}while(ba);return S}function LS(){var e=F.H,t=e.useState()[0];return t=typeof t.then=="function"?Do(t):t,e=e.useState()[0],(kt!==null?kt.memoizedState:null)!==e&&(it.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,si=kt=it=null,ba=!1,To=nc=0,Sa=null}function Li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?it.memoizedState=si=e:si=si.next=e,si}function ii(){if(kt===null){var e=it.alternate;e=e!==null?e.memoizedState:null}else e=kt.next;var t=si===null?it.memoizedState:si.next;if(t!==null)si=t,kt=e;else{if(e===null)throw it.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},si===null?it.memoizedState=si=e:si=si.next=e}return si}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=To;return To+=1,Sa===null&&(Sa=[]),e=Ap(Sa,e,t),t=it,(si===null?t.memoizedState:si.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Sg:Wh),e}function ac(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Do(e);if(e.$$typeof===y)return Si(e)}throw Error(a(438,String(e)))}function jh(e){var t=null,n=it.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var o=it.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(),it.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]=U;return t.index++,n}function on(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=ii();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 I=M=null,J=null,ce=t,ge=!1;do{var ye=ce.lane&-536870913;if(ye!==ce.lane?(ht&ye)===ye:(an&ye)===ye){var de=ce.revertLane;if(de===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ye===pa&&(ge=!0);else if((an&de)===de){ce=ce.next,de===pa&&(ge=!0);continue}else ye={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(I=J=ye,M=S):J=J.next=ye,it.lanes|=de,Un|=de;ye=ce.action,As&&n(S,ye),S=ce.hasEagerState?ce.eagerState:n(S,ye)}else de={lane:ye,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(I=J=de,M=S):J=J.next=de,it.lanes|=ye,Un|=ye;ce=ce.next}while(ce!==null&&ce!==t);if(J===null?M=S:J.next=I,!Xi(S,e.memoizedState)&&(ai=!0,ge&&(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=ii(),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);Xi(S,t.memoizedState)||(ai=!0),t.memoizedState=S,t.baseQueue===null&&(t.baseState=S),n.lastRenderedState=S}return[S,o]}function Ip(e,t,n){var o=it,p=ii(),S=gt;if(S){if(n===void 0)throw Error(a(407));n=n()}else n=t();var M=!Xi((kt||p).memoizedState,n);if(M&&(p.memoizedState=n,ai=!0),p=p.queue,Ih($p.bind(null,o,p,e),[e]),p.getSnapshot!==t||M||si!==null&&si.memoizedState.tag&1){if(o.flags|=2048,wa(9,{destroy:void 0},qp.bind(null,o,p,n,t),null),jt===null)throw Error(a(349));S||(an&127)!==0||Fp(o,t,n)}return n}function Fp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=it.updateQueue,t===null?(t=sc(),it.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qp(e,t,n,o){t.value=n,t.getSnapshot=o,Kp(t)&&Vp(e)}function $p(e,t,n){return n(function(){Kp(t)&&Vp(e)})}function Kp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xi(e,n)}catch{return!0}}function Vp(e){var t=Ss(e,2);t!==null&&$i(t,e,2)}function zh(e){var t=Li();if(typeof e=="function"){var n=e;if(e=n(),As){_i(!0);try{n()}finally{_i(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t}function Wp(e,t,n,o){return e.baseState=n,Hh(e,kt,typeof o=="function"?o:on)}function MS(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)}};F.T!==null?n(!0):S.isTransition=!1,o(S),n=t.pending,n===null?(S.next=t.pending=S,Yp(t,S)):(S.next=n.next,t.pending=n.next=S)}}function Yp(e,t){var n=t.action,o=t.payload,p=e.state;if(t.isTransition){var S=F.T,M={};F.T=M;try{var I=n(p,o),J=F.S;J!==null&&J(M,I),Gp(e,t,I)}catch(ce){Uh(e,t,ce)}finally{S!==null&&M.types!==null&&(S.types=M.types),F.T=S}}else try{S=n(p,o),Gp(e,t,S)}catch(ce){Uh(e,t,ce)}}function Gp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(o){Xp(e,t,o)},function(o){return Uh(e,t,o)}):Xp(e,t,n)}function Xp(e,t,n){t.status="fulfilled",t.value=n,Qp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yp(e,n)))}function Uh(e,t,n){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=n,Qp(t),t=t.next;while(t!==o)}e.action=null}function Qp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zp(e,t){return t}function Jp(e,t){if(gt){var n=jt.formState;if(n!==null){e:{var o=it;if(gt){if(zt){t:{for(var p=zt,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){zt=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:Zp,lastRenderedState:t},n.queue=o,n=_g.bind(null,it,o),o.dispatch=n,o=zh(!1),S=Vh.bind(null,it,!1,o.queue),o=Li(),p={state:t,dispatch:null,action:e,pending:null},o.queue=p,n=MS.bind(null,it,p,S,n),p.dispatch=n,o.memoizedState=e,[t,n,!1]}function eg(e){var t=ii();return tg(t,kt,e)}function tg(e,t,n){if(t=Hh(e,t,Zp)[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=ii();var p=t.queue,S=p.dispatch;return n!==t.memoizedState&&(it.flags|=2048,wa(9,{destroy:void 0},kS.bind(null,p,n),null)),[o,S,e]}function kS(e,t){e.action=t}function ig(e){var t=ii(),n=kt;if(n!==null)return tg(t,n,e);ii(),t=t.memoizedState,n=ii();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=it.updateQueue,t===null&&(t=sc(),it.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 rg(){return ii().memoizedState}function lc(e,t,n,o){var p=Li();it.flags|=e,p.memoizedState=wa(1|t,{destroy:void 0},n,o===void 0?null:o)}function cc(e,t,n,o){var p=ii();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):(it.flags|=e,p.memoizedState=wa(1|t,S,n,o))}function ng(e,t){lc(8390656,8,e,t)}function Ih(e,t){cc(2048,8,e,t)}function BS(e){it.flags|=4;var t=it.updateQueue;if(t===null)t=sc(),it.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function sg(e){var t=ii().memoizedState;return BS({ref:t,nextImpl:e}),function(){if((Et&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ag(e,t){return cc(4,2,e,t)}function og(e,t){return cc(4,4,e,t)}function lg(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 cg(e,t,n){n=n!=null?n.concat([e]):null,cc(4,4,lg.bind(null,t,e),n)}function Fh(){}function ug(e,t){var n=ii();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 hg(e,t){var n=ii();t=t===void 0?null:t;var o=n.memoizedState;if(t!==null&&Lh(t,o[1]))return o[0];if(o=e(),As){_i(!0);try{e()}finally{_i(!1)}}return n.memoizedState=[o,t],o}function qh(e,t,n){return n===void 0||(an&1073741824)!==0&&(ht&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=dv(),it.lanes|=e,Un|=e,n)}function dg(e,t,n,o){return Xi(n,t)?n:ya.current!==null?(e=qh(e,n,o),Xi(e,t)||(ai=!0),e):(an&42)===0||(an&1073741824)!==0&&(ht&261930)===0?(ai=!0,e.memoizedState=n):(e=dv(),it.lanes|=e,Un|=e,t)}function fg(e,t,n,o,p){var S=Y.p;Y.p=S!==0&&8>S?S:8;var M=F.T,I={};F.T=I,Vh(e,!1,t,n);try{var J=p(),ce=F.S;if(ce!==null&&ce(I,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ge=OS(J,o);Oo(e,t,ge,ir(e))}else Oo(e,t,o,ir(e))}catch(ye){Oo(e,t,{then:function(){},status:"rejected",reason:ye},ir())}finally{Y.p=S,M!==null&&I.types!==null&&(M.types=I.types),F.T=M}}function NS(){}function $h(e,t,n,o){if(e.tag!==5)throw Error(a(476));var p=mg(e).queue;fg(e,p,t,k,n===null?NS:function(){return pg(e),n(o)})}function mg(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 pg(e){var t=mg(e);t.next===null&&(t=e.alternate.memoizedState),Oo(e,t.next.queue,{},ir())}function Kh(){return Si(Vo)}function gg(){return ii().memoizedState}function vg(){return ii().memoizedState}function jS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ir();e=Bn(n);var o=Nn(t,e,n);o!==null&&($i(o,t,n),Eo(o,t,n)),t={cache:bh()},e.payload=t;return}t=t.return}}function HS(e,t,n){var o=ir();n={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?yg(t,n):(n=ch(e,t,n,o),n!==null&&($i(n,e,o),bg(n,t,o)))}function _g(e,t,n){var o=ir();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))yg(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,I=S(M,n);if(p.hasEagerState=!0,p.eagerState=I,Xi(I,M))return $l(e,t,p,0),jt===null&&ql(),!1}catch{}finally{}if(n=ch(e,t,p,o),n!==null)return $i(n,e,o),bg(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&&$i(t,e,2)}function uc(e){var t=e.alternate;return e===it||t!==null&&t===it}function yg(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 bg(e,t,n){if((n&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,W(e,n)}}var Ao={readContext:Si,use:ac,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Ao.useEffectEvent=Qt;var Sg={readContext:Si,use:ac,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:Si,useEffect:ng,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,lc(4194308,4,lg.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){_i(!0);try{e()}finally{_i(!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){_i(!0);try{n(t)}finally{_i(!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=HS.bind(null,it,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=_g.bind(null,it,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=fg.bind(null,it,e.queue,!0,!1),Li().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=it,p=Li();if(gt){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),jt===null)throw Error(a(349));(ht&127)!==0||Fp(o,t,n)}p.memoizedState=n;var S={value:n,getSnapshot:t};return p.queue=S,ng($p.bind(null,o,S,e),[e]),o.flags|=2048,wa(9,{destroy:void 0},qp.bind(null,o,S,n,t),null),n},useId:function(){var e=Li(),t=jt.identifierPrefix;if(gt){var n=Hr,o=jr;n=(o&~(1<<32-Ft(o)-1)).toString(32)+n,t="_"+t+"R_"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=AS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kh,useFormState:Jp,useActionState:Jp,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,it,!0,n),n.dispatch=t,[e,t]},useMemoCache:jh,useCacheRefresh:function(){return Li().memoizedState=jS.bind(null,it)},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:Si,use:ac,useCallback:ug,useContext:Si,useEffect:Ih,useImperativeHandle:cg,useInsertionEffect:ag,useLayoutEffect:og,useMemo:hg,useReducer:oc,useRef:rg,useState:function(){return oc(on)},useDebugValue:Fh,useDeferredValue:function(e,t){var n=ii();return dg(n,kt.memoizedState,e,t)},useTransition:function(){var e=oc(on)[0],t=ii().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Ip,useId:gg,useHostTransitionStatus:Kh,useFormState:eg,useActionState:eg,useOptimistic:function(e,t){var n=ii();return Wp(n,kt,e,t)},useMemoCache:jh,useCacheRefresh:vg};Wh.useEffectEvent=sg;var wg={readContext:Si,use:ac,useCallback:ug,useContext:Si,useEffect:Ih,useImperativeHandle:cg,useInsertionEffect:ag,useLayoutEffect:og,useMemo:hg,useReducer:Ph,useRef:rg,useState:function(){return Ph(on)},useDebugValue:Fh,useDeferredValue:function(e,t){var n=ii();return kt===null?qh(n,e,t):dg(n,kt.memoizedState,e,t)},useTransition:function(){var e=Ph(on)[0],t=ii().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Ip,useId:gg,useHostTransitionStatus:Kh,useFormState:ig,useActionState:ig,useOptimistic:function(e,t){var n=ii();return kt!==null?Wp(n,kt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jh,useCacheRefresh:vg};wg.useEffectEvent=sg;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=ir(),p=Bn(o);p.payload=t,n!=null&&(p.callback=n),t=Nn(e,p,o),t!==null&&($i(t,e,o),Eo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=ir(),p=Bn(o);p.tag=1,p.payload=t,n!=null&&(p.callback=n),t=Nn(e,p,o),t!==null&&($i(t,e,o),Eo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ir(),o=Bn(n);o.tag=2,t!=null&&(o.callback=t),t=Nn(e,o,n),t!==null&&($i(t,e,n),Eo(t,e,n))}};function Cg(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 Eg(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 xg(e){Fl(e)}function Rg(e){console.error(e)}function Tg(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 Dg(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 Og(e){return e=Bn(e),e.tag=3,e}function Ag(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(){Dg(t,n,o)}}var M=n.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){Dg(t,n,o),typeof p!="function"&&(In===null?In=new Set([this]):In.add(this));var I=o.stack;this.componentDidCatch(o.value,{componentStack:I!==null?I:""})})}function PS(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=Zi.current,n!==null){switch(n.tag){case 31:case 13:return hr===null?Cc():n.alternate===null&&Zt===0&&(Zt=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(gt)return t=Zi.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),Zt!==4&&(Zt=2)),!1;var S=Error(a(520),{cause:o});if(S=or(S,n),Po===null?Po=[S]:Po.push(S),Zt!==4&&(Zt=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"&&(In===null||!In.has(S))))return n.flags|=65536,p&=-p,n.lanes|=p,p=Og(p),Ag(p,e,n,o),Rh(n,p),!1}n=n.return}while(n!==null);return!1}var Qh=Error(a(461)),ai=!1;function wi(e,t,n,o){t.child=e===null?Bp(t,null,n,o):Os(t,e.child,n,o)}function Lg(e,t,n,o,p){n=n.render;var S=t.ref;if("ref"in o){var M={};for(var I in o)I!=="ref"&&(M[I]=o[I])}else M=o;return xs(t),o=Mh(e,t,n,M,S,p),I=kh(),e!==null&&!ai?(Bh(e,t,p),ln(e,t,p)):(gt&&I&&fh(t),t.flags|=1,wi(e,t,o,p),t.child)}function Mg(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,kg(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 kg(e,t,n,o,p){if(e!==null){var S=e.memoizedProps;if(go(S,o)&&e.ref===t.ref)if(ai=!1,t.pendingProps=o=S,sd(e,p))(e.flags&131072)!==0&&(ai=!0);else return t.lanes=e.lanes,ln(e,t,p)}return Zh(e,t,n,o,p)}function Bg(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 Ng(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?Hp(t,S):Dh(),Pp(t);else return o=t.lanes=536870912,Ng(e,t,S!==null?S.baseLanes|n:n,n,o)}else S!==null?(Xl(t,S.cachePool),Hp(t,S),Hn(),t.memoizedState=null):(e!==null&&Xl(t,null),Dh(),Hn());return wi(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 Ng(e,t,n,o,p){var S=wh();return S=S===null?null:{parent:ni._currentValue,pool:S},t.memoizedState={baseLanes:n,cachePool:S},e!==null&&Xl(t,null),Dh(),Pp(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 jg(e,t,n){return Os(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,Ji(t),t.memoizedState=null,e}function zS(e,t,n){var o=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(gt){if(o.mode==="hidden")return e=dc(t,o),t.lanes=536870912,Lo(null,e);if(Ah(t),(e=zt)?(e=Yv(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=yp(e),n.return=t,t.child=n,bi=t,zt=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=jg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(ai||ma(e,t,n,!1),p=(n&e.childLanes)!==0,ai||p){if(o=jt,o!==null&&(M=ie(o,n),M!==0&&M!==S.retryLane))throw S.retryLane=M,Ss(e,M),$i(o,e,M),Qh;Cc(),t=jg(e,t,n)}else e=S.treeContext,zt=dr(M.nextSibling),bi=t,gt=!0,An=null,ur=!1,e!==null&&wp(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&&!ai?(Bh(e,t,p),ln(e,t,p)):(gt&&o&&fh(t),t.flags|=1,wi(e,t,n,p),t.child)}function Hg(e,t,n,o,p,S){return xs(t),t.updateQueue=null,n=Up(t,o,n,p),zp(e),o=kh(),e!==null&&!ai?(Bh(e,t,S),ln(e,t,S)):(gt&&o&&fh(t),t.flags|=1,wi(e,t,n,S),t.child)}function Pg(e,t,n,o,p){if(xs(t),t.stateNode===null){var S=ua,M=n.contextType;typeof M=="object"&&M!==null&&(S=Si(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?Si(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 I=t.memoizedProps,J=Ls(n,I);S.props=J;var ce=S.context,ge=n.contextType;M=ua,typeof ge=="object"&&ge!==null&&(M=Si(ge));var ye=n.getDerivedStateFromProps;ge=typeof ye=="function"||typeof S.getSnapshotBeforeUpdate=="function",I=t.pendingProps!==I,ge||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(I||ce!==M)&&Eg(t,S,o,M),kn=!1;var de=t.memoizedState;S.state=de,Ro(t,o,S,p),xo(),ce=t.memoizedState,I||de!==ce||kn?(typeof ye=="function"&&(Yh(t,n,ye,o),ce=t.memoizedState),(J=kn||Cg(t,n,J,o,de,ce,M))?(ge||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=ce),S.props=o,S.state=ce,S.context=M,o=J):(typeof S.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{S=t.stateNode,xh(e,t),M=t.memoizedProps,ge=Ls(n,M),S.props=ge,ye=t.pendingProps,de=S.context,ce=n.contextType,J=ua,typeof ce=="object"&&ce!==null&&(J=Si(ce)),I=n.getDerivedStateFromProps,(ce=typeof I=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==ye||de!==J)&&Eg(t,S,o,J),kn=!1,de=t.memoizedState,S.state=de,Ro(t,o,S,p),xo();var pe=t.memoizedState;M!==ye||de!==pe||kn||e!==null&&e.dependencies!==null&&Yl(e.dependencies)?(typeof I=="function"&&(Yh(t,n,I,o),pe=t.memoizedState),(ge=kn||Cg(t,n,ge,o,de,pe,J)||e!==null&&e.dependencies!==null&&Yl(e.dependencies))?(ce||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,pe,J),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,pe,J)),typeof S.componentDidUpdate=="function"&&(t.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=pe),S.props=o,S.state=pe,S.context=J,o=ge):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&de===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)):wi(e,t,n,p),t.memoizedState=S.state,e=t.child):e=ln(e,t,p),e}function zg(e,t,n,o){return Cs(),t.flags|=256,wi(e,t,n,o),t.child}var Jh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:Dp()}}function td(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=tr),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:(ti.current&2)!==0),M&&(p=!0,t.flags&=-129),M=(t.flags&32)!==0,t.flags&=-33,e===null){if(gt){if(p?jn(t):Hn(),(e=zt)?(e=Yv(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=yp(e),n.return=t,t.child=n,bi=t,zt=null)):e=null,e===null)throw Ln(t);return Hd(e)?t.lanes=32:t.lanes=536870912,null}var I=o.children;return o=o.fallback,p?(Hn(),p=t.mode,I=mc({mode:"hidden",children:I},p),o=ws(o,p,n,null),I.return=t,o.return=t,I.sibling=o,t.child=I,o=t.child,o.memoizedState=ed(n),o.childLanes=td(e,M,n),t.memoizedState=Jh,Lo(null,o)):(jn(t),id(t,I))}var J=e.memoizedState;if(J!==null&&(I=J.dehydrated,I!==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(),I=o.fallback,p=t.mode,o=mc({mode:"visible",children:o.children},p),I=ws(I,p,n,null),I.flags|=2,o.return=t,I.return=t,o.sibling=I,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(I)){if(M=I.nextSibling&&I.nextSibling.dataset,M)var ce=M.dgst;M=ce,o=Error(a(419)),o.stack="",o.digest=M,yo({value:o,source:null,stack:null}),t=rd(e,t,n)}else if(ai||ma(e,t,n,!1),M=(n&e.childLanes)!==0,ai||M){if(M=jt,M!==null&&(o=ie(M,n),o!==0&&o!==J.retryLane))throw J.retryLane=o,Ss(e,o),$i(M,e,o),Qh;jd(I)||Cc(),t=rd(e,t,n)}else jd(I)?(t.flags|=192,t.child=e.child,t=null):(e=J.treeContext,zt=dr(I.nextSibling),bi=t,gt=!0,An=null,ur=!1,e!==null&&wp(t,e),t=id(t,o.children),t.flags|=4096);return t}return p?(Hn(),I=o.fallback,p=t.mode,J=e.child,ce=J.sibling,o=tn(J,{mode:"hidden",children:o.children}),o.subtreeFlags=J.subtreeFlags&65011712,ce!==null?I=tn(ce,I):(I=ws(I,p,n,null),I.flags|=2),I.return=t,o.return=t,o.sibling=I,t.child=o,Lo(null,o),o=t.child,I=e.child.memoizedState,I===null?I=ed(n):(p=I.cachePool,p!==null?(J=ni._currentValue,p=p.parent!==J?{parent:J,pool:J}:p):p=Dp(),I={baseLanes:I.baseLanes|n,cachePool:p}),o.memoizedState=I,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=Qi(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 Ig(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 Fg(e,t,n){var o=t.pendingProps,p=o.revealOrder,S=o.tail;o=o.children;var M=ti.current,I=(M&2)!==0;if(I?(M=M&1|2,t.flags|=128):M&=1,Q(ti,M),wi(e,t,o,n),o=gt?_o:0,!I&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ig(e,n,t);else if(e.tag===19)Ig(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),Un|=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,ni,e.memoizedState.cache),Cs();break;case 27:case 5:fe(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 Fg(e,t,n);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Q(ti,ti.current),o)break;return null;case 22:return t.lanes=0,Bg(e,t,n,t.pendingProps);case 24:Mn(t,ni,e.memoizedState.cache)}return ln(e,t,n)}function qg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ai=!0;else{if(!sd(e,n)&&(t.flags&128)===0)return ai=!1,US(e,t,n);ai=(e.flags&131072)!==0}else ai=!1,gt&&(t.flags&1048576)!==0&&Sp(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=Pg(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=Lg(null,t,e,o,n);break e}else if(p===O){t.tag=14,t=Mg(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),Pg(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,ni,o),o!==S.cache&&yh(t,[ni],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=zg(e,t,o,n);break e}else if(o!==p){p=or(Error(a(424)),t),yo(p),t=zg(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(zt=dr(e.firstChild),bi=t,gt=!0,An=null,ur=!0,n=Bp(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}wi(e,t,o,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=e_(t.type,null,t.pendingProps,null))?t.memoizedState=n:gt||(n=t.type,e=t.pendingProps,o=Ac(be.current).createElement(n),o[Re]=t,o[Te]=e,Ci(o,n,e),qt(o),t.stateNode=o):t.memoizedState=e_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&gt&&(o=t.stateNode=Qv(t.type,t.pendingProps,be.current),bi=t,ur=!0,p=zt,Kn(t.type)?(Pd=p,zt=dr(o.firstChild)):zt=p),wi(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&gt&&((p=o=zt)&&(o=gw(o,t.type,t.pendingProps,ur),o!==null?(t.stateNode=o,bi=t,zt=dr(o.firstChild),ur=!1,p=!0):p=!1),p||Ln(t)),fe(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,LS,null,null,n),Vo._currentValue=p),fc(e,t),wi(e,t,o,n),t.child;case 6:return e===null&&gt&&((e=n=zt)&&(n=vw(n,t.pendingProps,ur),n!==null?(t.stateNode=n,bi=t,zt=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):wi(e,t,o,n),t.child;case 11:return Lg(e,t,t.type,t.pendingProps,n);case 7:return wi(e,t,t.pendingProps,n),t.child;case 8:return wi(e,t,t.pendingProps.children,n),t.child;case 12:return wi(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,Mn(t,t.type,o.value),wi(e,t,o.children,n),t.child;case 9:return p=t.type._context,o=t.pendingProps.children,xs(t),p=Si(p),o=o(p),t.flags|=1,wi(e,t,o,n),t.child;case 14:return Mg(e,t,t.type,t.pendingProps,n);case 15:return kg(e,t,t.type,t.pendingProps,n);case 19:return Fg(e,t,n);case 31:return zS(e,t,n);case 22:return Bg(e,t,n,t.pendingProps);case 24:return xs(t),o=Si(ni),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,ni,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,ni,o)):(o=S.cache,Mn(t,ni,o),o!==p.cache&&yh(t,[ni],n,!0))),wi(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(gv())e.flags|=8192;else throw Ds=Zl,Ch}else e.flags&=-16777217}function $g(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!s_(t))if(gv())e.flags|=8192;else throw Ds=Zl,Ch}function pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vt():536870912,e.lanes|=t,Ra|=t)}function Mo(e,t){if(!gt)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 Ut(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 IS(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 Ut(t),null;case 1:return Ut(t),null;case 3:return n=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),sn(ni),ae(),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())),Ut(t),null;case 26:var p=t.type,S=t.memoizedState;return e===null?(cn(t),S!==null?(Ut(t),$g(t,S)):(Ut(t),ad(t,p,null,o,n))):S?S!==e.memoizedState?(cn(t),Ut(t),$g(t,S)):(Ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&cn(t),Ut(t),ad(t,p,e,o,n)),null;case 27:if(me(t),n=be.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 Ut(t),null}e=te.current,fa(t)?Cp(t):(e=Qv(p,o,n),t.stateNode=e,cn(t))}return Ut(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 Ut(t),null}if(S=te.current,fa(t))Cp(t);else{var M=Ac(be.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[Re]=t,S[Te]=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(Ci(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 Ut(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=be.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,p=bi,p!==null)switch(p.tag){case 27:case 5:o=p.memoizedProps}e[Re]=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[Re]=t,t.stateNode=e}return Ut(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[Re]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ut(t),e=!1}else n=gh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ji(t),t):(Ji(t),null);if((t.flags&128)!==0)throw Error(a(558))}return Ut(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[Re]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ut(t),p=!1}else p=gh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(Ji(t),t):(Ji(t),null)}return Ji(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),Ut(t),null);case 4:return ae(),e===null&&Dd(t.stateNode.containerInfo),Ut(t),null;case 10:return sn(t.type),Ut(t),null;case 19:if(q(ti),o=t.memoizedState,o===null)return Ut(t),null;if(p=(t.flags&128)!==0,S=o.rendering,S===null)if(p)Mo(o,!1);else{if(Zt!==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;)_p(n,e),n=n.sibling;return Q(ti,ti.current&1|2),gt&&rn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&ze()>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&&!gt)return Ut(t),null}else 2*ze()-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=ze(),e.sibling=null,n=ti.current,Q(ti,p?n&1|2:n&1),gt&&rn(t,o.treeForkCount),e):(Ut(t),null);case 22:case 23:return Ji(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&&(Ut(t),t.subtreeFlags&6&&(t.flags|=8192)):Ut(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&&q(Rs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),sn(ni),Ut(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function FS(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(ni),ae(),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(Ji(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(Ji(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 q(ti),null;case 4:return ae(),null;case 10:return sn(t.type),null;case 22:case 23:return Ji(t),Oh(),e!==null&&q(Rs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sn(ni),null;case 25:return null;default:return null}}function Kg(e,t){switch(mh(t),t.tag){case 3:sn(ni),ae();break;case 26:case 27:case 5:me(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&Ji(t);break;case 13:Ji(t);break;case 19:q(ti);break;case 10:sn(t.type);break;case 22:case 23:Ji(t),Oh(),e!==null&&q(Rs);break;case 24:sn(ni)}}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(I){Ot(t,t.return,I)}}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,I=M.destroy;if(I!==void 0){M.destroy=void 0,p=t;var J=n,ce=I;try{ce()}catch(ge){Ot(p,J,ge)}}}o=o.next}while(o!==S)}}catch(ge){Ot(t,t.return,ge)}}function Vg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jp(t,n)}catch(o){Ot(e,e.return,o)}}}function Wg(e,t,n){n.props=Ls(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(o){Ot(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){Ot(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){Ot(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){Ot(e,t,p)}else n.current=null}function Yg(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){Ot(e,e.return,p)}}function od(e,t,n){try{var o=e.stateNode;uw(o,e.type,n,t),o[Te]=t}catch(p){Ot(e,e.return,p)}}function Gg(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||Gg(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 Xg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var o=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);Ci(t,o,n),t[Re]=e,t[Te]=n}catch(S){Ot(e,e.return,S)}}var un=!1,oi=!1,ud=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,pi=null;function qS(e,t){if(e=e.containerInfo,Ld=Hc,e=cp(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,I=-1,J=-1,ce=0,ge=0,ye=e,de=null;t:for(;;){for(var pe;ye!==n||p!==0&&ye.nodeType!==3||(I=M+p),ye!==S||o!==0&&ye.nodeType!==3||(J=M+o),ye.nodeType===3&&(M+=ye.nodeValue.length),(pe=ye.firstChild)!==null;)de=ye,ye=pe;for(;;){if(ye===e)break t;if(de===n&&++ce===p&&(I=M),de===S&&++ge===o&&(J=M),(pe=ye.nextSibling)!==null)break;ye=de,de=ye.parentNode}ye=pe}n=I===-1||J===-1?null:{start:I,end:J}}else n=null}n=n||{start:0,end:0}}else n=null;for(Md={focusedElem:e,selectionRange:n},Hc=!1,pi=t;pi!==null;)if(t=pi,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pi=e;else for(;pi!==null;){switch(t=pi,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 Le=Ls(n.type,p);e=o.getSnapshotBeforeUpdate(Le,S),o.__reactInternalSnapshotBeforeUpdate=e}catch(We){Ot(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,pi=e;break}pi=t.return}}function Zg(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){Ot(n,n.return,M)}else{var p=Ls(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(M){Ot(n,n.return,M)}}o&64&&Vg(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{jp(e,t)}catch(M){Ot(n,n.return,M)}}break;case 27:t===null&&o&4&&Xg(n);case 26:case 5:dn(e,n),t===null&&o&4&&Yg(n),o&512&&Bo(n,n.return);break;case 12:dn(e,n);break;case 31:dn(e,n),o&4&&tv(e,n);break;case 13:dn(e,n),o&4&&iv(e,n),o&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ZS.bind(null,n),_w(e,n))));break;case 22:if(o=n.memoizedState!==null||un,!o){t=t!==null&&t.memoizedState!==null||oi,p=un;var S=oi;un=o,(oi=t)&&!S?fn(e,n,(n.subtreeFlags&8772)!==0):dn(e,n),un=p,oi=S}break;case 30:break;default:dn(e,n)}}function Jg(e){var t=e.alternate;t!==null&&(e.alternate=null,Jg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gt(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 $t=null,Ui=!1;function hn(e,t,n){for(n=n.child;n!==null;)ev(e,t,n),n=n.sibling}function ev(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(di,n)}catch{}switch(n.tag){case 26:oi||Pr(n,t),hn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:oi||Pr(n,t);var o=$t,p=Ui;Kn(n.type)&&($t=n.stateNode,Ui=!1),hn(e,t,n),qo(n.stateNode),$t=o,Ui=p;break;case 5:oi||Pr(n,t);case 6:if(o=$t,p=Ui,$t=null,hn(e,t,n),$t=o,Ui=p,$t!==null)if(Ui)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(n.stateNode)}catch(S){Ot(n,t,S)}else try{$t.removeChild(n.stateNode)}catch(S){Ot(n,t,S)}break;case 18:$t!==null&&(Ui?(e=$t,Vv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ba(e)):Vv($t,n.stateNode));break;case 4:o=$t,p=Ui,$t=n.stateNode.containerInfo,Ui=!0,hn(e,t,n),$t=o,Ui=p;break;case 0:case 11:case 14:case 15:Pn(2,n,t),oi||Pn(4,n,t),hn(e,t,n);break;case 1:oi||(Pr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"&&Wg(n,t,o)),hn(e,t,n);break;case 21:hn(e,t,n);break;case 22:oi=(o=oi)||n.memoizedState!==null,hn(e,t,n),oi=o;break;default:hn(e,t,n)}}function tv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ba(e)}catch(n){Ot(t,t.return,n)}}}function iv(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){Ot(t,t.return,n)}}function $S(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qg),t;default:throw Error(a(435,e.tag))}}function vc(e,t){var n=$S(e);t.forEach(function(o){if(!n.has(o)){n.add(o);var p=JS.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,I=M;e:for(;I!==null;){switch(I.tag){case 27:if(Kn(I.type)){$t=I.stateNode,Ui=!1;break e}break;case 5:$t=I.stateNode,Ui=!1;break e;case 3:case 4:$t=I.stateNode.containerInfo,Ui=!0;break e}I=I.return}if($t===null)throw Error(a(160));ev(S,M,p),$t=null,Ui=!1,S=p.alternate,S!==null&&(S.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rv(t,e),t=t.sibling}var Dr=null;function rv(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ii(t,e),Fi(e),o&4&&(Pn(3,e,e.return),ko(3,e),Pn(5,e,e.return));break;case 1:Ii(t,e),Fi(e),o&512&&(oi||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=Dr;if(Ii(t,e),Fi(e),o&512&&(oi||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[Wt]||S[Re]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=p.createElement(o),p.head.insertBefore(S,p.querySelector("head > title"))),Ci(S,o,n),S[Re]=e,qt(S),o=S;break e;case"link":var M=r_("link","href",p).get(o+(n.href||""));if(M){for(var I=0;I<M.length;I++)if(S=M[I],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(I,1);break t}}S=p.createElement(o),Ci(S,o,n),p.head.appendChild(S);break;case"meta":if(M=r_("meta","content",p).get(o+(n.content||""))){for(I=0;I<M.length;I++)if(S=M[I],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(I,1);break t}}S=p.createElement(o),Ci(S,o,n),p.head.appendChild(S);break;default:throw Error(a(468,o))}S[Re]=e,qt(S),o=S}e.stateNode=o}else n_(p,e.type,e.stateNode);else e.stateNode=i_(p,o,e.memoizedProps);else S!==o?(S===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):S.count--,o===null?n_(p,e.type,e.stateNode):i_(p,o,e.memoizedProps)):o===null&&e.stateNode!==null&&od(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ii(t,e),Fi(e),o&512&&(oi||n===null||Pr(n,n.return)),n!==null&&o&4&&od(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ii(t,e),Fi(e),o&512&&(oi||n===null||Pr(n,n.return)),e.flags&32){p=e.stateNode;try{ra(p,"")}catch(Le){Ot(e,e.return,Le)}}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),Fi(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(Le){Ot(e,e.return,Le)}}break;case 3:if(kc=null,p=Dr,Dr=Lc(t.containerInfo),Ii(t,e),Dr=p,Fi(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Ba(t.containerInfo)}catch(Le){Ot(e,e.return,Le)}ud&&(ud=!1,nv(e));break;case 4:o=Dr,Dr=Lc(e.stateNode.containerInfo),Ii(t,e),Fi(e),Dr=o;break;case 12:Ii(t,e),Fi(e);break;case 31:Ii(t,e),Fi(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vc(e,o)));break;case 13:Ii(t,e),Fi(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(yc=ze()),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,ce=un,ge=oi;if(un=ce||p,oi=ge||J,Ii(t,e),oi=ge,un=ce,Fi(e),o&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(n===null||J||un||oi||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{I=J.stateNode;var ye=J.memoizedProps.style,de=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;I.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Le){Ot(J,J.return,Le)}}}else if(t.tag===6){if(n===null){J=t;try{J.stateNode.nodeValue=p?"":J.memoizedProps}catch(Le){Ot(J,J.return,Le)}}}else if(t.tag===18){if(n===null){J=t;try{var pe=J.stateNode;p?Wv(pe,!0):Wv(J.stateNode,!1)}catch(Le){Ot(J,J.return,Le)}}}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),Fi(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),Fi(e)}}function Fi(e){var t=e.flags;if(t&2){try{for(var n,o=e.return;o!==null;){if(Gg(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 I=ld(e);gc(e,I,M);break;case 3:case 4:var J=n.stateNode.containerInfo,ce=ld(e);cd(e,ce,J);break;default:throw Error(a(161))}}catch(ge){Ot(e,e.return,ge)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nv(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;)Zg(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"&&Wg(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(ce){Ot(o,o.return,ce)}if(o=S,p=o.updateQueue,p!==null){var I=o.stateNode;try{var J=p.shared.hiddenCallbacks;if(J!==null)for(p.shared.hiddenCallbacks=null,p=0;p<J.length;p++)Np(J[p],I)}catch(ce){Ot(o,o.return,ce)}}n&&M&64&&Vg(S),Bo(S,S.return);break;case 27:Xg(S);case 26:case 5:fn(p,S,n),n&&o===null&&M&4&&Yg(S),Bo(S,S.return);break;case 12:fn(p,S,n);break;case 31:fn(p,S,n),n&&M&4&&tv(p,S);break;case 13:fn(p,S,n),n&&M&4&&iv(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 Or(e,t,n,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sv(e,t,n,o),t=t.sibling}function sv(e,t,n,o){var p=t.flags;switch(t.tag){case 0:case 11:case 15:Or(e,t,n,o),p&2048&&ko(9,t);break;case 1:Or(e,t,n,o);break;case 3:Or(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){Or(e,t,n,o),e=t.stateNode;try{var S=t.memoizedProps,M=S.id,I=S.onPostCommit;typeof I=="function"&&I(M,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(J){Ot(t,t.return,J)}}else Or(e,t,n,o);break;case 31:Or(e,t,n,o);break;case 13:Or(e,t,n,o);break;case 23:break;case 22:S=t.stateNode,M=t.alternate,t.memoizedState!==null?S._visibility&2?Or(e,t,n,o):No(e,t):S._visibility&2?Or(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:Or(e,t,n,o),p&2048&&dd(t.alternate,t);break;default:Or(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,I=n,J=o,ce=M.flags;switch(M.tag){case 0:case 11:case 15:Ca(S,M,I,J,p),ko(8,M);break;case 23:break;case 22:var ge=M.stateNode;M.memoizedState!==null?ge._visibility&2?Ca(S,M,I,J,p):No(S,M):(ge._visibility|=2,Ca(S,M,I,J,p)),p&&ce&2048&&hd(M.alternate,M);break;case 24:Ca(S,M,I,J,p),p&&ce&2048&&dd(M.alternate,M);break;default:Ca(S,M,I,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;)av(e,t,n),e=e.sibling}function av(e,t,n){switch(e.tag){case 26:Ea(e,t,n),e.flags&jo&&e.memoizedState!==null&&Aw(n,Dr,e.memoizedState,e.memoizedProps);break;case 5:Ea(e,t,n);break;case 3:case 4:var o=Dr;Dr=Lc(e.stateNode.containerInfo),Ea(e,t,n),Dr=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 ov(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];pi=o,cv(o,e)}ov(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lv(e),e=e.sibling}function lv(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];pi=o,cv(o,e)}ov(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 cv(e,t){for(;pi!==null;){var n=pi;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,pi=o;else e:for(n=e;pi!==null;){o=pi;var p=o.sibling,S=o.return;if(Jg(o),o===n){pi=null;break e}if(p!==null){p.return=S,pi=p;break e}pi=S}}}var KS={getCacheForType:function(e){var t=Si(ni),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Si(ni).controller.signal}},VS=typeof WeakMap=="function"?WeakMap:Map,Et=0,jt=null,ct=null,ht=0,Dt=0,er=null,zn=!1,xa=!1,fd=!1,mn=0,Zt=0,Un=0,ks=0,md=0,tr=0,Ra=0,Po=null,qi=null,pd=!1,yc=0,uv=0,bc=1/0,Sc=null,In=null,ui=0,Fn=null,Ta=null,pn=0,gd=0,vd=null,hv=null,zo=0,_d=null;function ir(){return(Et&2)!==0&&ht!==0?ht&-ht:F.T!==null?Ed():Ce()}function dv(){if(tr===0)if((ht&536870912)===0||gt){var e=Ni;Ni<<=1,(Ni&3932160)===0&&(Ni=262144),tr=e}else tr=536870912;return e=Zi.current,e!==null&&(e.flags|=32),tr}function $i(e,t,n){(e===jt&&(Dt===2||Dt===9)||e.cancelPendingCommit!==null)&&(Da(e,0),qn(e,ht,tr,!1)),he(e,n),((Et&2)===0||e!==jt)&&(e===jt&&((Et&2)===0&&(ks|=n),Zt===4&&qn(e,ht,tr,!1)),zr(e))}function fv(e,t,n){if((Et&6)!==0)throw Error(a(327));var o=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Mt(e,t),p=o?GS(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&&!WS(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 I=e;p=Po;var J=I.current.memoizedState.isDehydrated;if(J&&(Da(I,M).flags|=256),M=bd(I,M,!1),M!==2){if(fd&&!J){I.errorRecoveryDisabledLanes|=S,ks|=S,p=4;break e}S=qi,qi=p,S!==null&&(qi===null?qi=S:qi.push.apply(qi,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,tr,!zn);break e;case 2:qi=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(p=yc+300-ze(),10<p)){if(qn(o,t,tr,!zn),Ve(o,0,!0)!==0)break e;pn=t,o.timeoutHandle=$v(mv.bind(null,o,n,qi,Sc,pd,t,tr,ks,Ra,zn,S,"Throttled",-0,0),p);break e}mv(o,n,qi,Sc,pd,t,tr,ks,Ra,zn,S,null,-0,0)}}break}while(!0);zr(e)}function mv(e,t,n,o,p,S,M,I,J,ce,ge,ye,de,pe){if(e.timeoutHandle=-1,ye=t.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jr},av(t,S,ye);var Le=(S&62914560)===S?yc-ze():(S&4194048)===S?uv-ze():0;if(Le=Lw(ye,Le),Le!==null){pn=S,e.cancelPendingCommit=Le(wv.bind(null,e,t,S,n,o,p,M,I,J,ge,ye,null,de,pe)),qn(e,S,M,!ce);return}}wv(e,t,S,n,o,p,M,I,J)}function WS(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(!Xi(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-Ft(p),M=1<<S;o[S]=-1,p&=~M}n!==0&&tt(e,n,t)}function wc(){return(Et&6)===0?(Uo(0),!1):!0}function yd(){if(ct!==null){if(Dt===0)var e=ct.return;else e=ct,nn=Es=null,Nh(e),_a=null,wo=0,e=ct;for(;e!==null;)Kg(e.alternate,e),e=e.return;ct=null}}function Da(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,fw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pn=0,yd(),jt=e,ct=n=tn(e.current,null),ht=t,Dt=0,er=null,zn=!1,xa=Mt(e,t),fd=!1,Ra=tr=md=ks=Un=Zt=0,qi=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-Ft(o),S=1<<p;t|=e[p],o&=~S}return mn=t,ql(),n}function pv(e,t){it=null,F.H=Ao,t===va||t===Ql?(t=Lp(),Dt=3):t===Ch?(t=Lp(),Dt=4):Dt=t===Qh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,er=t,ct===null&&(Zt=1,hc(e,or(t,e.current)))}function gv(){var e=Zi.current;return e===null?!0:(ht&4194048)===ht?hr===null:(ht&62914560)===ht||(ht&536870912)!==0?e===hr:!1}function vv(){var e=F.H;return F.H=Ao,e===null?Ao:e}function _v(){var e=F.A;return F.A=KS,e}function Cc(){Zt=4,zn||(ht&4194048)!==ht&&Zi.current!==null||(xa=!0),(Un&134217727)===0&&(ks&134217727)===0||jt===null||qn(jt,ht,tr,!1)}function bd(e,t,n){var o=Et;Et|=2;var p=vv(),S=_v();(jt!==e||ht!==t)&&(Sc=null,Da(e,t)),t=!1;var M=Zt;e:do try{if(Dt!==0&&ct!==null){var I=ct,J=er;switch(Dt){case 8:yd(),M=6;break e;case 3:case 2:case 9:case 6:Zi.current===null&&(t=!0);var ce=Dt;if(Dt=0,er=null,Oa(e,I,J,ce),n&&xa){M=0;break e}break;default:ce=Dt,Dt=0,er=null,Oa(e,I,J,ce)}}YS(),M=Zt;break}catch(ge){pv(e,ge)}while(!0);return t&&e.shellSuspendCounter++,nn=Es=null,Et=o,F.H=p,F.A=S,ct===null&&(jt=null,ht=0,ql()),M}function YS(){for(;ct!==null;)yv(ct)}function GS(e,t){var n=Et;Et|=2;var o=vv(),p=_v();jt!==e||ht!==t?(Sc=null,bc=ze()+500,Da(e,t)):xa=Mt(e,t);e:do try{if(Dt!==0&&ct!==null){t=ct;var S=er;t:switch(Dt){case 1:Dt=0,er=null,Oa(e,t,S,1);break;case 2:case 9:if(Op(S)){Dt=0,er=null,bv(t);break}t=function(){Dt!==2&&Dt!==9||jt!==e||(Dt=7),zr(e)},S.then(t,t);break e;case 3:Dt=7;break e;case 4:Dt=5;break e;case 7:Op(S)?(Dt=0,er=null,bv(t)):(Dt=0,er=null,Oa(e,t,S,7));break;case 5:var M=null;switch(ct.tag){case 26:M=ct.memoizedState;case 5:case 27:var I=ct;if(M?s_(M):I.stateNode.complete){Dt=0,er=null;var J=I.sibling;if(J!==null)ct=J;else{var ce=I.return;ce!==null?(ct=ce,Ec(ce)):ct=null}break t}}Dt=0,er=null,Oa(e,t,S,5);break;case 6:Dt=0,er=null,Oa(e,t,S,6);break;case 8:yd(),Zt=6;break e;default:throw Error(a(462))}}XS();break}catch(ge){pv(e,ge)}while(!0);return nn=Es=null,F.H=o,F.A=p,Et=n,ct!==null?0:(jt=null,ht=0,ql(),Zt)}function XS(){for(;ct!==null&&!De();)yv(ct)}function yv(e){var t=qg(e.alternate,e,mn);e.memoizedProps=e.pendingProps,t===null?Ec(e):ct=t}function bv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hg(n,t,t.pendingProps,t.type,void 0,ht);break;case 11:t=Hg(n,t,t.pendingProps,t.type.render,t.ref,ht);break;case 5:Nh(t);default:Kg(n,t),t=ct=_p(t,mn),t=qg(n,t,mn)}e.memoizedProps=e.pendingProps,t===null?Ec(e):ct=t}function Oa(e,t,n,o){nn=Es=null,Nh(t),_a=null,wo=0;var p=t.return;try{if(PS(e,p,t,n,ht)){Zt=1,hc(e,or(n,e.current)),ct=null;return}}catch(S){if(p!==null)throw ct=p,S;Zt=1,hc(e,or(n,e.current)),ct=null;return}t.flags&32768?(gt||o===1?e=!0:xa||(ht&536870912)!==0?e=!1:(zn=e=!0,(o===2||o===9||o===3||o===6)&&(o=Zi.current,o!==null&&o.tag===13&&(o.flags|=16384))),Sv(t,e)):Ec(t)}function Ec(e){var t=e;do{if((t.flags&32768)!==0){Sv(t,zn);return}e=t.return;var n=IS(t.alternate,t,mn);if(n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);Zt===0&&(Zt=5)}function Sv(e,t){do{var n=FS(e.alternate,e);if(n!==null){n.flags&=32767,ct=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ct=e;return}ct=e=n}while(e!==null);Zt=6,ct=null}function wv(e,t,n,o,p,S,M,I,J){e.cancelPendingCommit=null;do xc();while(ui!==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,Oe(e,n,S,M,I,J),e===jt&&(ct=jt=null,ht=0),Ta=t,Fn=e,pn=n,gd=S,vd=p,hv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ew(Je,function(){return Tv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=F.T,F.T=null,p=Y.p,Y.p=2,M=Et,Et|=4;try{qS(e,t,n)}finally{Et=M,Y.p=p,F.T=o}}ui=1,Cv(),Ev(),xv()}}function Cv(){if(ui===1){ui=0;var e=Fn,t=Ta,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=F.T,F.T=null;var o=Y.p;Y.p=2;var p=Et;Et|=4;try{rv(t,e);var S=Md,M=cp(e.containerInfo),I=S.focusedElem,J=S.selectionRange;if(M!==I&&I&&I.ownerDocument&&lp(I.ownerDocument.documentElement,I)){if(J!==null&&rh(I)){var ce=J.start,ge=J.end;if(ge===void 0&&(ge=ce),"selectionStart"in I)I.selectionStart=ce,I.selectionEnd=Math.min(ge,I.value.length);else{var ye=I.ownerDocument||document,de=ye&&ye.defaultView||window;if(de.getSelection){var pe=de.getSelection(),Le=I.textContent.length,We=Math.min(J.start,Le),Nt=J.end===void 0?We:Math.min(J.end,Le);!pe.extend&&We>Nt&&(M=Nt,Nt=We,We=M);var ne=op(I,We),re=op(I,Nt);if(ne&&re&&(pe.rangeCount!==1||pe.anchorNode!==ne.node||pe.anchorOffset!==ne.offset||pe.focusNode!==re.node||pe.focusOffset!==re.offset)){var le=ye.createRange();le.setStart(ne.node,ne.offset),pe.removeAllRanges(),We>Nt?(pe.addRange(le),pe.extend(re.node,re.offset)):(le.setEnd(re.node,re.offset),pe.addRange(le))}}}}for(ye=[],pe=I;pe=pe.parentNode;)pe.nodeType===1&&ye.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<ye.length;I++){var ve=ye[I];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Hc=!!Ld,Md=Ld=null}finally{Et=p,Y.p=o,F.T=n}}e.current=t,ui=2}}function Ev(){if(ui===2){ui=0;var e=Fn,t=Ta,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=F.T,F.T=null;var o=Y.p;Y.p=2;var p=Et;Et|=4;try{Zg(e,t.alternate,t)}finally{Et=p,Y.p=o,F.T=n}}ui=3}}function xv(){if(ui===4||ui===3){ui=0,$e();var e=Fn,t=Ta,n=pn,o=hv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ui=5:(ui=0,Ta=Fn=null,Rv(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(In=null),_e(n),t=t.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(di,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=F.T,p=Y.p,Y.p=2,F.T=null;try{for(var S=e.onRecoverableError,M=0;M<o.length;M++){var I=o[M];S(I.value,{componentStack:I.stack})}}finally{F.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,Uo(0)}}function Rv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bo(t)))}function xc(){return Cv(),Ev(),xv(),Tv()}function Tv(){if(ui!==5)return!1;var e=Fn,t=gd;gd=0;var n=_e(pn),o=F.T,p=Y.p;try{Y.p=32>n?32:n,F.T=null,n=vd,vd=null;var S=Fn,M=pn;if(ui=0,Ta=Fn=null,pn=0,(Et&6)!==0)throw Error(a(331));var I=Et;if(Et|=4,lv(S.current),sv(S,S.current,M,n),Et=I,Uo(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(di,S)}catch{}return!0}finally{Y.p=p,F.T=o,Rv(e,t)}}function Dv(e,t,n){t=or(n,t),t=Xh(e.stateNode,t,2),e=Nn(e,t,2),e!==null&&(he(e,2),zr(e))}function Ot(e,t,n){if(e.tag===3)Dv(e,e,n);else for(;t!==null;){if(t.tag===3){Dv(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(In===null||!In.has(o))){e=or(n,e),n=Og(2),o=Nn(t,n,2),o!==null&&(Ag(n,o,t,e),he(o,2),zr(o));break}}t=t.return}}function Sd(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new VS;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=QS.bind(null,e,t,n),t.then(e,e))}function QS(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,jt===e&&(ht&n)===n&&(Zt===4||Zt===3&&(ht&62914560)===ht&&300>ze()-yc?(Et&2)===0&&Da(e,0):md|=n,Ra===ht&&(Ra=0)),zr(e)}function Ov(e,t){t===0&&(t=Vt()),e=Ss(e,t),e!==null&&(he(e,t),zr(e))}function ZS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ov(e,n)}function JS(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),Ov(e,n)}function ew(e,t){return ot(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,iw())}function Uo(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,I=o.pingedLanes;S=(1<<31-Ft(42|e)+1)-1,S&=p&~(M&~I),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(n=!0,kv(o,S))}else S=ht,S=Ve(o,o===jt?S:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(S&3)===0||Mt(o,S)||(n=!0,kv(o,S));o=o.next}while(n);Cd=!1}}function tw(){Av()}function Av(){Tc=wd=!1;var e=0;$n!==0&&dw()&&(e=$n);for(var t=ze(),n=null,o=Rc;o!==null;){var p=o.next,S=Lv(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}ui!==0&&ui!==5||Uo(e),$n!==0&&($n=0)}function Lv(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,p=e.expirationTimes,S=e.pendingLanes&-62914561;0<S;){var M=31-Ft(S),I=1<<M,J=p[M];J===-1?((I&n)===0||(I&o)!==0)&&(p[M]=Kt(I,t)):J<=t&&(e.expiredLanes|=I),S&=~I}if(t=jt,n=ht,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,n===0||e===t&&(Dt===2||Dt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ne(o),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(o!==null&&Ne(o),_e(n)){case 2:case 8:n=xt;break;case 32:n=Je;break;case 268435456:n=_t;break;default:n=Je}return o=Mv.bind(null,e),n=ot(n,o),e.callbackPriority=t,e.callbackNode=n,t}return o!==null&&o!==null&&Ne(o),e.callbackPriority=2,e.callbackNode=null,2}function Mv(e,t){if(ui!==0&&ui!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xc()&&e.callbackNode!==n)return null;var o=ht;return o=Ve(e,e===jt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(fv(e,o,t),Lv(e,ze()),e.callbackNode!=null&&e.callbackNode===n?Mv.bind(null,e):null)}function kv(e,t){if(xc())return null;fv(e,t,!0)}function iw(){mw(function(){(Et&6)!==0?ot(Ct,tw):Av()})}function Ed(){if($n===0){var e=pa;e===0&&(e=Ri,Ri<<=1,(Ri&261888)===0&&(Ri=256)),$n=e}return $n}function Bv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Nl(""+e)}function Nv(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 rw(e,t,n,o,p){if(t==="submit"&&n&&n.stateNode===p){var S=Bv((p[Te]||null).action),M=o.submitter;M&&(t=(t=M[Te]||null)?Bv(t.formAction):M.getAttribute("formAction"),t!==null&&(S=t,M=null));var I=new zl("action","action",null,o,p);e.push({event:I,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if($n!==0){var J=M?Nv(p,M):new FormData(p);$h(n,{pending:!0,data:J,method:p.method,action:S},null,J)}}else typeof S=="function"&&(I.preventDefault(),J=M?Nv(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],nw=Rd.toLowerCase(),sw=Rd[0].toUpperCase()+Rd.slice(1);Tr(nw,"on"+sw)}Tr(dp,"onAnimationEnd"),Tr(fp,"onAnimationIteration"),Tr(mp,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(SS,"onTransitionRun"),Tr(wS,"onTransitionStart"),Tr(CS,"onTransitionCancel"),Tr(pp,"onTransitionEnd"),nr("onMouseEnter",["mouseout","mouseover"]),nr("onMouseLeave",["mouseout","mouseover"]),nr("onPointerEnter",["pointerout","pointerover"]),nr("onPointerLeave",["pointerout","pointerover"]),xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xr("onBeforeInput",["compositionend","keypress","textInput","paste"]),xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="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(" "),aw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function jv(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 I=o[M],J=I.instance,ce=I.currentTarget;if(I=I.listener,J!==S&&p.isPropagationStopped())break e;S=I,p.currentTarget=ce;try{S(p)}catch(ge){Fl(ge)}p.currentTarget=null,S=J}else for(M=0;M<o.length;M++){if(I=o[M],J=I.instance,ce=I.currentTarget,I=I.listener,J!==S&&p.isPropagationStopped())break e;S=I,p.currentTarget=ce;try{S(p)}catch(ge){Fl(ge)}p.currentTarget=null,S=J}}}}function ut(e,t){var n=t[Ge];n===void 0&&(n=t[Ge]=new Set);var o=e+"__bubble";n.has(o)||(Hv(t,e,2,!1),n.add(o))}function Td(e,t,n){var o=0;t&&(o|=4),Hv(n,e,o,t)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function Dd(e){if(!e[Dc]){e[Dc]=!0,Er.forEach(function(n){n!=="selectionchange"&&(aw.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 Hv(e,t,n,o){switch(d_(t)){case 2:var p=Bw;break;case 8:p=Nw;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 I=o.stateNode.containerInfo;if(I===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(;I!==null;){if(M=Xt(I),M===null)return;if(J=M.tag,J===5||J===6||J===26||J===27){o=S=M;continue e}I=I.parentNode}}o=o.return}Fm(function(){var ce=S,ge=Vu(n),ye=[];e:{var de=gp.get(e);if(de!==void 0){var pe=zl,Le=e;switch(e){case"keypress":if(Hl(n)===0)break e;case"keydown":case"keyup":pe=J1;break;case"focusin":Le="focus",pe=Zu;break;case"focusout":Le="blur",pe=Zu;break;case"beforeblur":case"afterblur":pe=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":pe=Km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=I1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=iS;break;case dp:case fp:case mp:pe=$1;break;case pp:pe=nS;break;case"scroll":case"scrollend":pe=z1;break;case"wheel":pe=aS;break;case"copy":case"cut":case"paste":pe=V1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Wm;break;case"toggle":case"beforetoggle":pe=lS}var We=(t&4)!==0,Nt=!We&&(e==="scroll"||e==="scrollend"),ne=We?de!==null?de+"Capture":null:de;We=[];for(var re=ce,le;re!==null;){var ve=re;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||ne===null||(ve=lo(re,ne),ve!=null&&We.push(Fo(re,ve,le))),Nt)break;re=re.return}0<We.length&&(de=new pe(de,Le,null,n,ge),ye.push({event:de,listeners:We}))}}if((t&7)===0){e:{if(de=e==="mouseover"||e==="pointerover",pe=e==="mouseout"||e==="pointerout",de&&n!==Ku&&(Le=n.relatedTarget||n.fromElement)&&(Xt(Le)||Le[ke]))break e;if((pe||de)&&(de=ge.window===ge?ge:(de=ge.ownerDocument)?de.defaultView||de.parentWindow:window,pe?(Le=n.relatedTarget||n.toElement,pe=ce,Le=Le?Xt(Le):null,Le!==null&&(Nt=f(Le),We=Le.tag,Le!==Nt||We!==5&&We!==27&&We!==6)&&(Le=null)):(pe=null,Le=ce),pe!==Le)){if(We=Km,ve="onMouseLeave",ne="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(We=Wm,ve="onPointerLeave",ne="onPointerEnter",re="pointer"),Nt=pe==null?de:mi(pe),le=Le==null?de:mi(Le),de=new We(ve,re+"leave",pe,n,ge),de.target=Nt,de.relatedTarget=le,ve=null,Xt(ge)===ce&&(We=new We(ne,re+"enter",Le,n,ge),We.target=le,We.relatedTarget=Nt,ve=We),Nt=ve,pe&&Le)t:{for(We=ow,ne=pe,re=Le,le=0,ve=ne;ve;ve=We(ve))le++;ve=0;for(var qe=re;qe;qe=We(qe))ve++;for(;0<le-ve;)ne=We(ne),le--;for(;0<ve-le;)re=We(re),ve--;for(;le--;){if(ne===re||re!==null&&ne===re.alternate){We=ne;break t}ne=We(ne),re=We(re)}We=null}else We=null;pe!==null&&Pv(ye,de,pe,We,!1),Le!==null&&Nt!==null&&Pv(ye,Nt,Le,We,!0)}}e:{if(de=ce?mi(ce):window,pe=de.nodeName&&de.nodeName.toLowerCase(),pe==="select"||pe==="input"&&de.type==="file")var bt=tp;else if(Jm(de))if(ip)bt=_S;else{bt=gS;var Be=pS}else pe=de.nodeName,!pe||pe.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ce&&$u(ce.elementType)&&(bt=tp):bt=vS;if(bt&&(bt=bt(e,ce))){ep(ye,bt,n,ge);break e}Be&&Be(e,de,ce),e==="focusout"&&ce&&de.type==="number"&&ce.memoizedProps.value!=null&&qu(de,"number",de.value)}switch(Be=ce?mi(ce):window,e){case"focusin":(Jm(Be)||Be.contentEditable==="true")&&(oa=Be,nh=ce,vo=null);break;case"focusout":vo=nh=oa=null;break;case"mousedown":sh=!0;break;case"contextmenu":case"mouseup":case"dragend":sh=!1,up(ye,n,ge);break;case"selectionchange":if(bS)break;case"keydown":case"keyup":up(ye,n,ge)}var rt;if(eh)e:{switch(e){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else aa?Qm(e,n)&&(dt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(dt="onCompositionStart");dt&&(Ym&&n.locale!=="ko"&&(aa||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&aa&&(rt=qm()):(Dn=ge,Gu="value"in Dn?Dn.value:Dn.textContent,aa=!0)),Be=Oc(ce,dt),0<Be.length&&(dt=new Vm(dt,e,null,n,ge),ye.push({event:dt,listeners:Be}),rt?dt.data=rt:(rt=Zm(n),rt!==null&&(dt.data=rt)))),(rt=uS?hS(e,n):dS(e,n))&&(dt=Oc(ce,"onBeforeInput"),0<dt.length&&(Be=new Vm("onBeforeInput","beforeinput",null,n,ge),ye.push({event:Be,listeners:dt}),Be.data=rt)),rw(ye,e,ce,n,ge)}jv(ye,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 ow(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pv(e,t,n,o,p){for(var S=t._reactName,M=[];n!==null&&n!==o;){var I=n,J=I.alternate,ce=I.stateNode;if(I=I.tag,J!==null&&J===o)break;I!==5&&I!==26&&I!==27||ce===null||(J=ce,p?(ce=lo(n,S),ce!=null&&M.unshift(Fo(n,ce,J))):p||(ce=lo(n,S),ce!=null&&M.push(Fo(n,ce,J)))),n=n.return}M.length!==0&&e.push({event:t,listeners:M})}var lw=/\r\n?/g,cw=/\u0000|\uFFFD/g;function zv(e){return(typeof e=="string"?e:""+e).replace(lw,`
49
- `).replace(cw,"")}function Uv(e,t){return t=zv(t),zv(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":Rr(e,"class",o);break;case"tabIndex":Rr(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Rr(e,n,o);break;case"style":Um(e,o,S);break;case"data":if(t!=="object"){Rr(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&&ut("scroll",e);break;case"onScrollEnd":o!=null&&ut("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":ut("beforetoggle",e),ut("toggle",e),ei(e,"popover",o);break;case"xlinkActuate":yi(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":yi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":yi(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":yi(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":yi(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":yi(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":yi(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":yi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":yi(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ei(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=H1.get(n)||n,ei(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&&ut("scroll",e);break;case"onScrollEnd":o!=null&&ut("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(!Gi.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[Te]||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,""):ei(e,n,o)}}}function Ci(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",e),ut("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":ut("invalid",e);var I=S=M=p=null,J=null,ce=null;for(o in n)if(n.hasOwnProperty(o)){var ge=n[o];if(ge!=null)switch(o){case"name":p=ge;break;case"type":M=ge;break;case"checked":J=ge;break;case"defaultChecked":ce=ge;break;case"value":S=ge;break;case"defaultValue":I=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(a(137,t));break;default:Bt(e,t,o,ge,n,null)}}jm(e,S,I,J,ce,M,p,!1);return;case"select":ut("invalid",e),o=M=S=null;for(p in n)if(n.hasOwnProperty(p)&&(I=n[p],I!=null))switch(p){case"value":S=I;break;case"defaultValue":M=I;break;case"multiple":o=I;default:Bt(e,t,p,I,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":ut("invalid",e),S=p=o=null;for(M in n)if(n.hasOwnProperty(M)&&(I=n[M],I!=null))switch(M){case"value":o=I;break;case"defaultValue":p=I;break;case"children":S=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(a(91));break;default:Bt(e,t,M,I,n,null)}Pm(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":ut("beforetoggle",e),ut("toggle",e),ut("cancel",e),ut("close",e);break;case"iframe":case"object":ut("load",e);break;case"video":case"audio":for(o=0;o<Io.length;o++)ut(Io[o],e);break;case"image":ut("error",e),ut("load",e);break;case"details":ut("toggle",e);break;case"embed":case"source":case"link":ut("error",e),ut("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(ce in n)if(n.hasOwnProperty(ce)&&(o=n[ce],o!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Bt(e,t,ce,o,n,null)}return;default:if($u(t)){for(ge in n)n.hasOwnProperty(ge)&&(o=n[ge],o!==void 0&&Ad(e,t,ge,o,n,void 0));return}}for(I in n)n.hasOwnProperty(I)&&(o=n[I],o!=null&&Bt(e,t,I,o,n,null))}function uw(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,I=null,J=null,ce=null,ge=null;for(pe in n){var ye=n[pe];if(n.hasOwnProperty(pe)&&ye!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":J=ye;default:o.hasOwnProperty(pe)||Bt(e,t,pe,null,o,ye)}}for(var de in o){var pe=o[de];if(ye=n[de],o.hasOwnProperty(de)&&(pe!=null||ye!=null))switch(de){case"type":S=pe;break;case"name":p=pe;break;case"checked":ce=pe;break;case"defaultChecked":ge=pe;break;case"value":M=pe;break;case"defaultValue":I=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(a(137,t));break;default:pe!==ye&&Bt(e,t,de,pe,o,ye)}}Fu(e,M,I,J,ce,ge,S,p);return;case"select":pe=M=I=de=null;for(S in n)if(J=n[S],n.hasOwnProperty(S)&&J!=null)switch(S){case"value":break;case"multiple":pe=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":de=S;break;case"defaultValue":I=S;break;case"multiple":M=S;default:S!==J&&Bt(e,t,p,S,o,J)}t=I,n=M,o=pe,de!=null?ia(e,!!n,de,!1):!!o!=!!n&&(t!=null?ia(e,!!n,t,!0):ia(e,!!n,n?[]:"",!1));return;case"textarea":pe=de=null;for(I in n)if(p=n[I],n.hasOwnProperty(I)&&p!=null&&!o.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Bt(e,t,I,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":de=p;break;case"defaultValue":pe=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)}Hm(e,de,pe);return;case"option":for(var Le in n)if(de=n[Le],n.hasOwnProperty(Le)&&de!=null&&!o.hasOwnProperty(Le))switch(Le){case"selected":e.selected=!1;break;default:Bt(e,t,Le,null,o,de)}for(J in o)if(de=o[J],pe=n[J],o.hasOwnProperty(J)&&de!==pe&&(de!=null||pe!=null))switch(J){case"selected":e.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Bt(e,t,J,de,o,pe)}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)de=n[We],n.hasOwnProperty(We)&&de!=null&&!o.hasOwnProperty(We)&&Bt(e,t,We,null,o,de);for(ce in o)if(de=o[ce],pe=n[ce],o.hasOwnProperty(ce)&&de!==pe&&(de!=null||pe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,t));break;default:Bt(e,t,ce,de,o,pe)}return;default:if($u(t)){for(var Nt in n)de=n[Nt],n.hasOwnProperty(Nt)&&de!==void 0&&!o.hasOwnProperty(Nt)&&Ad(e,t,Nt,void 0,o,de);for(ge in o)de=o[ge],pe=n[ge],!o.hasOwnProperty(ge)||de===pe||de===void 0&&pe===void 0||Ad(e,t,ge,de,o,pe);return}}for(var ne in n)de=n[ne],n.hasOwnProperty(ne)&&de!=null&&!o.hasOwnProperty(ne)&&Bt(e,t,ne,null,o,de);for(ye in o)de=o[ye],pe=n[ye],!o.hasOwnProperty(ye)||de===pe||de==null&&pe==null||Bt(e,t,ye,de,o,pe)}function Iv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hw(){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,I=p.duration;if(S&&I&&Iv(M)){for(M=0,I=p.responseEnd,o+=1;o<n.length;o++){var J=n[o],ce=J.startTime;if(ce>I)break;var ge=J.transferSize,ye=J.initiatorType;ge&&Iv(ye)&&(J=J.responseEnd,M+=ge*(J<I?1:(I-ce)/(J-ce)))}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 Fv(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 qv(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 dw(){var e=window.event;return e&&e.type==="popstate"?e===Bd?!1:(Bd=e,!0):(Bd=null,!1)}var $v=typeof setTimeout=="function"?setTimeout:void 0,fw=typeof clearTimeout=="function"?clearTimeout:void 0,Kv=typeof Promise=="function"?Promise:void 0,mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Kv<"u"?function(e){return Kv.resolve(null).then(e).catch(pw)}:$v;function pw(e){setTimeout(function(){throw e})}function Kn(e){return e==="head"}function Vv(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,I=S.nodeName;S[Wt]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&S.rel.toLowerCase()==="stylesheet"||n.removeChild(S),S=M}}else n==="body"&&qo(e.ownerDocument.body);n=p}while(n);Ba(t)}function Wv(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),Gt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function gw(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[Wt])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 vw(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 Yv(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 _w(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 Gv(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 Xv(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 Qv(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]);Gt(e)}var fr=new Map,Zv=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:yw,r:bw,D:Sw,C:ww,L:Cw,m:Ew,X:Rw,S:xw,M:Tw};function yw(){var e=gn.f(),t=wc();return e||t}function bw(e){var t=ft(e);t!==null&&t.tag===5&&t.type==="form"?pg(t):gn.r(e)}var La=typeof document>"u"?null:document;function Jv(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+'"]'),Zv.has(p)||(Zv.add(p),e={rel:e,crossOrigin:n,href:t},o.querySelector(p)===null&&(t=o.createElement("link"),Ci(t,"link",e),qt(t),o.head.appendChild(t)))}}function Sw(e){gn.D(e),Jv("dns-prefetch",e,null)}function ww(e,t){gn.C(e,t),Jv("preconnect",e,t)}function Cw(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"),Ci(t,"link",e),qt(t),o.head.appendChild(t)))}}function Ew(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"),Ci(o,"link",e),qt(o),n.head.appendChild(o)}}}function xw(e,t,n){gn.S(e,t,n);var o=La;if(o&&e){var p=Pi(o).hoistableStyles,S=Ma(e);t=t||"default";var M=p.get(S);if(!M){var I={loading:0,preload:null};if(M=o.querySelector($o(S)))I.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");qt(J),Ci(J,"link",e),J._p=new Promise(function(ce,ge){J.onload=ce,J.onerror=ge}),J.addEventListener("load",function(){I.loading|=1}),J.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Mc(M,t,o)}M={type:"stylesheet",instance:M,count:1,state:I},p.set(S,M)}}}function Rw(e,t){gn.X(e,t);var n=La;if(n&&e){var o=Pi(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))&&Ud(e,t),S=n.createElement("script"),qt(S),Ci(S,"link",e),n.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(p,S))}}function Tw(e,t){gn.M(e,t);var n=La;if(n&&e){var o=Pi(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))&&Ud(e,t),S=n.createElement("script"),qt(S),Ci(S,"link",e),n.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(p,S))}}function e_(e,t,n,o){var p=(p=be.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=Pi(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=Pi(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||Dw(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=Pi(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 t_(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function Dw(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}),Ci(t,"link",n),qt(t),e.head.appendChild(t))}function ka(e){return'[src="'+sr(e)+'"]'}function Ko(e){return"script[async]"+e}function i_(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,qt(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"),qt(o),Ci(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,qt(S),S;o=t_(n),(p=fr.get(p))&&zd(o,p),S=(e.ownerDocument||e).createElement("link"),qt(S);var M=S;return M._p=new Promise(function(I,J){M.onload=I,M.onerror=J}),Ci(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,qt(p),p):(o=n,(p=fr.get(S))&&(o=d({},n),Ud(o,p)),e=e.ownerDocument||e,p=e.createElement("script"),qt(p),Ci(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 I=o[M];if(I.dataset.precedence===t)S=I;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 Ud(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 r_(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[Wt]||S[Re]||e==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(t)||"";M=e+M;var I=o.get(M);I?I.push(S):o.set(M,[S])}}return o}function n_(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Ow(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 s_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Aw(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,qt(S);return}S=t.ownerDocument||t,o=t_(o),(p=fr.get(p))&&zd(o,p),S=S.createElement("link"),qt(S);var M=S;M._p=new Promise(function(I,J){M.onload=I,M.onerror=J}),Ci(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 Id=0;function Lw(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&&Id===0&&(Id=62500*hw());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>Id?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(Mw,e),Nc=null,Bc.call(e))}function Mw(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 kw(e,t,n,o,p,S,M,I,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=Ti(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.hiddenUpdates=Ti(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 a_(e,t,n,o,p,S,M,I,J,ce,ge,ye){return e=new kw(e,t,n,M,J,ce,ge,ye,I),t=1,S===!0&&(t|=24),S=Qi(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 o_(e){return e?(e=ua,e):ua}function l_(e,t,n,o,p,S){p=o_(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&&($i(n,e,t),Eo(n,e,t))}function c_(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){c_(e,t),(e=e.alternate)&&c_(e,t)}function u_(e){if(e.tag===13||e.tag===31){var t=Ss(e,67108864);t!==null&&$i(t,e,67108864),Fd(e,67108864)}}function h_(e){if(e.tag===13||e.tag===31){var t=ir();t=oe(t);var n=Ss(e,t);n!==null&&$i(n,e,t),Fd(e,t)}}var Hc=!0;function Bw(e,t,n,o){var p=F.T;F.T=null;var S=Y.p;try{Y.p=2,qd(e,t,n,o)}finally{Y.p=S,F.T=p}}function Nw(e,t,n,o){var p=F.T;F.T=null;var S=Y.p;try{Y.p=8,qd(e,t,n,o)}finally{Y.p=S,F.T=p}}function qd(e,t,n,o){if(Hc){var p=$d(o);if(p===null)Od(e,t,o,Pc,n),f_(e,o);else if(Hw(p,e,t,n,o))o.stopPropagation();else if(f_(e,o),t&4&&-1<jw.indexOf(e)){for(;p!==null;){var S=ft(p);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=Hi(S.pendingLanes);if(M!==0){var I=S;for(I.pendingLanes|=2,I.entangledLanes|=2;M;){var J=1<<31-Ft(M);I.entanglements[1]|=J,M&=~J}zr(S),(Et&6)===0&&(bc=ze()+500,Uo(0))}}break;case 31:case 13:I=Ss(S,2),I!==null&&$i(I,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=Xt(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(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 d_(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(nt()){case Ct:return 2;case xt:return 8;case Je:case yt:return 32;case _t:return 268435456;default:return 32}default:return 32}}var Vd=!1,Vn=null,Wn=null,Yn=null,Wo=new Map,Yo=new Map,Gn=[],jw="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 f_(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=ft(t),t!==null&&u_(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function Hw(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 m_(e){var t=Xt(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,He(e.priority,function(){h_(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,He(e.priority,function(){h_(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=ft(n),t!==null&&u_(t),e.blockedOn=n,!1;t.shift()}return!0}function p_(e,t,n){zc(e)&&n.delete(t)}function Pw(){Vd=!1,Vn!==null&&zc(Vn)&&(Vn=null),Wn!==null&&zc(Wn)&&(Wn=null),Yn!==null&&zc(Yn)&&(Yn=null),Wo.forEach(p_),Yo.forEach(p_)}function Uc(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Pw)))}var Ic=null;function g_(e){Ic!==e&&(Ic=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ic===e&&(Ic=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=ft(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 Uc(J,e)}Vn!==null&&Uc(Vn,e),Wn!==null&&Uc(Wn,e),Yn!==null&&Uc(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);)m_(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[Te]||null;if(typeof S=="function")M||g_(n);else if(M){var I=null;if(S&&S.hasAttribute("formAction")){if(p=S,M=S[Te]||null)I=M.formAction;else if(Kd(p)!==null)continue}else I=M.action;typeof I=="function"?n[o+1]=I:(n.splice(o,3),o-=3),g_(n)}}}function v_(){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=ir();l_(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;l_(e.current,2,null,e,null,null),wc(),t[ke]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ce();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&&m_(e)}};var __=r.version;if(__!=="19.2.4")throw Error(a(527,__,"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 zw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{di=qc.inject(zw),Ye=qc}catch{}}return Qo.createRoot=function(e,t){if(!c(e))throw Error(a(299));var n=!1,o="",p=xg,S=Rg,M=Tg;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=a_(e,1,!1,null,null,n,o,null,p,S,M,v_),e[ke]=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=xg,M=Rg,I=Tg,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&&(I=n.onRecoverableError),n.formState!==void 0&&(J=n.formState)),t=a_(e,1,!0,t,n??null,o,p,J,S,M,I,v_),t.context=o_(null),n=t.current,o=ir(),o=oe(o),p=Bn(o),p.callback=null,Nn(n,p,o),n=o,t.current.lanes=n,he(t,n),zr(t),e[ke]=t.current,Dd(e),new Fc(t)},Qo.version="19.2.4",Qo}var U_;function kC(){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=MC(),Qd.exports}var BC=kC();/**
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 Fy=i=>{throw TypeError(i)},NC=(i,r,s)=>r.has(i)||Fy("Cannot "+s),tf=(i,r,s)=>(NC(i,r,"read from private field"),s?s.call(i):r.get(i)),jC=(i,r,s)=>r.has(i)?Fy("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,s),I_="popstate";function HC(i={}){function r(a,c){let{pathname:f,search:g,hash:l}=a.location;return pl("",{pathname:f,search:g,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 zC(r,s,null,i)}function at(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function ci(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function PC(){return Math.random().toString(36).substring(2,10)}function F_(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||PC()}}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 zC(i,r,s,a={}){let{window:c=document.defaultView,v5Compat:f=!1}=a,g=c.history,l="POP",u=null,h=b();h==null&&(h=0,g.replaceState({...g.state,idx:h},""));function b(){return(g.state||{idx:null}).idx}function d(){l="POP";let m=b(),v=m==null?null:m-h;h=m,u&&u({action:l,location:x.location,delta:v})}function w(m,v){l="PUSH";let _=pl(x.location,m,v);h=b()+1;let y=F_(_,h),E=x.createHref(_);try{g.pushState(y,"",E)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;c.location.assign(E)}f&&u&&u({action:l,location:x.location,delta:1})}function C(m,v){l="REPLACE";let _=pl(x.location,m,v);h=b();let y=F_(_,h),E=x.createHref(_);g.replaceState(y,"",E),f&&u&&u({action:l,location:x.location,delta:0})}function R(m){return qy(m)}let x={get action(){return l},get location(){return i(c,g)},listen(m){if(u)throw new Error("A history only accepts one active listener");return c.addEventListener(I_,d),u=m,()=>{c.removeEventListener(I_,d),u=null}},createHref(m){return r(c,m)},createURL:R,encodeLocation(m){let v=R(m);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:w,replace:C,go(m){return g.go(m)}};return x}function qy(i,r=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),at(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,q_=class{constructor(i){if(jC(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 IC(i){return UC.has(i)}var FC=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function qC(i){return FC.has(i)}function $C(i){return i.index===!0}function gl(i,r,s=[],a={},c=!1){return i.map((f,g)=>{let l=[...s,String(g)],u=typeof f.id=="string"?f.id:l.join("-");if(at(f.index!==!0||!f.children,"Cannot specify children on an index route"),at(c||!a[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),$C(f)){let h={...f,id:u};return a[u]=$_(h,r(h)),h}else{let h={...f,id:u,children:void 0};return a[u]=$_(h,r(h)),f.children&&(h.children=gl(f.children,r,l,a,c)),h}})}function $_(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 g=$y(i);VC(g);let l=null;for(let u=0;l==null&&u<g.length;++u){let h=Vy(f);l=tE(g[u],h,a)}return l}function KC(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 $y(i,r=[],s=[],a="",c=!1){let f=(g,l,u=c,h)=>{let b={relativePath:h===void 0?g.path||"":h,caseSensitive:g.caseSensitive===!0,childrenIndex:l,route:g};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;at(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);g.children&&g.children.length>0&&(at(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),$y(g.children,r,w,d,u)),!(g.path==null&&!g.index)&&r.push({path:d,score:JC(d,g.index),routesMeta:w})};return i.forEach((g,l)=>{var u;if(g.path===""||!((u=g.path)!=null&&u.includes("?")))f(g,l);else for(let h of Ky(g.path))f(g,l,!0,h)}),r}function Ky(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 g=Ky(a.join("/")),l=[];return l.push(...g.map(u=>u===""?f:[f,u].join("/"))),c&&l.push(...g),l.map(u=>i.startsWith("/")&&u===""?"/":u)}function VC(i){i.sort((r,s)=>r.score!==s.score?s.score-r.score:eE(r.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}var WC=/^:[\w-]+$/,YC=3,GC=2,XC=1,QC=10,ZC=-2,K_=i=>i==="*";function JC(i,r){let s=i.split("/"),a=s.length;return s.some(K_)&&(a+=ZC),r&&(a+=GC),s.filter(c=>!K_(c)).reduce((c,f)=>c+(WC.test(f)?YC:f===""?XC:QC),a)}function eE(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 tE(i,r,s=!1){let{routesMeta:a}=i,c={},f="/",g=[];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),g.push({params:c,pathname:Yr([f,d.pathname]),pathnameBase:sE(Yr([f,d.pathnameBase])),route:w}),d.pathnameBase!=="/"&&(f=Yr([f,d.pathnameBase]))}return g}function Zs(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[s,a]=iE(i.path,i.caseSensitive,i.end),c=r.match(s);if(!c)return null;let f=c[0],g=f.replace(/(.)\/+$/,"$1"),l=c.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:d},w)=>{if(b==="*"){let R=l[w]||"";g=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:g,pattern:i}}function iE(i,r=!1,s=!0){ci(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,(g,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 Vy(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return ci(!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 rE({basename:i,pathname:r}){return r==="/"?i:Yr([i,r])}var Wy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fm=i=>Wy.test(i);function nE(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=V_(s.substring(1),"/"):f=V_(s,r)):f=r,{pathname:f,search:aE(a),hash:oE(c)}}function V_(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 Yy(i){return i.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function mm(i){let r=Yy(i);return r.map((s,a)=>a===r.length-1?s.pathname:s.pathnameBase)}function pm(i,r,s,a=!1){let c;typeof i=="string"?c=fs(i):(c={...i},at(!c.pathname||!c.pathname.includes("?"),rf("?","pathname","search",c)),at(!c.pathname||!c.pathname.includes("#"),rf("#","pathname","hash",c)),at(!c.search||!c.search.includes("#"),rf("#","search","hash",c)));let f=i===""||c.pathname==="",g=f?"/":c.pathname,l;if(g==null)l=s;else{let d=r.length-1;if(!a&&g.startsWith("..")){let w=g.split("/");for(;w[0]==="..";)w.shift(),d-=1;c.pathname=w.join("/")}l=d>=0?r[d]:"/"}let u=nE(c,l),h=g&&g!=="/"&&g.endsWith("/"),b=(f||g===".")&&s.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var Yr=i=>i.join("/").replace(/\/\/+/g,"/"),sE=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),aE=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,oE=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 Gy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xy(i,r){let s=i;if(typeof s!="string"||!Wy.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let a=s,c=!1;if(Gy)try{let f=new URL(window.location.href),g=s.startsWith("//")?new URL(f.protocol+s):new URL(s),l=br(g.pathname,r);g.origin===f.origin&&l!=null?s=l+g.search+g.hash:c=!0}catch{ci(!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 lE(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 g=Object.keys(s);for(let l of g)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 g=c[f],l=s[`lazy.${f}`];if(typeof g=="function"&&l.length>0){let u=Pa(l,g,()=>{});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 g=f[us]??f,l=Pa(s[c],g,(...u)=>W_(u[0]));l&&(c==="loader"&&g.hydrate===!0&&(l.hydrate=!0),l[us]=g,a[c]=l)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(a.middleware=r.middleware.map(c=>{let f=c[us]??c,g=Pa(s.middleware,f,(...l)=>W_(l[0]));return g?(g[us]=f,g):c})),a}function cE(i,r){let s={navigate:[],fetch:[]};if(r.forEach(a=>a({instrument(c){let f=Object.keys(c);for(let g of f)c[g]&&s[g].push(c[g])}})),s.navigate.length>0){let a=i.navigate[us]??i.navigate,c=Pa(s.navigate,a,(...f)=>{let[g,l]=f;return{to:typeof g=="number"||typeof g=="string"?g:g?Gr(g):".",...Y_(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[g,,l,u]=f;return{href:l??".",fetcherKey:g,...Y_(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 Qy(i,s(...a),()=>r(...a),i.length-1);if(c.type==="error")throw c.value;return c.value}}async function Qy(i,r,s,a){let c=i[a],f;if(c){let g,l=async()=>(g?console.error("You cannot call instrumented handlers more than once"):g=Qy(i,r,s,a-1),f=await g,at(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)}g||await l(),await g}else try{f={type:"success",value:await s()}}catch(g){f={type:"error",value:g}}return f||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function W_(i){let{request:r,context:s,params:a,unstable_pattern:c}=i;return{request:uE(r),params:{...a},unstable_pattern:c,context:hE(s)}}function Y_(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 uE(i){return{method:i.method,url:i.url,headers:{get:(...r)=>i.headers.get(...r)}}}function hE(i){if(fE(i)){let r={...i};return Object.freeze(r),r}else return{get:r=>i.get(r)}}var dE=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fE(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")===dE}var Zy=["POST","PUT","PATCH","DELETE"],mE=new Set(Zy),pE=["GET",...Zy],gE=new Set(pE),Jy=new Set([301,302,303,307,308]),vE=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},_E={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},yE=i=>({hasErrorBoundary:!!i.hasErrorBoundary}),eb="remix-router-transitions",tb=Symbol("ResetLoaderData");function bE(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";at(i.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=i.hydrationRouteProperties||[],c=i.mapRouteProperties||yE,f=c;if(i.unstable_instrumentations){let W=i.unstable_instrumentations;f=ie=>({...c(ie),...lE(W.map(oe=>oe.route).filter(Boolean),ie)})}let g={},l=gl(i.routes,f,void 0,g),u,h=i.basename||"/";h.startsWith("/")||(h=`/${h}`);let b=i.dataStrategy||xE,d={...i.future},w=null,C=new Set,R=null,x=null,m=null,v=i.hydrationData!=null,_=Jn(l,i.history.location,h),y=!1,E=null,D;if(_==null&&!i.patchRoutesOnNavigation){let W=gr(404,{pathname:i.history.location.pathname}),{matches:ie,route:oe}=Vc(l);D=!0,_=ie,E={[oe.id]:W}}else if(_&&!i.hydrationData&&Vt(_,l,i.history.location.pathname).active&&(_=null),_)if(_.some(W=>W.route.lazy))D=!1;else if(!_.some(W=>gm(W.route)))D=!0;else{let W=i.hydrationData?i.hydrationData.loaderData:null,ie=i.hydrationData?i.hydrationData.errors:null;if(ie){let oe=_.findIndex(_e=>ie[_e.route.id]!==void 0);D=_.slice(0,oe+1).every(_e=>!Pf(_e.route,W,ie))}else D=_.every(oe=>!Pf(oe.route,W,ie))}else{D=!1,_=[];let W=Vt(null,l,i.history.location.pathname);W.active&&W.matches&&(y=!0,_=W.matches)}let A,O={historyAction:i.history.action,location:i.history.location,matches:_,initialized:D,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},T="POP",L=null,U=!1,V,j=!1,$=new Map,Z=null,X=!1,F=!1,Y=new Set,k=new Map,z=0,K=-1,B=new Map,q=new Set,Q=new Map,te=new Map,se=new Set,be=new Map,H,G=null;function ae(){if(w=i.history.listen(({action:W,location:ie,delta:oe})=>{if(H){H(),H=void 0;return}ci(be.size===0||oe!=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 _e=Ni({currentLocation:O.location,nextLocation:ie,historyAction:W});if(_e&&oe!=null){let Ce=new Promise(He=>{H=He});i.history.go(oe*-1),Ri(_e,{state:"blocked",location:ie,proceed(){Ri(_e,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),Ce.then(()=>i.history.go(oe))},reset(){let He=new Map(O.blockers);He.set(_e,Zo),ue({blockers:He})}}),L==null||L.resolve(),L=null;return}return Ee(W,ie)}),s){qE(r,$);let W=()=>$E(r,$);r.addEventListener("pagehide",W),Z=()=>r.removeEventListener("pagehide",W)}return O.initialized||Ee("POP",O.location,{initialHydration:!0}),A}function fe(){w&&w(),Z&&Z(),C.clear(),V&&V.abort(),O.fetchers.forEach((W,ie)=>et(ie)),O.blockers.forEach((W,ie)=>ri(ie))}function me(W){return C.add(W),()=>C.delete(W)}function ue(W,ie={}){W.matches&&(W.matches=W.matches.map(Ce=>{let He=g[Ce.route.id],Me=Ce.route;return Me.element!==He.element||Me.errorElement!==He.errorElement||Me.hydrateFallbackElement!==He.hydrateFallbackElement?{...Ce,route:He}:Ce})),O={...O,...W};let oe=[],_e=[];O.fetchers.forEach((Ce,He)=>{Ce.state==="idle"&&(se.has(He)?oe.push(He):_e.push(He))}),se.forEach(Ce=>{!O.fetchers.has(Ce)&&!k.has(Ce)&&oe.push(Ce)}),[...C].forEach(Ce=>Ce(O,{deletedFetchers:oe,newErrors:W.errors??null,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),oe.forEach(Ce=>et(Ce)),_e.forEach(Ce=>O.fetchers.delete(Ce))}function we(W,ie,{flushSync:oe}={}){var Ge,Ue;let _e=O.actionData!=null&&O.navigation.formMethod!=null&&Ai(O.navigation.formMethod)&&O.navigation.state==="loading"&&((Ge=W.state)==null?void 0:Ge._isRedirect)!==!0,Ce;ie.actionData?Object.keys(ie.actionData).length>0?Ce=ie.actionData:Ce=null:_e?Ce=O.actionData:Ce=null;let He=ie.loaderData?n0(O.loaderData,ie.loaderData,ie.matches||[],ie.errors):O.loaderData,Me=O.blockers;Me.size>0&&(Me=new Map(Me),Me.forEach((Ze,lt)=>Me.set(lt,Zo)));let Re=X?!1:Kt(W,ie.matches||O.matches),Te=U===!0||O.navigation.formMethod!=null&&Ai(O.navigation.formMethod)&&((Ue=W.state)==null?void 0:Ue._isRedirect)!==!0;u&&(l=u,u=void 0),X||T==="POP"||(T==="PUSH"?i.history.push(W,W.state):T==="REPLACE"&&i.history.replace(W,W.state));let ke;if(T==="POP"){let Ze=$.get(O.location.pathname);Ze&&Ze.has(W.pathname)?ke={currentLocation:O.location,nextLocation:W}:$.has(W.pathname)&&(ke={currentLocation:W,nextLocation:O.location})}else if(j){let Ze=$.get(O.location.pathname);Ze?Ze.add(W.pathname):(Ze=new Set([W.pathname]),$.set(O.location.pathname,Ze)),ke={currentLocation:O.location,nextLocation:W}}ue({...ie,actionData:Ce,loaderData:He,historyAction:T,location:W,initialized:!0,navigation:nf,revalidation:"idle",restoreScrollPosition:Re,preventScrollReset:Te,blockers:Me},{viewTransitionOpts:ke,flushSync:oe===!0}),T="POP",U=!1,j=!1,X=!1,F=!1,L==null||L.resolve(),L=null,G==null||G.resolve(),G=null}async function Ke(W,ie){if(L==null||L.resolve(),L=null,typeof W=="number"){L||(L=l0());let lt=L.promise;return i.history.go(W),lt}let oe=Hf(O.location,O.matches,h,W,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:_e,submission:Ce,error:He}=G_(!1,oe,ie),Me=O.location,Re=pl(O.location,_e,ie&&ie.state);Re={...Re,...i.history.encodeLocation(Re)};let Te=ie&&ie.replace!=null?ie.replace:void 0,ke="PUSH";Te===!0?ke="REPLACE":Te===!1||Ce!=null&&Ai(Ce.formMethod)&&Ce.formAction===O.location.pathname+O.location.search&&(ke="REPLACE");let Ge=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,Ue=(ie&&ie.flushSync)===!0,Ze=Ni({currentLocation:Me,nextLocation:Re,historyAction:ke});if(Ze){Ri(Ze,{state:"blocked",location:Re,proceed(){Ri(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:Re}),Ke(W,ie)},reset(){let lt=new Map(O.blockers);lt.set(Ze,Zo),ue({blockers:lt})}});return}await Ee(ke,Re,{submission:Ce,pendingError:He,preventScrollReset:Ge,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:Ue,callSiteDefaultShouldRevalidate:ie&&ie.unstable_defaultShouldRevalidate})}function Pe(){G||(G=l0()),xt(),ue({revalidation:"loading"});let W=G.promise;return O.navigation.state==="submitting"?W:O.navigation.state==="idle"?(Ee(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),W):(Ee(T||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:j===!0}),W)}async function Ee(W,ie,oe){V&&V.abort(),V=null,T=W,X=(oe&&oe.startUninterruptedRevalidation)===!0,Mt(O.location,O.matches),U=(oe&&oe.preventScrollReset)===!0,j=(oe&&oe.enableViewTransition)===!0;let _e=u||l,Ce=oe&&oe.overrideNavigation,He=oe!=null&&oe.initialHydration&&O.matches&&O.matches.length>0&&!y?O.matches:Jn(_e,ie,h),Me=(oe&&oe.flushSync)===!0;if(He&&O.initialized&&!F&&kE(O.location,ie)&&!(oe&&oe.submission&&Ai(oe.submission.formMethod))){we(ie,{matches:He},{flushSync:Me});return}let Re=Vt(He,_e,ie.pathname);if(Re.active&&Re.matches&&(He=Re.matches),!He){let{error:Gt,notFoundMatches:Xt,route:ft}=ji(ie.pathname);we(ie,{matches:Xt,loaderData:{},errors:{[ft.id]:Gt}},{flushSync:Me});return}V=new AbortController;let Te=ja(i.history,ie,V.signal,oe&&oe.submission),ke=i.getContext?await i.getContext():new q_,Ge;if(oe&&oe.pendingError)Ge=[es(He).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&Ai(oe.submission.formMethod)){let Gt=await Se(Te,ie,oe.submission,He,ke,Re.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:Me});if(Gt.shortCircuited)return;if(Gt.pendingActionResult){let[Xt,ft]=Gt.pendingActionResult;if(rr(ft)&&vl(ft.error)&&ft.error.status===404){V=null,we(ie,{matches:Gt.matches,loaderData:{},errors:{[Xt]:ft.error}});return}}He=Gt.matches||He,Ge=Gt.pendingActionResult,Ce=sf(ie,oe.submission),Me=!1,Re.active=!1,Te=ja(i.history,Te.url,Te.signal)}let{shortCircuited:Ue,matches:Ze,loaderData:lt,errors:Wt}=await Ie(Te,ie,He,ke,Re.active,Ce,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,Me,Ge,oe&&oe.callSiteDefaultShouldRevalidate);Ue||(V=null,we(ie,{matches:Ze||He,...s0(Ge),loaderData:lt,errors:Wt}))}async function Se(W,ie,oe,_e,Ce,He,Me,Re={}){xt();let Te=IE(ie,oe);if(ue({navigation:Te},{flushSync:Re.flushSync===!0}),He){let Ue=await Ti(_e,ie.pathname,W.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){if(Ue.partialMatches.length===0){let{matches:lt,route:Wt}=Vc(l);return{matches:lt,pendingActionResult:[Wt.id,{type:"error",error:Ue.error}]}}let Ze=es(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,pendingActionResult:[Ze,{type:"error",error:Ue.error}]}}else if(Ue.matches)_e=Ue.matches;else{let{notFoundMatches:Ze,error:lt,route:Wt}=ji(ie.pathname);return{matches:Ze,pendingActionResult:[Wt.id,{type:"error",error:lt}]}}}let ke,Ge=nu(_e,ie);if(!Ge.route.action&&!Ge.route.lazy)ke={type:"error",error:gr(405,{method:W.method,pathname:ie.pathname,routeId:Ge.route.id})};else{let Ue=za(f,g,W,_e,Ge,Me?[]:a,Ce),Ze=await nt(W,Ue,Ce,null);if(ke=Ze[Ge.route.id],!ke){for(let lt of _e)if(Ze[lt.route.id]){ke=Ze[lt.route.id];break}}if(W.signal.aborted)return{shortCircuited:!0}}if(Ps(ke)){let Ue;return Re&&Re.replace!=null?Ue=Re.replace:Ue=t0(ke.response.headers.get("Location"),new URL(W.url),h,i.history)===O.location.pathname+O.location.search,await ze(W,ke,!0,{submission:oe,replace:Ue}),{shortCircuited:!0}}if(rr(ke)){let Ue=es(_e,Ge.route.id);return(Re&&Re.replace)!==!0&&(T="PUSH"),{matches:_e,pendingActionResult:[Ue.route.id,ke,Ge.route.id]}}return{matches:_e,pendingActionResult:[Ge.route.id,ke]}}async function Ie(W,ie,oe,_e,Ce,He,Me,Re,Te,ke,Ge,Ue,Ze){let lt=He||sf(ie,Me),Wt=Me||Re||o0(lt),Gt=!X&&!ke;if(Ce){if(Gt){let ei=je(Ue);ue({navigation:lt,...ei!==void 0?{actionData:ei}:{}},{flushSync:Ge})}let mt=await Ti(oe,ie.pathname,W.signal);if(mt.type==="aborted")return{shortCircuited:!0};if(mt.type==="error"){if(mt.partialMatches.length===0){let{matches:Rr,route:yi}=Vc(l);return{matches:Rr,loaderData:{},errors:{[yi.id]:mt.error}}}let ei=es(mt.partialMatches).route.id;return{matches:mt.partialMatches,loaderData:{},errors:{[ei]:mt.error}}}else if(mt.matches)oe=mt.matches;else{let{error:ei,notFoundMatches:Rr,route:yi}=ji(ie.pathname);return{matches:Rr,loaderData:{},errors:{[yi.id]:ei}}}}let Xt=u||l,{dsMatches:ft,revalidatingFetchers:mi}=X_(W,_e,f,g,i.history,O,oe,Wt,ie,ke?[]:a,ke===!0,F,Y,se,Q,q,Xt,h,i.patchRoutesOnNavigation!=null,Ue,Ze);if(K=++z,!i.dataStrategy&&!ft.some(mt=>mt.shouldLoad)&&!ft.some(mt=>mt.route.middleware&&mt.route.middleware.length>0)&&mi.length===0){let mt=Ft();return we(ie,{matches:oe,loaderData:{},errors:Ue&&rr(Ue[1])?{[Ue[0]]:Ue[1].error}:null,...s0(Ue),...mt?{fetchers:new Map(O.fetchers)}:{}},{flushSync:Ge}),{shortCircuited:!0}}if(Gt){let mt={};if(!Ce){mt.navigation=lt;let ei=je(Ue);ei!==void 0&&(mt.actionData=ei)}mi.length>0&&(mt.fetchers=ot(mi)),ue(mt,{flushSync:Ge})}mi.forEach(mt=>{Ye(mt.key),mt.controller&&k.set(mt.key,mt.controller)});let Pi=()=>mi.forEach(mt=>Ye(mt.key));V&&V.signal.addEventListener("abort",Pi);let{loaderResults:qt,fetcherResults:Er}=await Ct(ft,mi,W,_e);if(W.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Pi),mi.forEach(mt=>k.delete(mt.key));let Gi=Wc(qt);if(Gi)return await ze(W,Gi.result,!0,{replace:Te}),{shortCircuited:!0};if(Gi=Wc(Er),Gi)return q.add(Gi.key),await ze(W,Gi.result,!0,{replace:Te}),{shortCircuited:!0};let{loaderData:xr,errors:nr}=r0(O,oe,qt,Ue,mi,Er);ke&&O.errors&&(nr={...O.errors,...nr});let Zr=Ft(),ps=Cr(K),gs=Zr||ps||mi.length>0;return{matches:oe,loaderData:xr,errors:nr,...gs?{fetchers:new Map(O.fetchers)}:{}}}function je(W){if(W&&!rr(W[1]))return{[W[0]]:W[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function ot(W){return W.forEach(ie=>{let oe=O.fetchers.get(ie.key),_e=Jo(void 0,oe?oe.data:void 0);O.fetchers.set(ie.key,_e)}),new Map(O.fetchers)}async function Ne(W,ie,oe,_e){Ye(W);let Ce=(_e&&_e.flushSync)===!0,He=u||l,Me=Hf(O.location,O.matches,h,oe,ie,_e==null?void 0:_e.relative),Re=Jn(He,Me,h),Te=Vt(Re,He,Me);if(Te.active&&Te.matches&&(Re=Te.matches),!Re){yt(W,ie,gr(404,{pathname:Me}),{flushSync:Ce});return}let{path:ke,submission:Ge,error:Ue}=G_(!0,Me,_e);if(Ue){yt(W,ie,Ue,{flushSync:Ce});return}let Ze=i.getContext?await i.getContext():new q_,lt=(_e&&_e.preventScrollReset)===!0;if(Ge&&Ai(Ge.formMethod)){await De(W,ie,ke,Re,Ze,Te.active,Ce,lt,Ge,_e&&_e.unstable_defaultShouldRevalidate);return}Q.set(W,{routeId:ie,path:ke}),await $e(W,ie,ke,Re,Ze,Te.active,Ce,lt,Ge)}async function De(W,ie,oe,_e,Ce,He,Me,Re,Te,ke){xt(),Q.delete(W);let Ge=O.fetchers.get(W);Je(W,FE(Te,Ge),{flushSync:Me});let Ue=new AbortController,Ze=ja(i.history,oe,Ue.signal,Te);if(He){let pt=await Ti(_e,new URL(Ze.url).pathname,Ze.signal,W);if(pt.type==="aborted")return;if(pt.type==="error"){yt(W,ie,pt.error,{flushSync:Me});return}else if(pt.matches)_e=pt.matches;else{yt(W,ie,gr(404,{pathname:oe}),{flushSync:Me});return}}let lt=nu(_e,oe);if(!lt.route.action&&!lt.route.lazy){let pt=gr(405,{method:Te.formMethod,pathname:oe,routeId:ie});yt(W,ie,pt,{flushSync:Me});return}k.set(W,Ue);let Wt=z,Gt=za(f,g,Ze,_e,lt,a,Ce),Xt=await nt(Ze,Gt,Ce,W),ft=Xt[lt.route.id];if(!ft){for(let pt of Gt)if(Xt[pt.route.id]){ft=Xt[pt.route.id];break}}if(Ze.signal.aborted){k.get(W)===Ue&&k.delete(W);return}if(se.has(W)){if(Ps(ft)||rr(ft)){Je(W,_n(void 0));return}}else{if(Ps(ft))if(k.delete(W),K>Wt){Je(W,_n(void 0));return}else return q.add(W),Je(W,Jo(Te)),ze(Ze,ft,!1,{fetcherSubmission:Te,preventScrollReset:Re});if(rr(ft)){yt(W,ie,ft.error);return}}let mi=O.navigation.location||O.location,Pi=ja(i.history,mi,Ue.signal),qt=u||l,Er=O.navigation.state!=="idle"?Jn(qt,O.navigation.location,h):O.matches;at(Er,"Didn't find any matches after fetcher action");let Gi=++z;B.set(W,Gi);let xr=Jo(Te,ft.data);O.fetchers.set(W,xr);let{dsMatches:nr,revalidatingFetchers:Zr}=X_(Pi,Ce,f,g,i.history,O,Er,Te,mi,a,!1,F,Y,se,Q,q,qt,h,i.patchRoutesOnNavigation!=null,[lt.route.id,ft],ke);Zr.filter(pt=>pt.key!==W).forEach(pt=>{let vs=pt.key,kl=O.fetchers.get(vs),oo=Jo(void 0,kl?kl.data:void 0);O.fetchers.set(vs,oo),Ye(vs),pt.controller&&k.set(vs,pt.controller)}),ue({fetchers:new Map(O.fetchers)});let ps=()=>Zr.forEach(pt=>Ye(pt.key));Ue.signal.addEventListener("abort",ps);let{loaderResults:gs,fetcherResults:mt}=await Ct(nr,Zr,Pi,Ce);if(Ue.signal.aborted)return;if(Ue.signal.removeEventListener("abort",ps),B.delete(W),k.delete(W),Zr.forEach(pt=>k.delete(pt.key)),O.fetchers.has(W)){let pt=_n(ft.data);O.fetchers.set(W,pt)}let ei=Wc(gs);if(ei)return ze(Pi,ei.result,!1,{preventScrollReset:Re});if(ei=Wc(mt),ei)return q.add(ei.key),ze(Pi,ei.result,!1,{preventScrollReset:Re});let{loaderData:Rr,errors:yi}=r0(O,Er,gs,void 0,Zr,mt);Cr(Gi),O.navigation.state==="loading"&&Gi>K?(at(T,"Expected pending action"),V&&V.abort(),we(O.navigation.location,{matches:Er,loaderData:Rr,errors:yi,fetchers:new Map(O.fetchers)})):(ue({errors:yi,loaderData:n0(O.loaderData,Rr,Er,yi),fetchers:new Map(O.fetchers)}),F=!1)}async function $e(W,ie,oe,_e,Ce,He,Me,Re,Te){let ke=O.fetchers.get(W);Je(W,Jo(Te,ke?ke.data:void 0),{flushSync:Me});let Ge=new AbortController,Ue=ja(i.history,oe,Ge.signal);if(He){let ft=await Ti(_e,new URL(Ue.url).pathname,Ue.signal,W);if(ft.type==="aborted")return;if(ft.type==="error"){yt(W,ie,ft.error,{flushSync:Me});return}else if(ft.matches)_e=ft.matches;else{yt(W,ie,gr(404,{pathname:oe}),{flushSync:Me});return}}let Ze=nu(_e,oe);k.set(W,Ge);let lt=z,Wt=za(f,g,Ue,_e,Ze,a,Ce),Xt=(await nt(Ue,Wt,Ce,W))[Ze.route.id];if(k.get(W)===Ge&&k.delete(W),!Ue.signal.aborted){if(se.has(W)){Je(W,_n(void 0));return}if(Ps(Xt))if(K>lt){Je(W,_n(void 0));return}else{q.add(W),await ze(Ue,Xt,!1,{preventScrollReset:Re});return}if(rr(Xt)){yt(W,ie,Xt.error);return}Je(W,_n(Xt.data))}}async function ze(W,ie,oe,{submission:_e,fetcherSubmission:Ce,preventScrollReset:He,replace:Me}={}){oe||(L==null||L.resolve(),L=null),ie.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Re=ie.response.headers.get("Location");at(Re,"Expected a Location header on the redirect Response"),Re=t0(Re,new URL(W.url),h,i.history);let Te=pl(O.location,Re,{_isRedirect:!0});if(s){let Wt=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))Wt=!0;else if(fm(Re)){const Gt=qy(Re,!0);Wt=Gt.origin!==r.location.origin||br(Gt.pathname,h)==null}if(Wt){Me?r.location.replace(Re):r.location.assign(Re);return}}V=null;let ke=Me===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ge,formAction:Ue,formEncType:Ze}=O.navigation;!_e&&!Ce&&Ge&&Ue&&Ze&&(_e=o0(O.navigation));let lt=_e||Ce;if(vE.has(ie.response.status)&&lt&&Ai(lt.formMethod))await Ee(ke,Te,{submission:{...lt,formAction:Re},preventScrollReset:He||U,enableViewTransition:oe?j:void 0});else{let Wt=sf(Te,_e);await Ee(ke,Te,{overrideNavigation:Wt,fetcherSubmission:Ce,preventScrollReset:He||U,enableViewTransition:oe?j:void 0})}}async function nt(W,ie,oe,_e){var Me;let Ce,He={};try{Ce=await TE(b,W,ie,_e,oe,!1)}catch(Re){return ie.filter(Te=>Te.shouldLoad).forEach(Te=>{He[Te.route.id]={type:"error",error:Re}}),He}if(W.signal.aborted)return He;if(!Ai(W.method))for(let Re of ie){if(((Me=Ce[Re.route.id])==null?void 0:Me.type)==="error")break;!Ce.hasOwnProperty(Re.route.id)&&!O.loaderData.hasOwnProperty(Re.route.id)&&(!O.errors||!O.errors.hasOwnProperty(Re.route.id))&&Re.shouldCallHandler()&&(Ce[Re.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Re.route.id}`)})}for(let[Re,Te]of Object.entries(Ce))if(HE(Te)){let ke=Te.result;He[Re]={type:"redirect",response:LE(ke,W,Re,ie,h)}}else He[Re]=await AE(Te);return He}async function Ct(W,ie,oe,_e){let Ce=nt(oe,W,_e,null),He=Promise.all(ie.map(async Te=>{if(Te.matches&&Te.match&&Te.request&&Te.controller){let Ge=(await nt(Te.request,Te.matches,_e,Te.key))[Te.match.route.id];return{[Te.key]:Ge}}else return Promise.resolve({[Te.key]:{type:"error",error:gr(404,{pathname:Te.path})}})})),Me=await Ce,Re=(await He).reduce((Te,ke)=>Object.assign(Te,ke),{});return{loaderResults:Me,fetcherResults:Re}}function xt(){F=!0,Q.forEach((W,ie)=>{k.has(ie)&&Y.add(ie),Ye(ie)})}function Je(W,ie,oe={}){O.fetchers.set(W,ie),ue({fetchers:new Map(O.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function yt(W,ie,oe,_e={}){let Ce=es(O.matches,ie);et(W),ue({errors:{[Ce.route.id]:oe},fetchers:new Map(O.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function _t(W){return te.set(W,(te.get(W)||0)+1),se.has(W)&&se.delete(W),O.fetchers.get(W)||_E}function Pt(W,ie){Ye(W,ie==null?void 0:ie.reason),Je(W,_n(null))}function et(W){let ie=O.fetchers.get(W);k.has(W)&&!(ie&&ie.state==="loading"&&B.has(W))&&Ye(W),Q.delete(W),B.delete(W),q.delete(W),se.delete(W),Y.delete(W),O.fetchers.delete(W)}function di(W){let ie=(te.get(W)||0)-1;ie<=0?(te.delete(W),se.add(W)):te.set(W,ie),ue({fetchers:new Map(O.fetchers)})}function Ye(W,ie){let oe=k.get(W);oe&&(oe.abort(ie),k.delete(W))}function _i(W){for(let ie of W){let oe=_t(ie),_e=_n(oe.data);O.fetchers.set(ie,_e)}}function Ft(){let W=[],ie=!1;for(let oe of q){let _e=O.fetchers.get(oe);at(_e,`Expected fetcher: ${oe}`),_e.state==="loading"&&(q.delete(oe),W.push(oe),ie=!0)}return _i(W),ie}function Cr(W){let ie=[];for(let[oe,_e]of B)if(_e<W){let Ce=O.fetchers.get(oe);at(Ce,`Expected fetcher: ${oe}`),Ce.state==="loading"&&(Ye(oe),B.delete(oe),ie.push(oe))}return _i(ie),ie.length>0}function fi(W,ie){let oe=O.blockers.get(W)||Zo;return be.get(W)!==ie&&be.set(W,ie),oe}function ri(W){O.blockers.delete(W),be.delete(W)}function Ri(W,ie){let oe=O.blockers.get(W)||Zo;at(oe.state==="unblocked"&&ie.state==="blocked"||oe.state==="blocked"&&ie.state==="blocked"||oe.state==="blocked"&&ie.state==="proceeding"||oe.state==="blocked"&&ie.state==="unblocked"||oe.state==="proceeding"&&ie.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${ie.state}`);let _e=new Map(O.blockers);_e.set(W,ie),ue({blockers:_e})}function Ni({currentLocation:W,nextLocation:ie,historyAction:oe}){if(be.size===0)return;be.size>1&&ci(!1,"A router only supports one blocker at a time");let _e=Array.from(be.entries()),[Ce,He]=_e[_e.length-1],Me=O.blockers.get(Ce);if(!(Me&&Me.state==="proceeding")&&He({currentLocation:W,nextLocation:ie,historyAction:oe}))return Ce}function ji(W){let ie=gr(404,{pathname:W}),oe=u||l,{matches:_e,route:Ce}=Vc(oe);return{notFoundMatches:_e,route:Ce,error:ie}}function Hi(W,ie,oe){if(R=W,m=ie,x=oe||null,!v&&O.navigation===nf){v=!0;let _e=Kt(O.location,O.matches);_e!=null&&ue({restoreScrollPosition:_e})}return()=>{R=null,m=null,x=null}}function Ve(W,ie){return x&&x(W,ie.map(_e=>KC(_e,O.loaderData)))||W.key}function Mt(W,ie){if(R&&m){let oe=Ve(W,ie);R[oe]=m()}}function Kt(W,ie){if(R){let oe=Ve(W,ie),_e=R[oe];if(typeof _e=="number")return _e}return null}function Vt(W,ie,oe){if(i.patchRoutesOnNavigation)if(W){if(Object.keys(W[0].params).length>0)return{active:!0,matches:sl(ie,oe,h,!0)}}else return{active:!0,matches:sl(ie,oe,h,!0)||[]};return{active:!1,matches:null}}async function Ti(W,ie,oe,_e){if(!i.patchRoutesOnNavigation)return{type:"success",matches:W};let Ce=W;for(;;){let He=u==null,Me=u||l,Re=g;try{await i.patchRoutesOnNavigation({signal:oe,path:ie,matches:Ce,fetcherKey:_e,patch:(Ge,Ue)=>{oe.aborted||Q_(Ge,Ue,Me,Re,f,!1)}})}catch(Ge){return{type:"error",error:Ge,partialMatches:Ce}}finally{He&&!oe.aborted&&(l=[...l])}if(oe.aborted)return{type:"aborted"};let Te=Jn(Me,ie,h),ke=null;if(Te){if(Object.keys(Te[0].params).length===0)return{type:"success",matches:Te};if(ke=sl(Me,ie,h,!0),!(ke&&Ce.length<ke.length&&he(Ce,ke.slice(0,Ce.length))))return{type:"success",matches:Te}}if(ke||(ke=sl(Me,ie,h,!0)),!ke||he(Ce,ke))return{type:"success",matches:null};Ce=ke}}function he(W,ie){return W.length===ie.length&&W.every((oe,_e)=>oe.route.id===ie[_e].route.id)}function Oe(W){g={},u=gl(W,f,void 0,g)}function tt(W,ie,oe=!1){let _e=u==null;Q_(W,ie,u||l,g,f,oe),_e&&(l=[...l],ue({}))}return A={get basename(){return h},get future(){return d},get state(){return O},get routes(){return l},get window(){return r},initialize:ae,subscribe:me,enableScrollRestoration:Hi,navigate:Ke,fetch:Ne,revalidate:Pe,createHref:W=>i.history.createHref(W),encodeLocation:W=>i.history.encodeLocation(W),getFetcher:_t,resetFetcher:Pt,deleteFetcher:di,dispose:fe,getBlocker:fi,deleteBlocker:ri,patchRoutes:tt,_internalFetchControllers:k,_internalSetRoutes:Oe,_internalSetStateDoNotUseOrYouWillBreakYourApp(W){ue(W)}},i.unstable_instrumentations&&(A=cE(A,i.unstable_instrumentations.map(W=>W.router).filter(Boolean))),A}function SE(i){return i!=null&&("formData"in i&&i.formData!=null||"body"in i&&i.body!==void 0)}function Hf(i,r,s,a,c,f){let g,l;if(c){g=[];for(let h of r)if(g.push(h),h.route.id===c){l=h;break}}else g=r,l=r[r.length-1];let u=pm(a||".",mm(g),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=_m(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=rE({basename:s,pathname:u.pathname})),Gr(u)}function G_(i,r,s){if(!s||!SE(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(),g=ob(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:g,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:g,formEncType:s.formEncType,formData:void 0,json:d,text:void 0}}}catch{return a()}}}at(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=i0(l);else if(s.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(s.body),u=i0(l)}catch{return a()}let h={formMethod:f,formAction:g,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&&_m(b.search)&&l.append("index",""),b.search=`?${l}`,{path:Gr(b),submission:h}}function X_(i,r,s,a,c,f,g,l,u,h,b,d,w,C,R,x,m,v,_,y,E){var X;let D=y?rr(y[1])?y[1].error:y[1].data:void 0,A=c.createURL(f.location),O=c.createURL(u),T;if(b&&f.errors){let F=Object.keys(f.errors)[0];T=g.findIndex(Y=>Y.route.id===F)}else if(y&&rr(y[1])){let F=y[0];T=g.findIndex(Y=>Y.route.id===F)-1}let L=y?y[1].statusCode:void 0,U=L&&L>=400,V={currentUrl:A,currentParams:((X=f.matches[0])==null?void 0:X.params)||{},nextUrl:O,nextParams:g[0].params,...l,actionResult:D,actionStatus:L},j=Tl(g),$=g.map((F,Y)=>{let{route:k}=F,z=null;if(T!=null&&Y>T?z=!1:k.lazy?z=!0:gm(k)?b?z=Pf(k,f.loaderData,f.errors):wE(f.loaderData,f.matches[Y],F)&&(z=!0):z=!1,z!==null)return zf(s,a,i,j,F,h,r,z);let K=!1;typeof E=="boolean"?K=E:U?K=!1:(d||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||CE(f.matches[Y],F))&&(K=!0);let B={...V,defaultShouldRevalidate:K},q=ol(F,B);return zf(s,a,i,j,F,h,r,q,B,E)}),Z=[];return R.forEach((F,Y)=>{if(b||!g.some(se=>se.route.id===F.routeId)||C.has(Y))return;let k=f.fetchers.get(Y),z=k&&k.state!=="idle"&&k.data===void 0,K=Jn(m,F.path,v);if(!K){if(_&&z)return;Z.push({key:Y,routeId:F.routeId,path:F.path,matches:null,match:null,request:null,controller:null});return}if(x.has(Y))return;let B=nu(K,F.path),q=new AbortController,Q=ja(c,F.path,q.signal),te=null;if(w.has(Y))w.delete(Y),te=za(s,a,Q,K,B,h,r);else if(z)d&&(te=za(s,a,Q,K,B,h,r));else{let se;typeof E=="boolean"?se=E:U?se=!1:se=d;let be={...V,defaultShouldRevalidate:se};ol(B,be)&&(te=za(s,a,Q,K,B,h,r,be))}te&&Z.push({key:Y,routeId:F.routeId,path:F.path,matches:te,match:B,request:Q,controller:q})}),{dsMatches:$,revalidatingFetchers:Z}}function gm(i){return i.loader!=null||i.middleware!=null&&i.middleware.length>0}function Pf(i,r,s){if(i.lazy)return!0;if(!gm(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 wE(i,r,s){let a=!r||s.route.id!==r.route.id,c=!i.hasOwnProperty(s.route.id);return a||c}function CE(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 Q_(i,r,s,a,c,f){let g;if(i){let h=a[i];at(h,`No route found to patch children into: routeId = ${i}`),h.children||(h.children=[]),g=h.children}else g=s;let l=[],u=[];if(r.forEach(h=>{let b=g.find(d=>ib(h,d));b?u.push({existingRoute:b,newRoute:h}):l.push(h)}),l.length>0){let h=gl(l,c,[i||"_","patch",String((g==null?void 0:g.length)||"0")],a);g.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 ib(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=>ib(s,f))}):!1}var Z_=new WeakMap,rb=({key:i,route:r,manifest:s,mapRouteProperties:a})=>{let c=s[r.id];if(at(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let f=c.lazy[i];if(!f)return;let g=Z_.get(c);g||(g={},Z_.set(c,g));let l=g[i];if(l)return l;let u=(async()=>{let h=IC(i),d=c[i]!==void 0&&i!=="hasErrorBoundary";if(h)ci(!h,"Route property "+i+" is not a supported lazy route property. This property will be ignored."),g[i]=Promise.resolve();else if(d)ci(!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 g[i]=u,u},J_=new WeakMap;function EE(i,r,s,a,c){let f=s[i.id];if(at(f,"No route found in manifest"),!i.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof i.lazy=="function"){let b=J_.get(f);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let d=(async()=>{at(typeof i.lazy=="function","No lazy route function found");let w=await i.lazy(),C={};for(let R in w){let x=w[R];if(x===void 0)continue;let m=qC(R),_=f[R]!==void 0&&R!=="hasErrorBoundary";m?ci(!m,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?ci(!_,`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]=x}Object.assign(f,C),Object.assign(f,{...a(f),lazy:void 0})})();return J_.set(f,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let g=Object.keys(i.lazy),l=[],u;for(let b of g){if(c&&c.includes(b))continue;let d=rb({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 e0(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 xE(i){return i.matches.some(r=>r.route.middleware)?nb(i,()=>e0(i)):e0(i)}function nb(i,r){return RE(i,r,a=>{if(zE(a))throw a;return a},NE,s);function s(a,c,f){if(f)return Promise.resolve(Object.assign(f.value,{[c]:{type:"error",result:a}}));{let{matches:g}=i,l=Math.min(Math.max(g.findIndex(h=>h.route.id===c),0),Math.max(g.findIndex(h=>h.shouldCallHandler()),0)),u=es(g,g[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:a}})}}}async function RE(i,r,s,a,c){let{matches:f,request:g,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 sb({request:g,params:l,context:u,unstable_pattern:h},b,r,s,a,c)}async function sb(i,r,s,a,c,f,g=0){let{request:l}=i;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=r[g];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 sb(i,r,s,a,c,f,g+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 ab(i,r,s,a,c){let f=rb({key:"middleware",route:a.route,manifest:r,mapRouteProperties:i}),g=EE(a.route,Ai(s.method)?"action":"loader",r,i,c);return{middleware:f,route:g.lazyRoutePromise,handler:g.lazyHandlerPromise}}function zf(i,r,s,a,c,f,g,l,u=null,h){let b=!1,d=ab(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:x}=c.route,m=b||l||w&&!Ai(s.method)&&(C||R),v=x&&x.length>0&&!R&&!C;return m&&(Ai(s.method)||!v)?DE({request:s,unstable_pattern:a,match:c,lazyHandlerPromise:d==null?void 0:d.handler,lazyRoutePromise:d==null?void 0:d.route,handlerOverride:w,scopedContext:g}):Promise.resolve({type:"data",result:void 0})}}}function za(i,r,s,a,c,f,g,l=null){return a.map(u=>u.route.id!==c.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:ab(i,r,s,u,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:zf(i,r,s,Tl(a),u,f,g,!0,l))}async function TE(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 g={request:r,unstable_pattern:Tl(s),params:s[0].params,context:c,matches:s},u=await i({...g,fetcherKey:a,runClientMiddleware:h=>{let b=g;return nb(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 DE({request:i,unstable_pattern:r,match:s,lazyHandlerPromise:a,lazyRoutePromise:c,handlerOverride:f,scopedContext:g}){let l,u,h=Ai(i.method),b=h?"action":"loader",d=w=>{let C,R=new Promise((v,_)=>C=_);u=()=>C(),i.signal.addEventListener("abort",u);let x=v=>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:g},...v!==void 0?[v]:[]),m=(async()=>{try{return{type:"data",result:await(f?f(_=>x(_)):x())}}catch(v){return{type:"error",result:v}}})();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(x=>{C=x}),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),x=R.pathname+R.search;throw gr(405,{method:i.method,pathname:x,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 OE(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 AE(i){var a,c,f,g,l;let{result:r,type:s}=i;if(vm(r)){let u;try{u=await OE(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"?a0(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:BE(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}:a0(r)?{type:"data",data:r.data,statusCode:(g=r.init)==null?void 0:g.status,headers:(l=r.init)!=null&&l.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function LE(i,r,s,a,c){let f=i.headers.get("Location");if(at(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!fm(f)){let g=a.slice(0,a.findIndex(l=>l.route.id===s)+1);f=Hf(new URL(r.url),g,c,f),i.headers.set("Location",f)}return i}function t0(i,r,s,a){let c=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(fm(i)){let f=i,g=f.startsWith("//")?new URL(r.protocol+f):new URL(f);if(c.includes(g.protocol))throw new Error("Invalid redirect location");let l=br(g.pathname,s)!=null;if(g.origin===r.origin&&l)return g.pathname+g.search+g.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(ob(r)).toString(),f={signal:s};if(a&&Ai(a.formMethod)){let{formMethod:g,formEncType:l}=a;f.method=g.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 i0(i){let r=new FormData;for(let[s,a]of i.entries())r.append(s,a);return r}function ME(i,r,s,a=!1,c=!1){let f={},g=null,l,u=!1,h={},b=s&&rr(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(at(!Ps(C),"Cannot handle redirect results in processLoaderData"),rr(C)){let R=C.error;if(b!==void 0&&(R=b,b=void 0),g=g||{},c)g[w]=R;else{let x=es(i,w);g[x.route.id]==null&&(g[x.route.id]=R)}a||(f[w]=tb),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&&(g={[s[0]]:b},s[2]&&(f[s[2]]=void 0)),{loaderData:f,errors:g,statusCode:l||200,loaderHeaders:h}}function r0(i,r,s,a,c,f){let{loaderData:g,errors:l}=ME(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(at(w,"Did not find corresponding fetcher result"),rr(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))at(!1,"Unhandled fetcher revalidation redirect");else{let C=_n(w.data);i.fetchers.set(h,C)}}),{loaderData:g,errors:l}}function n0(i,r,s,a){let c=Object.entries(r).filter(([,f])=>f!==tb).reduce((f,[g,l])=>(f[g]=l,f),{});for(let f of s){let g=f.route.id;if(!r.hasOwnProperty(g)&&i.hasOwnProperty(g)&&f.route.loader&&(c[g]=i[g]),a&&a.hasOwnProperty(g))break}return c}function s0(i){return i?rr(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 g="Unknown Server Error",l="Unknown @remix-run/router error";return i===400?(g="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?(g="Forbidden",l=`Route "${s}" does not match URL "${r}"`):i===404?(g="Not Found",l=`No route matches URL "${r}"`):i===405&&(g="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,g,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 ob(i){let r=typeof i=="string"?fs(i):i;return Gr({...r,hash:""})}function kE(i,r){return i.pathname!==r.pathname||i.search!==r.search?!1:i.hash===""?r.hash!=="":i.hash===r.hash?!0:r.hash!==""}function BE(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 NE(i){return i!=null&&typeof i=="object"&&Object.entries(i).every(([r,s])=>typeof r=="string"&&jE(s))}function jE(i){return i!=null&&typeof i=="object"&&"type"in i&&"result"in i&&(i.type==="data"||i.type==="error")}function HE(i){return vm(i.result)&&Jy.has(i.result.status)}function rr(i){return i.type==="error"}function Ps(i){return(i&&i.type)==="redirect"}function a0(i){return typeof i=="object"&&i!=null&&"type"in i&&"data"in i&&"init"in i&&i.type==="DataWithResponseInit"}function vm(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.headers=="object"&&typeof i.body<"u"}function PE(i){return Jy.has(i)}function zE(i){return vm(i)&&PE(i.status)&&i.headers.has("Location")}function UE(i){return gE.has(i.toUpperCase())}function Ai(i){return mE.has(i.toUpperCase())}function _m(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&&_m(s||""))return i[i.length-1];let a=Yy(i);return a[a.length-1]}function o0(i){let{formMethod:r,formAction:s,formEncType:a,text:c,formData:f,json:g}=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(g!==void 0)return{formMethod:r,formAction:s,formEncType:a,formData:void 0,json:g,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 IE(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 FE(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 qE(i,r){try{let s=i.sessionStorage.getItem(eb);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 $E(i,r){if(r.size>0){let s={};for(let[a,c]of r)s[a]=[...c];try{i.sessionStorage.setItem(eb,JSON.stringify(s))}catch(a){ci(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function l0(){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 lb=N.createContext(!1);function KE(){return N.useContext(lb)}var ym=N.createContext({isTransitioning:!1});ym.displayName="ViewTransition";var cb=N.createContext(new Map);cb.displayName="Fetchers";var VE=N.createContext(null);VE.displayName="Await";var Sr=N.createContext(null);Sr.displayName="Navigation";var Mu=N.createContext(null);Mu.displayName="Location";var Nr=N.createContext({outlet:null,matches:[],isDataRoute:!1});Nr.displayName="Route";var bm=N.createContext(null);bm.displayName="RouteError";var ub="REACT_ROUTER_ERROR",WE="REDIRECT",YE="ROUTE_ERROR_RESPONSE";function GE(i){if(i.startsWith(`${ub}:${WE}:{`))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 XE(i){if(i.startsWith(`${ub}:${YE}:{`))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 QE(i,{relative:r}={}){at(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:g}=Ol(i,{relative:r}),l=f;return s!=="/"&&(l=f==="/"?s:Yr([s,f])),a.createHref({pathname:l,search:g,hash:c})}function no(){return N.useContext(Mu)!=null}function Xr(){return at(no(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Mu).location}function ZE(i){at(no(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:r}=Xr();return N.useMemo(()=>Zs(i,Vy(r)),[r,i])}var hb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function db(i){N.useContext(Sr).static||N.useLayoutEffect(i)}function ku(){let{isDataRoute:i}=N.useContext(Nr);return i?mx():JE()}function JE(){at(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(Nr),{pathname:c}=Xr(),f=JSON.stringify(mm(a)),g=N.useRef(!1);return db(()=>{g.current=!0}),N.useCallback((u,h={})=>{if(ci(g.current,hb),!g.current)return;if(typeof u=="number"){s.go(u);return}let b=pm(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 ex=N.createContext(null);function tx(i){let r=N.useContext(Nr).outlet;return N.useMemo(()=>r&&N.createElement(ex.Provider,{value:i},r),[r,i])}function ix(){let{matches:i}=N.useContext(Nr),r=i[i.length-1];return r?r.params:{}}function Ol(i,{relative:r}={}){let{matches:s}=N.useContext(Nr),{pathname:a}=Xr(),c=JSON.stringify(mm(s));return N.useMemo(()=>pm(i,JSON.parse(c),a,r==="path"),[i,c,a,r])}function rx(i,r,s,a,c){at(no(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=N.useContext(Sr),{matches:g}=N.useContext(Nr),l=g[g.length-1],u=l?l.params:{},h=l?l.pathname:"/",b=l?l.pathnameBase:"/",d=l&&l.route;{let _=d&&d.path||"";mb(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||"/",x=R;if(b!=="/"){let _=b.replace(/^\//,"").split("/");x="/"+R.replace(/^\//,"").split("/").slice(_.length).join("/")}let m=Jn(i,{pathname:x});return ci(d||m!=null,`No routes matched location "${C.pathname}${C.search}${C.hash}" `),ci(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.`),lx(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])})),g,s,a,c)}function nx(){let i=fx(),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},g=null;return console.error("Error handled by React Router default ErrorBoundary:",i),g=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,g)}var sx=N.createElement(nx,null),fb=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=XE(i.digest);s&&(i=s)}let r=i!==void 0?N.createElement(Nr.Provider,{value:this.props.routeContext},N.createElement(bm.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?N.createElement(ax,{error:i},r):r}};fb.contextType=lb;var af=new WeakMap;function ax({children:i,error:r}){let{basename:s}=N.useContext(Sr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let a=GE(r.digest);if(a){let c=af.get(r);if(c)throw c;let f=Xy(a.location,s);if(Gy&&!af.get(r))if(f.isExternal||a.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:a.replace}));throw af.set(r,g),g}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return i}function ox({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(Nr.Provider,{value:i},s)}function lx(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,g=s==null?void 0:s.errors;if(g!=null){let b=f.findIndex(d=>d.route.id&&(g==null?void 0:g[d.route.id])!==void 0);at(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(g).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,x=null,m=null;s&&(C=g&&d.route.id?g[d.route.id]:void 0,x=d.route.errorElement||sx,l&&(u<0&&w===0?(mb("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 v=r.concat(f.slice(0,w+1)),_=()=>{let y;return C?y=x:R?y=m:d.route.Component?y=N.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=b,N.createElement(ox,{match:d,routeContext:{outlet:b,matches:v,isDataRoute:s!=null},children:y})};return s&&(d.route.ErrorBoundary||d.route.errorElement||w===0)?N.createElement(fb,{location:s.location,revalidation:s.revalidation,component:x,error:C,children:_(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:h}):_()},null)}function Sm(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cx(i){let r=N.useContext(ta);return at(r,Sm(i)),r}function ux(i){let r=N.useContext(Dl);return at(r,Sm(i)),r}function hx(i){let r=N.useContext(Nr);return at(r,Sm(i)),r}function wm(i){let r=hx(i),s=r.matches[r.matches.length-1];return at(s.route.id,`${i} can only be used on routes that contain a unique "id"`),s.route.id}function dx(){return wm("useRouteId")}function fx(){var a;let i=N.useContext(bm),r=ux("useRouteError"),s=wm("useRouteError");return i!==void 0?i:(a=r.errors)==null?void 0:a[s]}function mx(){let{router:i}=cx("useNavigate"),r=wm("useNavigate"),s=N.useRef(!1);return db(()=>{s.current=!0}),N.useCallback(async(c,f={})=>{ci(s.current,hb),s.current&&(typeof c=="number"?await i.navigate(c):await i.navigate(c,{fromRouteId:r,...f}))},[i,r])}var c0={};function mb(i,r,s){!r&&!c0[i]&&(c0[i]=!0,ci(!1,s))}var u0={};function h0(i,r){!i&&!u0[r]&&(u0[r]=!0,console.warn(r))}var px="useOptimistic",d0=dm[px],gx=()=>{};function vx(i){return d0?d0(i):[i,gx]}function _x(i){let r={hasErrorBoundary:i.hasErrorBoundary||i.ErrorBoundary!=null||i.errorElement!=null};return i.Component&&(i.element&&ci(!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&&ci(!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&&ci(!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 yx=["HydrateFallback","hydrateFallbackElement"],bx=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 Sx({router:i,flushSync:r,onError:s,unstable_useTransitions:a}){a=KE()||a;let[f,g]=N.useState(i.state),[l,u]=vx(f),[h,b]=N.useState(),[d,w]=N.useState({isTransitioning:!1}),[C,R]=N.useState(),[x,m]=N.useState(),[v,_]=N.useState(),y=N.useRef(new Map),E=N.useCallback((T,{deletedFetchers:L,newErrors:U,flushSync:V,viewTransitionOpts:j})=>{U&&s&&Object.values(U).forEach(Z=>{var X;return s(Z,{location:T.location,params:((X=T.matches[0])==null?void 0:X.params)??{},unstable_pattern:Tl(T.matches)})}),T.fetchers.forEach((Z,X)=>{Z.data!==void 0&&y.current.set(X,Z.data)}),L.forEach(Z=>y.current.delete(Z)),h0(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(h0(j==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."),!j||!$){r&&V?r(()=>g(T)):a===!1?g(T):N.startTransition(()=>{a===!0&&u(Z=>f0(Z,T)),g(T)});return}if(r&&V){r(()=>{x&&(C==null||C.resolve(),x.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let Z=i.window.document.startViewTransition(()=>{r(()=>g(T))});Z.finished.finally(()=>{r(()=>{R(void 0),m(void 0),b(void 0),w({isTransitioning:!1})})}),r(()=>m(Z));return}x?(C==null||C.resolve(),x.skipTransition(),_({state:T,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(b(T),w({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[i.window,r,x,C,a,u,s]);N.useLayoutEffect(()=>i.subscribe(E),[i,E]),N.useEffect(()=>{d.isTransitioning&&!d.flushSync&&R(new bx)},[d]),N.useEffect(()=>{if(C&&h&&i.window){let T=h,L=C.promise,U=i.window.document.startViewTransition(async()=>{a===!1?g(T):N.startTransition(()=>{a===!0&&u(V=>f0(V,T)),g(T)}),await L});U.finished.finally(()=>{R(void 0),m(void 0),b(void 0),w({isTransitioning:!1})}),m(U)}},[h,C,i.window,a,u]),N.useEffect(()=>{C&&h&&l.location.key===h.location.key&&C.resolve()},[C,x,l.location,h]),N.useEffect(()=>{!d.isTransitioning&&v&&(b(v.state),w({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),_(void 0))},[d.isTransitioning,v]);let D=N.useMemo(()=>({createHref:i.createHref,encodeLocation:i.encodeLocation,go:T=>i.navigate(T),push:(T,L,U)=>i.navigate(T,{state:L,preventScrollReset:U==null?void 0:U.preventScrollReset}),replace:(T,L,U)=>i.navigate(T,{replace:!0,state:L,preventScrollReset:U==null?void 0:U.preventScrollReset})}),[i]),A=i.basename||"/",O=N.useMemo(()=>({router:i,navigator:D,static:!1,basename:A,onError:s}),[i,D,A,s]);return N.createElement(N.Fragment,null,N.createElement(ta.Provider,{value:O},N.createElement(Dl.Provider,{value:l},N.createElement(cb.Provider,{value:y.current},N.createElement(ym.Provider,{value:d},N.createElement(xx,{basename:A,location:l.location,navigationType:l.historyAction,navigator:D,unstable_useTransitions:a},N.createElement(wx,{routes:i.routes,future:i.future,state:l,onError:s})))))),null)}function f0(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 wx=N.memo(Cx);function Cx({routes:i,future:r,state:s,onError:a}){return rx(i,void 0,s,a,r)}function Ex(i){return tx(i.context)}function xx({basename:i="/",children:r=null,location:s,navigationType:a="POP",navigator:c,static:f=!1,unstable_useTransitions:g}){at(!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:g,future:{}}),[l,c,f,g]);typeof s=="string"&&(s=fs(s));let{pathname:h="/",search:b="",hash:d="",state:w=null,key:C="default"}=s,R=N.useMemo(()=>{let x=br(h,l);return x==null?null:{location:{pathname:x,search:b,hash:d,state:w,key:C},navigationType:a}},[l,h,b,d,w,C,a]);return ci(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 Rx(i){return Bu(i)&&i.tagName.toLowerCase()==="button"}function Tx(i){return Bu(i)&&i.tagName.toLowerCase()==="form"}function Dx(i){return Bu(i)&&i.tagName.toLowerCase()==="input"}function Ox(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Ax(i,r){return i.button===0&&(!r||r==="_self")&&!Ox(i)}var Yc=null;function Lx(){if(Yc===null)try{new FormData(document.createElement("form"),0),Yc=!1}catch{Yc=!0}return Yc}var Mx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function of(i){return i!=null&&!Mx.has(i)?(ci(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${au}"`),null):i}function kx(i,r){let s,a,c,f,g;if(Tx(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(Rx(i)||Dx(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),!Lx()){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,g=i}return f&&c==="text/plain"&&(g=f,f=void 0),{action:a,method:s.toLowerCase(),encType:c,formData:f,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cm(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Bx(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 Nx(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 jx(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 Hx(i,r,s){let a=await Promise.all(i.map(async c=>{let f=r.routes[c.route.id];if(f){let g=await Nx(f,s);return g.links?g.links():[]}return[]}));return Ix(a.flat(1).filter(jx).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function m0(i,r,s,a,c,f){let g=(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)=>g(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(g(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 Px(i,r,{includeHydrateFallback:s}={}){return zx(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 zx(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 Ix(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 pb(){let i=N.useContext(ta);return Cm(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Fx(){let i=N.useContext(Dl);return Cm(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Em=N.createContext(void 0);Em.displayName="FrameworkContext";function gb(){let i=N.useContext(Em);return Cm(i,"You must render this element inside a <HydratedRouter> element"),i}function qx(i,r){let s=N.useContext(Em),[a,c]=N.useState(!1),[f,g]=N.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:d}=r,w=N.useRef(null);N.useEffect(()=>{if(i==="render"&&g(!0),i==="viewport"){let x=v=>{v.forEach(_=>{g(_.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return w.current&&m.observe(w.current),()=>{m.disconnect()}}},[i]),N.useEffect(()=>{if(a){let x=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(x)}}},[a]);let C=()=>{c(!0)},R=()=>{c(!1),g(!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 $x({page:i,...r}){let{router:s}=pb(),a=N.useMemo(()=>Jn(s.routes,i,s.basename),[s.routes,i,s.basename]);return a?N.createElement(Vx,{page:i,matches:a,...r}):null}function Kx(i){let{manifest:r,routeModules:s}=gb(),[a,c]=N.useState([]);return N.useEffect(()=>{let f=!1;return Hx(i,r,s).then(g=>{f||c(g)}),()=>{f=!0}},[i,r,s]),a}function Vx({page:i,matches:r,...s}){let a=Xr(),{future:c,manifest:f,routeModules:g}=gb(),{basename:l}=pb(),{loaderData:u,matches:h}=Fx(),b=N.useMemo(()=>m0(i,r,h,f,a,"data"),[i,r,h,f,a]),d=N.useMemo(()=>m0(i,r,h,f,a,"assets"),[i,r,h,f,a]),w=N.useMemo(()=>{if(i===a.pathname+a.search+a.hash)return[];let x=new Set,m=!1;if(r.forEach(_=>{var E;let y=f.routes[_.route.id];!y||!y.hasLoader||(!b.some(D=>D.route.id===_.route.id)&&_.route.id in u&&((E=g[_.route.id])!=null&&E.shouldRevalidate)||y.hasClientLoader?m=!0:x.add(_.route.id))}),x.size===0)return[];let v=Bx(i,l,c.unstable_trailingSlashAwareDataRequests,"data");return m&&x.size>0&&v.searchParams.set("_routes",r.filter(_=>x.has(_.route.id)).map(_=>_.route.id).join(",")),[v.pathname+v.search]},[l,c.unstable_trailingSlashAwareDataRequests,u,a,f,b,r,i,g]),C=N.useMemo(()=>Px(d,f),[d,f]),R=Kx(d);return N.createElement(N.Fragment,null,w.map(x=>N.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...s})),C.map(x=>N.createElement("link",{key:x,rel:"modulepreload",href:x,...s})),R.map(({key:x,link:m})=>N.createElement("link",{key:x,nonce:s.nonce,...m,crossOrigin:m.crossOrigin??s.crossOrigin})))}function Wx(...i){return r=>{i.forEach(s=>{typeof s=="function"?s(r):s!=null&&(s.current=r)})}}var Yx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yx&&(window.__reactRouterVersion="7.13.0")}catch{}function Gx(i,r){return bE({basename:r==null?void 0:r.basename,getContext:r==null?void 0:r.getContext,future:r==null?void 0:r.future,history:HC({window:r==null?void 0:r.window}),hydrationData:Xx(),routes:i,mapRouteProperties:_x,hydrationRouteProperties:yx,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 Xx(){let i=window==null?void 0:window.__staticRouterHydrationData;return i&&i.errors&&(i={...i,errors:Qx(i.errors)}),i}function Qx(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 g=new f(c.message);g.stack="",s[a]=g}catch{}}if(s[a]==null){let f=new Error(c.message);f.stack="",s[a]=f}}else s[a]=c;return s}var vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=N.forwardRef(function({onClick:r,discover:s="render",prefetch:a="none",relative:c,reloadDocument:f,replace:g,state:l,target:u,to:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w,...C},R){let{basename:x,unstable_useTransitions:m}=N.useContext(Sr),v=typeof h=="string"&&vb.test(h),_=Xy(h,x);h=_.to;let y=QE(h,{relative:c}),[E,D,A]=qx(a,C),O=t2(h,{replace:g,state:l,target:u,preventScrollReset:b,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:w,unstable_useTransitions:m});function T(U){r&&r(U),U.defaultPrevented||O(U)}let L=N.createElement("a",{...C,...A,href:_.absoluteURL||y,onClick:_.isExternal||f?r:T,ref:Wx(R,D),target:u,"data-discover":!v&&s==="render"?"true":void 0});return E&&!v?N.createElement(N.Fragment,null,L,N.createElement($x,{page:y})):L});yn.displayName="Link";var Zx=N.forwardRef(function({"aria-current":r="page",caseSensitive:s=!1,className:a="",end:c=!1,style:f,to:g,viewTransition:l,children:u,...h},b){let d=Ol(g,{relative:h.relative}),w=Xr(),C=N.useContext(Dl),{navigator:R,basename:x}=N.useContext(Sr),m=C!=null&&a2(d)&&l===!0,v=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,v=v.toLowerCase()),y&&x&&(y=br(y,x)||y);const E=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let D=_===v||!c&&_.startsWith(v)&&_.charAt(E)==="/",A=y!=null&&(y===v||!c&&y.startsWith(v)&&y.charAt(v.length)==="/"),O={isActive:D,isPending:A,isTransitioning:m},T=D?r:void 0,L;typeof a=="function"?L=a(O):L=[a,D?"active":null,A?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let U=typeof f=="function"?f(O):f;return N.createElement(yn,{...h,"aria-current":T,className:L,ref:b,style:U,to:g,viewTransition:l},typeof u=="function"?u(O):u)});Zx.displayName="NavLink";var Jx=N.forwardRef(({discover:i="render",fetcherKey:r,navigate:s,reloadDocument:a,replace:c,state:f,method:g=su,action:l,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w,...C},R)=>{let{unstable_useTransitions:x}=N.useContext(Sr),m=n2(),v=s2(l,{relative:h}),_=g.toLowerCase()==="get"?"get":"post",y=typeof l=="string"&&vb.test(l),E=D=>{if(u&&u(D),D.defaultPrevented)return;D.preventDefault();let A=D.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||g,T=()=>m(A||D.currentTarget,{fetcherKey:r,method:O,navigate:s,replace:c,state:f,relative:h,preventScrollReset:b,viewTransition:d,unstable_defaultShouldRevalidate:w});x&&s!==!1?N.startTransition(()=>T()):T()};return N.createElement("form",{ref:R,method:_,action:v,onSubmit:a?u:E,...C,"data-discover":!y&&i==="render"?"true":void 0})});Jx.displayName="Form";function e2(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _b(i){let r=N.useContext(ta);return at(r,e2(i)),r}function t2(i,{target:r,replace:s,state:a,preventScrollReset:c,relative:f,viewTransition:g,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let h=ku(),b=Xr(),d=Ol(i,{relative:f});return N.useCallback(w=>{if(Ax(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:g,unstable_defaultShouldRevalidate:l});u?N.startTransition(()=>R()):R()}},[b,h,d,s,a,r,i,c,f,g,l,u])}var i2=0,r2=()=>`__${String(++i2)}__`;function n2(){let{router:i}=_b("useSubmit"),{basename:r}=N.useContext(Sr),s=dx(),a=i.fetch,c=i.navigate;return N.useCallback(async(f,g={})=>{let{action:l,method:u,encType:h,formData:b,body:d}=kx(f,r);if(g.navigate===!1){let w=g.fetcherKey||r2();await a(w,s,g.action||l,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:b,body:d,formMethod:g.method||u,formEncType:g.encType||h,flushSync:g.flushSync})}else await c(g.action||l,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:b,body:d,formMethod:g.method||u,formEncType:g.encType||h,replace:g.replace,state:g.state,fromRouteId:s,flushSync:g.flushSync,viewTransition:g.viewTransition})},[a,c,r,s])}function s2(i,{relative:r}={}){let{basename:s}=N.useContext(Sr),a=N.useContext(Nr);at(a,"useFormAction must be used inside a RouteContext");let[c]=a.matches.slice(-1),f={...Ol(i||".",{relative:r})},g=Xr();if(i==null){f.search=g.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 a2(i,{relative:r}={}){let s=N.useContext(ym);at(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=_b("useViewTransitionState"),c=Ol(i,{relative:r});if(!s.isTransitioning)return!1;let f=br(s.currentLocation.pathname,a)||s.currentLocation.pathname,g=br(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Zs(c.pathname,g)!=null||Zs(c.pathname,f)!=null}var eo=Iy();const o2=Oy(eo);function l2(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 c2=i=>{switch(i){case"success":return d2;case"info":return m2;case"warning":return f2;case"error":return p2;default:return null}},u2=Array(12).fill(0),h2=({visible:i,className:r})=>xe.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":i},xe.createElement("div",{className:"sonner-spinner"},u2.map((s,a)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),d2=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),f2=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},xe.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"})),m2=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),p2=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),g2=xe.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"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),v2=()=>{const[i,r]=xe.useState(document.hidden);return xe.useEffect(()=>{const s=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),i};let If=1;class _2{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:If++,g=this.toasts.find(u=>u.id===f),l=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),g?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,g;const l=c.then(async h=>{if(g=["resolve",h],xe.isValidElement(h))f=!1,this.create({id:a,type:"default",message:h});else if(b2(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"&&!xe.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"&&!xe.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"&&!xe.isValidElement(d)?d:{message:d};this.create({id:a,type:"success",description:w,...R})}}).catch(async h=>{if(g=["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"&&!xe.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(()=>g[0]==="reject"?b(g[1]):h(g[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)||If++;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 Wi=new _2,y2=(i,r)=>{const s=(r==null?void 0:r.id)||If++;return Wi.addToast({title:i,...r,id:s}),s},b2=i=>i&&typeof i=="object"&&"ok"in i&&typeof i.ok=="boolean"&&"status"in i&&typeof i.status=="number",S2=y2,w2=()=>Wi.toasts,C2=()=>Wi.getActiveToasts(),wt=Object.assign(S2,{success:Wi.success,info:Wi.info,warning:Wi.warning,error:Wi.error,custom:Wi.custom,message:Wi.message,promise:Wi.promise,dismiss:Wi.dismiss,loading:Wi.loading},{getHistory:w2,getToasts:C2});l2("[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 E2=3,x2="24px",R2="16px",p0=4e3,T2=356,D2=14,O2=45,A2=200;function Ur(...i){return i.filter(Boolean).join(" ")}function L2(i){const[r,s]=i.split("-"),a=[];return r&&a.push(r),s&&a.push(s),a}const M2=i=>{var r,s,a,c,f,g,l,u,h;const{invert:b,toast:d,unstyled:w,interacting:C,setHeights:R,visibleToasts:x,heights:m,index:v,toasts:_,expanded:y,removeToast:E,defaultRichColors:D,closeButton:A,style:O,cancelButtonStyle:T,actionButtonStyle:L,className:U="",descriptionClassName:V="",duration:j,position:$,gap:Z,expandByDefault:X,classNames:F,icons:Y,closeButtonAriaLabel:k="Close toast"}=i,[z,K]=xe.useState(null),[B,q]=xe.useState(null),[Q,te]=xe.useState(!1),[se,be]=xe.useState(!1),[H,G]=xe.useState(!1),[ae,fe]=xe.useState(!1),[me,ue]=xe.useState(!1),[we,Ke]=xe.useState(0),[Pe,Ee]=xe.useState(0),Se=xe.useRef(d.duration||j||p0),Ie=xe.useRef(null),je=xe.useRef(null),ot=v===0,Ne=v+1<=x,De=d.type,$e=d.dismissible!==!1,ze=d.className||"",nt=d.descriptionClassName||"",Ct=xe.useMemo(()=>m.findIndex(Ve=>Ve.toastId===d.id)||0,[m,d.id]),xt=xe.useMemo(()=>{var Ve;return(Ve=d.closeButton)!=null?Ve:A},[d.closeButton,A]),Je=xe.useMemo(()=>d.duration||j||p0,[d.duration,j]),yt=xe.useRef(0),_t=xe.useRef(0),Pt=xe.useRef(0),et=xe.useRef(null),[di,Ye]=$.split("-"),_i=xe.useMemo(()=>m.reduce((Ve,Mt,Kt)=>Kt>=Ct?Ve:Ve+Mt.height,0),[m,Ct]),Ft=v2(),Cr=d.invert||b,fi=De==="loading";_t.current=xe.useMemo(()=>Ct*Z+_i,[Ct,_i]),xe.useEffect(()=>{Se.current=Je},[Je]),xe.useEffect(()=>{te(!0)},[]),xe.useEffect(()=>{const Ve=je.current;if(Ve){const Mt=Ve.getBoundingClientRect().height;return Ee(Mt),R(Kt=>[{toastId:d.id,height:Mt,position:d.position},...Kt]),()=>R(Kt=>Kt.filter(Vt=>Vt.toastId!==d.id))}},[R,d.id]),xe.useLayoutEffect(()=>{if(!Q)return;const Ve=je.current,Mt=Ve.style.height;Ve.style.height="auto";const Kt=Ve.getBoundingClientRect().height;Ve.style.height=Mt,Ee(Kt),R(Vt=>Vt.find(he=>he.toastId===d.id)?Vt.map(he=>he.toastId===d.id?{...he,height:Kt}:he):[{toastId:d.id,height:Kt,position:d.position},...Vt])},[Q,d.title,d.description,R,d.id,d.jsx,d.action,d.cancel]);const ri=xe.useCallback(()=>{be(!0),Ke(_t.current),R(Ve=>Ve.filter(Mt=>Mt.toastId!==d.id)),setTimeout(()=>{E(d)},A2)},[d,E,R,_t]);xe.useEffect(()=>{if(d.promise&&De==="loading"||d.duration===1/0||d.type==="loading")return;let Ve;return y||C||Ft?(()=>{if(Pt.current<yt.current){const Vt=new Date().getTime()-yt.current;Se.current=Se.current-Vt}Pt.current=new Date().getTime()})():(()=>{Se.current!==1/0&&(yt.current=new Date().getTime(),Ve=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ri()},Se.current))})(),()=>clearTimeout(Ve)},[y,C,d,De,Ft,ri]),xe.useEffect(()=>{d.delete&&(ri(),d.onDismiss==null||d.onDismiss.call(d,d))},[ri,d.delete]);function Ri(){var Ve;if(Y!=null&&Y.loading){var Mt;return xe.createElement("div",{className:Ur(F==null?void 0:F.loader,d==null||(Mt=d.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":De==="loading"},Y.loading)}return xe.createElement(h2,{className:Ur(F==null?void 0:F.loader,d==null||(Ve=d.classNames)==null?void 0:Ve.loader),visible:De==="loading"})}const Ni=d.icon||(Y==null?void 0:Y[De])||c2(De);var ji,Hi;return xe.createElement("li",{tabIndex:0,ref:je,className:Ur(U,ze,F==null?void 0:F.toast,d==null||(r=d.classNames)==null?void 0:r.toast,F==null?void 0:F.default,F==null?void 0:F[De],d==null||(s=d.classNames)==null?void 0:s[De]),"data-sonner-toast":"","data-rich-colors":(ji=d.richColors)!=null?ji:D,"data-styled":!(d.jsx||d.unstyled||w),"data-mounted":Q,"data-promise":!!d.promise,"data-swiped":me,"data-removed":se,"data-visible":Ne,"data-y-position":di,"data-x-position":Ye,"data-index":v,"data-front":ot,"data-swiping":H,"data-dismissible":$e,"data-type":De,"data-invert":Cr,"data-swipe-out":ae,"data-swipe-direction":B,"data-expanded":!!(y||X&&Q),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":_.length-v,"--offset":`${se?we:_t.current}px`,"--initial-height":X?"auto":`${Pe}px`,...O,...d.style},onDragEnd:()=>{G(!1),K(null),et.current=null},onPointerDown:Ve=>{Ve.button!==2&&(fi||!$e||(Ie.current=new Date,Ke(_t.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(G(!0),et.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Mt,Kt;if(ae||!$e)return;et.current=null;const Vt=Number(((Ve=je.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ti=Number(((Mt=je.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),he=new Date().getTime()-((Kt=Ie.current)==null?void 0:Kt.getTime()),Oe=z==="x"?Vt:Ti,tt=Math.abs(Oe)/he;if(Math.abs(Oe)>=O2||tt>.11){Ke(_t.current),d.onDismiss==null||d.onDismiss.call(d,d),q(z==="x"?Vt>0?"right":"left":Ti>0?"down":"up"),ri(),fe(!0);return}else{var W,ie;(W=je.current)==null||W.style.setProperty("--swipe-amount-x","0px"),(ie=je.current)==null||ie.style.setProperty("--swipe-amount-y","0px")}ue(!1),G(!1),K(null)},onPointerMove:Ve=>{var Mt,Kt,Vt;if(!et.current||!$e||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const he=Ve.clientY-et.current.y,Oe=Ve.clientX-et.current.x;var tt;const W=(tt=i.swipeDirections)!=null?tt:L2($);!z&&(Math.abs(Oe)>1||Math.abs(he)>1)&&K(Math.abs(Oe)>Math.abs(he)?"x":"y");let ie={x:0,y:0};const oe=_e=>1/(1.5+Math.abs(_e)/20);if(z==="y"){if(W.includes("top")||W.includes("bottom"))if(W.includes("top")&&he<0||W.includes("bottom")&&he>0)ie.y=he;else{const _e=he*oe(he);ie.y=Math.abs(_e)<Math.abs(he)?_e:he}}else if(z==="x"&&(W.includes("left")||W.includes("right")))if(W.includes("left")&&Oe<0||W.includes("right")&&Oe>0)ie.x=Oe;else{const _e=Oe*oe(Oe);ie.x=Math.abs(_e)<Math.abs(Oe)?_e:Oe}(Math.abs(ie.x)>0||Math.abs(ie.y)>0)&&ue(!0),(Kt=je.current)==null||Kt.style.setProperty("--swipe-amount-x",`${ie.x}px`),(Vt=je.current)==null||Vt.style.setProperty("--swipe-amount-y",`${ie.y}px`)}},xt&&!d.jsx&&De!=="loading"?xe.createElement("button",{"aria-label":k,"data-disabled":fi,"data-close-button":!0,onClick:fi||!$e?()=>{}:()=>{ri(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Ur(F==null?void 0:F.closeButton,d==null||(a=d.classNames)==null?void 0:a.closeButton)},(Hi=Y==null?void 0:Y.close)!=null?Hi:g2):null,(De||d.icon||d.promise)&&d.icon!==null&&((Y==null?void 0:Y[De])!==null||d.icon)?xe.createElement("div",{"data-icon":"",className:Ur(F==null?void 0:F.icon,d==null||(c=d.classNames)==null?void 0:c.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ri():null,d.type!=="loading"?Ni:null):null,xe.createElement("div",{"data-content":"",className:Ur(F==null?void 0:F.content,d==null||(f=d.classNames)==null?void 0:f.content)},xe.createElement("div",{"data-title":"",className:Ur(F==null?void 0:F.title,d==null||(g=d.classNames)==null?void 0:g.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?xe.createElement("div",{"data-description":"",className:Ur(V,nt,F==null?void 0:F.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),xe.isValidElement(d.cancel)?d.cancel:d.cancel&&Gc(d.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:Ve=>{Gc(d.cancel)&&$e&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ve),ri())},className:Ur(F==null?void 0:F.cancelButton,d==null||(u=d.classNames)==null?void 0:u.cancelButton)},d.cancel.label):null,xe.isValidElement(d.action)?d.action:d.action&&Gc(d.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:Ve=>{Gc(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ve),!Ve.defaultPrevented&&ri())},className:Ur(F==null?void 0:F.actionButton,d==null||(h=d.classNames)==null?void 0:h.actionButton)},d.action.label):null)};function g0(){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 k2(i,r){const s={};return[i,r].forEach((a,c)=>{const f=c===1,g=f?"--mobile-offset":"--offset",l=f?R2:x2;function u(h){["top","right","bottom","left"].forEach(b=>{s[`${g}-${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[`${g}-${h}`]=l:s[`${g}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):u(l)}),s}const B2=xe.forwardRef(function(r,s){const{id:a,invert:c,position:f="bottom-right",hotkey:g=["altKey","KeyT"],expand:l,closeButton:u,className:h,offset:b,mobileOffset:d,theme:w="light",richColors:C,duration:R,style:x,visibleToasts:m=E2,toastOptions:v,dir:_=g0(),gap:y=D2,icons:E,containerAriaLabel:D="Notifications"}=r,[A,O]=xe.useState([]),T=xe.useMemo(()=>a?A.filter(Q=>Q.toasterId===a):A.filter(Q=>!Q.toasterId),[A,a]),L=xe.useMemo(()=>Array.from(new Set([f].concat(T.filter(Q=>Q.position).map(Q=>Q.position)))),[T,f]),[U,V]=xe.useState([]),[j,$]=xe.useState(!1),[Z,X]=xe.useState(!1),[F,Y]=xe.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=xe.useRef(null),z=g.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=xe.useRef(null),B=xe.useRef(!1),q=xe.useCallback(Q=>{O(te=>{var se;return(se=te.find(be=>be.id===Q.id))!=null&&se.delete||Wi.dismiss(Q.id),te.filter(({id:be})=>be!==Q.id)})},[]);return xe.useEffect(()=>Wi.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{O(te=>te.map(se=>se.id===Q.id?{...se,delete:!0}:se))});return}setTimeout(()=>{o2.flushSync(()=>{O(te=>{const se=te.findIndex(be=>be.id===Q.id);return se!==-1?[...te.slice(0,se),{...te[se],...Q},...te.slice(se+1)]:[Q,...te]})})})}),[A]),xe.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 Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:te})=>{Y(te?"dark":"light")})}catch{Q.addListener(({matches:se})=>{try{Y(se?"dark":"light")}catch(be){console.error(be)}})}},[w]),xe.useEffect(()=>{A.length<=1&&$(!1)},[A]),xe.useEffect(()=>{const Q=te=>{var se;if(g.every(G=>te[G]||te.code===G)){var H;$(!0),(H=k.current)==null||H.focus()}te.code==="Escape"&&(document.activeElement===k.current||(se=k.current)!=null&&se.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[g]),xe.useEffect(()=>{if(k.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,B.current=!1)}},[k.current]),xe.createElement("section",{ref:s,"aria-label":`${D} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((Q,te)=>{var se;const[be,H]=Q.split("-");return T.length?xe.createElement("ol",{key:Q,dir:_==="auto"?g0():_,tabIndex:-1,ref:k,className:h,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":be,"data-x-position":H,style:{"--front-toast-height":`${((se=U[0])==null?void 0:se.height)||0}px`,"--width":`${T2}px`,"--gap":`${y}px`,...x,...k2(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"||X(!0)},onPointerUp:()=>X(!1)},T.filter(G=>!G.position&&te===0||G.position===Q).map((G,ae)=>{var fe,me;return xe.createElement(M2,{key:G.id,icons:E,index:ae,toast:G,defaultRichColors:C,duration:(fe=v==null?void 0:v.duration)!=null?fe:R,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:c,visibleToasts:m,closeButton:(me=v==null?void 0:v.closeButton)!=null?me:u,interacting:Z,position:Q,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:q,toasts:T.filter(ue=>ue.position==G.position),heights:U.filter(ue=>ue.position==G.position),setHeights:V,expandByDefault:l,gap:y,expanded:j,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 yb=(...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 N2=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 j2=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 v0=i=>{const r=j2(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 H2={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 P2=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 z2=N.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:c="",children:f,iconNode:g,...l},u)=>N.createElement("svg",{ref:u,...H2,width:r,height:r,stroke:i,strokeWidth:a?Number(s)*24/Number(r):s,className:yb("lucide",c),...!f&&!P2(l)&&{"aria-hidden":"true"},...l},[...g.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(z2,{ref:f,iconNode:r,className:yb(`lucide-${N2(v0(i))}`,`lucide-${i}`,a),...c}));return s.displayName=v0(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"}]],bb=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 I2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xm=Yt("chevron-down",I2);/**
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 F2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],q2=Yt("chevron-left",F2);/**
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 $2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rm=Yt("chevron-right",$2);/**
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 K2=[["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"}]],V2=Yt("circle-alert",K2);/**
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 W2=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Y2=Yt("circle-check-big",W2);/**
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 G2=[["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"}]],Sb=Yt("globe",G2);/**
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 X2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Q2=Yt("info",X2);/**
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 Z2=[["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"}]],wb=Yt("keyboard",Z2);/**
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 J2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],eR=Yt("loader-circle",J2);/**
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 tR=[["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",tR);/**
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 iR=[["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"}]],rR=Yt("pencil",iR);/**
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 nR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cb=Yt("plus",nR);/**
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 sR=[["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"}]],aR=Yt("refresh-ccw",sR);/**
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 oR=[["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"}]],lR=Yt("rotate-ccw",oR);/**
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 cR=[["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"}]],Ff=Yt("save",cR);/**
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 uR=[["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"}]],qf=Yt("send",uR);/**
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 hR=[["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"}]],_0=Yt("settings",hR);/**
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 dR=[["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"}]],y0=Yt("shield",dR);/**
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 fR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Eb=Yt("smartphone",fR);/**
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 mR=[["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"}]],Tm=Yt("trash-2",mR);/**
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 pR=[["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"}]],gR=Yt("triangle-alert",pR);/**
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 vR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dm=Yt("x",vR),Xe=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},b0=i=>i==null?"":""+i,_R=(i,r,s)=>{i.forEach(a=>{r[a]&&(s[a]=r[a])})},yR=/###/g,S0=i=>i&&i.indexOf("###")>-1?i.replace(yR,"."):i,w0=i=>!i||Xe(i),ll=(i,r,s)=>{const a=Xe(r)?r.split("."):r;let c=0;for(;c<a.length-1;){if(w0(i))return{};const f=S0(a[c]);!i[f]&&s&&(i[f]=new s),Object.prototype.hasOwnProperty.call(i,f)?i=i[f]:i={},++c}return w0(i)?{}:{obj:i,k:S0(a[c])}},C0=(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],g=r.slice(0,r.length-1),l=ll(i,g,Object);for(;l.obj===void 0&&g.length;)f=`${g[g.length-1]}.${f}`,g=g.slice(0,g.length-1),l=ll(i,g,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${f}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${f}`]=s},bR=(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]},SR=(i,r,s)=>{const a=mu(i,s);return a!==void 0?a:mu(r,s)},xb=(i,r,s)=>{for(const a in r)a!=="__proto__"&&a!=="constructor"&&(a in i?Xe(i[a])||i[a]instanceof String||Xe(r[a])||r[a]instanceof String?s&&(i[a]=r[a]):xb(i[a],r[a],s):i[a]=r[a]);return i},Na=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const CR=i=>Xe(i)?i.replace(/[&<>"'\/]/g,r=>wR[r]):i;class ER{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 xR=[" ",",","?","!",";"],RR=new ER(20),TR=(i,r,s)=>{r=r||"",s=s||"";const a=xR.filter(g=>r.indexOf(g)<0&&s.indexOf(g)<0);if(a.length===0)return!0;const c=RR.getRegExp(`(${a.map(g=>g==="?"?"\\?":g).join("|")})`);let f=!c.test(i);if(!f){const g=i.indexOf(s);g>0&&!c.test(i.substring(0,g))&&(f=!0)}return f},$f=(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 g,l="";for(let u=f;u<a.length;++u)if(u!==f&&(l+=s),l+=a[u],g=c[l],g!==void 0){if(["string","number","boolean"].indexOf(typeof g)>-1&&u<a.length-1)continue;f+=u-f+1;break}c=g}return c},_l=i=>i==null?void 0:i.replace("_","-"),DR={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||DR,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:(Xe(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 g=0;g<f;g++)c(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,f])=>{for(let g=0;g<f;g++)c.apply(c,[r,...s])})}}class E0 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,g=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):Xe(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||!g||!Xe(a)?u:$f((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 g=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let l=[r,s];a&&(l=l.concat(g?a.split(g):a)),r.indexOf(".")>-1&&(l=r.split("."),c=s,s=l[1]),this.addNamespaces(s),C0(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)(Xe(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,g={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)||{};g.skipCopy||(a=JSON.parse(JSON.stringify(a))),c?xb(u,a,f):u={...u,...a},C0(this.data,l,u),g.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 Rb={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,r,s,a,c){return i.forEach(f=>{var g;r=((g=this.processors[f])==null?void 0:g.process(r,s,a,c))??r}),r}};const Tb=Symbol("i18next/PATH_KEY");function OR(){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===Tb?i:(i.push(c),s=Proxy.revocable(a,r),s.proxy)},Proxy.revocable(Object.create(null),r).proxy}function Kf(i,r){const{[Tb]:s}=i(OR());return s.join((r==null?void 0:r.keySeparator)??".")}const x0={},lf=i=>!Xe(i)&&typeof i!="boolean"&&typeof i!="number";class gu extends Nu{constructor(r,s={}){super(),_R(["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 g=a&&r.indexOf(a)>-1,l=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!TR(r,a,c);if(g&&!l){const u=r.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:r,namespaces:Xe(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:Xe(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=Kf(r,{...this.options,...c})),Array.isArray(r)||(r=[String(r)]);const f=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,g=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 x=(C==null?void 0:C.usedKey)||l,m=(C==null?void 0:C.exactUsedKey)||l,v=["[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&&!Xe(c.count),D=gu.hasDefaultValue(c),A=E?this.pluralResolver.getSuffix(d,c.count,c):"",O=c.ordinal&&E?this.pluralResolver.getSuffix(d,c.count,{ordinal:!1}):"",T=E&&!c.ordinal&&c.count===0,L=T&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${A}`]||c[`defaultValue${O}`]||c.defaultValue;let U=R;y&&!R&&D&&(U=L);const V=lf(U),j=Object.prototype.toString.apply(U);if(y&&U&&V&&v.indexOf(j)<0&&!(Xe(_)&&Array.isArray(U))){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(x,U,{...c,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return f?(C.res=$,C.usedParams=this.getUsedParamsDetails(c),C):$}if(g){const $=Array.isArray(U),Z=$?[]:{},X=$?m:x;for(const F in U)if(Object.prototype.hasOwnProperty.call(U,F)){const Y=`${X}${g}${F}`;D&&!R?Z[F]=this.translate(Y,{...c,defaultValue:lf(L)?L[F]:void 0,joinArrays:!1,ns:u}):Z[F]=this.translate(Y,{...c,joinArrays:!1,ns:u}),Z[F]===Y&&(Z[F]=U[F])}R=Z}}else if(y&&Xe(_)&&Array.isArray(R))R=R.join(_),R&&(R=this.extendTranslation(R,r,c,a));else{let $=!1,Z=!1;!this.isValidLookup(R)&&D&&($=!0,R=L),this.isValidLookup(R)||(Z=!0,R=l);const F=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Z?void 0:R,Y=D&&L!==R&&this.options.updateMissing;if(Z||$||Y){if(this.logger.log(Y?"updateKey":"missingKey",d,h,l,Y?L:R),g){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,q,Q)=>{var se;const te=D&&Q!==R?Q:F;this.options.missingKeyHandler?this.options.missingKeyHandler(B,h,q,te,Y,c):(se=this.backendConnector)!=null&&se.saveMissing&&this.backendConnector.saveMissing(B,h,q,te,Y,c),this.emit("missingKey",B,h,q,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?k.forEach(B=>{const q=this.pluralResolver.getSuffixes(B,c);T&&c[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(Q=>{K([B],l+Q,c[`defaultValue${Q}`]||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=Xe(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&&!Xe(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 g=a.postProcess||this.options.postProcess,l=Xe(g)?[g]:g;return r!=null&&(l!=null&&l.length)&&a.applyPostProcessor!==!1&&(r=Rb.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,g,l;return Xe(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&&!Xe(s.count),C=w&&!s.ordinal&&s.count===0,R=s.context!==void 0&&(Xe(s.context)||typeof s.context=="number")&&s.context!=="",x=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);d.forEach(m=>{var v,_;this.isValidLookup(a)||(l=m,!x0[`${x[0]}-${m}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((_=this.utils)!=null&&_.hasLoadedNamespace(l))&&(x0[`${x[0]}-${m}`]=!0,this.logger.warn(`key "${c}" for languages "${x.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!!!")),x.forEach(y=>{var A;if(this.isValidLookup(a))return;g=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 T=`${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+T)),R){const U=`${b}${this.options.contextSeparator||"_"}${s.context}`;E.push(U),w&&(s.ordinal&&O.indexOf(L)===0&&E.push(U+O.replace(L,this.options.pluralSeparator)),E.push(U+O),C&&E.push(U+T))}}let D;for(;D=E.pop();)this.isValidLookup(a)||(f=D,a=this.getResource(y,m,D,s))}))})}),{res:a,usedKey:c,exactUsedKey:f,usedLng:g,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&&!Xe(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 R0{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(Xe(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(g=>{if(g===f)return g;if(!(g.indexOf("-")<0&&f.indexOf("-")<0)&&(g.indexOf("-")>0&&f.indexOf("-")<0&&g.substring(0,g.indexOf("-"))===f||g.indexOf(f)===0&&f.length>1))return g})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(r,s){if(!r)return[];if(typeof r=="function"&&(r=r(s)),Xe(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=g=>{g&&(this.isSupportedCode(g)?c.push(g):this.logger.warn(`rejecting language code not found in supportedLngs: ${g}`))};return Xe(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))):Xe(r)&&f(this.formatLanguageCode(r)),a.forEach(g=>{c.indexOf(g)<0&&f(this.formatLanguageCode(g))}),c}}const T0={zero:0,one:1,two:2,few:3,many:4,other:5},D0={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class AR{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 g;try{g=new Intl.PluralRules(a,{type:c})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),D0;if(!r.match(/-|_/))return D0;const u=this.languageUtils.getLanguagePartFromCode(r);g=this.getRule(u,s)}return this.pluralRulesCache[f]=g,g}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)=>T0[c]-T0[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 O0=(i,r,s,a=".",c=!0)=>{let f=SR(i,r,s);return!f&&c&&Xe(s)&&(f=$f(i,s,a),f===void 0&&(f=$f(r,s,a))),f},cf=i=>i.replace(/\$/g,"$$$$");class A0{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:g,suffix:l,suffixEscaped:u,formatSeparator:h,unescapeSuffix:b,unescapePrefix:d,nestingPrefix:w,nestingPrefixEscaped:C,nestingSuffix:R,nestingSuffixEscaped:x,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:_}=r.interpolation;this.escape=s!==void 0?s:CR,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=f?Na(f):g||"{{",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):x||Na(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||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,g,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=R=>{if(R.indexOf(this.formatSeparator)<0){const _=O0(s,u,R,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,a,{...c,...s,interpolationkey:R}):_}const x=R.split(this.formatSeparator),m=x.shift().trim(),v=x.join(this.formatSeparator).trim();return this.format(O0(s,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),v,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 x=f[1].trim();if(g=h(x),g===void 0)if(typeof b=="function"){const v=b(r,f,c);g=Xe(v)?v:""}else if(c&&Object.prototype.hasOwnProperty.call(c,x))g="";else if(d){g=f[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${r}`),g="";else!Xe(g)&&!this.useRawValueToEscape&&(g=b0(g));const m=R.safeValue(g);if(r=r.replace(f[0],m),d?(R.regex.lastIndex+=g.length,R.regex.lastIndex-=f[0].length):R.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),r}nest(r,s,a={}){let c,f,g;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,g);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{g=JSON.parse(w),h&&(g={...h,...g})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${b}${w}`}return g.defaultValue&&g.defaultValue.indexOf(this.prefix)>-1&&delete g.defaultValue,u};for(;c=this.nestingRegexp.exec(r);){let u=[];g={...a},g=g.replace&&!Xe(g.replace)?g.replace:g,g.applyPostProcessor=!1,delete g.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(),g),g),f&&c[0]===r&&!Xe(f))return f;Xe(f)||(f=b0(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 LR=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(g=>{if(g){const[l,...u]=g.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}},L0=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 g=a+JSON.stringify(f);let l=r[g];return l||(l=i(_l(a),c),r[g]=l),l(s)}},MR=i=>(r,s,a)=>i(_l(s),a)(r);class kR{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?L0:MR;this.formats={number:a((c,f)=>{const g=new Intl.NumberFormat(c,{...f});return l=>g.format(l)}),currency:a((c,f)=>{const g=new Intl.NumberFormat(c,{...f,style:"currency"});return l=>g.format(l)}),datetime:a((c,f)=>{const g=new Intl.DateTimeFormat(c,{...f});return l=>g.format(l)}),relativetime:a((c,f)=>{const g=new Intl.RelativeTimeFormat(c,{...f});return l=>g.format(l,f.range||"day")}),list:a((c,f)=>{const g=new Intl.ListFormat(c,{...f});return l=>g.format(l)})}}add(r,s){this.formats[r.toLowerCase().trim()]=s}addCached(r,s){this.formats[r.toLowerCase().trim()]=L0(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}=LR(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 BR=(i,r)=>{i.pending[r]!==void 0&&(delete i.pending[r],i.pendingCount--)};class NR extends Nu{constructor(r,s,a,c={}){var f,g;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=[],(g=(f=this.backend)==null?void 0:f.init)==null||g.call(f,a,c.backend,c)}queueLoad(r,s,a,c){const f={},g={},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?g[w]===void 0&&(g[w]=!0):(this.state[w]=1,b=!1,g[w]===void 0&&(g[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(g).length)&&this.queue.push({pending:g,pendingCount:Object.keys(g).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(f),pending:Object.keys(g),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(u)}}loaded(r,s,a){const c=r.split("|"),f=c[0],g=c[1];s&&this.emit("failedLoading",f,g,s),!s&&a&&this.store.addResourceBundle(f,g,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=>{bR(u.loaded,[f],g),BR(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,g){if(!r.length)return g(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:s,fcName:a,tried:c,wait:f,callback:g});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,g)},f);return}g(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();Xe(r)&&(r=this.languageUtils.toResolveHierarchy(r)),Xe(s)&&(s=[s]);const f=this.queueLoad(r,s,a,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(g=>{this.loadOne(g)})}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,(g,l)=>{g&&this.logger.warn(`${s}loading namespace ${f} for language ${c} failed`,g),!g&&l&&this.logger.log(`${s}loaded namespace ${f} for language ${c}`,l),this.loaded(r,g,l)})}saveMissing(r,s,a,c,f,g={},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={...g,isUpdate:f},R=this.backend.create.bind(this.backend);if(R.length<6)try{let x;R.length===5?x=R(r,s,a,c,C):x=R(r,s,a,c),x&&typeof x.then=="function"?x.then(m=>l(null,m)).catch(l):l(null,x)}catch(x){l(x)}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]),Xe(i[1])&&(r.defaultValue=i[1]),Xe(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}),M0=i=>{var r,s;return Xe(i.ns)&&(i.ns=[i.ns]),Xe(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),Xe(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=()=>{},jR=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(s=>{typeof i[s]=="function"&&(i[s]=i[s].bind(i))})},HR=i=>{var r,s,a,c,f,g,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=(g=(f=(c=i==null?void 0:i.modules)==null?void 0:c.backend)==null?void 0:f.constructor)==null?void 0:g.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=M0(r),this.services={},this.logger=Wr,this.modules={external:[]},jR(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&&(Xe(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const a=uf();this.options={...a,...this.options,...M0(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&&!HR(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=kR;const b=new R0(this.options);this.store=new E0(this.options.resources,this.options);const d=this.services;d.logger=Wr,d.resourceStore=this.store,d.languageUtils=b,d.pluralResolver=new AR(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 A0(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new NR(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,g;let a=s;const c=Xe(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)),(g=(f=this.options.preload)==null?void 0:f.forEach)==null||g.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"&&Rb.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))},g=l=>{var b,d;!r&&!l&&this.services.languageDetector&&(l=[]);const u=Xe(l)?l:l&&l[0],h=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Xe(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?g(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(g):this.services.languageDetector.detect(g):g(r),a}getFixedT(r,s,a){const c=(f,g,...l)=>{let u;typeof g!="object"?u=this.options.overloadTranslationOptionHandler([f,g].concat(l)):u={...g},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=Kf(d,{...this.options,...g})),`${u.keyPrefix}${h}${d}`)):(typeof f=="function"&&(f=Kf(f,{...this.options,...g})),b=u.keyPrefix?`${u.keyPrefix}${h}${f}`:f),this.t(b,u)};return Xe(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 g=(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,g);if(l!==void 0)return l}return!!(this.hasResourceBundle(a,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||g(a,r)&&(!c||g(f,r)))}loadNamespaces(r,s){const a=tl();return this.options.ns?(Xe(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();Xe(r)&&(r=[r]);const c=this.options.preload||[],f=r.filter(g=>c.indexOf(g)<0&&this.services.languageUtils.isSupportedCode(g));return f.length?(this.options.preload=c.concat(f),this.loadResources(g=>{a.resolve(),s&&s(g)}),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 g=new Intl.Locale(r);if(g&&g.getTextInfo){const l=g.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 R0(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 E0(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 A0(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 xi=cl.createInstance();xi.createInstance;xi.dir;xi.init;xi.loadResources;xi.reloadResources;xi.use;xi.changeLanguage;xi.getFixedT;xi.t;xi.exists;xi.setDefaultNamespace;xi.hasLoadedNamespace;xi.loadNamespaces;xi.loadLanguages;const PR=(i,r,s,a)=>{var f,g,l,u;const c=[s,{code:r,...a||{}}];if((g=(f=i==null?void 0:i.services)==null?void 0:f.logger)!=null&&g.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)},k0={},Db=(i,r,s,a)=>{Js(s)&&k0[s]||(Js(s)&&(k0[s]=new Date),PR(i,r,s,a))},Ob=(i,r)=>()=>{if(i.isInitialized)r();else{const s=()=>{setTimeout(()=>{i.off("initialized",s)},0),r()};i.on("initialized",s)}},Vf=(i,r,s)=>{i.loadNamespaces(r,Ob(i,s))},B0=(i,r,s,a)=>{if(Js(s)&&(s=[s]),i.options.preload&&i.options.preload.indexOf(r)>-1)return Vf(i,s,a);s.forEach(c=>{i.options.ns.indexOf(c)<0&&i.options.ns.push(c)}),i.loadLanguages(r,Ob(i,a))},zR=(i,r,s={})=>!r.languages||!r.languages.length?(Db(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,IR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,FR={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},qR=i=>FR[i],$R=i=>i.replace(IR,qR);let Wf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$R,transDefaultProps:void 0};const KR=(i={})=>{Wf={...Wf,...i}},VR=()=>Wf;let Ab;const WR=i=>{Ab=i},YR=()=>Ab,GR={type:"3rdParty",init(i){KR(i.options.react),WR(i)}},XR=N.createContext();class QR{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 N0;function ZR(){if(N0)return df;N0=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,g=i.useDebugValue;function l(d,w){var C=w(),R=a({inst:{value:C,getSnapshot:w}}),x=R[0].inst,m=R[1];return f(function(){x.value=C,x.getSnapshot=w,u(x)&&m({inst:x})},[d,C,w]),c(function(){return u(x)&&m({inst:x}),d(function(){u(x)&&m({inst:x})})},[d]),g(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 j0;function Lb(){return j0||(j0=1,hf.exports=ZR()),hf.exports}var Mb=Lb();const JR=(i,r)=>Js(r)?r:UR(r)&&Js(r.defaultValue)?r.defaultValue:Array.isArray(i)?i[i.length-1]:i,e3={t:JR,ready:!1},t3=()=>()=>{},wr=(i,r={})=>{var L,U,V;const{i18n:s}=r,{i18n:a,defaultNS:c}=N.useContext(XR)||{},f=s||a||YR();f&&!f.reportNamespaces&&(f.reportNamespaces=new QR),f||Db(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const g=N.useMemo(()=>{var j;return{...VR(),...(j=f==null?void 0:f.options)==null?void 0:j.react,...r}},[f,r]),{useSuspense:l,keyPrefix:u}=g,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=(U=f==null?void 0:f.reportNamespaces)==null?void 0:U.addUsedNamespaces)==null||V.call(U,d);const w=N.useRef(0),C=N.useCallback(j=>{if(!f)return t3;const{bindI18n:$,bindI18nStore:Z}=g,X=()=>{w.current+=1,j()};return $&&f.on($,X),Z&&f.store.on(Z,X),()=>{$&&$.split(" ").forEach(F=>f.off(F,X)),Z&&Z.split(" ").forEach(F=>f.store.off(F,X))}},[f,g]),R=N.useRef(),x=N.useCallback(()=>{if(!f)return e3;const j=!!(f.isInitialized||f.initializedStoreOnce)&&d.every(k=>zR(k,f,g)),$=r.lng||f.language,Z=w.current,X=R.current;if(X&&X.ready===j&&X.lng===$&&X.keyPrefix===u&&X.revision===Z)return X;const Y={t:f.getFixedT($,g.nsMode==="fallback"?d:d[0],u),ready:j,lng:$,keyPrefix:u,revision:Z};return R.current=Y,Y},[f,d,u,g,r.lng]),[m,v]=N.useState(0),{t:_,ready:y}=Mb.useSyncExternalStore(C,x,x);N.useEffect(()=>{if(f&&!y&&!l){const j=()=>v($=>$+1);r.lng?B0(f,r.lng,d,j):Vf(f,d,j)}},[f,r.lng,d,y,l,m]);const E=f||{},D=N.useRef(null),A=N.useRef(),O=j=>{const $=Object.getOwnPropertyDescriptors(j);$.__original&&delete $.__original;const Z=Object.create(Object.getPrototypeOf(j),$);if(!Object.prototype.hasOwnProperty.call(Z,"__original"))try{Object.defineProperty(Z,"__original",{value:j,writable:!1,enumerable:!1,configurable:!1})}catch{}return Z},T=N.useMemo(()=>{const j=E,$=j==null?void 0:j.language;let Z=j;j&&(D.current&&D.current.__original===j?A.current!==$?(Z=O(j),D.current=Z,A.current=$):Z=D.current:(Z=O(j),D.current=Z,A.current=$));const X=[_,Z,y];return X.t=_,X.i18n=Z,X.ready=y,X},[_,E,y,E.resolvedLanguage,E.language,E.languages]);if(f&&l&&!y)throw new Promise(j=>{const $=()=>j();r.lng?B0(f,r.lng,d,$):Vf(f,d,$)});return T},i3={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"},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:"必填"},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 设备需要填写主机地址"}}}},Yf="en_US";function kb(i){return i.replace("_","-")}const H0=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},r3=(i=>i?H0(i):H0),n3=i=>i;function s3(i,r=n3){const s=xe.useSyncExternalStore(i.subscribe,xe.useCallback(()=>r(i.getState()),[i,r]),xe.useCallback(()=>r(i.getInitialState()),[i,r]));return xe.useDebugValue(s),s}const P0=i=>{const r=r3(i),s=a=>s3(r,a);return Object.assign(s,r),s},Om=(i=>i?P0(i):P0),z0={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,enableBrowserBellToast:!0,enableTelegramBellPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Yf,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=Om((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:z0,loading:!1}),z0}},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=[],a3=100,o3=500,Gf=new Map,l3=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function Bb(i){const r=Date.now(),s=Gf.get(i);return s!==void 0&&r-s<o3?!0:(Gf.set(i,r),!1)}function c3(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 g=new TextDecoder().decode(i.slice(f,f+c)),l=i.slice(f+c);return{deviceId:s,paneId:g,output:l}}function u3(){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<a3&&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=u3();for(const c of r().connectedDevices)a.has(c)||Bb(c)||mr({type:"device/connect",payload:{deviceId:c}})},ki.onmessage=async a=>{if(a.data instanceof Blob){const f=await a.data.arrayBuffer(),g=new Uint8Array(f),l=c3(g);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(g=>({deviceConnected:{...g.deviceConnected,[f]:!0},deviceErrors:{...g.deviceErrors,[f]:void 0}}));return}case"device/disconnected":{const f=c.payload.deviceId;i(g=>({deviceConnected:{...g.deviceConnected,[f]:!1}}));return}case"event/device":{const f=c.payload;if(f.type==="error"){const g=f.message??"Device Error";i(l=>{const u=l.deviceErrors[f.deviceId];return(u==null?void 0:u.message)===g&&(u==null?void 0:u.type)===f.errorType?{}:{deviceErrors:{...l.deviceErrors,[f.deviceId]:{message:g,type:f.errorType}}}});return}if(f.type==="disconnected"){i(g=>({deviceConnected:{...g.deviceConnected,[f.deviceId]:!1}}));return}return}case"state/snapshot":{const f=c.payload;i(g=>({snapshots:{...g.snapshots,[f.deviceId]:f}}));return}case"term/history":{const f=c.payload;for(const g of Bs)g.deviceId===f.deviceId&&g.paneId===f.paneId&&g.handler(f.data);return}case"event/tmux":{const f=c.payload;if(f.type==="bell"){const g=Tn.getState().settings;if((g==null?void 0:g.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 It=Om((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 g=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()}})),l3&&console.log("[tmux] connectDevice",{deviceId:s,ref:a,isFirstReference:g}),ff(i,r),g){if(Bb(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 g={...f};delete g[a];const l={...c.connectionRefs};if(Object.keys(g).length>0){l[s]=g,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}})),Gf.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 g=Date.now()-600*1e3;for(let l=Bs.length-1;l>=0;l--)Bs[l].subscribedAt<g&&Bs.splice(l,1);return()=>{const l=Bs.indexOf(f);l>=0&&Bs.splice(l,1)}}}));function h3(i,r){let s;try{s=i()}catch{return}return{getItem:c=>{var f;const g=u=>u===null?null:JSON.parse(u,void 0),l=(f=s.getItem(c))!=null?f:null;return l instanceof Promise?l.then(g):g(l)},setItem:(c,f)=>s.setItem(c,JSON.stringify(f,void 0)),removeItem:c=>s.removeItem(c)}}const Xf=i=>r=>{try{const s=i(r);return s instanceof Promise?s:{then(a){return Xf(a)(s)},catch(a){return this}}}catch(s){return{then(a){return this},catch(a){return Xf(a)(s)}}}},d3=(i,r)=>(s,a,c)=>{let f={storage:h3(()=>window.localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...r},g=!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,v)=>(w(m,v),d());const C=i((...m)=>(s(...m),d()),a,c);c.getInitialState=()=>C;let R;const x=()=>{var m,v;if(!b)return;const _=++l;g=!1,u.forEach(E=>{var D;return E((D=a())!=null?D:C)});const y=((v=f.onRehydrateStorage)==null?void 0:v.call(f,(m=a())!=null?m:C))||void 0;return Xf(b.getItem.bind(b))(f.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==f.version){if(f.migrate){const D=f.migrate(E.state,E.version);return D instanceof Promise?D.then(A=>[!0,A]):[!0,D]}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 D;if(_!==l)return;const[A,O]=E;if(R=f.merge(O,(D=a())!=null?D:C),s(R,!0),A)return d()}).then(()=>{_===l&&(y==null||y(R,void 0),R=a(),g=!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:()=>x(),hasHydrated:()=>g,onHydrate:m=>(u.add(m),()=>{u.delete(m)}),onFinishHydration:m=>(h.add(m),()=>{h.delete(m)})},f.skipHydration||x(),R||C},f3=d3,Ir=Om()(f3(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 Am(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 Nb(i){return encodeURIComponent(i)}const Rt=N.forwardRef(({className:i="",variant:r="default",size:s="default",asChild:a,children:c,...f},g)=>{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:g})}return P.jsx("button",{ref:g,className:`${l} ${u[r]} ${h[s]} ${i}`,...f,children:c})});Rt.displayName="Button";const Ei=N.forwardRef(({className:i="",...r},s)=>P.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}));Ei.displayName="Input";const jb=N.forwardRef(({className:i="",...r},s)=>P.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}));jb.displayName="Textarea";const _u=N.forwardRef(({className:i="",children:r,...s},a)=>P.jsxs("div",{className:"relative",children:[P.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}),P.jsx(xm,{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})=>P.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 Hb=N.createContext(void 0);function so(i){const r=N.useContext(Hb);if(i===!1&&r===void 0)throw new Error(Al(27));return r}const I0={};function ms(i,r){const s=N.useRef(I0);return s.current===I0&&(s.current=i(r)),s}function yu(i,r,s,a){const c=ms(Pb).current;return p3(c,i,r,s,a)&&zb(c,[i,r,s,a]),c.callback}function m3(i){const r=ms(Pb).current;return g3(r,i)&&zb(r,i),r.callback}function Pb(){return{callback:null,cleanup:null,refs:[]}}function p3(i,r,s,a,c){return i.refs[0]!==r||i.refs[1]!==s||i.refs[2]!==a||i.refs[3]!==c}function g3(i,r){return i.refs.length!==r.length||i.refs.some((s,a)=>s!==r[a])}function zb(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 g=f(s);typeof g=="function"&&(a[c]=g);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 g=a[c];typeof g=="function"?g():f(null);break}case"object":{f.current=null;break}}}}}}}const v3=parseInt(N.version,10);function Lm(i){return v3>=i}function F0(i){if(!N.isValidElement(i))return null;const r=i,s=r.props;return(Lm(19)?s==null?void 0:s.ref:r.ref)??null}function Qf(i,r){if(i&&!r)return i;if(!i&&r)return r;if(i||r)return{...i,...r}}function _3(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 y3(i,r){return typeof i=="function"?i(r):i}function b3(i,r){return typeof i=="function"?i(r):i}const ul={};function Ub(i,r,s,a,c){let f={...Zf(i,ul)};return r&&(f=lu(f,r)),s&&(f=lu(f,s)),a&&(f=lu(f,a)),f}function S3(i){if(i.length===0)return ul;if(i.length===1)return Zf(i[0],ul);let r={...Zf(i[0],ul)};for(let s=1;s<i.length;s+=1)r=lu(r,i[s]);return r}function lu(i,r){return Ib(r)?r(i):w3(i,r)}function w3(i,r){if(!r)return i;for(const s in r){const a=r[s];switch(s){case"style":{i[s]=Qf(i.style,a);break}case"className":{i[s]=Fb(i.className,a);break}default:C3(s,a)?i[s]=E3(i[s],a):i[s]=a}}return i}function C3(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 Ib(i){return typeof i=="function"}function Zf(i,r){return Ib(i)?i(r):i??ul}function E3(i,r){return r?i?s=>{if(x3(s)){const c=s;Jf(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 Jf(i){return i.preventBaseUIHandler=()=>{i.baseUIHandlerPrevented=!0},i}function Fb(i,r){return r?i?r+" "+i:r:i}function x3(i){return i!=null&&typeof i=="object"&&"nativeEvent"in i}function qb(){}const yr=Object.freeze({}),R3="data-base-ui-click-trigger",T3={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ll(i,r,s={}){const a=r.render,c=D3(r,s);if(s.enabled===!1)return null;const f=s.state??yr;return O3(i,a,c,f)}function D3(i,r={}){const{className:s,style:a,render:c}=i,{state:f=yr,ref:g,props:l,stateAttributesMapping:u,enabled:h=!0}=r,b=h?y3(s,f):void 0,d=h?b3(a,f):void 0,w=h?_3(f,u):yr,C=h?Qf(w,Array.isArray(l)?S3(l):l)??yr:yr;return typeof document<"u"&&(h?Array.isArray(g)?C.ref=m3([C.ref,F0(c),...g]):C.ref=yu(C.ref,F0(c),g):yu(null,null)),h?(b!==void 0&&(C.className=Fb(C.className,b)),d!==void 0&&(C.style=Qf(C.style,d)),C):yr}function O3(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 A3(i,s);throw new Error(Al(8))}function A3(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 L3={[bu.startingStyle]:""},M3={[bu.endingStyle]:""},$b={transitionStatus(i){return i==="starting"?L3:i==="ending"?M3: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 k3={[zs.open]:""},B3={[zs.closed]:""},N3={[zs.anchorHidden]:""},Kb={open(i){return i?k3:B3},anchorHidden(i){return i?N3:null}},j3={...Kb,...$b},H3=N.forwardRef(function(r,s){const{render:a,className:c,forceRender:f=!1,...g}=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:j3,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},g],enabled:f||!h})});function ju(){return typeof window<"u"}function Hu(i){return Mm(i)?(i.nodeName||"").toLowerCase():"#document"}function Qr(i){var r;return(i==null||(r=i.ownerDocument)==null?void 0:r.defaultView)||window}function P3(i){var r;return(r=(Mm(i)?i.ownerDocument:i.document)||window.document)==null?void 0:r.documentElement}function Mm(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 em(i){return!ju()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof Qr(i).ShadowRoot}const z3=new Set(["inline","contents"]);function Pu(i){const{overflow:r,overflowX:s,overflowY:a,display:c}=km(i);return/auto|scroll|overlay|hidden|clip/.test(r+a+s)&&!z3.has(c)}function U3(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const I3=new Set(["html","body","#document"]);function cu(i){return I3.has(Hu(i))}function km(i){return Qr(i).getComputedStyle(i)}function Vb(i){if(Hu(i)==="html")return i;const r=i.assignedSlot||i.parentNode||em(i)&&i.host||P3(i);return em(r)?r.host:r}function Wb(i){const r=Vb(i);return cu(r)?i.ownerDocument?i.ownerDocument.body:i.body:En(r)&&Pu(r)?r:Wb(r)}function hl(i,r,s){var a;r===void 0&&(r=[]),s===void 0&&(s=!0);const c=Wb(i),f=c===((a=i.ownerDocument)==null?void 0:a.body),g=Qr(c);if(f){const l=F3(g);return r.concat(g,g.visualViewport||[],Pu(c)?c:[],l&&s?hl(l):[])}return r.concat(c,hl(c,[],s))}function F3(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}const mf=dm[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],q3=mf&&mf!==N.useLayoutEffect?mf:i=>i();function At(i){const r=ms($3).current;return r.next=i,q3(r.effect),r.trampoline}function $3(){const i={next:void 0,callback:K3,trampoline:(...r)=>{var s;return(s=i.callback)==null?void 0:s.call(i,...r)},effect:()=>{i.callback=i.next}};return i}function K3(){}const V3=()=>{},vi=typeof document<"u"?N.useLayoutEffect:V3,W3=N.createContext(void 0);function Y3(i=!1){const r=N.useContext(W3);if(r===void 0&&!i)throw new Error(Al(16));return r}function G3(i){const{focusableWhenDisabled:r,disabled:s,composite:a=!1,tabIndex:c=0,isNativeButton:f}=i,g=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||g)||!f&&s)&&(h["aria-disabled"]=s),f&&(!r||l)&&(h.disabled=s),h},[a,s,r,g,l,f,c])}}function X3(i={}){const{disabled:r=!1,focusableWhenDisabled:s,tabIndex:a=0,native:c=!0}=i,f=N.useRef(null),g=Y3(!0)!==void 0,l=At(()=>{const w=f.current;return!!((w==null?void 0:w.tagName)==="A"&&(w!=null&&w.href))}),{props:u}=G3({focusableWhenDisabled:s,disabled:r,composite:g,tabIndex:a,isNativeButton:c}),h=N.useCallback(()=>{const w=f.current;Q3(w)&&g&&r&&u.disabled===void 0&&w.disabled&&(w.disabled=!1)},[r,u.disabled,g]);vi(h,[h]);const b=N.useCallback((w={})=>{const{onClick:C,onMouseDown:R,onKeyUp:x,onKeyDown:m,onPointerDown:v,..._}=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||(Jf(E),m==null||m(E)),E.baseUIHandlerPrevented)return;const D=E.target===E.currentTarget&&!c&&!l()&&!r,A=E.key==="Enter",O=E.key===" ";D&&((O||A)&&E.preventDefault(),A&&(C==null||C(E)))},onKeyUp(E){r||(Jf(E),x==null||x(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!c&&!r&&E.key===" "&&(C==null||C(E))},onPointerDown(E){if(r){E.preventDefault();return}v==null||v(E)}},c?void 0:{role:"button"},u,_)},[r,u,c,l]),d=At(w=>{f.current=w,h()});return{getButtonProps:b,buttonRef:d}}function Q3(i){return En(i)&&i.tagName==="BUTTON"}const Z3="none",q0="trigger-press",J3="trigger-hover",Yb="outside-press",eT="close-press",Gb="focus-out",tT="escape-key",iT="imperative-action";function xn(i,r,s,a){let c=!1,f=!1;const g=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,...g}}const rT=N.forwardRef(function(r,s){const{render:a,className:c,disabled:f=!1,nativeButton:g=!0,...l}=r,{store:u}=so(),h=u.useState("open");function b(R){h&&u.setOpen(!1,xn(eT,R.nativeEvent))}const{getButtonProps:d,buttonRef:w}=X3({disabled:f,native:g}),C=N.useMemo(()=>({disabled:f}),[f]);return Ll("button",r,{state:C,ref:[s,w],props:[{onClick:b},l,d]})}),nT={...dm};let $0=0;function sT(i,r="mui"){const[s,a]=N.useState(i),c=i||s;return N.useEffect(()=>{s==null&&($0+=1,a(`${r}-${$0}`))},[s,r]),c}const K0=nT.useId;function zu(i,r){if(K0!==void 0){const s=K0();return i??(r?`${r}-${s}`:s)}return sT(i,r)}function aT(i){return zu(i,"base-ui")}const oT=[];function Xb(i){N.useEffect(i,oT)}const il=0;class to{constructor(){Ht(this,"currentId",il);Ht(this,"clear",()=>{this.currentId!==il&&(clearTimeout(this.currentId),this.currentId=il)});Ht(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 Xb(i.disposeEffect),i}function al(i){const r=ms(lT,i).current;return r.next=i,vi(r.effect),r}function lT(i){const r={current:i,next:i,effect:()=>{r.current=r.next}};return r}const ao=typeof navigator<"u",pf=fT(),Qb=pT(),Zb=mT(),cT=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),uT=pf.platform==="MacIntel"&&pf.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(pf.platform),hT=ao&&/apple/i.test(navigator.vendor),tm=ao&&/android/i.test(Qb)||/android/i.test(Zb);ao&&Qb.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const dT=Zb.includes("jsdom/");function fT(){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 mT(){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 pT(){if(!ao)return"";const i=navigator.userAgentData;return i!=null&&i.platform?i.platform:navigator.platform??""}const im="data-base-ui-focusable",Jb="active",e1="selected",gT="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 li(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&&em(s)){let c=r;for(;c;){if(i===c)return!0;c=c.parentNode||c.host}}return!1}function kr(i){return"composedPath"in i?i.composedPath()[0]:i.target}function Ar(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 vT(i){return i.matches("html,body")}function Yi(i){return(i==null?void 0:i.ownerDocument)||document}function _T(i){return En(i)&&i.matches(gT)}function V0(i){return i?i.getAttribute("role")==="combobox"&&_T(i):!1}function rm(i){return i?i.hasAttribute(im)?i:i.querySelector(`[${im}]`)||i:null}function Ua(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,...Ua(i,c.id,s)])}function W0(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(g=>g.id===a);a=f==null?void 0:f.parentId,f&&(s=s.concat(f))}return s}function yT(i){i.preventDefault(),i.stopPropagation()}function bT(i){return"nativeEvent"in i}function ST(i){return i.mozInputSource===0&&i.isTrusted?!0:tm&&i.pointerType?i.type==="click"&&i.buttons===1:i.detail===0&&!i.pointerType}function wT(i){return dT?!1:!tm&&i.width===0&&i.height===0||tm&&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 CT(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 ET=["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=ET.join(","),t1=typeof Element>"u",io=t1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cu=!t1&&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",g=f||s&&r&&(typeof r.closest=="function"?r.closest("[inert]"):Eu(r.parentNode));return g},xT=function(r){var s,a=r==null||(s=r.getAttribute)===null||s===void 0?void 0:s.call(r,"contenteditable");return a===""||a==="true"},i1=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 g=f.shift();if(!Eu(g,!1))if(g.tagName==="SLOT"){var l=g.assignedElements(),u=l.length?l:g.children,h=xu(u,!0,a);a.flatten?c.push.apply(c,h):c.push({scopeParent:g,candidates:h})}else{var b=io.call(g,wu);b&&a.filter(g)&&(s||!r.includes(g))&&c.push(g);var d=g.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(g),w=!Eu(d,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(g));if(d&&w){var C=xu(d===!0?g.children:d.children,!0,a);a.flatten?c.push.apply(c,C):c.push({scopeParent:g,candidates:C})}else f.unshift.apply(f,g.children)}}return c},r1=function(r){return!isNaN(parseInt(r.getAttribute("tabindex"),10))},n1=function(r){if(!r)throw new Error("No node provided");return r.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(r.tagName)||xT(r))&&!r1(r)?0:r.tabIndex},RT=function(r,s){var a=n1(r);return a<0&&s&&!r1(r)?0:a},TT=function(r,s){return r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex},s1=function(r){return r.tagName==="INPUT"},DT=function(r){return s1(r)&&r.type==="hidden"},OT=function(r){var s=r.tagName==="DETAILS"&&Array.prototype.slice.apply(r.children).some(function(a){return a.tagName==="SUMMARY"});return s},AT=function(r,s){for(var a=0;a<r.length;a++)if(r[a].checked&&r[a].form===s)return r[a]},LT=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(g){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",g.message),!1}var f=AT(c,r.form);return!f||f===r},MT=function(r){return s1(r)&&r.type==="radio"},kT=function(r){return MT(r)&&!LT(r)},BT=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 g,l,u;for(f=!!((g=c)!==null&&g!==void 0&&(l=g.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},Y0=function(r){var s=r.getBoundingClientRect(),a=s.width,c=s.height;return a===0&&c===0},NT=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 g=io.call(r,"details>summary:first-of-type"),l=g?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 Y0(r);r.assignedSlot?r=r.assignedSlot:!h&&b!==r.ownerDocument?r=b.host:r=h}r=u}if(BT(r))return!r.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return Y0(r);return!1},jT=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},nm=function(r,s){return!(s.disabled||DT(s)||NT(s,r)||OT(s)||jT(s))},sm=function(r,s){return!(kT(s)||n1(s)<0||!nm(r,s))},HT=function(r){var s=parseInt(r.getAttribute("tabindex"),10);return!!(isNaN(s)||s>=0)},a1=function(r){var s=[],a=[];return r.forEach(function(c,f){var g=!!c.scopeParent,l=g?c.scopeParent:c,u=RT(l,g),h=g?a1(c.candidates):l;u===0?g?s.push.apply(s,h):s.push(l):a.push({documentOrder:f,tabIndex:u,item:c,isScope:g,content:h})}),a.sort(TT).reduce(function(c,f){return f.isScope?c.push.apply(c,f.content):c.push(f.content),c},[]).concat(s)},Uu=function(r,s){s=s||{};var a;return s.getShadowRoot?a=xu([r],s.includeContainer,{filter:sm.bind(null,s),flatten:!1,getShadowRoot:s.getShadowRoot,shadowRootFilter:HT}):a=i1(r,s.includeContainer,sm.bind(null,s)),a1(a)},PT=function(r,s){s=s||{};var a;return s.getShadowRoot?a=xu([r],s.includeContainer,{filter:nm.bind(null,s),flatten:!0,getShadowRoot:s.getShadowRoot}):a=i1(r,s.includeContainer,nm.bind(null,s)),a},o1=function(r,s){if(s=s||{},!r)throw new Error("No node provided");return io.call(r,wu)===!1?!1:sm(s,r)};const Ml=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function l1(i,r){const s=Uu(i,Ml()),a=s.length;if(a===0)return;const c=Ha(Yi(i)),f=s.indexOf(c),g=f===-1?r===1?0:a-1:f+r;return s[g]}function c1(i){return l1(Yi(i).body,1)||i}function u1(i){return l1(Yi(i).body,-1)||i}function dl(i,r){const s=r||i.currentTarget,a=i.relatedTarget;return!a||!li(s,a)}function zT(i){Uu(i,Ml()).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function G0(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 IT=N.createContext(null),FT=N.createContext(null),h1=()=>{var i;return((i=N.useContext(IT))==null?void 0:i.id)||null},d1=i=>{const r=N.useContext(FT);return i??r};function Ru(i){return`data-base-ui-${i}`}const f1={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 qT{constructor(){Ht(this,"callbacks",[]);Ht(this,"callbacksCount",0);Ht(this,"nextId",1);Ht(this,"startId",1);Ht(this,"isScheduled",!1);Ht(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 qT;class Kr{constructor(){Ht(this,"currentId",Qc);Ht(this,"cancel",()=>{this.currentId!==Qc&&(Zc.cancel(this.currentId),this.currentId=Qc)});Ht(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 m1(){const i=ms(Kr.create).current;return Xb(i.disposeEffect),i}function Iu(i){return(i==null?void 0:i.ownerDocument)||document}const Tu=N.forwardRef(function(r,s){const[a,c]=N.useState();vi(()=>{hT&&c("button")},[]);const f={tabIndex:0,role:a};return P.jsx("span",{...r,ref:s,style:f1,"aria-hidden":a?void 0:!0,...f,"data-base-ui-focus-guard":""})});let X0=0;function gf(i,r={}){const{preventScroll:s=!1,cancelPrevious:a=!0,sync:c=!1}=r;a&&cancelAnimationFrame(X0);const f=()=>i==null?void 0:i.focus({preventScroll:s});c?f():X0=requestAnimationFrame(f)}const Ia={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Q0(i){return i==="inert"?Ia.inert:i==="aria-hidden"?Ia["aria-hidden"]:Ia.none}let Jc=new WeakSet,eu={},vf=0;const p1=i=>i&&(i.host||p1(i.parentNode)),$T=(i,r)=>r.map(s=>{if(i.contains(s))return s;const a=p1(s);return i.contains(a)?a:null}).filter(s=>s!=null);function KT(i,r,s,a){const c="data-base-ui-inert",f=a?"inert":s?"aria-hidden":null,g=$T(r,i),l=new Set,u=new Set(g),h=[];eu[c]||(eu[c]=new WeakMap);const b=eu[c];g.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 x=f?R.getAttribute(f):null,m=x!==null&&x!=="false",v=Q0(f),_=(v.get(R)||0)+1,y=(b.get(R)||0)+1;v.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=Q0(f),m=(R.get(C)||0)-1,v=(b.get(C)||0)-1;R.set(C,m),b.set(C,v),m||(!Jc.has(C)&&f&&C.removeAttribute(f),Jc.delete(C)),v||C.removeAttribute(c)}),vf-=1,vf||(Ia.inert=new WeakMap,Ia["aria-hidden"]=new WeakMap,Ia.none=new WeakMap,Jc=new WeakSet,eu={})}}function VT(i,r=!1,s=!1){const a=Yi(i[0]).body;return KT(i.concat(Array.from(a.querySelectorAll("[aria-live]"))),a,r,s)}const g1=N.createContext(null),v1=()=>N.useContext(g1),WT=Ru("portal");function YT(i={}){const{ref:r,container:s,componentProps:a=yr,elementProps:c,elementState:f}=i,g=zu(),l=v1(),u=l==null?void 0:l.portalNode,[h,b]=N.useState(null),[d,w]=N.useState(null),C=N.useRef(null);vi(()=>{if(s===null){C.current&&(C.current=null,w(null),b(null));return}if(g==null)return;const m=(s&&(Mm(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,g]);const R=Ll("div",a,{ref:[r,w],state:f,props:[{id:g,[WT]:""},c]});return{portalNode:d,portalSubtree:h&&R?eo.createPortal(R,h):null}}const GT=N.forwardRef(function(r,s){const{children:a,container:c,className:f,render:g,renderGuards:l,...u}=r,{portalNode:h,portalSubtree:b}=YT({container:c,ref:s,componentProps:r,elementProps:u}),d=N.useRef(null),w=N.useRef(null),C=N.useRef(null),R=N.useRef(null),[x,m]=N.useState(null),v=x==null?void 0:x.modal,_=x==null?void 0:x.open,y=typeof l=="boolean"?l:!!x&&!x.modal&&x.open&&!!h;N.useEffect(()=>{if(!h||v)return;function D(A){h&&dl(A)&&(A.type==="focusin"?G0:zT)(h)}return h.addEventListener("focusin",D,!0),h.addEventListener("focusout",D,!0),()=>{h.removeEventListener("focusin",D,!0),h.removeEventListener("focusout",D,!0)}},[h,v]),N.useEffect(()=>{!h||_||G0(h)},[_,h]);const E=N.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:R,portalNode:h,setFocusManagerState:m}),[h]);return P.jsxs(N.Fragment,{children:[b,P.jsxs(g1.Provider,{value:E,children:[y&&h&&P.jsx(Tu,{"data-type":"outside",ref:d,onFocus:D=>{var A;if(dl(D,h))(A=C.current)==null||A.focus();else{const O=x?x.domReference:null,T=u1(O);T==null||T.focus()}}}),y&&h&&P.jsx("span",{"aria-owns":h.id,style:T3}),h&&eo.createPortal(a,h),y&&h&&P.jsx(Tu,{"data-type":"outside",ref:w,onFocus:D=>{var A;if(dl(D,h))(A=R.current)==null||A.focus();else{const O=x?x.domReference:null,T=c1(O);T==null||T.focus(),x!=null&&x.closeOnFocusOut&&(x==null||x.onOpenChange(!1,xn(Gb,D.nativeEvent)))}}})]})]})});function js(i){return i==null?i:"current"in i?i.current:i}function XT(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 Z0=20;let hs=[];function Bm(){hs=hs.filter(i=>i.isConnected)}function QT(i){Bm(),i&&Hu(i)!=="body"&&(hs.push(i),hs.length>Z0&&(hs=hs.slice(-Z0)))}function _f(){return Bm(),hs[hs.length-1]}function ZT(i){if(!i)return null;const r=Ml();return o1(i,r)?i:Uu(i,r)[0]||i}function JT(i){return!i||!i.isConnected?!1:typeof i.checkVisibility=="function"?i.checkVisibility():km(i).display!=="none"}function J0(i,r){var g;if(!r.current.includes("floating")&&!((g=i.getAttribute("role"))!=null&&g.includes("dialog")))return;const s=Ml(),c=PT(i,s).filter(l=>{const u=l.getAttribute("data-tabindex")||"";return o1(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 eD(i){const{context:r,children:s,disabled:a=!1,order:c=["content"],initialFocus:f=!0,returnFocus:g=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:b="",getInsideElements:d=()=>[],nextFocusableElement:w,previousFocusableElement:C,beforeContentFocusGuardRef:R,externalTree:x}=i,m="rootStore"in r?r.rootStore:r,v=m.useState("open"),_=m.useState("domReferenceElement"),y=m.useState("floatingElement"),{events:E,dataRef:D}=m.context,A=At(()=>{var Ee;return(Ee=D.current.floatingContext)==null?void 0:Ee.nodeId}),O=At(d),T=f===!1,L=V0(_)&&T,U=al(c),V=al(f),j=al(g),$=al(b),Z=d1(x),X=v1(),F=N.useRef(null),Y=N.useRef(null),k=N.useRef(!1),z=N.useRef(!1),K=N.useRef(!1),B=N.useRef(-1),q=N.useRef(""),Q=N.useRef(""),te=Su(),se=Su(),be=m1(),H=X!=null,G=rm(y),ae=At((Ee=G)=>Ee?Uu(Ee,Ml()):[]),fe=At(Ee=>{const Se=ae(Ee);return U.current.map(()=>Se).filter(Boolean).flat()});N.useEffect(()=>{if(a||!u)return;function Ee(Ie){Ie.key==="Tab"&&li(G,Ha(Yi(G)))&&ae().length===0&&!L&&yT(Ie)}const Se=Yi(G);return Se.addEventListener("keydown",Ee),()=>{Se.removeEventListener("keydown",Ee)}},[a,_,G,u,U,L,ae,fe]),N.useEffect(()=>{if(a||!y)return;function Ee(Se){const Ie=kr(Se),ot=ae().indexOf(Ie);ot!==-1&&(B.current=ot)}return y.addEventListener("focusin",Ee),()=>{y.removeEventListener("focusin",Ee)}},[a,y,ae]),N.useEffect(()=>{if(a||!v)return;const Ee=Yi(G);function Se(){K.current=!1}function Ie(ot){const Ne=kr(ot),De=li(y,Ne)||li(_,Ne)||li(X==null?void 0:X.portalNode,Ne);K.current=!De,Q.current=ot.pointerType||"keyboard"}function je(){Q.current="keyboard"}return Ee.addEventListener("pointerdown",Ie,!0),Ee.addEventListener("pointerup",Se,!0),Ee.addEventListener("pointercancel",Se,!0),Ee.addEventListener("keydown",je,!0),()=>{Ee.removeEventListener("pointerdown",Ie,!0),Ee.removeEventListener("pointerup",Se,!0),Ee.removeEventListener("pointercancel",Se,!0),Ee.removeEventListener("keydown",je,!0)}},[a,y,_,G,v,X]),N.useEffect(()=>{if(a||!h)return;function Ee(){z.current=!0,se.start(0,()=>{z.current=!1})}function Se(Ne){const De=Ne.relatedTarget,$e=Ne.currentTarget,ze=kr(Ne);queueMicrotask(()=>{const nt=A(),Ct=m.context.triggerElements,xt=!(li(_,De)||li(y,De)||li(De,y)||li(X==null?void 0:X.portalNode,De)||De!=null&&Ct.hasElement(De)||Ct.hasMatchingElement(Je=>li(Je,De))||De!=null&&De.hasAttribute(Ru("focus-guard"))||Z&&(Ua(Z.nodesRef.current,nt).find(Je=>{var yt,_t;return li((yt=Je.context)==null?void 0:yt.elements.floating,De)||li((_t=Je.context)==null?void 0:_t.elements.domReference,De)})||W0(Z.nodesRef.current,nt).find(Je=>{var yt,_t,Pt;return[(yt=Je.context)==null?void 0:yt.elements.floating,rm((_t=Je.context)==null?void 0:_t.elements.floating)].includes(De)||((Pt=Je.context)==null?void 0:Pt.elements.domReference)===De})));if($e===_&&G&&J0(G,U),l&&$e!==_&&!JT(ze)&&Ha(Yi(G))===Yi(G).body){if(En(G)&&(G.focus(),l==="popup")){be.request(()=>{G.focus()});return}const Je=B.current,yt=ae(),_t=yt[Je]||yt[yt.length-1]||G;En(_t)&&_t.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(L||!u)&&De&&xt&&!z.current&&(L||De!==_f())&&(k.current=!0,m.setOpen(!1,xn(Gb,Ne)))})}function Ie(){K.current||(D.current.insideReactTree=!0,te.start(0,()=>{D.current.insideReactTree=!1}))}const je=En(_)?_:null,ot=[];if(!(!y&&!je))return je&&(je.addEventListener("focusout",Se),je.addEventListener("pointerdown",Ee),ot.push(()=>{je.removeEventListener("focusout",Se),je.removeEventListener("pointerdown",Ee)})),y&&(y.addEventListener("focusout",Se),X&&(y.addEventListener("focusout",Ie,!0),ot.push(()=>{y.removeEventListener("focusout",Ie,!0)})),ot.push(()=>{y.removeEventListener("focusout",Se)})),()=>{ot.forEach(Ne=>{Ne()})}},[a,_,y,G,u,Z,X,m,h,l,ae,L,A,U,D,te,se,be]);const me=N.useRef(null),ue=N.useRef(null),we=yu(me,R,X==null?void 0:X.beforeInsideRef),Ke=yu(ue,X==null?void 0:X.afterInsideRef);N.useEffect(()=>{var Ne,De,$e;if(a||!y||!v)return;const Ee=Array.from(((Ne=X==null?void 0:X.portalNode)==null?void 0:Ne.querySelectorAll(`[${Ru("portal")}]`))||[]),Ie=($e=(De=(Z?W0(Z.nodesRef.current,A()):[]).find(ze=>{var nt;return V0(((nt=ze.context)==null?void 0:nt.elements.domReference)||null)}))==null?void 0:De.context)==null?void 0:$e.elements.domReference,je=[y,Ie,...Ee,...O(),F.current,Y.current,me.current,ue.current,X==null?void 0:X.beforeOutsideRef.current,X==null?void 0:X.afterOutsideRef.current,js(C),js(w),L?_:null].filter(ze=>ze!=null),ot=VT(je,u||L);return()=>{ot()}},[v,a,_,y,u,U,X,L,Z,A,O,w,C]),vi(()=>{if(!v||a||!En(G))return;const Ee=Yi(G),Se=Ha(Ee);queueMicrotask(()=>{const Ie=fe(G),je=V.current,ot=typeof je=="function"?je($.current||""):je;if(ot===void 0||ot===!1)return;let Ne;ot===!0||ot===null?Ne=Ie[0]||G:Ne=js(ot),Ne=Ne||Ie[0]||G,!li(G,Se)&&gf(Ne,{preventScroll:Ne===G})})},[a,v,G,T,fe,V,$]),vi(()=>{if(a||!G)return;const Ee=Yi(G),Se=Ha(Ee);QT(Se);function Ie(Ne){if(Ne.open||(q.current=XT(Ne.nativeEvent,Q.current)),Ne.reason===J3&&Ne.nativeEvent.type==="mouseleave"&&(k.current=!0),Ne.reason===Yb)if(Ne.nested)k.current=!1;else if(ST(Ne.nativeEvent)||wT(Ne.nativeEvent))k.current=!1;else{let De=!1;document.createElement("div").focus({get preventScroll(){return De=!0,!1}}),De?k.current=!1:k.current=!0}}E.on("openchange",Ie);const je=Ee.createElement("span");je.setAttribute("tabindex","-1"),je.setAttribute("aria-hidden","true"),Object.assign(je.style,f1),H&&_&&_.insertAdjacentElement("afterend",je);function ot(){const Ne=j.current;let De=typeof Ne=="function"?Ne(q.current):Ne;if(De===void 0||De===!1)return null;if(De===null&&(De=!0),typeof De=="boolean"){const ze=_||_f();return ze&&ze.isConnected?ze:je}const $e=_||_f()||je;return js(De)||$e}return()=>{E.off("openchange",Ie);const Ne=Ha(Ee),De=li(y,Ne)||Z&&Ua(Z.nodesRef.current,A(),!1).some(ze=>{var nt;return li((nt=ze.context)==null?void 0:nt.elements.floating,Ne)}),$e=ot();queueMicrotask(()=>{const ze=ZT($e),nt=typeof j.current!="boolean";j.current&&!k.current&&En(ze)&&(!(!nt&&ze!==Ne&&Ne!==Ee.body)||De)&&ze.focus({preventScroll:!0}),je.remove()})}},[a,y,G,j,D,E,Z,H,_,A]),N.useEffect(()=>{queueMicrotask(()=>{k.current=!1})},[a]),N.useEffect(()=>{if(a||!v)return;function Ee(Ie){const je=kr(Ie);je!=null&&je.closest(`[${R3}]`)&&(z.current=!0)}const Se=Yi(G);return Se.addEventListener("pointerdown",Ee,!0),()=>{Se.removeEventListener("pointerdown",Ee,!0)}},[a,v,G]),vi(()=>{if(!a&&X)return X.setFocusManagerState({modal:u,closeOnFocusOut:h,open:v,onOpenChange:m.setOpen,domReference:_}),()=>{X.setFocusManagerState(null)}},[a,X,u,v,m,h,_]),vi(()=>{if(!(a||!G))return J0(G,U),()=>{queueMicrotask(Bm)}},[a,G,U]);const Pe=!a&&(u?!L:!0)&&(H||u);return P.jsxs(N.Fragment,{children:[Pe&&P.jsx(Tu,{"data-type":"inside",ref:we,onFocus:Ee=>{var Se;if(u){const Ie=fe();gf(Ie[Ie.length-1])}else if(X!=null&&X.portalNode)if(k.current=!1,dl(Ee,X.portalNode)){const Ie=c1(_);Ie==null||Ie.focus()}else(Se=js(C??X.beforeOutsideRef))==null||Se.focus()}}),s,Pe&&P.jsx(Tu,{"data-type":"inside",ref:Ke,onFocus:Ee=>{var Se;if(u)gf(fe()[0]);else if(X!=null&&X.portalNode)if(h&&(k.current=!0),dl(Ee,X.portalNode)){const Ie=u1(_);Ie==null||Ie.focus()}else(Se=js(w??X.afterOutsideRef))==null||Se.focus()}})]})}const tD={intentional:"onClick",sloppy:"onPointerDown"};function iD(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 rD(i,r={}){const s="rootStore"in i?i.rootStore:i,a=s.useState("open"),c=s.useState("floatingElement"),f=s.useState("referenceElement"),g=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:x=!1,bubbles:m,externalTree:v}=r,_=d1(v),y=At(typeof d=="function"?d:()=>!1),E=typeof d=="function"?y:d,D=N.useRef(!1),{escapeKey:A,outsidePress:O}=iD(m),T=N.useRef(null),L=Su(),U=Su(),V=At(()=>{U.clear(),u.current.insideReactTree=!1}),j=N.useRef(!1),$=N.useRef(""),Z=At(me=>{$.current=me.pointerType}),X=At(()=>{const me=$.current,ue=me==="pen"||!me?"mouse":me,we=typeof w=="function"?w():w;return typeof we=="string"?we:we[ue]}),F=At(me=>{var Ee;if(!a||!h||!b||me.key!=="Escape"||j.current)return;const ue=(Ee=u.current.floatingContext)==null?void 0:Ee.nodeId,we=_?Ua(_.nodesRef.current,ue):[];if(!A&&we.length>0){let Se=!0;if(we.forEach(Ie=>{var je;(je=Ie.context)!=null&&je.open&&!Ie.context.dataRef.current.__escapeKeyBubbles&&(Se=!1)}),!Se)return}const Ke=bT(me)?me.nativeEvent:me,Pe=xn(tT,Ke);s.setOpen(!1,Pe),!A&&!Pe.isPropagationAllowed&&me.stopPropagation()}),Y=At(me=>{const ue=X();return ue==="intentional"&&me.type!=="click"||ue==="sloppy"&&me.type==="click"}),k=At(()=>{u.current.insideReactTree=!0,U.start(0,V)}),z=At((me,ue=!1)=>{var Ne;if(Y(me)){V();return}if(u.current.insideReactTree){V();return}if(X()==="intentional"&&ue||typeof E=="function"&&!E(me))return;const we=kr(me),Ke=`[${Ru("inert")}]`,Pe=Yi(s.select("floatingElement")).querySelectorAll(Ke),Ee=s.context.triggerElements;if(we&&(Ee.hasElement(we)||Ee.hasMatchingElement(De=>li(De,we))))return;let Se=Ns(we)?we:null;for(;Se&&!cu(Se);){const De=Vb(Se);if(cu(De)||!Ns(De))break;Se=De}if(Pe.length&&Ns(we)&&!vT(we)&&!li(we,s.select("floatingElement"))&&Array.from(Pe).every(De=>!li(Se,De)))return;if(En(we)&&!("touches"in me)){const De=cu(we),$e=km(we),ze=/auto|scroll/,nt=De||ze.test($e.overflowX),Ct=De||ze.test($e.overflowY),xt=nt&&we.clientWidth>0&&we.scrollWidth>we.clientWidth,Je=Ct&&we.clientHeight>0&&we.scrollHeight>we.clientHeight,yt=$e.direction==="rtl",_t=Je&&(yt?me.offsetX<=we.offsetWidth-we.clientWidth:me.offsetX>we.clientWidth),Pt=xt&&me.offsetY>we.clientHeight;if(_t||Pt)return}const Ie=(Ne=u.current.floatingContext)==null?void 0:Ne.nodeId,je=_&&Ua(_.nodesRef.current,Ie).some(De=>{var $e;return Ar(me,($e=De.context)==null?void 0:$e.elements.floating)});if(Ar(me,s.select("floatingElement"))||Ar(me,s.select("domReferenceElement"))||je)return;const ot=_?Ua(_.nodesRef.current,Ie):[];if(ot.length>0){let De=!0;if(ot.forEach($e=>{var ze;(ze=$e.context)!=null&&ze.open&&!$e.context.dataRef.current.__outsidePressBubbles&&(De=!1)}),!De)return}s.setOpen(!1,xn(Yb,me)),V()}),K=At(me=>{X()!=="sloppy"||me.pointerType==="touch"||!s.select("open")||!h||Ar(me,s.select("floatingElement"))||Ar(me,s.select("domReferenceElement"))||z(me)}),B=At(me=>{if(X()!=="sloppy"||!s.select("open")||!h||Ar(me,s.select("floatingElement"))||Ar(me,s.select("domReferenceElement")))return;const ue=me.touches[0];ue&&(T.current={startTime:Date.now(),startX:ue.clientX,startY:ue.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},L.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),q=At(me=>{const ue=kr(me);function we(){B(me),ue==null||ue.removeEventListener(me.type,we)}ue==null||ue.addEventListener(me.type,we)}),Q=At(me=>{const ue=D.current;if(D.current=!1,L.clear(),me.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)return;const we=kr(me);function Ke(){me.type==="pointerdown"?K(me):z(me,ue),we==null||we.removeEventListener(me.type,Ke)}we==null||we.addEventListener(me.type,Ke)}),te=At(me=>{if(X()!=="sloppy"||!T.current||Ar(me,s.select("floatingElement"))||Ar(me,s.select("domReferenceElement")))return;const ue=me.touches[0];if(!ue)return;const we=Math.abs(ue.clientX-T.current.startX),Ke=Math.abs(ue.clientY-T.current.startY),Pe=Math.sqrt(we*we+Ke*Ke);Pe>5&&(T.current.dismissOnTouchEnd=!0),Pe>10&&(z(me),L.clear(),T.current=null)}),se=At(me=>{const ue=kr(me);function we(){te(me),ue==null||ue.removeEventListener(me.type,we)}ue==null||ue.addEventListener(me.type,we)}),be=At(me=>{X()!=="sloppy"||!T.current||Ar(me,s.select("floatingElement"))||Ar(me,s.select("domReferenceElement"))||(T.current.dismissOnTouchEnd&&z(me),L.clear(),T.current=null)}),H=At(me=>{const ue=kr(me);function we(){be(me),ue==null||ue.removeEventListener(me.type,we)}ue==null||ue.addEventListener(me.type,we)});N.useEffect(()=>{if(!a||!h)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=O;const me=new to;function ue(Se){s.setOpen(!1,xn(Z3,Se))}function we(){me.clear(),j.current=!0}function Ke(){me.start(U3()?5:0,()=>{j.current=!1})}const Pe=Yi(c);Pe.addEventListener("pointerdown",Z,!0),b&&(Pe.addEventListener("keydown",F),Pe.addEventListener("compositionstart",we),Pe.addEventListener("compositionend",Ke)),E&&(Pe.addEventListener("click",Q,!0),Pe.addEventListener("pointerdown",Q,!0),Pe.addEventListener("touchstart",q,!0),Pe.addEventListener("touchmove",se,!0),Pe.addEventListener("touchend",H,!0),Pe.addEventListener("mousedown",Q,!0));let Ee=[];return x&&(Ns(g)&&(Ee=hl(g)),Ns(c)&&(Ee=Ee.concat(hl(c))),!Ns(f)&&f&&f.contextElement&&(Ee=Ee.concat(hl(f.contextElement)))),Ee=Ee.filter(Se=>{var Ie;return Se!==((Ie=Pe.defaultView)==null?void 0:Ie.visualViewport)}),Ee.forEach(Se=>{Se.addEventListener("scroll",ue,{passive:!0})}),()=>{Pe.removeEventListener("pointerdown",Z,!0),b&&(Pe.removeEventListener("keydown",F),Pe.removeEventListener("compositionstart",we),Pe.removeEventListener("compositionend",Ke)),E&&(Pe.removeEventListener("click",Q,!0),Pe.removeEventListener("pointerdown",Q,!0),Pe.removeEventListener("touchstart",q,!0),Pe.removeEventListener("touchmove",se,!0),Pe.removeEventListener("touchend",H,!0),Pe.removeEventListener("mousedown",Q,!0)),Ee.forEach(Se=>{Se.removeEventListener("scroll",ue)}),me.clear()}},[u,c,f,g,b,E,a,l,x,h,A,O,F,z,Q,K,q,se,H,Z,s]),N.useEffect(V,[E,V]);const G=N.useMemo(()=>({onKeyDown:F,...C&&{[tD[R]]:me=>{s.setOpen(!1,xn(q0,me.nativeEvent))},...R!=="intentional"&&{onClick(me){s.setOpen(!1,xn(q0,me.nativeEvent))}}}}),[F,s,C,R]),ae=At(me=>{const ue=kr(me.nativeEvent);!li(s.select("floatingElement"),ue)||me.button!==0||(D.current=!0)}),fe=N.useMemo(()=>({onKeyDown:F,onPointerDown:ae,onMouseDown:ae,onMouseUp:ae,onClickCapture:k,onMouseDownCapture:k,onPointerDownCapture:k,onMouseUpCapture:k,onTouchEndCapture:k,onTouchMoveCapture:k}),[F,ae,k]);return N.useMemo(()=>h?{reference:G,floating:fe,trigger:G}:{},[h,G,fe])}var Du=Symbol("NOT_FOUND");function nD(i,r=`expected a function, instead received ${typeof i}`){if(typeof i!="function")throw new TypeError(r)}function sD(i,r=`expected an object, instead received ${typeof i}`){if(typeof i!="object")throw new TypeError(r)}function aD(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 ey=i=>Array.isArray(i)?i:[i];function oD(i){const r=Array.isArray(i[0])?i[0]:i;return aD(r,"createSelector expects all input-selectors to be functions, but received the following types: "),r}function lD(i,r){const s=[],{length:a}=i;for(let c=0;c<a;c++)s.push(i[c].apply(null,r));return s}function cD(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 uD(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 g(){s=[]}return{get:a,put:c,getEntries:f,clear:g}}var hD=(i,r)=>i===r;function dD(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 fD(i,r){const s=typeof r=="object"?r:{equalityCheck:r},{equalityCheck:a=hD,maxSize:c=1,resultEqualityCheck:f}=s,g=dD(a);let l=0;const u=c<=1?cD(g):uD(c,g);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 mD=class{constructor(i){this.value=i}deref(){return this.value}},pD=typeof WeakRef<"u"?WeakRef:mD,gD=0,ty=1;function tu(){return{s:gD,v:void 0,o:null,p:null}}function _1(i,r={}){let s=tu();const{resultEqualityCheck:a}=r;let c,f=0;function g(){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 x=l.o;x===null&&(l.o=x=new WeakMap);const m=x.get(R);m===void 0?(l=tu(),x.set(R,l)):l=m}else{let x=l.p;x===null&&(l.p=x=new Map);const m=x.get(R);m===void 0?(l=tu(),x.set(R,l)):l=m}}const h=l;let b;if(l.s===ty)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 pD(b):b}return h.s=ty,h.v=b,b}return g.clearCache=()=>{s=tu(),g.resetResultsCount()},g.resultsCount=()=>f,g.resetResultsCount=()=>{f=0},g}function y1(i,...r){const s=typeof i=="function"?{memoize:i,memoizeOptions:r}:i,a=(...c)=>{let f=0,g=0,l,u={},h=c.pop();typeof h=="object"&&(u=h,h=c.pop()),nD(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const b={...s,...u},{memoize:d,memoizeOptions:w=[],argsMemoize:C=_1,argsMemoizeOptions:R=[]}=b,x=ey(w),m=ey(R),v=oD(c),_=d(function(){return f++,h.apply(null,arguments)},...x),y=C(function(){g++;const D=lD(v,arguments);return l=_.apply(null,D),l},...m);return Object.assign(y,{resultFunc:h,memoizedResultFunc:_,dependencies:v,dependencyRecomputations:()=>g,resetDependencyRecomputations:()=>{g=0},lastResult:()=>l,recomputations:()=>f,resetRecomputations:()=>{f=0},memoize:d,argsMemoize:C})};return Object.assign(a,{withTypes:()=>a}),a}var vD=y1(_1),_D=Object.assign((i,r=vD)=>{sD(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((g,l,u)=>(g[s[u]]=l,g),{}))},{withTypes:()=>_D});y1({memoize:fD,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Lt=(i,r,s,a,c,f,...g)=>{if(g.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 iy;function yD(){if(iy)return bf;iy=1;var i=xl(),r=Lb();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,g=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 x={hasValue:!1,value:null};R.current=x}else x=R.current;R=l(function(){function v(A){if(!_){if(_=!0,y=A,A=w(A),C!==void 0&&x.hasValue){var O=x.value;if(C(O,A))return E=O}return E=A}if(O=E,a(y,A))return O;var T=w(A);return C!==void 0&&C(O,T)?(y=A,O):(y=A,E=T)}var _=!1,y,E,D=d===void 0?null:d;return[function(){return v(b())},D===null?void 0:function(){return v(D())}]},[b,d,w,C]);var m=c(h,R[0],R[1]);return g(function(){x.hasValue=!0,x.value=m},[m]),u(m),m},bf}var ry;function bD(){return ry||(ry=1,yf.exports=yD()),yf.exports}var SD=bD();const wD=Lm(19),CD=wD?xD:RD;function ED(i,r,s,a,c){return CD(i,r,s,a,c)}function xD(i,r,s,a,c){const f=N.useCallback(()=>r(i.getSnapshot(),s,a,c),[i,r,s,a,c]);return Mb.useSyncExternalStore(i.subscribe,f,f)}function RD(i,r,s,a,c){return SD.useSyncExternalStoreWithSelector(i.subscribe,i.getSnapshot,i.getSnapshot,f=>r(f,s,a,c))}class fl{constructor(r){Ht(this,"subscribe",r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}));Ht(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 b1 extends fl{constructor(s,a={},c){super(s);Ht(this,"controlledValues",new Map);Ht(this,"select",(s,a,c,f)=>{const g=this.selectors[s];return g(this.state,a,c,f)});Ht(this,"useState",(s,a,c,f)=>{N.useDebugValue(s);const g=this.selectors[s];return ED(this,g,a,c,f)});this.context=a,this.selectors=c}useSyncedValue(s,a){N.useDebugValue(s),vi(()=>{this.state[s]!==a&&this.set(s,a)},[s,a])}useSyncedValueWithCleanup(s,a){vi(()=>(this.state[s]!==a&&this.set(s,a),()=>{this.set(s,void 0)}),[s,a])}useSyncedValues(s){const a=Object.values(s);vi(()=>{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})),vi(()=>{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=At(a??qb);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(g=>{const l=c(g);if(!Object.is(f,l)){const u=f;f=l,a(l,u,this)}})}}const TD={open:Lt(i=>i.open),domReferenceElement:Lt(i=>i.domReferenceElement),referenceElement:Lt(i=>i.positionReference??i.referenceElement),floatingElement:Lt(i=>i.floatingElement),floatingId:Lt(i=>i.floatingId)};class S1 extends b1{constructor(s){const{nested:a,noEmit:c,onOpenChange:f,triggerElements:g,...l}=s;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:f,dataRef:{current:{}},events:UT(),nested:a,noEmit:c,triggerElements:g},TD);Ht(this,"setOpen",(s,a)=>{var c,f;if((!s||!this.state.open||CT(a.event))&&(this.context.dataRef.current.openEvent=s?a.event:void 0),!this.context.noEmit){const g={open:s,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",g)}(f=(c=this.context).onOpenChange)==null||f.call(c,s,a)})}}function DD(i,r=!1,s=!1){const[a,c]=N.useState(i&&r?"idle":void 0),[f,g]=N.useState(i);return i&&!f&&(g(!0),c("starting")),!i&&f&&a!=="ending"&&!s&&c("ending"),!i&&!f&&a==="ending"&&c(void 0),vi(()=>{if(!i&&f&&a!=="ending"&&s){const l=Kr.request(()=>{c("ending")});return()=>{Kr.cancel(l)}}},[i,f,a,s]),vi(()=>{if(!i||r)return;const l=Kr.request(()=>{eo.flushSync(()=>{c(void 0)})});return()=>{Kr.cancel(l)}},[r,i]),vi(()=>{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:g,transitionStatus:a}),[f,a])}function OD(i,r=!1,s=!0){const a=m1();return At((c,f=null)=>{a.cancel();const g=js(i);g!=null&&(typeof g.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?c():a.request(()=>{function l(){g&&Promise.all(g.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 g.getAnimations().length>0&&g.getAnimations().some(u=>u.pending||u.playState!=="finished")&&l()})}r?a.request(l):l()}))})}function w1(i){const{enabled:r=!0,open:s,ref:a,onComplete:c}=i,f=al(s),g=At(c),l=OD(a,s);N.useEffect(()=>{r&&l(()=>{s===f.current&&g()})},[r,s,g,l,f])}function AD(i){const r=i.useState("open");vi(()=>{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 LD(i,r,s){const{mounted:a,setMounted:c,transitionStatus:f}=DD(i);r.useSyncedValues({mounted:a,transitionStatus:f});const g=At(()=>{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 w1({enabled:!l,open:i,ref:r.context.popupRef,onComplete(){i||g()}}),{forceUnmount:g,transitionStatus:f}}class C1{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 MD(){return new S1({open:!1,floatingElement:null,referenceElement:null,triggerElements:new C1,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function kD(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:MD(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:yr,inactiveTriggerProps:yr,popupProps:yr}}const BD={open:Lt(i=>i.open),mounted:Lt(i=>i.mounted),transitionStatus:Lt(i=>i.transitionStatus),floatingRootContext:Lt(i=>i.floatingRootContext),preventUnmountingOnClose:Lt(i=>i.preventUnmountingOnClose),payload:Lt(i=>i.payload),activeTriggerId:Lt(i=>i.activeTriggerId),activeTriggerElement:Lt(i=>i.mounted?i.activeTriggerElement:null),isTriggerActive:Lt((i,r)=>r!==void 0&&i.activeTriggerId===r),isOpenedByTrigger:Lt((i,r)=>r!==void 0&&i.activeTriggerId===r&&i.open),isMountedByTrigger:Lt((i,r)=>r!==void 0&&i.activeTriggerId===r&&i.mounted),triggerProps:Lt((i,r)=>r?i.activeTriggerProps:i.inactiveTriggerProps),popupProps:Lt(i=>i.popupProps),popupElement:Lt(i=>i.popupElement),positionerElement:Lt(i=>i.positionerElement)};function ND(i){const{popupStore:r,noEmit:s=!1,treatPopupAsFloatingElement:a=!1,onOpenChange:c}=i,f=zu(),g=h1()!=null,l=r.useState("open"),u=r.useState("activeTriggerElement"),h=r.useState(a?"popupElement":"positionerElement"),b=r.context.triggerElements,d=ms(()=>new S1({open:l,referenceElement:u,floatingElement:h,triggerElements:b,onOpenChange:c,floatingId:f,nested:g,noEmit:s})).current;return vi(()=>{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=g,d.context.noEmit=s,d}function jD(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),g=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:g,getItemProps:l,getTriggerProps:u}),[f,g,l,u])}function iu(i,r,s){var g;const a=new Map,c=s==="item",f={};s==="floating"&&(f.tabIndex=-1,f[im]="");for(const l in i)c&&i&&(l===Jb||l===e1)||(f[l]=i[l]);for(let l=0;l<r.length;l+=1){let u;const h=(g=r[l])==null?void 0:g[s];typeof h=="function"?u=i?h(i):null:u=h,u&&ny(f,u,c,a)}return ny(f,i,c,a),f}function ny(i,r,s,a){var c;for(const f in r){const g=r[f];s&&(f===Jb||f===e1)||(f.startsWith("on")?(a.has(f)||a.set(f,[]),typeof g=="function"&&((c=a.get(f))==null||c.push(g),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]=g)}}const HD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PD(i,r={}){const s="rootStore"in i?i.rootStore:i,a=s.useState("open"),c=s.useState("floatingId"),f=s.useState("domReferenceElement"),g=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=rm(g))==null?void 0:y.id)||c},[g,c]),w=HD.get(u)??u,R=h1()!=null,x=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}:{...x,"aria-expanded":a?"true":"false","aria-controls":a?d:void 0,...w==="menu"&&{id:b}},[w,d,a,b,u,x]),v=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 D={role:"option",...y&&{id:`${d}-fui-option`}};switch(u){case"select":case"combobox":return{...D,"aria-selected":E}}return{}},[d,u]);return N.useMemo(()=>l?{reference:m,floating:v,item:_,trigger:x}:{},[l,m,v,x,_])}let zD=(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 E1=N.createContext(void 0);function ID(){const i=N.useContext(E1);if(i===void 0)throw new Error(Al(26));return i}const x1="ArrowUp",R1="ArrowDown",T1="ArrowLeft",D1="ArrowRight",O1="Home",A1="End",FD=new Set([T1,D1]),qD=new Set([x1,R1]),$D=new Set([...FD,...qD]);[...$D];const KD=new Set([x1,R1,T1,D1,O1,A1]),VD={...Kb,...$b,nestedDialogOpen(i){return i?{[UD.nestedDialogOpen]:""}:null}},WD=N.forwardRef(function(r,s){const{className:a,finalFocus:c,initialFocus:f,render:g,...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"),x=u.useState("nested"),m=u.useState("nestedOpenDialogCount"),v=u.useState("open"),_=u.useState("openMethod"),y=u.useState("titleElementId"),E=u.useState("transitionStatus"),D=u.useState("role");ID(),w1({open:v,ref:u.context.popupRef,onComplete(){var V,j;v&&((j=(V=u.context).onOpenChangeComplete)==null||j.call(V,!0))}});function A(V){return V==="touch"?u.context.popupRef.current:!0}const O=f===void 0?A:f,T=m>0,L=N.useMemo(()=>({open:v,nested:x,transitionStatus:E,nestedDialogOpen:T}),[v,x,E,T]),U=Ll("div",r,{state:L,props:[w,{"aria-labelledby":y??void 0,"aria-describedby":h??void 0,role:D,tabIndex:-1,hidden:!R,onKeyDown(V){KD.has(V.key)&&V.stopPropagation()},style:{[zD.nestedDialogs]:m}},l],ref:[s,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:VD});return P.jsx(eD,{context:d,openInteractionType:_,disabled:!R,closeOnFocusOut:!b,initialFocus:O,returnFocus:c,modal:C!==!1,restoreFocus:"popup",children:U})});function YD(i){return Lm(19)?i:i?"true":void 0}const GD=N.forwardRef(function(r,s){const{cutout:a,...c}=r;let f;if(a){const g=a==null?void 0:a.getBoundingClientRect();f=`polygon(
244
- 0% 0%,
245
- 100% 0%,
246
- 100% 100%,
247
- 0% 100%,
248
- 0% 0%,
249
- ${g.left}px ${g.top}px,
250
- ${g.left}px ${g.bottom}px,
251
- ${g.right}px ${g.bottom}px,
252
- ${g.right}px ${g.top}px,
253
- ${g.left}px ${g.top}px
254
- )`}return P.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...c,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:f}})}),XD=N.forwardRef(function(r,s){const{keepMounted:a=!1,...c}=r,{store:f}=so(),g=f.useState("mounted"),l=f.useState("modal");return g||a?P.jsx(E1.Provider,{value:a,children:P.jsxs(GT,{ref:s,...c,children:[g&&l===!0&&P.jsx(GD,{ref:f.context.internalBackdropRef,inert:YD(!open)}),r.children]})}):null});let sy={},ay={},oy="";function QD(i){if(typeof document>"u")return!1;const r=Iu(i);return Qr(r).innerWidth-r.documentElement.clientWidth>0}function ZD(i){const r=Iu(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 JD(i){var w,C;const r=Iu(i),s=r.documentElement,a=r.body,c=Qr(s);let f=0,g=0;const l=Kr.create(),u=typeof CSS<"u"&&((w=CSS.supports)==null?void 0:w.call(CSS,"scrollbar-gutter","stable"));if(cT&&(((C=c.visualViewport)==null?void 0:C.scale)??1)!==1)return()=>{};function h(){const R=c.getComputedStyle(s),x=c.getComputedStyle(a),_=(R.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";f=s.scrollTop,g=s.scrollLeft,sy={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},oy=s.style.scrollBehavior,ay={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,D=R.overflowY==="scroll"||x.overflowY==="scroll",A=R.overflowX==="scroll"||x.overflowX==="scroll",O=Math.max(0,c.innerWidth-s.clientWidth),T=Math.max(0,c.innerHeight-s.clientHeight),L=parseFloat(x.marginTop)+parseFloat(x.marginBottom),U=parseFloat(x.marginLeft)+parseFloat(x.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||D)&&(s.style.overflowY="scroll"),(E||A)&&(s.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:L||T?`calc(100dvh - ${L+T}px)`:"100dvh",width:U||O?`calc(100vw - ${U+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),a.scrollTop=f,a.scrollLeft=g,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function b(){Object.assign(s.style,sy),Object.assign(a.style,ay),u||(s.scrollTop=f,s.scrollLeft=g,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=oy)}function d(){b(),l.request(h)}return h(),c.addEventListener("resize",d),()=>{l.cancel(),b(),typeof c.removeEventListener=="function"&&c.removeEventListener("resize",d)}}class e4{constructor(){Ht(this,"lockCount",0);Ht(this,"restore",null);Ht(this,"timeoutLock",to.create());Ht(this,"timeoutUnlock",to.create());Ht(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ht(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=Iu(r).documentElement,c=Qr(a).getComputedStyle(a).overflowY;if(c==="hidden"||c==="clip"){this.restore=qb;return}const f=uT||!QD(r);this.restore=f?ZD(r):JD(r)}}const t4=new e4;function i4(i=!0,r=null){vi(()=>{if(i)return t4.acquire(r)},[i,r])}function r4(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 n4(i){const[r,s]=N.useState(null),a=At((l,u)=>{i||s(u)}),c=N.useCallback(()=>{s(null)},[]),{onClick:f,onPointerDown:g}=r4(a);return N.useMemo(()=>({openMethod:r,reset:c,triggerProps:{onClick:f,onPointerDown:g}}),[r,c,f,g])}function s4(i){const{store:r,parentContext:s,actionsRef:a}=i,c=r.useState("open"),f=r.useState("disablePointerDismissal"),g=r.useState("modal"),l=r.useState("popupElement"),{openMethod:u,triggerProps:h,reset:b}=n4(c);AD(r);const{forceUnmount:d}=LD(c,r,()=>{b()}),w=At(U=>{const V=xn(U);return V.preventUnmountOnClose=()=>{r.set("preventUnmountingOnClose",!0)},V}),C=N.useCallback(()=>{r.setOpen(!1,w(iT))},[r,w]);N.useImperativeHandle(a,()=>({unmount:d,close:C}),[d,C]);const R=ND({popupStore:r,onOpenChange:r.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[x,m]=N.useState(0),v=x===0,_=PD(R),y=rD(R,{outsidePressEvent(){return r.context.internalBackdropRef.current||r.context.backdropRef.current?"intentional":{mouse:g==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(U){if("button"in U&&U.button!==0||"touches"in U&&U.touches.length!==1)return!1;const V=kr(U);if(v&&!f){const j=V;return g&&(r.context.internalBackdropRef.current||r.context.backdropRef.current)?r.context.internalBackdropRef.current===j||r.context.backdropRef.current===j||li(j,l)&&!(j!=null&&j.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:v});i4(c&&g===!0,l);const{getReferenceProps:E,getFloatingProps:D,getTriggerProps:A}=jD([_,y]);r.useContextCallback("onNestedDialogOpen",U=>{m(U+1)}),r.useContextCallback("onNestedDialogClose",()=>{m(0)}),N.useEffect(()=>(s!=null&&s.onNestedDialogOpen&&c&&s.onNestedDialogOpen(x),s!=null&&s.onNestedDialogClose&&!c&&s.onNestedDialogClose(),()=>{s!=null&&s.onNestedDialogClose&&c&&s.onNestedDialogClose()}),[c,s,x]);const O=N.useMemo(()=>E(h),[E,h]),T=N.useMemo(()=>A(h),[A,h]),L=N.useMemo(()=>D(),[D]);r.useSyncedValues({openMethod:u,activeTriggerProps:O,inactiveTriggerProps:T,popupProps:L,floatingRootContext:R,nestedOpenDialogCount:x})}const a4={...BD,modal:Lt(i=>i.modal),nested:Lt(i=>i.nested),nestedOpenDialogCount:Lt(i=>i.nestedOpenDialogCount),disablePointerDismissal:Lt(i=>i.disablePointerDismissal),openMethod:Lt(i=>i.openMethod),descriptionElementId:Lt(i=>i.descriptionElementId),titleElementId:Lt(i=>i.titleElementId),viewportElement:Lt(i=>i.viewportElement),role:Lt(i=>i.role)};class o4 extends b1{constructor(s){super(l4(s),{popupRef:N.createRef(),backdropRef:N.createRef(),internalBackdropRef:N.createRef(),triggerElements:new C1,onOpenChange:void 0,onOpenChangeComplete:void 0},a4);Ht(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},g=((b=a.trigger)==null?void 0:b.id)??null;(g||s)&&(f.activeTriggerId=g,f.activeTriggerElement=a.trigger??null),this.update(f)})}}function l4(i={}){return{...kD(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...i}}function c4(i){const{children:r,open:s,defaultOpen:a=!1,onOpenChange:c,onOpenChangeComplete:f,disablePointerDismissal:g=!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 o4({open:s??a,activeTriggerId:b!==void 0?b:d,modal:l,disablePointerDismissal:g,nested:C})).current;R.useControlledProp("open",s,a),R.useControlledProp("activeTriggerId",b,d),R.useSyncedValues({disablePointerDismissal:g,nested:C,modal:l}),R.useContextCallback("onOpenChange",c),R.useContextCallback("onOpenChangeComplete",f);const x=R.useState("payload");s4({store:R,actionsRef:u,parentContext:w==null?void 0:w.store.context});const m=N.useMemo(()=>({store:R}),[R]);return P.jsx(Hb.Provider,{value:m,children:typeof r=="function"?r({payload:x}):r})}const u4=N.forwardRef(function(r,s){const{render:a,className:c,id:f,...g}=r,{store:l}=so(),u=aT(f);return l.useSyncedValueWithCleanup("titleElementId",u),Ll("h2",r,{ref:s,props:[{id:u},g]})}),h4=({open:i,onOpenChange:r,children:s})=>P.jsx(c4,{open:i,onOpenChange:r,children:s}),d4=({children:i,className:r=""})=>P.jsxs(XD,{children:[P.jsx(H3,{className:"fixed inset-0 bg-black/50 z-50"}),P.jsx(WD,{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})]}),f4=({children:i,className:r=""})=>P.jsx("div",{className:`flex items-center justify-between p-4 border-b border-[var(--color-border)] ${r}`,children:i}),m4=({children:i,className:r=""})=>P.jsx(u4,{className:`text-lg font-semibold ${r}`,children:i}),p4=({className:i=""})=>P.jsx(rT,{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:P.jsx(Dm,{className:"h-4 w-4"})}),g4=({children:i,className:r=""})=>P.jsx("div",{className:`p-4 ${r}`,children:i}),v4=({children:i,className:r=""})=>P.jsx("div",{className:`flex gap-3 pt-4 ${r}`,children:i}),yl=N.forwardRef(({className:i="",...r},s)=>P.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)=>P.jsx("div",{ref:s,className:`p-4 ${i}`,...r}));Ou.displayName="CardContent";const Au=N.forwardRef(({className:i="",...r},s)=>P.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)=>P.jsx("h3",{ref:s,className:`font-medium truncate ${i}`,...r}));Lu.displayName="CardTitle";const L1=N.forwardRef(({className:i="",...r},s)=>P.jsx("p",{ref:s,className:`text-sm text-[var(--color-text-secondary)] truncate ${i}`,...r}));L1.displayName="CardDescription";const _4=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:Q2,destructive:V2,warning:gR,success:Y2}[r];return P.jsx("div",{ref:c,role:"alert",className:`relative rounded-lg border p-4 ${f[r]} ${i}`,...a,children:P.jsxs("div",{className:"flex gap-3",children:[P.jsx(l,{className:"h-5 w-5 flex-shrink-0 mt-0.5"}),P.jsx("div",{className:"flex-1",children:s})]})})});_4.displayName="Alert";const y4=N.forwardRef(({className:i="",...r},s)=>P.jsx("h5",{ref:s,className:`font-medium mb-1 ${i}`,...r}));y4.displayName="AlertTitle";const b4=N.forwardRef(({className:i="",...r},s)=>P.jsx("div",{ref:s,className:`text-sm opacity-90 ${i}`,...r}));b4.displayName="AlertDescription";function S4({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),g=a==null?void 0:a.params.windowId,l=Am(a==null?void 0:a.params.paneId),{sidebarCollapsed:u,setSidebarCollapsed:h}=Ir(),[b,d]=N.useState(new Set),[w,C]=N.useState({}),R=ku(),x=ea(),m=It(q=>q.snapshots),v=It(q=>q.connectDevice),_=It(q=>q.disconnectDevice),y=It(q=>q.createWindow),E=It(q=>q.closeWindow),D=It(q=>q.closePane),A=It(q=>q.selectWindow),O=It(q=>q.deviceConnected),T=Tn(q=>{var Q;return((Q=q.settings)==null?void 0:Q.siteName)??"tmex"}),L=Tn(q=>{var Q;return((Q=q.settings)==null?void 0:Q.language)??"en_US"}),{data:U}=Qs({queryKey:["devices"],queryFn:async()=>{const q=await fetch("/api/devices");if(!q.ok)throw new Error("Failed to fetch devices");return q.json()},throwOnError:!1});N.useEffect(()=>{U||wt.error(r("common.error"))},[U,r]);const V=_r({mutationFn:async q=>{if(!(await fetch(`/api/devices/${q}`,{method:"DELETE"})).ok)throw new Error("Failed to delete device")},onSuccess:()=>{x.invalidateQueries({queryKey:["devices"]}),wt.success(r("common.success"))},onError:q=>{wt.error(q instanceof Error?q.message:r("common.error"))}}),j=N.useCallback(q=>{d(Q=>{const te=new Set(Q);return te.has(q)?(te.delete(q),q!==f&&_(q,"sidebar")):(te.add(q),v(q,"sidebar")),te})},[v,_,f]),$=N.useCallback(q=>{R(`/devices/${q}`),i()},[R,i]),Z=N.useCallback((q,Q,te)=>{R(`/devices/${q}/windows/${Q}/panes/${Nb(te)}`),i()},[R,i]),X=N.useCallback((q,Q,te)=>{Z(q,Q,te)},[Z]),F=N.useCallback((q,Q,te)=>{const se=te.find(be=>be.active)??te[0];if(se){Z(q,Q,se.id);return}C(be=>({...be,[q]:{windowId:Q,requestedAt:Date.now()}})),A(q,Q)},[Z,A]),Y=N.useCallback(q=>{y(q)},[y]),k=N.useCallback((q,Q)=>{E(q,Q)},[E]),z=N.useCallback((q,Q,te,se)=>{if(se<=1){E(q,Q);return}D(q,te)},[D,E]);N.useEffect(()=>{f&&!b.has(f)&&(d(Q=>new Set(Q).add(f)),a!=null&&a.params.deviceId||v(f,"sidebar"))},[f,b,v,a==null?void 0:a.params.deviceId]),N.useEffect(()=>{var be;const q=Object.entries(w);if(q.length===0)return;const Q=Date.now(),te={...w};let se=!1;for(const[H,G]of q){const ae=m[H],fe=(be=ae==null?void 0:ae.session)==null?void 0:be.windows.find(ue=>ue.id===G.windowId),me=(fe==null?void 0:fe.panes.find(ue=>ue.active))??(fe==null?void 0:fe.panes[0]);if(fe&&me){Z(H,fe.id,me.id),delete te[H],se=!0;continue}Q-G.requestedAt>3e3&&(delete te[H],se=!0)}se&&C(te)},[w,m,Z]);const K=(U==null?void 0:U.devices)??[],B=N.useMemo(()=>[...K].sort((q,Q)=>q.name.localeCompare(Q.name,kb(L),{numeric:!0,sensitivity:"base"})),[K,L]);return P.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:[P.jsxs("div",{className:"flex items-center justify-between px-3 h-11 border-b border-[var(--color-border)] flex-shrink-0",children:[!u&&P.jsx("span",{className:"font-semibold text-base text-[var(--color-text)] truncate",children:T}),P.jsx(Rt,{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?P.jsx(Rm,{className:"h-4 w-4"}):P.jsx(q2,{className:"h-4 w-4"})})]}),P.jsxs("div",{className:"flex-1 overflow-y-auto py-2 min-h-0",children:[B.map(q=>{var Q,te;return P.jsx(w4,{device:q,isExpanded:b.has(q.id),isSelected:q.id===f,selectedWindowId:g,selectedPaneId:l,windows:((te=(Q=m[q.id])==null?void 0:Q.session)==null?void 0:te.windows)??null,isConnected:O[q.id]??!1,onToggle:()=>j(q.id),onSelect:()=>$(q.id),onDelete:()=>V.mutate(q.id),onCreateWindow:()=>Y(q.id),onCloseWindow:k,onClosePane:z,collapsed:u,onPaneClick:X,onWindowClick:F},q.id)}),B.length===0&&!u&&P.jsxs("div",{className:"px-4 py-8 text-center text-[var(--color-text-secondary)] text-sm",children:[P.jsx("div",{className:"mb-2",children:r("sidebar.noDevices")}),P.jsxs("div",{className:"space-y-1",children:[P.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")}),P.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&&P.jsx("div",{className:"p-3 border-t border-[var(--color-border)] flex-shrink-0",children:P.jsxs("div",{className:"flex flex-col gap-2",children:[P.jsx(Rt,{variant:"default",className:"w-full justify-start",asChild:!0,children:P.jsxs(yn,{"data-testid":"sidebar-manage-devices",to:"/devices",onClick:i,children:[P.jsx(fu,{className:"h-4 w-4 mr-2 flex-shrink-0"}),r("sidebar.manageDevices")]})}),P.jsx(Rt,{variant:"default",className:"w-full justify-start",asChild:!0,children:P.jsxs(yn,{"data-testid":"sidebar-settings",to:"/settings",onClick:i,children:[P.jsx(_0,{className:"h-4 w-4 mr-2 flex-shrink-0"}),r("sidebar.settings")]})})]})}),u&&P.jsxs("div",{className:"p-2 border-t border-[var(--color-border)] flex-shrink-0 flex flex-col gap-2",children:[P.jsx(Rt,{variant:"ghost",size:"sm",className:"w-full h-8 px-2 justify-start",asChild:!0,title:r("sidebar.manageDevices"),children:P.jsx(yn,{"data-testid":"sidebar-manage-devices",to:"/devices",onClick:i,children:P.jsx(fu,{className:"h-4 w-4"})})}),P.jsx(Rt,{variant:"ghost",size:"sm",className:"w-full h-8 px-2 justify-start",asChild:!0,title:r("sidebar.settings"),children:P.jsx(yn,{"data-testid":"sidebar-settings",to:"/settings",onClick:i,children:P.jsx(_0,{className:"h-4 w-4"})})})]})]})}function w4({device:i,isExpanded:r,isSelected:s,selectedWindowId:a,selectedPaneId:c,onToggle:f,onSelect:g,onCreateWindow:l,onCloseWindow:u,onClosePane:h,collapsed:b,windows:d,isConnected:w,onPaneClick:C,onWindowClick:R}){const{t:x}=wr(),m=i.type==="local"?fu:Sb,v=s&&!!c,_=v?d==null?void 0:d.find(D=>D.id===a):void 0,y=v?_==null?void 0:_.panes.find(D=>D.id===c):void 0,E=v&&!!y;return b?P.jsx("div",{className:"px-2 py-1",children:P.jsx("button",{type:"button",onClick:g,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:P.jsx(m,{className:"h-4 w-4 flex-shrink-0"})})}):P.jsxs("div",{className:"select-none group",children:[P.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:P.jsxs("div",{className:"flex items-center px-2 py-2",children:[P.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:x(r?"common.collapse":"common.expand"),children:r?P.jsx(xm,{className:"h-3.5 w-3.5"}):P.jsx(Rm,{className:"h-3.5 w-3.5"})}),P.jsx("span",{className:`
276
- mr-2 flex-shrink-0
277
- ${s?"text-[var(--color-text)]":"text-[var(--color-text-secondary)]"}
278
- `,children:P.jsx(m,{className:"h-4 w-4"})}),P.jsx("button",{type:"button","data-testid":`device-select-${i.id}`,onClick:g,className:"flex-1 min-w-0 text-left font-medium truncate",title:i.name,children:i.name}),w&&P.jsx("span",{className:`
279
- ml-1.5 w-2 h-2 rounded-full flex-shrink-0
280
- bg-[var(--color-success)]
281
- `,title:x("device.connected")}),P.jsx("button",{type:"button","data-testid":`window-create-${i.id}`,onClick:D=>{D.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:x("sidebar.newWindow"),"aria-label":`${i.name} ${x("sidebar.newWindow")}`,children:P.jsx(Cb,{className:"h-3.5 w-3.5"})})]})}),r&&P.jsxs("div",{className:"ml-4 mr-2 mb-2",children:[!d&&P.jsxs("div",{className:"px-3 py-2 text-sm text-[var(--color-text-secondary)] flex items-center gap-2",children:[P.jsx("span",{className:"w-1.5 h-1.5 bg-[var(--color-accent)] rounded-full animate-pulse"}),x("terminal.connecting")]}),d&&d.length===0&&P.jsx("div",{className:"px-3 py-2 text-sm text-[var(--color-text-secondary)]",children:"-"}),d==null?void 0:d.map(D=>P.jsx(C4,{device:i,window:D,isSelected:s&&D.id===a,isDeviceTreeSelected:E,selectedPaneId:c,parentSelected:s,onPaneClick:C,onWindowClick:R,onCloseWindow:u,onClosePane:h},D.id))]})]})}function C4({device:i,window:r,isSelected:s,isDeviceTreeSelected:a,selectedPaneId:c,parentSelected:f,onPaneClick:g,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,x=r.panes.find(v=>v.id===c),m=a&&!!x;return P.jsxs("div",{className:"select-none",children:[P.jsx("div",{"data-testid":`window-item-${r.id}`,"data-active":s,role:"button",tabIndex:0,onClick:C,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.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:P.jsxs("div",{className:"flex items-center px-2 py-1.5",children:[R?P.jsx("button",{type:"button",onClick:v=>{v.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?P.jsx(xm,{className:"h-3 w-3"}):P.jsx(Rm,{className:"h-3 w-3"})}):P.jsx("span",{className:"w-5 flex-shrink-0"}),P.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,":"]}),P.jsx("span",{className:"flex-1 min-w-0 text-left text-sm truncate",title:r.name,children:r.name}),r.active&&P.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")}),P.jsx("button",{type:"button","data-testid":`window-close-${r.id}`,onClick:v=>{v.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:P.jsx(Dm,{className:"h-3 w-3"})})]})}),(d||!R)&&P.jsx("div",{className:`
305
- ${!s&&f?"ml-4":"ml-3"}
306
- border-l border-[var(--color-border)] pl-2
307
- `,children:r.panes.map(v=>P.jsx(E4,{deviceId:i.id,windowId:r.id,pane:v,isSelected:s&&v.id===c,isWindowTreeSelected:m,parentWindowSelected:s,paneCount:r.panes.length,onClick:g,onClosePane:h},v.id))})]})}function E4({deviceId:i,windowId:r,pane:s,isSelected:a,isWindowTreeSelected:c,parentWindowSelected:f,paneCount:g,onClick:l,onClosePane:u}){const{t:h}=wr();return P.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:[P.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:[P.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:"›"}),P.jsxs("span",{className:"truncate flex-1 text-left",children:["Pane ",s.index]}),s.active&&P.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")})]}),P.jsx("button",{type:"button","data-testid":`pane-close-${s.id}`,onClick:b=>{b.stopPropagation(),u(i,r,s.id,g)},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:P.jsx(Dm,{className:"h-3 w-3"})})]})}function x4(){const i=Tn.getState().settings;return(i==null?void 0:i.siteName)||"tmex"}function ly(i){const r=i==null?void 0:i.trim();return r&&r.length>0?r:"?"}function M1({paneIdx:i,windowIdx:r,paneTitle:s,windowName:a,deviceName:c}){const f=r??"?",g=i??"?",l=ly(s??a),u=ly(c);return`${f}/${g}: ${l}@${u}`}function R4(i){const r=x4();return i!=null&&i.trim()?`[${r}]${i}`:r}function T4(){const{t:i}=wr(),[r,s]=N.useState(!1),[a,c]=N.useState(!1),f=ku(),g=Xr(),l=ZE("/devices/:deviceId/windows/:windowId/panes/:paneId"),u=l==null?void 0:l.params.deviceId,h=l==null?void 0:l.params.windowId,b=Am(l==null?void 0:l.params.paneId),d=It(j=>j.ensureSocketConnected),w=It(j=>j.snapshots),C=It(j=>{var $;return u?(($=j.deviceConnected)==null?void 0:$[u])??!1:!1}),R=It(j=>{var $;return u?($=j.selectedPanes)==null?void 0:$[u]:void 0}),{inputMode:x,setInputMode:m}=Ir(),v=Tn(j=>j.settings),_=Tn(j=>j.fetchSettings),{data:y}=Qs({queryKey:["devices"],queryFn:async()=>{const j=await fetch("/api/devices");if(!j.ok)throw new Error(i("device.loadFailed"));return j.json()},throwOnError:!1}),E=N.useMemo(()=>{var X,F,Y;if(!l||!u||!h||!b)return null;const j=(F=(X=w[u])==null?void 0:X.session)==null?void 0:F.windows.find(k=>k.id===h),$=j==null?void 0:j.panes.find(k=>k.id===b);if(!j||!$)return null;const Z=((Y=y==null?void 0:y.devices.find(k=>k.id===u))==null?void 0:Y.name)??u;return M1({paneIdx:$.index,windowIdx:j.index,paneTitle:$.title,windowName:j.name,deviceName:Z})},[y==null?void 0:y.devices,u,b,h,l,w]),D=!!l,A=g.pathname.replace(/\/+$/,"")||"/",O=A==="/"||A==="/devices"||A==="/settings",T=!!(D&&b&&C&&(R==null?void 0:R.paneId)===b),L=N.useRef(null),U=()=>{m(x==="direct"?"editor":"direct")},V=()=>{D&&window.dispatchEvent(new CustomEvent("tmex:jump-to-latest"))};return N.useEffect(()=>{d()},[d]),N.useEffect(()=>{_()},[_]),N.useEffect(()=>{v!=null&&v.language&&xi.language!==v.language&&xi.changeLanguage(v.language)},[v==null?void 0:v.language]),N.useEffect(()=>{y||!D||wt.error(i("common.error"))},[y,D,i]),N.useEffect(()=>{document.title=(v==null?void 0:v.siteName)??"tmex"},[v==null?void 0:v.siteName]),N.useEffect(()=>{const j=$=>{const X=$.detail;if(!(X!=null&&X.title))return;const F=()=>{if(!X.paneUrl)return;const Y=new URL(X.paneUrl,window.location.origin);f(`${Y.pathname}${Y.search}${Y.hash}`)};if(X.paneUrl){wt.custom(Y=>P.jsxs("button",{type:"button",className:"w-full text-left rounded-md bg-[var(--color-bg-secondary)] px-3 py-2",onClick:()=>{wt.dismiss(Y),F()},children:[P.jsx("div",{className:"text-sm font-medium",children:X.title}),X.description&&P.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:X.description}),P.jsx("div",{className:"mt-1 text-xs text-[var(--color-accent)]",children:i("notification.clickToJump")})]}),{duration:6e3});return}wt.info(X.title,{description:X.description})};return window.addEventListener("tmex:sonner",j),()=>window.removeEventListener("tmex:sonner",j)},[f]),N.useEffect(()=>{const j=()=>{const $=window.innerWidth<768;c($),$||s(!1)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),N.useEffect(()=>{const j=document.body;if(a&&D)return j.classList.add("tmex-terminal-mobile-gesture-guard"),()=>j.classList.remove("tmex-terminal-mobile-gesture-guard");j.classList.remove("tmex-terminal-mobile-gesture-guard")},[a,D]),N.useEffect(()=>{if(!(a&&D))return;const j=L.current;if(!j)return;let $=0;const Z=Y=>{if(!(Y instanceof HTMLElement))return null;let k=Y;for(;k&&k!==j;){const z=window.getComputedStyle(k);if(/(auto|scroll)/.test(z.overflowY)&&k.scrollHeight>k.clientHeight)return k;k=k.parentElement}return null},X=Y=>{var k;Y.touches.length===1&&($=((k=Y.touches[0])==null?void 0:k.clientY)??0)},F=Y=>{var q;if(Y.touches.length!==1||(((q=Y.touches[0])==null?void 0:q.clientY)??0)-$<=0)return;const K=Z(Y.target);(!K||K.scrollTop<=0)&&Y.preventDefault()};return j.addEventListener("touchstart",X,{passive:!0}),j.addEventListener("touchmove",F,{passive:!1}),()=>{j.removeEventListener("touchstart",X),j.removeEventListener("touchmove",F)}},[a,D]),N.useEffect(()=>{var $,Z;const j=()=>{var F;const X=((F=window.visualViewport)==null?void 0:F.height)??window.innerHeight;document.documentElement.style.setProperty("--tmex-viewport-height",`${Math.round(X)}px`)};return j(),window.addEventListener("resize",j),($=window.visualViewport)==null||$.addEventListener("resize",j),(Z=window.visualViewport)==null||Z.addEventListener("scroll",j),()=>{var X,F;window.removeEventListener("resize",j),(X=window.visualViewport)==null||X.removeEventListener("resize",j),(F=window.visualViewport)==null||F.removeEventListener("scroll",j)}},[]),P.jsxs("div",{ref:L,className:"flex w-screen overflow-hidden bg-[var(--color-bg)]",style:{height:"var(--tmex-viewport-height)"},children:[a&&r&&P.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)}),P.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:P.jsx(S4,{isOpen:r,onClose:()=>s(!1)})}),P.jsxs("div",{className:`flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden ${a?"pt-11":""}`,children:[a&&P.jsxs("header",{"data-testid":"mobile-topbar",className:"fixed top-0 left-0 right-0 z-[120] h-11 flex items-center justify-between px-3 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border)] gap-2",children:[P.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:P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:P.jsx("path",{d:"M3 5h14v2H3V5zm0 4h14v2H3V9zm0 4h14v2H3v-2z"})})}),P.jsx("span",{"data-testid":"mobile-topbar-title",className:"font-medium text-sm truncate text-center flex-1",title:E??(v==null?void 0:v.siteName)??"tmex",children:E??(v==null?void 0:v.siteName)??"tmex"}),P.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[P.jsx("button",{type:"button","data-testid":"terminal-input-mode-toggle",onClick:U,className:"h-7 w-7 inline-flex items-center justify-center rounded hover:bg-[var(--color-bg-tertiary)]","aria-label":i(x==="direct"?"nav.switchToEditor":"nav.switchToDirect"),title:i(x==="direct"?"nav.switchToEditor":"nav.switchToDirect"),disabled:!D,children:x==="direct"?P.jsx(wb,{className:"h-4 w-4"}):P.jsx(Eb,{className:"h-4 w-4"})}),P.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:!T,children:P.jsx(bb,{className:"h-4 w-4"})})]})]}),P.jsx("main",{className:`flex-1 min-w-0 min-h-0 ${O?"overflow-y-auto":"overflow-hidden"} ${a&&D?"overscroll-none":""}`,children:P.jsx(Ex,{})})]})]})}var Sf={exports:{}},cy;function D4(){return cy||(cy=1,(function(i,r){(function(s,a){i.exports=a()})(self,(()=>(()=>{var s={4567:function(g,l,u){var h=this&&this.__decorate||function(y,E,D,A){var O,T=arguments.length,L=T<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,D):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,D,A);else for(var U=y.length-1;U>=0;U--)(O=y[U])&&(L=(T<3?O(L):T>3?O(E,D,L):O(E,D))||L);return T>3&&L&&Object.defineProperty(E,D,L),L},b=this&&this.__param||function(y,E){return function(D,A){E(D,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),x=u(5596),m=u(4725),v=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 D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,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((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
324
- `)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new x.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,v.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 D=this._terminal.buffer,A=D.lines.length.toString();for(let O=y;O<=E;O++){const T=D.translateBufferLineToString(D.ydisp+O,!0),L=(D.ydisp+O+1).toString(),U=this._rowElements[O];U&&(T.length===0?U.innerText=" ":U.textContent=T,U.setAttribute("aria-posinset",L),U.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(y,E){const D=y.target,A=this._rowElements[E===0?1:this._rowElements.length-2];if(D.getAttribute("aria-posinset")===(E===0?"1":`${this._terminal.buffer.lines.length}`)||y.relatedTarget!==A)return;let O,T;if(E===0?(O=D,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(O=this._rowElements.shift(),T=D,this._rowContainer.removeChild(O)),O.removeEventListener("focus",this._topBoundaryFocusListener),T.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:(g,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,x){w=h(w=u(w),R.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),R.triggerDataEvent(w,!0),C.value=""}function d(w,C,R){const x=R.getBoundingClientRect(),m=w.clientX-x.left-10,v=w.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${m}px`,C.style.top=`${v}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,x){w.stopPropagation(),w.clipboardData&&b(w.clipboardData.getData("text/plain"),C,R,x)},l.paste=b,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(w,C,R,x,m){d(w,C,R),m&&x.rightClickSelect(w),C.value=x.selectionText,C.select()}},7239:(g,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:(g,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(g,l,u){var h=this&&this.__decorate||function(m,v,_,y){var E,D=arguments.length,A=D<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,v,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(D<3?E(A):D>3?E(v,_,A):E(v,_))||A);return D>3&&A&&Object.defineProperty(v,_,A),A},b=this&&this.__param||function(m,v){return function(_,y){v(_,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 x=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 v=this._linkProviders.indexOf(m);v!==-1&&this._linkProviders.splice(v,1)}}}attachToDom(m,v,_){this._element=m,this._mouseService=v,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 v=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!v)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&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_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,v){var _,y;this._activeProviderReplies&&v||((_=this._activeProviderReplies)===null||_===void 0||_.forEach((D=>{D==null||D.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=m.y);let E=!1;for(const[D,A]of this._linkProviders.entries())v?!((y=this._activeProviderReplies)===null||y===void 0)&&y.get(D)&&(E=this._checkLinkProviderResult(D,m,E)):A.provideLinks(m.y,(O=>{var T,L;if(this._isMouseOut)return;const U=O==null?void 0:O.map((V=>({link:V})));(T=this._activeProviderReplies)===null||T===void 0||T.set(D,U),E=this._checkLinkProviderResult(D,m,E),((L=this._activeProviderReplies)===null||L===void 0?void 0:L.size)===this._linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)}))}_removeIntersectingLinks(m,v){const _=new Set;for(let y=0;y<v.size;y++){const E=v.get(y);if(E)for(let D=0;D<E.length;D++){const A=E[D],O=A.link.range.start.y<m?0:A.link.range.start.x,T=A.link.range.end.y>m?this._bufferService.cols:A.link.range.end.x;for(let L=O;L<=T;L++){if(_.has(L)){E.splice(D--,1);break}_.add(L)}}}}_checkLinkProviderResult(m,v,_){var y;if(!this._activeProviderReplies)return _;const E=this._activeProviderReplies.get(m);let D=!1;for(let A=0;A<m;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(D=!0);if(!D&&E){const A=E.find((O=>this._linkAtPosition(O.link,v)));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((T=>this._linkAtPosition(T.link,v)));if(O){_=!0,this._handleNewLink(O);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._element||!this._mouseService||!this._currentLink)return;const v=this._positionFromMouseEvent(m,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,v){this._element&&this._currentLink&&this._lastMouseEvent&&(!m||!v||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=v)&&(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 v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(m.link,v)&&(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,D;!((y=this._currentLink)===null||y===void 0)&&y.state&&((D=(E=this._currentLink)===null||E===void 0?void 0:E.state)===null||D===void 0?void 0:D.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 D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(m,v,_){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(_,v.text)}_fireUnderlineEvent(m,v){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);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(m,v,_){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(_,v.text)}_linkAtPosition(m,v){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=v.y*this._bufferService.cols+v.x;return _<=E&&E<=y}_positionFromMouseEvent(m,v,_){const y=_.getCoords(m,v,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,v,_,y,E){return{x1:m,y1:v,x2:_,y2:y,cols:this._bufferService.cols,fg:E}}};l.Linkifier2=x=h([b(0,R.IBufferService)],x)},9042:(g,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(g,l,u){var h=this&&this.__decorate||function(x,m,v,_){var y,E=arguments.length,D=E<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,m,v,_);else for(var A=x.length-1;A>=0;A--)(y=x[A])&&(D=(E<3?y(D):E>3?y(m,v,D):y(m,v))||D);return E>3&&D&&Object.defineProperty(m,v,D),D},b=this&&this.__param||function(x,m){return function(v,_){m(v,_,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),w=u(2585);let C=l.OscLinkProvider=class{constructor(x,m,v){this._bufferService=x,this._optionsService=m,this._oscLinkService=v}provideLinks(x,m){var v;const _=this._bufferService.buffer.lines.get(x-1);if(!_)return void m(void 0);const y=[],E=this._optionsService.rawOptions.linkHandler,D=new d.CellData,A=_.getTrimmedLength();let O=-1,T=-1,L=!1;for(let U=0;U<A;U++)if(T!==-1||_.hasContent(U)){if(_.loadCell(U,D),D.hasExtendedAttrs()&&D.extended.urlId){if(T===-1){T=U,O=D.extended.urlId;continue}L=D.extended.urlId!==O}else T!==-1&&(L=!0);if(L||T!==-1&&U===A-1){const V=(v=this._oscLinkService.getLinkData(O))===null||v===void 0?void 0:v.uri;if(V){const j={start:{x:T+1,y:x},end:{x:U+(L||U!==A-1?0:1),y:x}};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:j,activate:(Z,X)=>E?E.activate(Z,X,j):R(0,X),hover:(Z,X)=>{var F;return(F=E==null?void 0:E.hover)===null||F===void 0?void 0:F.call(E,Z,X,j)},leave:(Z,X)=>{var F;return(F=E==null?void 0:E.leave)===null||F===void 0?void 0:F.call(E,Z,X,j)}})}L=!1,D.hasExtendedAttrs()&&D.extended.urlId?(T=U,O=D.extended.urlId):(T=-1,O=-1)}}m(y)}};function R(x,m){if(confirm(`Do you want to navigate to ${m}?
326
-
327
- WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.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:(g,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:(g,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:(g,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),x=u(3107),m=u(5744),v=u(2950),_=u(1296),y=u(428),E=u(4269),D=u(5114),A=u(8934),O=u(3230),T=u(9312),L=u(4725),U=u(6731),V=u(8055),j=u(8969),$=u(8460),Z=u(844),X=u(6114),F=u(8437),Y=u(2584),k=u(7399),z=u(5941),K=u(9074),B=u(2585),q=u(5435),Q=u(4567),te=typeof window<"u"?window.document:null;class se extends j.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(H={}){super(H),this.browser=X,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,ae)=>this.refresh(G,ae)))),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,ae;this._customKeyEventHandler=void 0,(ae=(G=this.element)===null||G===void 0?void 0:G.parentNode)===null||ae===void 0||ae.removeChild(this.element)})))}_handleColorEvent(H){if(this._themeService)for(const G of H){let ae,fe="";switch(G.index){case 256:ae="foreground",fe="10";break;case 257:ae="background",fe="11";break;case 258:ae="cursor",fe="12";break;default:ae="ansi",fe="4;"+G.index}switch(G.type){case 0:const me=V.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${fe};${(0,z.toRgbString)(me)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((ue=>ue.ansi[G.index]=V.rgba.toColor(...G.color)));else{const ue=ae;this._themeService.modifyColors((we=>we[ue]=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(H){H?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(H){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.updateCursorStyle(H),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var H;return(H=this.textarea)===null||H===void 0?void 0:H.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 H=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(H);if(!G)return;const ae=Math.min(this.buffer.x,this.cols-1),fe=this._renderService.dimensions.css.cell.height,me=G.getWidth(ae),ue=this._renderService.dimensions.css.cell.width*me,we=this.buffer.y*this._renderService.dimensions.css.cell.height,Ke=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ke+"px",this.textarea.style.top=we+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=fe+"px",this.textarea.style.lineHeight=fe+"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 H=G=>(0,h.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",H)),this.register((0,b.addDisposableDomListener)(this.element,"paste",H)),X.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)}))),X.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",(H=>this._keyUp(H)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(H=>this._keyDown(H)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(H=>this._keyPress(H)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(H=>this._compositionHelper.compositionupdate(H)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(H=>this._inputEvent(H)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(H){var G;if(!H)throw new Error("Terminal requires a parent element.");H.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=H.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),H.appendChild(this.element);const ae=te.createDocumentFragment();this._viewportElement=te.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ae.appendChild(this._viewportElement),this._viewportScrollArea=te.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=te.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=te.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ae.appendChild(this.screenElement),this.textarea=te.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",w.promptLabel),X.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(D.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",(fe=>this._handleTextAreaFocus(fe)))),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(U.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((fe=>this._onRender.fire(fe)))),this.onResize((fe=>this._renderService.resize(fe.cols,fe.rows))),this._compositionView=te.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(ae);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((fe=>this.scrollLines(fe.amount,fe.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(T.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((fe=>this.scrollLines(fe.amount,fe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((fe=>this._renderService.handleSelectionChanged(fe.start,fe.end,fe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((fe=>{this.textarea.value=fe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((fe=>{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(x.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(fe=>this._selectionService.handleMouseDown(fe)))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(fe=>this._handleScreenReaderModeOptionChange(fe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(fe=>{!this._overviewRulerRenderer&&fe&&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 H=this,G=this.element;function ae(ue){const we=H._mouseService.getMouseReportCoords(ue,H.screenElement);if(!we)return!1;let Ke,Pe;switch(ue.overrideType||ue.type){case"mousemove":Pe=32,ue.buttons===void 0?(Ke=3,ue.button!==void 0&&(Ke=ue.button<3?ue.button:3)):Ke=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Pe=0,Ke=ue.button<3?ue.button:3;break;case"mousedown":Pe=1,Ke=ue.button<3?ue.button:3;break;case"wheel":if(H.viewport.getLinesScrolled(ue)===0)return!1;Pe=ue.deltaY<0?0:1,Ke=4;break;default:return!1}return!(Pe===void 0||Ke===void 0||Ke>4)&&H.coreMouseService.triggerMouseEvent({col:we.col,row:we.row,x:we.x,y:we.y,button:Ke,action:Pe,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const fe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:ue=>(ae(ue),ue.buttons||(this._document.removeEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.removeEventListener("mousemove",fe.mousedrag)),this.cancel(ue)),wheel:ue=>(ae(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&ae(ue)},mousemove:ue=>{ue.buttons||ae(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),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&ue?fe.mousemove||(G.addEventListener("mousemove",me.mousemove),fe.mousemove=me.mousemove):(G.removeEventListener("mousemove",fe.mousemove),fe.mousemove=null),16&ue?fe.wheel||(G.addEventListener("wheel",me.wheel,{passive:!1}),fe.wheel=me.wheel):(G.removeEventListener("wheel",fe.wheel),fe.wheel=null),2&ue?fe.mouseup||(G.addEventListener("mouseup",me.mouseup),fe.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",fe.mouseup),G.removeEventListener("mouseup",fe.mouseup),fe.mouseup=null),4&ue?fe.mousedrag||(fe.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",fe.mousedrag),fe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)(G,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return ae(ue),fe.mouseup&&this._document.addEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.addEventListener("mousemove",fe.mousedrag),this.cancel(ue)}))),this.register((0,b.addDisposableDomListener)(G,"wheel",(ue=>{if(!fe.wheel){if(!this.buffer.hasScrollback){const we=this.viewport.getLinesScrolled(ue);if(we===0)return;const Ke=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Pe="";for(let Ee=0;Ee<Math.abs(we);Ee++)Pe+=Ke;return this.coreService.triggerDataEvent(Pe,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)(G,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,b.addDisposableDomListener)(G,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(H,G){var ae;(ae=this._renderService)===null||ae===void 0||ae.refreshRows(H,G)}updateCursorStyle(H){var G;!((G=this._selectionService)===null||G===void 0)&&G.shouldColumnSelect(H)?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(H,G,ae=0){var fe;ae===1?(super.scrollLines(H,G,ae),this.refresh(0,this.rows-1)):(fe=this.viewport)===null||fe===void 0||fe.scrollLines(H)}paste(H){(0,h.paste)(H,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(H){this._customKeyEventHandler=H}registerLinkProvider(H){return this.linkifier2.registerLinkProvider(H)}registerCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(H);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(H)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(H){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+H)}registerDecoration(H){return this._decorationService.registerDecoration(H)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(H,G,ae){this._selectionService.setSelection(H,G,ae)}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 H;(H=this._selectionService)===null||H===void 0||H.clearSelection()}selectAll(){var H;(H=this._selectionService)===null||H===void 0||H.selectAll()}selectLines(H,G){var ae;(ae=this._selectionService)===null||ae===void 0||ae.selectLines(H,G)}_keyDown(H){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&H.altKey;if(!G&&!this._compositionHelper.keydown(H))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||H.key!=="Dead"&&H.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,k.evaluateKeyboardEvent)(H,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(H),ae.type===3||ae.type===2){const fe=this.rows-1;return this.scrollLines(ae.type===2?-fe:fe),this.cancel(H,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,H)||(ae.cancel&&this.cancel(H,!0),!ae.key||!!(H.key&&!H.ctrlKey&&!H.altKey&&!H.metaKey&&H.key.length===1&&H.key.charCodeAt(0)>=65&&H.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==Y.C0.ETX&&ae.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||H.altKey||H.ctrlKey?this.cancel(H,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(H,G){const ae=H.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||H.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||H.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?ae:ae&&(!G.keyCode||G.keyCode>47)}_keyUp(H){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(H)||this.focus(),this.updateCursorStyle(H),this._keyPressHandled=!1)}_keyPress(H){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;if(this.cancel(H),H.charCode)G=H.charCode;else if(H.which===null||H.which===void 0)G=H.keyCode;else{if(H.which===0||H.charCode===0)return!1;G=H.which}return!(!G||(H.altKey||H.ctrlKey||H.metaKey)&&!this._isThirdLevelShift(this.browser,H)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(H){if(H.data&&H.inputType==="insertText"&&(!H.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=H.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(H),!0}return!1}resize(H,G){H!==this.cols||G!==this.rows?super.resize(H,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(H,G){var ae,fe;(ae=this._charSizeService)===null||ae===void 0||ae.measure(),(fe=this.viewport)===null||fe===void 0||fe.syncScrollArea(!0)}clear(){var H;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(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(H=this.viewport)===null||H===void 0||H.reset(),this.refresh(0,this.rows-1)}}reset(){var H,G;this.options.rows=this.rows,this.options.cols=this.cols;const ae=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)===null||H===void 0||H.reset(),this._decorationService.reset(),(G=this.viewport)===null||G===void 0||G.reset(),this._customKeyEventHandler=ae,this.refresh(0,this.rows-1)}clearTextureAtlas(){var H;(H=this._renderService)===null||H===void 0||H.clearTextureAtlas()}_reportFocus(){var H;!((H=this.element)===null||H===void 0)&&H.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(H){if(this._renderService)switch(H){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const G=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ae};${G}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const fe=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};${fe}t`)}}cancel(H,G){if(this.options.cancelEvents||G)return H.preventDefault(),H.stopPropagation(),!1}}l.Terminal=se},9924:(g,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(g,l,u){var h=this&&this.__decorate||function(v,_,y,E){var D,A=arguments.length,O=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(v,_,y,E);else for(var T=v.length-1;T>=0;T--)(D=v[T])&&(O=(A<3?D(O):A>3?D(_,y,O):D(_,y))||O);return A>3&&O&&Object.defineProperty(_,y,O),O},b=this&&this.__param||function(v,_){return function(y,E){_(y,E,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),w=u(4725),C=u(8460),R=u(844),x=u(2585);let m=l.Viewport=class extends R.Disposable{constructor(v,_,y,E,D,A,O,T){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=y,this._optionsService=E,this._charSizeService=D,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(T.colors),this.register(T.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,_){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&y<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);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(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*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:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){var y;let E,D="";const A=[],O=_??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let L=v;L<O;L++){const U=T.get(L);if(!U)continue;const V=(y=T.get(L+1))===null||y===void 0?void 0:y.isWrapped;if(D+=U.translateToString(!V),!V||L===T.length-1){const j=document.createElement("div");j.textContent=D,A.push(j),D.length>0&&(E=j),D=""}}return{bufferElements:A,cursorElement:E}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&_.altKey||y==="ctrl"&&_.ctrlKey||y==="shift"&&_.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};l.Viewport=m=h([b(2,x.IBufferService),b(3,x.IOptionsService),b(4,w.ICharSizeService),b(5,w.IRenderService),b(6,w.ICoreBrowserService),b(7,w.IThemeService)],m)},3107:function(g,l,u){var h=this&&this.__decorate||function(m,v,_,y){var E,D=arguments.length,A=D<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,v,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(D<3?E(A):D>3?E(v,_,A):E(v,_))||A);return D>3&&A&&Object.defineProperty(v,_,A),A},b=this&&this.__param||function(m,v){return function(_,y){v(_,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 x=l.BufferDecorationRenderer=class extends C.Disposable{constructor(m,v,_,y){super(),this._screenElement=m,this._bufferService=v,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 v,_;const y=document.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((v=m==null?void 0:m.options)===null||v===void 0?void 0:v.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 v=m.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=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=v*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(_)}}_refreshXPosition(m,v=m.element){var _;if(!v)return;const y=(_=m.options.x)!==null&&_!==void 0?_:0;(m.options.anchor||"left")==="right"?v.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var v;(v=this._decorationElements.get(m))===null||v===void 0||v.remove(),this._decorationElements.delete(m),m.dispose()}};l.BufferDecorationRenderer=x=h([b(1,R.IBufferService),b(2,R.IDecorationService),b(3,w.IRenderService)],x)},5871:(g,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(g,l,u){var h=this&&this.__decorate||function(E,D,A,O){var T,L=arguments.length,U=L<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(E,D,A,O);else for(var V=E.length-1;V>=0;V--)(T=E[V])&&(U=(L<3?T(U):L>3?T(D,A,U):T(D,A))||U);return L>3&&U&&Object.defineProperty(D,A,U),U},b=this&&this.__param||function(E,D){return function(A,O){D(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),x=u(2585),m={full:0,left:0,center:0,right:0},v={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,D,A,O,T,L,U){var V;super(),this._viewportElement=E,this._screenElement=D,this._bufferService=A,this._decorationService=O,this._renderService=T,this._optionsService=L,this._coreBrowseService=U,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 j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,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),D=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=E,v.center=D,v.right=E,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=v.left,_.right=v.left+v.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowseService.dpr);const E=this._canvas.height/this._bufferService.buffer.lines.length,D=Math.round(Math.max(Math.min(E,12),6)*this._coreBrowseService.dpr);m.left=D,m.center=D,m.right=D}_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 D of this._decorationService.decorations)this._colorZoneStore.addDecoration(D);this._ctx.lineWidth=1;const E=this._colorZoneStore.zones;for(const D of E)D.position!=="full"&&this._renderColorZone(D);for(const D of E)D.position==="full"&&this._renderColorZone(D);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),v[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,D){this._shouldUpdateDimensions=E||this._shouldUpdateDimensions,this._shouldUpdateAnchor=D||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=y=h([b(2,x.IBufferService),b(3,x.IDecorationService),b(4,C.IRenderService),b(5,x.IOptionsService),b(6,C.ICoreBrowserService)],y)},2950:function(g,l,u){var h=this&&this.__decorate||function(x,m,v,_){var y,E=arguments.length,D=E<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,m,v,_);else for(var A=x.length-1;A>=0;A--)(y=x[A])&&(D=(E<3?y(D):E>3?y(m,v,D):y(m,v))||D);return E>3&&D&&Object.defineProperty(m,v,D),D},b=this&&this.__param||function(x,m){return function(v,_){m(v,_,x)}};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(x,m,v,_,y,E){this._textarea=x,this._compositionView=m,this._bufferService=v,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),v.length>0&&this._coreService.triggerDataEvent(v,!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 x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,v=m.replace(x,"");this._dataAlreadySent=v,m.length>x.length?this._coreService.triggerDataEvent(v,!0):m.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):m.length===x.length&&m!==x&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=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=v+"px",this._compositionView.style.lineHeight=v+"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"}x||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:(g,l)=>{function u(h,b,d){const w=d.getBoundingClientRect(),C=h.getComputedStyle(d),R=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[b.clientX-w.left-R,b.clientY-w.top-x]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(h,b,d,w,C,R,x,m,v){if(!R)return;const _=u(h,b,d);return _?(_[0]=Math.ceil((_[0]+(v?x/2:0))/x),_[1]=Math.ceil(_[1]/m),_[0]=Math.min(Math.max(_[0],1),w+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),C),_):void 0}},9504:(g,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=u(2584);function b(m,v,_,y){const E=m-d(m,_),D=v-d(v,_),A=Math.abs(E-D)-(function(O,T,L){let U=0;const V=O-d(O,L),j=T-d(T,L);for(let $=0;$<Math.abs(V-j);$++){const Z=w(O,T)==="A"?-1:1,X=L.buffer.lines.get(V+Z*$);X!=null&&X.isWrapped&&U++}return U})(m,v,_);return x(A,R(w(m,v),y))}function d(m,v){let _=0,y=v.buffer.lines.get(m),E=y==null?void 0:y.isWrapped;for(;E&&m>=0&&m<v.rows;)_++,y=v.buffer.lines.get(--m),E=y==null?void 0:y.isWrapped;return _}function w(m,v){return m>v?"A":"B"}function C(m,v,_,y,E,D){let A=m,O=v,T="";for(;A!==_||O!==y;)A+=E?1:-1,E&&A>D.cols-1?(T+=D.buffer.translateBufferLineToString(O,!1,m,A),A=0,m=0,O++):!E&&A<0&&(T+=D.buffer.translateBufferLineToString(O,!1,0,m+1),A=D.cols-1,m=A,O--);return T+D.buffer.translateBufferLineToString(O,!1,m,A)}function R(m,v){const _=v?"O":"[";return h.C0.ESC+_+m}function x(m,v){m=Math.floor(m);let _="";for(let y=0;y<m;y++)_+=v;return _}l.moveToCellSequence=function(m,v,_,y){const E=_.buffer.x,D=_.buffer.y;if(!_.buffer.hasScrollback)return(function(T,L,U,V,j,$){return b(L,V,j,$).length===0?"":x(C(T,L,T,L-d(L,j),!1,j).length,R("D",$))})(E,D,0,v,_,y)+b(D,v,_,y)+(function(T,L,U,V,j,$){let Z;Z=b(L,V,j,$).length>0?V-d(V,j):L;const X=V,F=(function(Y,k,z,K,B,q){let Q;return Q=b(z,K,B,q).length>0?K-d(K,B):k,Y<z&&Q<=K||Y>=z&&Q<K?"C":"D"})(T,L,U,V,j,$);return x(C(T,Z,U,X,F==="C",j).length,R(F,$))})(E,D,m,v,_,y);let A;if(D===v)return A=E>m?"D":"C",x(Math.abs(E-m),R(A,y));A=D>v?"D":"C";const O=Math.abs(D-v);return x((function(T,L){return L.cols-T})(D>v?m:E,_)+(O-1)*_.cols+1+((D>v?E:m)-1),R(A,y))}},1296:function(g,l,u){var h=this&&this.__decorate||function(j,$,Z,X){var F,Y=arguments.length,k=Y<3?$:X===null?X=Object.getOwnPropertyDescriptor($,Z):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(j,$,Z,X);else for(var z=j.length-1;z>=0;z--)(F=j[z])&&(k=(Y<3?F(k):Y>3?F($,Z,k):F($,Z))||k);return Y>3&&k&&Object.defineProperty($,Z,k),k},b=this&&this.__param||function(j,$){return function(Z,X){$(Z,X,j)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),w=u(2550),C=u(2223),R=u(6171),x=u(4725),m=u(8055),v=u(8460),_=u(844),y=u(2585),E="xterm-dom-renderer-owner-",D="xterm-rows",A="xterm-fg-",O="xterm-bg-",T="xterm-focus",L="xterm-selection";let U=1,V=l.DomRenderer=class extends _.Disposable{constructor(j,$,Z,X,F,Y,k,z,K,B){super(),this._element=j,this._screenElement=$,this._viewportElement=Z,this._linkifier2=X,this._charSizeService=Y,this._optionsService=k,this._bufferService=z,this._coreBrowserService=K,this._themeService=B,this._terminalClass=U++,this._rowElements=[],this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(D),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((q=>this._injectCss(q)))),this._injectCss(this._themeService.colors),this._rowFactory=F.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((q=>this._handleLinkHover(q)))),this.register(this._linkifier2.onHideLinkUnderline((q=>this._handleLinkLeave(q)))),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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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} .${D} 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(j){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${D} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${D} .xterm-dim { color: ${m.color.multiplyOpacity(j.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: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,$+=`${this._terminalSelector} .${D}.${T} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${D}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.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: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,X]of j.ansi.entries())$+=`${this._terminalSelector} .${A}${Z} { color: ${X.css}; }${this._terminalSelector} .${A}${Z}.xterm-dim { color: ${m.color.multiplyOpacity(X,.5).css}; }${this._terminalSelector} .${O}${Z} { background-color: ${X.css}; }`;$+=`${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(j.background).css}; }${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${O}${C.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,$){for(let Z=this._rowElements.length;Z<=$;Z++){const X=document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,$){this._refreshRowElements(j,$),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(T)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,$,Z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,$,Z),this.renderRows(0,this._bufferService.rows-1),!j||!$)return;const X=j[1]-this._bufferService.buffer.ydisp,F=$[1]-this._bufferService.buffer.ydisp,Y=Math.max(X,0),k=Math.min(F,this._bufferService.rows-1);if(Y>=this._bufferService.rows||k<0)return;const z=document.createDocumentFragment();if(Z){const K=j[0]>$[0];z.appendChild(this._createSelectionElement(Y,K?$[0]:j[0],K?j[0]:$[0],k-Y+1))}else{const K=X===Y?j[0]:0,B=Y===F?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(Y,K,B));const q=k-Y-1;if(z.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,q)),Y!==k){const Q=F===k?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(k,0,Q))}}this._selectionContainer.appendChild(z)}_createSelectionElement(j,$,Z,X=1){const F=document.createElement("div");return F.style.height=X*this.dimensions.css.cell.height+"px",F.style.top=j*this.dimensions.css.cell.height+"px",F.style.left=$*this.dimensions.css.cell.width+"px",F.style.width=this.dimensions.css.cell.width*(Z-$)+"px",F}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 j of this._rowElements)j.replaceChildren()}renderRows(j,$){const Z=this._bufferService.buffer,X=Z.ybase+Z.y,F=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=j;K<=$;K++){const B=K+Z.ydisp,q=this._rowElements[K],Q=Z.lines.get(B);if(!q||!Q)break;q.replaceChildren(...this._rowFactory.createRow(Q,B,B===X,k,z,F,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,$,Z,X,F,Y){Z<0&&(j=0),X<0&&($=0);const k=this._bufferService.rows-1;Z=Math.max(Math.min(Z,k),0),X=Math.max(Math.min(X,k),0),F=Math.min(F,this._bufferService.cols);const z=this._bufferService.buffer,K=z.ybase+z.y,B=Math.min(z.x,F-1),q=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,te=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=Z;se<=X;++se){const be=se+z.ydisp,H=this._rowElements[se],G=z.lines.get(be);if(!H||!G)break;H.replaceChildren(...this._rowFactory.createRow(G,be,be===K,Q,te,B,q,this.dimensions.css.cell.width,this._widthCache,Y?se===Z?j:0:-1,Y?(se===X?$:F)-1:-1))}}};l.DomRenderer=V=h([b(4,y.IInstantiationService),b(5,x.ICharSizeService),b(6,y.IOptionsService),b(7,y.IBufferService),b(8,x.ICoreBrowserService),b(9,x.IThemeService)],V)},3787:function(g,l,u){var h=this&&this.__decorate||function(A,O,T,L){var U,V=arguments.length,j=V<3?O:L===null?L=Object.getOwnPropertyDescriptor(O,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(A,O,T,L);else for(var $=A.length-1;$>=0;$--)(U=A[$])&&(j=(V<3?U(j):V>3?U(O,T,j):U(O,T))||j);return V>3&&j&&Object.defineProperty(O,T,j),j},b=this&&this.__param||function(A,O){return function(T,L){O(T,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),x=u(8055),m=u(4725),v=u(4269),_=u(6171),y=u(3734);let E=l.DomRendererRowFactory=class{constructor(A,O,T,L,U,V,j){this._document=A,this._characterJoinerService=O,this._optionsService=T,this._coreBrowserService=L,this._coreService=U,this._decorationService=V,this._themeService=j,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,O,T){this._selectionStart=A,this._selectionEnd=O,this._columnSelectMode=T}createRow(A,O,T,L,U,V,j,$,Z,X,F){const Y=[],k=this._characterJoinerService.getJoinedCharacters(O),z=this._themeService.colors;let K,B=A.getNoBgTrimmedLength();T&&B<V+1&&(B=V+1);let q=0,Q="",te=0,se=0,be=0,H=!1,G=0,ae=!1,fe=0;const me=[],ue=X!==-1&&F!==-1;for(let we=0;we<B;we++){A.loadCell(we,this._workCell);let Ke=this._workCell.getWidth();if(Ke===0)continue;let Pe=!1,Ee=we,Se=this._workCell;if(k.length>0&&we===k[0][0]){Pe=!0;const et=k.shift();Se=new v.JoinedCellData(this._workCell,A.translateToString(!0,et[0],et[1]),et[1]-et[0]),Ee=et[1]-1,Ke=Se.getWidth()}const Ie=this._isCellInSelection(we,O),je=T&&we===V,ot=ue&&we>=X&&we<=F;let Ne=!1;this._decorationService.forEachDecorationAtCell(we,O,void 0,(et=>{Ne=!0}));let De=Se.getChars()||w.WHITESPACE_CELL_CHAR;if(De===" "&&(Se.isUnderline()||Se.isOverline())&&(De=" "),fe=Ke*$-Z.get(De,Se.isBold(),Se.isItalic()),K){if(q&&(Ie&&ae||!Ie&&!ae&&Se.bg===te)&&(Ie&&ae&&z.selectionForeground||Se.fg===se)&&Se.extended.ext===be&&ot===H&&fe===G&&!je&&!Pe&&!Ne){Q+=De,q++;continue}q&&(K.textContent=Q),K=this._document.createElement("span"),q=0,Q=""}else K=this._document.createElement("span");if(te=Se.bg,se=Se.fg,be=Se.extended.ext,H=ot,G=fe,ae=Ie,Pe&&V>=we&&V<=Ee&&(V=we),!this._coreService.isCursorHidden&&je){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)j&&me.push("xterm-cursor-blink"),me.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){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(Se.isBold()&&me.push("xterm-bold"),Se.isItalic()&&me.push("xterm-italic"),Se.isDim()&&me.push("xterm-dim"),Q=Se.isInvisible()?w.WHITESPACE_CELL_CHAR:Se.getChars()||w.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(me.push(`xterm-underline-${Se.extended.underlineStyle}`),Q===" "&&(Q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())K.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let et=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&et<8&&(et+=8),K.style.textDecorationColor=z.ansi[et].css}Se.isOverline()&&(me.push("xterm-overline"),Q===" "&&(Q=" ")),Se.isStrikethrough()&&me.push("xterm-strikethrough"),ot&&(K.style.textDecoration="underline");let $e=Se.getFgColor(),ze=Se.getFgColorMode(),nt=Se.getBgColor(),Ct=Se.getBgColorMode();const xt=!!Se.isInverse();if(xt){const et=$e;$e=nt,nt=et;const di=ze;ze=Ct,Ct=di}let Je,yt,_t,Pt=!1;switch(this._decorationService.forEachDecorationAtCell(we,O,void 0,(et=>{et.options.layer!=="top"&&Pt||(et.backgroundColorRGB&&(Ct=50331648,nt=et.backgroundColorRGB.rgba>>8&16777215,Je=et.backgroundColorRGB),et.foregroundColorRGB&&(ze=50331648,$e=et.foregroundColorRGB.rgba>>8&16777215,yt=et.foregroundColorRGB),Pt=et.options.layer==="top")})),!Pt&&Ie&&(Je=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,nt=Je.rgba>>8&16777215,Ct=50331648,Pt=!0,z.selectionForeground&&(ze=50331648,$e=z.selectionForeground.rgba>>8&16777215,yt=z.selectionForeground)),Pt&&me.push("xterm-decoration-top"),Ct){case 16777216:case 33554432:_t=z.ansi[nt],me.push(`xterm-bg-${nt}`);break;case 50331648:_t=x.rgba.toColor(nt>>16,nt>>8&255,255&nt),this._addStyle(K,`background-color:#${D((nt>>>0).toString(16),"0",6)}`);break;default:xt?(_t=z.foreground,me.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):_t=z.background}switch(Je||Se.isDim()&&(Je=x.color.multiplyOpacity(_t,.5)),ze){case 16777216:case 33554432:Se.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(K,_t,z.ansi[$e],Se,Je,void 0)||me.push(`xterm-fg-${$e}`);break;case 50331648:const et=x.rgba.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(K,_t,et,Se,Je,yt)||this._addStyle(K,`color:#${D($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(K,_t,z.foreground,Se,Je,void 0)||xt&&me.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}me.length&&(K.className=me.join(" "),me.length=0),je||Pe||Ne?K.textContent=Q:q++,fe!==this.defaultSpacing&&(K.style.letterSpacing=`${fe}px`),Y.push(K),we=Ee}return K&&q&&(K.textContent=Q),Y}_applyMinimumContrast(A,O,T,L,U,V){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.excludeFromContrastRatioDemands)(L.getCode()))return!1;const j=this._getContrastCache(L);let $;if(U||V||($=j.getColor(O.rgba,T.rgba)),$===void 0){const Z=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);$=x.color.ensureContrastRatio(U||O,V||T,Z),j.setColor((U||O).rgba,(V||T).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 T=this._selectionStart,L=this._selectionEnd;return!(!T||!L)&&(this._columnSelectMode?T[0]<=L[0]?A>=T[0]&&O>=T[1]&&A<L[0]&&O<=L[1]:A<T[0]&&O>=T[1]&&A>=L[0]&&O<=L[1]:O>T[1]&&O<L[1]||T[1]===L[1]&&O===T[1]&&A>=T[0]&&A<L[0]||T[1]<L[1]&&O===L[1]&&A<L[0]||T[1]<L[1]&&O===T[1]&&A>=T[0])}};function D(A,O,T){for(;A.length<T;)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:(g,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:(g,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:(g,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:(g,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(g,l,u){var h=this&&this.__decorate||function(m,v,_,y){var E,D=arguments.length,A=D<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,v,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(D<3?E(A):D>3?E(v,_,A):E(v,_))||A);return D>3&&A&&Object.defineProperty(v,_,A),A},b=this&&this.__param||function(m,v){return function(_,y){v(_,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,v,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new w.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new x(m,v,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 x{constructor(v,_,y){this._document=v,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 v={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return v.width!==0&&v.height!==0&&(this._result.width=v.width/32,this._result.height=Math.ceil(v.height)),this._result}}},4269:function(g,l,u){var h=this&&this.__decorate||function(v,_,y,E){var D,A=arguments.length,O=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(v,_,y,E);else for(var T=v.length-1;T>=0;T--)(D=v[T])&&(O=(A<3?D(O):A>3?D(_,y,O):D(_,y))||O);return A>3&&O&&Object.defineProperty(_,y,O),O},b=this&&this.__param||function(v,_){return function(y,E){_(y,E,v)}};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 x 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=x;let m=l.CharacterJoinerService=class k1{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=[],D=y.translateToString(!0);let A=0,O=0,T=0,L=y.getFg(0),U=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!==U){if(V-A>1){const j=this._getJoinedRanges(D,T,O,y,A);for(let $=0;$<j.length;$++)E.push(j[$])}A=V,T=O,L=this._workCell.fg,U=this._workCell.bg}O+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const V=this._getJoinedRanges(D,T,O,y,A);for(let j=0;j<V.length;j++)E.push(V[j])}return E}_getJoinedRanges(_,y,E,D,A){const O=_.substring(y,E);let T=[];try{T=this._characterJoiners[0].handler(O)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const U=this._characterJoiners[L].handler(O);for(let V=0;V<U.length;V++)k1._mergeRanges(T,U[V])}catch(U){console.error(U)}return this._stringRangesToCellRanges(T,D,A),T}_stringRangesToCellRanges(_,y,E){let D=0,A=!1,O=0,T=_[D];if(T){for(let L=E;L<this._bufferService.cols;L++){const U=y.getWidth(L),V=y.getString(L).length||w.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!A&&T[0]<=O&&(T[0]=L,A=!0),T[1]<=O){if(T[1]=L,T=_[++D],!T)break;T[0]<=O?(T[0]=L,A=!0):A=!1}O+=V}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(_,y){let E=!1;for(let D=0;D<_.length;D++){const A=_[D];if(E){if(y[1]<=A[0])return _[D-1][1]=y[1],_;if(y[1]<=A[1])return _[D-1][1]=Math.max(y[1],A[1]),_.splice(D,1),_;_.splice(D,1),D--}else{if(y[1]<=A[0])return _.splice(D,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:(g,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(g,l,u){var h=this&&this.__decorate||function(R,x,m,v){var _,y=arguments.length,E=y<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(R,x,m,v);else for(var D=R.length-1;D>=0;D--)(_=R[D])&&(E=(y<3?_(E):y>3?_(x,m,E):_(x,m))||E);return y>3&&E&&Object.defineProperty(x,m,E),E},b=this&&this.__param||function(R,x){return function(m,v){x(m,v,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,x){this._renderService=R,this._charSizeService=x}getCoords(R,x,m,v,_){return(0,w.getCoords)(window,R,x,m,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(R,x){const m=(0,w.getCoordsRelativeToElement)(window,R,x);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(g,l,u){var h=this&&this.__decorate||function(E,D,A,O){var T,L=arguments.length,U=L<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(E,D,A,O);else for(var V=E.length-1;V>=0;V--)(T=E[V])&&(U=(L<3?T(U):L>3?T(D,A,U):T(D,A))||U);return L>3&&U&&Object.defineProperty(D,A,U),U},b=this&&this.__param||function(E,D){return function(A,O){D(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),x=u(8460),m=u(844),v=u(7226),_=u(2585);let y=l.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(E,D,A,O,T,L,U,V){if(super(),this._rowCount=E,this._charSizeService=O,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new v.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new w.RenderDebouncer(U.window,((j,$)=>this._renderRows(j,$))),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(U.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var j;return(j=this._renderer.value)===null||j===void 0?void 0:j.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(T.onDecorationRegistered((()=>this._fullRefresh()))),this.register(T.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)(U.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(V.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in U.window){const j=new U.window.IntersectionObserver(($=>this._handleIntersectionChange($[$.length-1])),{threshold:0});j.observe(D),this.register({dispose:()=>j.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,D,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(E,D,this._rowCount))}_renderRows(E,D){this._renderer.value&&(E=Math.min(E,this._rowCount-1),D=Math.min(D,this._rowCount-1),this._renderer.value.renderRows(E,D),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:D}),this._onRender.fire({start:E,end:D}),this._isNextRenderRedrawOnly=!0)}resize(E,D){this._rowCount=D,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((D=>this.refreshRows(D.start,D.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,D;this._renderer.value&&((D=(E=this._renderer.value).clearTextureAtlas)===null||D===void 0||D.call(E),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(E,D){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(E,D))):this._renderer.value.handleResize(E,D),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,D,A){var O;this._selectionState.start=E,this._selectionState.end=D,this._selectionState.columnSelectMode=A,(O=this._renderer.value)===null||O===void 0||O.handleSelectionChanged(E,D,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(g,l,u){var h=this&&this.__decorate||function(T,L,U,V){var j,$=arguments.length,Z=$<3?L:V===null?V=Object.getOwnPropertyDescriptor(L,U):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(T,L,U,V);else for(var X=T.length-1;X>=0;X--)(j=T[X])&&(Z=($<3?j(Z):$>3?j(L,U,Z):j(L,U))||Z);return $>3&&Z&&Object.defineProperty(L,U,Z),Z},b=this&&this.__param||function(T,L){return function(U,V){L(U,V,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),w=u(9504),C=u(456),R=u(4725),x=u(8460),m=u(844),v=u(6114),_=u(4841),y=u(511),E=u(2585),D=" ",A=new RegExp(D,"g");let O=l.SelectionService=class extends m.Disposable{constructor(T,L,U,V,j,$,Z,X,F){super(),this._element=T,this._screenElement=L,this._linkifier=U,this._bufferService=V,this._coreService=j,this._mouseService=$,this._optionsService=Z,this._renderService=X,this._coreBrowserService=F,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 x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.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 T=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!T||!L||T[0]===L[0]&&T[1]===L[1])}get selectionText(){const T=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!T||!L)return"";const U=this._bufferService.buffer,V=[];if(this._activeSelectionMode===3){if(T[0]===L[0])return"";const j=T[0]<L[0]?T[0]:L[0],$=T[0]<L[0]?L[0]:T[0];for(let Z=T[1];Z<=L[1];Z++){const X=U.translateBufferLineToString(Z,!0,j,$);V.push(X)}}else{const j=T[1]===L[1]?L[0]:void 0;V.push(U.translateBufferLineToString(T[1],!0,T[0],j));for(let $=T[1]+1;$<=L[1]-1;$++){const Z=U.lines.get($),X=U.translateBufferLineToString($,!0);Z!=null&&Z.isWrapped?V[V.length-1]+=X:V.push(X)}if(T[1]!==L[1]){const $=U.lines.get(L[1]),Z=U.translateBufferLineToString(L[1],!0,0,L[0]);$&&$.isWrapped?V[V.length-1]+=Z:V.push(Z)}}return V.map((j=>j.replace(A," "))).join(v.isWindows?`\r
328
- `:`
329
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&T&&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(T){const L=this._getMouseBufferCoords(T),U=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!!(U&&V&&L)&&this._areCoordsInSelection(L,U,V)}isCellInSelection(T,L){const U=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!(!U||!V)&&this._areCoordsInSelection([T,L],U,V)}_areCoordsInSelection(T,L,U){return T[1]>L[1]&&T[1]<U[1]||L[1]===U[1]&&T[1]===L[1]&&T[0]>=L[0]&&T[0]<U[0]||L[1]<U[1]&&T[1]===U[1]&&T[0]<U[0]||L[1]<U[1]&&T[1]===L[1]&&T[0]>=L[0]}_selectWordAtCursor(T,L){var U,V;const j=(V=(U=this._linkifier.currentLink)===null||U===void 0?void 0:U.link)===null||V===void 0?void 0:V.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(T);return!!$&&(this._selectWordAt($,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,L){this._model.clearSelection(),T=Math.max(T,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const L=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(T){let L=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=U?0:(L>U&&(L-=U),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(T){return v.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),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(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!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(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const L=this._getMouseBufferCoords(T);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(T){return T.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.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(T),!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(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const V=U.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 T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const L=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const V=(0,w.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(V,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,U=!(!T||!L||T[0]===L[0]&&T[1]===L[1]);U?T&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,L,U)):this._oldHasSelection&&this._fireOnSelectionChange(T,L,U)}_fireOnSelectionChange(T,L,U){this._oldSelectionStart=T,this._oldSelectionEnd=L,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(T,L){let U=L;for(let V=0;L>=V;V++){const j=T.loadCell(V,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:j>1&&L!==V&&(U+=j-1)}return U}setSelection(T,L,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,L],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,L,U=!0,V=!0){if(T[0]>=this._bufferService.cols)return;const j=this._bufferService.buffer,$=j.lines.get(T[1]);if(!$)return;const Z=j.translateBufferLineToString(T[1],!1);let X=this._convertViewportColToCharacterIndex($,T[0]),F=X;const Y=T[0]-X;let k=0,z=0,K=0,B=0;if(Z.charAt(X)===" "){for(;X>0&&Z.charAt(X-1)===" ";)X--;for(;F<Z.length&&Z.charAt(F+1)===" ";)F++}else{let te=T[0],se=T[0];$.getWidth(te)===0&&(k++,te--),$.getWidth(se)===2&&(z++,se++);const be=$.getString(se).length;for(be>1&&(B+=be-1,F+=be-1);te>0&&X>0&&!this._isCharWordSeparator($.loadCell(te-1,this._workCell));){$.loadCell(te-1,this._workCell);const H=this._workCell.getChars().length;this._workCell.getWidth()===0?(k++,te--):H>1&&(K+=H-1,X-=H-1),X--,te--}for(;se<$.length&&F+1<Z.length&&!this._isCharWordSeparator($.loadCell(se+1,this._workCell));){$.loadCell(se+1,this._workCell);const H=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,se++):H>1&&(B+=H-1,F+=H-1),F++,se++}}F++;let q=X+Y-k+K,Q=Math.min(this._bufferService.cols,F-X+k+z-K-B);if(L||Z.slice(X,F).trim()!==""){if(U&&q===0&&$.getCodePoint(0)!==32){const te=j.lines.get(T[1]-1);if(te&&$.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const se=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(se){const be=this._bufferService.cols-se.start;q-=be,Q+=be}}}if(V&&q+Q===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const te=j.lines.get(T[1]+1);if(te!=null&&te.isWrapped&&te.getCodePoint(0)!==32){const se=this._getWordAt([0,T[1]+1],!1,!1,!0);se&&(Q+=se.length)}}return{start:q,length:Q}}}_selectWordAt(T,L){const U=this._getWordAt(T,L);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[U.start,T[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(T){const L=this._getWordAt(T,!0);if(L){let U=T[1];for(;L.start<0;)L.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,U]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const L=this._bufferService.buffer.getWrappedRangeForLine(T),U={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)(U,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:(g,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(g,l,u){var h=this&&this.__decorate||function(O,T,L,U){var V,j=arguments.length,$=j<3?T:U===null?U=Object.getOwnPropertyDescriptor(T,L):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(O,T,L,U);else for(var Z=O.length-1;Z>=0;Z--)(V=O[Z])&&($=(j<3?V($):j>3?V(T,L,$):V(T,L))||$);return j>3&&$&&Object.defineProperty(T,L,$),$},b=this&&this.__param||function(O,T){return function(L,U){T(L,U,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),x=u(2585),m=w.css.toColor("#ffffff"),v=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")],T=[0,95,135,175,215,255];for(let L=0;L<216;L++){const U=T[L/36%6|0],V=T[L/6%6|0],j=T[L%6];O.push({css:w.channels.toCss(U,V,j),rgba:w.channels.toRgba(U,V,j)})}for(let L=0;L<24;L++){const U=8+10*L;O.push({css:w.channels.toCss(U,U,U),rgba:w.channels.toRgba(U,U,U)})}return O})());let D=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:v,cursor:_,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:w.color.blend(v,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:w.color.blend(v,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 T=this._colors;if(T.foreground=A(O.foreground,m),T.background=A(O.background,v),T.cursor=A(O.cursor,_),T.cursorAccent=A(O.cursorAccent,y),T.selectionBackgroundTransparent=A(O.selectionBackground,E),T.selectionBackgroundOpaque=w.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=A(O.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=w.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=O.selectionForeground?A(O.selectionForeground,w.NULL_COLOR):void 0,T.selectionForeground===w.NULL_COLOR&&(T.selectionForeground=void 0),w.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=w.color.opacity(T.selectionBackgroundTransparent,.3)),w.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=w.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=A(O.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=A(O.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=A(O.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=A(O.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=A(O.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=A(O.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=A(O.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=A(O.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=A(O.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=A(O.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=A(O.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=A(O.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=A(O.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=A(O.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=A(O.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=A(O.brightWhite,l.DEFAULT_ANSI_COLORS[15]),O.extendedAnsi){const L=Math.min(T.ansi.length-16,O.extendedAnsi.length);for(let U=0;U<L;U++)T.ansi[U+16]=A(O.extendedAnsi[U],l.DEFAULT_ANSI_COLORS[U+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 T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}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,T){if(O!==void 0)try{return w.css.toColor(O)}catch{}return T}l.ThemeService=D=h([b(0,x.IOptionsService)],D)},6349:(g,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 x=0;x<Math.min(C,this.length);x++)R[x]=this._array[this._getCyclicIndex(x)];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,...x){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+x.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<x.length;m++)this._array[this._getCyclicIndex(C+m)]=x[m];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const m=this._length+x.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,R,x){if(!(R<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let v=R-1;v>=0;v--)this.set(C+v+x,this.get(C+v));const m=C+R+x-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+x,this.get(C+m))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=d},1439:(g,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:(g,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,x,m,v,_;function y(D){const A=D.toString(16);return A.length<2?"0"+A:A}function E(D,A){return D<A?(A+.05)/(D+.05):(D+.05)/(A+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(D){D.toCss=function(A,O,T,L){return L!==void 0?`#${y(A)}${y(O)}${y(T)}${y(L)}`:`#${y(A)}${y(O)}${y(T)}`},D.toRgba=function(A,O,T,L=255){return(A<<24|O<<16|T<<8|L)>>>0}})(R||(l.channels=R={})),(function(D){function A(O,T){return C=Math.round(255*T),[b,d,w]=_.toChannels(O.rgba),{css:R.toCss(b,d,w,C),rgba:R.toRgba(b,d,w,C)}}D.blend=function(O,T){if(C=(255&T.rgba)/255,C===1)return{css:T.css,rgba:T.rgba};const L=T.rgba>>24&255,U=T.rgba>>16&255,V=T.rgba>>8&255,j=O.rgba>>24&255,$=O.rgba>>16&255,Z=O.rgba>>8&255;return b=j+Math.round((L-j)*C),d=$+Math.round((U-$)*C),w=Z+Math.round((V-Z)*C),{css:R.toCss(b,d,w),rgba:R.toRgba(b,d,w)}},D.isOpaque=function(O){return(255&O.rgba)==255},D.ensureContrastRatio=function(O,T,L){const U=_.ensureContrastRatio(O.rgba,T.rgba,L);if(U)return _.toColor(U>>24&255,U>>16&255,U>>8&255)},D.opaque=function(O){const T=(255|O.rgba)>>>0;return[b,d,w]=_.toChannels(T),{css:R.toCss(b,d,w),rgba:T}},D.opacity=A,D.multiplyOpacity=function(O,T){return C=255&O.rgba,A(O,C*T/255)},D.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(x||(l.color=x={})),(function(D){let A,O;if(!h.isNode){const T=document.createElement("canvas");T.width=1,T.height=1;const L=T.getContext("2d",{willReadFrequently:!0});L&&(A=L,A.globalCompositeOperation="copy",O=A.createLinearGradient(0,0,1,1))}D.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return b=parseInt(T.slice(1,2).repeat(2),16),d=parseInt(T.slice(2,3).repeat(2),16),w=parseInt(T.slice(3,4).repeat(2),16),_.toColor(b,d,w);case 5:return b=parseInt(T.slice(1,2).repeat(2),16),d=parseInt(T.slice(2,3).repeat(2),16),w=parseInt(T.slice(3,4).repeat(2),16),C=parseInt(T.slice(4,5).repeat(2),16),_.toColor(b,d,w,C);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const L=T.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=T,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:T}}})(m||(l.css=m={})),(function(D){function A(O,T,L){const U=O/255,V=T/255,j=L/255;return .2126*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))+.7152*(V<=.03928?V/12.92:Math.pow((V+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}D.relativeLuminance=function(O){return A(O>>16&255,O>>8&255,255&O)},D.relativeLuminance2=A})(v||(l.rgb=v={})),(function(D){function A(T,L,U){const V=T>>24&255,j=T>>16&255,$=T>>8&255;let Z=L>>24&255,X=L>>16&255,F=L>>8&255,Y=E(v.relativeLuminance2(Z,X,F),v.relativeLuminance2(V,j,$));for(;Y<U&&(Z>0||X>0||F>0);)Z-=Math.max(0,Math.ceil(.1*Z)),X-=Math.max(0,Math.ceil(.1*X)),F-=Math.max(0,Math.ceil(.1*F)),Y=E(v.relativeLuminance2(Z,X,F),v.relativeLuminance2(V,j,$));return(Z<<24|X<<16|F<<8|255)>>>0}function O(T,L,U){const V=T>>24&255,j=T>>16&255,$=T>>8&255;let Z=L>>24&255,X=L>>16&255,F=L>>8&255,Y=E(v.relativeLuminance2(Z,X,F),v.relativeLuminance2(V,j,$));for(;Y<U&&(Z<255||X<255||F<255);)Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),X=Math.min(255,X+Math.ceil(.1*(255-X))),F=Math.min(255,F+Math.ceil(.1*(255-F))),Y=E(v.relativeLuminance2(Z,X,F),v.relativeLuminance2(V,j,$));return(Z<<24|X<<16|F<<8|255)>>>0}D.ensureContrastRatio=function(T,L,U){const V=v.relativeLuminance(T>>8),j=v.relativeLuminance(L>>8);if(E(V,j)<U){if(j<V){const X=A(T,L,U),F=E(V,v.relativeLuminance(X>>8));if(F<U){const Y=O(T,L,U);return F>E(V,v.relativeLuminance(Y>>8))?X:Y}return X}const $=O(T,L,U),Z=E(V,v.relativeLuminance($>>8));if(Z<U){const X=A(T,L,U);return Z>E(V,v.relativeLuminance(X>>8))?$:X}return $}},D.reduceLuminance=A,D.increaseLuminance=O,D.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]},D.toColor=function(T,L,U,V){return{css:R.toCss(T,L,U,V),rgba:R.toRgba(T,L,U,V)}}})(_||(l.rgba=_={})),l.toPaddedHex=y,l.contrastRatio=E},8969:(g,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),x=u(6975),m=u(8460),v=u(1753),_=u(1480),y=u(7994),E=u(9282),D=u(5435),A=u(5981),O=u(2660);let T=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((V=>{var j;(j=this._onScrollApi)===null||j===void 0||j.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 j in V)this.optionsService.options[j]=V[j]}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(x.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.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 D.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((j=>{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((j=>{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(((j,$)=>this._inputHandler.parse(j,$)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(V,j){this._writeBuffer.write(V,j)}writeSync(V,j){this._logService.logLevel<=b.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(V,j)}resize(V,j){isNaN(V)||isNaN(j)||(V=Math.max(V,C.MINIMUM_COLS),j=Math.max(j,C.MINIMUM_ROWS),this._bufferService.resize(V,j))}scroll(V,j=!1){this._bufferService.scroll(V,j)}scrollLines(V,j,$){this._bufferService.scrollLines(V,j,$)}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 j=V-this._bufferService.buffer.ydisp;j!==0&&this.scrollLines(j)}registerEscHandler(V,j){return this._inputHandler.registerEscHandler(V,j)}registerDcsHandler(V,j){return this._inputHandler.registerDcsHandler(V,j)}registerCsiHandler(V,j){return this._inputHandler.registerCsiHandler(V,j)}registerOscHandler(V,j){return this._inputHandler.registerOscHandler(V,j)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let V=!1;const j=this.optionsService.rawOptions.windowsPty;j&&j.buildNumber!==void 0&&j.buildNumber!==void 0?V=j.backend==="conpty"&&j.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 j of V)j.dispose()}))}}}l.CoreTerminal=L},8460:(g,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(g,l,u){var h=this&&this.__decorate||function(Y,k,z,K){var B,q=arguments.length,Q=q<3?k:K===null?K=Object.getOwnPropertyDescriptor(k,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Y,k,z,K);else for(var te=Y.length-1;te>=0;te--)(B=Y[te])&&(Q=(q<3?B(Q):q>3?B(k,z,Q):B(k,z))||Q);return q>3&&Q&&Object.defineProperty(k,z,Q),Q},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),x=u(482),m=u(8437),v=u(8460),_=u(643),y=u(511),E=u(3734),D=u(2585),A=u(6242),O=u(6351),T=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=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 j;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(l.WindowsOptionsReportType=j={}));let $=0;class Z extends R.Disposable{getAttrData(){return this._curAttrData}constructor(k,z,K,B,q,Q,te,se,be=new C.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=z,this._coreService=K,this._logService=B,this._optionsService=q,this._oscLinkService=Q,this._coreMouseService=te,this._unicodeService=se,this._parser=be,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.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 v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,G)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:G.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,G,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:G,data:ae})})),this._parser.setDcsHandlerFallback(((H,G,ae)=>{G==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:G,payload:ae})})),this._parser.setPrintHandler(((H,G,ae)=>this.print(H,G,ae))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!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((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new A.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new A.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new A.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new A.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new A.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new A.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new A.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new A.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new A.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new A.OscHandler((H=>this.restoreCursorColor(H)))),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 H in w.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new O.DcsHandler(((H,G)=>this.requestStatusString(H,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<=D.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,q=this._activeBuffer.y,Q=0;const te=this._parseStack.paused;if(te){if(K=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(K),K;B=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>U&&(Q=this._parseStack.position+U)}if(this._logService.logLevel<=D.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,(se=>String.fromCharCode(se))).join("")}"`),typeof k=="string"?k.split("").map((se=>se.charCodeAt(0))):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(k.length,U))),te||this._dirtyRowTracker.clearRange(),k.length>U)for(let se=Q;se<k.length;se+=U){const be=se+U<k.length?se+U:k.length,H=typeof k=="string"?this._stringDecoder.decode(k.substring(se,be),this._parseBuffer):this._utf8Decoder.decode(k.subarray(se,be),this._parseBuffer);if(K=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,q,H,se),this._logSlowResolvingAsync(K),K}else if(!te){const se=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(K=this._parser.parse(this._parseBuffer,se))return this._preserveStack(B,q,se,0),this._logSlowResolvingAsync(K),K}this._activeBuffer.x===B&&this._activeBuffer.y===q||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(k,z,K){let B,q;const Q=this._charsetService.charset,te=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,be=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,G=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&K-z>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodePoint(this._activeBuffer.x-1,0,1,G.fg,G.bg,G.extended);for(let fe=z;fe<K;++fe){if(B=k[fe],q=this._unicodeService.wcwidth(B),B<127&&Q){const me=Q[String.fromCharCode(B)];me&&(B=me.charCodeAt(0))}if(te&&this._onA11yChar.fire((0,x.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),q||!this._activeBuffer.x){if(this._activeBuffer.x+q-1>=se){if(be){for(;this._activeBuffer.x<se;)ae.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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=se-1,q===2)continue}if(H&&(ae.insertCells(this._activeBuffer.x,q,this._activeBuffer.getNullCell(G),G),ae.getWidth(se-1)===2&&ae.setCellFromCodePoint(se-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,G.fg,G.bg,G.extended)),ae.setCellFromCodePoint(this._activeBuffer.x++,B,q,G.fg,G.bg,G.extended),q>0)for(;--q;)ae.setCellFromCodePoint(this._activeBuffer.x++,0,0,G.fg,G.bg,G.extended)}else ae.getWidth(this._activeBuffer.x-1)?ae.addCodepointToCell(this._activeBuffer.x-1,B):ae.addCodepointToCell(this._activeBuffer.x-2,B)}K-z>0&&(ae.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<se&&K-z>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.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,q=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);Q.replaceCells(z,K,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),q),B&&(Q.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,q=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;z--;)this._activeBuffer.lines.splice(q-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:q}=this._coreMouseService,Q=this._coreService,{buffers:te,cols:se}=this._bufferService,{active:be,alt:H}=te,G=this._optionsService.rawOptions,ae=we=>we?1:2,fe=k.params[0];return me=fe,ue=z?fe===2?4:fe===4?ae(Q.modes.insertMode):fe===12?3:fe===20?ae(G.convertEol):0:fe===1?ae(K.applicationCursorKeys):fe===3?G.windowOptions.setWinLines?se===80?2:se===132?1:0:0:fe===6?ae(K.origin):fe===7?ae(K.wraparound):fe===8?3:fe===9?ae(B==="X10"):fe===12?ae(G.cursorBlink):fe===25?ae(!Q.isCursorHidden):fe===45?ae(K.reverseWraparound):fe===66?ae(K.applicationKeypad):fe===67?4:fe===1e3?ae(B==="VT200"):fe===1002?ae(B==="DRAG"):fe===1003?ae(B==="ANY"):fe===1004?ae(K.sendFocus):fe===1005?4:fe===1006?ae(q==="SGR"):fe===1015?4:fe===1016?ae(q==="SGR_PIXELS"):fe===1048?1:fe===47||fe===1047||fe===1049?ae(be===H):fe===2004?ae(K.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${z?"":"?"}${me};${ue}$y`),!0;var me,ue}_updateAttrColor(k,z,K,B,q){return z===2?(k|=50331648,k&=-16777216,k|=E.AttributeData.fromColorRGB([K,B,q])):z===5&&(k&=-50331904,k|=33554432|255&K),k}_extractColor(k,z,K){const B=[0,0,-1,0,0,0];let q=0,Q=0;do{if(B[Q+q]=k.params[z+Q],k.hasSubParams(z+Q)){const te=k.getSubParams(z+Q);let se=0;do B[1]===5&&(q=1),B[Q+se+1+q]=te[se];while(++se<te.length&&se+Q+1+q<B.length);break}if(B[1]===5&&Q+q>=2||B[1]===2&&Q+q>=5)break;B[1]&&(q=1)}while(++Q+z<k.length&&Q+q<B.length);for(let te=2;te<B.length;++te)B[te]===-1&&(B[te]=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 Q}_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 q=0;q<z;q++)K=k.params[q],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(q)?k.getSubParams(q)[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?q+=this._extractColor(k,q,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(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.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(),q=K.shift();if(/^\d+$/.exec(B)){const Q=parseInt(B);if(F(Q))if(q==="?")z.push({type:0,index:Q});else{const te=(0,T.parseColor)(q);te&&z.push({type:1,index:Q,color:te})}}}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 q=K.findIndex((Q=>Q.startsWith("id=")));return q!==-1&&(B=K[q].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 q=(0,T.parseColor)(K[B]);q&&this._onColor.fire([{type:1,index:this._specialColors[z],color:q}])}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 q=parseInt(K[B]);F(q)&&z.push({type:2,index:q})}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(q=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${q}${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 X=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 F(Y){return 0<=Y&&Y<256}X=h([b(0,D.IBufferService)],X)},844:(g,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:(g,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:(g,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:(g,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:(g,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,x=0,m=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),x=Math.max(R,x),v=C.timeRemaining(),1.5*x>v)return m-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-R))}ms`),void this._start();m=v}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:(g,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:(g,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:(g,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),x=u(643),m=u(4863),v=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=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=R.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=R.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.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 D=0;const A=this._getCorrectBufferLength(y);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<_)for(let T=0;T<this.lines.length;T++)D+=+this.lines.get(T).resize(_,E);let O=0;if(this._rows<y)for(let T=this._rows;T<y;T++)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 T=this._rows;T>y;T--)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 T=this.lines.length-A;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,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++)D+=+this.lines.get(O).resize(_,E);this._cols=_,this._rows=y,this._memoryCleanupQueue.clear(),D>.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 D=(0,C.reflowLargerCreateNewLayout)(this.lines,E);(0,C.reflowLargerApplyNewLayout)(this.lines,D.layout),this._reflowLargerAdjustViewport(_,y,D.countRemoved)}}_reflowLargerAdjustViewport(_,y,E){const D=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(_,D))):(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),D=[];let A=0;for(let O=this.lines.length-1;O>=0;O--){let T=this.lines.get(O);if(!T||!T.isWrapped&&T.getTrimmedLength()<=_)continue;const L=[T];for(;T.isWrapped&&O>0;)T=this.lines.get(--O),L.unshift(T);const U=this.ybase+this.y;if(U>=O&&U<O+L.length)continue;const V=L[L.length-1].getTrimmedLength(),j=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,_),$=j.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 X=[];for(let B=0;B<$;B++){const q=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);X.push(q)}X.length>0&&(D.push({start:O+L.length+A,newLines:X}),A+=X.length),L.push(...X);let F=j.length-1,Y=j[F];Y===0&&(F--,Y=j[F]);let k=L.length-$-1,z=V;for(;k>=0;){const B=Math.min(z,Y);if(L[F]===void 0)break;if(L[F].copyCellsFrom(L[k],z-B,Y-B,B,!0),Y-=B,Y===0&&(F--,Y=j[F]),z-=B,z===0){k--;const q=Math.max(k,0);z=(0,C.getWrappedLineTrimmedLength)(L,q,this._cols)}}for(let B=0;B<L.length;B++)j[B]<_&&L[B].setCell(j[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(D.length>0){const O=[],T=[];for(let F=0;F<this.lines.length;F++)T.push(this.lines.get(F));const L=this.lines.length;let U=L-1,V=0,j=D[V];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let $=0;for(let F=Math.min(this.lines.maxLength-1,L+A-1);F>=0;F--)if(j&&j.start>U+$){for(let Y=j.newLines.length-1;Y>=0;Y--)this.lines.set(F--,j.newLines[Y]);F++,O.push({index:U+1,amount:j.newLines.length}),$+=j.newLines.length,j=D[++V]}else this.lines.set(F,T[U--]);let Z=0;for(let F=O.length-1;F>=0;F--)O[F].index+=Z,this.lines.onInsertEmitter.fire(O[F]),Z+=O[F].amount;const X=Math.max(0,L+A-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(_,y,E=0,D){const A=this.lines.get(_);return A?A.translateToString(y,E,D):""}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:(g,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,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const y=v||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 v=this._data[3*m+0],_=2097151&v;return[this._data[3*m+1],2097152&v?this._combined[m]:_?(0,w.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[m].charCodeAt(this._combined[m].length-1):_]}set(m,v){this._data[3*m+1]=v[d.CHAR_DATA_ATTR_INDEX],v[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=v[1],this._data[3*m+0]=2097152|m|v[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[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 v=this._data[3*m+0];return 2097152&v?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&v}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const v=this._data[3*m+0];return 2097152&v?this._combined[m]:2097151&v?(0,w.stringFromCodePoint)(2097151&v):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,v){return C=3*m,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[m]),268435456&v.bg&&(v.extended=this._extendedAttrs[m]),v}setCell(m,v){2097152&v.content&&(this._combined[m]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[m]=v.extended),this._data[3*m+0]=v.content,this._data[3*m+1]=v.fg,this._data[3*m+2]=v.bg}setCellFromCodePoint(m,v,_,y,E,D){268435456&E&&(this._extendedAttrs[m]=D),this._data[3*m+0]=v|_<<22,this._data[3*m+1]=y,this._data[3*m+2]=E}addCodepointToCell(m,v){let _=this._data[3*m+0];2097152&_?this._combined[m]+=(0,w.stringFromCodePoint)(v):(2097151&_?(this._combined[m]=(0,w.stringFromCodePoint)(2097151&_)+(0,w.stringFromCodePoint)(v),_&=-2097152,_|=2097152):_=v|4194304,this._data[3*m+0]=_)}insertCells(m,v,_,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),v<this.length-m){const E=new b.CellData;for(let D=this.length-m-v-1;D>=0;--D)this.setCell(m+v+D,this.loadCell(m+D,E));for(let D=0;D<v;++D)this.setCell(m+D,_)}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,v,_,y){if(m%=this.length,v<this.length-m){const E=new b.CellData;for(let D=0;D<this.length-m-v;++D)this.setCell(m+D,this.loadCell(m+v+D,E));for(let D=this.length-v;D<this.length;++D)this.setCell(D,_)}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,v,_,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),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodePoint(v,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<v&&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),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodePoint(v,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<v&&m<this.length;)this.setCell(m++,_)}resize(m,v){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,v)}else{this._data=this._data.subarray(0,_);const y=Object.keys(this._combined);for(let D=0;D<y.length;D++){const A=parseInt(y[D],10);A>=m&&delete this._combined[A]}const E=Object.keys(this._extendedAttrs);for(let D=0;D<E.length;D++){const A=parseInt(E[D],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,v=!1){if(v)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 v in m._combined)this._combined[v]=m._combined[v];this._extendedAttrs={};for(const v in m._extendedAttrs)this._extendedAttrs[v]=m._extendedAttrs[v];this.isWrapped=m.isWrapped}clone(){const m=new R(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const v in this._combined)m._combined[v]=this._combined[v];for(const v in this._extendedAttrs)m._extendedAttrs[v]=this._extendedAttrs[v];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,v,_,y,E){const D=m._data;if(E)for(let O=y-1;O>=0;O--){for(let T=0;T<3;T++)this._data[3*(_+O)+T]=D[3*(v+O)+T];268435456&D[3*(v+O)+2]&&(this._extendedAttrs[_+O]=m._extendedAttrs[v+O])}else for(let O=0;O<y;O++){for(let T=0;T<3;T++)this._data[3*(_+O)+T]=D[3*(v+O)+T];268435456&D[3*(v+O)+2]&&(this._extendedAttrs[_+O]=m._extendedAttrs[v+O])}const A=Object.keys(m._combined);for(let O=0;O<A.length;O++){const T=parseInt(A[O],10);T>=v&&(this._combined[T-v+_]=m._combined[T])}}translateToString(m=!1,v=0,_=this.length){m&&(_=Math.min(_,this.getTrimmedLength()));let y="";for(;v<_;){const E=this._data[3*v+0],D=2097151&E;y+=2097152&E?this._combined[v]:D?(0,w.stringFromCodePoint)(D):d.WHITESPACE_CELL_CHAR,v+=E>>22||1}return y}}l.BufferLine=R},4841:(g,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:(g,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 x=0;x<h.length-1;x++){let m=x,v=h.get(++m);if(!v.isWrapped)continue;const _=[h.get(x)];for(;m<h.length&&v.isWrapped;)_.push(v),v=h.get(++m);if(w>=x&&w<m){x+=_.length-1;continue}let y=0,E=u(_,y,b),D=1,A=0;for(;D<_.length;){const T=u(_,D,b),L=T-A,U=d-E,V=Math.min(L,U);_[y].copyCellsFrom(_[D],A,E,V,!1),E+=V,E===d&&(y++,E=0),A+=V,A===T&&(D++,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 T=_.length-1;T>0&&(T>y||_[T].getTrimmedLength()===0);T--)O++;O>0&&(R.push(x+_.length-O),R.push(O)),x+=_.length-1}return R},l.reflowLargerCreateNewLayout=function(h,b){const d=[];let w=0,C=b[w],R=0;for(let x=0;x<h.length;x++)if(C===x){const m=b[++w];h.onDeleteEmitter.fire({index:x-R,amount:m}),x+=m-1,R+=m,C=b[++w]}else d.push(x);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(((v,_)=>u(h,_,b))).reduce(((v,_)=>v+_));let R=0,x=0,m=0;for(;m<C;){if(C-m<d){w.push(C-m);break}R+=d;const v=u(h,x,b);R>v&&(R-=v,x++);const _=h[x].getWidth(R-1)===2;_&&R--;const y=_?d-1:d;w.push(y),m+=y}return w},l.getWrappedLineTrimmedLength=u},5295:(g,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,x){super(),this._optionsService=R,this._bufferService=x,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,x){this._normal.resize(R,x),this._alt.resize(R,x),this.setupTabStops(R)}setupTabStops(R){this._normal.setupTabStops(R),this._alt.setupTabStops(R)}}l.BufferSet=w},511:(g,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 x=new w;return x.setFromCharData(R),x}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 x=!1;if(R[b.CHAR_DATA_CHAR_INDEX].length>2)x=!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 v=R[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(m-55296)+v-56320+65536|R[b.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=R[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[b.CHAR_DATA_WIDTH_INDEX]<<22;x&&(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:(g,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:(g,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:(g,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:(g,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:(g,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 x={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"?x.key=w?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?x.key=w?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?x.key=w?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(x.key=w?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(d.altKey){x.key=h.C0.ESC+h.C0.DEL;break}x.key=h.C0.DEL;break;case 9:if(d.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,d.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(C?"b":"[1;5D"))):x.key=w?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(C?"f":"[1;5C"))):x.key=w?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"A",C||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=w?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"B",C||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=w?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=m?h.C0.ESC+"[3;"+(m+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=m?h.C0.ESC+"[1;"+(m+1)+"H":w?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=m?h.C0.ESC+"[1;"+(m+1)+"F":w?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?x.type=2:d.ctrlKey?x.key=h.C0.ESC+"[5;"+(m+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?x.type=3:d.ctrlKey?x.key=h.C0.ESC+"[6;"+(m+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=m?h.C0.ESC+"[1;"+(m+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=m?h.C0.ESC+"[1;"+(m+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=m?h.C0.ESC+"[1;"+(m+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=m?h.C0.ESC+"[1;"+(m+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=m?h.C0.ESC+"[15;"+(m+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=m?h.C0.ESC+"[17;"+(m+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=m?h.C0.ESC+"[18;"+(m+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=m?h.C0.ESC+"[19;"+(m+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=m?h.C0.ESC+"[20;"+(m+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=m?h.C0.ESC+"[21;"+(m+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=m?h.C0.ESC+"[23;"+(m+1)+"~":h.C0.ESC+"[23~";break;case 123:x.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?x.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(x.key=h.C0.US),d.key==="@"&&(x.key=h.C0.NUL)):d.keyCode===65&&(x.type=1);else{const v=b[d.keyCode],_=v==null?void 0:v[d.shiftKey?1:0];if(_)x.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()),x.key=h.C0.ESC+E}else if(d.keyCode===32)x.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()),x.key=h.C0.ESC+y,x.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?x.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?x.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?x.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?x.key=h.C0.DEL:d.keyCode===219?x.key=h.C0.ESC:d.keyCode===220?x.key=h.C0.FS:d.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(g,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 x=u.charCodeAt(C);56320<=x&&x<=57343?h[d++]=1024*(R-55296)+x-56320+65536:(h[d++]=R,h[d++]=x)}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,x=0,m=0,v=0;if(this.interim[0]){let E=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let A,O=0;for(;(A=63&this.interim[++O])&&O<4;)D<<=6,D|=A;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=T-O;for(;v<L;){if(v>=b)return 0;if(A=u[v++],(192&A)!=128){v--,E=!0;break}this.interim[O++]=A,D<<=6,D|=63&A}E||(T===2?D<128?v--:h[x++]=D:T===3?D<2048||D>=55296&&D<=57343||D===65279||(h[x++]=D):D<65536||D>1114111||(h[x++]=D)),this.interim.fill(0)}const _=b-4;let y=v;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[x++]=d,h[x++]=w,h[x++]=C,h[x++]=R,y+=4;if(d=u[y++],d<128)h[x++]=d;else if((224&d)==192){if(y>=b)return this.interim[0]=d,x;if(w=u[y++],(192&w)!=128){y--;continue}if(m=(31&d)<<6|63&w,m<128){y--;continue}h[x++]=m}else if((240&d)==224){if(y>=b)return this.interim[0]=d,x;if(w=u[y++],(192&w)!=128){y--;continue}if(y>=b)return this.interim[0]=d,this.interim[1]=w,x;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[x++]=m}else if((248&d)==240){if(y>=b)return this.interim[0]=d,x;if(w=u[y++],(192&w)!=128){y--;continue}if(y>=b)return this.interim[0]=d,this.interim[1]=w,x;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,x;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[x++]=m}}return x}}},225:(g,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,x=0,m=C.length-1;if(w<C[0][0]||w>C[m][1])return!1;for(;m>=x;)if(R=x+m>>1,w>C[R][1])x=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:(g,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 x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);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 x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],v=this._action(m,R);if(v){const y=E=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(x,E);return void v.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-x>=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:(g,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 x=0;x<3;++x){const m=parseInt(w.slice(C*x,C*x+C),16);R[x]=C===1?m<<4:C===2?m:C===3?m>>4:m>>8}return R}},l.toRgbString=function(d,w=16){const[C,R,x]=d;return`rgb:${b(C,w)}/${b(R,w)}/${b(x,w)}`}},5770:(g,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(g,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,x){this._handlers[R]===void 0&&(this._handlers[R]=[]);const m=this._handlers[R];return m.push(x),{dispose:()=>{const v=m.indexOf(x);v!==-1&&m.splice(v,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,x){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(x);else this._handlerFb(this._ident,"HOOK",x)}put(R,x,m){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(R,x,m);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(R,x,m))}unhook(R,x=!0){if(this._active.length){let m=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,m=x,_=this._stack.fallThrough,this._stack.paused=!1),!_&&m===!1){for(;v>=0&&(m=this._active[v].unhook(R),m!==!0);v--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,m;v--}for(;v>=0;v--)if(m=this._active[v].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,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,x,m){this._hitLimit||(this._data+=(0,h.utf32ToString)(R,x,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(R){let x=!1;if(this._hitLimit)x=!1;else if(R&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((m=>(this._params=C,this._data="",this._hitLimit=!1,m)));return this._params=C,this._data="",this._hitLimit=!1,x}}},2015:(g,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(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,y,E){this.table[_<<8|v]=y<<4|E}addMany(v,_,y,E){for(let D=0;D<v.length;D++)this.table[_<<8|v[D]]=y<<4|E}}l.TransitionTable=C;const R=160;l.VT500_TRANSITION_TABLE=(function(){const m=new C(4095),v=Array.apply(null,Array(256)).map(((O,T)=>T)),_=(O,T)=>v.slice(O,T),y=_(32,127),E=_(0,24);E.push(25),E.push.apply(E,_(28,32));const D=_(0,14);let A;for(A in m.setDefault(1,0),m.addMany(y,0,2,0),D)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 x extends h.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,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(v,_=[64,126]){let y=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=v.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;D<v.intermediates.length;++D){const A=v.intermediates.charCodeAt(D);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=A}}if(v.final.length!==1)throw new Error("final must be a single byte");const E=v.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(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const y=this._identifier(v,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(_),{dispose:()=>{const D=E.indexOf(_);D!==-1&&E.splice(D,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const y=this._identifier(v);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(_),{dispose:()=>{const D=E.indexOf(_);D!==-1&&E.splice(D,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,_,y,E,D){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=D}parse(v,_,y){let E,D=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 T=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&L>-1){for(;L>=0&&(E=T[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=T[L](),E!==!0);L--)if(E instanceof Promise)return this._parseStack.handlerPos=L,E}this._parseStack.handlers=[];break;case 6:if(D=v[this._parseStack.chunkPos],E=this._dcsParser.unhook(D!==24&&D!==26,y),E)return E;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=v[this._parseStack.chunkPos],E=this._oscParser.end(D!==24&&D!==26,y),E)return E;D===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 T=O;T<_;++T){switch(D=v[T],A=this._transitions.table[this.currentState<<8|(D<160?D:R)],A>>4){case 2:for(let $=T+1;;++$){if($>=_||(D=v[$])<32||D>126&&D<R){this._printHandler(v,T,$),T=$-1;break}if(++$>=_||(D=v[$])<32||D>126&&D<R){this._printHandler(v,T,$),T=$-1;break}if(++$>=_||(D=v[$])<32||D>126&&D<R){this._printHandler(v,T,$),T=$-1;break}if(++$>=_||(D=v[$])<32||D>126&&D<R){this._printHandler(v,T,$),T=$-1;break}}break;case 3:this._executeHandlers[D]?this._executeHandlers[D]():this._executeHandlerFb(D),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:D,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|D];let U=L?L.length-1:-1;for(;U>=0&&(E=L[U](this._params),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(3,L,U,A,T),E;U<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingCodepoint=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++T<_&&(D=v[T])>47&&D<60);T--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const V=this._escHandlers[this._collect<<8|D];let j=V?V.length-1:-1;for(;j>=0&&(E=V[j](),E!==!0);j--)if(E instanceof Promise)return this._preserveStack(4,V,j,A,T),E;j<0&&this._escHandlerFb(this._collect<<8|D),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|D,this._params);break;case 13:for(let $=T+1;;++$)if($>=_||(D=v[$])===24||D===26||D===27||D>127&&D<R){this._dcsParser.put(v,T,$),T=$-1;break}break;case 14:if(E=this._dcsParser.unhook(D!==24&&D!==26),E)return this._preserveStack(6,[],0,A,T),E;D===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 $=T+1;;$++)if($>=_||(D=v[$])<32||D>127&&D<R){this._oscParser.put(v,T,$),T=$-1;break}break;case 6:if(E=this._oscParser.end(D!==24&&D!==26),E)return this._preserveStack(5,[],0,A,T),E;D===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&A}}}l.EscapeSequenceParser=x},6242:(g,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 x=R.indexOf(C);x!==-1&&R.splice(x,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 x=this._active.length-1;x>=0;x--)this._active[x].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 x=w[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-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,x=this._active.length-1,m=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,R=C,m=this._stack.fallThrough,this._stack.paused=!1),!m&&R===!1){for(;x>=0&&(R=this._active[x].end(w),R!==!0);x--)if(R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,R;x--}for(;x>=0;x--)if(R=this._active[x].end(!1),R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,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:(g,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 x=0;x<R.length;++x)w.addSubParam(R[x]);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:(g,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:(g,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:(g,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:(g,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:(g,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:(g,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(g,l,u){var h=this&&this.__decorate||function(m,v,_,y){var E,D=arguments.length,A=D<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,v,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(D<3?E(A):D>3?E(v,_,A):E(v,_))||A);return D>3&&A&&Object.defineProperty(v,_,A),A},b=this&&this.__param||function(m,v){return function(_,y){v(_,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 x=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,v){this.cols=m,this.rows=v,this.buffers.resize(m,v),this._onResize.fire({cols:m,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,v=!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,v),this._cachedBlankLine=y),y.isWrapped=v;const E=_.ybase+_.scrollTop,D=_.ybase+_.scrollBottom;if(_.scrollTop===0){const A=_.lines.isFull;D===_.lines.length-1?A?_.lines.recycle().copyFrom(y):_.lines.push(y.clone()):_.lines.splice(D+1,0,y.clone()),A?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const A=D-E+1;_.lines.shiftElements(E+1,A-1,-1),_.lines.set(D,y.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(m,v,_){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&&(v||this._onScroll.fire(y.ydisp))}};l.BufferService=x=h([b(0,R.IOptionsService)],x)},7994:(g,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(g,l,u){var h=this&&this.__decorate||function(y,E,D,A){var O,T=arguments.length,L=T<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,D):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,D,A);else for(var U=y.length-1;U>=0;U--)(O=y[U])&&(L=(T<3?O(L):T>3?O(E,D,L):O(E,D))||L);return T>3&&L&&Object.defineProperty(E,D,L),L},b=this&&this.__param||function(y,E){return function(D,A){E(D,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 x(y,E){let D=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(D|=64,D|=y.action):(D|=3&y.button,4&y.button&&(D|=64),8&y.button&&(D|=128),y.action===32?D|=32:y.action!==0||E||(D|=3)),D}const m=String.fromCharCode,v={DEFAULT:y=>{const E=[x(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[<${x(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(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 D of Object.keys(R))this.addProtocol(D,R[D]);for(const D of Object.keys(v))this.addEncoding(D,v[D]);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,D){if(D){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(g,l,u){var h=this&&this.__decorate||function(_,y,E,D){var A,O=arguments.length,T=O<3?y:D===null?D=Object.getOwnPropertyDescriptor(y,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,y,E,D);else for(var L=_.length-1;L>=0;L--)(A=_[L])&&(T=(O<3?A(T):O>3?A(y,E,T):A(y,E))||T);return O>3&&T&&Object.defineProperty(y,E,T),T},b=this&&this.__param||function(_,y){return function(E,D){y(E,D,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),w=u(8460),C=u(844),R=u(2585),x=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=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)(x),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(x),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((D=>D.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=v=h([b(0,R.IBufferService),b(1,R.ILogService),b(2,R.IOptionsService)],v)},9074:(g,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 x 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 D,A,O;let T=0,L=0;for(const U of this._decorations.getKeyIterator(y))T=(D=U.options.x)!==null&&D!==void 0?D:0,L=T+((A=U.options.width)!==null&&A!==void 0?A:1),_>=T&&_<L&&(!E||((O=U.options.layer)!==null&&O!==void 0?O:"bottom")===E)&&(yield U)}forEachDecorationAtCell(_,y,E,D){this._decorations.forEachByKey(y,(A=>{var O,T,L;C=(O=A.options.x)!==null&&O!==void 0?O:0,R=C+((T=A.options.width)!==null&&T!==void 0?T:1),_>=C&&_<R&&(!E||((L=A.options.layer)!==null&&L!==void 0?L:"bottom")===E)&&D(A)}))}}l.DecorationService=x;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:(g,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,x]of C)this.set(R,x)}set(C,R){const x=this._entries.get(C);return this._entries.set(C,R),x}forEach(C){for(const[R,x]of this._entries.entries())C(R,x)}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(((v,_)=>v.index-_.index)),x=[];for(const v of R){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${v.id}.`);x.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,...x)}}},7866:function(g,l,u){var h=this&&this.__decorate||function(m,v,_,y){var E,D=arguments.length,A=D<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,v,_,y);else for(var O=m.length-1;O>=0;O--)(E=m[O])&&(A=(D<3?E(A):D>3?E(v,_,A):E(v,_))||A);return D>3&&A&&Object.defineProperty(v,_,A),A},b=this&&this.__param||function(m,v){return function(_,y){v(_,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,x=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 v=0;v<m.length;v++)typeof m[v]=="function"&&(m[v]=m[v]())}_log(m,v,_){this._evalLazyOptionalParams(_),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(m,...v){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,v)}debug(m,...v){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,v)}info(m,...v){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,v)}warn(m,...v){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,v)}error(m,...v){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,v)}};l.LogService=x=h([b(0,w.IOptionsService)],x),l.setTraceLogger=function(m){R=m},l.traceCall=function(m,v,_){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 D=y.apply(this,E);return R.trace(`GlyphRenderer#${y.name} return`,D),D}}},7302:(g,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(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m=Object.assign({},l.DEFAULT_OPTIONS);for(const v in x)if(v in m)try{const _=x[v];m[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=m,this.options=Object.assign({},m),this._setupOptions()}onSpecificOptionChange(x,m){return this.onOptionChange((v=>{v===x&&m(this.rawOptions[x])}))}onMultipleOptionChange(x,m){return this.onOptionChange((v=>{x.indexOf(v)!==-1&&m()}))}_setupOptions(){const x=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},m=(v,_)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:x.bind(this,v),set:m.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(x,m){switch(x){case"cursorStyle":if(m||(m=l.DEFAULT_OPTIONS[x]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${x}`);break;case"wordSeparator":m||(m=l.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=w.includes(m)?m:l.DEFAULT_OPTIONS[x];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${x} 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(`${x} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${x} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}l.OptionsService=C},2660:function(g,l,u){var h=this&&this.__decorate||function(C,R,x,m){var v,_=arguments.length,y=_<3?R:m===null?m=Object.getOwnPropertyDescriptor(R,x):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,R,x,m);else for(var E=C.length-1;E>=0;E--)(v=C[E])&&(y=(_<3?v(y):_>3?v(R,x,y):v(R,x))||y);return _>3&&y&&Object.defineProperty(R,x,y),y},b=this&&this.__param||function(C,R){return function(x,m){R(x,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),D={data:C,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(D,E))),this._dataByLinkId.set(D.id,D),D.id}const x=C,m=this._getEntryIdKey(x),v=this._entriesWithId.get(m);if(v)return this.addLineToLink(v.id,R.ybase+R.y),v.id;const _=R.addMarker(R.ybase+R.y),y={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(y,_))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(C,R){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((m=>m.line!==R))){const m=this._bufferService.buffer.addMarker(R);x.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(x,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 x=C.lines.indexOf(R);x!==-1&&(C.lines.splice(x,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:(g,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(x,m,v){m[u]===m?m[h].push({id:x,index:v}):(m[h]=[{id:x,index:v}],m[u]=m)})(d,w,R)};return d.toString=()=>b,l.serviceRegistry.set(b,d),d}},2585:(g,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:(g,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 x=d.charCodeAt(R);if(55296<=x&&x<=56319){if(++R>=C)return w+this.wcwidth(x);const m=d.charCodeAt(R);56320<=m&&m<=57343?x=1024*(x-55296)+m-56320+65536:w+=this.wcwidth(m)}w+=this.wcwidth(x)}return w}}}},a={};function c(g){var l=a[g];if(l!==void 0)return l.exports;var u=a[g]={exports:{}};return s[g].call(u.exports,u,u.exports,c),u.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.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 x extends h.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new b.AddonManager),this._publicOptions=Object.assign({},this._core.options);const _=E=>this._core.options[E],y=(E,D)=>{this._checkReadonlyOptions(E),this._core.options[E]=D};for(const E in this._core.options){const D={get:_.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,D)}}_checkReadonlyOptions(v){if(R.includes(v))throw new Error(`Option "${v}" 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 v=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:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){var _,y,E;return this._checkProposedApi(),this._verifyPositiveIntegers((_=v.x)!==null&&_!==void 0?_:0,(y=v.width)!==null&&y!==void 0?y:0,(E=v.height)!==null&&E!==void 0?E:0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,_,y){this._verifyIntegers(v,_,y),this._core.select(v,_,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
331
- `,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}g.Terminal=x})(),f})()))})(Sf)),Sf.exports}var O4=D4(),wf={exports:{}},uy;function A4(){return uy||(uy=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 g=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")))-g;return{cols:Math.max(2,Math.floor(w/f.css.cell.width)),rows:Math.max(1,Math.floor(d/f.css.cell.height))}}}})(),s})()))})(wf)),wf.exports}var L4=A4(),uu={exports:{}},M4=uu.exports,hy;function k4(){return hy||(hy=1,(function(i,r){(function(s,a){i.exports=a()})(M4,(()=>(()=>{var s={433:(g,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,x){let m,v=0,_=x.length-1;if(R<x[0][0]||R>x[_][1])return!1;for(;_>=v;)if(m=v+_>>1,R>x[m][1])v=m+1;else{if(!(R<x[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(g){var l=a[g];if(l!==void 0)return l.exports;var u=a[g]={exports:{}};return s[g](u,u.exports,c),u.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Unicode11Addon=void 0;const l=c(433);g.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),f})()))})(uu)),uu.exports}var B4=k4();function N4(){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 j4(i){return i&&i.replace(/\r?\n/g,`\r
332
- `)}function H4(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 g=0;s=r;for(const l of i)l===10&&!s&&(f[g]=13,g+=1),f[g]=l,g+=1,s=l===13;return{normalized:f,endedWithCR:c}}const P4=[{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 dy(){var Ti;const{t:i}=wr(),{deviceId:r,windowId:s,paneId:a}=ix(),c=ku(),f=N.useRef(null),g=N.useRef(null),l=N.useRef(null),u=N.useRef(!1),h=N.useRef([]),b=N.useRef(!1),d=N.useRef(0),w=N.useRef(null),C=N.useRef(!1),R=N.useRef(!1),x=N.useRef(null),m=N.useRef(!1),v=N.useRef(null),_=N.useRef(null),y=N.useRef(null),E=N.useRef(null),D=N.useRef(0),A=N.useRef([]),O=N.useRef(null),T=N.useRef(null),L=N.useRef(null),U=It(he=>he.connectDevice),V=It(he=>he.disconnectDevice),j=It(he=>he.selectPane),$=It(he=>he.sendInput),Z=It(he=>he.resizePane),X=It(he=>he.syncPaneSize),F=It(he=>he.subscribeBinary),Y=It(he=>he.subscribeHistory),k=It(he=>r?he.snapshots[r]:void 0),z=It(he=>{var Oe;return r?(Oe=he.deviceErrors)==null?void 0:Oe[r]:void 0}),K=It(he=>{var Oe;return r?(Oe=he.deviceConnected)==null?void 0:Oe[r]:!1}),B=It(he=>he.lastConnectRequest),q=It(he=>he.socketReady),Q=Tn(he=>{var Oe;return((Oe=he.settings)==null?void 0:Oe.siteName)??"tmex"}),te=N.useMemo(()=>Am(a),[a]),se=N.useMemo(()=>r&&te?`${r}:${te}`:null,[r,te]),[be,H]=N.useState(!1),[G,ae]=N.useState(""),[fe,me]=N.useState(!1),[ue,we]=N.useState(!0),[Ke,Pe]=N.useState(null),Ee=Ir(he=>he.inputMode),Se=Ir(he=>he.editorSendWithEnter),Ie=Ir(he=>he.setEditorSendWithEnter),je=Ir(he=>he.addEditorHistory),ot=Ir(he=>he.setEditorDraft),Ne=Ir(he=>he.removeEditorDraft),De=Ir(he=>se?he.editorDrafts[se]??"":""),$e=(Ti=k==null?void 0:k.session)==null?void 0:Ti.windows,{data:ze}=Qs({queryKey:["devices"],queryFn:async()=>{const he=await fetch("/api/devices");if(!he.ok)throw new Error("Failed to fetch devices");return he.json()},throwOnError:!1}),nt=N.useMemo(()=>{if(r)return ze==null?void 0:ze.devices.find(he=>he.id===r)},[r,ze==null?void 0:ze.devices]),Ct=N.useMemo(()=>{if(!(!s||!$e))return $e.find(he=>he.id===s)},[s,$e]),xt=N.useMemo(()=>{if(!(!te||!Ct))return Ct.panes.find(he=>he.id===te)},[te,Ct]),Je=!!$e,Pt=Je&&!!s&&!Ct||Je&&!!s&&!!te&&!!Ct&&!xt?i("wsError.checkGateway"):null,et=!!Pt,di=N.useMemo(()=>!Pt||!r||!s||!te?null:`${r}:${s}:${te}:${Pt}`,[r,Pt,te,s]),Ye=!!(K&&te&&!et),_i=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");N.useEffect(()=>{!_i||!r||B&&B.deviceId!==r&&console.warn("[tmux] route device mismatch with last connect request",{routeDeviceId:r,lastConnectRequest:B})},[r,_i,B]);const Ft=N.useMemo(()=>{if(!Ct||!xt)return null;const he=(nt==null?void 0:nt.name)??r;return M1({paneIdx:xt.index,windowIdx:Ct.index,paneTitle:xt.title,windowName:Ct.name,deviceName:he})},[nt==null?void 0:nt.name,r,xt,Ct]),Cr=N.useCallback((he,Oe=!1)=>{var _e;if(!r||!te||!K||et||!Oe&&Date.now()<D.current)return!1;const tt=g.current;if(!tt)return!1;(_e=l.current)==null||_e.fit();const W=Math.max(2,tt.cols),ie=Math.max(2,tt.rows),oe=y.current;return!Oe&&oe&&oe.cols===W&&oe.rows===ie||(he==="sync"?X(r,te,W,ie):Z(r,te,W,ie),y.current={cols:W,rows:ie},E.current={cols:W,rows:ie,at:Date.now()}),!0},[K,r,et,Z,te,X]),fi=N.useCallback((he="resize",Oe={})=>{const{immediate:tt=!1,force:W=!1}=Oe;_.current!==null&&(window.clearTimeout(_.current),_.current=null),v.current!==null&&(cancelAnimationFrame(v.current),v.current=null);const ie=()=>{v.current=requestAnimationFrame(()=>{v.current=null,Cr(he,W)})};if(tt){ie();return}_.current=window.setTimeout(()=>{_.current=null,ie()},80)},[Cr]),ri=N.useCallback(()=>{for(const he of A.current)window.clearTimeout(he);A.current=[]},[]),Ri=N.useCallback(()=>{var Oe;ri(),fi("sync",{immediate:!0,force:!0});const he=window.setTimeout(()=>{fi("sync",{immediate:!0,force:!0})},60);A.current.push(he),typeof document<"u"&&"fonts"in document&&((Oe=document.fonts)!=null&&Oe.ready)&&document.fonts.ready.then(()=>{fi("sync",{immediate:!0,force:!0})}).catch(()=>{})},[ri,fi]),Ni=N.useCallback((he,Oe)=>{if(he!==d.current)return;if(C.current){w.current=null;return}x.current!==null&&(window.clearTimeout(x.current),x.current=null);const tt=g.current;if(!b.current||!tt){w.current={sessionId:he,data:Oe};return}tt.write(j4(Oe));for(const W of h.current)tt.write(W);h.current=[],R.current=!0,C.current=!0,w.current=null},[]),ji=N.useCallback(he=>{if(he!==d.current||C.current)return;const Oe=g.current;if(!(!b.current||!Oe)){if(h.current.length>0){for(const tt of h.current)Oe.write(tt);h.current=[]}R.current=!0,C.current=!0,w.current=null}},[]);N.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current),ri(),_.current!==null&&window.clearTimeout(_.current),v.current!==null&&cancelAnimationFrame(v.current)},[ri]),N.useEffect(()=>{if(!s||!te)return;d.current+=1,R.current=!1,C.current=!1,w.current=null,h.current=[],m.current=!1,y.current=null,E.current=null,x.current!==null&&(window.clearTimeout(x.current),x.current=null),ri();const he=g.current;he&&b.current&&he.reset()},[ri,r,s,te]),N.useEffect(()=>{const he=()=>{H(window.innerWidth<768||"ontouchstart"in window)};return he(),window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]),N.useEffect(()=>{if(!f.current||g.current)return;const he=f.current,Oe=()=>{try{const W=N4(),ie=new O4.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,...W?{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}),oe=new L4.FitAddon,_e=new B4.Unicode11Addon;ie.loadAddon(oe),ie.loadAddon(_e),ie.unicode.versions.includes("11")&&(ie.unicode.activeVersion="11"),ie.open(he),requestAnimationFrame(()=>{oe.fit(),b.current=!0;const Ce=w.current;Ce&&Ce.sessionId===d.current?Ni(Ce.sessionId,Ce.data):Ce&&(w.current=null)}),g.current=ie,l.current=oe,we(!1)}catch(W){console.error("[DevicePage] Failed to initialize terminal:",W),Pe(i("terminal.initFailed")),we(!1)}},tt=he.getBoundingClientRect();if(tt.width>0&&tt.height>0)Oe();else{const W=new ResizeObserver(ie=>{for(const oe of ie){const{width:_e,height:Ce}=oe.contentRect;if(_e>0&&Ce>0&&!g.current){Oe(),W.disconnect();break}}});return W.observe(he),()=>W.disconnect()}return()=>{if(g.current){try{g.current.dispose()}catch{}g.current=null}l.current=null,b.current=!1}},[Ni,i]),N.useEffect(()=>{if(r)return U(r,"page"),u.current=!1,()=>{V(r,"page")}},[U,r,V]),N.useEffect(()=>{if(r)return F(r,he=>{const Oe=H4(he,m.current);if(m.current=Oe.endedWithCR,!b.current||!g.current){h.current.push(Oe.normalized.slice());return}if(!R.current){h.current.push(Oe.normalized.slice());return}g.current.write(Oe.normalized)})},[r,F]),N.useEffect(()=>{if(!r||!te||!q)return;const he=d.current;return Y(r,te,Oe=>{Ni(he,Oe)})},[Ni,r,te,q,Y]),N.useEffect(()=>{if(!r||s&&te||u.current||!K||!$e||$e.length===0)return;const he=$e.find(tt=>tt.active)??$e[0],Oe=he.panes.find(tt=>tt.active)??he.panes[0];Oe&&(u.current=!0,c(`/devices/${r}/windows/${he.id}/panes/${Nb(Oe.id)}`,{replace:!0}))},[K,r,c,te,s,$e]),N.useEffect(()=>{if(!r||!s||!te||ue||!q||!K||et)return;const he=d.current;x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{x.current=null,ji(he)},400),Cr("sync",!0),j(r,s,te),Ri()},[K,r,ji,ue,et,Cr,te,Ri,j,q,s]),N.useEffect(()=>{if(!Ye||!xt||!b.current)return;const he=g.current;if(!he)return;const Oe=Math.max(2,Math.floor(xt.width||0)),tt=Math.max(2,Math.floor(xt.height||0));if(!Oe||!tt||he.cols===Oe&&he.rows===tt)return;const W=E.current;if(W){const ie=Date.now()-W.at;if(W.cols===Oe&&W.rows===tt&&ie<1800){E.current=null,y.current={cols:Oe,rows:tt};return}if(ie<900)return;E.current=null}D.current=Date.now()+220,he.resize(Oe,tt),y.current={cols:Oe,rows:tt}},[Ye,xt]),N.useEffect(()=>{!Ye||ue||fi("resize",{immediate:!0,force:!0})},[Ye,ue,fi]),N.useEffect(()=>{!Ye||!xt||ue||Ri()},[Ye,ue,Ri,xt==null?void 0:xt.id]),N.useEffect(()=>{const he=g.current;if(!he||!r||!te)return;const Oe=he.onData(tt=>{Ye&&(fe||$(r,te,tt,!1))});return he.attachCustomKeyEventHandler(tt=>!Ye||Ee!=="direct"||fe||tt.type!=="keydown"?!0:tt.shiftKey&&tt.key==="Enter"?(tt.preventDefault(),$(r,te,"\x1B[13;2u",!1),!1):!0),()=>{Oe.dispose(),he.attachCustomKeyEventHandler(()=>!0)}},[Ye,r,Ee,fe,te,$]),N.useEffect(()=>{ae(De)},[De]),N.useEffect(()=>{if(!Ye)return;const he=()=>{fi("resize")};return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[Ye,fi]),N.useEffect(()=>{const he=f.current;if(!he||!Ye)return;const Oe=new ResizeObserver(()=>{fi("resize")});return Oe.observe(he),()=>Oe.disconnect()},[Ye,fi]),N.useEffect(()=>{z!=null&&z.message&&wt.error(z.message)},[z==null?void 0:z.message]),N.useEffect(()=>{Ke&&wt.error(Ke)},[Ke]),N.useEffect(()=>{if(T.current=di,O.current!==null&&(window.clearTimeout(O.current),O.current=null),!di||!Pt){L.current=null;return}if(L.current!==di)return O.current=window.setTimeout(()=>{T.current===di&&(wt.error(Pt),L.current=di,O.current=null)},500),()=>{O.current!==null&&(window.clearTimeout(O.current),O.current=null)}},[di,Pt]),N.useEffect(()=>(document.title=R4(Ft),()=>{document.title=Q}),[Q,Ft]),N.useEffect(()=>{const he=()=>{var Oe;(Oe=g.current)==null||Oe.scrollToBottom()};return window.addEventListener("tmex:jump-to-latest",he),()=>{window.removeEventListener("tmex:jump-to-latest",he)}},[]);const Hi=N.useCallback(()=>{var he;(he=g.current)==null||he.scrollToBottom()},[]),Ve=N.useCallback(he=>{!r||!te||!Ye||$(r,te,he,!1)},[Ye,r,te,$]),Mt=N.useCallback(()=>{if(!r||!te||!Ye||!G.trim())return;const he=Se?`${G}\r`:G;$(r,te,he,!1),je(G),se&&Ne(se),ae("")},[je,Ye,r,se,Se,G,Ne,te,$]),Kt=N.useCallback(()=>{if(!r||!te||!Ye||!G.trim())return;const he=G.split(/\r?\n/);for(const Oe of he)Oe.trim()&&$(r,te,`${Oe}\r`,!1);je(G),se&&Ne(se),ae("")},[je,Ye,r,se,G,Ne,te,$]);if(!r)return P.jsx("div",{className:"flex items-center justify-center h-full",children:P.jsx("div",{className:"text-[var(--color-text-secondary)]",children:i("device.noDevices")})});const Vt=!K&&!z;return P.jsxs("div",{className:"flex flex-col h-full bg-[var(--color-bg)]","data-testid":"device-page",children:[!be&&P.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:[P.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1 overflow-hidden",children:P.jsx("span",{"data-testid":"terminal-topbar-title",className:"text-sm font-medium truncate",title:Ft??Q,children:Ft??Q})}),P.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[P.jsxs(Rt,{variant:"ghost",size:"sm","data-testid":"terminal-jump-latest",className:"px-2 py-1 text-xs",onClick:Hi,title:i("nav.jumpToLatest"),disabled:!Ye,children:[P.jsx(bb,{className:"h-3 w-3 mr-1"}),P.jsx("span",{className:"hidden sm:inline",children:i("nav.jumpToLatest")})]}),P.jsx(Rt,{variant:"default",size:"sm","data-testid":"terminal-input-mode-toggle",className:"px-2 py-1 text-xs",onClick:()=>Ir.setState({inputMode:Ee==="direct"?"editor":"direct"}),children:Ee==="direct"?P.jsxs(P.Fragment,{children:[P.jsx(wb,{className:"h-3 w-3 mr-1"})," ",i("nav.switchToEditor")]}):P.jsxs(P.Fragment,{children:[P.jsx(Eb,{className:"h-3 w-3 mr-1"})," ",i("nav.switchToDirect")]})})]})]}),P.jsx("div",{className:"terminal-shortcuts-strip","data-testid":"terminal-shortcuts-strip",children:P.jsx("div",{className:"shortcut-row","data-testid":"editor-shortcuts-row",children:P4.map(he=>P.jsx(Rt,{variant:"default",size:"sm",title:he.label,"aria-label":he.label,"data-testid":`editor-shortcut-${he.key}`,onClick:()=>Ve(he.payload),disabled:!Ye,children:he.label},he.key))})}),P.jsxs("div",{className:`flex-1 relative overflow-hidden min-h-0 min-w-0 ${be&&Ee==="editor"?"pb-2":""}`,children:[P.jsx("div",{ref:f,className:"w-full h-full min-w-0 min-h-0"}),(ue||Vt)&&P.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:P.jsxs("div",{className:"flex flex-col items-center gap-3",children:[P.jsx("div",{className:"w-8 h-8 border-2 border-[var(--color-accent)] border-t-transparent rounded-full animate-spin"}),P.jsx("span",{className:"text-[var(--color-text-secondary)]","data-testid":"terminal-status-text",children:i(ue?"terminal.initializing":"terminal.connecting")})]})})]}),Ee==="editor"&&P.jsxs("div",{className:"editor-mode-input",children:[P.jsx("textarea",{"data-testid":"editor-input",value:G,onChange:he=>{const Oe=he.target.value;if(ae(Oe),!!se){if(Oe){ot(se,Oe);return}Ne(se)}},placeholder:i("terminal.inputPlaceholder"),onCompositionStart:()=>me(!0),onCompositionEnd:()=>me(!1)}),P.jsx("div",{className:"actions",children:P.jsxs("div",{className:"send-row","data-testid":"editor-send-row",children:[P.jsxs("label",{className:"send-with-enter-toggle","data-testid":"editor-send-with-enter-toggle",children:[P.jsx("input",{type:"checkbox",checked:Se,onChange:he=>Ie(he.target.checked)}),P.jsx("span",{children:i("terminal.editorSendWithEnter")})]}),P.jsxs(Rt,{variant:"default",size:"sm","data-testid":"editor-clear",onClick:()=>{ae(""),se&&Ne(se)},title:i("terminal.clear"),children:[P.jsx(Tm,{className:"h-4 w-4 mr-1"}),i("terminal.clear")]}),P.jsxs(Rt,{variant:"default",size:"sm","data-testid":"editor-send-line-by-line",onClick:Kt,disabled:!Ye,children:[P.jsx(qf,{className:"h-4 w-4 mr-1"}),i("terminal.editorSendLineByLine")]}),P.jsxs(Rt,{variant:"primary",size:"sm","data-testid":"editor-send",onClick:Mt,disabled:!Ye,children:[P.jsx(qf,{className:"h-4 w-4 mr-1"}),i("common.send")]})]})})]}),be&&Ee==="direct"&&P.jsx("input",{type:"text",className:"sr-only",onCompositionStart:()=>me(!0),onCompositionEnd:he=>{me(!1),!(!r||!te||!Ye)&&($(r,te,he.target.value,!1),he.target.value="")}})]})}function Vr(i){const r=i.trim();return r||void 0}function fy(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 z4(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 U4(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 my(i,r){try{return(await i.json()).error??r}catch{return r}}function py(){const{t:i}=wr(),[r,s]=N.useState(!1),[a,c]=N.useState(null),f=ea(),{data:g,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"]}),wt.success(i("common.success"))},onError:b=>{wt.error(b instanceof Error?b.message:i("common.error"))}}),h=(g==null?void 0:g.devices)??[];return P.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[P.jsxs("div",{className:"flex items-center justify-between mb-6",children:[P.jsx("h1",{className:"text-2xl font-bold",children:i("device.title")}),P.jsxs(Rt,{variant:"primary","data-testid":"devices-add",onClick:()=>s(!0),children:[P.jsx(Cb,{className:"h-4 w-4"}),i("device.addDevice")]})]}),l?P.jsx("div",{className:"text-center py-12 text-[var(--color-text-secondary)]",children:i("common.loading")}):h.length===0?P.jsx(yl,{children:P.jsxs(Ou,{className:"text-center py-12",children:[P.jsx("div",{className:"text-4xl mb-4",children:"🖥️"}),P.jsx("h3",{className:"text-lg font-medium mb-2",children:i("device.noDevices")}),P.jsxs("p",{className:"text-[var(--color-text-secondary)] mb-4",children:[i("device.typeLocal")," / SSH ",i("device.type")]}),P.jsx(Rt,{variant:"primary","data-testid":"devices-add-empty",onClick:()=>s(!0),children:i("device.addDevice")})]})}):P.jsx("div",{className:"grid gap-4",children:h.map(b=>P.jsx(I4,{device:b,onEdit:()=>c(b),onDelete:()=>u.mutate(b.id)},b.id))}),r&&P.jsx(gy,{mode:"create",onClose:()=>s(!1)}),a&&P.jsx(gy,{mode:"edit",device:a,onClose:()=>c(null)})]})}function I4({device:i,onEdit:r,onDelete:s}){const{t:a}=wr(),c=i.type==="local"?P.jsx(fu,{className:"h-6 w-6"}):P.jsx(Sb,{className:"h-6 w-6"}),f=i.type==="local"?a("device.typeLocal"):`${i.username}@${i.host}:${i.port}`;return P.jsx(yl,{"data-testid":"device-card","data-device-id":i.id,"data-device-name":i.name,children:P.jsxs(Au,{children:[P.jsx("div",{className:"text-[var(--color-accent)]",children:c}),P.jsxs("div",{className:"flex-1 min-w-0",children:[P.jsx(Lu,{children:i.name}),P.jsx(L1,{children:f}),i.session&&i.session!=="tmex"&&P.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:["Session: ",i.session]})]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Rt,{variant:"default",size:"sm",onClick:r,title:a("device.editDevice"),children:P.jsx(rR,{className:"h-4 w-4"})}),P.jsx(Rt,{variant:"primary",size:"sm",asChild:!0,children:P.jsx(yn,{"data-testid":`device-connect-${i.id}`,to:`/devices/${i.id}`,children:a("device.connect")})}),P.jsx(Rt,{variant:"danger",size:"sm",onClick:s,title:a("common.delete"),children:P.jsx(Tm,{className:"h-4 w-4"})})]})]})})}function gy({mode:i,device:r,onClose:s}){const{t:a}=wr(),c=ea(),[f,g]=N.useState(!1),[l,u]=N.useState(()=>fy(r));N.useEffect(()=>{u(fy(r))},[r]);const h=l.type==="ssh",b=i==="edit",d=_r({mutationFn:async T=>{const L=await fetch("/api/devices",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!L.ok)throw new Error(await my(L,a("device.createFailed")));return L.json()},onSuccess:()=>{c.invalidateQueries({queryKey:["devices"]}),wt.success(a("common.success")),s()},onError:T=>{wt.error(T instanceof Error?T.message:a("common.error"))}}),w=_r({mutationFn:async T=>{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(T)});if(!L.ok)throw new Error(await my(L,a("device.updateFailed")));return L.json()},onSuccess:()=>{c.invalidateQueries({queryKey:["devices"]}),wt.success(a("common.success")),s()},onError:T=>{wt.error(T instanceof Error?T.message:a("common.error"))}}),C=async T=>{T.preventDefault(),g(!0);try{i==="create"?await d.mutateAsync(z4(l)):await w.mutateAsync(U4(l))}catch{}finally{g(!1)}},R=`${i}-device-name`,x=`${i}-device-type`,m=`${i}-device-host`,v=`${i}-device-port`,_=`${i}-device-username`,y=`${i}-device-session`,E=`${i}-device-auth-mode`,D=`${i}-device-password`,A=`${i}-device-private-key`,O=`${i}-device-private-key-passphrase`;return P.jsx(h4,{open:!0,onOpenChange:T=>!T&&s(),"data-testid":"device-dialog",children:P.jsxs(d4,{className:"w-full max-w-lg",children:[P.jsxs(f4,{children:[P.jsx(m4,{children:a(b?"device.editDevice":"device.addDevice")}),P.jsx(p4,{})]}),P.jsxs("form",{onSubmit:C,children:[P.jsxs(g4,{className:"space-y-4",children:[P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:R,children:a("device.name")}),P.jsx(Ei,{id:R,"data-testid":"device-name-input",type:"text",value:l.name,onChange:T=>u(L=>({...L,name:T.target.value})),placeholder:a("device.namePlaceholder"),required:!0})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:x,children:a("device.type")}),P.jsxs(_u,{id:x,"data-testid":"device-type-select",value:l.type,onChange:T=>{const L=T.target.value;u(U=>({...U,type:L,authMode:L==="local"?"auto":U.authMode==="auto"?"password":U.authMode}))},disabled:b,children:[P.jsx(Zn,{value:"local",children:a("device.typeLocal")}),P.jsxs(Zn,{value:"ssh",children:["SSH ",a("device.type")]})]})]}),h&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[P.jsxs("div",{className:"col-span-2",children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:m,children:a("device.host")}),P.jsx(Ei,{id:m,type:"text",value:l.host,onChange:T=>u(L=>({...L,host:T.target.value})),placeholder:a("device.hostPlaceholder")})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:v,children:a("device.port")}),P.jsx(Ei,{id:v,type:"number",value:l.port,onChange:T=>u(L=>({...L,port:Number.parseInt(T.target.value||"22",10)})),min:1,max:65535})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:_,children:a("device.username")}),P.jsx(Ei,{id:_,type:"text",value:l.username,onChange:T=>u(L=>({...L,username:T.target.value})),placeholder:a("device.usernamePlaceholder")})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:y,children:a("device.session")}),P.jsx(Ei,{id:y,"data-testid":"device-session-input",type:"text",value:l.session,onChange:T=>u(L=>({...L,session:T.target.value})),placeholder:a("device.sessionPlaceholder")}),P.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:'"tmex"'})]}),h&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:E,children:a("device.authMode")}),P.jsxs(_u,{id:E,value:l.authMode,onChange:T=>u(L=>({...L,authMode:T.target.value})),children:[P.jsx(Zn,{value:"password",children:a("device.authPassword")}),P.jsx(Zn,{value:"key",children:a("device.authKey")}),P.jsx(Zn,{value:"agent",children:a("device.authAgent")}),P.jsx(Zn,{value:"configRef",children:"SSH Config"})]})]}),l.authMode==="password"&&P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:D,children:a("device.password")}),P.jsx(Ei,{id:D,type:"password",value:l.password,onChange:T=>u(L=>({...L,password:T.target.value}))})]}),l.authMode==="key"&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:A,children:a("device.privateKey")}),P.jsx(jb,{id:A,value:l.privateKey,onChange:T=>u(L=>({...L,privateKey:T.target.value})),className:"h-24 font-mono text-xs",placeholder:a("device.privateKeyPlaceholder")})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:O,children:a("device.passphrase")}),P.jsx(Ei,{id:O,type:"password",value:l.privateKeyPassphrase,onChange:T=>u(L=>({...L,privateKeyPassphrase:T.target.value}))})]})]})]})]}),P.jsxs(v4,{className:"px-4 pb-4",children:[P.jsx(Rt,{type:"button",variant:"default",className:"flex-1",onClick:s,children:a("common.cancel")}),P.jsx(Rt,{type:"submit",variant:"primary",className:"flex-1","data-testid":"device-dialog-save",disabled:f,children:a(f?"common.saving":"common.save")})]})]})]})})}async function Br(i,r){try{return(await i.json()).error??r}catch{return r}}function F4(){var Y,k;const{t:i}=wr(),r=ea(),{refreshSettings:s}=Tn(),[a,c]=N.useState("tmex"),[f,g]=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),[x,m]=N.useState(2),[v,_]=N.useState(10),[y,E]=N.useState(!1),[D,A]=N.useState(""),[O,T]=N.useState(""),[L,U]=N.useState(null),V=Qs({queryKey:["site-settings"],queryFn:async()=>{const z=await fetch("/api/settings/site");if(!z.ok)throw new Error(await Br(z,i("settings.loadFailed")));return await z.json()}}),j=Qs({queryKey:["telegram-bots"],queryFn:async()=>{const z=await fetch("/api/settings/telegram/bots");if(!z.ok)throw new Error(await Br(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),g(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:x,sshReconnectDelaySeconds:v})});if(!K.ok)throw new Error(await Br(K,i("settings.saveFailed")))},onSuccess:async()=>{var z,K;await Promise.all([r.invalidateQueries({queryKey:["site-settings"]}),s()]),wt.success(i("settings.settingsSaved")),((K=(z=V.data)==null?void 0:z.settings)==null?void 0:K.language)!==l&&E(!0)},onError:z=>{wt.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 Br(z,i("settings.restartFailed")))},onSuccess:()=>{wt.success(i("settings.restartScheduled"))},onError:z=>{wt.error(z instanceof Error?z.message:i("common.error"))}}),X=_r({mutationFn:async()=>{const z=await fetch("/api/settings/telegram/bots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:D,token:O,enabled:!0,allowAuthRequests:!0})});if(!z.ok)throw new Error(await Br(z,i("telegram.createFailed")))},onSuccess:async()=>{A(""),T(""),await r.invalidateQueries({queryKey:["telegram-bots"]}),wt.success(i("common.success"))},onError:z=>{wt.error(z instanceof Error?z.message:i("common.error"))}}),F=((k=j.data)==null?void 0:k.bots)??[];return P.jsxs("div",{className:"p-6 max-w-5xl mx-auto space-y-6","data-testid":"settings-page",children:[P.jsxs("div",{className:"flex items-center justify-between",children:[P.jsx("h1",{className:"text-2xl font-bold",children:i("nav.settings")}),P.jsxs(Rt,{variant:"ghost",onClick:()=>{Promise.all([r.invalidateQueries({queryKey:["site-settings"]}),r.invalidateQueries({queryKey:["telegram-bots"]})])},children:[P.jsx(aR,{className:"h-4 w-4"}),i("common.refresh")]})]}),P.jsxs(yl,{children:[P.jsx(Au,{children:P.jsx(Lu,{children:i("settings.siteName")})}),P.jsxs(Ou,{className:"space-y-4",children:[P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"site-name-input",children:i("settings.siteName")}),P.jsx(Ei,{id:"site-name-input",value:a,onChange:z=>c(z.target.value),placeholder:i("settings.siteNamePlaceholder")})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"site-url-input",children:i("settings.siteUrl")}),P.jsx(Ei,{id:"site-url-input",value:f,onChange:z=>g(z.target.value),placeholder:i("settings.siteUrlPlaceholder")})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"language-select",children:i("settings.language")}),P.jsxs(_u,{id:"language-select","data-testid":"settings-language-select",value:l,onChange:z=>u(z.target.value),children:[P.jsx(Zn,{value:"en_US",children:i("settings.language_en_US")}),P.jsx(Zn,{value:"zh_CN",children:i("settings.language_zh_CN")})]}),y&&P.jsx("p",{className:"text-xs text-[var(--color-accent)] mt-1","data-testid":"settings-refresh-notice",children:i("settings.refreshToApply")})]}),P.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[P.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer select-none",htmlFor:"enable-browser-bell-toast",children:[P.jsx("input",{id:"enable-browser-bell-toast","data-testid":"settings-enable-browser-bell-toast",type:"checkbox",checked:d,onChange:z=>w(z.target.checked)}),P.jsx("span",{children:i("settings.enableBrowserBellToast")})]}),P.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer select-none",htmlFor:"enable-telegram-bell-push",children:[P.jsx("input",{id:"enable-telegram-bell-push","data-testid":"settings-enable-telegram-bell-push",type:"checkbox",checked:C,onChange:z=>R(z.target.checked)}),P.jsx("span",{children:i("settings.enableTelegramBellPush")})]})]}),P.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"bell-throttle-input",children:i("settings.bellThrottle")}),P.jsx(Ei,{id:"bell-throttle-input",type:"number",value:h,min:0,max:300,onChange:z=>b(Number(z.target.value))})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"ssh-reconnect-retries-input",children:i("settings.sshReconnectMaxRetries")}),P.jsx(Ei,{id:"ssh-reconnect-retries-input",type:"number",value:x,min:0,max:20,onChange:z=>m(Number(z.target.value))})]}),P.jsxs("div",{children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"ssh-reconnect-delay-input",children:i("settings.sshReconnectDelay")}),P.jsx(Ei,{id:"ssh-reconnect-delay-input",type:"number",value:v,min:1,max:300,onChange:z=>_(Number(z.target.value))})]})]}),P.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P.jsxs(Rt,{variant:"danger","data-testid":"settings-restart",onClick:()=>Z.mutate(),disabled:Z.isPending,children:[P.jsx(lR,{className:"h-4 w-4"}),i("settings.restartGateway")]}),P.jsxs(Rt,{variant:"primary","data-testid":"settings-save",onClick:()=>$.mutate(),disabled:$.isPending,children:[P.jsx(Ff,{className:"h-4 w-4"}),i("common.save")]})]})]})]}),P.jsxs(yl,{children:[P.jsx(Au,{children:P.jsx(Lu,{children:i("telegram.title")})}),P.jsxs(Ou,{className:"space-y-4",children:[P.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end",children:[P.jsxs("div",{className:"md:col-span-3",children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"new-bot-name",children:i("telegram.botName")}),P.jsx(Ei,{id:"new-bot-name",value:D,onChange:z=>A(z.target.value),placeholder:i("telegram.botNamePlaceholder")})]}),P.jsxs("div",{className:"md:col-span-7",children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:"new-bot-token",children:i("telegram.botToken")}),P.jsx(Ei,{id:"new-bot-token",type:"password",value:O,onChange:z=>T(z.target.value),placeholder:i("telegram.botTokenPlaceholder")})]}),P.jsx("div",{className:"md:col-span-2",children:P.jsxs(Rt,{variant:"primary",className:"w-full",onClick:()=>X.mutate(),disabled:X.isPending||!D.trim()||!O.trim(),children:[X.isPending?P.jsx(eR,{className:"h-4 w-4 animate-spin"}):P.jsx(Ff,{className:"h-4 w-4"}),i("telegram.addBot")]})})]}),P.jsxs("div",{className:"space-y-3",children:[j.isLoading&&P.jsx("div",{className:"text-sm text-[var(--color-text-secondary)]",children:i("common.loading")}),!j.isLoading&&F.length===0&&P.jsx("div",{className:"text-sm text-[var(--color-text-secondary)]",children:i("telegram.addBot")}),F.map(z=>P.jsx(q4,{bot:z,expanded:L===z.id,onToggleExpand:()=>{U(K=>K===z.id?null:z.id)}},z.id))]})]})]})]})}function q4({bot:i,expanded:r,onToggleExpand:s}){var E;const{t:a}=wr(),c=ea(),[f,g]=N.useState(i.name),[l,u]=N.useState(""),[h,b]=N.useState(i.enabled),[d,w]=N.useState(i.allowAuthRequests);N.useEffect(()=>{g(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 D=await fetch(`/api/settings/telegram/bots/${i.id}/chats`);if(!D.ok)throw new Error(await Br(D,a("telegram.loadChatsFailed")));return await D.json()}}),R=N.useMemo(()=>{var A;const D=((A=C.data)==null?void 0:A.chats)??[];return{pending:D.filter(O=>O.status==="pending"),authorized:D.filter(O=>O.status==="authorized")}},[(E=C.data)==null?void 0:E.chats]),x=_r({mutationFn:async()=>{const D={name:f,enabled:h,allowAuthRequests:d};l.trim()&&(D.token=l.trim());const A=await fetch(`/api/settings/telegram/bots/${i.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)});if(!A.ok)throw new Error(await Br(A,a("telegram.updateFailed")))},onSuccess:async()=>{u(""),await c.invalidateQueries({queryKey:["telegram-bots"]}),wt.success(a("common.success"))},onError:D=>{wt.error(D instanceof Error?D.message:a("common.error"))}}),m=_r({mutationFn:async()=>{const D=await fetch(`/api/settings/telegram/bots/${i.id}`,{method:"DELETE"});if(!D.ok)throw new Error(await Br(D,a("telegram.deleteFailed")))},onSuccess:async()=>{await c.invalidateQueries({queryKey:["telegram-bots"]}),wt.success(a("common.success"))},onError:D=>{wt.error(D instanceof Error?D.message:a("common.error"))}}),v=_r({mutationFn:async D=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(D)}/approve`,{method:"POST"});if(!A.ok)throw new Error(await Br(A,a("telegram.approveFailed")))},onSuccess:async()=>{await Promise.all([c.invalidateQueries({queryKey:["telegram-bots"]}),c.invalidateQueries({queryKey:["telegram-bot-chats",i.id]})]),wt.success(a("common.success"))},onError:D=>{wt.error(D instanceof Error?D.message:a("common.error"))}}),_=_r({mutationFn:async D=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(D)}`,{method:"DELETE"});if(!A.ok)throw new Error(await Br(A,a("telegram.removeFailed")))},onSuccess:async()=>{await Promise.all([c.invalidateQueries({queryKey:["telegram-bots"]}),c.invalidateQueries({queryKey:["telegram-bot-chats",i.id]})]),wt.success(a("common.success"))},onError:D=>{wt.error(D instanceof Error?D.message:a("common.error"))}}),y=_r({mutationFn:async D=>{const A=await fetch(`/api/settings/telegram/bots/${i.id}/chats/${encodeURIComponent(D)}/test`,{method:"POST"});if(!A.ok)throw new Error(await Br(A,a("telegram.testMessageFailed")))},onSuccess:()=>{wt.success(a("common.success"))},onError:D=>{wt.error(D instanceof Error?D.message:a("common.error"))}});return P.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-bg-secondary)] p-4 space-y-3",children:[P.jsxs("div",{className:"flex items-center justify-between gap-3",children:[P.jsxs("div",{children:[P.jsx("div",{className:"font-medium",children:i.name}),P.jsxs("div",{className:"text-xs text-[var(--color-text-secondary)]",children:[i.authorizedCount," / ",i.pendingCount]})]}),P.jsx(Rt,{variant:"ghost",onClick:s,children:a(r?"common.collapse":"common.expand")})]}),P.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end",children:[P.jsxs("div",{className:"md:col-span-3",children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:`bot-name-${i.id}`,children:a("telegram.botName")}),P.jsx(Ei,{id:`bot-name-${i.id}`,value:f,onChange:D=>g(D.target.value)})]}),P.jsxs("div",{className:"md:col-span-4",children:[P.jsx("label",{className:"block text-sm font-medium mb-1.5",htmlFor:`bot-token-${i.id}`,children:a("telegram.botToken")}),P.jsx(Ei,{id:`bot-token-${i.id}`,type:"password",value:l,onChange:D=>u(D.target.value),placeholder:a("telegram.tokenPlaceholder")})]}),P.jsx("div",{className:"md:col-span-2",children:P.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[P.jsx("input",{type:"checkbox",checked:h,onChange:D=>b(D.target.checked)}),a("common.enabled")]})}),P.jsx("div",{className:"md:col-span-3",children:P.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[P.jsx("input",{type:"checkbox",checked:d,onChange:D=>w(D.target.checked)}),a("telegram.allowAuthRequests")]})})]}),P.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P.jsxs(Rt,{variant:"danger",onClick:()=>m.mutate(),children:[P.jsx(Tm,{className:"h-4 w-4"}),a("telegram.deleteBot")]}),P.jsxs(Rt,{variant:"primary",onClick:()=>x.mutate(),children:[P.jsx(Ff,{className:"h-4 w-4"}),a("common.save")]})]}),r&&P.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 pt-2 border-t border-[var(--color-border)]",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1",children:[P.jsx(y0,{className:"h-4 w-4"}),a("telegram.pendingChats")]}),R.pending.length===0&&P.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:"-"}),R.pending.map(D=>P.jsx(vy,{chat:D,pending:!0,onApprove:()=>v.mutate(D.chatId),onDelete:()=>_.mutate(D.chatId)},`${D.botId}-${D.chatId}`))]}),P.jsxs("div",{className:"space-y-2",children:[P.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1",children:[P.jsx(y0,{className:"h-4 w-4"}),a("telegram.chats")]}),R.authorized.length===0&&P.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:"-"}),R.authorized.map(D=>P.jsx(vy,{chat:D,pending:!1,onTest:()=>y.mutate(D.chatId),onDelete:()=>_.mutate(D.chatId)},`${D.botId}-${D.chatId}`))]}),C.isLoading&&P.jsx("div",{className:"lg:col-span-2 text-xs text-[var(--color-text-secondary)]",children:a("common.loading")})]})]})}function vy({chat:i,pending:r,onApprove:s,onDelete:a,onTest:c}){const{t:f}=wr(),g=Tn(l=>{var u;return((u=l.settings)==null?void 0:u.language)??"en_US"});return P.jsxs("div",{className:"rounded border border-[var(--color-border)] p-3 bg-[var(--color-bg)] space-y-2",children:[P.jsx("div",{className:"text-sm font-medium truncate",title:i.displayName,children:i.displayName}),P.jsxs("div",{className:"text-xs text-[var(--color-text-secondary)]",children:[f("telegram.chatId"),":",i.chatId]}),P.jsx("div",{className:"text-xs text-[var(--color-text-secondary)]",children:new Date(i.appliedAt).toLocaleString(kb(g))}),P.jsx("div",{className:"flex items-center justify-end gap-2",children:r?P.jsxs(P.Fragment,{children:[P.jsx(Rt,{variant:"default",size:"sm",onClick:a,children:f("telegram.reject")}),P.jsx(Rt,{variant:"primary",size:"sm",onClick:s,children:f("telegram.authorize")})]}):P.jsxs(P.Fragment,{children:[P.jsxs(Rt,{variant:"default",size:"sm",onClick:c,children:[P.jsx(qf,{className:"h-3.5 w-3.5"}),f("telegram.sendTestMessage")]}),P.jsx(Rt,{variant:"danger",size:"sm",onClick:a,children:f("common.delete")})]})})]})}xi.use(GR).init({resources:i3,lng:Yf,fallbackLng:Yf,interpolation:{escapeValue:!1},returnNull:!1});const $4=new pC({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),K4=Gx([{path:"/",element:P.jsx(T4,{}),children:[{path:"settings",element:P.jsx(F4,{})},{path:"devices",element:P.jsx(py,{})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:P.jsx(dy,{})},{path:"devices/:deviceId",element:P.jsx(dy,{})},{path:"",element:P.jsx(py,{})}]}]),B1=document.getElementById("root");if(!B1)throw new Error("Root element not found");BC.createRoot(B1).render(P.jsx(N.StrictMode,{children:P.jsxs(vC,{client:$4,children:[P.jsx(Sx,{router:K4}),P.jsx(B2,{richColors:!0,position:"top-right",closeButton:!0,toastOptions:{duration:6e3}})]})}));
333
- //# sourceMappingURL=index-DNlxXBdI.js.map