@highstate/designer 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BzpzT3Fy.js","./BfQlfp01.js","./error-404.BJkSn6RI.css","./C97RHzKR.js","./error-500.TOCKLquH.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DJMH00PF.js","./H2Dg9Wnt.js","./error-404.BJkSn6RI.css","./Dy9sUyql.js","./error-500.TOCKLquH.css"])))=>i.map(i=>d[i]);
2
2
  var yQ=Object.defineProperty;var CQ=(t,e,n)=>e in t?yQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var bt=(t,e,n)=>CQ(t,typeof e!="symbol"?e+"":e,n);/**
3
3
  * @vue/shared v3.5.13
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -27,7 +27,7 @@ Use "options.replacer" or "options.ignoreUnknown"
27
27
  `);n=s.pop()??"";for(const a of s)r.enqueue(a)}}))}function Iie(t){const e=Oie(t);let n=!1;return e.pipeThrough(new TransformStream({transform(i,r){if(n){const s=JSON.parse(i);r.enqueue(s)}else{const s=JSON.parse(i);r.enqueue(s),n=!0}}}))}function Nie(t){const e=new Map;function n(){return Array.from(e.values()).every(a=>a.closed)}function i(){let a;const o=new ReadableStream({start(c){a=c}}),l={enqueue:c=>a.enqueue(c),close:()=>{a.close(),u(),n()&&t.abort()},closed:!1,getReaderResource:()=>{const c=o.getReader();return Cz(c,()=>{c.releaseLock(),l.close()})},error:c=>{a.error(c),u()}};function u(){Object.assign(l,{closed:!0,close:()=>{},enqueue:()=>{},getReaderResource:null,error:()=>{}})}return l}function r(a){let o=e.get(a);return o||(o=i(),e.set(a,o)),o}function s(a){for(const o of e.values())o.error(a)}return{getOrCreate:r,isEmpty:n,cancelAll:s}}async function xie(t){const{deserialize:e=l=>l}=t;let n=Iie(t.from);e&&(n=n.pipeThrough(new TransformStream({transform(l,u){u.enqueue(e(l))}})));let i=vie();const r=Nie(t.abortController);function s(l){const[u,c,d]=l,h=r.getOrCreate(d);switch(c){case bie:return av(async()=>{var S;const f={stack:[],error:void 0,hasError:!1};try{const _=nk(f,h.getReaderResource(),!1),{value:p}=await _.read(),[v,m,g]=p;switch(m){case yie:return a(g);case Cie:throw((S=t.formatError)==null?void 0:S.call(t,{error:g}))??new ik(g)}}catch(_){f.error=_,f.hasError=!0}finally{OA(f)}});case Eie:return av(async function*(){var S;const f={stack:[],error:void 0,hasError:!1};try{const _=nk(f,h.getReaderResource(),!1);for(;;){const{value:p}=await _.read(),[v,m,g]=p;switch(m){case wie:yield a(g);break;case Tie:return a(g);case Rie:throw((S=t.formatError)==null?void 0:S.call(t,{error:g}))??new ik(g)}}}catch(_){f.error=_,f.hasError=!0}finally{OA(f)}})}}function a(l){const[[u],...c]=l;for(const d of c){const[h]=d,f=s(d);if(h===null)return f;u[h]=f}return u}const o=l=>{i==null||i.reject(l),r.cancelAll(l)};return n.pipeTo(new WritableStream({write(l){if(i){const h=l;for(const[f,S]of Object.entries(l)){const _=a(S);h[f]=_}i.resolve(h),i=null;return}const u=l,[c]=u;r.getOrCreate(c).enqueue(u)},close:()=>o(new Error("Stream closed")),abort:o}),{signal:t.abortController.signal}).catch(l=>{var u;(u=t.onError)==null||u.call(t,{error:l}),o(l)}),[await i.promise,r]}function wz(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e}function _N(t){var e=typeof SuppressedError=="function"?SuppressedError:function(n,i,r){var s=new Error(r);return s.name="SuppressedError",s.error=n,s.suppressed=i,s};return(_N=function(i){function r(l){i.error=i.hasError?new e(l,i.error,"An error was suppressed during disposal."):l,i.hasError=!0}var s,a=0;function o(){for(;s=i.stack.pop();)try{if(!s.async&&a===1)return a=0,i.stack.push(s),Promise.resolve().then(o);if(s.dispose){var l=s.dispose.call(s.value);if(s.async)return a|=2,Promise.resolve(l).then(o,function(u){return r(u),o()})}else a|=1}catch(u){r(u)}if(a===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return o()})(t)}const Die="ping",kie="serialized-error",Mie="connected",Lie="return";async function Pie(t){const e={stack:[],error:void 0,hasError:!1};try{const n=wz(e,gie(t.timeoutMs),!1),i=await ma.race([t.promise,n.start()]);return i===Tz?await t.onTimeout():i}catch(n){e.error=n,e.hasError=!0}finally{_N(e)}}function Bie(t){const{deserialize:e=o=>o}=t;let n={};const i=t.signal;let r=null;const s=()=>new ReadableStream({async start(o){const[l,u]=await Promise.all([t.url(),t.init()]),c=r=new t.EventSource(l,u);o.enqueue({type:"connecting",eventSource:r,event:null}),c.addEventListener(Mie,h=>{const S=JSON.parse(h.data);n=S,o.enqueue({type:"connected",options:S,eventSource:c})}),c.addEventListener(kie,h=>{const f=h;o.enqueue({type:"serialized-error",error:e(JSON.parse(f.data)),eventSource:c})}),c.addEventListener(Die,()=>{o.enqueue({type:"ping",eventSource:c})}),c.addEventListener(Lie,()=>{c.close(),o.close(),r=null}),c.addEventListener("error",h=>{c.readyState===EventSource.CLOSED?o.error(h):o.enqueue({type:"connecting",eventSource:c,event:h})}),c.addEventListener("message",h=>{const f=h,_={data:e(JSON.parse(f.data))};f.lastEventId&&(_.id=f.lastEventId),o.enqueue({type:"data",data:_,eventSource:c})});const d=()=>{try{c.close(),o.close()}catch{}};i.aborted?d():i.addEventListener("abort",d)},cancel(){r==null||r.close()}}),a=()=>{let o=s(),l=o.getReader();async function u(){await l.cancel(),r=null}return mie({read(){return l.read()},async recreate(){await u(),o=s(),l=o.getReader()}},u)};return av(async function*(){const o={stack:[],error:void 0,hasError:!1};try{const l=wz(o,a(),!0);for(;;){let u=l.read();const c=n.reconnectAfterInactivityMs;c&&(u=Pie({promise:u,timeoutMs:c,onTimeout:async()=>{const h={value:{type:"timeout",ms:c,eventSource:r},done:!1};return await l.recreate(),h}}));const d=await u;if(d.done)return d.value;yield d.value}}catch(l){o.error=l,o.hasError=!0}finally{const l=_N(o);l&&await l}})}var wV,RV,AV,OV,IV,NV;typeof window>"u"||"Deno"in window||((RV=(wV=globalThis.process)==null?void 0:wV.env)==null?void 0:RV.NODE_ENV)==="test"||(OV=(AV=globalThis.process)==null?void 0:AV.env)!=null&&OV.JEST_WORKER_ID||(NV=(IV=globalThis.process)==null?void 0:IV.env)!=null&&NV.VITEST_WORKER_ID;function S_(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fie(t){return t instanceof rs||t instanceof Error&&t.name==="TRPCClientError"}function Uie(t){return AA(t)&&AA(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function $ie(t,e){return typeof t=="string"?t:AA(t)&&typeof t.message=="string"?t.message:e}class rs extends Error{static from(e,n={}){const i=e;return Fie(i)?(n.meta&&(i.meta={...i.meta,...n.meta}),i):Uie(i)?new rs(i.error.message,{...n,result:i}):new rs($ie(i,"Unknown error"),{...n,cause:i})}constructor(e,n){var r,s;const i=n==null?void 0:n.cause;super(e,{cause:i}),S_(this,"cause",void 0),S_(this,"shape",void 0),S_(this,"data",void 0),S_(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=(r=n==null?void 0:n.result)==null?void 0:r.error,this.data=(s=n==null?void 0:n.result)==null?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,rs.prototype)}}function CE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Gie{$request(e){return gz({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(lie())}async requestAsPromise(e){try{const n=this.$request(e);return(await aie(n)).result.data}catch(n){throw rs.from(n)}}query(e,n,i){return this.requestAsPromise({type:"query",path:e,input:n,context:i==null?void 0:i.context,signal:i==null?void 0:i.signal})}mutation(e,n,i){return this.requestAsPromise({type:"mutation",path:e,input:n,context:i==null?void 0:i.context,signal:i==null?void 0:i.signal})}subscription(e,n,i){return this.$request({type:"subscription",path:e,input:n,context:i.context,signal:i.signal}).subscribe({next(s){var a,o,l,u;switch(s.result.type){case"state":{(a=i.onConnectionStateChange)==null||a.call(i,s.result);break}case"started":{(o=i.onStarted)==null||o.call(i,{context:s.context});break}case"stopped":{(l=i.onStopped)==null||l.call(i);break}case"data":case void 0:{(u=i.onData)==null||u.call(i,s.result.data);break}}},error(s){var a;(a=i.onError)==null||a.call(i,s)},complete(){var s;(s=i.onComplete)==null||s.call(i)}})}constructor(e){CE(this,"links",void 0),CE(this,"runtime",void 0),CE(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(n=>n(this.runtime))}}function Hie(t){return new Gie(t)}const Vie=Symbol.for("trpc_untypedClient"),zie={query:"query",mutate:"mutation",subscribe:"subscription"},qie=t=>zie[t];function Yie(t){const e=bz(({path:n,args:i})=>{const r=[...n],s=qie(r.pop()),a=r.join(".");return t[s](a,...i)});return Ez(n=>n===Vie?t:e[n])}const rk=t=>typeof t=="function";function Wie(t){if(t)return t;if(typeof window<"u"&&rk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&rk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const sk=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function ok(t){let e=null,n=null;const i=()=>{clearTimeout(n),n=null,e=null};function r(o){var c,d;const l=[[]];let u=0;for(;;){const h=o[u];if(!h)break;const f=l[l.length-1];if(h.aborted){(c=h.reject)==null||c.call(h,new Error("Aborted")),u++;continue}if(t.validate(f.concat(h).map(_=>_.key))){f.push(h),u++;continue}if(f.length===0){(d=h.reject)==null||d.call(h,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function s(){const o=r(e);i();for(const l of o){if(!l.length)continue;const u={items:l};for(const d of l)d.batch=u;t.fetch(u.items.map(d=>d.key)).then(async d=>{var h;await Promise.all(d.map(async(f,S)=>{var p,v;const _=u.items[S];try{const m=await Promise.resolve(f);(p=_.resolve)==null||p.call(_,m)}catch(m){(v=_.reject)==null||v.call(_,m)}_.batch=null,_.reject=null,_.resolve=null}));for(const f of u.items)(h=f.reject)==null||h.call(f,new Error("Missing result")),f.batch=null}).catch(d=>{var h;for(const f of u.items)(h=f.reject)==null||h.call(f,d),f.batch=null})}}function a(o){const l={aborted:!1,key:o,batch:null,resolve:sk,reject:sk},u=new Promise((c,d)=>{l.reject=d,l.resolve=c,e||(e=[]),e.push(l)});return n||(n=setTimeout(s)),u}return{load:a}}function Kie(...t){const e=new AbortController,n=t.length;let i=0;const r=()=>{++i===n&&e.abort()};for(const s of t)s!=null&&s.aborted?r():s==null||s.addEventListener("abort",r,{once:!0});return e.signal}function Rz(...t){const e=new AbortController;for(const n of t)n!=null&&n.aborted?e.abort():n==null||n.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}function Az(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}function jie(t){return{url:t.url.toString(),fetch:t.fetch,transformer:Az(t.transformer),methodOverride:t.methodOverride}}function Qie(t){const e={};for(let n=0;n<t.length;n++){const i=t[n];e[n]=i}return e}const Xie={query:"GET",mutation:"POST",subscription:"PATCH"};function Oz(t){return"input"in t?t.transformer.input.serialize(t.input):Qie(t.inputs.map(e=>t.transformer.input.serialize(e)))}const IA=t=>{const e=t.url.split("?");let i=e[0].replace(/\/$/,"")+"/"+t.path;const r=[];if(e[1]&&r.push(e[1]),"inputs"in t&&r.push("batch=1"),t.type==="query"||t.type==="subscription"){const s=Oz(t);s!==void 0&&t.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(i+="?"+r.join("&")),i},Zie=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=Oz(t);return e!==void 0?JSON.stringify(e):void 0};class Jie extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const ere=t=>{var e;if(t!=null&&t.aborted)throw(e=t.throwIfAborted)==null||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Jie};async function tre(t){ere(t.signal);const e=t.getUrl(t),n=t.getBody(t),{type:i}=t,r=await(async()=>{const a=await t.headers();return Symbol.iterator in a?Object.fromEntries(a):a})(),s={...t.contentTypeHeader?{"content-type":t.contentTypeHeader}:{},...t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0,...r};return Wie(t.fetch)(e,{method:t.methodOverride??Xie[i],signal:t.signal,body:n,headers:s})}function nre(t){const e=jie(t),n=t.maxURLLength??1/0,i=t.maxItems??1/0;return()=>{const r=l=>({validate(u){if(n===1/0&&i===1/0)return!0;if(u.length>i)return!1;const c=u.map(f=>f.path).join(","),d=u.map(f=>f.input);return IA({...e,type:l,path:c,inputs:d,signal:null}).length<=n},async fetch(u){const c=u.map(m=>m.path).join(","),d=u.map(m=>m.input),h=Kie(...u.map(m=>m.signal)),f=new AbortController,_=await tre({...e,signal:Rz(h,f.signal),type:l,contentTypeHeader:"application/json",trpcAcceptHeader:"application/jsonl",getUrl:IA,getBody:Zie,inputs:d,path:c,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:u}):t.headers:{}}}),[p]=await xie({from:_.body,deserialize:e.transformer.output.deserialize,formatError(m){const g=m.error;return rs.from({error:g})},abortController:f});return Object.keys(u).map(async m=>{let g=await Promise.resolve(p[m]);if("result"in g){const b=await Promise.resolve(g.result);g={result:{data:await Promise.resolve(b.data)}}}return{json:g,meta:{response:_}}})}}),s=ok(r("query")),a=ok(r("mutation")),o={query:s,mutation:a};return({op:l})=>Xd(u=>{/* istanbul ignore if -- @preserve */if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`");const d=o[l.type].load(l);let h;return d.then(f=>{if(h=f,"error"in f.json){u.error(rs.from(f.json,{meta:f.meta}));return}else if("result"in f.json){u.next({context:f.meta,result:f.json.result}),u.complete();return}u.complete()}).catch(f=>{u.error(rs.from(f,{meta:h==null?void 0:h.meta}))}),()=>{}})}}function ak(t){return Array.isArray(t)?t:[t]}function ire(t){return e=>{const n=ak(t.true).map(r=>r(e)),i=ak(t.false).map(r=>r(e));return r=>Xd(s=>{const a=t.condition(r.op)?n:i;return gz({op:r.op,links:a}).subscribe(s)})}}const Nf=(t,...e)=>typeof t=="function"?t(...e):t;function rre(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}async function sre(t){const e=await Nf(t.url);if(!t.connectionParams)return e;const i=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+i}async function ore(t){const e={method:"connectionParams",data:await Nf(t)};return JSON.stringify(e)}function Rc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function are(t){const{promise:e,resolve:n,reject:i}=rre();return t.addEventListener("open",()=>{t.removeEventListener("error",i),n()}),t.addEventListener("error",i),e}function lre(t,{intervalMs:e,pongTimeoutMs:n}){let i,r;function s(){i=setTimeout(()=>{t.send("PING"),r=setTimeout(()=>{t.close()},n)},e)}function a(){clearTimeout(i),s()}function o(){clearTimeout(r),a()}t.addEventListener("open",s),t.addEventListener("message",({data:l})=>{clearTimeout(i),s(),l==="PONG"&&o()}),t.addEventListener("close",()=>{clearTimeout(i),clearTimeout(r)})}class lv{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++lv.connectCount;const e=sre(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=e.then(async n=>{this.ws=n,n.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&lre(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await are(n),this.urlOptions.connectionParams&&n.send(await ore(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var e;try{await this.openPromise}finally{(e=this.ws)==null||e.close()}}constructor(e){if(Rc(this,"id",++lv.connectCount),Rc(this,"WebSocketPonyfill",void 0),Rc(this,"urlOptions",void 0),Rc(this,"keepAliveOpts",void 0),Rc(this,"wsObservable",mz(null)),Rc(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}Rc(lv,"connectCount",0);function cre(t,e){return!e||t!=null&&typeof t!="object"?t:{...t??{},lastEventId:e}}async function ure(t){let e=await Nf(t.url);if(t.connectionParams){const n=await Nf(t.connectionParams),i=e.includes("?")?"&":"?";e+=i+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return e}const dre=[g_.BAD_GATEWAY,g_.SERVICE_UNAVAILABLE,g_.GATEWAY_TIMEOUT,g_.INTERNAL_SERVER_ERROR];function hre(t){const e=Az(t.transformer);return()=>({op:n})=>Xd(i=>{const{type:r,path:s,input:a}=n;/* istanbul ignore if -- @preserve */if(r!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let o;const l=new AbortController,u=Rz(n.signal,l.signal),c=Bie({url:async()=>IA({transformer:e,url:await ure(t),input:cre(a,o),path:s,type:r,signal:null}),init:()=>Nf(t.eventSourceOptions,{op:n}),signal:u,deserialize:e.output.deserialize,EventSource:t.EventSource??globalThis.EventSource}),d=mz({type:"state",state:"connecting",error:null}),h=d.subscribe({next(f){i.next({result:f})}});return av(async()=>{for await(const f of c)switch(f.type){case"ping":break;case"data":const S=f.data;let _;S.id?(o=S.id,_={id:S.id,data:S}):_={data:S.data},i.next({result:_,context:{eventSource:f.eventSource}});break;case"connected":{i.next({result:{type:"started"},context:{eventSource:f.eventSource}}),d.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const p=rs.from({error:f.error});if(dre.includes(f.error.code)){d.next({type:"state",state:"connecting",error:p});break}throw p}case"connecting":{const p=d.get(),v=f.event&&rs.from(f.event);if(!v&&p.state==="connecting")break;d.next({type:"state",state:"connecting",error:v});break}case"timeout":d.next({type:"state",state:"connecting",error:new rs(`Timeout of ${f.ms}ms reached while waiting for a response`)})}i.next({result:{type:"stopped"}}),d.next({type:"state",state:"idle",error:null}),i.complete()}).catch(f=>{i.error(rs.from(f))}),()=>{i.complete(),l.abort(),h.unsubscribe()}})}function fre(t,e){return e===void 0?t:`${t}-${nie(e||"")}`}function pre(t){return Lt(t)||typeof t=="function"}function lk(t){let e;return t!=null&&t.abortOnUnmount&&(_i()&&Xn(()=>{var n;(n=e==null?void 0:e.abort)==null||n.call(e)}),e=typeof AbortController<"u"?new AbortController:{}),e}function _re(t,e){return bz(n=>{const i=n.args,r=[t,...n.path],s=r.pop(),a=r.join("."),[o,l]=i;if(s==="_def")return{path:r};if(s==="useQuery"){const{trpc:u,queryKey:c,...d}=l||{},h=lk(u),f=c||fre(a,Jt(o)),S=pre(o)?[...d.watch||[],o]:d.watch;return j1(f,()=>e[a].query(Jt(o),{signal:h==null?void 0:h.signal,...u}),{...d,watch:S})}if(s==="useMutation"){const{trpc:u,...c}=l||{},d=ve(null),h=lk(u),f=j1(()=>e[a].mutate(d.value,{signal:h==null?void 0:h.signal,...u}),{...c,immediate:!1},"$oBI3baRD5o");async function S(_){return d.value=_,await f.execute(),gt(f.data.value)}return Object.assign(f,{mutate:S}),f}return e[a][s](...i)})}function mre(t){const e=Hie(t),n=Yie(e);return Ez(r=>_re(r,n))}const gre=jr(()=>({provide:{client:mre({links:[ire({condition:e=>e.type==="subscription",true:hre({url:"/api"}),false:nre({url:"/api"})})]})}})),ck=!1;function vre(){return{theme:{defaultTheme:"dark"}}}function nu(t,e){let n;function i(){n=Ql(),n.run(()=>e.length?e(()=>{n==null||n.stop(),i()}):e())}Ie(t,r=>{r&&!n?i():r||(n==null||n.stop(),n=void 0)},{immediate:!0}),Xn(()=>{n==null||n.stop()})}function Fn(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:d=>d,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:d=>d;const s=Li("useProxiedModel"),a=ve(t[e]!==void 0?t[e]:n),o=Gc(e),u=te(o!==e?()=>{var d,h,f,S;return t[e],!!(((d=s.vnode.props)!=null&&d.hasOwnProperty(e)||(h=s.vnode.props)!=null&&h.hasOwnProperty(o))&&((f=s.vnode.props)!=null&&f.hasOwnProperty(`onUpdate:${e}`)||(S=s.vnode.props)!=null&&S.hasOwnProperty(`onUpdate:${o}`)))}:()=>{var d,h;return t[e],!!((d=s.vnode.props)!=null&&d.hasOwnProperty(e)&&((h=s.vnode.props)!=null&&h.hasOwnProperty(`onUpdate:${e}`)))});nu(()=>!u.value,()=>{Ie(()=>t[e],d=>{a.value=d})});const c=te({get(){const d=t[e];return i(u.value?d:a.value)},set(d){const h=r(d),f=gt(u.value?t[e]:a.value);f===h||i(f)===d||(a.value=h,s==null||s.emit(`update:${e}`,h))}});return Object.defineProperty(c,"externalValue",{get:()=>u.value?t[e]:a.value}),c}const Sre={badge:"Badge",open:"Open",close:"Close",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Cancel"},dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},dateRangeInput:{divider:"to"},datePicker:{itemsSelected:"{0} selected",range:{title:"Select dates",header:"Enter dates"},title:"Select date",header:"Enter date",input:{placeholder:"Enter date"}},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more",today:"Today"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action",otp:"Please enter OTP character {0}"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},fileUpload:{title:"Drag and drop files here",divider:"or",browse:"Browse Files"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Go to page {0}",currentPage:"Page {0}, Current page",first:"First page",last:"Last page"}},stepper:{next:"Next",prev:"Previous"},rating:{ariaLabel:{item:"Rating {0} of {1}"}},loading:"Loading...",infiniteScroll:{loadMore:"Load more",empty:"No more"}},uk="$vuetify.",dk=(t,e)=>t.replace(/\{(\d+)\}/g,(n,i)=>String(e[+i])),Iz=(t,e,n)=>function(i){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];if(!i.startsWith(uk))return dk(i,s);const o=i.replace(uk,""),l=t.value&&n.value[t.value],u=e.value&&n.value[e.value];let c=yA(l,o,null);return c||(`${i}${t.value}`,c=yA(u,o,null)),c||(c=i),typeof c!="string"&&(c=i),dk(c,s)};function Nz(t,e){return(n,i)=>new Intl.NumberFormat([t.value,e.value],i).format(n)}function TE(t,e,n){const i=Fn(t,e,t[e]??n.value);return i.value=t[e]??n.value,Ie(n,r=>{t[e]==null&&(i.value=n.value)}),i}function xz(t){return e=>{const n=TE(e,"locale",t.current),i=TE(e,"fallback",t.fallback),r=TE(e,"messages",t.messages);return{name:"vuetify",current:n,fallback:i,messages:r,t:Iz(n,i,r),n:Nz(n,i),provide:xz({current:n,fallback:i,messages:r})}}}function bre(t){const e=ut((t==null?void 0:t.locale)??"en"),n=ut((t==null?void 0:t.fallback)??"en"),i=ve({en:Sre,...t==null?void 0:t.messages});return{name:"vuetify",current:e,fallback:n,messages:i,t:Iz(e,n,i),n:Nz(e,n),provide:xz({current:e,fallback:n,messages:i})}}const cv=Symbol.for("vuetify:locale");function Ere(t){return t.name!=null}function yre(t){const e=t!=null&&t.adapter&&Ere(t==null?void 0:t.adapter)?t==null?void 0:t.adapter:bre(t),n=Tre(e,t);return{...e,...n}}function Ip(){const t=an(cv);if(!t)throw new Error("[Vuetify] Could not find injected locale instance");return t}function Cre(){return{af:!1,ar:!0,bg:!1,ca:!1,ckb:!1,cs:!1,de:!1,el:!1,en:!1,es:!1,et:!1,fa:!0,fi:!1,fr:!1,hr:!1,hu:!1,he:!0,id:!1,it:!1,ja:!1,km:!1,ko:!1,lv:!1,lt:!1,nl:!1,no:!1,pl:!1,pt:!1,ro:!1,ru:!1,sk:!1,sl:!1,srCyrl:!1,srLatn:!1,sv:!1,th:!1,tr:!1,az:!1,uk:!1,vi:!1,zhHans:!1,zhHant:!1}}function Tre(t,e){const n=ve((e==null?void 0:e.rtl)??Cre()),i=te(()=>n.value[t.current.value]??!1);return{isRtl:i,rtl:n,rtlClasses:te(()=>`v-locale--is-${i.value?"rtl":"ltr"}`)}}function ec(){const t=an(cv);if(!t)throw new Error("[Vuetify] Could not find injected rtl instance");return{isRtl:t.isRtl,rtlClasses:t.rtlClasses}}const jS={"001":1,AD:1,AE:6,AF:6,AG:0,AI:1,AL:1,AM:1,AN:1,AR:1,AS:0,AT:1,AU:1,AX:1,AZ:1,BA:1,BD:0,BE:1,BG:1,BH:6,BM:1,BN:1,BR:0,BS:0,BT:0,BW:0,BY:1,BZ:0,CA:0,CH:1,CL:1,CM:1,CN:1,CO:0,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DM:0,DO:0,DZ:6,EC:1,EE:1,EG:6,ES:1,ET:0,FI:1,FJ:1,FO:1,FR:1,GB:1,"GB-alt-variant":0,GE:1,GF:1,GP:1,GR:1,GT:0,GU:0,HK:0,HN:0,HR:1,HU:1,ID:0,IE:1,IL:0,IN:0,IQ:6,IR:6,IS:1,IT:1,JM:0,JO:6,JP:0,KE:0,KG:1,KH:0,KR:0,KW:6,KZ:1,LA:0,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MH:0,MK:1,MM:0,MN:1,MO:0,MQ:1,MT:0,MV:5,MX:0,MY:1,MZ:0,NI:0,NL:1,NO:1,NP:0,NZ:1,OM:6,PA:0,PE:0,PH:0,PK:0,PL:1,PR:0,PT:0,PY:0,QA:6,RE:1,RO:1,RS:1,RU:1,SA:0,SD:6,SE:1,SG:0,SI:1,SK:1,SM:1,SV:0,SY:6,TH:0,TJ:1,TM:1,TR:1,TT:0,TW:0,UA:1,UM:0,US:0,UY:1,UZ:1,VA:1,VE:0,VI:0,VN:1,WS:0,XK:1,YE:0,ZA:0,ZW:0};function wre(t,e,n){const i=[];let r=[];const s=Dz(t),a=kz(t),o=n??jS[e.slice(-2).toUpperCase()]??0,l=(s.getDay()-o+7)%7,u=(a.getDay()-o+7)%7;for(let c=0;c<l;c++){const d=new Date(s);d.setDate(d.getDate()-(l-c)),r.push(d)}for(let c=1;c<=a.getDate();c++){const d=new Date(t.getFullYear(),t.getMonth(),c);r.push(d),r.length===7&&(i.push(r),r=[])}for(let c=1;c<7-u;c++){const d=new Date(a);d.setDate(d.getDate()+c),r.push(d)}return r.length>0&&i.push(r),i}function Rre(t,e,n){const i=n??jS[e.slice(-2).toUpperCase()]??0,r=new Date(t);for(;r.getDay()!==i;)r.setDate(r.getDate()-1);return r}function Are(t,e){const n=new Date(t),i=((jS[e.slice(-2).toUpperCase()]??0)+6)%7;for(;n.getDay()!==i;)n.setDate(n.getDate()+1);return n}function Dz(t){return new Date(t.getFullYear(),t.getMonth(),1)}function kz(t){return new Date(t.getFullYear(),t.getMonth()+1,0)}function Ore(t){const e=t.split("-").map(Number);return new Date(e[0],e[1]-1,e[2])}const Ire=/^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;function Mz(t){if(t==null)return new Date;if(t instanceof Date)return t;if(typeof t=="string"){let e;if(Ire.test(t))return Ore(t);if(e=Date.parse(t),!isNaN(e))return new Date(e)}return null}const hk=new Date(2e3,0,2);function Nre(t,e){const n=e??jS[t.slice(-2).toUpperCase()]??0;return Y3(7).map(i=>{const r=new Date(hk);return r.setDate(hk.getDate()+n+i),new Intl.DateTimeFormat(t,{weekday:"narrow"}).format(r)})}function xre(t,e,n,i){const r=Mz(t)??new Date,s=i==null?void 0:i[e];if(typeof s=="function")return s(r,e,n);let a={};switch(e){case"fullDate":a={year:"numeric",month:"long",day:"numeric"};break;case"fullDateWithWeekday":a={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case"normalDate":const o=r.getDate(),l=new Intl.DateTimeFormat(n,{month:"long"}).format(r);return`${o} ${l}`;case"normalDateWithWeekday":a={weekday:"short",day:"numeric",month:"short"};break;case"shortDate":a={month:"short",day:"numeric"};break;case"year":a={year:"numeric"};break;case"month":a={month:"long"};break;case"monthShort":a={month:"short"};break;case"monthAndYear":a={month:"long",year:"numeric"};break;case"monthAndDate":a={month:"long",day:"numeric"};break;case"weekday":a={weekday:"long"};break;case"weekdayShort":a={weekday:"short"};break;case"dayOfMonth":return new Intl.NumberFormat(n).format(r.getDate());case"hours12h":a={hour:"numeric",hour12:!0};break;case"hours24h":a={hour:"numeric",hour12:!1};break;case"minutes":a={minute:"numeric"};break;case"seconds":a={second:"numeric"};break;case"fullTime":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime12h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime24h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"fullDateTime":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime12h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime24h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDate":a={year:"numeric",month:"2-digit",day:"2-digit"};break;case"keyboardDateTime":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDateTime12h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"keyboardDateTime24h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;default:a=s??{timeZone:"UTC",timeZoneName:"short"}}return new Intl.DateTimeFormat(n,a).format(r)}function Dre(t,e){const n=t.toJsDate(e),i=n.getFullYear(),r=k1(String(n.getMonth()+1),2,"0"),s=k1(String(n.getDate()),2,"0");return`${i}-${r}-${s}`}function kre(t){const[e,n,i]=t.split("-").map(Number);return new Date(e,n-1,i)}function Mre(t,e){const n=new Date(t);return n.setMinutes(n.getMinutes()+e),n}function Lre(t,e){const n=new Date(t);return n.setHours(n.getHours()+e),n}function Pre(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Bre(t,e){const n=new Date(t);return n.setDate(n.getDate()+e*7),n}function Fre(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function Ure(t){return t.getFullYear()}function $re(t){return t.getMonth()}function Gre(t){return t.getDate()}function Hre(t){return new Date(t.getFullYear(),t.getMonth()+1,1)}function Vre(t){return new Date(t.getFullYear(),t.getMonth()-1,1)}function zre(t){return t.getHours()}function qre(t){return t.getMinutes()}function Yre(t){return new Date(t.getFullYear(),0,1)}function Wre(t){return new Date(t.getFullYear(),11,31)}function Kre(t,e){return uv(t,e[0])&&Xre(t,e[1])}function jre(t){const e=new Date(t);return e instanceof Date&&!isNaN(e.getTime())}function uv(t,e){return t.getTime()>e.getTime()}function Qre(t,e){return uv(NA(t),NA(e))}function Xre(t,e){return t.getTime()<e.getTime()}function fk(t,e){return t.getTime()===e.getTime()}function Zre(t,e){return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function Jre(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function ese(t,e){return t.getFullYear()===e.getFullYear()}function tse(t,e,n){const i=new Date(t),r=new Date(e);switch(n){case"years":return i.getFullYear()-r.getFullYear();case"quarters":return Math.floor((i.getMonth()-r.getMonth()+(i.getFullYear()-r.getFullYear())*12)/4);case"months":return i.getMonth()-r.getMonth()+(i.getFullYear()-r.getFullYear())*12;case"weeks":return Math.floor((i.getTime()-r.getTime())/(1e3*60*60*24*7));case"days":return Math.floor((i.getTime()-r.getTime())/(1e3*60*60*24));case"hours":return Math.floor((i.getTime()-r.getTime())/(1e3*60*60));case"minutes":return Math.floor((i.getTime()-r.getTime())/(1e3*60));case"seconds":return Math.floor((i.getTime()-r.getTime())/1e3);default:return i.getTime()-r.getTime()}}function nse(t,e){const n=new Date(t);return n.setHours(e),n}function ise(t,e){const n=new Date(t);return n.setMinutes(e),n}function rse(t,e){const n=new Date(t);return n.setMonth(e),n}function sse(t,e){const n=new Date(t);return n.setDate(e),n}function ose(t,e){const n=new Date(t);return n.setFullYear(e),n}function NA(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}function ase(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59,999)}class lse{constructor(e){this.locale=e.locale,this.formats=e.formats}date(e){return Mz(e)}toJsDate(e){return e}toISO(e){return Dre(this,e)}parseISO(e){return kre(e)}addMinutes(e,n){return Mre(e,n)}addHours(e,n){return Lre(e,n)}addDays(e,n){return Pre(e,n)}addWeeks(e,n){return Bre(e,n)}addMonths(e,n){return Fre(e,n)}getWeekArray(e,n){return wre(e,this.locale,n?Number(n):void 0)}startOfWeek(e,n){return Rre(e,this.locale,n?Number(n):void 0)}endOfWeek(e){return Are(e,this.locale)}startOfMonth(e){return Dz(e)}endOfMonth(e){return kz(e)}format(e,n){return xre(e,n,this.locale,this.formats)}isEqual(e,n){return fk(e,n)}isValid(e){return jre(e)}isWithinRange(e,n){return Kre(e,n)}isAfter(e,n){return uv(e,n)}isAfterDay(e,n){return Qre(e,n)}isBefore(e,n){return!uv(e,n)&&!fk(e,n)}isSameDay(e,n){return Zre(e,n)}isSameMonth(e,n){return Jre(e,n)}isSameYear(e,n){return ese(e,n)}setMinutes(e,n){return ise(e,n)}setHours(e,n){return nse(e,n)}setMonth(e,n){return rse(e,n)}setDate(e,n){return sse(e,n)}setYear(e,n){return ose(e,n)}getDiff(e,n,i){return tse(e,n,i)}getWeekdays(e){return Nre(this.locale,e?Number(e):void 0)}getYear(e){return Ure(e)}getMonth(e){return $re(e)}getDate(e){return Gre(e)}getNextMonth(e){return Hre(e)}getPreviousMonth(e){return Vre(e)}getHours(e){return zre(e)}getMinutes(e){return qre(e)}startOfDay(e){return NA(e)}endOfDay(e){return ase(e)}startOfYear(e){return Yre(e)}endOfYear(e){return Wre(e)}}const cse=Symbol.for("vuetify:date-options"),pk=Symbol.for("vuetify:date-adapter");function use(t,e){const n=rr({adapter:lse,locale:{af:"af-ZA",bg:"bg-BG",ca:"ca-ES",ckb:"",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",et:"et-EE",fa:"fa-IR",fi:"fi-FI",hr:"hr-HR",hu:"hu-HU",he:"he-IL",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",nl:"nl-NL",no:"no-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU",sk:"sk-SK",sl:"sl-SI",srCyrl:"sr-SP",srLatn:"sr-SP",sv:"sv-SE",th:"th-TH",tr:"tr-TR",az:"az-AZ",uk:"uk-UA",vi:"vi-VN",zhHans:"zh-CN",zhHant:"zh-TW"}},t);return{options:n,instance:dse(n,e)}}function dse(t,e){const n=$n(typeof t.adapter=="function"?new t.adapter({locale:t.locale[e.current.value]??e.current.value,formats:t.formats}):t.adapter);return Ie(e.current,i=>{n.locale=t.locale[i]??i??n.locale}),n}const QS=["sm","md","lg","xl","xxl"],xA=Symbol.for("vuetify:display"),_k={mobileBreakpoint:"lg",thresholds:{xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560}},hse=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_k;return rr(_k,t)};function mk(t){return dn&&!t?window.innerWidth:typeof t=="object"&&t.clientWidth||0}function gk(t){return dn&&!t?window.innerHeight:typeof t=="object"&&t.clientHeight||0}function vk(t){const e=dn&&!t?window.navigator.userAgent:"ssr";function n(S){return!!e.match(S)}const i=n(/android/i),r=n(/iphone|ipad|ipod/i),s=n(/cordova/i),a=n(/electron/i),o=n(/chrome/i),l=n(/edge/i),u=n(/firefox/i),c=n(/opera/i),d=n(/win/i),h=n(/mac/i),f=n(/linux/i);return{android:i,ios:r,cordova:s,electron:a,chrome:o,edge:l,firefox:u,opera:c,win:d,mac:h,linux:f,touch:Nte,ssr:e==="ssr"}}function fse(t,e){const{thresholds:n,mobileBreakpoint:i}=hse(t),r=ut(gk(e)),s=ut(vk(e)),a=$n({}),o=ut(mk(e));function l(){r.value=gk(),o.value=mk()}function u(){l(),s.value=vk()}return Wr(()=>{const c=o.value<n.sm,d=o.value<n.md&&!c,h=o.value<n.lg&&!(d||c),f=o.value<n.xl&&!(h||d||c),S=o.value<n.xxl&&!(f||h||d||c),_=o.value>=n.xxl,p=c?"xs":d?"sm":h?"md":f?"lg":S?"xl":"xxl",v=typeof i=="number"?i:n[i],m=o.value<v;a.xs=c,a.sm=d,a.md=h,a.lg=f,a.xl=S,a.xxl=_,a.smAndUp=!c,a.mdAndUp=!(c||d),a.lgAndUp=!(c||d||h),a.xlAndUp=!(c||d||h||f),a.smAndDown=!(h||f||S||_),a.mdAndDown=!(f||S||_),a.lgAndDown=!(S||_),a.xlAndDown=!_,a.name=p,a.height=r.value,a.width=o.value,a.mobile=m,a.mobileBreakpoint=i,a.platform=s.value,a.thresholds=n}),dn&&window.addEventListener("resize",l,{passive:!0}),{...Cp(a),update:u,ssr:!!e}}const pse=Ue({mobile:{type:Boolean,default:!1},mobileBreakpoint:[Number,String]},"display");function mN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{mobile:null},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();const n=an(xA);if(!n)throw new Error("Could not find Vuetify display injection");const i=te(()=>t.mobile?!0:typeof t.mobileBreakpoint=="number"?n.width.value<t.mobileBreakpoint:t.mobileBreakpoint?n.width.value<n.thresholds.value[t.mobileBreakpoint]:t.mobile===null?n.mobile.value:!1),r=te(()=>e?{[`${e}--mobile`]:i.value}:{});return{...n,displayClasses:r,mobile:i}}const Lz=Symbol.for("vuetify:goto");function Pz(){return{container:void 0,duration:300,layout:!1,offset:0,easing:"easeInOutCubic",patterns:{linear:t=>t,easeInQuad:t=>t**2,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t**2:-1+(4-2*t)*t,easeInCubic:t=>t**3,easeOutCubic:t=>--t**3+1,easeInOutCubic:t=>t<.5?4*t**3:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t**4,easeOutQuart:t=>1- --t**4,easeInOutQuart:t=>t<.5?8*t**4:1-8*--t**4,easeInQuint:t=>t**5,easeOutQuint:t=>1+--t**5,easeInOutQuint:t=>t<.5?16*t**5:1+16*--t**5}}}function _se(t){return gN(t)??(document.scrollingElement||document.body)}function gN(t){return typeof t=="string"?document.querySelector(t):K3(t)}function wE(t,e,n){if(typeof t=="number")return e&&n?-t:t;let i=gN(t),r=0;for(;i;)r+=e?i.offsetLeft:i.offsetTop,i=i.offsetParent;return r}function mse(t,e){return{rtl:e.isRtl,options:rr(Pz(),t)}}async function Sk(t,e,n,i){const r=n?"scrollLeft":"scrollTop",s=rr((i==null?void 0:i.options)??Pz(),e),a=i==null?void 0:i.rtl.value,o=(typeof t=="number"?t:gN(t))??0,l=s.container==="parent"&&o instanceof HTMLElement?o.parentElement:_se(s.container),u=typeof s.easing=="function"?s.easing:s.patterns[s.easing];if(!u)throw new TypeError(`Easing function "${s.easing}" not found.`);let c;if(typeof o=="number")c=wE(o,n,a);else if(c=wE(o,n,a)-wE(l,n,a),s.layout){const S=window.getComputedStyle(o).getPropertyValue("--v-layout-top");S&&(c-=parseInt(S,10))}c+=s.offset,c=vse(l,c,!!a,!!n);const d=l[r]??0;if(c===d)return Promise.resolve(c);const h=performance.now();return new Promise(f=>requestAnimationFrame(function S(_){const v=(_-h)/s.duration,m=Math.floor(d+(c-d)*u(Lo(v,0,1)));if(l[r]=m,v>=1&&Math.abs(m-l[r])<10)return f(c);if(v>2)return f(l[r]);requestAnimationFrame(S)}))}function gse(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=an(Lz),{isRtl:n}=ec();if(!e)throw new Error("[Vuetify] Could not find injected goto instance");const i={...e,rtl:te(()=>e.rtl.value||n.value)};async function r(s,a){return Sk(s,rr(t,a),!1,i)}return r.horizontal=async(s,a)=>Sk(s,rr(t,a),!0,i),r}function vse(t,e,n,i){const{scrollWidth:r,scrollHeight:s}=t,[a,o]=t===document.scrollingElement?[window.innerWidth,window.innerHeight]:[t.offsetWidth,t.offsetHeight];let l,u;return i?n?(l=-(r-a),u=0):(l=0,u=r-a):(l=0,u=s+-o),Math.max(Math.min(e,u),l)}const dv=Symbol.for("vuetify:theme"),$i=Ue({theme:String},"theme");function bk(){return{defaultTheme:"light",variations:{colors:[],lighten:0,darken:0},themes:{light:{dark:!1,colors:{background:"#FFFFFF",surface:"#FFFFFF","surface-bright":"#FFFFFF","surface-light":"#EEEEEE","surface-variant":"#424242","on-surface-variant":"#EEEEEE",primary:"#1867C0","primary-darken-1":"#1F5592",secondary:"#48A9A6","secondary-darken-1":"#018786",error:"#B00020",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#000000","border-opacity":.12,"high-emphasis-opacity":.87,"medium-emphasis-opacity":.6,"disabled-opacity":.38,"idle-opacity":.04,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.12,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#F5F5F5","theme-on-code":"#000000"}},dark:{dark:!0,colors:{background:"#121212",surface:"#212121","surface-bright":"#ccbfd6","surface-light":"#424242","surface-variant":"#a3a3a3","on-surface-variant":"#424242",primary:"#2196F3","primary-darken-1":"#277CC1",secondary:"#54B6B2","secondary-darken-1":"#48A9A6",error:"#CF6679",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#FFFFFF","border-opacity":.12,"high-emphasis-opacity":1,"medium-emphasis-opacity":.7,"disabled-opacity":.5,"idle-opacity":.1,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.16,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#343434","theme-on-code":"#CCCCCC"}}}}}function Sse(){var i,r;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bk();const e=bk();if(!t)return{...e,isDisabled:!0};const n={};for(const[s,a]of Object.entries(t.themes??{})){const o=a.dark||s==="dark"?(i=e.themes)==null?void 0:i.dark:(r=e.themes)==null?void 0:r.light;n[s]=rr(o,a)}return rr(e,{...t,themes:n})}function bse(t){const e=Sse(t),n=ve(e.defaultTheme),i=ve(e.themes),r=te(()=>{const c={};for(const[d,h]of Object.entries(i.value)){const f=c[d]={...h,colors:{...h.colors}};if(e.variations)for(const S of e.variations.colors){const _=f.colors[S];if(_)for(const p of["lighten","darken"]){const v=p==="lighten"?cne:une;for(const m of Y3(e.variations[p],1))f.colors[`${S}-${p}-${m}`]=one(v(xo(_),m))}}for(const S of Object.keys(f.colors)){if(/^on-[a-z]/.test(S)||f.colors[`on-${S}`])continue;const _=`on-${S}`,p=xo(f.colors[S]);f.colors[_]=oz(p)}}return c}),s=te(()=>r.value[n.value]),a=te(()=>{var S;const c=[];(S=s.value)!=null&&S.dark&&Sc(c,":root",["color-scheme: dark"]),Sc(c,":root",Ek(s.value));for(const[_,p]of Object.entries(r.value))Sc(c,`.v-theme--${_}`,[`color-scheme: ${p.dark?"dark":"normal"}`,...Ek(p)]);const d=[],h=[],f=new Set(Object.values(r.value).flatMap(_=>Object.keys(_.colors)));for(const _ of f)/^on-[a-z]/.test(_)?Sc(h,`.${_}`,[`color: rgb(var(--v-theme-${_})) !important`]):(Sc(d,`.bg-${_}`,[`--v-theme-overlay-multiplier: var(--v-theme-${_}-overlay-multiplier)`,`background-color: rgb(var(--v-theme-${_})) !important`,`color: rgb(var(--v-theme-on-${_})) !important`]),Sc(h,`.text-${_}`,[`color: rgb(var(--v-theme-${_})) !important`]),Sc(h,`.border-${_}`,[`--v-border-color: var(--v-theme-${_})`]));return c.push(...d,...h),c.map((_,p)=>p===0?_:` ${_}`).join("")});function o(){return{style:[{children:a.value,id:"vuetify-theme-stylesheet",nonce:e.cspNonce||!1}]}}function l(c){if(e.isDisabled)return;const d=c._context.provides.usehead;if(d)if(d.push){const h=d.push(o);dn&&Ie(a,()=>{h.patch(o)})}else dn?(d.addHeadObjs(te(o)),Wr(()=>d.updateDOM())):d.addHeadObjs(o());else{let f=function(){if(typeof document<"u"&&!h){const S=document.createElement("style");S.type="text/css",S.id="vuetify-theme-stylesheet",e.cspNonce&&S.setAttribute("nonce",e.cspNonce),h=S,document.head.appendChild(h)}h&&(h.innerHTML=a.value)},h=dn?document.getElementById("vuetify-theme-stylesheet"):null;dn?Ie(a,f,{immediate:!0}):f()}}const u=te(()=>e.isDisabled?void 0:`v-theme--${n.value}`);return{install:l,isDisabled:e.isDisabled,name:n,themes:i,current:s,computedThemes:r,themeClasses:u,styles:a,global:{name:n,current:s}}}function cr(t){Li("provideTheme");const e=an(dv,null);if(!e)throw new Error("Could not find Vuetify theme injection");const n=te(()=>t.theme??e.name.value),i=te(()=>e.themes.value[n.value]),r=te(()=>e.isDisabled?void 0:`v-theme--${n.value}`),s={...e,name:n,current:i,themeClasses:r};return Kn(dv,s),s}function Sc(t,e,n){t.push(`${e} {
28
28
  `,...n.map(i=>` ${i};
29
29
  `),`}
30
- `)}function Ek(t){const e=t.dark?2:1,n=t.dark?1:2,i=[];for(const[r,s]of Object.entries(t.colors)){const a=xo(s);i.push(`--v-theme-${r}: ${a.r},${a.g},${a.b}`),r.startsWith("on-")||i.push(`--v-theme-${r}-overlay-multiplier: ${dne(s)>.18?e:n}`)}for(const[r,s]of Object.entries(t.variables)){const a=typeof s=="string"&&s.startsWith("#")?xo(s):void 0,o=a?`${a.r}, ${a.g}, ${a.b}`:void 0;i.push(`--v-${r}: ${o??s}`)}return i}function xf(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=CA(),i=ve();if(dn){const r=new ResizeObserver(s=>{s.length&&(e==="content"?i.value=s[0].contentRect:i.value=s[0].target.getBoundingClientRect())});Yi(()=>{r.disconnect()}),Ie(()=>n.el,(s,a)=>{a&&(r.unobserve(a),i.value=void 0),s&&r.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:qd(i)}}function Bz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:e,...n}=t,i=rr(e,n),{aliases:r={},components:s={},directives:a={}}=i,o=fne(i.defaults),l=fse(i.display,i.ssr),u=bse(i.theme),c=Ene(i.icons),d=yre(i.locale),h=use(i.date,d),f=mse(i.goTo,d);return{install:_=>{for(const p in a)_.directive(p,a[p]);for(const p in s)_.component(p,s[p]);for(const p in r)_.component(p,Qd({...r[p],name:p,aliasName:r[p].name}));if(u.install(_),_.provide(Cd,o),_.provide(xA,l),_.provide(dv,u),_.provide(RA,c),_.provide(cv,d),_.provide(cse,h.options),_.provide(pk,h.instance),_.provide(Lz,f),dn&&i.ssr)if(_.$nuxt)_.$nuxt.hook("app:suspense:resolve",()=>{l.update()});else{const{mount:p}=_;_.mount=function(){const v=p(...arguments);return $t(()=>l.update()),_.mount=p,v}}Os.reset(),_.mixin({computed:{$vuetify(){return $n({defaults:Lu.call(this,Cd),display:Lu.call(this,xA),theme:Lu.call(this,dv),icons:Lu.call(this,RA),locale:Lu.call(this,cv),date:Lu.call(this,pk)})}}})},defaults:o,display:l,theme:u,icons:c,locale:d,date:h,goTo:f}}const Ese="3.7.13";Bz.version=Ese;function Lu(t){var i,r;const e=this.$,n=((i=e.parent)==null?void 0:i.provides)??((r=e.vnode.appContext)==null?void 0:r.provides);if(n&&t in n)return n[t]}const yse=jr({name:"vuetify:nuxt:client:plugin",order:25,dependsOn:["vuetify:icons:plugin"],parallel:!0,async setup(t){let e,n;const i=vre();[e,n]=uf(()=>t.hooks.callHook("vuetify:configuration",{isDev:ck,vuetifyOptions:i})),await e,n(),[e,n]=uf(()=>t.hooks.callHook("vuetify:before-create",{isDev:ck,vuetifyOptions:i})),await e,n();const r=Bz(i);t.vueApp.use(r),t.provide("vuetify",r),[e,n]=uf(()=>t.hooks.callHook("vuetify:ready",r)),await e,n()}}),Cse=[Ate,Ite,wne,Ane,Nne,xne,Dne,kne,Lne,iie,rie,sie,gre,yse];class Tse{}class Ol extends Tse{constructor(e,n,i){super(),this.viewId=e,this.groupId=n,this.panelId=i}}class iu{constructor(){}static getInstance(){return iu.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,n){n&&(this.data=e,this.proto=n)}}iu.INSTANCE=new iu;function tr(){const t=iu.getInstance();if(t.hasData(Ol.prototype))return t.getData(Ol.prototype)[0]}var Vc;(function(t){t.any=(...e)=>n=>{const i=e.map(r=>r(n));return{dispose:()=>{i.forEach(r=>{r.dispose()})}}}})(Vc||(Vc={}));class vN{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class wse{constructor(){this.events=new Map}get size(){return this.events.size}add(e,n){this.events.set(e,n)}delete(e){this.events.delete(e)}clear(){this.events.clear()}}class hv{static create(){var e;return new hv((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class Rse{constructor(e,n){this.callback=e,this.stacktrace=n}}class Pe{static setLeakageMonitorEnabled(e){e!==Pe.ENABLE_TRACKING&&Pe.MEMORY_LEAK_WATCHER.clear(),Pe.ENABLE_TRACKING=e}get value(){return this._last}constructor(e){this.options=e,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>{var n;!((n=this.options)===null||n===void 0)&&n.replay&&this._last!==void 0&&e(this._last);const i=new Rse(e,Pe.ENABLE_TRACKING?hv.create():void 0);return this._listeners.push(i),{dispose:()=>{const r=this._listeners.indexOf(i);r>-1&&this._listeners.splice(r,1)}}},Pe.ENABLE_TRACKING&&Pe.MEMORY_LEAK_WATCHER.add(this._event,hv.create())),this._event}fire(e){this._last=e;for(const n of this._listeners)n.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(Pe.ENABLE_TRACKING&&queueMicrotask(()=>{var e;for(const n of this._listeners)console.warn("dockview: stacktrace",(e=n.stacktrace)===null||e===void 0?void 0:e.print())}),this._listeners=[]),Pe.ENABLE_TRACKING&&this._event&&Pe.MEMORY_LEAK_WATCHER.delete(this._event))}}Pe.ENABLE_TRACKING=!1;Pe.MEMORY_LEAK_WATCHER=new wse;function Ca(t,e,n,i){return t.addEventListener(e,n,i),{dispose:()=>{t.removeEventListener(e,n,i)}}}function si(t,e,n,i){return t.addEventListener(e,n,i),{dispose:()=>{t.removeEventListener(e,n,i)}}}class yk{constructor(){this._onFired=new Pe,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const n=this._currentFireCount;return this._onFired.event(()=>{this._currentFireCount>n&&e()})}}fire(){this._currentFireCount++,!this._queued&&(this._queued=!0,queueMicrotask(()=>{this._queued=!1,this._onFired.fire()}))}dispose(){this._onFired.dispose()}}var br;(function(t){t.NONE={dispose:()=>{}};function e(n){return{dispose:()=>{n()}}}t.from=e})(br||(br={}));class ln{get isDisposed(){return this._isDisposed}constructor(...e){this._isDisposed=!1,this._disposables=e}addDisposables(...e){e.forEach(n=>this._disposables.push(n))}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach(e=>e.dispose()),this._disposables=[])}}class Ho{constructor(){this._disposable=br.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=br.NONE)}}function Fz(t,e){const n=new ResizeObserver(i=>{requestAnimationFrame(()=>{const r=i[0];e(r)})});return n.observe(t),{dispose:()=>{n.unobserve(t),n.disconnect()}}}const DA=(t,...e)=>{for(const n of e)t.classList.contains(n)&&t.classList.remove(n)},Uz=(t,...e)=>{for(const n of e)t.classList.contains(n)||t.classList.add(n)},rn=(t,e,n)=>{const i=t.classList.contains(e);n&&!i&&t.classList.add(e),!n&&i&&t.classList.remove(e)};function kA(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ck(t){return Array.prototype.slice.call(document.getElementsByTagName(t),0)}function $z(t){return new Ase(t)}class Ase extends ln{constructor(e){super(),this._onDidFocus=new Pe,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new Pe,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let n=kA(document.activeElement,e),i=!1;const r=()=>{i=!1,n||(n=!0,this._onDidFocus.fire())},s=()=>{n&&(i=!0,window.setTimeout(()=>{i&&(i=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{kA(document.activeElement,e)!==n&&(n?s():r())},e instanceof HTMLElement?(this.addDisposables(si(e,"focus",r,!0)),this.addDisposables(si(e,"blur",s,!0))):(this.addDisposables(Ca(e,"focus",r,!0)),this.addDisposables(Ca(e,"blur",s,!0)))}refreshState(){this._refreshStateHandler()}}const Gz="dv-quasiPreventDefault";function Ose(t){t[Gz]=!0}function Tk(t){return t[Gz]}function Ise(t,e){const n=Array.from(e);for(const i of n){if(i.href){const s=t.createElement("link");s.href=i.href,s.type=i.type,s.rel="stylesheet",t.head.appendChild(s)}let r=[];try{i.cssRules&&(r=Array.from(i.cssRules).map(s=>s.cssText))}catch{}for(const s of r){const a=t.createElement("style");a.appendChild(t.createTextNode(s)),t.head.appendChild(a)}}}function wk(t){const{left:e,top:n,width:i,height:r}=t.getBoundingClientRect();return{left:e+window.scrollX,top:n+window.scrollY,width:i,height:r}}function Nse(t){let e=t;for(;e!=null&&e.parentNode;){if(e.parentNode===document)return!0;e.parentNode instanceof DocumentFragment?e=e.parentNode.host:e=e.parentNode}return!1}function xse(t,e){t.setAttribute("data-testid",e)}function fv(){const t=[...Ck("iframe"),...Ck("webview")],e=new WeakMap;for(const n of t)e.set(n,n.style.pointerEvents),n.style.pointerEvents="none";return{release:()=>{var n;for(const i of t)i.style.pointerEvents=(n=e.get(i))!==null&&n!==void 0?n:"auto";t.splice(0,t.length)}}}function Dse(t){function e(r){const s=[];for(let a=0;a<r.classList.length;a++)s.push(r.classList.item(a));return s}let n,i=t;for(;i!==null&&(n=e(i).find(r=>r.startsWith("dockview-theme-")),typeof n!="string");)i=i.parentElement;return n}class kse{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const n of this._classNames)rn(this.element,n,!1);this._classNames=e.split(" ").filter(n=>n.trim().length>0);for(const n of this._classNames)rn(this.element,n,!0)}}function kc(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}function Mse(t){return t.length>0?t[t.length-1]:void 0}function Lse(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function RE(t,e){const n=t.indexOf(e);n>-1&&(t.splice(n,1),t.unshift(e))}function b_(t,e){const n=t.indexOf(e);n>-1&&(t.splice(n,1),t.push(e))}function Pse(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(e(i))return n}return-1}function AE(t,e){const n=t.findIndex(i=>i===e);return n>-1?(t.splice(n,1),!0):!1}const zn=(t,e,n)=>e>n?e:Math.min(n,Math.max(t,e)),Hz=()=>{let t=1;return{next:()=>(t++).toString()}},Ps=(t,e)=>{const n=[];if(typeof e!="number"&&(e=t,t=0),t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n};class Bse{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,n,i,r){this.container=e,this.view=n,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(e,n){var i;e!==this.visible&&(e?(this.size=zn((i=this._cachedVisibleSize)!==null&&i!==void 0?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}dispose(){return this.disposable.dispose(),this.view}}var Pt;(function(t){t.HORIZONTAL="HORIZONTAL",t.VERTICAL="VERTICAL"})(Pt||(Pt={}));var _s;(function(t){t[t.MAXIMUM=0]="MAXIMUM",t[t.MINIMUM=1]="MINIMUM",t[t.DISABLED=2]="DISABLED",t[t.ENABLED=3]="ENABLED"})(_s||(_s={}));var Oi;(function(t){t.Low="low",t.High="high",t.Normal="normal"})(Oi||(Oi={}));var Ta;(function(t){t.Distribute={type:"distribute"};function e(i){return{type:"split",index:i}}t.Split=e;function n(i){return{type:"invisible",cachedVisibleSize:i}}t.Invisible=n})(Ta||(Ta={}));class Rk{get contentSize(){return this._contentSize}get size(){return this._size}set size(e){this._size=e}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(e){this._orientation=e;const n=this.size;this.size=this.orthogonalSize,this.orthogonalSize=n,DA(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==Pt.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce((e,n)=>e+n.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,n)=>e+n.maximumSize,0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(e){this._disabled=e,rn(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e}constructor(e,n){var i;this.container=e,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new Pe,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new Pe,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new Pe,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(r,s,a=this.viewItems.map(f=>f.size),o,l,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d,h)=>{if(r<0||r>this.viewItems.length)return 0;const f=Ps(r,-1),S=Ps(r+1,this.viewItems.length);if(l)for(const O of l)RE(f,O),RE(S,O);if(o)for(const O of o)b_(f,O),b_(S,O);const _=f.map(O=>this.viewItems[O]),p=f.map(O=>a[O]),v=S.map(O=>this.viewItems[O]),m=S.map(O=>a[O]),g=f.reduce((O,D)=>O+this.viewItems[D].minimumSize-a[D],0),b=f.reduce((O,D)=>O+this.viewItems[D].maximumSize-a[D],0),y=S.length===0?Number.POSITIVE_INFINITY:S.reduce((O,D)=>O+a[D]-this.viewItems[D].minimumSize,0),E=S.length===0?Number.NEGATIVE_INFINITY:S.reduce((O,D)=>O+a[D]-this.viewItems[D].maximumSize,0),T=Math.max(g,E),C=Math.min(y,b);let w=!1;if(d){const O=this.viewItems[d.index],D=s>=d.limitDelta;w=D!==O.visible,O.setVisible(D,d.size)}if(!w&&h){const O=this.viewItems[h.index],D=s<h.limitDelta;w=D!==O.visible,O.setVisible(D,h.size)}if(w)return this.resize(r,s,a,o,l,u,c);const R=zn(s,T,C);let I=0,A=R;for(let O=0;O<_.length;O++){const D=_[O],L=zn(p[O]+A,D.minimumSize,D.maximumSize),q=L-p[O];I+=q,A-=q,D.size=L}let x=I;for(let O=0;O<v.length;O++){const D=v[O],L=zn(m[O]-x,D.minimumSize,D.maximumSize),q=L-m[O];x+=q,D.size=L}return s},this._orientation=n.orientation,this.element=this.createContainer(),this.margin=(i=n.margin)!==null&&i!==void 0?i:0,this.proportionalLayout=n.proportionalLayout===void 0?!0:!!n.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(n.styles),n.descriptor&&(this._size=n.descriptor.size,n.descriptor.views.forEach((r,s)=>{const a=r.visible===void 0||r.visible?r.size:{type:"invisible",cachedVisibleSize:r.size},o=r.view;this.addView(o,a,s,!0)}),this._contentSize=this.viewItems.reduce((r,s)=>r+s.size,0),this.saveProportions())}style(e){(e==null?void 0:e.separatorBorder)==="transparent"?(DA(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(Uz(this.element,"dv-separator-border"),e!=null&&e.separatorBorder&&this.element.style.setProperty("--dv-separator-border",e.separatorBorder))}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,n){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[e];i.setVisible(n,i.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(e,n){if(e<0||e>=this.viewItems.length)return;const i=Ps(this.viewItems.length).filter(o=>o!==e),r=[...i.filter(o=>this.viewItems[o].priority===Oi.Low),e],s=i.filter(o=>this.viewItems[o].priority===Oi.High),a=this.viewItems[e];n=Math.round(n),n=zn(n,a.minimumSize,Math.min(a.maximumSize,this._size)),a.size=n,this.relayout(r,s)}getViews(){return this.viewItems.map(e=>e.view)}onDidChange(e,n){const i=this.viewItems.indexOf(e);if(i<0||i>=this.viewItems.length)return;n=typeof n=="number"?n:e.size,n=zn(n,e.minimumSize,e.maximumSize),e.size=n;const r=Ps(this.viewItems.length).filter(o=>o!==i),s=[...r.filter(o=>this.viewItems[o].priority===Oi.Low),i],a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.relayout([...s,i],a)}addView(e,n={type:"distribute"},i=this.viewItems.length,r){const s=document.createElement("div");s.className="dv-view",s.appendChild(e.element);let a;typeof n=="number"?a=n:n.type==="split"?a=this.getViewSize(n.index)/2:n.type==="invisible"?a={cachedVisibleSize:n.cachedVisibleSize}:a=e.minimumSize;const o=e.onDidChange(u=>this.onDidChange(l,u.size)),l=new Bse(s,e,a,{dispose:()=>{o.dispose(),this.viewContainer.removeChild(s)}});if(i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,l),this.viewItems.length>1){const u=document.createElement("div");u.className="dv-sash";const c=h=>{for(const D of this.viewItems)D.enabled=!1;const f=fv(),S=this._orientation===Pt.HORIZONTAL?h.clientX:h.clientY,_=Pse(this.sashes,D=>D.container===u),p=this.viewItems.map(D=>D.size);let v,m;const g=Ps(_,-1),b=Ps(_+1,this.viewItems.length),y=g.reduce((D,L)=>D+(this.viewItems[L].minimumSize-p[L]),0),E=g.reduce((D,L)=>D+(this.viewItems[L].viewMaximumSize-p[L]),0),T=b.length===0?Number.POSITIVE_INFINITY:b.reduce((D,L)=>D+(p[L]-this.viewItems[L].minimumSize),0),C=b.length===0?Number.NEGATIVE_INFINITY:b.reduce((D,L)=>D+(p[L]-this.viewItems[L].viewMaximumSize),0),w=Math.max(y,C),R=Math.min(T,E),I=this.findFirstSnapIndex(g),A=this.findFirstSnapIndex(b);if(typeof I=="number"){const D=this.viewItems[I],L=Math.floor(D.viewMinimumSize/2);v={index:I,limitDelta:D.visible?w-L:w+L,size:D.size}}if(typeof A=="number"){const D=this.viewItems[A],L=Math.floor(D.viewMinimumSize/2);m={index:A,limitDelta:D.visible?R+L:R-L,size:D.size}}const x=D=>{const q=(this._orientation===Pt.HORIZONTAL?D.clientX:D.clientY)-S;this.resize(_,q,p,void 0,void 0,w,R,v,m),this.distributeEmptySpace(),this.layoutViews()},O=()=>{for(const D of this.viewItems)D.enabled=!0;f.release(),this.saveProportions(),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",O),document.removeEventListener("pointercancel",O),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",x),document.addEventListener("pointerup",O),document.addEventListener("pointercancel",O)};u.addEventListener("pointerdown",c);const d={container:u,disposable:()=>{u.removeEventListener("pointerdown",c),this.sashContainer.removeChild(u)}};this.sashContainer.appendChild(u),this.sashes.push(d)}r||this.relayout([i]),!r&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidAddView.fire(e)}distributeViewSizes(){const e=[];let n=0;for(const o of this.viewItems)o.maximumSize-o.minimumSize>0&&(e.push(o),n+=o.size);const i=Math.floor(n/e.length);for(const o of e)o.size=zn(i,o.minimumSize,o.maximumSize);const r=Ps(this.viewItems.length),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.relayout(s,a)}removeView(e,n,i=!1){const r=this.viewItems.splice(e,1)[0];if(r.dispose(),this.viewItems.length>=1){const s=Math.max(e-1,0);this.sashes.splice(s,1)[0].disposable()}return i||this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidRemoveView.fire(r.view),r.view}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}moveView(e,n){const i=this.getViewCachedVisibleSize(e),r=typeof i>"u"?this.getViewSize(e):Ta.Invisible(i),s=this.removeView(e,void 0,!0);this.addView(s,r,n)}layout(e,n){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.orthogonalSize=n,this.proportions){let r=0;for(let s=0;s<this.viewItems.length;s++){const a=this.viewItems[s],o=this.proportions[s];typeof o=="number"?r+=o:e-=a.size}for(let s=0;s<this.viewItems.length;s++){const a=this.viewItems[s],o=this.proportions[s];typeof o=="number"&&r>0&&(a.size=zn(Math.round(o*e/r),a.minimumSize,a.maximumSize))}}else{const r=Ps(this.viewItems.length),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.resize(this.viewItems.length-1,e-i,void 0,s,a)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,n){const i=this.viewItems.reduce((r,s)=>r+s.size,0);this.resize(this.viewItems.length-1,this._size-i,void 0,e,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(e){const n=this.viewItems.reduce((o,l)=>o+l.size,0);let i=this.size-n;const r=Ps(this.viewItems.length-1,-1),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);for(const o of a)RE(r,o);for(const o of s)b_(r,o);typeof e=="number"&&b_(r,e);for(let o=0;i!==0&&o<r.length;o++){const l=this.viewItems[r[o]],u=zn(l.size+i,l.minimumSize,l.maximumSize),c=u-l.size;i-=c,l.size=u}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map(e=>e.visible?e.size/this._contentSize:void 0))}layoutViews(){if(this._contentSize=this.viewItems.reduce((l,u)=>l+u.size,0),this.updateSashEnablement(),this.viewItems.length===0)return;const e=this.viewItems.filter(l=>l.visible),n=Math.max(0,e.length-1),i=this.margin*n/Math.max(1,e.length);let r=0;const s=[],a=4,o=this.viewItems.reduce((l,u,c)=>{const d=u.visible?1:0;return c===0?l.push(d):l.push(l[c-1]+d),l},[]);this.viewItems.forEach((l,u)=>{r+=this.viewItems[u].size,s.push(r);const c=l.visible?l.size-i:0,d=Math.max(0,o[u]-1),h=u===0||d===0?0:s[u-1]+d/n*i;if(u<this.viewItems.length-1){const f=l.visible?h+c-a/2+this.margin/2:h;this._orientation===Pt.HORIZONTAL&&(this.sashes[u].container.style.left=`${f}px`,this.sashes[u].container.style.top="0px"),this._orientation===Pt.VERTICAL&&(this.sashes[u].container.style.left="0px",this.sashes[u].container.style.top=`${f}px`)}this._orientation===Pt.HORIZONTAL&&(l.container.style.width=`${c}px`,l.container.style.left=`${h}px`,l.container.style.top="",l.container.style.height=""),this._orientation===Pt.VERTICAL&&(l.container.style.height=`${c}px`,l.container.style.top=`${h}px`,l.container.style.width="",l.container.style.left=""),l.view.layout(l.size-i,this._orthogonalSize)})}findFirstSnapIndex(e){for(const n of e){const i=this.viewItems[n];if(i.visible&&i.snap)return n}for(const n of e){const i=this.viewItems[n];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return n}}updateSashEnablement(){let e=!1;const n=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const s=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const a=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let o=0;for(let l=0;l<this.sashes.length;l++){const u=this.sashes[l],c=this.viewItems[l];o+=c.size;const d=!(n[l]&&a[l+1]),h=!(i[l]&&s[l+1]);if(d&&h){const f=Ps(l,-1),S=Ps(l+1,this.viewItems.length),_=this.findFirstSnapIndex(f),p=this.findFirstSnapIndex(S),v=typeof _=="number"&&!this.viewItems[_].visible,m=typeof p=="number"&&!this.viewItems[p].visible;v&&s[l]&&(o>0||this.startSnappingEnabled)?this.updateSash(u,_s.MINIMUM):m&&n[l]&&(o<this._contentSize||this.endSnappingEnabled)?this.updateSash(u,_s.MAXIMUM):this.updateSash(u,_s.DISABLED)}else d&&!h?this.updateSash(u,_s.MINIMUM):!d&&h?this.updateSash(u,_s.MAXIMUM):this.updateSash(u,_s.ENABLED)}}updateSash(e,n){rn(e.container,"dv-disabled",n===_s.DISABLED),rn(e.container,"dv-enabled",n===_s.ENABLED),rn(e.container,"dv-maximum",n===_s.MAXIMUM),rn(e.container,"dv-minimum",n===_s.MINIMUM)}createViewContainer(){const e=document.createElement("div");return e.className="dv-view-container",e}createSashContainer(){const e=document.createElement("div");return e.className="dv-sash-container",e}createContainer(){const e=document.createElement("div"),n=this._orientation===Pt.HORIZONTAL?"dv-horizontal":"dv-vertical";return e.className=`dv-split-view-container ${n}`,e}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let e=0;e<this.element.children.length;e++)if(this.element.children.item(e)===this.element){this.element.removeChild(this.element);break}for(const e of this.viewItems)e.dispose();this.element.remove()}}class Xi{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===Pt.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===Pt.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===Pt.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===Pt.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===Pt.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===Pt.HORIZONTAL?this.size:this.orthogonalSize}constructor(e,n,i,r=0){this.view=e,this.orientation=n,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=r,this._disposable=this.view.onDidChange(s=>{s?this._onDidChange.fire({size:this.orientation===Pt.VERTICAL?s.width:s.height,orthogonalSize:this.orientation===Pt.VERTICAL?s.height:s.width}):this._onDidChange.fire({})})}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,n){this._size=e,this._orthogonalSize=n,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class vi extends ln{get width(){return this.orientation===Pt.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===Pt.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((e,n)=>this.splitview.isViewVisible(n)?e.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((e,n)=>this.splitview.isViewVisible(n)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===Pt.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===Pt.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===Pt.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===Pt.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(this.children.length===0)return Oi.Normal;const e=this.children.map(n=>typeof n.priority>"u"?Oi.Normal:n.priority);return e.some(n=>n===Oi.High)?Oi.High:e.some(n=>n===Oi.Low)?Oi.Low:Oi.Normal}get disabled(){return this.splitview.disabled}set disabled(e){this.splitview.disabled=e}get margin(){return this.splitview.margin}set margin(e){this.splitview.margin=e,this.children.forEach(n=>{n instanceof vi&&(n.margin=e)})}constructor(e,n,i,r,s,a,o,l){if(super(),this.orientation=e,this.proportionalLayout=n,this.styles=i,this._childrenDisposable=br.NONE,this.children=[],this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new Pe,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=s,this._size=r,this.element=document.createElement("div"),this.element.className="dv-branch-node",!l)this.splitview=new Rk(this.element,{orientation:this.orientation,proportionalLayout:n,styles:i,margin:o}),this.splitview.layout(this.size,this.orthogonalSize);else{const u={views:l.map(c=>({view:c.node,size:c.node.size,visible:c.node instanceof Xi&&c.visible!==void 0?c.visible:!0})),size:this.orthogonalSize};this.children=l.map(c=>c.node),this.splitview=new Rk(this.element,{orientation:this.orientation,descriptor:u,proportionalLayout:n,styles:i,margin:o})}this.disabled=a,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire({})})),this.setupChildrenEvents()}setVisible(e){}isChildVisible(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(e)}setChildVisible(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===n)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(e,n);const r=this.splitview.contentSize===0;(n&&i||!n&&r)&&this._onDidVisibilityChange.fire({visible:n})}moveChild(e,n){if(e===n)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<n&&n--,this.splitview.moveView(e,n);const i=this._removeChild(e);this._addChild(i,n)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,n)}layout(e,n){this._size=n,this._orthogonalSize=e,this.splitview.layout(n,e)}addChild(e,n,i,r){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,n,i,r),this._addChild(e,i)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,n),this._removeChild(e)}_addChild(e,n){this.children.splice(n,0,e),this.setupChildrenEvents()}_removeChild(e){const[n]=this.children.splice(e,1);return this.setupChildrenEvents(),n}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new ln(Vc.any(...this.children.map(e=>e.onDidChange))(e=>{this._onDidChange.fire({size:e.orthogonalSize})}),...this.children.map((e,n)=>e instanceof vi?e.onDidVisibilityChange(({visible:i})=>{this.setChildVisible(n,i)}):br.NONE))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach(e=>e.dispose()),super.dispose()}}function MA(t,e){if(t instanceof Xi)return t;if(t instanceof vi)return MA(t.children[e?t.children.length-1:0],e);throw new Error("invalid node")}function LA(t,e,n){if(t instanceof vi){const i=new vi(Ro(t.orientation),t.proportionalLayout,t.styles,e,n,t.disabled,t.margin);let r=0;for(let s=t.children.length-1;s>=0;s--){const a=t.children[s],o=a instanceof vi?a.orthogonalSize:a.size;let l=t.size===0?0:Math.round(e*o/t.size);r+=l,s===0&&(l+=e-r),i.addChild(LA(a,n,l),l,0,!0)}return i}else return new Xi(t.view,Ro(t.orientation),n)}function Fse(t){const e=t.parentElement;if(!e)throw new Error("Invalid grid element");let n=e.firstElementChild,i=0;for(;n!==t&&n!==e.lastElementChild&&n;)n=n.nextElementSibling,i++;return i}function Vi(t){const e=t.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(e.className))return[];const n=Fse(e),i=e.parentElement.parentElement.parentElement;return[...Vi(i),n]}function Pu(t,e,n){const i=$se(t,e),r=Use(n);if(i===r){const[s,a]=kc(e);let o=a;return(n==="right"||n==="bottom")&&(o+=1),[...s,o]}else{const s=n==="right"||n==="bottom"?1:0;return[...e,s]}}function Use(t){return t==="top"||t==="bottom"?Pt.VERTICAL:Pt.HORIZONTAL}function $se(t,e){return e.length%2===0?Ro(t):t}const Ro=t=>t===Pt.HORIZONTAL?Pt.VERTICAL:Pt.HORIZONTAL;function Gse(t){return!!t.children}const PA=(t,e)=>{const n=e===Pt.VERTICAL?t.box.width:t.box.height;return Gse(t)?{type:"branch",data:t.children.map(i=>PA(i,Ro(e))),size:n}:typeof t.cachedVisibleSize=="number"?{type:"leaf",data:t.view.toJSON(),size:t.cachedVisibleSize,visible:!1}:{type:"leaf",data:t.view.toJSON(),size:n}};class Hse{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(e){if(this.root.orientation===e)return;const{size:n,orthogonalSize:i}=this.root;this.root=LA(this.root,i,n),this.root.layout(n,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(e){this._locked=e;const n=[this.root];for(;n.length>0;){const i=n.pop();i instanceof vi&&(i.disabled=e,n.push(...i.children))}}get margin(){return this._margin}set margin(e){this._margin=e,this.root.margin=e}maximizedView(){var e;return(e=this._maximizedNode)===null||e===void 0?void 0:e.leaf.view}hasMaximizedView(){return this._maximizedNode!==void 0}maximizeView(e){var n;const i=Vi(e.element),[r,s]=this.getNode(i);if(!(s instanceof Xi)||((n=this._maximizedNode)===null||n===void 0?void 0:n.leaf)===s)return;this.hasMaximizedView()&&this.exitMaximizedView(),PA(this.getView(),this.orientation);const a=[];function o(l,u){for(let c=0;c<l.children.length;c++){const d=l.children[c];d instanceof Xi?d!==u&&(l.isChildVisible(c)?l.setChildVisible(c,!1):a.push(d)):o(d,u)}}o(this.root,s),this._maximizedNode={leaf:s,hiddenOnMaximize:a},this._onDidMaximizedNodeChange.fire({view:s.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const e=this._maximizedNode.hiddenOnMaximize;function n(r){for(let s=r.children.length-1;s>=0;s--){const a=r.children[s];a instanceof Xi?e.includes(a)||r.setChildVisible(s,!0):n(a)}}n(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let n;e&&(n=Vi(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const r={root:PA(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return n&&(r.maximizedNode={location:n}),e&&this.maximizeView(e),r}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const e=this.root.orientation;this.root=new vi(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(e,n){const i=e.orientation,r=i===Pt.VERTICAL?e.height:e.width;if(this._deserialize(e.root,i,n,r),this.layout(e.width,e.height),e.maximizedNode){const s=e.maximizedNode.location,[a,o]=this.getNode(s);if(!(o instanceof Xi))return;this.maximizeView(o.view)}}_deserialize(e,n,i,r){this.root=this._deserializeNode(e,n,i,r)}_deserializeNode(e,n,i,r){var s;let a;if(e.type==="branch"){const l=e.data.map(u=>({node:this._deserializeNode(u,Ro(n),i,e.size),visible:u.visible}));a=new vi(n,this.proportionalLayout,this.styles,e.size,r,this.locked,this.margin,l)}else{const o=i.fromJSON(e);typeof e.visible=="boolean"&&((s=o.setVisible)===null||s===void 0||s.call(o,e.visible)),a=new Xi(o,n,r,e.size)}return a}get root(){return this._root}set root(e){const n=this._root;n&&(n.dispose(),this._maximizedNode=void 0,this.element.removeChild(n.element)),this._root=e,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(i=>{this._onDidChange.fire(i)})}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const e=this.root;if(e.element.remove(),this._root=new vi(Ro(e.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),e.children.length!==0)if(e.children.length===1){const n=e.children[0];e.removeChild(0).dispose(),e.dispose(),this._root.addChild(LA(n,n.orthogonalSize,n.size),Ta.Distribute,0)}else this._root.addChild(e,Ta.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(n=>{this._onDidChange.fire(n)})}next(e){return this.progmaticSelect(e)}previous(e){return this.progmaticSelect(e,!0)}getView(e){const n=e?this.getNode(e)[1]:this.root;return this._getViews(n,this.orientation)}_getViews(e,n,i){const r={height:e.height,width:e.width};if(e instanceof Xi)return{box:r,view:e.view,cachedVisibleSize:i};const s=[];for(let a=0;a<e.children.length;a++){const o=e.children[a],l=e.getChildCachedVisibleSize(a);s.push(this._getViews(o,Ro(n),l))}return{box:r,children:s}}progmaticSelect(e,n=!1){const[i,r]=this.getNode(e);if(!(r instanceof Xi))throw new Error("invalid location");for(let s=i.length-1;s>-1;s--){const a=i[s],o=e[s]||0;if(n?o-1>-1:o+1<a.children.length)return MA(a.children[n?o-1:o+1],n)}return MA(this.root,n)}constructor(e,n,i,r,s){this.proportionalLayout=e,this.styles=n,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new Ho,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new Pe,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new Pe,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=r??!1,this._margin=s??0,this.root=new vi(i,e,n,0,0,this.locked,this.margin)}isViewVisible(e){const[n,i]=kc(e),[,r]=this.getNode(n);if(!(r instanceof vi))throw new Error("Invalid from location");return r.isChildVisible(i)}setViewVisible(e,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=kc(e),[,s]=this.getNode(i);if(!(s instanceof vi))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),s.setChildVisible(r,n)}moveView(e,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,r]=this.getNode(e);if(!(r instanceof vi))throw new Error("Invalid location");r.moveChild(n,i)}addView(e,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[r,s]=kc(i),[a,o]=this.getNode(r);if(o instanceof vi){const l=new Xi(e,Ro(o.orientation),o.orthogonalSize);o.addChild(l,n,s)}else{const[l,...u]=[...a].reverse(),[c,...d]=[...r].reverse();let h=0;const f=l.getChildCachedVisibleSize(c);typeof f=="number"&&(h=Ta.Invisible(f)),l.removeChild(c).dispose();const _=new vi(o.orientation,this.proportionalLayout,this.styles,o.size,o.orthogonalSize,this.locked,this.margin);l.addChild(_,o.size,c);const p=new Xi(o.view,l.orientation,o.size);_.addChild(p,h,0),typeof n!="number"&&n.type==="split"&&(n={type:"split",index:0});const v=new Xi(e,l.orientation,o.size);_.addChild(v,n,s)}}remove(e,n){const i=Vi(e.element);return this.removeView(i,n)}removeView(e,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=kc(e),[s,a]=this.getNode(i);if(!(a instanceof vi))throw new Error("Invalid location");const o=a.children[r];if(!(o instanceof Xi))throw new Error("Invalid location");if(a.removeChild(r,n),o.dispose(),a.children.length!==1)return o.view;const l=a.children[0];if(s.length===0)return l instanceof Xi||(a.removeChild(0,n),this.root=l),o.view;const[u,...c]=[...s].reverse(),[d,...h]=[...i].reverse(),f=a.isChildVisible(0);a.removeChild(0,n);const S=u.children.map((_,p)=>u.getChildSize(p));if(u.removeChild(d,n).dispose(),l instanceof vi){S.splice(d,1,...l.children.map(_=>_.size));for(let _=0;_<l.children.length;_++){const p=l.children[_];u.addChild(p,p.size,d+_)}for(;l.children.length>0;)l.removeChild(0)}else{const _=new Xi(l.view,Ro(l.orientation),l.size),p=f?l.orthogonalSize:Ta.Invisible(l.orthogonalSize);u.addChild(_,p,d)}l.dispose();for(let _=0;_<S.length;_++)u.resizeChild(_,S[_]);return o.view}layout(e,n){const[i,r]=this.root.orientation===Pt.HORIZONTAL?[n,e]:[e,n];this.root.layout(i,r)}getNode(e,n=this.root,i=[]){if(e.length===0)return[i,n];if(!(n instanceof vi))throw new Error("Invalid location");const[r,...s]=e;if(r<0||r>=n.children.length)throw new Error("Invalid location");const a=n.children[r];return i.push(n),this.getNode(s,a,i)}}class Vse extends ln{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,n=!1){super(),this._disableResizing=n,this._element=e,this.addDisposables(Fz(this._element,i=>{if(this.isDisposed||this.disableResizing||!this._element.offsetParent||!Nse(this._element))return;const{width:r,height:s}=i.contentRect;this.layout(r,s)}))}}const zse=Hz();function Ak(t){switch(t){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";case"within":default:return"center"}}class qse extends Vse{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map(e=>e.value)}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(e){this.gridview.locked=e}constructor(e,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=zse.next(),this._groups=new Map,this._onDidRemove=new Pe,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new Pe,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new Pe,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new Pe,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new yk,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new yk,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new kse(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),e.appendChild(this.element),this.gridview=new Hse(!!n.proportionalLayout,n.styles,n.orientation,n.locked,n.margin),this.gridview.locked=!!n.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange(r=>{this._onDidMaximizedChange.fire({panel:r.view,isMaximized:r.isMaximized})}),this.gridview.onDidViewVisibilityChange(()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire()),this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.layout(this.width,this.height,!0)}),br.from(()=>{var r;(r=this.element.parentElement)===null||r===void 0||r.removeChild(this.element)}),this.gridview.onDidChange(()=>{this._bufferOnDidLayoutChange.fire()}),Vc.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)(()=>{this._bufferOnDidLayoutChange.fire()}),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,n){this.gridview.setViewVisible(Vi(e.element),n),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(Vi(e.element))}updateOptions(e){var n,i,r,s;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=(n=e.disableAutoResizing)!==null&&n!==void 0?n:!1),"locked"in e&&(this.locked=(i=e.locked)!==null&&i!==void 0?i:!1),"margin"in e&&(this.gridview.margin=(r=e.margin)!==null&&r!==void 0?r:0),"className"in e&&this._classNames.setClassNames((s=e.className)!==null&&s!==void 0?s:"")}maximizeGroup(e){this.gridview.maximizeView(e),this.doSetGroupActive(e)}isMaximizedGroup(e){return this.gridview.maximizedView()===e}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(e,n=[0],i){this.gridview.addView(e,i??Ta.Distribute,n),this._onDidAdd.fire(e)}doRemoveGroup(e,n){if(!this._groups.has(e.id))throw new Error("invalid operation");const i=this._groups.get(e.id),r=this.gridview.remove(e,Ta.Distribute);if(i&&!(n!=null&&n.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(e.id),this._onDidRemove.fire(e)),!(n!=null&&n.skipActive)&&this._activeGroup===e){const s=Array.from(this._groups.values());this.doSetGroupActive(s.length>0?s[0].value:void 0)}return r}getPanel(e){var n;return(n=this._groups.get(e))===null||n===void 0?void 0:n.value}doSetGroupActive(e){this._activeGroup!==e&&(this._activeGroup&&this._activeGroup.setActive(!1),e&&e.setActive(!0),this._activeGroup=e,this._onDidActiveChange.fire(e))}removeGroup(e){this.doRemoveGroup(e)}moveToNext(e){var n;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=Vi(e.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}moveToPrevious(e){var n;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=Vi(e.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}layout(e,n,i){(i||e!==this.width||n!==this.height)&&(this.gridview.element.style.height=`${n}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,n))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class pv{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get gap(){return this.component.gap}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(e){this.component=e}focus(){this.component.focus()}getPanel(e){return this.component.getGroupPanel(e)}layout(e,n,i=!1){this.component.layout(e,n,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e){this.component.removePanel(e)}addGroup(e){return this.component.addGroup(e)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(e){this.component.removeGroup(e)}getGroup(e){return this.component.getPanel(e)}addFloatingGroup(e,n){return this.component.addFloatingGroup(e,n)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(e){this.component.moveToNext(e)}moveToPrevious(e){this.component.moveToPrevious(e)}maximizeGroup(e){this.component.maximizeGroup(e.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(e,n){return this.component.addPopoutGroup(e,n)}setGap(e){this.component.updateOptions({gap:e})}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Vz extends ln{constructor(e){super(),this.el=e,this.dataDisposable=new Ho,this.pointerEventsDisposable=new Ho,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}isCancelled(e){return!1}configure(){this.addDisposables(this._onDragStart,si(this.el,"dragstart",e=>{if(e.defaultPrevented||this.isCancelled(e)){e.preventDefault();return}const n=fv();this.pointerEventsDisposable.value={dispose:()=>{n.release()}},this.el.classList.add("dv-dragged"),setTimeout(()=>this.el.classList.remove("dv-dragged"),0),this.dataDisposable.value=this.getData(e),this._onDragStart.fire(e),e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.items.length>0||e.dataTransfer.setData("text/plain",""))}),si(this.el,"dragend",()=>{this.pointerEventsDisposable.dispose(),this.dataDisposable.dispose()}))}}class zz extends ln{constructor(e,n){super(),this.element=e,this.callbacks=n,this.target=null,this.registerListeners()}onDragEnter(e){this.target=e.target,this.callbacks.onDragEnter(e)}onDragOver(e){e.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(e)}onDragLeave(e){this.target===e.target&&(this.target=null,this.callbacks.onDragLeave(e))}onDragEnd(e){this.target=null,this.callbacks.onDragEnd(e)}onDrop(e){this.callbacks.onDrop(e)}registerListeners(){this.addDisposables(si(this.element,"dragenter",e=>{this.onDragEnter(e)},!0)),this.addDisposables(si(this.element,"dragover",e=>{this.onDragOver(e)},!0)),this.addDisposables(si(this.element,"dragleave",e=>{this.onDragLeave(e)})),this.addDisposables(si(this.element,"dragend",e=>{this.onDragEnd(e)})),this.addDisposables(si(this.element,"drop",e=>{this.onDrop(e)}))}}class Yse extends vN{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function Ok(t){switch(t){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${t}'`)}}function Wse(t){switch(t){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${t}'`)}}const Kse={value:20,type:"percentage"},jse={value:50,type:"percentage"},Qse=100,Xse=100;class Ml extends ln{get state(){return this._state}constructor(e,n){super(),this.element=e,this.options=n,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new zz(this.element,{onDragEnter:()=>{},onDragOver:i=>{if(this._acceptedTargetZonesSet.size===0){this.removeDropTarget();return}const r=this.element.clientWidth,s=this.element.clientHeight;if(r===0||s===0)return;const a=i.currentTarget.getBoundingClientRect(),o=i.clientX-a.left,l=i.clientY-a.top,u=this.calculateQuadrant(this._acceptedTargetZonesSet,o,l,r,s);if(this.isAlreadyUsed(i)||u===null){this.removeDropTarget();return}if(!this.options.canDisplayOverlay(i,u)){this.removeDropTarget();return}const c=new Yse({nativeEvent:i,position:u});if(this._onWillShowOverlay.fire(c),c.defaultPrevented){this.removeDropTarget();return}this.markAsUsed(i),this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),this.element.classList.add("dv-drop-target"),this.element.append(this.targetElement)),this.toggleClasses(u,r,s),this._state=u},onDragLeave:()=>{this.removeDropTarget()},onDragEnd:()=>{this.removeDropTarget()},onDrop:i=>{i.preventDefault();const r=this._state;this.removeDropTarget(),r&&(i.stopPropagation(),this._onDrop.fire({position:r,nativeEvent:i}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(e){this._acceptedTargetZonesSet=new Set(e)}setOverlayModel(e){this.options.overlayModel=e}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(e){e[Ml.USED_EVENT_ID]=!0}isAlreadyUsed(e){const n=e[Ml.USED_EVENT_ID];return typeof n=="boolean"&&n}toggleClasses(e,n,i){var r,s;if(!this.overlayElement)return;const a=n<Qse,o=i<Xse,l=e==="left",u=e==="right",c=e==="top",d=e==="bottom",h=!a&&u,f=!a&&l,S=!o&&c,_=!o&&d;let p=1;const v=(s=(r=this.options.overlayModel)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:jse;v.type==="percentage"?p=zn(v.value,0,100)/100:((h||f)&&(p=zn(0,v.value,n)/n),(S||_)&&(p=zn(0,v.value,i)/i));const m={top:"0px",left:"0px",width:"100%",height:"100%"};h?(m.left=`${100*(1-p)}%`,m.width=`${100*p}%`):f?m.width=`${100*p}%`:S?m.height=`${100*p}%`:_&&(m.top=`${100*(1-p)}%`,m.height=`${100*p}%`),this.overlayElement.style.top=m.top,this.overlayElement.style.left=m.left,this.overlayElement.style.width=m.width,this.overlayElement.style.height=m.height,rn(this.overlayElement,"dv-drop-target-small-vertical",o),rn(this.overlayElement,"dv-drop-target-small-horizontal",a),rn(this.overlayElement,"dv-drop-target-left",l),rn(this.overlayElement,"dv-drop-target-right",u),rn(this.overlayElement,"dv-drop-target-top",c),rn(this.overlayElement,"dv-drop-target-bottom",d),rn(this.overlayElement,"dv-drop-target-center",e==="center")}calculateQuadrant(e,n,i,r,s){var a,o;const l=(o=(a=this.options.overlayModel)===null||a===void 0?void 0:a.activationSize)!==null&&o!==void 0?o:Kse;return l.type==="percentage"?Zse(e,n,i,r,s,l.value):Jse(e,n,i,r,s,l.value)}removeDropTarget(){this.targetElement&&(this._state=void 0,this.element.removeChild(this.targetElement),this.targetElement=void 0,this.overlayElement=void 0,this.element.classList.remove("dv-drop-target"))}}Ml.USED_EVENT_ID="__dockview_droptarget_event_is_used__";function Zse(t,e,n,i,r,s){const a=100*e/i,o=100*n/r;return t.has("left")&&a<s?"left":t.has("right")&&a>100-s?"right":t.has("top")&&o<s?"top":t.has("bottom")&&o>100-s?"bottom":t.has("center")?"center":null}function Jse(t,e,n,i,r,s){return t.has("left")&&e<s?"left":t.has("right")&&e>i-s?"right":t.has("top")&&n<s?"top":t.has("bottom")&&n>r-s?"bottom":t.has("center")?"center":null}class qz extends vN{constructor(){super()}}class eoe extends ln{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(e,n){super(),this.id=e,this.component=n,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new Ho,this._onDidDimensionChange=new Pe,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new Pe,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new Pe,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new Pe,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new Pe,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new Pe,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new Pe,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new Pe,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange(i=>{this._isFocused=i.isFocused}),this.onDidActiveChange(i=>{this._isActive=i.isActive}),this.onDidVisibilityChange(i=>{this._isVisible=i.isVisible}),this.onDidDimensionsChange(i=>{this._width=i.width,this._height=i.height}),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(e){this.panelUpdatesDisposable.value=this._onDidParametersChange.event(n=>{this._parameters=n,e.update({params:n})})}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class toe extends ln{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var e;return(e=this._params)===null||e===void 0?void 0:e.params}constructor(e,n,i){super(),this.id=e,this.component=n,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const r=$z(this._element);this.addDisposables(this.api,r.onDidFocus(()=>{this.api._onDidChangeFocus.fire({isFocused:!0})}),r.onDidBlur(()=>{this.api._onDidChangeFocus.fire({isFocused:!1})}),r)}focus(){const e=new qz;this.api._onWillFocus.fire(e),!e.defaultPrevented&&this._element.focus()}layout(e,n){this._width=e,this._height=n,this.api._onDidDimensionChange.fire({width:e,height:n}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var n,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},(n=this._params)===null||n===void 0?void 0:n.params),e.params)});for(const r of Object.keys(e.params))e.params[r]===void 0&&delete this._params.params[r];(i=this.part)===null||i===void 0||i.update({params:this._params.params})}toJSON(){var e,n;const i=(n=(e=this._params)===null||e===void 0?void 0:e.params)!==null&&n!==void 0?n:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var e;this.api.dispose(),(e=this.part)===null||e===void 0||e.dispose(),super.dispose()}}class noe extends ln{get element(){return this._element}constructor(e,n){super(),this.accessor=e,this.group=n,this.disposable=new Ho,this._onDidFocus=new Pe,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new Pe,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur),this.dropTarget=new Ml(this.element,{acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(i,r)=>{if(this.group.locked==="no-drop-target"||this.group.locked&&r==="center")return!1;const s=tr();return!s&&i.shiftKey&&this.group.location.type!=="floating"?!1:s&&s.viewId===this.accessor.id?s.groupId===this.group.id&&(r==="center"||s.panelId===null)?!1:!(this.group.panels.length===1&&s.groupId===this.group.id):this.group.canDisplayOverlay(i,r,"content")}}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,n={asActive:!0}){const i=n.asActive||this.panel&&this.group.isPanelActive(this.panel);this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=e;let r;switch(e.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(e),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),r=this._element;break;case"always":e.view.content.element.parentElement===this._element&&this._element.removeChild(e.view.content.element),r=this.group.renderContainer.attach({panel:e,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${e.api.renderer}'`)}if(i){const s=$z(r),a=new ln;a.addDisposables(s,s.onDidFocus(()=>this._onDidFocus.fire()),s.onDidBlur(()=>this._onDidBlur.fire())),this.disposable.value=a}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,n){}closePanel(){var e;this.panel&&this.panel.api.renderer==="onlyWhenVisible"&&((e=this.panel.view.content.element.parentElement)===null||e===void 0||e.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}}class ioe extends Vz{constructor(e,n,i,r){super(e),this.accessor=n,this.group=i,this.panel=r,this.panelTransfer=iu.getInstance()}getData(e){return this.panelTransfer.setData([new Ol(this.accessor.id,this.group.id,this.panel.id)],Ol.prototype),{dispose:()=>{this.panelTransfer.clearData(Ol.prototype)}}}}class roe extends ln{get element(){return this._element}constructor(e,n,i){super(),this.panel=e,this.accessor=n,this.group=i,this.content=void 0,this._onChanged=new Pe,this.onChanged=this._onChanged.event,this._onDropped=new Pe,this.onDrop=this._onDropped.event,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!0,rn(this.element,"dv-inactive-tab",!0);const r=new ioe(this._element,this.accessor,this.group,this.panel);this.dropTarget=new Ml(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(s,a)=>{if(this.group.locked)return!1;const o=tr();return o&&this.accessor.id===o.viewId?o.panelId===null&&o.groupId===this.group.id?!1:this.panel.id!==o.panelId:this.group.model.canDisplayOverlay(s,a,"tab")}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onChanged,this._onDropped,this._onDragStart,r.onDragStart(s=>{this._onDragStart.fire(s)}),r,si(this._element,"pointerdown",s=>{s.defaultPrevented||this._onChanged.fire(s)}),this.dropTarget.onDrop(s=>{this._onDropped.fire(s)}),this.dropTarget)}setActive(e){rn(this.element,"dv-active-tab",e),rn(this.element,"dv-inactive-tab",!e)}setContent(e){this.content&&this._element.removeChild(this.content.element),this.content=e,this._element.appendChild(this.content.element)}dispose(){super.dispose()}}function soe(t,e){Uz(e,"dv-dragged"),document.body.appendChild(e),t.setDragImage(e,0,0),setTimeout(()=>{DA(e,"dv-dragged"),e.remove()},0)}class ooe extends Vz{constructor(e,n,i){super(e),this.accessor=n,this.group=i,this.panelTransfer=iu.getInstance(),this.addDisposables(si(e,"pointerdown",r=>{r.shiftKey&&Ose(r)},!0))}isCancelled(e){return this.group.api.location.type==="floating"&&!e.shiftKey}getData(e){const n=e.dataTransfer;this.panelTransfer.setData([new Ol(this.accessor.id,this.group.id,null)],Ol.prototype);const i=window.getComputedStyle(this.el),r=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),s=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(n){const a=document.createElement("div");a.style.backgroundColor=r,a.style.color=s,a.style.padding="2px 8px",a.style.height="24px",a.style.fontSize="11px",a.style.lineHeight="20px",a.style.borderRadius="12px",a.style.position="absolute",a.textContent=`Multiple Panels (${this.group.size})`,soe(n,a)}return{dispose:()=>{this.panelTransfer.clearData(Ol.prototype)}}}}class aoe extends ln{get element(){return this._element}constructor(e,n){super(),this.accessor=e,this.group=n,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!0,this.addDisposables(this._onDrop,this._onDragStart,si(this._element,"pointerdown",()=>{this.accessor.doSetGroupActive(this.group)}));const i=new ooe(this._element,e,n);this.dropTraget=new Ml(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(r,s)=>{var a;const o=tr();return o&&this.accessor.id===o.viewId?o.panelId===null&&o.groupId===this.group.id?!1:((a=Mse(this.group.panels))===null||a===void 0?void 0:a.id)!==o.panelId:n.model.canDisplayOverlay(r,s,"header_space")}}),this.onWillShowOverlay=this.dropTraget.onWillShowOverlay,this.addDisposables(i,i.onDragStart(r=>{this._onDragStart.fire(r)}),this.dropTraget.onDrop(r=>{this._onDrop.fire(r)}),this.dropTraget)}}class loe extends ln{get panels(){return this.tabs.map(e=>e.value.panel.id)}get size(){return this.tabs.length}get hidden(){return this._hidden}set hidden(e){this._hidden=e,this.element.style.display=e?"none":""}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(e){this.rightActions!==e&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),e&&(this.rightActionsContainer.appendChild(e),this.rightActions=e))}setLeftActionsElement(e){this.leftActions!==e&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),e&&(this.leftActionsContainer.appendChild(e),this.leftActions=e))}setPrefixActionsElement(e){this.preActions!==e&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),e&&(this.preActionsContainer.appendChild(e),this.preActions=e))}get element(){return this._element}isActive(e){return this.selectedIndex>-1&&this.tabs[this.selectedIndex].value===e}indexOf(e){return this.tabs.findIndex(n=>n.value.panel.id===e)}constructor(e,n){super(),this.accessor=e,this.group=n,this.tabs=[],this.selectedIndex=-1,this._hidden=!1,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onTabDragStart=new Pe,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new Pe,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",rn(this._element,"dv-full-width-single-tab",this.accessor.options.singleTabMode==="fullwidth"),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabContainer=document.createElement("div"),this.tabContainer.className="dv-tabs-container",this.voidContainer=new aoe(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabContainer),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.accessor.onDidAddPanel(i=>{i.api.group===this.group&&rn(this._element,"dv-single-tab",this.size===1)}),this.accessor.onDidRemovePanel(i=>{i.api.group===this.group&&rn(this._element,"dv-single-tab",this.size===1)}),this._onWillShowOverlay,this._onDrop,this._onTabDragStart,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart(i=>{this._onGroupDragStart.fire({nativeEvent:i,group:this.group})}),this.voidContainer.onDrop(i=>{this._onDrop.fire({event:i.nativeEvent,index:this.tabs.length})}),this.voidContainer.onWillShowOverlay(i=>{this._onWillShowOverlay.fire(new _v(i,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:tr}))}),si(this.voidContainer.element,"pointerdown",i=>{if(!this.accessor.options.disableFloatingGroups&&i.shiftKey&&this.group.api.location.type!=="floating"){i.preventDefault();const{top:s,left:a}=this.element.getBoundingClientRect(),{top:o,left:l}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:a-l+20,y:s-o+20,inDragMode:!0})}}),si(this.tabContainer,"pointerdown",i=>{if(i.defaultPrevented)return;i.button===0&&this.accessor.doSetGroupActive(this.group)}))}setActive(e){}addTab(e,n=this.tabs.length){if(n<0||n>this.tabs.length)throw new Error("invalid location");this.tabContainer.insertBefore(e.value.element,this.tabContainer.children[n]),this.tabs=[...this.tabs.slice(0,n),e,...this.tabs.slice(n)],this.selectedIndex<0&&(this.selectedIndex=n)}delete(e){const n=this.tabs.findIndex(a=>a.value.panel.id===e),i=this.tabs.splice(n,1)[0],{value:r,disposable:s}=i;s.dispose(),r.dispose(),r.element.remove()}setActivePanel(e){this.tabs.forEach(n=>{const i=e.id===n.value.panel.id;n.value.setActive(i)})}openPanel(e,n=this.tabs.length){if(this.tabs.find(a=>a.value.panel.id===e.id))return;const i=new roe(e,this.accessor,this.group);i.setContent(e.view.tab);const r=new ln(i.onDragStart(a=>{this._onTabDragStart.fire({nativeEvent:a,panel:e})}),i.onChanged(a=>{const o=!this.accessor.options.disableFloatingGroups,l=this.group.api.location.type==="floating"&&this.size===1;if(o&&!l&&a.shiftKey){a.preventDefault();const c=this.accessor.getGroupPanel(i.panel.id),{top:d,left:h}=i.element.getBoundingClientRect(),{top:f,left:S}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(c,{x:h-S,y:d-f,inDragMode:!0});return}!(a.button===0)||a.defaultPrevented||this.group.activePanel!==e&&this.group.model.openPanel(e)}),i.onDrop(a=>{this._onDrop.fire({event:a.nativeEvent,index:this.tabs.findIndex(o=>o.value===i)})}),i.onWillShowOverlay(a=>{this._onWillShowOverlay.fire(new _v(a,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:tr}))})),s={value:i,disposable:r};this.addTab(s,n)}closePanel(e){this.delete(e.id)}dispose(){super.dispose();for(const{value:e,disposable:n}of this.tabs)n.dispose(),e.dispose();this.tabs=[]}}class Yz{get isAccepted(){return this._isAccepted}constructor(e,n,i,r,s){this.nativeEvent=e,this.target=n,this.position=i,this.getData=r,this.group=s,this._isAccepted=!1}accept(){this._isAccepted=!0}}const Ik=Object.keys({disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,gap:void 0,className:void 0,noPanelsOverlay:void 0});function coe(t){return!!t.referencePanel}function uoe(t){return!!t.referenceGroup}function doe(t){return!!t.referencePanel}function hoe(t){return!!t.referenceGroup}class SN extends vN{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(e){super(),this.options=e}getData(){return this.options.getData()}}class Wz extends SN{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class _v{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(e,n){this.event=e,this.options=n}}class foe extends ln{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,rn(this.container,"dv-locked-groupview",e==="no-drop-target"||e)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return this._panels.length===0}get hasWatermark(){return!!(this.watermark&&this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return document.activeElement?kA(document.activeElement,this.contentContainer.element):!1}get location(){return this._location}set location(e){switch(this._location=e,rn(this.container,"dv-groupview-floating",!1),rn(this.container,"dv-groupview-popout",!1),e.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(e?["center"]:["top","bottom","left","right","center"]),rn(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),rn(this.container,"dv-groupview-popout",!0);break}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,n,i,r,s){var a;super(),this.container=e,this.accessor=n,this.id=i,this.options=r,this.groupPanel=s,this._isGroupActive=!1,this._locked=!1,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new Pe,this.onMove=this._onMove.event,this._onDidDrop=new Pe,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new Pe,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new Pe,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new Pe,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new Pe,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new Pe,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new Pe,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new Pe,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new Pe,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,rn(this.container,"dv-groupview",!0),this._api=new pv(this.accessor),this.tabsContainer=new loe(this.accessor,this.groupPanel),this.contentContainer=new noe(this.accessor,this),e.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!r.hideHeader,this.locked=(a=r.locked)!==null&&a!==void 0?a:!1,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this.tabsContainer.onTabDragStart(o=>{this._onTabDragStart.fire(o)}),this.tabsContainer.onGroupDragStart(o=>{this._onGroupDragStart.fire(o)}),this.tabsContainer.onDrop(o=>{this.handleDropEvent("header",o.event,"center",o.index)}),this.contentContainer.onDidFocus(()=>{this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.onDidBlur(()=>{}),this.contentContainer.dropTarget.onDrop(o=>{this.handleDropEvent("content",o.nativeEvent,o.position)}),this.tabsContainer.onWillShowOverlay(o=>{this._onWillShowOverlay.fire(o)}),this.contentContainer.dropTarget.onWillShowOverlay(o=>{this._onWillShowOverlay.fire(new _v(o,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:tr}))}),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(e){this.panels.forEach(n=>{this.renderContainer.detatch(n)}),this._overwriteRenderContainer=e,this.panels.forEach(n=>{this.rerender(n)})}get renderContainer(){var e;return(e=this._overwriteRenderContainer)!==null&&e!==void 0?e:this.accessor.overlayRenderContainer}initialize(){this.options.panels&&this.options.panels.forEach(e=>{this.doAddPanel(e)}),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.accessor.options.createRightHeaderActionComponent&&(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this.addDisposables(this._rightHeaderActions),this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)),this.accessor.options.createLeftHeaderActionComponent&&(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this.addDisposables(this._leftHeaderActions),this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)),this.accessor.options.createPrefixHeaderActionComponent&&(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this.addDisposables(this._prefixHeaderActions),this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element))}rerender(e){this.contentContainer.renderPanel(e,{asActive:!1})}indexOf(e){return this.tabsContainer.indexOf(e.id)}toJSON(){var e;const n={views:this.tabsContainer.panels,activeView:(e=this._activePanel)===null||e===void 0?void 0:e.id,id:this.id};return this.locked!==!1&&(n.locked=this.locked),this.header.hidden&&(n.hideHeader=!0),n}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const n=e.panel?this.panels.indexOf(e.panel):-1;let i;if(n<this.panels.length-1)i=n+1;else if(!e.suppressRoll)i=0;else return;this.openPanel(this.panels[i])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const n=this.panels.indexOf(e.panel);let i;if(n>0)i=n-1;else if(!e.suppressRoll)i=this.panels.length-1;else return;this.openPanel(this.panels[i])}containsPanel(e){return this.panels.includes(e)}init(e){}update(e){}focus(){var e;(e=this._activePanel)===null||e===void 0||e.focus()}openPanel(e,n={}){(typeof n.index!="number"||n.index>this.panels.length)&&(n.index=this.panels.length);const i=!!n.skipSetActive;if(e.updateParentGroup(this.groupPanel,{skipSetActive:n.skipSetActive}),this.doAddPanel(e,n.index,{skipSetActive:i}),this._activePanel===e){this.contentContainer.renderPanel(e,{asActive:!0});return}i||this.doSetActivePanel(e),n.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),n.skipSetActive||this.updateContainer()}removePanel(e,n={skipSetActive:!1}){const i=typeof e=="string"?e:e.id,r=this._panels.find(s=>s.id===i);if(!r)throw new Error("invalid operation");return this._removePanel(r,n)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const n of e)this.doClose(n)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const n=this.panels.length===1&&this.accessor.groups.length===1;this.accessor.removePanel(e,n&&this.accessor.options.noPanelsOverlay==="emptyGroup"?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,n=!1){!n&&this.isActive===e||(this._isGroupActive=e,rn(this.container,"dv-active-group",e),rn(this.container,"dv-inactive-group",!e),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(e,n){var i;this._width=e,this._height=n,this.contentContainer.layout(this._width,this._height),!((i=this._activePanel)===null||i===void 0)&&i.layout&&this._activePanel.layout(this._width,this._height)}_removePanel(e,n){const i=this._activePanel===e;if(this.doRemovePanel(e),i&&this.panels.length>0){const r=this.mostRecentlyUsed[0];this.openPanel(r,{skipSetActive:n.skipSetActive,skipSetGroupActive:n.skipSetActiveGroup})}return this._activePanel&&this.panels.length===0&&this.doSetActivePanel(void 0),n.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const n=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(n,1),this.mostRecentlyUsed.includes(e)){const r=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(r,1)}const i=this._panelDisposables.get(e.id);i&&(i.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,n=this.panels.length,i={skipSetActive:!1}){const s=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,n),i.skipSetActive||this.contentContainer.openPanel(e),!s&&(this.updateMru(e),this.panels.splice(n,0,e),this._panelDisposables.set(e.id,new ln(e.api.onDidTitleChange(a=>this._onDidPanelTitleChange.fire(a)),e.api.onDidParametersChange(a=>this._onDidPanelParametersChange.fire(a)))),this._onDidAddPanel.fire({panel:e}))}doSetActivePanel(e){this._activePanel!==e&&(this._activePanel=e,e&&(this.tabsContainer.setActivePanel(e),e.layout(this._width,this._height),this.updateMru(e),this._onDidActivePanelChange.fire({panel:e})))}updateMru(e){this.mostRecentlyUsed.includes(e)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(e),1),this.mostRecentlyUsed=[e,...this.mostRecentlyUsed]}updateContainer(){var e,n;if(this.panels.forEach(i=>i.runEvents()),this.isEmpty&&!this.watermark){const i=this.accessor.createWatermarkComponent();i.init({containerApi:this._api,group:this.groupPanel}),this.watermark=i,si(this.watermark.element,"pointerdown",()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),(n=(e=this.watermark).dispose)===null||n===void 0||n.call(e),this.watermark=void 0)}canDisplayOverlay(e,n,i){const r=new Yz(e,i,n,tr,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(r),r.isAccepted}handleDropEvent(e,n,i,r){if(this.locked==="no-drop-target")return;function s(){switch(e){case"header":return typeof r=="number"?"tab":"header_space";case"content":return"content"}}const a=typeof r=="number"?this.panels[r]:void 0,o=new Wz({nativeEvent:n,position:i,panel:a,getData:()=>tr(),kind:s(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(o),o.defaultPrevented)return;const l=tr();if(l&&l.viewId===this.accessor.id){if(l.panelId===null){const{groupId:f}=l;this._onMove.fire({target:i,groupId:f,index:r});return}if(this.tabsContainer.indexOf(l.panelId)!==-1&&this.tabsContainer.size===1)return;const{groupId:c,panelId:d}=l;if(this.id===c&&!i&&this.tabsContainer.indexOf(d)===r)return;this._onMove.fire({target:i,groupId:l.groupId,itemId:l.panelId,index:r})}else this._onDidDrop.fire(new SN({nativeEvent:n,position:i,panel:a,getData:()=>tr(),group:this.groupPanel,api:this._api}))}dispose(){var e,n,i;super.dispose(),(e=this.watermark)===null||e===void 0||e.element.remove(),(i=(n=this.watermark)===null||n===void 0?void 0:n.dispose)===null||i===void 0||i.call(n),this.watermark=void 0;for(const r of this.panels)r.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class bN extends eoe{constructor(e,n,i){super(e,n),this._onDidConstraintsChangeInternal=new Pe,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new Pe,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new Pe,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class poe extends toe{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const e=typeof this._minimumWidth=="function"?this._minimumWidth():this._minimumWidth;return e!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=e,this.updateConstraints()),e}__maximumWidth(){const e=typeof this._maximumWidth=="function"?this._maximumWidth():this._maximumWidth;return e!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=e,this.updateConstraints()),e}__minimumHeight(){const e=typeof this._minimumHeight=="function"?this._minimumHeight():this._minimumHeight;return e!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=e,this.updateConstraints()),e}__maximumHeight(){const e=typeof this._maximumHeight=="function"?this._maximumHeight():this._maximumHeight;return e!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=e,this.updateConstraints()),e}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(e,n,i,r){super(e,n,r??new bN(e,n)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,typeof(i==null?void 0:i.minimumWidth)=="number"&&(this._minimumWidth=i.minimumWidth),typeof(i==null?void 0:i.maximumWidth)=="number"&&(this._maximumWidth=i.maximumWidth),typeof(i==null?void 0:i.minimumHeight)=="number"&&(this._minimumHeight=i.minimumHeight),typeof(i==null?void 0:i.maximumHeight)=="number"&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange(s=>{const{isVisible:a}=s,{accessor:o}=this._params;o.setVisible(this,a)}),this.api.onActiveChange(()=>{const{accessor:s}=this._params;s.doSetGroupActive(this)}),this.api.onDidConstraintsChangeInternal(s=>{(typeof s.minimumWidth=="number"||typeof s.minimumWidth=="function")&&(this._minimumWidth=s.minimumWidth),(typeof s.minimumHeight=="number"||typeof s.minimumHeight=="function")&&(this._minimumHeight=s.minimumHeight),(typeof s.maximumWidth=="number"||typeof s.maximumWidth=="function")&&(this._maximumWidth=s.maximumWidth),(typeof s.maximumHeight=="number"||typeof s.maximumHeight=="function")&&(this._maximumHeight=s.maximumHeight)}),this.api.onDidSizeChange(s=>{this._onDidChange.fire({height:s.height,width:s.width})}),this._onDidChange)}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}init(e){e.maximumHeight&&(this._maximumHeight=e.maximumHeight),e.minimumHeight&&(this._minimumHeight=e.minimumHeight),e.maximumWidth&&(this._maximumWidth=e.maximumWidth),e.minimumWidth&&(this._minimumWidth=e.minimumWidth),this._priority=e.priority,this._snap=!!e.snap,super.init(e),typeof e.isVisible=="boolean"&&this.setVisible(e.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const e=super.toJSON(),n=r=>r===Number.MAX_SAFE_INTEGER?void 0:r,i=r=>r<=0?void 0:r;return Object.assign(Object.assign({},e),{minimumHeight:i(this.minimumHeight),maximumHeight:n(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:n(this.maximumWidth),snap:this.snap,priority:this.priority})}}const fh="dockview: DockviewGroupPanelApiImpl not initialized";class _oe extends bN{get location(){if(!this._group)throw new Error(fh);return this._group.model.location}constructor(e,n){super(e,"__dockviewgroup__"),this.accessor=n,this._mutableDisposable=new Ho,this._onDidLocationChange=new Pe,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange,this._mutableDisposable)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return this.location.type==="popout"?this.location.getWindow():window}moveTo(e){var n,i,r;if(!this._group)throw new Error(fh);const s=(n=e.group)!==null&&n!==void 0?n:this.accessor.addGroup({direction:Wse((i=e.position)!==null&&i!==void 0?i:"right"),skipSetActive:!0});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:e.group&&(r=e.position)!==null&&r!==void 0?r:"center",index:e.index}})}maximize(){if(!this._group)throw new Error(fh);this.location.type==="grid"&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(fh);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(fh);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e,queueMicrotask(()=>{this._mutableDisposable.value=this._group.model.onDidActivePanelChange(n=>{this._onDidActivePanelChange.fire(n)})})}}const moe=100,goe=100;class Nk extends poe{get minimumWidth(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.minimumWidth;return typeof n=="number"?n:super.__minimumWidth()}get minimumHeight(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.minimumHeight;return typeof n=="number"?n:super.__minimumHeight()}get maximumWidth(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.maximumWidth;return typeof n=="number"?n:super.__maximumWidth()}get maximumHeight(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.maximumHeight;return typeof n=="number"?n:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(e){this._model.locked=e}get header(){return this._model.header}constructor(e,n,i){var r,s,a,o,l,u;super(n,"groupview_default",{minimumHeight:(s=(r=i.constraints)===null||r===void 0?void 0:r.minimumHeight)!==null&&s!==void 0?s:goe,minimumWidth:(o=(a=i.constraints)===null||a===void 0?void 0:a.maximumHeight)!==null&&o!==void 0?o:moe,maximumHeight:(l=i.constraints)===null||l===void 0?void 0:l.maximumHeight,maximumWidth:(u=i.constraints)===null||u===void 0?void 0:u.maximumWidth},new _oe(n,e)),this.api.initialize(this),this._model=new foe(this.element,e,n,i,this)}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,n){super.layout(e,n),this.model.layout(e,n)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}class voe extends bN{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(e){const n=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(n),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,n,i,r,s){super(e.id,r),this.panel=e,this.accessor=i,this._onDidTitleChange=new Pe,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new Pe,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new Pe,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new Pe,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new Pe,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new Ho,this._tabComponent=s,this.initialize(e),this._group=n,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(e){var n,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:(n=e.group)!==null&&n!==void 0?n:this._group,position:e.group&&(i=e.position)!==null&&i!==void 0?i:"center",index:e.index}})}setTitle(e){this.panel.setTitle(e)}setRenderer(e){this.panel.setRenderer(e)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(e){var n;let i=(n=e==null?void 0:e.isActive)!==null&&n!==void 0?n:!1;this.groupEventsDisposable.value=new ln(this.group.api.onDidVisibilityChange(r=>{const s=!r.isVisible&&this.isVisible,a=r.isVisible&&!this.isVisible,o=this.group.model.isPanelActive(this.panel);(s||a&&o)&&this._onDidVisibilityChange.fire(r)}),this.group.api.onDidLocationChange(r=>{this.group===this.panel.group&&this._onDidLocationChange.fire(r)}),this.group.api.onDidActiveChange(()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))}))}}class zu extends ln{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var e;return(e=this._renderer)!==null&&e!==void 0?e:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(e,n,i,r,s,a,o,l){super(),this.id=e,this.accessor=r,this.containerApi=s,this.view=o,this._renderer=l.renderer,this._group=a,this._minimumWidth=l.minimumWidth,this._minimumHeight=l.minimumHeight,this._maximumWidth=l.maximumWidth,this._maximumHeight=l.maximumHeight,this.api=new voe(this,this._group,r,n,i),this.addDisposables(this.api.onActiveChange(()=>{r.setActivePanel(this)}),this.api.onDidSizeChange(u=>{this.group.api.setSize(u)}),this.api.onDidRendererChange(()=>{this.group.model.rerender(this)}))}init(e){this._params=e.params,this.view.init(Object.assign(Object.assign({},e),{api:this.api,containerApi:this.containerApi})),this.setTitle(e.title)}focus(){const e=new qz;this.api._onWillFocus.fire(e),!e.defaultPrevented&&(this.api.isActive||this.api.setActive())}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(e){e!==this.title&&(this._title=e,this.api._onDidTitleChange.fire({title:e}))}setRenderer(e){e!==this.renderer&&(this._renderer=e,this.api._onDidRendererChange.fire({renderer:e}))}update(e){var n;this._params=Object.assign(Object.assign({},(n=this._params)!==null&&n!==void 0?n:{}),e.params);for(const i of Object.keys(e.params))e.params[i]===void 0&&delete this._params[i];this.view.update({params:this._params})}updateParentGroup(e,n){this._group=e,this.api.group=this._group;const i=this._group.model.isPanelActive(this),r=this.group.api.isActive&&i;n!=null&&n.skipSetActive||this.api.isActive!==r&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const e=this._group.model.isPanelActive(this),n=this.group.api.isActive&&e;this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,n){this.api._onDidDimensionChange.fire({width:e,height:n}),this.view.layout(e,n)}dispose(){this.api.dispose(),this.view.dispose()}}const Soe=t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttributeNS(null,"height",t.height),e.setAttributeNS(null,"width",t.width),e.setAttributeNS(null,"viewBox",t.viewbox),e.setAttributeNS(null,"aria-hidden","false"),e.setAttributeNS(null,"focusable","false"),e.classList.add("dv-svg");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d",t.path),e.appendChild(n),e},boe=()=>Soe({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"});class xk extends ln{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(boe()),this._element.appendChild(this._content),this._element.appendChild(this.action),this.addDisposables(si(this.action,"pointerdown",e=>{e.preventDefault()})),this.render()}init(e){this._title=e.title,this.addDisposables(e.api.onDidTitleChange(n=>{this._title=n.title,this.render()}),si(this.action,"pointerdown",n=>{n.preventDefault()}),si(this.action,"click",n=>{n.defaultPrevented||(n.preventDefault(),e.api.close())})),this.render()}render(){var e;this._content.textContent!==this._title&&(this._content.textContent=(e=this._title)!==null&&e!==void 0?e:"")}}class Kz{get content(){return this._content}get tab(){return this._tab}constructor(e,n,i,r){this.accessor=e,this.id=n,this.contentComponent=i,this.tabComponent=r,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,r)}init(e){this.content.init(e),this.tab.init(e)}updateParentGroup(e,n){}layout(e,n){var i,r;(r=(i=this.content).layout)===null||r===void 0||r.call(i,e,n)}update(e){var n,i,r,s;(i=(n=this.content).update)===null||i===void 0||i.call(n,e),(s=(r=this.tab).update)===null||s===void 0||s.call(r,e)}dispose(){var e,n,i,r;(n=(e=this.content).dispose)===null||n===void 0||n.call(e),(r=(i=this.tab).dispose)===null||r===void 0||r.call(i)}createContentComponent(e,n){return this.accessor.options.createComponent({id:e,name:n})}createTabComponent(e,n){const i=n??this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const r=this.accessor.options.createTabComponent({id:e,name:i});return r||new xk}console.warn(`dockview: tabComponent '${n}' was not found. falling back to the default tab.`)}return new xk}}class Eoe{constructor(e){this.accessor=e}fromJSON(e,n){var i,r;const s=e.id,a=e.params,o=e.title,l=e.view,u=l?l.content.id:(i=e.contentComponent)!==null&&i!==void 0?i:"unknown",c=l?(r=l.tab)===null||r===void 0?void 0:r.id:e.tabComponent,d=new Kz(this.accessor,s,u,c),h=new zu(s,u,c,this.accessor,new pv(this.accessor),n,d,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return h.init({title:o??s,params:a??{}}),h}}class yoe extends ln{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}class Coe{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter(n=>n!==e),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter(n=>n!==e),this.update()}update(){for(let e=0;e<this._orderedList.length;e++)this._orderedList[e].setAttribute("aria-level",`${e}`),this._orderedList[e].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${e*2})`}}const E_=new Coe;class Sl extends ln{set minimumInViewportWidth(e){this.options.minimumInViewportWidth=e}set minimumInViewportHeight(e){this.options.minimumInViewportHeight=e}get element(){return this._element}get isVisible(){return this._isVisible}constructor(e){super(),this.options=e,this._element=document.createElement("div"),this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new Pe,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),E_.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,rn(this.element,"dv-hidden",!this.isVisible))}bringToFront(){E_.push(this._element)}setBounds(e={}){typeof e.height=="number"&&(this._element.style.height=`${e.height}px`),typeof e.width=="number"&&(this._element.style.width=`${e.width}px`),"top"in e&&typeof e.top=="number"&&(this._element.style.top=`${e.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in e&&typeof e.bottom=="number"&&(this._element.style.bottom=`${e.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in e&&typeof e.left=="number"&&(this._element.style.left=`${e.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in e&&typeof e.right=="number"&&(this._element.style.right=`${e.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const n=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),r=Math.max(0,this.getMinimumWidth(i.width)),s=Math.max(0,this.getMinimumHeight(i.height));if(this.verticalAlignment==="top"){const a=zn(i.top-n.top,-s,Math.max(0,n.height-i.height+s));this._element.style.top=`${a}px`,this._element.style.bottom="auto"}if(this.verticalAlignment==="bottom"){const a=zn(n.bottom-i.bottom,-s,Math.max(0,n.height-i.height+s));this._element.style.bottom=`${a}px`,this._element.style.top="auto"}if(this.horiziontalAlignment==="left"){const a=zn(i.left-n.left,-r,Math.max(0,n.width-i.width+r));this._element.style.left=`${a}px`,this._element.style.right="auto"}if(this.horiziontalAlignment==="right"){const a=zn(n.right-i.right,-r,Math.max(0,n.width-i.width+r));this._element.style.right=`${a}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),n=this._element.getBoundingClientRect(),i={};return this.verticalAlignment==="top"?i.top=parseFloat(this._element.style.top):this.verticalAlignment==="bottom"?i.bottom=parseFloat(this._element.style.bottom):i.top=n.top-e.top,this.horiziontalAlignment==="left"?i.left=parseFloat(this._element.style.left):this.horiziontalAlignment==="right"?i.right=parseFloat(this._element.style.right):i.left=n.left-e.left,i.width=n.width,i.height=n.height,i}setupDrag(e,n={inDragMode:!1}){const i=new Ho,r=()=>{let s=null;const a=fv();i.value=new ln({dispose:()=>{a.release()}},Ca(window,"pointermove",o=>{const l=this.options.container.getBoundingClientRect(),u=o.clientX-l.left,c=o.clientY-l.top;rn(this._element,"dv-resize-container-dragging",!0);const d=this._element.getBoundingClientRect();s===null&&(s={x:o.clientX-d.left,y:o.clientY-d.top});const h=Math.max(0,this.getMinimumWidth(d.width)),f=Math.max(0,this.getMinimumHeight(d.height)),S=zn(c-s.y,-f,Math.max(0,l.height-d.height+f)),_=zn(s.y-c+l.height-d.height,-f,Math.max(0,l.height-d.height+f)),p=zn(u-s.x,-h,Math.max(0,l.width-d.width+h)),v=zn(s.x-u+l.width-d.width,-h,Math.max(0,l.width-d.width+h)),m={};S<=_?m.top=S:m.bottom=_,p<=v?m.left=p:m.right=v,this.setBounds(m)}),Ca(window,"pointerup",()=>{rn(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()}))};this.addDisposables(i,si(e,"pointerdown",s=>{if(s.defaultPrevented){s.preventDefault();return}Tk(s)||r()}),si(this.options.content,"pointerdown",s=>{s.defaultPrevented||Tk(s)||s.shiftKey&&r()}),si(this.options.content,"pointerdown",()=>{E_.push(this._element)},!0)),n.inDragMode&&r()}setupResize(e){const n=document.createElement("div");n.className=`dv-resize-handle-${e}`,this._element.appendChild(n);const i=new Ho;this.addDisposables(i,si(n,"pointerdown",r=>{r.preventDefault();let s=null;const a=fv();i.value=new ln(Ca(window,"pointermove",o=>{const l=this.options.container.getBoundingClientRect(),u=this._element.getBoundingClientRect(),c=o.clientY-l.top,d=o.clientX-l.left;s===null&&(s={originalY:c,originalHeight:u.height,originalX:d,originalWidth:u.width});let h,f,S,_,p,v;const m=()=>{h=zn(c,-Number.MAX_VALUE,s.originalY+s.originalHeight>l.height?this.getMinimumHeight(l.height):Math.max(0,s.originalY+s.originalHeight-Sl.MINIMUM_HEIGHT)),S=s.originalY+s.originalHeight-h,f=l.height-h-S},g=()=>{h=s.originalY-s.originalHeight,S=zn(c-h,h<0&&typeof this.options.minimumInViewportHeight=="number"?-h+this.options.minimumInViewportHeight:Sl.MINIMUM_HEIGHT,Number.MAX_VALUE),f=l.height-h-S},b=()=>{_=zn(d,-Number.MAX_VALUE,s.originalX+s.originalWidth>l.width?this.getMinimumWidth(l.width):Math.max(0,s.originalX+s.originalWidth-Sl.MINIMUM_WIDTH)),v=s.originalX+s.originalWidth-_,p=l.width-_-v},y=()=>{_=s.originalX-s.originalWidth,v=zn(d-_,_<0&&typeof this.options.minimumInViewportWidth=="number"?-_+this.options.minimumInViewportWidth:Sl.MINIMUM_WIDTH,Number.MAX_VALUE),p=l.width-_-v};switch(e){case"top":m();break;case"bottom":g();break;case"left":b();break;case"right":y();break;case"topleft":m(),b();break;case"topright":m(),y();break;case"bottomleft":g(),b();break;case"bottomright":g(),y();break}const E={};h<=f?E.top=h:E.bottom=f,_<=p?E.left=_:E.right=p,E.height=S,E.width=v,this.setBounds(E)}),{dispose:()=>{a.release()}},Ca(window,"pointerup",()=>{i.dispose(),this._onDidChangeEnd.fire()}))}))}getMinimumWidth(e){return typeof this.options.minimumInViewportWidth=="number"?e-this.options.minimumInViewportWidth:0}getMinimumHeight(e){return typeof this.options.minimumInViewportHeight=="number"?e-this.options.minimumInViewportHeight:0}dispose(){E_.destroy(this._element),this._element.remove(),super.dispose()}}Sl.MINIMUM_HEIGHT=20;Sl.MINIMUM_WIDTH=20;class Toe extends ln{constructor(e,n){super(),this.group=e,this.overlay=n,this.addDisposables(n)}position(e){this.overlay.setBounds(e)}}const y_=100,Ja={left:100,top:100,width:300,height:300};function woe(){const t=document.createElement("div");return t.tabIndex=-1,t}class Dk extends ln{constructor(e,n){super(),this.element=e,this.accessor=n,this.map={},this._disposed=!1,this.addDisposables(br.from(()=>{for(const i of Object.values(this.map))i.disposable.dispose(),i.destroy.dispose();this._disposed=!0}))}detatch(e){if(this.map[e.api.id]){const{disposable:n,destroy:i}=this.map[e.api.id];return n.dispose(),i.dispose(),delete this.map[e.api.id],!0}return!1}attach(e){const{panel:n,referenceContainer:i}=e;if(!this.map[n.api.id]){const c=woe();c.className="dv-render-overlay",this.map[n.api.id]={panel:n,disposable:br.NONE,destroy:br.NONE,element:c}}const r=this.map[n.api.id].element;n.view.content.element.parentElement!==r&&r.appendChild(n.view.content.element),r.parentElement!==this.element&&this.element.appendChild(r);const s=()=>{const c=wk(i.element),d=wk(this.element);r.style.left=`${c.left-d.left}px`,r.style.top=`${c.top-d.top}px`,r.style.width=`${c.width}px`,r.style.height=`${c.height}px`,rn(r,"dv-render-overlay-float",n.group.api.location.type==="floating")},a=()=>{n.api.isVisible&&s(),r.style.display=n.api.isVisible?"":"none"},o=new Ho,l=()=>{n.api.location.type==="floating"?queueMicrotask(()=>{const c=this.accessor.floatingGroups.find(S=>S.group===n.api.group);if(!c)return;const d=c.overlay.element,h=()=>{const S=Number(d.getAttribute("aria-level"));r.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${S*2+1})`},f=new MutationObserver(()=>{h()});o.value=br.from(()=>f.disconnect()),f.observe(d,{attributeFilter:["aria-level"],attributes:!0}),h()}):r.style.zIndex=""},u=new ln(o,new zz(r,{onDragEnd:c=>{i.dropTarget.dnd.onDragEnd(c)},onDragEnter:c=>{i.dropTarget.dnd.onDragEnter(c)},onDragLeave:c=>{i.dropTarget.dnd.onDragLeave(c)},onDrop:c=>{i.dropTarget.dnd.onDrop(c)},onDragOver:c=>{i.dropTarget.dnd.onDragOver(c)}}),n.api.onDidVisibilityChange(()=>{a()}),n.api.onDidDimensionsChange(()=>{n.api.isVisible&&s()}),n.api.onDidLocationChange(()=>{l()}));return this.map[n.api.id].destroy=br.from(()=>{var c;n.view.content.element.parentElement===r&&r.removeChild(n.view.content.element),(c=r.parentElement)===null||c===void 0||c.removeChild(r)}),l(),queueMicrotask(()=>{this.isDisposed||a()}),this.map[n.api.id].disposable.dispose(),this.map[n.api.id].disposable=u,r}}var Roe=function(t,e,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(c){try{u(i.next(c))}catch(d){a(d)}}function l(c){try{u(i.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):r(c.value).then(o,l)}u((i=i.apply(t,e||[])).next())})};class Aoe extends ln{get window(){var e,n;return(n=(e=this._window)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:null}constructor(e,n,i){super(),this.target=e,this.className=n,this.options=i,this._onWillClose=new Pe,this.onWillClose=this._onWillClose.event,this._onDidClose=new Pe,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const e=this._window.value.screenX,n=this._window.value.screenY,i=this._window.value.innerWidth,r=this._window.value.innerHeight;return{top:n,left:e,width:i,height:r}}close(){var e,n;this._window&&(this._onWillClose.fire(),(n=(e=this.options).onWillClose)===null||n===void 0||n.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var e,n;return Roe(this,void 0,void 0,function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,r=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map(([l,u])=>`${l}=${u}`).join(","),s=window.open(i,this.target,r);if(!s)return null;const a=new ln;this._window={value:s,disposable:a},a.addDisposables(br.from(()=>{s.close()}),Ca(window,"beforeunload",()=>{this.close()}));const o=this.createPopoutWindowContainer();return this.className&&o.classList.add(this.className),(n=(e=this.options).onDidOpen)===null||n===void 0||n.call(e,{id:this.target,window:s}),new Promise((l,u)=>{s.addEventListener("unload",c=>{}),s.addEventListener("load",()=>{try{const c=s.document;c.title=document.title,c.body.appendChild(o),Ise(c,window.document.styleSheets),Ca(s,"beforeunload",()=>{this.close()}),l(o)}catch(c){u(c)}})})})}createPopoutWindowContainer(){const e=document.createElement("div");return e.classList.add("dv-popout-window"),e.id="dv-popout-window",e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e}}class Ooe extends ln{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,n=new Set;this.addDisposables(this.accessor.onDidAddPanel(i=>{if(e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);e.add(i.api.id)}),this.accessor.onDidRemovePanel(i=>{if(e.has(i.api.id))e.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`)}),this.accessor.onDidAddGroup(i=>{if(n.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${i.api.id} but group already exists`);n.add(i.api.id)}),this.accessor.onDidRemoveGroup(i=>{if(n.has(i.api.id))n.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${i.api.id} but group does not exists`)}))}}const kk={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function OE(t){const e=t.from.activePanel;[...t.from.panels].map(i=>{const r=t.from.model.removePanel(i);return t.from.model.renderContainer.detatch(i),r}).forEach(i=>{t.to.model.openPanel(i,{skipSetActive:e!==i,skipSetGroupActive:!0})})}class Ioe extends qse{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap(e=>e.panels)}get options(){return this._options}get activePanel(){const e=this.activeGroup;if(e)return e.activePanel}get renderer(){var e;return(e=this.options.defaultRenderer)!==null&&e!==void 0?e:"onlyWhenVisible"}get api(){return this._api}get gap(){return this.gridview.margin}get floatingGroups(){return this._floatingGroups}constructor(e,n){var i;super(e,{proportionalLayout:!0,orientation:Pt.HORIZONTAL,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,locked:n.locked,margin:n.gap,className:n.className}),this.nextGroupId=Hz(),this._deserializer=new Eoe(this),this.watermark=null,this._onWillDragPanel=new Pe,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new Pe,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new Pe,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new Pe,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new Pe,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new Pe,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new Pe,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidLayoutFromJSON=new Pe,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new Pe,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new Pe,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._onDidRemoveGroup=new Pe,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new Pe,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new Pe,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this.overlayRenderContainer=new Dk(this.gridview.element,this),rn(this.gridview.element,"dv-dockview",!0),rn(this.element,"dv-debug",!!n.debug),n.debug&&this.addDisposables(new Ooe(this)),this.addDisposables(this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.updateWatermark()}),this.onDidAdd(r=>{this._moving||this._onDidAddGroup.fire(r)}),this.onDidRemove(r=>{this._moving||this._onDidRemoveGroup.fire(r)}),this.onDidActiveChange(r=>{this._moving||this._onDidActiveGroupChange.fire(r)}),this.onDidMaximizedChange(r=>{this._onDidMaximizedGroupChange.fire({group:r.panel,isMaximized:r.isMaximized})}),Vc.any(this.onDidAdd,this.onDidRemove)(()=>{this.updateWatermark()}),Vc.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange)(()=>{this._bufferOnDidLayoutChange.fire()}),br.from(()=>{for(const r of[...this._floatingGroups])r.dispose();for(const r of[...this._popoutGroups])r.disposable.dispose()})),this._options=n,this._rootDropTarget=new Ml(this.element,{canDisplayOverlay:(r,s)=>{const a=tr();if(a)return a.viewId!==this.id?!1:s==="center"?this.gridview.length===0:!0;if(s==="center"&&this.gridview.length!==0)return!1;const o=new Yz(r,"edge",s,tr);return this._onUnhandledDragOverEvent.fire(o),o.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:(i=this.options.rootOverlayModel)!==null&&i!==void 0?i:kk}),this.addDisposables(this._rootDropTarget,this._rootDropTarget.onWillShowOverlay(r=>{this.gridview.length>0&&r.position==="center"||this._onWillShowOverlay.fire(new _v(r,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:tr}))}),this._rootDropTarget.onDrop(r=>{var s;const a=new Wz({nativeEvent:r.nativeEvent,position:r.position,panel:void 0,api:this._api,group:void 0,getData:tr,kind:"edge"});if(this._onWillDrop.fire(a),a.defaultPrevented)return;const o=tr();o?this.moveGroupOrPanel({from:{groupId:o.groupId,panelId:(s=o.panelId)!==null&&s!==void 0?s:void 0},to:{group:this.orthogonalize(r.position),position:"center"}}):this._onDidDrop.fire(new SN({nativeEvent:r.nativeEvent,position:r.position,panel:void 0,api:this._api,group:void 0,getData:tr}))}),this._rootDropTarget),this._api=new pv(this),this.updateWatermark()}setVisible(e,n){switch(e.api.location.type){case"grid":super.setVisible(e,n);break;case"floating":{const i=this.floatingGroups.find(r=>r.group===e);i&&(i.overlay.setVisible(n),e.api._onDidVisibilityChange.fire({isVisible:n}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window");break}}addPopoutGroup(e,n){var i,r,s,a,o;if(e instanceof zu&&e.group.size===1)return this.addPopoutGroup(e.group,n);const l=Dse(this.gridview.element),u=this.element;function c(){return n!=null&&n.position?n.position:e instanceof Nk?e.element.getBoundingClientRect():e.group?e.group.element.getBoundingClientRect():u.getBoundingClientRect()}const d=c(),h=(r=(i=n==null?void 0:n.overridePopoutGroup)===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:this.getNextGroupId(),f=new Aoe(`${this.id}-${h}`,l??"",{url:(o=(s=n==null?void 0:n.popoutUrl)!==null&&s!==void 0?s:(a=this.options)===null||a===void 0?void 0:a.popoutUrl)!==null&&o!==void 0?o:"/popout.html",left:window.screenX+d.left,top:window.screenY+d.top,width:d.width,height:d.height,onDidOpen:n==null?void 0:n.onDidOpen,onWillClose:n==null?void 0:n.onWillClose}),S=new ln(f,f.onDidClose(()=>{S.dispose()}));return f.open().then(_=>{var p;if(f.isDisposed)return!1;if(_===null)return S.dispose(),!1;const v=document.createElement("div");v.className="dv-overlay-render-container";const m=new Dk(v,this),g=e instanceof zu?e.group:e,b=e.api.location.type,y=g.element.parentElement!==null;let E;y?n!=null&&n.overridePopoutGroup?E=n.overridePopoutGroup:(E=this.createGroup({id:h}),this._onDidAddGroup.fire(E)):E=g,E.model.renderContainer=m,E.layout(f.window.innerWidth,f.window.innerHeight);let T;if(!(n!=null&&n.overridePopoutGroup)&&y)if(e instanceof zu)this.movingLock(()=>{const I=g.model.removePanel(e);E.model.openPanel(I)});else switch(this.movingLock(()=>OE({from:g,to:E})),b){case"grid":g.api.setVisible(!1);break;case"floating":case"popout":T=(p=this._floatingGroups.find(I=>I.group.api.id===e.api.id))===null||p===void 0?void 0:p.overlay.toJSON(),this.removeGroup(g);break}_.classList.add("dv-dockview"),_.style.overflow="hidden",_.appendChild(v),_.appendChild(E.element),E.model.location={type:"popout",getWindow:()=>f.window,popoutUrl:n==null?void 0:n.popoutUrl},y&&e.api.location.type==="grid"&&e.api.setVisible(!1),this.doSetGroupAndPanelActive(E),S.addDisposables(E.api.onDidActiveChange(I=>{var A;I.isActive&&((A=f.window)===null||A===void 0||A.focus())}),E.api.onWillFocus(()=>{var I;(I=f.window)===null||I===void 0||I.focus()}));let C;const w=y&&g&&this.getPanel(g.id),R={window:f,popoutGroup:E,referenceGroup:w?g.id:void 0,disposable:{dispose:()=>(S.dispose(),C)}};return S.addDisposables(Ca(f.window,"resize",()=>{E.layout(f.window.innerWidth,f.window.innerHeight)}),m,br.from(()=>{y&&this.getPanel(g.id)?(this.movingLock(()=>OE({from:E,to:g})),g.api.isVisible||g.api.setVisible(!0),this.getPanel(E.id)&&this.doRemoveGroup(E,{skipPopoutAssociated:!0})):this.getPanel(E.id)&&(E.model.renderContainer=this.overlayRenderContainer,C=E,T?this.addFloatingGroup(E,{height:T.height,width:T.width,position:T}):(this.doRemoveGroup(E,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),E.model.location={type:"grid"},this.movingLock(()=>{this.doAddGroup(E,[0])})),this.doSetGroupAndPanelActive(E))})),this._popoutGroups.push(R),this.updateWatermark(),!0}).catch(_=>(console.error("dockview: failed to create popout window",_),!1))}addFloatingGroup(e,n){var i,r,s,a,o;let l;if(e instanceof zu)l=this.createGroup(),this._onDidAddGroup.fire(l),this.movingLock(()=>this.removePanel(e,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0})),this.movingLock(()=>l.model.openPanel(e,{skipSetGroupActive:!0}));else{l=e;const _=(i=this._popoutGroups.find(m=>m.popoutGroup===l))===null||i===void 0?void 0:i.referenceGroup,p=_?this.getPanel(_):void 0;typeof(n==null?void 0:n.skipRemoveGroup)=="boolean"&&n.skipRemoveGroup||(p?(this.movingLock(()=>OE({from:e,to:p})),this.doRemoveGroup(e,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(p,{skipDispose:!0}),l=p):this.doRemoveGroup(e,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}function u(){if(n!=null&&n.position){const _={};return"left"in n.position?_.left=Math.max(n.position.left,0):"right"in n.position?_.right=Math.max(n.position.right,0):_.left=Ja.left,"top"in n.position?_.top=Math.max(n.position.top,0):"bottom"in n.position?_.bottom=Math.max(n.position.bottom,0):_.top=Ja.top,typeof n.width=="number"?_.width=Math.max(n.width,0):_.width=Ja.width,typeof n.height=="number"?_.height=Math.max(n.height,0):_.height=Ja.height,_}return{left:typeof(n==null?void 0:n.x)=="number"?Math.max(n.x,0):Ja.left,top:typeof(n==null?void 0:n.y)=="number"?Math.max(n.y,0):Ja.top,width:typeof(n==null?void 0:n.width)=="number"?Math.max(n.width,0):Ja.width,height:typeof(n==null?void 0:n.height)=="number"?Math.max(n.height,0):Ja.height}}const c=u(),d=new Sl(Object.assign(Object.assign({container:this.gridview.element,content:l.element},c),{minimumInViewportWidth:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(s=(r=this.options.floatingGroupBounds)===null||r===void 0?void 0:r.minimumWidthWithinViewport)!==null&&s!==void 0?s:y_,minimumInViewportHeight:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(o=(a=this.options.floatingGroupBounds)===null||a===void 0?void 0:a.minimumHeightWithinViewport)!==null&&o!==void 0?o:y_})),h=l.element.querySelector(".dv-void-container");if(!h)throw new Error("failed to find drag handle");d.setupDrag(h,{inDragMode:typeof(n==null?void 0:n.inDragMode)=="boolean"?n.inDragMode:!1});const f=new Toe(l,d),S=new ln(l.api.onDidActiveChange(_=>{_.isActive&&d.bringToFront()}),Fz(l.element,_=>{const{width:p,height:v}=_.contentRect;l.layout(p,v)}));f.addDisposables(d.onDidChange(()=>{l.layout(l.width,l.height)}),d.onDidChangeEnd(()=>{this._bufferOnDidLayoutChange.fire()}),l.onDidChange(_=>{d.setBounds({height:_==null?void 0:_.height,width:_==null?void 0:_.width})}),{dispose:()=>{S.dispose(),AE(this._floatingGroups,f),l.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(f),l.model.location={type:"floating"},n!=null&&n.skipActiveGroup||this.doSetGroupAndPanelActive(l),this.updateWatermark()}orthogonalize(e){switch(e){case"top":case"bottom":this.gridview.orientation===Pt.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===Pt.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break}switch(e){case"top":case"left":case"center":return this.createGroupAtLocation([0]);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length]);default:throw new Error(`unsupported position ${e}`)}}updateOptions(e){var n,i,r,s;if(super.updateOptions(e),"floatingGroupBounds"in e)for(const a of this._floatingGroups){switch(e.floatingGroupBounds){case"boundedWithinViewport":a.overlay.minimumInViewportHeight=void 0,a.overlay.minimumInViewportWidth=void 0;break;case void 0:a.overlay.minimumInViewportHeight=y_,a.overlay.minimumInViewportWidth=y_;break;default:a.overlay.minimumInViewportHeight=(n=e.floatingGroupBounds)===null||n===void 0?void 0:n.minimumHeightWithinViewport,a.overlay.minimumInViewportWidth=(i=e.floatingGroupBounds)===null||i===void 0?void 0:i.minimumWidthWithinViewport}a.overlay.setBounds()}"rootOverlayModel"in e&&this._rootDropTarget.setOverlayModel((r=e.rootOverlayModel)!==null&&r!==void 0?r:kk),"gap"in e&&(this.gridview.margin=(s=e.gap)!==null&&s!==void 0?s:0),this._options=Object.assign(Object.assign({},this.options),e),this.layout(this.gridview.width,this.gridview.height,!0)}layout(e,n,i){if(super.layout(e,n,i),this._floatingGroups)for(const r of this._floatingGroups)r.overlay.setBounds()}focus(){var e;(e=this.activeGroup)===null||e===void 0||e.focus()}getGroupPanel(e){return this.panels.find(n=>n.id===e)}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var n;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[e.group.panels.length-1]){e.group.model.moveToNext({suppressRoll:!0});return}const i=Vi(e.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupAndPanelActive(r)}moveToPrevious(e={}){var n;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[0]){e.group.model.moveToPrevious({suppressRoll:!0});return}const i=Vi(e.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;r&&this.doSetGroupAndPanelActive(r)}toJSON(){var e;const n=this.gridview.serialize(),i=this.panels.reduce((o,l)=>(o[l.id]=l.toJSON(),o),{}),r=this._floatingGroups.map(o=>({data:o.group.toJSON(),position:o.overlay.toJSON()})),s=this._popoutGroups.map(o=>({data:o.popoutGroup.toJSON(),gridReferenceGroup:o.referenceGroup,position:o.window.dimensions(),url:o.popoutGroup.api.location.type==="popout"?o.popoutGroup.api.location.popoutUrl:void 0})),a={grid:n,panels:i,activeGroup:(e=this.activeGroup)===null||e===void 0?void 0:e.id};return r.length>0&&(a.floatingGroups=r),s.length>0&&(a.popoutGroups=s),a}fromJSON(e){var n,i,r;if(this.clear(),typeof e!="object"||e===null)throw new Error("serialized layout must be a non-null object");const{grid:s,panels:a,activeGroup:o}=e;if(s.root.type!=="branch"||!Array.isArray(s.root.data))throw new Error("root must be of type branch");try{const l=this.width,u=this.height,c=f=>{const{id:S,locked:_,hideHeader:p,views:v,activeView:m}=f;if(typeof S!="string")throw new Error("group id must be of type string");const g=this.createGroup({id:S,locked:!!_,hideHeader:!!p});this._onDidAddGroup.fire(g);const b=[];for(const y of v){const E=this._deserializer.fromJSON(a[y],g);b.push(E)}for(let y=0;y<v.length;y++){const E=b[y],T=typeof m=="string"&&m===E.id;g.model.openPanel(E,{skipSetActive:!T,skipSetGroupActive:!0})}return!g.activePanel&&g.panels.length>0&&g.model.openPanel(g.panels[g.panels.length-1],{skipSetGroupActive:!0}),g};this.gridview.deserialize(s,{fromJSON:f=>c(f.data)}),this.layout(l,u,!0);const d=(n=e.floatingGroups)!==null&&n!==void 0?n:[];for(const f of d){const{data:S,position:_}=f,p=c(S);this.addFloatingGroup(p,{position:_,width:_.width,height:_.height,skipRemoveGroup:!0,inDragMode:!1})}const h=(i=e.popoutGroups)!==null&&i!==void 0?i:[];for(const f of h){const{data:S,position:_,gridReferenceGroup:p,url:v}=f,m=c(S);this.addPopoutGroup((r=p?this.getPanel(p):void 0)!==null&&r!==void 0?r:m,{position:_??void 0,overridePopoutGroup:p?m:void 0,popoutUrl:v})}for(const f of this._floatingGroups)f.overlay.setBounds();if(typeof o=="string"){const f=this.getPanel(o);f&&this.doSetGroupAndPanelActive(f)}}catch(l){console.error("dockview: failed to deserialize layout. Reverting changes",l);for(const u of this.groups)for(const c of u.panels)this.removePanel(c,{removeEmptyGroup:!1,skipDispose:!1});for(const u of this.groups)u.dispose(),this._groups.delete(u.id),this._onDidRemoveGroup.fire(u);for(const u of[...this._floatingGroups])u.dispose();throw this.clear(),l}this.updateWatermark(),this._onDidLayoutFromJSON.fire()}clear(){const e=Array.from(this._groups.values()).map(i=>i.value),n=!!this.activeGroup;for(const i of e)this.removeGroup(i,{skipActive:!0});n&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[n,i]=e;i.value.model.closeAllPanels()}}addPanel(e){var n,i;if(this.panels.find(l=>l.id===e.id))throw new Error(`panel with id ${e.id} already exists`);let r;if(e.position&&e.floating)throw new Error("you can only provide one of: position, floating as arguments to .addPanel(...)");const s={width:e.initialWidth,height:e.initialHeight};let a;if(e.position)if(coe(e.position)){const l=typeof e.position.referencePanel=="string"?this.getGroupPanel(e.position.referencePanel):e.position.referencePanel;if(a=e.position.index,!l)throw new Error(`referencePanel '${e.position.referencePanel}' does not exist`);r=this.findGroup(l)}else if(uoe(e.position)){if(r=typeof e.position.referenceGroup=="string"?(n=this._groups.get(e.position.referenceGroup))===null||n===void 0?void 0:n.value:e.position.referenceGroup,a=e.position.index,!r)throw new Error(`referenceGroup '${e.position.referenceGroup}' does not exist`)}else{const l=this.orthogonalize(Ok(e.position.direction)),u=this.createPanel(e,l);return l.model.openPanel(u,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(l),l.api.setSize({height:s==null?void 0:s.height,width:s==null?void 0:s.width}),u}else r=this.activeGroup;let o;if(r){const l=Ak(((i=e.position)===null||i===void 0?void 0:i.direction)||"within");if(e.floating){const u=this.createGroup();this._onDidAddGroup.fire(u);const c=typeof e.floating=="object"&&e.floating!==null?e.floating:{};this.addFloatingGroup(u,Object.assign(Object.assign({},c),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),o=this.createPanel(e,u),u.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a})}else if(r.api.location.type==="floating"||l==="center")o=this.createPanel(e,r),r.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),r.api.setSize({width:s==null?void 0:s.width,height:s==null?void 0:s.height}),e.inactive||this.doSetGroupAndPanelActive(r);else{const u=Vi(r.element),c=Pu(this.gridview.orientation,u,l),d=this.createGroupAtLocation(c,this.orientationAtLocation(c)===Pt.VERTICAL?s==null?void 0:s.height:s==null?void 0:s.width);o=this.createPanel(e,d),d.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(d)}}else if(e.floating){const l=this.createGroup();this._onDidAddGroup.fire(l);const u=typeof e.floating=="object"&&e.floating!==null?e.floating:{};this.addFloatingGroup(l,Object.assign(Object.assign({},u),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),o=this.createPanel(e,l),l.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a})}else{const l=this.createGroupAtLocation([0],this.gridview.orientation===Pt.VERTICAL?s==null?void 0:s.height:s==null?void 0:s.width);o=this.createPanel(e,l),l.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(l)}return o}removePanel(e,n={removeEmptyGroup:!0}){const i=e.group;if(!i)throw new Error(`cannot remove panel ${e.id}. it's missing a group.`);i.model.removePanel(e,{skipSetActiveGroup:n.skipSetActiveGroup}),n.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),i.size===0&&n.removeEmptyGroup&&this.removeGroup(i,{skipActive:n.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new yoe}updateWatermark(){var e,n;if(this.groups.filter(i=>i.api.location.type==="grid"&&i.api.isVisible).length===0){if(!this.watermark){this.watermark=this.createWatermarkComponent(),this.watermark.init({containerApi:new pv(this)});const i=document.createElement("div");i.className="dv-watermark-container",xse(i,"watermark-component"),i.appendChild(this.watermark.element),this.gridview.element.appendChild(i)}}else this.watermark&&(this.watermark.element.parentElement.remove(),(n=(e=this.watermark).dispose)===null||n===void 0||n.call(e),this.watermark=null)}addGroup(e){var n;if(e){let i;if(doe(e)){const u=typeof e.referencePanel=="string"?this.panels.find(c=>c.id===e.referencePanel):e.referencePanel;if(!u)throw new Error(`reference panel ${e.referencePanel} does not exist`);if(i=this.findGroup(u),!i)throw new Error(`reference group for reference panel ${e.referencePanel} does not exist`)}else if(hoe(e)){if(i=typeof e.referenceGroup=="string"?(n=this._groups.get(e.referenceGroup))===null||n===void 0?void 0:n.value:e.referenceGroup,!i)throw new Error(`reference group ${e.referenceGroup} does not exist`)}else{const u=this.orthogonalize(Ok(e.direction));return e.skipSetActive||this.doSetGroupAndPanelActive(u),u}const r=Ak(e.direction||"within"),s=Vi(i.element),a=Pu(this.gridview.orientation,s,r),o=this.createGroup(e),l=this.getLocationOrientation(a)===Pt.VERTICAL?e.initialHeight:e.initialWidth;return this.doAddGroup(o,a,l),e.skipSetActive||this.doSetGroupAndPanelActive(o),o}else{const i=this.createGroup(e);return this.doAddGroup(i),this.doSetGroupAndPanelActive(i),i}}getLocationOrientation(e){return e.length%2==0&&this.gridview.orientation===Pt.HORIZONTAL?Pt.HORIZONTAL:Pt.VERTICAL}removeGroup(e,n){this.doRemoveGroup(e,n)}doRemoveGroup(e,n){var i;const r=[...e.panels];if(!(n!=null&&n.skipDispose))for(const o of r)this.removePanel(o,{removeEmptyGroup:!1,skipDispose:(i=n==null?void 0:n.skipDispose)!==null&&i!==void 0?i:!1});const s=this.activePanel;if(e.api.location.type==="floating"){const o=this._floatingGroups.find(l=>l.group===e);if(o){if(n!=null&&n.skipDispose||(o.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),AE(this._floatingGroups,o),o.dispose(),!(n!=null&&n.skipActive)&&this._activeGroup===e){const l=Array.from(this._groups.values());this.doSetGroupAndPanelActive(l.length>0?l[0].value:void 0)}return o.group}throw new Error("failed to find floating group")}if(e.api.location.type==="popout"){const o=this._popoutGroups.find(l=>l.popoutGroup===e);if(o){if(!(n!=null&&n.skipDispose)){if(!(n!=null&&n.skipPopoutAssociated)){const u=o.referenceGroup?this.getPanel(o.referenceGroup):void 0;u&&u.panels.length===0&&this.removeGroup(u)}o.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}AE(this._popoutGroups,o);const l=o.disposable.dispose();if(!(n!=null&&n.skipPopoutReturn)&&l&&(this.doAddGroup(l,[0]),this.doSetGroupAndPanelActive(l)),!(n!=null&&n.skipActive)&&this._activeGroup===e){const u=Array.from(this._groups.values());this.doSetGroupAndPanelActive(u.length>0?u[0].value:void 0)}return this.updateWatermark(),o.popoutGroup}throw new Error("failed to find popout group")}const a=super.doRemoveGroup(e,n);return n!=null&&n.skipActive||this.activePanel!==s&&this._onDidActivePanelChange.fire(this.activePanel),a}movingLock(e){const n=this._moving;try{return this._moving=!0,e()}finally{this._moving=n}}moveGroupOrPanel(e){var n;const i=e.to.group,r=e.from.groupId,s=e.from.panelId,a=e.to.position,o=e.to.index,l=r?(n=this._groups.get(r))===null||n===void 0?void 0:n.value:void 0;if(!l)throw new Error(`Failed to find group id ${r}`);if(s===void 0){this.moveGroup({from:{group:l},to:{group:i,position:a}});return}if(!a||a==="center"){const u=this.movingLock(()=>l.model.removePanel(s,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!u)throw new Error(`No panel with id ${s}`);l.model.size===0&&this.doRemoveGroup(l,{skipActive:!0}),this.movingLock(()=>i.model.openPanel(u,{index:o,skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:u,from:l})}else{const u=Vi(i.element),c=Pu(this.gridview.orientation,u,a);if(l.size<2){const[d,h]=kc(c);if(l.api.location.type==="grid"){const p=Vi(l.element),[v,m]=kc(p);if(Lse(v,d)){this.gridview.moveView(v,m,h),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l});return}}if(l.api.location.type==="popout"){const p=this._popoutGroups.find(g=>g.popoutGroup===l),v=this.movingLock(()=>p.popoutGroup.model.removePanel(p.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0}));this.doRemoveGroup(l,{skipActive:!0});const m=this.createGroupAtLocation(c);this.movingLock(()=>m.model.openPanel(v)),this.doSetGroupAndPanelActive(m),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l});return}const f=this.movingLock(()=>this.doRemoveGroup(l,{skipActive:!0,skipDispose:!0})),S=Vi(i.element),_=Pu(this.gridview.orientation,S,a);this.movingLock(()=>this.doAddGroup(f,_)),this.doSetGroupAndPanelActive(f),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l})}else{const d=this.movingLock(()=>l.model.removePanel(s,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!d)throw new Error(`No panel with id ${s}`);const h=Pu(this.gridview.orientation,u,a),f=this.createGroupAtLocation(h);this.movingLock(()=>f.model.openPanel(d,{skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(f),this._onDidMovePanel.fire({panel:d,from:l})}}}moveGroup(e){const n=e.from.group,i=e.to.group,r=e.to.position;if(r==="center"){const s=n.activePanel,a=this.movingLock(()=>[...n.panels].map(o=>n.model.removePanel(o.id,{skipSetActive:!0})));(n==null?void 0:n.model.size)===0&&this.doRemoveGroup(n,{skipActive:!0}),this.movingLock(()=>{for(const o of a)i.model.openPanel(o,{skipSetActive:o!==s,skipSetGroupActive:!0})}),this.doSetGroupAndPanelActive(i)}else{switch(n.api.location.type){case"grid":this.gridview.removeView(Vi(n.element));break;case"floating":{const l=this._floatingGroups.find(u=>u.group===n);if(!l)throw new Error("failed to find floating group");l.dispose();break}case"popout":{const l=this._popoutGroups.find(u=>u.popoutGroup===n);if(!l)throw new Error("failed to find popout group");l.disposable.dispose()}}const s=Vi(i.element),a=Pu(this.gridview.orientation,s,r);let o;switch(this.gridview.orientation){case Pt.VERTICAL:o=s.length%2==0?n.api.width:n.api.height;break;case Pt.HORIZONTAL:o=s.length%2==0?n.api.height:n.api.width;break}this.gridview.addView(n,o,a)}n.panels.forEach(s=>{this._onDidMovePanel.fire({panel:s,from:n})})}doSetGroupActive(e){super.doSetGroupActive(e);const n=this.activePanel;!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const n=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(e){e||(e={});let n=e==null?void 0:e.id;if(n&&this._groups.has(e.id)&&(console.warn(`dockview: Duplicate group id ${e==null?void 0:e.id}. reassigning group id to avoid errors`),n=void 0),!n)for(n=this.nextGroupId.next();this._groups.has(n);)n=this.nextGroupId.next();const i=new Nk(this,n,e);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const r=new ln(i.model.onTabDragStart(s=>{this._onWillDragPanel.fire(s)}),i.model.onGroupDragStart(s=>{this._onWillDragGroup.fire(s)}),i.model.onMove(s=>{const{groupId:a,itemId:o,target:l,index:u}=s;this.moveGroupOrPanel({from:{groupId:a,panelId:o},to:{group:i,position:l,index:u}})}),i.model.onDidDrop(s=>{this._onDidDrop.fire(s)}),i.model.onWillDrop(s=>{this._onWillDrop.fire(s)}),i.model.onWillShowOverlay(s=>{if(this.options.disableDnd){s.preventDefault();return}this._onWillShowOverlay.fire(s)}),i.model.onUnhandledDragOverEvent(s=>{this._onUnhandledDragOverEvent.fire(s)}),i.model.onDidAddPanel(s=>{this._moving||this._onDidAddPanel.fire(s.panel)}),i.model.onDidRemovePanel(s=>{this._moving||this._onDidRemovePanel.fire(s.panel)}),i.model.onDidActivePanelChange(s=>{this._moving||s.panel===this.activePanel&&this._onDidActivePanelChange.value!==s.panel&&this._onDidActivePanelChange.fire(s.panel)}),Vc.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)(()=>{this._bufferOnDidLayoutChange.fire()}));this._groups.set(i.id,{value:i,disposable:r})}return i.initialize(),i}createPanel(e,n){var i,r,s;const a=e.component,o=(i=e.tabComponent)!==null&&i!==void 0?i:this.options.defaultTabComponent,l=new Kz(this,e.id,a,o),u=new zu(e.id,a,o,this,this._api,n,l,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return u.init({title:(r=e.title)!==null&&r!==void 0?r:e.id,params:(s=e==null?void 0:e.params)!==null&&s!==void 0?s:{}}),u}createGroupAtLocation(e,n){const i=this.createGroup();return this.doAddGroup(i,e,n),i}findGroup(e){var n;return(n=Array.from(this._groups.values()).find(i=>i.value.model.containsPanel(e)))===null||n===void 0?void 0:n.value}orientationAtLocation(e){const n=this.gridview.orientation;return e.length%2==1?n:Ro(n)}}function Noe(t,e){return new Ioe(t,e).api}var xoe=Object.defineProperty,Doe=(t,e,n)=>e in t?xoe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ad=(t,e,n)=>(Doe(t,typeof e!="symbol"?e+"":e,n),n);function bc(t,e){var n,i;let r=t,s=null;for(;!s&&r;)s=(n=r.components)==null?void 0:n[e],r=r.parent;if(s||(s=(i=t.appContext.components)==null?void 0:i[e]),!s)throw new Error(`Failed to find Vue Component '${e}'`);return s}function EN(t,e,n,i){let r=W(t,Object.freeze(n));r.appContext=e.appContext,r.appContext.provides={...r.appContext.provides?r.appContext.provides:{},...e.provides?e.provides:{}},fE(r,i);let s=n;return{update:a=>{s={...n,...a},r=Go(r,s),fE(r,i)},dispose:()=>{fE(null,i)}}}class yN{constructor(e,n){ad(this,"_element"),this.component=e,this.parent=n,this._element=document.createElement("div"),this.element.className="dv-vue-part",this.element.style.height="100%",this.element.style.width="100%"}get element(){return this._element}}class Mk extends yN{constructor(){super(...arguments),ad(this,"_renderDisposable"),ad(this,"_api"),ad(this,"_containerApi")}init(e){var n;this._api=e.api,this._containerApi=e.containerApi;const i={params:e.params,api:e.api,containerApi:e.containerApi};(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:i},this.element)}update(e){var n;if(!this._api||!this._containerApi)return;const i=e.params;(n=this._renderDisposable)==null||n.update({params:{params:i,api:this._api,containerApi:this._containerApi}})}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}class koe extends yN{constructor(){super(...arguments),ad(this,"_renderDisposable")}get element(){return this._element}init(e){var n;const i={group:e.group,containerApi:e.containerApi};(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:i},this.element)}update(e){}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}class IE extends yN{constructor(e,n,i){super(e,n),ad(this,"_renderDisposable")}get element(){return this._element}init(e){var n;(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:e},this.element)}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}const Moe=Qe({__name:"dockview",props:{disableAutoResizing:{type:Boolean},hideBorders:{type:Boolean},singleTabMode:{},disableFloatingGroups:{type:Boolean},floatingGroupBounds:{},popoutUrl:{},defaultRenderer:{},debug:{type:Boolean},rootOverlayModel:{},locked:{type:Boolean},disableDnd:{type:Boolean},className:{},gap:{},noPanelsOverlay:{},watermarkComponent:{},defaultTabComponent:{},rightHeaderActionsComponent:{},leftHeaderActionsComponent:{},prefixHeaderActionsComponent:{}},emits:["ready"],setup(t,{emit:e}){function n(o){return Ik.reduce((u,c)=>(u[c]=o[c],u),{})}const i=e,r=t,s=ve(null),a=ve(null);return Ik.forEach(o=>{Ie(()=>r[o],(l,u)=>{a.value&&a.value.updateOptions({[o]:l})})}),ai(()=>{if(!s.value)throw new Error("dockview-vue: element is not mounted");const o=_i();if(!o)throw new Error("dockview-vue: getCurrentInstance() returned null");const l={createComponent(h){const f=bc(o,h.name);return new Mk(f,o)},createTabComponent(h){let f=bc(o,h.name);if(!f&&r.defaultTabComponent&&(f=bc(o,r.defaultTabComponent)),f)return new Mk(f,o)},createWatermarkComponent:r.watermarkComponent?()=>{const h=bc(o,r.watermarkComponent);return new koe(h,o)}:void 0,createLeftHeaderActionComponent:r.leftHeaderActionsComponent?h=>{const f=bc(o,r.leftHeaderActionsComponent);return new IE(f,o,h)}:void 0,createPrefixHeaderActionComponent:r.prefixHeaderActionsComponent?h=>{const f=bc(o,r.prefixHeaderActionsComponent);return new IE(f,o,h)}:void 0,createRightHeaderActionComponent:r.rightHeaderActionsComponent?h=>{const f=bc(o,r.rightHeaderActionsComponent);return new IE(f,o,h)}:void 0},u=Noe(s.value,{...n(r),...l}),{clientWidth:c,clientHeight:d}=s.value;u.layout(c,d),a.value=ys(u),i("ready",{api:u})}),Yi(()=>{a.value&&a.value.dispose()}),(o,l)=>(_e(),Ge("div",{ref_key:"el",ref:s},null,512))}});function CN(t){return aN(()=>{const e=[],n={};if(t.value.background)if(wA(t.value.background)){if(n.backgroundColor=t.value.background,!t.value.text&&rne(t.value.background)){const i=xo(t.value.background);if(i.a==null||i.a===1){const r=oz(i);n.color=r,n.caretColor=r}}}else e.push(`bg-${t.value.background}`);return t.value.text&&(wA(t.value.text)?(n.color=t.value.text,n.caretColor=t.value.text):e.push(`text-${t.value.text}`)),{colorClasses:e,colorStyles:n}})}function Xs(t,e){const n=te(()=>({text:Lt(t)?t.value:e?t[e]:null})),{colorClasses:i,colorStyles:r}=CN(n);return{textColorClasses:i,textColorStyles:r}}function Il(t,e){const n=te(()=>({background:Lt(t)?t.value:e?t[e]:null})),{colorClasses:i,colorStyles:r}=CN(n);return{backgroundColorClasses:i,backgroundColorStyles:r}}const Loe=["x-small","small","default","large","x-large"],Np=Ue({size:{type:[String,Number],default:"default"}},"size");function xp(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return aN(()=>{let n,i;return tv(Loe,t.size)?n=`${e}--size-${t.size}`:t.size&&(i={width:Ht(t.size),height:Ht(t.size)}),{sizeClasses:n,sizeStyles:i}})}const Ri=Ue({tag:{type:String,default:"div"}},"tag"),Poe=Ue({color:String,disabled:Boolean,start:Boolean,end:Boolean,icon:on,...jt(),...Np(),...Ri({tag:"i"}),...$i()},"VIcon"),Ot=vt()({name:"VIcon",props:Poe(),setup(t,e){let{attrs:n,slots:i}=e;const r=ve(),{themeClasses:s}=cr(t),{iconData:a}=yne(te(()=>r.value||t.icon)),{sizeClasses:o}=xp(t),{textColorClasses:l,textColorStyles:u}=Xs(Ve(t,"color"));return Ft(()=>{var h,f;const c=(h=i.default)==null?void 0:h.call(i);c&&(r.value=(f=Q3(c).filter(S=>S.type===Rl&&S.children&&typeof S.children=="string")[0])==null?void 0:f.children);const d=!!(n.onClick||n.onClickOnce);return W(a.value.component,{tag:t.tag,icon:a.value.icon,class:["v-icon","notranslate",s.value,o.value,l.value,{"v-icon--clickable":d,"v-icon--disabled":t.disabled,"v-icon--start":t.start,"v-icon--end":t.end},t.class],style:[o.value?void 0:{fontSize:Ht(t.size),height:Ht(t.size),width:Ht(t.size)},u.value,t.style],role:d?"button":void 0,"aria-hidden":!d,tabindex:d?t.disabled?-1:0:void 0},{default:()=>[c]})}),{}}}),Boe=Ue({disabled:Boolean,group:Boolean,hideOnLeave:Boolean,leaveAbsolute:Boolean,mode:String,origin:String},"transition");function cs(t,e,n){return vt()({name:t,props:Boe({mode:n,origin:e}),setup(i,r){let{slots:s}=r;const a={onBeforeEnter(o){i.origin&&(o.style.transformOrigin=i.origin)},onLeave(o){if(i.leaveAbsolute){const{offsetTop:l,offsetLeft:u,offsetWidth:c,offsetHeight:d}=o;o._transitionInitialStyles={position:o.style.position,top:o.style.top,left:o.style.left,width:o.style.width,height:o.style.height},o.style.position="absolute",o.style.top=`${l}px`,o.style.left=`${u}px`,o.style.width=`${c}px`,o.style.height=`${d}px`}i.hideOnLeave&&o.style.setProperty("display","none","important")},onAfterLeave(o){if(i.leaveAbsolute&&(o!=null&&o._transitionInitialStyles)){const{position:l,top:u,left:c,width:d,height:h}=o._transitionInitialStyles;delete o._transitionInitialStyles,o.style.position=l||"",o.style.top=u||"",o.style.left=c||"",o.style.width=d||"",o.style.height=h||""}}};return()=>{const o=i.group?XI:eu;return Bt(o,{name:i.disabled?"":t,css:!i.disabled,...i.group?void 0:{mode:i.mode},...i.disabled?{}:a},s.default)}}})}function jz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"in-out";return vt()({name:t,props:{mode:{type:String,default:n},disabled:Boolean,group:Boolean},setup(i,r){let{slots:s}=r;const a=i.group?XI:eu;return()=>Bt(a,{name:i.disabled?"":t,css:!i.disabled,...i.disabled?{}:e},s.default)}})}function Qz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?"width":"height",i=Rr(`offset-${n}`);return{onBeforeEnter(a){a._parent=a.parentNode,a._initialStyle={transition:a.style.transition,overflow:a.style.overflow,[n]:a.style[n]}},onEnter(a){const o=a._initialStyle;if(!o)return;a.style.setProperty("transition","none","important"),a.style.overflow="hidden";const l=`${a[i]}px`;a.style[n]="0",a.offsetHeight,a.style.transition=o.transition,t&&a._parent&&a._parent.classList.add(t),requestAnimationFrame(()=>{a.style[n]=l})},onAfterEnter:s,onEnterCancelled:s,onLeave(a){a._initialStyle={transition:"",overflow:a.style.overflow,[n]:a.style[n]},a.style.overflow="hidden",a.style[n]=`${a[i]}px`,a.offsetHeight,requestAnimationFrame(()=>a.style[n]="0")},onAfterLeave:r,onLeaveCancelled:r};function r(a){t&&a._parent&&a._parent.classList.remove(t),s(a)}function s(a){if(!a._initialStyle)return;const o=a._initialStyle[n];a.style.overflow=a._initialStyle.overflow,o!=null&&(a.style[n]=o),delete a._initialStyle}}const Foe=Ue({target:[Object,Array]},"v-dialog-transition"),TN=vt()({name:"VDialogTransition",props:Foe(),setup(t,e){let{slots:n}=e;const i={onBeforeEnter(r){r.style.pointerEvents="none",r.style.visibility="hidden"},async onEnter(r,s){var h;await new Promise(f=>requestAnimationFrame(f)),await new Promise(f=>requestAnimationFrame(f)),r.style.visibility="";const{x:a,y:o,sx:l,sy:u,speed:c}=Pk(t.target,r),d=Qu(r,[{transform:`translate(${a}px, ${o}px) scale(${l}, ${u})`,opacity:0},{}],{duration:225*c,easing:mne});(h=Lk(r))==null||h.forEach(f=>{Qu(f,[{opacity:0},{opacity:0,offset:.33},{}],{duration:225*2*c,easing:sv})}),d.finished.then(()=>s())},onAfterEnter(r){r.style.removeProperty("pointer-events")},onBeforeLeave(r){r.style.pointerEvents="none"},async onLeave(r,s){var h;await new Promise(f=>requestAnimationFrame(f));const{x:a,y:o,sx:l,sy:u,speed:c}=Pk(t.target,r);Qu(r,[{},{transform:`translate(${a}px, ${o}px) scale(${l}, ${u})`,opacity:0}],{duration:125*c,easing:gne}).finished.then(()=>s()),(h=Lk(r))==null||h.forEach(f=>{Qu(f,[{},{opacity:0,offset:.2},{opacity:0}],{duration:125*2*c,easing:sv})})},onAfterLeave(r){r.style.removeProperty("pointer-events")}};return()=>t.target?W(eu,rt({name:"dialog-transition"},i,{css:!1}),n):W(eu,{name:"dialog-transition"},n)}});function Lk(t){var n;const e=(n=t.querySelector(":scope > .v-card, :scope > .v-sheet, :scope > .v-list"))==null?void 0:n.children;return e&&[...e]}function Pk(t,e){const n=tz(t),i=uN(e),[r,s]=getComputedStyle(e).transformOrigin.split(" ").map(v=>parseFloat(v)),[a,o]=getComputedStyle(e).getPropertyValue("--v-overlay-anchor-origin").split(" ");let l=n.left+n.width/2;a==="left"||o==="left"?l-=n.width/2:(a==="right"||o==="right")&&(l+=n.width/2);let u=n.top+n.height/2;a==="top"||o==="top"?u-=n.height/2:(a==="bottom"||o==="bottom")&&(u+=n.height/2);const c=n.width/i.width,d=n.height/i.height,h=Math.max(1,c,d),f=c/h||0,S=d/h||0,_=i.width*i.height/(window.innerWidth*window.innerHeight),p=_>.12?Math.min(1.5,(_-.12)*10+1):1;return{x:l-(r+i.left),y:u-(s+i.top),sx:f,sy:S,speed:p}}cs("fab-transition","center center","out-in");cs("dialog-bottom-transition");cs("dialog-top-transition");const Bk=cs("fade-transition");cs("scale-transition");cs("scroll-x-transition");cs("scroll-x-reverse-transition");cs("scroll-y-transition");cs("scroll-y-reverse-transition");cs("slide-x-transition");cs("slide-x-reverse-transition");const Xz=cs("slide-y-transition");cs("slide-y-reverse-transition");const Uoe=jz("expand-transition",Qz()),Zz=jz("expand-x-transition",Qz("",!0)),Zd=Ue({transition:{type:[Boolean,String,Object],default:"fade-transition",validator:t=>t!==!0}},"transition"),bl=(t,e)=>{let{slots:n}=e;const{transition:i,disabled:r,group:s,...a}=t,{component:o=s?XI:eu,...l}=typeof i=="object"?i:{};return Bt(o,rt(typeof i=="string"?{name:r?"":i}:l,typeof i=="string"?{}:Object.fromEntries(Object.entries({disabled:r,group:s}).filter(u=>{let[c,d]=u;return d!==void 0})),a),n)},$oe=Ue({active:Boolean,disabled:Boolean,max:[Number,String],value:{type:[Number,String],default:0},...jt(),...Zd({transition:{component:Xz}})},"VCounter"),Jz=vt()({name:"VCounter",functional:!0,props:$oe(),setup(t,e){let{slots:n}=e;const i=te(()=>t.max?`${t.value} / ${t.max}`:String(t.value));return Ft(()=>W(bl,{transition:t.transition},{default:()=>[Ar(W("div",{class:["v-counter",{"text-error":t.max&&!t.disabled&&parseFloat(t.value)>parseFloat(t.max)},t.class],style:t.style},[n.default?n.default({counter:i.value,max:t.max,value:t.value}):i.value]),[[Wd,t.active]])]})),{}}}),Goe=Ue({text:String,onClick:Yr(),...jt(),...$i()},"VLabel"),eq=vt()({name:"VLabel",props:Goe(),setup(t,e){let{slots:n}=e;return Ft(()=>{var i;return W("label",{class:["v-label",{"v-label--clickable":!!t.onClick},t.class],style:t.style,onClick:t.onClick},[t.text,(i=n.default)==null?void 0:i.call(n)])}),{}}}),Hoe=Ue({floating:Boolean,...jt()},"VFieldLabel"),C_=vt()({name:"VFieldLabel",props:Hoe(),setup(t,e){let{slots:n}=e;return Ft(()=>W(eq,{class:["v-field-label",{"v-field-label--floating":t.floating},t.class],style:t.style,"aria-hidden":t.floating||void 0},n)),{}}}),Voe=Ue({defaults:Object,disabled:Boolean,reset:[Number,String],root:[Boolean,String],scoped:Boolean},"VDefaultsProvider"),pi=vt(!1)({name:"VDefaultsProvider",props:Voe(),setup(t,e){let{slots:n}=e;const{defaults:i,disabled:r,reset:s,root:a,scoped:o}=Cp(t);return jd(i,{reset:s,root:a,scoped:o,disabled:r}),()=>{var l;return(l=n.default)==null?void 0:l.call(n)}}});function tq(t){const{t:e}=Ip();function n(i){let{name:r}=i;const s={prepend:"prependAction",prependInner:"prependAction",append:"appendAction",appendInner:"appendAction",clear:"clear"}[r],a=t[`onClick:${r}`];function o(u){u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),u.stopPropagation(),lN(a,new PointerEvent("click",u)))}const l=a&&s?e(`$vuetify.input.${s}`,t.label??""):void 0;return W(Ot,{icon:t[`${r}Icon`],"aria-label":l,onClick:a,onKeydown:o},null)}return{InputIcon:n}}const nq=Ue({focused:Boolean,"onUpdate:focused":Yr()},"focus");function XS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();const n=Fn(t,"focused"),i=te(()=>({[`${e}--focused`]:n.value}));function r(){n.value=!0}function s(){n.value=!1}return{focusClasses:i,isFocused:n,focus:r,blur:s}}function iq(t,e){const n=ve(),i=ut(!1);if(sN){const r=new IntersectionObserver(s=>{i.value=!!s.find(a=>a.isIntersecting)},e);Yi(()=>{r.disconnect()}),Ie(n,(s,a)=>{a&&(r.unobserve(a),i.value=!1),s&&r.observe(s)},{flush:"post"})}return{intersectionRef:n,isIntersecting:i}}const Fk={center:"center",top:"bottom",bottom:"top",left:"right",right:"left"},ZS=Ue({location:String},"location");function JS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2?arguments[2]:void 0;const{isRtl:i}=ec();return{locationStyles:te(()=>{if(!t.location)return{};const{side:s,align:a}=TA(t.location.split(" ").length>1?t.location:`${t.location} center`,i.value);function o(u){return n?n(u):0}const l={};return s!=="center"&&(e?l[Fk[s]]=`calc(100% - ${o(s)}px)`:l[s]=0),a!=="center"?e?l[Fk[a]]=`calc(100% - ${o(a)}px)`:l[a]=0:(s==="center"?l.top=l.left="50%":l[{top:"left",bottom:"left",left:"top",right:"top"}[s]]="50%",l.transform={top:"translateX(-50%)",bottom:"translateX(-50%)",left:"translateY(-50%)",right:"translateY(-50%)",center:"translate(-50%, -50%)"}[s]),l})}}const no=Ue({rounded:{type:[Boolean,Number,String],default:void 0},tile:Boolean},"rounded");function io(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{roundedClasses:te(()=>{const i=Lt(t)?t.value:t.rounded,r=Lt(t)?t.value:t.tile,s=[];if(i===!0||i==="")s.push(`${e}--rounded`);else if(typeof i=="string"||i===0)for(const a of String(i).split(" "))s.push(`rounded-${a}`);else(r||i===!1)&&s.push("rounded-0");return s})}}const zoe=Ue({absolute:Boolean,active:{type:Boolean,default:!0},bgColor:String,bgOpacity:[Number,String],bufferValue:{type:[Number,String],default:0},bufferColor:String,bufferOpacity:[Number,String],clickable:Boolean,color:String,height:{type:[Number,String],default:4},indeterminate:Boolean,max:{type:[Number,String],default:100},modelValue:{type:[Number,String],default:0},opacity:[Number,String],reverse:Boolean,stream:Boolean,striped:Boolean,roundedBar:Boolean,...jt(),...ZS({location:"top"}),...no(),...Ri(),...$i()},"VProgressLinear"),rq=vt()({name:"VProgressLinear",props:zoe(),emits:{"update:modelValue":t=>!0},setup(t,e){var I;let{slots:n}=e;const i=Fn(t,"modelValue"),{isRtl:r,rtlClasses:s}=ec(),{themeClasses:a}=cr(t),{locationStyles:o}=JS(t),{textColorClasses:l,textColorStyles:u}=Xs(t,"color"),{backgroundColorClasses:c,backgroundColorStyles:d}=Il(te(()=>t.bgColor||t.color)),{backgroundColorClasses:h,backgroundColorStyles:f}=Il(te(()=>t.bufferColor||t.bgColor||t.color)),{backgroundColorClasses:S,backgroundColorStyles:_}=Il(t,"color"),{roundedClasses:p}=io(t),{intersectionRef:v,isIntersecting:m}=iq(),g=te(()=>parseFloat(t.max)),b=te(()=>parseFloat(t.height)),y=te(()=>Lo(parseFloat(t.bufferValue)/g.value*100,0,100)),E=te(()=>Lo(parseFloat(i.value)/g.value*100,0,100)),T=te(()=>r.value!==t.reverse),C=te(()=>t.indeterminate?"fade-transition":"slide-x-transition"),w=dn&&((I=window.matchMedia)==null?void 0:I.call(window,"(forced-colors: active)").matches);function R(A){if(!v.value)return;const{left:x,right:O,width:D}=v.value.getBoundingClientRect(),L=T.value?D-A.clientX+(O-D):A.clientX-x;i.value=Math.round(L/D*g.value)}return Ft(()=>W(t.tag,{ref:v,class:["v-progress-linear",{"v-progress-linear--absolute":t.absolute,"v-progress-linear--active":t.active&&m.value,"v-progress-linear--reverse":T.value,"v-progress-linear--rounded":t.rounded,"v-progress-linear--rounded-bar":t.roundedBar,"v-progress-linear--striped":t.striped},p.value,a.value,s.value,t.class],style:[{bottom:t.location==="bottom"?0:void 0,top:t.location==="top"?0:void 0,height:t.active?Ht(b.value):0,"--v-progress-linear-height":Ht(b.value),...t.absolute?o.value:{}},t.style],role:"progressbar","aria-hidden":t.active?"false":"true","aria-valuemin":"0","aria-valuemax":t.max,"aria-valuenow":t.indeterminate?void 0:Math.min(parseFloat(i.value),g.value),onClick:t.clickable&&R},{default:()=>[t.stream&&W("div",{key:"stream",class:["v-progress-linear__stream",l.value],style:{...u.value,[T.value?"left":"right"]:Ht(-b.value),borderTop:`${Ht(b.value/2)} dotted`,opacity:parseFloat(t.bufferOpacity),top:`calc(50% - ${Ht(b.value/4)})`,width:Ht(100-y.value,"%"),"--v-progress-linear-stream-to":Ht(b.value*(T.value?1:-1))}},null),W("div",{class:["v-progress-linear__background",w?void 0:c.value],style:[d.value,{opacity:parseFloat(t.bgOpacity),width:t.stream?0:void 0}]},null),W("div",{class:["v-progress-linear__buffer",w?void 0:h.value],style:[f.value,{opacity:parseFloat(t.bufferOpacity),width:Ht(y.value,"%")}]},null),W(eu,{name:C.value},{default:()=>[t.indeterminate?W("div",{class:"v-progress-linear__indeterminate"},[["long","short"].map(A=>W("div",{key:A,class:["v-progress-linear__indeterminate",A,w?void 0:S.value],style:_.value},null))]):W("div",{class:["v-progress-linear__determinate",w?void 0:S.value],style:[_.value,{width:Ht(E.value,"%")}]},null)]}),n.default&&W("div",{class:"v-progress-linear__content"},[n.default({value:E.value,buffer:y.value})])]})),{}}}),wN=Ue({loading:[Boolean,String]},"loader");function RN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{loaderClasses:te(()=>({[`${e}--loading`]:t.loading}))}}function sq(t,e){var i;let{slots:n}=e;return W("div",{class:`${t.name}__loader`},[((i=n.default)==null?void 0:i.call(n,{color:t.color,isActive:t.active}))||W(rq,{absolute:t.absolute,active:t.active,color:t.color,height:"2",indeterminate:!0},null)])}const qoe=["underlined","outlined","filled","solo","solo-inverted","solo-filled","plain"],AN=Ue({appendInnerIcon:on,bgColor:String,clearable:Boolean,clearIcon:{type:on,default:"$clear"},active:Boolean,centerAffix:{type:Boolean,default:void 0},color:String,baseColor:String,dirty:Boolean,disabled:{type:Boolean,default:null},error:Boolean,flat:Boolean,label:String,persistentClear:Boolean,prependInnerIcon:on,reverse:Boolean,singleLine:Boolean,variant:{type:String,default:"filled",validator:t=>qoe.includes(t)},"onClick:clear":Yr(),"onClick:appendInner":Yr(),"onClick:prependInner":Yr(),...jt(),...wN(),...no(),...$i()},"VField"),ON=vt()({name:"VField",inheritAttrs:!1,props:{id:String,...nq(),...AN()},emits:{"update:focused":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{attrs:n,emit:i,slots:r}=e;const{themeClasses:s}=cr(t),{loaderClasses:a}=RN(t),{focusClasses:o,isFocused:l,focus:u,blur:c}=XS(t),{InputIcon:d}=tq(t),{roundedClasses:h}=io(t),{rtlClasses:f}=ec(),S=te(()=>t.dirty||t.active),_=te(()=>!!(t.label||r.label)),p=te(()=>!t.singleLine&&_.value),v=Os(),m=te(()=>t.id||`input-${v}`),g=te(()=>`${m.value}-messages`),b=ve(),y=ve(),E=ve(),T=te(()=>["plain","underlined"].includes(t.variant)),{backgroundColorClasses:C,backgroundColorStyles:w}=Il(Ve(t,"bgColor")),{textColorClasses:R,textColorStyles:I}=Xs(te(()=>t.error||t.disabled?void 0:S.value&&l.value?t.color:t.baseColor));Ie(S,O=>{if(p.value){const D=b.value.$el,L=y.value.$el;requestAnimationFrame(()=>{const q=uN(D),G=L.getBoundingClientRect(),M=G.x-q.x,P=G.y-q.y-(q.height/2-G.height/2),N=G.width/.75,U=Math.abs(N-q.width)>1?{maxWidth:Ht(N)}:void 0,F=getComputedStyle(D),k=getComputedStyle(L),H=parseFloat(F.transitionDuration)*1e3||150,X=parseFloat(k.getPropertyValue("--v-field-label-scale")),K=k.getPropertyValue("color");D.style.visibility="visible",L.style.visibility="hidden",Qu(D,{transform:`translate(${M}px, ${P}px) scale(${X})`,color:K,...U},{duration:H,easing:sv,direction:O?"normal":"reverse"}).finished.then(()=>{D.style.removeProperty("visibility"),L.style.removeProperty("visibility")})})}},{flush:"post"});const A=te(()=>({isActive:S,isFocused:l,controlRef:E,blur:c,focus:u}));function x(O){O.target!==document.activeElement&&O.preventDefault()}return Ft(()=>{var M,P,N;const O=t.variant==="outlined",D=!!(r["prepend-inner"]||t.prependInnerIcon),L=!!(t.clearable||r.clear)&&!t.disabled,q=!!(r["append-inner"]||t.appendInnerIcon||L),G=()=>r.label?r.label({...A.value,label:t.label,props:{for:m.value}}):t.label;return W("div",rt({class:["v-field",{"v-field--active":S.value,"v-field--appended":q,"v-field--center-affix":t.centerAffix??!T.value,"v-field--disabled":t.disabled,"v-field--dirty":t.dirty,"v-field--error":t.error,"v-field--flat":t.flat,"v-field--has-background":!!t.bgColor,"v-field--persistent-clear":t.persistentClear,"v-field--prepended":D,"v-field--reverse":t.reverse,"v-field--single-line":t.singleLine,"v-field--no-label":!G(),[`v-field--variant-${t.variant}`]:!0},s.value,C.value,o.value,a.value,h.value,f.value,t.class],style:[w.value,t.style],onClick:x},n),[W("div",{class:"v-field__overlay"},null),W(sq,{name:"v-field",active:!!t.loading,color:t.error?"error":typeof t.loading=="string"?t.loading:t.color},{default:r.loader}),D&&W("div",{key:"prepend",class:"v-field__prepend-inner"},[t.prependInnerIcon&&W(d,{key:"prepend-icon",name:"prependInner"},null),(M=r["prepend-inner"])==null?void 0:M.call(r,A.value)]),W("div",{class:"v-field__field","data-no-activator":""},[["filled","solo","solo-inverted","solo-filled"].includes(t.variant)&&p.value&&W(C_,{key:"floating-label",ref:y,class:[R.value],floating:!0,for:m.value,style:I.value},{default:()=>[G()]}),_.value&&W(C_,{key:"label",ref:b,for:m.value},{default:()=>[G()]}),(P=r.default)==null?void 0:P.call(r,{...A.value,props:{id:m.value,class:"v-field__input","aria-describedby":g.value},focus:u,blur:c})]),L&&W(Zz,{key:"clear"},{default:()=>[Ar(W("div",{class:"v-field__clearable",onMousedown:U=>{U.preventDefault(),U.stopPropagation()}},[W(pi,{defaults:{VIcon:{icon:t.clearIcon}}},{default:()=>[r.clear?r.clear({...A.value,props:{onFocus:u,onBlur:c,onClick:t["onClick:clear"]}}):W(d,{name:"clear",onFocus:u,onBlur:c},null)]})]),[[Wd,t.dirty]])]}),q&&W("div",{key:"append",class:"v-field__append-inner"},[(N=r["append-inner"])==null?void 0:N.call(r,A.value),t.appendInnerIcon&&W(d,{key:"append-icon",name:"appendInner"},null)]),W("div",{class:["v-field__outline",R.value],style:I.value},[O&&W(He,null,[W("div",{class:"v-field__outline__start"},null),p.value&&W("div",{class:"v-field__outline__notch"},[W(C_,{ref:y,floating:!0,for:m.value},{default:()=>[G()]})]),W("div",{class:"v-field__outline__end"},null)]),T.value&&p.value&&W(C_,{ref:y,floating:!0,for:m.value},{default:()=>[G()]})])])}),{controlRef:E}}});function oq(t){const e=Object.keys(ON.props).filter(n=>!oN(n)&&n!=="class"&&n!=="style");return Op(t,e)}const Yoe=Ue({active:Boolean,color:String,messages:{type:[Array,String],default:()=>[]},...jt(),...Zd({transition:{component:Xz,leaveAbsolute:!0,group:!0}})},"VMessages"),Woe=vt()({name:"VMessages",props:Yoe(),setup(t,e){let{slots:n}=e;const i=te(()=>qr(t.messages)),{textColorClasses:r,textColorStyles:s}=Xs(te(()=>t.color));return Ft(()=>W(bl,{transition:t.transition,tag:"div",class:["v-messages",r.value,t.class],style:[s.value,t.style]},{default:()=>[t.active&&i.value.map((a,o)=>W("div",{class:"v-messages__message",key:`${o}-${i.value}`},[n.message?n.message({message:a}):a]))]})),{}}}),Koe=[null,"default","comfortable","compact"],ro=Ue({density:{type:String,default:"default",validator:t=>Koe.includes(t)}},"density");function Qo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{densityClasses:te(()=>`${e}--density-${t.density}`)}}const Ha=Ue({height:[Number,String],maxHeight:[Number,String],maxWidth:[Number,String],minHeight:[Number,String],minWidth:[Number,String],width:[Number,String]},"dimension");function Va(t){return{dimensionStyles:te(()=>{const n={},i=Ht(t.height),r=Ht(t.maxHeight),s=Ht(t.maxWidth),a=Ht(t.minHeight),o=Ht(t.minWidth),l=Ht(t.width);return i!=null&&(n.height=i),r!=null&&(n.maxHeight=r),s!=null&&(n.maxWidth=s),a!=null&&(n.minHeight=a),o!=null&&(n.minWidth=o),l!=null&&(n.width=l),n})}}const aq=Symbol.for("vuetify:form"),joe=Ue({disabled:Boolean,fastFail:Boolean,readonly:Boolean,modelValue:{type:Boolean,default:null},validateOn:{type:String,default:"input"}},"form");function Qoe(t){const e=Fn(t,"modelValue"),n=te(()=>t.disabled),i=te(()=>t.readonly),r=ut(!1),s=ve([]),a=ve([]);async function o(){const c=[];let d=!0;a.value=[],r.value=!0;for(const h of s.value){const f=await h.validate();if(f.length>0&&(d=!1,c.push({id:h.id,errorMessages:f})),!d&&t.fastFail)break}return a.value=c,r.value=!1,{valid:d,errors:a.value}}function l(){s.value.forEach(c=>c.reset())}function u(){s.value.forEach(c=>c.resetValidation())}return Ie(s,()=>{let c=0,d=0;const h=[];for(const f of s.value)f.isValid===!1?(d++,h.push({id:f.id,errorMessages:f.errorMessages})):f.isValid===!0&&c++;a.value=h,e.value=d>0?!1:c===s.value.length?!0:null},{deep:!0,flush:"post"}),Kn(aq,{register:c=>{let{id:d,vm:h,validate:f,reset:S,resetValidation:_}=c;s.value.some(p=>p.id===d),s.value.push({id:d,validate:f,reset:S,resetValidation:_,vm:ys(h),isValid:null,errorMessages:[]})},unregister:c=>{s.value=s.value.filter(d=>d.id!==c)},update:(c,d,h)=>{const f=s.value.find(S=>S.id===c);f&&(f.isValid=d,f.errorMessages=h)},isDisabled:n,isReadonly:i,isValidating:r,isValid:e,items:s,validateOn:Ve(t,"validateOn")}),{errors:a,isDisabled:n,isReadonly:i,isValidating:r,isValid:e,items:s,validate:o,reset:l,resetValidation:u}}function IN(t){const e=an(aq,null);return{...e,isReadonly:te(()=>!!((t==null?void 0:t.readonly)??(e==null?void 0:e.isReadonly.value))),isDisabled:te(()=>!!((t==null?void 0:t.disabled)??(e==null?void 0:e.isDisabled.value)))}}const Xoe=Ue({disabled:{type:Boolean,default:null},error:Boolean,errorMessages:{type:[Array,String],default:()=>[]},maxErrors:{type:[Number,String],default:1},name:String,label:String,readonly:{type:Boolean,default:null},rules:{type:Array,default:()=>[]},modelValue:null,validateOn:String,validationValue:null,...nq()},"validation");function Zoe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Os();const i=Fn(t,"modelValue"),r=te(()=>t.validationValue===void 0?i.value:t.validationValue),s=IN(t),a=ve([]),o=ut(!0),l=te(()=>!!(qr(i.value===""?null:i.value).length||qr(r.value===""?null:r.value).length)),u=te(()=>{var g;return(g=t.errorMessages)!=null&&g.length?qr(t.errorMessages).concat(a.value).slice(0,Math.max(0,+t.maxErrors)):a.value}),c=te(()=>{var y;let g=(t.validateOn??((y=s.validateOn)==null?void 0:y.value))||"input";g==="lazy"&&(g="input lazy"),g==="eager"&&(g="input eager");const b=new Set((g==null?void 0:g.split(" "))??[]);return{input:b.has("input"),blur:b.has("blur")||b.has("input")||b.has("invalid-input"),invalidInput:b.has("invalid-input"),lazy:b.has("lazy"),eager:b.has("eager")}}),d=te(()=>{var g;return t.error||(g=t.errorMessages)!=null&&g.length?!1:t.rules.length?o.value?a.value.length||c.value.lazy?null:!0:!a.value.length:!0}),h=ut(!1),f=te(()=>({[`${e}--error`]:d.value===!1,[`${e}--dirty`]:l.value,[`${e}--disabled`]:s.isDisabled.value,[`${e}--readonly`]:s.isReadonly.value})),S=Li("validation"),_=te(()=>t.name??ie(n));vu(()=>{var g;(g=s.register)==null||g.call(s,{id:_.value,vm:S,validate:m,reset:p,resetValidation:v})}),Yi(()=>{var g;(g=s.unregister)==null||g.call(s,_.value)}),ai(async()=>{var g;c.value.lazy||await m(!c.value.eager),(g=s.update)==null||g.call(s,_.value,d.value,u.value)}),nu(()=>c.value.input||c.value.invalidInput&&d.value===!1,()=>{Ie(r,()=>{if(r.value!=null)m();else if(t.focused){const g=Ie(()=>t.focused,b=>{b||m(),g()})}})}),nu(()=>c.value.blur,()=>{Ie(()=>t.focused,g=>{g||m()})}),Ie([d,u],()=>{var g;(g=s.update)==null||g.call(s,_.value,d.value,u.value)});async function p(){i.value=null,await $t(),await v()}async function v(){o.value=!0,c.value.lazy?a.value=[]:await m(!c.value.eager)}async function m(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const b=[];h.value=!0;for(const y of t.rules){if(b.length>=+(t.maxErrors??1))break;const T=await(typeof y=="function"?y:()=>y)(r.value);if(T!==!0){if(T!==!1&&typeof T!="string"){console.warn(`${T} is not a valid value. Rule functions must return boolean true or a string.`);continue}b.push(T||"")}}return a.value=b,h.value=!1,o.value=g,a.value}return{errorMessages:u,isDirty:l,isDisabled:s.isDisabled,isReadonly:s.isReadonly,isPristine:o,isValid:d,isValidating:h,reset:p,resetValidation:v,validate:m,validationClasses:f}}const eb=Ue({id:String,appendIcon:on,centerAffix:{type:Boolean,default:!0},prependIcon:on,hideDetails:[Boolean,String],hideSpinButtons:Boolean,hint:String,persistentHint:Boolean,messages:{type:[Array,String],default:()=>[]},direction:{type:String,default:"horizontal",validator:t=>["horizontal","vertical"].includes(t)},"onClick:prepend":Yr(),"onClick:append":Yr(),...jt(),...ro(),...Op(Ha(),["maxWidth","minWidth","width"]),...$i(),...Xoe()},"VInput"),Td=vt()({name:"VInput",props:{...eb()},emits:{"update:modelValue":t=>!0},setup(t,e){let{attrs:n,slots:i,emit:r}=e;const{densityClasses:s}=Qo(t),{dimensionStyles:a}=Va(t),{themeClasses:o}=cr(t),{rtlClasses:l}=ec(),{InputIcon:u}=tq(t),c=Os(),d=te(()=>t.id||`input-${c}`),h=te(()=>`${d.value}-messages`),{errorMessages:f,isDirty:S,isDisabled:_,isReadonly:p,isPristine:v,isValid:m,isValidating:g,reset:b,resetValidation:y,validate:E,validationClasses:T}=Zoe(t,"v-input",d),C=te(()=>({id:d,messagesId:h,isDirty:S,isDisabled:_,isReadonly:p,isPristine:v,isValid:m,isValidating:g,reset:b,resetValidation:y,validate:E})),w=te(()=>{var R;return(R=t.errorMessages)!=null&&R.length||!v.value&&f.value.length?f.value:t.hint&&(t.persistentHint||t.focused)?t.hint:t.messages});return Ft(()=>{var O,D,L,q;const R=!!(i.prepend||t.prependIcon),I=!!(i.append||t.appendIcon),A=w.value.length>0,x=!t.hideDetails||t.hideDetails==="auto"&&(A||!!i.details);return W("div",{class:["v-input",`v-input--${t.direction}`,{"v-input--center-affix":t.centerAffix,"v-input--hide-spin-buttons":t.hideSpinButtons},s.value,o.value,l.value,T.value,t.class],style:[a.value,t.style]},[R&&W("div",{key:"prepend",class:"v-input__prepend"},[(O=i.prepend)==null?void 0:O.call(i,C.value),t.prependIcon&&W(u,{key:"prepend-icon",name:"prepend"},null)]),i.default&&W("div",{class:"v-input__control"},[(D=i.default)==null?void 0:D.call(i,C.value)]),I&&W("div",{key:"append",class:"v-input__append"},[t.appendIcon&&W(u,{key:"append-icon",name:"append"},null),(L=i.append)==null?void 0:L.call(i,C.value)]),x&&W("div",{id:h.value,class:"v-input__details",role:"alert","aria-live":"polite"},[W(Woe,{active:A,messages:w.value},{message:i.message}),(q=i.details)==null?void 0:q.call(i,C.value)])])}),{reset:b,resetValidation:y,validate:E,isValid:m,errorMessages:f}}}),NE=Symbol("Forwarded refs");function xE(t,e){let n=t;for(;n;){const i=Reflect.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function tc(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return t[NE]=n,new Proxy(t,{get(r,s){if(Reflect.has(r,s))return Reflect.get(r,s);if(!(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))){for(const a of n)if(a.value&&Reflect.has(a.value,s)){const o=Reflect.get(a.value,s);return typeof o=="function"?o.bind(a.value):o}}},has(r,s){if(Reflect.has(r,s))return!0;if(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))return!1;for(const a of n)if(a.value&&Reflect.has(a.value,s))return!0;return!1},set(r,s,a){if(Reflect.has(r,s))return Reflect.set(r,s,a);if(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))return!1;for(const o of n)if(o.value&&Reflect.has(o.value,s))return Reflect.set(o.value,s,a);return!1},getOwnPropertyDescriptor(r,s){var o;const a=Reflect.getOwnPropertyDescriptor(r,s);if(a)return a;if(!(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))){for(const l of n){if(!l.value)continue;const u=xE(l.value,s)??("_"in l.value?xE((o=l.value._)==null?void 0:o.setupState,s):void 0);if(u)return u}for(const l of n){const u=l.value&&l.value[NE];if(!u)continue;const c=u.slice();for(;c.length;){const d=c.shift(),h=xE(d.value,s);if(h)return h;const f=d.value&&d.value[NE];f&&c.push(...f)}}}}})}function Joe(t,e){if(!sN)return;const n=e.modifiers||{},i=e.value,{handler:r,options:s}=typeof i=="object"?i:{handler:i,options:{}},a=new IntersectionObserver(function(){var d;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0;const u=(d=t._observe)==null?void 0:d[e.instance.$.uid];if(!u)return;const c=o.some(h=>h.isIntersecting);r&&(!n.quiet||u.init)&&(!n.once||c||u.init)&&r(c,o,l),c&&n.once?lq(t,e):u.init=!0},s);t._observe=Object(t._observe),t._observe[e.instance.$.uid]={init:!1,observer:a},a.observe(t)}function lq(t,e){var i;const n=(i=t._observe)==null?void 0:i[e.instance.$.uid];n&&(n.observer.unobserve(t),delete t._observe[e.instance.$.uid])}const NN={mounted:Joe,unmounted:lq},eae=["color","file","time","date","datetime-local","week","month"],xN=Ue({autofocus:Boolean,counter:[Boolean,Number,String],counterValue:[Number,Function],prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,suffix:String,role:String,type:{type:String,default:"text"},modelModifiers:Object,...eb(),...AN()},"VTextField"),Vo=vt()({name:"VTextField",directives:{Intersect:NN},inheritAttrs:!1,props:xN(),emits:{"click:control":t=>!0,"mousedown:control":t=>!0,"update:focused":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{attrs:n,emit:i,slots:r}=e;const s=Fn(t,"modelValue"),{isFocused:a,focus:o,blur:l}=XS(t),u=te(()=>typeof t.counterValue=="function"?t.counterValue(s.value):typeof t.counterValue=="number"?t.counterValue:(s.value??"").toString().length),c=te(()=>{if(n.maxlength)return n.maxlength;if(!(!t.counter||typeof t.counter!="number"&&typeof t.counter!="string"))return t.counter}),d=te(()=>["plain","underlined"].includes(t.variant));function h(E,T){var C,w;!t.autofocus||!E||(w=(C=T[0].target)==null?void 0:C.focus)==null||w.call(C)}const f=ve(),S=ve(),_=ve(),p=te(()=>eae.includes(t.type)||t.persistentPlaceholder||a.value||t.active);function v(){var E;_.value!==document.activeElement&&((E=_.value)==null||E.focus()),a.value||o()}function m(E){i("mousedown:control",E),E.target!==_.value&&(v(),E.preventDefault())}function g(E){v(),i("click:control",E)}function b(E){E.stopPropagation(),v(),$t(()=>{s.value=null,lN(t["onClick:clear"],E)})}function y(E){var C;const T=E.target;if(s.value=T.value,(C=t.modelModifiers)!=null&&C.trim&&["text","search","password","tel","url"].includes(t.type)){const w=[T.selectionStart,T.selectionEnd];$t(()=>{T.selectionStart=w[0],T.selectionEnd=w[1]})}}return Ft(()=>{const E=!!(r.counter||t.counter!==!1&&t.counter!=null),T=!!(E||r.details),[C,w]=YS(n),{modelValue:R,...I}=Td.filterProps(t),A=oq(t);return W(Td,rt({ref:f,modelValue:s.value,"onUpdate:modelValue":x=>s.value=x,class:["v-text-field",{"v-text-field--prefixed":t.prefix,"v-text-field--suffixed":t.suffix,"v-input--plain-underlined":d.value},t.class],style:t.style},C,I,{centerAffix:!d.value,focused:a.value}),{...r,default:x=>{let{id:O,isDisabled:D,isDirty:L,isReadonly:q,isValid:G}=x;return W(ON,rt({ref:S,onMousedown:m,onClick:g,"onClick:clear":b,"onClick:prependInner":t["onClick:prependInner"],"onClick:appendInner":t["onClick:appendInner"],role:t.role},A,{id:O.value,active:p.value||L.value,dirty:L.value||t.dirty,disabled:D.value,focused:a.value,error:G.value===!1}),{...r,default:M=>{let{props:{class:P,...N}}=M;const U=Ar(W("input",rt({ref:_,value:s.value,onInput:y,autofocus:t.autofocus,readonly:q.value,disabled:D.value,name:t.name,placeholder:t.placeholder,size:1,type:t.type,onFocus:v,onBlur:l},N,w),null),[[Jl("intersect"),{handler:h},null,{once:!0}]]);return W(He,null,[t.prefix&&W("span",{class:"v-text-field__prefix"},[W("span",{class:"v-text-field__prefix__text"},[t.prefix])]),r.default?W("div",{class:P,"data-no-activator":""},[r.default(),U]):Go(U,{class:P}),t.suffix&&W("span",{class:"v-text-field__suffix"},[W("span",{class:"v-text-field__suffix__text"},[t.suffix])])])}})},details:T?x=>{var O;return W(He,null,[(O=r.details)==null?void 0:O.call(r,x),E&&W(He,null,[W("span",null,null),W(Jz,{active:t.persistentCounter||a.value,value:u.value,max:c.value,disabled:t.disabled},r.counter)])])}:void 0})}),tc({},f,S,_)}}),cq=Qe({__name:"PasswordField",props:{modelValue:{},modelModifiers:{},visible:{type:Boolean,default:!1},visibleModifiers:{}},emits:["update:modelValue","update:visible"],setup(t,{expose:e}){const n=kl(t,"modelValue"),i=kl(t,"visible"),r=MS("textField");return e({textField:r}),(s,a)=>(_e(),xe(Vo,{ref_key:"textField",ref:r,modelValue:n.value,"onUpdate:modelValue":a[1]||(a[1]=o=>n.value=o),variant:"outlined",density:"compact",type:i.value?"text":"password"},{"append-inner":be(()=>[W(Ot,{onClick:a[0]||(a[0]=o=>i.value=!i.value)},{default:be(()=>[Tt(Mn(i.value?"mdi-eye-off":"mdi-eye"),1)]),_:1})]),_:1},8,["modelValue","type"]))}});function uq(t){return gu()?(Xn(t),!0):!1}function BA(){const t=new Set,e=r=>{t.delete(r)};return{on:r=>{t.add(r);const s=()=>e(r);return uq(s),{off:s}},off:e,trigger:(...r)=>Promise.all(Array.from(t).map(s=>s(...r)))}}const ld=new WeakMap,tae=(t,e)=>{var n;const i=(n=_i())==null?void 0:n.proxy;if(i==null)throw new Error("provideLocal must be called in setup");ld.has(i)||ld.set(i,Object.create(null));const r=ld.get(i);r[t]=e,Kn(t,e)},nae=(...t)=>{var e;const n=t[0],i=(e=_i())==null?void 0:e.proxy;if(i==null)throw new Error("injectLocal must be called in setup");return ld.has(i)&&n in ld.get(i)?ld.get(i)[n]:an(...t)};function mv(t){return typeof t=="function"?t():ie(t)}const iae=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rae=Object.prototype.toString,sae=t=>rae.call(t)==="[object Object]",FA=()=>{};function oae(t,e){function n(...i){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return n}function aae(t,e={}){let n,i,r=FA;const s=o=>{clearTimeout(o),r(),r=FA};return o=>{const l=mv(t),u=mv(e.maxWait);return n&&s(n),l<=0||u!==void 0&&u<=0?(i&&(s(i),i=null),Promise.resolve(o())):new Promise((c,d)=>{r=e.rejectOnCancel?d:c,u&&!i&&(i=setTimeout(()=>{n&&s(n),i=null,c(o())},u)),n=setTimeout(()=>{i&&s(i),i=null,c(o())},l)})}}function tb(t,e=200,n={}){return oae(aae(e,n),t)}function lae(t,e=200,n={}){const i=ve(t.value),r=tb(()=>{i.value=t.value},e,n);return Ie(t,()=>r()),i}function cae(t,e){return te({get(){var n;return(n=t.value)!=null?n:e},set(n){t.value=n}})}function uae(t,e,n){const i=Ie(t,(...r)=>($t(()=>i()),e(...r)),n);return i}function dq(t){var e;const n=mv(t);return(e=n==null?void 0:n.$el)!=null?e:n}const DN=iae?window:void 0;function Vh(...t){let e,n,i,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,r]=t,e=DN):[e,n,i,r]=t,!e)return FA;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},o=(c,d,h,f)=>(c.addEventListener(d,h,f),()=>c.removeEventListener(d,h,f)),l=Ie(()=>[dq(e),mv(r)],([c,d])=>{if(a(),!c)return;const h=sae(d)?{...d}:d;s.push(...n.flatMap(f=>i.map(S=>o(c,f,S,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return uq(u),u}const dae={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function hae(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:i=!1,initialValue:r={x:0,y:0},window:s=DN,target:a=s,scroll:o=!0,eventFilter:l}=t;let u=null;const c=ve(r.x),d=ve(r.y),h=ve(null),f=typeof e=="function"?e:dae[e],S=y=>{const E=f(y);u=y,E&&([c.value,d.value]=E,h.value="mouse")},_=y=>{if(y.touches.length>0){const E=f(y.touches[0]);E&&([c.value,d.value]=E,h.value="touch")}},p=()=>{if(!u||!s)return;const y=f(u);u instanceof MouseEvent&&y&&(c.value=y[0]+s.scrollX,d.value=y[1]+s.scrollY)},v=()=>{c.value=r.x,d.value=r.y},m=l?y=>l(()=>S(y),{}):y=>S(y),g=l?y=>l(()=>_(y),{}):y=>_(y),b=l?()=>l(()=>p(),{}):()=>p();if(a){const y={passive:!0};Vh(a,["mousemove","dragover"],m,y),n&&e!=="movement"&&(Vh(a,["touchstart","touchmove"],g,y),i&&Vh(a,"touchend",v,y)),o&&e==="page"&&Vh(s,"scroll",b,{passive:!0})}return{x:c,y:d,sourceType:h}}function fae(t,e={}){const{handleOutside:n=!0,window:i=DN}=e,r=e.type||"page",{x:s,y:a,sourceType:o}=hae(e),l=ve(t??(i==null?void 0:i.document.body)),u=ve(0),c=ve(0),d=ve(0),h=ve(0),f=ve(0),S=ve(0),_=ve(!0);let p=()=>{};return i&&(p=Ie([l,s,a],()=>{const v=dq(l);if(!v)return;const{left:m,top:g,width:b,height:y}=v.getBoundingClientRect();d.value=m+(r==="page"?i.pageXOffset:0),h.value=g+(r==="page"?i.pageYOffset:0),f.value=y,S.value=b;const E=s.value-d.value,T=a.value-h.value;_.value=b===0||y===0||E<0||T<0||E>b||T>y,(n||!_.value)&&(u.value=E,c.value=T)},{immediate:!0}),Vh(document,"mouseleave",()=>{_.value=!0})),{x:s,y:a,sourceType:o,elementX:u,elementY:c,elementPositionX:d,elementPositionY:h,elementHeight:f,elementWidth:S,isOutside:_,stop:p}}const nb=As("projects",()=>{const{$client:t}=wn(),{data:e}=t.project.getProjects.useQuery(),n=cae(te(()=>e.value),[]),i=ve(!1),r=async(a,o)=>{i.value=!0;try{if(n.value.includes(a))throw new Error("Project already exists");await t.project.createProject.mutate({projectId:a,password:o})}finally{i.value=!1}},s=ve(null);return{projectNames:n,focusedProjectId:s,createProject:r,loadingCreateProject:i}}),Su=As("workspace",()=>{const t=ys(ve(null)),e=ys(ve(null)),n=nb(),{$client:i}=wn(),r=tb(async()=>{const f=t.value.toJSON();e.value=f,await i.workspace.setWorkspaceLayout.mutate({layout:f})},1e3),s=()=>{const f=t.value.addPanel({id:"project-list",component:"ProjectListPanel",tabComponent:"CustomTab",params:{title:"Projects",icon:"mdi-folder-multiple",closable:!1}}),S=t.value.addPanel({id:"component-list",component:"ComponentList",tabComponent:"CustomTab",params:{title:"Components",icon:"mdi-cube-outline",closable:!1},position:{referencePanel:f,direction:"right"},initialWidth:400,minimumWidth:400,maximumWidth:400});t.value.addPanel({id:"operation-list",component:"OperationListPanel",tabComponent:"CustomTab",params:{title:"Operations",icon:"mdi-cogs",closable:!1},position:{referencePanel:S,direction:"below"}})};return{dockview:t,init:f=>{t.value=f,t.value.onDidActivePanelChange(S=>{var _;S&&(S.id==="operation-list"||S.id==="component-list"||(n.focusedProjectId=((_=S.params)==null?void 0:_.projectId)??null))}),t.value.onDidRemovePanel(S=>{var _;((_=S==null?void 0:S.params)==null?void 0:_.projectId)===n.focusedProjectId&&(n.focusedProjectId=null)}),t.value.onDidLayoutChange(r)},loadLayout:async()=>{const f=await i.workspace.getWorkspaceLayout.query();f?(t.value.fromJSON(f),e.value=f):s()},openProjectPanel:f=>{const S=`projects/${f}`,_=t.value.getPanel(S);return _?(_.focus(),_):t.value.addPanel({id:S,component:"ProjectPanel",tabComponent:"CustomTab",params:{title:`Project: ${f}`,icon:"mdi-folder",closable:!0,projectId:f}})},openCompositeInstancePanel:(f,S)=>{const _=`projects/${f}/instances/${S}`,p=t.value.getPanel(_);return p?(p.focus(),p):t.value.addPanel({id:_,component:"CompositeInstancePanel",tabComponent:"CustomTab",params:{title:`Instance: ${S}`,icon:"mdi-cube-outline",closable:!0,projectId:f,instanceId:S}})},openTerminalPanel:(f,S,_)=>{const p=`terminals/${S}`,v=t.value.getPanel(p);return v?(v.focus(),v):t.value.addPanel({id:p,component:"TerminalPanel",tabComponent:"CustomTab",params:{title:`Terminal: ${_.id}`,icon:"mdi-console",closable:!0,projectId:f,instanceId:_.id,sessionId:S}})},openLogsPanel:(f,S,_)=>{const p=`operations/${S}/instances/${_}/logs`,v=t.value.getPanel(p);return v?(v.focus(),v):t.value.addPanel({id:p,component:"LogsPanel",tabComponent:"CustomTab",params:{title:`Logs: ${_}`,icon:"mdi-text",closable:!0,projectId:f,operationId:S,instanceId:_}})},resetLayout:async()=>{t.value.clear(),s(),await r()},serialiedLayout:e}}),pae=WS("v-alert-title"),bu=Ue({border:[Boolean,Number,String]},"border");function Eu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{borderClasses:te(()=>{const i=Lt(t)?t.value:t.border,r=[];if(i===!0||i==="")r.push(`${e}--border`);else if(typeof i=="string"||i===0)for(const s of String(i).split(" "))r.push(`border-${s}`);return r})}}const yu=Ue({elevation:{type:[Number,String],validator(t){const e=parseInt(t);return!isNaN(e)&&e>=0&&e<=24}}},"elevation");function Cu(t){return{elevationClasses:te(()=>{const n=Lt(t)?t.value:t.elevation,i=[];return n==null||i.push(`elevation-${n}`),i})}}const _ae=["elevated","flat","tonal","outlined","text","plain"];function Jd(t,e){return W(He,null,[t&&W("span",{key:"overlay",class:`${e}__overlay`},null),W("span",{key:"underlay",class:`${e}__underlay`},null)])}const za=Ue({color:String,variant:{type:String,default:"elevated",validator:t=>_ae.includes(t)}},"variant");function eh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();const n=te(()=>{const{variant:s}=ie(t);return`${e}--variant-${s}`}),{colorClasses:i,colorStyles:r}=CN(te(()=>{const{variant:s,color:a}=ie(t);return{[["elevated","flat"].includes(s)?"background":"text"]:a}}));return{colorClasses:i,colorStyles:r,variantClasses:n}}const hq=Ue({baseColor:String,divided:Boolean,...bu(),...jt(),...ro(),...yu(),...no(),...Ri(),...$i(),...za()},"VBtnGroup"),Uk=vt()({name:"VBtnGroup",props:hq(),setup(t,e){let{slots:n}=e;const{themeClasses:i}=cr(t),{densityClasses:r}=Qo(t),{borderClasses:s}=Eu(t),{elevationClasses:a}=Cu(t),{roundedClasses:o}=io(t);jd({VBtn:{height:"auto",baseColor:Ve(t,"baseColor"),color:Ve(t,"color"),density:Ve(t,"density"),flat:!0,variant:Ve(t,"variant")}}),Ft(()=>W(t.tag,{class:["v-btn-group",{"v-btn-group--divided":t.divided},i.value,s.value,r.value,a.value,o.value,t.class],style:t.style},n))}}),kN=Ue({modelValue:{type:null,default:void 0},multiple:Boolean,mandatory:[Boolean,String],max:Number,selectedClass:String,disabled:Boolean},"group"),fq=Ue({value:null,disabled:Boolean,selectedClass:String},"group-item");function pq(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=Li("useGroupItem");if(!i)throw new Error("[Vuetify] useGroupItem composable must be used inside a component setup function");const r=Os();Kn(Symbol.for(`${e.description}:id`),r);const s=an(e,null);if(!s){if(!n)return s;throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${e.description}`)}const a=Ve(t,"value"),o=te(()=>!!(s.disabled.value||t.disabled));s.register({id:r,value:a,disabled:o},i),Yi(()=>{s.unregister(r)});const l=te(()=>s.isSelected(r)),u=te(()=>s.items.value[0].id===r),c=te(()=>s.items.value[s.items.value.length-1].id===r),d=te(()=>l.value&&[s.selectedClass.value,t.selectedClass]);return Ie(l,h=>{i.emit("group:selected",{value:h})},{flush:"sync"}),{id:r,isSelected:l,isFirst:u,isLast:c,toggle:()=>s.select(r,!l.value),select:h=>s.select(r,h),selectedClass:d,value:a,disabled:o,group:s}}function MN(t,e){let n=!1;const i=$n([]),r=Fn(t,"modelValue",[],h=>h==null?[]:_q(i,qr(h)),h=>{const f=gae(i,h);return t.multiple?f:f[0]}),s=Li("useGroup");function a(h,f){const S=h,_=Symbol.for(`${e.description}:id`),v=Hh(_,s==null?void 0:s.vnode).indexOf(f);ie(S.value)==null&&(S.value=v,S.useIndexAsValue=!0),v>-1?i.splice(v,0,S):i.push(S)}function o(h){if(n)return;l();const f=i.findIndex(S=>S.id===h);i.splice(f,1)}function l(){const h=i.find(f=>!f.disabled);h&&t.mandatory==="force"&&!r.value.length&&(r.value=[h.id])}ai(()=>{l()}),Yi(()=>{n=!0}),HI(()=>{for(let h=0;h<i.length;h++)i[h].useIndexAsValue&&(i[h].value=h)});function u(h,f){const S=i.find(_=>_.id===h);if(!(f&&(S!=null&&S.disabled)))if(t.multiple){const _=r.value.slice(),p=_.findIndex(m=>m===h),v=~p;if(f=f??!v,v&&t.mandatory&&_.length<=1||!v&&t.max!=null&&_.length+1>t.max)return;p<0&&f?_.push(h):p>=0&&!f&&_.splice(p,1),r.value=_}else{const _=r.value.includes(h);if(t.mandatory&&_)return;r.value=f??!_?[h]:[]}}function c(h){if(t.multiple,r.value.length){const f=r.value[0],S=i.findIndex(v=>v.id===f);let _=(S+h)%i.length,p=i[_];for(;p.disabled&&_!==S;)_=(_+h)%i.length,p=i[_];if(p.disabled)return;r.value=[i[_].id]}else{const f=i.find(S=>!S.disabled);f&&(r.value=[f.id])}}const d={register:a,unregister:o,selected:r,select:u,disabled:Ve(t,"disabled"),prev:()=>c(i.length-1),next:()=>c(1),isSelected:h=>r.value.includes(h),selectedClass:te(()=>t.selectedClass),items:te(()=>i),getItemIndex:h=>mae(i,h)};return Kn(e,d),d}function mae(t,e){const n=_q(t,[e]);return n.length?t.findIndex(i=>i.id===n[0]):-1}function _q(t,e){const n=[];return e.forEach(i=>{const r=t.find(a=>Ks(i,a.value)),s=t[i];(r==null?void 0:r.value)!=null?n.push(r.id):s!=null&&n.push(s.id)}),n}function gae(t,e){const n=[];return e.forEach(i=>{const r=t.findIndex(s=>s.id===i);if(~r){const s=t[r];n.push(s.value!=null?s.value:r)}}),n}const mq=Symbol.for("vuetify:v-btn-toggle"),vae=Ue({...hq(),...kN()},"VBtnToggle");vt()({name:"VBtnToggle",props:vae(),emits:{"update:modelValue":t=>!0},setup(t,e){let{slots:n}=e;const{isSelected:i,next:r,prev:s,select:a,selected:o}=MN(t,mq);return Ft(()=>{const l=Uk.filterProps(t);return W(Uk,rt({class:["v-btn-toggle",t.class]},l,{style:t.style}),{default:()=>{var u;return[(u=n.default)==null?void 0:u.call(n,{isSelected:i,next:r,prev:s,select:a,selected:o})]}})}),{next:r,prev:s,select:a}}});const Sae=Ue({bgColor:String,color:String,indeterminate:[Boolean,String],modelValue:{type:[Number,String],default:0},rotate:{type:[Number,String],default:0},width:{type:[Number,String],default:4},...jt(),...Np(),...Ri({tag:"div"}),...$i()},"VProgressCircular"),gq=vt()({name:"VProgressCircular",props:Sae(),setup(t,e){let{slots:n}=e;const i=20,r=2*Math.PI*i,s=ve(),{themeClasses:a}=cr(t),{sizeClasses:o,sizeStyles:l}=xp(t),{textColorClasses:u,textColorStyles:c}=Xs(Ve(t,"color")),{textColorClasses:d,textColorStyles:h}=Xs(Ve(t,"bgColor")),{intersectionRef:f,isIntersecting:S}=iq(),{resizeRef:_,contentRect:p}=xf(),v=te(()=>Math.max(0,Math.min(100,parseFloat(t.modelValue)))),m=te(()=>Number(t.width)),g=te(()=>l.value?Number(t.size):p.value?p.value.width:Math.max(m.value,32)),b=te(()=>i/(1-m.value/g.value)*2),y=te(()=>m.value/g.value*b.value),E=te(()=>Ht((100-v.value)/100*r));return Wr(()=>{f.value=s.value,_.value=s.value}),Ft(()=>W(t.tag,{ref:s,class:["v-progress-circular",{"v-progress-circular--indeterminate":!!t.indeterminate,"v-progress-circular--visible":S.value,"v-progress-circular--disable-shrink":t.indeterminate==="disable-shrink"},a.value,o.value,u.value,t.class],style:[l.value,c.value,t.style],role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":t.indeterminate?void 0:v.value},{default:()=>[W("svg",{style:{transform:`rotate(calc(-90deg + ${Number(t.rotate)}deg))`},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${b.value} ${b.value}`},[W("circle",{class:["v-progress-circular__underlay",d.value],style:h.value,fill:"transparent",cx:"50%",cy:"50%",r:i,"stroke-width":y.value,"stroke-dasharray":r,"stroke-dashoffset":0},null),W("circle",{class:"v-progress-circular__overlay",fill:"transparent",cx:"50%",cy:"50%",r:i,"stroke-width":y.value,"stroke-dasharray":r,"stroke-dashoffset":E.value},null)]),n.default&&W("div",{class:"v-progress-circular__content"},[n.default({value:v.value})])]})),{}}}),bae=["static","relative","fixed","absolute","sticky"],LN=Ue({position:{type:String,validator:t=>bae.includes(t)}},"position");function PN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{positionClasses:te(()=>t.position?`${e}--${t.position}`:void 0)}}function Eae(){const t=Li("useRoute");return te(()=>{var e;return(e=t==null?void 0:t.proxy)==null?void 0:e.$route})}function yae(){var t,e;return(e=(t=Li("useRouter"))==null?void 0:t.proxy)==null?void 0:e.$router}function ib(t,e){var d,h;const n=BS("RouterLink"),i=te(()=>!!(t.href||t.to)),r=te(()=>(i==null?void 0:i.value)||M1(e,"click")||M1(t,"click"));if(typeof n=="string"||!("useLink"in n)){const f=Ve(t,"href");return{isLink:i,isClickable:r,href:f,linkProps:$n({href:f})}}const s=te(()=>({...t,to:Ve(()=>t.to||"")})),a=n.useLink(s.value),o=te(()=>t.to?a:void 0),l=Eae(),u=te(()=>{var f,S,_;return o.value?t.exact?l.value?((_=o.value.isExactActive)==null?void 0:_.value)&&Ks(o.value.route.value.query,l.value.query):((S=o.value.isExactActive)==null?void 0:S.value)??!1:((f=o.value.isActive)==null?void 0:f.value)??!1:!1}),c=te(()=>{var f;return t.to?(f=o.value)==null?void 0:f.route.value.href:t.href});return{isLink:i,isClickable:r,isActive:u,route:(d=o.value)==null?void 0:d.route,navigate:(h=o.value)==null?void 0:h.navigate,href:c,linkProps:$n({href:c,"aria-current":te(()=>u.value?"page":void 0)})}}const rb=Ue({href:String,replace:Boolean,to:[String,Object],exact:Boolean},"router");let DE=!1;function Cae(t,e){let n=!1,i,r;dn&&(t!=null&&t.beforeEach)&&($t(()=>{window.addEventListener("popstate",s),i=t.beforeEach((a,o,l)=>{DE?n?e(l):l():setTimeout(()=>n?e(l):l()),DE=!0}),r=t==null?void 0:t.afterEach(()=>{DE=!1})}),Xn(()=>{window.removeEventListener("popstate",s),i==null||i(),r==null||r()}));function s(a){var o;(o=a.state)!=null&&o.replaced||(n=!0,setTimeout(()=>n=!1))}}function Tae(t,e){Ie(()=>{var n;return(n=t.isActive)==null?void 0:n.value},n=>{t.isLink.value&&n&&e&&$t(()=>{e(!0)})},{immediate:!0})}const UA=Symbol("rippleStop"),wae=80;function $k(t,e){t.style.transform=e,t.style.webkitTransform=e}function $A(t){return t.constructor.name==="TouchEvent"}function vq(t){return t.constructor.name==="KeyboardEvent"}const Rae=function(t,e){var d;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=0,r=0;if(!vq(t)){const h=e.getBoundingClientRect(),f=$A(t)?t.touches[t.touches.length-1]:t;i=f.clientX-h.left,r=f.clientY-h.top}let s=0,a=.3;(d=e._ripple)!=null&&d.circle?(a=.15,s=e.clientWidth/2,s=n.center?s:s+Math.sqrt((i-s)**2+(r-s)**2)/4):s=Math.sqrt(e.clientWidth**2+e.clientHeight**2)/2;const o=`${(e.clientWidth-s*2)/2}px`,l=`${(e.clientHeight-s*2)/2}px`,u=n.center?o:`${i-s}px`,c=n.center?l:`${r-s}px`;return{radius:s,scale:a,x:u,y:c,centerX:o,centerY:l}},gv={show(t,e){var f;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!((f=e==null?void 0:e._ripple)!=null&&f.enabled))return;const i=document.createElement("span"),r=document.createElement("span");i.appendChild(r),i.className="v-ripple__container",n.class&&(i.className+=` ${n.class}`);const{radius:s,scale:a,x:o,y:l,centerX:u,centerY:c}=Rae(t,e,n),d=`${s*2}px`;r.className="v-ripple__animation",r.style.width=d,r.style.height=d,e.appendChild(i);const h=window.getComputedStyle(e);h&&h.position==="static"&&(e.style.position="relative",e.dataset.previousPosition="static"),r.classList.add("v-ripple__animation--enter"),r.classList.add("v-ripple__animation--visible"),$k(r,`translate(${o}, ${l}) scale3d(${a},${a},${a})`),r.dataset.activated=String(performance.now()),requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classList.remove("v-ripple__animation--enter"),r.classList.add("v-ripple__animation--in"),$k(r,`translate(${u}, ${c}) scale3d(1,1,1)`)})})},hide(t){var s;if(!((s=t==null?void 0:t._ripple)!=null&&s.enabled))return;const e=t.getElementsByClassName("v-ripple__animation");if(e.length===0)return;const n=e[e.length-1];if(n.dataset.isHiding)return;n.dataset.isHiding="true";const i=performance.now()-Number(n.dataset.activated),r=Math.max(250-i,0);setTimeout(()=>{n.classList.remove("v-ripple__animation--in"),n.classList.add("v-ripple__animation--out"),setTimeout(()=>{var o;t.getElementsByClassName("v-ripple__animation").length===1&&t.dataset.previousPosition&&(t.style.position=t.dataset.previousPosition,delete t.dataset.previousPosition),((o=n.parentNode)==null?void 0:o.parentNode)===t&&t.removeChild(n.parentNode)},300)},r)}};function Sq(t){return typeof t>"u"||!!t}function Df(t){const e={},n=t.currentTarget;if(!(!(n!=null&&n._ripple)||n._ripple.touched||t[UA])){if(t[UA]=!0,$A(t))n._ripple.touched=!0,n._ripple.isTouch=!0;else if(n._ripple.isTouch)return;if(e.center=n._ripple.centered||vq(t),n._ripple.class&&(e.class=n._ripple.class),$A(t)){if(n._ripple.showTimerCommit)return;n._ripple.showTimerCommit=()=>{gv.show(t,n,e)},n._ripple.showTimer=window.setTimeout(()=>{var i;(i=n==null?void 0:n._ripple)!=null&&i.showTimerCommit&&(n._ripple.showTimerCommit(),n._ripple.showTimerCommit=null)},wae)}else gv.show(t,n,e)}}function Gk(t){t[UA]=!0}function is(t){const e=t.currentTarget;if(e!=null&&e._ripple){if(window.clearTimeout(e._ripple.showTimer),t.type==="touchend"&&e._ripple.showTimerCommit){e._ripple.showTimerCommit(),e._ripple.showTimerCommit=null,e._ripple.showTimer=window.setTimeout(()=>{is(t)});return}window.setTimeout(()=>{e._ripple&&(e._ripple.touched=!1)}),gv.hide(e)}}function bq(t){const e=t.currentTarget;e!=null&&e._ripple&&(e._ripple.showTimerCommit&&(e._ripple.showTimerCommit=null),window.clearTimeout(e._ripple.showTimer))}let kf=!1;function Eq(t){!kf&&(t.keyCode===N1.enter||t.keyCode===N1.space)&&(kf=!0,Df(t))}function yq(t){kf=!1,is(t)}function Cq(t){kf&&(kf=!1,is(t))}function Tq(t,e,n){const{value:i,modifiers:r}=e,s=Sq(i);if(s||gv.hide(t),t._ripple=t._ripple??{},t._ripple.enabled=s,t._ripple.centered=r.center,t._ripple.circle=r.circle,W3(i)&&i.class&&(t._ripple.class=i.class),s&&!n){if(r.stop){t.addEventListener("touchstart",Gk,{passive:!0}),t.addEventListener("mousedown",Gk);return}t.addEventListener("touchstart",Df,{passive:!0}),t.addEventListener("touchend",is,{passive:!0}),t.addEventListener("touchmove",bq,{passive:!0}),t.addEventListener("touchcancel",is),t.addEventListener("mousedown",Df),t.addEventListener("mouseup",is),t.addEventListener("mouseleave",is),t.addEventListener("keydown",Eq),t.addEventListener("keyup",yq),t.addEventListener("blur",Cq),t.addEventListener("dragstart",is,{passive:!0})}else!s&&n&&wq(t)}function wq(t){t.removeEventListener("mousedown",Df),t.removeEventListener("touchstart",Df),t.removeEventListener("touchend",is),t.removeEventListener("touchmove",bq),t.removeEventListener("touchcancel",is),t.removeEventListener("mouseup",is),t.removeEventListener("mouseleave",is),t.removeEventListener("keydown",Eq),t.removeEventListener("keyup",yq),t.removeEventListener("dragstart",is),t.removeEventListener("blur",Cq)}function Aae(t,e){Tq(t,e,!1)}function Oae(t){delete t._ripple,wq(t)}function Iae(t,e){if(e.value===e.oldValue)return;const n=Sq(e.oldValue);Tq(t,e,n)}const Dp={mounted:Aae,unmounted:Oae,updated:Iae},Nae=Ue({active:{type:Boolean,default:void 0},activeColor:String,baseColor:String,symbol:{type:null,default:mq},flat:Boolean,icon:[Boolean,String,Function,Object],prependIcon:on,appendIcon:on,block:Boolean,readonly:Boolean,slim:Boolean,stacked:Boolean,ripple:{type:[Boolean,Object],default:!0},text:String,...bu(),...jt(),...ro(),...Ha(),...yu(),...fq(),...wN(),...ZS(),...LN(),...no(),...rb(),...Np(),...Ri({tag:"button"}),...$i(),...za({variant:"elevated"})},"VBtn"),Sn=vt()({name:"VBtn",props:Nae(),emits:{"group:selected":t=>!0},setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{borderClasses:s}=Eu(t),{densityClasses:a}=Qo(t),{dimensionStyles:o}=Va(t),{elevationClasses:l}=Cu(t),{loaderClasses:u}=RN(t),{locationStyles:c}=JS(t),{positionClasses:d}=PN(t),{roundedClasses:h}=io(t),{sizeClasses:f,sizeStyles:S}=xp(t),_=pq(t,t.symbol,!1),p=ib(t,n),v=te(()=>{var I;return t.active!==void 0?t.active:p.isLink.value?(I=p.isActive)==null?void 0:I.value:_==null?void 0:_.isSelected.value}),m=te(()=>v.value?t.activeColor??t.color:t.color),g=te(()=>{var A,x;return{color:(_==null?void 0:_.isSelected.value)&&(!p.isLink.value||((A=p.isActive)==null?void 0:A.value))||!_||((x=p.isActive)==null?void 0:x.value)?m.value??t.baseColor:t.baseColor,variant:t.variant}}),{colorClasses:b,colorStyles:y,variantClasses:E}=eh(g),T=te(()=>(_==null?void 0:_.disabled.value)||t.disabled),C=te(()=>t.variant==="elevated"&&!(t.disabled||t.flat||t.border)),w=te(()=>{if(!(t.value===void 0||typeof t.value=="symbol"))return Object(t.value)===t.value?JSON.stringify(t.value,null,0):t.value});function R(I){var A;T.value||p.isLink.value&&(I.metaKey||I.ctrlKey||I.shiftKey||I.button!==0||n.target==="_blank")||((A=p.navigate)==null||A.call(p,I),_==null||_.toggle())}return Tae(p,_==null?void 0:_.select),Ft(()=>{const I=p.isLink.value?"a":t.tag,A=!!(t.prependIcon||i.prepend),x=!!(t.appendIcon||i.append),O=!!(t.icon&&t.icon!==!0);return Ar(W(I,rt({type:I==="a"?void 0:"button",class:["v-btn",_==null?void 0:_.selectedClass.value,{"v-btn--active":v.value,"v-btn--block":t.block,"v-btn--disabled":T.value,"v-btn--elevated":C.value,"v-btn--flat":t.flat,"v-btn--icon":!!t.icon,"v-btn--loading":t.loading,"v-btn--readonly":t.readonly,"v-btn--slim":t.slim,"v-btn--stacked":t.stacked},r.value,s.value,b.value,a.value,l.value,u.value,d.value,h.value,f.value,E.value,t.class],style:[y.value,o.value,c.value,S.value,t.style],"aria-busy":t.loading?!0:void 0,disabled:T.value||void 0,tabindex:t.loading||t.readonly?-1:void 0,onClick:R,value:w.value},p.linkProps),{default:()=>{var D;return[Jd(!0,"v-btn"),!t.icon&&A&&W("span",{key:"prepend",class:"v-btn__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!t.prependIcon,defaults:{VIcon:{icon:t.prependIcon}}},i.prepend):W(Ot,{key:"prepend-icon",icon:t.prependIcon},null)]),W("span",{class:"v-btn__content","data-no-activator":""},[!i.default&&O?W(Ot,{key:"content-icon",icon:t.icon},null):W(pi,{key:"content-defaults",disabled:!O,defaults:{VIcon:{icon:t.icon}}},{default:()=>{var L;return[((L=i.default)==null?void 0:L.call(i))??t.text]}})]),!t.icon&&x&&W("span",{key:"append",class:"v-btn__append"},[i.append?W(pi,{key:"append-defaults",disabled:!t.appendIcon,defaults:{VIcon:{icon:t.appendIcon}}},i.append):W(Ot,{key:"append-icon",icon:t.appendIcon},null)]),!!t.loading&&W("span",{key:"loader",class:"v-btn__loader"},[((D=i.loader)==null?void 0:D.call(i))??W(gq,{color:typeof t.loading=="boolean"?void 0:t.loading,indeterminate:!0,width:"2"},null)])]}}),[[Dp,!T.value&&t.ripple,"",{center:!!t.icon}]])}),{group:_}}}),xae=["success","info","warning","error"],Dae=Ue({border:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["top","end","bottom","start"].includes(t)},borderColor:String,closable:Boolean,closeIcon:{type:on,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:t=>xae.includes(t)},...jt(),...ro(),...Ha(),...yu(),...ZS(),...LN(),...no(),...Ri(),...$i(),...za({variant:"flat"})},"VAlert"),kae=vt()({name:"VAlert",props:Dae(),emits:{"click:close":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{emit:n,slots:i}=e;const r=Fn(t,"modelValue"),s=te(()=>{if(t.icon!==!1)return t.type?t.icon??`$${t.type}`:t.icon}),a=te(()=>({color:t.color??t.type,variant:t.variant})),{themeClasses:o}=cr(t),{colorClasses:l,colorStyles:u,variantClasses:c}=eh(a),{densityClasses:d}=Qo(t),{dimensionStyles:h}=Va(t),{elevationClasses:f}=Cu(t),{locationStyles:S}=JS(t),{positionClasses:_}=PN(t),{roundedClasses:p}=io(t),{textColorClasses:v,textColorStyles:m}=Xs(Ve(t,"borderColor")),{t:g}=Ip(),b=te(()=>({"aria-label":g(t.closeLabel),onClick(y){r.value=!1,n("click:close",y)}}));return()=>{const y=!!(i.prepend||s.value),E=!!(i.title||t.title),T=!!(i.close||t.closable);return r.value&&W(t.tag,{class:["v-alert",t.border&&{"v-alert--border":!!t.border,[`v-alert--border-${t.border===!0?"start":t.border}`]:!0},{"v-alert--prominent":t.prominent},o.value,l.value,d.value,f.value,_.value,p.value,c.value,t.class],style:[u.value,h.value,S.value,t.style],role:"alert"},{default:()=>{var C,w;return[Jd(!1,"v-alert"),t.border&&W("div",{key:"border",class:["v-alert__border",v.value],style:m.value},null),y&&W("div",{key:"prepend",class:"v-alert__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!s.value,defaults:{VIcon:{density:t.density,icon:s.value,size:t.prominent?44:28}}},i.prepend):W(Ot,{key:"prepend-icon",density:t.density,icon:s.value,size:t.prominent?44:28},null)]),W("div",{class:"v-alert__content"},[E&&W(pae,{key:"title"},{default:()=>{var R;return[((R=i.title)==null?void 0:R.call(i))??t.title]}}),((C=i.text)==null?void 0:C.call(i))??t.text,(w=i.default)==null?void 0:w.call(i)]),i.append&&W("div",{key:"append",class:"v-alert__append"},[i.append()]),T&&W("div",{key:"close",class:"v-alert__close"},[i.close?W(pi,{key:"close-defaults",defaults:{VBtn:{icon:t.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var R;return[(R=i.close)==null?void 0:R.call(i,{props:b.value})]}}):W(Sn,rt({key:"close-btn",icon:t.closeIcon,size:"x-small",variant:"text"},b.value),null)])]}})}}}),zo=vt()({name:"VCardActions",props:jt(),setup(t,e){let{slots:n}=e;return jd({VBtn:{slim:!0,variant:"text"}}),Ft(()=>{var i;return W("div",{class:["v-card-actions",t.class],style:t.style},[(i=n.default)==null?void 0:i.call(n)])}),{}}}),Mae=Ue({opacity:[Number,String],...jt(),...Ri()},"VCardSubtitle"),Rq=vt()({name:"VCardSubtitle",props:Mae(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-card-subtitle",t.class],style:[{"--v-card-subtitle-opacity":t.opacity},t.style]},n)),{}}}),BN=WS("v-card-title");function Lae(t){return{aspectStyles:te(()=>{const e=Number(t.aspectRatio);return e?{paddingBottom:String(1/e*100)+"%"}:void 0})}}const Aq=Ue({aspectRatio:[String,Number],contentClass:null,inline:Boolean,...jt(),...Ha()},"VResponsive"),Hk=vt()({name:"VResponsive",props:Aq(),setup(t,e){let{slots:n}=e;const{aspectStyles:i}=Lae(t),{dimensionStyles:r}=Va(t);return Ft(()=>{var s;return W("div",{class:["v-responsive",{"v-responsive--inline":t.inline},t.class],style:[r.value,t.style]},[W("div",{class:"v-responsive__sizer",style:i.value},null),(s=n.additional)==null?void 0:s.call(n),n.default&&W("div",{class:["v-responsive__content",t.contentClass]},[n.default()])])}),{}}}),Pae=Ue({absolute:Boolean,alt:String,cover:Boolean,color:String,draggable:{type:[Boolean,String],default:void 0},eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:()=>({root:void 0,rootMargin:void 0,threshold:void 0})},sizes:String,src:{type:[String,Object],default:""},crossorigin:String,referrerpolicy:String,srcset:String,position:String,...Aq(),...jt(),...no(),...Zd()},"VImg"),Oq=vt()({name:"VImg",directives:{intersect:NN},props:Pae(),emits:{loadstart:t=>!0,load:t=>!0,error:t=>!0},setup(t,e){let{emit:n,slots:i}=e;const{backgroundColorClasses:r,backgroundColorStyles:s}=Il(Ve(t,"color")),{roundedClasses:a}=io(t),o=Li("VImg"),l=ut(""),u=ve(),c=ut(t.eager?"loading":"idle"),d=ut(),h=ut(),f=te(()=>t.src&&typeof t.src=="object"?{src:t.src.src,srcset:t.srcset||t.src.srcset,lazySrc:t.lazySrc||t.src.lazySrc,aspect:Number(t.aspectRatio||t.src.aspect||0)}:{src:t.src,srcset:t.srcset,lazySrc:t.lazySrc,aspect:Number(t.aspectRatio||0)}),S=te(()=>f.value.aspect||d.value/h.value||0);Ie(()=>t.src,()=>{_(c.value!=="idle")}),Ie(S,(A,x)=>{!A&&x&&u.value&&b(u.value)}),vu(()=>_());function _(A){if(!(t.eager&&A)&&!(sN&&!A&&!t.eager)){if(c.value="loading",f.value.lazySrc){const x=new Image;x.src=f.value.lazySrc,b(x,null)}f.value.src&&$t(()=>{var x;n("loadstart",((x=u.value)==null?void 0:x.currentSrc)||f.value.src),setTimeout(()=>{var O;if(!o.isUnmounted)if((O=u.value)!=null&&O.complete){if(u.value.naturalWidth||v(),c.value==="error")return;S.value||b(u.value,null),c.value==="loading"&&p()}else S.value||b(u.value),m()})})}}function p(){var A;o.isUnmounted||(m(),b(u.value),c.value="loaded",n("load",((A=u.value)==null?void 0:A.currentSrc)||f.value.src))}function v(){var A;o.isUnmounted||(c.value="error",n("error",((A=u.value)==null?void 0:A.currentSrc)||f.value.src))}function m(){const A=u.value;A&&(l.value=A.currentSrc||A.src)}let g=-1;Yi(()=>{clearTimeout(g)});function b(A){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;const O=()=>{if(clearTimeout(g),o.isUnmounted)return;const{naturalHeight:D,naturalWidth:L}=A;D||L?(d.value=L,h.value=D):!A.complete&&c.value==="loading"&&x!=null?g=window.setTimeout(O,x):(A.currentSrc.endsWith(".svg")||A.currentSrc.startsWith("data:image/svg+xml"))&&(d.value=1,h.value=1)};O()}const y=te(()=>({"v-img__img--cover":t.cover,"v-img__img--contain":!t.cover})),E=()=>{var O;if(!f.value.src||c.value==="idle")return null;const A=W("img",{class:["v-img__img",y.value],style:{objectPosition:t.position},crossorigin:t.crossorigin,src:f.value.src,srcset:f.value.srcset,alt:t.alt,referrerpolicy:t.referrerpolicy,draggable:t.draggable,sizes:t.sizes,ref:u,onLoad:p,onError:v},null),x=(O=i.sources)==null?void 0:O.call(i);return W(bl,{transition:t.transition,appear:!0},{default:()=>[Ar(x?W("picture",{class:"v-img__picture"},[x,A]):A,[[Wd,c.value==="loaded"]])]})},T=()=>W(bl,{transition:t.transition},{default:()=>[f.value.lazySrc&&c.value!=="loaded"&&W("img",{class:["v-img__img","v-img__img--preload",y.value],style:{objectPosition:t.position},crossorigin:t.crossorigin,src:f.value.lazySrc,alt:t.alt,referrerpolicy:t.referrerpolicy,draggable:t.draggable},null)]}),C=()=>i.placeholder?W(bl,{transition:t.transition,appear:!0},{default:()=>[(c.value==="loading"||c.value==="error"&&!i.error)&&W("div",{class:"v-img__placeholder"},[i.placeholder()])]}):null,w=()=>i.error?W(bl,{transition:t.transition,appear:!0},{default:()=>[c.value==="error"&&W("div",{class:"v-img__error"},[i.error()])]}):null,R=()=>t.gradient?W("div",{class:"v-img__gradient",style:{backgroundImage:`linear-gradient(${t.gradient})`}},null):null,I=ut(!1);{const A=Ie(S,x=>{x&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{I.value=!0})}),A())})}return Ft(()=>{const A=Hk.filterProps(t);return Ar(W(Hk,rt({class:["v-img",{"v-img--absolute":t.absolute,"v-img--booting":!I.value},r.value,a.value,t.class],style:[{width:Ht(t.width==="auto"?d.value:t.width)},s.value,t.style]},A,{aspectRatio:S.value,"aria-label":t.alt,role:t.alt?"img":void 0}),{additional:()=>W(He,null,[W(E,null,null),W(T,null,null),W(R,null,null),W(C,null,null),W(w,null,null)]),default:i.default}),[[Jl("intersect"),{handler:_,options:t.options},null,{once:!0}]])}),{currentSrc:l,image:u,state:c,naturalWidth:d,naturalHeight:h}}}),Bae=Ue({start:Boolean,end:Boolean,icon:on,image:String,text:String,...bu(),...jt(),...ro(),...no(),...Np(),...Ri(),...$i(),...za({variant:"flat"})},"VAvatar"),Ll=vt()({name:"VAvatar",props:Bae(),setup(t,e){let{slots:n}=e;const{themeClasses:i}=cr(t),{borderClasses:r}=Eu(t),{colorClasses:s,colorStyles:a,variantClasses:o}=eh(t),{densityClasses:l}=Qo(t),{roundedClasses:u}=io(t),{sizeClasses:c,sizeStyles:d}=xp(t);return Ft(()=>W(t.tag,{class:["v-avatar",{"v-avatar--start":t.start,"v-avatar--end":t.end},i.value,r.value,s.value,l.value,u.value,c.value,o.value,t.class],style:[a.value,d.value,t.style]},{default:()=>[n.default?W(pi,{key:"content-defaults",defaults:{VImg:{cover:!0,src:t.image},VIcon:{icon:t.icon}}},{default:()=>[n.default()]}):t.image?W(Oq,{key:"image",src:t.image,alt:"",cover:!0},null):t.icon?W(Ot,{key:"icon",icon:t.icon},null):t.text,Jd(!1,"v-avatar")]})),{}}}),Fae=Ue({appendAvatar:String,appendIcon:on,prependAvatar:String,prependIcon:on,subtitle:[String,Number],title:[String,Number],...jt(),...ro()},"VCardItem"),Uae=vt()({name:"VCardItem",props:Fae(),setup(t,e){let{slots:n}=e;return Ft(()=>{var u;const i=!!(t.prependAvatar||t.prependIcon),r=!!(i||n.prepend),s=!!(t.appendAvatar||t.appendIcon),a=!!(s||n.append),o=!!(t.title!=null||n.title),l=!!(t.subtitle!=null||n.subtitle);return W("div",{class:["v-card-item",t.class],style:t.style},[r&&W("div",{key:"prepend",class:"v-card-item__prepend"},[n.prepend?W(pi,{key:"prepend-defaults",disabled:!i,defaults:{VAvatar:{density:t.density,image:t.prependAvatar},VIcon:{density:t.density,icon:t.prependIcon}}},n.prepend):W(He,null,[t.prependAvatar&&W(Ll,{key:"prepend-avatar",density:t.density,image:t.prependAvatar},null),t.prependIcon&&W(Ot,{key:"prepend-icon",density:t.density,icon:t.prependIcon},null)])]),W("div",{class:"v-card-item__content"},[o&&W(BN,{key:"title"},{default:()=>{var c;return[((c=n.title)==null?void 0:c.call(n))??t.title]}}),l&&W(Rq,{key:"subtitle"},{default:()=>{var c;return[((c=n.subtitle)==null?void 0:c.call(n))??t.subtitle]}}),(u=n.default)==null?void 0:u.call(n)]),a&&W("div",{key:"append",class:"v-card-item__append"},[n.append?W(pi,{key:"append-defaults",disabled:!s,defaults:{VAvatar:{density:t.density,image:t.appendAvatar},VIcon:{density:t.density,icon:t.appendIcon}}},n.append):W(He,null,[t.appendIcon&&W(Ot,{key:"append-icon",density:t.density,icon:t.appendIcon},null),t.appendAvatar&&W(Ll,{key:"append-avatar",density:t.density,image:t.appendAvatar},null)])])])}),{}}}),$ae=Ue({opacity:[Number,String],...jt(),...Ri()},"VCardText"),Po=vt()({name:"VCardText",props:$ae(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-card-text",t.class],style:[{"--v-card-text-opacity":t.opacity},t.style]},n)),{}}}),Gae=Ue({appendAvatar:String,appendIcon:on,disabled:Boolean,flat:Boolean,hover:Boolean,image:String,link:{type:Boolean,default:void 0},prependAvatar:String,prependIcon:on,ripple:{type:[Boolean,Object],default:!0},subtitle:[String,Number],text:[String,Number],title:[String,Number],...bu(),...jt(),...ro(),...Ha(),...yu(),...wN(),...ZS(),...LN(),...no(),...rb(),...Ri(),...$i(),...za({variant:"elevated"})},"VCard"),Is=vt()({name:"VCard",directives:{Ripple:Dp},props:Gae(),setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{borderClasses:s}=Eu(t),{colorClasses:a,colorStyles:o,variantClasses:l}=eh(t),{densityClasses:u}=Qo(t),{dimensionStyles:c}=Va(t),{elevationClasses:d}=Cu(t),{loaderClasses:h}=RN(t),{locationStyles:f}=JS(t),{positionClasses:S}=PN(t),{roundedClasses:_}=io(t),p=ib(t,n),v=te(()=>t.link!==!1&&p.isLink.value),m=te(()=>!t.disabled&&t.link!==!1&&(t.link||p.isClickable.value));return Ft(()=>{const g=v.value?"a":t.tag,b=!!(i.title||t.title!=null),y=!!(i.subtitle||t.subtitle!=null),E=b||y,T=!!(i.append||t.appendAvatar||t.appendIcon),C=!!(i.prepend||t.prependAvatar||t.prependIcon),w=!!(i.image||t.image),R=E||C||T,I=!!(i.text||t.text!=null);return Ar(W(g,rt({class:["v-card",{"v-card--disabled":t.disabled,"v-card--flat":t.flat,"v-card--hover":t.hover&&!(t.disabled||t.flat),"v-card--link":m.value},r.value,s.value,a.value,u.value,d.value,h.value,S.value,_.value,l.value,t.class],style:[o.value,c.value,f.value,t.style],onClick:m.value&&p.navigate,tabindex:t.disabled?-1:void 0},p.linkProps),{default:()=>{var A;return[w&&W("div",{key:"image",class:"v-card__image"},[i.image?W(pi,{key:"image-defaults",disabled:!t.image,defaults:{VImg:{cover:!0,src:t.image}}},i.image):W(Oq,{key:"image-img",cover:!0,src:t.image},null)]),W(sq,{name:"v-card",active:!!t.loading,color:typeof t.loading=="boolean"?void 0:t.loading},{default:i.loader}),R&&W(Uae,{key:"item",prependAvatar:t.prependAvatar,prependIcon:t.prependIcon,title:t.title,subtitle:t.subtitle,appendAvatar:t.appendAvatar,appendIcon:t.appendIcon},{default:i.item,prepend:i.prepend,title:i.title,subtitle:i.subtitle,append:i.append}),I&&W(Po,{key:"text"},{default:()=>{var x;return[((x=i.text)==null?void 0:x.call(i))??t.text]}}),(A=i.default)==null?void 0:A.call(i),i.actions&&W(zo,null,{default:i.actions}),Jd(m.value,"v-card")]}}),[[Jl("ripple"),m.value&&t.ripple]])}),{}}});function kE(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Hae(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Vk(t,e){if(t.side==="top"||t.side==="bottom"){const{side:n,align:i}=t,r=i==="left"?0:i==="center"?e.width/2:i==="right"?e.width:i,s=n==="top"?0:n==="bottom"?e.height:n;return kE({x:r,y:s},e)}else if(t.side==="left"||t.side==="right"){const{side:n,align:i}=t,r=n==="left"?0:n==="right"?e.width:n,s=i==="top"?0:i==="center"?e.height/2:i==="bottom"?e.height:i;return kE({x:r,y:s},e)}return kE({x:e.width/2,y:e.height/2},e)}const Iq={static:qae,connected:Wae},Vae=Ue({locationStrategy:{type:[String,Function],default:"static",validator:t=>typeof t=="function"||t in Iq},location:{type:String,default:"bottom"},origin:{type:String,default:"auto"},offset:[Number,String,Array]},"VOverlay-location-strategies");function zae(t,e){const n=ve({}),i=ve();dn&&nu(()=>!!(e.isActive.value&&t.locationStrategy),s=>{var a,o;Ie(()=>t.locationStrategy,s),Xn(()=>{window.removeEventListener("resize",r),i.value=void 0}),window.addEventListener("resize",r,{passive:!0}),typeof t.locationStrategy=="function"?i.value=(a=t.locationStrategy(e,t,n))==null?void 0:a.updateLocation:i.value=(o=Iq[t.locationStrategy](e,t,n))==null?void 0:o.updateLocation});function r(s){var a;(a=i.value)==null||a.call(i,s)}return{contentStyles:n,updateLocation:i}}function qae(){}function Yae(t,e){const n=uN(t);return e?n.x+=parseFloat(t.style.right||0):n.x-=parseFloat(t.style.left||0),n.y-=parseFloat(t.style.top||0),n}function Wae(t,e,n){(Array.isArray(t.target.value)||Sne(t.target.value))&&Object.assign(n.value,{position:"fixed",top:0,[t.isRtl.value?"right":"left"]:0});const{preferredAnchor:r,preferredOrigin:s}=aN(()=>{const S=TA(e.location,t.isRtl.value),_=e.origin==="overlap"?S:e.origin==="auto"?SE(S):TA(e.origin,t.isRtl.value);return S.side===_.side&&S.align===bE(_).align?{preferredAnchor:P1(S),preferredOrigin:P1(_)}:{preferredAnchor:S,preferredOrigin:_}}),[a,o,l,u]=["minWidth","minHeight","maxWidth","maxHeight"].map(S=>te(()=>{const _=parseFloat(e[S]);return isNaN(_)?1/0:_})),c=te(()=>{if(Array.isArray(e.offset))return e.offset;if(typeof e.offset=="string"){const S=e.offset.split(" ").map(parseFloat);return S.length<2&&S.push(0),S}return typeof e.offset=="number"?[e.offset,0]:[0,0]});let d=!1;const h=new ResizeObserver(()=>{d&&f()});Ie([t.target,t.contentEl],(S,_)=>{let[p,v]=S,[m,g]=_;m&&!Array.isArray(m)&&h.unobserve(m),p&&!Array.isArray(p)&&h.observe(p),g&&h.unobserve(g),v&&h.observe(v)},{immediate:!0}),Xn(()=>{h.disconnect()});function f(){if(d=!1,requestAnimationFrame(()=>d=!0),!t.target.value||!t.contentEl.value)return;const S=tz(t.target.value),_=Yae(t.contentEl.value,t.isRtl.value),p=ov(t.contentEl.value),v=12;p.length||(p.push(document.documentElement),t.contentEl.value.style.top&&t.contentEl.value.style.left||(_.x-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x")||0),_.y-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y")||0)));const m=p.reduce((I,A)=>{const x=A.getBoundingClientRect(),O=new Hc({x:A===document.documentElement?0:x.x,y:A===document.documentElement?0:x.y,width:A.clientWidth,height:A.clientHeight});return I?new Hc({x:Math.max(I.left,O.left),y:Math.max(I.top,O.top),width:Math.min(I.right,O.right)-Math.max(I.left,O.left),height:Math.min(I.bottom,O.bottom)-Math.max(I.top,O.top)}):O},void 0);m.x+=v,m.y+=v,m.width-=v*2,m.height-=v*2;let g={anchor:r.value,origin:s.value};function b(I){const A=new Hc(_),x=Vk(I.anchor,S),O=Vk(I.origin,A);let{x:D,y:L}=Hae(x,O);switch(I.anchor.side){case"top":L-=c.value[0];break;case"bottom":L+=c.value[0];break;case"left":D-=c.value[0];break;case"right":D+=c.value[0];break}switch(I.anchor.align){case"top":L-=c.value[1];break;case"bottom":L+=c.value[1];break;case"left":D-=c.value[1];break;case"right":D+=c.value[1];break}return A.x+=D,A.y+=L,A.width=Math.min(A.width,l.value),A.height=Math.min(A.height,u.value),{overflows:F1(A,m),x:D,y:L}}let y=0,E=0;const T={x:0,y:0},C={x:!1,y:!1};let w=-1;for(;!(w++>10);){const{x:I,y:A,overflows:x}=b(g);y+=I,E+=A,_.x+=I,_.y+=A;{const O=B1(g.anchor),D=x.x.before||x.x.after,L=x.y.before||x.y.after;let q=!1;if(["x","y"].forEach(G=>{if(G==="x"&&D&&!C.x||G==="y"&&L&&!C.y){const M={anchor:{...g.anchor},origin:{...g.origin}},P=G==="x"?O==="y"?bE:SE:O==="y"?SE:bE;M.anchor=P(M.anchor),M.origin=P(M.origin);const{overflows:N}=b(M);(N[G].before<=x[G].before&&N[G].after<=x[G].after||N[G].before+N[G].after<(x[G].before+x[G].after)/2)&&(g=M,q=C[G]=!0)}}),q)continue}x.x.before&&(y+=x.x.before,_.x+=x.x.before),x.x.after&&(y-=x.x.after,_.x-=x.x.after),x.y.before&&(E+=x.y.before,_.y+=x.y.before),x.y.after&&(E-=x.y.after,_.y-=x.y.after);{const O=F1(_,m);T.x=m.width-O.x.before-O.x.after,T.y=m.height-O.y.before-O.y.after,y+=O.x.before,_.x+=O.x.before,E+=O.y.before,_.y+=O.y.before}break}const R=B1(g.anchor);return Object.assign(n.value,{"--v-overlay-anchor-origin":`${g.anchor.side} ${g.anchor.align}`,transformOrigin:`${g.origin.side} ${g.origin.align}`,top:Ht(ME(E)),left:t.isRtl.value?void 0:Ht(ME(y)),right:t.isRtl.value?Ht(ME(-y)):void 0,minWidth:Ht(R==="y"?Math.min(a.value,S.width):a.value),maxWidth:Ht(zk(Lo(T.x,a.value===1/0?0:a.value,l.value))),maxHeight:Ht(zk(Lo(T.y,o.value===1/0?0:o.value,u.value)))}),{available:T,contentBox:_}}return Ie(()=>[r.value,s.value,e.offset,e.minWidth,e.minHeight,e.maxWidth,e.maxHeight],()=>f()),$t(()=>{const S=f();if(!S)return;const{available:_,contentBox:p}=S;p.height>_.y&&requestAnimationFrame(()=>{f(),requestAnimationFrame(()=>{f()})})}),{updateLocation:f}}function ME(t){return Math.round(t*devicePixelRatio)/devicePixelRatio}function zk(t){return Math.ceil(t*devicePixelRatio)/devicePixelRatio}let GA=!0;const vv=[];function Kae(t){!GA||vv.length?(vv.push(t),HA()):(GA=!1,t(),HA())}let qk=-1;function HA(){cancelAnimationFrame(qk),qk=requestAnimationFrame(()=>{const t=vv.shift();t&&t(),vv.length?HA():GA=!0})}const og={none:null,close:Xae,block:Zae,reposition:Jae},jae=Ue({scrollStrategy:{type:[String,Function],default:"block",validator:t=>typeof t=="function"||t in og}},"VOverlay-scroll-strategies");function Qae(t,e){if(!dn)return;let n;Wr(async()=>{n==null||n.stop(),e.isActive.value&&t.scrollStrategy&&(n=Ql(),await new Promise(i=>setTimeout(i)),n.active&&n.run(()=>{var i;typeof t.scrollStrategy=="function"?t.scrollStrategy(e,t,n):(i=og[t.scrollStrategy])==null||i.call(og,e,t,n)}))}),Xn(()=>{n==null||n.stop()})}function Xae(t){function e(n){t.isActive.value=!1}Nq(t.targetEl.value??t.contentEl.value,e)}function Zae(t,e){var a;const n=(a=t.root.value)==null?void 0:a.offsetParent,i=[...new Set([...ov(t.targetEl.value,e.contained?n:void 0),...ov(t.contentEl.value,e.contained?n:void 0)])].filter(o=>!o.classList.contains("v-overlay-scroll-blocked")),r=window.innerWidth-document.documentElement.offsetWidth,s=(o=>fN(o)&&o)(n||document.documentElement);s&&t.root.value.classList.add("v-overlay--scroll-blocked"),i.forEach((o,l)=>{o.style.setProperty("--v-body-scroll-x",Ht(-o.scrollLeft)),o.style.setProperty("--v-body-scroll-y",Ht(-o.scrollTop)),o!==document.documentElement&&o.style.setProperty("--v-scrollbar-offset",Ht(r)),o.classList.add("v-overlay-scroll-blocked")}),Xn(()=>{i.forEach((o,l)=>{const u=parseFloat(o.style.getPropertyValue("--v-body-scroll-x")),c=parseFloat(o.style.getPropertyValue("--v-body-scroll-y")),d=o.style.scrollBehavior;o.style.scrollBehavior="auto",o.style.removeProperty("--v-body-scroll-x"),o.style.removeProperty("--v-body-scroll-y"),o.style.removeProperty("--v-scrollbar-offset"),o.classList.remove("v-overlay-scroll-blocked"),o.scrollLeft=-u,o.scrollTop=-c,o.style.scrollBehavior=d}),s&&t.root.value.classList.remove("v-overlay--scroll-blocked")})}function Jae(t,e,n){let i=!1,r=-1,s=-1;function a(o){Kae(()=>{var c,d;const l=performance.now();(d=(c=t.updateLocation).value)==null||d.call(c,o),i=(performance.now()-l)/(1e3/60)>2})}s=(typeof requestIdleCallback>"u"?o=>o():requestIdleCallback)(()=>{n.run(()=>{Nq(t.targetEl.value??t.contentEl.value,o=>{i?(cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{a(o)})})):a(o)})})}),Xn(()=>{typeof cancelIdleCallback<"u"&&cancelIdleCallback(s),cancelAnimationFrame(r)})}function Nq(t,e){const n=[document,...ov(t)];n.forEach(i=>{i.addEventListener("scroll",e,{passive:!0})}),Xn(()=>{n.forEach(i=>{i.removeEventListener("scroll",e)})})}const VA=Symbol.for("vuetify:v-menu"),ele=Ue({closeDelay:[Number,String],openDelay:[Number,String]},"delay");function tle(t,e){let n=()=>{};function i(a){n==null||n();const o=Number(a?t.openDelay:t.closeDelay);return new Promise(l=>{n=Bte(o,()=>{e==null||e(a),l(a)})})}function r(){return i(!0)}function s(){return i(!1)}return{clearDelay:n,runOpenDelay:r,runCloseDelay:s}}const nle=Ue({target:[String,Object],activator:[String,Object],activatorProps:{type:Object,default:()=>({})},openOnClick:{type:Boolean,default:void 0},openOnHover:Boolean,openOnFocus:{type:Boolean,default:void 0},closeOnContentClick:Boolean,...ele()},"VOverlay-activator");function ile(t,e){let{isActive:n,isTop:i,contentEl:r}=e;const s=Li("useActivator"),a=ve();let o=!1,l=!1,u=!0;const c=te(()=>t.openOnFocus||t.openOnFocus==null&&t.openOnHover),d=te(()=>t.openOnClick||t.openOnClick==null&&!t.openOnHover&&!c.value),{runOpenDelay:h,runCloseDelay:f}=tle(t,C=>{C===(t.openOnHover&&o||c.value&&l)&&!(t.openOnHover&&n.value&&!i.value)&&(n.value!==C&&(u=!0),n.value=C)}),S=ve(),_={onClick:C=>{C.stopPropagation(),a.value=C.currentTarget||C.target,n.value||(S.value=[C.clientX,C.clientY]),n.value=!n.value},onMouseenter:C=>{var w;(w=C.sourceCapabilities)!=null&&w.firesTouchEvents||(o=!0,a.value=C.currentTarget||C.target,h())},onMouseleave:C=>{o=!1,f()},onFocus:C=>{nv(C.target,":focus-visible")!==!1&&(l=!0,C.stopPropagation(),a.value=C.currentTarget||C.target,h())},onBlur:C=>{l=!1,C.stopPropagation(),f()}},p=te(()=>{const C={};return d.value&&(C.onClick=_.onClick),t.openOnHover&&(C.onMouseenter=_.onMouseenter,C.onMouseleave=_.onMouseleave),c.value&&(C.onFocus=_.onFocus,C.onBlur=_.onBlur),C}),v=te(()=>{const C={};if(t.openOnHover&&(C.onMouseenter=()=>{o=!0,h()},C.onMouseleave=()=>{o=!1,f()}),c.value&&(C.onFocusin=()=>{l=!0,h()},C.onFocusout=()=>{l=!1,f()}),t.closeOnContentClick){const w=an(VA,null);C.onClick=()=>{n.value=!1,w==null||w.closeParents()}}return C}),m=te(()=>{const C={};return t.openOnHover&&(C.onMouseenter=()=>{u&&(o=!0,u=!1,h())},C.onMouseleave=()=>{o=!1,f()}),C});Ie(i,C=>{var w;C&&(t.openOnHover&&!o&&(!c.value||!l)||c.value&&!l&&(!t.openOnHover||!o))&&!((w=r.value)!=null&&w.contains(document.activeElement))&&(n.value=!1)}),Ie(n,C=>{C||setTimeout(()=>{S.value=void 0})},{flush:"post"});const g=CA();Wr(()=>{g.value&&$t(()=>{a.value=g.el})});const b=CA(),y=te(()=>t.target==="cursor"&&S.value?S.value:b.value?b.el:xq(t.target,s)||a.value),E=te(()=>Array.isArray(y.value)?void 0:y.value);let T;return Ie(()=>!!t.activator,C=>{C&&dn?(T=Ql(),T.run(()=>{rle(t,s,{activatorEl:a,activatorEvents:p})})):T&&T.stop()},{flush:"post",immediate:!0}),Xn(()=>{T==null||T.stop()}),{activatorEl:a,activatorRef:g,target:y,targetEl:E,targetRef:b,activatorEvents:p,contentEvents:v,scrimEvents:m}}function rle(t,e,n){let{activatorEl:i,activatorEvents:r}=n;Ie(()=>t.activator,(l,u)=>{if(u&&l!==u){const c=o(u);c&&a(c)}l&&$t(()=>s())},{immediate:!0}),Ie(()=>t.activatorProps,()=>{s()}),Xn(()=>{a()});function s(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.activatorProps;l&&$te(l,rt(r.value,u))}function a(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.activatorProps;l&&Gte(l,rt(r.value,u))}function o(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.activator;const u=xq(l,e);return i.value=(u==null?void 0:u.nodeType)===Node.ELEMENT_NODE?u:void 0,i.value}}function xq(t,e){var i,r;if(!t)return;let n;if(t==="parent"){let s=(r=(i=e==null?void 0:e.proxy)==null?void 0:i.$el)==null?void 0:r.parentNode;for(;s!=null&&s.hasAttribute("data-no-activator");)s=s.parentNode;n=s}else typeof t=="string"?n=document.querySelector(t):"$el"in t?n=t.$el:n=t;return n}function sle(){if(!dn)return ut(!1);const{ssr:t}=mN();if(t){const e=ut(!1);return ai(()=>{e.value=!0}),e}else return ut(!0)}const ole=Ue({eager:Boolean},"lazy");function ale(t,e){const n=ut(!1),i=te(()=>n.value||t.eager||e.value);Ie(e,()=>n.value=!0);function r(){t.eager||(n.value=!1)}return{isBooted:n,hasContent:i,onAfterLeave:r}}function sb(){const e=Li("useScopeId").vnode.scopeId;return{scopeId:e?{[e]:""}:void 0}}const Yk=Symbol.for("vuetify:stack"),ph=$n([]);function lle(t,e,n){const i=Li("useStack"),r=!n,s=an(Yk,void 0),a=$n({activeChildren:new Set});Kn(Yk,a);const o=ut(+e.value);nu(t,()=>{var d;const c=(d=ph.at(-1))==null?void 0:d[1];o.value=c?c+10:+e.value,r&&ph.push([i.uid,o.value]),s==null||s.activeChildren.add(i.uid),Xn(()=>{if(r){const h=gt(ph).findIndex(f=>f[0]===i.uid);ph.splice(h,1)}s==null||s.activeChildren.delete(i.uid)})});const l=ut(!0);r&&Wr(()=>{var d;const c=((d=ph.at(-1))==null?void 0:d[0])===i.uid;setTimeout(()=>l.value=c)});const u=te(()=>!a.activeChildren.size);return{globalTop:qd(l),localTop:u,stackStyles:te(()=>({zIndex:o.value}))}}function cle(t){return{teleportTarget:te(()=>{const n=t();if(n===!0||!dn)return;const i=n===!1?document.body:typeof n=="string"?document.querySelector(n):n;if(i==null)return;let r=[...i.children].find(s=>s.matches(".v-overlay-container"));return r||(r=document.createElement("div"),r.className="v-overlay-container",i.appendChild(r)),r})}}function ule(){return!0}function Dq(t,e,n){if(!t||kq(t,n)===!1)return!1;const i=lz(e);if(typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&i.host===t.target)return!1;const r=(typeof n.value=="object"&&n.value.include||(()=>[]))();return r.push(e),!r.some(s=>s==null?void 0:s.contains(t.target))}function kq(t,e){return(typeof e.value=="object"&&e.value.closeConditional||ule)(t)}function dle(t,e,n){const i=typeof n.value=="function"?n.value:n.value.handler;t.shadowTarget=t.target,e._clickOutside.lastMousedownWasOutside&&Dq(t,e,n)&&setTimeout(()=>{kq(t,n)&&i&&i(t)},0)}function Wk(t,e){const n=lz(t);e(document),typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&e(n)}const hle={mounted(t,e){const n=r=>dle(r,t,e),i=r=>{t._clickOutside.lastMousedownWasOutside=Dq(r,t,e)};Wk(t,r=>{r.addEventListener("click",n,!0),r.addEventListener("mousedown",i,!0)}),t._clickOutside||(t._clickOutside={lastMousedownWasOutside:!1}),t._clickOutside[e.instance.$.uid]={onClick:n,onMousedown:i}},beforeUnmount(t,e){t._clickOutside&&(Wk(t,n=>{var s;if(!n||!((s=t._clickOutside)!=null&&s[e.instance.$.uid]))return;const{onClick:i,onMousedown:r}=t._clickOutside[e.instance.$.uid];n.removeEventListener("click",i,!0),n.removeEventListener("mousedown",r,!0)}),delete t._clickOutside[e.instance.$.uid])}};function fle(t){const{modelValue:e,color:n,...i}=t;return W(eu,{name:"fade-transition",appear:!0},{default:()=>[t.modelValue&&W("div",rt({class:["v-overlay__scrim",t.color.backgroundColorClasses.value],style:t.color.backgroundColorStyles.value},i),null)]})}const ob=Ue({absolute:Boolean,attach:[Boolean,String,Object],closeOnBack:{type:Boolean,default:!0},contained:Boolean,contentClass:null,contentProps:null,disabled:Boolean,opacity:[Number,String],noClickAnimation:Boolean,modelValue:Boolean,persistent:Boolean,scrim:{type:[Boolean,String],default:!0},zIndex:{type:[Number,String],default:2e3},...nle(),...jt(),...Ha(),...ole(),...Vae(),...jae(),...$i(),...Zd()},"VOverlay"),Pl=vt()({name:"VOverlay",directives:{ClickOutside:hle},inheritAttrs:!1,props:{_disableGlobalStack:Boolean,...ob()},emits:{"click:outside":t=>!0,"update:modelValue":t=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,e){let{slots:n,attrs:i,emit:r}=e;const s=Li("VOverlay"),a=ve(),o=ve(),l=ve(),u=Fn(t,"modelValue"),c=te({get:()=>u.value,set:X=>{X&&t.disabled||(u.value=X)}}),{themeClasses:d}=cr(t),{rtlClasses:h,isRtl:f}=ec(),{hasContent:S,onAfterLeave:_}=ale(t,c),p=Il(te(()=>typeof t.scrim=="string"?t.scrim:null)),{globalTop:v,localTop:m,stackStyles:g}=lle(c,Ve(t,"zIndex"),t._disableGlobalStack),{activatorEl:b,activatorRef:y,target:E,targetEl:T,targetRef:C,activatorEvents:w,contentEvents:R,scrimEvents:I}=ile(t,{isActive:c,isTop:m,contentEl:l}),{teleportTarget:A}=cle(()=>{var z,re,ne;const X=t.attach||t.contained;if(X)return X;const K=((z=b==null?void 0:b.value)==null?void 0:z.getRootNode())||((ne=(re=s.proxy)==null?void 0:re.$el)==null?void 0:ne.getRootNode());return K instanceof ShadowRoot?K:!1}),{dimensionStyles:x}=Va(t),O=sle(),{scopeId:D}=sb();Ie(()=>t.disabled,X=>{X&&(c.value=!1)});const{contentStyles:L,updateLocation:q}=zae(t,{isRtl:f,contentEl:l,target:E,isActive:c});Qae(t,{root:a,contentEl:l,targetEl:T,isActive:c,updateLocation:q});function G(X){r("click:outside",X),t.persistent?F():c.value=!1}function M(X){return c.value&&v.value&&(!t.scrim||X.target===o.value||X instanceof MouseEvent&&X.shadowTarget===o.value)}dn&&Ie(c,X=>{X?window.addEventListener("keydown",P):window.removeEventListener("keydown",P)},{immediate:!0}),Yi(()=>{dn&&window.removeEventListener("keydown",P)});function P(X){var K,z;X.key==="Escape"&&v.value&&(t.persistent?F():(c.value=!1,(K=l.value)!=null&&K.contains(document.activeElement)&&((z=b.value)==null||z.focus())))}const N=yae();nu(()=>t.closeOnBack,()=>{Cae(N,X=>{v.value&&c.value?(X(!1),t.persistent?F():c.value=!1):X()})});const U=ve();Ie(()=>c.value&&(t.absolute||t.contained)&&A.value==null,X=>{if(X){const K=cz(a.value);K&&K!==document.scrollingElement&&(U.value=K.scrollTop)}});function F(){t.noClickAnimation||l.value&&Qu(l.value,[{transformOrigin:"center"},{transform:"scale(1.03)"},{transformOrigin:"center"}],{duration:150,easing:sv})}function k(){r("afterEnter")}function H(){_(),r("afterLeave")}return Ft(()=>{var X;return W(He,null,[(X=n.activator)==null?void 0:X.call(n,{isActive:c.value,targetRef:C,props:rt({ref:y},w.value,t.activatorProps)}),O.value&&S.value&&W(hX,{disabled:!A.value,to:A.value},{default:()=>[W("div",rt({class:["v-overlay",{"v-overlay--absolute":t.absolute||t.contained,"v-overlay--active":c.value,"v-overlay--contained":t.contained},d.value,h.value,t.class],style:[g.value,{"--v-overlay-opacity":t.opacity,top:Ht(U.value)},t.style],ref:a},D,i),[W(fle,rt({color:p,modelValue:c.value&&!!t.scrim,ref:o},I.value),null),W(bl,{appear:!0,persisted:!0,transition:t.transition,target:E.value,onAfterEnter:k,onAfterLeave:H},{default:()=>{var K;return[Ar(W("div",rt({ref:l,class:["v-overlay__content",t.contentClass],style:[x.value,L.value]},R.value,t.contentProps),[(K=n.default)==null?void 0:K.call(n,{isActive:c})]),[[Wd,c.value],[Jl("click-outside"),{handler:G,closeConditional:M,include:()=>[b.value]}]])]}})])]})])}),{activatorEl:b,scrimEl:o,target:E,animateClick:F,contentEl:l,globalTop:v,localTop:m,updateLocation:q}}}),ple=Ue({fullscreen:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,...ob({origin:"center center",scrollStrategy:"block",transition:{component:TN},zIndex:2400})},"VDialog"),FN=vt()({name:"VDialog",props:ple(),emits:{"update:modelValue":t=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,e){let{emit:n,slots:i}=e;const r=Fn(t,"modelValue"),{scopeId:s}=sb(),a=ve();function o(c){var f,S;const d=c.relatedTarget,h=c.target;if(d!==h&&((f=a.value)!=null&&f.contentEl)&&((S=a.value)!=null&&S.globalTop)&&![document,a.value.contentEl].includes(h)&&!a.value.contentEl.contains(h)){const _=Of(a.value.contentEl);if(!_.length)return;const p=_[0],v=_[_.length-1];d===p?v.focus():p.focus()}}Yi(()=>{document.removeEventListener("focusin",o)}),dn&&Ie(()=>r.value&&t.retainFocus,c=>{c?document.addEventListener("focusin",o):document.removeEventListener("focusin",o)},{immediate:!0});function l(){var c;n("afterEnter"),(c=a.value)!=null&&c.contentEl&&!a.value.contentEl.contains(document.activeElement)&&a.value.contentEl.focus({preventScroll:!0})}function u(){n("afterLeave")}return Ie(r,async c=>{var d;c||(await $t(),(d=a.value.activatorEl)==null||d.focus({preventScroll:!0}))}),Ft(()=>{const c=Pl.filterProps(t),d=rt({"aria-haspopup":"dialog"},t.activatorProps),h=rt({tabindex:-1},t.contentProps);return W(Pl,rt({ref:a,class:["v-dialog",{"v-dialog--fullscreen":t.fullscreen,"v-dialog--scrollable":t.scrollable},t.class],style:t.style},c,{modelValue:r.value,"onUpdate:modelValue":f=>r.value=f,"aria-modal":"true",activatorProps:d,contentProps:h,height:t.fullscreen?void 0:t.height,width:t.fullscreen?void 0:t.width,maxHeight:t.fullscreen?void 0:t.maxHeight,maxWidth:t.fullscreen?void 0:t.maxWidth,role:"dialog",onAfterEnter:l,onAfterLeave:u},s),{activator:i.activator,default:function(){for(var f=arguments.length,S=new Array(f),_=0;_<f;_++)S[_]=arguments[_];return W(pi,{root:"VDialog"},{default:()=>{var p;return[(p=i.default)==null?void 0:p.call(i,...S)]}})}})}),tc({},a)}}),_le=Ue({...jt(),...joe()},"VForm"),mle=vt()({name:"VForm",props:_le(),emits:{"update:modelValue":t=>!0,submit:t=>!0},setup(t,e){let{slots:n,emit:i}=e;const r=Qoe(t),s=ve();function a(l){l.preventDefault(),r.reset()}function o(l){const u=l,c=r.validate();u.then=c.then.bind(c),u.catch=c.catch.bind(c),u.finally=c.finally.bind(c),i("submit",u),u.defaultPrevented||c.then(d=>{var f;let{valid:h}=d;h&&((f=s.value)==null||f.submit())}),u.preventDefault()}return Ft(()=>{var l;return W("form",{ref:s,class:["v-form",t.class],style:t.style,novalidate:!0,onReset:a,onSubmit:o},[(l=n.default)==null?void 0:l.call(n,r)])}),tc(r,s)}}),Mq=QS.reduce((t,e)=>(t[e]={type:[Boolean,String,Number],default:!1},t),{}),Lq=QS.reduce((t,e)=>{const n="offset"+Fa(e);return t[n]={type:[String,Number],default:null},t},{}),Pq=QS.reduce((t,e)=>{const n="order"+Fa(e);return t[n]={type:[String,Number],default:null},t},{}),Kk={col:Object.keys(Mq),offset:Object.keys(Lq),order:Object.keys(Pq)};function gle(t,e,n){let i=t;if(!(n==null||n===!1)){if(e){const r=e.replace(t,"");i+=`-${r}`}return t==="col"&&(i="v-"+i),t==="col"&&(n===""||n===!0)||(i+=`-${n}`),i.toLowerCase()}}const vle=["auto","start","end","center","baseline","stretch"],Sle=Ue({cols:{type:[Boolean,String,Number],default:!1},...Mq,offset:{type:[String,Number],default:null},...Lq,order:{type:[String,Number],default:null},...Pq,alignSelf:{type:String,default:null,validator:t=>vle.includes(t)},...jt(),...Ri()},"VCol"),jk=vt()({name:"VCol",props:Sle(),setup(t,e){let{slots:n}=e;const i=te(()=>{const r=[];let s;for(s in Kk)Kk[s].forEach(o=>{const l=t[o],u=gle(s,o,l);u&&r.push(u)});const a=r.some(o=>o.startsWith("v-col-"));return r.push({"v-col":!a||!t.cols,[`v-col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),r});return()=>{var r;return Bt(t.tag,{class:[i.value,t.class],style:t.style},(r=n.default)==null?void 0:r.call(n))}}}),UN=["start","end","center"],Bq=["space-between","space-around","space-evenly"];function $N(t,e){return QS.reduce((n,i)=>{const r=t+Fa(i);return n[r]=e(),n},{})}const ble=[...UN,"baseline","stretch"],Fq=t=>ble.includes(t),Uq=$N("align",()=>({type:String,default:null,validator:Fq})),Ele=[...UN,...Bq],$q=t=>Ele.includes(t),Gq=$N("justify",()=>({type:String,default:null,validator:$q})),yle=[...UN,...Bq,"stretch"],Hq=t=>yle.includes(t),Vq=$N("alignContent",()=>({type:String,default:null,validator:Hq})),Qk={align:Object.keys(Uq),justify:Object.keys(Gq),alignContent:Object.keys(Vq)},Cle={align:"align",justify:"justify",alignContent:"align-content"};function Tle(t,e,n){let i=Cle[t];if(n!=null){if(e){const r=e.replace(t,"");i+=`-${r}`}return i+=`-${n}`,i.toLowerCase()}}const wle=Ue({dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:Fq},...Uq,justify:{type:String,default:null,validator:$q},...Gq,alignContent:{type:String,default:null,validator:Hq},...Vq,...jt(),...Ri()},"VRow"),Rle=vt()({name:"VRow",props:wle(),setup(t,e){let{slots:n}=e;const i=te(()=>{const r=[];let s;for(s in Qk)Qk[s].forEach(a=>{const o=t[a],l=Tle(s,a,o);l&&r.push(l)});return r.push({"v-row--no-gutters":t.noGutters,"v-row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),r});return()=>{var r;return Bt(t.tag,{class:["v-row",i.value,t.class],style:t.style},(r=n.default)==null?void 0:r.call(n))}}}),Na=WS("v-spacer","div","VSpacer"),Ale=Qe({__name:"NewProjectDialog",props:{visible:{type:Boolean},visibleModifiers:{}},emits:["update:visible"],setup(t){const e=kl(t,"visible"),n=ve(!1),i=ve(""),r=ve(""),s=ve(""),a=[h=>!!h||"Project ID is required",h=>h&&h.length<=64||"Project ID must be less than 64 characters",h=>/^[a-z0-9-]+$/i.test(h)||"Project ID must be alphanumeric with dashes (-)",h=>/^[a-z]/i.test(h)||"Project ID must start with a letter"],o=[h=>!!h||"Password is required",h=>h&&h.length>=8||"Password must be at least 8 characters"],l=[h=>!!h||"Repeat password is required",h=>h===r.value||"Passwords do not match"],u=nb(),c=Su(),d=async()=>{await u.createProject(i.value,r.value),c.openProjectPanel(i.value),e.value=!1};return(h,f)=>{const S=cq;return _e(),xe(FN,{modelValue:e.value,"onUpdate:modelValue":f[5]||(f[5]=_=>e.value=_),"max-width":"600px"},{default:be(()=>[W(Is,{title:"New project",color:"#2d2d2d"},{default:be(()=>[W(mle,{modelValue:ie(n),"onUpdate:modelValue":f[4]||(f[4]=_=>Lt(n)?n.value=_:null)},{default:be(()=>[W(Po,null,{default:be(()=>[W(Vo,{modelValue:ie(i),"onUpdate:modelValue":f[0]||(f[0]=_=>Lt(i)?i.value=_:null),class:"mb-4",variant:"outlined",density:"compact",label:"Project ID",rules:a,placeholder:"my-awesome-project",hint:"Project ID must be unique across all repositories connected to the same storage","persistent-hint":""},null,8,["modelValue"]),W(S,{modelValue:ie(r),"onUpdate:modelValue":f[1]||(f[1]=_=>Lt(r)?r.value=_:null),class:"mb-4",label:"Password",rules:o,hint:"Password must be strong enough to resist offline attacks","persistent-hint":""},null,8,["modelValue"]),W(S,{modelValue:ie(s),"onUpdate:modelValue":f[2]||(f[2]=_=>Lt(s)?s.value=_:null),class:"mb-4",label:"Repeat Password",rules:l},null,8,["modelValue"]),W(kae,{type:"warning",density:"compact"},{default:be(()=>f[6]||(f[6]=[Tt(" The password will be used to encrypt the project secrets and sensitive state data. Losing the password will result in losing the control over the created resources! ")])),_:1})]),_:1}),W(zo,null,{default:be(()=>[W(Na),W(Sn,{onClick:f[3]||(f[3]=_=>e.value=!1)},{default:be(()=>f[7]||(f[7]=[Tt("Cancel")])),_:1}),W(Sn,{disabled:!ie(n),loading:ie(u).loadingCreateProject,onClick:d},{default:be(()=>f[8]||(f[8]=[Tt(" Create ")])),_:1},8,["disabled","loading"])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["modelValue"])}}}),Ole=Ue({color:String,inset:Boolean,length:[Number,String],opacity:[Number,String],thickness:[Number,String],vertical:Boolean,...jt(),...$i()},"VDivider"),El=vt()({name:"VDivider",props:Ole(),setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{textColorClasses:s,textColorStyles:a}=Xs(Ve(t,"color")),o=te(()=>{const l={};return t.length&&(l[t.vertical?"height":"width"]=Ht(t.length)),t.thickness&&(l[t.vertical?"borderRightWidth":"borderTopWidth"]=Ht(t.thickness)),l});return Ft(()=>{const l=W("hr",{class:[{"v-divider":!0,"v-divider--inset":t.inset,"v-divider--vertical":t.vertical},r.value,s.value,t.class],style:[o.value,a.value,{"--v-border-opacity":t.opacity},t.style],"aria-orientation":!n.role||n.role==="separator"?t.vertical?"vertical":"horizontal":void 0,role:`${n.role||"separator"}`},null);return i.default?W("div",{class:["v-divider__wrapper",{"v-divider__wrapper--vertical":t.vertical,"v-divider__wrapper--inset":t.inset}]},[l,W("div",{class:"v-divider__content"},[i.default()]),l]):l}),{}}}),zA=Symbol.for("vuetify:list");function zq(){const t=an(zA,{hasPrepend:ut(!1),updateHasPrepend:()=>null}),e={hasPrepend:ut(!1),updateHasPrepend:n=>{n&&(e.hasPrepend.value=n)}};return Kn(zA,e),t}function qq(){return an(zA,null)}const GN=t=>{const e={activate:n=>{let{id:i,value:r,activated:s}=n;return i=gt(i),t&&!r&&s.size===1&&s.has(i)||(r?s.add(i):s.delete(i)),s},in:(n,i,r)=>{let s=new Set;if(n!=null)for(const a of qr(n))s=e.activate({id:a,value:!0,activated:new Set(s),children:i,parents:r});return s},out:n=>Array.from(n)};return e},Yq=t=>{const e=GN(t);return{activate:i=>{let{activated:r,id:s,...a}=i;s=gt(s);const o=r.has(s)?new Set([s]):new Set;return e.activate({...a,id:s,activated:o})},in:(i,r,s)=>{let a=new Set;if(i!=null){const o=qr(i);o.length&&(a=e.in(o.slice(0,1),r,s))}return a},out:(i,r,s)=>e.out(i,r,s)}},Ile=t=>{const e=GN(t);return{activate:i=>{let{id:r,activated:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.activate({id:r,activated:s,children:a,...o})},in:e.in,out:e.out}},Nle=t=>{const e=Yq(t);return{activate:i=>{let{id:r,activated:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.activate({id:r,activated:s,children:a,...o})},in:e.in,out:e.out}},xle={open:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(n){const s=new Set;s.add(e);let a=r.get(e);for(;a!=null;)s.add(a),a=r.get(a);return s}else return i.delete(e),i},select:()=>null},Wq={open:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(n){let s=r.get(e);for(i.add(e);s!=null&&s!==e;)i.add(s),s=r.get(s);return i}else i.delete(e);return i},select:()=>null},Dle={open:Wq.open,select:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(!n)return i;const s=[];let a=r.get(e);for(;a!=null;)s.push(a),a=r.get(a);return new Set(s)}},HN=t=>{const e={select:n=>{let{id:i,value:r,selected:s}=n;if(i=gt(i),t&&!r){const a=Array.from(s.entries()).reduce((o,l)=>{let[u,c]=l;return c==="on"&&o.push(u),o},[]);if(a.length===1&&a[0]===i)return s}return s.set(i,r?"on":"off"),s},in:(n,i,r)=>{const s=new Map;for(const a of n||[])e.select({id:a,value:!0,selected:s,children:i,parents:r});return s},out:n=>{const i=[];for(const[r,s]of n.entries())s==="on"&&i.push(r);return i}};return e},Kq=t=>{const e=HN(t);return{select:i=>{let{selected:r,id:s,...a}=i;s=gt(s);const o=r.has(s)?new Map([[s,r.get(s)]]):new Map;return e.select({...a,id:s,selected:o})},in:(i,r,s)=>i!=null&&i.length?e.in(i.slice(0,1),r,s):new Map,out:(i,r,s)=>e.out(i,r,s)}},kle=t=>{const e=HN(t);return{select:i=>{let{id:r,selected:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.select({id:r,selected:s,children:a,...o})},in:e.in,out:e.out}},Mle=t=>{const e=Kq(t);return{select:i=>{let{id:r,selected:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.select({id:r,selected:s,children:a,...o})},in:e.in,out:e.out}},Lle=t=>{const e={select:n=>{let{id:i,value:r,selected:s,children:a,parents:o}=n;i=gt(i);const l=new Map(s),u=[i];for(;u.length;){const d=u.shift();s.set(gt(d),r?"on":"off"),a.has(d)&&u.push(...a.get(d))}let c=gt(o.get(i));for(;c;){const d=a.get(c),h=d.every(S=>s.get(gt(S))==="on"),f=d.every(S=>!s.has(gt(S))||s.get(gt(S))==="off");s.set(c,h?"on":f?"off":"indeterminate"),c=gt(o.get(c))}return t&&!r&&Array.from(s.entries()).reduce((h,f)=>{let[S,_]=f;return _==="on"&&h.push(S),h},[]).length===0?l:s},in:(n,i,r)=>{let s=new Map;for(const a of n||[])s=e.select({id:a,value:!0,selected:s,children:i,parents:r});return s},out:(n,i)=>{const r=[];for(const[s,a]of n.entries())a==="on"&&!i.has(s)&&r.push(s);return r}};return e},Mf=Symbol.for("vuetify:nested"),jq={id:ut(),root:{register:()=>null,unregister:()=>null,parents:ve(new Map),children:ve(new Map),open:()=>null,openOnSelect:()=>null,activate:()=>null,select:()=>null,activatable:ve(!1),selectable:ve(!1),opened:ve(new Set),activated:ve(new Set),selected:ve(new Map),selectedValues:ve([]),getPath:()=>[]}},Ple=Ue({activatable:Boolean,selectable:Boolean,activeStrategy:[String,Function,Object],selectStrategy:[String,Function,Object],openStrategy:[String,Object],opened:null,activated:null,selected:null,mandatory:Boolean},"nested"),Ble=t=>{let e=!1;const n=ve(new Map),i=ve(new Map),r=Fn(t,"opened",t.opened,S=>new Set(S),S=>[...S.values()]),s=te(()=>{if(typeof t.activeStrategy=="object")return t.activeStrategy;if(typeof t.activeStrategy=="function")return t.activeStrategy(t.mandatory);switch(t.activeStrategy){case"leaf":return Ile(t.mandatory);case"single-leaf":return Nle(t.mandatory);case"independent":return GN(t.mandatory);case"single-independent":default:return Yq(t.mandatory)}}),a=te(()=>{if(typeof t.selectStrategy=="object")return t.selectStrategy;if(typeof t.selectStrategy=="function")return t.selectStrategy(t.mandatory);switch(t.selectStrategy){case"single-leaf":return Mle(t.mandatory);case"leaf":return kle(t.mandatory);case"independent":return HN(t.mandatory);case"single-independent":return Kq(t.mandatory);case"classic":default:return Lle(t.mandatory)}}),o=te(()=>{if(typeof t.openStrategy=="object")return t.openStrategy;switch(t.openStrategy){case"list":return Dle;case"single":return xle;case"multiple":default:return Wq}}),l=Fn(t,"activated",t.activated,S=>s.value.in(S,n.value,i.value),S=>s.value.out(S,n.value,i.value)),u=Fn(t,"selected",t.selected,S=>a.value.in(S,n.value,i.value),S=>a.value.out(S,n.value,i.value));Yi(()=>{e=!0});function c(S){const _=[];let p=S;for(;p!=null;)_.unshift(p),p=i.value.get(p);return _}const d=Li("nested"),h=new Set,f={id:ut(),root:{opened:r,activatable:Ve(t,"activatable"),selectable:Ve(t,"selectable"),activated:l,selected:u,selectedValues:te(()=>{const S=[];for(const[_,p]of u.value.entries())p==="on"&&S.push(_);return S}),register:(S,_,p)=>{if(h.has(S)){c(S).map(String).join(" -> "),c(_).concat(S).map(String).join(" -> ");return}else h.add(S);_&&S!==_&&i.value.set(S,_),p&&n.value.set(S,[]),_!=null&&n.value.set(_,[...n.value.get(_)||[],S])},unregister:S=>{if(e)return;h.delete(S),n.value.delete(S);const _=i.value.get(S);if(_){const p=n.value.get(_)??[];n.value.set(_,p.filter(v=>v!==S))}i.value.delete(S)},open:(S,_,p)=>{d.emit("click:open",{id:S,value:_,path:c(S),event:p});const v=o.value.open({id:S,value:_,opened:new Set(r.value),children:n.value,parents:i.value,event:p});v&&(r.value=v)},openOnSelect:(S,_,p)=>{const v=o.value.select({id:S,value:_,selected:new Map(u.value),opened:new Set(r.value),children:n.value,parents:i.value,event:p});v&&(r.value=v)},select:(S,_,p)=>{d.emit("click:select",{id:S,value:_,path:c(S),event:p});const v=a.value.select({id:S,value:_,selected:new Map(u.value),children:n.value,parents:i.value,event:p});v&&(u.value=v),f.root.openOnSelect(S,_,p)},activate:(S,_,p)=>{if(!t.activatable)return f.root.select(S,!0,p);d.emit("click:activate",{id:S,value:_,path:c(S),event:p});const v=s.value.activate({id:S,value:_,activated:new Set(l.value),children:n.value,parents:i.value,event:p});if(v.size!==l.value.size)l.value=v;else{for(const m of v)if(!l.value.has(m)){l.value=v;return}for(const m of l.value)if(!v.has(m)){l.value=v;return}}},children:n,parents:i,getPath:c}};return Kn(Mf,f),f.root},Qq=(t,e)=>{const n=an(Mf,jq),i=Symbol(Os()),r=te(()=>t.value!==void 0?t.value:i),s={...n,id:r,open:(a,o)=>n.root.open(r.value,a,o),openOnSelect:(a,o)=>n.root.openOnSelect(r.value,a,o),isOpen:te(()=>n.root.opened.value.has(r.value)),parent:te(()=>n.root.parents.value.get(r.value)),activate:(a,o)=>n.root.activate(r.value,a,o),isActivated:te(()=>n.root.activated.value.has(gt(r.value))),select:(a,o)=>n.root.select(r.value,a,o),isSelected:te(()=>n.root.selected.value.get(gt(r.value))==="on"),isIndeterminate:te(()=>n.root.selected.value.get(gt(r.value))==="indeterminate"),isLeaf:te(()=>!n.root.children.value.get(r.value)),isGroupActivator:n.isGroupActivator};return vu(()=>{!n.isGroupActivator&&n.root.register(r.value,n.id.value,e)}),Yi(()=>{!n.isGroupActivator&&n.root.unregister(r.value)}),e&&Kn(Mf,s),s},Fle=()=>{const t=an(Mf,jq);Kn(Mf,{...t,isGroupActivator:!0})};function Ule(){const t=ut(!1);return ai(()=>{window.requestAnimationFrame(()=>{t.value=!0})}),{ssrBootStyles:te(()=>t.value?void 0:{transition:"none !important"}),isBooted:qd(t)}}const $le=Qd({name:"VListGroupActivator",setup(t,e){let{slots:n}=e;return Fle(),()=>{var i;return(i=n.default)==null?void 0:i.call(n)}}}),Gle=Ue({activeColor:String,baseColor:String,color:String,collapseIcon:{type:on,default:"$collapse"},expandIcon:{type:on,default:"$expand"},prependIcon:on,appendIcon:on,fluid:Boolean,subgroup:Boolean,title:String,value:null,...jt(),...Ri()},"VListGroup"),Xk=vt()({name:"VListGroup",props:Gle(),setup(t,e){let{slots:n}=e;const{isOpen:i,open:r,id:s}=Qq(Ve(t,"value"),!0),a=te(()=>`v-list-group--id-${String(s.value)}`),o=qq(),{isBooted:l}=Ule();function u(f){f.stopPropagation(),r(!i.value,f)}const c=te(()=>({onClick:u,class:"v-list-group__header",id:a.value})),d=te(()=>i.value?t.collapseIcon:t.expandIcon),h=te(()=>({VListItem:{active:i.value,activeColor:t.activeColor,baseColor:t.baseColor,color:t.color,prependIcon:t.prependIcon||t.subgroup&&d.value,appendIcon:t.appendIcon||!t.subgroup&&d.value,title:t.title,value:t.value}}));return Ft(()=>W(t.tag,{class:["v-list-group",{"v-list-group--prepend":o==null?void 0:o.hasPrepend.value,"v-list-group--fluid":t.fluid,"v-list-group--subgroup":t.subgroup,"v-list-group--open":i.value},t.class],style:t.style},{default:()=>[n.activator&&W(pi,{defaults:h.value},{default:()=>[W($le,null,{default:()=>[n.activator({props:c.value,isOpen:i.value})]})]}),W(bl,{transition:{component:Uoe},disabled:!l.value},{default:()=>{var f;return[Ar(W("div",{class:"v-list-group__items",role:"group","aria-labelledby":a.value},[(f=n.default)==null?void 0:f.call(n)]),[[Wd,i.value]])]}})]})),{isOpen:i}}}),Hle=Ue({opacity:[Number,String],...jt(),...Ri()},"VListItemSubtitle"),Vle=vt()({name:"VListItemSubtitle",props:Hle(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-list-item-subtitle",t.class],style:[{"--v-list-item-subtitle-opacity":t.opacity},t.style]},n)),{}}}),zle=WS("v-list-item-title"),qle=Ue({active:{type:Boolean,default:void 0},activeClass:String,activeColor:String,appendAvatar:String,appendIcon:on,baseColor:String,disabled:Boolean,lines:[Boolean,String],link:{type:Boolean,default:void 0},nav:Boolean,prependAvatar:String,prependIcon:on,ripple:{type:[Boolean,Object],default:!0},slim:Boolean,subtitle:[String,Number],title:[String,Number],value:null,onClick:Yr(),onClickOnce:Yr(),...bu(),...jt(),...ro(),...Ha(),...yu(),...no(),...rb(),...Ri(),...$i(),...za({variant:"text"})},"VListItem"),Bl=vt()({name:"VListItem",directives:{Ripple:Dp},props:qle(),emits:{click:t=>!0},setup(t,e){let{attrs:n,slots:i,emit:r}=e;const s=ib(t,n),a=te(()=>t.value===void 0?s.href.value:t.value),{activate:o,isActivated:l,select:u,isOpen:c,isSelected:d,isIndeterminate:h,isGroupActivator:f,root:S,parent:_,openOnSelect:p,id:v}=Qq(a,!1),m=qq(),g=te(()=>{var k;return t.active!==!1&&(t.active||((k=s.isActive)==null?void 0:k.value)||(S.activatable.value?l.value:d.value))}),b=te(()=>t.link!==!1&&s.isLink.value),y=te(()=>!!m&&(S.selectable.value||S.activatable.value||t.value!=null)),E=te(()=>!t.disabled&&t.link!==!1&&(t.link||s.isClickable.value||y.value)),T=te(()=>t.rounded||t.nav),C=te(()=>t.color??t.activeColor),w=te(()=>({color:g.value?C.value??t.baseColor:t.baseColor,variant:t.variant}));Ie(()=>{var k;return(k=s.isActive)==null?void 0:k.value},k=>{k&&R()}),vu(()=>{var k;(k=s.isActive)!=null&&k.value&&R()});function R(){_.value!=null&&S.open(_.value,!0),p(!0)}const{themeClasses:I}=cr(t),{borderClasses:A}=Eu(t),{colorClasses:x,colorStyles:O,variantClasses:D}=eh(w),{densityClasses:L}=Qo(t),{dimensionStyles:q}=Va(t),{elevationClasses:G}=Cu(t),{roundedClasses:M}=io(T),P=te(()=>t.lines?`v-list-item--${t.lines}-line`:void 0),N=te(()=>({isActive:g.value,select:u,isOpen:c.value,isSelected:d.value,isIndeterminate:h.value}));function U(k){var H;r("click",k),E.value&&((H=s.navigate)==null||H.call(s,k),!f&&(S.activatable.value?o(!l.value,k):(S.selectable.value||t.value!=null)&&u(!d.value,k)))}function F(k){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.target.dispatchEvent(new MouseEvent("click",k)))}return Ft(()=>{const k=b.value?"a":t.tag,H=i.title||t.title!=null,X=i.subtitle||t.subtitle!=null,K=!!(t.appendAvatar||t.appendIcon),z=!!(K||i.append),re=!!(t.prependAvatar||t.prependIcon),ne=!!(re||i.prepend);return m==null||m.updateHasPrepend(ne),t.activeColor&&Xte("active-color",["color","base-color"]),Ar(W(k,rt({class:["v-list-item",{"v-list-item--active":g.value,"v-list-item--disabled":t.disabled,"v-list-item--link":E.value,"v-list-item--nav":t.nav,"v-list-item--prepend":!ne&&(m==null?void 0:m.hasPrepend.value),"v-list-item--slim":t.slim,[`${t.activeClass}`]:t.activeClass&&g.value},I.value,A.value,x.value,L.value,G.value,P.value,M.value,D.value,t.class],style:[O.value,q.value,t.style],tabindex:E.value?m?-2:0:void 0,"aria-selected":y.value?S.activatable.value?l.value:S.selectable.value?d.value:g.value:void 0,onClick:U,onKeydown:E.value&&!b.value&&F},s.linkProps),{default:()=>{var Z;return[Jd(E.value||g.value,"v-list-item"),ne&&W("div",{key:"prepend",class:"v-list-item__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!re,defaults:{VAvatar:{density:t.density,image:t.prependAvatar},VIcon:{density:t.density,icon:t.prependIcon},VListItemAction:{start:!0}}},{default:()=>{var J;return[(J=i.prepend)==null?void 0:J.call(i,N.value)]}}):W(He,null,[t.prependAvatar&&W(Ll,{key:"prepend-avatar",density:t.density,image:t.prependAvatar},null),t.prependIcon&&W(Ot,{key:"prepend-icon",density:t.density,icon:t.prependIcon},null)]),W("div",{class:"v-list-item__spacer"},null)]),W("div",{class:"v-list-item__content","data-no-activator":""},[H&&W(zle,{key:"title"},{default:()=>{var J;return[((J=i.title)==null?void 0:J.call(i,{title:t.title}))??t.title]}}),X&&W(Vle,{key:"subtitle"},{default:()=>{var J;return[((J=i.subtitle)==null?void 0:J.call(i,{subtitle:t.subtitle}))??t.subtitle]}}),(Z=i.default)==null?void 0:Z.call(i,N.value)]),z&&W("div",{key:"append",class:"v-list-item__append"},[i.append?W(pi,{key:"append-defaults",disabled:!K,defaults:{VAvatar:{density:t.density,image:t.appendAvatar},VIcon:{density:t.density,icon:t.appendIcon},VListItemAction:{end:!0}}},{default:()=>{var J;return[(J=i.append)==null?void 0:J.call(i,N.value)]}}):W(He,null,[t.appendIcon&&W(Ot,{key:"append-icon",density:t.density,icon:t.appendIcon},null),t.appendAvatar&&W(Ll,{key:"append-avatar",density:t.density,image:t.appendAvatar},null)]),W("div",{class:"v-list-item__spacer"},null)])]}}),[[Jl("ripple"),E.value&&t.ripple]])}),{activate:o,isActivated:l,isGroupActivator:f,isSelected:d,list:m,select:u,root:S,id:v,link:s}}}),Yle=Ue({color:String,inset:Boolean,sticky:Boolean,title:String,...jt(),...Ri()},"VListSubheader"),Xq=vt()({name:"VListSubheader",props:Yle(),setup(t,e){let{slots:n}=e;const{textColorClasses:i,textColorStyles:r}=Xs(Ve(t,"color"));return Ft(()=>{const s=!!(n.default||t.title);return W(t.tag,{class:["v-list-subheader",{"v-list-subheader--inset":t.inset,"v-list-subheader--sticky":t.sticky},i.value,t.class],style:[{textColorStyles:r},t.style]},{default:()=>{var a;return[s&&W("div",{class:"v-list-subheader__text"},[((a=n.default)==null?void 0:a.call(n))??t.title])]}})}),{}}}),Wle=Ue({items:Array,returnObject:Boolean},"VListChildren"),Zq=vt()({name:"VListChildren",props:Wle(),setup(t,e){let{slots:n}=e;return zq(),()=>{var i,r;return((i=n.default)==null?void 0:i.call(n))??((r=t.items)==null?void 0:r.map(s=>{var h,f;let{children:a,props:o,type:l,raw:u}=s;if(l==="divider")return((h=n.divider)==null?void 0:h.call(n,{props:o}))??W(El,o,null);if(l==="subheader")return((f=n.subheader)==null?void 0:f.call(n,{props:o}))??W(Xq,o,null);const c={subtitle:n.subtitle?S=>{var _;return(_=n.subtitle)==null?void 0:_.call(n,{...S,item:u})}:void 0,prepend:n.prepend?S=>{var _;return(_=n.prepend)==null?void 0:_.call(n,{...S,item:u})}:void 0,append:n.append?S=>{var _;return(_=n.append)==null?void 0:_.call(n,{...S,item:u})}:void 0,title:n.title?S=>{var _;return(_=n.title)==null?void 0:_.call(n,{...S,item:u})}:void 0},d=Xk.filterProps(o);return a?W(Xk,rt({value:o==null?void 0:o.value},d),{activator:S=>{let{props:_}=S;const p={...o,..._,value:t.returnObject?u:o.value};return n.header?n.header({props:p}):W(Bl,p,c)},default:()=>W(Zq,{items:a,returnObject:t.returnObject},n)}):n.item?n.item({props:o}):W(Bl,rt(o,{value:t.returnObject?u:o.value}),c)}))}}}),Jq=Ue({items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:"title"},itemValue:{type:[String,Array,Function],default:"value"},itemChildren:{type:[Boolean,String,Array,Function],default:"children"},itemProps:{type:[Boolean,String,Array,Function],default:"props"},returnObject:Boolean,valueComparator:Function},"list-items");function ml(t,e){const n=wo(e,t.itemTitle,e),i=wo(e,t.itemValue,n),r=wo(e,t.itemChildren),s=t.itemProps===!0?typeof e=="object"&&e!=null&&!Array.isArray(e)?"children"in e?Ga(e,["children"]):e:void 0:wo(e,t.itemProps),a={title:n,value:i,...s};return{title:String(a.title??""),value:a.value,props:a,children:Array.isArray(r)?eY(t,r):void 0,raw:e}}function eY(t,e){const n=Op(t,["itemTitle","itemValue","itemChildren","itemProps","returnObject","valueComparator"]),i=[];for(const r of e)i.push(ml(n,r));return i}function tY(t){const e=te(()=>eY(t,t.items)),n=te(()=>e.value.some(o=>o.value===null)),i=ut(new Map),r=ut([]);Wr(()=>{const o=e.value,l=new Map,u=[];for(let c=0;c<o.length;c++){const d=o[c];if(J3(d.value)||d.value===null){let h=l.get(d.value);h||(h=[],l.set(d.value,h)),h.push(d)}else u.push(d)}i.value=l,r.value=u});function s(o){const l=i.value,u=e.value,c=r.value,d=n.value,h=t.returnObject,f=!!t.valueComparator,S=t.valueComparator||Ks,_=Op(t,["itemTitle","itemValue","itemChildren","itemProps","returnObject","valueComparator"]),p=[];e:for(const v of o){if(!d&&v===null)continue;if(h&&typeof v=="string"){p.push(ml(_,v));continue}const m=l.get(v);if(f||!m){for(const g of f?u:c)if(S(v,g.value)){p.push(g);continue e}p.push(ml(_,v));continue}p.push(...m)}return p}function a(o){return t.returnObject?o.map(l=>{let{raw:u}=l;return u}):o.map(l=>{let{value:u}=l;return u})}return{items:e,transformIn:s,transformOut:a}}function Kle(t,e){const n=wo(e,t.itemType,"item"),i=J3(e)?e:wo(e,t.itemTitle),r=wo(e,t.itemValue,void 0),s=wo(e,t.itemChildren),a=t.itemProps===!0?Ga(e,["children"]):wo(e,t.itemProps),o={title:i,value:r,...a};return{type:n,title:o.title,value:o.value,props:o,children:n==="item"&&s?nY(t,s):void 0,raw:e}}function nY(t,e){const n=[];for(const i of e)n.push(Kle(t,i));return n}function jle(t){return{items:te(()=>nY(t,t.items))}}const Qle=Ue({baseColor:String,activeColor:String,activeClass:String,bgColor:String,disabled:Boolean,expandIcon:on,collapseIcon:on,lines:{type:[Boolean,String],default:"one"},slim:Boolean,nav:Boolean,"onClick:open":Yr(),"onClick:select":Yr(),"onUpdate:opened":Yr(),...Ple({selectStrategy:"single-leaf",openStrategy:"list"}),...bu(),...jt(),...ro(),...Ha(),...yu(),itemType:{type:String,default:"type"},...Jq(),...no(),...Ri(),...$i(),...za({variant:"text"})},"VList"),VN=vt()({name:"VList",props:Qle(),emits:{"update:selected":t=>!0,"update:activated":t=>!0,"update:opened":t=>!0,"click:open":t=>!0,"click:activate":t=>!0,"click:select":t=>!0},setup(t,e){let{slots:n}=e;const{items:i}=jle(t),{themeClasses:r}=cr(t),{backgroundColorClasses:s,backgroundColorStyles:a}=Il(Ve(t,"bgColor")),{borderClasses:o}=Eu(t),{densityClasses:l}=Qo(t),{dimensionStyles:u}=Va(t),{elevationClasses:c}=Cu(t),{roundedClasses:d}=io(t),{children:h,open:f,parents:S,select:_,getPath:p}=Ble(t),v=te(()=>t.lines?`v-list--${t.lines}-line`:void 0),m=Ve(t,"activeColor"),g=Ve(t,"baseColor"),b=Ve(t,"color");zq(),jd({VListGroup:{activeColor:m,baseColor:g,color:b,expandIcon:Ve(t,"expandIcon"),collapseIcon:Ve(t,"collapseIcon")},VListItem:{activeClass:Ve(t,"activeClass"),activeColor:m,baseColor:g,color:b,density:Ve(t,"density"),disabled:Ve(t,"disabled"),lines:Ve(t,"lines"),nav:Ve(t,"nav"),slim:Ve(t,"slim"),variant:Ve(t,"variant")}});const y=ut(!1),E=ve();function T(x){y.value=!0}function C(x){y.value=!1}function w(x){var O;!y.value&&!(x.relatedTarget&&((O=E.value)!=null&&O.contains(x.relatedTarget)))&&A()}function R(x){const O=x.target;if(!(!E.value||["INPUT","TEXTAREA"].includes(O.tagName))){if(x.key==="ArrowDown")A("next");else if(x.key==="ArrowUp")A("prev");else if(x.key==="Home")A("first");else if(x.key==="End")A("last");else return;x.preventDefault()}}function I(x){y.value=!0}function A(x){if(E.value)return hf(E.value,x)}return Ft(()=>W(t.tag,{ref:E,class:["v-list",{"v-list--disabled":t.disabled,"v-list--nav":t.nav,"v-list--slim":t.slim},r.value,s.value,o.value,l.value,c.value,v.value,d.value,t.class],style:[a.value,u.value,t.style],tabindex:t.disabled?-1:0,role:"listbox","aria-activedescendant":void 0,onFocusin:T,onFocusout:C,onFocus:w,onKeydown:R,onMousedown:I},{default:()=>[W(Zq,{items:i.value,returnObject:t.returnObject},n)]})),{open:f,select:_,focus:A,children:h,parents:S,getPath:p}}}),Xle={class:"project-list-container"},Zle=Qe({__name:"ProjectListPanel",setup(t){const e=nb(),n=Su(),i=yd(),r=ve(!1);return(s,a)=>{const o=Ale;return _e(),Ge(He,null,[Gt("div",Xle,[W(Is,{width:"460",variant:"text"},{default:be(()=>[W(Po,null,{default:be(()=>[W(BN,{class:"text-center text-uppercase"},{default:be(()=>a[2]||(a[2]=[Tt("Highstate Designer")])),_:1}),W(Rq,{class:"text-center"},{default:be(()=>[Tt(" v"+Mn(ie(i).public.version)+" ● Все зонды удалены ",1)]),_:1}),W(El,{class:"mt-4"}),W(VN,{variant:"flat",class:"project-list"},{default:be(()=>[W(Xq,{class:"text-uppercase"},{default:be(()=>a[3]||(a[3]=[Tt("Projects")])),_:1}),(_e(!0),Ge(He,null,Or(ie(e).projectNames,l=>(_e(),xe(Bl,{key:l,class:"prject-list-item",onClick:u=>ie(n).openProjectPanel(l)},{default:be(()=>[Tt(Mn(l),1)]),_:2},1032,["onClick"]))),128)),W(Bl,{class:"prject-list-item",onClick:a[0]||(a[0]=l=>r.value=!0)},{default:be(()=>[W(Ot,null,{default:be(()=>a[4]||(a[4]=[Tt("mdi-plus")])),_:1}),a[5]||(a[5]=Tt(" Create new project "))]),_:1})]),_:1})]),_:1})]),_:1})]),W(o,{visible:ie(r),"onUpdate:visible":a[1]||(a[1]=l=>Lt(r)?r.value=l:null)},null,8,["visible"])],64)}}}),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},Jle=Zn(Zle,[["__scopeId","data-v-3a776313"]]),ece=["ID","URL","IP","IPs","IPv4","IPv6","DNS","SSH","WireGuard","API","k8s","TLS","HTTP","HTTPS","TCP","UDP","CIDR","CPU","RAM","GPU","SSD","HDD","VM","CNI","CSI","MariaDB","PostgreSQL"],Zk=new Map(ece.map(t=>[t.toLowerCase(),t]));function zN(t){return t.split(/(?=[A-Z])|_|\./).map(n=>{const i=n.toLowerCase();return Zk.has(i)?Zk.get(i):n.charAt(0).toUpperCase()+n.slice(1)}).join(" ")}function Us(t,e){return e.displayName??zN(t)}let qA=[],iY=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?iY:qA).push(n=n+t[e])})();function tce(t){if(t<768)return!1;for(let e=0,n=qA.length;;){let i=e+n>>1;if(t<qA[i])n=i;else if(t>=iY[i])e=i+1;else return!0;if(e==n)return!1}}function Jk(t){return t>=127462&&t<=127487}const eM=8205;function nce(t,e,n=!0,i=!0){return(n?rY:ice)(t,e,i)}function rY(t,e,n){if(e==t.length)return e;e&&sY(t.charCodeAt(e))&&oY(t.charCodeAt(e-1))&&e--;let i=LE(t,e);for(e+=tM(i);e<t.length;){let r=LE(t,e);if(i==eM||r==eM||n&&tce(r))e+=tM(r),i=r;else if(Jk(r)){let s=0,a=e-2;for(;a>=0&&Jk(LE(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function ice(t,e,n){for(;e>0;){let i=rY(t,e-2,n);if(i<e)return i;e--}return 0}function LE(t,e){let n=t.charCodeAt(e);if(!oY(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return sY(i)?(n-55296<<10)+(i-56320)+65536:n}function sY(t){return t>=56320&&t<57344}function oY(t){return t>=55296&&t<56320}function tM(t){return t<65536?1:2}let _n=class aY{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=wd(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Ao.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=wd(this,e,n);let i=[];return this.decompose(e,n,i,0),Ao.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ff(this),s=new ff(e);for(let a=n,o=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new ff(this,e)}iterRange(e,n=this.length){return new lY(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new cY(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?aY.empty:e.length<=32?new fi(e):Ao.from(fi.split(e,[]))}};class fi extends _n{constructor(e,n=rce(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let a=this.text[s],o=r+a.length;if((n?i:o)>=e)return new sce(r,o,i,a);r=o+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new fi(nM(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),o=ag(s.text,a.text.slice(),0,s.length);if(o.length<=32)i.push(new fi(o,a.length+s.length));else{let l=o.length>>1;i.push(new fi(o.slice(0,l)),new fi(o.slice(l)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof fi))return super.replace(e,n,i);[e,n]=wd(this,e,n);let r=ag(this.text,ag(i.text,nM(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new fi(r,s):Ao.from(fi.split(r,[]),s)}sliceString(e,n=this.length,i=`
30
+ `)}function Ek(t){const e=t.dark?2:1,n=t.dark?1:2,i=[];for(const[r,s]of Object.entries(t.colors)){const a=xo(s);i.push(`--v-theme-${r}: ${a.r},${a.g},${a.b}`),r.startsWith("on-")||i.push(`--v-theme-${r}-overlay-multiplier: ${dne(s)>.18?e:n}`)}for(const[r,s]of Object.entries(t.variables)){const a=typeof s=="string"&&s.startsWith("#")?xo(s):void 0,o=a?`${a.r}, ${a.g}, ${a.b}`:void 0;i.push(`--v-${r}: ${o??s}`)}return i}function xf(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=CA(),i=ve();if(dn){const r=new ResizeObserver(s=>{s.length&&(e==="content"?i.value=s[0].contentRect:i.value=s[0].target.getBoundingClientRect())});Yi(()=>{r.disconnect()}),Ie(()=>n.el,(s,a)=>{a&&(r.unobserve(a),i.value=void 0),s&&r.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:qd(i)}}function Bz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:e,...n}=t,i=rr(e,n),{aliases:r={},components:s={},directives:a={}}=i,o=fne(i.defaults),l=fse(i.display,i.ssr),u=bse(i.theme),c=Ene(i.icons),d=yre(i.locale),h=use(i.date,d),f=mse(i.goTo,d);return{install:_=>{for(const p in a)_.directive(p,a[p]);for(const p in s)_.component(p,s[p]);for(const p in r)_.component(p,Qd({...r[p],name:p,aliasName:r[p].name}));if(u.install(_),_.provide(Cd,o),_.provide(xA,l),_.provide(dv,u),_.provide(RA,c),_.provide(cv,d),_.provide(cse,h.options),_.provide(pk,h.instance),_.provide(Lz,f),dn&&i.ssr)if(_.$nuxt)_.$nuxt.hook("app:suspense:resolve",()=>{l.update()});else{const{mount:p}=_;_.mount=function(){const v=p(...arguments);return $t(()=>l.update()),_.mount=p,v}}Os.reset(),_.mixin({computed:{$vuetify(){return $n({defaults:Lu.call(this,Cd),display:Lu.call(this,xA),theme:Lu.call(this,dv),icons:Lu.call(this,RA),locale:Lu.call(this,cv),date:Lu.call(this,pk)})}}})},defaults:o,display:l,theme:u,icons:c,locale:d,date:h,goTo:f}}const Ese="3.7.13";Bz.version=Ese;function Lu(t){var i,r;const e=this.$,n=((i=e.parent)==null?void 0:i.provides)??((r=e.vnode.appContext)==null?void 0:r.provides);if(n&&t in n)return n[t]}const yse=jr({name:"vuetify:nuxt:client:plugin",order:25,dependsOn:["vuetify:icons:plugin"],parallel:!0,async setup(t){let e,n;const i=vre();[e,n]=uf(()=>t.hooks.callHook("vuetify:configuration",{isDev:ck,vuetifyOptions:i})),await e,n(),[e,n]=uf(()=>t.hooks.callHook("vuetify:before-create",{isDev:ck,vuetifyOptions:i})),await e,n();const r=Bz(i);t.vueApp.use(r),t.provide("vuetify",r),[e,n]=uf(()=>t.hooks.callHook("vuetify:ready",r)),await e,n()}}),Cse=[Ate,Ite,wne,Ane,Nne,xne,Dne,kne,Lne,iie,rie,sie,gre,yse];class Tse{}class Ol extends Tse{constructor(e,n,i){super(),this.viewId=e,this.groupId=n,this.panelId=i}}class iu{constructor(){}static getInstance(){return iu.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,n){n&&(this.data=e,this.proto=n)}}iu.INSTANCE=new iu;function tr(){const t=iu.getInstance();if(t.hasData(Ol.prototype))return t.getData(Ol.prototype)[0]}var Vc;(function(t){t.any=(...e)=>n=>{const i=e.map(r=>r(n));return{dispose:()=>{i.forEach(r=>{r.dispose()})}}}})(Vc||(Vc={}));class vN{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class wse{constructor(){this.events=new Map}get size(){return this.events.size}add(e,n){this.events.set(e,n)}delete(e){this.events.delete(e)}clear(){this.events.clear()}}class hv{static create(){var e;return new hv((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class Rse{constructor(e,n){this.callback=e,this.stacktrace=n}}class Pe{static setLeakageMonitorEnabled(e){e!==Pe.ENABLE_TRACKING&&Pe.MEMORY_LEAK_WATCHER.clear(),Pe.ENABLE_TRACKING=e}get value(){return this._last}constructor(e){this.options=e,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>{var n;!((n=this.options)===null||n===void 0)&&n.replay&&this._last!==void 0&&e(this._last);const i=new Rse(e,Pe.ENABLE_TRACKING?hv.create():void 0);return this._listeners.push(i),{dispose:()=>{const r=this._listeners.indexOf(i);r>-1&&this._listeners.splice(r,1)}}},Pe.ENABLE_TRACKING&&Pe.MEMORY_LEAK_WATCHER.add(this._event,hv.create())),this._event}fire(e){this._last=e;for(const n of this._listeners)n.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(Pe.ENABLE_TRACKING&&queueMicrotask(()=>{var e;for(const n of this._listeners)console.warn("dockview: stacktrace",(e=n.stacktrace)===null||e===void 0?void 0:e.print())}),this._listeners=[]),Pe.ENABLE_TRACKING&&this._event&&Pe.MEMORY_LEAK_WATCHER.delete(this._event))}}Pe.ENABLE_TRACKING=!1;Pe.MEMORY_LEAK_WATCHER=new wse;function Ca(t,e,n,i){return t.addEventListener(e,n,i),{dispose:()=>{t.removeEventListener(e,n,i)}}}function si(t,e,n,i){return t.addEventListener(e,n,i),{dispose:()=>{t.removeEventListener(e,n,i)}}}class yk{constructor(){this._onFired=new Pe,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const n=this._currentFireCount;return this._onFired.event(()=>{this._currentFireCount>n&&e()})}}fire(){this._currentFireCount++,!this._queued&&(this._queued=!0,queueMicrotask(()=>{this._queued=!1,this._onFired.fire()}))}dispose(){this._onFired.dispose()}}var br;(function(t){t.NONE={dispose:()=>{}};function e(n){return{dispose:()=>{n()}}}t.from=e})(br||(br={}));class ln{get isDisposed(){return this._isDisposed}constructor(...e){this._isDisposed=!1,this._disposables=e}addDisposables(...e){e.forEach(n=>this._disposables.push(n))}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach(e=>e.dispose()),this._disposables=[])}}class Ho{constructor(){this._disposable=br.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=br.NONE)}}function Fz(t,e){const n=new ResizeObserver(i=>{requestAnimationFrame(()=>{const r=i[0];e(r)})});return n.observe(t),{dispose:()=>{n.unobserve(t),n.disconnect()}}}const DA=(t,...e)=>{for(const n of e)t.classList.contains(n)&&t.classList.remove(n)},Uz=(t,...e)=>{for(const n of e)t.classList.contains(n)||t.classList.add(n)},rn=(t,e,n)=>{const i=t.classList.contains(e);n&&!i&&t.classList.add(e),!n&&i&&t.classList.remove(e)};function kA(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ck(t){return Array.prototype.slice.call(document.getElementsByTagName(t),0)}function $z(t){return new Ase(t)}class Ase extends ln{constructor(e){super(),this._onDidFocus=new Pe,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new Pe,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let n=kA(document.activeElement,e),i=!1;const r=()=>{i=!1,n||(n=!0,this._onDidFocus.fire())},s=()=>{n&&(i=!0,window.setTimeout(()=>{i&&(i=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{kA(document.activeElement,e)!==n&&(n?s():r())},e instanceof HTMLElement?(this.addDisposables(si(e,"focus",r,!0)),this.addDisposables(si(e,"blur",s,!0))):(this.addDisposables(Ca(e,"focus",r,!0)),this.addDisposables(Ca(e,"blur",s,!0)))}refreshState(){this._refreshStateHandler()}}const Gz="dv-quasiPreventDefault";function Ose(t){t[Gz]=!0}function Tk(t){return t[Gz]}function Ise(t,e){const n=Array.from(e);for(const i of n){if(i.href){const s=t.createElement("link");s.href=i.href,s.type=i.type,s.rel="stylesheet",t.head.appendChild(s)}let r=[];try{i.cssRules&&(r=Array.from(i.cssRules).map(s=>s.cssText))}catch{}for(const s of r){const a=t.createElement("style");a.appendChild(t.createTextNode(s)),t.head.appendChild(a)}}}function wk(t){const{left:e,top:n,width:i,height:r}=t.getBoundingClientRect();return{left:e+window.scrollX,top:n+window.scrollY,width:i,height:r}}function Nse(t){let e=t;for(;e!=null&&e.parentNode;){if(e.parentNode===document)return!0;e.parentNode instanceof DocumentFragment?e=e.parentNode.host:e=e.parentNode}return!1}function xse(t,e){t.setAttribute("data-testid",e)}function fv(){const t=[...Ck("iframe"),...Ck("webview")],e=new WeakMap;for(const n of t)e.set(n,n.style.pointerEvents),n.style.pointerEvents="none";return{release:()=>{var n;for(const i of t)i.style.pointerEvents=(n=e.get(i))!==null&&n!==void 0?n:"auto";t.splice(0,t.length)}}}function Dse(t){function e(r){const s=[];for(let a=0;a<r.classList.length;a++)s.push(r.classList.item(a));return s}let n,i=t;for(;i!==null&&(n=e(i).find(r=>r.startsWith("dockview-theme-")),typeof n!="string");)i=i.parentElement;return n}class kse{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const n of this._classNames)rn(this.element,n,!1);this._classNames=e.split(" ").filter(n=>n.trim().length>0);for(const n of this._classNames)rn(this.element,n,!0)}}function kc(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}function Mse(t){return t.length>0?t[t.length-1]:void 0}function Lse(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function RE(t,e){const n=t.indexOf(e);n>-1&&(t.splice(n,1),t.unshift(e))}function b_(t,e){const n=t.indexOf(e);n>-1&&(t.splice(n,1),t.push(e))}function Pse(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(e(i))return n}return-1}function AE(t,e){const n=t.findIndex(i=>i===e);return n>-1?(t.splice(n,1),!0):!1}const zn=(t,e,n)=>e>n?e:Math.min(n,Math.max(t,e)),Hz=()=>{let t=1;return{next:()=>(t++).toString()}},Ps=(t,e)=>{const n=[];if(typeof e!="number"&&(e=t,t=0),t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n};class Bse{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,n,i,r){this.container=e,this.view=n,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(e,n){var i;e!==this.visible&&(e?(this.size=zn((i=this._cachedVisibleSize)!==null&&i!==void 0?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}dispose(){return this.disposable.dispose(),this.view}}var Pt;(function(t){t.HORIZONTAL="HORIZONTAL",t.VERTICAL="VERTICAL"})(Pt||(Pt={}));var _s;(function(t){t[t.MAXIMUM=0]="MAXIMUM",t[t.MINIMUM=1]="MINIMUM",t[t.DISABLED=2]="DISABLED",t[t.ENABLED=3]="ENABLED"})(_s||(_s={}));var Oi;(function(t){t.Low="low",t.High="high",t.Normal="normal"})(Oi||(Oi={}));var Ta;(function(t){t.Distribute={type:"distribute"};function e(i){return{type:"split",index:i}}t.Split=e;function n(i){return{type:"invisible",cachedVisibleSize:i}}t.Invisible=n})(Ta||(Ta={}));class Rk{get contentSize(){return this._contentSize}get size(){return this._size}set size(e){this._size=e}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(e){this._orientation=e;const n=this.size;this.size=this.orthogonalSize,this.orthogonalSize=n,DA(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==Pt.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce((e,n)=>e+n.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,n)=>e+n.maximumSize,0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(e){this._disabled=e,rn(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e}constructor(e,n){var i;this.container=e,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new Pe,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new Pe,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new Pe,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(r,s,a=this.viewItems.map(f=>f.size),o,l,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d,h)=>{if(r<0||r>this.viewItems.length)return 0;const f=Ps(r,-1),S=Ps(r+1,this.viewItems.length);if(l)for(const O of l)RE(f,O),RE(S,O);if(o)for(const O of o)b_(f,O),b_(S,O);const _=f.map(O=>this.viewItems[O]),p=f.map(O=>a[O]),v=S.map(O=>this.viewItems[O]),m=S.map(O=>a[O]),g=f.reduce((O,D)=>O+this.viewItems[D].minimumSize-a[D],0),b=f.reduce((O,D)=>O+this.viewItems[D].maximumSize-a[D],0),y=S.length===0?Number.POSITIVE_INFINITY:S.reduce((O,D)=>O+a[D]-this.viewItems[D].minimumSize,0),E=S.length===0?Number.NEGATIVE_INFINITY:S.reduce((O,D)=>O+a[D]-this.viewItems[D].maximumSize,0),T=Math.max(g,E),C=Math.min(y,b);let w=!1;if(d){const O=this.viewItems[d.index],D=s>=d.limitDelta;w=D!==O.visible,O.setVisible(D,d.size)}if(!w&&h){const O=this.viewItems[h.index],D=s<h.limitDelta;w=D!==O.visible,O.setVisible(D,h.size)}if(w)return this.resize(r,s,a,o,l,u,c);const R=zn(s,T,C);let I=0,A=R;for(let O=0;O<_.length;O++){const D=_[O],L=zn(p[O]+A,D.minimumSize,D.maximumSize),q=L-p[O];I+=q,A-=q,D.size=L}let x=I;for(let O=0;O<v.length;O++){const D=v[O],L=zn(m[O]-x,D.minimumSize,D.maximumSize),q=L-m[O];x+=q,D.size=L}return s},this._orientation=n.orientation,this.element=this.createContainer(),this.margin=(i=n.margin)!==null&&i!==void 0?i:0,this.proportionalLayout=n.proportionalLayout===void 0?!0:!!n.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(n.styles),n.descriptor&&(this._size=n.descriptor.size,n.descriptor.views.forEach((r,s)=>{const a=r.visible===void 0||r.visible?r.size:{type:"invisible",cachedVisibleSize:r.size},o=r.view;this.addView(o,a,s,!0)}),this._contentSize=this.viewItems.reduce((r,s)=>r+s.size,0),this.saveProportions())}style(e){(e==null?void 0:e.separatorBorder)==="transparent"?(DA(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(Uz(this.element,"dv-separator-border"),e!=null&&e.separatorBorder&&this.element.style.setProperty("--dv-separator-border",e.separatorBorder))}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,n){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[e];i.setVisible(n,i.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(e,n){if(e<0||e>=this.viewItems.length)return;const i=Ps(this.viewItems.length).filter(o=>o!==e),r=[...i.filter(o=>this.viewItems[o].priority===Oi.Low),e],s=i.filter(o=>this.viewItems[o].priority===Oi.High),a=this.viewItems[e];n=Math.round(n),n=zn(n,a.minimumSize,Math.min(a.maximumSize,this._size)),a.size=n,this.relayout(r,s)}getViews(){return this.viewItems.map(e=>e.view)}onDidChange(e,n){const i=this.viewItems.indexOf(e);if(i<0||i>=this.viewItems.length)return;n=typeof n=="number"?n:e.size,n=zn(n,e.minimumSize,e.maximumSize),e.size=n;const r=Ps(this.viewItems.length).filter(o=>o!==i),s=[...r.filter(o=>this.viewItems[o].priority===Oi.Low),i],a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.relayout([...s,i],a)}addView(e,n={type:"distribute"},i=this.viewItems.length,r){const s=document.createElement("div");s.className="dv-view",s.appendChild(e.element);let a;typeof n=="number"?a=n:n.type==="split"?a=this.getViewSize(n.index)/2:n.type==="invisible"?a={cachedVisibleSize:n.cachedVisibleSize}:a=e.minimumSize;const o=e.onDidChange(u=>this.onDidChange(l,u.size)),l=new Bse(s,e,a,{dispose:()=>{o.dispose(),this.viewContainer.removeChild(s)}});if(i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,l),this.viewItems.length>1){const u=document.createElement("div");u.className="dv-sash";const c=h=>{for(const D of this.viewItems)D.enabled=!1;const f=fv(),S=this._orientation===Pt.HORIZONTAL?h.clientX:h.clientY,_=Pse(this.sashes,D=>D.container===u),p=this.viewItems.map(D=>D.size);let v,m;const g=Ps(_,-1),b=Ps(_+1,this.viewItems.length),y=g.reduce((D,L)=>D+(this.viewItems[L].minimumSize-p[L]),0),E=g.reduce((D,L)=>D+(this.viewItems[L].viewMaximumSize-p[L]),0),T=b.length===0?Number.POSITIVE_INFINITY:b.reduce((D,L)=>D+(p[L]-this.viewItems[L].minimumSize),0),C=b.length===0?Number.NEGATIVE_INFINITY:b.reduce((D,L)=>D+(p[L]-this.viewItems[L].viewMaximumSize),0),w=Math.max(y,C),R=Math.min(T,E),I=this.findFirstSnapIndex(g),A=this.findFirstSnapIndex(b);if(typeof I=="number"){const D=this.viewItems[I],L=Math.floor(D.viewMinimumSize/2);v={index:I,limitDelta:D.visible?w-L:w+L,size:D.size}}if(typeof A=="number"){const D=this.viewItems[A],L=Math.floor(D.viewMinimumSize/2);m={index:A,limitDelta:D.visible?R+L:R-L,size:D.size}}const x=D=>{const q=(this._orientation===Pt.HORIZONTAL?D.clientX:D.clientY)-S;this.resize(_,q,p,void 0,void 0,w,R,v,m),this.distributeEmptySpace(),this.layoutViews()},O=()=>{for(const D of this.viewItems)D.enabled=!0;f.release(),this.saveProportions(),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",O),document.removeEventListener("pointercancel",O),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",x),document.addEventListener("pointerup",O),document.addEventListener("pointercancel",O)};u.addEventListener("pointerdown",c);const d={container:u,disposable:()=>{u.removeEventListener("pointerdown",c),this.sashContainer.removeChild(u)}};this.sashContainer.appendChild(u),this.sashes.push(d)}r||this.relayout([i]),!r&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidAddView.fire(e)}distributeViewSizes(){const e=[];let n=0;for(const o of this.viewItems)o.maximumSize-o.minimumSize>0&&(e.push(o),n+=o.size);const i=Math.floor(n/e.length);for(const o of e)o.size=zn(i,o.minimumSize,o.maximumSize);const r=Ps(this.viewItems.length),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.relayout(s,a)}removeView(e,n,i=!1){const r=this.viewItems.splice(e,1)[0];if(r.dispose(),this.viewItems.length>=1){const s=Math.max(e-1,0);this.sashes.splice(s,1)[0].disposable()}return i||this.relayout(),n&&n.type==="distribute"&&this.distributeViewSizes(),this._onDidRemoveView.fire(r.view),r.view}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}moveView(e,n){const i=this.getViewCachedVisibleSize(e),r=typeof i>"u"?this.getViewSize(e):Ta.Invisible(i),s=this.removeView(e,void 0,!0);this.addView(s,r,n)}layout(e,n){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.orthogonalSize=n,this.proportions){let r=0;for(let s=0;s<this.viewItems.length;s++){const a=this.viewItems[s],o=this.proportions[s];typeof o=="number"?r+=o:e-=a.size}for(let s=0;s<this.viewItems.length;s++){const a=this.viewItems[s],o=this.proportions[s];typeof o=="number"&&r>0&&(a.size=zn(Math.round(o*e/r),a.minimumSize,a.maximumSize))}}else{const r=Ps(this.viewItems.length),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);this.resize(this.viewItems.length-1,e-i,void 0,s,a)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,n){const i=this.viewItems.reduce((r,s)=>r+s.size,0);this.resize(this.viewItems.length-1,this._size-i,void 0,e,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(e){const n=this.viewItems.reduce((o,l)=>o+l.size,0);let i=this.size-n;const r=Ps(this.viewItems.length-1,-1),s=r.filter(o=>this.viewItems[o].priority===Oi.Low),a=r.filter(o=>this.viewItems[o].priority===Oi.High);for(const o of a)RE(r,o);for(const o of s)b_(r,o);typeof e=="number"&&b_(r,e);for(let o=0;i!==0&&o<r.length;o++){const l=this.viewItems[r[o]],u=zn(l.size+i,l.minimumSize,l.maximumSize),c=u-l.size;i-=c,l.size=u}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map(e=>e.visible?e.size/this._contentSize:void 0))}layoutViews(){if(this._contentSize=this.viewItems.reduce((l,u)=>l+u.size,0),this.updateSashEnablement(),this.viewItems.length===0)return;const e=this.viewItems.filter(l=>l.visible),n=Math.max(0,e.length-1),i=this.margin*n/Math.max(1,e.length);let r=0;const s=[],a=4,o=this.viewItems.reduce((l,u,c)=>{const d=u.visible?1:0;return c===0?l.push(d):l.push(l[c-1]+d),l},[]);this.viewItems.forEach((l,u)=>{r+=this.viewItems[u].size,s.push(r);const c=l.visible?l.size-i:0,d=Math.max(0,o[u]-1),h=u===0||d===0?0:s[u-1]+d/n*i;if(u<this.viewItems.length-1){const f=l.visible?h+c-a/2+this.margin/2:h;this._orientation===Pt.HORIZONTAL&&(this.sashes[u].container.style.left=`${f}px`,this.sashes[u].container.style.top="0px"),this._orientation===Pt.VERTICAL&&(this.sashes[u].container.style.left="0px",this.sashes[u].container.style.top=`${f}px`)}this._orientation===Pt.HORIZONTAL&&(l.container.style.width=`${c}px`,l.container.style.left=`${h}px`,l.container.style.top="",l.container.style.height=""),this._orientation===Pt.VERTICAL&&(l.container.style.height=`${c}px`,l.container.style.top=`${h}px`,l.container.style.width="",l.container.style.left=""),l.view.layout(l.size-i,this._orthogonalSize)})}findFirstSnapIndex(e){for(const n of e){const i=this.viewItems[n];if(i.visible&&i.snap)return n}for(const n of e){const i=this.viewItems[n];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return n}}updateSashEnablement(){let e=!1;const n=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const s=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const a=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let o=0;for(let l=0;l<this.sashes.length;l++){const u=this.sashes[l],c=this.viewItems[l];o+=c.size;const d=!(n[l]&&a[l+1]),h=!(i[l]&&s[l+1]);if(d&&h){const f=Ps(l,-1),S=Ps(l+1,this.viewItems.length),_=this.findFirstSnapIndex(f),p=this.findFirstSnapIndex(S),v=typeof _=="number"&&!this.viewItems[_].visible,m=typeof p=="number"&&!this.viewItems[p].visible;v&&s[l]&&(o>0||this.startSnappingEnabled)?this.updateSash(u,_s.MINIMUM):m&&n[l]&&(o<this._contentSize||this.endSnappingEnabled)?this.updateSash(u,_s.MAXIMUM):this.updateSash(u,_s.DISABLED)}else d&&!h?this.updateSash(u,_s.MINIMUM):!d&&h?this.updateSash(u,_s.MAXIMUM):this.updateSash(u,_s.ENABLED)}}updateSash(e,n){rn(e.container,"dv-disabled",n===_s.DISABLED),rn(e.container,"dv-enabled",n===_s.ENABLED),rn(e.container,"dv-maximum",n===_s.MAXIMUM),rn(e.container,"dv-minimum",n===_s.MINIMUM)}createViewContainer(){const e=document.createElement("div");return e.className="dv-view-container",e}createSashContainer(){const e=document.createElement("div");return e.className="dv-sash-container",e}createContainer(){const e=document.createElement("div"),n=this._orientation===Pt.HORIZONTAL?"dv-horizontal":"dv-vertical";return e.className=`dv-split-view-container ${n}`,e}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let e=0;e<this.element.children.length;e++)if(this.element.children.item(e)===this.element){this.element.removeChild(this.element);break}for(const e of this.viewItems)e.dispose();this.element.remove()}}class Xi{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===Pt.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===Pt.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===Pt.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===Pt.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===Pt.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===Pt.HORIZONTAL?this.size:this.orthogonalSize}constructor(e,n,i,r=0){this.view=e,this.orientation=n,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=r,this._disposable=this.view.onDidChange(s=>{s?this._onDidChange.fire({size:this.orientation===Pt.VERTICAL?s.width:s.height,orthogonalSize:this.orientation===Pt.VERTICAL?s.height:s.width}):this._onDidChange.fire({})})}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,n){this._size=e,this._orthogonalSize=n,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class vi extends ln{get width(){return this.orientation===Pt.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===Pt.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return this.children.length===0?0:Math.max(...this.children.map((e,n)=>this.splitview.isViewVisible(n)?e.minimumOrthogonalSize:0))}get maximumSize(){return Math.min(...this.children.map((e,n)=>this.splitview.isViewVisible(n)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===Pt.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===Pt.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===Pt.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===Pt.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(this.children.length===0)return Oi.Normal;const e=this.children.map(n=>typeof n.priority>"u"?Oi.Normal:n.priority);return e.some(n=>n===Oi.High)?Oi.High:e.some(n=>n===Oi.Low)?Oi.Low:Oi.Normal}get disabled(){return this.splitview.disabled}set disabled(e){this.splitview.disabled=e}get margin(){return this.splitview.margin}set margin(e){this.splitview.margin=e,this.children.forEach(n=>{n instanceof vi&&(n.margin=e)})}constructor(e,n,i,r,s,a,o,l){if(super(),this.orientation=e,this.proportionalLayout=n,this.styles=i,this._childrenDisposable=br.NONE,this.children=[],this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new Pe,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=s,this._size=r,this.element=document.createElement("div"),this.element.className="dv-branch-node",!l)this.splitview=new Rk(this.element,{orientation:this.orientation,proportionalLayout:n,styles:i,margin:o}),this.splitview.layout(this.size,this.orthogonalSize);else{const u={views:l.map(c=>({view:c.node,size:c.node.size,visible:c.node instanceof Xi&&c.visible!==void 0?c.visible:!0})),size:this.orthogonalSize};this.children=l.map(c=>c.node),this.splitview=new Rk(this.element,{orientation:this.orientation,descriptor:u,proportionalLayout:n,styles:i,margin:o})}this.disabled=a,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd(()=>{this._onDidChange.fire({})})),this.setupChildrenEvents()}setVisible(e){}isChildVisible(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(e)}setChildVisible(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===n)return;const i=this.splitview.contentSize===0;this.splitview.setViewVisible(e,n);const r=this.splitview.contentSize===0;(n&&i||!n&&r)&&this._onDidVisibilityChange.fire({visible:n})}moveChild(e,n){if(e===n)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<n&&n--,this.splitview.moveView(e,n);const i=this._removeChild(e);this._addChild(i,n)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,n)}layout(e,n){this._size=n,this._orthogonalSize=e,this.splitview.layout(n,e)}addChild(e,n,i,r){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,n,i,r),this._addChild(e,i)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,n){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,n),this._removeChild(e)}_addChild(e,n){this.children.splice(n,0,e),this.setupChildrenEvents()}_removeChild(e){const[n]=this.children.splice(e,1);return this.setupChildrenEvents(),n}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new ln(Vc.any(...this.children.map(e=>e.onDidChange))(e=>{this._onDidChange.fire({size:e.orthogonalSize})}),...this.children.map((e,n)=>e instanceof vi?e.onDidVisibilityChange(({visible:i})=>{this.setChildVisible(n,i)}):br.NONE))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach(e=>e.dispose()),super.dispose()}}function MA(t,e){if(t instanceof Xi)return t;if(t instanceof vi)return MA(t.children[e?t.children.length-1:0],e);throw new Error("invalid node")}function LA(t,e,n){if(t instanceof vi){const i=new vi(Ro(t.orientation),t.proportionalLayout,t.styles,e,n,t.disabled,t.margin);let r=0;for(let s=t.children.length-1;s>=0;s--){const a=t.children[s],o=a instanceof vi?a.orthogonalSize:a.size;let l=t.size===0?0:Math.round(e*o/t.size);r+=l,s===0&&(l+=e-r),i.addChild(LA(a,n,l),l,0,!0)}return i}else return new Xi(t.view,Ro(t.orientation),n)}function Fse(t){const e=t.parentElement;if(!e)throw new Error("Invalid grid element");let n=e.firstElementChild,i=0;for(;n!==t&&n!==e.lastElementChild&&n;)n=n.nextElementSibling,i++;return i}function Vi(t){const e=t.parentElement;if(!e)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(e.className))return[];const n=Fse(e),i=e.parentElement.parentElement.parentElement;return[...Vi(i),n]}function Pu(t,e,n){const i=$se(t,e),r=Use(n);if(i===r){const[s,a]=kc(e);let o=a;return(n==="right"||n==="bottom")&&(o+=1),[...s,o]}else{const s=n==="right"||n==="bottom"?1:0;return[...e,s]}}function Use(t){return t==="top"||t==="bottom"?Pt.VERTICAL:Pt.HORIZONTAL}function $se(t,e){return e.length%2===0?Ro(t):t}const Ro=t=>t===Pt.HORIZONTAL?Pt.VERTICAL:Pt.HORIZONTAL;function Gse(t){return!!t.children}const PA=(t,e)=>{const n=e===Pt.VERTICAL?t.box.width:t.box.height;return Gse(t)?{type:"branch",data:t.children.map(i=>PA(i,Ro(e))),size:n}:typeof t.cachedVisibleSize=="number"?{type:"leaf",data:t.view.toJSON(),size:t.cachedVisibleSize,visible:!1}:{type:"leaf",data:t.view.toJSON(),size:n}};class Hse{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(e){if(this.root.orientation===e)return;const{size:n,orthogonalSize:i}=this.root;this.root=LA(this.root,i,n),this.root.layout(n,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(e){this._locked=e;const n=[this.root];for(;n.length>0;){const i=n.pop();i instanceof vi&&(i.disabled=e,n.push(...i.children))}}get margin(){return this._margin}set margin(e){this._margin=e,this.root.margin=e}maximizedView(){var e;return(e=this._maximizedNode)===null||e===void 0?void 0:e.leaf.view}hasMaximizedView(){return this._maximizedNode!==void 0}maximizeView(e){var n;const i=Vi(e.element),[r,s]=this.getNode(i);if(!(s instanceof Xi)||((n=this._maximizedNode)===null||n===void 0?void 0:n.leaf)===s)return;this.hasMaximizedView()&&this.exitMaximizedView(),PA(this.getView(),this.orientation);const a=[];function o(l,u){for(let c=0;c<l.children.length;c++){const d=l.children[c];d instanceof Xi?d!==u&&(l.isChildVisible(c)?l.setChildVisible(c,!1):a.push(d)):o(d,u)}}o(this.root,s),this._maximizedNode={leaf:s,hiddenOnMaximize:a},this._onDidMaximizedNodeChange.fire({view:s.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const e=this._maximizedNode.hiddenOnMaximize;function n(r){for(let s=r.children.length-1;s>=0;s--){const a=r.children[s];a instanceof Xi?e.includes(a)||r.setChildVisible(s,!0):n(a)}}n(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let n;e&&(n=Vi(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const r={root:PA(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return n&&(r.maximizedNode={location:n}),e&&this.maximizeView(e),r}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const e=this.root.orientation;this.root=new vi(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(e,n){const i=e.orientation,r=i===Pt.VERTICAL?e.height:e.width;if(this._deserialize(e.root,i,n,r),this.layout(e.width,e.height),e.maximizedNode){const s=e.maximizedNode.location,[a,o]=this.getNode(s);if(!(o instanceof Xi))return;this.maximizeView(o.view)}}_deserialize(e,n,i,r){this.root=this._deserializeNode(e,n,i,r)}_deserializeNode(e,n,i,r){var s;let a;if(e.type==="branch"){const l=e.data.map(u=>({node:this._deserializeNode(u,Ro(n),i,e.size),visible:u.visible}));a=new vi(n,this.proportionalLayout,this.styles,e.size,r,this.locked,this.margin,l)}else{const o=i.fromJSON(e);typeof e.visible=="boolean"&&((s=o.setVisible)===null||s===void 0||s.call(o,e.visible)),a=new Xi(o,n,r,e.size)}return a}get root(){return this._root}set root(e){const n=this._root;n&&(n.dispose(),this._maximizedNode=void 0,this.element.removeChild(n.element)),this._root=e,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(i=>{this._onDidChange.fire(i)})}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const e=this.root;if(e.element.remove(),this._root=new vi(Ro(e.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),e.children.length!==0)if(e.children.length===1){const n=e.children[0];e.removeChild(0).dispose(),e.dispose(),this._root.addChild(LA(n,n.orthogonalSize,n.size),Ta.Distribute,0)}else this._root.addChild(e,Ta.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange(n=>{this._onDidChange.fire(n)})}next(e){return this.progmaticSelect(e)}previous(e){return this.progmaticSelect(e,!0)}getView(e){const n=e?this.getNode(e)[1]:this.root;return this._getViews(n,this.orientation)}_getViews(e,n,i){const r={height:e.height,width:e.width};if(e instanceof Xi)return{box:r,view:e.view,cachedVisibleSize:i};const s=[];for(let a=0;a<e.children.length;a++){const o=e.children[a],l=e.getChildCachedVisibleSize(a);s.push(this._getViews(o,Ro(n),l))}return{box:r,children:s}}progmaticSelect(e,n=!1){const[i,r]=this.getNode(e);if(!(r instanceof Xi))throw new Error("invalid location");for(let s=i.length-1;s>-1;s--){const a=i[s],o=e[s]||0;if(n?o-1>-1:o+1<a.children.length)return MA(a.children[n?o-1:o+1],n)}return MA(this.root,n)}constructor(e,n,i,r,s){this.proportionalLayout=e,this.styles=n,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new Ho,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new Pe,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new Pe,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=r??!1,this._margin=s??0,this.root=new vi(i,e,n,0,0,this.locked,this.margin)}isViewVisible(e){const[n,i]=kc(e),[,r]=this.getNode(n);if(!(r instanceof vi))throw new Error("Invalid from location");return r.isChildVisible(i)}setViewVisible(e,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=kc(e),[,s]=this.getNode(i);if(!(s instanceof vi))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),s.setChildVisible(r,n)}moveView(e,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,r]=this.getNode(e);if(!(r instanceof vi))throw new Error("Invalid location");r.moveChild(n,i)}addView(e,n,i){this.hasMaximizedView()&&this.exitMaximizedView();const[r,s]=kc(i),[a,o]=this.getNode(r);if(o instanceof vi){const l=new Xi(e,Ro(o.orientation),o.orthogonalSize);o.addChild(l,n,s)}else{const[l,...u]=[...a].reverse(),[c,...d]=[...r].reverse();let h=0;const f=l.getChildCachedVisibleSize(c);typeof f=="number"&&(h=Ta.Invisible(f)),l.removeChild(c).dispose();const _=new vi(o.orientation,this.proportionalLayout,this.styles,o.size,o.orthogonalSize,this.locked,this.margin);l.addChild(_,o.size,c);const p=new Xi(o.view,l.orientation,o.size);_.addChild(p,h,0),typeof n!="number"&&n.type==="split"&&(n={type:"split",index:0});const v=new Xi(e,l.orientation,o.size);_.addChild(v,n,s)}}remove(e,n){const i=Vi(e.element);return this.removeView(i,n)}removeView(e,n){this.hasMaximizedView()&&this.exitMaximizedView();const[i,r]=kc(e),[s,a]=this.getNode(i);if(!(a instanceof vi))throw new Error("Invalid location");const o=a.children[r];if(!(o instanceof Xi))throw new Error("Invalid location");if(a.removeChild(r,n),o.dispose(),a.children.length!==1)return o.view;const l=a.children[0];if(s.length===0)return l instanceof Xi||(a.removeChild(0,n),this.root=l),o.view;const[u,...c]=[...s].reverse(),[d,...h]=[...i].reverse(),f=a.isChildVisible(0);a.removeChild(0,n);const S=u.children.map((_,p)=>u.getChildSize(p));if(u.removeChild(d,n).dispose(),l instanceof vi){S.splice(d,1,...l.children.map(_=>_.size));for(let _=0;_<l.children.length;_++){const p=l.children[_];u.addChild(p,p.size,d+_)}for(;l.children.length>0;)l.removeChild(0)}else{const _=new Xi(l.view,Ro(l.orientation),l.size),p=f?l.orthogonalSize:Ta.Invisible(l.orthogonalSize);u.addChild(_,p,d)}l.dispose();for(let _=0;_<S.length;_++)u.resizeChild(_,S[_]);return o.view}layout(e,n){const[i,r]=this.root.orientation===Pt.HORIZONTAL?[n,e]:[e,n];this.root.layout(i,r)}getNode(e,n=this.root,i=[]){if(e.length===0)return[i,n];if(!(n instanceof vi))throw new Error("Invalid location");const[r,...s]=e;if(r<0||r>=n.children.length)throw new Error("Invalid location");const a=n.children[r];return i.push(n),this.getNode(s,a,i)}}class Vse extends ln{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,n=!1){super(),this._disableResizing=n,this._element=e,this.addDisposables(Fz(this._element,i=>{if(this.isDisposed||this.disableResizing||!this._element.offsetParent||!Nse(this._element))return;const{width:r,height:s}=i.contentRect;this.layout(r,s)}))}}const zse=Hz();function Ak(t){switch(t){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";case"within":default:return"center"}}class qse extends Vse{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map(e=>e.value)}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(e){this.gridview.locked=e}constructor(e,n){var i;super(document.createElement("div"),n.disableAutoResizing),this._id=zse.next(),this._groups=new Map,this._onDidRemove=new Pe,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new Pe,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new Pe,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new Pe,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new yk,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new yk,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new kse(this.element),this._classNames.setClassNames((i=n.className)!==null&&i!==void 0?i:""),e.appendChild(this.element),this.gridview=new Hse(!!n.proportionalLayout,n.styles,n.orientation,n.locked,n.margin),this.gridview.locked=!!n.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange(r=>{this._onDidMaximizedChange.fire({panel:r.view,isMaximized:r.isMaximized})}),this.gridview.onDidViewVisibilityChange(()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire()),this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.layout(this.width,this.height,!0)}),br.from(()=>{var r;(r=this.element.parentElement)===null||r===void 0||r.removeChild(this.element)}),this.gridview.onDidChange(()=>{this._bufferOnDidLayoutChange.fire()}),Vc.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)(()=>{this._bufferOnDidLayoutChange.fire()}),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,n){this.gridview.setViewVisible(Vi(e.element),n),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(Vi(e.element))}updateOptions(e){var n,i,r,s;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=(n=e.disableAutoResizing)!==null&&n!==void 0?n:!1),"locked"in e&&(this.locked=(i=e.locked)!==null&&i!==void 0?i:!1),"margin"in e&&(this.gridview.margin=(r=e.margin)!==null&&r!==void 0?r:0),"className"in e&&this._classNames.setClassNames((s=e.className)!==null&&s!==void 0?s:"")}maximizeGroup(e){this.gridview.maximizeView(e),this.doSetGroupActive(e)}isMaximizedGroup(e){return this.gridview.maximizedView()===e}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(e,n=[0],i){this.gridview.addView(e,i??Ta.Distribute,n),this._onDidAdd.fire(e)}doRemoveGroup(e,n){if(!this._groups.has(e.id))throw new Error("invalid operation");const i=this._groups.get(e.id),r=this.gridview.remove(e,Ta.Distribute);if(i&&!(n!=null&&n.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(e.id),this._onDidRemove.fire(e)),!(n!=null&&n.skipActive)&&this._activeGroup===e){const s=Array.from(this._groups.values());this.doSetGroupActive(s.length>0?s[0].value:void 0)}return r}getPanel(e){var n;return(n=this._groups.get(e))===null||n===void 0?void 0:n.value}doSetGroupActive(e){this._activeGroup!==e&&(this._activeGroup&&this._activeGroup.setActive(!1),e&&e.setActive(!0),this._activeGroup=e,this._onDidActiveChange.fire(e))}removeGroup(e){this.doRemoveGroup(e)}moveToNext(e){var n;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=Vi(e.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}moveToPrevious(e){var n;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=Vi(e.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;this.doSetGroupActive(r)}layout(e,n,i){(i||e!==this.width||n!==this.height)&&(this.gridview.element.style.height=`${n}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,n))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class pv{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get gap(){return this.component.gap}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(e){this.component=e}focus(){this.component.focus()}getPanel(e){return this.component.getGroupPanel(e)}layout(e,n,i=!1){this.component.layout(e,n,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e){this.component.removePanel(e)}addGroup(e){return this.component.addGroup(e)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(e){this.component.removeGroup(e)}getGroup(e){return this.component.getPanel(e)}addFloatingGroup(e,n){return this.component.addFloatingGroup(e,n)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(e){this.component.moveToNext(e)}moveToPrevious(e){this.component.moveToPrevious(e)}maximizeGroup(e){this.component.maximizeGroup(e.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(e,n){return this.component.addPopoutGroup(e,n)}setGap(e){this.component.updateOptions({gap:e})}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Vz extends ln{constructor(e){super(),this.el=e,this.dataDisposable=new Ho,this.pointerEventsDisposable=new Ho,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}isCancelled(e){return!1}configure(){this.addDisposables(this._onDragStart,si(this.el,"dragstart",e=>{if(e.defaultPrevented||this.isCancelled(e)){e.preventDefault();return}const n=fv();this.pointerEventsDisposable.value={dispose:()=>{n.release()}},this.el.classList.add("dv-dragged"),setTimeout(()=>this.el.classList.remove("dv-dragged"),0),this.dataDisposable.value=this.getData(e),this._onDragStart.fire(e),e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.items.length>0||e.dataTransfer.setData("text/plain",""))}),si(this.el,"dragend",()=>{this.pointerEventsDisposable.dispose(),this.dataDisposable.dispose()}))}}class zz extends ln{constructor(e,n){super(),this.element=e,this.callbacks=n,this.target=null,this.registerListeners()}onDragEnter(e){this.target=e.target,this.callbacks.onDragEnter(e)}onDragOver(e){e.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(e)}onDragLeave(e){this.target===e.target&&(this.target=null,this.callbacks.onDragLeave(e))}onDragEnd(e){this.target=null,this.callbacks.onDragEnd(e)}onDrop(e){this.callbacks.onDrop(e)}registerListeners(){this.addDisposables(si(this.element,"dragenter",e=>{this.onDragEnter(e)},!0)),this.addDisposables(si(this.element,"dragover",e=>{this.onDragOver(e)},!0)),this.addDisposables(si(this.element,"dragleave",e=>{this.onDragLeave(e)})),this.addDisposables(si(this.element,"dragend",e=>{this.onDragEnd(e)})),this.addDisposables(si(this.element,"drop",e=>{this.onDrop(e)}))}}class Yse extends vN{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function Ok(t){switch(t){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${t}'`)}}function Wse(t){switch(t){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${t}'`)}}const Kse={value:20,type:"percentage"},jse={value:50,type:"percentage"},Qse=100,Xse=100;class Ml extends ln{get state(){return this._state}constructor(e,n){super(),this.element=e,this.options=n,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new zz(this.element,{onDragEnter:()=>{},onDragOver:i=>{if(this._acceptedTargetZonesSet.size===0){this.removeDropTarget();return}const r=this.element.clientWidth,s=this.element.clientHeight;if(r===0||s===0)return;const a=i.currentTarget.getBoundingClientRect(),o=i.clientX-a.left,l=i.clientY-a.top,u=this.calculateQuadrant(this._acceptedTargetZonesSet,o,l,r,s);if(this.isAlreadyUsed(i)||u===null){this.removeDropTarget();return}if(!this.options.canDisplayOverlay(i,u)){this.removeDropTarget();return}const c=new Yse({nativeEvent:i,position:u});if(this._onWillShowOverlay.fire(c),c.defaultPrevented){this.removeDropTarget();return}this.markAsUsed(i),this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),this.element.classList.add("dv-drop-target"),this.element.append(this.targetElement)),this.toggleClasses(u,r,s),this._state=u},onDragLeave:()=>{this.removeDropTarget()},onDragEnd:()=>{this.removeDropTarget()},onDrop:i=>{i.preventDefault();const r=this._state;this.removeDropTarget(),r&&(i.stopPropagation(),this._onDrop.fire({position:r,nativeEvent:i}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(e){this._acceptedTargetZonesSet=new Set(e)}setOverlayModel(e){this.options.overlayModel=e}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(e){e[Ml.USED_EVENT_ID]=!0}isAlreadyUsed(e){const n=e[Ml.USED_EVENT_ID];return typeof n=="boolean"&&n}toggleClasses(e,n,i){var r,s;if(!this.overlayElement)return;const a=n<Qse,o=i<Xse,l=e==="left",u=e==="right",c=e==="top",d=e==="bottom",h=!a&&u,f=!a&&l,S=!o&&c,_=!o&&d;let p=1;const v=(s=(r=this.options.overlayModel)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:jse;v.type==="percentage"?p=zn(v.value,0,100)/100:((h||f)&&(p=zn(0,v.value,n)/n),(S||_)&&(p=zn(0,v.value,i)/i));const m={top:"0px",left:"0px",width:"100%",height:"100%"};h?(m.left=`${100*(1-p)}%`,m.width=`${100*p}%`):f?m.width=`${100*p}%`:S?m.height=`${100*p}%`:_&&(m.top=`${100*(1-p)}%`,m.height=`${100*p}%`),this.overlayElement.style.top=m.top,this.overlayElement.style.left=m.left,this.overlayElement.style.width=m.width,this.overlayElement.style.height=m.height,rn(this.overlayElement,"dv-drop-target-small-vertical",o),rn(this.overlayElement,"dv-drop-target-small-horizontal",a),rn(this.overlayElement,"dv-drop-target-left",l),rn(this.overlayElement,"dv-drop-target-right",u),rn(this.overlayElement,"dv-drop-target-top",c),rn(this.overlayElement,"dv-drop-target-bottom",d),rn(this.overlayElement,"dv-drop-target-center",e==="center")}calculateQuadrant(e,n,i,r,s){var a,o;const l=(o=(a=this.options.overlayModel)===null||a===void 0?void 0:a.activationSize)!==null&&o!==void 0?o:Kse;return l.type==="percentage"?Zse(e,n,i,r,s,l.value):Jse(e,n,i,r,s,l.value)}removeDropTarget(){this.targetElement&&(this._state=void 0,this.element.removeChild(this.targetElement),this.targetElement=void 0,this.overlayElement=void 0,this.element.classList.remove("dv-drop-target"))}}Ml.USED_EVENT_ID="__dockview_droptarget_event_is_used__";function Zse(t,e,n,i,r,s){const a=100*e/i,o=100*n/r;return t.has("left")&&a<s?"left":t.has("right")&&a>100-s?"right":t.has("top")&&o<s?"top":t.has("bottom")&&o>100-s?"bottom":t.has("center")?"center":null}function Jse(t,e,n,i,r,s){return t.has("left")&&e<s?"left":t.has("right")&&e>i-s?"right":t.has("top")&&n<s?"top":t.has("bottom")&&n>r-s?"bottom":t.has("center")?"center":null}class qz extends vN{constructor(){super()}}class eoe extends ln{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(e,n){super(),this.id=e,this.component=n,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new Ho,this._onDidDimensionChange=new Pe,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new Pe,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new Pe,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new Pe,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new Pe,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new Pe,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new Pe,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new Pe,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange(i=>{this._isFocused=i.isFocused}),this.onDidActiveChange(i=>{this._isActive=i.isActive}),this.onDidVisibilityChange(i=>{this._isVisible=i.isVisible}),this.onDidDimensionsChange(i=>{this._width=i.width,this._height=i.height}),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(e){this.panelUpdatesDisposable.value=this._onDidParametersChange.event(n=>{this._parameters=n,e.update({params:n})})}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class toe extends ln{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var e;return(e=this._params)===null||e===void 0?void 0:e.params}constructor(e,n,i){super(),this.id=e,this.component=n,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const r=$z(this._element);this.addDisposables(this.api,r.onDidFocus(()=>{this.api._onDidChangeFocus.fire({isFocused:!0})}),r.onDidBlur(()=>{this.api._onDidChangeFocus.fire({isFocused:!1})}),r)}focus(){const e=new qz;this.api._onWillFocus.fire(e),!e.defaultPrevented&&this._element.focus()}layout(e,n){this._width=e,this._height=n,this.api._onDidDimensionChange.fire({width:e,height:n}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var n,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},(n=this._params)===null||n===void 0?void 0:n.params),e.params)});for(const r of Object.keys(e.params))e.params[r]===void 0&&delete this._params.params[r];(i=this.part)===null||i===void 0||i.update({params:this._params.params})}toJSON(){var e,n;const i=(n=(e=this._params)===null||e===void 0?void 0:e.params)!==null&&n!==void 0?n:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var e;this.api.dispose(),(e=this.part)===null||e===void 0||e.dispose(),super.dispose()}}class noe extends ln{get element(){return this._element}constructor(e,n){super(),this.accessor=e,this.group=n,this.disposable=new Ho,this._onDidFocus=new Pe,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new Pe,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur),this.dropTarget=new Ml(this.element,{acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(i,r)=>{if(this.group.locked==="no-drop-target"||this.group.locked&&r==="center")return!1;const s=tr();return!s&&i.shiftKey&&this.group.location.type!=="floating"?!1:s&&s.viewId===this.accessor.id?s.groupId===this.group.id&&(r==="center"||s.panelId===null)?!1:!(this.group.panels.length===1&&s.groupId===this.group.id):this.group.canDisplayOverlay(i,r,"content")}}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,n={asActive:!0}){const i=n.asActive||this.panel&&this.group.isPanelActive(this.panel);this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=e;let r;switch(e.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(e),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),r=this._element;break;case"always":e.view.content.element.parentElement===this._element&&this._element.removeChild(e.view.content.element),r=this.group.renderContainer.attach({panel:e,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${e.api.renderer}'`)}if(i){const s=$z(r),a=new ln;a.addDisposables(s,s.onDidFocus(()=>this._onDidFocus.fire()),s.onDidBlur(()=>this._onDidBlur.fire())),this.disposable.value=a}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,n){}closePanel(){var e;this.panel&&this.panel.api.renderer==="onlyWhenVisible"&&((e=this.panel.view.content.element.parentElement)===null||e===void 0||e.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}}class ioe extends Vz{constructor(e,n,i,r){super(e),this.accessor=n,this.group=i,this.panel=r,this.panelTransfer=iu.getInstance()}getData(e){return this.panelTransfer.setData([new Ol(this.accessor.id,this.group.id,this.panel.id)],Ol.prototype),{dispose:()=>{this.panelTransfer.clearData(Ol.prototype)}}}}class roe extends ln{get element(){return this._element}constructor(e,n,i){super(),this.panel=e,this.accessor=n,this.group=i,this.content=void 0,this._onChanged=new Pe,this.onChanged=this._onChanged.event,this._onDropped=new Pe,this.onDrop=this._onDropped.event,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!0,rn(this.element,"dv-inactive-tab",!0);const r=new ioe(this._element,this.accessor,this.group,this.panel);this.dropTarget=new Ml(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(s,a)=>{if(this.group.locked)return!1;const o=tr();return o&&this.accessor.id===o.viewId?o.panelId===null&&o.groupId===this.group.id?!1:this.panel.id!==o.panelId:this.group.model.canDisplayOverlay(s,a,"tab")}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onChanged,this._onDropped,this._onDragStart,r.onDragStart(s=>{this._onDragStart.fire(s)}),r,si(this._element,"pointerdown",s=>{s.defaultPrevented||this._onChanged.fire(s)}),this.dropTarget.onDrop(s=>{this._onDropped.fire(s)}),this.dropTarget)}setActive(e){rn(this.element,"dv-active-tab",e),rn(this.element,"dv-inactive-tab",!e)}setContent(e){this.content&&this._element.removeChild(this.content.element),this.content=e,this._element.appendChild(this.content.element)}dispose(){super.dispose()}}function soe(t,e){Uz(e,"dv-dragged"),document.body.appendChild(e),t.setDragImage(e,0,0),setTimeout(()=>{DA(e,"dv-dragged"),e.remove()},0)}class ooe extends Vz{constructor(e,n,i){super(e),this.accessor=n,this.group=i,this.panelTransfer=iu.getInstance(),this.addDisposables(si(e,"pointerdown",r=>{r.shiftKey&&Ose(r)},!0))}isCancelled(e){return this.group.api.location.type==="floating"&&!e.shiftKey}getData(e){const n=e.dataTransfer;this.panelTransfer.setData([new Ol(this.accessor.id,this.group.id,null)],Ol.prototype);const i=window.getComputedStyle(this.el),r=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),s=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(n){const a=document.createElement("div");a.style.backgroundColor=r,a.style.color=s,a.style.padding="2px 8px",a.style.height="24px",a.style.fontSize="11px",a.style.lineHeight="20px",a.style.borderRadius="12px",a.style.position="absolute",a.textContent=`Multiple Panels (${this.group.size})`,soe(n,a)}return{dispose:()=>{this.panelTransfer.clearData(Ol.prototype)}}}}class aoe extends ln{get element(){return this._element}constructor(e,n){super(),this.accessor=e,this.group=n,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onDragStart=new Pe,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!0,this.addDisposables(this._onDrop,this._onDragStart,si(this._element,"pointerdown",()=>{this.accessor.doSetGroupActive(this.group)}));const i=new ooe(this._element,e,n);this.dropTraget=new Ml(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(r,s)=>{var a;const o=tr();return o&&this.accessor.id===o.viewId?o.panelId===null&&o.groupId===this.group.id?!1:((a=Mse(this.group.panels))===null||a===void 0?void 0:a.id)!==o.panelId:n.model.canDisplayOverlay(r,s,"header_space")}}),this.onWillShowOverlay=this.dropTraget.onWillShowOverlay,this.addDisposables(i,i.onDragStart(r=>{this._onDragStart.fire(r)}),this.dropTraget.onDrop(r=>{this._onDrop.fire(r)}),this.dropTraget)}}class loe extends ln{get panels(){return this.tabs.map(e=>e.value.panel.id)}get size(){return this.tabs.length}get hidden(){return this._hidden}set hidden(e){this._hidden=e,this.element.style.display=e?"none":""}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(e){this.rightActions!==e&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),e&&(this.rightActionsContainer.appendChild(e),this.rightActions=e))}setLeftActionsElement(e){this.leftActions!==e&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),e&&(this.leftActionsContainer.appendChild(e),this.leftActions=e))}setPrefixActionsElement(e){this.preActions!==e&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),e&&(this.preActionsContainer.appendChild(e),this.preActions=e))}get element(){return this._element}isActive(e){return this.selectedIndex>-1&&this.tabs[this.selectedIndex].value===e}indexOf(e){return this.tabs.findIndex(n=>n.value.panel.id===e)}constructor(e,n){super(),this.accessor=e,this.group=n,this.tabs=[],this.selectedIndex=-1,this._hidden=!1,this._onDrop=new Pe,this.onDrop=this._onDrop.event,this._onTabDragStart=new Pe,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new Pe,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",rn(this._element,"dv-full-width-single-tab",this.accessor.options.singleTabMode==="fullwidth"),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabContainer=document.createElement("div"),this.tabContainer.className="dv-tabs-container",this.voidContainer=new aoe(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabContainer),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.accessor.onDidAddPanel(i=>{i.api.group===this.group&&rn(this._element,"dv-single-tab",this.size===1)}),this.accessor.onDidRemovePanel(i=>{i.api.group===this.group&&rn(this._element,"dv-single-tab",this.size===1)}),this._onWillShowOverlay,this._onDrop,this._onTabDragStart,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart(i=>{this._onGroupDragStart.fire({nativeEvent:i,group:this.group})}),this.voidContainer.onDrop(i=>{this._onDrop.fire({event:i.nativeEvent,index:this.tabs.length})}),this.voidContainer.onWillShowOverlay(i=>{this._onWillShowOverlay.fire(new _v(i,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:tr}))}),si(this.voidContainer.element,"pointerdown",i=>{if(!this.accessor.options.disableFloatingGroups&&i.shiftKey&&this.group.api.location.type!=="floating"){i.preventDefault();const{top:s,left:a}=this.element.getBoundingClientRect(),{top:o,left:l}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:a-l+20,y:s-o+20,inDragMode:!0})}}),si(this.tabContainer,"pointerdown",i=>{if(i.defaultPrevented)return;i.button===0&&this.accessor.doSetGroupActive(this.group)}))}setActive(e){}addTab(e,n=this.tabs.length){if(n<0||n>this.tabs.length)throw new Error("invalid location");this.tabContainer.insertBefore(e.value.element,this.tabContainer.children[n]),this.tabs=[...this.tabs.slice(0,n),e,...this.tabs.slice(n)],this.selectedIndex<0&&(this.selectedIndex=n)}delete(e){const n=this.tabs.findIndex(a=>a.value.panel.id===e),i=this.tabs.splice(n,1)[0],{value:r,disposable:s}=i;s.dispose(),r.dispose(),r.element.remove()}setActivePanel(e){this.tabs.forEach(n=>{const i=e.id===n.value.panel.id;n.value.setActive(i)})}openPanel(e,n=this.tabs.length){if(this.tabs.find(a=>a.value.panel.id===e.id))return;const i=new roe(e,this.accessor,this.group);i.setContent(e.view.tab);const r=new ln(i.onDragStart(a=>{this._onTabDragStart.fire({nativeEvent:a,panel:e})}),i.onChanged(a=>{const o=!this.accessor.options.disableFloatingGroups,l=this.group.api.location.type==="floating"&&this.size===1;if(o&&!l&&a.shiftKey){a.preventDefault();const c=this.accessor.getGroupPanel(i.panel.id),{top:d,left:h}=i.element.getBoundingClientRect(),{top:f,left:S}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(c,{x:h-S,y:d-f,inDragMode:!0});return}!(a.button===0)||a.defaultPrevented||this.group.activePanel!==e&&this.group.model.openPanel(e)}),i.onDrop(a=>{this._onDrop.fire({event:a.nativeEvent,index:this.tabs.findIndex(o=>o.value===i)})}),i.onWillShowOverlay(a=>{this._onWillShowOverlay.fire(new _v(a,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:tr}))})),s={value:i,disposable:r};this.addTab(s,n)}closePanel(e){this.delete(e.id)}dispose(){super.dispose();for(const{value:e,disposable:n}of this.tabs)n.dispose(),e.dispose();this.tabs=[]}}class Yz{get isAccepted(){return this._isAccepted}constructor(e,n,i,r,s){this.nativeEvent=e,this.target=n,this.position=i,this.getData=r,this.group=s,this._isAccepted=!1}accept(){this._isAccepted=!0}}const Ik=Object.keys({disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,gap:void 0,className:void 0,noPanelsOverlay:void 0});function coe(t){return!!t.referencePanel}function uoe(t){return!!t.referenceGroup}function doe(t){return!!t.referencePanel}function hoe(t){return!!t.referenceGroup}class SN extends vN{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(e){super(),this.options=e}getData(){return this.options.getData()}}class Wz extends SN{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class _v{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(e,n){this.event=e,this.options=n}}class foe extends ln{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,rn(this.container,"dv-locked-groupview",e==="no-drop-target"||e)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return this._panels.length===0}get hasWatermark(){return!!(this.watermark&&this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return document.activeElement?kA(document.activeElement,this.contentContainer.element):!1}get location(){return this._location}set location(e){switch(this._location=e,rn(this.container,"dv-groupview-floating",!1),rn(this.container,"dv-groupview-popout",!1),e.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(e?["center"]:["top","bottom","left","right","center"]),rn(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),rn(this.container,"dv-groupview-popout",!0);break}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,n,i,r,s){var a;super(),this.container=e,this.accessor=n,this.id=i,this.options=r,this.groupPanel=s,this._isGroupActive=!1,this._locked=!1,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new Pe,this.onMove=this._onMove.event,this._onDidDrop=new Pe,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new Pe,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new Pe,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new Pe,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new Pe,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new Pe,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new Pe,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new Pe,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new Pe,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,rn(this.container,"dv-groupview",!0),this._api=new pv(this.accessor),this.tabsContainer=new loe(this.accessor,this.groupPanel),this.contentContainer=new noe(this.accessor,this),e.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!r.hideHeader,this.locked=(a=r.locked)!==null&&a!==void 0?a:!1,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this.tabsContainer.onTabDragStart(o=>{this._onTabDragStart.fire(o)}),this.tabsContainer.onGroupDragStart(o=>{this._onGroupDragStart.fire(o)}),this.tabsContainer.onDrop(o=>{this.handleDropEvent("header",o.event,"center",o.index)}),this.contentContainer.onDidFocus(()=>{this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.onDidBlur(()=>{}),this.contentContainer.dropTarget.onDrop(o=>{this.handleDropEvent("content",o.nativeEvent,o.position)}),this.tabsContainer.onWillShowOverlay(o=>{this._onWillShowOverlay.fire(o)}),this.contentContainer.dropTarget.onWillShowOverlay(o=>{this._onWillShowOverlay.fire(new _v(o,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:tr}))}),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(e){this.panels.forEach(n=>{this.renderContainer.detatch(n)}),this._overwriteRenderContainer=e,this.panels.forEach(n=>{this.rerender(n)})}get renderContainer(){var e;return(e=this._overwriteRenderContainer)!==null&&e!==void 0?e:this.accessor.overlayRenderContainer}initialize(){this.options.panels&&this.options.panels.forEach(e=>{this.doAddPanel(e)}),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.accessor.options.createRightHeaderActionComponent&&(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this.addDisposables(this._rightHeaderActions),this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)),this.accessor.options.createLeftHeaderActionComponent&&(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this.addDisposables(this._leftHeaderActions),this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)),this.accessor.options.createPrefixHeaderActionComponent&&(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this.addDisposables(this._prefixHeaderActions),this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element))}rerender(e){this.contentContainer.renderPanel(e,{asActive:!1})}indexOf(e){return this.tabsContainer.indexOf(e.id)}toJSON(){var e;const n={views:this.tabsContainer.panels,activeView:(e=this._activePanel)===null||e===void 0?void 0:e.id,id:this.id};return this.locked!==!1&&(n.locked=this.locked),this.header.hidden&&(n.hideHeader=!0),n}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const n=e.panel?this.panels.indexOf(e.panel):-1;let i;if(n<this.panels.length-1)i=n+1;else if(!e.suppressRoll)i=0;else return;this.openPanel(this.panels[i])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const n=this.panels.indexOf(e.panel);let i;if(n>0)i=n-1;else if(!e.suppressRoll)i=this.panels.length-1;else return;this.openPanel(this.panels[i])}containsPanel(e){return this.panels.includes(e)}init(e){}update(e){}focus(){var e;(e=this._activePanel)===null||e===void 0||e.focus()}openPanel(e,n={}){(typeof n.index!="number"||n.index>this.panels.length)&&(n.index=this.panels.length);const i=!!n.skipSetActive;if(e.updateParentGroup(this.groupPanel,{skipSetActive:n.skipSetActive}),this.doAddPanel(e,n.index,{skipSetActive:i}),this._activePanel===e){this.contentContainer.renderPanel(e,{asActive:!0});return}i||this.doSetActivePanel(e),n.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),n.skipSetActive||this.updateContainer()}removePanel(e,n={skipSetActive:!1}){const i=typeof e=="string"?e:e.id,r=this._panels.find(s=>s.id===i);if(!r)throw new Error("invalid operation");return this._removePanel(r,n)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const n of e)this.doClose(n)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const n=this.panels.length===1&&this.accessor.groups.length===1;this.accessor.removePanel(e,n&&this.accessor.options.noPanelsOverlay==="emptyGroup"?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,n=!1){!n&&this.isActive===e||(this._isGroupActive=e,rn(this.container,"dv-active-group",e),rn(this.container,"dv-inactive-group",!e),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(e,n){var i;this._width=e,this._height=n,this.contentContainer.layout(this._width,this._height),!((i=this._activePanel)===null||i===void 0)&&i.layout&&this._activePanel.layout(this._width,this._height)}_removePanel(e,n){const i=this._activePanel===e;if(this.doRemovePanel(e),i&&this.panels.length>0){const r=this.mostRecentlyUsed[0];this.openPanel(r,{skipSetActive:n.skipSetActive,skipSetGroupActive:n.skipSetActiveGroup})}return this._activePanel&&this.panels.length===0&&this.doSetActivePanel(void 0),n.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const n=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(n,1),this.mostRecentlyUsed.includes(e)){const r=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(r,1)}const i=this._panelDisposables.get(e.id);i&&(i.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,n=this.panels.length,i={skipSetActive:!1}){const s=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,n),i.skipSetActive||this.contentContainer.openPanel(e),!s&&(this.updateMru(e),this.panels.splice(n,0,e),this._panelDisposables.set(e.id,new ln(e.api.onDidTitleChange(a=>this._onDidPanelTitleChange.fire(a)),e.api.onDidParametersChange(a=>this._onDidPanelParametersChange.fire(a)))),this._onDidAddPanel.fire({panel:e}))}doSetActivePanel(e){this._activePanel!==e&&(this._activePanel=e,e&&(this.tabsContainer.setActivePanel(e),e.layout(this._width,this._height),this.updateMru(e),this._onDidActivePanelChange.fire({panel:e})))}updateMru(e){this.mostRecentlyUsed.includes(e)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(e),1),this.mostRecentlyUsed=[e,...this.mostRecentlyUsed]}updateContainer(){var e,n;if(this.panels.forEach(i=>i.runEvents()),this.isEmpty&&!this.watermark){const i=this.accessor.createWatermarkComponent();i.init({containerApi:this._api,group:this.groupPanel}),this.watermark=i,si(this.watermark.element,"pointerdown",()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)}),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),(n=(e=this.watermark).dispose)===null||n===void 0||n.call(e),this.watermark=void 0)}canDisplayOverlay(e,n,i){const r=new Yz(e,i,n,tr,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(r),r.isAccepted}handleDropEvent(e,n,i,r){if(this.locked==="no-drop-target")return;function s(){switch(e){case"header":return typeof r=="number"?"tab":"header_space";case"content":return"content"}}const a=typeof r=="number"?this.panels[r]:void 0,o=new Wz({nativeEvent:n,position:i,panel:a,getData:()=>tr(),kind:s(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(o),o.defaultPrevented)return;const l=tr();if(l&&l.viewId===this.accessor.id){if(l.panelId===null){const{groupId:f}=l;this._onMove.fire({target:i,groupId:f,index:r});return}if(this.tabsContainer.indexOf(l.panelId)!==-1&&this.tabsContainer.size===1)return;const{groupId:c,panelId:d}=l;if(this.id===c&&!i&&this.tabsContainer.indexOf(d)===r)return;this._onMove.fire({target:i,groupId:l.groupId,itemId:l.panelId,index:r})}else this._onDidDrop.fire(new SN({nativeEvent:n,position:i,panel:a,getData:()=>tr(),group:this.groupPanel,api:this._api}))}dispose(){var e,n,i;super.dispose(),(e=this.watermark)===null||e===void 0||e.element.remove(),(i=(n=this.watermark)===null||n===void 0?void 0:n.dispose)===null||i===void 0||i.call(n),this.watermark=void 0;for(const r of this.panels)r.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class bN extends eoe{constructor(e,n,i){super(e,n),this._onDidConstraintsChangeInternal=new Pe,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new Pe,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new Pe,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class poe extends toe{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const e=typeof this._minimumWidth=="function"?this._minimumWidth():this._minimumWidth;return e!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=e,this.updateConstraints()),e}__maximumWidth(){const e=typeof this._maximumWidth=="function"?this._maximumWidth():this._maximumWidth;return e!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=e,this.updateConstraints()),e}__minimumHeight(){const e=typeof this._minimumHeight=="function"?this._minimumHeight():this._minimumHeight;return e!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=e,this.updateConstraints()),e}__maximumHeight(){const e=typeof this._maximumHeight=="function"?this._maximumHeight():this._maximumHeight;return e!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=e,this.updateConstraints()),e}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(e,n,i,r){super(e,n,r??new bN(e,n)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,typeof(i==null?void 0:i.minimumWidth)=="number"&&(this._minimumWidth=i.minimumWidth),typeof(i==null?void 0:i.maximumWidth)=="number"&&(this._maximumWidth=i.maximumWidth),typeof(i==null?void 0:i.minimumHeight)=="number"&&(this._minimumHeight=i.minimumHeight),typeof(i==null?void 0:i.maximumHeight)=="number"&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange(s=>{const{isVisible:a}=s,{accessor:o}=this._params;o.setVisible(this,a)}),this.api.onActiveChange(()=>{const{accessor:s}=this._params;s.doSetGroupActive(this)}),this.api.onDidConstraintsChangeInternal(s=>{(typeof s.minimumWidth=="number"||typeof s.minimumWidth=="function")&&(this._minimumWidth=s.minimumWidth),(typeof s.minimumHeight=="number"||typeof s.minimumHeight=="function")&&(this._minimumHeight=s.minimumHeight),(typeof s.maximumWidth=="number"||typeof s.maximumWidth=="function")&&(this._maximumWidth=s.maximumWidth),(typeof s.maximumHeight=="number"||typeof s.maximumHeight=="function")&&(this._maximumHeight=s.maximumHeight)}),this.api.onDidSizeChange(s=>{this._onDidChange.fire({height:s.height,width:s.width})}),this._onDidChange)}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}init(e){e.maximumHeight&&(this._maximumHeight=e.maximumHeight),e.minimumHeight&&(this._minimumHeight=e.minimumHeight),e.maximumWidth&&(this._maximumWidth=e.maximumWidth),e.minimumWidth&&(this._minimumWidth=e.minimumWidth),this._priority=e.priority,this._snap=!!e.snap,super.init(e),typeof e.isVisible=="boolean"&&this.setVisible(e.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const e=super.toJSON(),n=r=>r===Number.MAX_SAFE_INTEGER?void 0:r,i=r=>r<=0?void 0:r;return Object.assign(Object.assign({},e),{minimumHeight:i(this.minimumHeight),maximumHeight:n(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:n(this.maximumWidth),snap:this.snap,priority:this.priority})}}const fh="dockview: DockviewGroupPanelApiImpl not initialized";class _oe extends bN{get location(){if(!this._group)throw new Error(fh);return this._group.model.location}constructor(e,n){super(e,"__dockviewgroup__"),this.accessor=n,this._mutableDisposable=new Ho,this._onDidLocationChange=new Pe,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange,this._mutableDisposable)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return this.location.type==="popout"?this.location.getWindow():window}moveTo(e){var n,i,r;if(!this._group)throw new Error(fh);const s=(n=e.group)!==null&&n!==void 0?n:this.accessor.addGroup({direction:Wse((i=e.position)!==null&&i!==void 0?i:"right"),skipSetActive:!0});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:e.group&&(r=e.position)!==null&&r!==void 0?r:"center",index:e.index}})}maximize(){if(!this._group)throw new Error(fh);this.location.type==="grid"&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(fh);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(fh);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e,queueMicrotask(()=>{this._mutableDisposable.value=this._group.model.onDidActivePanelChange(n=>{this._onDidActivePanelChange.fire(n)})})}}const moe=100,goe=100;class Nk extends poe{get minimumWidth(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.minimumWidth;return typeof n=="number"?n:super.__minimumWidth()}get minimumHeight(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.minimumHeight;return typeof n=="number"?n:super.__minimumHeight()}get maximumWidth(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.maximumWidth;return typeof n=="number"?n:super.__maximumWidth()}get maximumHeight(){var e;const n=(e=this.activePanel)===null||e===void 0?void 0:e.maximumHeight;return typeof n=="number"?n:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(e){this._model.locked=e}get header(){return this._model.header}constructor(e,n,i){var r,s,a,o,l,u;super(n,"groupview_default",{minimumHeight:(s=(r=i.constraints)===null||r===void 0?void 0:r.minimumHeight)!==null&&s!==void 0?s:goe,minimumWidth:(o=(a=i.constraints)===null||a===void 0?void 0:a.maximumHeight)!==null&&o!==void 0?o:moe,maximumHeight:(l=i.constraints)===null||l===void 0?void 0:l.maximumHeight,maximumWidth:(u=i.constraints)===null||u===void 0?void 0:u.maximumWidth},new _oe(n,e)),this.api.initialize(this),this._model=new foe(this.element,e,n,i,this)}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,n){super.layout(e,n),this.model.layout(e,n)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}class voe extends bN{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(e){const n=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(n),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,n,i,r,s){super(e.id,r),this.panel=e,this.accessor=i,this._onDidTitleChange=new Pe,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new Pe,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new Pe,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new Pe,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new Pe,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new Ho,this._tabComponent=s,this.initialize(e),this._group=n,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(e){var n,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:(n=e.group)!==null&&n!==void 0?n:this._group,position:e.group&&(i=e.position)!==null&&i!==void 0?i:"center",index:e.index}})}setTitle(e){this.panel.setTitle(e)}setRenderer(e){this.panel.setRenderer(e)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(e){var n;let i=(n=e==null?void 0:e.isActive)!==null&&n!==void 0?n:!1;this.groupEventsDisposable.value=new ln(this.group.api.onDidVisibilityChange(r=>{const s=!r.isVisible&&this.isVisible,a=r.isVisible&&!this.isVisible,o=this.group.model.isPanelActive(this.panel);(s||a&&o)&&this._onDidVisibilityChange.fire(r)}),this.group.api.onDidLocationChange(r=>{this.group===this.panel.group&&this._onDidLocationChange.fire(r)}),this.group.api.onDidActiveChange(()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))}))}}class zu extends ln{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var e;return(e=this._renderer)!==null&&e!==void 0?e:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(e,n,i,r,s,a,o,l){super(),this.id=e,this.accessor=r,this.containerApi=s,this.view=o,this._renderer=l.renderer,this._group=a,this._minimumWidth=l.minimumWidth,this._minimumHeight=l.minimumHeight,this._maximumWidth=l.maximumWidth,this._maximumHeight=l.maximumHeight,this.api=new voe(this,this._group,r,n,i),this.addDisposables(this.api.onActiveChange(()=>{r.setActivePanel(this)}),this.api.onDidSizeChange(u=>{this.group.api.setSize(u)}),this.api.onDidRendererChange(()=>{this.group.model.rerender(this)}))}init(e){this._params=e.params,this.view.init(Object.assign(Object.assign({},e),{api:this.api,containerApi:this.containerApi})),this.setTitle(e.title)}focus(){const e=new qz;this.api._onWillFocus.fire(e),!e.defaultPrevented&&(this.api.isActive||this.api.setActive())}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(e){e!==this.title&&(this._title=e,this.api._onDidTitleChange.fire({title:e}))}setRenderer(e){e!==this.renderer&&(this._renderer=e,this.api._onDidRendererChange.fire({renderer:e}))}update(e){var n;this._params=Object.assign(Object.assign({},(n=this._params)!==null&&n!==void 0?n:{}),e.params);for(const i of Object.keys(e.params))e.params[i]===void 0&&delete this._params[i];this.view.update({params:this._params})}updateParentGroup(e,n){this._group=e,this.api.group=this._group;const i=this._group.model.isPanelActive(this),r=this.group.api.isActive&&i;n!=null&&n.skipSetActive||this.api.isActive!==r&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const e=this._group.model.isPanelActive(this),n=this.group.api.isActive&&e;this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,n){this.api._onDidDimensionChange.fire({width:e,height:n}),this.view.layout(e,n)}dispose(){this.api.dispose(),this.view.dispose()}}const Soe=t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttributeNS(null,"height",t.height),e.setAttributeNS(null,"width",t.width),e.setAttributeNS(null,"viewBox",t.viewbox),e.setAttributeNS(null,"aria-hidden","false"),e.setAttributeNS(null,"focusable","false"),e.classList.add("dv-svg");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d",t.path),e.appendChild(n),e},boe=()=>Soe({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"});class xk extends ln{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(boe()),this._element.appendChild(this._content),this._element.appendChild(this.action),this.addDisposables(si(this.action,"pointerdown",e=>{e.preventDefault()})),this.render()}init(e){this._title=e.title,this.addDisposables(e.api.onDidTitleChange(n=>{this._title=n.title,this.render()}),si(this.action,"pointerdown",n=>{n.preventDefault()}),si(this.action,"click",n=>{n.defaultPrevented||(n.preventDefault(),e.api.close())})),this.render()}render(){var e;this._content.textContent!==this._title&&(this._content.textContent=(e=this._title)!==null&&e!==void 0?e:"")}}class Kz{get content(){return this._content}get tab(){return this._tab}constructor(e,n,i,r){this.accessor=e,this.id=n,this.contentComponent=i,this.tabComponent=r,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,r)}init(e){this.content.init(e),this.tab.init(e)}updateParentGroup(e,n){}layout(e,n){var i,r;(r=(i=this.content).layout)===null||r===void 0||r.call(i,e,n)}update(e){var n,i,r,s;(i=(n=this.content).update)===null||i===void 0||i.call(n,e),(s=(r=this.tab).update)===null||s===void 0||s.call(r,e)}dispose(){var e,n,i,r;(n=(e=this.content).dispose)===null||n===void 0||n.call(e),(r=(i=this.tab).dispose)===null||r===void 0||r.call(i)}createContentComponent(e,n){return this.accessor.options.createComponent({id:e,name:n})}createTabComponent(e,n){const i=n??this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const r=this.accessor.options.createTabComponent({id:e,name:i});return r||new xk}console.warn(`dockview: tabComponent '${n}' was not found. falling back to the default tab.`)}return new xk}}class Eoe{constructor(e){this.accessor=e}fromJSON(e,n){var i,r;const s=e.id,a=e.params,o=e.title,l=e.view,u=l?l.content.id:(i=e.contentComponent)!==null&&i!==void 0?i:"unknown",c=l?(r=l.tab)===null||r===void 0?void 0:r.id:e.tabComponent,d=new Kz(this.accessor,s,u,c),h=new zu(s,u,c,this.accessor,new pv(this.accessor),n,d,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return h.init({title:o??s,params:a??{}}),h}}class yoe extends ln{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}class Coe{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter(n=>n!==e),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter(n=>n!==e),this.update()}update(){for(let e=0;e<this._orderedList.length;e++)this._orderedList[e].setAttribute("aria-level",`${e}`),this._orderedList[e].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${e*2})`}}const E_=new Coe;class Sl extends ln{set minimumInViewportWidth(e){this.options.minimumInViewportWidth=e}set minimumInViewportHeight(e){this.options.minimumInViewportHeight=e}get element(){return this._element}get isVisible(){return this._isVisible}constructor(e){super(),this.options=e,this._element=document.createElement("div"),this._onDidChange=new Pe,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new Pe,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),E_.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,rn(this.element,"dv-hidden",!this.isVisible))}bringToFront(){E_.push(this._element)}setBounds(e={}){typeof e.height=="number"&&(this._element.style.height=`${e.height}px`),typeof e.width=="number"&&(this._element.style.width=`${e.width}px`),"top"in e&&typeof e.top=="number"&&(this._element.style.top=`${e.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in e&&typeof e.bottom=="number"&&(this._element.style.bottom=`${e.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in e&&typeof e.left=="number"&&(this._element.style.left=`${e.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in e&&typeof e.right=="number"&&(this._element.style.right=`${e.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const n=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),r=Math.max(0,this.getMinimumWidth(i.width)),s=Math.max(0,this.getMinimumHeight(i.height));if(this.verticalAlignment==="top"){const a=zn(i.top-n.top,-s,Math.max(0,n.height-i.height+s));this._element.style.top=`${a}px`,this._element.style.bottom="auto"}if(this.verticalAlignment==="bottom"){const a=zn(n.bottom-i.bottom,-s,Math.max(0,n.height-i.height+s));this._element.style.bottom=`${a}px`,this._element.style.top="auto"}if(this.horiziontalAlignment==="left"){const a=zn(i.left-n.left,-r,Math.max(0,n.width-i.width+r));this._element.style.left=`${a}px`,this._element.style.right="auto"}if(this.horiziontalAlignment==="right"){const a=zn(n.right-i.right,-r,Math.max(0,n.width-i.width+r));this._element.style.right=`${a}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),n=this._element.getBoundingClientRect(),i={};return this.verticalAlignment==="top"?i.top=parseFloat(this._element.style.top):this.verticalAlignment==="bottom"?i.bottom=parseFloat(this._element.style.bottom):i.top=n.top-e.top,this.horiziontalAlignment==="left"?i.left=parseFloat(this._element.style.left):this.horiziontalAlignment==="right"?i.right=parseFloat(this._element.style.right):i.left=n.left-e.left,i.width=n.width,i.height=n.height,i}setupDrag(e,n={inDragMode:!1}){const i=new Ho,r=()=>{let s=null;const a=fv();i.value=new ln({dispose:()=>{a.release()}},Ca(window,"pointermove",o=>{const l=this.options.container.getBoundingClientRect(),u=o.clientX-l.left,c=o.clientY-l.top;rn(this._element,"dv-resize-container-dragging",!0);const d=this._element.getBoundingClientRect();s===null&&(s={x:o.clientX-d.left,y:o.clientY-d.top});const h=Math.max(0,this.getMinimumWidth(d.width)),f=Math.max(0,this.getMinimumHeight(d.height)),S=zn(c-s.y,-f,Math.max(0,l.height-d.height+f)),_=zn(s.y-c+l.height-d.height,-f,Math.max(0,l.height-d.height+f)),p=zn(u-s.x,-h,Math.max(0,l.width-d.width+h)),v=zn(s.x-u+l.width-d.width,-h,Math.max(0,l.width-d.width+h)),m={};S<=_?m.top=S:m.bottom=_,p<=v?m.left=p:m.right=v,this.setBounds(m)}),Ca(window,"pointerup",()=>{rn(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()}))};this.addDisposables(i,si(e,"pointerdown",s=>{if(s.defaultPrevented){s.preventDefault();return}Tk(s)||r()}),si(this.options.content,"pointerdown",s=>{s.defaultPrevented||Tk(s)||s.shiftKey&&r()}),si(this.options.content,"pointerdown",()=>{E_.push(this._element)},!0)),n.inDragMode&&r()}setupResize(e){const n=document.createElement("div");n.className=`dv-resize-handle-${e}`,this._element.appendChild(n);const i=new Ho;this.addDisposables(i,si(n,"pointerdown",r=>{r.preventDefault();let s=null;const a=fv();i.value=new ln(Ca(window,"pointermove",o=>{const l=this.options.container.getBoundingClientRect(),u=this._element.getBoundingClientRect(),c=o.clientY-l.top,d=o.clientX-l.left;s===null&&(s={originalY:c,originalHeight:u.height,originalX:d,originalWidth:u.width});let h,f,S,_,p,v;const m=()=>{h=zn(c,-Number.MAX_VALUE,s.originalY+s.originalHeight>l.height?this.getMinimumHeight(l.height):Math.max(0,s.originalY+s.originalHeight-Sl.MINIMUM_HEIGHT)),S=s.originalY+s.originalHeight-h,f=l.height-h-S},g=()=>{h=s.originalY-s.originalHeight,S=zn(c-h,h<0&&typeof this.options.minimumInViewportHeight=="number"?-h+this.options.minimumInViewportHeight:Sl.MINIMUM_HEIGHT,Number.MAX_VALUE),f=l.height-h-S},b=()=>{_=zn(d,-Number.MAX_VALUE,s.originalX+s.originalWidth>l.width?this.getMinimumWidth(l.width):Math.max(0,s.originalX+s.originalWidth-Sl.MINIMUM_WIDTH)),v=s.originalX+s.originalWidth-_,p=l.width-_-v},y=()=>{_=s.originalX-s.originalWidth,v=zn(d-_,_<0&&typeof this.options.minimumInViewportWidth=="number"?-_+this.options.minimumInViewportWidth:Sl.MINIMUM_WIDTH,Number.MAX_VALUE),p=l.width-_-v};switch(e){case"top":m();break;case"bottom":g();break;case"left":b();break;case"right":y();break;case"topleft":m(),b();break;case"topright":m(),y();break;case"bottomleft":g(),b();break;case"bottomright":g(),y();break}const E={};h<=f?E.top=h:E.bottom=f,_<=p?E.left=_:E.right=p,E.height=S,E.width=v,this.setBounds(E)}),{dispose:()=>{a.release()}},Ca(window,"pointerup",()=>{i.dispose(),this._onDidChangeEnd.fire()}))}))}getMinimumWidth(e){return typeof this.options.minimumInViewportWidth=="number"?e-this.options.minimumInViewportWidth:0}getMinimumHeight(e){return typeof this.options.minimumInViewportHeight=="number"?e-this.options.minimumInViewportHeight:0}dispose(){E_.destroy(this._element),this._element.remove(),super.dispose()}}Sl.MINIMUM_HEIGHT=20;Sl.MINIMUM_WIDTH=20;class Toe extends ln{constructor(e,n){super(),this.group=e,this.overlay=n,this.addDisposables(n)}position(e){this.overlay.setBounds(e)}}const y_=100,Ja={left:100,top:100,width:300,height:300};function woe(){const t=document.createElement("div");return t.tabIndex=-1,t}class Dk extends ln{constructor(e,n){super(),this.element=e,this.accessor=n,this.map={},this._disposed=!1,this.addDisposables(br.from(()=>{for(const i of Object.values(this.map))i.disposable.dispose(),i.destroy.dispose();this._disposed=!0}))}detatch(e){if(this.map[e.api.id]){const{disposable:n,destroy:i}=this.map[e.api.id];return n.dispose(),i.dispose(),delete this.map[e.api.id],!0}return!1}attach(e){const{panel:n,referenceContainer:i}=e;if(!this.map[n.api.id]){const c=woe();c.className="dv-render-overlay",this.map[n.api.id]={panel:n,disposable:br.NONE,destroy:br.NONE,element:c}}const r=this.map[n.api.id].element;n.view.content.element.parentElement!==r&&r.appendChild(n.view.content.element),r.parentElement!==this.element&&this.element.appendChild(r);const s=()=>{const c=wk(i.element),d=wk(this.element);r.style.left=`${c.left-d.left}px`,r.style.top=`${c.top-d.top}px`,r.style.width=`${c.width}px`,r.style.height=`${c.height}px`,rn(r,"dv-render-overlay-float",n.group.api.location.type==="floating")},a=()=>{n.api.isVisible&&s(),r.style.display=n.api.isVisible?"":"none"},o=new Ho,l=()=>{n.api.location.type==="floating"?queueMicrotask(()=>{const c=this.accessor.floatingGroups.find(S=>S.group===n.api.group);if(!c)return;const d=c.overlay.element,h=()=>{const S=Number(d.getAttribute("aria-level"));r.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${S*2+1})`},f=new MutationObserver(()=>{h()});o.value=br.from(()=>f.disconnect()),f.observe(d,{attributeFilter:["aria-level"],attributes:!0}),h()}):r.style.zIndex=""},u=new ln(o,new zz(r,{onDragEnd:c=>{i.dropTarget.dnd.onDragEnd(c)},onDragEnter:c=>{i.dropTarget.dnd.onDragEnter(c)},onDragLeave:c=>{i.dropTarget.dnd.onDragLeave(c)},onDrop:c=>{i.dropTarget.dnd.onDrop(c)},onDragOver:c=>{i.dropTarget.dnd.onDragOver(c)}}),n.api.onDidVisibilityChange(()=>{a()}),n.api.onDidDimensionsChange(()=>{n.api.isVisible&&s()}),n.api.onDidLocationChange(()=>{l()}));return this.map[n.api.id].destroy=br.from(()=>{var c;n.view.content.element.parentElement===r&&r.removeChild(n.view.content.element),(c=r.parentElement)===null||c===void 0||c.removeChild(r)}),l(),queueMicrotask(()=>{this.isDisposed||a()}),this.map[n.api.id].disposable.dispose(),this.map[n.api.id].disposable=u,r}}var Roe=function(t,e,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(c){try{u(i.next(c))}catch(d){a(d)}}function l(c){try{u(i.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):r(c.value).then(o,l)}u((i=i.apply(t,e||[])).next())})};class Aoe extends ln{get window(){var e,n;return(n=(e=this._window)===null||e===void 0?void 0:e.value)!==null&&n!==void 0?n:null}constructor(e,n,i){super(),this.target=e,this.className=n,this.options=i,this._onWillClose=new Pe,this.onWillClose=this._onWillClose.event,this._onDidClose=new Pe,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const e=this._window.value.screenX,n=this._window.value.screenY,i=this._window.value.innerWidth,r=this._window.value.innerHeight;return{top:n,left:e,width:i,height:r}}close(){var e,n;this._window&&(this._onWillClose.fire(),(n=(e=this.options).onWillClose)===null||n===void 0||n.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var e,n;return Roe(this,void 0,void 0,function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,r=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map(([l,u])=>`${l}=${u}`).join(","),s=window.open(i,this.target,r);if(!s)return null;const a=new ln;this._window={value:s,disposable:a},a.addDisposables(br.from(()=>{s.close()}),Ca(window,"beforeunload",()=>{this.close()}));const o=this.createPopoutWindowContainer();return this.className&&o.classList.add(this.className),(n=(e=this.options).onDidOpen)===null||n===void 0||n.call(e,{id:this.target,window:s}),new Promise((l,u)=>{s.addEventListener("unload",c=>{}),s.addEventListener("load",()=>{try{const c=s.document;c.title=document.title,c.body.appendChild(o),Ise(c,window.document.styleSheets),Ca(s,"beforeunload",()=>{this.close()}),l(o)}catch(c){u(c)}})})})}createPopoutWindowContainer(){const e=document.createElement("div");return e.classList.add("dv-popout-window"),e.id="dv-popout-window",e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e}}class Ooe extends ln{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,n=new Set;this.addDisposables(this.accessor.onDidAddPanel(i=>{if(e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);e.add(i.api.id)}),this.accessor.onDidRemovePanel(i=>{if(e.has(i.api.id))e.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`)}),this.accessor.onDidAddGroup(i=>{if(n.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${i.api.id} but group already exists`);n.add(i.api.id)}),this.accessor.onDidRemoveGroup(i=>{if(n.has(i.api.id))n.delete(i.api.id);else throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${i.api.id} but group does not exists`)}))}}const kk={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function OE(t){const e=t.from.activePanel;[...t.from.panels].map(i=>{const r=t.from.model.removePanel(i);return t.from.model.renderContainer.detatch(i),r}).forEach(i=>{t.to.model.openPanel(i,{skipSetActive:e!==i,skipSetGroupActive:!0})})}class Ioe extends qse{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap(e=>e.panels)}get options(){return this._options}get activePanel(){const e=this.activeGroup;if(e)return e.activePanel}get renderer(){var e;return(e=this.options.defaultRenderer)!==null&&e!==void 0?e:"onlyWhenVisible"}get api(){return this._api}get gap(){return this.gridview.margin}get floatingGroups(){return this._floatingGroups}constructor(e,n){var i;super(e,{proportionalLayout:!0,orientation:Pt.HORIZONTAL,styles:n.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:n.disableAutoResizing,locked:n.locked,margin:n.gap,className:n.className}),this.nextGroupId=Hz(),this._deserializer=new Eoe(this),this.watermark=null,this._onWillDragPanel=new Pe,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new Pe,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new Pe,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new Pe,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new Pe,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new Pe,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new Pe,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new Pe,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidLayoutFromJSON=new Pe,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new Pe,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new Pe,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new Pe,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._onDidRemoveGroup=new Pe,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new Pe,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new Pe,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this.overlayRenderContainer=new Dk(this.gridview.element,this),rn(this.gridview.element,"dv-dockview",!0),rn(this.element,"dv-debug",!!n.debug),n.debug&&this.addDisposables(new Ooe(this)),this.addDisposables(this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this.onDidViewVisibilityChangeMicroTaskQueue(()=>{this.updateWatermark()}),this.onDidAdd(r=>{this._moving||this._onDidAddGroup.fire(r)}),this.onDidRemove(r=>{this._moving||this._onDidRemoveGroup.fire(r)}),this.onDidActiveChange(r=>{this._moving||this._onDidActiveGroupChange.fire(r)}),this.onDidMaximizedChange(r=>{this._onDidMaximizedGroupChange.fire({group:r.panel,isMaximized:r.isMaximized})}),Vc.any(this.onDidAdd,this.onDidRemove)(()=>{this.updateWatermark()}),Vc.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange)(()=>{this._bufferOnDidLayoutChange.fire()}),br.from(()=>{for(const r of[...this._floatingGroups])r.dispose();for(const r of[...this._popoutGroups])r.disposable.dispose()})),this._options=n,this._rootDropTarget=new Ml(this.element,{canDisplayOverlay:(r,s)=>{const a=tr();if(a)return a.viewId!==this.id?!1:s==="center"?this.gridview.length===0:!0;if(s==="center"&&this.gridview.length!==0)return!1;const o=new Yz(r,"edge",s,tr);return this._onUnhandledDragOverEvent.fire(o),o.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:(i=this.options.rootOverlayModel)!==null&&i!==void 0?i:kk}),this.addDisposables(this._rootDropTarget,this._rootDropTarget.onWillShowOverlay(r=>{this.gridview.length>0&&r.position==="center"||this._onWillShowOverlay.fire(new _v(r,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:tr}))}),this._rootDropTarget.onDrop(r=>{var s;const a=new Wz({nativeEvent:r.nativeEvent,position:r.position,panel:void 0,api:this._api,group:void 0,getData:tr,kind:"edge"});if(this._onWillDrop.fire(a),a.defaultPrevented)return;const o=tr();o?this.moveGroupOrPanel({from:{groupId:o.groupId,panelId:(s=o.panelId)!==null&&s!==void 0?s:void 0},to:{group:this.orthogonalize(r.position),position:"center"}}):this._onDidDrop.fire(new SN({nativeEvent:r.nativeEvent,position:r.position,panel:void 0,api:this._api,group:void 0,getData:tr}))}),this._rootDropTarget),this._api=new pv(this),this.updateWatermark()}setVisible(e,n){switch(e.api.location.type){case"grid":super.setVisible(e,n);break;case"floating":{const i=this.floatingGroups.find(r=>r.group===e);i&&(i.overlay.setVisible(n),e.api._onDidVisibilityChange.fire({isVisible:n}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window");break}}addPopoutGroup(e,n){var i,r,s,a,o;if(e instanceof zu&&e.group.size===1)return this.addPopoutGroup(e.group,n);const l=Dse(this.gridview.element),u=this.element;function c(){return n!=null&&n.position?n.position:e instanceof Nk?e.element.getBoundingClientRect():e.group?e.group.element.getBoundingClientRect():u.getBoundingClientRect()}const d=c(),h=(r=(i=n==null?void 0:n.overridePopoutGroup)===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:this.getNextGroupId(),f=new Aoe(`${this.id}-${h}`,l??"",{url:(o=(s=n==null?void 0:n.popoutUrl)!==null&&s!==void 0?s:(a=this.options)===null||a===void 0?void 0:a.popoutUrl)!==null&&o!==void 0?o:"/popout.html",left:window.screenX+d.left,top:window.screenY+d.top,width:d.width,height:d.height,onDidOpen:n==null?void 0:n.onDidOpen,onWillClose:n==null?void 0:n.onWillClose}),S=new ln(f,f.onDidClose(()=>{S.dispose()}));return f.open().then(_=>{var p;if(f.isDisposed)return!1;if(_===null)return S.dispose(),!1;const v=document.createElement("div");v.className="dv-overlay-render-container";const m=new Dk(v,this),g=e instanceof zu?e.group:e,b=e.api.location.type,y=g.element.parentElement!==null;let E;y?n!=null&&n.overridePopoutGroup?E=n.overridePopoutGroup:(E=this.createGroup({id:h}),this._onDidAddGroup.fire(E)):E=g,E.model.renderContainer=m,E.layout(f.window.innerWidth,f.window.innerHeight);let T;if(!(n!=null&&n.overridePopoutGroup)&&y)if(e instanceof zu)this.movingLock(()=>{const I=g.model.removePanel(e);E.model.openPanel(I)});else switch(this.movingLock(()=>OE({from:g,to:E})),b){case"grid":g.api.setVisible(!1);break;case"floating":case"popout":T=(p=this._floatingGroups.find(I=>I.group.api.id===e.api.id))===null||p===void 0?void 0:p.overlay.toJSON(),this.removeGroup(g);break}_.classList.add("dv-dockview"),_.style.overflow="hidden",_.appendChild(v),_.appendChild(E.element),E.model.location={type:"popout",getWindow:()=>f.window,popoutUrl:n==null?void 0:n.popoutUrl},y&&e.api.location.type==="grid"&&e.api.setVisible(!1),this.doSetGroupAndPanelActive(E),S.addDisposables(E.api.onDidActiveChange(I=>{var A;I.isActive&&((A=f.window)===null||A===void 0||A.focus())}),E.api.onWillFocus(()=>{var I;(I=f.window)===null||I===void 0||I.focus()}));let C;const w=y&&g&&this.getPanel(g.id),R={window:f,popoutGroup:E,referenceGroup:w?g.id:void 0,disposable:{dispose:()=>(S.dispose(),C)}};return S.addDisposables(Ca(f.window,"resize",()=>{E.layout(f.window.innerWidth,f.window.innerHeight)}),m,br.from(()=>{y&&this.getPanel(g.id)?(this.movingLock(()=>OE({from:E,to:g})),g.api.isVisible||g.api.setVisible(!0),this.getPanel(E.id)&&this.doRemoveGroup(E,{skipPopoutAssociated:!0})):this.getPanel(E.id)&&(E.model.renderContainer=this.overlayRenderContainer,C=E,T?this.addFloatingGroup(E,{height:T.height,width:T.width,position:T}):(this.doRemoveGroup(E,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),E.model.location={type:"grid"},this.movingLock(()=>{this.doAddGroup(E,[0])})),this.doSetGroupAndPanelActive(E))})),this._popoutGroups.push(R),this.updateWatermark(),!0}).catch(_=>(console.error("dockview: failed to create popout window",_),!1))}addFloatingGroup(e,n){var i,r,s,a,o;let l;if(e instanceof zu)l=this.createGroup(),this._onDidAddGroup.fire(l),this.movingLock(()=>this.removePanel(e,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0})),this.movingLock(()=>l.model.openPanel(e,{skipSetGroupActive:!0}));else{l=e;const _=(i=this._popoutGroups.find(m=>m.popoutGroup===l))===null||i===void 0?void 0:i.referenceGroup,p=_?this.getPanel(_):void 0;typeof(n==null?void 0:n.skipRemoveGroup)=="boolean"&&n.skipRemoveGroup||(p?(this.movingLock(()=>OE({from:e,to:p})),this.doRemoveGroup(e,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(p,{skipDispose:!0}),l=p):this.doRemoveGroup(e,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}function u(){if(n!=null&&n.position){const _={};return"left"in n.position?_.left=Math.max(n.position.left,0):"right"in n.position?_.right=Math.max(n.position.right,0):_.left=Ja.left,"top"in n.position?_.top=Math.max(n.position.top,0):"bottom"in n.position?_.bottom=Math.max(n.position.bottom,0):_.top=Ja.top,typeof n.width=="number"?_.width=Math.max(n.width,0):_.width=Ja.width,typeof n.height=="number"?_.height=Math.max(n.height,0):_.height=Ja.height,_}return{left:typeof(n==null?void 0:n.x)=="number"?Math.max(n.x,0):Ja.left,top:typeof(n==null?void 0:n.y)=="number"?Math.max(n.y,0):Ja.top,width:typeof(n==null?void 0:n.width)=="number"?Math.max(n.width,0):Ja.width,height:typeof(n==null?void 0:n.height)=="number"?Math.max(n.height,0):Ja.height}}const c=u(),d=new Sl(Object.assign(Object.assign({container:this.gridview.element,content:l.element},c),{minimumInViewportWidth:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(s=(r=this.options.floatingGroupBounds)===null||r===void 0?void 0:r.minimumWidthWithinViewport)!==null&&s!==void 0?s:y_,minimumInViewportHeight:this.options.floatingGroupBounds==="boundedWithinViewport"?void 0:(o=(a=this.options.floatingGroupBounds)===null||a===void 0?void 0:a.minimumHeightWithinViewport)!==null&&o!==void 0?o:y_})),h=l.element.querySelector(".dv-void-container");if(!h)throw new Error("failed to find drag handle");d.setupDrag(h,{inDragMode:typeof(n==null?void 0:n.inDragMode)=="boolean"?n.inDragMode:!1});const f=new Toe(l,d),S=new ln(l.api.onDidActiveChange(_=>{_.isActive&&d.bringToFront()}),Fz(l.element,_=>{const{width:p,height:v}=_.contentRect;l.layout(p,v)}));f.addDisposables(d.onDidChange(()=>{l.layout(l.width,l.height)}),d.onDidChangeEnd(()=>{this._bufferOnDidLayoutChange.fire()}),l.onDidChange(_=>{d.setBounds({height:_==null?void 0:_.height,width:_==null?void 0:_.width})}),{dispose:()=>{S.dispose(),AE(this._floatingGroups,f),l.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(f),l.model.location={type:"floating"},n!=null&&n.skipActiveGroup||this.doSetGroupAndPanelActive(l),this.updateWatermark()}orthogonalize(e){switch(e){case"top":case"bottom":this.gridview.orientation===Pt.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===Pt.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break}switch(e){case"top":case"left":case"center":return this.createGroupAtLocation([0]);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length]);default:throw new Error(`unsupported position ${e}`)}}updateOptions(e){var n,i,r,s;if(super.updateOptions(e),"floatingGroupBounds"in e)for(const a of this._floatingGroups){switch(e.floatingGroupBounds){case"boundedWithinViewport":a.overlay.minimumInViewportHeight=void 0,a.overlay.minimumInViewportWidth=void 0;break;case void 0:a.overlay.minimumInViewportHeight=y_,a.overlay.minimumInViewportWidth=y_;break;default:a.overlay.minimumInViewportHeight=(n=e.floatingGroupBounds)===null||n===void 0?void 0:n.minimumHeightWithinViewport,a.overlay.minimumInViewportWidth=(i=e.floatingGroupBounds)===null||i===void 0?void 0:i.minimumWidthWithinViewport}a.overlay.setBounds()}"rootOverlayModel"in e&&this._rootDropTarget.setOverlayModel((r=e.rootOverlayModel)!==null&&r!==void 0?r:kk),"gap"in e&&(this.gridview.margin=(s=e.gap)!==null&&s!==void 0?s:0),this._options=Object.assign(Object.assign({},this.options),e),this.layout(this.gridview.width,this.gridview.height,!0)}layout(e,n,i){if(super.layout(e,n,i),this._floatingGroups)for(const r of this._floatingGroups)r.overlay.setBounds()}focus(){var e;(e=this.activeGroup)===null||e===void 0||e.focus()}getGroupPanel(e){return this.panels.find(n=>n.id===e)}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var n;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[e.group.panels.length-1]){e.group.model.moveToNext({suppressRoll:!0});return}const i=Vi(e.group.element),r=(n=this.gridview.next(i))===null||n===void 0?void 0:n.view;this.doSetGroupAndPanelActive(r)}moveToPrevious(e={}){var n;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[0]){e.group.model.moveToPrevious({suppressRoll:!0});return}const i=Vi(e.group.element),r=(n=this.gridview.previous(i))===null||n===void 0?void 0:n.view;r&&this.doSetGroupAndPanelActive(r)}toJSON(){var e;const n=this.gridview.serialize(),i=this.panels.reduce((o,l)=>(o[l.id]=l.toJSON(),o),{}),r=this._floatingGroups.map(o=>({data:o.group.toJSON(),position:o.overlay.toJSON()})),s=this._popoutGroups.map(o=>({data:o.popoutGroup.toJSON(),gridReferenceGroup:o.referenceGroup,position:o.window.dimensions(),url:o.popoutGroup.api.location.type==="popout"?o.popoutGroup.api.location.popoutUrl:void 0})),a={grid:n,panels:i,activeGroup:(e=this.activeGroup)===null||e===void 0?void 0:e.id};return r.length>0&&(a.floatingGroups=r),s.length>0&&(a.popoutGroups=s),a}fromJSON(e){var n,i,r;if(this.clear(),typeof e!="object"||e===null)throw new Error("serialized layout must be a non-null object");const{grid:s,panels:a,activeGroup:o}=e;if(s.root.type!=="branch"||!Array.isArray(s.root.data))throw new Error("root must be of type branch");try{const l=this.width,u=this.height,c=f=>{const{id:S,locked:_,hideHeader:p,views:v,activeView:m}=f;if(typeof S!="string")throw new Error("group id must be of type string");const g=this.createGroup({id:S,locked:!!_,hideHeader:!!p});this._onDidAddGroup.fire(g);const b=[];for(const y of v){const E=this._deserializer.fromJSON(a[y],g);b.push(E)}for(let y=0;y<v.length;y++){const E=b[y],T=typeof m=="string"&&m===E.id;g.model.openPanel(E,{skipSetActive:!T,skipSetGroupActive:!0})}return!g.activePanel&&g.panels.length>0&&g.model.openPanel(g.panels[g.panels.length-1],{skipSetGroupActive:!0}),g};this.gridview.deserialize(s,{fromJSON:f=>c(f.data)}),this.layout(l,u,!0);const d=(n=e.floatingGroups)!==null&&n!==void 0?n:[];for(const f of d){const{data:S,position:_}=f,p=c(S);this.addFloatingGroup(p,{position:_,width:_.width,height:_.height,skipRemoveGroup:!0,inDragMode:!1})}const h=(i=e.popoutGroups)!==null&&i!==void 0?i:[];for(const f of h){const{data:S,position:_,gridReferenceGroup:p,url:v}=f,m=c(S);this.addPopoutGroup((r=p?this.getPanel(p):void 0)!==null&&r!==void 0?r:m,{position:_??void 0,overridePopoutGroup:p?m:void 0,popoutUrl:v})}for(const f of this._floatingGroups)f.overlay.setBounds();if(typeof o=="string"){const f=this.getPanel(o);f&&this.doSetGroupAndPanelActive(f)}}catch(l){console.error("dockview: failed to deserialize layout. Reverting changes",l);for(const u of this.groups)for(const c of u.panels)this.removePanel(c,{removeEmptyGroup:!1,skipDispose:!1});for(const u of this.groups)u.dispose(),this._groups.delete(u.id),this._onDidRemoveGroup.fire(u);for(const u of[...this._floatingGroups])u.dispose();throw this.clear(),l}this.updateWatermark(),this._onDidLayoutFromJSON.fire()}clear(){const e=Array.from(this._groups.values()).map(i=>i.value),n=!!this.activeGroup;for(const i of e)this.removeGroup(i,{skipActive:!0});n&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[n,i]=e;i.value.model.closeAllPanels()}}addPanel(e){var n,i;if(this.panels.find(l=>l.id===e.id))throw new Error(`panel with id ${e.id} already exists`);let r;if(e.position&&e.floating)throw new Error("you can only provide one of: position, floating as arguments to .addPanel(...)");const s={width:e.initialWidth,height:e.initialHeight};let a;if(e.position)if(coe(e.position)){const l=typeof e.position.referencePanel=="string"?this.getGroupPanel(e.position.referencePanel):e.position.referencePanel;if(a=e.position.index,!l)throw new Error(`referencePanel '${e.position.referencePanel}' does not exist`);r=this.findGroup(l)}else if(uoe(e.position)){if(r=typeof e.position.referenceGroup=="string"?(n=this._groups.get(e.position.referenceGroup))===null||n===void 0?void 0:n.value:e.position.referenceGroup,a=e.position.index,!r)throw new Error(`referenceGroup '${e.position.referenceGroup}' does not exist`)}else{const l=this.orthogonalize(Ok(e.position.direction)),u=this.createPanel(e,l);return l.model.openPanel(u,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(l),l.api.setSize({height:s==null?void 0:s.height,width:s==null?void 0:s.width}),u}else r=this.activeGroup;let o;if(r){const l=Ak(((i=e.position)===null||i===void 0?void 0:i.direction)||"within");if(e.floating){const u=this.createGroup();this._onDidAddGroup.fire(u);const c=typeof e.floating=="object"&&e.floating!==null?e.floating:{};this.addFloatingGroup(u,Object.assign(Object.assign({},c),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),o=this.createPanel(e,u),u.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a})}else if(r.api.location.type==="floating"||l==="center")o=this.createPanel(e,r),r.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),r.api.setSize({width:s==null?void 0:s.width,height:s==null?void 0:s.height}),e.inactive||this.doSetGroupAndPanelActive(r);else{const u=Vi(r.element),c=Pu(this.gridview.orientation,u,l),d=this.createGroupAtLocation(c,this.orientationAtLocation(c)===Pt.VERTICAL?s==null?void 0:s.height:s==null?void 0:s.width);o=this.createPanel(e,d),d.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(d)}}else if(e.floating){const l=this.createGroup();this._onDidAddGroup.fire(l);const u=typeof e.floating=="object"&&e.floating!==null?e.floating:{};this.addFloatingGroup(l,Object.assign(Object.assign({},u),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),o=this.createPanel(e,l),l.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a})}else{const l=this.createGroupAtLocation([0],this.gridview.orientation===Pt.VERTICAL?s==null?void 0:s.height:s==null?void 0:s.width);o=this.createPanel(e,l),l.model.openPanel(o,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:a}),e.inactive||this.doSetGroupAndPanelActive(l)}return o}removePanel(e,n={removeEmptyGroup:!0}){const i=e.group;if(!i)throw new Error(`cannot remove panel ${e.id}. it's missing a group.`);i.model.removePanel(e,{skipSetActiveGroup:n.skipSetActiveGroup}),n.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),i.size===0&&n.removeEmptyGroup&&this.removeGroup(i,{skipActive:n.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new yoe}updateWatermark(){var e,n;if(this.groups.filter(i=>i.api.location.type==="grid"&&i.api.isVisible).length===0){if(!this.watermark){this.watermark=this.createWatermarkComponent(),this.watermark.init({containerApi:new pv(this)});const i=document.createElement("div");i.className="dv-watermark-container",xse(i,"watermark-component"),i.appendChild(this.watermark.element),this.gridview.element.appendChild(i)}}else this.watermark&&(this.watermark.element.parentElement.remove(),(n=(e=this.watermark).dispose)===null||n===void 0||n.call(e),this.watermark=null)}addGroup(e){var n;if(e){let i;if(doe(e)){const u=typeof e.referencePanel=="string"?this.panels.find(c=>c.id===e.referencePanel):e.referencePanel;if(!u)throw new Error(`reference panel ${e.referencePanel} does not exist`);if(i=this.findGroup(u),!i)throw new Error(`reference group for reference panel ${e.referencePanel} does not exist`)}else if(hoe(e)){if(i=typeof e.referenceGroup=="string"?(n=this._groups.get(e.referenceGroup))===null||n===void 0?void 0:n.value:e.referenceGroup,!i)throw new Error(`reference group ${e.referenceGroup} does not exist`)}else{const u=this.orthogonalize(Ok(e.direction));return e.skipSetActive||this.doSetGroupAndPanelActive(u),u}const r=Ak(e.direction||"within"),s=Vi(i.element),a=Pu(this.gridview.orientation,s,r),o=this.createGroup(e),l=this.getLocationOrientation(a)===Pt.VERTICAL?e.initialHeight:e.initialWidth;return this.doAddGroup(o,a,l),e.skipSetActive||this.doSetGroupAndPanelActive(o),o}else{const i=this.createGroup(e);return this.doAddGroup(i),this.doSetGroupAndPanelActive(i),i}}getLocationOrientation(e){return e.length%2==0&&this.gridview.orientation===Pt.HORIZONTAL?Pt.HORIZONTAL:Pt.VERTICAL}removeGroup(e,n){this.doRemoveGroup(e,n)}doRemoveGroup(e,n){var i;const r=[...e.panels];if(!(n!=null&&n.skipDispose))for(const o of r)this.removePanel(o,{removeEmptyGroup:!1,skipDispose:(i=n==null?void 0:n.skipDispose)!==null&&i!==void 0?i:!1});const s=this.activePanel;if(e.api.location.type==="floating"){const o=this._floatingGroups.find(l=>l.group===e);if(o){if(n!=null&&n.skipDispose||(o.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),AE(this._floatingGroups,o),o.dispose(),!(n!=null&&n.skipActive)&&this._activeGroup===e){const l=Array.from(this._groups.values());this.doSetGroupAndPanelActive(l.length>0?l[0].value:void 0)}return o.group}throw new Error("failed to find floating group")}if(e.api.location.type==="popout"){const o=this._popoutGroups.find(l=>l.popoutGroup===e);if(o){if(!(n!=null&&n.skipDispose)){if(!(n!=null&&n.skipPopoutAssociated)){const u=o.referenceGroup?this.getPanel(o.referenceGroup):void 0;u&&u.panels.length===0&&this.removeGroup(u)}o.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}AE(this._popoutGroups,o);const l=o.disposable.dispose();if(!(n!=null&&n.skipPopoutReturn)&&l&&(this.doAddGroup(l,[0]),this.doSetGroupAndPanelActive(l)),!(n!=null&&n.skipActive)&&this._activeGroup===e){const u=Array.from(this._groups.values());this.doSetGroupAndPanelActive(u.length>0?u[0].value:void 0)}return this.updateWatermark(),o.popoutGroup}throw new Error("failed to find popout group")}const a=super.doRemoveGroup(e,n);return n!=null&&n.skipActive||this.activePanel!==s&&this._onDidActivePanelChange.fire(this.activePanel),a}movingLock(e){const n=this._moving;try{return this._moving=!0,e()}finally{this._moving=n}}moveGroupOrPanel(e){var n;const i=e.to.group,r=e.from.groupId,s=e.from.panelId,a=e.to.position,o=e.to.index,l=r?(n=this._groups.get(r))===null||n===void 0?void 0:n.value:void 0;if(!l)throw new Error(`Failed to find group id ${r}`);if(s===void 0){this.moveGroup({from:{group:l},to:{group:i,position:a}});return}if(!a||a==="center"){const u=this.movingLock(()=>l.model.removePanel(s,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!u)throw new Error(`No panel with id ${s}`);l.model.size===0&&this.doRemoveGroup(l,{skipActive:!0}),this.movingLock(()=>i.model.openPanel(u,{index:o,skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:u,from:l})}else{const u=Vi(i.element),c=Pu(this.gridview.orientation,u,a);if(l.size<2){const[d,h]=kc(c);if(l.api.location.type==="grid"){const p=Vi(l.element),[v,m]=kc(p);if(Lse(v,d)){this.gridview.moveView(v,m,h),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l});return}}if(l.api.location.type==="popout"){const p=this._popoutGroups.find(g=>g.popoutGroup===l),v=this.movingLock(()=>p.popoutGroup.model.removePanel(p.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0}));this.doRemoveGroup(l,{skipActive:!0});const m=this.createGroupAtLocation(c);this.movingLock(()=>m.model.openPanel(v)),this.doSetGroupAndPanelActive(m),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l});return}const f=this.movingLock(()=>this.doRemoveGroup(l,{skipActive:!0,skipDispose:!0})),S=Vi(i.element),_=Pu(this.gridview.orientation,S,a);this.movingLock(()=>this.doAddGroup(f,_)),this.doSetGroupAndPanelActive(f),this._onDidMovePanel.fire({panel:this.getGroupPanel(s),from:l})}else{const d=this.movingLock(()=>l.model.removePanel(s,{skipSetActive:!1,skipSetActiveGroup:!0}));if(!d)throw new Error(`No panel with id ${s}`);const h=Pu(this.gridview.orientation,u,a),f=this.createGroupAtLocation(h);this.movingLock(()=>f.model.openPanel(d,{skipSetGroupActive:!0})),this.doSetGroupAndPanelActive(f),this._onDidMovePanel.fire({panel:d,from:l})}}}moveGroup(e){const n=e.from.group,i=e.to.group,r=e.to.position;if(r==="center"){const s=n.activePanel,a=this.movingLock(()=>[...n.panels].map(o=>n.model.removePanel(o.id,{skipSetActive:!0})));(n==null?void 0:n.model.size)===0&&this.doRemoveGroup(n,{skipActive:!0}),this.movingLock(()=>{for(const o of a)i.model.openPanel(o,{skipSetActive:o!==s,skipSetGroupActive:!0})}),this.doSetGroupAndPanelActive(i)}else{switch(n.api.location.type){case"grid":this.gridview.removeView(Vi(n.element));break;case"floating":{const l=this._floatingGroups.find(u=>u.group===n);if(!l)throw new Error("failed to find floating group");l.dispose();break}case"popout":{const l=this._popoutGroups.find(u=>u.popoutGroup===n);if(!l)throw new Error("failed to find popout group");l.disposable.dispose()}}const s=Vi(i.element),a=Pu(this.gridview.orientation,s,r);let o;switch(this.gridview.orientation){case Pt.VERTICAL:o=s.length%2==0?n.api.width:n.api.height;break;case Pt.HORIZONTAL:o=s.length%2==0?n.api.height:n.api.width;break}this.gridview.addView(n,o,a)}n.panels.forEach(s=>{this._onDidMovePanel.fire({panel:s,from:n})})}doSetGroupActive(e){super.doSetGroupActive(e);const n=this.activePanel;!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const n=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),!this._moving&&n!==this._onDidActivePanelChange.value&&this._onDidActivePanelChange.fire(n)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(e){e||(e={});let n=e==null?void 0:e.id;if(n&&this._groups.has(e.id)&&(console.warn(`dockview: Duplicate group id ${e==null?void 0:e.id}. reassigning group id to avoid errors`),n=void 0),!n)for(n=this.nextGroupId.next();this._groups.has(n);)n=this.nextGroupId.next();const i=new Nk(this,n,e);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const r=new ln(i.model.onTabDragStart(s=>{this._onWillDragPanel.fire(s)}),i.model.onGroupDragStart(s=>{this._onWillDragGroup.fire(s)}),i.model.onMove(s=>{const{groupId:a,itemId:o,target:l,index:u}=s;this.moveGroupOrPanel({from:{groupId:a,panelId:o},to:{group:i,position:l,index:u}})}),i.model.onDidDrop(s=>{this._onDidDrop.fire(s)}),i.model.onWillDrop(s=>{this._onWillDrop.fire(s)}),i.model.onWillShowOverlay(s=>{if(this.options.disableDnd){s.preventDefault();return}this._onWillShowOverlay.fire(s)}),i.model.onUnhandledDragOverEvent(s=>{this._onUnhandledDragOverEvent.fire(s)}),i.model.onDidAddPanel(s=>{this._moving||this._onDidAddPanel.fire(s.panel)}),i.model.onDidRemovePanel(s=>{this._moving||this._onDidRemovePanel.fire(s.panel)}),i.model.onDidActivePanelChange(s=>{this._moving||s.panel===this.activePanel&&this._onDidActivePanelChange.value!==s.panel&&this._onDidActivePanelChange.fire(s.panel)}),Vc.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)(()=>{this._bufferOnDidLayoutChange.fire()}));this._groups.set(i.id,{value:i,disposable:r})}return i.initialize(),i}createPanel(e,n){var i,r,s;const a=e.component,o=(i=e.tabComponent)!==null&&i!==void 0?i:this.options.defaultTabComponent,l=new Kz(this,e.id,a,o),u=new zu(e.id,a,o,this,this._api,n,l,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return u.init({title:(r=e.title)!==null&&r!==void 0?r:e.id,params:(s=e==null?void 0:e.params)!==null&&s!==void 0?s:{}}),u}createGroupAtLocation(e,n){const i=this.createGroup();return this.doAddGroup(i,e,n),i}findGroup(e){var n;return(n=Array.from(this._groups.values()).find(i=>i.value.model.containsPanel(e)))===null||n===void 0?void 0:n.value}orientationAtLocation(e){const n=this.gridview.orientation;return e.length%2==1?n:Ro(n)}}function Noe(t,e){return new Ioe(t,e).api}var xoe=Object.defineProperty,Doe=(t,e,n)=>e in t?xoe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ad=(t,e,n)=>(Doe(t,typeof e!="symbol"?e+"":e,n),n);function bc(t,e){var n,i;let r=t,s=null;for(;!s&&r;)s=(n=r.components)==null?void 0:n[e],r=r.parent;if(s||(s=(i=t.appContext.components)==null?void 0:i[e]),!s)throw new Error(`Failed to find Vue Component '${e}'`);return s}function EN(t,e,n,i){let r=W(t,Object.freeze(n));r.appContext=e.appContext,r.appContext.provides={...r.appContext.provides?r.appContext.provides:{},...e.provides?e.provides:{}},fE(r,i);let s=n;return{update:a=>{s={...n,...a},r=Go(r,s),fE(r,i)},dispose:()=>{fE(null,i)}}}class yN{constructor(e,n){ad(this,"_element"),this.component=e,this.parent=n,this._element=document.createElement("div"),this.element.className="dv-vue-part",this.element.style.height="100%",this.element.style.width="100%"}get element(){return this._element}}class Mk extends yN{constructor(){super(...arguments),ad(this,"_renderDisposable"),ad(this,"_api"),ad(this,"_containerApi")}init(e){var n;this._api=e.api,this._containerApi=e.containerApi;const i={params:e.params,api:e.api,containerApi:e.containerApi};(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:i},this.element)}update(e){var n;if(!this._api||!this._containerApi)return;const i=e.params;(n=this._renderDisposable)==null||n.update({params:{params:i,api:this._api,containerApi:this._containerApi}})}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}class koe extends yN{constructor(){super(...arguments),ad(this,"_renderDisposable")}get element(){return this._element}init(e){var n;const i={group:e.group,containerApi:e.containerApi};(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:i},this.element)}update(e){}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}class IE extends yN{constructor(e,n,i){super(e,n),ad(this,"_renderDisposable")}get element(){return this._element}init(e){var n;(n=this._renderDisposable)==null||n.dispose(),this._renderDisposable=EN(this.component,this.parent,{params:e},this.element)}dispose(){var e;(e=this._renderDisposable)==null||e.dispose()}}const Moe=Qe({__name:"dockview",props:{disableAutoResizing:{type:Boolean},hideBorders:{type:Boolean},singleTabMode:{},disableFloatingGroups:{type:Boolean},floatingGroupBounds:{},popoutUrl:{},defaultRenderer:{},debug:{type:Boolean},rootOverlayModel:{},locked:{type:Boolean},disableDnd:{type:Boolean},className:{},gap:{},noPanelsOverlay:{},watermarkComponent:{},defaultTabComponent:{},rightHeaderActionsComponent:{},leftHeaderActionsComponent:{},prefixHeaderActionsComponent:{}},emits:["ready"],setup(t,{emit:e}){function n(o){return Ik.reduce((u,c)=>(u[c]=o[c],u),{})}const i=e,r=t,s=ve(null),a=ve(null);return Ik.forEach(o=>{Ie(()=>r[o],(l,u)=>{a.value&&a.value.updateOptions({[o]:l})})}),ai(()=>{if(!s.value)throw new Error("dockview-vue: element is not mounted");const o=_i();if(!o)throw new Error("dockview-vue: getCurrentInstance() returned null");const l={createComponent(h){const f=bc(o,h.name);return new Mk(f,o)},createTabComponent(h){let f=bc(o,h.name);if(!f&&r.defaultTabComponent&&(f=bc(o,r.defaultTabComponent)),f)return new Mk(f,o)},createWatermarkComponent:r.watermarkComponent?()=>{const h=bc(o,r.watermarkComponent);return new koe(h,o)}:void 0,createLeftHeaderActionComponent:r.leftHeaderActionsComponent?h=>{const f=bc(o,r.leftHeaderActionsComponent);return new IE(f,o,h)}:void 0,createPrefixHeaderActionComponent:r.prefixHeaderActionsComponent?h=>{const f=bc(o,r.prefixHeaderActionsComponent);return new IE(f,o,h)}:void 0,createRightHeaderActionComponent:r.rightHeaderActionsComponent?h=>{const f=bc(o,r.rightHeaderActionsComponent);return new IE(f,o,h)}:void 0},u=Noe(s.value,{...n(r),...l}),{clientWidth:c,clientHeight:d}=s.value;u.layout(c,d),a.value=ys(u),i("ready",{api:u})}),Yi(()=>{a.value&&a.value.dispose()}),(o,l)=>(_e(),Ge("div",{ref_key:"el",ref:s},null,512))}});function CN(t){return aN(()=>{const e=[],n={};if(t.value.background)if(wA(t.value.background)){if(n.backgroundColor=t.value.background,!t.value.text&&rne(t.value.background)){const i=xo(t.value.background);if(i.a==null||i.a===1){const r=oz(i);n.color=r,n.caretColor=r}}}else e.push(`bg-${t.value.background}`);return t.value.text&&(wA(t.value.text)?(n.color=t.value.text,n.caretColor=t.value.text):e.push(`text-${t.value.text}`)),{colorClasses:e,colorStyles:n}})}function Xs(t,e){const n=te(()=>({text:Lt(t)?t.value:e?t[e]:null})),{colorClasses:i,colorStyles:r}=CN(n);return{textColorClasses:i,textColorStyles:r}}function Il(t,e){const n=te(()=>({background:Lt(t)?t.value:e?t[e]:null})),{colorClasses:i,colorStyles:r}=CN(n);return{backgroundColorClasses:i,backgroundColorStyles:r}}const Loe=["x-small","small","default","large","x-large"],Np=Ue({size:{type:[String,Number],default:"default"}},"size");function xp(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return aN(()=>{let n,i;return tv(Loe,t.size)?n=`${e}--size-${t.size}`:t.size&&(i={width:Ht(t.size),height:Ht(t.size)}),{sizeClasses:n,sizeStyles:i}})}const Ri=Ue({tag:{type:String,default:"div"}},"tag"),Poe=Ue({color:String,disabled:Boolean,start:Boolean,end:Boolean,icon:on,...jt(),...Np(),...Ri({tag:"i"}),...$i()},"VIcon"),Ot=vt()({name:"VIcon",props:Poe(),setup(t,e){let{attrs:n,slots:i}=e;const r=ve(),{themeClasses:s}=cr(t),{iconData:a}=yne(te(()=>r.value||t.icon)),{sizeClasses:o}=xp(t),{textColorClasses:l,textColorStyles:u}=Xs(Ve(t,"color"));return Ft(()=>{var h,f;const c=(h=i.default)==null?void 0:h.call(i);c&&(r.value=(f=Q3(c).filter(S=>S.type===Rl&&S.children&&typeof S.children=="string")[0])==null?void 0:f.children);const d=!!(n.onClick||n.onClickOnce);return W(a.value.component,{tag:t.tag,icon:a.value.icon,class:["v-icon","notranslate",s.value,o.value,l.value,{"v-icon--clickable":d,"v-icon--disabled":t.disabled,"v-icon--start":t.start,"v-icon--end":t.end},t.class],style:[o.value?void 0:{fontSize:Ht(t.size),height:Ht(t.size),width:Ht(t.size)},u.value,t.style],role:d?"button":void 0,"aria-hidden":!d,tabindex:d?t.disabled?-1:0:void 0},{default:()=>[c]})}),{}}}),Boe=Ue({disabled:Boolean,group:Boolean,hideOnLeave:Boolean,leaveAbsolute:Boolean,mode:String,origin:String},"transition");function cs(t,e,n){return vt()({name:t,props:Boe({mode:n,origin:e}),setup(i,r){let{slots:s}=r;const a={onBeforeEnter(o){i.origin&&(o.style.transformOrigin=i.origin)},onLeave(o){if(i.leaveAbsolute){const{offsetTop:l,offsetLeft:u,offsetWidth:c,offsetHeight:d}=o;o._transitionInitialStyles={position:o.style.position,top:o.style.top,left:o.style.left,width:o.style.width,height:o.style.height},o.style.position="absolute",o.style.top=`${l}px`,o.style.left=`${u}px`,o.style.width=`${c}px`,o.style.height=`${d}px`}i.hideOnLeave&&o.style.setProperty("display","none","important")},onAfterLeave(o){if(i.leaveAbsolute&&(o!=null&&o._transitionInitialStyles)){const{position:l,top:u,left:c,width:d,height:h}=o._transitionInitialStyles;delete o._transitionInitialStyles,o.style.position=l||"",o.style.top=u||"",o.style.left=c||"",o.style.width=d||"",o.style.height=h||""}}};return()=>{const o=i.group?XI:eu;return Bt(o,{name:i.disabled?"":t,css:!i.disabled,...i.group?void 0:{mode:i.mode},...i.disabled?{}:a},s.default)}}})}function jz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"in-out";return vt()({name:t,props:{mode:{type:String,default:n},disabled:Boolean,group:Boolean},setup(i,r){let{slots:s}=r;const a=i.group?XI:eu;return()=>Bt(a,{name:i.disabled?"":t,css:!i.disabled,...i.disabled?{}:e},s.default)}})}function Qz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?"width":"height",i=Rr(`offset-${n}`);return{onBeforeEnter(a){a._parent=a.parentNode,a._initialStyle={transition:a.style.transition,overflow:a.style.overflow,[n]:a.style[n]}},onEnter(a){const o=a._initialStyle;if(!o)return;a.style.setProperty("transition","none","important"),a.style.overflow="hidden";const l=`${a[i]}px`;a.style[n]="0",a.offsetHeight,a.style.transition=o.transition,t&&a._parent&&a._parent.classList.add(t),requestAnimationFrame(()=>{a.style[n]=l})},onAfterEnter:s,onEnterCancelled:s,onLeave(a){a._initialStyle={transition:"",overflow:a.style.overflow,[n]:a.style[n]},a.style.overflow="hidden",a.style[n]=`${a[i]}px`,a.offsetHeight,requestAnimationFrame(()=>a.style[n]="0")},onAfterLeave:r,onLeaveCancelled:r};function r(a){t&&a._parent&&a._parent.classList.remove(t),s(a)}function s(a){if(!a._initialStyle)return;const o=a._initialStyle[n];a.style.overflow=a._initialStyle.overflow,o!=null&&(a.style[n]=o),delete a._initialStyle}}const Foe=Ue({target:[Object,Array]},"v-dialog-transition"),TN=vt()({name:"VDialogTransition",props:Foe(),setup(t,e){let{slots:n}=e;const i={onBeforeEnter(r){r.style.pointerEvents="none",r.style.visibility="hidden"},async onEnter(r,s){var h;await new Promise(f=>requestAnimationFrame(f)),await new Promise(f=>requestAnimationFrame(f)),r.style.visibility="";const{x:a,y:o,sx:l,sy:u,speed:c}=Pk(t.target,r),d=Qu(r,[{transform:`translate(${a}px, ${o}px) scale(${l}, ${u})`,opacity:0},{}],{duration:225*c,easing:mne});(h=Lk(r))==null||h.forEach(f=>{Qu(f,[{opacity:0},{opacity:0,offset:.33},{}],{duration:225*2*c,easing:sv})}),d.finished.then(()=>s())},onAfterEnter(r){r.style.removeProperty("pointer-events")},onBeforeLeave(r){r.style.pointerEvents="none"},async onLeave(r,s){var h;await new Promise(f=>requestAnimationFrame(f));const{x:a,y:o,sx:l,sy:u,speed:c}=Pk(t.target,r);Qu(r,[{},{transform:`translate(${a}px, ${o}px) scale(${l}, ${u})`,opacity:0}],{duration:125*c,easing:gne}).finished.then(()=>s()),(h=Lk(r))==null||h.forEach(f=>{Qu(f,[{},{opacity:0,offset:.2},{opacity:0}],{duration:125*2*c,easing:sv})})},onAfterLeave(r){r.style.removeProperty("pointer-events")}};return()=>t.target?W(eu,rt({name:"dialog-transition"},i,{css:!1}),n):W(eu,{name:"dialog-transition"},n)}});function Lk(t){var n;const e=(n=t.querySelector(":scope > .v-card, :scope > .v-sheet, :scope > .v-list"))==null?void 0:n.children;return e&&[...e]}function Pk(t,e){const n=tz(t),i=uN(e),[r,s]=getComputedStyle(e).transformOrigin.split(" ").map(v=>parseFloat(v)),[a,o]=getComputedStyle(e).getPropertyValue("--v-overlay-anchor-origin").split(" ");let l=n.left+n.width/2;a==="left"||o==="left"?l-=n.width/2:(a==="right"||o==="right")&&(l+=n.width/2);let u=n.top+n.height/2;a==="top"||o==="top"?u-=n.height/2:(a==="bottom"||o==="bottom")&&(u+=n.height/2);const c=n.width/i.width,d=n.height/i.height,h=Math.max(1,c,d),f=c/h||0,S=d/h||0,_=i.width*i.height/(window.innerWidth*window.innerHeight),p=_>.12?Math.min(1.5,(_-.12)*10+1):1;return{x:l-(r+i.left),y:u-(s+i.top),sx:f,sy:S,speed:p}}cs("fab-transition","center center","out-in");cs("dialog-bottom-transition");cs("dialog-top-transition");const Bk=cs("fade-transition");cs("scale-transition");cs("scroll-x-transition");cs("scroll-x-reverse-transition");cs("scroll-y-transition");cs("scroll-y-reverse-transition");cs("slide-x-transition");cs("slide-x-reverse-transition");const Xz=cs("slide-y-transition");cs("slide-y-reverse-transition");const Uoe=jz("expand-transition",Qz()),Zz=jz("expand-x-transition",Qz("",!0)),Zd=Ue({transition:{type:[Boolean,String,Object],default:"fade-transition",validator:t=>t!==!0}},"transition"),bl=(t,e)=>{let{slots:n}=e;const{transition:i,disabled:r,group:s,...a}=t,{component:o=s?XI:eu,...l}=typeof i=="object"?i:{};return Bt(o,rt(typeof i=="string"?{name:r?"":i}:l,typeof i=="string"?{}:Object.fromEntries(Object.entries({disabled:r,group:s}).filter(u=>{let[c,d]=u;return d!==void 0})),a),n)},$oe=Ue({active:Boolean,disabled:Boolean,max:[Number,String],value:{type:[Number,String],default:0},...jt(),...Zd({transition:{component:Xz}})},"VCounter"),Jz=vt()({name:"VCounter",functional:!0,props:$oe(),setup(t,e){let{slots:n}=e;const i=te(()=>t.max?`${t.value} / ${t.max}`:String(t.value));return Ft(()=>W(bl,{transition:t.transition},{default:()=>[Ar(W("div",{class:["v-counter",{"text-error":t.max&&!t.disabled&&parseFloat(t.value)>parseFloat(t.max)},t.class],style:t.style},[n.default?n.default({counter:i.value,max:t.max,value:t.value}):i.value]),[[Wd,t.active]])]})),{}}}),Goe=Ue({text:String,onClick:Yr(),...jt(),...$i()},"VLabel"),eq=vt()({name:"VLabel",props:Goe(),setup(t,e){let{slots:n}=e;return Ft(()=>{var i;return W("label",{class:["v-label",{"v-label--clickable":!!t.onClick},t.class],style:t.style,onClick:t.onClick},[t.text,(i=n.default)==null?void 0:i.call(n)])}),{}}}),Hoe=Ue({floating:Boolean,...jt()},"VFieldLabel"),C_=vt()({name:"VFieldLabel",props:Hoe(),setup(t,e){let{slots:n}=e;return Ft(()=>W(eq,{class:["v-field-label",{"v-field-label--floating":t.floating},t.class],style:t.style,"aria-hidden":t.floating||void 0},n)),{}}}),Voe=Ue({defaults:Object,disabled:Boolean,reset:[Number,String],root:[Boolean,String],scoped:Boolean},"VDefaultsProvider"),pi=vt(!1)({name:"VDefaultsProvider",props:Voe(),setup(t,e){let{slots:n}=e;const{defaults:i,disabled:r,reset:s,root:a,scoped:o}=Cp(t);return jd(i,{reset:s,root:a,scoped:o,disabled:r}),()=>{var l;return(l=n.default)==null?void 0:l.call(n)}}});function tq(t){const{t:e}=Ip();function n(i){let{name:r}=i;const s={prepend:"prependAction",prependInner:"prependAction",append:"appendAction",appendInner:"appendAction",clear:"clear"}[r],a=t[`onClick:${r}`];function o(u){u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),u.stopPropagation(),lN(a,new PointerEvent("click",u)))}const l=a&&s?e(`$vuetify.input.${s}`,t.label??""):void 0;return W(Ot,{icon:t[`${r}Icon`],"aria-label":l,onClick:a,onKeydown:o},null)}return{InputIcon:n}}const nq=Ue({focused:Boolean,"onUpdate:focused":Yr()},"focus");function XS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();const n=Fn(t,"focused"),i=te(()=>({[`${e}--focused`]:n.value}));function r(){n.value=!0}function s(){n.value=!1}return{focusClasses:i,isFocused:n,focus:r,blur:s}}function iq(t,e){const n=ve(),i=ut(!1);if(sN){const r=new IntersectionObserver(s=>{i.value=!!s.find(a=>a.isIntersecting)},e);Yi(()=>{r.disconnect()}),Ie(n,(s,a)=>{a&&(r.unobserve(a),i.value=!1),s&&r.observe(s)},{flush:"post"})}return{intersectionRef:n,isIntersecting:i}}const Fk={center:"center",top:"bottom",bottom:"top",left:"right",right:"left"},ZS=Ue({location:String},"location");function JS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2?arguments[2]:void 0;const{isRtl:i}=ec();return{locationStyles:te(()=>{if(!t.location)return{};const{side:s,align:a}=TA(t.location.split(" ").length>1?t.location:`${t.location} center`,i.value);function o(u){return n?n(u):0}const l={};return s!=="center"&&(e?l[Fk[s]]=`calc(100% - ${o(s)}px)`:l[s]=0),a!=="center"?e?l[Fk[a]]=`calc(100% - ${o(a)}px)`:l[a]=0:(s==="center"?l.top=l.left="50%":l[{top:"left",bottom:"left",left:"top",right:"top"}[s]]="50%",l.transform={top:"translateX(-50%)",bottom:"translateX(-50%)",left:"translateY(-50%)",right:"translateY(-50%)",center:"translate(-50%, -50%)"}[s]),l})}}const no=Ue({rounded:{type:[Boolean,Number,String],default:void 0},tile:Boolean},"rounded");function io(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{roundedClasses:te(()=>{const i=Lt(t)?t.value:t.rounded,r=Lt(t)?t.value:t.tile,s=[];if(i===!0||i==="")s.push(`${e}--rounded`);else if(typeof i=="string"||i===0)for(const a of String(i).split(" "))s.push(`rounded-${a}`);else(r||i===!1)&&s.push("rounded-0");return s})}}const zoe=Ue({absolute:Boolean,active:{type:Boolean,default:!0},bgColor:String,bgOpacity:[Number,String],bufferValue:{type:[Number,String],default:0},bufferColor:String,bufferOpacity:[Number,String],clickable:Boolean,color:String,height:{type:[Number,String],default:4},indeterminate:Boolean,max:{type:[Number,String],default:100},modelValue:{type:[Number,String],default:0},opacity:[Number,String],reverse:Boolean,stream:Boolean,striped:Boolean,roundedBar:Boolean,...jt(),...ZS({location:"top"}),...no(),...Ri(),...$i()},"VProgressLinear"),rq=vt()({name:"VProgressLinear",props:zoe(),emits:{"update:modelValue":t=>!0},setup(t,e){var I;let{slots:n}=e;const i=Fn(t,"modelValue"),{isRtl:r,rtlClasses:s}=ec(),{themeClasses:a}=cr(t),{locationStyles:o}=JS(t),{textColorClasses:l,textColorStyles:u}=Xs(t,"color"),{backgroundColorClasses:c,backgroundColorStyles:d}=Il(te(()=>t.bgColor||t.color)),{backgroundColorClasses:h,backgroundColorStyles:f}=Il(te(()=>t.bufferColor||t.bgColor||t.color)),{backgroundColorClasses:S,backgroundColorStyles:_}=Il(t,"color"),{roundedClasses:p}=io(t),{intersectionRef:v,isIntersecting:m}=iq(),g=te(()=>parseFloat(t.max)),b=te(()=>parseFloat(t.height)),y=te(()=>Lo(parseFloat(t.bufferValue)/g.value*100,0,100)),E=te(()=>Lo(parseFloat(i.value)/g.value*100,0,100)),T=te(()=>r.value!==t.reverse),C=te(()=>t.indeterminate?"fade-transition":"slide-x-transition"),w=dn&&((I=window.matchMedia)==null?void 0:I.call(window,"(forced-colors: active)").matches);function R(A){if(!v.value)return;const{left:x,right:O,width:D}=v.value.getBoundingClientRect(),L=T.value?D-A.clientX+(O-D):A.clientX-x;i.value=Math.round(L/D*g.value)}return Ft(()=>W(t.tag,{ref:v,class:["v-progress-linear",{"v-progress-linear--absolute":t.absolute,"v-progress-linear--active":t.active&&m.value,"v-progress-linear--reverse":T.value,"v-progress-linear--rounded":t.rounded,"v-progress-linear--rounded-bar":t.roundedBar,"v-progress-linear--striped":t.striped},p.value,a.value,s.value,t.class],style:[{bottom:t.location==="bottom"?0:void 0,top:t.location==="top"?0:void 0,height:t.active?Ht(b.value):0,"--v-progress-linear-height":Ht(b.value),...t.absolute?o.value:{}},t.style],role:"progressbar","aria-hidden":t.active?"false":"true","aria-valuemin":"0","aria-valuemax":t.max,"aria-valuenow":t.indeterminate?void 0:Math.min(parseFloat(i.value),g.value),onClick:t.clickable&&R},{default:()=>[t.stream&&W("div",{key:"stream",class:["v-progress-linear__stream",l.value],style:{...u.value,[T.value?"left":"right"]:Ht(-b.value),borderTop:`${Ht(b.value/2)} dotted`,opacity:parseFloat(t.bufferOpacity),top:`calc(50% - ${Ht(b.value/4)})`,width:Ht(100-y.value,"%"),"--v-progress-linear-stream-to":Ht(b.value*(T.value?1:-1))}},null),W("div",{class:["v-progress-linear__background",w?void 0:c.value],style:[d.value,{opacity:parseFloat(t.bgOpacity),width:t.stream?0:void 0}]},null),W("div",{class:["v-progress-linear__buffer",w?void 0:h.value],style:[f.value,{opacity:parseFloat(t.bufferOpacity),width:Ht(y.value,"%")}]},null),W(eu,{name:C.value},{default:()=>[t.indeterminate?W("div",{class:"v-progress-linear__indeterminate"},[["long","short"].map(A=>W("div",{key:A,class:["v-progress-linear__indeterminate",A,w?void 0:S.value],style:_.value},null))]):W("div",{class:["v-progress-linear__determinate",w?void 0:S.value],style:[_.value,{width:Ht(E.value,"%")}]},null)]}),n.default&&W("div",{class:"v-progress-linear__content"},[n.default({value:E.value,buffer:y.value})])]})),{}}}),wN=Ue({loading:[Boolean,String]},"loader");function RN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{loaderClasses:te(()=>({[`${e}--loading`]:t.loading}))}}function sq(t,e){var i;let{slots:n}=e;return W("div",{class:`${t.name}__loader`},[((i=n.default)==null?void 0:i.call(n,{color:t.color,isActive:t.active}))||W(rq,{absolute:t.absolute,active:t.active,color:t.color,height:"2",indeterminate:!0},null)])}const qoe=["underlined","outlined","filled","solo","solo-inverted","solo-filled","plain"],AN=Ue({appendInnerIcon:on,bgColor:String,clearable:Boolean,clearIcon:{type:on,default:"$clear"},active:Boolean,centerAffix:{type:Boolean,default:void 0},color:String,baseColor:String,dirty:Boolean,disabled:{type:Boolean,default:null},error:Boolean,flat:Boolean,label:String,persistentClear:Boolean,prependInnerIcon:on,reverse:Boolean,singleLine:Boolean,variant:{type:String,default:"filled",validator:t=>qoe.includes(t)},"onClick:clear":Yr(),"onClick:appendInner":Yr(),"onClick:prependInner":Yr(),...jt(),...wN(),...no(),...$i()},"VField"),ON=vt()({name:"VField",inheritAttrs:!1,props:{id:String,...nq(),...AN()},emits:{"update:focused":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{attrs:n,emit:i,slots:r}=e;const{themeClasses:s}=cr(t),{loaderClasses:a}=RN(t),{focusClasses:o,isFocused:l,focus:u,blur:c}=XS(t),{InputIcon:d}=tq(t),{roundedClasses:h}=io(t),{rtlClasses:f}=ec(),S=te(()=>t.dirty||t.active),_=te(()=>!!(t.label||r.label)),p=te(()=>!t.singleLine&&_.value),v=Os(),m=te(()=>t.id||`input-${v}`),g=te(()=>`${m.value}-messages`),b=ve(),y=ve(),E=ve(),T=te(()=>["plain","underlined"].includes(t.variant)),{backgroundColorClasses:C,backgroundColorStyles:w}=Il(Ve(t,"bgColor")),{textColorClasses:R,textColorStyles:I}=Xs(te(()=>t.error||t.disabled?void 0:S.value&&l.value?t.color:t.baseColor));Ie(S,O=>{if(p.value){const D=b.value.$el,L=y.value.$el;requestAnimationFrame(()=>{const q=uN(D),G=L.getBoundingClientRect(),M=G.x-q.x,P=G.y-q.y-(q.height/2-G.height/2),N=G.width/.75,U=Math.abs(N-q.width)>1?{maxWidth:Ht(N)}:void 0,F=getComputedStyle(D),k=getComputedStyle(L),H=parseFloat(F.transitionDuration)*1e3||150,X=parseFloat(k.getPropertyValue("--v-field-label-scale")),K=k.getPropertyValue("color");D.style.visibility="visible",L.style.visibility="hidden",Qu(D,{transform:`translate(${M}px, ${P}px) scale(${X})`,color:K,...U},{duration:H,easing:sv,direction:O?"normal":"reverse"}).finished.then(()=>{D.style.removeProperty("visibility"),L.style.removeProperty("visibility")})})}},{flush:"post"});const A=te(()=>({isActive:S,isFocused:l,controlRef:E,blur:c,focus:u}));function x(O){O.target!==document.activeElement&&O.preventDefault()}return Ft(()=>{var M,P,N;const O=t.variant==="outlined",D=!!(r["prepend-inner"]||t.prependInnerIcon),L=!!(t.clearable||r.clear)&&!t.disabled,q=!!(r["append-inner"]||t.appendInnerIcon||L),G=()=>r.label?r.label({...A.value,label:t.label,props:{for:m.value}}):t.label;return W("div",rt({class:["v-field",{"v-field--active":S.value,"v-field--appended":q,"v-field--center-affix":t.centerAffix??!T.value,"v-field--disabled":t.disabled,"v-field--dirty":t.dirty,"v-field--error":t.error,"v-field--flat":t.flat,"v-field--has-background":!!t.bgColor,"v-field--persistent-clear":t.persistentClear,"v-field--prepended":D,"v-field--reverse":t.reverse,"v-field--single-line":t.singleLine,"v-field--no-label":!G(),[`v-field--variant-${t.variant}`]:!0},s.value,C.value,o.value,a.value,h.value,f.value,t.class],style:[w.value,t.style],onClick:x},n),[W("div",{class:"v-field__overlay"},null),W(sq,{name:"v-field",active:!!t.loading,color:t.error?"error":typeof t.loading=="string"?t.loading:t.color},{default:r.loader}),D&&W("div",{key:"prepend",class:"v-field__prepend-inner"},[t.prependInnerIcon&&W(d,{key:"prepend-icon",name:"prependInner"},null),(M=r["prepend-inner"])==null?void 0:M.call(r,A.value)]),W("div",{class:"v-field__field","data-no-activator":""},[["filled","solo","solo-inverted","solo-filled"].includes(t.variant)&&p.value&&W(C_,{key:"floating-label",ref:y,class:[R.value],floating:!0,for:m.value,style:I.value},{default:()=>[G()]}),_.value&&W(C_,{key:"label",ref:b,for:m.value},{default:()=>[G()]}),(P=r.default)==null?void 0:P.call(r,{...A.value,props:{id:m.value,class:"v-field__input","aria-describedby":g.value},focus:u,blur:c})]),L&&W(Zz,{key:"clear"},{default:()=>[Ar(W("div",{class:"v-field__clearable",onMousedown:U=>{U.preventDefault(),U.stopPropagation()}},[W(pi,{defaults:{VIcon:{icon:t.clearIcon}}},{default:()=>[r.clear?r.clear({...A.value,props:{onFocus:u,onBlur:c,onClick:t["onClick:clear"]}}):W(d,{name:"clear",onFocus:u,onBlur:c},null)]})]),[[Wd,t.dirty]])]}),q&&W("div",{key:"append",class:"v-field__append-inner"},[(N=r["append-inner"])==null?void 0:N.call(r,A.value),t.appendInnerIcon&&W(d,{key:"append-icon",name:"appendInner"},null)]),W("div",{class:["v-field__outline",R.value],style:I.value},[O&&W(He,null,[W("div",{class:"v-field__outline__start"},null),p.value&&W("div",{class:"v-field__outline__notch"},[W(C_,{ref:y,floating:!0,for:m.value},{default:()=>[G()]})]),W("div",{class:"v-field__outline__end"},null)]),T.value&&p.value&&W(C_,{ref:y,floating:!0,for:m.value},{default:()=>[G()]})])])}),{controlRef:E}}});function oq(t){const e=Object.keys(ON.props).filter(n=>!oN(n)&&n!=="class"&&n!=="style");return Op(t,e)}const Yoe=Ue({active:Boolean,color:String,messages:{type:[Array,String],default:()=>[]},...jt(),...Zd({transition:{component:Xz,leaveAbsolute:!0,group:!0}})},"VMessages"),Woe=vt()({name:"VMessages",props:Yoe(),setup(t,e){let{slots:n}=e;const i=te(()=>qr(t.messages)),{textColorClasses:r,textColorStyles:s}=Xs(te(()=>t.color));return Ft(()=>W(bl,{transition:t.transition,tag:"div",class:["v-messages",r.value,t.class],style:[s.value,t.style]},{default:()=>[t.active&&i.value.map((a,o)=>W("div",{class:"v-messages__message",key:`${o}-${i.value}`},[n.message?n.message({message:a}):a]))]})),{}}}),Koe=[null,"default","comfortable","compact"],ro=Ue({density:{type:String,default:"default",validator:t=>Koe.includes(t)}},"density");function Qo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{densityClasses:te(()=>`${e}--density-${t.density}`)}}const Ha=Ue({height:[Number,String],maxHeight:[Number,String],maxWidth:[Number,String],minHeight:[Number,String],minWidth:[Number,String],width:[Number,String]},"dimension");function Va(t){return{dimensionStyles:te(()=>{const n={},i=Ht(t.height),r=Ht(t.maxHeight),s=Ht(t.maxWidth),a=Ht(t.minHeight),o=Ht(t.minWidth),l=Ht(t.width);return i!=null&&(n.height=i),r!=null&&(n.maxHeight=r),s!=null&&(n.maxWidth=s),a!=null&&(n.minHeight=a),o!=null&&(n.minWidth=o),l!=null&&(n.width=l),n})}}const aq=Symbol.for("vuetify:form"),joe=Ue({disabled:Boolean,fastFail:Boolean,readonly:Boolean,modelValue:{type:Boolean,default:null},validateOn:{type:String,default:"input"}},"form");function Qoe(t){const e=Fn(t,"modelValue"),n=te(()=>t.disabled),i=te(()=>t.readonly),r=ut(!1),s=ve([]),a=ve([]);async function o(){const c=[];let d=!0;a.value=[],r.value=!0;for(const h of s.value){const f=await h.validate();if(f.length>0&&(d=!1,c.push({id:h.id,errorMessages:f})),!d&&t.fastFail)break}return a.value=c,r.value=!1,{valid:d,errors:a.value}}function l(){s.value.forEach(c=>c.reset())}function u(){s.value.forEach(c=>c.resetValidation())}return Ie(s,()=>{let c=0,d=0;const h=[];for(const f of s.value)f.isValid===!1?(d++,h.push({id:f.id,errorMessages:f.errorMessages})):f.isValid===!0&&c++;a.value=h,e.value=d>0?!1:c===s.value.length?!0:null},{deep:!0,flush:"post"}),Kn(aq,{register:c=>{let{id:d,vm:h,validate:f,reset:S,resetValidation:_}=c;s.value.some(p=>p.id===d),s.value.push({id:d,validate:f,reset:S,resetValidation:_,vm:ys(h),isValid:null,errorMessages:[]})},unregister:c=>{s.value=s.value.filter(d=>d.id!==c)},update:(c,d,h)=>{const f=s.value.find(S=>S.id===c);f&&(f.isValid=d,f.errorMessages=h)},isDisabled:n,isReadonly:i,isValidating:r,isValid:e,items:s,validateOn:Ve(t,"validateOn")}),{errors:a,isDisabled:n,isReadonly:i,isValidating:r,isValid:e,items:s,validate:o,reset:l,resetValidation:u}}function IN(t){const e=an(aq,null);return{...e,isReadonly:te(()=>!!((t==null?void 0:t.readonly)??(e==null?void 0:e.isReadonly.value))),isDisabled:te(()=>!!((t==null?void 0:t.disabled)??(e==null?void 0:e.isDisabled.value)))}}const Xoe=Ue({disabled:{type:Boolean,default:null},error:Boolean,errorMessages:{type:[Array,String],default:()=>[]},maxErrors:{type:[Number,String],default:1},name:String,label:String,readonly:{type:Boolean,default:null},rules:{type:Array,default:()=>[]},modelValue:null,validateOn:String,validationValue:null,...nq()},"validation");function Zoe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Os();const i=Fn(t,"modelValue"),r=te(()=>t.validationValue===void 0?i.value:t.validationValue),s=IN(t),a=ve([]),o=ut(!0),l=te(()=>!!(qr(i.value===""?null:i.value).length||qr(r.value===""?null:r.value).length)),u=te(()=>{var g;return(g=t.errorMessages)!=null&&g.length?qr(t.errorMessages).concat(a.value).slice(0,Math.max(0,+t.maxErrors)):a.value}),c=te(()=>{var y;let g=(t.validateOn??((y=s.validateOn)==null?void 0:y.value))||"input";g==="lazy"&&(g="input lazy"),g==="eager"&&(g="input eager");const b=new Set((g==null?void 0:g.split(" "))??[]);return{input:b.has("input"),blur:b.has("blur")||b.has("input")||b.has("invalid-input"),invalidInput:b.has("invalid-input"),lazy:b.has("lazy"),eager:b.has("eager")}}),d=te(()=>{var g;return t.error||(g=t.errorMessages)!=null&&g.length?!1:t.rules.length?o.value?a.value.length||c.value.lazy?null:!0:!a.value.length:!0}),h=ut(!1),f=te(()=>({[`${e}--error`]:d.value===!1,[`${e}--dirty`]:l.value,[`${e}--disabled`]:s.isDisabled.value,[`${e}--readonly`]:s.isReadonly.value})),S=Li("validation"),_=te(()=>t.name??ie(n));vu(()=>{var g;(g=s.register)==null||g.call(s,{id:_.value,vm:S,validate:m,reset:p,resetValidation:v})}),Yi(()=>{var g;(g=s.unregister)==null||g.call(s,_.value)}),ai(async()=>{var g;c.value.lazy||await m(!c.value.eager),(g=s.update)==null||g.call(s,_.value,d.value,u.value)}),nu(()=>c.value.input||c.value.invalidInput&&d.value===!1,()=>{Ie(r,()=>{if(r.value!=null)m();else if(t.focused){const g=Ie(()=>t.focused,b=>{b||m(),g()})}})}),nu(()=>c.value.blur,()=>{Ie(()=>t.focused,g=>{g||m()})}),Ie([d,u],()=>{var g;(g=s.update)==null||g.call(s,_.value,d.value,u.value)});async function p(){i.value=null,await $t(),await v()}async function v(){o.value=!0,c.value.lazy?a.value=[]:await m(!c.value.eager)}async function m(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const b=[];h.value=!0;for(const y of t.rules){if(b.length>=+(t.maxErrors??1))break;const T=await(typeof y=="function"?y:()=>y)(r.value);if(T!==!0){if(T!==!1&&typeof T!="string"){console.warn(`${T} is not a valid value. Rule functions must return boolean true or a string.`);continue}b.push(T||"")}}return a.value=b,h.value=!1,o.value=g,a.value}return{errorMessages:u,isDirty:l,isDisabled:s.isDisabled,isReadonly:s.isReadonly,isPristine:o,isValid:d,isValidating:h,reset:p,resetValidation:v,validate:m,validationClasses:f}}const eb=Ue({id:String,appendIcon:on,centerAffix:{type:Boolean,default:!0},prependIcon:on,hideDetails:[Boolean,String],hideSpinButtons:Boolean,hint:String,persistentHint:Boolean,messages:{type:[Array,String],default:()=>[]},direction:{type:String,default:"horizontal",validator:t=>["horizontal","vertical"].includes(t)},"onClick:prepend":Yr(),"onClick:append":Yr(),...jt(),...ro(),...Op(Ha(),["maxWidth","minWidth","width"]),...$i(),...Xoe()},"VInput"),Td=vt()({name:"VInput",props:{...eb()},emits:{"update:modelValue":t=>!0},setup(t,e){let{attrs:n,slots:i,emit:r}=e;const{densityClasses:s}=Qo(t),{dimensionStyles:a}=Va(t),{themeClasses:o}=cr(t),{rtlClasses:l}=ec(),{InputIcon:u}=tq(t),c=Os(),d=te(()=>t.id||`input-${c}`),h=te(()=>`${d.value}-messages`),{errorMessages:f,isDirty:S,isDisabled:_,isReadonly:p,isPristine:v,isValid:m,isValidating:g,reset:b,resetValidation:y,validate:E,validationClasses:T}=Zoe(t,"v-input",d),C=te(()=>({id:d,messagesId:h,isDirty:S,isDisabled:_,isReadonly:p,isPristine:v,isValid:m,isValidating:g,reset:b,resetValidation:y,validate:E})),w=te(()=>{var R;return(R=t.errorMessages)!=null&&R.length||!v.value&&f.value.length?f.value:t.hint&&(t.persistentHint||t.focused)?t.hint:t.messages});return Ft(()=>{var O,D,L,q;const R=!!(i.prepend||t.prependIcon),I=!!(i.append||t.appendIcon),A=w.value.length>0,x=!t.hideDetails||t.hideDetails==="auto"&&(A||!!i.details);return W("div",{class:["v-input",`v-input--${t.direction}`,{"v-input--center-affix":t.centerAffix,"v-input--hide-spin-buttons":t.hideSpinButtons},s.value,o.value,l.value,T.value,t.class],style:[a.value,t.style]},[R&&W("div",{key:"prepend",class:"v-input__prepend"},[(O=i.prepend)==null?void 0:O.call(i,C.value),t.prependIcon&&W(u,{key:"prepend-icon",name:"prepend"},null)]),i.default&&W("div",{class:"v-input__control"},[(D=i.default)==null?void 0:D.call(i,C.value)]),I&&W("div",{key:"append",class:"v-input__append"},[t.appendIcon&&W(u,{key:"append-icon",name:"append"},null),(L=i.append)==null?void 0:L.call(i,C.value)]),x&&W("div",{id:h.value,class:"v-input__details",role:"alert","aria-live":"polite"},[W(Woe,{active:A,messages:w.value},{message:i.message}),(q=i.details)==null?void 0:q.call(i,C.value)])])}),{reset:b,resetValidation:y,validate:E,isValid:m,errorMessages:f}}}),NE=Symbol("Forwarded refs");function xE(t,e){let n=t;for(;n;){const i=Reflect.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function tc(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return t[NE]=n,new Proxy(t,{get(r,s){if(Reflect.has(r,s))return Reflect.get(r,s);if(!(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))){for(const a of n)if(a.value&&Reflect.has(a.value,s)){const o=Reflect.get(a.value,s);return typeof o=="function"?o.bind(a.value):o}}},has(r,s){if(Reflect.has(r,s))return!0;if(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))return!1;for(const a of n)if(a.value&&Reflect.has(a.value,s))return!0;return!1},set(r,s,a){if(Reflect.has(r,s))return Reflect.set(r,s,a);if(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))return!1;for(const o of n)if(o.value&&Reflect.has(o.value,s))return Reflect.set(o.value,s,a);return!1},getOwnPropertyDescriptor(r,s){var o;const a=Reflect.getOwnPropertyDescriptor(r,s);if(a)return a;if(!(typeof s=="symbol"||s.startsWith("$")||s.startsWith("__"))){for(const l of n){if(!l.value)continue;const u=xE(l.value,s)??("_"in l.value?xE((o=l.value._)==null?void 0:o.setupState,s):void 0);if(u)return u}for(const l of n){const u=l.value&&l.value[NE];if(!u)continue;const c=u.slice();for(;c.length;){const d=c.shift(),h=xE(d.value,s);if(h)return h;const f=d.value&&d.value[NE];f&&c.push(...f)}}}}})}function Joe(t,e){if(!sN)return;const n=e.modifiers||{},i=e.value,{handler:r,options:s}=typeof i=="object"?i:{handler:i,options:{}},a=new IntersectionObserver(function(){var d;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0;const u=(d=t._observe)==null?void 0:d[e.instance.$.uid];if(!u)return;const c=o.some(h=>h.isIntersecting);r&&(!n.quiet||u.init)&&(!n.once||c||u.init)&&r(c,o,l),c&&n.once?lq(t,e):u.init=!0},s);t._observe=Object(t._observe),t._observe[e.instance.$.uid]={init:!1,observer:a},a.observe(t)}function lq(t,e){var i;const n=(i=t._observe)==null?void 0:i[e.instance.$.uid];n&&(n.observer.unobserve(t),delete t._observe[e.instance.$.uid])}const NN={mounted:Joe,unmounted:lq},eae=["color","file","time","date","datetime-local","week","month"],xN=Ue({autofocus:Boolean,counter:[Boolean,Number,String],counterValue:[Number,Function],prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,suffix:String,role:String,type:{type:String,default:"text"},modelModifiers:Object,...eb(),...AN()},"VTextField"),Vo=vt()({name:"VTextField",directives:{Intersect:NN},inheritAttrs:!1,props:xN(),emits:{"click:control":t=>!0,"mousedown:control":t=>!0,"update:focused":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{attrs:n,emit:i,slots:r}=e;const s=Fn(t,"modelValue"),{isFocused:a,focus:o,blur:l}=XS(t),u=te(()=>typeof t.counterValue=="function"?t.counterValue(s.value):typeof t.counterValue=="number"?t.counterValue:(s.value??"").toString().length),c=te(()=>{if(n.maxlength)return n.maxlength;if(!(!t.counter||typeof t.counter!="number"&&typeof t.counter!="string"))return t.counter}),d=te(()=>["plain","underlined"].includes(t.variant));function h(E,T){var C,w;!t.autofocus||!E||(w=(C=T[0].target)==null?void 0:C.focus)==null||w.call(C)}const f=ve(),S=ve(),_=ve(),p=te(()=>eae.includes(t.type)||t.persistentPlaceholder||a.value||t.active);function v(){var E;_.value!==document.activeElement&&((E=_.value)==null||E.focus()),a.value||o()}function m(E){i("mousedown:control",E),E.target!==_.value&&(v(),E.preventDefault())}function g(E){v(),i("click:control",E)}function b(E){E.stopPropagation(),v(),$t(()=>{s.value=null,lN(t["onClick:clear"],E)})}function y(E){var C;const T=E.target;if(s.value=T.value,(C=t.modelModifiers)!=null&&C.trim&&["text","search","password","tel","url"].includes(t.type)){const w=[T.selectionStart,T.selectionEnd];$t(()=>{T.selectionStart=w[0],T.selectionEnd=w[1]})}}return Ft(()=>{const E=!!(r.counter||t.counter!==!1&&t.counter!=null),T=!!(E||r.details),[C,w]=YS(n),{modelValue:R,...I}=Td.filterProps(t),A=oq(t);return W(Td,rt({ref:f,modelValue:s.value,"onUpdate:modelValue":x=>s.value=x,class:["v-text-field",{"v-text-field--prefixed":t.prefix,"v-text-field--suffixed":t.suffix,"v-input--plain-underlined":d.value},t.class],style:t.style},C,I,{centerAffix:!d.value,focused:a.value}),{...r,default:x=>{let{id:O,isDisabled:D,isDirty:L,isReadonly:q,isValid:G}=x;return W(ON,rt({ref:S,onMousedown:m,onClick:g,"onClick:clear":b,"onClick:prependInner":t["onClick:prependInner"],"onClick:appendInner":t["onClick:appendInner"],role:t.role},A,{id:O.value,active:p.value||L.value,dirty:L.value||t.dirty,disabled:D.value,focused:a.value,error:G.value===!1}),{...r,default:M=>{let{props:{class:P,...N}}=M;const U=Ar(W("input",rt({ref:_,value:s.value,onInput:y,autofocus:t.autofocus,readonly:q.value,disabled:D.value,name:t.name,placeholder:t.placeholder,size:1,type:t.type,onFocus:v,onBlur:l},N,w),null),[[Jl("intersect"),{handler:h},null,{once:!0}]]);return W(He,null,[t.prefix&&W("span",{class:"v-text-field__prefix"},[W("span",{class:"v-text-field__prefix__text"},[t.prefix])]),r.default?W("div",{class:P,"data-no-activator":""},[r.default(),U]):Go(U,{class:P}),t.suffix&&W("span",{class:"v-text-field__suffix"},[W("span",{class:"v-text-field__suffix__text"},[t.suffix])])])}})},details:T?x=>{var O;return W(He,null,[(O=r.details)==null?void 0:O.call(r,x),E&&W(He,null,[W("span",null,null),W(Jz,{active:t.persistentCounter||a.value,value:u.value,max:c.value,disabled:t.disabled},r.counter)])])}:void 0})}),tc({},f,S,_)}}),cq=Qe({__name:"PasswordField",props:{modelValue:{},modelModifiers:{},visible:{type:Boolean,default:!1},visibleModifiers:{}},emits:["update:modelValue","update:visible"],setup(t,{expose:e}){const n=kl(t,"modelValue"),i=kl(t,"visible"),r=MS("textField");return e({textField:r}),(s,a)=>(_e(),xe(Vo,{ref_key:"textField",ref:r,modelValue:n.value,"onUpdate:modelValue":a[1]||(a[1]=o=>n.value=o),variant:"outlined",density:"compact",type:i.value?"text":"password"},{"append-inner":be(()=>[W(Ot,{onClick:a[0]||(a[0]=o=>i.value=!i.value)},{default:be(()=>[Tt(Mn(i.value?"mdi-eye-off":"mdi-eye"),1)]),_:1})]),_:1},8,["modelValue","type"]))}});function uq(t){return gu()?(Xn(t),!0):!1}function BA(){const t=new Set,e=r=>{t.delete(r)};return{on:r=>{t.add(r);const s=()=>e(r);return uq(s),{off:s}},off:e,trigger:(...r)=>Promise.all(Array.from(t).map(s=>s(...r)))}}const ld=new WeakMap,tae=(t,e)=>{var n;const i=(n=_i())==null?void 0:n.proxy;if(i==null)throw new Error("provideLocal must be called in setup");ld.has(i)||ld.set(i,Object.create(null));const r=ld.get(i);r[t]=e,Kn(t,e)},nae=(...t)=>{var e;const n=t[0],i=(e=_i())==null?void 0:e.proxy;if(i==null)throw new Error("injectLocal must be called in setup");return ld.has(i)&&n in ld.get(i)?ld.get(i)[n]:an(...t)};function mv(t){return typeof t=="function"?t():ie(t)}const iae=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rae=Object.prototype.toString,sae=t=>rae.call(t)==="[object Object]",FA=()=>{};function oae(t,e){function n(...i){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return n}function aae(t,e={}){let n,i,r=FA;const s=o=>{clearTimeout(o),r(),r=FA};return o=>{const l=mv(t),u=mv(e.maxWait);return n&&s(n),l<=0||u!==void 0&&u<=0?(i&&(s(i),i=null),Promise.resolve(o())):new Promise((c,d)=>{r=e.rejectOnCancel?d:c,u&&!i&&(i=setTimeout(()=>{n&&s(n),i=null,c(o())},u)),n=setTimeout(()=>{i&&s(i),i=null,c(o())},l)})}}function tb(t,e=200,n={}){return oae(aae(e,n),t)}function lae(t,e=200,n={}){const i=ve(t.value),r=tb(()=>{i.value=t.value},e,n);return Ie(t,()=>r()),i}function cae(t,e){return te({get(){var n;return(n=t.value)!=null?n:e},set(n){t.value=n}})}function uae(t,e,n){const i=Ie(t,(...r)=>($t(()=>i()),e(...r)),n);return i}function dq(t){var e;const n=mv(t);return(e=n==null?void 0:n.$el)!=null?e:n}const DN=iae?window:void 0;function Vh(...t){let e,n,i,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,r]=t,e=DN):[e,n,i,r]=t,!e)return FA;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},o=(c,d,h,f)=>(c.addEventListener(d,h,f),()=>c.removeEventListener(d,h,f)),l=Ie(()=>[dq(e),mv(r)],([c,d])=>{if(a(),!c)return;const h=sae(d)?{...d}:d;s.push(...n.flatMap(f=>i.map(S=>o(c,f,S,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return uq(u),u}const dae={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function hae(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:i=!1,initialValue:r={x:0,y:0},window:s=DN,target:a=s,scroll:o=!0,eventFilter:l}=t;let u=null;const c=ve(r.x),d=ve(r.y),h=ve(null),f=typeof e=="function"?e:dae[e],S=y=>{const E=f(y);u=y,E&&([c.value,d.value]=E,h.value="mouse")},_=y=>{if(y.touches.length>0){const E=f(y.touches[0]);E&&([c.value,d.value]=E,h.value="touch")}},p=()=>{if(!u||!s)return;const y=f(u);u instanceof MouseEvent&&y&&(c.value=y[0]+s.scrollX,d.value=y[1]+s.scrollY)},v=()=>{c.value=r.x,d.value=r.y},m=l?y=>l(()=>S(y),{}):y=>S(y),g=l?y=>l(()=>_(y),{}):y=>_(y),b=l?()=>l(()=>p(),{}):()=>p();if(a){const y={passive:!0};Vh(a,["mousemove","dragover"],m,y),n&&e!=="movement"&&(Vh(a,["touchstart","touchmove"],g,y),i&&Vh(a,"touchend",v,y)),o&&e==="page"&&Vh(s,"scroll",b,{passive:!0})}return{x:c,y:d,sourceType:h}}function fae(t,e={}){const{handleOutside:n=!0,window:i=DN}=e,r=e.type||"page",{x:s,y:a,sourceType:o}=hae(e),l=ve(t??(i==null?void 0:i.document.body)),u=ve(0),c=ve(0),d=ve(0),h=ve(0),f=ve(0),S=ve(0),_=ve(!0);let p=()=>{};return i&&(p=Ie([l,s,a],()=>{const v=dq(l);if(!v)return;const{left:m,top:g,width:b,height:y}=v.getBoundingClientRect();d.value=m+(r==="page"?i.pageXOffset:0),h.value=g+(r==="page"?i.pageYOffset:0),f.value=y,S.value=b;const E=s.value-d.value,T=a.value-h.value;_.value=b===0||y===0||E<0||T<0||E>b||T>y,(n||!_.value)&&(u.value=E,c.value=T)},{immediate:!0}),Vh(document,"mouseleave",()=>{_.value=!0})),{x:s,y:a,sourceType:o,elementX:u,elementY:c,elementPositionX:d,elementPositionY:h,elementHeight:f,elementWidth:S,isOutside:_,stop:p}}const nb=As("projects",()=>{const{$client:t}=wn(),{data:e}=t.project.getProjects.useQuery(),n=cae(te(()=>e.value),[]),i=ve(!1),r=async(a,o)=>{i.value=!0;try{if(n.value.includes(a))throw new Error("Project already exists");await t.project.createProject.mutate({projectId:a,password:o})}finally{i.value=!1}},s=ve(null);return{projectNames:n,focusedProjectId:s,createProject:r,loadingCreateProject:i}}),Su=As("workspace",()=>{const t=ys(ve(null)),e=ys(ve(null)),n=nb(),{$client:i}=wn(),r=tb(async()=>{const f=t.value.toJSON();e.value=f,await i.workspace.setWorkspaceLayout.mutate({layout:f})},1e3),s=()=>{const f=t.value.addPanel({id:"project-list",component:"ProjectListPanel",tabComponent:"CustomTab",params:{title:"Projects",icon:"mdi-folder-multiple",closable:!1}}),S=t.value.addPanel({id:"component-list",component:"ComponentList",tabComponent:"CustomTab",params:{title:"Components",icon:"mdi-cube-outline",closable:!1},position:{referencePanel:f,direction:"right"},initialWidth:400,minimumWidth:400,maximumWidth:400});t.value.addPanel({id:"operation-list",component:"OperationListPanel",tabComponent:"CustomTab",params:{title:"Operations",icon:"mdi-cogs",closable:!1},position:{referencePanel:S,direction:"below"}})};return{dockview:t,init:f=>{t.value=f,t.value.onDidActivePanelChange(S=>{var _;S&&(S.id==="operation-list"||S.id==="component-list"||(n.focusedProjectId=((_=S.params)==null?void 0:_.projectId)??null))}),t.value.onDidRemovePanel(S=>{var _;((_=S==null?void 0:S.params)==null?void 0:_.projectId)===n.focusedProjectId&&(n.focusedProjectId=null)}),t.value.onDidLayoutChange(r)},loadLayout:async()=>{const f=await i.workspace.getWorkspaceLayout.query();f?(t.value.fromJSON(f),e.value=f):s()},openProjectPanel:f=>{const S=`projects/${f}`,_=t.value.getPanel(S);return _?(_.focus(),_):t.value.addPanel({id:S,component:"ProjectPanel",tabComponent:"CustomTab",params:{title:`Project: ${f}`,icon:"mdi-folder",closable:!0,projectId:f}})},openCompositeInstancePanel:(f,S)=>{const _=`projects/${f}/instances/${S}`,p=t.value.getPanel(_);return p?(p.focus(),p):t.value.addPanel({id:_,component:"CompositeInstancePanel",tabComponent:"CustomTab",params:{title:`Instance: ${S}`,icon:"mdi-cube-outline",closable:!0,projectId:f,instanceId:S}})},openTerminalPanel:(f,S,_)=>{const p=`terminals/${S}`,v=t.value.getPanel(p);return v?(v.focus(),v):t.value.addPanel({id:p,component:"TerminalPanel",tabComponent:"CustomTab",params:{title:`Terminal: ${_.id}`,icon:"mdi-console",closable:!0,projectId:f,instanceId:_.id,sessionId:S}})},openLogsPanel:(f,S,_)=>{const p=`operations/${S}/instances/${_}/logs`,v=t.value.getPanel(p);return v?(v.focus(),v):t.value.addPanel({id:p,component:"LogsPanel",tabComponent:"CustomTab",params:{title:`Logs: ${_}`,icon:"mdi-text",closable:!0,projectId:f,operationId:S,instanceId:_}})},resetLayout:async()=>{t.value.clear(),s(),await r()},serialiedLayout:e}}),pae=WS("v-alert-title"),bu=Ue({border:[Boolean,Number,String]},"border");function Eu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{borderClasses:te(()=>{const i=Lt(t)?t.value:t.border,r=[];if(i===!0||i==="")r.push(`${e}--border`);else if(typeof i=="string"||i===0)for(const s of String(i).split(" "))r.push(`border-${s}`);return r})}}const yu=Ue({elevation:{type:[Number,String],validator(t){const e=parseInt(t);return!isNaN(e)&&e>=0&&e<=24}}},"elevation");function Cu(t){return{elevationClasses:te(()=>{const n=Lt(t)?t.value:t.elevation,i=[];return n==null||i.push(`elevation-${n}`),i})}}const _ae=["elevated","flat","tonal","outlined","text","plain"];function Jd(t,e){return W(He,null,[t&&W("span",{key:"overlay",class:`${e}__overlay`},null),W("span",{key:"underlay",class:`${e}__underlay`},null)])}const za=Ue({color:String,variant:{type:String,default:"elevated",validator:t=>_ae.includes(t)}},"variant");function eh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();const n=te(()=>{const{variant:s}=ie(t);return`${e}--variant-${s}`}),{colorClasses:i,colorStyles:r}=CN(te(()=>{const{variant:s,color:a}=ie(t);return{[["elevated","flat"].includes(s)?"background":"text"]:a}}));return{colorClasses:i,colorStyles:r,variantClasses:n}}const hq=Ue({baseColor:String,divided:Boolean,...bu(),...jt(),...ro(),...yu(),...no(),...Ri(),...$i(),...za()},"VBtnGroup"),Uk=vt()({name:"VBtnGroup",props:hq(),setup(t,e){let{slots:n}=e;const{themeClasses:i}=cr(t),{densityClasses:r}=Qo(t),{borderClasses:s}=Eu(t),{elevationClasses:a}=Cu(t),{roundedClasses:o}=io(t);jd({VBtn:{height:"auto",baseColor:Ve(t,"baseColor"),color:Ve(t,"color"),density:Ve(t,"density"),flat:!0,variant:Ve(t,"variant")}}),Ft(()=>W(t.tag,{class:["v-btn-group",{"v-btn-group--divided":t.divided},i.value,s.value,r.value,a.value,o.value,t.class],style:t.style},n))}}),kN=Ue({modelValue:{type:null,default:void 0},multiple:Boolean,mandatory:[Boolean,String],max:Number,selectedClass:String,disabled:Boolean},"group"),fq=Ue({value:null,disabled:Boolean,selectedClass:String},"group-item");function pq(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=Li("useGroupItem");if(!i)throw new Error("[Vuetify] useGroupItem composable must be used inside a component setup function");const r=Os();Kn(Symbol.for(`${e.description}:id`),r);const s=an(e,null);if(!s){if(!n)return s;throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${e.description}`)}const a=Ve(t,"value"),o=te(()=>!!(s.disabled.value||t.disabled));s.register({id:r,value:a,disabled:o},i),Yi(()=>{s.unregister(r)});const l=te(()=>s.isSelected(r)),u=te(()=>s.items.value[0].id===r),c=te(()=>s.items.value[s.items.value.length-1].id===r),d=te(()=>l.value&&[s.selectedClass.value,t.selectedClass]);return Ie(l,h=>{i.emit("group:selected",{value:h})},{flush:"sync"}),{id:r,isSelected:l,isFirst:u,isLast:c,toggle:()=>s.select(r,!l.value),select:h=>s.select(r,h),selectedClass:d,value:a,disabled:o,group:s}}function MN(t,e){let n=!1;const i=$n([]),r=Fn(t,"modelValue",[],h=>h==null?[]:_q(i,qr(h)),h=>{const f=gae(i,h);return t.multiple?f:f[0]}),s=Li("useGroup");function a(h,f){const S=h,_=Symbol.for(`${e.description}:id`),v=Hh(_,s==null?void 0:s.vnode).indexOf(f);ie(S.value)==null&&(S.value=v,S.useIndexAsValue=!0),v>-1?i.splice(v,0,S):i.push(S)}function o(h){if(n)return;l();const f=i.findIndex(S=>S.id===h);i.splice(f,1)}function l(){const h=i.find(f=>!f.disabled);h&&t.mandatory==="force"&&!r.value.length&&(r.value=[h.id])}ai(()=>{l()}),Yi(()=>{n=!0}),HI(()=>{for(let h=0;h<i.length;h++)i[h].useIndexAsValue&&(i[h].value=h)});function u(h,f){const S=i.find(_=>_.id===h);if(!(f&&(S!=null&&S.disabled)))if(t.multiple){const _=r.value.slice(),p=_.findIndex(m=>m===h),v=~p;if(f=f??!v,v&&t.mandatory&&_.length<=1||!v&&t.max!=null&&_.length+1>t.max)return;p<0&&f?_.push(h):p>=0&&!f&&_.splice(p,1),r.value=_}else{const _=r.value.includes(h);if(t.mandatory&&_)return;r.value=f??!_?[h]:[]}}function c(h){if(t.multiple,r.value.length){const f=r.value[0],S=i.findIndex(v=>v.id===f);let _=(S+h)%i.length,p=i[_];for(;p.disabled&&_!==S;)_=(_+h)%i.length,p=i[_];if(p.disabled)return;r.value=[i[_].id]}else{const f=i.find(S=>!S.disabled);f&&(r.value=[f.id])}}const d={register:a,unregister:o,selected:r,select:u,disabled:Ve(t,"disabled"),prev:()=>c(i.length-1),next:()=>c(1),isSelected:h=>r.value.includes(h),selectedClass:te(()=>t.selectedClass),items:te(()=>i),getItemIndex:h=>mae(i,h)};return Kn(e,d),d}function mae(t,e){const n=_q(t,[e]);return n.length?t.findIndex(i=>i.id===n[0]):-1}function _q(t,e){const n=[];return e.forEach(i=>{const r=t.find(a=>Ks(i,a.value)),s=t[i];(r==null?void 0:r.value)!=null?n.push(r.id):s!=null&&n.push(s.id)}),n}function gae(t,e){const n=[];return e.forEach(i=>{const r=t.findIndex(s=>s.id===i);if(~r){const s=t[r];n.push(s.value!=null?s.value:r)}}),n}const mq=Symbol.for("vuetify:v-btn-toggle"),vae=Ue({...hq(),...kN()},"VBtnToggle");vt()({name:"VBtnToggle",props:vae(),emits:{"update:modelValue":t=>!0},setup(t,e){let{slots:n}=e;const{isSelected:i,next:r,prev:s,select:a,selected:o}=MN(t,mq);return Ft(()=>{const l=Uk.filterProps(t);return W(Uk,rt({class:["v-btn-toggle",t.class]},l,{style:t.style}),{default:()=>{var u;return[(u=n.default)==null?void 0:u.call(n,{isSelected:i,next:r,prev:s,select:a,selected:o})]}})}),{next:r,prev:s,select:a}}});const Sae=Ue({bgColor:String,color:String,indeterminate:[Boolean,String],modelValue:{type:[Number,String],default:0},rotate:{type:[Number,String],default:0},width:{type:[Number,String],default:4},...jt(),...Np(),...Ri({tag:"div"}),...$i()},"VProgressCircular"),gq=vt()({name:"VProgressCircular",props:Sae(),setup(t,e){let{slots:n}=e;const i=20,r=2*Math.PI*i,s=ve(),{themeClasses:a}=cr(t),{sizeClasses:o,sizeStyles:l}=xp(t),{textColorClasses:u,textColorStyles:c}=Xs(Ve(t,"color")),{textColorClasses:d,textColorStyles:h}=Xs(Ve(t,"bgColor")),{intersectionRef:f,isIntersecting:S}=iq(),{resizeRef:_,contentRect:p}=xf(),v=te(()=>Math.max(0,Math.min(100,parseFloat(t.modelValue)))),m=te(()=>Number(t.width)),g=te(()=>l.value?Number(t.size):p.value?p.value.width:Math.max(m.value,32)),b=te(()=>i/(1-m.value/g.value)*2),y=te(()=>m.value/g.value*b.value),E=te(()=>Ht((100-v.value)/100*r));return Wr(()=>{f.value=s.value,_.value=s.value}),Ft(()=>W(t.tag,{ref:s,class:["v-progress-circular",{"v-progress-circular--indeterminate":!!t.indeterminate,"v-progress-circular--visible":S.value,"v-progress-circular--disable-shrink":t.indeterminate==="disable-shrink"},a.value,o.value,u.value,t.class],style:[l.value,c.value,t.style],role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":t.indeterminate?void 0:v.value},{default:()=>[W("svg",{style:{transform:`rotate(calc(-90deg + ${Number(t.rotate)}deg))`},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${b.value} ${b.value}`},[W("circle",{class:["v-progress-circular__underlay",d.value],style:h.value,fill:"transparent",cx:"50%",cy:"50%",r:i,"stroke-width":y.value,"stroke-dasharray":r,"stroke-dashoffset":0},null),W("circle",{class:"v-progress-circular__overlay",fill:"transparent",cx:"50%",cy:"50%",r:i,"stroke-width":y.value,"stroke-dasharray":r,"stroke-dashoffset":E.value},null)]),n.default&&W("div",{class:"v-progress-circular__content"},[n.default({value:v.value})])]})),{}}}),bae=["static","relative","fixed","absolute","sticky"],LN=Ue({position:{type:String,validator:t=>bae.includes(t)}},"position");function PN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jo();return{positionClasses:te(()=>t.position?`${e}--${t.position}`:void 0)}}function Eae(){const t=Li("useRoute");return te(()=>{var e;return(e=t==null?void 0:t.proxy)==null?void 0:e.$route})}function yae(){var t,e;return(e=(t=Li("useRouter"))==null?void 0:t.proxy)==null?void 0:e.$router}function ib(t,e){var d,h;const n=BS("RouterLink"),i=te(()=>!!(t.href||t.to)),r=te(()=>(i==null?void 0:i.value)||M1(e,"click")||M1(t,"click"));if(typeof n=="string"||!("useLink"in n)){const f=Ve(t,"href");return{isLink:i,isClickable:r,href:f,linkProps:$n({href:f})}}const s=te(()=>({...t,to:Ve(()=>t.to||"")})),a=n.useLink(s.value),o=te(()=>t.to?a:void 0),l=Eae(),u=te(()=>{var f,S,_;return o.value?t.exact?l.value?((_=o.value.isExactActive)==null?void 0:_.value)&&Ks(o.value.route.value.query,l.value.query):((S=o.value.isExactActive)==null?void 0:S.value)??!1:((f=o.value.isActive)==null?void 0:f.value)??!1:!1}),c=te(()=>{var f;return t.to?(f=o.value)==null?void 0:f.route.value.href:t.href});return{isLink:i,isClickable:r,isActive:u,route:(d=o.value)==null?void 0:d.route,navigate:(h=o.value)==null?void 0:h.navigate,href:c,linkProps:$n({href:c,"aria-current":te(()=>u.value?"page":void 0)})}}const rb=Ue({href:String,replace:Boolean,to:[String,Object],exact:Boolean},"router");let DE=!1;function Cae(t,e){let n=!1,i,r;dn&&(t!=null&&t.beforeEach)&&($t(()=>{window.addEventListener("popstate",s),i=t.beforeEach((a,o,l)=>{DE?n?e(l):l():setTimeout(()=>n?e(l):l()),DE=!0}),r=t==null?void 0:t.afterEach(()=>{DE=!1})}),Xn(()=>{window.removeEventListener("popstate",s),i==null||i(),r==null||r()}));function s(a){var o;(o=a.state)!=null&&o.replaced||(n=!0,setTimeout(()=>n=!1))}}function Tae(t,e){Ie(()=>{var n;return(n=t.isActive)==null?void 0:n.value},n=>{t.isLink.value&&n&&e&&$t(()=>{e(!0)})},{immediate:!0})}const UA=Symbol("rippleStop"),wae=80;function $k(t,e){t.style.transform=e,t.style.webkitTransform=e}function $A(t){return t.constructor.name==="TouchEvent"}function vq(t){return t.constructor.name==="KeyboardEvent"}const Rae=function(t,e){var d;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=0,r=0;if(!vq(t)){const h=e.getBoundingClientRect(),f=$A(t)?t.touches[t.touches.length-1]:t;i=f.clientX-h.left,r=f.clientY-h.top}let s=0,a=.3;(d=e._ripple)!=null&&d.circle?(a=.15,s=e.clientWidth/2,s=n.center?s:s+Math.sqrt((i-s)**2+(r-s)**2)/4):s=Math.sqrt(e.clientWidth**2+e.clientHeight**2)/2;const o=`${(e.clientWidth-s*2)/2}px`,l=`${(e.clientHeight-s*2)/2}px`,u=n.center?o:`${i-s}px`,c=n.center?l:`${r-s}px`;return{radius:s,scale:a,x:u,y:c,centerX:o,centerY:l}},gv={show(t,e){var f;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!((f=e==null?void 0:e._ripple)!=null&&f.enabled))return;const i=document.createElement("span"),r=document.createElement("span");i.appendChild(r),i.className="v-ripple__container",n.class&&(i.className+=` ${n.class}`);const{radius:s,scale:a,x:o,y:l,centerX:u,centerY:c}=Rae(t,e,n),d=`${s*2}px`;r.className="v-ripple__animation",r.style.width=d,r.style.height=d,e.appendChild(i);const h=window.getComputedStyle(e);h&&h.position==="static"&&(e.style.position="relative",e.dataset.previousPosition="static"),r.classList.add("v-ripple__animation--enter"),r.classList.add("v-ripple__animation--visible"),$k(r,`translate(${o}, ${l}) scale3d(${a},${a},${a})`),r.dataset.activated=String(performance.now()),requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classList.remove("v-ripple__animation--enter"),r.classList.add("v-ripple__animation--in"),$k(r,`translate(${u}, ${c}) scale3d(1,1,1)`)})})},hide(t){var s;if(!((s=t==null?void 0:t._ripple)!=null&&s.enabled))return;const e=t.getElementsByClassName("v-ripple__animation");if(e.length===0)return;const n=e[e.length-1];if(n.dataset.isHiding)return;n.dataset.isHiding="true";const i=performance.now()-Number(n.dataset.activated),r=Math.max(250-i,0);setTimeout(()=>{n.classList.remove("v-ripple__animation--in"),n.classList.add("v-ripple__animation--out"),setTimeout(()=>{var o;t.getElementsByClassName("v-ripple__animation").length===1&&t.dataset.previousPosition&&(t.style.position=t.dataset.previousPosition,delete t.dataset.previousPosition),((o=n.parentNode)==null?void 0:o.parentNode)===t&&t.removeChild(n.parentNode)},300)},r)}};function Sq(t){return typeof t>"u"||!!t}function Df(t){const e={},n=t.currentTarget;if(!(!(n!=null&&n._ripple)||n._ripple.touched||t[UA])){if(t[UA]=!0,$A(t))n._ripple.touched=!0,n._ripple.isTouch=!0;else if(n._ripple.isTouch)return;if(e.center=n._ripple.centered||vq(t),n._ripple.class&&(e.class=n._ripple.class),$A(t)){if(n._ripple.showTimerCommit)return;n._ripple.showTimerCommit=()=>{gv.show(t,n,e)},n._ripple.showTimer=window.setTimeout(()=>{var i;(i=n==null?void 0:n._ripple)!=null&&i.showTimerCommit&&(n._ripple.showTimerCommit(),n._ripple.showTimerCommit=null)},wae)}else gv.show(t,n,e)}}function Gk(t){t[UA]=!0}function is(t){const e=t.currentTarget;if(e!=null&&e._ripple){if(window.clearTimeout(e._ripple.showTimer),t.type==="touchend"&&e._ripple.showTimerCommit){e._ripple.showTimerCommit(),e._ripple.showTimerCommit=null,e._ripple.showTimer=window.setTimeout(()=>{is(t)});return}window.setTimeout(()=>{e._ripple&&(e._ripple.touched=!1)}),gv.hide(e)}}function bq(t){const e=t.currentTarget;e!=null&&e._ripple&&(e._ripple.showTimerCommit&&(e._ripple.showTimerCommit=null),window.clearTimeout(e._ripple.showTimer))}let kf=!1;function Eq(t){!kf&&(t.keyCode===N1.enter||t.keyCode===N1.space)&&(kf=!0,Df(t))}function yq(t){kf=!1,is(t)}function Cq(t){kf&&(kf=!1,is(t))}function Tq(t,e,n){const{value:i,modifiers:r}=e,s=Sq(i);if(s||gv.hide(t),t._ripple=t._ripple??{},t._ripple.enabled=s,t._ripple.centered=r.center,t._ripple.circle=r.circle,W3(i)&&i.class&&(t._ripple.class=i.class),s&&!n){if(r.stop){t.addEventListener("touchstart",Gk,{passive:!0}),t.addEventListener("mousedown",Gk);return}t.addEventListener("touchstart",Df,{passive:!0}),t.addEventListener("touchend",is,{passive:!0}),t.addEventListener("touchmove",bq,{passive:!0}),t.addEventListener("touchcancel",is),t.addEventListener("mousedown",Df),t.addEventListener("mouseup",is),t.addEventListener("mouseleave",is),t.addEventListener("keydown",Eq),t.addEventListener("keyup",yq),t.addEventListener("blur",Cq),t.addEventListener("dragstart",is,{passive:!0})}else!s&&n&&wq(t)}function wq(t){t.removeEventListener("mousedown",Df),t.removeEventListener("touchstart",Df),t.removeEventListener("touchend",is),t.removeEventListener("touchmove",bq),t.removeEventListener("touchcancel",is),t.removeEventListener("mouseup",is),t.removeEventListener("mouseleave",is),t.removeEventListener("keydown",Eq),t.removeEventListener("keyup",yq),t.removeEventListener("dragstart",is),t.removeEventListener("blur",Cq)}function Aae(t,e){Tq(t,e,!1)}function Oae(t){delete t._ripple,wq(t)}function Iae(t,e){if(e.value===e.oldValue)return;const n=Sq(e.oldValue);Tq(t,e,n)}const Dp={mounted:Aae,unmounted:Oae,updated:Iae},Nae=Ue({active:{type:Boolean,default:void 0},activeColor:String,baseColor:String,symbol:{type:null,default:mq},flat:Boolean,icon:[Boolean,String,Function,Object],prependIcon:on,appendIcon:on,block:Boolean,readonly:Boolean,slim:Boolean,stacked:Boolean,ripple:{type:[Boolean,Object],default:!0},text:String,...bu(),...jt(),...ro(),...Ha(),...yu(),...fq(),...wN(),...ZS(),...LN(),...no(),...rb(),...Np(),...Ri({tag:"button"}),...$i(),...za({variant:"elevated"})},"VBtn"),Sn=vt()({name:"VBtn",props:Nae(),emits:{"group:selected":t=>!0},setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{borderClasses:s}=Eu(t),{densityClasses:a}=Qo(t),{dimensionStyles:o}=Va(t),{elevationClasses:l}=Cu(t),{loaderClasses:u}=RN(t),{locationStyles:c}=JS(t),{positionClasses:d}=PN(t),{roundedClasses:h}=io(t),{sizeClasses:f,sizeStyles:S}=xp(t),_=pq(t,t.symbol,!1),p=ib(t,n),v=te(()=>{var I;return t.active!==void 0?t.active:p.isLink.value?(I=p.isActive)==null?void 0:I.value:_==null?void 0:_.isSelected.value}),m=te(()=>v.value?t.activeColor??t.color:t.color),g=te(()=>{var A,x;return{color:(_==null?void 0:_.isSelected.value)&&(!p.isLink.value||((A=p.isActive)==null?void 0:A.value))||!_||((x=p.isActive)==null?void 0:x.value)?m.value??t.baseColor:t.baseColor,variant:t.variant}}),{colorClasses:b,colorStyles:y,variantClasses:E}=eh(g),T=te(()=>(_==null?void 0:_.disabled.value)||t.disabled),C=te(()=>t.variant==="elevated"&&!(t.disabled||t.flat||t.border)),w=te(()=>{if(!(t.value===void 0||typeof t.value=="symbol"))return Object(t.value)===t.value?JSON.stringify(t.value,null,0):t.value});function R(I){var A;T.value||p.isLink.value&&(I.metaKey||I.ctrlKey||I.shiftKey||I.button!==0||n.target==="_blank")||((A=p.navigate)==null||A.call(p,I),_==null||_.toggle())}return Tae(p,_==null?void 0:_.select),Ft(()=>{const I=p.isLink.value?"a":t.tag,A=!!(t.prependIcon||i.prepend),x=!!(t.appendIcon||i.append),O=!!(t.icon&&t.icon!==!0);return Ar(W(I,rt({type:I==="a"?void 0:"button",class:["v-btn",_==null?void 0:_.selectedClass.value,{"v-btn--active":v.value,"v-btn--block":t.block,"v-btn--disabled":T.value,"v-btn--elevated":C.value,"v-btn--flat":t.flat,"v-btn--icon":!!t.icon,"v-btn--loading":t.loading,"v-btn--readonly":t.readonly,"v-btn--slim":t.slim,"v-btn--stacked":t.stacked},r.value,s.value,b.value,a.value,l.value,u.value,d.value,h.value,f.value,E.value,t.class],style:[y.value,o.value,c.value,S.value,t.style],"aria-busy":t.loading?!0:void 0,disabled:T.value||void 0,tabindex:t.loading||t.readonly?-1:void 0,onClick:R,value:w.value},p.linkProps),{default:()=>{var D;return[Jd(!0,"v-btn"),!t.icon&&A&&W("span",{key:"prepend",class:"v-btn__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!t.prependIcon,defaults:{VIcon:{icon:t.prependIcon}}},i.prepend):W(Ot,{key:"prepend-icon",icon:t.prependIcon},null)]),W("span",{class:"v-btn__content","data-no-activator":""},[!i.default&&O?W(Ot,{key:"content-icon",icon:t.icon},null):W(pi,{key:"content-defaults",disabled:!O,defaults:{VIcon:{icon:t.icon}}},{default:()=>{var L;return[((L=i.default)==null?void 0:L.call(i))??t.text]}})]),!t.icon&&x&&W("span",{key:"append",class:"v-btn__append"},[i.append?W(pi,{key:"append-defaults",disabled:!t.appendIcon,defaults:{VIcon:{icon:t.appendIcon}}},i.append):W(Ot,{key:"append-icon",icon:t.appendIcon},null)]),!!t.loading&&W("span",{key:"loader",class:"v-btn__loader"},[((D=i.loader)==null?void 0:D.call(i))??W(gq,{color:typeof t.loading=="boolean"?void 0:t.loading,indeterminate:!0,width:"2"},null)])]}}),[[Dp,!T.value&&t.ripple,"",{center:!!t.icon}]])}),{group:_}}}),xae=["success","info","warning","error"],Dae=Ue({border:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["top","end","bottom","start"].includes(t)},borderColor:String,closable:Boolean,closeIcon:{type:on,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:t=>xae.includes(t)},...jt(),...ro(),...Ha(),...yu(),...ZS(),...LN(),...no(),...Ri(),...$i(),...za({variant:"flat"})},"VAlert"),kae=vt()({name:"VAlert",props:Dae(),emits:{"click:close":t=>!0,"update:modelValue":t=>!0},setup(t,e){let{emit:n,slots:i}=e;const r=Fn(t,"modelValue"),s=te(()=>{if(t.icon!==!1)return t.type?t.icon??`$${t.type}`:t.icon}),a=te(()=>({color:t.color??t.type,variant:t.variant})),{themeClasses:o}=cr(t),{colorClasses:l,colorStyles:u,variantClasses:c}=eh(a),{densityClasses:d}=Qo(t),{dimensionStyles:h}=Va(t),{elevationClasses:f}=Cu(t),{locationStyles:S}=JS(t),{positionClasses:_}=PN(t),{roundedClasses:p}=io(t),{textColorClasses:v,textColorStyles:m}=Xs(Ve(t,"borderColor")),{t:g}=Ip(),b=te(()=>({"aria-label":g(t.closeLabel),onClick(y){r.value=!1,n("click:close",y)}}));return()=>{const y=!!(i.prepend||s.value),E=!!(i.title||t.title),T=!!(i.close||t.closable);return r.value&&W(t.tag,{class:["v-alert",t.border&&{"v-alert--border":!!t.border,[`v-alert--border-${t.border===!0?"start":t.border}`]:!0},{"v-alert--prominent":t.prominent},o.value,l.value,d.value,f.value,_.value,p.value,c.value,t.class],style:[u.value,h.value,S.value,t.style],role:"alert"},{default:()=>{var C,w;return[Jd(!1,"v-alert"),t.border&&W("div",{key:"border",class:["v-alert__border",v.value],style:m.value},null),y&&W("div",{key:"prepend",class:"v-alert__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!s.value,defaults:{VIcon:{density:t.density,icon:s.value,size:t.prominent?44:28}}},i.prepend):W(Ot,{key:"prepend-icon",density:t.density,icon:s.value,size:t.prominent?44:28},null)]),W("div",{class:"v-alert__content"},[E&&W(pae,{key:"title"},{default:()=>{var R;return[((R=i.title)==null?void 0:R.call(i))??t.title]}}),((C=i.text)==null?void 0:C.call(i))??t.text,(w=i.default)==null?void 0:w.call(i)]),i.append&&W("div",{key:"append",class:"v-alert__append"},[i.append()]),T&&W("div",{key:"close",class:"v-alert__close"},[i.close?W(pi,{key:"close-defaults",defaults:{VBtn:{icon:t.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var R;return[(R=i.close)==null?void 0:R.call(i,{props:b.value})]}}):W(Sn,rt({key:"close-btn",icon:t.closeIcon,size:"x-small",variant:"text"},b.value),null)])]}})}}}),zo=vt()({name:"VCardActions",props:jt(),setup(t,e){let{slots:n}=e;return jd({VBtn:{slim:!0,variant:"text"}}),Ft(()=>{var i;return W("div",{class:["v-card-actions",t.class],style:t.style},[(i=n.default)==null?void 0:i.call(n)])}),{}}}),Mae=Ue({opacity:[Number,String],...jt(),...Ri()},"VCardSubtitle"),Rq=vt()({name:"VCardSubtitle",props:Mae(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-card-subtitle",t.class],style:[{"--v-card-subtitle-opacity":t.opacity},t.style]},n)),{}}}),BN=WS("v-card-title");function Lae(t){return{aspectStyles:te(()=>{const e=Number(t.aspectRatio);return e?{paddingBottom:String(1/e*100)+"%"}:void 0})}}const Aq=Ue({aspectRatio:[String,Number],contentClass:null,inline:Boolean,...jt(),...Ha()},"VResponsive"),Hk=vt()({name:"VResponsive",props:Aq(),setup(t,e){let{slots:n}=e;const{aspectStyles:i}=Lae(t),{dimensionStyles:r}=Va(t);return Ft(()=>{var s;return W("div",{class:["v-responsive",{"v-responsive--inline":t.inline},t.class],style:[r.value,t.style]},[W("div",{class:"v-responsive__sizer",style:i.value},null),(s=n.additional)==null?void 0:s.call(n),n.default&&W("div",{class:["v-responsive__content",t.contentClass]},[n.default()])])}),{}}}),Pae=Ue({absolute:Boolean,alt:String,cover:Boolean,color:String,draggable:{type:[Boolean,String],default:void 0},eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:()=>({root:void 0,rootMargin:void 0,threshold:void 0})},sizes:String,src:{type:[String,Object],default:""},crossorigin:String,referrerpolicy:String,srcset:String,position:String,...Aq(),...jt(),...no(),...Zd()},"VImg"),Oq=vt()({name:"VImg",directives:{intersect:NN},props:Pae(),emits:{loadstart:t=>!0,load:t=>!0,error:t=>!0},setup(t,e){let{emit:n,slots:i}=e;const{backgroundColorClasses:r,backgroundColorStyles:s}=Il(Ve(t,"color")),{roundedClasses:a}=io(t),o=Li("VImg"),l=ut(""),u=ve(),c=ut(t.eager?"loading":"idle"),d=ut(),h=ut(),f=te(()=>t.src&&typeof t.src=="object"?{src:t.src.src,srcset:t.srcset||t.src.srcset,lazySrc:t.lazySrc||t.src.lazySrc,aspect:Number(t.aspectRatio||t.src.aspect||0)}:{src:t.src,srcset:t.srcset,lazySrc:t.lazySrc,aspect:Number(t.aspectRatio||0)}),S=te(()=>f.value.aspect||d.value/h.value||0);Ie(()=>t.src,()=>{_(c.value!=="idle")}),Ie(S,(A,x)=>{!A&&x&&u.value&&b(u.value)}),vu(()=>_());function _(A){if(!(t.eager&&A)&&!(sN&&!A&&!t.eager)){if(c.value="loading",f.value.lazySrc){const x=new Image;x.src=f.value.lazySrc,b(x,null)}f.value.src&&$t(()=>{var x;n("loadstart",((x=u.value)==null?void 0:x.currentSrc)||f.value.src),setTimeout(()=>{var O;if(!o.isUnmounted)if((O=u.value)!=null&&O.complete){if(u.value.naturalWidth||v(),c.value==="error")return;S.value||b(u.value,null),c.value==="loading"&&p()}else S.value||b(u.value),m()})})}}function p(){var A;o.isUnmounted||(m(),b(u.value),c.value="loaded",n("load",((A=u.value)==null?void 0:A.currentSrc)||f.value.src))}function v(){var A;o.isUnmounted||(c.value="error",n("error",((A=u.value)==null?void 0:A.currentSrc)||f.value.src))}function m(){const A=u.value;A&&(l.value=A.currentSrc||A.src)}let g=-1;Yi(()=>{clearTimeout(g)});function b(A){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;const O=()=>{if(clearTimeout(g),o.isUnmounted)return;const{naturalHeight:D,naturalWidth:L}=A;D||L?(d.value=L,h.value=D):!A.complete&&c.value==="loading"&&x!=null?g=window.setTimeout(O,x):(A.currentSrc.endsWith(".svg")||A.currentSrc.startsWith("data:image/svg+xml"))&&(d.value=1,h.value=1)};O()}const y=te(()=>({"v-img__img--cover":t.cover,"v-img__img--contain":!t.cover})),E=()=>{var O;if(!f.value.src||c.value==="idle")return null;const A=W("img",{class:["v-img__img",y.value],style:{objectPosition:t.position},crossorigin:t.crossorigin,src:f.value.src,srcset:f.value.srcset,alt:t.alt,referrerpolicy:t.referrerpolicy,draggable:t.draggable,sizes:t.sizes,ref:u,onLoad:p,onError:v},null),x=(O=i.sources)==null?void 0:O.call(i);return W(bl,{transition:t.transition,appear:!0},{default:()=>[Ar(x?W("picture",{class:"v-img__picture"},[x,A]):A,[[Wd,c.value==="loaded"]])]})},T=()=>W(bl,{transition:t.transition},{default:()=>[f.value.lazySrc&&c.value!=="loaded"&&W("img",{class:["v-img__img","v-img__img--preload",y.value],style:{objectPosition:t.position},crossorigin:t.crossorigin,src:f.value.lazySrc,alt:t.alt,referrerpolicy:t.referrerpolicy,draggable:t.draggable},null)]}),C=()=>i.placeholder?W(bl,{transition:t.transition,appear:!0},{default:()=>[(c.value==="loading"||c.value==="error"&&!i.error)&&W("div",{class:"v-img__placeholder"},[i.placeholder()])]}):null,w=()=>i.error?W(bl,{transition:t.transition,appear:!0},{default:()=>[c.value==="error"&&W("div",{class:"v-img__error"},[i.error()])]}):null,R=()=>t.gradient?W("div",{class:"v-img__gradient",style:{backgroundImage:`linear-gradient(${t.gradient})`}},null):null,I=ut(!1);{const A=Ie(S,x=>{x&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{I.value=!0})}),A())})}return Ft(()=>{const A=Hk.filterProps(t);return Ar(W(Hk,rt({class:["v-img",{"v-img--absolute":t.absolute,"v-img--booting":!I.value},r.value,a.value,t.class],style:[{width:Ht(t.width==="auto"?d.value:t.width)},s.value,t.style]},A,{aspectRatio:S.value,"aria-label":t.alt,role:t.alt?"img":void 0}),{additional:()=>W(He,null,[W(E,null,null),W(T,null,null),W(R,null,null),W(C,null,null),W(w,null,null)]),default:i.default}),[[Jl("intersect"),{handler:_,options:t.options},null,{once:!0}]])}),{currentSrc:l,image:u,state:c,naturalWidth:d,naturalHeight:h}}}),Bae=Ue({start:Boolean,end:Boolean,icon:on,image:String,text:String,...bu(),...jt(),...ro(),...no(),...Np(),...Ri(),...$i(),...za({variant:"flat"})},"VAvatar"),Ll=vt()({name:"VAvatar",props:Bae(),setup(t,e){let{slots:n}=e;const{themeClasses:i}=cr(t),{borderClasses:r}=Eu(t),{colorClasses:s,colorStyles:a,variantClasses:o}=eh(t),{densityClasses:l}=Qo(t),{roundedClasses:u}=io(t),{sizeClasses:c,sizeStyles:d}=xp(t);return Ft(()=>W(t.tag,{class:["v-avatar",{"v-avatar--start":t.start,"v-avatar--end":t.end},i.value,r.value,s.value,l.value,u.value,c.value,o.value,t.class],style:[a.value,d.value,t.style]},{default:()=>[n.default?W(pi,{key:"content-defaults",defaults:{VImg:{cover:!0,src:t.image},VIcon:{icon:t.icon}}},{default:()=>[n.default()]}):t.image?W(Oq,{key:"image",src:t.image,alt:"",cover:!0},null):t.icon?W(Ot,{key:"icon",icon:t.icon},null):t.text,Jd(!1,"v-avatar")]})),{}}}),Fae=Ue({appendAvatar:String,appendIcon:on,prependAvatar:String,prependIcon:on,subtitle:[String,Number],title:[String,Number],...jt(),...ro()},"VCardItem"),Uae=vt()({name:"VCardItem",props:Fae(),setup(t,e){let{slots:n}=e;return Ft(()=>{var u;const i=!!(t.prependAvatar||t.prependIcon),r=!!(i||n.prepend),s=!!(t.appendAvatar||t.appendIcon),a=!!(s||n.append),o=!!(t.title!=null||n.title),l=!!(t.subtitle!=null||n.subtitle);return W("div",{class:["v-card-item",t.class],style:t.style},[r&&W("div",{key:"prepend",class:"v-card-item__prepend"},[n.prepend?W(pi,{key:"prepend-defaults",disabled:!i,defaults:{VAvatar:{density:t.density,image:t.prependAvatar},VIcon:{density:t.density,icon:t.prependIcon}}},n.prepend):W(He,null,[t.prependAvatar&&W(Ll,{key:"prepend-avatar",density:t.density,image:t.prependAvatar},null),t.prependIcon&&W(Ot,{key:"prepend-icon",density:t.density,icon:t.prependIcon},null)])]),W("div",{class:"v-card-item__content"},[o&&W(BN,{key:"title"},{default:()=>{var c;return[((c=n.title)==null?void 0:c.call(n))??t.title]}}),l&&W(Rq,{key:"subtitle"},{default:()=>{var c;return[((c=n.subtitle)==null?void 0:c.call(n))??t.subtitle]}}),(u=n.default)==null?void 0:u.call(n)]),a&&W("div",{key:"append",class:"v-card-item__append"},[n.append?W(pi,{key:"append-defaults",disabled:!s,defaults:{VAvatar:{density:t.density,image:t.appendAvatar},VIcon:{density:t.density,icon:t.appendIcon}}},n.append):W(He,null,[t.appendIcon&&W(Ot,{key:"append-icon",density:t.density,icon:t.appendIcon},null),t.appendAvatar&&W(Ll,{key:"append-avatar",density:t.density,image:t.appendAvatar},null)])])])}),{}}}),$ae=Ue({opacity:[Number,String],...jt(),...Ri()},"VCardText"),Po=vt()({name:"VCardText",props:$ae(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-card-text",t.class],style:[{"--v-card-text-opacity":t.opacity},t.style]},n)),{}}}),Gae=Ue({appendAvatar:String,appendIcon:on,disabled:Boolean,flat:Boolean,hover:Boolean,image:String,link:{type:Boolean,default:void 0},prependAvatar:String,prependIcon:on,ripple:{type:[Boolean,Object],default:!0},subtitle:[String,Number],text:[String,Number],title:[String,Number],...bu(),...jt(),...ro(),...Ha(),...yu(),...wN(),...ZS(),...LN(),...no(),...rb(),...Ri(),...$i(),...za({variant:"elevated"})},"VCard"),Is=vt()({name:"VCard",directives:{Ripple:Dp},props:Gae(),setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{borderClasses:s}=Eu(t),{colorClasses:a,colorStyles:o,variantClasses:l}=eh(t),{densityClasses:u}=Qo(t),{dimensionStyles:c}=Va(t),{elevationClasses:d}=Cu(t),{loaderClasses:h}=RN(t),{locationStyles:f}=JS(t),{positionClasses:S}=PN(t),{roundedClasses:_}=io(t),p=ib(t,n),v=te(()=>t.link!==!1&&p.isLink.value),m=te(()=>!t.disabled&&t.link!==!1&&(t.link||p.isClickable.value));return Ft(()=>{const g=v.value?"a":t.tag,b=!!(i.title||t.title!=null),y=!!(i.subtitle||t.subtitle!=null),E=b||y,T=!!(i.append||t.appendAvatar||t.appendIcon),C=!!(i.prepend||t.prependAvatar||t.prependIcon),w=!!(i.image||t.image),R=E||C||T,I=!!(i.text||t.text!=null);return Ar(W(g,rt({class:["v-card",{"v-card--disabled":t.disabled,"v-card--flat":t.flat,"v-card--hover":t.hover&&!(t.disabled||t.flat),"v-card--link":m.value},r.value,s.value,a.value,u.value,d.value,h.value,S.value,_.value,l.value,t.class],style:[o.value,c.value,f.value,t.style],onClick:m.value&&p.navigate,tabindex:t.disabled?-1:void 0},p.linkProps),{default:()=>{var A;return[w&&W("div",{key:"image",class:"v-card__image"},[i.image?W(pi,{key:"image-defaults",disabled:!t.image,defaults:{VImg:{cover:!0,src:t.image}}},i.image):W(Oq,{key:"image-img",cover:!0,src:t.image},null)]),W(sq,{name:"v-card",active:!!t.loading,color:typeof t.loading=="boolean"?void 0:t.loading},{default:i.loader}),R&&W(Uae,{key:"item",prependAvatar:t.prependAvatar,prependIcon:t.prependIcon,title:t.title,subtitle:t.subtitle,appendAvatar:t.appendAvatar,appendIcon:t.appendIcon},{default:i.item,prepend:i.prepend,title:i.title,subtitle:i.subtitle,append:i.append}),I&&W(Po,{key:"text"},{default:()=>{var x;return[((x=i.text)==null?void 0:x.call(i))??t.text]}}),(A=i.default)==null?void 0:A.call(i),i.actions&&W(zo,null,{default:i.actions}),Jd(m.value,"v-card")]}}),[[Jl("ripple"),m.value&&t.ripple]])}),{}}});function kE(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Hae(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Vk(t,e){if(t.side==="top"||t.side==="bottom"){const{side:n,align:i}=t,r=i==="left"?0:i==="center"?e.width/2:i==="right"?e.width:i,s=n==="top"?0:n==="bottom"?e.height:n;return kE({x:r,y:s},e)}else if(t.side==="left"||t.side==="right"){const{side:n,align:i}=t,r=n==="left"?0:n==="right"?e.width:n,s=i==="top"?0:i==="center"?e.height/2:i==="bottom"?e.height:i;return kE({x:r,y:s},e)}return kE({x:e.width/2,y:e.height/2},e)}const Iq={static:qae,connected:Wae},Vae=Ue({locationStrategy:{type:[String,Function],default:"static",validator:t=>typeof t=="function"||t in Iq},location:{type:String,default:"bottom"},origin:{type:String,default:"auto"},offset:[Number,String,Array]},"VOverlay-location-strategies");function zae(t,e){const n=ve({}),i=ve();dn&&nu(()=>!!(e.isActive.value&&t.locationStrategy),s=>{var a,o;Ie(()=>t.locationStrategy,s),Xn(()=>{window.removeEventListener("resize",r),i.value=void 0}),window.addEventListener("resize",r,{passive:!0}),typeof t.locationStrategy=="function"?i.value=(a=t.locationStrategy(e,t,n))==null?void 0:a.updateLocation:i.value=(o=Iq[t.locationStrategy](e,t,n))==null?void 0:o.updateLocation});function r(s){var a;(a=i.value)==null||a.call(i,s)}return{contentStyles:n,updateLocation:i}}function qae(){}function Yae(t,e){const n=uN(t);return e?n.x+=parseFloat(t.style.right||0):n.x-=parseFloat(t.style.left||0),n.y-=parseFloat(t.style.top||0),n}function Wae(t,e,n){(Array.isArray(t.target.value)||Sne(t.target.value))&&Object.assign(n.value,{position:"fixed",top:0,[t.isRtl.value?"right":"left"]:0});const{preferredAnchor:r,preferredOrigin:s}=aN(()=>{const S=TA(e.location,t.isRtl.value),_=e.origin==="overlap"?S:e.origin==="auto"?SE(S):TA(e.origin,t.isRtl.value);return S.side===_.side&&S.align===bE(_).align?{preferredAnchor:P1(S),preferredOrigin:P1(_)}:{preferredAnchor:S,preferredOrigin:_}}),[a,o,l,u]=["minWidth","minHeight","maxWidth","maxHeight"].map(S=>te(()=>{const _=parseFloat(e[S]);return isNaN(_)?1/0:_})),c=te(()=>{if(Array.isArray(e.offset))return e.offset;if(typeof e.offset=="string"){const S=e.offset.split(" ").map(parseFloat);return S.length<2&&S.push(0),S}return typeof e.offset=="number"?[e.offset,0]:[0,0]});let d=!1;const h=new ResizeObserver(()=>{d&&f()});Ie([t.target,t.contentEl],(S,_)=>{let[p,v]=S,[m,g]=_;m&&!Array.isArray(m)&&h.unobserve(m),p&&!Array.isArray(p)&&h.observe(p),g&&h.unobserve(g),v&&h.observe(v)},{immediate:!0}),Xn(()=>{h.disconnect()});function f(){if(d=!1,requestAnimationFrame(()=>d=!0),!t.target.value||!t.contentEl.value)return;const S=tz(t.target.value),_=Yae(t.contentEl.value,t.isRtl.value),p=ov(t.contentEl.value),v=12;p.length||(p.push(document.documentElement),t.contentEl.value.style.top&&t.contentEl.value.style.left||(_.x-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x")||0),_.y-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y")||0)));const m=p.reduce((I,A)=>{const x=A.getBoundingClientRect(),O=new Hc({x:A===document.documentElement?0:x.x,y:A===document.documentElement?0:x.y,width:A.clientWidth,height:A.clientHeight});return I?new Hc({x:Math.max(I.left,O.left),y:Math.max(I.top,O.top),width:Math.min(I.right,O.right)-Math.max(I.left,O.left),height:Math.min(I.bottom,O.bottom)-Math.max(I.top,O.top)}):O},void 0);m.x+=v,m.y+=v,m.width-=v*2,m.height-=v*2;let g={anchor:r.value,origin:s.value};function b(I){const A=new Hc(_),x=Vk(I.anchor,S),O=Vk(I.origin,A);let{x:D,y:L}=Hae(x,O);switch(I.anchor.side){case"top":L-=c.value[0];break;case"bottom":L+=c.value[0];break;case"left":D-=c.value[0];break;case"right":D+=c.value[0];break}switch(I.anchor.align){case"top":L-=c.value[1];break;case"bottom":L+=c.value[1];break;case"left":D-=c.value[1];break;case"right":D+=c.value[1];break}return A.x+=D,A.y+=L,A.width=Math.min(A.width,l.value),A.height=Math.min(A.height,u.value),{overflows:F1(A,m),x:D,y:L}}let y=0,E=0;const T={x:0,y:0},C={x:!1,y:!1};let w=-1;for(;!(w++>10);){const{x:I,y:A,overflows:x}=b(g);y+=I,E+=A,_.x+=I,_.y+=A;{const O=B1(g.anchor),D=x.x.before||x.x.after,L=x.y.before||x.y.after;let q=!1;if(["x","y"].forEach(G=>{if(G==="x"&&D&&!C.x||G==="y"&&L&&!C.y){const M={anchor:{...g.anchor},origin:{...g.origin}},P=G==="x"?O==="y"?bE:SE:O==="y"?SE:bE;M.anchor=P(M.anchor),M.origin=P(M.origin);const{overflows:N}=b(M);(N[G].before<=x[G].before&&N[G].after<=x[G].after||N[G].before+N[G].after<(x[G].before+x[G].after)/2)&&(g=M,q=C[G]=!0)}}),q)continue}x.x.before&&(y+=x.x.before,_.x+=x.x.before),x.x.after&&(y-=x.x.after,_.x-=x.x.after),x.y.before&&(E+=x.y.before,_.y+=x.y.before),x.y.after&&(E-=x.y.after,_.y-=x.y.after);{const O=F1(_,m);T.x=m.width-O.x.before-O.x.after,T.y=m.height-O.y.before-O.y.after,y+=O.x.before,_.x+=O.x.before,E+=O.y.before,_.y+=O.y.before}break}const R=B1(g.anchor);return Object.assign(n.value,{"--v-overlay-anchor-origin":`${g.anchor.side} ${g.anchor.align}`,transformOrigin:`${g.origin.side} ${g.origin.align}`,top:Ht(ME(E)),left:t.isRtl.value?void 0:Ht(ME(y)),right:t.isRtl.value?Ht(ME(-y)):void 0,minWidth:Ht(R==="y"?Math.min(a.value,S.width):a.value),maxWidth:Ht(zk(Lo(T.x,a.value===1/0?0:a.value,l.value))),maxHeight:Ht(zk(Lo(T.y,o.value===1/0?0:o.value,u.value)))}),{available:T,contentBox:_}}return Ie(()=>[r.value,s.value,e.offset,e.minWidth,e.minHeight,e.maxWidth,e.maxHeight],()=>f()),$t(()=>{const S=f();if(!S)return;const{available:_,contentBox:p}=S;p.height>_.y&&requestAnimationFrame(()=>{f(),requestAnimationFrame(()=>{f()})})}),{updateLocation:f}}function ME(t){return Math.round(t*devicePixelRatio)/devicePixelRatio}function zk(t){return Math.ceil(t*devicePixelRatio)/devicePixelRatio}let GA=!0;const vv=[];function Kae(t){!GA||vv.length?(vv.push(t),HA()):(GA=!1,t(),HA())}let qk=-1;function HA(){cancelAnimationFrame(qk),qk=requestAnimationFrame(()=>{const t=vv.shift();t&&t(),vv.length?HA():GA=!0})}const og={none:null,close:Xae,block:Zae,reposition:Jae},jae=Ue({scrollStrategy:{type:[String,Function],default:"block",validator:t=>typeof t=="function"||t in og}},"VOverlay-scroll-strategies");function Qae(t,e){if(!dn)return;let n;Wr(async()=>{n==null||n.stop(),e.isActive.value&&t.scrollStrategy&&(n=Ql(),await new Promise(i=>setTimeout(i)),n.active&&n.run(()=>{var i;typeof t.scrollStrategy=="function"?t.scrollStrategy(e,t,n):(i=og[t.scrollStrategy])==null||i.call(og,e,t,n)}))}),Xn(()=>{n==null||n.stop()})}function Xae(t){function e(n){t.isActive.value=!1}Nq(t.targetEl.value??t.contentEl.value,e)}function Zae(t,e){var a;const n=(a=t.root.value)==null?void 0:a.offsetParent,i=[...new Set([...ov(t.targetEl.value,e.contained?n:void 0),...ov(t.contentEl.value,e.contained?n:void 0)])].filter(o=>!o.classList.contains("v-overlay-scroll-blocked")),r=window.innerWidth-document.documentElement.offsetWidth,s=(o=>fN(o)&&o)(n||document.documentElement);s&&t.root.value.classList.add("v-overlay--scroll-blocked"),i.forEach((o,l)=>{o.style.setProperty("--v-body-scroll-x",Ht(-o.scrollLeft)),o.style.setProperty("--v-body-scroll-y",Ht(-o.scrollTop)),o!==document.documentElement&&o.style.setProperty("--v-scrollbar-offset",Ht(r)),o.classList.add("v-overlay-scroll-blocked")}),Xn(()=>{i.forEach((o,l)=>{const u=parseFloat(o.style.getPropertyValue("--v-body-scroll-x")),c=parseFloat(o.style.getPropertyValue("--v-body-scroll-y")),d=o.style.scrollBehavior;o.style.scrollBehavior="auto",o.style.removeProperty("--v-body-scroll-x"),o.style.removeProperty("--v-body-scroll-y"),o.style.removeProperty("--v-scrollbar-offset"),o.classList.remove("v-overlay-scroll-blocked"),o.scrollLeft=-u,o.scrollTop=-c,o.style.scrollBehavior=d}),s&&t.root.value.classList.remove("v-overlay--scroll-blocked")})}function Jae(t,e,n){let i=!1,r=-1,s=-1;function a(o){Kae(()=>{var c,d;const l=performance.now();(d=(c=t.updateLocation).value)==null||d.call(c,o),i=(performance.now()-l)/(1e3/60)>2})}s=(typeof requestIdleCallback>"u"?o=>o():requestIdleCallback)(()=>{n.run(()=>{Nq(t.targetEl.value??t.contentEl.value,o=>{i?(cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{a(o)})})):a(o)})})}),Xn(()=>{typeof cancelIdleCallback<"u"&&cancelIdleCallback(s),cancelAnimationFrame(r)})}function Nq(t,e){const n=[document,...ov(t)];n.forEach(i=>{i.addEventListener("scroll",e,{passive:!0})}),Xn(()=>{n.forEach(i=>{i.removeEventListener("scroll",e)})})}const VA=Symbol.for("vuetify:v-menu"),ele=Ue({closeDelay:[Number,String],openDelay:[Number,String]},"delay");function tle(t,e){let n=()=>{};function i(a){n==null||n();const o=Number(a?t.openDelay:t.closeDelay);return new Promise(l=>{n=Bte(o,()=>{e==null||e(a),l(a)})})}function r(){return i(!0)}function s(){return i(!1)}return{clearDelay:n,runOpenDelay:r,runCloseDelay:s}}const nle=Ue({target:[String,Object],activator:[String,Object],activatorProps:{type:Object,default:()=>({})},openOnClick:{type:Boolean,default:void 0},openOnHover:Boolean,openOnFocus:{type:Boolean,default:void 0},closeOnContentClick:Boolean,...ele()},"VOverlay-activator");function ile(t,e){let{isActive:n,isTop:i,contentEl:r}=e;const s=Li("useActivator"),a=ve();let o=!1,l=!1,u=!0;const c=te(()=>t.openOnFocus||t.openOnFocus==null&&t.openOnHover),d=te(()=>t.openOnClick||t.openOnClick==null&&!t.openOnHover&&!c.value),{runOpenDelay:h,runCloseDelay:f}=tle(t,C=>{C===(t.openOnHover&&o||c.value&&l)&&!(t.openOnHover&&n.value&&!i.value)&&(n.value!==C&&(u=!0),n.value=C)}),S=ve(),_={onClick:C=>{C.stopPropagation(),a.value=C.currentTarget||C.target,n.value||(S.value=[C.clientX,C.clientY]),n.value=!n.value},onMouseenter:C=>{var w;(w=C.sourceCapabilities)!=null&&w.firesTouchEvents||(o=!0,a.value=C.currentTarget||C.target,h())},onMouseleave:C=>{o=!1,f()},onFocus:C=>{nv(C.target,":focus-visible")!==!1&&(l=!0,C.stopPropagation(),a.value=C.currentTarget||C.target,h())},onBlur:C=>{l=!1,C.stopPropagation(),f()}},p=te(()=>{const C={};return d.value&&(C.onClick=_.onClick),t.openOnHover&&(C.onMouseenter=_.onMouseenter,C.onMouseleave=_.onMouseleave),c.value&&(C.onFocus=_.onFocus,C.onBlur=_.onBlur),C}),v=te(()=>{const C={};if(t.openOnHover&&(C.onMouseenter=()=>{o=!0,h()},C.onMouseleave=()=>{o=!1,f()}),c.value&&(C.onFocusin=()=>{l=!0,h()},C.onFocusout=()=>{l=!1,f()}),t.closeOnContentClick){const w=an(VA,null);C.onClick=()=>{n.value=!1,w==null||w.closeParents()}}return C}),m=te(()=>{const C={};return t.openOnHover&&(C.onMouseenter=()=>{u&&(o=!0,u=!1,h())},C.onMouseleave=()=>{o=!1,f()}),C});Ie(i,C=>{var w;C&&(t.openOnHover&&!o&&(!c.value||!l)||c.value&&!l&&(!t.openOnHover||!o))&&!((w=r.value)!=null&&w.contains(document.activeElement))&&(n.value=!1)}),Ie(n,C=>{C||setTimeout(()=>{S.value=void 0})},{flush:"post"});const g=CA();Wr(()=>{g.value&&$t(()=>{a.value=g.el})});const b=CA(),y=te(()=>t.target==="cursor"&&S.value?S.value:b.value?b.el:xq(t.target,s)||a.value),E=te(()=>Array.isArray(y.value)?void 0:y.value);let T;return Ie(()=>!!t.activator,C=>{C&&dn?(T=Ql(),T.run(()=>{rle(t,s,{activatorEl:a,activatorEvents:p})})):T&&T.stop()},{flush:"post",immediate:!0}),Xn(()=>{T==null||T.stop()}),{activatorEl:a,activatorRef:g,target:y,targetEl:E,targetRef:b,activatorEvents:p,contentEvents:v,scrimEvents:m}}function rle(t,e,n){let{activatorEl:i,activatorEvents:r}=n;Ie(()=>t.activator,(l,u)=>{if(u&&l!==u){const c=o(u);c&&a(c)}l&&$t(()=>s())},{immediate:!0}),Ie(()=>t.activatorProps,()=>{s()}),Xn(()=>{a()});function s(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.activatorProps;l&&$te(l,rt(r.value,u))}function a(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.activatorProps;l&&Gte(l,rt(r.value,u))}function o(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.activator;const u=xq(l,e);return i.value=(u==null?void 0:u.nodeType)===Node.ELEMENT_NODE?u:void 0,i.value}}function xq(t,e){var i,r;if(!t)return;let n;if(t==="parent"){let s=(r=(i=e==null?void 0:e.proxy)==null?void 0:i.$el)==null?void 0:r.parentNode;for(;s!=null&&s.hasAttribute("data-no-activator");)s=s.parentNode;n=s}else typeof t=="string"?n=document.querySelector(t):"$el"in t?n=t.$el:n=t;return n}function sle(){if(!dn)return ut(!1);const{ssr:t}=mN();if(t){const e=ut(!1);return ai(()=>{e.value=!0}),e}else return ut(!0)}const ole=Ue({eager:Boolean},"lazy");function ale(t,e){const n=ut(!1),i=te(()=>n.value||t.eager||e.value);Ie(e,()=>n.value=!0);function r(){t.eager||(n.value=!1)}return{isBooted:n,hasContent:i,onAfterLeave:r}}function sb(){const e=Li("useScopeId").vnode.scopeId;return{scopeId:e?{[e]:""}:void 0}}const Yk=Symbol.for("vuetify:stack"),ph=$n([]);function lle(t,e,n){const i=Li("useStack"),r=!n,s=an(Yk,void 0),a=$n({activeChildren:new Set});Kn(Yk,a);const o=ut(+e.value);nu(t,()=>{var d;const c=(d=ph.at(-1))==null?void 0:d[1];o.value=c?c+10:+e.value,r&&ph.push([i.uid,o.value]),s==null||s.activeChildren.add(i.uid),Xn(()=>{if(r){const h=gt(ph).findIndex(f=>f[0]===i.uid);ph.splice(h,1)}s==null||s.activeChildren.delete(i.uid)})});const l=ut(!0);r&&Wr(()=>{var d;const c=((d=ph.at(-1))==null?void 0:d[0])===i.uid;setTimeout(()=>l.value=c)});const u=te(()=>!a.activeChildren.size);return{globalTop:qd(l),localTop:u,stackStyles:te(()=>({zIndex:o.value}))}}function cle(t){return{teleportTarget:te(()=>{const n=t();if(n===!0||!dn)return;const i=n===!1?document.body:typeof n=="string"?document.querySelector(n):n;if(i==null)return;let r=[...i.children].find(s=>s.matches(".v-overlay-container"));return r||(r=document.createElement("div"),r.className="v-overlay-container",i.appendChild(r)),r})}}function ule(){return!0}function Dq(t,e,n){if(!t||kq(t,n)===!1)return!1;const i=lz(e);if(typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&i.host===t.target)return!1;const r=(typeof n.value=="object"&&n.value.include||(()=>[]))();return r.push(e),!r.some(s=>s==null?void 0:s.contains(t.target))}function kq(t,e){return(typeof e.value=="object"&&e.value.closeConditional||ule)(t)}function dle(t,e,n){const i=typeof n.value=="function"?n.value:n.value.handler;t.shadowTarget=t.target,e._clickOutside.lastMousedownWasOutside&&Dq(t,e,n)&&setTimeout(()=>{kq(t,n)&&i&&i(t)},0)}function Wk(t,e){const n=lz(t);e(document),typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&e(n)}const hle={mounted(t,e){const n=r=>dle(r,t,e),i=r=>{t._clickOutside.lastMousedownWasOutside=Dq(r,t,e)};Wk(t,r=>{r.addEventListener("click",n,!0),r.addEventListener("mousedown",i,!0)}),t._clickOutside||(t._clickOutside={lastMousedownWasOutside:!1}),t._clickOutside[e.instance.$.uid]={onClick:n,onMousedown:i}},beforeUnmount(t,e){t._clickOutside&&(Wk(t,n=>{var s;if(!n||!((s=t._clickOutside)!=null&&s[e.instance.$.uid]))return;const{onClick:i,onMousedown:r}=t._clickOutside[e.instance.$.uid];n.removeEventListener("click",i,!0),n.removeEventListener("mousedown",r,!0)}),delete t._clickOutside[e.instance.$.uid])}};function fle(t){const{modelValue:e,color:n,...i}=t;return W(eu,{name:"fade-transition",appear:!0},{default:()=>[t.modelValue&&W("div",rt({class:["v-overlay__scrim",t.color.backgroundColorClasses.value],style:t.color.backgroundColorStyles.value},i),null)]})}const ob=Ue({absolute:Boolean,attach:[Boolean,String,Object],closeOnBack:{type:Boolean,default:!0},contained:Boolean,contentClass:null,contentProps:null,disabled:Boolean,opacity:[Number,String],noClickAnimation:Boolean,modelValue:Boolean,persistent:Boolean,scrim:{type:[Boolean,String],default:!0},zIndex:{type:[Number,String],default:2e3},...nle(),...jt(),...Ha(),...ole(),...Vae(),...jae(),...$i(),...Zd()},"VOverlay"),Pl=vt()({name:"VOverlay",directives:{ClickOutside:hle},inheritAttrs:!1,props:{_disableGlobalStack:Boolean,...ob()},emits:{"click:outside":t=>!0,"update:modelValue":t=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,e){let{slots:n,attrs:i,emit:r}=e;const s=Li("VOverlay"),a=ve(),o=ve(),l=ve(),u=Fn(t,"modelValue"),c=te({get:()=>u.value,set:X=>{X&&t.disabled||(u.value=X)}}),{themeClasses:d}=cr(t),{rtlClasses:h,isRtl:f}=ec(),{hasContent:S,onAfterLeave:_}=ale(t,c),p=Il(te(()=>typeof t.scrim=="string"?t.scrim:null)),{globalTop:v,localTop:m,stackStyles:g}=lle(c,Ve(t,"zIndex"),t._disableGlobalStack),{activatorEl:b,activatorRef:y,target:E,targetEl:T,targetRef:C,activatorEvents:w,contentEvents:R,scrimEvents:I}=ile(t,{isActive:c,isTop:m,contentEl:l}),{teleportTarget:A}=cle(()=>{var z,re,ne;const X=t.attach||t.contained;if(X)return X;const K=((z=b==null?void 0:b.value)==null?void 0:z.getRootNode())||((ne=(re=s.proxy)==null?void 0:re.$el)==null?void 0:ne.getRootNode());return K instanceof ShadowRoot?K:!1}),{dimensionStyles:x}=Va(t),O=sle(),{scopeId:D}=sb();Ie(()=>t.disabled,X=>{X&&(c.value=!1)});const{contentStyles:L,updateLocation:q}=zae(t,{isRtl:f,contentEl:l,target:E,isActive:c});Qae(t,{root:a,contentEl:l,targetEl:T,isActive:c,updateLocation:q});function G(X){r("click:outside",X),t.persistent?F():c.value=!1}function M(X){return c.value&&v.value&&(!t.scrim||X.target===o.value||X instanceof MouseEvent&&X.shadowTarget===o.value)}dn&&Ie(c,X=>{X?window.addEventListener("keydown",P):window.removeEventListener("keydown",P)},{immediate:!0}),Yi(()=>{dn&&window.removeEventListener("keydown",P)});function P(X){var K,z;X.key==="Escape"&&v.value&&(t.persistent?F():(c.value=!1,(K=l.value)!=null&&K.contains(document.activeElement)&&((z=b.value)==null||z.focus())))}const N=yae();nu(()=>t.closeOnBack,()=>{Cae(N,X=>{v.value&&c.value?(X(!1),t.persistent?F():c.value=!1):X()})});const U=ve();Ie(()=>c.value&&(t.absolute||t.contained)&&A.value==null,X=>{if(X){const K=cz(a.value);K&&K!==document.scrollingElement&&(U.value=K.scrollTop)}});function F(){t.noClickAnimation||l.value&&Qu(l.value,[{transformOrigin:"center"},{transform:"scale(1.03)"},{transformOrigin:"center"}],{duration:150,easing:sv})}function k(){r("afterEnter")}function H(){_(),r("afterLeave")}return Ft(()=>{var X;return W(He,null,[(X=n.activator)==null?void 0:X.call(n,{isActive:c.value,targetRef:C,props:rt({ref:y},w.value,t.activatorProps)}),O.value&&S.value&&W(hX,{disabled:!A.value,to:A.value},{default:()=>[W("div",rt({class:["v-overlay",{"v-overlay--absolute":t.absolute||t.contained,"v-overlay--active":c.value,"v-overlay--contained":t.contained},d.value,h.value,t.class],style:[g.value,{"--v-overlay-opacity":t.opacity,top:Ht(U.value)},t.style],ref:a},D,i),[W(fle,rt({color:p,modelValue:c.value&&!!t.scrim,ref:o},I.value),null),W(bl,{appear:!0,persisted:!0,transition:t.transition,target:E.value,onAfterEnter:k,onAfterLeave:H},{default:()=>{var K;return[Ar(W("div",rt({ref:l,class:["v-overlay__content",t.contentClass],style:[x.value,L.value]},R.value,t.contentProps),[(K=n.default)==null?void 0:K.call(n,{isActive:c})]),[[Wd,c.value],[Jl("click-outside"),{handler:G,closeConditional:M,include:()=>[b.value]}]])]}})])]})])}),{activatorEl:b,scrimEl:o,target:E,animateClick:F,contentEl:l,globalTop:v,localTop:m,updateLocation:q}}}),ple=Ue({fullscreen:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,...ob({origin:"center center",scrollStrategy:"block",transition:{component:TN},zIndex:2400})},"VDialog"),FN=vt()({name:"VDialog",props:ple(),emits:{"update:modelValue":t=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,e){let{emit:n,slots:i}=e;const r=Fn(t,"modelValue"),{scopeId:s}=sb(),a=ve();function o(c){var f,S;const d=c.relatedTarget,h=c.target;if(d!==h&&((f=a.value)!=null&&f.contentEl)&&((S=a.value)!=null&&S.globalTop)&&![document,a.value.contentEl].includes(h)&&!a.value.contentEl.contains(h)){const _=Of(a.value.contentEl);if(!_.length)return;const p=_[0],v=_[_.length-1];d===p?v.focus():p.focus()}}Yi(()=>{document.removeEventListener("focusin",o)}),dn&&Ie(()=>r.value&&t.retainFocus,c=>{c?document.addEventListener("focusin",o):document.removeEventListener("focusin",o)},{immediate:!0});function l(){var c;n("afterEnter"),(c=a.value)!=null&&c.contentEl&&!a.value.contentEl.contains(document.activeElement)&&a.value.contentEl.focus({preventScroll:!0})}function u(){n("afterLeave")}return Ie(r,async c=>{var d;c||(await $t(),(d=a.value.activatorEl)==null||d.focus({preventScroll:!0}))}),Ft(()=>{const c=Pl.filterProps(t),d=rt({"aria-haspopup":"dialog"},t.activatorProps),h=rt({tabindex:-1},t.contentProps);return W(Pl,rt({ref:a,class:["v-dialog",{"v-dialog--fullscreen":t.fullscreen,"v-dialog--scrollable":t.scrollable},t.class],style:t.style},c,{modelValue:r.value,"onUpdate:modelValue":f=>r.value=f,"aria-modal":"true",activatorProps:d,contentProps:h,height:t.fullscreen?void 0:t.height,width:t.fullscreen?void 0:t.width,maxHeight:t.fullscreen?void 0:t.maxHeight,maxWidth:t.fullscreen?void 0:t.maxWidth,role:"dialog",onAfterEnter:l,onAfterLeave:u},s),{activator:i.activator,default:function(){for(var f=arguments.length,S=new Array(f),_=0;_<f;_++)S[_]=arguments[_];return W(pi,{root:"VDialog"},{default:()=>{var p;return[(p=i.default)==null?void 0:p.call(i,...S)]}})}})}),tc({},a)}}),_le=Ue({...jt(),...joe()},"VForm"),mle=vt()({name:"VForm",props:_le(),emits:{"update:modelValue":t=>!0,submit:t=>!0},setup(t,e){let{slots:n,emit:i}=e;const r=Qoe(t),s=ve();function a(l){l.preventDefault(),r.reset()}function o(l){const u=l,c=r.validate();u.then=c.then.bind(c),u.catch=c.catch.bind(c),u.finally=c.finally.bind(c),i("submit",u),u.defaultPrevented||c.then(d=>{var f;let{valid:h}=d;h&&((f=s.value)==null||f.submit())}),u.preventDefault()}return Ft(()=>{var l;return W("form",{ref:s,class:["v-form",t.class],style:t.style,novalidate:!0,onReset:a,onSubmit:o},[(l=n.default)==null?void 0:l.call(n,r)])}),tc(r,s)}}),Mq=QS.reduce((t,e)=>(t[e]={type:[Boolean,String,Number],default:!1},t),{}),Lq=QS.reduce((t,e)=>{const n="offset"+Fa(e);return t[n]={type:[String,Number],default:null},t},{}),Pq=QS.reduce((t,e)=>{const n="order"+Fa(e);return t[n]={type:[String,Number],default:null},t},{}),Kk={col:Object.keys(Mq),offset:Object.keys(Lq),order:Object.keys(Pq)};function gle(t,e,n){let i=t;if(!(n==null||n===!1)){if(e){const r=e.replace(t,"");i+=`-${r}`}return t==="col"&&(i="v-"+i),t==="col"&&(n===""||n===!0)||(i+=`-${n}`),i.toLowerCase()}}const vle=["auto","start","end","center","baseline","stretch"],Sle=Ue({cols:{type:[Boolean,String,Number],default:!1},...Mq,offset:{type:[String,Number],default:null},...Lq,order:{type:[String,Number],default:null},...Pq,alignSelf:{type:String,default:null,validator:t=>vle.includes(t)},...jt(),...Ri()},"VCol"),jk=vt()({name:"VCol",props:Sle(),setup(t,e){let{slots:n}=e;const i=te(()=>{const r=[];let s;for(s in Kk)Kk[s].forEach(o=>{const l=t[o],u=gle(s,o,l);u&&r.push(u)});const a=r.some(o=>o.startsWith("v-col-"));return r.push({"v-col":!a||!t.cols,[`v-col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),r});return()=>{var r;return Bt(t.tag,{class:[i.value,t.class],style:t.style},(r=n.default)==null?void 0:r.call(n))}}}),UN=["start","end","center"],Bq=["space-between","space-around","space-evenly"];function $N(t,e){return QS.reduce((n,i)=>{const r=t+Fa(i);return n[r]=e(),n},{})}const ble=[...UN,"baseline","stretch"],Fq=t=>ble.includes(t),Uq=$N("align",()=>({type:String,default:null,validator:Fq})),Ele=[...UN,...Bq],$q=t=>Ele.includes(t),Gq=$N("justify",()=>({type:String,default:null,validator:$q})),yle=[...UN,...Bq,"stretch"],Hq=t=>yle.includes(t),Vq=$N("alignContent",()=>({type:String,default:null,validator:Hq})),Qk={align:Object.keys(Uq),justify:Object.keys(Gq),alignContent:Object.keys(Vq)},Cle={align:"align",justify:"justify",alignContent:"align-content"};function Tle(t,e,n){let i=Cle[t];if(n!=null){if(e){const r=e.replace(t,"");i+=`-${r}`}return i+=`-${n}`,i.toLowerCase()}}const wle=Ue({dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:Fq},...Uq,justify:{type:String,default:null,validator:$q},...Gq,alignContent:{type:String,default:null,validator:Hq},...Vq,...jt(),...Ri()},"VRow"),Rle=vt()({name:"VRow",props:wle(),setup(t,e){let{slots:n}=e;const i=te(()=>{const r=[];let s;for(s in Qk)Qk[s].forEach(a=>{const o=t[a],l=Tle(s,a,o);l&&r.push(l)});return r.push({"v-row--no-gutters":t.noGutters,"v-row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),r});return()=>{var r;return Bt(t.tag,{class:["v-row",i.value,t.class],style:t.style},(r=n.default)==null?void 0:r.call(n))}}}),Na=WS("v-spacer","div","VSpacer"),Ale=Qe({__name:"NewProjectDialog",props:{visible:{type:Boolean},visibleModifiers:{}},emits:["update:visible"],setup(t){const e=kl(t,"visible"),n=ve(!1),i=ve(""),r=ve(""),s=ve(""),a=[h=>!!h||"Project ID is required",h=>h&&h.length<=64||"Project ID must be less than 64 characters",h=>/^[a-z0-9-]+$/i.test(h)||"Project ID must be alphanumeric with dashes (-)",h=>/^[a-z]/i.test(h)||"Project ID must start with a letter"],o=[h=>!!h||"Password is required",h=>h&&h.length>=8||"Password must be at least 8 characters"],l=[h=>!!h||"Repeat password is required",h=>h===r.value||"Passwords do not match"],u=nb(),c=Su(),d=async()=>{await u.createProject(i.value,r.value),c.openProjectPanel(i.value),e.value=!1};return(h,f)=>{const S=cq;return _e(),xe(FN,{modelValue:e.value,"onUpdate:modelValue":f[5]||(f[5]=_=>e.value=_),"max-width":"600px"},{default:be(()=>[W(Is,{title:"New project",color:"#2d2d2d"},{default:be(()=>[W(mle,{modelValue:ie(n),"onUpdate:modelValue":f[4]||(f[4]=_=>Lt(n)?n.value=_:null)},{default:be(()=>[W(Po,null,{default:be(()=>[W(Vo,{modelValue:ie(i),"onUpdate:modelValue":f[0]||(f[0]=_=>Lt(i)?i.value=_:null),class:"mb-4",variant:"outlined",density:"compact",label:"Project ID",rules:a,placeholder:"my-awesome-project",hint:"Project ID must be unique across all repositories connected to the same storage","persistent-hint":""},null,8,["modelValue"]),W(S,{modelValue:ie(r),"onUpdate:modelValue":f[1]||(f[1]=_=>Lt(r)?r.value=_:null),class:"mb-4",label:"Password",rules:o,hint:"Password must be strong enough to resist offline attacks","persistent-hint":""},null,8,["modelValue"]),W(S,{modelValue:ie(s),"onUpdate:modelValue":f[2]||(f[2]=_=>Lt(s)?s.value=_:null),class:"mb-4",label:"Repeat Password",rules:l},null,8,["modelValue"]),W(kae,{type:"warning",density:"compact"},{default:be(()=>f[6]||(f[6]=[Tt(" The password will be used to encrypt the project secrets and sensitive state data. Losing the password will result in losing the control over the created resources! ")])),_:1})]),_:1}),W(zo,null,{default:be(()=>[W(Na),W(Sn,{onClick:f[3]||(f[3]=_=>e.value=!1)},{default:be(()=>f[7]||(f[7]=[Tt("Cancel")])),_:1}),W(Sn,{disabled:!ie(n),loading:ie(u).loadingCreateProject,onClick:d},{default:be(()=>f[8]||(f[8]=[Tt(" Create ")])),_:1},8,["disabled","loading"])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["modelValue"])}}}),Ole=Ue({color:String,inset:Boolean,length:[Number,String],opacity:[Number,String],thickness:[Number,String],vertical:Boolean,...jt(),...$i()},"VDivider"),El=vt()({name:"VDivider",props:Ole(),setup(t,e){let{attrs:n,slots:i}=e;const{themeClasses:r}=cr(t),{textColorClasses:s,textColorStyles:a}=Xs(Ve(t,"color")),o=te(()=>{const l={};return t.length&&(l[t.vertical?"height":"width"]=Ht(t.length)),t.thickness&&(l[t.vertical?"borderRightWidth":"borderTopWidth"]=Ht(t.thickness)),l});return Ft(()=>{const l=W("hr",{class:[{"v-divider":!0,"v-divider--inset":t.inset,"v-divider--vertical":t.vertical},r.value,s.value,t.class],style:[o.value,a.value,{"--v-border-opacity":t.opacity},t.style],"aria-orientation":!n.role||n.role==="separator"?t.vertical?"vertical":"horizontal":void 0,role:`${n.role||"separator"}`},null);return i.default?W("div",{class:["v-divider__wrapper",{"v-divider__wrapper--vertical":t.vertical,"v-divider__wrapper--inset":t.inset}]},[l,W("div",{class:"v-divider__content"},[i.default()]),l]):l}),{}}}),zA=Symbol.for("vuetify:list");function zq(){const t=an(zA,{hasPrepend:ut(!1),updateHasPrepend:()=>null}),e={hasPrepend:ut(!1),updateHasPrepend:n=>{n&&(e.hasPrepend.value=n)}};return Kn(zA,e),t}function qq(){return an(zA,null)}const GN=t=>{const e={activate:n=>{let{id:i,value:r,activated:s}=n;return i=gt(i),t&&!r&&s.size===1&&s.has(i)||(r?s.add(i):s.delete(i)),s},in:(n,i,r)=>{let s=new Set;if(n!=null)for(const a of qr(n))s=e.activate({id:a,value:!0,activated:new Set(s),children:i,parents:r});return s},out:n=>Array.from(n)};return e},Yq=t=>{const e=GN(t);return{activate:i=>{let{activated:r,id:s,...a}=i;s=gt(s);const o=r.has(s)?new Set([s]):new Set;return e.activate({...a,id:s,activated:o})},in:(i,r,s)=>{let a=new Set;if(i!=null){const o=qr(i);o.length&&(a=e.in(o.slice(0,1),r,s))}return a},out:(i,r,s)=>e.out(i,r,s)}},Ile=t=>{const e=GN(t);return{activate:i=>{let{id:r,activated:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.activate({id:r,activated:s,children:a,...o})},in:e.in,out:e.out}},Nle=t=>{const e=Yq(t);return{activate:i=>{let{id:r,activated:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.activate({id:r,activated:s,children:a,...o})},in:e.in,out:e.out}},xle={open:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(n){const s=new Set;s.add(e);let a=r.get(e);for(;a!=null;)s.add(a),a=r.get(a);return s}else return i.delete(e),i},select:()=>null},Wq={open:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(n){let s=r.get(e);for(i.add(e);s!=null&&s!==e;)i.add(s),s=r.get(s);return i}else i.delete(e);return i},select:()=>null},Dle={open:Wq.open,select:t=>{let{id:e,value:n,opened:i,parents:r}=t;if(!n)return i;const s=[];let a=r.get(e);for(;a!=null;)s.push(a),a=r.get(a);return new Set(s)}},HN=t=>{const e={select:n=>{let{id:i,value:r,selected:s}=n;if(i=gt(i),t&&!r){const a=Array.from(s.entries()).reduce((o,l)=>{let[u,c]=l;return c==="on"&&o.push(u),o},[]);if(a.length===1&&a[0]===i)return s}return s.set(i,r?"on":"off"),s},in:(n,i,r)=>{const s=new Map;for(const a of n||[])e.select({id:a,value:!0,selected:s,children:i,parents:r});return s},out:n=>{const i=[];for(const[r,s]of n.entries())s==="on"&&i.push(r);return i}};return e},Kq=t=>{const e=HN(t);return{select:i=>{let{selected:r,id:s,...a}=i;s=gt(s);const o=r.has(s)?new Map([[s,r.get(s)]]):new Map;return e.select({...a,id:s,selected:o})},in:(i,r,s)=>i!=null&&i.length?e.in(i.slice(0,1),r,s):new Map,out:(i,r,s)=>e.out(i,r,s)}},kle=t=>{const e=HN(t);return{select:i=>{let{id:r,selected:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.select({id:r,selected:s,children:a,...o})},in:e.in,out:e.out}},Mle=t=>{const e=Kq(t);return{select:i=>{let{id:r,selected:s,children:a,...o}=i;return r=gt(r),a.has(r)?s:e.select({id:r,selected:s,children:a,...o})},in:e.in,out:e.out}},Lle=t=>{const e={select:n=>{let{id:i,value:r,selected:s,children:a,parents:o}=n;i=gt(i);const l=new Map(s),u=[i];for(;u.length;){const d=u.shift();s.set(gt(d),r?"on":"off"),a.has(d)&&u.push(...a.get(d))}let c=gt(o.get(i));for(;c;){const d=a.get(c),h=d.every(S=>s.get(gt(S))==="on"),f=d.every(S=>!s.has(gt(S))||s.get(gt(S))==="off");s.set(c,h?"on":f?"off":"indeterminate"),c=gt(o.get(c))}return t&&!r&&Array.from(s.entries()).reduce((h,f)=>{let[S,_]=f;return _==="on"&&h.push(S),h},[]).length===0?l:s},in:(n,i,r)=>{let s=new Map;for(const a of n||[])s=e.select({id:a,value:!0,selected:s,children:i,parents:r});return s},out:(n,i)=>{const r=[];for(const[s,a]of n.entries())a==="on"&&!i.has(s)&&r.push(s);return r}};return e},Mf=Symbol.for("vuetify:nested"),jq={id:ut(),root:{register:()=>null,unregister:()=>null,parents:ve(new Map),children:ve(new Map),open:()=>null,openOnSelect:()=>null,activate:()=>null,select:()=>null,activatable:ve(!1),selectable:ve(!1),opened:ve(new Set),activated:ve(new Set),selected:ve(new Map),selectedValues:ve([]),getPath:()=>[]}},Ple=Ue({activatable:Boolean,selectable:Boolean,activeStrategy:[String,Function,Object],selectStrategy:[String,Function,Object],openStrategy:[String,Object],opened:null,activated:null,selected:null,mandatory:Boolean},"nested"),Ble=t=>{let e=!1;const n=ve(new Map),i=ve(new Map),r=Fn(t,"opened",t.opened,S=>new Set(S),S=>[...S.values()]),s=te(()=>{if(typeof t.activeStrategy=="object")return t.activeStrategy;if(typeof t.activeStrategy=="function")return t.activeStrategy(t.mandatory);switch(t.activeStrategy){case"leaf":return Ile(t.mandatory);case"single-leaf":return Nle(t.mandatory);case"independent":return GN(t.mandatory);case"single-independent":default:return Yq(t.mandatory)}}),a=te(()=>{if(typeof t.selectStrategy=="object")return t.selectStrategy;if(typeof t.selectStrategy=="function")return t.selectStrategy(t.mandatory);switch(t.selectStrategy){case"single-leaf":return Mle(t.mandatory);case"leaf":return kle(t.mandatory);case"independent":return HN(t.mandatory);case"single-independent":return Kq(t.mandatory);case"classic":default:return Lle(t.mandatory)}}),o=te(()=>{if(typeof t.openStrategy=="object")return t.openStrategy;switch(t.openStrategy){case"list":return Dle;case"single":return xle;case"multiple":default:return Wq}}),l=Fn(t,"activated",t.activated,S=>s.value.in(S,n.value,i.value),S=>s.value.out(S,n.value,i.value)),u=Fn(t,"selected",t.selected,S=>a.value.in(S,n.value,i.value),S=>a.value.out(S,n.value,i.value));Yi(()=>{e=!0});function c(S){const _=[];let p=S;for(;p!=null;)_.unshift(p),p=i.value.get(p);return _}const d=Li("nested"),h=new Set,f={id:ut(),root:{opened:r,activatable:Ve(t,"activatable"),selectable:Ve(t,"selectable"),activated:l,selected:u,selectedValues:te(()=>{const S=[];for(const[_,p]of u.value.entries())p==="on"&&S.push(_);return S}),register:(S,_,p)=>{if(h.has(S)){c(S).map(String).join(" -> "),c(_).concat(S).map(String).join(" -> ");return}else h.add(S);_&&S!==_&&i.value.set(S,_),p&&n.value.set(S,[]),_!=null&&n.value.set(_,[...n.value.get(_)||[],S])},unregister:S=>{if(e)return;h.delete(S),n.value.delete(S);const _=i.value.get(S);if(_){const p=n.value.get(_)??[];n.value.set(_,p.filter(v=>v!==S))}i.value.delete(S)},open:(S,_,p)=>{d.emit("click:open",{id:S,value:_,path:c(S),event:p});const v=o.value.open({id:S,value:_,opened:new Set(r.value),children:n.value,parents:i.value,event:p});v&&(r.value=v)},openOnSelect:(S,_,p)=>{const v=o.value.select({id:S,value:_,selected:new Map(u.value),opened:new Set(r.value),children:n.value,parents:i.value,event:p});v&&(r.value=v)},select:(S,_,p)=>{d.emit("click:select",{id:S,value:_,path:c(S),event:p});const v=a.value.select({id:S,value:_,selected:new Map(u.value),children:n.value,parents:i.value,event:p});v&&(u.value=v),f.root.openOnSelect(S,_,p)},activate:(S,_,p)=>{if(!t.activatable)return f.root.select(S,!0,p);d.emit("click:activate",{id:S,value:_,path:c(S),event:p});const v=s.value.activate({id:S,value:_,activated:new Set(l.value),children:n.value,parents:i.value,event:p});if(v.size!==l.value.size)l.value=v;else{for(const m of v)if(!l.value.has(m)){l.value=v;return}for(const m of l.value)if(!v.has(m)){l.value=v;return}}},children:n,parents:i,getPath:c}};return Kn(Mf,f),f.root},Qq=(t,e)=>{const n=an(Mf,jq),i=Symbol(Os()),r=te(()=>t.value!==void 0?t.value:i),s={...n,id:r,open:(a,o)=>n.root.open(r.value,a,o),openOnSelect:(a,o)=>n.root.openOnSelect(r.value,a,o),isOpen:te(()=>n.root.opened.value.has(r.value)),parent:te(()=>n.root.parents.value.get(r.value)),activate:(a,o)=>n.root.activate(r.value,a,o),isActivated:te(()=>n.root.activated.value.has(gt(r.value))),select:(a,o)=>n.root.select(r.value,a,o),isSelected:te(()=>n.root.selected.value.get(gt(r.value))==="on"),isIndeterminate:te(()=>n.root.selected.value.get(gt(r.value))==="indeterminate"),isLeaf:te(()=>!n.root.children.value.get(r.value)),isGroupActivator:n.isGroupActivator};return vu(()=>{!n.isGroupActivator&&n.root.register(r.value,n.id.value,e)}),Yi(()=>{!n.isGroupActivator&&n.root.unregister(r.value)}),e&&Kn(Mf,s),s},Fle=()=>{const t=an(Mf,jq);Kn(Mf,{...t,isGroupActivator:!0})};function Ule(){const t=ut(!1);return ai(()=>{window.requestAnimationFrame(()=>{t.value=!0})}),{ssrBootStyles:te(()=>t.value?void 0:{transition:"none !important"}),isBooted:qd(t)}}const $le=Qd({name:"VListGroupActivator",setup(t,e){let{slots:n}=e;return Fle(),()=>{var i;return(i=n.default)==null?void 0:i.call(n)}}}),Gle=Ue({activeColor:String,baseColor:String,color:String,collapseIcon:{type:on,default:"$collapse"},expandIcon:{type:on,default:"$expand"},prependIcon:on,appendIcon:on,fluid:Boolean,subgroup:Boolean,title:String,value:null,...jt(),...Ri()},"VListGroup"),Xk=vt()({name:"VListGroup",props:Gle(),setup(t,e){let{slots:n}=e;const{isOpen:i,open:r,id:s}=Qq(Ve(t,"value"),!0),a=te(()=>`v-list-group--id-${String(s.value)}`),o=qq(),{isBooted:l}=Ule();function u(f){f.stopPropagation(),r(!i.value,f)}const c=te(()=>({onClick:u,class:"v-list-group__header",id:a.value})),d=te(()=>i.value?t.collapseIcon:t.expandIcon),h=te(()=>({VListItem:{active:i.value,activeColor:t.activeColor,baseColor:t.baseColor,color:t.color,prependIcon:t.prependIcon||t.subgroup&&d.value,appendIcon:t.appendIcon||!t.subgroup&&d.value,title:t.title,value:t.value}}));return Ft(()=>W(t.tag,{class:["v-list-group",{"v-list-group--prepend":o==null?void 0:o.hasPrepend.value,"v-list-group--fluid":t.fluid,"v-list-group--subgroup":t.subgroup,"v-list-group--open":i.value},t.class],style:t.style},{default:()=>[n.activator&&W(pi,{defaults:h.value},{default:()=>[W($le,null,{default:()=>[n.activator({props:c.value,isOpen:i.value})]})]}),W(bl,{transition:{component:Uoe},disabled:!l.value},{default:()=>{var f;return[Ar(W("div",{class:"v-list-group__items",role:"group","aria-labelledby":a.value},[(f=n.default)==null?void 0:f.call(n)]),[[Wd,i.value]])]}})]})),{isOpen:i}}}),Hle=Ue({opacity:[Number,String],...jt(),...Ri()},"VListItemSubtitle"),Vle=vt()({name:"VListItemSubtitle",props:Hle(),setup(t,e){let{slots:n}=e;return Ft(()=>W(t.tag,{class:["v-list-item-subtitle",t.class],style:[{"--v-list-item-subtitle-opacity":t.opacity},t.style]},n)),{}}}),zle=WS("v-list-item-title"),qle=Ue({active:{type:Boolean,default:void 0},activeClass:String,activeColor:String,appendAvatar:String,appendIcon:on,baseColor:String,disabled:Boolean,lines:[Boolean,String],link:{type:Boolean,default:void 0},nav:Boolean,prependAvatar:String,prependIcon:on,ripple:{type:[Boolean,Object],default:!0},slim:Boolean,subtitle:[String,Number],title:[String,Number],value:null,onClick:Yr(),onClickOnce:Yr(),...bu(),...jt(),...ro(),...Ha(),...yu(),...no(),...rb(),...Ri(),...$i(),...za({variant:"text"})},"VListItem"),Bl=vt()({name:"VListItem",directives:{Ripple:Dp},props:qle(),emits:{click:t=>!0},setup(t,e){let{attrs:n,slots:i,emit:r}=e;const s=ib(t,n),a=te(()=>t.value===void 0?s.href.value:t.value),{activate:o,isActivated:l,select:u,isOpen:c,isSelected:d,isIndeterminate:h,isGroupActivator:f,root:S,parent:_,openOnSelect:p,id:v}=Qq(a,!1),m=qq(),g=te(()=>{var k;return t.active!==!1&&(t.active||((k=s.isActive)==null?void 0:k.value)||(S.activatable.value?l.value:d.value))}),b=te(()=>t.link!==!1&&s.isLink.value),y=te(()=>!!m&&(S.selectable.value||S.activatable.value||t.value!=null)),E=te(()=>!t.disabled&&t.link!==!1&&(t.link||s.isClickable.value||y.value)),T=te(()=>t.rounded||t.nav),C=te(()=>t.color??t.activeColor),w=te(()=>({color:g.value?C.value??t.baseColor:t.baseColor,variant:t.variant}));Ie(()=>{var k;return(k=s.isActive)==null?void 0:k.value},k=>{k&&R()}),vu(()=>{var k;(k=s.isActive)!=null&&k.value&&R()});function R(){_.value!=null&&S.open(_.value,!0),p(!0)}const{themeClasses:I}=cr(t),{borderClasses:A}=Eu(t),{colorClasses:x,colorStyles:O,variantClasses:D}=eh(w),{densityClasses:L}=Qo(t),{dimensionStyles:q}=Va(t),{elevationClasses:G}=Cu(t),{roundedClasses:M}=io(T),P=te(()=>t.lines?`v-list-item--${t.lines}-line`:void 0),N=te(()=>({isActive:g.value,select:u,isOpen:c.value,isSelected:d.value,isIndeterminate:h.value}));function U(k){var H;r("click",k),E.value&&((H=s.navigate)==null||H.call(s,k),!f&&(S.activatable.value?o(!l.value,k):(S.selectable.value||t.value!=null)&&u(!d.value,k)))}function F(k){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.target.dispatchEvent(new MouseEvent("click",k)))}return Ft(()=>{const k=b.value?"a":t.tag,H=i.title||t.title!=null,X=i.subtitle||t.subtitle!=null,K=!!(t.appendAvatar||t.appendIcon),z=!!(K||i.append),re=!!(t.prependAvatar||t.prependIcon),ne=!!(re||i.prepend);return m==null||m.updateHasPrepend(ne),t.activeColor&&Xte("active-color",["color","base-color"]),Ar(W(k,rt({class:["v-list-item",{"v-list-item--active":g.value,"v-list-item--disabled":t.disabled,"v-list-item--link":E.value,"v-list-item--nav":t.nav,"v-list-item--prepend":!ne&&(m==null?void 0:m.hasPrepend.value),"v-list-item--slim":t.slim,[`${t.activeClass}`]:t.activeClass&&g.value},I.value,A.value,x.value,L.value,G.value,P.value,M.value,D.value,t.class],style:[O.value,q.value,t.style],tabindex:E.value?m?-2:0:void 0,"aria-selected":y.value?S.activatable.value?l.value:S.selectable.value?d.value:g.value:void 0,onClick:U,onKeydown:E.value&&!b.value&&F},s.linkProps),{default:()=>{var Z;return[Jd(E.value||g.value,"v-list-item"),ne&&W("div",{key:"prepend",class:"v-list-item__prepend"},[i.prepend?W(pi,{key:"prepend-defaults",disabled:!re,defaults:{VAvatar:{density:t.density,image:t.prependAvatar},VIcon:{density:t.density,icon:t.prependIcon},VListItemAction:{start:!0}}},{default:()=>{var J;return[(J=i.prepend)==null?void 0:J.call(i,N.value)]}}):W(He,null,[t.prependAvatar&&W(Ll,{key:"prepend-avatar",density:t.density,image:t.prependAvatar},null),t.prependIcon&&W(Ot,{key:"prepend-icon",density:t.density,icon:t.prependIcon},null)]),W("div",{class:"v-list-item__spacer"},null)]),W("div",{class:"v-list-item__content","data-no-activator":""},[H&&W(zle,{key:"title"},{default:()=>{var J;return[((J=i.title)==null?void 0:J.call(i,{title:t.title}))??t.title]}}),X&&W(Vle,{key:"subtitle"},{default:()=>{var J;return[((J=i.subtitle)==null?void 0:J.call(i,{subtitle:t.subtitle}))??t.subtitle]}}),(Z=i.default)==null?void 0:Z.call(i,N.value)]),z&&W("div",{key:"append",class:"v-list-item__append"},[i.append?W(pi,{key:"append-defaults",disabled:!K,defaults:{VAvatar:{density:t.density,image:t.appendAvatar},VIcon:{density:t.density,icon:t.appendIcon},VListItemAction:{end:!0}}},{default:()=>{var J;return[(J=i.append)==null?void 0:J.call(i,N.value)]}}):W(He,null,[t.appendIcon&&W(Ot,{key:"append-icon",density:t.density,icon:t.appendIcon},null),t.appendAvatar&&W(Ll,{key:"append-avatar",density:t.density,image:t.appendAvatar},null)]),W("div",{class:"v-list-item__spacer"},null)])]}}),[[Jl("ripple"),E.value&&t.ripple]])}),{activate:o,isActivated:l,isGroupActivator:f,isSelected:d,list:m,select:u,root:S,id:v,link:s}}}),Yle=Ue({color:String,inset:Boolean,sticky:Boolean,title:String,...jt(),...Ri()},"VListSubheader"),Xq=vt()({name:"VListSubheader",props:Yle(),setup(t,e){let{slots:n}=e;const{textColorClasses:i,textColorStyles:r}=Xs(Ve(t,"color"));return Ft(()=>{const s=!!(n.default||t.title);return W(t.tag,{class:["v-list-subheader",{"v-list-subheader--inset":t.inset,"v-list-subheader--sticky":t.sticky},i.value,t.class],style:[{textColorStyles:r},t.style]},{default:()=>{var a;return[s&&W("div",{class:"v-list-subheader__text"},[((a=n.default)==null?void 0:a.call(n))??t.title])]}})}),{}}}),Wle=Ue({items:Array,returnObject:Boolean},"VListChildren"),Zq=vt()({name:"VListChildren",props:Wle(),setup(t,e){let{slots:n}=e;return zq(),()=>{var i,r;return((i=n.default)==null?void 0:i.call(n))??((r=t.items)==null?void 0:r.map(s=>{var h,f;let{children:a,props:o,type:l,raw:u}=s;if(l==="divider")return((h=n.divider)==null?void 0:h.call(n,{props:o}))??W(El,o,null);if(l==="subheader")return((f=n.subheader)==null?void 0:f.call(n,{props:o}))??W(Xq,o,null);const c={subtitle:n.subtitle?S=>{var _;return(_=n.subtitle)==null?void 0:_.call(n,{...S,item:u})}:void 0,prepend:n.prepend?S=>{var _;return(_=n.prepend)==null?void 0:_.call(n,{...S,item:u})}:void 0,append:n.append?S=>{var _;return(_=n.append)==null?void 0:_.call(n,{...S,item:u})}:void 0,title:n.title?S=>{var _;return(_=n.title)==null?void 0:_.call(n,{...S,item:u})}:void 0},d=Xk.filterProps(o);return a?W(Xk,rt({value:o==null?void 0:o.value},d),{activator:S=>{let{props:_}=S;const p={...o,..._,value:t.returnObject?u:o.value};return n.header?n.header({props:p}):W(Bl,p,c)},default:()=>W(Zq,{items:a,returnObject:t.returnObject},n)}):n.item?n.item({props:o}):W(Bl,rt(o,{value:t.returnObject?u:o.value}),c)}))}}}),Jq=Ue({items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:"title"},itemValue:{type:[String,Array,Function],default:"value"},itemChildren:{type:[Boolean,String,Array,Function],default:"children"},itemProps:{type:[Boolean,String,Array,Function],default:"props"},returnObject:Boolean,valueComparator:Function},"list-items");function ml(t,e){const n=wo(e,t.itemTitle,e),i=wo(e,t.itemValue,n),r=wo(e,t.itemChildren),s=t.itemProps===!0?typeof e=="object"&&e!=null&&!Array.isArray(e)?"children"in e?Ga(e,["children"]):e:void 0:wo(e,t.itemProps),a={title:n,value:i,...s};return{title:String(a.title??""),value:a.value,props:a,children:Array.isArray(r)?eY(t,r):void 0,raw:e}}function eY(t,e){const n=Op(t,["itemTitle","itemValue","itemChildren","itemProps","returnObject","valueComparator"]),i=[];for(const r of e)i.push(ml(n,r));return i}function tY(t){const e=te(()=>eY(t,t.items)),n=te(()=>e.value.some(o=>o.value===null)),i=ut(new Map),r=ut([]);Wr(()=>{const o=e.value,l=new Map,u=[];for(let c=0;c<o.length;c++){const d=o[c];if(J3(d.value)||d.value===null){let h=l.get(d.value);h||(h=[],l.set(d.value,h)),h.push(d)}else u.push(d)}i.value=l,r.value=u});function s(o){const l=i.value,u=e.value,c=r.value,d=n.value,h=t.returnObject,f=!!t.valueComparator,S=t.valueComparator||Ks,_=Op(t,["itemTitle","itemValue","itemChildren","itemProps","returnObject","valueComparator"]),p=[];e:for(const v of o){if(!d&&v===null)continue;if(h&&typeof v=="string"){p.push(ml(_,v));continue}const m=l.get(v);if(f||!m){for(const g of f?u:c)if(S(v,g.value)){p.push(g);continue e}p.push(ml(_,v));continue}p.push(...m)}return p}function a(o){return t.returnObject?o.map(l=>{let{raw:u}=l;return u}):o.map(l=>{let{value:u}=l;return u})}return{items:e,transformIn:s,transformOut:a}}function Kle(t,e){const n=wo(e,t.itemType,"item"),i=J3(e)?e:wo(e,t.itemTitle),r=wo(e,t.itemValue,void 0),s=wo(e,t.itemChildren),a=t.itemProps===!0?Ga(e,["children"]):wo(e,t.itemProps),o={title:i,value:r,...a};return{type:n,title:o.title,value:o.value,props:o,children:n==="item"&&s?nY(t,s):void 0,raw:e}}function nY(t,e){const n=[];for(const i of e)n.push(Kle(t,i));return n}function jle(t){return{items:te(()=>nY(t,t.items))}}const Qle=Ue({baseColor:String,activeColor:String,activeClass:String,bgColor:String,disabled:Boolean,expandIcon:on,collapseIcon:on,lines:{type:[Boolean,String],default:"one"},slim:Boolean,nav:Boolean,"onClick:open":Yr(),"onClick:select":Yr(),"onUpdate:opened":Yr(),...Ple({selectStrategy:"single-leaf",openStrategy:"list"}),...bu(),...jt(),...ro(),...Ha(),...yu(),itemType:{type:String,default:"type"},...Jq(),...no(),...Ri(),...$i(),...za({variant:"text"})},"VList"),VN=vt()({name:"VList",props:Qle(),emits:{"update:selected":t=>!0,"update:activated":t=>!0,"update:opened":t=>!0,"click:open":t=>!0,"click:activate":t=>!0,"click:select":t=>!0},setup(t,e){let{slots:n}=e;const{items:i}=jle(t),{themeClasses:r}=cr(t),{backgroundColorClasses:s,backgroundColorStyles:a}=Il(Ve(t,"bgColor")),{borderClasses:o}=Eu(t),{densityClasses:l}=Qo(t),{dimensionStyles:u}=Va(t),{elevationClasses:c}=Cu(t),{roundedClasses:d}=io(t),{children:h,open:f,parents:S,select:_,getPath:p}=Ble(t),v=te(()=>t.lines?`v-list--${t.lines}-line`:void 0),m=Ve(t,"activeColor"),g=Ve(t,"baseColor"),b=Ve(t,"color");zq(),jd({VListGroup:{activeColor:m,baseColor:g,color:b,expandIcon:Ve(t,"expandIcon"),collapseIcon:Ve(t,"collapseIcon")},VListItem:{activeClass:Ve(t,"activeClass"),activeColor:m,baseColor:g,color:b,density:Ve(t,"density"),disabled:Ve(t,"disabled"),lines:Ve(t,"lines"),nav:Ve(t,"nav"),slim:Ve(t,"slim"),variant:Ve(t,"variant")}});const y=ut(!1),E=ve();function T(x){y.value=!0}function C(x){y.value=!1}function w(x){var O;!y.value&&!(x.relatedTarget&&((O=E.value)!=null&&O.contains(x.relatedTarget)))&&A()}function R(x){const O=x.target;if(!(!E.value||["INPUT","TEXTAREA"].includes(O.tagName))){if(x.key==="ArrowDown")A("next");else if(x.key==="ArrowUp")A("prev");else if(x.key==="Home")A("first");else if(x.key==="End")A("last");else return;x.preventDefault()}}function I(x){y.value=!0}function A(x){if(E.value)return hf(E.value,x)}return Ft(()=>W(t.tag,{ref:E,class:["v-list",{"v-list--disabled":t.disabled,"v-list--nav":t.nav,"v-list--slim":t.slim},r.value,s.value,o.value,l.value,c.value,v.value,d.value,t.class],style:[a.value,u.value,t.style],tabindex:t.disabled?-1:0,role:"listbox","aria-activedescendant":void 0,onFocusin:T,onFocusout:C,onFocus:w,onKeydown:R,onMousedown:I},{default:()=>[W(Zq,{items:i.value,returnObject:t.returnObject},n)]})),{open:f,select:_,focus:A,children:h,parents:S,getPath:p}}}),Xle={class:"project-list-container"},Zle=Qe({__name:"ProjectListPanel",setup(t){const e=nb(),n=Su(),i=yd(),r=ve(!1);return(s,a)=>{const o=Ale;return _e(),Ge(He,null,[Gt("div",Xle,[W(Is,{width:"460",variant:"text"},{default:be(()=>[W(Po,null,{default:be(()=>[W(BN,{class:"text-center text-uppercase"},{default:be(()=>a[2]||(a[2]=[Tt("Highstate Designer")])),_:1}),W(Rq,{class:"text-center"},{default:be(()=>[Tt(" v"+Mn(ie(i).public.version)+" • Все зонды удалены ",1)]),_:1}),W(El,{class:"mt-4"}),W(VN,{variant:"flat",class:"project-list"},{default:be(()=>[W(Xq,{class:"text-uppercase"},{default:be(()=>a[3]||(a[3]=[Tt("Projects")])),_:1}),(_e(!0),Ge(He,null,Or(ie(e).projectNames,l=>(_e(),xe(Bl,{key:l,class:"prject-list-item",onClick:u=>ie(n).openProjectPanel(l)},{default:be(()=>[Tt(Mn(l),1)]),_:2},1032,["onClick"]))),128)),W(Bl,{class:"prject-list-item",onClick:a[0]||(a[0]=l=>r.value=!0)},{default:be(()=>[W(Ot,null,{default:be(()=>a[4]||(a[4]=[Tt("mdi-plus")])),_:1}),a[5]||(a[5]=Tt(" Create new project "))]),_:1})]),_:1})]),_:1})]),_:1})]),W(o,{visible:ie(r),"onUpdate:visible":a[1]||(a[1]=l=>Lt(r)?r.value=l:null)},null,8,["visible"])],64)}}}),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},Jle=Zn(Zle,[["__scopeId","data-v-245476a7"]]),ece=["ID","URL","IP","IPs","IPv4","IPv6","DNS","SSH","WireGuard","API","k8s","TLS","HTTP","HTTPS","TCP","UDP","CIDR","CPU","RAM","GPU","SSD","HDD","VM","CNI","CSI","MariaDB","PostgreSQL"],Zk=new Map(ece.map(t=>[t.toLowerCase(),t]));function zN(t){return t.split(/(?=[A-Z])|_|\./).map(n=>{const i=n.toLowerCase();return Zk.has(i)?Zk.get(i):n.charAt(0).toUpperCase()+n.slice(1)}).join(" ")}function Us(t,e){return e.displayName??zN(t)}let qA=[],iY=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?iY:qA).push(n=n+t[e])})();function tce(t){if(t<768)return!1;for(let e=0,n=qA.length;;){let i=e+n>>1;if(t<qA[i])n=i;else if(t>=iY[i])e=i+1;else return!0;if(e==n)return!1}}function Jk(t){return t>=127462&&t<=127487}const eM=8205;function nce(t,e,n=!0,i=!0){return(n?rY:ice)(t,e,i)}function rY(t,e,n){if(e==t.length)return e;e&&sY(t.charCodeAt(e))&&oY(t.charCodeAt(e-1))&&e--;let i=LE(t,e);for(e+=tM(i);e<t.length;){let r=LE(t,e);if(i==eM||r==eM||n&&tce(r))e+=tM(r),i=r;else if(Jk(r)){let s=0,a=e-2;for(;a>=0&&Jk(LE(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function ice(t,e,n){for(;e>0;){let i=rY(t,e-2,n);if(i<e)return i;e--}return 0}function LE(t,e){let n=t.charCodeAt(e);if(!oY(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return sY(i)?(n-55296<<10)+(i-56320)+65536:n}function sY(t){return t>=56320&&t<57344}function oY(t){return t>=55296&&t<56320}function tM(t){return t<65536?1:2}let _n=class aY{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=wd(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Ao.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=wd(this,e,n);let i=[];return this.decompose(e,n,i,0),Ao.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ff(this),s=new ff(e);for(let a=n,o=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new ff(this,e)}iterRange(e,n=this.length){return new lY(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new cY(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?aY.empty:e.length<=32?new fi(e):Ao.from(fi.split(e,[]))}};class fi extends _n{constructor(e,n=rce(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let a=this.text[s],o=r+a.length;if((n?i:o)>=e)return new sce(r,o,i,a);r=o+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new fi(nM(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),o=ag(s.text,a.text.slice(),0,s.length);if(o.length<=32)i.push(new fi(o,a.length+s.length));else{let l=o.length>>1;i.push(new fi(o.slice(0,l)),new fi(o.slice(l)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof fi))return super.replace(e,n,i);[e,n]=wd(this,e,n);let r=ag(this.text,ag(i.text,nM(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new fi(r,s):Ao.from(fi.split(r,[]),s)}sliceString(e,n=this.length,i=`
31
31
  `){[e,n]=wd(this,e,n);let r="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let o=this.text[a],l=s+o.length;s>e&&a&&(r+=i),e<l&&n>s&&(r+=o.slice(Math.max(0,e-s),n-s)),s=l+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new fi(i,r)),i=[],r=-1);return r>-1&&n.push(new fi(i,r)),n}}class Ao extends _n{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let a=this.children[s],o=r+a.length,l=i+a.lines-1;if((n?l:o)>=e)return a.lineInner(e,n,i,r);r=o+1,i=l+1}}decompose(e,n,i,r){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let o=this.children[s],l=a+o.length;if(e<=l&&n>=a){let u=r&((a<=e?1:0)|(l>=n?2:0));a>=e&&l<=n&&!u?i.push(o):o.decompose(e-a,n-a,i,u)}a=l+1}}replace(e,n,i){if([e,n]=wd(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let a=this.children[r],o=s+a.length;if(e>=s&&n<=o){let l=a.replace(e-s,n-s,i),u=this.lines-a.lines+l.lines;if(l.lines<u>>4&&l.lines>u>>6){let c=this.children.slice();return c[r]=l,new Ao(c,this.length-(n-e)+i.length)}return super.replace(s,o,l)}s=o+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
32
32
  `){[e,n]=wd(this,e,n);let r="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let o=this.children[s],l=a+o.length;a>e&&s&&(r+=i),e<l&&n>a&&(r+=o.sliceString(e-a,n-a,i)),a=l+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ao))return 0;let i=0,[r,s,a,o]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==a||s==o)return i;let l=this.children[r],u=e.children[s];if(l!=u)return i+l.scanIdentical(u,n);i+=l.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let f of e)i+=f.lines;if(i<32){let f=[];for(let S of e)S.flatten(f);return new fi(f,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,o=[],l=0,u=-1,c=[];function d(f){let S;if(f.lines>s&&f instanceof Ao)for(let _ of f.children)d(_);else f.lines>a&&(l>a||!l)?(h(),o.push(f)):f instanceof fi&&l&&(S=c[c.length-1])instanceof fi&&f.lines+S.lines<=32?(l+=f.lines,u+=f.length+1,c[c.length-1]=new fi(S.text.concat(f.text),S.length+1+f.length)):(l+f.lines>r&&h(),l+=f.lines,u+=f.length+1,c.push(f))}function h(){l!=0&&(o.push(c.length==1?c[0]:Ao.from(c,u)),u=-1,l=c.length=0)}for(let f of e)d(f);return h(),o.length==1?o[0]:new Ao(o,n)}}_n.empty=new fi([""],0);function rce(t){let e=-1;for(let n of t)e+=n.length+1;return e}function ag(t,e,n=0,i=1e9){for(let r=0,s=0,a=!0;s<t.length&&r<=i;s++){let o=t[s],l=r+o.length;l>=n&&(l>i&&(o=o.slice(0,i-r)),r<n&&(o=o.slice(n-r)),a?(e[e.length-1]+=o,a=!1):e.push(o)),r=l+1}return e}function nM(t,e,n){return ag(t,[""],e,n)}class ff{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof fi?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,o=r instanceof fi?r.text.length:r.children.length;if(a==(n>0?o:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
33
33
  `,this;e--}else if(r instanceof fi){let l=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[a+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof fi?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class lY{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new ff(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class cY{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(_n.prototype[Symbol.iterator]=function(){return this.iter()},ff.prototype[Symbol.iterator]=lY.prototype[Symbol.iterator]=cY.prototype[Symbol.iterator]=function(){return this});class sce{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}}function wd(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function qi(t,e,n=!0,i=!0){return nce(t,e,n,i)}function oce(t){return t>=56320&&t<57344}function ace(t){return t>=55296&&t<56320}function Fr(t,e){let n=t.charCodeAt(e);if(!ace(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return oce(i)?(n-55296<<10)+(i-56320)+65536:n}function qN(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Oo(t){return t<65536?1:2}const YA=/\r\n?|\n/;var Er=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Er||(Er={}));class Bo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(i,r,s),r+=s):r+=a,i+=s}}iterChangedRanges(e,n=!1){WA(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new Bo(e)}composeDesc(e){return this.empty?e:e.empty?this:uY(this,e)}mapDesc(e,n=!1){return e.empty?this:KA(this,e,n)}mapPos(e,n=-1,i=Er.Simple){let r=0,s=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],l=this.sections[a++],u=r+o;if(l<0){if(u>e)return s+(e-r);s+=o}else{if(i!=Er.Simple&&u>=e&&(i==Er.TrackDel&&r<e&&u>e||i==Er.TrackBefore&&r<e||i==Er.TrackAfter&&u>e))return null;if(u>e||u==e&&n<0&&!o)return e==r||n<0?s:s+l;s+=l}r=u}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],a=this.sections[i++],o=r+s;if(a>=0&&r<=n&&o>=e)return r<e&&o>n?"cover":!0;r=o}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Bo(e)}static create(e){return new Bo(e)}}class Ii extends Bo{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return WA(this,(n,i,r,s,a)=>e=e.replace(r,r+(i-n),a),!1),e}mapDesc(e,n=!1){return KA(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let a=n[r],o=n[r+1];if(o>=0){n[r]=o,n[r+1]=a;let l=r>>1;for(;i.length<l;)i.push(_n.empty);i.push(a?e.slice(s,s+a):_n.empty)}s+=a}return new Ii(n,i)}compose(e){return this.empty?e:e.empty?this:uY(this,e,!0)}map(e,n=!1){return e.empty?this:KA(this,e,n,!0)}iterChanges(e,n=!1){WA(this,e,n)}get desc(){return Bo.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new Lf(this);e:for(let a=0,o=0;;){let l=a==e.length?1e9:e[a++];for(;o<l||o==l&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,l-o);Zi(r,c,-1);let d=s.ins==-1?-1:s.off==0?s.ins:0;Zi(n,c,d),d>0&&yl(i,n,s.text),s.forward(c),o+=c}let u=e[a++];for(;o<u;){if(s.done)break e;let c=Math.min(s.len,u-o);Zi(n,c,-1),Zi(r,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),o+=c}}return{changes:new Ii(n,i),filtered:Bo.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],a=0,o=null;function l(c=!1){if(!c&&!r.length)return;a<n&&Zi(r,n-a,-1);let d=new Ii(r,s);o=o?o.compose(d.map(o)):d,r=[],s=[],a=0}function u(c){if(Array.isArray(c))for(let d of c)u(d);else if(c instanceof Ii){if(c.length!=n)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${n})`);l(),o=o?o.compose(c.map(o)):c}else{let{from:d,to:h=d,insert:f}=c;if(d>h||d<0||h>n)throw new RangeError(`Invalid change range ${d} to ${h} (in doc of length ${n})`);let S=f?typeof f=="string"?_n.of(f.split(i||YA)):f:_n.empty,_=S.length;if(d==h&&_==0)return;d<a&&l(),d>a&&Zi(r,d-a,-1),Zi(r,h-d,_),yl(s,r,S),a=h}}return u(e),l(!o),o}static empty(e){return new Ii(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,o)=>o&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(_n.empty);i[r]=_n.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new Ii(n,i)}static createSet(e,n){return new Ii(e,n)}}function Zi(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function yl(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(_n.empty);t.push(n)}}function WA(t,e,n){let i=t.inserted;for(let r=0,s=0,a=0;a<t.sections.length;){let o=t.sections[a++],l=t.sections[a++];if(l<0)r+=o,s+=o;else{let u=r,c=s,d=_n.empty;for(;u+=o,c+=l,l&&i&&(d=d.append(i[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)o=t.sections[a++],l=t.sections[a++];e(r,u,s,c,d),r=u,s=c}}}function KA(t,e,n,i=!1){let r=[],s=i?[]:null,a=new Lf(t),o=new Lf(e);for(let l=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let u=Math.min(a.len,o.len);Zi(r,u,-1),a.forward(u),o.forward(u)}else if(o.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!n))){let u=o.len;for(Zi(r,o.ins,-1);u;){let c=Math.min(a.len,u);a.ins>=0&&l<a.i&&a.len<=c&&(Zi(r,0,a.ins),s&&yl(s,r,a.text),l=a.i),a.forward(c),u-=c}o.next()}else if(a.ins>=0){let u=0,c=a.len;for(;c;)if(o.ins==-1){let d=Math.min(c,o.len);u+=d,c-=d,o.forward(d)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;Zi(r,u,l<a.i?a.ins:0),s&&l<a.i&&yl(s,r,a.text),l=a.i,a.forward(a.len-c)}else{if(a.done&&o.done)return s?Ii.createSet(r,s):Bo.create(r);throw new Error("Mismatched change set lengths")}}}function uY(t,e,n=!1){let i=[],r=n?[]:null,s=new Lf(t),a=new Lf(e);for(let o=!1;;){if(s.done&&a.done)return r?Ii.createSet(i,r):Bo.create(i);if(s.ins==0)Zi(i,s.len,0,o),s.next();else if(a.len==0&&!a.done)Zi(i,0,a.ins,o),r&&yl(r,i,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,a.len),u=i.length;if(s.ins==-1){let c=a.ins==-1?-1:a.off?0:a.ins;Zi(i,l,c,o),r&&c&&yl(r,i,a.text)}else a.ins==-1?(Zi(i,s.off?0:s.len,l,o),r&&yl(r,i,s.textBit(l))):(Zi(i,s.off?0:s.len,a.off?0:a.ins,o),r&&!a.off&&yl(r,i,a.text));o=(s.ins>l||a.ins>=0&&a.len>l)&&(o||i.length>u),s.forward2(l),a.forward(l)}}}}class Lf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?_n.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?_n.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Mc{constructor(e,n,i){this.from=e,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Mc(i,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Oe.range(e,n);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Oe.range(this.anchor,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Oe.range(e.anchor,e.head)}static create(e,n,i){return new Mc(e,n,i)}}class Oe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Oe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Oe([this.main],0)}addRange(e,n=!0){return Oe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,Oe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Oe(e.ranges.map(n=>Mc.fromJSON(n)),e.main)}static single(e,n=e){return new Oe([Oe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Oe.normalized(e.slice(),n);i=s.to}return new Oe(e,n)}static cursor(e,n=0,i,r){return Mc.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,n,i,r){let s=(i??16777215)<<6|(r==null?7:Math.min(6,r));return n<e?Mc.create(n,e,48|s):Mc.create(e,n,(n>e?8:0)|s)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],a=e[r-1];if(s.empty?s.from<=a.to:s.from<a.to){let o=a.from,l=Math.max(s.to,a.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?Oe.range(l,o):Oe.range(o,l))}}return new Oe(e,n)}}function dY(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let YN=0;class et{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=YN++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new et(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:WN),!!e.static,e.enables)}of(e){return new lg([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new lg(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new lg(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function WN(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class lg{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=YN++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=e[s]>>1,o=this.type==2,l=!1,u=!1,c=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?u=!0:(((n=e[d.id])!==null&&n!==void 0?n:1)&1)==0&&c.push(e[d.id]);return{create(d){return d.values[a]=i(d),1},update(d,h){if(l&&h.docChanged||u&&(h.docChanged||h.selection)||jA(d,c)){let f=i(d);if(o?!iM(f,d.values[a],r):!r(f,d.values[a]))return d.values[a]=f,1}return 0},reconfigure:(d,h)=>{let f,S=h.config.address[s];if(S!=null){let _=bv(h,S);if(this.dependencies.every(p=>p instanceof et?h.facet(p)===d.facet(p):p instanceof Pi?h.field(p,!1)==d.field(p,!1):!0)||(o?iM(f=i(d),_,r):r(f=i(d),_)))return d.values[a]=_,0}else f=i(d);return d.values[a]=f,1}}}}function iM(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function jA(t,e){let n=!1;for(let i of e)pf(t,i)&1&&(n=!0);return n}function lce(t,e,n){let i=n.map(l=>t[l.id]),r=n.map(l=>l.type),s=i.filter(l=>!(l&1)),a=t[e.id]>>1;function o(l){let u=[];for(let c=0;c<i.length;c++){let d=bv(l,i[c]);if(r[c]==2)for(let h of d)u.push(h);else u.push(d)}return e.combine(u)}return{create(l){for(let u of i)pf(l,u);return l.values[a]=o(l),1},update(l,u){if(!jA(l,s))return 0;let c=o(l);return e.compare(c,l.values[a])?0:(l.values[a]=c,1)},reconfigure(l,u){let c=jA(l,i),d=u.config.facets[e.id],h=u.facet(e);if(d&&!c&&WN(n,d))return l.values[a]=h,0;let f=o(l);return e.compare(f,h)?(l.values[a]=h,0):(l.values[a]=f,1)}}}const T_=et.define({static:!0});class Pi{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new Pi(YN++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(T_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(T_),a=r.facet(T_),o;return(o=s.find(l=>l.field==this))&&o!=a.find(l=>l.field==this)?(i.values[n]=o.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,T_.of({field:this,create:e})]}get extension(){return this}}const Oc={lowest:4,low:3,default:2,high:1,highest:0};function _h(t){return e=>new hY(e,t)}const Tu={highest:_h(Oc.highest),high:_h(Oc.high),default:_h(Oc.default),low:_h(Oc.low),lowest:_h(Oc.lowest)};class hY{constructor(e,n){this.inner=e,this.prec=n}}class Rd{of(e){return new QA(this,e)}reconfigure(e){return Rd.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class QA{constructor(e,n){this.compartment=e,this.inner=n}}class Sv{constructor(e,n,i,r,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),a=new Map;for(let h of cce(e,n,a))h instanceof Pi?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let o=Object.create(null),l=[],u=[];for(let h of r)o[h.id]=u.length<<1,u.push(f=>h.slot(f));let c=i==null?void 0:i.config.facets;for(let h in s){let f=s[h],S=f[0].facet,_=c&&c[h]||[];if(f.every(p=>p.type==0))if(o[S.id]=l.length<<1|1,WN(_,f))l.push(i.facet(S));else{let p=S.combine(f.map(v=>v.value));l.push(i&&S.compare(p,i.facet(S))?i.facet(S):p)}else{for(let p of f)p.type==0?(o[p.id]=l.length<<1|1,l.push(p.value)):(o[p.id]=u.length<<1,u.push(v=>p.dynamicSlot(v)));o[S.id]=u.length<<1,u.push(p=>lce(p,S,f))}}let d=u.map(h=>h(o));return new Sv(e,a,d,o,l,s)}}function cce(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(a,o){let l=r.get(a);if(l!=null){if(l<=o)return;let u=i[l].indexOf(a);u>-1&&i[l].splice(u,1),a instanceof QA&&n.delete(a.compartment)}if(r.set(a,o),Array.isArray(a))for(let u of a)s(u,o);else if(a instanceof QA){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(a.compartment)||a.inner;n.set(a.compartment,u),s(u,o)}else if(a instanceof hY)s(a.inner,a.prec);else if(a instanceof Pi)i[o].push(a),a.provides&&s(a.provides,o);else if(a instanceof lg)i[o].push(a),a.facet.extensions&&s(a.facet.extensions,Oc.default);else{let u=a.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,o)}}return s(t,Oc.default),i.reduce((a,o)=>a.concat(o))}function pf(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function bv(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const fY=et.define(),XA=et.define({combine:t=>t.some(e=>e),static:!0}),pY=et.define({combine:t=>t.length?t[0]:void 0,static:!0}),_Y=et.define(),mY=et.define(),gY=et.define(),vY=et.define({combine:t=>t.length?t[0]:!1});class qa{constructor(e,n){this.type=e,this.value=n}static define(){return new uce}}class uce{of(e){return new qa(this,e)}}class dce{constructor(e){this.map=e}of(e){return new Mt(this,e)}}class Mt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Mt(this.type,n)}is(e){return this.type==e}static define(e={}){return new dce(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}}Mt.reconfigure=Mt.define();Mt.appendConfig=Mt.define();class ki{constructor(e,n,i,r,s,a){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&dY(i,n.newLength),s.some(o=>o.type==ki.time)||(this.annotations=s.concat(ki.time.of(Date.now())))}static create(e,n,i,r,s,a){return new ki(e,n,i,r,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ki.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ki.time=qa.define();ki.userEvent=qa.define();ki.addToHistory=qa.define();ki.remote=qa.define();function hce(t,e){let n=[];for(let i=0,r=0;;){let s,a;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],a=t[i++];else if(r<e.length)s=e[r++],a=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function SY(t,e,n){var i;let r,s,a;return n?(r=e.changes,s=Ii.empty(e.changes.length),a=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:Mt.mapEffects(t.effects,r).concat(Mt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function ZA(t,e,n){let i=e.selection,r=cd(e.annotations);return e.userEvent&&(r=r.concat(ki.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ii?e.changes:Ii.of(e.changes||[],n,t.facet(pY)),selection:i&&(i instanceof Oe?i:Oe.single(i.anchor,i.head)),effects:cd(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function bY(t,e,n){let i=ZA(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;i=SY(i,ZA(t,e[s],a?i.changes.newLength:t.doc.length),a)}let r=ki.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return pce(n?fce(r):r)}function fce(t){let e=t.startState,n=!0;for(let r of e.facet(_Y)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:hce(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Ii.empty(e.doc.length);else{let a=t.changes.filter(n);r=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=ki.create(e,r,t.selection&&t.selection.map(s),Mt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(mY);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof ki?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ki?t=s[0]:t=bY(e,cd(s),!1)}return t}function pce(t){let e=t.startState,n=e.facet(gY),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=SY(i,ZA(e,s,t.changes.newLength),!0))}return i==t?t:ki.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const _ce=[];function cd(t){return t==null?_ce:Array.isArray(t)?t:[t]}var qn=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(qn||(qn={}));const mce=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let JA;try{JA=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gce(t){if(JA)return JA.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||mce.test(n)))return!0}return!1}function vce(t){return e=>{if(!/\S/.test(e))return qn.Space;if(gce(e))return qn.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return qn.Word;return qn.Other}}class Yt{constructor(e,n,i,r,s,a){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)pf(this,o<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return pf(this,i),bv(this,i)}update(...e){return bY(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let o of e.effects)o.is(Rd.reconfigure)?(n&&(r=new Map,n.compartments.forEach((l,u)=>r.set(u,l)),n=null),r.set(o.value.compartment,o.value.extension)):o.is(Mt.reconfigure)?(n=null,i=o.value):o.is(Mt.appendConfig)&&(n=null,i=cd(i).concat(o.value));let s;n?s=e.startState.values.slice():(n=Sv.resolve(i,r,this),s=new Yt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let a=e.startState.facet(XA)?e.newSelection:e.newSelection.asSingle();new Yt(n,e.newDoc,a,s,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Oe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=cd(i.effects);for(let o=1;o<n.ranges.length;o++){let l=e(n.ranges[o]),u=this.changes(l.changes),c=u.map(r);for(let h=0;h<o;h++)s[h]=s[h].map(c);let d=r.mapDesc(u,!0);s.push(l.range.map(d)),r=r.compose(c),a=Mt.mapEffects(a,c).concat(Mt.mapEffects(cd(l.effects),d))}return{changes:r,selection:Oe.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof Ii?e:Ii.of(e,this.doc.length,this.facet(Yt.lineSeparator))}toText(e){return _n.of(e.split(this.facet(Yt.lineSeparator)||YA))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(pf(this,n),bv(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Pi&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let a=i[s],o=e[s];r.push(a.init(l=>a.spec.fromJSON(o,l)))}}return Yt.create({doc:e.doc,selection:Oe.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=Sv.resolve(e.extensions||[],new Map),i=e.doc instanceof _n?e.doc:_n.of((e.doc||"").split(n.staticFacet(Yt.lineSeparator)||YA)),r=e.selection?e.selection instanceof Oe?e.selection:Oe.single(e.selection.anchor,e.selection.head):Oe.single(0);return dY(r,i.length),n.staticFacet(XA)||(r=r.asSingle()),new Yt(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Yt.tabSize)}get lineBreak(){return this.facet(Yt.lineSeparator)||`
@@ -241,4 +241,4 @@ void main() {
241
241
  }`)),this.register((0,c.toDisposable)(()=>A.deleteProgram(this._program))),this._projectionLocation=(0,u.throwIfFalsy)(A.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=A.createVertexArray(),A.bindVertexArray(this._vertexArrayObject);const x=new Float32Array([0,0,1,0,0,1,1,1]),O=A.createBuffer();this.register((0,c.toDisposable)(()=>A.deleteBuffer(O))),A.bindBuffer(A.ARRAY_BUFFER,O),A.bufferData(A.ARRAY_BUFFER,x,A.STATIC_DRAW),A.enableVertexAttribArray(3),A.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),L=A.createBuffer();this.register((0,c.toDisposable)(()=>A.deleteBuffer(L))),A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,L),A.bufferData(A.ELEMENT_ARRAY_BUFFER,D,A.STATIC_DRAW),this._attributesBuffer=(0,u.throwIfFalsy)(A.createBuffer()),this.register((0,c.toDisposable)(()=>A.deleteBuffer(this._attributesBuffer))),A.bindBuffer(A.ARRAY_BUFFER,this._attributesBuffer),A.enableVertexAttribArray(0),A.vertexAttribPointer(0,2,A.FLOAT,!1,f,0),A.vertexAttribDivisor(0,1),A.enableVertexAttribArray(1),A.vertexAttribPointer(1,2,A.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),A.vertexAttribDivisor(1,1),A.enableVertexAttribArray(2),A.vertexAttribPointer(2,4,A.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),A.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors(q=>{this._updateCachedColors(q),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(C){const w=this._gl;w.useProgram(this._program),w.bindVertexArray(this._vertexArrayObject),w.uniformMatrix4fv(this._projectionLocation,!1,h.PROJECTION_MATRIX),w.bindBuffer(w.ARRAY_BUFFER,this._attributesBuffer),w.bufferData(w.ARRAY_BUFFER,C.attributes,w.DYNAMIC_DRAW),w.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,w.UNSIGNED_BYTE,0,C.count)}handleResize(){this._updateViewportRectangle()}setDimensions(C){this._dimensions=C}_updateCachedColors(C){this._bgFloat=this._colorToFloat32Array(C.background),this._cursorFloat=this._colorToFloat32Array(C.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(C){const w=this._terminal,R=this._vertices;let I,A,x,O,D,L,q,G,M,P,N,U=1;for(I=0;I<w.rows;I++){for(x=-1,O=0,D=0,L=!1,A=0;A<w.cols;A++)q=(I*w.cols+A)*d.RENDER_MODEL_INDICIES_PER_CELL,G=C.cells[q+d.RENDER_MODEL_BG_OFFSET],M=C.cells[q+d.RENDER_MODEL_FG_OFFSET],P=!!(67108864&M),(G!==O||M!==D&&(L||P))&&((O!==0||L&&D!==0)&&(N=8*U++,this._updateRectangle(R,N,D,O,x,A,I)),x=A,O=G,D=M,L=P);(O!==0||L&&D!==0)&&(N=8*U++,this._updateRectangle(R,N,D,O,x,w.cols,I))}R.count=U}updateCursor(C){const w=this._verticesCursor,R=C.cursor;if(!R||R.style==="block")return void(w.count=0);let I,A=0;R.style!=="bar"&&R.style!=="outline"||(I=8*A++,this._addRectangleFloat(w.attributes,I,R.x*this._dimensions.device.cell.width,R.y*this._dimensions.device.cell.height,R.style==="bar"?R.dpr*R.cursorWidth:R.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.style!=="underline"&&R.style!=="outline"||(I=8*A++,this._addRectangleFloat(w.attributes,I,R.x*this._dimensions.device.cell.width,(R.y+1)*this._dimensions.device.cell.height-R.dpr,R.width*this._dimensions.device.cell.width,R.dpr,this._cursorFloat)),R.style==="outline"&&(I=8*A++,this._addRectangleFloat(w.attributes,I,R.x*this._dimensions.device.cell.width,R.y*this._dimensions.device.cell.height,R.width*this._dimensions.device.cell.width,R.dpr,this._cursorFloat),I=8*A++,this._addRectangleFloat(w.attributes,I,(R.x+R.width)*this._dimensions.device.cell.width-R.dpr,R.y*this._dimensions.device.cell.height,R.dpr,this._dimensions.device.cell.height,this._cursorFloat)),w.count=A}_updateRectangle(C,w,R,I,A,x,O){if(67108864&R)switch(50331648&R){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&R].rgba;break;case 50331648:_=(16777215&R)<<8;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:_=(16777215&I)<<8;break;default:_=this._themeService.colors.background.rgba}C.attributes.length<w+4&&(C.attributes=(0,h.expandFloat32Array)(C.attributes,this._terminal.rows*this._terminal.cols*8)),p=A*this._dimensions.device.cell.width,v=O*this._dimensions.device.cell.height,m=(_>>24&255)/255,g=(_>>16&255)/255,b=(_>>8&255)/255,y=1,this._addRectangle(C.attributes,w,p,v,(x-A)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,m,g,b,y)}_addRectangle(C,w,R,I,A,x,O,D,L,q){C[w]=R/this._dimensions.device.canvas.width,C[w+1]=I/this._dimensions.device.canvas.height,C[w+2]=A/this._dimensions.device.canvas.width,C[w+3]=x/this._dimensions.device.canvas.height,C[w+4]=O,C[w+5]=D,C[w+6]=L,C[w+7]=q}_addRectangleFloat(C,w,R,I,A,x,O){C[w]=R/this._dimensions.device.canvas.width,C[w+1]=I/this._dimensions.device.canvas.height,C[w+2]=A/this._dimensions.device.canvas.width,C[w+3]=x/this._dimensions.device.canvas.height,C[w+4]=O[0],C[w+5]=O[1],C[w+6]=O[2],C[w+7]=O[3]}_colorToFloat32Array(C){return new Float32Array([(C.rgba>>24&255)/255,(C.rgba>>16&255)/255,(C.rgba>>8&255)/255,(255&C.rgba)/255])}}o.RectangleRenderer=E},310:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderModel=o.COMBINED_CHAR_BIT_MASK=o.RENDER_MODEL_EXT_OFFSET=o.RENDER_MODEL_FG_OFFSET=o.RENDER_MODEL_BG_OFFSET=o.RENDER_MODEL_INDICIES_PER_CELL=void 0;const u=l(296);o.RENDER_MODEL_INDICIES_PER_CELL=4,o.RENDER_MODEL_BG_OFFSET=1,o.RENDER_MODEL_FG_OFFSET=2,o.RENDER_MODEL_EXT_OFFSET=3,o.COMBINED_CHAR_BIT_MASK=2147483648,o.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,u.createSelectionRenderModel)()}resize(c,d){const h=c*d*o.RENDER_MODEL_INDICIES_PER_CELL;h!==this.cells.length&&(this.cells=new Uint32Array(h),this.lineLengths=new Uint32Array(d))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.JoinedCellData=o.WebglRenderer=void 0;const u=l(820),c=l(274),d=l(627),h=l(457),f=l(56),S=l(374),_=l(345),p=l(859),v=l(147),m=l(782),g=l(855),b=l(965),y=l(742),E=l(310),T=l(733);class C extends p.Disposable{constructor(A,x,O,D,L,q,G,M,P){super(),this._terminal=A,this._characterJoinerService=x,this._charSizeService=O,this._coreBrowserService=D,this._coreService=L,this._decorationService=q,this._optionsService=G,this._themeService=M,this._cursorBlinkStateManager=new p.MutableDisposable,this._charAtlasDisposable=this.register(new p.MutableDisposable),this._observerDisposable=this.register(new p.MutableDisposable),this._model=new E.RenderModel,this._workCell=new m.CellData,this._workCell2=new m.CellData,this._rectangleRenderer=this.register(new p.MutableDisposable),this._glyphRenderer=this.register(new p.MutableDisposable),this._onChangeTextureAtlas=this.register(new _.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new _.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new _.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new T.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,G,this._themeService)],this.dimensions=(0,S.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(G.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const N={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",N),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,u.addDisposableDomListener)(this._canvas,"webglcontextlost",U=>{console.log("webglcontextlost event received"),U.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(U)},3e3)})),this.register((0,u.addDisposableDomListener)(this._canvas,"webglcontextrestored",U=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,d.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(U,F)=>this._setCanvasDevicePixelDimensions(U,F)),this.register(this._coreBrowserService.onWindowChange(U=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,U,(F,k)=>this._setCanvasDevicePixelDimensions(F,k))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,p.toDisposable)(()=>{var U;for(const F of this._renderLayers)F.dispose();(U=this._canvas.parentElement)==null||U.removeChild(this._canvas),(0,d.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var A;return(A=this._charAtlas)==null?void 0:A.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(A,x){var O,D,L,q;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const G of this._renderLayers)G.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(O=this._rectangleRenderer.value)==null||O.setDimensions(this.dimensions),(D=this._rectangleRenderer.value)==null||D.handleResize(),(L=this._glyphRenderer.value)==null||L.setDimensions(this.dimensions),(q=this._glyphRenderer.value)==null||q.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var A;for(const x of this._renderLayers)x.handleBlur(this._terminal);(A=this._cursorBlinkStateManager.value)==null||A.pause(),this._requestRedrawViewport()}handleFocus(){var A;for(const x of this._renderLayers)x.handleFocus(this._terminal);(A=this._cursorBlinkStateManager.value)==null||A.resume(),this._requestRedrawViewport()}handleSelectionChanged(A,x,O){for(const D of this._renderLayers)D.handleSelectionChanged(this._terminal,A,x,O);this._model.selection.update(this._core,A,x,O),this._requestRedrawViewport()}handleCursorMove(){var A;for(const x of this._renderLayers)x.handleCursorMove(this._terminal);(A=this._cursorBlinkStateManager.value)==null||A.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new y.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var x;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const A=(0,d.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==A&&(this._onChangeTextureAtlas.fire(A.pages[0].canvas),this._charAtlasDisposable.value=(0,p.getDisposeArrayDisposable)([(0,_.forwardEvent)(A.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,_.forwardEvent)(A.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=A,this._charAtlas.warmUp(),(x=this._glyphRenderer.value)==null||x.setAtlas(this._charAtlas)}_clearModel(A){var x;this._model.clear(),A&&((x=this._glyphRenderer.value)==null||x.clear())}clearTextureAtlas(){var A;(A=this._charAtlas)==null||A.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var A;this._clearModel(!0);for(const x of this._renderLayers)x.reset(this._terminal);(A=this._cursorBlinkStateManager.value)==null||A.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(A){return-1}deregisterCharacterJoiner(A){return!1}renderRows(A,x){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const O of this._renderLayers)O.handleGridChanged(this._terminal,A,x);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(A,x),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new h.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(A,x){const O=this._core;let D,L,q,G,M,P,N,U,F,k,H,X,K,z,re=this._workCell;A=R(A,O.rows-1,0),x=R(x,O.rows-1,0);const ne=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Z=ne-O.buffer.ydisp,J=Math.min(this._terminal.buffer.active.cursorX,O.cols-1);let V=-1;const $=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Y=!1;for(L=A;L<=x;L++)for(q=L+O.buffer.ydisp,G=O.buffer.lines.get(q),this._model.lineLengths[L]=0,M=this._characterJoinerService.getJoinedCharacters(q),K=0;K<O.cols;K++)if(D=this._cellColorResolver.result.bg,G.loadCell(K,re),K===0&&(D=this._cellColorResolver.result.bg),P=!1,N=K,M.length>0&&K===M[0][0]&&(P=!0,U=M.shift(),re=new w(re,G.translateToString(!0,U[0],U[1]),U[1]-U[0]),N=U[1]-1),F=re.getChars(),k=re.getCode(),X=(L*O.cols+K)*E.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,K,q,this.dimensions.device.cell.width),$&&q===ne&&(K===J&&(this._model.cursor={x:J,y:Z,width:re.getWidth(),style:this._coreBrowserService.isFocused?O.options.cursorStyle||"block":O.options.cursorInactiveStyle,cursorWidth:O.options.cursorWidth,dpr:this._devicePixelRatio},V=J+re.getWidth()-1),K>=J&&K<=V&&(this._coreBrowserService.isFocused&&(O.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&O.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),k!==g.NULL_CELL_CODE&&(this._model.lineLengths[L]=K+1),(this._model.cells[X]!==k||this._model.cells[X+E.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[X+E.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[X+E.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Y=!0,F.length>1&&(k|=E.COMBINED_CHAR_BIT_MASK),this._model.cells[X]=k,this._model.cells[X+E.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[X+E.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[X+E.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,H=re.getWidth(),this._glyphRenderer.value.updateCell(K,L,k,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,F,H,D),P))for(re=this._workCell,K++;K<N;K++)z=(L*O.cols+K)*E.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(K,L,g.NULL_CELL_CODE,0,0,0,g.NULL_CELL_CHAR,0,0),this._model.cells[z]=g.NULL_CELL_CODE,this._model.cells[z+E.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[z+E.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[z+E.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Y&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(A,x){this._canvas.width===A&&this._canvas.height===x||(this._canvas.width=A,this._canvas.height=x,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const A=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:A,end:A})}}o.WebglRenderer=C;class w extends v.AttributeData{constructor(A,x,O){super(),this.content=0,this.combinedData="",this.fg=A.fg,this.bg=A.bg,this.combinedData=x,this._width=O}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(A){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function R(I,A,x=0){return Math.max(Math.min(I,A),x)}o.JoinedCellData=w},381:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GLTexture=o.expandFloat32Array=o.createShader=o.createProgram=o.PROJECTION_MATRIX=void 0;const u=l(374);function c(d,h,f){const S=(0,u.throwIfFalsy)(d.createShader(h));if(d.shaderSource(S,f),d.compileShader(S),d.getShaderParameter(S,d.COMPILE_STATUS))return S;console.error(d.getShaderInfoLog(S)),d.deleteShader(S)}o.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),o.createProgram=function(d,h,f){const S=(0,u.throwIfFalsy)(d.createProgram());if(d.attachShader(S,(0,u.throwIfFalsy)(c(d,d.VERTEX_SHADER,h))),d.attachShader(S,(0,u.throwIfFalsy)(c(d,d.FRAGMENT_SHADER,f))),d.linkProgram(S),d.getProgramParameter(S,d.LINK_STATUS))return S;console.error(d.getProgramInfoLog(S)),d.deleteProgram(S)},o.createShader=c,o.expandFloat32Array=function(d,h){const f=Math.min(2*d.length,h),S=new Float32Array(f);for(let _=0;_<d.length;_++)S[_]=d[_];return S},o.GLTexture=class{constructor(d){this.texture=d,this.version=-1}}},592:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseRenderLayer=void 0;const u=l(627),c=l(237),d=l(374),h=l(859);class f extends h.Disposable{constructor(_,p,v,m,g,b,y,E){super(),this._container=p,this._alpha=g,this._coreBrowserService=b,this._optionsService=y,this._themeService=E,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${v}-layer`),this._canvas.style.zIndex=m.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(T=>{this._refreshCharAtlas(_,T),this.reset(_)})),this.register((0,h.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,d.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(_){}handleFocus(_){}handleCursorMove(_){}handleGridChanged(_,p,v){}handleSelectionChanged(_,p,v,m=!1){}_setTransparency(_,p){if(p===this._alpha)return;const v=this._canvas;this._alpha=p,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,v),this._refreshCharAtlas(_,this._themeService.colors),this.handleGridChanged(_,0,_.rows-1)}_refreshCharAtlas(_,p){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,u.acquireTextureAtlas)(_,this._optionsService.rawOptions,p,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(_,p){this._deviceCellWidth=p.device.cell.width,this._deviceCellHeight=p.device.cell.height,this._deviceCharWidth=p.device.char.width,this._deviceCharHeight=p.device.char.height,this._deviceCharLeft=p.device.char.left,this._deviceCharTop=p.device.char.top,this._canvas.width=p.device.canvas.width,this._canvas.height=p.device.canvas.height,this._canvas.style.width=`${p.css.canvas.width}px`,this._canvas.style.height=`${p.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(_,this._themeService.colors)}_fillBottomLineAtCells(_,p,v=1){this._ctx.fillRect(_*this._deviceCellWidth,(p+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,v*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(_,p,v,m){this._alpha?this._ctx.clearRect(_*this._deviceCellWidth,p*this._deviceCellHeight,v*this._deviceCellWidth,m*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(_*this._deviceCellWidth,p*this._deviceCellHeight,v*this._deviceCellWidth,m*this._deviceCellHeight))}_fillCharTrueColor(_,p,v,m){this._ctx.font=this._getFont(_,!1,!1),this._ctx.textBaseline=c.TEXT_BASELINE,this._clipCell(v,m,p.getWidth()),this._ctx.fillText(p.getChars(),v*this._deviceCellWidth+this._deviceCharLeft,m*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(_,p,v){this._ctx.beginPath(),this._ctx.rect(_*this._deviceCellWidth,p*this._deviceCellHeight,v*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(_,p,v){return`${v?"italic":""} ${p?_.options.fontWeightBold:_.options.fontWeight} ${_.options.fontSize*this._coreBrowserService.dpr}px ${_.options.fontFamily}`}}o.BaseRenderLayer=f},733:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const u=l(197),c=l(237),d=l(592);class h extends d.BaseRenderLayer{constructor(S,_,p,v,m,g,b){super(p,S,"link",_,!0,m,g,b),this.register(v.onShowLinkUnderline(y=>this._handleShowLinkUnderline(y))),this.register(v.onHideLinkUnderline(y=>this._handleHideLinkUnderline(y)))}resize(S,_){super.resize(S,_),this._state=void 0}reset(S){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg!==void 0&&(0,u.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let _=S.y1+1;_<S.y2;_++)this._fillBottomLineAtCells(0,_,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}o.LinkRenderLayer=h},820:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,c,d){l.addEventListener(u,c,d);let h=!1;return{dispose:()=>{h||(h=!0,l.removeEventListener(u,c,d))}}}},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const u=l(855),c=l(160),d=l(374);let h,f=0,S=0,_=!1,p=!1,v=!1,m=0;o.CellColorResolver=class{constructor(g,b,y,E,T,C){this._terminal=g,this._optionService=b,this._selectionRenderModel=y,this._decorationService=E,this._coreBrowserService=T,this._themeService=C,this.result={fg:0,bg:0,ext:0}}resolve(g,b,y,E){if(this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,S=0,f=0,p=!1,_=!1,v=!1,h=this._themeService.colors,m=0,g.getCode()!==u.NULL_CELL_CODE&&g.extended.underlineStyle===4){const T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));m=b*E%(2*Math.round(T))}if(this._decorationService.forEachDecorationAtCell(b,y,"bottom",T=>{T.backgroundColorRGB&&(S=T.backgroundColorRGB.rgba>>8&16777215,p=!0),T.foregroundColorRGB&&(f=T.foregroundColorRGB.rgba>>8&16777215,_=!0)}),v=this._selectionRenderModel.isCellSelected(this._terminal,b,y),v){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}S=c.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else S=(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(p=!0,h.selectionForeground&&(f=h.selectionForeground.rgba>>8&16777215,_=!0),(0,d.treatGlyphAsBackgroundColor)(g.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=c.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(b,y,"top",T=>{T.backgroundColorRGB&&(S=T.backgroundColorRGB.rgba>>8&16777215,p=!0),T.foregroundColorRGB&&(f=T.foregroundColorRGB.rgba>>8&16777215,_=!0)}),p&&(S=v?-16777216&g.bg&-134217729|S|50331648:-16777216&g.bg|S|50331648),_&&(f=-16777216&g.fg&-67108865|f|50331648),67108864&this.result.fg&&(p&&!_&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&h.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,_=!0),!p&&_&&(S=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&h.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,p=!0)),h=void 0,this.result.bg=p?S:this.result.bg,this.result.fg=_?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=m<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const u=l(509),c=l(197),d=[];o.acquireTextureAtlas=function(h,f,S,_,p,v,m,g){const b=(0,c.generateConfig)(_,p,v,m,f,S,g);for(let T=0;T<d.length;T++){const C=d[T],w=C.ownedBy.indexOf(h);if(w>=0){if((0,c.configEquals)(C.config,b))return C.atlas;C.ownedBy.length===1?(C.atlas.dispose(),d.splice(T,1)):C.ownedBy.splice(w,1);break}}for(let T=0;T<d.length;T++){const C=d[T];if((0,c.configEquals)(C.config,b))return C.ownedBy.push(h),C.atlas}const y=h._core,E={atlas:new u.TextureAtlas(document,b,y.unicodeService),config:b,ownedBy:[h]};return d.push(E),E.atlas},o.removeTerminalFromCache=function(h){for(let f=0;f<d.length;f++){const S=d[f].ownedBy.indexOf(h);if(S!==-1){d[f].ownedBy.length===1?(d[f].atlas.dispose(),d.splice(f,1)):d[f].ownedBy.splice(S,1);break}}}},197:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const u=l(160);o.generateConfig=function(c,d,h,f,S,_,p){const v={foreground:_.foreground,background:_.background,cursor:u.NULL_COLOR,cursorAccent:u.NULL_COLOR,selectionForeground:u.NULL_COLOR,selectionBackgroundTransparent:u.NULL_COLOR,selectionBackgroundOpaque:u.NULL_COLOR,selectionInactiveBackgroundTransparent:u.NULL_COLOR,selectionInactiveBackgroundOpaque:u.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:p,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:c,deviceCellHeight:d,deviceCharWidth:h,deviceCharHeight:f,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:v}},o.configEquals=function(c,d){for(let h=0;h<c.colors.ansi.length;h++)if(c.colors.ansi[h].rgba!==d.colors.ansi[h].rgba)return!1;return c.devicePixelRatio===d.devicePixelRatio&&c.customGlyphs===d.customGlyphs&&c.lineHeight===d.lineHeight&&c.letterSpacing===d.letterSpacing&&c.fontFamily===d.fontFamily&&c.fontSize===d.fontSize&&c.fontWeight===d.fontWeight&&c.fontWeightBold===d.fontWeightBold&&c.allowTransparency===d.allowTransparency&&c.deviceCharWidth===d.deviceCharWidth&&c.deviceCharHeight===d.deviceCharHeight&&c.drawBoldTextInBrightColors===d.drawBoldTextInBrightColors&&c.minimumContrastRatio===d.minimumContrastRatio&&c.colors.foreground.rgba===d.colors.foreground.rgba&&c.colors.background.rgba===d.colors.background.rgba},o.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},457:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.CursorBlinkStateManager=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,u>0)return void this._restartInterval(u)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(u)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const u=l(374);o.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};o.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(_,p)=>`M0,${.5-p} L1,${.5-p} M0,${.5+p} L1,${.5+p}`},"║":{1:(_,p)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╒":{1:(_,p)=>`M.5,1 L.5,${.5-p} L1,${.5-p} M.5,${.5+p} L1,${.5+p}`},"╓":{1:(_,p)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"╔":{1:(_,p)=>`M1,${.5-p} L${.5-_},${.5-p} L${.5-_},1 M1,${.5+p} L${.5+_},${.5+p} L${.5+_},1`},"╕":{1:(_,p)=>`M0,${.5-p} L.5,${.5-p} L.5,1 M0,${.5+p} L.5,${.5+p}`},"╖":{1:(_,p)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"╗":{1:(_,p)=>`M0,${.5+p} L${.5-_},${.5+p} L${.5-_},1 M0,${.5-p} L${.5+_},${.5-p} L${.5+_},1`},"╘":{1:(_,p)=>`M.5,0 L.5,${.5+p} L1,${.5+p} M.5,${.5-p} L1,${.5-p}`},"╙":{1:(_,p)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╚":{1:(_,p)=>`M1,${.5-p} L${.5+_},${.5-p} L${.5+_},0 M1,${.5+p} L${.5-_},${.5+p} L${.5-_},0`},"╛":{1:(_,p)=>`M0,${.5+p} L.5,${.5+p} L.5,0 M0,${.5-p} L.5,${.5-p}`},"╜":{1:(_,p)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"╝":{1:(_,p)=>`M0,${.5-p} L${.5-_},${.5-p} L${.5-_},0 M0,${.5+p} L${.5+_},${.5+p} L${.5+_},0`},"╞":{1:(_,p)=>`M.5,0 L.5,1 M.5,${.5-p} L1,${.5-p} M.5,${.5+p} L1,${.5+p}`},"╟":{1:(_,p)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"╠":{1:(_,p)=>`M${.5-_},0 L${.5-_},1 M1,${.5+p} L${.5+_},${.5+p} L${.5+_},1 M1,${.5-p} L${.5+_},${.5-p} L${.5+_},0`},"╡":{1:(_,p)=>`M.5,0 L.5,1 M0,${.5-p} L.5,${.5-p} M0,${.5+p} L.5,${.5+p}`},"╢":{1:(_,p)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╣":{1:(_,p)=>`M${.5+_},0 L${.5+_},1 M0,${.5+p} L${.5-_},${.5+p} L${.5-_},1 M0,${.5-p} L${.5-_},${.5-p} L${.5-_},0`},"╤":{1:(_,p)=>`M0,${.5-p} L1,${.5-p} M0,${.5+p} L1,${.5+p} M.5,${.5+p} L.5,1`},"╥":{1:(_,p)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"╦":{1:(_,p)=>`M0,${.5-p} L1,${.5-p} M0,${.5+p} L${.5-_},${.5+p} L${.5-_},1 M1,${.5+p} L${.5+_},${.5+p} L${.5+_},1`},"╧":{1:(_,p)=>`M.5,0 L.5,${.5-p} M0,${.5-p} L1,${.5-p} M0,${.5+p} L1,${.5+p}`},"╨":{1:(_,p)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╩":{1:(_,p)=>`M0,${.5+p} L1,${.5+p} M0,${.5-p} L${.5-_},${.5-p} L${.5-_},0 M1,${.5-p} L${.5+_},${.5-p} L${.5+_},0`},"╪":{1:(_,p)=>`M.5,0 L.5,1 M0,${.5-p} L1,${.5-p} M0,${.5+p} L1,${.5+p}`},"╫":{1:(_,p)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╬":{1:(_,p)=>`M0,${.5+p} L${.5-_},${.5+p} L${.5-_},1 M1,${.5+p} L${.5+_},${.5+p} L${.5+_},1 M0,${.5-p} L${.5-_},${.5-p} L${.5-_},0 M1,${.5-p} L${.5+_},${.5-p} L${.5+_},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(_,p)=>`M.5,1 L.5,${.5+p/.15*.5} C.5,${.5+p/.15*.5},.5,.5,1,.5`},"╮":{1:(_,p)=>`M.5,1 L.5,${.5+p/.15*.5} C.5,${.5+p/.15*.5},.5,.5,0,.5`},"╯":{1:(_,p)=>`M.5,0 L.5,${.5-p/.15*.5} C.5,${.5-p/.15*.5},.5,.5,0,.5`},"╰":{1:(_,p)=>`M.5,0 L.5,${.5-p/.15*.5} C.5,${.5-p/.15*.5},.5,.5,1,.5`}},o.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.tryDrawCustomChar=function(_,p,v,m,g,b,y,E){const T=o.blockElementDefinitions[p];if(T)return function(I,A,x,O,D,L){for(let q=0;q<A.length;q++){const G=A[q],M=D/8,P=L/8;I.fillRect(x+G.x*M,O+G.y*P,G.w*M,G.h*P)}}(_,T,v,m,g,b),!0;const C=c[p];if(C)return function(I,A,x,O,D,L){let q=d.get(A);q||(q=new Map,d.set(A,q));const G=I.fillStyle;if(typeof G!="string")throw new Error(`Unexpected fillStyle type "${G}"`);let M=q.get(G);if(!M){const P=A[0].length,N=A.length,U=I.canvas.ownerDocument.createElement("canvas");U.width=P,U.height=N;const F=(0,u.throwIfFalsy)(U.getContext("2d")),k=new ImageData(P,N);let H,X,K,z;if(G.startsWith("#"))H=parseInt(G.slice(1,3),16),X=parseInt(G.slice(3,5),16),K=parseInt(G.slice(5,7),16),z=G.length>7&&parseInt(G.slice(7,9),16)||1;else{if(!G.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${G}" when drawing pattern glyph`);[H,X,K,z]=G.substring(5,G.length-1).split(",").map(re=>parseFloat(re))}for(let re=0;re<N;re++)for(let ne=0;ne<P;ne++)k.data[4*(re*P+ne)]=H,k.data[4*(re*P+ne)+1]=X,k.data[4*(re*P+ne)+2]=K,k.data[4*(re*P+ne)+3]=A[re][ne]*(255*z);F.putImageData(k,0,0),M=(0,u.throwIfFalsy)(I.createPattern(U,null)),q.set(G,M)}I.fillStyle=M,I.fillRect(x,O,D,L)}(_,C,v,m,g,b),!0;const w=o.boxDrawingDefinitions[p];if(w)return function(I,A,x,O,D,L,q){I.strokeStyle=I.fillStyle;for(const[G,M]of Object.entries(A)){let P;I.beginPath(),I.lineWidth=q*Number.parseInt(G),P=typeof M=="function"?M(.15,.15/L*D):M;for(const N of P.split(" ")){const U=N[0],F=f[U];if(!F){console.error(`Could not find drawing instructions for "${U}"`);continue}const k=N.substring(1).split(",");k[0]&&k[1]&&F(I,S(k,D,L,x,O,!0,q))}I.stroke(),I.closePath()}}(_,w,v,m,g,b,E),!0;const R=o.powerlineDefinitions[p];return!!R&&(function(I,A,x,O,D,L,q,G){const M=new Path2D;M.rect(x,O,D,L),I.clip(M),I.beginPath();const P=q/12;I.lineWidth=G*P;for(const N of A.d.split(" ")){const U=N[0],F=f[U];if(!F){console.error(`Could not find drawing instructions for "${U}"`);continue}const k=N.substring(1).split(",");k[0]&&k[1]&&F(I,S(k,D,L,x,O,!1,G,(A.leftPadding??0)*(P/2),(A.rightPadding??0)*(P/2)))}A.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()}(_,R,v,m,g,b,y,E),!0)};const d=new Map;function h(_,p,v=0){return Math.max(Math.min(_,p),v)}const f={C:(_,p)=>_.bezierCurveTo(p[0],p[1],p[2],p[3],p[4],p[5]),L:(_,p)=>_.lineTo(p[0],p[1]),M:(_,p)=>_.moveTo(p[0],p[1])};function S(_,p,v,m,g,b,y,E=0,T=0){const C=_.map(w=>parseFloat(w)||parseInt(w));if(C.length<2)throw new Error("Too few arguments for instruction");for(let w=0;w<C.length;w+=2)C[w]*=p-E*y-T*y,b&&C[w]!==0&&(C[w]=h(Math.round(C[w]+.5)-.5,p,0)),C[w]+=m+E*y;for(let w=1;w<C.length;w+=2)C[w]*=v,b&&C[w]!==0&&(C[w]=h(Math.round(C[w]+.5)-.5,v,0)),C[w]+=g;return C}},56:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const u=l(859);o.observeDevicePixelDimensions=function(c,d,h){let f=new d.ResizeObserver(S=>{const _=S.find(m=>m.target===c);if(!_)return;if(!("devicePixelContentBoxSize"in _))return f==null||f.disconnect(),void(f=void 0);const p=_.devicePixelContentBoxSize[0].inlineSize,v=_.devicePixelContentBoxSize[0].blockSize;p>0&&v>0&&h(p,v)});try{f.observe(c,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,u.toDisposable)(()=>f==null?void 0:f.disconnect())}},374:(a,o)=>{function l(c){return 57508<=c&&c<=57558}function u(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},o.isEmoji=u,o.allowRescaling=function(c,d,h,f){return d===1&&h>Math.ceil(1.5*f)&&c!==void 0&&c>255&&!u(c)&&!l(c)&&!function(S){return 57344<=S&&S<=63743}(c)},o.treatGlyphAsBackgroundColor=function(c){return l(c)||function(d){return 9472<=d&&d<=9631}(c)},o.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}}}},o.computeNextVariantOffset=function(c,d,h=0){return(c-(2*Math.round(d)-h))%(2*Math.round(d))}},296:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,d,h,f=!1){if(this.selectionStart=d,this.selectionEnd=h,!d||!h||d[0]===h[0]&&d[1]===h[1])return void this.clear();const S=c.buffers.active.ydisp,_=d[1]-S,p=h[1]-S,v=Math.max(_,0),m=Math.min(p,c.rows-1);v>=c.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=_,this.viewportEndRow=p,this.viewportCappedStartRow=v,this.viewportCappedEndRow=m,this.startCol=d[0],this.endCol=h[0])}isCellSelected(c,d,h){return!!this.hasSelection&&(h-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&h>=this.viewportCappedStartRow&&d<this.endCol&&h<=this.viewportCappedEndRow:d<this.startCol&&h>=this.viewportCappedStartRow&&d>=this.endCol&&h<=this.viewportCappedEndRow:h>this.viewportStartRow&&h<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&h===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},509:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const u=l(237),c=l(860),d=l(374),h=l(160),f=l(345),S=l(485),_=l(385),p=l(147),v=l(855),m={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let g;class b{get pages(){return this._pages}constructor(w,R,I){this._document=w,this._config=R,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new S.FourKeyMap,this._cacheMapCombined=new S.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new p.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(w,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const w of this.pages)w.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const w=new _.IdleTaskQueue;for(let R=33;R<126;R++)w.enqueue(()=>{if(!this._cacheMap.get(R,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT)){const I=this._drawToCache(R,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT);this._cacheMap.set(R,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT,I)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const w of this._pages)w.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const R=this._pages.filter(q=>2*q.canvas.width<=(b.maxTextureSize||4096)).sort((q,G)=>G.canvas.width!==q.canvas.width?G.canvas.width-q.canvas.width:G.percentageUsed-q.percentageUsed);let I=-1,A=0;for(let q=0;q<R.length;q++)if(R[q].canvas.width!==A)I=q,A=R[q].canvas.width;else if(q-I==3)break;const x=R.slice(I,I+4),O=x.map(q=>q.glyphs[0].texturePage).sort((q,G)=>q>G?1:-1),D=this.pages.length-x.length,L=this._mergePages(x,D);L.version++;for(let q=O.length-1;q>=0;q--)this._deletePage(O[q]);this.pages.push(L),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(L.canvas)}const w=new y(this._document,this._textureSize);return this._pages.push(w),this._activePages.push(w),this._onAddTextureAtlasCanvas.fire(w.canvas),w}_mergePages(w,R){const I=2*w[0].canvas.width,A=new y(this._document,I,w);for(const[x,O]of w.entries()){const D=x*O.canvas.width%I,L=Math.floor(x/2)*O.canvas.height;A.ctx.drawImage(O.canvas,D,L);for(const G of O.glyphs)G.texturePage=R,G.sizeClipSpace.x=G.size.x/I,G.sizeClipSpace.y=G.size.y/I,G.texturePosition.x+=D,G.texturePosition.y+=L,G.texturePositionClipSpace.x=G.texturePosition.x/I,G.texturePositionClipSpace.y=G.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(O.canvas);const q=this._activePages.indexOf(O);q!==-1&&this._activePages.splice(q,1)}return A}_deletePage(w){this._pages.splice(w,1);for(let R=w;R<this._pages.length;R++){const I=this._pages[R];for(const A of I.glyphs)A.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(w,R,I,A,x){return this._getFromCacheMap(this._cacheMapCombined,w,R,I,A,x)}getRasterizedGlyph(w,R,I,A,x){return this._getFromCacheMap(this._cacheMap,w,R,I,A,x)}_getFromCacheMap(w,R,I,A,x,O=!1){return g=w.get(R,I,A,x),g||(g=this._drawToCache(R,I,A,x,O),w.set(R,I,A,x,g)),g}_getColorFromAnsiIndex(w){if(w>=this._config.colors.ansi.length)throw new Error("No color found for idx "+w);return this._config.colors.ansi[w]}_getBackgroundColor(w,R,I,A){if(this._config.allowTransparency)return h.NULL_COLOR;let x;switch(w){case 16777216:case 33554432:x=this._getColorFromAnsiIndex(R);break;case 50331648:const O=p.AttributeData.toColorRGB(R);x=h.channels.toColor(O[0],O[1],O[2]);break;default:x=I?h.color.opaque(this._config.colors.foreground):this._config.colors.background}return x}_getForegroundColor(w,R,I,A,x,O,D,L,q,G){const M=this._getMinimumContrastColor(w,R,I,A,x,O,D,q,L,G);if(M)return M;let P;switch(x){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&q&&O<8&&(O+=8),P=this._getColorFromAnsiIndex(O);break;case 50331648:const N=p.AttributeData.toColorRGB(O);P=h.channels.toColor(N[0],N[1],N[2]);break;default:P=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=h.color.opaque(P)),L&&(P=h.color.multiplyOpacity(P,u.DIM_OPACITY)),P}_resolveBackgroundRgba(w,R,I){switch(w){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(w,R,I,A){switch(w){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&A&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(w,R,I,A,x,O,D,L,q,G){if(this._config.minimumContrastRatio===1||G)return;const M=this._getContrastCache(q),P=M.getColor(w,A);if(P!==void 0)return P||void 0;const N=this._resolveBackgroundRgba(R,I,D),U=this._resolveForegroundRgba(x,O,D,L),F=h.rgba.ensureContrastRatio(N,U,this._config.minimumContrastRatio/(q?2:1));if(!F)return void M.setColor(w,A,null);const k=h.channels.toColor(F>>24&255,F>>16&255,F>>8&255);return M.setColor(w,A,k),k}_getContrastCache(w){return w?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(w,R,I,A,x=!1){const O=typeof w=="number"?String.fromCharCode(w):w,D=Math.min(this._config.deviceCellWidth*Math.max(O.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const L=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<L&&(this._tmpCanvas.height=L),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=R,this._workAttributeData.extended.ext=A,this._workAttributeData.isInvisible())return m;const q=!!this._workAttributeData.isBold(),G=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),N=!!this._workAttributeData.isUnderline(),U=!!this._workAttributeData.isStrikethrough(),F=!!this._workAttributeData.isOverline();let k=this._workAttributeData.getFgColor(),H=this._workAttributeData.getFgColorMode(),X=this._workAttributeData.getBgColor(),K=this._workAttributeData.getBgColorMode();if(G){const pe=k;k=X,X=pe;const me=H;H=K,K=me}const z=this._getBackgroundColor(K,X,G,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=q?this._config.fontWeightBold:this._config.fontWeight,ne=P?"italic":"";this._tmpCtx.font=`${ne} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=u.TEXT_BASELINE;const Z=O.length===1&&(0,d.isPowerlineGlyph)(O.charCodeAt(0)),J=O.length===1&&(0,d.isRestrictedPowerlineGlyph)(O.charCodeAt(0)),V=this._getForegroundColor(R,K,X,I,H,k,G,M,q,(0,d.treatGlyphAsBackgroundColor)(O.charCodeAt(0)));this._tmpCtx.fillStyle=V.css;const $=J?0:4;let Y=!1;this._config.customGlyphs!==!1&&(Y=(0,c.tryDrawCustomChar)(this._tmpCtx,O,$,$,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Q,j=!Z;if(Q=typeof w=="number"?this._unicodeService.wcwidth(w):this._unicodeService.getStringCellWidth(w),N){this._tmpCtx.save();const pe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),me=pe%2==1?.5:0;if(this._tmpCtx.lineWidth=pe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${p.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let St=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&St<8&&(St+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(St).css}this._tmpCtx.beginPath();const ye=$,we=Math.ceil($+this._config.deviceCharHeight)-me-(x?2*pe:0),Ke=we+pe,lt=we+2*pe;let ct=this._workAttributeData.getUnderlineVariantOffset();for(let St=0;St<Q;St++){this._tmpCtx.save();const _t=ye+St*this._config.deviceCellWidth,nt=ye+(St+1)*this._config.deviceCellWidth,tn=_t+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(_t,we),this._tmpCtx.lineTo(nt,we),this._tmpCtx.moveTo(_t,lt),this._tmpCtx.lineTo(nt,lt);break;case 3:const fn=pe<=1?lt:Math.ceil($+this._config.deviceCharHeight-pe/2)-me,jn=pe<=1?we:Math.ceil($+this._config.deviceCharHeight+pe/2)-me,An=new Path2D;An.rect(_t,we,this._config.deviceCellWidth,lt-we),this._tmpCtx.clip(An),this._tmpCtx.moveTo(_t-this._config.deviceCellWidth/2,Ke),this._tmpCtx.bezierCurveTo(_t-this._config.deviceCellWidth/2,jn,_t,jn,_t,Ke),this._tmpCtx.bezierCurveTo(_t,fn,tn,fn,tn,Ke),this._tmpCtx.bezierCurveTo(tn,jn,nt,jn,nt,Ke),this._tmpCtx.bezierCurveTo(nt,fn,nt+this._config.deviceCellWidth/2,fn,nt+this._config.deviceCellWidth/2,Ke);break;case 4:const xn=ct===0?0:ct>=pe?2*pe-ct:pe-ct;ct>=pe||xn===0?(this._tmpCtx.setLineDash([Math.round(pe),Math.round(pe)]),this._tmpCtx.moveTo(_t+xn,we),this._tmpCtx.lineTo(nt,we)):(this._tmpCtx.setLineDash([Math.round(pe),Math.round(pe)]),this._tmpCtx.moveTo(_t,we),this._tmpCtx.lineTo(_t+xn,we),this._tmpCtx.moveTo(_t+xn+pe,we),this._tmpCtx.lineTo(nt,we)),ct=(0,d.computeNextVariantOffset)(nt-_t,pe,ct);break;case 5:const le=.6,ge=.3,Te=nt-_t,Be=Math.floor(le*Te),Me=Math.floor(ge*Te),at=Te-Be-Me;this._tmpCtx.setLineDash([Be,Me,at]),this._tmpCtx.moveTo(_t,we),this._tmpCtx.lineTo(nt,we);break;default:this._tmpCtx.moveTo(_t,we),this._tmpCtx.lineTo(nt,we)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Y&&this._config.fontSize>=12&&!this._config.allowTransparency&&O!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const St=this._tmpCtx.measureText(O);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in St&&St.actualBoundingBoxDescent>0){this._tmpCtx.save();const _t=new Path2D;_t.rect(ye,we-Math.ceil(pe/2),this._config.deviceCellWidth*Q,lt-we+Math.ceil(pe/2)),this._tmpCtx.clip(_t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(O,$,$+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(F){const pe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),me=pe%2==1?.5:0;this._tmpCtx.lineWidth=pe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo($,$+me),this._tmpCtx.lineTo($+this._config.deviceCharWidth*Q,$+me),this._tmpCtx.stroke()}if(Y||this._tmpCtx.fillText(O,$,$+this._config.deviceCharHeight),O==="_"&&!this._config.allowTransparency){let pe=E(this._tmpCtx.getImageData($,$,this._config.deviceCellWidth,this._config.deviceCellHeight),z,V,j);if(pe)for(let me=1;me<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(O,$,$+this._config.deviceCharHeight-me),pe=E(this._tmpCtx.getImageData($,$,this._config.deviceCellWidth,this._config.deviceCellHeight),z,V,j),pe);me++);}if(U){const pe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),me=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=pe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo($,$+Math.floor(this._config.deviceCharHeight/2)-me),this._tmpCtx.lineTo($+this._config.deviceCharWidth*Q,$+Math.floor(this._config.deviceCharHeight/2)-me),this._tmpCtx.stroke()}this._tmpCtx.restore();const se=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let fe;if(fe=this._config.allowTransparency?function(pe){for(let me=0;me<pe.data.length;me+=4)if(pe.data[me+3]>0)return!1;return!0}(se):E(se,z,V,j),fe)return m;const ae=this._findGlyphBoundingBox(se,this._workBoundingBox,D,J,Y,$);let ce,ue;for(;;){if(this._activePages.length===0){const pe=this._createNewPage();ce=pe,ue=pe.currentRow,ue.height=ae.size.y;break}ce=this._activePages[this._activePages.length-1],ue=ce.currentRow;for(const pe of this._activePages)ae.size.y<=pe.currentRow.height&&(ce=pe,ue=pe.currentRow);for(let pe=this._activePages.length-1;pe>=0;pe--)for(const me of this._activePages[pe].fixedRows)me.height<=ue.height&&ae.size.y<=me.height&&(ce=this._activePages[pe],ue=me);if(ue.y+ae.size.y>=ce.canvas.height||ue.height>ae.size.y+2){let pe=!1;if(ce.currentRow.y+ce.currentRow.height+ae.size.y>=ce.canvas.height){let me;for(const ye of this._activePages)if(ye.currentRow.y+ye.currentRow.height+ae.size.y<ye.canvas.height){me=ye;break}if(me)ce=me;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&ue.y+ae.size.y<=ce.canvas.height&&ue.height>=ae.size.y&&ue.x+ae.size.x<=ce.canvas.width)pe=!0;else{const ye=this._createNewPage();ce=ye,ue=ye.currentRow,ue.height=ae.size.y,pe=!0}}pe||(ce.currentRow.height>0&&ce.fixedRows.push(ce.currentRow),ue={x:0,y:ce.currentRow.y+ce.currentRow.height,height:ae.size.y},ce.fixedRows.push(ue),ce.currentRow={x:0,y:ue.y+ue.height,height:0})}if(ue.x+ae.size.x<=ce.canvas.width)break;ue===ce.currentRow?(ue.x=0,ue.y+=ue.height,ue.height=0):ce.fixedRows.splice(ce.fixedRows.indexOf(ue),1)}return ae.texturePage=this._pages.indexOf(ce),ae.texturePosition.x=ue.x,ae.texturePosition.y=ue.y,ae.texturePositionClipSpace.x=ue.x/ce.canvas.width,ae.texturePositionClipSpace.y=ue.y/ce.canvas.height,ae.sizeClipSpace.x/=ce.canvas.width,ae.sizeClipSpace.y/=ce.canvas.height,ue.height=Math.max(ue.height,ae.size.y),ue.x+=ae.size.x,ce.ctx.putImageData(se,ae.texturePosition.x-this._workBoundingBox.left,ae.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ae.size.x,ae.size.y),ce.addGlyph(ae),ce.version++,ae}_findGlyphBoundingBox(w,R,I,A,x,O){R.top=0;const D=A?this._config.deviceCellHeight:this._tmpCanvas.height,L=A?this._config.deviceCellWidth:I;let q=!1;for(let G=0;G<D;G++){for(let M=0;M<L;M++){const P=G*this._tmpCanvas.width*4+4*M+3;if(w.data[P]!==0){R.top=G,q=!0;break}}if(q)break}R.left=0,q=!1;for(let G=0;G<O+L;G++){for(let M=0;M<D;M++){const P=M*this._tmpCanvas.width*4+4*G+3;if(w.data[P]!==0){R.left=G,q=!0;break}}if(q)break}R.right=L,q=!1;for(let G=O+L-1;G>=O;G--){for(let M=0;M<D;M++){const P=M*this._tmpCanvas.width*4+4*G+3;if(w.data[P]!==0){R.right=G,q=!0;break}}if(q)break}R.bottom=D,q=!1;for(let G=D-1;G>=0;G--){for(let M=0;M<L;M++){const P=G*this._tmpCanvas.width*4+4*M+3;if(w.data[P]!==0){R.bottom=G,q=!0;break}}if(q)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:R.right-R.left+1,y:R.bottom-R.top+1},sizeClipSpace:{x:R.right-R.left+1,y:R.bottom-R.top+1},offset:{x:-R.left+O+(A||x?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-R.top+O+(A||x?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=b;class y{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(w){this._glyphs.push(w),this._usedPixels+=w.size.x*w.size.y}constructor(w,R,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const A of I)this._glyphs.push(...A.glyphs),this._usedPixels+=A._usedPixels;this.canvas=T(w,R,R),this.ctx=(0,d.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function E(C,w,R,I){const A=w.rgba>>>24,x=w.rgba>>>16&255,O=w.rgba>>>8&255,D=R.rgba>>>24,L=R.rgba>>>16&255,q=R.rgba>>>8&255,G=Math.floor((Math.abs(A-D)+Math.abs(x-L)+Math.abs(O-q))/12);let M=!0;for(let P=0;P<C.data.length;P+=4)C.data[P]===A&&C.data[P+1]===x&&C.data[P+2]===O||I&&Math.abs(C.data[P]-A)+Math.abs(C.data[P+1]-x)+Math.abs(C.data[P+2]-O)<G?C.data[P+3]=0:M=!1;return M}function T(C,w,R){const I=C.createElement("canvas");return I.width=w,I.height=R,I}},160:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,c=0,d=0;var h,f,S,_,p;function v(g){const b=g.toString(16);return b.length<2?"0"+b:b}function m(g,b){return g<b?(b+.05)/(g+.05):(g+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(b,y,E,T){return T!==void 0?`#${v(b)}${v(y)}${v(E)}${v(T)}`:`#${v(b)}${v(y)}${v(E)}`},g.toRgba=function(b,y,E,T=255){return(b<<24|y<<16|E<<8|T)>>>0},g.toColor=function(b,y,E,T){return{css:g.toCss(b,y,E,T),rgba:g.toRgba(b,y,E,T)}}}(h||(o.channels=h={})),function(g){function b(y,E){return d=Math.round(255*E),[l,u,c]=p.toChannels(y.rgba),{css:h.toCss(l,u,c,d),rgba:h.toRgba(l,u,c,d)}}g.blend=function(y,E){if(d=(255&E.rgba)/255,d===1)return{css:E.css,rgba:E.rgba};const T=E.rgba>>24&255,C=E.rgba>>16&255,w=E.rgba>>8&255,R=y.rgba>>24&255,I=y.rgba>>16&255,A=y.rgba>>8&255;return l=R+Math.round((T-R)*d),u=I+Math.round((C-I)*d),c=A+Math.round((w-A)*d),{css:h.toCss(l,u,c),rgba:h.toRgba(l,u,c)}},g.isOpaque=function(y){return(255&y.rgba)==255},g.ensureContrastRatio=function(y,E,T){const C=p.ensureContrastRatio(y.rgba,E.rgba,T);if(C)return h.toColor(C>>24&255,C>>16&255,C>>8&255)},g.opaque=function(y){const E=(255|y.rgba)>>>0;return[l,u,c]=p.toChannels(E),{css:h.toCss(l,u,c),rgba:E}},g.opacity=b,g.multiplyOpacity=function(y,E){return d=255&y.rgba,b(y,d*E/255)},g.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}}(f||(o.color=f={})),function(g){let b,y;try{const E=document.createElement("canvas");E.width=1,E.height=1;const T=E.getContext("2d",{willReadFrequently:!0});T&&(b=T,b.globalCompositeOperation="copy",y=b.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return l=parseInt(E.slice(1,2).repeat(2),16),u=parseInt(E.slice(2,3).repeat(2),16),c=parseInt(E.slice(3,4).repeat(2),16),h.toColor(l,u,c);case 5:return l=parseInt(E.slice(1,2).repeat(2),16),u=parseInt(E.slice(2,3).repeat(2),16),c=parseInt(E.slice(3,4).repeat(2),16),d=parseInt(E.slice(4,5).repeat(2),16),h.toColor(l,u,c,d);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const T=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),c=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),h.toColor(l,u,c,d);if(!b||!y)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=y,b.fillStyle=E,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,u,c,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(l,u,c,d),css:E}}}(S||(o.css=S={})),function(g){function b(y,E,T){const C=y/255,w=E/255,R=T/255;return .2126*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.7152*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}g.relativeLuminance=function(y){return b(y>>16&255,y>>8&255,255&y)},g.relativeLuminance2=b}(_||(o.rgb=_={})),function(g){function b(E,T,C){const w=E>>24&255,R=E>>16&255,I=E>>8&255;let A=T>>24&255,x=T>>16&255,O=T>>8&255,D=m(_.relativeLuminance2(A,x,O),_.relativeLuminance2(w,R,I));for(;D<C&&(A>0||x>0||O>0);)A-=Math.max(0,Math.ceil(.1*A)),x-=Math.max(0,Math.ceil(.1*x)),O-=Math.max(0,Math.ceil(.1*O)),D=m(_.relativeLuminance2(A,x,O),_.relativeLuminance2(w,R,I));return(A<<24|x<<16|O<<8|255)>>>0}function y(E,T,C){const w=E>>24&255,R=E>>16&255,I=E>>8&255;let A=T>>24&255,x=T>>16&255,O=T>>8&255,D=m(_.relativeLuminance2(A,x,O),_.relativeLuminance2(w,R,I));for(;D<C&&(A<255||x<255||O<255);)A=Math.min(255,A+Math.ceil(.1*(255-A))),x=Math.min(255,x+Math.ceil(.1*(255-x))),O=Math.min(255,O+Math.ceil(.1*(255-O))),D=m(_.relativeLuminance2(A,x,O),_.relativeLuminance2(w,R,I));return(A<<24|x<<16|O<<8|255)>>>0}g.blend=function(E,T){if(d=(255&T)/255,d===1)return T;const C=T>>24&255,w=T>>16&255,R=T>>8&255,I=E>>24&255,A=E>>16&255,x=E>>8&255;return l=I+Math.round((C-I)*d),u=A+Math.round((w-A)*d),c=x+Math.round((R-x)*d),h.toRgba(l,u,c)},g.ensureContrastRatio=function(E,T,C){const w=_.relativeLuminance(E>>8),R=_.relativeLuminance(T>>8);if(m(w,R)<C){if(R<w){const x=b(E,T,C),O=m(w,_.relativeLuminance(x>>8));if(O<C){const D=y(E,T,C);return O>m(w,_.relativeLuminance(D>>8))?x:D}return x}const I=y(E,T,C),A=m(w,_.relativeLuminance(I>>8));if(A<C){const x=b(E,T,C);return A>m(w,_.relativeLuminance(x>>8))?I:x}return I}},g.reduceLuminance=b,g.increaseLuminance=y,g.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}}(p||(o.rgba=p={})),o.toPaddedHex=v,o.contrastRatio=m},345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===l)return void this._listeners.splice(u,1)}}})),this._event}fire(l,u){const c=[];for(let d=0;d<this._listeners.length;d++)c.push(this._listeners[d]);for(let d=0;d<c.length;d++)c[d].call(void 0,l,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,u){return l(c=>u.fire(c))},o.runAndSubscribe=function(l,u){return u(void 0),l(c=>u(c))}},859:(a,o)=>{function l(u){for(const c of u)c.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const c=this._disposables.indexOf(u);c!==-1&&this._disposables.splice(c,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var c;this._isDisposed||u===this._value||((c=this._value)==null||c.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},485:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(c,d,h){this._data[c]||(this._data[c]={}),this._data[c][d]=h}get(c,d){return this._data[c]?this._data[c][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,c,d,h,f){this._data.get(u,c)||this._data.set(u,c,new l),this._data.get(u,c).set(d,h,f)}get(u,c,d,h){var f;return(f=this._data.get(u,c))==null?void 0:f.get(d,h)}clear(){this._data.clear()}}},399:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const c=l.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},385:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let S=0,_=0,p=f.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),_=Math.max(S,_),v=f.timeRemaining(),1.5*_>v)return p-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-S))}ms`),void this._start();p=v}this.clear()}}class d extends c{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const S=Date.now()+f;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},147:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}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 l;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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{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}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,h=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=h}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},782:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(133),c=l(855),d=l(147);class h extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const _=new h;return _.setFromCharData(S),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(S[c.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(S[c.CHAR_DATA_CHAR_INDEX].length===2){const p=S[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const v=S[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(p-55296)+v-56320+65536|S[c.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=S[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[c.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=S[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=h},855:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},133:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,c=l.length){let d="";for(let h=u;h<c;++h){let f=l[h];f>65535?(f-=65536,d+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):d+=String.fromCharCode(f)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const c=l.length;if(!c)return 0;let d=0,h=0;if(this._interim){const f=l.charCodeAt(h++);56320<=f&&f<=57343?u[d++]=1024*(this._interim-55296)+f-56320+65536:(u[d++]=this._interim,u[d++]=f),this._interim=0}for(let f=h;f<c;++f){const S=l.charCodeAt(f);if(55296<=S&&S<=56319){if(++f>=c)return this._interim=S,d;const _=l.charCodeAt(f);56320<=_&&_<=57343?u[d++]=1024*(S-55296)+_-56320+65536:(u[d++]=S,u[d++]=_)}else S!==65279&&(u[d++]=S)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const c=l.length;if(!c)return 0;let d,h,f,S,_=0,p=0,v=0;if(this.interim[0]){let b=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let E,T=0;for(;(E=63&this.interim[++T])&&T<4;)y<<=6,y|=E;const C=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,w=C-T;for(;v<w;){if(v>=c)return 0;if(E=l[v++],(192&E)!=128){v--,b=!0;break}this.interim[T++]=E,y<<=6,y|=63&E}b||(C===2?y<128?v--:u[_++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(u[_++]=y):y<65536||y>1114111||(u[_++]=y)),this.interim.fill(0)}const m=c-4;let g=v;for(;g<c;){for(;!(!(g<m)||128&(d=l[g])||128&(h=l[g+1])||128&(f=l[g+2])||128&(S=l[g+3]));)u[_++]=d,u[_++]=h,u[_++]=f,u[_++]=S,g+=4;if(d=l[g++],d<128)u[_++]=d;else if((224&d)==192){if(g>=c)return this.interim[0]=d,_;if(h=l[g++],(192&h)!=128){g--;continue}if(p=(31&d)<<6|63&h,p<128){g--;continue}u[_++]=p}else if((240&d)==224){if(g>=c)return this.interim[0]=d,_;if(h=l[g++],(192&h)!=128){g--;continue}if(g>=c)return this.interim[0]=d,this.interim[1]=h,_;if(f=l[g++],(192&f)!=128){g--;continue}if(p=(15&d)<<12|(63&h)<<6|63&f,p<2048||p>=55296&&p<=57343||p===65279)continue;u[_++]=p}else if((248&d)==240){if(g>=c)return this.interim[0]=d,_;if(h=l[g++],(192&h)!=128){g--;continue}if(g>=c)return this.interim[0]=d,this.interim[1]=h,_;if(f=l[g++],(192&f)!=128){g--;continue}if(g>=c)return this.interim[0]=d,this.interim[1]=h,this.interim[2]=f,_;if(S=l[g++],(192&S)!=128){g--;continue}if(p=(7&d)<<18|(63&h)<<12|(63&f)<<6|63&S,p<65536||p>1114111)continue;u[_++]=p}}return _}}},776:function(a,o,l){var u=this&&this.__decorate||function(p,v,m,g){var b,y=arguments.length,E=y<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(p,v,m,g);else for(var T=p.length-1;T>=0;T--)(b=p[T])&&(E=(y<3?b(E):y>3?b(v,m,E):b(v,m))||E);return y>3&&E&&Object.defineProperty(v,m,E),E},c=this&&this.__param||function(p,v){return function(m,g){v(m,g,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(859),h=l(97),f={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF};let S,_=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let v=0;v<p.length;v++)typeof p[v]=="function"&&(p[v]=p[v]())}_log(p,v,m){this._evalLazyOptionalParams(m),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...m)}trace(p,...v){var m;this._logLevel<=h.LogLevelEnum.TRACE&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.trace.bind(this._optionsService.options.logger))??console.log,p,v)}debug(p,...v){var m;this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.debug.bind(this._optionsService.options.logger))??console.log,p,v)}info(p,...v){var m;this._logLevel<=h.LogLevelEnum.INFO&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.info.bind(this._optionsService.options.logger))??console.info,p,v)}warn(p,...v){var m;this._logLevel<=h.LogLevelEnum.WARN&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.warn.bind(this._optionsService.options.logger))??console.warn,p,v)}error(p,...v){var m;this._logLevel<=h.LogLevelEnum.ERROR&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.error.bind(this._optionsService.options.logger))??console.error,p,v)}};o.LogService=_=u([c(0,h.IOptionsService)],_),o.setTraceLogger=function(p){S=p},o.traceCall=function(p,v,m){if(typeof m.value!="function")throw new Error("not supported");const g=m.value;m.value=function(...b){if(S.logLevel!==h.LogLevelEnum.TRACE)return g.apply(this,b);S.trace(`GlyphRenderer#${g.name}(${b.map(E=>JSON.stringify(E)).join(", ")})`);const y=g.apply(this,b);return S.trace(`GlyphRenderer#${g.name} return`,y),y}}},726:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(c){return c[u]||[]},o.createDecorator=function(c){if(o.serviceRegistry.has(c))return o.serviceRegistry.get(c);const d=function(h,f,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,p,v){p[l]===p?p[u].push({id:_,index:v}):(p[u]=[{id:_,index:v}],p[l]=p)})(d,h,S)};return d.toString=()=>c,o.serviceRegistry.set(c,d),d}},97:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(726);var c;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.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"}(c||(o.LogLevelEnum=c={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")}},i={};function r(a){var o=i[a];if(o!==void 0)return o.exports;var l=i[a]={exports:{}};return n[a].call(l.exports,l,l.exports,r),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.WebglAddon=void 0;const o=r(345),l=r(859),u=r(399),c=r(666),d=r(776);class h extends l.Disposable{constructor(S){if(u.isSafari&&(0,u.getSafariVersion)()<16){const _={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",_))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=S,this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(S){const _=S._core;if(!S.element)return void this.register(_.onWillOpen(()=>this.activate(S)));this._terminal=S;const p=_.coreService,v=_.optionsService,m=_,g=m._renderService,b=m._characterJoinerService,y=m._charSizeService,E=m._coreBrowserService,T=m._decorationService,C=m._logService,w=m._themeService;(0,d.setTraceLogger)(C),this._renderer=this.register(new c.WebglRenderer(S,b,y,E,p,T,v,w,this._preserveDrawingBuffer)),this.register((0,o.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,o.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),g.setRenderer(this._renderer),this.register((0,l.toDisposable)(()=>{const R=this._terminal._core._renderService;R.setRenderer(this._terminal._core._createRenderer()),R.handleResize(S.cols,S.rows)}))}get textureAtlas(){var S;return(S=this._renderer)==null?void 0:S.textureAtlas}clearTextureAtlas(){var S;(S=this._renderer)==null||S.clearTextureAtlas()}}a.WebglAddon=h})(),s})())}(HR)),HR.exports}var EPe=bPe();const yPe={ref:"terminal",class:"terminal-container"},CPe=Qe({__name:"FullScreenTerminal",emits:["load"],setup(t,{emit:e}){const n=MS("terminal"),i=e;return ai(()=>{const r=new gPe.Terminal({fontFamily:"monospace"}),s=new SPe.FitAddon,a=new EPe.WebglAddon;r.loadAddon(s),r.loadAddon(a),r.open(n.value),s.fit();const o=new ResizeObserver(()=>{s.fit()});o.observe(n.value),i("load",r),$a(()=>{o.disconnect(),r.dispose()})}),(r,s)=>(_e(),Ge("div",yPe,null,512))}}),q9=Zn(CPe,[["__scopeId","data-v-938fdbc7"]]);var VR={exports:{}},yV;function TPe(){return yV||(yV=1,function(t,e){(function(n,i){t.exports=i()})(self,()=>(()=>{var n={};return(()=>{var i=n;function r(s,a,o){return s.addEventListener(a,o),{dispose:()=>{o&&s.removeEventListener(a,o)}}}Object.defineProperty(i,"__esModule",{value:!0}),i.AttachAddon=void 0,i.AttachAddon=class{constructor(s,a){this._disposables=[],this._socket=s,this._socket.binaryType="arraybuffer",this._bidirectional=!(a&&a.bidirectional===!1)}activate(s){this._disposables.push(r(this._socket,"message",a=>{const o=a.data;s.write(typeof o=="string"?o:new Uint8Array(o))})),this._bidirectional&&(this._disposables.push(s.onData(a=>this._sendData(a))),this._disposables.push(s.onBinary(a=>this._sendBinary(a)))),this._disposables.push(r(this._socket,"close",()=>this.dispose())),this._disposables.push(r(this._socket,"error",()=>this.dispose()))}dispose(){for(const s of this._disposables)s.dispose()}_sendData(s){this._checkOpenSocket()&&this._socket.send(s)}_sendBinary(s){if(!this._checkOpenSocket())return;const a=new Uint8Array(s.length);for(let o=0;o<s.length;++o)a[o]=255&s.charCodeAt(o);this._socket.send(a)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),n})())}(VR)),VR.exports}var wPe=TPe();const RPe=Wa({name:"terminal",getStoreId:(t,e,n)=>`projects/${t}/instances/${e}/terminals/${n}`,create:({storeId:t,id:[e,n,i]})=>As(t,()=>({connectTerminal:s=>{const a=new WebSocket(`ws://localhost:3000/projects/${e}/instances/${n}/terminalSessions/${i}`),o=new wPe.AttachAddon(a);s.loadAddon(o)}}))}),APe=Qe({__name:"InstanceTerminal",props:{projectId:{},instanceId:{},sessionId:{}},setup(t){const e=RPe(t.projectId,t.instanceId,t.sessionId),n=i=>{e.connectTerminal(i)};return(i,r)=>{const s=q9;return _e(),xe(s,{onLoad:n})}}}),OPe=Qe({__name:"TerminalPanel",props:{params:{}},setup(t){return(e,n)=>{const i=APe;return _e(),xe(i,{"project-id":e.params.params.projectId,"instance-id":e.params.params.instanceId,"session-id":e.params.params.sessionId},null,8,["project-id","instance-id","session-id"])}}}),IPe=Wa({name:"logs",getStoreId:(t,e)=>`operations/${t}/instances/${e}/logs`,create:({storeId:t,id:[e,n],onDeactivated:i})=>As(t,()=>{const{$client:r}=wn(),s=ve([]);return{lines:s,loadLogsToTerminal:async o=>{const l=c=>{for(const d of c.split(`
242
242
  `))o.writeln(d)};s.value=await r.logs.getInstanceLogs.query({operationId:e,instanceId:n});for(const c of s.value)l(c);const{unsubscribe:u}=r.logs.watchInstanceLogs.subscribe({operationId:e,instanceId:n},{onData(c){s.value.push(c),l(c)}});i(u)}}})}),NPe=Qe({__name:"LogsTerminal",props:{operationId:{},instanceId:{}},setup(t){const e=IPe(t.operationId,t.instanceId),n=i=>{e.loadLogsToTerminal(i)};return(i,r)=>{const s=q9;return _e(),xe(s,{onLoad:n})}}}),xPe=Qe({__name:"LogsPanel",props:{params:{}},setup(t){return(e,n)=>{const i=NPe;return _e(),xe(i,{"operation-id":e.params.params.operationId,"instance-id":e.params.params.instanceId},null,8,["operation-id","instance-id"])}}});function DPe(t){return t.status!=="completed"&&t.status!=="failed"&&t.status!=="cancelled"}const kPe={class:"d-flex w-100"},MPe={class:"d-flex"},LPe={class:"d-flex ml-auto"},PPe=Qe({__name:"OperationCard",props:{operation:{}},setup(t){const e=te(()=>{switch(t.operation.status){case"completed":return"mdi-check";case"failed":case"cancelled":return"mdi-close";default:return""}}),n=te(()=>{switch(t.operation.status){case"pending":case"evaluating":return"primary";case"running":return"info";case"completed":return"success";case"failed":case"cancelled":return"error";default:return""}}),i=te(()=>{switch(t.operation.type){case"update":return"success";case"destroy":return"error";case"recreate":return"warning";case"refresh":case"evaluate":return"info";default:return""}});return(r,s)=>(_e(),xe(Is,{subtitle:r.operation.status,width:360,class:"operation-card",color:"#2d2d2d",variant:"flat",style:{"border-radius":"4px"}},{title:be(()=>[Gt("div",kPe,[Gt("div",MPe,Mn(r.operation.id.slice(0,8)),1),Gt("div",LPe,[W(No,{color:ie(i)},{default:be(()=>[Tt(Mn(r.operation.type),1)]),_:1},8,["color"])])])]),prepend:be(()=>[("isOperationRunning"in r?r.isOperationRunning:ie(DPe))(r.operation)?(_e(),xe(gq,{key:0,class:"mr-1",color:ie(n),indeterminate:"",size:"24"},null,8,["color"])):(_e(),xe(Ot,{key:1,color:ie(n)},{default:be(()=>[Tt(Mn(ie(e)),1)]),_:1},8,["color"]))]),_:1},8,["subtitle"]))}}),BPe=Zn(PPe,[["__scopeId","data-v-9a058856"]]),FPe={key:0,class:"d-flex flex-column pl-4 pr-4 gr-4 pt-4 align-center sidebar-container"},UPe={key:0,class:"d-flex text-disabled text-subtitle-1",style:{"line-height":"1"}},$Pe={key:1,class:"d-flex text-disabled text-subtitle-1",style:{"line-height":"1"}},GPe={class:"d-flex flex-column gr-4 operation-list-container"},HPe={key:1,class:"mt-4 text-center text-uppercase"},VPe=Qe({__name:"OperationList",props:{projectId:{}},setup(t){const{stateStore:e,operationsStore:n,secretsStore:i}=_0e(t.projectId),r=async()=>{await n.launchOperation({projectId:t.projectId,type:"update",instanceIds:e.instancesToAutoUpdate.map(s=>s.id)})};return(s,a)=>{const o=BPe;return ie(i).isLocked?(_e(),Ge("div",HPe,"The project is locked")):(_e(),Ge("div",FPe,[W(Sn,{"prepend-icon":"mdi-auto-fix",color:"primary",size:"large",width:"360px",disabled:ie(e).instancesToAutoUpdate.length===0,onClick:r},{default:be(()=>[Gt("div",null,[a[0]||(a[0]=Gt("div",{class:"d-flex",style:{"line-height":"1"}},"auto update",-1)),ie(e).instancesToAutoUpdate.length>0?(_e(),Ge("div",UPe,Mn(ie(e).instancesToAutoUpdate.length)+" component(s) ",1)):(_e(),Ge("div",$Pe," nothing to update "))])]),_:1},8,["disabled"]),Gt("div",GPe,[(_e(!0),Ge(He,null,Or(ie(n).operations,l=>(_e(),xe(o,{key:l.id,operation:l},null,8,["operation"]))),128))])]))}}}),zPe=Zn(VPe,[["__scopeId","data-v-1e9cc7f5"]]),qPe={key:1,class:"mt-4 text-center text-uppercase"},YPe=Qe({__name:"OperationListPanel",setup(t){const e=nb();return(n,i)=>{const r=zPe;return ie(e).focusedProjectId?(_e(),xe(r,{key:ie(e).focusedProjectId,"project-id":ie(e).focusedProjectId},null,8,["project-id"])):(_e(),Ge("div",qPe,"No active project"))}}}),WPe={class:"dv-default-tab"},KPe={class:"dv-default-tab-content"},jPe=Qe({__name:"CustomTab",props:{params:{}},setup(t){return(e,n)=>(_e(),Ge("div",WPe,[e.params.params.icon?(_e(),xe(Ot,{key:0},{default:be(()=>[Tt(Mn(e.params.params.icon),1)]),_:1})):mt("",!0),Gt("div",KPe,Mn(e.params.params.title),1),e.params.params.closable?(_e(),Ge("div",{key:1,class:"dv-default-tab-action",onClick:n[0]||(n[0]=i=>e.params.api.close())},n[1]||(n[1]=[Gt("svg",{height:"11",width:"11",viewBox:"0 0 28 28","aria-hidden":"false",focusable:"false",class:"dv-svg"},[Gt("path",{d:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"})],-1)]))):mt("",!0)]))}}),QPe=Qe({__name:"LayoutResetButton",props:{params:{}},setup(t){const e=Su(),n=ve(!1);return $t(()=>{n.value=t.params.group.model.panels.some(i=>i.id==="project-list")}),(i,r)=>ie(n)?(_e(),xe(Sn,{key:0,variant:"text",size:"small",class:"toolbar-button ma-1",onClick:r[0]||(r[0]=s=>ie(e).resetLayout())},{default:be(()=>[W(Ot,null,{default:be(()=>r[1]||(r[1]=[Tt("mdi-window-restore")])),_:1}),W(bK,{activator:"parent",location:"bottom"},{default:be(()=>r[2]||(r[2]=[Tt("Reset Layout")])),_:1})]),_:1})):mt("",!0)}}),XPe=Zn(QPe,[["__scopeId","data-v-6df1353d"]]),ZPe=Qe({components:{ProjectListPanel:Jle,ProjectPanel:ELe,ComponentList:_Pe,TerminalPanel:OPe,LogsPanel:xPe,OperationListPanel:YPe,CompositeInstancePanel:uPe,CustomTab:jPe,LayoutResetButton:XPe},__name:"app",async setup(t){let e,n;const i=wu();[e,n]=YI(()=>i.loadLibrary()),await e,n();const r=Su(),s=ve(!1),a=o=>{r.init(o.api),r.loadLayout().finally(()=>{s.value=!0})};return(o,l)=>(_e(),Ge("div",{style:wi({display:ie(s)?"block":"none"})},[W(ie(Moe),{class:"dockview-container dockview-theme-dark","right-header-actions-component":"LayoutResetButton",onReady:a})],4))}}),JPe=Zn(ZPe,[["__scopeId","data-v-8811e678"]]),eBe={__name:"nuxt-error-page",props:{error:Object},setup(t){const n=t.error;n.stack&&n.stack.split(`
243
243
  `).splice(1).map(d=>({text:d.replace("webpack:/","").replace(".vue",".js").trim(),internal:d.includes("node_modules")&&!d.includes(".cache")||d.includes("internal")||d.includes("new Promise")})).map(d=>`<span class="stack${d.internal?" internal":""}">${d.text}</span>`).join(`
244
- `);const i=Number(n.statusCode||500),r=i===404,s=n.statusMessage??(r?"Page Not Found":"Internal Server Error"),a=n.message||n.toString(),o=void 0,c=r?MD(()=>A1(()=>import("./BzpzT3Fy.js"),__vite__mapDeps([0,1,2]),import.meta.url)):MD(()=>A1(()=>import("./C97RHzKR.js"),__vite__mapDeps([3,1,4]),import.meta.url));return(d,h)=>(_e(),xe(ie(c),Mg(Vg({statusCode:ie(i),statusMessage:ie(s),description:ie(a),stack:ie(o)})),null,16))}},tBe={key:0},CV={__name:"nuxt-root",setup(t){const e=()=>null,n=wn(),i=n.deferHydration();if(n.isHydrating){const l=n.hooks.hookOnce("app:error",i);tu().beforeEach(l)}const r=!1;Kn(O3,I3()),n.hooks.callHookWith(l=>l.map(u=>u()),"vue:setup");const s=tN(),a=!1;S5((l,u,c)=>{if(n.hooks.callHook("vue:error",l,u,c).catch(d=>console.error("[nuxt] Error in `vue:error` hook",d)),Eee(l)&&(l.fatal||l.unhandled))return n.runWithContext(()=>See(l)),!1});const o=!1;return(l,u)=>(_e(),xe(jI,{onResolve:ie(i)},{default:be(()=>[ie(a)?(_e(),Ge("div",tBe)):ie(s)?(_e(),xe(ie(eBe),{key:1,error:ie(s)},null,8,["error"])):ie(o)?(_e(),xe(ie(e),{key:2,context:ie(o)},null,8,["context"])):ie(r)?(_e(),xe(BS(ie(r)),{key:3})):(_e(),xe(ie(JPe),{key:4}))]),_:1},8,["onResolve"]))}};let TV;{let t;TV=async function(){var a,o;if(t)return t;const i=!!(((a=window.__NUXT__)==null?void 0:a.serverRendered)??((o=document.getElementById("__NUXT_DATA__"))==null?void 0:o.dataset.ssr)==="true")?WZ(CV):YZ(CV),r=nee({vueApp:i});async function s(l){await r.callHook("app:error",l),r.payload.error=r.payload.error||zS(l)}i.config.errorHandler=s,r.hook("app:suspense:resolve",()=>{i.config.errorHandler===s&&(i.config.errorHandler=void 0)});try{await see(r,Cse)}catch(l){s(l)}try{await r.hooks.callHook("app:created",i),await r.hooks.callHook("app:beforeMount",i),i.mount(JJ),await r.hooks.callHook("app:mounted",i),await $t()}catch(l){s(l)}return i},t=TV().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{be as A,Tt as B,rBe as C,Wr as D,SA as E,Ie as F,LS as G,bX as H,_i as I,Zn as _,wn as a,pN as b,K1 as c,Qe as d,Yi as e,sBe as f,b5 as g,Bt as h,vee as i,te as j,Kd as k,VS as l,yd as m,gee as n,ai as o,h3 as p,JI as q,ve as r,iBe as s,Ge as t,tu as u,_e as v,cA as w,Gt as x,Mn as y,W as z};
244
+ `);const i=Number(n.statusCode||500),r=i===404,s=n.statusMessage??(r?"Page Not Found":"Internal Server Error"),a=n.message||n.toString(),o=void 0,c=r?MD(()=>A1(()=>import("./DJMH00PF.js"),__vite__mapDeps([0,1,2]),import.meta.url)):MD(()=>A1(()=>import("./Dy9sUyql.js"),__vite__mapDeps([3,1,4]),import.meta.url));return(d,h)=>(_e(),xe(ie(c),Mg(Vg({statusCode:ie(i),statusMessage:ie(s),description:ie(a),stack:ie(o)})),null,16))}},tBe={key:0},CV={__name:"nuxt-root",setup(t){const e=()=>null,n=wn(),i=n.deferHydration();if(n.isHydrating){const l=n.hooks.hookOnce("app:error",i);tu().beforeEach(l)}const r=!1;Kn(O3,I3()),n.hooks.callHookWith(l=>l.map(u=>u()),"vue:setup");const s=tN(),a=!1;S5((l,u,c)=>{if(n.hooks.callHook("vue:error",l,u,c).catch(d=>console.error("[nuxt] Error in `vue:error` hook",d)),Eee(l)&&(l.fatal||l.unhandled))return n.runWithContext(()=>See(l)),!1});const o=!1;return(l,u)=>(_e(),xe(jI,{onResolve:ie(i)},{default:be(()=>[ie(a)?(_e(),Ge("div",tBe)):ie(s)?(_e(),xe(ie(eBe),{key:1,error:ie(s)},null,8,["error"])):ie(o)?(_e(),xe(ie(e),{key:2,context:ie(o)},null,8,["context"])):ie(r)?(_e(),xe(BS(ie(r)),{key:3})):(_e(),xe(ie(JPe),{key:4}))]),_:1},8,["onResolve"]))}};let TV;{let t;TV=async function(){var a,o;if(t)return t;const i=!!(((a=window.__NUXT__)==null?void 0:a.serverRendered)??((o=document.getElementById("__NUXT_DATA__"))==null?void 0:o.dataset.ssr)==="true")?WZ(CV):YZ(CV),r=nee({vueApp:i});async function s(l){await r.callHook("app:error",l),r.payload.error=r.payload.error||zS(l)}i.config.errorHandler=s,r.hook("app:suspense:resolve",()=>{i.config.errorHandler===s&&(i.config.errorHandler=void 0)});try{await see(r,Cse)}catch(l){s(l)}try{await r.hooks.callHook("app:created",i),await r.hooks.callHook("app:beforeMount",i),i.mount(JJ),await r.hooks.callHook("app:mounted",i),await $t()}catch(l){s(l)}return i},t=TV().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{be as A,Tt as B,rBe as C,Wr as D,SA as E,Ie as F,LS as G,bX as H,_i as I,Zn as _,wn as a,pN as b,K1 as c,Qe as d,Yi as e,sBe as f,b5 as g,Bt as h,vee as i,te as j,Kd as k,VS as l,yd as m,gee as n,ai as o,h3 as p,JI as q,ve as r,iBe as s,Ge as t,tu as u,_e as v,cA as w,Gt as x,Mn as y,W as z};